diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 21:19:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 21:19:05 -0400 |
commit | 61464c8357c8f6b780e4c44f5c79471799c51ca7 (patch) | |
tree | 4509cf075403965528f380f2f825c46908fb7d4e | |
parent | 47061eda2584b9e4516d1e3a9713406a3a559ac8 (diff) | |
parent | 9cf1c871526cf6bfec2a653e1e068ee72592542c (diff) |
Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM soc general cleanups from Olof Johansson:
"This is a large branch that contains a handful of different cleanups:
- Fixing up the I/O space remapping on PCI on ARM. This is a series
from Rob Herring that restructures how all pci devices allocate I/O
space, and it's part of the work to allow multiplatform kernels.
- A number of cleanup series for OMAP, moving and removing some
headers, sparse irq rework and in general preparation for
multiplatform.
- Final removal of all non-DT boards for Tegra, it is now
device-tree-only!
- Removal of a stale platform, nxp4008. It's an old mobile chipset
that is no longer in use, and was very likely never really used
with a mainline kernel. We have not been able to find anyone
interested in keeping it around in the kernel.
- Removal of the legacy dmaengine driver on tegra
+ A handful of other things that I haven't described above."
Fix up some conflicts with the staging tree (and because nxp4008 was
removed)
* tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (184 commits)
ARM: OMAP2+: serial: Change MAX_HSUART_PORTS to 6
ARM: OMAP4: twl-common: Support for additional devices on i2c1 bus
ARM: mmp: using for_each_set_bit to simplify the code
ARM: tegra: harmony: fix ldo7 regulator-name
ARM: OMAP2+: Make omap4-keypad.h local
ARM: OMAP2+: Make l4_3xxx.h local
ARM: OMAP2+: Make l4_2xxx.h local
ARM: OMAP2+: Make l3_3xxx.h local
ARM: OMAP2+: Make l3_2xxx.h local
ARM: OMAP1: Move irda.h from plat to mach
ARM: OMAP2+: Make hdq1w.h local
ARM: OMAP2+: Make gpmc-smsc911x.h local
ARM: OMAP2+: Make gpmc-smc91x.h local
ARM: OMAP1: Move flash.h from plat to mach
ARM: OMAP2+: Make debug-devices.h local
ARM: OMAP1: Move board-voiceblue.h from plat to mach
ARM: OMAP1: Move board-sx1.h from plat to mach
ARM: OMAP2+: Make omap-wakeupgen.h local
ARM: OMAP2+: Make omap-secure.h local
ARM: OMAP2+: Make ctrl_module_wkup_44xx.h local
...
623 files changed, 4618 insertions, 15490 deletions
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt index 816d6071669e..8b46c79679c4 100644 --- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt +++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | S3C2410 GPIO Control | 1 | S3C24XX GPIO Control |
2 | ==================== | 2 | ==================== |
3 | 3 | ||
4 | Introduction | 4 | Introduction |
@@ -12,7 +12,7 @@ Introduction | |||
12 | of the s3c2410 GPIO system, please read the Samsung provided | 12 | of the s3c2410 GPIO system, please read the Samsung provided |
13 | data-sheet/users manual to find out the complete list. | 13 | data-sheet/users manual to find out the complete list. |
14 | 14 | ||
15 | See Documentation/arm/Samsung/GPIO.txt for the core implemetation. | 15 | See Documentation/arm/Samsung/GPIO.txt for the core implementation. |
16 | 16 | ||
17 | 17 | ||
18 | GPIOLIB | 18 | GPIOLIB |
@@ -41,8 +41,8 @@ GPIOLIB | |||
41 | GPIOLIB conversion | 41 | GPIOLIB conversion |
42 | ------------------ | 42 | ------------------ |
43 | 43 | ||
44 | If you need to convert your board or driver to use gpiolib from the exiting | 44 | If you need to convert your board or driver to use gpiolib from the phased |
45 | s3c2410 api, then here are some notes on the process. | 45 | out s3c2410 API, then here are some notes on the process. |
46 | 46 | ||
47 | 1) If your board is exclusively using an GPIO, say to control peripheral | 47 | 1) If your board is exclusively using an GPIO, say to control peripheral |
48 | power, then it will require to claim the gpio with gpio_request() before | 48 | power, then it will require to claim the gpio with gpio_request() before |
@@ -55,7 +55,7 @@ s3c2410 api, then here are some notes on the process. | |||
55 | as they have the same arguments, and can either take the pin specific | 55 | as they have the same arguments, and can either take the pin specific |
56 | values, or the more generic special-function-number arguments. | 56 | values, or the more generic special-function-number arguments. |
57 | 57 | ||
58 | 3) s3c2410_gpio_pullup() changs have the problem that whilst the | 58 | 3) s3c2410_gpio_pullup() changes have the problem that whilst the |
59 | s3c2410_gpio_pullup(x, 1) can be easily translated to the | 59 | s3c2410_gpio_pullup(x, 1) can be easily translated to the |
60 | s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0) | 60 | s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0) |
61 | are not so easy. | 61 | are not so easy. |
@@ -74,7 +74,7 @@ s3c2410 api, then here are some notes on the process. | |||
74 | when using gpio_get_value() on an output pin (s3c2410_gpio_getpin | 74 | when using gpio_get_value() on an output pin (s3c2410_gpio_getpin |
75 | would return the value the pin is supposed to be outputting). | 75 | would return the value the pin is supposed to be outputting). |
76 | 76 | ||
77 | 6) s3c2410_gpio_getirq() should be directly replacable with the | 77 | 6) s3c2410_gpio_getirq() should be directly replaceable with the |
78 | gpio_to_irq() call. | 78 | gpio_to_irq() call. |
79 | 79 | ||
80 | The s3c2410_gpio and gpio_ calls have always operated on the same gpio | 80 | The s3c2410_gpio and gpio_ calls have always operated on the same gpio |
@@ -105,7 +105,7 @@ PIN Numbers | |||
105 | ----------- | 105 | ----------- |
106 | 106 | ||
107 | Each pin has an unique number associated with it in regs-gpio.h, | 107 | Each pin has an unique number associated with it in regs-gpio.h, |
108 | eg S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell | 108 | e.g. S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell |
109 | the GPIO functions which pin is to be used. | 109 | the GPIO functions which pin is to be used. |
110 | 110 | ||
111 | With the conversion to gpiolib, there is no longer a direct conversion | 111 | With the conversion to gpiolib, there is no longer a direct conversion |
@@ -120,31 +120,27 @@ Configuring a pin | |||
120 | The following function allows the configuration of a given pin to | 120 | The following function allows the configuration of a given pin to |
121 | be changed. | 121 | be changed. |
122 | 122 | ||
123 | void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); | 123 | void s3c_gpio_cfgpin(unsigned int pin, unsigned int function); |
124 | 124 | ||
125 | Eg: | 125 | e.g.: |
126 | 126 | ||
127 | s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0); | 127 | s3c_gpio_cfgpin(S3C2410_GPA(0), S3C_GPIO_SFN(1)); |
128 | s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1); | 128 | s3c_gpio_cfgpin(S3C2410_GPE(8), S3C_GPIO_SFN(2)); |
129 | 129 | ||
130 | which would turn GPA(0) into the lowest Address line A0, and set | 130 | which would turn GPA(0) into the lowest Address line A0, and set |
131 | GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line. | 131 | GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line. |
132 | 132 | ||
133 | The s3c_gpio_cfgpin() call is a functional replacement for this call. | ||
134 | |||
135 | 133 | ||
136 | Reading the current configuration | 134 | Reading the current configuration |
137 | --------------------------------- | 135 | --------------------------------- |
138 | 136 | ||
139 | The current configuration of a pin can be read by using: | 137 | The current configuration of a pin can be read by using standard |
138 | gpiolib function: | ||
140 | 139 | ||
141 | s3c2410_gpio_getcfg(unsigned int pin); | 140 | s3c_gpio_getcfg(unsigned int pin); |
142 | 141 | ||
143 | The return value will be from the same set of values which can be | 142 | The return value will be from the same set of values which can be |
144 | passed to s3c2410_gpio_cfgpin(). | 143 | passed to s3c_gpio_cfgpin(). |
145 | |||
146 | The s3c_gpio_getcfg() call should be a functional replacement for | ||
147 | this call. | ||
148 | 144 | ||
149 | 145 | ||
150 | Configuring a pull-up resistor | 146 | Configuring a pull-up resistor |
@@ -154,61 +150,33 @@ Configuring a pull-up resistor | |||
154 | pull-up resistors enabled. This can be configured by the following | 150 | pull-up resistors enabled. This can be configured by the following |
155 | function: | 151 | function: |
156 | 152 | ||
157 | void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); | 153 | void s3c_gpio_setpull(unsigned int pin, unsigned int to); |
158 | |||
159 | Where the to value is zero to set the pull-up off, and 1 to enable | ||
160 | the specified pull-up. Any other values are currently undefined. | ||
161 | |||
162 | The s3c_gpio_setpull() offers similar functionality, but with the | ||
163 | ability to encode whether the pull is up or down. Currently there | ||
164 | is no 'just on' state, so up or down must be selected. | ||
165 | |||
166 | |||
167 | Getting the state of a PIN | ||
168 | -------------------------- | ||
169 | |||
170 | The state of a pin can be read by using the function: | ||
171 | |||
172 | unsigned int s3c2410_gpio_getpin(unsigned int pin); | ||
173 | 154 | ||
174 | This will return either zero or non-zero. Do not count on this | 155 | Where the to value is S3C_GPIO_PULL_NONE to set the pull-up off, |
175 | function returning 1 if the pin is set. | 156 | and S3C_GPIO_PULL_UP to enable the specified pull-up. Any other |
157 | values are currently undefined. | ||
176 | 158 | ||
177 | This call is now implemented by the relevant gpiolib calls, convert | ||
178 | your board or driver to use gpiolib. | ||
179 | |||
180 | |||
181 | Setting the state of a PIN | ||
182 | -------------------------- | ||
183 | |||
184 | The value an pin is outputing can be modified by using the following: | ||
185 | 159 | ||
186 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); | 160 | Getting and setting the state of a PIN |
161 | -------------------------------------- | ||
187 | 162 | ||
188 | Which sets the given pin to the value. Use 0 to write 0, and 1 to | 163 | These calls are now implemented by the relevant gpiolib calls, convert |
189 | set the output to 1. | ||
190 | |||
191 | This call is now implemented by the relevant gpiolib calls, convert | ||
192 | your board or driver to use gpiolib. | 164 | your board or driver to use gpiolib. |
193 | 165 | ||
194 | 166 | ||
195 | Getting the IRQ number associated with a PIN | 167 | Getting the IRQ number associated with a PIN |
196 | -------------------------------------------- | 168 | -------------------------------------------- |
197 | 169 | ||
198 | The following function can map the given pin number to an IRQ | 170 | A standard gpiolib function can map the given pin number to an IRQ |
199 | number to pass to the IRQ system. | 171 | number to pass to the IRQ system. |
200 | 172 | ||
201 | int s3c2410_gpio_getirq(unsigned int pin); | 173 | int gpio_to_irq(unsigned int pin); |
202 | 174 | ||
203 | Note, not all pins have an IRQ. | 175 | Note, not all pins have an IRQ. |
204 | 176 | ||
205 | This call is now implemented by the relevant gpiolib calls, convert | ||
206 | your board or driver to use gpiolib. | ||
207 | |||
208 | 177 | ||
209 | Authour | 178 | Author |
210 | ------- | 179 | ------- |
211 | 180 | ||
212 | |||
213 | Ben Dooks, 03 October 2004 | 181 | Ben Dooks, 03 October 2004 |
214 | Copyright 2004 Ben Dooks, Simtec Electronics | 182 | Copyright 2004 Ben Dooks, Simtec Electronics |
diff --git a/Documentation/arm/Samsung/GPIO.txt b/Documentation/arm/Samsung/GPIO.txt index 513f2562c1a3..795adfd88081 100644 --- a/Documentation/arm/Samsung/GPIO.txt +++ b/Documentation/arm/Samsung/GPIO.txt | |||
@@ -5,14 +5,14 @@ Introduction | |||
5 | ------------ | 5 | ------------ |
6 | 6 | ||
7 | This outlines the Samsung GPIO implementation and the architecture | 7 | This outlines the Samsung GPIO implementation and the architecture |
8 | specific calls provided alongisde the drivers/gpio core. | 8 | specific calls provided alongside the drivers/gpio core. |
9 | 9 | ||
10 | 10 | ||
11 | S3C24XX (Legacy) | 11 | S3C24XX (Legacy) |
12 | ---------------- | 12 | ---------------- |
13 | 13 | ||
14 | See Documentation/arm/Samsung-S3C24XX/GPIO.txt for more information | 14 | See Documentation/arm/Samsung-S3C24XX/GPIO.txt for more information |
15 | about these devices. Their implementation is being brought into line | 15 | about these devices. Their implementation has been brought into line |
16 | with the core samsung implementation described in this document. | 16 | with the core samsung implementation described in this document. |
17 | 17 | ||
18 | 18 | ||
@@ -29,7 +29,7 @@ GPIO numbering is synchronised between the Samsung and gpiolib system. | |||
29 | PIN configuration | 29 | PIN configuration |
30 | ----------------- | 30 | ----------------- |
31 | 31 | ||
32 | Pin configuration is specific to the Samsung architecutre, with each SoC | 32 | Pin configuration is specific to the Samsung architecture, with each SoC |
33 | registering the necessary information for the core gpio configuration | 33 | registering the necessary information for the core gpio configuration |
34 | implementation to configure pins as necessary. | 34 | implementation to configure pins as necessary. |
35 | 35 | ||
@@ -38,5 +38,3 @@ driver or machine to change gpio configuration. | |||
38 | 38 | ||
39 | See arch/arm/plat-samsung/include/plat/gpio-cfg.h for more information | 39 | See arch/arm/plat-samsung/include/plat/gpio-cfg.h for more information |
40 | on these functions. | 40 | on these functions. |
41 | |||
42 | |||
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt index 208a2d465b92..4bfb9ffbdbc1 100644 --- a/Documentation/arm/memory.txt +++ b/Documentation/arm/memory.txt | |||
@@ -51,6 +51,9 @@ ffc00000 ffefffff DMA memory mapping region. Memory returned | |||
51 | ff000000 ffbfffff Reserved for future expansion of DMA | 51 | ff000000 ffbfffff Reserved for future expansion of DMA |
52 | mapping region. | 52 | mapping region. |
53 | 53 | ||
54 | fee00000 feffffff Mapping of PCI I/O space. This is a static | ||
55 | mapping within the vmalloc space. | ||
56 | |||
54 | VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space. | 57 | VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space. |
55 | Memory returned by vmalloc/ioremap will | 58 | Memory returned by vmalloc/ioremap will |
56 | be dynamically placed in this region. | 59 | be dynamically placed in this region. |
diff --git a/Documentation/devicetree/bindings/arm/pmu.txt b/Documentation/devicetree/bindings/arm/pmu.txt index 1c044eb320cc..343781b9f246 100644 --- a/Documentation/devicetree/bindings/arm/pmu.txt +++ b/Documentation/devicetree/bindings/arm/pmu.txt | |||
@@ -7,8 +7,12 @@ representation in the device tree should be done as under:- | |||
7 | Required properties: | 7 | Required properties: |
8 | 8 | ||
9 | - compatible : should be one of | 9 | - compatible : should be one of |
10 | "arm,cortex-a15-pmu" | ||
10 | "arm,cortex-a9-pmu" | 11 | "arm,cortex-a9-pmu" |
11 | "arm,cortex-a8-pmu" | 12 | "arm,cortex-a8-pmu" |
13 | "arm,cortex-a7-pmu" | ||
14 | "arm,cortex-a5-pmu" | ||
15 | "arm,arm11mpcore-pmu" | ||
12 | "arm,arm1176-pmu" | 16 | "arm,arm1176-pmu" |
13 | "arm,arm1136-pmu" | 17 | "arm,arm1136-pmu" |
14 | - interrupts : 1 combined interrupt or 1 per core. | 18 | - interrupts : 1 combined interrupt or 1 per core. |
diff --git a/MAINTAINERS b/MAINTAINERS index 0318e6264346..a9f1ac20a094 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -595,7 +595,6 @@ M: Will Deacon <will.deacon@arm.com> | |||
595 | S: Maintained | 595 | S: Maintained |
596 | F: arch/arm/kernel/perf_event* | 596 | F: arch/arm/kernel/perf_event* |
597 | F: arch/arm/oprofile/common.c | 597 | F: arch/arm/oprofile/common.c |
598 | F: arch/arm/kernel/pmu.c | ||
599 | F: arch/arm/include/asm/pmu.h | 598 | F: arch/arm/include/asm/pmu.h |
600 | F: arch/arm/kernel/hw_breakpoint.c | 599 | F: arch/arm/kernel/hw_breakpoint.c |
601 | F: arch/arm/include/asm/hw_breakpoint.h | 600 | F: arch/arm/include/asm/hw_breakpoint.h |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4c428dc999ea..884768cb5332 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -279,7 +279,6 @@ config ARCH_INTEGRATOR | |||
279 | select GENERIC_CLOCKEVENTS | 279 | select GENERIC_CLOCKEVENTS |
280 | select PLAT_VERSATILE | 280 | select PLAT_VERSATILE |
281 | select PLAT_VERSATILE_FPGA_IRQ | 281 | select PLAT_VERSATILE_FPGA_IRQ |
282 | select NEED_MACH_IO_H | ||
283 | select NEED_MACH_MEMORY_H | 282 | select NEED_MACH_MEMORY_H |
284 | select SPARSE_IRQ | 283 | select SPARSE_IRQ |
285 | select MULTI_IRQ_HANDLER | 284 | select MULTI_IRQ_HANDLER |
@@ -311,7 +310,6 @@ config ARCH_VERSATILE | |||
311 | select ICST | 310 | select ICST |
312 | select GENERIC_CLOCKEVENTS | 311 | select GENERIC_CLOCKEVENTS |
313 | select ARCH_WANT_OPTIONAL_GPIOLIB | 312 | select ARCH_WANT_OPTIONAL_GPIOLIB |
314 | select NEED_MACH_IO_H if PCI | ||
315 | select PLAT_VERSATILE | 313 | select PLAT_VERSATILE |
316 | select PLAT_VERSATILE_CLOCK | 314 | select PLAT_VERSATILE_CLOCK |
317 | select PLAT_VERSATILE_CLCD | 315 | select PLAT_VERSATILE_CLCD |
@@ -406,9 +404,8 @@ config ARCH_GEMINI | |||
406 | help | 404 | help |
407 | Support for the Cortina Systems Gemini family SoCs | 405 | Support for the Cortina Systems Gemini family SoCs |
408 | 406 | ||
409 | config ARCH_PRIMA2 | 407 | config ARCH_SIRF |
410 | bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" | 408 | bool "CSR SiRF" |
411 | select CPU_V7 | ||
412 | select NO_IOPORT | 409 | select NO_IOPORT |
413 | select ARCH_REQUIRE_GPIOLIB | 410 | select ARCH_REQUIRE_GPIOLIB |
414 | select GENERIC_CLOCKEVENTS | 411 | select GENERIC_CLOCKEVENTS |
@@ -418,9 +415,8 @@ config ARCH_PRIMA2 | |||
418 | select PINCTRL | 415 | select PINCTRL |
419 | select PINCTRL_SIRF | 416 | select PINCTRL_SIRF |
420 | select USE_OF | 417 | select USE_OF |
421 | select ZONE_DMA | ||
422 | help | 418 | help |
423 | Support for CSR SiRFSoC ARM Cortex A9 Platform | 419 | Support for CSR SiRFprimaII/Marco/Polo platforms |
424 | 420 | ||
425 | config ARCH_EBSA110 | 421 | config ARCH_EBSA110 |
426 | bool "EBSA-110" | 422 | bool "EBSA-110" |
@@ -455,7 +451,7 @@ config ARCH_FOOTBRIDGE | |||
455 | select FOOTBRIDGE | 451 | select FOOTBRIDGE |
456 | select GENERIC_CLOCKEVENTS | 452 | select GENERIC_CLOCKEVENTS |
457 | select HAVE_IDE | 453 | select HAVE_IDE |
458 | select NEED_MACH_IO_H | 454 | select NEED_MACH_IO_H if !MMU |
459 | select NEED_MACH_MEMORY_H | 455 | select NEED_MACH_MEMORY_H |
460 | help | 456 | help |
461 | Support for systems based on the DC21285 companion chip | 457 | Support for systems based on the DC21285 companion chip |
@@ -512,7 +508,6 @@ config ARCH_IOP13XX | |||
512 | select PCI | 508 | select PCI |
513 | select ARCH_SUPPORTS_MSI | 509 | select ARCH_SUPPORTS_MSI |
514 | select VMSPLIT_1G | 510 | select VMSPLIT_1G |
515 | select NEED_MACH_IO_H | ||
516 | select NEED_MACH_MEMORY_H | 511 | select NEED_MACH_MEMORY_H |
517 | select NEED_RET_TO_USER | 512 | select NEED_RET_TO_USER |
518 | help | 513 | help |
@@ -522,7 +517,6 @@ config ARCH_IOP32X | |||
522 | bool "IOP32x-based" | 517 | bool "IOP32x-based" |
523 | depends on MMU | 518 | depends on MMU |
524 | select CPU_XSCALE | 519 | select CPU_XSCALE |
525 | select NEED_MACH_IO_H | ||
526 | select NEED_RET_TO_USER | 520 | select NEED_RET_TO_USER |
527 | select PLAT_IOP | 521 | select PLAT_IOP |
528 | select PCI | 522 | select PCI |
@@ -535,7 +529,6 @@ config ARCH_IOP33X | |||
535 | bool "IOP33x-based" | 529 | bool "IOP33x-based" |
536 | depends on MMU | 530 | depends on MMU |
537 | select CPU_XSCALE | 531 | select CPU_XSCALE |
538 | select NEED_MACH_IO_H | ||
539 | select NEED_RET_TO_USER | 532 | select NEED_RET_TO_USER |
540 | select PLAT_IOP | 533 | select PLAT_IOP |
541 | select PCI | 534 | select PCI |
@@ -575,7 +568,6 @@ config ARCH_DOVE | |||
575 | select PCI | 568 | select PCI |
576 | select ARCH_REQUIRE_GPIOLIB | 569 | select ARCH_REQUIRE_GPIOLIB |
577 | select GENERIC_CLOCKEVENTS | 570 | select GENERIC_CLOCKEVENTS |
578 | select NEED_MACH_IO_H | ||
579 | select PLAT_ORION | 571 | select PLAT_ORION |
580 | help | 572 | help |
581 | Support for the Marvell Dove SoC 88AP510 | 573 | Support for the Marvell Dove SoC 88AP510 |
@@ -586,7 +578,6 @@ config ARCH_KIRKWOOD | |||
586 | select PCI | 578 | select PCI |
587 | select ARCH_REQUIRE_GPIOLIB | 579 | select ARCH_REQUIRE_GPIOLIB |
588 | select GENERIC_CLOCKEVENTS | 580 | select GENERIC_CLOCKEVENTS |
589 | select NEED_MACH_IO_H | ||
590 | select PLAT_ORION | 581 | select PLAT_ORION |
591 | help | 582 | help |
592 | Support for the following Marvell Kirkwood series SoCs: | 583 | Support for the following Marvell Kirkwood series SoCs: |
@@ -613,7 +604,6 @@ config ARCH_MV78XX0 | |||
613 | select PCI | 604 | select PCI |
614 | select ARCH_REQUIRE_GPIOLIB | 605 | select ARCH_REQUIRE_GPIOLIB |
615 | select GENERIC_CLOCKEVENTS | 606 | select GENERIC_CLOCKEVENTS |
616 | select NEED_MACH_IO_H | ||
617 | select PLAT_ORION | 607 | select PLAT_ORION |
618 | help | 608 | help |
619 | Support for the following Marvell MV78xx0 series SoCs: | 609 | Support for the following Marvell MV78xx0 series SoCs: |
@@ -626,7 +616,6 @@ config ARCH_ORION5X | |||
626 | select PCI | 616 | select PCI |
627 | select ARCH_REQUIRE_GPIOLIB | 617 | select ARCH_REQUIRE_GPIOLIB |
628 | select GENERIC_CLOCKEVENTS | 618 | select GENERIC_CLOCKEVENTS |
629 | select NEED_MACH_IO_H | ||
630 | select PLAT_ORION | 619 | select PLAT_ORION |
631 | help | 620 | help |
632 | Support for the following Marvell Orion 5x series SoCs: | 621 | Support for the following Marvell Orion 5x series SoCs: |
@@ -651,8 +640,9 @@ config ARCH_KS8695 | |||
651 | bool "Micrel/Kendin KS8695" | 640 | bool "Micrel/Kendin KS8695" |
652 | select CPU_ARM922T | 641 | select CPU_ARM922T |
653 | select ARCH_REQUIRE_GPIOLIB | 642 | select ARCH_REQUIRE_GPIOLIB |
654 | select ARCH_USES_GETTIMEOFFSET | ||
655 | select NEED_MACH_MEMORY_H | 643 | select NEED_MACH_MEMORY_H |
644 | select CLKSRC_MMIO | ||
645 | select GENERIC_CLOCKEVENTS | ||
656 | help | 646 | help |
657 | Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based | 647 | Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based |
658 | System-on-Chip devices. | 648 | System-on-Chip devices. |
@@ -682,7 +672,6 @@ config ARCH_TEGRA | |||
682 | select HAVE_CLK | 672 | select HAVE_CLK |
683 | select HAVE_SMP | 673 | select HAVE_SMP |
684 | select MIGHT_HAVE_CACHE_L2X0 | 674 | select MIGHT_HAVE_CACHE_L2X0 |
685 | select NEED_MACH_IO_H if PCI | ||
686 | select ARCH_HAS_CPUFREQ | 675 | select ARCH_HAS_CPUFREQ |
687 | select USE_OF | 676 | select USE_OF |
688 | help | 677 | help |
@@ -708,14 +697,6 @@ config ARCH_PICOXCELL | |||
708 | family of Femtocell devices. The picoxcell support requires device tree | 697 | family of Femtocell devices. The picoxcell support requires device tree |
709 | for all boards. | 698 | for all boards. |
710 | 699 | ||
711 | config ARCH_PNX4008 | ||
712 | bool "Philips Nexperia PNX4008 Mobile" | ||
713 | select CPU_ARM926T | ||
714 | select CLKDEV_LOOKUP | ||
715 | select ARCH_USES_GETTIMEOFFSET | ||
716 | help | ||
717 | This enables support for Philips PNX4008 mobile platform. | ||
718 | |||
719 | config ARCH_PXA | 700 | config ARCH_PXA |
720 | bool "PXA2xx/PXA3xx-based" | 701 | bool "PXA2xx/PXA3xx-based" |
721 | depends on MMU | 702 | depends on MMU |
@@ -911,7 +892,6 @@ config ARCH_SHARK | |||
911 | select PCI | 892 | select PCI |
912 | select ARCH_USES_GETTIMEOFFSET | 893 | select ARCH_USES_GETTIMEOFFSET |
913 | select NEED_MACH_MEMORY_H | 894 | select NEED_MACH_MEMORY_H |
914 | select NEED_MACH_IO_H | ||
915 | help | 895 | help |
916 | Support for the StrongARM based Digital DNARD machine, also known | 896 | Support for the StrongARM based Digital DNARD machine, also known |
917 | as "Shark" (<http://www.shark-linux.de/shark.html>). | 897 | as "Shark" (<http://www.shark-linux.de/shark.html>). |
@@ -930,6 +910,7 @@ config ARCH_U300 | |||
930 | select COMMON_CLK | 910 | select COMMON_CLK |
931 | select GENERIC_GPIO | 911 | select GENERIC_GPIO |
932 | select ARCH_REQUIRE_GPIOLIB | 912 | select ARCH_REQUIRE_GPIOLIB |
913 | select SPARSE_IRQ | ||
933 | help | 914 | help |
934 | Support for ST-Ericsson U300 series mobile platforms. | 915 | Support for ST-Ericsson U300 series mobile platforms. |
935 | 916 | ||
@@ -1117,6 +1098,8 @@ source "arch/arm/mach-exynos/Kconfig" | |||
1117 | 1098 | ||
1118 | source "arch/arm/mach-shmobile/Kconfig" | 1099 | source "arch/arm/mach-shmobile/Kconfig" |
1119 | 1100 | ||
1101 | source "arch/arm/mach-prima2/Kconfig" | ||
1102 | |||
1120 | source "arch/arm/mach-tegra/Kconfig" | 1103 | source "arch/arm/mach-tegra/Kconfig" |
1121 | 1104 | ||
1122 | source "arch/arm/mach-u300/Kconfig" | 1105 | source "arch/arm/mach-u300/Kconfig" |
@@ -1178,12 +1161,6 @@ config XSCALE_PMU | |||
1178 | depends on CPU_XSCALE | 1161 | depends on CPU_XSCALE |
1179 | default y | 1162 | default y |
1180 | 1163 | ||
1181 | config CPU_HAS_PMU | ||
1182 | depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \ | ||
1183 | (!ARCH_OMAP3 || OMAP3_EMU) | ||
1184 | default y | ||
1185 | bool | ||
1186 | |||
1187 | config MULTI_IRQ_HANDLER | 1164 | config MULTI_IRQ_HANDLER |
1188 | bool | 1165 | bool |
1189 | help | 1166 | help |
@@ -1756,7 +1733,7 @@ config HIGHPTE | |||
1756 | 1733 | ||
1757 | config HW_PERF_EVENTS | 1734 | config HW_PERF_EVENTS |
1758 | bool "Enable hardware performance counter support for perf events" | 1735 | bool "Enable hardware performance counter support for perf events" |
1759 | depends on PERF_EVENTS && CPU_HAS_PMU | 1736 | depends on PERF_EVENTS |
1760 | default y | 1737 | default y |
1761 | help | 1738 | help |
1762 | Enable hardware performance counter support for perf events. If | 1739 | Enable hardware performance counter support for perf events. If |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index a051dfbdd7db..74381a31ee42 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -167,7 +167,6 @@ machine-$(CONFIG_ARCH_OMAP1) := omap1 | |||
167 | machine-$(CONFIG_ARCH_OMAP2PLUS) := omap2 | 167 | machine-$(CONFIG_ARCH_OMAP2PLUS) := omap2 |
168 | machine-$(CONFIG_ARCH_ORION5X) := orion5x | 168 | machine-$(CONFIG_ARCH_ORION5X) := orion5x |
169 | machine-$(CONFIG_ARCH_PICOXCELL) := picoxcell | 169 | machine-$(CONFIG_ARCH_PICOXCELL) := picoxcell |
170 | machine-$(CONFIG_ARCH_PNX4008) := pnx4008 | ||
171 | machine-$(CONFIG_ARCH_PRIMA2) := prima2 | 170 | machine-$(CONFIG_ARCH_PRIMA2) := prima2 |
172 | machine-$(CONFIG_ARCH_PXA) := pxa | 171 | machine-$(CONFIG_ARCH_PXA) := pxa |
173 | machine-$(CONFIG_ARCH_REALVIEW) := realview | 172 | machine-$(CONFIG_ARCH_REALVIEW) := realview |
diff --git a/arch/arm/boot/dts/imx27-phytec-phycore.dts b/arch/arm/boot/dts/imx27-phytec-phycore.dts index 2b0ff60247a4..2acc86cfdd05 100644 --- a/arch/arm/boot/dts/imx27-phytec-phycore.dts +++ b/arch/arm/boot/dts/imx27-phytec-phycore.dts | |||
@@ -49,7 +49,7 @@ | |||
49 | i2c@1001d000 { | 49 | i2c@1001d000 { |
50 | clock-frequency = <400000>; | 50 | clock-frequency = <400000>; |
51 | status = "okay"; | 51 | status = "okay"; |
52 | at24@4c { | 52 | at24@52 { |
53 | compatible = "at,24c32"; | 53 | compatible = "at,24c32"; |
54 | pagesize = <32>; | 54 | pagesize = <32>; |
55 | reg = <0x52>; | 55 | reg = <0x52>; |
diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts index f146dbf6f7f8..c3ef1ad26b6a 100644 --- a/arch/arm/boot/dts/tegra20-harmony.dts +++ b/arch/arm/boot/dts/tegra20-harmony.dts | |||
@@ -275,6 +275,160 @@ | |||
275 | i2c@7000d000 { | 275 | i2c@7000d000 { |
276 | status = "okay"; | 276 | status = "okay"; |
277 | clock-frequency = <400000>; | 277 | clock-frequency = <400000>; |
278 | |||
279 | pmic: tps6586x@34 { | ||
280 | compatible = "ti,tps6586x"; | ||
281 | reg = <0x34>; | ||
282 | interrupts = <0 86 0x4>; | ||
283 | |||
284 | ti,system-power-controller; | ||
285 | |||
286 | #gpio-cells = <2>; | ||
287 | gpio-controller; | ||
288 | |||
289 | sys-supply = <&vdd_5v0_reg>; | ||
290 | vin-sm0-supply = <&sys_reg>; | ||
291 | vin-sm1-supply = <&sys_reg>; | ||
292 | vin-sm2-supply = <&sys_reg>; | ||
293 | vinldo01-supply = <&sm2_reg>; | ||
294 | vinldo23-supply = <&sm2_reg>; | ||
295 | vinldo4-supply = <&sm2_reg>; | ||
296 | vinldo678-supply = <&sm2_reg>; | ||
297 | vinldo9-supply = <&sm2_reg>; | ||
298 | |||
299 | regulators { | ||
300 | #address-cells = <1>; | ||
301 | #size-cells = <0>; | ||
302 | |||
303 | sys_reg: regulator@0 { | ||
304 | reg = <0>; | ||
305 | regulator-compatible = "sys"; | ||
306 | regulator-name = "vdd_sys"; | ||
307 | regulator-always-on; | ||
308 | }; | ||
309 | |||
310 | regulator@1 { | ||
311 | reg = <1>; | ||
312 | regulator-compatible = "sm0"; | ||
313 | regulator-name = "vdd_sm0,vdd_core"; | ||
314 | regulator-min-microvolt = <1200000>; | ||
315 | regulator-max-microvolt = <1200000>; | ||
316 | regulator-always-on; | ||
317 | }; | ||
318 | |||
319 | regulator@2 { | ||
320 | reg = <2>; | ||
321 | regulator-compatible = "sm1"; | ||
322 | regulator-name = "vdd_sm1,vdd_cpu"; | ||
323 | regulator-min-microvolt = <1000000>; | ||
324 | regulator-max-microvolt = <1000000>; | ||
325 | regulator-always-on; | ||
326 | }; | ||
327 | |||
328 | sm2_reg: regulator@3 { | ||
329 | reg = <3>; | ||
330 | regulator-compatible = "sm2"; | ||
331 | regulator-name = "vdd_sm2,vin_ldo*"; | ||
332 | regulator-min-microvolt = <3700000>; | ||
333 | regulator-max-microvolt = <3700000>; | ||
334 | regulator-always-on; | ||
335 | }; | ||
336 | |||
337 | regulator@4 { | ||
338 | reg = <4>; | ||
339 | regulator-compatible = "ldo0"; | ||
340 | regulator-name = "vdd_ldo0,vddio_pex_clk"; | ||
341 | regulator-min-microvolt = <3300000>; | ||
342 | regulator-max-microvolt = <3300000>; | ||
343 | }; | ||
344 | |||
345 | regulator@5 { | ||
346 | reg = <5>; | ||
347 | regulator-compatible = "ldo1"; | ||
348 | regulator-name = "vdd_ldo1,avdd_pll*"; | ||
349 | regulator-min-microvolt = <1100000>; | ||
350 | regulator-max-microvolt = <1100000>; | ||
351 | regulator-always-on; | ||
352 | }; | ||
353 | |||
354 | regulator@6 { | ||
355 | reg = <6>; | ||
356 | regulator-compatible = "ldo2"; | ||
357 | regulator-name = "vdd_ldo2,vdd_rtc"; | ||
358 | regulator-min-microvolt = <1200000>; | ||
359 | regulator-max-microvolt = <1200000>; | ||
360 | }; | ||
361 | |||
362 | regulator@7 { | ||
363 | reg = <7>; | ||
364 | regulator-compatible = "ldo3"; | ||
365 | regulator-name = "vdd_ldo3,avdd_usb*"; | ||
366 | regulator-min-microvolt = <3300000>; | ||
367 | regulator-max-microvolt = <3300000>; | ||
368 | regulator-always-on; | ||
369 | }; | ||
370 | |||
371 | regulator@8 { | ||
372 | reg = <8>; | ||
373 | regulator-compatible = "ldo4"; | ||
374 | regulator-name = "vdd_ldo4,avdd_osc,vddio_sys"; | ||
375 | regulator-min-microvolt = <1800000>; | ||
376 | regulator-max-microvolt = <1800000>; | ||
377 | regulator-always-on; | ||
378 | }; | ||
379 | |||
380 | regulator@9 { | ||
381 | reg = <9>; | ||
382 | regulator-compatible = "ldo5"; | ||
383 | regulator-name = "vdd_ldo5,vcore_mmc"; | ||
384 | regulator-min-microvolt = <2850000>; | ||
385 | regulator-max-microvolt = <2850000>; | ||
386 | regulator-always-on; | ||
387 | }; | ||
388 | |||
389 | regulator@10 { | ||
390 | reg = <10>; | ||
391 | regulator-compatible = "ldo6"; | ||
392 | regulator-name = "vdd_ldo6,avdd_vdac"; | ||
393 | regulator-min-microvolt = <1800000>; | ||
394 | regulator-max-microvolt = <1800000>; | ||
395 | }; | ||
396 | |||
397 | regulator@11 { | ||
398 | reg = <11>; | ||
399 | regulator-compatible = "ldo7"; | ||
400 | regulator-name = "vdd_ldo7,avdd_hdmi"; | ||
401 | regulator-min-microvolt = <3300000>; | ||
402 | regulator-max-microvolt = <3300000>; | ||
403 | }; | ||
404 | |||
405 | regulator@12 { | ||
406 | reg = <12>; | ||
407 | regulator-compatible = "ldo8"; | ||
408 | regulator-name = "vdd_ldo8,avdd_hdmi_pll"; | ||
409 | regulator-min-microvolt = <1800000>; | ||
410 | regulator-max-microvolt = <1800000>; | ||
411 | }; | ||
412 | |||
413 | regulator@13 { | ||
414 | reg = <13>; | ||
415 | regulator-compatible = "ldo9"; | ||
416 | regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx"; | ||
417 | regulator-min-microvolt = <2850000>; | ||
418 | regulator-max-microvolt = <2850000>; | ||
419 | regulator-always-on; | ||
420 | }; | ||
421 | |||
422 | regulator@14 { | ||
423 | reg = <14>; | ||
424 | regulator-compatible = "ldo_rtc"; | ||
425 | regulator-name = "vdd_rtc_out,vdd_cell"; | ||
426 | regulator-min-microvolt = <3300000>; | ||
427 | regulator-max-microvolt = <3300000>; | ||
428 | regulator-always-on; | ||
429 | }; | ||
430 | }; | ||
431 | }; | ||
278 | }; | 432 | }; |
279 | 433 | ||
280 | pmc { | 434 | pmc { |
@@ -310,6 +464,72 @@ | |||
310 | bus-width = <8>; | 464 | bus-width = <8>; |
311 | }; | 465 | }; |
312 | 466 | ||
467 | regulators { | ||
468 | compatible = "simple-bus"; | ||
469 | #address-cells = <1>; | ||
470 | #size-cells = <0>; | ||
471 | |||
472 | vdd_5v0_reg: regulator@0 { | ||
473 | compatible = "regulator-fixed"; | ||
474 | reg = <0>; | ||
475 | regulator-name = "vdd_5v0"; | ||
476 | regulator-min-microvolt = <5000000>; | ||
477 | regulator-max-microvolt = <5000000>; | ||
478 | regulator-always-on; | ||
479 | }; | ||
480 | |||
481 | regulator@1 { | ||
482 | compatible = "regulator-fixed"; | ||
483 | reg = <1>; | ||
484 | regulator-name = "vdd_1v5"; | ||
485 | regulator-min-microvolt = <1500000>; | ||
486 | regulator-max-microvolt = <1500000>; | ||
487 | gpio = <&pmic 0 0>; | ||
488 | }; | ||
489 | |||
490 | regulator@2 { | ||
491 | compatible = "regulator-fixed"; | ||
492 | reg = <2>; | ||
493 | regulator-name = "vdd_1v2"; | ||
494 | regulator-min-microvolt = <1200000>; | ||
495 | regulator-max-microvolt = <1200000>; | ||
496 | gpio = <&pmic 1 0>; | ||
497 | enable-active-high; | ||
498 | }; | ||
499 | |||
500 | regulator@3 { | ||
501 | compatible = "regulator-fixed"; | ||
502 | reg = <3>; | ||
503 | regulator-name = "vdd_1v05"; | ||
504 | regulator-min-microvolt = <1050000>; | ||
505 | regulator-max-microvolt = <1050000>; | ||
506 | gpio = <&pmic 2 0>; | ||
507 | enable-active-high; | ||
508 | /* Hack until board-harmony-pcie.c is removed */ | ||
509 | status = "disabled"; | ||
510 | }; | ||
511 | |||
512 | regulator@4 { | ||
513 | compatible = "regulator-fixed"; | ||
514 | reg = <4>; | ||
515 | regulator-name = "vdd_pnl"; | ||
516 | regulator-min-microvolt = <2800000>; | ||
517 | regulator-max-microvolt = <2800000>; | ||
518 | gpio = <&gpio 22 0>; /* gpio PC6 */ | ||
519 | enable-active-high; | ||
520 | }; | ||
521 | |||
522 | regulator@5 { | ||
523 | compatible = "regulator-fixed"; | ||
524 | reg = <5>; | ||
525 | regulator-name = "vdd_bl"; | ||
526 | regulator-min-microvolt = <2800000>; | ||
527 | regulator-max-microvolt = <2800000>; | ||
528 | gpio = <&gpio 176 0>; /* gpio PW0 */ | ||
529 | enable-active-high; | ||
530 | }; | ||
531 | }; | ||
532 | |||
313 | sound { | 533 | sound { |
314 | compatible = "nvidia,tegra-audio-wm8903-harmony", | 534 | compatible = "nvidia,tegra-audio-wm8903-harmony", |
315 | "nvidia,tegra-audio-wm8903"; | 535 | "nvidia,tegra-audio-wm8903"; |
diff --git a/arch/arm/configs/pnx4008_defconfig b/arch/arm/configs/pnx4008_defconfig deleted file mode 100644 index 35a31ccacc32..000000000000 --- a/arch/arm/configs/pnx4008_defconfig +++ /dev/null | |||
@@ -1,472 +0,0 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | ||
2 | CONFIG_SYSVIPC=y | ||
3 | CONFIG_POSIX_MQUEUE=y | ||
4 | CONFIG_BSD_PROCESS_ACCT=y | ||
5 | CONFIG_AUDIT=y | ||
6 | CONFIG_LOG_BUF_SHIFT=14 | ||
7 | CONFIG_BLK_DEV_INITRD=y | ||
8 | CONFIG_EXPERT=y | ||
9 | CONFIG_SLAB=y | ||
10 | CONFIG_MODULES=y | ||
11 | CONFIG_MODULE_UNLOAD=y | ||
12 | CONFIG_MODULE_FORCE_UNLOAD=y | ||
13 | CONFIG_MODVERSIONS=y | ||
14 | CONFIG_MODULE_SRCVERSION_ALL=y | ||
15 | CONFIG_ARCH_PNX4008=y | ||
16 | CONFIG_PREEMPT=y | ||
17 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
18 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
19 | CONFIG_CMDLINE="mem=64M console=ttyS0,115200" | ||
20 | CONFIG_FPE_NWFPE=y | ||
21 | CONFIG_BINFMT_AOUT=m | ||
22 | CONFIG_BINFMT_MISC=m | ||
23 | CONFIG_PM=y | ||
24 | CONFIG_PACKET=y | ||
25 | CONFIG_UNIX=y | ||
26 | CONFIG_INET=y | ||
27 | CONFIG_IP_MULTICAST=y | ||
28 | CONFIG_IP_ADVANCED_ROUTER=y | ||
29 | CONFIG_IP_MULTIPLE_TABLES=y | ||
30 | CONFIG_IP_ROUTE_MULTIPATH=y | ||
31 | CONFIG_IP_ROUTE_VERBOSE=y | ||
32 | CONFIG_IP_PNP=y | ||
33 | CONFIG_IP_PNP_DHCP=y | ||
34 | CONFIG_IP_PNP_BOOTP=y | ||
35 | CONFIG_IP_MROUTE=y | ||
36 | CONFIG_IP_PIMSM_V1=y | ||
37 | CONFIG_IP_PIMSM_V2=y | ||
38 | CONFIG_SYN_COOKIES=y | ||
39 | CONFIG_INET_AH=m | ||
40 | CONFIG_INET_ESP=m | ||
41 | CONFIG_INET_IPCOMP=m | ||
42 | CONFIG_IPV6_PRIVACY=y | ||
43 | CONFIG_INET6_AH=m | ||
44 | CONFIG_INET6_ESP=m | ||
45 | CONFIG_INET6_IPCOMP=m | ||
46 | CONFIG_IPV6_TUNNEL=m | ||
47 | CONFIG_NETFILTER=y | ||
48 | CONFIG_IP_VS=m | ||
49 | CONFIG_IP_VS_PROTO_TCP=y | ||
50 | CONFIG_IP_VS_PROTO_UDP=y | ||
51 | CONFIG_IP_VS_PROTO_ESP=y | ||
52 | CONFIG_IP_VS_PROTO_AH=y | ||
53 | CONFIG_IP_VS_RR=m | ||
54 | CONFIG_IP_VS_WRR=m | ||
55 | CONFIG_IP_VS_LC=m | ||
56 | CONFIG_IP_VS_WLC=m | ||
57 | CONFIG_IP_VS_LBLC=m | ||
58 | CONFIG_IP_VS_LBLCR=m | ||
59 | CONFIG_IP_VS_DH=m | ||
60 | CONFIG_IP_VS_SH=m | ||
61 | CONFIG_IP_VS_SED=m | ||
62 | CONFIG_IP_VS_NQ=m | ||
63 | CONFIG_IP_VS_FTP=m | ||
64 | CONFIG_IP_NF_QUEUE=m | ||
65 | CONFIG_IP6_NF_QUEUE=m | ||
66 | CONFIG_DECNET_NF_GRABULATOR=m | ||
67 | CONFIG_BRIDGE_NF_EBTABLES=m | ||
68 | CONFIG_BRIDGE_EBT_BROUTE=m | ||
69 | CONFIG_BRIDGE_EBT_T_FILTER=m | ||
70 | CONFIG_BRIDGE_EBT_T_NAT=m | ||
71 | CONFIG_BRIDGE_EBT_802_3=m | ||
72 | CONFIG_BRIDGE_EBT_AMONG=m | ||
73 | CONFIG_BRIDGE_EBT_ARP=m | ||
74 | CONFIG_BRIDGE_EBT_IP=m | ||
75 | CONFIG_BRIDGE_EBT_LIMIT=m | ||
76 | CONFIG_BRIDGE_EBT_MARK=m | ||
77 | CONFIG_BRIDGE_EBT_PKTTYPE=m | ||
78 | CONFIG_BRIDGE_EBT_STP=m | ||
79 | CONFIG_BRIDGE_EBT_VLAN=m | ||
80 | CONFIG_BRIDGE_EBT_ARPREPLY=m | ||
81 | CONFIG_BRIDGE_EBT_DNAT=m | ||
82 | CONFIG_BRIDGE_EBT_MARK_T=m | ||
83 | CONFIG_BRIDGE_EBT_REDIRECT=m | ||
84 | CONFIG_BRIDGE_EBT_SNAT=m | ||
85 | CONFIG_BRIDGE_EBT_LOG=m | ||
86 | CONFIG_IP_SCTP=m | ||
87 | CONFIG_ATM=y | ||
88 | CONFIG_ATM_CLIP=y | ||
89 | CONFIG_ATM_LANE=m | ||
90 | CONFIG_ATM_MPOA=m | ||
91 | CONFIG_ATM_BR2684=m | ||
92 | CONFIG_BRIDGE=m | ||
93 | CONFIG_VLAN_8021Q=m | ||
94 | CONFIG_DECNET=m | ||
95 | CONFIG_LLC2=m | ||
96 | CONFIG_IPX=m | ||
97 | CONFIG_ATALK=m | ||
98 | CONFIG_DEV_APPLETALK=m | ||
99 | CONFIG_IPDDP=m | ||
100 | CONFIG_IPDDP_ENCAP=y | ||
101 | CONFIG_IPDDP_DECAP=y | ||
102 | CONFIG_X25=m | ||
103 | CONFIG_LAPB=m | ||
104 | CONFIG_ECONET=m | ||
105 | CONFIG_ECONET_AUNUDP=y | ||
106 | CONFIG_ECONET_NATIVE=y | ||
107 | CONFIG_WAN_ROUTER=m | ||
108 | CONFIG_NET_SCHED=y | ||
109 | CONFIG_NET_SCH_CBQ=m | ||
110 | CONFIG_NET_SCH_HTB=m | ||
111 | CONFIG_NET_SCH_HFSC=m | ||
112 | CONFIG_NET_SCH_ATM=m | ||
113 | CONFIG_NET_SCH_PRIO=m | ||
114 | CONFIG_NET_SCH_RED=m | ||
115 | CONFIG_NET_SCH_SFQ=m | ||
116 | CONFIG_NET_SCH_TEQL=m | ||
117 | CONFIG_NET_SCH_TBF=m | ||
118 | CONFIG_NET_SCH_GRED=m | ||
119 | CONFIG_NET_SCH_DSMARK=m | ||
120 | CONFIG_NET_SCH_NETEM=m | ||
121 | CONFIG_NET_CLS_TCINDEX=m | ||
122 | CONFIG_NET_CLS_ROUTE4=m | ||
123 | CONFIG_NET_CLS_FW=m | ||
124 | CONFIG_NET_CLS_U32=m | ||
125 | CONFIG_NET_CLS_RSVP=m | ||
126 | CONFIG_NET_CLS_RSVP6=m | ||
127 | CONFIG_NET_PKTGEN=m | ||
128 | CONFIG_MTD=y | ||
129 | CONFIG_MTD_CONCAT=y | ||
130 | CONFIG_MTD_PARTITIONS=y | ||
131 | CONFIG_MTD_REDBOOT_PARTS=y | ||
132 | CONFIG_MTD_CHAR=y | ||
133 | CONFIG_MTD_BLOCK=y | ||
134 | CONFIG_MTD_SLRAM=m | ||
135 | CONFIG_MTD_PHRAM=m | ||
136 | CONFIG_MTD_MTDRAM=m | ||
137 | CONFIG_MTD_DOC2000=m | ||
138 | CONFIG_MTD_DOC2001=m | ||
139 | CONFIG_MTD_DOC2001PLUS=m | ||
140 | CONFIG_MTD_NAND=y | ||
141 | CONFIG_MTD_NAND_NANDSIM=m | ||
142 | CONFIG_BLK_DEV_LOOP=y | ||
143 | CONFIG_BLK_DEV_CRYPTOLOOP=y | ||
144 | CONFIG_BLK_DEV_NBD=y | ||
145 | CONFIG_BLK_DEV_RAM=y | ||
146 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
147 | CONFIG_CDROM_PKTCDVD=m | ||
148 | CONFIG_EEPROM_LEGACY=m | ||
149 | CONFIG_SCSI=m | ||
150 | CONFIG_BLK_DEV_SD=m | ||
151 | CONFIG_CHR_DEV_ST=m | ||
152 | CONFIG_CHR_DEV_OSST=m | ||
153 | CONFIG_BLK_DEV_SR=m | ||
154 | CONFIG_CHR_DEV_SG=m | ||
155 | CONFIG_CHR_DEV_SCH=m | ||
156 | CONFIG_SCSI_MULTI_LUN=y | ||
157 | CONFIG_SCSI_CONSTANTS=y | ||
158 | CONFIG_SCSI_LOGGING=y | ||
159 | CONFIG_SCSI_SPI_ATTRS=m | ||
160 | CONFIG_SCSI_FC_ATTRS=m | ||
161 | CONFIG_SCSI_DEBUG=m | ||
162 | CONFIG_NETDEVICES=y | ||
163 | CONFIG_DUMMY=m | ||
164 | CONFIG_BONDING=m | ||
165 | CONFIG_EQUALIZER=m | ||
166 | CONFIG_TUN=m | ||
167 | CONFIG_NET_ETHERNET=y | ||
168 | CONFIG_USB_CATC=m | ||
169 | CONFIG_USB_KAWETH=m | ||
170 | CONFIG_USB_PEGASUS=m | ||
171 | CONFIG_USB_RTL8150=m | ||
172 | CONFIG_USB_USBNET=m | ||
173 | # CONFIG_USB_NET_CDC_SUBSET is not set | ||
174 | CONFIG_WAN=y | ||
175 | CONFIG_HDLC=m | ||
176 | CONFIG_HDLC_RAW=m | ||
177 | CONFIG_HDLC_RAW_ETH=m | ||
178 | CONFIG_HDLC_CISCO=m | ||
179 | CONFIG_HDLC_FR=m | ||
180 | CONFIG_HDLC_PPP=m | ||
181 | CONFIG_HDLC_X25=m | ||
182 | CONFIG_DLCI=m | ||
183 | CONFIG_WAN_ROUTER_DRIVERS=m | ||
184 | CONFIG_LAPBETHER=m | ||
185 | CONFIG_X25_ASY=m | ||
186 | CONFIG_ATM_TCP=m | ||
187 | CONFIG_PPP=m | ||
188 | CONFIG_PPP_MULTILINK=y | ||
189 | CONFIG_PPP_FILTER=y | ||
190 | CONFIG_PPP_ASYNC=m | ||
191 | CONFIG_PPP_SYNC_TTY=m | ||
192 | CONFIG_PPP_DEFLATE=m | ||
193 | CONFIG_PPP_BSDCOMP=m | ||
194 | CONFIG_PPP_MPPE=m | ||
195 | CONFIG_PPPOE=m | ||
196 | CONFIG_PPPOATM=m | ||
197 | CONFIG_SLIP=m | ||
198 | CONFIG_SLIP_COMPRESSED=y | ||
199 | CONFIG_SLIP_SMART=y | ||
200 | CONFIG_SLIP_MODE_SLIP6=y | ||
201 | CONFIG_NETCONSOLE=m | ||
202 | # CONFIG_INPUT_MOUSEDEV is not set | ||
203 | CONFIG_INPUT_JOYDEV=m | ||
204 | CONFIG_INPUT_EVDEV=m | ||
205 | CONFIG_INPUT_EVBUG=m | ||
206 | CONFIG_KEYBOARD_LKKBD=m | ||
207 | CONFIG_KEYBOARD_NEWTON=m | ||
208 | CONFIG_KEYBOARD_SUNKBD=m | ||
209 | CONFIG_KEYBOARD_XTKBD=m | ||
210 | CONFIG_MOUSE_PS2=m | ||
211 | CONFIG_MOUSE_SERIAL=m | ||
212 | CONFIG_MOUSE_VSXXXAA=m | ||
213 | CONFIG_INPUT_JOYSTICK=y | ||
214 | CONFIG_JOYSTICK_ANALOG=m | ||
215 | CONFIG_JOYSTICK_A3D=m | ||
216 | CONFIG_JOYSTICK_ADI=m | ||
217 | CONFIG_JOYSTICK_COBRA=m | ||
218 | CONFIG_JOYSTICK_GF2K=m | ||
219 | CONFIG_JOYSTICK_GRIP=m | ||
220 | CONFIG_JOYSTICK_GRIP_MP=m | ||
221 | CONFIG_JOYSTICK_GUILLEMOT=m | ||
222 | CONFIG_JOYSTICK_INTERACT=m | ||
223 | CONFIG_JOYSTICK_SIDEWINDER=m | ||
224 | CONFIG_JOYSTICK_TMDC=m | ||
225 | CONFIG_JOYSTICK_IFORCE=m | ||
226 | CONFIG_JOYSTICK_IFORCE_USB=y | ||
227 | CONFIG_JOYSTICK_IFORCE_232=y | ||
228 | CONFIG_JOYSTICK_WARRIOR=m | ||
229 | CONFIG_JOYSTICK_MAGELLAN=m | ||
230 | CONFIG_JOYSTICK_SPACEORB=m | ||
231 | CONFIG_JOYSTICK_SPACEBALL=m | ||
232 | CONFIG_JOYSTICK_STINGER=m | ||
233 | CONFIG_JOYSTICK_JOYDUMP=m | ||
234 | CONFIG_INPUT_TOUCHSCREEN=y | ||
235 | CONFIG_TOUCHSCREEN_GUNZE=m | ||
236 | CONFIG_INPUT_MISC=y | ||
237 | CONFIG_INPUT_UINPUT=m | ||
238 | CONFIG_SERIO_SERPORT=m | ||
239 | CONFIG_SERIO_RAW=m | ||
240 | CONFIG_GAMEPORT_NS558=m | ||
241 | CONFIG_GAMEPORT_L4=m | ||
242 | CONFIG_SERIAL_8250=y | ||
243 | CONFIG_SERIAL_8250_CONSOLE=y | ||
244 | CONFIG_SERIAL_8250_EXTENDED=y | ||
245 | CONFIG_SERIAL_8250_MANY_PORTS=y | ||
246 | CONFIG_SERIAL_8250_SHARE_IRQ=y | ||
247 | CONFIG_SERIAL_8250_RSA=y | ||
248 | CONFIG_HW_RANDOM=y | ||
249 | CONFIG_I2C=y | ||
250 | CONFIG_I2C_CHARDEV=y | ||
251 | CONFIG_SPI=y | ||
252 | CONFIG_SPI_BITBANG=y | ||
253 | # CONFIG_HWMON is not set | ||
254 | CONFIG_WATCHDOG=y | ||
255 | CONFIG_SOFT_WATCHDOG=m | ||
256 | CONFIG_USBPCWATCHDOG=m | ||
257 | # CONFIG_VGA_CONSOLE is not set | ||
258 | CONFIG_SOUND=m | ||
259 | CONFIG_SND=m | ||
260 | CONFIG_SND_SEQUENCER=m | ||
261 | CONFIG_SND_SEQ_DUMMY=m | ||
262 | CONFIG_SND_MIXER_OSS=m | ||
263 | CONFIG_SND_PCM_OSS=m | ||
264 | CONFIG_SND_SEQUENCER_OSS=y | ||
265 | CONFIG_SND_DUMMY=m | ||
266 | CONFIG_SND_VIRMIDI=m | ||
267 | CONFIG_SND_MTPAV=m | ||
268 | CONFIG_SND_SERIAL_U16550=m | ||
269 | CONFIG_SND_MPU401=m | ||
270 | CONFIG_SND_USB_AUDIO=m | ||
271 | CONFIG_SOUND_PRIME=m | ||
272 | CONFIG_USB_HID=m | ||
273 | CONFIG_USB_HIDDEV=y | ||
274 | CONFIG_USB_KBD=m | ||
275 | CONFIG_USB_MOUSE=m | ||
276 | CONFIG_USB=y | ||
277 | CONFIG_USB_DEVICEFS=y | ||
278 | CONFIG_USB_MON=y | ||
279 | CONFIG_USB_SL811_HCD=m | ||
280 | CONFIG_USB_ACM=m | ||
281 | CONFIG_USB_PRINTER=m | ||
282 | CONFIG_USB_STORAGE=m | ||
283 | CONFIG_USB_STORAGE_DATAFAB=m | ||
284 | CONFIG_USB_STORAGE_FREECOM=m | ||
285 | CONFIG_USB_STORAGE_USBAT=m | ||
286 | CONFIG_USB_STORAGE_SDDR09=m | ||
287 | CONFIG_USB_STORAGE_SDDR55=m | ||
288 | CONFIG_USB_STORAGE_JUMPSHOT=m | ||
289 | CONFIG_USB_MDC800=m | ||
290 | CONFIG_USB_MICROTEK=m | ||
291 | CONFIG_USB_SERIAL=m | ||
292 | CONFIG_USB_SERIAL_GENERIC=y | ||
293 | CONFIG_USB_SERIAL_BELKIN=m | ||
294 | CONFIG_USB_SERIAL_WHITEHEAT=m | ||
295 | CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m | ||
296 | CONFIG_USB_SERIAL_CYPRESS_M8=m | ||
297 | CONFIG_USB_SERIAL_EMPEG=m | ||
298 | CONFIG_USB_SERIAL_FTDI_SIO=m | ||
299 | CONFIG_USB_SERIAL_VISOR=m | ||
300 | CONFIG_USB_SERIAL_IPAQ=m | ||
301 | CONFIG_USB_SERIAL_IR=m | ||
302 | CONFIG_USB_SERIAL_EDGEPORT=m | ||
303 | CONFIG_USB_SERIAL_EDGEPORT_TI=m | ||
304 | CONFIG_USB_SERIAL_IPW=m | ||
305 | CONFIG_USB_SERIAL_KEYSPAN_PDA=m | ||
306 | CONFIG_USB_SERIAL_KEYSPAN=m | ||
307 | CONFIG_USB_SERIAL_KLSI=m | ||
308 | CONFIG_USB_SERIAL_KOBIL_SCT=m | ||
309 | CONFIG_USB_SERIAL_MCT_U232=m | ||
310 | CONFIG_USB_SERIAL_PL2303=m | ||
311 | CONFIG_USB_SERIAL_SAFE=m | ||
312 | CONFIG_USB_SERIAL_CYBERJACK=m | ||
313 | CONFIG_USB_SERIAL_XIRCOM=m | ||
314 | CONFIG_USB_SERIAL_OMNINET=m | ||
315 | CONFIG_USB_RIO500=m | ||
316 | CONFIG_USB_LEGOTOWER=m | ||
317 | CONFIG_USB_LCD=m | ||
318 | CONFIG_USB_LED=m | ||
319 | CONFIG_USB_CYTHERM=m | ||
320 | CONFIG_USB_TEST=m | ||
321 | CONFIG_USB_ATM=m | ||
322 | CONFIG_USB_SPEEDTOUCH=m | ||
323 | CONFIG_USB_GADGET=m | ||
324 | CONFIG_USB_GADGET_DUMMY_HCD=y | ||
325 | CONFIG_USB_ZERO=m | ||
326 | CONFIG_USB_ETH=m | ||
327 | CONFIG_USB_GADGETFS=m | ||
328 | CONFIG_USB_FILE_STORAGE=m | ||
329 | CONFIG_USB_G_SERIAL=m | ||
330 | CONFIG_MMC=m | ||
331 | CONFIG_EXT2_FS=y | ||
332 | CONFIG_EXT2_FS_XATTR=y | ||
333 | CONFIG_EXT2_FS_POSIX_ACL=y | ||
334 | CONFIG_EXT2_FS_SECURITY=y | ||
335 | CONFIG_EXT3_FS=m | ||
336 | CONFIG_EXT3_FS_POSIX_ACL=y | ||
337 | CONFIG_EXT3_FS_SECURITY=y | ||
338 | CONFIG_REISERFS_FS=m | ||
339 | CONFIG_REISERFS_FS_XATTR=y | ||
340 | CONFIG_REISERFS_FS_POSIX_ACL=y | ||
341 | CONFIG_REISERFS_FS_SECURITY=y | ||
342 | CONFIG_JFS_FS=m | ||
343 | CONFIG_JFS_POSIX_ACL=y | ||
344 | CONFIG_JFS_STATISTICS=y | ||
345 | CONFIG_XFS_FS=m | ||
346 | CONFIG_XFS_QUOTA=y | ||
347 | CONFIG_XFS_POSIX_ACL=y | ||
348 | CONFIG_XFS_RT=y | ||
349 | CONFIG_INOTIFY=y | ||
350 | CONFIG_QUOTA=y | ||
351 | CONFIG_QFMT_V1=m | ||
352 | CONFIG_QFMT_V2=m | ||
353 | CONFIG_AUTOFS_FS=m | ||
354 | CONFIG_AUTOFS4_FS=m | ||
355 | CONFIG_ISO9660_FS=m | ||
356 | CONFIG_JOLIET=y | ||
357 | CONFIG_ZISOFS=y | ||
358 | CONFIG_UDF_FS=m | ||
359 | CONFIG_MSDOS_FS=m | ||
360 | CONFIG_VFAT_FS=m | ||
361 | CONFIG_NTFS_FS=m | ||
362 | CONFIG_TMPFS=y | ||
363 | CONFIG_ADFS_FS=m | ||
364 | CONFIG_AFFS_FS=m | ||
365 | CONFIG_HFS_FS=m | ||
366 | CONFIG_HFSPLUS_FS=m | ||
367 | CONFIG_BEFS_FS=m | ||
368 | CONFIG_BFS_FS=m | ||
369 | CONFIG_EFS_FS=m | ||
370 | CONFIG_JFFS2_FS=m | ||
371 | CONFIG_CRAMFS=y | ||
372 | CONFIG_VXFS_FS=m | ||
373 | CONFIG_MINIX_FS=m | ||
374 | CONFIG_HPFS_FS=m | ||
375 | CONFIG_QNX4FS_FS=m | ||
376 | CONFIG_ROMFS_FS=m | ||
377 | CONFIG_SYSV_FS=m | ||
378 | CONFIG_UFS_FS=m | ||
379 | CONFIG_NFS_FS=y | ||
380 | CONFIG_NFS_V3=y | ||
381 | CONFIG_NFS_V4=y | ||
382 | CONFIG_ROOT_NFS=y | ||
383 | CONFIG_NFSD=m | ||
384 | CONFIG_NFSD_V4=y | ||
385 | CONFIG_RPCSEC_GSS_SPKM3=m | ||
386 | CONFIG_SMB_FS=m | ||
387 | CONFIG_CIFS=m | ||
388 | CONFIG_NCP_FS=m | ||
389 | CONFIG_NCPFS_PACKET_SIGNING=y | ||
390 | CONFIG_NCPFS_IOCTL_LOCKING=y | ||
391 | CONFIG_NCPFS_STRONG=y | ||
392 | CONFIG_NCPFS_NFS_NS=y | ||
393 | CONFIG_NCPFS_OS2_NS=y | ||
394 | CONFIG_NCPFS_NLS=y | ||
395 | CONFIG_NCPFS_EXTRAS=y | ||
396 | CONFIG_CODA_FS=m | ||
397 | CONFIG_AFS_FS=m | ||
398 | CONFIG_PARTITION_ADVANCED=y | ||
399 | CONFIG_ACORN_PARTITION=y | ||
400 | CONFIG_ACORN_PARTITION_ICS=y | ||
401 | CONFIG_ACORN_PARTITION_RISCIX=y | ||
402 | CONFIG_OSF_PARTITION=y | ||
403 | CONFIG_AMIGA_PARTITION=y | ||
404 | CONFIG_ATARI_PARTITION=y | ||
405 | CONFIG_MAC_PARTITION=y | ||
406 | CONFIG_BSD_DISKLABEL=y | ||
407 | CONFIG_MINIX_SUBPARTITION=y | ||
408 | CONFIG_SOLARIS_X86_PARTITION=y | ||
409 | CONFIG_UNIXWARE_DISKLABEL=y | ||
410 | CONFIG_LDM_PARTITION=y | ||
411 | CONFIG_SGI_PARTITION=y | ||
412 | CONFIG_ULTRIX_PARTITION=y | ||
413 | CONFIG_SUN_PARTITION=y | ||
414 | CONFIG_NLS_DEFAULT="cp437" | ||
415 | CONFIG_NLS_CODEPAGE_437=m | ||
416 | CONFIG_NLS_CODEPAGE_737=m | ||
417 | CONFIG_NLS_CODEPAGE_775=m | ||
418 | CONFIG_NLS_CODEPAGE_850=m | ||
419 | CONFIG_NLS_CODEPAGE_852=m | ||
420 | CONFIG_NLS_CODEPAGE_855=m | ||
421 | CONFIG_NLS_CODEPAGE_857=m | ||
422 | CONFIG_NLS_CODEPAGE_860=m | ||
423 | CONFIG_NLS_CODEPAGE_861=m | ||
424 | CONFIG_NLS_CODEPAGE_862=m | ||
425 | CONFIG_NLS_CODEPAGE_863=m | ||
426 | CONFIG_NLS_CODEPAGE_864=m | ||
427 | CONFIG_NLS_CODEPAGE_865=m | ||
428 | CONFIG_NLS_CODEPAGE_866=m | ||
429 | CONFIG_NLS_CODEPAGE_869=m | ||
430 | CONFIG_NLS_CODEPAGE_936=m | ||
431 | CONFIG_NLS_CODEPAGE_950=m | ||
432 | CONFIG_NLS_CODEPAGE_932=m | ||
433 | CONFIG_NLS_CODEPAGE_949=m | ||
434 | CONFIG_NLS_CODEPAGE_874=m | ||
435 | CONFIG_NLS_ISO8859_8=m | ||
436 | CONFIG_NLS_CODEPAGE_1250=m | ||
437 | CONFIG_NLS_CODEPAGE_1251=m | ||
438 | CONFIG_NLS_ASCII=m | ||
439 | CONFIG_NLS_ISO8859_1=m | ||
440 | CONFIG_NLS_ISO8859_2=m | ||
441 | CONFIG_NLS_ISO8859_3=m | ||
442 | CONFIG_NLS_ISO8859_4=m | ||
443 | CONFIG_NLS_ISO8859_5=m | ||
444 | CONFIG_NLS_ISO8859_6=m | ||
445 | CONFIG_NLS_ISO8859_7=m | ||
446 | CONFIG_NLS_ISO8859_9=m | ||
447 | CONFIG_NLS_ISO8859_13=m | ||
448 | CONFIG_NLS_ISO8859_14=m | ||
449 | CONFIG_NLS_ISO8859_15=m | ||
450 | CONFIG_NLS_KOI8_R=m | ||
451 | CONFIG_NLS_KOI8_U=m | ||
452 | CONFIG_MAGIC_SYSRQ=y | ||
453 | CONFIG_DEBUG_KERNEL=y | ||
454 | CONFIG_DEBUG_MUTEXES=y | ||
455 | # CONFIG_DEBUG_BUGVERBOSE is not set | ||
456 | CONFIG_SECURITY=y | ||
457 | CONFIG_CRYPTO_NULL=m | ||
458 | CONFIG_CRYPTO_TEST=m | ||
459 | CONFIG_CRYPTO_HMAC=y | ||
460 | CONFIG_CRYPTO_MD4=m | ||
461 | CONFIG_CRYPTO_MICHAEL_MIC=m | ||
462 | CONFIG_CRYPTO_SHA256=m | ||
463 | CONFIG_CRYPTO_SHA512=m | ||
464 | CONFIG_CRYPTO_WP512=m | ||
465 | CONFIG_CRYPTO_ANUBIS=m | ||
466 | CONFIG_CRYPTO_BLOWFISH=m | ||
467 | CONFIG_CRYPTO_CAST6=m | ||
468 | CONFIG_CRYPTO_KHAZAD=m | ||
469 | CONFIG_CRYPTO_SERPENT=m | ||
470 | CONFIG_CRYPTO_TEA=m | ||
471 | CONFIG_CRYPTO_TWOFISH=m | ||
472 | CONFIG_CRC16=m | ||
diff --git a/arch/arm/configs/prima2_defconfig b/arch/arm/configs/prima2_defconfig index c328ac65479a..807d4e2acb17 100644 --- a/arch/arm/configs/prima2_defconfig +++ b/arch/arm/configs/prima2_defconfig | |||
@@ -1,4 +1,6 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | 1 | CONFIG_EXPERIMENTAL=y |
2 | CONFIG_NO_HZ=y | ||
3 | CONFIG_HIGH_RES_TIMERS=y | ||
2 | CONFIG_RELAY=y | 4 | CONFIG_RELAY=y |
3 | CONFIG_BLK_DEV_INITRD=y | 5 | CONFIG_BLK_DEV_INITRD=y |
4 | CONFIG_KALLSYMS_ALL=y | 6 | CONFIG_KALLSYMS_ALL=y |
@@ -8,9 +10,7 @@ CONFIG_MODULE_UNLOAD=y | |||
8 | CONFIG_PARTITION_ADVANCED=y | 10 | CONFIG_PARTITION_ADVANCED=y |
9 | CONFIG_BSD_DISKLABEL=y | 11 | CONFIG_BSD_DISKLABEL=y |
10 | CONFIG_SOLARIS_X86_PARTITION=y | 12 | CONFIG_SOLARIS_X86_PARTITION=y |
11 | CONFIG_ARCH_PRIMA2=y | 13 | CONFIG_ARCH_SIRF=y |
12 | CONFIG_NO_HZ=y | ||
13 | CONFIG_HIGH_RES_TIMERS=y | ||
14 | CONFIG_PREEMPT=y | 14 | CONFIG_PREEMPT=y |
15 | CONFIG_AEABI=y | 15 | CONFIG_AEABI=y |
16 | CONFIG_KEXEC=y | 16 | CONFIG_KEXEC=y |
@@ -36,7 +36,6 @@ CONFIG_SPI=y | |||
36 | CONFIG_SPI_SIRF=y | 36 | CONFIG_SPI_SIRF=y |
37 | CONFIG_SPI_SPIDEV=y | 37 | CONFIG_SPI_SPIDEV=y |
38 | # CONFIG_HWMON is not set | 38 | # CONFIG_HWMON is not set |
39 | # CONFIG_HID_SUPPORT is not set | ||
40 | CONFIG_USB_GADGET=y | 39 | CONFIG_USB_GADGET=y |
41 | CONFIG_USB_FILE_STORAGE=m | 40 | CONFIG_USB_FILE_STORAGE=m |
42 | CONFIG_USB_MASS_STORAGE=m | 41 | CONFIG_USB_MASS_STORAGE=m |
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig index db2245353f0f..0d6bb738c6de 100644 --- a/arch/arm/configs/tegra_defconfig +++ b/arch/arm/configs/tegra_defconfig | |||
@@ -145,6 +145,8 @@ CONFIG_MMC_SDHCI_TEGRA=y | |||
145 | CONFIG_RTC_CLASS=y | 145 | CONFIG_RTC_CLASS=y |
146 | CONFIG_RTC_DRV_EM3027=y | 146 | CONFIG_RTC_DRV_EM3027=y |
147 | CONFIG_RTC_DRV_TEGRA=y | 147 | CONFIG_RTC_DRV_TEGRA=y |
148 | CONFIG_DMADEVICES=y | ||
149 | CONFIG_TEGRA20_APB_DMA=y | ||
148 | CONFIG_STAGING=y | 150 | CONFIG_STAGING=y |
149 | CONFIG_SENSORS_ISL29018=y | 151 | CONFIG_SENSORS_ISL29018=y |
150 | CONFIG_SENSORS_ISL29028=y | 152 | CONFIG_SENSORS_ISL29028=y |
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h index 2ff2c75a4639..02fe2fbe2477 100644 --- a/arch/arm/include/asm/hardware/iop3xx.h +++ b/arch/arm/include/asm/hardware/iop3xx.h | |||
@@ -217,18 +217,8 @@ extern int iop3xx_get_init_atu(void); | |||
217 | #define IOP3XX_PCI_LOWER_MEM_PA 0x80000000 | 217 | #define IOP3XX_PCI_LOWER_MEM_PA 0x80000000 |
218 | #define IOP3XX_PCI_MEM_WINDOW_SIZE 0x08000000 | 218 | #define IOP3XX_PCI_MEM_WINDOW_SIZE 0x08000000 |
219 | 219 | ||
220 | #define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000 | ||
221 | #define IOP3XX_PCI_LOWER_IO_PA 0x90000000 | 220 | #define IOP3XX_PCI_LOWER_IO_PA 0x90000000 |
222 | #define IOP3XX_PCI_LOWER_IO_VA 0xfe000000 | 221 | #define IOP3XX_PCI_LOWER_IO_BA 0x00000000 |
223 | #define IOP3XX_PCI_LOWER_IO_BA 0x90000000 | ||
224 | #define IOP3XX_PCI_UPPER_IO_PA (IOP3XX_PCI_LOWER_IO_PA +\ | ||
225 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) | ||
226 | #define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\ | ||
227 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) | ||
228 | #define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) (addr) -\ | ||
229 | IOP3XX_PCI_LOWER_IO_PA) +\ | ||
230 | IOP3XX_PCI_LOWER_IO_VA) | ||
231 | |||
232 | 222 | ||
233 | #ifndef __ASSEMBLY__ | 223 | #ifndef __ASSEMBLY__ |
234 | 224 | ||
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 815c669fec0a..8f4db67533e5 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -113,11 +113,19 @@ static inline void __iomem *__typesafe_io(unsigned long addr) | |||
113 | #define __iowmb() do { } while (0) | 113 | #define __iowmb() do { } while (0) |
114 | #endif | 114 | #endif |
115 | 115 | ||
116 | /* PCI fixed i/o mapping */ | ||
117 | #define PCI_IO_VIRT_BASE 0xfee00000 | ||
118 | |||
119 | extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr); | ||
120 | |||
116 | /* | 121 | /* |
117 | * Now, pick up the machine-defined IO definitions | 122 | * Now, pick up the machine-defined IO definitions |
118 | */ | 123 | */ |
119 | #ifdef CONFIG_NEED_MACH_IO_H | 124 | #ifdef CONFIG_NEED_MACH_IO_H |
120 | #include <mach/io.h> | 125 | #include <mach/io.h> |
126 | #elif defined(CONFIG_PCI) | ||
127 | #define IO_SPACE_LIMIT ((resource_size_t)0xfffff) | ||
128 | #define __io(a) __typesafe_io(PCI_IO_VIRT_BASE + ((a) & IO_SPACE_LIMIT)) | ||
121 | #else | 129 | #else |
122 | #define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT) | 130 | #define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT) |
123 | #endif | 131 | #endif |
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h index a6efcdd6fd25..195ac2f9d3d3 100644 --- a/arch/arm/include/asm/mach/map.h +++ b/arch/arm/include/asm/mach/map.h | |||
@@ -9,6 +9,9 @@ | |||
9 | * | 9 | * |
10 | * Page table mapping constructs and function prototypes | 10 | * Page table mapping constructs and function prototypes |
11 | */ | 11 | */ |
12 | #ifndef __ASM_MACH_MAP_H | ||
13 | #define __ASM_MACH_MAP_H | ||
14 | |||
12 | #include <asm/io.h> | 15 | #include <asm/io.h> |
13 | 16 | ||
14 | struct map_desc { | 17 | struct map_desc { |
@@ -34,6 +37,8 @@ struct map_desc { | |||
34 | 37 | ||
35 | #ifdef CONFIG_MMU | 38 | #ifdef CONFIG_MMU |
36 | extern void iotable_init(struct map_desc *, int); | 39 | extern void iotable_init(struct map_desc *, int); |
40 | extern void vm_reserve_area_early(unsigned long addr, unsigned long size, | ||
41 | void *caller); | ||
37 | 42 | ||
38 | struct mem_type; | 43 | struct mem_type; |
39 | extern const struct mem_type *get_mem_type(unsigned int type); | 44 | extern const struct mem_type *get_mem_type(unsigned int type); |
@@ -44,4 +49,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys, | |||
44 | const struct mem_type *mtype); | 49 | const struct mem_type *mtype); |
45 | #else | 50 | #else |
46 | #define iotable_init(map,num) do { } while (0) | 51 | #define iotable_init(map,num) do { } while (0) |
52 | #define vm_reserve_area_early(a,s,c) do { } while (0) | ||
53 | #endif | ||
54 | |||
47 | #endif | 55 | #endif |
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index 26c511fddf8f..db9fedb57f2c 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_MACH_PCI_H | 11 | #ifndef __ASM_MACH_PCI_H |
12 | #define __ASM_MACH_PCI_H | 12 | #define __ASM_MACH_PCI_H |
13 | 13 | ||
14 | #include <linux/ioport.h> | ||
15 | |||
14 | struct pci_sys_data; | 16 | struct pci_sys_data; |
15 | struct pci_ops; | 17 | struct pci_ops; |
16 | struct pci_bus; | 18 | struct pci_bus; |
@@ -42,6 +44,8 @@ struct pci_sys_data { | |||
42 | unsigned long io_offset; /* bus->cpu IO mapping offset */ | 44 | unsigned long io_offset; /* bus->cpu IO mapping offset */ |
43 | struct pci_bus *bus; /* PCI bus */ | 45 | struct pci_bus *bus; /* PCI bus */ |
44 | struct list_head resources; /* root bus resources (apertures) */ | 46 | struct list_head resources; /* root bus resources (apertures) */ |
47 | struct resource io_res; | ||
48 | char io_res_name[12]; | ||
45 | /* Bridge swizzling */ | 49 | /* Bridge swizzling */ |
46 | u8 (*swizzle)(struct pci_dev *, u8 *); | 50 | u8 (*swizzle)(struct pci_dev *, u8 *); |
47 | /* IRQ mapping */ | 51 | /* IRQ mapping */ |
@@ -55,6 +59,15 @@ struct pci_sys_data { | |||
55 | void pci_common_init(struct hw_pci *); | 59 | void pci_common_init(struct hw_pci *); |
56 | 60 | ||
57 | /* | 61 | /* |
62 | * Setup early fixed I/O mapping. | ||
63 | */ | ||
64 | #if defined(CONFIG_PCI) | ||
65 | extern void pci_map_io_early(unsigned long pfn); | ||
66 | #else | ||
67 | static inline void pci_map_io_early(unsigned long pfn) {} | ||
68 | #endif | ||
69 | |||
70 | /* | ||
58 | * PCI controllers | 71 | * PCI controllers |
59 | */ | 72 | */ |
60 | extern struct pci_ops iop3xx_ops; | 73 | extern struct pci_ops iop3xx_ops; |
diff --git a/arch/arm/include/asm/perf_event.h b/arch/arm/include/asm/perf_event.h index e074948d8143..625cd621a436 100644 --- a/arch/arm/include/asm/perf_event.h +++ b/arch/arm/include/asm/perf_event.h | |||
@@ -12,6 +12,13 @@ | |||
12 | #ifndef __ARM_PERF_EVENT_H__ | 12 | #ifndef __ARM_PERF_EVENT_H__ |
13 | #define __ARM_PERF_EVENT_H__ | 13 | #define __ARM_PERF_EVENT_H__ |
14 | 14 | ||
15 | /* Nothing to see here... */ | 15 | /* |
16 | * The ARMv7 CPU PMU supports up to 32 event counters. | ||
17 | */ | ||
18 | #define ARMPMU_MAX_HWEVENTS 32 | ||
19 | |||
20 | #define HW_OP_UNSUPPORTED 0xFFFF | ||
21 | #define C(_x) PERF_COUNT_HW_CACHE_##_x | ||
22 | #define CACHE_OP_UNSUPPORTED 0xFFFF | ||
16 | 23 | ||
17 | #endif /* __ARM_PERF_EVENT_H__ */ | 24 | #endif /* __ARM_PERF_EVENT_H__ */ |
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h index 4432305f4a2a..a26170dce02e 100644 --- a/arch/arm/include/asm/pmu.h +++ b/arch/arm/include/asm/pmu.h | |||
@@ -16,69 +16,30 @@ | |||
16 | #include <linux/perf_event.h> | 16 | #include <linux/perf_event.h> |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Types of PMUs that can be accessed directly and require mutual | ||
20 | * exclusion between profiling tools. | ||
21 | */ | ||
22 | enum arm_pmu_type { | ||
23 | ARM_PMU_DEVICE_CPU = 0, | ||
24 | ARM_NUM_PMU_DEVICES, | ||
25 | }; | ||
26 | |||
27 | /* | ||
28 | * struct arm_pmu_platdata - ARM PMU platform data | 19 | * struct arm_pmu_platdata - ARM PMU platform data |
29 | * | 20 | * |
30 | * @handle_irq: an optional handler which will be called from the | 21 | * @handle_irq: an optional handler which will be called from the |
31 | * interrupt and passed the address of the low level handler, | 22 | * interrupt and passed the address of the low level handler, |
32 | * and can be used to implement any platform specific handling | 23 | * and can be used to implement any platform specific handling |
33 | * before or after calling it. | 24 | * before or after calling it. |
34 | * @enable_irq: an optional handler which will be called after | 25 | * @runtime_resume: an optional handler which will be called by the |
35 | * request_irq and be used to handle some platform specific | 26 | * runtime PM framework following a call to pm_runtime_get(). |
36 | * irq enablement | 27 | * Note that if pm_runtime_get() is called more than once in |
37 | * @disable_irq: an optional handler which will be called before | 28 | * succession this handler will only be called once. |
38 | * free_irq and be used to handle some platform specific | 29 | * @runtime_suspend: an optional handler which will be called by the |
39 | * irq disablement | 30 | * runtime PM framework following a call to pm_runtime_put(). |
31 | * Note that if pm_runtime_get() is called more than once in | ||
32 | * succession this handler will only be called following the | ||
33 | * final call to pm_runtime_put() that actually disables the | ||
34 | * hardware. | ||
40 | */ | 35 | */ |
41 | struct arm_pmu_platdata { | 36 | struct arm_pmu_platdata { |
42 | irqreturn_t (*handle_irq)(int irq, void *dev, | 37 | irqreturn_t (*handle_irq)(int irq, void *dev, |
43 | irq_handler_t pmu_handler); | 38 | irq_handler_t pmu_handler); |
44 | void (*enable_irq)(int irq); | 39 | int (*runtime_resume)(struct device *dev); |
45 | void (*disable_irq)(int irq); | 40 | int (*runtime_suspend)(struct device *dev); |
46 | }; | 41 | }; |
47 | 42 | ||
48 | #ifdef CONFIG_CPU_HAS_PMU | ||
49 | |||
50 | /** | ||
51 | * reserve_pmu() - reserve the hardware performance counters | ||
52 | * | ||
53 | * Reserve the hardware performance counters in the system for exclusive use. | ||
54 | * Returns 0 on success or -EBUSY if the lock is already held. | ||
55 | */ | ||
56 | extern int | ||
57 | reserve_pmu(enum arm_pmu_type type); | ||
58 | |||
59 | /** | ||
60 | * release_pmu() - Relinquish control of the performance counters | ||
61 | * | ||
62 | * Release the performance counters and allow someone else to use them. | ||
63 | */ | ||
64 | extern void | ||
65 | release_pmu(enum arm_pmu_type type); | ||
66 | |||
67 | #else /* CONFIG_CPU_HAS_PMU */ | ||
68 | |||
69 | #include <linux/err.h> | ||
70 | |||
71 | static inline int | ||
72 | reserve_pmu(enum arm_pmu_type type) | ||
73 | { | ||
74 | return -ENODEV; | ||
75 | } | ||
76 | |||
77 | static inline void | ||
78 | release_pmu(enum arm_pmu_type type) { } | ||
79 | |||
80 | #endif /* CONFIG_CPU_HAS_PMU */ | ||
81 | |||
82 | #ifdef CONFIG_HW_PERF_EVENTS | 43 | #ifdef CONFIG_HW_PERF_EVENTS |
83 | 44 | ||
84 | /* The events for a given PMU register set. */ | 45 | /* The events for a given PMU register set. */ |
@@ -103,7 +64,6 @@ struct pmu_hw_events { | |||
103 | 64 | ||
104 | struct arm_pmu { | 65 | struct arm_pmu { |
105 | struct pmu pmu; | 66 | struct pmu pmu; |
106 | enum arm_pmu_type type; | ||
107 | cpumask_t active_irqs; | 67 | cpumask_t active_irqs; |
108 | char *name; | 68 | char *name; |
109 | irqreturn_t (*handle_irq)(int irq_num, void *dev); | 69 | irqreturn_t (*handle_irq)(int irq_num, void *dev); |
@@ -118,6 +78,8 @@ struct arm_pmu { | |||
118 | void (*start)(void); | 78 | void (*start)(void); |
119 | void (*stop)(void); | 79 | void (*stop)(void); |
120 | void (*reset)(void *); | 80 | void (*reset)(void *); |
81 | int (*request_irq)(irq_handler_t handler); | ||
82 | void (*free_irq)(void); | ||
121 | int (*map_event)(struct perf_event *event); | 83 | int (*map_event)(struct perf_event *event); |
122 | int num_events; | 84 | int num_events; |
123 | atomic_t active_events; | 85 | atomic_t active_events; |
@@ -129,7 +91,9 @@ struct arm_pmu { | |||
129 | 91 | ||
130 | #define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu)) | 92 | #define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu)) |
131 | 93 | ||
132 | int __init armpmu_register(struct arm_pmu *armpmu, char *name, int type); | 94 | extern const struct dev_pm_ops armpmu_dev_pm_ops; |
95 | |||
96 | int armpmu_register(struct arm_pmu *armpmu, char *name, int type); | ||
133 | 97 | ||
134 | u64 armpmu_event_update(struct perf_event *event, | 98 | u64 armpmu_event_update(struct perf_event *event, |
135 | struct hw_perf_event *hwc, | 99 | struct hw_perf_event *hwc, |
@@ -139,6 +103,13 @@ int armpmu_event_set_period(struct perf_event *event, | |||
139 | struct hw_perf_event *hwc, | 103 | struct hw_perf_event *hwc, |
140 | int idx); | 104 | int idx); |
141 | 105 | ||
106 | int armpmu_map_event(struct perf_event *event, | ||
107 | const unsigned (*event_map)[PERF_COUNT_HW_MAX], | ||
108 | const unsigned (*cache_map)[PERF_COUNT_HW_CACHE_MAX] | ||
109 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
110 | [PERF_COUNT_HW_CACHE_RESULT_MAX], | ||
111 | u32 raw_event_mask); | ||
112 | |||
142 | #endif /* CONFIG_HW_PERF_EVENTS */ | 113 | #endif /* CONFIG_HW_PERF_EVENTS */ |
143 | 114 | ||
144 | #endif /* __ARM_PMU_H__ */ | 115 | #endif /* __ARM_PMU_H__ */ |
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 7ad2d5cf7008..1c4321430737 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -69,8 +69,7 @@ obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o | |||
69 | obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o | 69 | obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o |
70 | obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o | 70 | obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o |
71 | obj-$(CONFIG_IWMMXT) += iwmmxt.o | 71 | obj-$(CONFIG_IWMMXT) += iwmmxt.o |
72 | obj-$(CONFIG_CPU_HAS_PMU) += pmu.o | 72 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o |
73 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o | ||
74 | AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt | 73 | AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt |
75 | obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o | 74 | obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o |
76 | 75 | ||
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 9cf16b83bbb5..9b722612553d 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
14 | 14 | ||
15 | #include <asm/mach-types.h> | 15 | #include <asm/mach-types.h> |
16 | #include <asm/mach/map.h> | ||
16 | #include <asm/mach/pci.h> | 17 | #include <asm/mach/pci.h> |
17 | 18 | ||
18 | static int debug_pci; | 19 | static int debug_pci; |
@@ -414,6 +415,38 @@ static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |||
414 | return irq; | 415 | return irq; |
415 | } | 416 | } |
416 | 417 | ||
418 | static int __init pcibios_init_resources(int busnr, struct pci_sys_data *sys) | ||
419 | { | ||
420 | int ret; | ||
421 | struct pci_host_bridge_window *window; | ||
422 | |||
423 | if (list_empty(&sys->resources)) { | ||
424 | pci_add_resource_offset(&sys->resources, | ||
425 | &iomem_resource, sys->mem_offset); | ||
426 | } | ||
427 | |||
428 | list_for_each_entry(window, &sys->resources, list) { | ||
429 | if (resource_type(window->res) == IORESOURCE_IO) | ||
430 | return 0; | ||
431 | } | ||
432 | |||
433 | sys->io_res.start = (busnr * SZ_64K) ? : pcibios_min_io; | ||
434 | sys->io_res.end = (busnr + 1) * SZ_64K - 1; | ||
435 | sys->io_res.flags = IORESOURCE_IO; | ||
436 | sys->io_res.name = sys->io_res_name; | ||
437 | sprintf(sys->io_res_name, "PCI%d I/O", busnr); | ||
438 | |||
439 | ret = request_resource(&ioport_resource, &sys->io_res); | ||
440 | if (ret) { | ||
441 | pr_err("PCI: unable to allocate I/O port region (%d)\n", ret); | ||
442 | return ret; | ||
443 | } | ||
444 | pci_add_resource_offset(&sys->resources, &sys->io_res, | ||
445 | sys->io_offset); | ||
446 | |||
447 | return 0; | ||
448 | } | ||
449 | |||
417 | static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head) | 450 | static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head) |
418 | { | 451 | { |
419 | struct pci_sys_data *sys = NULL; | 452 | struct pci_sys_data *sys = NULL; |
@@ -436,11 +469,10 @@ static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head) | |||
436 | ret = hw->setup(nr, sys); | 469 | ret = hw->setup(nr, sys); |
437 | 470 | ||
438 | if (ret > 0) { | 471 | if (ret > 0) { |
439 | if (list_empty(&sys->resources)) { | 472 | ret = pcibios_init_resources(nr, sys); |
440 | pci_add_resource_offset(&sys->resources, | 473 | if (ret) { |
441 | &ioport_resource, sys->io_offset); | 474 | kfree(sys); |
442 | pci_add_resource_offset(&sys->resources, | 475 | break; |
443 | &iomem_resource, sys->mem_offset); | ||
444 | } | 476 | } |
445 | 477 | ||
446 | if (hw->scan) | 478 | if (hw->scan) |
@@ -618,3 +650,15 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
618 | 650 | ||
619 | return 0; | 651 | return 0; |
620 | } | 652 | } |
653 | |||
654 | void __init pci_map_io_early(unsigned long pfn) | ||
655 | { | ||
656 | struct map_desc pci_io_desc = { | ||
657 | .virtual = PCI_IO_VIRT_BASE, | ||
658 | .type = MT_DEVICE, | ||
659 | .length = SZ_64K, | ||
660 | }; | ||
661 | |||
662 | pci_io_desc.pfn = pfn; | ||
663 | iotable_init(&pci_io_desc, 1); | ||
664 | } | ||
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index ab243b87118d..93971b1a4f0b 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -12,68 +12,15 @@ | |||
12 | */ | 12 | */ |
13 | #define pr_fmt(fmt) "hw perfevents: " fmt | 13 | #define pr_fmt(fmt) "hw perfevents: " fmt |
14 | 14 | ||
15 | #include <linux/bitmap.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
18 | #include <linux/export.h> | ||
19 | #include <linux/perf_event.h> | ||
20 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
21 | #include <linux/spinlock.h> | 17 | #include <linux/pm_runtime.h> |
22 | #include <linux/uaccess.h> | 18 | #include <linux/uaccess.h> |
23 | 19 | ||
24 | #include <asm/cputype.h> | ||
25 | #include <asm/irq.h> | ||
26 | #include <asm/irq_regs.h> | 20 | #include <asm/irq_regs.h> |
27 | #include <asm/pmu.h> | 21 | #include <asm/pmu.h> |
28 | #include <asm/stacktrace.h> | 22 | #include <asm/stacktrace.h> |
29 | 23 | ||
30 | /* | ||
31 | * ARMv6 supports a maximum of 3 events, starting from index 0. If we add | ||
32 | * another platform that supports more, we need to increase this to be the | ||
33 | * largest of all platforms. | ||
34 | * | ||
35 | * ARMv7 supports up to 32 events: | ||
36 | * cycle counter CCNT + 31 events counters CNT0..30. | ||
37 | * Cortex-A8 has 1+4 counters, Cortex-A9 has 1+6 counters. | ||
38 | */ | ||
39 | #define ARMPMU_MAX_HWEVENTS 32 | ||
40 | |||
41 | static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events); | ||
42 | static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask); | ||
43 | static DEFINE_PER_CPU(struct pmu_hw_events, cpu_hw_events); | ||
44 | |||
45 | #define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu)) | ||
46 | |||
47 | /* Set at runtime when we know what CPU type we are. */ | ||
48 | static struct arm_pmu *cpu_pmu; | ||
49 | |||
50 | const char *perf_pmu_name(void) | ||
51 | { | ||
52 | if (!cpu_pmu) | ||
53 | return NULL; | ||
54 | |||
55 | return cpu_pmu->pmu.name; | ||
56 | } | ||
57 | EXPORT_SYMBOL_GPL(perf_pmu_name); | ||
58 | |||
59 | int perf_num_counters(void) | ||
60 | { | ||
61 | int max_events = 0; | ||
62 | |||
63 | if (cpu_pmu != NULL) | ||
64 | max_events = cpu_pmu->num_events; | ||
65 | |||
66 | return max_events; | ||
67 | } | ||
68 | EXPORT_SYMBOL_GPL(perf_num_counters); | ||
69 | |||
70 | #define HW_OP_UNSUPPORTED 0xFFFF | ||
71 | |||
72 | #define C(_x) \ | ||
73 | PERF_COUNT_HW_CACHE_##_x | ||
74 | |||
75 | #define CACHE_OP_UNSUPPORTED 0xFFFF | ||
76 | |||
77 | static int | 24 | static int |
78 | armpmu_map_cache_event(const unsigned (*cache_map) | 25 | armpmu_map_cache_event(const unsigned (*cache_map) |
79 | [PERF_COUNT_HW_CACHE_MAX] | 26 | [PERF_COUNT_HW_CACHE_MAX] |
@@ -104,7 +51,7 @@ armpmu_map_cache_event(const unsigned (*cache_map) | |||
104 | } | 51 | } |
105 | 52 | ||
106 | static int | 53 | static int |
107 | armpmu_map_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config) | 54 | armpmu_map_hw_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config) |
108 | { | 55 | { |
109 | int mapping = (*event_map)[config]; | 56 | int mapping = (*event_map)[config]; |
110 | return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping; | 57 | return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping; |
@@ -116,19 +63,20 @@ armpmu_map_raw_event(u32 raw_event_mask, u64 config) | |||
116 | return (int)(config & raw_event_mask); | 63 | return (int)(config & raw_event_mask); |
117 | } | 64 | } |
118 | 65 | ||
119 | static int map_cpu_event(struct perf_event *event, | 66 | int |
120 | const unsigned (*event_map)[PERF_COUNT_HW_MAX], | 67 | armpmu_map_event(struct perf_event *event, |
121 | const unsigned (*cache_map) | 68 | const unsigned (*event_map)[PERF_COUNT_HW_MAX], |
122 | [PERF_COUNT_HW_CACHE_MAX] | 69 | const unsigned (*cache_map) |
123 | [PERF_COUNT_HW_CACHE_OP_MAX] | 70 | [PERF_COUNT_HW_CACHE_MAX] |
124 | [PERF_COUNT_HW_CACHE_RESULT_MAX], | 71 | [PERF_COUNT_HW_CACHE_OP_MAX] |
125 | u32 raw_event_mask) | 72 | [PERF_COUNT_HW_CACHE_RESULT_MAX], |
73 | u32 raw_event_mask) | ||
126 | { | 74 | { |
127 | u64 config = event->attr.config; | 75 | u64 config = event->attr.config; |
128 | 76 | ||
129 | switch (event->attr.type) { | 77 | switch (event->attr.type) { |
130 | case PERF_TYPE_HARDWARE: | 78 | case PERF_TYPE_HARDWARE: |
131 | return armpmu_map_event(event_map, config); | 79 | return armpmu_map_hw_event(event_map, config); |
132 | case PERF_TYPE_HW_CACHE: | 80 | case PERF_TYPE_HW_CACHE: |
133 | return armpmu_map_cache_event(cache_map, config); | 81 | return armpmu_map_cache_event(cache_map, config); |
134 | case PERF_TYPE_RAW: | 82 | case PERF_TYPE_RAW: |
@@ -222,7 +170,6 @@ armpmu_stop(struct perf_event *event, int flags) | |||
222 | */ | 170 | */ |
223 | if (!(hwc->state & PERF_HES_STOPPED)) { | 171 | if (!(hwc->state & PERF_HES_STOPPED)) { |
224 | armpmu->disable(hwc, hwc->idx); | 172 | armpmu->disable(hwc, hwc->idx); |
225 | barrier(); /* why? */ | ||
226 | armpmu_event_update(event, hwc, hwc->idx); | 173 | armpmu_event_update(event, hwc, hwc->idx); |
227 | hwc->state |= PERF_HES_STOPPED | PERF_HES_UPTODATE; | 174 | hwc->state |= PERF_HES_STOPPED | PERF_HES_UPTODATE; |
228 | } | 175 | } |
@@ -350,99 +297,41 @@ validate_group(struct perf_event *event) | |||
350 | return 0; | 297 | return 0; |
351 | } | 298 | } |
352 | 299 | ||
353 | static irqreturn_t armpmu_platform_irq(int irq, void *dev) | 300 | static irqreturn_t armpmu_dispatch_irq(int irq, void *dev) |
354 | { | 301 | { |
355 | struct arm_pmu *armpmu = (struct arm_pmu *) dev; | 302 | struct arm_pmu *armpmu = (struct arm_pmu *) dev; |
356 | struct platform_device *plat_device = armpmu->plat_device; | 303 | struct platform_device *plat_device = armpmu->plat_device; |
357 | struct arm_pmu_platdata *plat = dev_get_platdata(&plat_device->dev); | 304 | struct arm_pmu_platdata *plat = dev_get_platdata(&plat_device->dev); |
358 | 305 | ||
359 | return plat->handle_irq(irq, dev, armpmu->handle_irq); | 306 | if (plat && plat->handle_irq) |
307 | return plat->handle_irq(irq, dev, armpmu->handle_irq); | ||
308 | else | ||
309 | return armpmu->handle_irq(irq, dev); | ||
360 | } | 310 | } |
361 | 311 | ||
362 | static void | 312 | static void |
363 | armpmu_release_hardware(struct arm_pmu *armpmu) | 313 | armpmu_release_hardware(struct arm_pmu *armpmu) |
364 | { | 314 | { |
365 | int i, irq, irqs; | 315 | armpmu->free_irq(); |
366 | struct platform_device *pmu_device = armpmu->plat_device; | 316 | pm_runtime_put_sync(&armpmu->plat_device->dev); |
367 | struct arm_pmu_platdata *plat = | ||
368 | dev_get_platdata(&pmu_device->dev); | ||
369 | |||
370 | irqs = min(pmu_device->num_resources, num_possible_cpus()); | ||
371 | |||
372 | for (i = 0; i < irqs; ++i) { | ||
373 | if (!cpumask_test_and_clear_cpu(i, &armpmu->active_irqs)) | ||
374 | continue; | ||
375 | irq = platform_get_irq(pmu_device, i); | ||
376 | if (irq >= 0) { | ||
377 | if (plat && plat->disable_irq) | ||
378 | plat->disable_irq(irq); | ||
379 | free_irq(irq, armpmu); | ||
380 | } | ||
381 | } | ||
382 | |||
383 | release_pmu(armpmu->type); | ||
384 | } | 317 | } |
385 | 318 | ||
386 | static int | 319 | static int |
387 | armpmu_reserve_hardware(struct arm_pmu *armpmu) | 320 | armpmu_reserve_hardware(struct arm_pmu *armpmu) |
388 | { | 321 | { |
389 | struct arm_pmu_platdata *plat; | 322 | int err; |
390 | irq_handler_t handle_irq; | ||
391 | int i, err, irq, irqs; | ||
392 | struct platform_device *pmu_device = armpmu->plat_device; | 323 | struct platform_device *pmu_device = armpmu->plat_device; |
393 | 324 | ||
394 | if (!pmu_device) | 325 | if (!pmu_device) |
395 | return -ENODEV; | 326 | return -ENODEV; |
396 | 327 | ||
397 | err = reserve_pmu(armpmu->type); | 328 | pm_runtime_get_sync(&pmu_device->dev); |
329 | err = armpmu->request_irq(armpmu_dispatch_irq); | ||
398 | if (err) { | 330 | if (err) { |
399 | pr_warning("unable to reserve pmu\n"); | 331 | armpmu_release_hardware(armpmu); |
400 | return err; | 332 | return err; |
401 | } | 333 | } |
402 | 334 | ||
403 | plat = dev_get_platdata(&pmu_device->dev); | ||
404 | if (plat && plat->handle_irq) | ||
405 | handle_irq = armpmu_platform_irq; | ||
406 | else | ||
407 | handle_irq = armpmu->handle_irq; | ||
408 | |||
409 | irqs = min(pmu_device->num_resources, num_possible_cpus()); | ||
410 | if (irqs < 1) { | ||
411 | pr_err("no irqs for PMUs defined\n"); | ||
412 | return -ENODEV; | ||
413 | } | ||
414 | |||
415 | for (i = 0; i < irqs; ++i) { | ||
416 | err = 0; | ||
417 | irq = platform_get_irq(pmu_device, i); | ||
418 | if (irq < 0) | ||
419 | continue; | ||
420 | |||
421 | /* | ||
422 | * If we have a single PMU interrupt that we can't shift, | ||
423 | * assume that we're running on a uniprocessor machine and | ||
424 | * continue. Otherwise, continue without this interrupt. | ||
425 | */ | ||
426 | if (irq_set_affinity(irq, cpumask_of(i)) && irqs > 1) { | ||
427 | pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n", | ||
428 | irq, i); | ||
429 | continue; | ||
430 | } | ||
431 | |||
432 | err = request_irq(irq, handle_irq, | ||
433 | IRQF_DISABLED | IRQF_NOBALANCING, | ||
434 | "arm-pmu", armpmu); | ||
435 | if (err) { | ||
436 | pr_err("unable to request IRQ%d for ARM PMU counters\n", | ||
437 | irq); | ||
438 | armpmu_release_hardware(armpmu); | ||
439 | return err; | ||
440 | } else if (plat && plat->enable_irq) | ||
441 | plat->enable_irq(irq); | ||
442 | |||
443 | cpumask_set_cpu(i, &armpmu->active_irqs); | ||
444 | } | ||
445 | |||
446 | return 0; | 335 | return 0; |
447 | } | 336 | } |
448 | 337 | ||
@@ -581,6 +470,32 @@ static void armpmu_disable(struct pmu *pmu) | |||
581 | armpmu->stop(); | 470 | armpmu->stop(); |
582 | } | 471 | } |
583 | 472 | ||
473 | #ifdef CONFIG_PM_RUNTIME | ||
474 | static int armpmu_runtime_resume(struct device *dev) | ||
475 | { | ||
476 | struct arm_pmu_platdata *plat = dev_get_platdata(dev); | ||
477 | |||
478 | if (plat && plat->runtime_resume) | ||
479 | return plat->runtime_resume(dev); | ||
480 | |||
481 | return 0; | ||
482 | } | ||
483 | |||
484 | static int armpmu_runtime_suspend(struct device *dev) | ||
485 | { | ||
486 | struct arm_pmu_platdata *plat = dev_get_platdata(dev); | ||
487 | |||
488 | if (plat && plat->runtime_suspend) | ||
489 | return plat->runtime_suspend(dev); | ||
490 | |||
491 | return 0; | ||
492 | } | ||
493 | #endif | ||
494 | |||
495 | const struct dev_pm_ops armpmu_dev_pm_ops = { | ||
496 | SET_RUNTIME_PM_OPS(armpmu_runtime_suspend, armpmu_runtime_resume, NULL) | ||
497 | }; | ||
498 | |||
584 | static void __init armpmu_init(struct arm_pmu *armpmu) | 499 | static void __init armpmu_init(struct arm_pmu *armpmu) |
585 | { | 500 | { |
586 | atomic_set(&armpmu->active_events, 0); | 501 | atomic_set(&armpmu->active_events, 0); |
@@ -598,174 +513,14 @@ static void __init armpmu_init(struct arm_pmu *armpmu) | |||
598 | }; | 513 | }; |
599 | } | 514 | } |
600 | 515 | ||
601 | int __init armpmu_register(struct arm_pmu *armpmu, char *name, int type) | 516 | int armpmu_register(struct arm_pmu *armpmu, char *name, int type) |
602 | { | 517 | { |
603 | armpmu_init(armpmu); | 518 | armpmu_init(armpmu); |
519 | pr_info("enabled with %s PMU driver, %d counters available\n", | ||
520 | armpmu->name, armpmu->num_events); | ||
604 | return perf_pmu_register(&armpmu->pmu, name, type); | 521 | return perf_pmu_register(&armpmu->pmu, name, type); |
605 | } | 522 | } |
606 | 523 | ||
607 | /* Include the PMU-specific implementations. */ | ||
608 | #include "perf_event_xscale.c" | ||
609 | #include "perf_event_v6.c" | ||
610 | #include "perf_event_v7.c" | ||
611 | |||
612 | /* | ||
613 | * Ensure the PMU has sane values out of reset. | ||
614 | * This requires SMP to be available, so exists as a separate initcall. | ||
615 | */ | ||
616 | static int __init | ||
617 | cpu_pmu_reset(void) | ||
618 | { | ||
619 | if (cpu_pmu && cpu_pmu->reset) | ||
620 | return on_each_cpu(cpu_pmu->reset, NULL, 1); | ||
621 | return 0; | ||
622 | } | ||
623 | arch_initcall(cpu_pmu_reset); | ||
624 | |||
625 | /* | ||
626 | * PMU platform driver and devicetree bindings. | ||
627 | */ | ||
628 | static struct of_device_id armpmu_of_device_ids[] = { | ||
629 | {.compatible = "arm,cortex-a9-pmu"}, | ||
630 | {.compatible = "arm,cortex-a8-pmu"}, | ||
631 | {.compatible = "arm,arm1136-pmu"}, | ||
632 | {.compatible = "arm,arm1176-pmu"}, | ||
633 | {}, | ||
634 | }; | ||
635 | |||
636 | static struct platform_device_id armpmu_plat_device_ids[] = { | ||
637 | {.name = "arm-pmu"}, | ||
638 | {}, | ||
639 | }; | ||
640 | |||
641 | static int __devinit armpmu_device_probe(struct platform_device *pdev) | ||
642 | { | ||
643 | if (!cpu_pmu) | ||
644 | return -ENODEV; | ||
645 | |||
646 | cpu_pmu->plat_device = pdev; | ||
647 | return 0; | ||
648 | } | ||
649 | |||
650 | static struct platform_driver armpmu_driver = { | ||
651 | .driver = { | ||
652 | .name = "arm-pmu", | ||
653 | .of_match_table = armpmu_of_device_ids, | ||
654 | }, | ||
655 | .probe = armpmu_device_probe, | ||
656 | .id_table = armpmu_plat_device_ids, | ||
657 | }; | ||
658 | |||
659 | static int __init register_pmu_driver(void) | ||
660 | { | ||
661 | return platform_driver_register(&armpmu_driver); | ||
662 | } | ||
663 | device_initcall(register_pmu_driver); | ||
664 | |||
665 | static struct pmu_hw_events *armpmu_get_cpu_events(void) | ||
666 | { | ||
667 | return &__get_cpu_var(cpu_hw_events); | ||
668 | } | ||
669 | |||
670 | static void __init cpu_pmu_init(struct arm_pmu *armpmu) | ||
671 | { | ||
672 | int cpu; | ||
673 | for_each_possible_cpu(cpu) { | ||
674 | struct pmu_hw_events *events = &per_cpu(cpu_hw_events, cpu); | ||
675 | events->events = per_cpu(hw_events, cpu); | ||
676 | events->used_mask = per_cpu(used_mask, cpu); | ||
677 | raw_spin_lock_init(&events->pmu_lock); | ||
678 | } | ||
679 | armpmu->get_hw_events = armpmu_get_cpu_events; | ||
680 | armpmu->type = ARM_PMU_DEVICE_CPU; | ||
681 | } | ||
682 | |||
683 | /* | ||
684 | * PMU hardware loses all context when a CPU goes offline. | ||
685 | * When a CPU is hotplugged back in, since some hardware registers are | ||
686 | * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading | ||
687 | * junk values out of them. | ||
688 | */ | ||
689 | static int __cpuinit pmu_cpu_notify(struct notifier_block *b, | ||
690 | unsigned long action, void *hcpu) | ||
691 | { | ||
692 | if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING) | ||
693 | return NOTIFY_DONE; | ||
694 | |||
695 | if (cpu_pmu && cpu_pmu->reset) | ||
696 | cpu_pmu->reset(NULL); | ||
697 | |||
698 | return NOTIFY_OK; | ||
699 | } | ||
700 | |||
701 | static struct notifier_block __cpuinitdata pmu_cpu_notifier = { | ||
702 | .notifier_call = pmu_cpu_notify, | ||
703 | }; | ||
704 | |||
705 | /* | ||
706 | * CPU PMU identification and registration. | ||
707 | */ | ||
708 | static int __init | ||
709 | init_hw_perf_events(void) | ||
710 | { | ||
711 | unsigned long cpuid = read_cpuid_id(); | ||
712 | unsigned long implementor = (cpuid & 0xFF000000) >> 24; | ||
713 | unsigned long part_number = (cpuid & 0xFFF0); | ||
714 | |||
715 | /* ARM Ltd CPUs. */ | ||
716 | if (0x41 == implementor) { | ||
717 | switch (part_number) { | ||
718 | case 0xB360: /* ARM1136 */ | ||
719 | case 0xB560: /* ARM1156 */ | ||
720 | case 0xB760: /* ARM1176 */ | ||
721 | cpu_pmu = armv6pmu_init(); | ||
722 | break; | ||
723 | case 0xB020: /* ARM11mpcore */ | ||
724 | cpu_pmu = armv6mpcore_pmu_init(); | ||
725 | break; | ||
726 | case 0xC080: /* Cortex-A8 */ | ||
727 | cpu_pmu = armv7_a8_pmu_init(); | ||
728 | break; | ||
729 | case 0xC090: /* Cortex-A9 */ | ||
730 | cpu_pmu = armv7_a9_pmu_init(); | ||
731 | break; | ||
732 | case 0xC050: /* Cortex-A5 */ | ||
733 | cpu_pmu = armv7_a5_pmu_init(); | ||
734 | break; | ||
735 | case 0xC0F0: /* Cortex-A15 */ | ||
736 | cpu_pmu = armv7_a15_pmu_init(); | ||
737 | break; | ||
738 | case 0xC070: /* Cortex-A7 */ | ||
739 | cpu_pmu = armv7_a7_pmu_init(); | ||
740 | break; | ||
741 | } | ||
742 | /* Intel CPUs [xscale]. */ | ||
743 | } else if (0x69 == implementor) { | ||
744 | part_number = (cpuid >> 13) & 0x7; | ||
745 | switch (part_number) { | ||
746 | case 1: | ||
747 | cpu_pmu = xscale1pmu_init(); | ||
748 | break; | ||
749 | case 2: | ||
750 | cpu_pmu = xscale2pmu_init(); | ||
751 | break; | ||
752 | } | ||
753 | } | ||
754 | |||
755 | if (cpu_pmu) { | ||
756 | pr_info("enabled with %s PMU driver, %d counters available\n", | ||
757 | cpu_pmu->name, cpu_pmu->num_events); | ||
758 | cpu_pmu_init(cpu_pmu); | ||
759 | register_cpu_notifier(&pmu_cpu_notifier); | ||
760 | armpmu_register(cpu_pmu, cpu_pmu->name, PERF_TYPE_RAW); | ||
761 | } else { | ||
762 | pr_info("no hardware support available\n"); | ||
763 | } | ||
764 | |||
765 | return 0; | ||
766 | } | ||
767 | early_initcall(init_hw_perf_events); | ||
768 | |||
769 | /* | 524 | /* |
770 | * Callchain handling code. | 525 | * Callchain handling code. |
771 | */ | 526 | */ |
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c new file mode 100644 index 000000000000..8d7d8d4de9d6 --- /dev/null +++ b/arch/arm/kernel/perf_event_cpu.c | |||
@@ -0,0 +1,295 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope that it will be useful, | ||
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
9 | * GNU General Public License for more details. | ||
10 | * | ||
11 | * You should have received a copy of the GNU General Public License | ||
12 | * along with this program; if not, write to the Free Software | ||
13 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
14 | * | ||
15 | * Copyright (C) 2012 ARM Limited | ||
16 | * | ||
17 | * Author: Will Deacon <will.deacon@arm.com> | ||
18 | */ | ||
19 | #define pr_fmt(fmt) "CPU PMU: " fmt | ||
20 | |||
21 | #include <linux/bitmap.h> | ||
22 | #include <linux/export.h> | ||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/of.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/spinlock.h> | ||
27 | |||
28 | #include <asm/cputype.h> | ||
29 | #include <asm/irq_regs.h> | ||
30 | #include <asm/pmu.h> | ||
31 | |||
32 | /* Set at runtime when we know what CPU type we are. */ | ||
33 | static struct arm_pmu *cpu_pmu; | ||
34 | |||
35 | static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events); | ||
36 | static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask); | ||
37 | static DEFINE_PER_CPU(struct pmu_hw_events, cpu_hw_events); | ||
38 | |||
39 | /* | ||
40 | * Despite the names, these two functions are CPU-specific and are used | ||
41 | * by the OProfile/perf code. | ||
42 | */ | ||
43 | const char *perf_pmu_name(void) | ||
44 | { | ||
45 | if (!cpu_pmu) | ||
46 | return NULL; | ||
47 | |||
48 | return cpu_pmu->pmu.name; | ||
49 | } | ||
50 | EXPORT_SYMBOL_GPL(perf_pmu_name); | ||
51 | |||
52 | int perf_num_counters(void) | ||
53 | { | ||
54 | int max_events = 0; | ||
55 | |||
56 | if (cpu_pmu != NULL) | ||
57 | max_events = cpu_pmu->num_events; | ||
58 | |||
59 | return max_events; | ||
60 | } | ||
61 | EXPORT_SYMBOL_GPL(perf_num_counters); | ||
62 | |||
63 | /* Include the PMU-specific implementations. */ | ||
64 | #include "perf_event_xscale.c" | ||
65 | #include "perf_event_v6.c" | ||
66 | #include "perf_event_v7.c" | ||
67 | |||
68 | static struct pmu_hw_events *cpu_pmu_get_cpu_events(void) | ||
69 | { | ||
70 | return &__get_cpu_var(cpu_hw_events); | ||
71 | } | ||
72 | |||
73 | static void cpu_pmu_free_irq(void) | ||
74 | { | ||
75 | int i, irq, irqs; | ||
76 | struct platform_device *pmu_device = cpu_pmu->plat_device; | ||
77 | |||
78 | irqs = min(pmu_device->num_resources, num_possible_cpus()); | ||
79 | |||
80 | for (i = 0; i < irqs; ++i) { | ||
81 | if (!cpumask_test_and_clear_cpu(i, &cpu_pmu->active_irqs)) | ||
82 | continue; | ||
83 | irq = platform_get_irq(pmu_device, i); | ||
84 | if (irq >= 0) | ||
85 | free_irq(irq, cpu_pmu); | ||
86 | } | ||
87 | } | ||
88 | |||
89 | static int cpu_pmu_request_irq(irq_handler_t handler) | ||
90 | { | ||
91 | int i, err, irq, irqs; | ||
92 | struct platform_device *pmu_device = cpu_pmu->plat_device; | ||
93 | |||
94 | if (!pmu_device) | ||
95 | return -ENODEV; | ||
96 | |||
97 | irqs = min(pmu_device->num_resources, num_possible_cpus()); | ||
98 | if (irqs < 1) { | ||
99 | pr_err("no irqs for PMUs defined\n"); | ||
100 | return -ENODEV; | ||
101 | } | ||
102 | |||
103 | for (i = 0; i < irqs; ++i) { | ||
104 | err = 0; | ||
105 | irq = platform_get_irq(pmu_device, i); | ||
106 | if (irq < 0) | ||
107 | continue; | ||
108 | |||
109 | /* | ||
110 | * If we have a single PMU interrupt that we can't shift, | ||
111 | * assume that we're running on a uniprocessor machine and | ||
112 | * continue. Otherwise, continue without this interrupt. | ||
113 | */ | ||
114 | if (irq_set_affinity(irq, cpumask_of(i)) && irqs > 1) { | ||
115 | pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n", | ||
116 | irq, i); | ||
117 | continue; | ||
118 | } | ||
119 | |||
120 | err = request_irq(irq, handler, IRQF_NOBALANCING, "arm-pmu", | ||
121 | cpu_pmu); | ||
122 | if (err) { | ||
123 | pr_err("unable to request IRQ%d for ARM PMU counters\n", | ||
124 | irq); | ||
125 | return err; | ||
126 | } | ||
127 | |||
128 | cpumask_set_cpu(i, &cpu_pmu->active_irqs); | ||
129 | } | ||
130 | |||
131 | return 0; | ||
132 | } | ||
133 | |||
134 | static void __devinit cpu_pmu_init(struct arm_pmu *cpu_pmu) | ||
135 | { | ||
136 | int cpu; | ||
137 | for_each_possible_cpu(cpu) { | ||
138 | struct pmu_hw_events *events = &per_cpu(cpu_hw_events, cpu); | ||
139 | events->events = per_cpu(hw_events, cpu); | ||
140 | events->used_mask = per_cpu(used_mask, cpu); | ||
141 | raw_spin_lock_init(&events->pmu_lock); | ||
142 | } | ||
143 | |||
144 | cpu_pmu->get_hw_events = cpu_pmu_get_cpu_events; | ||
145 | cpu_pmu->request_irq = cpu_pmu_request_irq; | ||
146 | cpu_pmu->free_irq = cpu_pmu_free_irq; | ||
147 | |||
148 | /* Ensure the PMU has sane values out of reset. */ | ||
149 | if (cpu_pmu && cpu_pmu->reset) | ||
150 | on_each_cpu(cpu_pmu->reset, NULL, 1); | ||
151 | } | ||
152 | |||
153 | /* | ||
154 | * PMU hardware loses all context when a CPU goes offline. | ||
155 | * When a CPU is hotplugged back in, since some hardware registers are | ||
156 | * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading | ||
157 | * junk values out of them. | ||
158 | */ | ||
159 | static int __cpuinit cpu_pmu_notify(struct notifier_block *b, | ||
160 | unsigned long action, void *hcpu) | ||
161 | { | ||
162 | if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING) | ||
163 | return NOTIFY_DONE; | ||
164 | |||
165 | if (cpu_pmu && cpu_pmu->reset) | ||
166 | cpu_pmu->reset(NULL); | ||
167 | |||
168 | return NOTIFY_OK; | ||
169 | } | ||
170 | |||
171 | static struct notifier_block __cpuinitdata cpu_pmu_hotplug_notifier = { | ||
172 | .notifier_call = cpu_pmu_notify, | ||
173 | }; | ||
174 | |||
175 | /* | ||
176 | * PMU platform driver and devicetree bindings. | ||
177 | */ | ||
178 | static struct of_device_id __devinitdata cpu_pmu_of_device_ids[] = { | ||
179 | {.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init}, | ||
180 | {.compatible = "arm,cortex-a9-pmu", .data = armv7_a9_pmu_init}, | ||
181 | {.compatible = "arm,cortex-a8-pmu", .data = armv7_a8_pmu_init}, | ||
182 | {.compatible = "arm,cortex-a7-pmu", .data = armv7_a7_pmu_init}, | ||
183 | {.compatible = "arm,cortex-a5-pmu", .data = armv7_a5_pmu_init}, | ||
184 | {.compatible = "arm,arm11mpcore-pmu", .data = armv6mpcore_pmu_init}, | ||
185 | {.compatible = "arm,arm1176-pmu", .data = armv6pmu_init}, | ||
186 | {.compatible = "arm,arm1136-pmu", .data = armv6pmu_init}, | ||
187 | {}, | ||
188 | }; | ||
189 | |||
190 | static struct platform_device_id __devinitdata cpu_pmu_plat_device_ids[] = { | ||
191 | {.name = "arm-pmu"}, | ||
192 | {}, | ||
193 | }; | ||
194 | |||
195 | /* | ||
196 | * CPU PMU identification and probing. | ||
197 | */ | ||
198 | static struct arm_pmu *__devinit probe_current_pmu(void) | ||
199 | { | ||
200 | struct arm_pmu *pmu = NULL; | ||
201 | int cpu = get_cpu(); | ||
202 | unsigned long cpuid = read_cpuid_id(); | ||
203 | unsigned long implementor = (cpuid & 0xFF000000) >> 24; | ||
204 | unsigned long part_number = (cpuid & 0xFFF0); | ||
205 | |||
206 | pr_info("probing PMU on CPU %d\n", cpu); | ||
207 | |||
208 | /* ARM Ltd CPUs. */ | ||
209 | if (0x41 == implementor) { | ||
210 | switch (part_number) { | ||
211 | case 0xB360: /* ARM1136 */ | ||
212 | case 0xB560: /* ARM1156 */ | ||
213 | case 0xB760: /* ARM1176 */ | ||
214 | pmu = armv6pmu_init(); | ||
215 | break; | ||
216 | case 0xB020: /* ARM11mpcore */ | ||
217 | pmu = armv6mpcore_pmu_init(); | ||
218 | break; | ||
219 | case 0xC080: /* Cortex-A8 */ | ||
220 | pmu = armv7_a8_pmu_init(); | ||
221 | break; | ||
222 | case 0xC090: /* Cortex-A9 */ | ||
223 | pmu = armv7_a9_pmu_init(); | ||
224 | break; | ||
225 | case 0xC050: /* Cortex-A5 */ | ||
226 | pmu = armv7_a5_pmu_init(); | ||
227 | break; | ||
228 | case 0xC0F0: /* Cortex-A15 */ | ||
229 | pmu = armv7_a15_pmu_init(); | ||
230 | break; | ||
231 | case 0xC070: /* Cortex-A7 */ | ||
232 | pmu = armv7_a7_pmu_init(); | ||
233 | break; | ||
234 | } | ||
235 | /* Intel CPUs [xscale]. */ | ||
236 | } else if (0x69 == implementor) { | ||
237 | part_number = (cpuid >> 13) & 0x7; | ||
238 | switch (part_number) { | ||
239 | case 1: | ||
240 | pmu = xscale1pmu_init(); | ||
241 | break; | ||
242 | case 2: | ||
243 | pmu = xscale2pmu_init(); | ||
244 | break; | ||
245 | } | ||
246 | } | ||
247 | |||
248 | put_cpu(); | ||
249 | return pmu; | ||
250 | } | ||
251 | |||
252 | static int __devinit cpu_pmu_device_probe(struct platform_device *pdev) | ||
253 | { | ||
254 | const struct of_device_id *of_id; | ||
255 | struct arm_pmu *(*init_fn)(void); | ||
256 | struct device_node *node = pdev->dev.of_node; | ||
257 | |||
258 | if (cpu_pmu) { | ||
259 | pr_info("attempt to register multiple PMU devices!"); | ||
260 | return -ENOSPC; | ||
261 | } | ||
262 | |||
263 | if (node && (of_id = of_match_node(cpu_pmu_of_device_ids, pdev->dev.of_node))) { | ||
264 | init_fn = of_id->data; | ||
265 | cpu_pmu = init_fn(); | ||
266 | } else { | ||
267 | cpu_pmu = probe_current_pmu(); | ||
268 | } | ||
269 | |||
270 | if (!cpu_pmu) | ||
271 | return -ENODEV; | ||
272 | |||
273 | cpu_pmu->plat_device = pdev; | ||
274 | cpu_pmu_init(cpu_pmu); | ||
275 | register_cpu_notifier(&cpu_pmu_hotplug_notifier); | ||
276 | armpmu_register(cpu_pmu, cpu_pmu->name, PERF_TYPE_RAW); | ||
277 | |||
278 | return 0; | ||
279 | } | ||
280 | |||
281 | static struct platform_driver cpu_pmu_driver = { | ||
282 | .driver = { | ||
283 | .name = "arm-pmu", | ||
284 | .pm = &armpmu_dev_pm_ops, | ||
285 | .of_match_table = cpu_pmu_of_device_ids, | ||
286 | }, | ||
287 | .probe = cpu_pmu_device_probe, | ||
288 | .id_table = cpu_pmu_plat_device_ids, | ||
289 | }; | ||
290 | |||
291 | static int __init register_pmu_driver(void) | ||
292 | { | ||
293 | return platform_driver_register(&cpu_pmu_driver); | ||
294 | } | ||
295 | device_initcall(register_pmu_driver); | ||
diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c index c90fcb2b6967..6ccc07971745 100644 --- a/arch/arm/kernel/perf_event_v6.c +++ b/arch/arm/kernel/perf_event_v6.c | |||
@@ -645,7 +645,7 @@ armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc, | |||
645 | 645 | ||
646 | static int armv6_map_event(struct perf_event *event) | 646 | static int armv6_map_event(struct perf_event *event) |
647 | { | 647 | { |
648 | return map_cpu_event(event, &armv6_perf_map, | 648 | return armpmu_map_event(event, &armv6_perf_map, |
649 | &armv6_perf_cache_map, 0xFF); | 649 | &armv6_perf_cache_map, 0xFF); |
650 | } | 650 | } |
651 | 651 | ||
@@ -664,7 +664,7 @@ static struct arm_pmu armv6pmu = { | |||
664 | .max_period = (1LLU << 32) - 1, | 664 | .max_period = (1LLU << 32) - 1, |
665 | }; | 665 | }; |
666 | 666 | ||
667 | static struct arm_pmu *__init armv6pmu_init(void) | 667 | static struct arm_pmu *__devinit armv6pmu_init(void) |
668 | { | 668 | { |
669 | return &armv6pmu; | 669 | return &armv6pmu; |
670 | } | 670 | } |
@@ -679,7 +679,7 @@ static struct arm_pmu *__init armv6pmu_init(void) | |||
679 | 679 | ||
680 | static int armv6mpcore_map_event(struct perf_event *event) | 680 | static int armv6mpcore_map_event(struct perf_event *event) |
681 | { | 681 | { |
682 | return map_cpu_event(event, &armv6mpcore_perf_map, | 682 | return armpmu_map_event(event, &armv6mpcore_perf_map, |
683 | &armv6mpcore_perf_cache_map, 0xFF); | 683 | &armv6mpcore_perf_cache_map, 0xFF); |
684 | } | 684 | } |
685 | 685 | ||
@@ -698,17 +698,17 @@ static struct arm_pmu armv6mpcore_pmu = { | |||
698 | .max_period = (1LLU << 32) - 1, | 698 | .max_period = (1LLU << 32) - 1, |
699 | }; | 699 | }; |
700 | 700 | ||
701 | static struct arm_pmu *__init armv6mpcore_pmu_init(void) | 701 | static struct arm_pmu *__devinit armv6mpcore_pmu_init(void) |
702 | { | 702 | { |
703 | return &armv6mpcore_pmu; | 703 | return &armv6mpcore_pmu; |
704 | } | 704 | } |
705 | #else | 705 | #else |
706 | static struct arm_pmu *__init armv6pmu_init(void) | 706 | static struct arm_pmu *__devinit armv6pmu_init(void) |
707 | { | 707 | { |
708 | return NULL; | 708 | return NULL; |
709 | } | 709 | } |
710 | 710 | ||
711 | static struct arm_pmu *__init armv6mpcore_pmu_init(void) | 711 | static struct arm_pmu *__devinit armv6mpcore_pmu_init(void) |
712 | { | 712 | { |
713 | return NULL; | 713 | return NULL; |
714 | } | 714 | } |
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c index f04070bd2183..bd4b090ebcfd 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/arch/arm/kernel/perf_event_v7.c | |||
@@ -1204,31 +1204,31 @@ static void armv7pmu_reset(void *info) | |||
1204 | 1204 | ||
1205 | static int armv7_a8_map_event(struct perf_event *event) | 1205 | static int armv7_a8_map_event(struct perf_event *event) |
1206 | { | 1206 | { |
1207 | return map_cpu_event(event, &armv7_a8_perf_map, | 1207 | return armpmu_map_event(event, &armv7_a8_perf_map, |
1208 | &armv7_a8_perf_cache_map, 0xFF); | 1208 | &armv7_a8_perf_cache_map, 0xFF); |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | static int armv7_a9_map_event(struct perf_event *event) | 1211 | static int armv7_a9_map_event(struct perf_event *event) |
1212 | { | 1212 | { |
1213 | return map_cpu_event(event, &armv7_a9_perf_map, | 1213 | return armpmu_map_event(event, &armv7_a9_perf_map, |
1214 | &armv7_a9_perf_cache_map, 0xFF); | 1214 | &armv7_a9_perf_cache_map, 0xFF); |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | static int armv7_a5_map_event(struct perf_event *event) | 1217 | static int armv7_a5_map_event(struct perf_event *event) |
1218 | { | 1218 | { |
1219 | return map_cpu_event(event, &armv7_a5_perf_map, | 1219 | return armpmu_map_event(event, &armv7_a5_perf_map, |
1220 | &armv7_a5_perf_cache_map, 0xFF); | 1220 | &armv7_a5_perf_cache_map, 0xFF); |
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | static int armv7_a15_map_event(struct perf_event *event) | 1223 | static int armv7_a15_map_event(struct perf_event *event) |
1224 | { | 1224 | { |
1225 | return map_cpu_event(event, &armv7_a15_perf_map, | 1225 | return armpmu_map_event(event, &armv7_a15_perf_map, |
1226 | &armv7_a15_perf_cache_map, 0xFF); | 1226 | &armv7_a15_perf_cache_map, 0xFF); |
1227 | } | 1227 | } |
1228 | 1228 | ||
1229 | static int armv7_a7_map_event(struct perf_event *event) | 1229 | static int armv7_a7_map_event(struct perf_event *event) |
1230 | { | 1230 | { |
1231 | return map_cpu_event(event, &armv7_a7_perf_map, | 1231 | return armpmu_map_event(event, &armv7_a7_perf_map, |
1232 | &armv7_a7_perf_cache_map, 0xFF); | 1232 | &armv7_a7_perf_cache_map, 0xFF); |
1233 | } | 1233 | } |
1234 | 1234 | ||
@@ -1245,7 +1245,7 @@ static struct arm_pmu armv7pmu = { | |||
1245 | .max_period = (1LLU << 32) - 1, | 1245 | .max_period = (1LLU << 32) - 1, |
1246 | }; | 1246 | }; |
1247 | 1247 | ||
1248 | static u32 __init armv7_read_num_pmnc_events(void) | 1248 | static u32 __devinit armv7_read_num_pmnc_events(void) |
1249 | { | 1249 | { |
1250 | u32 nb_cnt; | 1250 | u32 nb_cnt; |
1251 | 1251 | ||
@@ -1256,7 +1256,7 @@ static u32 __init armv7_read_num_pmnc_events(void) | |||
1256 | return nb_cnt + 1; | 1256 | return nb_cnt + 1; |
1257 | } | 1257 | } |
1258 | 1258 | ||
1259 | static struct arm_pmu *__init armv7_a8_pmu_init(void) | 1259 | static struct arm_pmu *__devinit armv7_a8_pmu_init(void) |
1260 | { | 1260 | { |
1261 | armv7pmu.name = "ARMv7 Cortex-A8"; | 1261 | armv7pmu.name = "ARMv7 Cortex-A8"; |
1262 | armv7pmu.map_event = armv7_a8_map_event; | 1262 | armv7pmu.map_event = armv7_a8_map_event; |
@@ -1264,7 +1264,7 @@ static struct arm_pmu *__init armv7_a8_pmu_init(void) | |||
1264 | return &armv7pmu; | 1264 | return &armv7pmu; |
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | static struct arm_pmu *__init armv7_a9_pmu_init(void) | 1267 | static struct arm_pmu *__devinit armv7_a9_pmu_init(void) |
1268 | { | 1268 | { |
1269 | armv7pmu.name = "ARMv7 Cortex-A9"; | 1269 | armv7pmu.name = "ARMv7 Cortex-A9"; |
1270 | armv7pmu.map_event = armv7_a9_map_event; | 1270 | armv7pmu.map_event = armv7_a9_map_event; |
@@ -1272,7 +1272,7 @@ static struct arm_pmu *__init armv7_a9_pmu_init(void) | |||
1272 | return &armv7pmu; | 1272 | return &armv7pmu; |
1273 | } | 1273 | } |
1274 | 1274 | ||
1275 | static struct arm_pmu *__init armv7_a5_pmu_init(void) | 1275 | static struct arm_pmu *__devinit armv7_a5_pmu_init(void) |
1276 | { | 1276 | { |
1277 | armv7pmu.name = "ARMv7 Cortex-A5"; | 1277 | armv7pmu.name = "ARMv7 Cortex-A5"; |
1278 | armv7pmu.map_event = armv7_a5_map_event; | 1278 | armv7pmu.map_event = armv7_a5_map_event; |
@@ -1280,7 +1280,7 @@ static struct arm_pmu *__init armv7_a5_pmu_init(void) | |||
1280 | return &armv7pmu; | 1280 | return &armv7pmu; |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | static struct arm_pmu *__init armv7_a15_pmu_init(void) | 1283 | static struct arm_pmu *__devinit armv7_a15_pmu_init(void) |
1284 | { | 1284 | { |
1285 | armv7pmu.name = "ARMv7 Cortex-A15"; | 1285 | armv7pmu.name = "ARMv7 Cortex-A15"; |
1286 | armv7pmu.map_event = armv7_a15_map_event; | 1286 | armv7pmu.map_event = armv7_a15_map_event; |
@@ -1289,7 +1289,7 @@ static struct arm_pmu *__init armv7_a15_pmu_init(void) | |||
1289 | return &armv7pmu; | 1289 | return &armv7pmu; |
1290 | } | 1290 | } |
1291 | 1291 | ||
1292 | static struct arm_pmu *__init armv7_a7_pmu_init(void) | 1292 | static struct arm_pmu *__devinit armv7_a7_pmu_init(void) |
1293 | { | 1293 | { |
1294 | armv7pmu.name = "ARMv7 Cortex-A7"; | 1294 | armv7pmu.name = "ARMv7 Cortex-A7"; |
1295 | armv7pmu.map_event = armv7_a7_map_event; | 1295 | armv7pmu.map_event = armv7_a7_map_event; |
@@ -1298,27 +1298,27 @@ static struct arm_pmu *__init armv7_a7_pmu_init(void) | |||
1298 | return &armv7pmu; | 1298 | return &armv7pmu; |
1299 | } | 1299 | } |
1300 | #else | 1300 | #else |
1301 | static struct arm_pmu *__init armv7_a8_pmu_init(void) | 1301 | static struct arm_pmu *__devinit armv7_a8_pmu_init(void) |
1302 | { | 1302 | { |
1303 | return NULL; | 1303 | return NULL; |
1304 | } | 1304 | } |
1305 | 1305 | ||
1306 | static struct arm_pmu *__init armv7_a9_pmu_init(void) | 1306 | static struct arm_pmu *__devinit armv7_a9_pmu_init(void) |
1307 | { | 1307 | { |
1308 | return NULL; | 1308 | return NULL; |
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | static struct arm_pmu *__init armv7_a5_pmu_init(void) | 1311 | static struct arm_pmu *__devinit armv7_a5_pmu_init(void) |
1312 | { | 1312 | { |
1313 | return NULL; | 1313 | return NULL; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | static struct arm_pmu *__init armv7_a15_pmu_init(void) | 1316 | static struct arm_pmu *__devinit armv7_a15_pmu_init(void) |
1317 | { | 1317 | { |
1318 | return NULL; | 1318 | return NULL; |
1319 | } | 1319 | } |
1320 | 1320 | ||
1321 | static struct arm_pmu *__init armv7_a7_pmu_init(void) | 1321 | static struct arm_pmu *__devinit armv7_a7_pmu_init(void) |
1322 | { | 1322 | { |
1323 | return NULL; | 1323 | return NULL; |
1324 | } | 1324 | } |
diff --git a/arch/arm/kernel/perf_event_xscale.c b/arch/arm/kernel/perf_event_xscale.c index f759fe0bab63..426e19f380a2 100644 --- a/arch/arm/kernel/perf_event_xscale.c +++ b/arch/arm/kernel/perf_event_xscale.c | |||
@@ -430,7 +430,7 @@ xscale1pmu_write_counter(int counter, u32 val) | |||
430 | 430 | ||
431 | static int xscale_map_event(struct perf_event *event) | 431 | static int xscale_map_event(struct perf_event *event) |
432 | { | 432 | { |
433 | return map_cpu_event(event, &xscale_perf_map, | 433 | return armpmu_map_event(event, &xscale_perf_map, |
434 | &xscale_perf_cache_map, 0xFF); | 434 | &xscale_perf_cache_map, 0xFF); |
435 | } | 435 | } |
436 | 436 | ||
@@ -449,7 +449,7 @@ static struct arm_pmu xscale1pmu = { | |||
449 | .max_period = (1LLU << 32) - 1, | 449 | .max_period = (1LLU << 32) - 1, |
450 | }; | 450 | }; |
451 | 451 | ||
452 | static struct arm_pmu *__init xscale1pmu_init(void) | 452 | static struct arm_pmu *__devinit xscale1pmu_init(void) |
453 | { | 453 | { |
454 | return &xscale1pmu; | 454 | return &xscale1pmu; |
455 | } | 455 | } |
@@ -816,17 +816,17 @@ static struct arm_pmu xscale2pmu = { | |||
816 | .max_period = (1LLU << 32) - 1, | 816 | .max_period = (1LLU << 32) - 1, |
817 | }; | 817 | }; |
818 | 818 | ||
819 | static struct arm_pmu *__init xscale2pmu_init(void) | 819 | static struct arm_pmu *__devinit xscale2pmu_init(void) |
820 | { | 820 | { |
821 | return &xscale2pmu; | 821 | return &xscale2pmu; |
822 | } | 822 | } |
823 | #else | 823 | #else |
824 | static struct arm_pmu *__init xscale1pmu_init(void) | 824 | static struct arm_pmu *__devinit xscale1pmu_init(void) |
825 | { | 825 | { |
826 | return NULL; | 826 | return NULL; |
827 | } | 827 | } |
828 | 828 | ||
829 | static struct arm_pmu *__init xscale2pmu_init(void) | 829 | static struct arm_pmu *__devinit xscale2pmu_init(void) |
830 | { | 830 | { |
831 | return NULL; | 831 | return NULL; |
832 | } | 832 | } |
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c deleted file mode 100644 index 2334bf8a650a..000000000000 --- a/arch/arm/kernel/pmu.c +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/kernel/pmu.c | ||
3 | * | ||
4 | * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles | ||
5 | * Copyright (C) 2010 ARM Ltd, Will Deacon | ||
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 | |||
13 | #include <linux/err.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/module.h> | ||
16 | |||
17 | #include <asm/pmu.h> | ||
18 | |||
19 | /* | ||
20 | * PMU locking to ensure mutual exclusion between different subsystems. | ||
21 | */ | ||
22 | static unsigned long pmu_lock[BITS_TO_LONGS(ARM_NUM_PMU_DEVICES)]; | ||
23 | |||
24 | int | ||
25 | reserve_pmu(enum arm_pmu_type type) | ||
26 | { | ||
27 | return test_and_set_bit_lock(type, pmu_lock) ? -EBUSY : 0; | ||
28 | } | ||
29 | EXPORT_SYMBOL_GPL(reserve_pmu); | ||
30 | |||
31 | void | ||
32 | release_pmu(enum arm_pmu_type type) | ||
33 | { | ||
34 | clear_bit_unlock(type, pmu_lock); | ||
35 | } | ||
36 | EXPORT_SYMBOL_GPL(release_pmu); | ||
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c index 46090e642d8e..6bd7300a2bc5 100644 --- a/arch/arm/mach-at91/at91x40.c +++ b/arch/arm/mach-at91/at91x40.c | |||
@@ -47,7 +47,7 @@ static void at91x40_idle(void) | |||
47 | * Disable the processor clock. The processor will be automatically | 47 | * Disable the processor clock. The processor will be automatically |
48 | * re-enabled by an interrupt or by a reset. | 48 | * re-enabled by an interrupt or by a reset. |
49 | */ | 49 | */ |
50 | __raw_writel(AT91_PS_CR_CPU, AT91_PS_CR); | 50 | __raw_writel(AT91_PS_CR_CPU, AT91_IO_P2V(AT91_PS_CR)); |
51 | cpu_do_idle(); | 51 | cpu_do_idle(); |
52 | } | 52 | } |
53 | 53 | ||
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c index 6ca680a1d5d1..ee06d7bcdf76 100644 --- a/arch/arm/mach-at91/at91x40_time.c +++ b/arch/arm/mach-at91/at91x40_time.c | |||
@@ -29,10 +29,10 @@ | |||
29 | #include <mach/at91_tc.h> | 29 | #include <mach/at91_tc.h> |
30 | 30 | ||
31 | #define at91_tc_read(field) \ | 31 | #define at91_tc_read(field) \ |
32 | __raw_readl(AT91_TC + field) | 32 | __raw_readl(AT91_IO_P2V(AT91_TC) + field) |
33 | 33 | ||
34 | #define at91_tc_write(field, value) \ | 34 | #define at91_tc_write(field, value) \ |
35 | __raw_writel(value, AT91_TC + field); | 35 | __raw_writel(value, AT91_IO_P2V(AT91_TC) + field); |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * 3 counter/timer units present. | 38 | * 3 counter/timer units present. |
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h index 09242b67d277..711a7892d331 100644 --- a/arch/arm/mach-at91/include/mach/hardware.h +++ b/arch/arm/mach-at91/include/mach/hardware.h | |||
@@ -67,13 +67,13 @@ | |||
67 | * to 0xFEF78000 .. 0xFF000000. (544Kb) | 67 | * to 0xFEF78000 .. 0xFF000000. (544Kb) |
68 | */ | 68 | */ |
69 | #define AT91_IO_PHYS_BASE 0xFFF78000 | 69 | #define AT91_IO_PHYS_BASE 0xFFF78000 |
70 | #define AT91_IO_VIRT_BASE (0xFF000000 - AT91_IO_SIZE) | 70 | #define AT91_IO_VIRT_BASE IOMEM(0xFF000000 - AT91_IO_SIZE) |
71 | #else | 71 | #else |
72 | /* | 72 | /* |
73 | * Identity mapping for the non MMU case. | 73 | * Identity mapping for the non MMU case. |
74 | */ | 74 | */ |
75 | #define AT91_IO_PHYS_BASE AT91_BASE_SYS | 75 | #define AT91_IO_PHYS_BASE AT91_BASE_SYS |
76 | #define AT91_IO_VIRT_BASE AT91_IO_PHYS_BASE | 76 | #define AT91_IO_VIRT_BASE IOMEM(AT91_IO_PHYS_BASE) |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) | 79 | #define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) |
diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h index 6f6118d1576a..97ad68a826f8 100644 --- a/arch/arm/mach-at91/include/mach/uncompress.h +++ b/arch/arm/mach-at91/include/mach/uncompress.h | |||
@@ -94,7 +94,7 @@ static const u32 uarts_sam9x5[] = { | |||
94 | 0, | 94 | 0, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | static inline const u32* decomp_soc_detect(u32 dbgu_base) | 97 | static inline const u32* decomp_soc_detect(void __iomem *dbgu_base) |
98 | { | 98 | { |
99 | u32 cidr, socid; | 99 | u32 cidr, socid; |
100 | 100 | ||
@@ -142,10 +142,10 @@ static inline void arch_decomp_setup(void) | |||
142 | int i = 0; | 142 | int i = 0; |
143 | const u32* usarts; | 143 | const u32* usarts; |
144 | 144 | ||
145 | usarts = decomp_soc_detect(AT91_BASE_DBGU0); | 145 | usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU0); |
146 | 146 | ||
147 | if (!usarts) | 147 | if (!usarts) |
148 | usarts = decomp_soc_detect(AT91_BASE_DBGU1); | 148 | usarts = decomp_soc_detect((void __iomem *)AT91_BASE_DBGU1); |
149 | if (!usarts) { | 149 | if (!usarts) { |
150 | at91_uart = NULL; | 150 | at91_uart = NULL; |
151 | return; | 151 | return; |
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index 944bffb08991..e6f52de1062f 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c | |||
@@ -73,7 +73,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length) | |||
73 | { | 73 | { |
74 | struct map_desc *desc = &sram_desc[bank]; | 74 | struct map_desc *desc = &sram_desc[bank]; |
75 | 75 | ||
76 | desc->virtual = AT91_IO_VIRT_BASE - length; | 76 | desc->virtual = (unsigned long)AT91_IO_VIRT_BASE - length; |
77 | if (bank > 0) | 77 | if (bank > 0) |
78 | desc->virtual -= sram_desc[bank - 1].length; | 78 | desc->virtual -= sram_desc[bank - 1].length; |
79 | 79 | ||
@@ -88,7 +88,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length) | |||
88 | } | 88 | } |
89 | 89 | ||
90 | static struct map_desc at91_io_desc __initdata = { | 90 | static struct map_desc at91_io_desc __initdata = { |
91 | .virtual = AT91_VA_BASE_SYS, | 91 | .virtual = (unsigned long)AT91_VA_BASE_SYS, |
92 | .pfn = __phys_to_pfn(AT91_BASE_SYS), | 92 | .pfn = __phys_to_pfn(AT91_BASE_SYS), |
93 | .length = SZ_16K, | 93 | .length = SZ_16K, |
94 | .type = MT_DEVICE, | 94 | .type = MT_DEVICE, |
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c index 45c97b1ee9b1..c18a5048b6c5 100644 --- a/arch/arm/mach-bcmring/arch.c +++ b/arch/arm/mach-bcmring/arch.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <asm/setup.h> | 29 | #include <asm/setup.h> |
30 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
31 | #include <asm/mach/time.h> | 31 | #include <asm/mach/time.h> |
32 | #include <asm/pmu.h> | ||
33 | 32 | ||
34 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
35 | #include <mach/dma.h> | 34 | #include <mach/dma.h> |
@@ -38,7 +37,7 @@ | |||
38 | #include <mach/csp/chipcHw_def.h> | 37 | #include <mach/csp/chipcHw_def.h> |
39 | #include <mach/csp/chipcHw_inline.h> | 38 | #include <mach/csp/chipcHw_inline.h> |
40 | 39 | ||
41 | #include <cfg_global.h> | 40 | #include <mach/cfg_global.h> |
42 | 41 | ||
43 | #include "core.h" | 42 | #include "core.h" |
44 | 43 | ||
@@ -116,7 +115,7 @@ static struct resource pmu_resource = { | |||
116 | 115 | ||
117 | static struct platform_device pmu_device = { | 116 | static struct platform_device pmu_device = { |
118 | .name = "arm-pmu", | 117 | .name = "arm-pmu", |
119 | .id = ARM_PMU_DEVICE_CPU, | 118 | .id = -1, |
120 | .resource = &pmu_resource, | 119 | .resource = &pmu_resource, |
121 | .num_resources = 1, | 120 | .num_resources = 1, |
122 | }; | 121 | }; |
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c index adbfb1994582..4b50228a6771 100644 --- a/arch/arm/mach-bcmring/core.c +++ b/arch/arm/mach-bcmring/core.c | |||
@@ -43,11 +43,10 @@ | |||
43 | #include <asm/mach/time.h> | 43 | #include <asm/mach/time.h> |
44 | #include <asm/mach/map.h> | 44 | #include <asm/mach/map.h> |
45 | 45 | ||
46 | #include <cfg_global.h> | 46 | #include <mach/cfg_global.h> |
47 | 47 | ||
48 | #include "clock.h" | 48 | #include "clock.h" |
49 | 49 | ||
50 | #include <csp/secHw.h> | ||
51 | #include <mach/csp/secHw_def.h> | 50 | #include <mach/csp/secHw_def.h> |
52 | #include <mach/csp/chipcHw_inline.h> | 51 | #include <mach/csp/chipcHw_inline.h> |
53 | #include <mach/csp/tmrHw_reg.h> | 52 | #include <mach/csp/tmrHw_reg.h> |
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw.c index 96273ff34956..5050833817b7 100644 --- a/arch/arm/mach-bcmring/csp/chipc/chipcHw.c +++ b/arch/arm/mach-bcmring/csp/chipc/chipcHw.c | |||
@@ -26,15 +26,15 @@ | |||
26 | 26 | ||
27 | /* ---- Include Files ---------------------------------------------------- */ | 27 | /* ---- Include Files ---------------------------------------------------- */ |
28 | 28 | ||
29 | #include <csp/errno.h> | 29 | #include <linux/errno.h> |
30 | #include <csp/stdint.h> | 30 | #include <linux/types.h> |
31 | #include <csp/module.h> | 31 | #include <linux/export.h> |
32 | 32 | ||
33 | #include <mach/csp/chipcHw_def.h> | 33 | #include <mach/csp/chipcHw_def.h> |
34 | #include <mach/csp/chipcHw_inline.h> | 34 | #include <mach/csp/chipcHw_inline.h> |
35 | 35 | ||
36 | #include <csp/reg.h> | 36 | #include <mach/csp/reg.h> |
37 | #include <csp/delay.h> | 37 | #include <linux/delay.h> |
38 | 38 | ||
39 | /* ---- Private Constants and Types --------------------------------------- */ | 39 | /* ---- Private Constants and Types --------------------------------------- */ |
40 | 40 | ||
@@ -61,21 +61,21 @@ static int chipcHw_divide(int num, int denom) | |||
61 | /****************************************************************************/ | 61 | /****************************************************************************/ |
62 | chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */ | 62 | chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */ |
63 | ) { | 63 | ) { |
64 | volatile uint32_t *pPLLReg = (uint32_t *) 0x0; | 64 | uint32_t __iomem *pPLLReg = NULL; |
65 | volatile uint32_t *pClockCtrl = (uint32_t *) 0x0; | 65 | uint32_t __iomem *pClockCtrl = NULL; |
66 | volatile uint32_t *pDependentClock = (uint32_t *) 0x0; | 66 | uint32_t __iomem *pDependentClock = NULL; |
67 | uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */ | 67 | uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */ |
68 | uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */ | 68 | uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */ |
69 | uint32_t dependentClockType = 0; | 69 | uint32_t dependentClockType = 0; |
70 | uint32_t vcoHz = 0; | 70 | uint32_t vcoHz = 0; |
71 | 71 | ||
72 | /* Get VCO frequencies */ | 72 | /* Get VCO frequencies */ |
73 | if ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { | 73 | if ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { |
74 | uint64_t adjustFreq = 0; | 74 | uint64_t adjustFreq = 0; |
75 | 75 | ||
76 | vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * | 76 | vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * |
77 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * | 77 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * |
78 | ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> | 78 | ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> |
79 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); | 79 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); |
80 | 80 | ||
81 | /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */ | 81 | /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */ |
@@ -86,13 +86,13 @@ chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configur | |||
86 | } else { | 86 | } else { |
87 | vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * | 87 | vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * |
88 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * | 88 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * |
89 | ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> | 89 | ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> |
90 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); | 90 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); |
91 | } | 91 | } |
92 | vcoFreqPll2Hz = | 92 | vcoFreqPll2Hz = |
93 | chipcHw_XTAL_FREQ_Hz * | 93 | chipcHw_XTAL_FREQ_Hz * |
94 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * | 94 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * |
95 | ((pChipcHw->PLLPreDivider2 & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> | 95 | ((readl(&pChipcHw->PLLPreDivider2) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> |
96 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); | 96 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); |
97 | 97 | ||
98 | switch (clock) { | 98 | switch (clock) { |
@@ -187,51 +187,51 @@ chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configur | |||
187 | 187 | ||
188 | if (pPLLReg) { | 188 | if (pPLLReg) { |
189 | /* Obtain PLL clock frequency */ | 189 | /* Obtain PLL clock frequency */ |
190 | if (*pPLLReg & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) { | 190 | if (readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) { |
191 | /* Return crystal clock frequency when bypassed */ | 191 | /* Return crystal clock frequency when bypassed */ |
192 | return chipcHw_XTAL_FREQ_Hz; | 192 | return chipcHw_XTAL_FREQ_Hz; |
193 | } else if (clock == chipcHw_CLOCK_DDR) { | 193 | } else if (clock == chipcHw_CLOCK_DDR) { |
194 | /* DDR frequency is configured in PLLDivider register */ | 194 | /* DDR frequency is configured in PLLDivider register */ |
195 | return chipcHw_divide (vcoHz, (((pChipcHw->PLLDivider & 0xFF000000) >> 24) ? ((pChipcHw->PLLDivider & 0xFF000000) >> 24) : 256)); | 195 | return chipcHw_divide (vcoHz, (((readl(&pChipcHw->PLLDivider) & 0xFF000000) >> 24) ? ((readl(&pChipcHw->PLLDivider) & 0xFF000000) >> 24) : 256)); |
196 | } else { | 196 | } else { |
197 | /* From chip revision number B0, LCD clock is internally divided by 2 */ | 197 | /* From chip revision number B0, LCD clock is internally divided by 2 */ |
198 | if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) { | 198 | if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) { |
199 | vcoHz >>= 1; | 199 | vcoHz >>= 1; |
200 | } | 200 | } |
201 | /* Obtain PLL clock frequency using VCO dividers */ | 201 | /* Obtain PLL clock frequency using VCO dividers */ |
202 | return chipcHw_divide(vcoHz, ((*pPLLReg & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (*pPLLReg & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256)); | 202 | return chipcHw_divide(vcoHz, ((readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256)); |
203 | } | 203 | } |
204 | } else if (pClockCtrl) { | 204 | } else if (pClockCtrl) { |
205 | /* Obtain divider clock frequency */ | 205 | /* Obtain divider clock frequency */ |
206 | uint32_t div; | 206 | uint32_t div; |
207 | uint32_t freq = 0; | 207 | uint32_t freq = 0; |
208 | 208 | ||
209 | if (*pClockCtrl & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) { | 209 | if (readl(pClockCtrl) & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) { |
210 | /* Return crystal clock frequency when bypassed */ | 210 | /* Return crystal clock frequency when bypassed */ |
211 | return chipcHw_XTAL_FREQ_Hz; | 211 | return chipcHw_XTAL_FREQ_Hz; |
212 | } else if (pDependentClock) { | 212 | } else if (pDependentClock) { |
213 | /* Identify the dependent clock frequency */ | 213 | /* Identify the dependent clock frequency */ |
214 | switch (dependentClockType) { | 214 | switch (dependentClockType) { |
215 | case PLL_CLOCK: | 215 | case PLL_CLOCK: |
216 | if (*pDependentClock & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) { | 216 | if (readl(pDependentClock) & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) { |
217 | /* Use crystal clock frequency when dependent PLL clock is bypassed */ | 217 | /* Use crystal clock frequency when dependent PLL clock is bypassed */ |
218 | freq = chipcHw_XTAL_FREQ_Hz; | 218 | freq = chipcHw_XTAL_FREQ_Hz; |
219 | } else { | 219 | } else { |
220 | /* Obtain PLL clock frequency using VCO dividers */ | 220 | /* Obtain PLL clock frequency using VCO dividers */ |
221 | div = *pDependentClock & chipcHw_REG_PLL_CLOCK_MDIV_MASK; | 221 | div = readl(pDependentClock) & chipcHw_REG_PLL_CLOCK_MDIV_MASK; |
222 | freq = div ? chipcHw_divide(vcoHz, div) : 0; | 222 | freq = div ? chipcHw_divide(vcoHz, div) : 0; |
223 | } | 223 | } |
224 | break; | 224 | break; |
225 | case NON_PLL_CLOCK: | 225 | case NON_PLL_CLOCK: |
226 | if (pDependentClock == (uint32_t *) &pChipcHw->ACLKClock) { | 226 | if (pDependentClock == &pChipcHw->ACLKClock) { |
227 | freq = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS); | 227 | freq = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS); |
228 | } else { | 228 | } else { |
229 | if (*pDependentClock & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) { | 229 | if (readl(pDependentClock) & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) { |
230 | /* Use crystal clock frequency when dependent divider clock is bypassed */ | 230 | /* Use crystal clock frequency when dependent divider clock is bypassed */ |
231 | freq = chipcHw_XTAL_FREQ_Hz; | 231 | freq = chipcHw_XTAL_FREQ_Hz; |
232 | } else { | 232 | } else { |
233 | /* Obtain divider clock frequency using XTAL dividers */ | 233 | /* Obtain divider clock frequency using XTAL dividers */ |
234 | div = *pDependentClock & chipcHw_REG_DIV_CLOCK_DIV_MASK; | 234 | div = readl(pDependentClock) & chipcHw_REG_DIV_CLOCK_DIV_MASK; |
235 | freq = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, (div ? div : 256)); | 235 | freq = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, (div ? div : 256)); |
236 | } | 236 | } |
237 | } | 237 | } |
@@ -242,7 +242,7 @@ chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configur | |||
242 | freq = chipcHw_XTAL_FREQ_Hz; | 242 | freq = chipcHw_XTAL_FREQ_Hz; |
243 | } | 243 | } |
244 | 244 | ||
245 | div = *pClockCtrl & chipcHw_REG_DIV_CLOCK_DIV_MASK; | 245 | div = readl(pClockCtrl) & chipcHw_REG_DIV_CLOCK_DIV_MASK; |
246 | return chipcHw_divide(freq, (div ? div : 256)); | 246 | return chipcHw_divide(freq, (div ? div : 256)); |
247 | } | 247 | } |
248 | return 0; | 248 | return 0; |
@@ -261,9 +261,9 @@ chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configur | |||
261 | chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configurable clock */ | 261 | chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configurable clock */ |
262 | uint32_t freq /* [ IN ] Clock frequency in Hz */ | 262 | uint32_t freq /* [ IN ] Clock frequency in Hz */ |
263 | ) { | 263 | ) { |
264 | volatile uint32_t *pPLLReg = (uint32_t *) 0x0; | 264 | uint32_t __iomem *pPLLReg = NULL; |
265 | volatile uint32_t *pClockCtrl = (uint32_t *) 0x0; | 265 | uint32_t __iomem *pClockCtrl = NULL; |
266 | volatile uint32_t *pDependentClock = (uint32_t *) 0x0; | 266 | uint32_t __iomem *pDependentClock = NULL; |
267 | uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */ | 267 | uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */ |
268 | uint32_t desVcoFreqPll1Hz = 0; /* Desired VCO frequency for PLL1 in Hz */ | 268 | uint32_t desVcoFreqPll1Hz = 0; /* Desired VCO frequency for PLL1 in Hz */ |
269 | uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */ | 269 | uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */ |
@@ -272,12 +272,12 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu | |||
272 | uint32_t desVcoHz = 0; | 272 | uint32_t desVcoHz = 0; |
273 | 273 | ||
274 | /* Get VCO frequencies */ | 274 | /* Get VCO frequencies */ |
275 | if ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { | 275 | if ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { |
276 | uint64_t adjustFreq = 0; | 276 | uint64_t adjustFreq = 0; |
277 | 277 | ||
278 | vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * | 278 | vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * |
279 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * | 279 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * |
280 | ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> | 280 | ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> |
281 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); | 281 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); |
282 | 282 | ||
283 | /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */ | 283 | /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */ |
@@ -289,16 +289,16 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu | |||
289 | /* Desired VCO frequency */ | 289 | /* Desired VCO frequency */ |
290 | desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * | 290 | desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * |
291 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * | 291 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * |
292 | (((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> | 292 | (((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> |
293 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT) + 1); | 293 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT) + 1); |
294 | } else { | 294 | } else { |
295 | vcoFreqPll1Hz = desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * | 295 | vcoFreqPll1Hz = desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * |
296 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * | 296 | chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * |
297 | ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> | 297 | ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> |
298 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); | 298 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); |
299 | } | 299 | } |
300 | vcoFreqPll2Hz = chipcHw_XTAL_FREQ_Hz * chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * | 300 | vcoFreqPll2Hz = chipcHw_XTAL_FREQ_Hz * chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * |
301 | ((pChipcHw->PLLPreDivider2 & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> | 301 | ((readl(&pChipcHw->PLLPreDivider2) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> |
302 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); | 302 | chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); |
303 | 303 | ||
304 | switch (clock) { | 304 | switch (clock) { |
@@ -307,8 +307,7 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu | |||
307 | { | 307 | { |
308 | REG_LOCAL_IRQ_SAVE; | 308 | REG_LOCAL_IRQ_SAVE; |
309 | /* Dvide DDR_phy by two to obtain DDR_ctrl clock */ | 309 | /* Dvide DDR_phy by two to obtain DDR_ctrl clock */ |
310 | pChipcHw->DDRClock = (pChipcHw->DDRClock & ~chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK) | ((((freq / 2) / chipcHw_getClockFrequency(chipcHw_CLOCK_BUS)) - 1) | 310 | writel((readl(&pChipcHw->DDRClock) & ~chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK) | ((((freq / 2) / chipcHw_getClockFrequency(chipcHw_CLOCK_BUS)) - 1) << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT), &pChipcHw->DDRClock); |
311 | << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT); | ||
312 | REG_LOCAL_IRQ_RESTORE; | 311 | REG_LOCAL_IRQ_RESTORE; |
313 | } | 312 | } |
314 | pPLLReg = &pChipcHw->DDRClock; | 313 | pPLLReg = &pChipcHw->DDRClock; |
@@ -329,8 +328,7 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu | |||
329 | /* Configure the VPM:BUS ratio settings */ | 328 | /* Configure the VPM:BUS ratio settings */ |
330 | { | 329 | { |
331 | REG_LOCAL_IRQ_SAVE; | 330 | REG_LOCAL_IRQ_SAVE; |
332 | pChipcHw->VPMClock = (pChipcHw->VPMClock & ~chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK) | ((chipcHw_divide (freq, chipcHw_getClockFrequency(chipcHw_CLOCK_BUS)) - 1) | 331 | writel((readl(&pChipcHw->VPMClock) & ~chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK) | ((chipcHw_divide (freq, chipcHw_getClockFrequency(chipcHw_CLOCK_BUS)) - 1) << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT), &pChipcHw->VPMClock); |
333 | << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT); | ||
334 | REG_LOCAL_IRQ_RESTORE; | 332 | REG_LOCAL_IRQ_RESTORE; |
335 | } | 333 | } |
336 | pPLLReg = &pChipcHw->VPMClock; | 334 | pPLLReg = &pChipcHw->VPMClock; |
@@ -428,9 +426,9 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu | |||
428 | /* For DDR settings use only the PLL divider clock */ | 426 | /* For DDR settings use only the PLL divider clock */ |
429 | if (pPLLReg == &pChipcHw->DDRClock) { | 427 | if (pPLLReg == &pChipcHw->DDRClock) { |
430 | /* Set M1DIV for PLL1, which controls the DDR clock */ | 428 | /* Set M1DIV for PLL1, which controls the DDR clock */ |
431 | reg32_write(&pChipcHw->PLLDivider, (pChipcHw->PLLDivider & 0x00FFFFFF) | ((chipcHw_REG_PLL_DIVIDER_MDIV (desVcoHz, freq)) << 24)); | 429 | reg32_write(&pChipcHw->PLLDivider, (readl(&pChipcHw->PLLDivider) & 0x00FFFFFF) | ((chipcHw_REG_PLL_DIVIDER_MDIV (desVcoHz, freq)) << 24)); |
432 | /* Calculate expected frequency */ | 430 | /* Calculate expected frequency */ |
433 | freq = chipcHw_divide(vcoHz, (((pChipcHw->PLLDivider & 0xFF000000) >> 24) ? ((pChipcHw->PLLDivider & 0xFF000000) >> 24) : 256)); | 431 | freq = chipcHw_divide(vcoHz, (((readl(&pChipcHw->PLLDivider) & 0xFF000000) >> 24) ? ((readl(&pChipcHw->PLLDivider) & 0xFF000000) >> 24) : 256)); |
434 | } else { | 432 | } else { |
435 | /* From chip revision number B0, LCD clock is internally divided by 2 */ | 433 | /* From chip revision number B0, LCD clock is internally divided by 2 */ |
436 | if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) { | 434 | if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) { |
@@ -441,7 +439,7 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu | |||
441 | reg32_modify_and(pPLLReg, ~(chipcHw_REG_PLL_CLOCK_MDIV_MASK)); | 439 | reg32_modify_and(pPLLReg, ~(chipcHw_REG_PLL_CLOCK_MDIV_MASK)); |
442 | reg32_modify_or(pPLLReg, chipcHw_REG_PLL_DIVIDER_MDIV(desVcoHz, freq)); | 440 | reg32_modify_or(pPLLReg, chipcHw_REG_PLL_DIVIDER_MDIV(desVcoHz, freq)); |
443 | /* Calculate expected frequency */ | 441 | /* Calculate expected frequency */ |
444 | freq = chipcHw_divide(vcoHz, ((*(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (*(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256)); | 442 | freq = chipcHw_divide(vcoHz, ((readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256)); |
445 | } | 443 | } |
446 | /* Wait for for atleast 200ns as per the protocol to change frequency */ | 444 | /* Wait for for atleast 200ns as per the protocol to change frequency */ |
447 | udelay(1); | 445 | udelay(1); |
@@ -460,16 +458,16 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu | |||
460 | if (pDependentClock) { | 458 | if (pDependentClock) { |
461 | switch (dependentClockType) { | 459 | switch (dependentClockType) { |
462 | case PLL_CLOCK: | 460 | case PLL_CLOCK: |
463 | divider = chipcHw_divide(chipcHw_divide (desVcoHz, (*pDependentClock & chipcHw_REG_PLL_CLOCK_MDIV_MASK)), freq); | 461 | divider = chipcHw_divide(chipcHw_divide (desVcoHz, (readl(pDependentClock) & chipcHw_REG_PLL_CLOCK_MDIV_MASK)), freq); |
464 | break; | 462 | break; |
465 | case NON_PLL_CLOCK: | 463 | case NON_PLL_CLOCK: |
466 | { | 464 | { |
467 | uint32_t sourceClock = 0; | 465 | uint32_t sourceClock = 0; |
468 | 466 | ||
469 | if (pDependentClock == (uint32_t *) &pChipcHw->ACLKClock) { | 467 | if (pDependentClock == &pChipcHw->ACLKClock) { |
470 | sourceClock = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS); | 468 | sourceClock = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS); |
471 | } else { | 469 | } else { |
472 | uint32_t div = *pDependentClock & chipcHw_REG_DIV_CLOCK_DIV_MASK; | 470 | uint32_t div = readl(pDependentClock) & chipcHw_REG_DIV_CLOCK_DIV_MASK; |
473 | sourceClock = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, ((div) ? div : 256)); | 471 | sourceClock = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, ((div) ? div : 256)); |
474 | } | 472 | } |
475 | divider = chipcHw_divide(sourceClock, freq); | 473 | divider = chipcHw_divide(sourceClock, freq); |
@@ -483,7 +481,7 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu | |||
483 | if (divider) { | 481 | if (divider) { |
484 | REG_LOCAL_IRQ_SAVE; | 482 | REG_LOCAL_IRQ_SAVE; |
485 | /* Set the divider to obtain the required frequency */ | 483 | /* Set the divider to obtain the required frequency */ |
486 | *pClockCtrl = (*pClockCtrl & (~chipcHw_REG_DIV_CLOCK_DIV_MASK)) | (((divider > 256) ? chipcHw_REG_DIV_CLOCK_DIV_256 : divider) & chipcHw_REG_DIV_CLOCK_DIV_MASK); | 484 | writel((readl(pClockCtrl) & (~chipcHw_REG_DIV_CLOCK_DIV_MASK)) | (((divider > 256) ? chipcHw_REG_DIV_CLOCK_DIV_256 : divider) & chipcHw_REG_DIV_CLOCK_DIV_MASK), pClockCtrl); |
487 | REG_LOCAL_IRQ_RESTORE; | 485 | REG_LOCAL_IRQ_RESTORE; |
488 | return freq; | 486 | return freq; |
489 | } | 487 | } |
@@ -515,25 +513,26 @@ static int vpmPhaseAlignA0(void) | |||
515 | int count = 0; | 513 | int count = 0; |
516 | 514 | ||
517 | for (iter = 0; (iter < MAX_PHASE_ALIGN_ATTEMPTS) && (adjustCount < MAX_PHASE_ADJUST_COUNT); iter++) { | 515 | for (iter = 0; (iter < MAX_PHASE_ALIGN_ATTEMPTS) && (adjustCount < MAX_PHASE_ADJUST_COUNT); iter++) { |
518 | phaseControl = (pChipcHw->VPMClock & chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT; | 516 | phaseControl = (readl(&pChipcHw->VPMClock) & chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT; |
519 | phaseValue = 0; | 517 | phaseValue = 0; |
520 | prevPhaseComp = 0; | 518 | prevPhaseComp = 0; |
521 | 519 | ||
522 | /* Step 1: Look for falling PH_COMP transition */ | 520 | /* Step 1: Look for falling PH_COMP transition */ |
523 | 521 | ||
524 | /* Read the contents of VPM Clock resgister */ | 522 | /* Read the contents of VPM Clock resgister */ |
525 | phaseValue = pChipcHw->VPMClock; | 523 | phaseValue = readl(&pChipcHw->VPMClock); |
526 | do { | 524 | do { |
527 | /* Store previous value of phase comparator */ | 525 | /* Store previous value of phase comparator */ |
528 | prevPhaseComp = phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP; | 526 | prevPhaseComp = phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP; |
529 | /* Change the value of PH_CTRL. */ | 527 | /* Change the value of PH_CTRL. */ |
530 | reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | 528 | reg32_write(&pChipcHw->VPMClock, |
529 | (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | ||
531 | /* Wait atleast 20 ns */ | 530 | /* Wait atleast 20 ns */ |
532 | udelay(1); | 531 | udelay(1); |
533 | /* Toggle the LOAD_CH after phase control is written. */ | 532 | /* Toggle the LOAD_CH after phase control is written. */ |
534 | pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; | 533 | writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock); |
535 | /* Read the contents of VPM Clock resgister. */ | 534 | /* Read the contents of VPM Clock resgister. */ |
536 | phaseValue = pChipcHw->VPMClock; | 535 | phaseValue = readl(&pChipcHw->VPMClock); |
537 | 536 | ||
538 | if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) { | 537 | if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) { |
539 | phaseControl = (0x3F & (phaseControl - 1)); | 538 | phaseControl = (0x3F & (phaseControl - 1)); |
@@ -557,12 +556,13 @@ static int vpmPhaseAlignA0(void) | |||
557 | 556 | ||
558 | for (count = 0; (count < 5) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) { | 557 | for (count = 0; (count < 5) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) { |
559 | phaseControl = (0x3F & (phaseControl + 1)); | 558 | phaseControl = (0x3F & (phaseControl + 1)); |
560 | reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | 559 | reg32_write(&pChipcHw->VPMClock, |
560 | (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | ||
561 | /* Wait atleast 20 ns */ | 561 | /* Wait atleast 20 ns */ |
562 | udelay(1); | 562 | udelay(1); |
563 | /* Toggle the LOAD_CH after phase control is written. */ | 563 | /* Toggle the LOAD_CH after phase control is written. */ |
564 | pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; | 564 | writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock); |
565 | phaseValue = pChipcHw->VPMClock; | 565 | phaseValue = readl(&pChipcHw->VPMClock); |
566 | /* Count number of adjustment made */ | 566 | /* Count number of adjustment made */ |
567 | adjustCount++; | 567 | adjustCount++; |
568 | } | 568 | } |
@@ -581,12 +581,13 @@ static int vpmPhaseAlignA0(void) | |||
581 | 581 | ||
582 | for (count = 0; (count < 3) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) { | 582 | for (count = 0; (count < 3) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) { |
583 | phaseControl = (0x3F & (phaseControl - 1)); | 583 | phaseControl = (0x3F & (phaseControl - 1)); |
584 | reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | 584 | reg32_write(&pChipcHw->VPMClock, |
585 | (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | ||
585 | /* Wait atleast 20 ns */ | 586 | /* Wait atleast 20 ns */ |
586 | udelay(1); | 587 | udelay(1); |
587 | /* Toggle the LOAD_CH after phase control is written. */ | 588 | /* Toggle the LOAD_CH after phase control is written. */ |
588 | pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; | 589 | writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock); |
589 | phaseValue = pChipcHw->VPMClock; | 590 | phaseValue = readl(&pChipcHw->VPMClock); |
590 | /* Count number of adjustment made */ | 591 | /* Count number of adjustment made */ |
591 | adjustCount++; | 592 | adjustCount++; |
592 | } | 593 | } |
@@ -605,12 +606,13 @@ static int vpmPhaseAlignA0(void) | |||
605 | 606 | ||
606 | for (count = 0; (count < 5); count++) { | 607 | for (count = 0; (count < 5); count++) { |
607 | phaseControl = (0x3F & (phaseControl - 1)); | 608 | phaseControl = (0x3F & (phaseControl - 1)); |
608 | reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | 609 | reg32_write(&pChipcHw->VPMClock, |
610 | (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | ||
609 | /* Wait atleast 20 ns */ | 611 | /* Wait atleast 20 ns */ |
610 | udelay(1); | 612 | udelay(1); |
611 | /* Toggle the LOAD_CH after phase control is written. */ | 613 | /* Toggle the LOAD_CH after phase control is written. */ |
612 | pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; | 614 | writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock); |
613 | phaseValue = pChipcHw->VPMClock; | 615 | phaseValue = readl(&pChipcHw->VPMClock); |
614 | /* Count number of adjustment made */ | 616 | /* Count number of adjustment made */ |
615 | adjustCount++; | 617 | adjustCount++; |
616 | } | 618 | } |
@@ -631,14 +633,14 @@ static int vpmPhaseAlignA0(void) | |||
631 | /* Store previous value of phase comparator */ | 633 | /* Store previous value of phase comparator */ |
632 | prevPhaseComp = phaseValue; | 634 | prevPhaseComp = phaseValue; |
633 | /* Change the value of PH_CTRL. */ | 635 | /* Change the value of PH_CTRL. */ |
634 | reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | 636 | reg32_write(&pChipcHw->VPMClock, |
637 | (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | ||
635 | /* Wait atleast 20 ns */ | 638 | /* Wait atleast 20 ns */ |
636 | udelay(1); | 639 | udelay(1); |
637 | /* Toggle the LOAD_CH after phase control is written. */ | 640 | /* Toggle the LOAD_CH after phase control is written. */ |
638 | pChipcHw->VPMClock ^= | 641 | writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock); |
639 | chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; | ||
640 | /* Read the contents of VPM Clock resgister. */ | 642 | /* Read the contents of VPM Clock resgister. */ |
641 | phaseValue = pChipcHw->VPMClock; | 643 | phaseValue = readl(&pChipcHw->VPMClock); |
642 | 644 | ||
643 | if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) { | 645 | if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) { |
644 | phaseControl = (0x3F & (phaseControl - 1)); | 646 | phaseControl = (0x3F & (phaseControl - 1)); |
@@ -661,13 +663,13 @@ static int vpmPhaseAlignA0(void) | |||
661 | } | 663 | } |
662 | 664 | ||
663 | /* For VPM Phase should be perfectly aligned. */ | 665 | /* For VPM Phase should be perfectly aligned. */ |
664 | phaseControl = (((pChipcHw->VPMClock >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT) - 1) & 0x3F); | 666 | phaseControl = (((readl(&pChipcHw->VPMClock) >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT) - 1) & 0x3F); |
665 | { | 667 | { |
666 | REG_LOCAL_IRQ_SAVE; | 668 | REG_LOCAL_IRQ_SAVE; |
667 | 669 | ||
668 | pChipcHw->VPMClock = (pChipcHw->VPMClock & ~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT); | 670 | writel((readl(&pChipcHw->VPMClock) & ~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT), &pChipcHw->VPMClock); |
669 | /* Load new phase value */ | 671 | /* Load new phase value */ |
670 | pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; | 672 | writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock); |
671 | 673 | ||
672 | REG_LOCAL_IRQ_RESTORE; | 674 | REG_LOCAL_IRQ_RESTORE; |
673 | } | 675 | } |
@@ -697,7 +699,7 @@ int chipcHw_vpmPhaseAlign(void) | |||
697 | int adjustCount = 0; | 699 | int adjustCount = 0; |
698 | 700 | ||
699 | /* Disable VPM access */ | 701 | /* Disable VPM access */ |
700 | pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE; | 702 | writel(readl(&pChipcHw->Spare1) & ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE, &pChipcHw->Spare1); |
701 | /* Disable HW VPM phase alignment */ | 703 | /* Disable HW VPM phase alignment */ |
702 | chipcHw_vpmHwPhaseAlignDisable(); | 704 | chipcHw_vpmHwPhaseAlignDisable(); |
703 | /* Enable SW VPM phase alignment */ | 705 | /* Enable SW VPM phase alignment */ |
@@ -715,23 +717,24 @@ int chipcHw_vpmPhaseAlign(void) | |||
715 | phaseControl--; | 717 | phaseControl--; |
716 | } else { | 718 | } else { |
717 | /* Enable VPM access */ | 719 | /* Enable VPM access */ |
718 | pChipcHw->Spare1 |= chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE; | 720 | writel(readl(&pChipcHw->Spare1) | chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE, &pChipcHw->Spare1); |
719 | /* Return adjust count */ | 721 | /* Return adjust count */ |
720 | return adjustCount; | 722 | return adjustCount; |
721 | } | 723 | } |
722 | /* Change the value of PH_CTRL. */ | 724 | /* Change the value of PH_CTRL. */ |
723 | reg32_write(&pChipcHw->VPMClock, (pChipcHw->VPMClock & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | 725 | reg32_write(&pChipcHw->VPMClock, |
726 | (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT)); | ||
724 | /* Wait atleast 20 ns */ | 727 | /* Wait atleast 20 ns */ |
725 | udelay(1); | 728 | udelay(1); |
726 | /* Toggle the LOAD_CH after phase control is written. */ | 729 | /* Toggle the LOAD_CH after phase control is written. */ |
727 | pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; | 730 | writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock); |
728 | /* Count adjustment */ | 731 | /* Count adjustment */ |
729 | adjustCount++; | 732 | adjustCount++; |
730 | } | 733 | } |
731 | } | 734 | } |
732 | 735 | ||
733 | /* Disable VPM access */ | 736 | /* Disable VPM access */ |
734 | pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE; | 737 | writel(readl(&pChipcHw->Spare1) & ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE, &pChipcHw->Spare1); |
735 | return -1; | 738 | return -1; |
736 | } | 739 | } |
737 | 740 | ||
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c index 367df75d4bb3..8377d8054168 100644 --- a/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c +++ b/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c | |||
@@ -26,15 +26,15 @@ | |||
26 | 26 | ||
27 | /* ---- Include Files ---------------------------------------------------- */ | 27 | /* ---- Include Files ---------------------------------------------------- */ |
28 | 28 | ||
29 | #include <csp/errno.h> | 29 | #include <linux/errno.h> |
30 | #include <csp/stdint.h> | 30 | #include <linux/types.h> |
31 | #include <csp/module.h> | 31 | #include <linux/export.h> |
32 | 32 | ||
33 | #include <mach/csp/chipcHw_def.h> | 33 | #include <mach/csp/chipcHw_def.h> |
34 | #include <mach/csp/chipcHw_inline.h> | 34 | #include <mach/csp/chipcHw_inline.h> |
35 | 35 | ||
36 | #include <csp/reg.h> | 36 | #include <mach/csp/reg.h> |
37 | #include <csp/delay.h> | 37 | #include <linux/delay.h> |
38 | /* ---- Private Constants and Types --------------------------------------- */ | 38 | /* ---- Private Constants and Types --------------------------------------- */ |
39 | 39 | ||
40 | /* | 40 | /* |
@@ -73,9 +73,9 @@ void chipcHw_pll2Enable(uint32_t vcoFreqHz) | |||
73 | 73 | ||
74 | { | 74 | { |
75 | REG_LOCAL_IRQ_SAVE; | 75 | REG_LOCAL_IRQ_SAVE; |
76 | pChipcHw->PLLConfig2 = | 76 | writel(chipcHw_REG_PLL_CONFIG_D_RESET | |
77 | chipcHw_REG_PLL_CONFIG_D_RESET | | 77 | chipcHw_REG_PLL_CONFIG_A_RESET, |
78 | chipcHw_REG_PLL_CONFIG_A_RESET; | 78 | &pChipcHw->PLLConfig2); |
79 | 79 | ||
80 | pllPreDivider2 = chipcHw_REG_PLL_PREDIVIDER_POWER_DOWN | | 80 | pllPreDivider2 = chipcHw_REG_PLL_PREDIVIDER_POWER_DOWN | |
81 | chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER | | 81 | chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER | |
@@ -87,28 +87,30 @@ void chipcHw_pll2Enable(uint32_t vcoFreqHz) | |||
87 | chipcHw_REG_PLL_PREDIVIDER_P2_SHIFT); | 87 | chipcHw_REG_PLL_PREDIVIDER_P2_SHIFT); |
88 | 88 | ||
89 | /* Enable CHIPC registers to control the PLL */ | 89 | /* Enable CHIPC registers to control the PLL */ |
90 | pChipcHw->PLLStatus |= chipcHw_REG_PLL_STATUS_CONTROL_ENABLE; | 90 | writel(readl(&pChipcHw->PLLStatus) | chipcHw_REG_PLL_STATUS_CONTROL_ENABLE, &pChipcHw->PLLStatus); |
91 | 91 | ||
92 | /* Set pre divider to get desired VCO frequency */ | 92 | /* Set pre divider to get desired VCO frequency */ |
93 | pChipcHw->PLLPreDivider2 = pllPreDivider2; | 93 | writel(pllPreDivider2, &pChipcHw->PLLPreDivider2); |
94 | /* Set NDIV Frac */ | 94 | /* Set NDIV Frac */ |
95 | pChipcHw->PLLDivider2 = chipcHw_REG_PLL_DIVIDER_NDIV_f; | 95 | writel(chipcHw_REG_PLL_DIVIDER_NDIV_f, &pChipcHw->PLLDivider2); |
96 | 96 | ||
97 | /* This has to be removed once the default values are fixed for PLL2. */ | 97 | /* This has to be removed once the default values are fixed for PLL2. */ |
98 | pChipcHw->PLLControl12 = 0x38000700; | 98 | writel(0x38000700, &pChipcHw->PLLControl12); |
99 | pChipcHw->PLLControl22 = 0x00000015; | 99 | writel(0x00000015, &pChipcHw->PLLControl22); |
100 | 100 | ||
101 | /* Reset PLL2 */ | 101 | /* Reset PLL2 */ |
102 | if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) { | 102 | if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) { |
103 | pChipcHw->PLLConfig2 = chipcHw_REG_PLL_CONFIG_D_RESET | | 103 | writel(chipcHw_REG_PLL_CONFIG_D_RESET | |
104 | chipcHw_REG_PLL_CONFIG_A_RESET | | 104 | chipcHw_REG_PLL_CONFIG_A_RESET | |
105 | chipcHw_REG_PLL_CONFIG_VCO_1601_3200 | | 105 | chipcHw_REG_PLL_CONFIG_VCO_1601_3200 | |
106 | chipcHw_REG_PLL_CONFIG_POWER_DOWN; | 106 | chipcHw_REG_PLL_CONFIG_POWER_DOWN, |
107 | &pChipcHw->PLLConfig2); | ||
107 | } else { | 108 | } else { |
108 | pChipcHw->PLLConfig2 = chipcHw_REG_PLL_CONFIG_D_RESET | | 109 | writel(chipcHw_REG_PLL_CONFIG_D_RESET | |
109 | chipcHw_REG_PLL_CONFIG_A_RESET | | 110 | chipcHw_REG_PLL_CONFIG_A_RESET | |
110 | chipcHw_REG_PLL_CONFIG_VCO_800_1600 | | 111 | chipcHw_REG_PLL_CONFIG_VCO_800_1600 | |
111 | chipcHw_REG_PLL_CONFIG_POWER_DOWN; | 112 | chipcHw_REG_PLL_CONFIG_POWER_DOWN, |
113 | &pChipcHw->PLLConfig2); | ||
112 | } | 114 | } |
113 | REG_LOCAL_IRQ_RESTORE; | 115 | REG_LOCAL_IRQ_RESTORE; |
114 | } | 116 | } |
@@ -119,22 +121,25 @@ void chipcHw_pll2Enable(uint32_t vcoFreqHz) | |||
119 | { | 121 | { |
120 | REG_LOCAL_IRQ_SAVE; | 122 | REG_LOCAL_IRQ_SAVE; |
121 | /* Remove analog reset and Power on the PLL */ | 123 | /* Remove analog reset and Power on the PLL */ |
122 | pChipcHw->PLLConfig2 &= | 124 | writel(readl(&pChipcHw->PLLConfig2) & |
123 | ~(chipcHw_REG_PLL_CONFIG_A_RESET | | 125 | ~(chipcHw_REG_PLL_CONFIG_A_RESET | |
124 | chipcHw_REG_PLL_CONFIG_POWER_DOWN); | 126 | chipcHw_REG_PLL_CONFIG_POWER_DOWN), |
127 | &pChipcHw->PLLConfig2); | ||
125 | 128 | ||
126 | REG_LOCAL_IRQ_RESTORE; | 129 | REG_LOCAL_IRQ_RESTORE; |
127 | 130 | ||
128 | } | 131 | } |
129 | 132 | ||
130 | /* Wait until PLL is locked */ | 133 | /* Wait until PLL is locked */ |
131 | while (!(pChipcHw->PLLStatus2 & chipcHw_REG_PLL_STATUS_LOCKED)) | 134 | while (!(readl(&pChipcHw->PLLStatus2) & chipcHw_REG_PLL_STATUS_LOCKED)) |
132 | ; | 135 | ; |
133 | 136 | ||
134 | { | 137 | { |
135 | REG_LOCAL_IRQ_SAVE; | 138 | REG_LOCAL_IRQ_SAVE; |
136 | /* Remove digital reset */ | 139 | /* Remove digital reset */ |
137 | pChipcHw->PLLConfig2 &= ~chipcHw_REG_PLL_CONFIG_D_RESET; | 140 | writel(readl(&pChipcHw->PLLConfig2) & |
141 | ~chipcHw_REG_PLL_CONFIG_D_RESET, | ||
142 | &pChipcHw->PLLConfig2); | ||
138 | 143 | ||
139 | REG_LOCAL_IRQ_RESTORE; | 144 | REG_LOCAL_IRQ_RESTORE; |
140 | } | 145 | } |
@@ -157,9 +162,9 @@ void chipcHw_pll1Enable(uint32_t vcoFreqHz, chipcHw_SPREAD_SPECTRUM_e ssSupport) | |||
157 | { | 162 | { |
158 | REG_LOCAL_IRQ_SAVE; | 163 | REG_LOCAL_IRQ_SAVE; |
159 | 164 | ||
160 | pChipcHw->PLLConfig = | 165 | writel(chipcHw_REG_PLL_CONFIG_D_RESET | |
161 | chipcHw_REG_PLL_CONFIG_D_RESET | | 166 | chipcHw_REG_PLL_CONFIG_A_RESET, |
162 | chipcHw_REG_PLL_CONFIG_A_RESET; | 167 | &pChipcHw->PLLConfig); |
163 | /* Setting VCO frequency */ | 168 | /* Setting VCO frequency */ |
164 | if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) { | 169 | if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) { |
165 | pllPreDivider = | 170 | pllPreDivider = |
@@ -182,30 +187,22 @@ void chipcHw_pll1Enable(uint32_t vcoFreqHz, chipcHw_SPREAD_SPECTRUM_e ssSupport) | |||
182 | } | 187 | } |
183 | 188 | ||
184 | /* Enable CHIPC registers to control the PLL */ | 189 | /* Enable CHIPC registers to control the PLL */ |
185 | pChipcHw->PLLStatus |= chipcHw_REG_PLL_STATUS_CONTROL_ENABLE; | 190 | writel(readl(&pChipcHw->PLLStatus) | chipcHw_REG_PLL_STATUS_CONTROL_ENABLE, &pChipcHw->PLLStatus); |
186 | 191 | ||
187 | /* Set pre divider to get desired VCO frequency */ | 192 | /* Set pre divider to get desired VCO frequency */ |
188 | pChipcHw->PLLPreDivider = pllPreDivider; | 193 | writel(pllPreDivider, &pChipcHw->PLLPreDivider); |
189 | /* Set NDIV Frac */ | 194 | /* Set NDIV Frac */ |
190 | if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) { | 195 | if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) { |
191 | pChipcHw->PLLDivider = chipcHw_REG_PLL_DIVIDER_M1DIV | | 196 | writel(chipcHw_REG_PLL_DIVIDER_M1DIV | chipcHw_REG_PLL_DIVIDER_NDIV_f_SS, &pChipcHw->PLLDivider); |
192 | chipcHw_REG_PLL_DIVIDER_NDIV_f_SS; | ||
193 | } else { | 197 | } else { |
194 | pChipcHw->PLLDivider = chipcHw_REG_PLL_DIVIDER_M1DIV | | 198 | writel(chipcHw_REG_PLL_DIVIDER_M1DIV | chipcHw_REG_PLL_DIVIDER_NDIV_f, &pChipcHw->PLLDivider); |
195 | chipcHw_REG_PLL_DIVIDER_NDIV_f; | ||
196 | } | 199 | } |
197 | 200 | ||
198 | /* Reset PLL1 */ | 201 | /* Reset PLL1 */ |
199 | if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) { | 202 | if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) { |
200 | pChipcHw->PLLConfig = chipcHw_REG_PLL_CONFIG_D_RESET | | 203 | writel(chipcHw_REG_PLL_CONFIG_D_RESET | chipcHw_REG_PLL_CONFIG_A_RESET | chipcHw_REG_PLL_CONFIG_VCO_1601_3200 | chipcHw_REG_PLL_CONFIG_POWER_DOWN, &pChipcHw->PLLConfig); |
201 | chipcHw_REG_PLL_CONFIG_A_RESET | | ||
202 | chipcHw_REG_PLL_CONFIG_VCO_1601_3200 | | ||
203 | chipcHw_REG_PLL_CONFIG_POWER_DOWN; | ||
204 | } else { | 204 | } else { |
205 | pChipcHw->PLLConfig = chipcHw_REG_PLL_CONFIG_D_RESET | | 205 | writel(chipcHw_REG_PLL_CONFIG_D_RESET | chipcHw_REG_PLL_CONFIG_A_RESET | chipcHw_REG_PLL_CONFIG_VCO_800_1600 | chipcHw_REG_PLL_CONFIG_POWER_DOWN, &pChipcHw->PLLConfig); |
206 | chipcHw_REG_PLL_CONFIG_A_RESET | | ||
207 | chipcHw_REG_PLL_CONFIG_VCO_800_1600 | | ||
208 | chipcHw_REG_PLL_CONFIG_POWER_DOWN; | ||
209 | } | 206 | } |
210 | 207 | ||
211 | REG_LOCAL_IRQ_RESTORE; | 208 | REG_LOCAL_IRQ_RESTORE; |
@@ -216,22 +213,19 @@ void chipcHw_pll1Enable(uint32_t vcoFreqHz, chipcHw_SPREAD_SPECTRUM_e ssSupport) | |||
216 | { | 213 | { |
217 | REG_LOCAL_IRQ_SAVE; | 214 | REG_LOCAL_IRQ_SAVE; |
218 | /* Remove analog reset and Power on the PLL */ | 215 | /* Remove analog reset and Power on the PLL */ |
219 | pChipcHw->PLLConfig &= | 216 | writel(readl(&pChipcHw->PLLConfig) & ~(chipcHw_REG_PLL_CONFIG_A_RESET | chipcHw_REG_PLL_CONFIG_POWER_DOWN), &pChipcHw->PLLConfig); |
220 | ~(chipcHw_REG_PLL_CONFIG_A_RESET | | ||
221 | chipcHw_REG_PLL_CONFIG_POWER_DOWN); | ||
222 | REG_LOCAL_IRQ_RESTORE; | 217 | REG_LOCAL_IRQ_RESTORE; |
223 | } | 218 | } |
224 | 219 | ||
225 | /* Wait until PLL is locked */ | 220 | /* Wait until PLL is locked */ |
226 | while (!(pChipcHw->PLLStatus & chipcHw_REG_PLL_STATUS_LOCKED) | 221 | while (!(readl(&pChipcHw->PLLStatus) & chipcHw_REG_PLL_STATUS_LOCKED) |
227 | || !(pChipcHw-> | 222 | || !(readl(&pChipcHw->PLLStatus2) & chipcHw_REG_PLL_STATUS_LOCKED)) |
228 | PLLStatus2 & chipcHw_REG_PLL_STATUS_LOCKED)) | ||
229 | ; | 223 | ; |
230 | 224 | ||
231 | /* Remove digital reset */ | 225 | /* Remove digital reset */ |
232 | { | 226 | { |
233 | REG_LOCAL_IRQ_SAVE; | 227 | REG_LOCAL_IRQ_SAVE; |
234 | pChipcHw->PLLConfig &= ~chipcHw_REG_PLL_CONFIG_D_RESET; | 228 | writel(readl(&pChipcHw->PLLConfig) & ~chipcHw_REG_PLL_CONFIG_D_RESET, &pChipcHw->PLLConfig); |
235 | REG_LOCAL_IRQ_RESTORE; | 229 | REG_LOCAL_IRQ_RESTORE; |
236 | } | 230 | } |
237 | } | 231 | } |
@@ -267,11 +261,7 @@ void chipcHw_Init(chipcHw_INIT_PARAM_t *initParam /* [ IN ] Misc chip initializ | |||
267 | chipcHw_clearStickyBits(chipcHw_REG_STICKY_CHIP_SOFT_RESET); | 261 | chipcHw_clearStickyBits(chipcHw_REG_STICKY_CHIP_SOFT_RESET); |
268 | 262 | ||
269 | /* Before configuring the ARM clock, atleast we need to make sure BUS clock maintains the proper ratio with ARM clock */ | 263 | /* Before configuring the ARM clock, atleast we need to make sure BUS clock maintains the proper ratio with ARM clock */ |
270 | pChipcHw->ACLKClock = | 264 | writel((readl(&pChipcHw->ACLKClock) & ~chipcHw_REG_ACLKClock_CLK_DIV_MASK) | (initParam-> armBusRatio & chipcHw_REG_ACLKClock_CLK_DIV_MASK), &pChipcHw->ACLKClock); |
271 | (pChipcHw-> | ||
272 | ACLKClock & ~chipcHw_REG_ACLKClock_CLK_DIV_MASK) | (initParam-> | ||
273 | armBusRatio & | ||
274 | chipcHw_REG_ACLKClock_CLK_DIV_MASK); | ||
275 | 265 | ||
276 | /* Set various core component frequencies. The order in which this is done is important for some. */ | 266 | /* Set various core component frequencies. The order in which this is done is important for some. */ |
277 | /* The RTBUS (DDR PHY) is derived from the BUS, and the BUS from the ARM, and VPM needs to know BUS */ | 267 | /* The RTBUS (DDR PHY) is derived from the BUS, and the BUS from the ARM, and VPM needs to know BUS */ |
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c index 2671d8896bbb..f95ce913fa1e 100644 --- a/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c +++ b/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c | |||
@@ -13,11 +13,11 @@ | |||
13 | *****************************************************************************/ | 13 | *****************************************************************************/ |
14 | 14 | ||
15 | /* ---- Include Files ---------------------------------------------------- */ | 15 | /* ---- Include Files ---------------------------------------------------- */ |
16 | #include <csp/stdint.h> | 16 | #include <linux/types.h> |
17 | #include <mach/csp/chipcHw_def.h> | 17 | #include <mach/csp/chipcHw_def.h> |
18 | #include <mach/csp/chipcHw_inline.h> | 18 | #include <mach/csp/chipcHw_inline.h> |
19 | #include <csp/intcHw.h> | 19 | #include <mach/csp/intcHw_reg.h> |
20 | #include <csp/cache.h> | 20 | #include <asm/cacheflush.h> |
21 | 21 | ||
22 | /* ---- Private Constants and Types --------------------------------------- */ | 22 | /* ---- Private Constants and Types --------------------------------------- */ |
23 | /* ---- Private Variables ------------------------------------------------- */ | 23 | /* ---- Private Variables ------------------------------------------------- */ |
@@ -50,17 +50,18 @@ void chipcHw_reset(uint32_t mask) | |||
50 | chipcHw_softReset(chipcHw_REG_SOFT_RESET_CHIP_SOFT); | 50 | chipcHw_softReset(chipcHw_REG_SOFT_RESET_CHIP_SOFT); |
51 | } | 51 | } |
52 | /* Bypass the PLL clocks before reboot */ | 52 | /* Bypass the PLL clocks before reboot */ |
53 | pChipcHw->UARTClock |= chipcHw_REG_PLL_CLOCK_BYPASS_SELECT; | 53 | writel(readl(&pChipcHw->UARTClock) | chipcHw_REG_PLL_CLOCK_BYPASS_SELECT, |
54 | pChipcHw->SPIClock |= chipcHw_REG_PLL_CLOCK_BYPASS_SELECT; | 54 | &pChipcHw->UARTClock); |
55 | writel(readl(&pChipcHw->SPIClock) | chipcHw_REG_PLL_CLOCK_BYPASS_SELECT, | ||
56 | &pChipcHw->SPIClock); | ||
55 | 57 | ||
56 | /* Copy the chipcHw_warmReset_run_from_aram function into ARAM */ | 58 | /* Copy the chipcHw_warmReset_run_from_aram function into ARAM */ |
57 | do { | 59 | do { |
58 | ((uint32_t *) MM_IO_BASE_ARAM)[i] = | 60 | writel(((uint32_t *) &chipcHw_reset_run_from_aram)[i], ((uint32_t __iomem *) MM_IO_BASE_ARAM) + i); |
59 | ((uint32_t *) &chipcHw_reset_run_from_aram)[i]; | ||
60 | i++; | 61 | i++; |
61 | } while (((uint32_t *) MM_IO_BASE_ARAM)[i - 1] != 0xe1a0f00f); /* 0xe1a0f00f == asm ("mov r15, r15"); */ | 62 | } while (readl(((uint32_t __iomem*) MM_IO_BASE_ARAM) + i - 1) != 0xe1a0f00f); /* 0xe1a0f00f == asm ("mov r15, r15"); */ |
62 | 63 | ||
63 | CSP_CACHE_FLUSH_ALL; | 64 | flush_cache_all(); |
64 | 65 | ||
65 | /* run the function from ARAM */ | 66 | /* run the function from ARAM */ |
66 | runFunc(); | 67 | runFunc(); |
diff --git a/arch/arm/mach-bcmring/csp/dmac/dmacHw.c b/arch/arm/mach-bcmring/csp/dmac/dmacHw.c index 6b9be2e98e51..547f746c7ff4 100644 --- a/arch/arm/mach-bcmring/csp/dmac/dmacHw.c +++ b/arch/arm/mach-bcmring/csp/dmac/dmacHw.c | |||
@@ -25,11 +25,11 @@ | |||
25 | /****************************************************************************/ | 25 | /****************************************************************************/ |
26 | 26 | ||
27 | /* ---- Include Files ---------------------------------------------------- */ | 27 | /* ---- Include Files ---------------------------------------------------- */ |
28 | #include <csp/stdint.h> | 28 | #include <linux/types.h> |
29 | #include <csp/string.h> | 29 | #include <linux/string.h> |
30 | #include <stddef.h> | 30 | #include <linux/stddef.h> |
31 | 31 | ||
32 | #include <csp/dmacHw.h> | 32 | #include <mach/csp/dmacHw.h> |
33 | #include <mach/csp/dmacHw_reg.h> | 33 | #include <mach/csp/dmacHw_reg.h> |
34 | #include <mach/csp/dmacHw_priv.h> | 34 | #include <mach/csp/dmacHw_priv.h> |
35 | #include <mach/csp/chipcHw_inline.h> | 35 | #include <mach/csp/chipcHw_inline.h> |
@@ -55,33 +55,32 @@ static uint32_t GetFifoSize(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handl | |||
55 | ) { | 55 | ) { |
56 | uint32_t val = 0; | 56 | uint32_t val = 0; |
57 | dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle); | 57 | dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle); |
58 | dmacHw_MISC_t *pMiscReg = | 58 | dmacHw_MISC_t __iomem *pMiscReg = (void __iomem *)dmacHw_REG_MISC_BASE(pCblk->module); |
59 | (dmacHw_MISC_t *) dmacHw_REG_MISC_BASE(pCblk->module); | ||
60 | 59 | ||
61 | switch (pCblk->channel) { | 60 | switch (pCblk->channel) { |
62 | case 0: | 61 | case 0: |
63 | val = (pMiscReg->CompParm2.lo & 0x70000000) >> 28; | 62 | val = (readl(&pMiscReg->CompParm2.lo) & 0x70000000) >> 28; |
64 | break; | 63 | break; |
65 | case 1: | 64 | case 1: |
66 | val = (pMiscReg->CompParm3.hi & 0x70000000) >> 28; | 65 | val = (readl(&pMiscReg->CompParm3.hi) & 0x70000000) >> 28; |
67 | break; | 66 | break; |
68 | case 2: | 67 | case 2: |
69 | val = (pMiscReg->CompParm3.lo & 0x70000000) >> 28; | 68 | val = (readl(&pMiscReg->CompParm3.lo) & 0x70000000) >> 28; |
70 | break; | 69 | break; |
71 | case 3: | 70 | case 3: |
72 | val = (pMiscReg->CompParm4.hi & 0x70000000) >> 28; | 71 | val = (readl(&pMiscReg->CompParm4.hi) & 0x70000000) >> 28; |
73 | break; | 72 | break; |
74 | case 4: | 73 | case 4: |
75 | val = (pMiscReg->CompParm4.lo & 0x70000000) >> 28; | 74 | val = (readl(&pMiscReg->CompParm4.lo) & 0x70000000) >> 28; |
76 | break; | 75 | break; |
77 | case 5: | 76 | case 5: |
78 | val = (pMiscReg->CompParm5.hi & 0x70000000) >> 28; | 77 | val = (readl(&pMiscReg->CompParm5.hi) & 0x70000000) >> 28; |
79 | break; | 78 | break; |
80 | case 6: | 79 | case 6: |
81 | val = (pMiscReg->CompParm5.lo & 0x70000000) >> 28; | 80 | val = (readl(&pMiscReg->CompParm5.lo) & 0x70000000) >> 28; |
82 | break; | 81 | break; |
83 | case 7: | 82 | case 7: |
84 | val = (pMiscReg->CompParm6.hi & 0x70000000) >> 28; | 83 | val = (readl(&pMiscReg->CompParm6.hi) & 0x70000000) >> 28; |
85 | break; | 84 | break; |
86 | } | 85 | } |
87 | 86 | ||
diff --git a/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c b/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c index a1f328357aa4..fe438699d11e 100644 --- a/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c +++ b/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c | |||
@@ -26,10 +26,10 @@ | |||
26 | 26 | ||
27 | /* ---- Include Files ---------------------------------------------------- */ | 27 | /* ---- Include Files ---------------------------------------------------- */ |
28 | 28 | ||
29 | #include <csp/stdint.h> | 29 | #include <linux/types.h> |
30 | #include <stddef.h> | 30 | #include <linux/stddef.h> |
31 | 31 | ||
32 | #include <csp/dmacHw.h> | 32 | #include <mach/csp/dmacHw.h> |
33 | #include <mach/csp/dmacHw_reg.h> | 33 | #include <mach/csp/dmacHw_reg.h> |
34 | #include <mach/csp/dmacHw_priv.h> | 34 | #include <mach/csp/dmacHw_priv.h> |
35 | 35 | ||
diff --git a/arch/arm/mach-bcmring/csp/tmr/tmrHw.c b/arch/arm/mach-bcmring/csp/tmr/tmrHw.c index 16225e43f3c3..dc4137ff75ca 100644 --- a/arch/arm/mach-bcmring/csp/tmr/tmrHw.c +++ b/arch/arm/mach-bcmring/csp/tmr/tmrHw.c | |||
@@ -26,10 +26,10 @@ | |||
26 | 26 | ||
27 | /* ---- Include Files ---------------------------------------------------- */ | 27 | /* ---- Include Files ---------------------------------------------------- */ |
28 | 28 | ||
29 | #include <csp/errno.h> | 29 | #include <linux/errno.h> |
30 | #include <csp/stdint.h> | 30 | #include <linux/types.h> |
31 | 31 | ||
32 | #include <csp/tmrHw.h> | 32 | #include <mach/csp/tmrHw.h> |
33 | #include <mach/csp/tmrHw_reg.h> | 33 | #include <mach/csp/tmrHw_reg.h> |
34 | 34 | ||
35 | #define tmrHw_ASSERT(a) if (!(a)) *(char *)0 = 0 | 35 | #define tmrHw_ASSERT(a) if (!(a)) *(char *)0 = 0 |
diff --git a/arch/arm/mach-bcmring/include/cfg_global.h b/arch/arm/mach-bcmring/include/cfg_global.h deleted file mode 100644 index f01da877148e..000000000000 --- a/arch/arm/mach-bcmring/include/cfg_global.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef _CFG_GLOBAL_H_ | ||
2 | #define _CFG_GLOBAL_H_ | ||
3 | |||
4 | #include <cfg_global_defines.h> | ||
5 | |||
6 | #define CFG_GLOBAL_CHIP BCM11107 | ||
7 | #define CFG_GLOBAL_CHIP_FAMILY CFG_GLOBAL_CHIP_FAMILY_BCMRING | ||
8 | #define CFG_GLOBAL_CHIP_REV 0xB0 | ||
9 | #define CFG_GLOBAL_RAM_SIZE 0x10000000 | ||
10 | #define CFG_GLOBAL_RAM_BASE 0x00000000 | ||
11 | #define CFG_GLOBAL_RAM_RESERVED_SIZE 0x000000 | ||
12 | |||
13 | #endif /* _CFG_GLOBAL_H_ */ | ||
diff --git a/arch/arm/mach-bcmring/include/csp/cache.h b/arch/arm/mach-bcmring/include/csp/cache.h deleted file mode 100644 index caa20e59db99..000000000000 --- a/arch/arm/mach-bcmring/include/csp/cache.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | #ifndef CSP_CACHE_H | ||
16 | #define CSP_CACHE_H | ||
17 | |||
18 | /* ---- Include Files ---------------------------------------------------- */ | ||
19 | |||
20 | #include <csp/stdint.h> | ||
21 | |||
22 | /* ---- Public Constants and Types --------------------------------------- */ | ||
23 | |||
24 | #if defined(__KERNEL__) && !defined(STANDALONE) | ||
25 | #include <asm/cacheflush.h> | ||
26 | |||
27 | #define CSP_CACHE_FLUSH_ALL flush_cache_all() | ||
28 | |||
29 | #else | ||
30 | |||
31 | #define CSP_CACHE_FLUSH_ALL | ||
32 | |||
33 | #endif | ||
34 | |||
35 | #endif /* CSP_CACHE_H */ | ||
diff --git a/arch/arm/mach-bcmring/include/csp/delay.h b/arch/arm/mach-bcmring/include/csp/delay.h deleted file mode 100644 index 8b3d80367293..000000000000 --- a/arch/arm/mach-bcmring/include/csp/delay.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | |||
16 | #ifndef CSP_DELAY_H | ||
17 | #define CSP_DELAY_H | ||
18 | |||
19 | /* ---- Include Files ---------------------------------------------------- */ | ||
20 | |||
21 | /* Some CSP routines require use of the following delay routines. Use the OS */ | ||
22 | /* version if available, otherwise use a CSP specific definition. */ | ||
23 | /* void udelay(unsigned long usecs); */ | ||
24 | /* void mdelay(unsigned long msecs); */ | ||
25 | |||
26 | #if defined(__KERNEL__) && !defined(STANDALONE) | ||
27 | #include <linux/delay.h> | ||
28 | #else | ||
29 | #include <mach/csp/delay.h> | ||
30 | #endif | ||
31 | |||
32 | /* ---- Public Constants and Types --------------------------------------- */ | ||
33 | /* ---- Public Variable Externs ------------------------------------------ */ | ||
34 | /* ---- Public Function Prototypes --------------------------------------- */ | ||
35 | |||
36 | #endif /* CSP_DELAY_H */ | ||
diff --git a/arch/arm/mach-bcmring/include/csp/errno.h b/arch/arm/mach-bcmring/include/csp/errno.h deleted file mode 100644 index 51357dd5b666..000000000000 --- a/arch/arm/mach-bcmring/include/csp/errno.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | #ifndef CSP_ERRNO_H | ||
16 | #define CSP_ERRNO_H | ||
17 | |||
18 | /* ---- Include Files ---------------------------------------------------- */ | ||
19 | |||
20 | #if defined(__KERNEL__) | ||
21 | #include <linux/errno.h> | ||
22 | #elif defined(CSP_SIMULATION) | ||
23 | #include <asm-generic/errno.h> | ||
24 | #else | ||
25 | #include <errno.h> | ||
26 | #endif | ||
27 | |||
28 | /* ---- Public Constants and Types --------------------------------------- */ | ||
29 | /* ---- Public Variable Externs ------------------------------------------ */ | ||
30 | /* ---- Public Function Prototypes --------------------------------------- */ | ||
31 | |||
32 | #endif /* CSP_ERRNO_H */ | ||
diff --git a/arch/arm/mach-bcmring/include/csp/intcHw.h b/arch/arm/mach-bcmring/include/csp/intcHw.h deleted file mode 100644 index 1c639c8ee08f..000000000000 --- a/arch/arm/mach-bcmring/include/csp/intcHw.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | |||
16 | /****************************************************************************/ | ||
17 | /** | ||
18 | * @file intcHw.h | ||
19 | * | ||
20 | * @brief generic interrupt controller API | ||
21 | * | ||
22 | * @note | ||
23 | * None | ||
24 | */ | ||
25 | /****************************************************************************/ | ||
26 | |||
27 | #ifndef _INTCHW_H | ||
28 | #define _INTCHW_H | ||
29 | |||
30 | /* ---- Include Files ---------------------------------------------------- */ | ||
31 | #include <mach/csp/intcHw_reg.h> | ||
32 | |||
33 | /* ---- Public Constants and Types --------------------------------------- */ | ||
34 | /* ---- Public Variable Externs ------------------------------------------ */ | ||
35 | /* ---- Public Function Prototypes --------------------------------------- */ | ||
36 | static inline void intcHw_irq_disable(void *basep, uint32_t mask); | ||
37 | static inline void intcHw_irq_enable(void *basep, uint32_t mask); | ||
38 | |||
39 | #endif /* _INTCHW_H */ | ||
40 | |||
diff --git a/arch/arm/mach-bcmring/include/csp/module.h b/arch/arm/mach-bcmring/include/csp/module.h deleted file mode 100644 index c30d2a5975a6..000000000000 --- a/arch/arm/mach-bcmring/include/csp/module.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | |||
16 | #ifndef CSP_MODULE_H | ||
17 | #define CSP_MODULE_H | ||
18 | |||
19 | /* ---- Include Files ---------------------------------------------------- */ | ||
20 | |||
21 | #ifdef __KERNEL__ | ||
22 | #include <linux/module.h> | ||
23 | #else | ||
24 | #define EXPORT_SYMBOL(symbol) | ||
25 | #endif | ||
26 | |||
27 | /* ---- Public Constants and Types --------------------------------------- */ | ||
28 | /* ---- Public Variable Externs ------------------------------------------ */ | ||
29 | /* ---- Public Function Prototypes --------------------------------------- */ | ||
30 | |||
31 | |||
32 | #endif /* CSP_MODULE_H */ | ||
diff --git a/arch/arm/mach-bcmring/include/csp/secHw.h b/arch/arm/mach-bcmring/include/csp/secHw.h deleted file mode 100644 index b9d7e0732dfc..000000000000 --- a/arch/arm/mach-bcmring/include/csp/secHw.h +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2004 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | /****************************************************************************/ | ||
16 | /** | ||
17 | * @file secHw.h | ||
18 | * | ||
19 | * @brief Definitions for accessing low level security features | ||
20 | * | ||
21 | */ | ||
22 | /****************************************************************************/ | ||
23 | #ifndef SECHW_H | ||
24 | #define SECHW_H | ||
25 | |||
26 | typedef void (*secHw_FUNC_t) (void); | ||
27 | |||
28 | typedef enum { | ||
29 | secHw_MODE_SECURE = 0x0, /* Switches processor into secure mode */ | ||
30 | secHw_MODE_NONSECURE = 0x1 /* Switches processor into non-secure mode */ | ||
31 | } secHw_MODE; | ||
32 | |||
33 | /****************************************************************************/ | ||
34 | /** | ||
35 | * @brief Requesting to execute the function in secure mode | ||
36 | * | ||
37 | * This function requests the given function to run in secure mode | ||
38 | * | ||
39 | */ | ||
40 | /****************************************************************************/ | ||
41 | void secHw_RunSecure(secHw_FUNC_t /* Function to run in secure mode */ | ||
42 | ); | ||
43 | |||
44 | /****************************************************************************/ | ||
45 | /** | ||
46 | * @brief Sets the mode | ||
47 | * | ||
48 | * his function sets the processor mode (secure/non-secure) | ||
49 | * | ||
50 | */ | ||
51 | /****************************************************************************/ | ||
52 | void secHw_SetMode(secHw_MODE /* Processor mode */ | ||
53 | ); | ||
54 | |||
55 | /****************************************************************************/ | ||
56 | /** | ||
57 | * @brief Get the current mode | ||
58 | * | ||
59 | * This function retieves the processor mode (secure/non-secure) | ||
60 | * | ||
61 | */ | ||
62 | /****************************************************************************/ | ||
63 | void secHw_GetMode(secHw_MODE *); | ||
64 | |||
65 | #endif /* SECHW_H */ | ||
diff --git a/arch/arm/mach-bcmring/include/csp/stdint.h b/arch/arm/mach-bcmring/include/csp/stdint.h deleted file mode 100644 index 3a8718bbf700..000000000000 --- a/arch/arm/mach-bcmring/include/csp/stdint.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | #ifndef CSP_STDINT_H | ||
16 | #define CSP_STDINT_H | ||
17 | |||
18 | /* ---- Include Files ---------------------------------------------------- */ | ||
19 | |||
20 | #ifdef __KERNEL__ | ||
21 | #include <linux/types.h> | ||
22 | #else | ||
23 | #include <stdint.h> | ||
24 | #endif | ||
25 | |||
26 | /* ---- Public Constants and Types --------------------------------------- */ | ||
27 | /* ---- Public Variable Externs ------------------------------------------ */ | ||
28 | /* ---- Public Function Prototypes --------------------------------------- */ | ||
29 | |||
30 | #endif /* CSP_STDINT_H */ | ||
diff --git a/arch/arm/mach-bcmring/include/csp/string.h b/arch/arm/mach-bcmring/include/csp/string.h deleted file mode 100644 index ad9e4005f141..000000000000 --- a/arch/arm/mach-bcmring/include/csp/string.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | |||
16 | |||
17 | #ifndef CSP_STRING_H | ||
18 | #define CSP_STRING_H | ||
19 | |||
20 | /* ---- Include Files ---------------------------------------------------- */ | ||
21 | |||
22 | #ifdef __KERNEL__ | ||
23 | #include <linux/string.h> | ||
24 | #else | ||
25 | #include <string.h> | ||
26 | #endif | ||
27 | |||
28 | /* ---- Public Constants and Types --------------------------------------- */ | ||
29 | /* ---- Public Variable Externs ------------------------------------------ */ | ||
30 | /* ---- Public Function Prototypes --------------------------------------- */ | ||
31 | |||
32 | |||
33 | #endif /* CSP_STRING_H */ | ||
34 | |||
diff --git a/arch/arm/mach-bcmring/include/cfg_global_defines.h b/arch/arm/mach-bcmring/include/mach/cfg_global.h index b5beb0b30734..449133eacdf5 100644 --- a/arch/arm/mach-bcmring/include/cfg_global_defines.h +++ b/arch/arm/mach-bcmring/include/mach/cfg_global.h | |||
@@ -38,3 +38,14 @@ | |||
38 | 38 | ||
39 | #define IMAGE_HEADER_SIZE_CHECKSUM 4 | 39 | #define IMAGE_HEADER_SIZE_CHECKSUM 4 |
40 | #endif | 40 | #endif |
41 | #ifndef _CFG_GLOBAL_H_ | ||
42 | #define _CFG_GLOBAL_H_ | ||
43 | |||
44 | #define CFG_GLOBAL_CHIP BCM11107 | ||
45 | #define CFG_GLOBAL_CHIP_FAMILY CFG_GLOBAL_CHIP_FAMILY_BCMRING | ||
46 | #define CFG_GLOBAL_CHIP_REV 0xB0 | ||
47 | #define CFG_GLOBAL_RAM_SIZE 0x10000000 | ||
48 | #define CFG_GLOBAL_RAM_BASE 0x00000000 | ||
49 | #define CFG_GLOBAL_RAM_RESERVED_SIZE 0x000000 | ||
50 | |||
51 | #endif /* _CFG_GLOBAL_H_ */ | ||
diff --git a/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h b/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h index 933ce68ed90b..0a89e0c63419 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h +++ b/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | /* ---- Include Files ---------------------------------------------------- */ | 18 | /* ---- Include Files ---------------------------------------------------- */ |
19 | #include <mach/csp/cap.h> | 19 | #include <mach/csp/cap.h> |
20 | #include <cfg_global.h> | 20 | #include <mach/cfg_global.h> |
21 | 21 | ||
22 | /* ---- Public Constants and Types --------------------------------------- */ | 22 | /* ---- Public Constants and Types --------------------------------------- */ |
23 | #define CAP_CONFIG0_VPM_DIS 0x00000001 | 23 | #define CAP_CONFIG0_VPM_DIS 0x00000001 |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h index 161973385faf..39f09cb89208 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h +++ b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h | |||
@@ -17,9 +17,9 @@ | |||
17 | 17 | ||
18 | /* ---- Include Files ----------------------------------------------------- */ | 18 | /* ---- Include Files ----------------------------------------------------- */ |
19 | 19 | ||
20 | #include <csp/stdint.h> | 20 | #include <linux/types.h> |
21 | #include <csp/errno.h> | 21 | #include <linux/errno.h> |
22 | #include <csp/reg.h> | 22 | #include <mach/csp/reg.h> |
23 | #include <mach/csp/chipcHw_reg.h> | 23 | #include <mach/csp/chipcHw_reg.h> |
24 | 24 | ||
25 | /* ---- Public Constants and Types ---------------------------------------- */ | 25 | /* ---- Public Constants and Types ---------------------------------------- */ |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h index 03238c299001..a66f3f7abb86 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h +++ b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h | |||
@@ -17,8 +17,8 @@ | |||
17 | 17 | ||
18 | /* ---- Include Files ----------------------------------------------------- */ | 18 | /* ---- Include Files ----------------------------------------------------- */ |
19 | 19 | ||
20 | #include <csp/errno.h> | 20 | #include <linux/errno.h> |
21 | #include <csp/reg.h> | 21 | #include <mach/csp/reg.h> |
22 | #include <mach/csp/chipcHw_reg.h> | 22 | #include <mach/csp/chipcHw_reg.h> |
23 | #include <mach/csp/chipcHw_def.h> | 23 | #include <mach/csp/chipcHw_def.h> |
24 | 24 | ||
@@ -47,7 +47,7 @@ static inline void chipcHw_setClock(chipcHw_CLOCK_e clock, | |||
47 | /****************************************************************************/ | 47 | /****************************************************************************/ |
48 | static inline uint32_t chipcHw_getChipId(void) | 48 | static inline uint32_t chipcHw_getChipId(void) |
49 | { | 49 | { |
50 | return pChipcHw->ChipId; | 50 | return readl(&pChipcHw->ChipId); |
51 | } | 51 | } |
52 | 52 | ||
53 | /****************************************************************************/ | 53 | /****************************************************************************/ |
@@ -59,15 +59,16 @@ static inline uint32_t chipcHw_getChipId(void) | |||
59 | /****************************************************************************/ | 59 | /****************************************************************************/ |
60 | static inline void chipcHw_enableSpreadSpectrum(void) | 60 | static inline void chipcHw_enableSpreadSpectrum(void) |
61 | { | 61 | { |
62 | if ((pChipcHw-> | 62 | if ((readl(&pChipcHw-> |
63 | PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != | 63 | PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != |
64 | chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { | 64 | chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { |
65 | ddrcReg_PHY_ADDR_CTL_REGP->ssCfg = | 65 | writel((0xFFFF << ddrcReg_PHY_ADDR_SS_CFG_NDIV_AMPLITUDE_SHIFT) | |
66 | (0xFFFF << ddrcReg_PHY_ADDR_SS_CFG_NDIV_AMPLITUDE_SHIFT) | | ||
67 | (ddrcReg_PHY_ADDR_SS_CFG_MIN_CYCLE_PER_TICK << | 66 | (ddrcReg_PHY_ADDR_SS_CFG_MIN_CYCLE_PER_TICK << |
68 | ddrcReg_PHY_ADDR_SS_CFG_CYCLE_PER_TICK_SHIFT); | 67 | ddrcReg_PHY_ADDR_SS_CFG_CYCLE_PER_TICK_SHIFT), |
69 | ddrcReg_PHY_ADDR_CTL_REGP->ssCtl |= | 68 | &ddrcReg_PHY_ADDR_CTL_REGP->ssCfg); |
70 | ddrcReg_PHY_ADDR_SS_CTRL_ENABLE; | 69 | writel(readl(&ddrcReg_PHY_ADDR_CTL_REGP->ssCtl) | |
70 | ddrcReg_PHY_ADDR_SS_CTRL_ENABLE, | ||
71 | &ddrcReg_PHY_ADDR_CTL_REGP->ssCtl); | ||
71 | } | 72 | } |
72 | } | 73 | } |
73 | 74 | ||
@@ -93,8 +94,8 @@ static inline void chipcHw_disableSpreadSpectrum(void) | |||
93 | /****************************************************************************/ | 94 | /****************************************************************************/ |
94 | static inline uint32_t chipcHw_getChipProductId(void) | 95 | static inline uint32_t chipcHw_getChipProductId(void) |
95 | { | 96 | { |
96 | return (pChipcHw-> | 97 | return (readl(&pChipcHw-> |
97 | ChipId & chipcHw_REG_CHIPID_BASE_MASK) >> | 98 | ChipId) & chipcHw_REG_CHIPID_BASE_MASK) >> |
98 | chipcHw_REG_CHIPID_BASE_SHIFT; | 99 | chipcHw_REG_CHIPID_BASE_SHIFT; |
99 | } | 100 | } |
100 | 101 | ||
@@ -109,7 +110,7 @@ static inline uint32_t chipcHw_getChipProductId(void) | |||
109 | /****************************************************************************/ | 110 | /****************************************************************************/ |
110 | static inline chipcHw_REV_NUMBER_e chipcHw_getChipRevisionNumber(void) | 111 | static inline chipcHw_REV_NUMBER_e chipcHw_getChipRevisionNumber(void) |
111 | { | 112 | { |
112 | return pChipcHw->ChipId & chipcHw_REG_CHIPID_REV_MASK; | 113 | return readl(&pChipcHw->ChipId) & chipcHw_REG_CHIPID_REV_MASK; |
113 | } | 114 | } |
114 | 115 | ||
115 | /****************************************************************************/ | 116 | /****************************************************************************/ |
@@ -156,7 +157,7 @@ static inline void chipcHw_busInterfaceClockDisable(uint32_t mask) | |||
156 | /****************************************************************************/ | 157 | /****************************************************************************/ |
157 | static inline uint32_t chipcHw_getBusInterfaceClockStatus(void) | 158 | static inline uint32_t chipcHw_getBusInterfaceClockStatus(void) |
158 | { | 159 | { |
159 | return pChipcHw->BusIntfClock; | 160 | return readl(&pChipcHw->BusIntfClock); |
160 | } | 161 | } |
161 | 162 | ||
162 | /****************************************************************************/ | 163 | /****************************************************************************/ |
@@ -215,8 +216,9 @@ static inline void chipcHw_softResetDisable(uint64_t mask) | |||
215 | 216 | ||
216 | /* Deassert module soft reset */ | 217 | /* Deassert module soft reset */ |
217 | REG_LOCAL_IRQ_SAVE; | 218 | REG_LOCAL_IRQ_SAVE; |
218 | pChipcHw->SoftReset1 ^= ctrl1; | 219 | writel(readl(&pChipcHw->SoftReset1) ^ ctrl1, &pChipcHw->SoftReset1); |
219 | pChipcHw->SoftReset2 ^= (ctrl2 & (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK)); | 220 | writel(readl(&pChipcHw->SoftReset2) ^ (ctrl2 & |
221 | (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK)), &pChipcHw->SoftReset2); | ||
220 | REG_LOCAL_IRQ_RESTORE; | 222 | REG_LOCAL_IRQ_RESTORE; |
221 | } | 223 | } |
222 | 224 | ||
@@ -227,9 +229,10 @@ static inline void chipcHw_softResetEnable(uint64_t mask) | |||
227 | uint32_t unhold = 0; | 229 | uint32_t unhold = 0; |
228 | 230 | ||
229 | REG_LOCAL_IRQ_SAVE; | 231 | REG_LOCAL_IRQ_SAVE; |
230 | pChipcHw->SoftReset1 |= ctrl1; | 232 | writel(readl(&pChipcHw->SoftReset1) | ctrl1, &pChipcHw->SoftReset1); |
231 | /* Mask out unhold request bits */ | 233 | /* Mask out unhold request bits */ |
232 | pChipcHw->SoftReset2 |= (ctrl2 & (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK)); | 234 | writel(readl(&pChipcHw->SoftReset2) | (ctrl2 & |
235 | (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK)), &pChipcHw->SoftReset2); | ||
233 | 236 | ||
234 | /* Process unhold requests */ | 237 | /* Process unhold requests */ |
235 | if (ctrl2 & chipcHw_REG_SOFT_RESET_VPM_GLOBAL_UNHOLD) { | 238 | if (ctrl2 & chipcHw_REG_SOFT_RESET_VPM_GLOBAL_UNHOLD) { |
@@ -246,7 +249,7 @@ static inline void chipcHw_softResetEnable(uint64_t mask) | |||
246 | 249 | ||
247 | if (unhold) { | 250 | if (unhold) { |
248 | /* Make sure unhold request is effective */ | 251 | /* Make sure unhold request is effective */ |
249 | pChipcHw->SoftReset1 &= ~unhold; | 252 | writel(readl(&pChipcHw->SoftReset1) & ~unhold, &pChipcHw->SoftReset1); |
250 | } | 253 | } |
251 | REG_LOCAL_IRQ_RESTORE; | 254 | REG_LOCAL_IRQ_RESTORE; |
252 | } | 255 | } |
@@ -307,7 +310,7 @@ static inline void chipcHw_setOTPOption(uint64_t mask) | |||
307 | /****************************************************************************/ | 310 | /****************************************************************************/ |
308 | static inline uint32_t chipcHw_getStickyBits(void) | 311 | static inline uint32_t chipcHw_getStickyBits(void) |
309 | { | 312 | { |
310 | return pChipcHw->Sticky; | 313 | return readl(&pChipcHw->Sticky); |
311 | } | 314 | } |
312 | 315 | ||
313 | /****************************************************************************/ | 316 | /****************************************************************************/ |
@@ -328,7 +331,7 @@ static inline void chipcHw_setStickyBits(uint32_t mask) | |||
328 | bits |= chipcHw_REG_STICKY_POR_BROM; | 331 | bits |= chipcHw_REG_STICKY_POR_BROM; |
329 | } else { | 332 | } else { |
330 | uint32_t sticky; | 333 | uint32_t sticky; |
331 | sticky = pChipcHw->Sticky; | 334 | sticky = readl(pChipcHw->Sticky); |
332 | 335 | ||
333 | if ((mask & chipcHw_REG_STICKY_BOOT_DONE) | 336 | if ((mask & chipcHw_REG_STICKY_BOOT_DONE) |
334 | && (sticky & chipcHw_REG_STICKY_BOOT_DONE) == 0) { | 337 | && (sticky & chipcHw_REG_STICKY_BOOT_DONE) == 0) { |
@@ -355,7 +358,7 @@ static inline void chipcHw_setStickyBits(uint32_t mask) | |||
355 | bits |= chipcHw_REG_STICKY_GENERAL_5; | 358 | bits |= chipcHw_REG_STICKY_GENERAL_5; |
356 | } | 359 | } |
357 | } | 360 | } |
358 | pChipcHw->Sticky = bits; | 361 | writel(bits, pChipcHw->Sticky); |
359 | REG_LOCAL_IRQ_RESTORE; | 362 | REG_LOCAL_IRQ_RESTORE; |
360 | } | 363 | } |
361 | 364 | ||
@@ -377,7 +380,7 @@ static inline void chipcHw_clearStickyBits(uint32_t mask) | |||
377 | (chipcHw_REG_STICKY_BOOT_DONE | chipcHw_REG_STICKY_GENERAL_1 | | 380 | (chipcHw_REG_STICKY_BOOT_DONE | chipcHw_REG_STICKY_GENERAL_1 | |
378 | chipcHw_REG_STICKY_GENERAL_2 | chipcHw_REG_STICKY_GENERAL_3 | | 381 | chipcHw_REG_STICKY_GENERAL_2 | chipcHw_REG_STICKY_GENERAL_3 | |
379 | chipcHw_REG_STICKY_GENERAL_4 | chipcHw_REG_STICKY_GENERAL_5)) { | 382 | chipcHw_REG_STICKY_GENERAL_4 | chipcHw_REG_STICKY_GENERAL_5)) { |
380 | uint32_t sticky = pChipcHw->Sticky; | 383 | uint32_t sticky = readl(&pChipcHw->Sticky); |
381 | 384 | ||
382 | if ((mask & chipcHw_REG_STICKY_BOOT_DONE) | 385 | if ((mask & chipcHw_REG_STICKY_BOOT_DONE) |
383 | && (sticky & chipcHw_REG_STICKY_BOOT_DONE)) { | 386 | && (sticky & chipcHw_REG_STICKY_BOOT_DONE)) { |
@@ -410,7 +413,7 @@ static inline void chipcHw_clearStickyBits(uint32_t mask) | |||
410 | mask &= ~chipcHw_REG_STICKY_GENERAL_5; | 413 | mask &= ~chipcHw_REG_STICKY_GENERAL_5; |
411 | } | 414 | } |
412 | } | 415 | } |
413 | pChipcHw->Sticky = bits | mask; | 416 | writel(bits | mask, &pChipcHw->Sticky); |
414 | REG_LOCAL_IRQ_RESTORE; | 417 | REG_LOCAL_IRQ_RESTORE; |
415 | } | 418 | } |
416 | 419 | ||
@@ -426,7 +429,7 @@ static inline void chipcHw_clearStickyBits(uint32_t mask) | |||
426 | /****************************************************************************/ | 429 | /****************************************************************************/ |
427 | static inline uint32_t chipcHw_getSoftStraps(void) | 430 | static inline uint32_t chipcHw_getSoftStraps(void) |
428 | { | 431 | { |
429 | return pChipcHw->SoftStraps; | 432 | return readl(&pChipcHw->SoftStraps); |
430 | } | 433 | } |
431 | 434 | ||
432 | /****************************************************************************/ | 435 | /****************************************************************************/ |
@@ -456,7 +459,7 @@ static inline void chipcHw_setSoftStraps(uint32_t strapOptions) | |||
456 | /****************************************************************************/ | 459 | /****************************************************************************/ |
457 | static inline uint32_t chipcHw_getPinStraps(void) | 460 | static inline uint32_t chipcHw_getPinStraps(void) |
458 | { | 461 | { |
459 | return pChipcHw->PinStraps; | 462 | return readl(&pChipcHw->PinStraps); |
460 | } | 463 | } |
461 | 464 | ||
462 | /****************************************************************************/ | 465 | /****************************************************************************/ |
@@ -671,9 +674,9 @@ static inline void chipcHw_selectGE3(void) | |||
671 | /****************************************************************************/ | 674 | /****************************************************************************/ |
672 | static inline chipcHw_GPIO_FUNCTION_e chipcHw_getGpioPinFunction(int pin) | 675 | static inline chipcHw_GPIO_FUNCTION_e chipcHw_getGpioPinFunction(int pin) |
673 | { | 676 | { |
674 | return (*((uint32_t *) chipcHw_REG_GPIO_MUX(pin)) & | 677 | return (readl(chipcHw_REG_GPIO_MUX(pin))) & |
675 | (chipcHw_REG_GPIO_MUX_MASK << | 678 | (chipcHw_REG_GPIO_MUX_MASK << |
676 | chipcHw_REG_GPIO_MUX_POSITION(pin))) >> | 679 | chipcHw_REG_GPIO_MUX_POSITION(pin)) >> |
677 | chipcHw_REG_GPIO_MUX_POSITION(pin); | 680 | chipcHw_REG_GPIO_MUX_POSITION(pin); |
678 | } | 681 | } |
679 | 682 | ||
@@ -841,8 +844,8 @@ static inline void chipcHw_setUsbDevice(void) | |||
841 | static inline void chipcHw_setClock(chipcHw_CLOCK_e clock, | 844 | static inline void chipcHw_setClock(chipcHw_CLOCK_e clock, |
842 | chipcHw_OPTYPE_e type, int mode) | 845 | chipcHw_OPTYPE_e type, int mode) |
843 | { | 846 | { |
844 | volatile uint32_t *pPLLReg = (uint32_t *) 0x0; | 847 | uint32_t __iomem *pPLLReg = NULL; |
845 | volatile uint32_t *pClockCtrl = (uint32_t *) 0x0; | 848 | uint32_t __iomem *pClockCtrl = NULL; |
846 | 849 | ||
847 | switch (clock) { | 850 | switch (clock) { |
848 | case chipcHw_CLOCK_DDR: | 851 | case chipcHw_CLOCK_DDR: |
@@ -1071,7 +1074,7 @@ static inline void chipcHw_bypassClockDisable(chipcHw_CLOCK_e clock) | |||
1071 | /****************************************************************************/ | 1074 | /****************************************************************************/ |
1072 | static inline int chipcHw_isSoftwareStrapsEnable(void) | 1075 | static inline int chipcHw_isSoftwareStrapsEnable(void) |
1073 | { | 1076 | { |
1074 | return pChipcHw->SoftStraps & 0x00000001; | 1077 | return readl(&pChipcHw->SoftStraps) & 0x00000001; |
1075 | } | 1078 | } |
1076 | 1079 | ||
1077 | /****************************************************************************/ | 1080 | /****************************************************************************/ |
@@ -1138,7 +1141,7 @@ static inline void chipcHw_pll2TestDisable(void) | |||
1138 | /****************************************************************************/ | 1141 | /****************************************************************************/ |
1139 | static inline int chipcHw_isPllTestEnable(void) | 1142 | static inline int chipcHw_isPllTestEnable(void) |
1140 | { | 1143 | { |
1141 | return pChipcHw->PLLConfig & chipcHw_REG_PLL_CONFIG_TEST_ENABLE; | 1144 | return readl(&pChipcHw->PLLConfig) & chipcHw_REG_PLL_CONFIG_TEST_ENABLE; |
1142 | } | 1145 | } |
1143 | 1146 | ||
1144 | /****************************************************************************/ | 1147 | /****************************************************************************/ |
@@ -1147,7 +1150,7 @@ static inline int chipcHw_isPllTestEnable(void) | |||
1147 | /****************************************************************************/ | 1150 | /****************************************************************************/ |
1148 | static inline int chipcHw_isPll2TestEnable(void) | 1151 | static inline int chipcHw_isPll2TestEnable(void) |
1149 | { | 1152 | { |
1150 | return pChipcHw->PLLConfig2 & chipcHw_REG_PLL_CONFIG_TEST_ENABLE; | 1153 | return readl(&pChipcHw->PLLConfig2) & chipcHw_REG_PLL_CONFIG_TEST_ENABLE; |
1151 | } | 1154 | } |
1152 | 1155 | ||
1153 | /****************************************************************************/ | 1156 | /****************************************************************************/ |
@@ -1183,8 +1186,8 @@ static inline void chipcHw_pll2TestSelect(uint32_t val) | |||
1183 | /****************************************************************************/ | 1186 | /****************************************************************************/ |
1184 | static inline uint8_t chipcHw_getPllTestSelected(void) | 1187 | static inline uint8_t chipcHw_getPllTestSelected(void) |
1185 | { | 1188 | { |
1186 | return (uint8_t) ((pChipcHw-> | 1189 | return (uint8_t) ((readl(&pChipcHw-> |
1187 | PLLConfig & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK) | 1190 | PLLConfig) & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK) |
1188 | >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT); | 1191 | >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT); |
1189 | } | 1192 | } |
1190 | 1193 | ||
@@ -1194,8 +1197,8 @@ static inline uint8_t chipcHw_getPllTestSelected(void) | |||
1194 | /****************************************************************************/ | 1197 | /****************************************************************************/ |
1195 | static inline uint8_t chipcHw_getPll2TestSelected(void) | 1198 | static inline uint8_t chipcHw_getPll2TestSelected(void) |
1196 | { | 1199 | { |
1197 | return (uint8_t) ((pChipcHw-> | 1200 | return (uint8_t) ((readl(&pChipcHw-> |
1198 | PLLConfig2 & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK) | 1201 | PLLConfig2) & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK) |
1199 | >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT); | 1202 | >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT); |
1200 | } | 1203 | } |
1201 | 1204 | ||
@@ -1208,7 +1211,8 @@ static inline uint8_t chipcHw_getPll2TestSelected(void) | |||
1208 | static inline void chipcHw_pll1Disable(void) | 1211 | static inline void chipcHw_pll1Disable(void) |
1209 | { | 1212 | { |
1210 | REG_LOCAL_IRQ_SAVE; | 1213 | REG_LOCAL_IRQ_SAVE; |
1211 | pChipcHw->PLLConfig |= chipcHw_REG_PLL_CONFIG_POWER_DOWN; | 1214 | writel(readl(&pChipcHw->PLLConfig) | chipcHw_REG_PLL_CONFIG_POWER_DOWN, |
1215 | &pChipcHw->PLLConfig); | ||
1212 | REG_LOCAL_IRQ_RESTORE; | 1216 | REG_LOCAL_IRQ_RESTORE; |
1213 | } | 1217 | } |
1214 | 1218 | ||
@@ -1221,7 +1225,8 @@ static inline void chipcHw_pll1Disable(void) | |||
1221 | static inline void chipcHw_pll2Disable(void) | 1225 | static inline void chipcHw_pll2Disable(void) |
1222 | { | 1226 | { |
1223 | REG_LOCAL_IRQ_SAVE; | 1227 | REG_LOCAL_IRQ_SAVE; |
1224 | pChipcHw->PLLConfig2 |= chipcHw_REG_PLL_CONFIG_POWER_DOWN; | 1228 | writel(readl(&pChipcHw->PLLConfig2) | chipcHw_REG_PLL_CONFIG_POWER_DOWN, |
1229 | &pChipcHw->PLLConfig2); | ||
1225 | REG_LOCAL_IRQ_RESTORE; | 1230 | REG_LOCAL_IRQ_RESTORE; |
1226 | } | 1231 | } |
1227 | 1232 | ||
@@ -1233,7 +1238,8 @@ static inline void chipcHw_pll2Disable(void) | |||
1233 | static inline void chipcHw_ddrPhaseAlignInterruptEnable(void) | 1238 | static inline void chipcHw_ddrPhaseAlignInterruptEnable(void) |
1234 | { | 1239 | { |
1235 | REG_LOCAL_IRQ_SAVE; | 1240 | REG_LOCAL_IRQ_SAVE; |
1236 | pChipcHw->Spare1 |= chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE; | 1241 | writel(readl(&pChipcHw->Spare1) | chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE, |
1242 | &pChipcHw->Spare1); | ||
1237 | REG_LOCAL_IRQ_RESTORE; | 1243 | REG_LOCAL_IRQ_RESTORE; |
1238 | } | 1244 | } |
1239 | 1245 | ||
@@ -1245,7 +1251,8 @@ static inline void chipcHw_ddrPhaseAlignInterruptEnable(void) | |||
1245 | static inline void chipcHw_ddrPhaseAlignInterruptDisable(void) | 1251 | static inline void chipcHw_ddrPhaseAlignInterruptDisable(void) |
1246 | { | 1252 | { |
1247 | REG_LOCAL_IRQ_SAVE; | 1253 | REG_LOCAL_IRQ_SAVE; |
1248 | pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE; | 1254 | writel(readl(&pChipcHw->Spare1) & ~chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE, |
1255 | &pChipcHw->Spare1); | ||
1249 | REG_LOCAL_IRQ_RESTORE; | 1256 | REG_LOCAL_IRQ_RESTORE; |
1250 | } | 1257 | } |
1251 | 1258 | ||
@@ -1333,7 +1340,8 @@ static inline void chipcHw_ddrHwPhaseAlignDisable(void) | |||
1333 | static inline void chipcHw_vpmSwPhaseAlignEnable(void) | 1340 | static inline void chipcHw_vpmSwPhaseAlignEnable(void) |
1334 | { | 1341 | { |
1335 | REG_LOCAL_IRQ_SAVE; | 1342 | REG_LOCAL_IRQ_SAVE; |
1336 | pChipcHw->VPMPhaseCtrl1 |= chipcHw_REG_VPM_SW_PHASE_CTRL_ENABLE; | 1343 | writel(readl(&pChipcHw->VPMPhaseCtrl1) | chipcHw_REG_VPM_SW_PHASE_CTRL_ENABLE, |
1344 | &pChipcHw->VPMPhaseCtrl1); | ||
1337 | REG_LOCAL_IRQ_RESTORE; | 1345 | REG_LOCAL_IRQ_RESTORE; |
1338 | } | 1346 | } |
1339 | 1347 | ||
@@ -1372,7 +1380,8 @@ static inline void chipcHw_vpmHwPhaseAlignEnable(void) | |||
1372 | static inline void chipcHw_vpmHwPhaseAlignDisable(void) | 1380 | static inline void chipcHw_vpmHwPhaseAlignDisable(void) |
1373 | { | 1381 | { |
1374 | REG_LOCAL_IRQ_SAVE; | 1382 | REG_LOCAL_IRQ_SAVE; |
1375 | pChipcHw->VPMPhaseCtrl1 &= ~chipcHw_REG_VPM_HW_PHASE_CTRL_ENABLE; | 1383 | writel(readl(&pChipcHw->VPMPhaseCtrl1) & ~chipcHw_REG_VPM_HW_PHASE_CTRL_ENABLE, |
1384 | &pChipcHw->VPMPhaseCtrl1); | ||
1376 | REG_LOCAL_IRQ_RESTORE; | 1385 | REG_LOCAL_IRQ_RESTORE; |
1377 | } | 1386 | } |
1378 | 1387 | ||
@@ -1474,8 +1483,8 @@ chipcHw_setVpmHwPhaseAlignMargin(chipcHw_VPM_HW_PHASE_MARGIN_e margin) | |||
1474 | /****************************************************************************/ | 1483 | /****************************************************************************/ |
1475 | static inline uint32_t chipcHw_isDdrHwPhaseAligned(void) | 1484 | static inline uint32_t chipcHw_isDdrHwPhaseAligned(void) |
1476 | { | 1485 | { |
1477 | return (pChipcHw-> | 1486 | return (readl(&pChipcHw-> |
1478 | PhaseAlignStatus & chipcHw_REG_DDR_PHASE_ALIGNED) ? 1 : 0; | 1487 | PhaseAlignStatus) & chipcHw_REG_DDR_PHASE_ALIGNED) ? 1 : 0; |
1479 | } | 1488 | } |
1480 | 1489 | ||
1481 | /****************************************************************************/ | 1490 | /****************************************************************************/ |
@@ -1488,8 +1497,8 @@ static inline uint32_t chipcHw_isDdrHwPhaseAligned(void) | |||
1488 | /****************************************************************************/ | 1497 | /****************************************************************************/ |
1489 | static inline uint32_t chipcHw_isVpmHwPhaseAligned(void) | 1498 | static inline uint32_t chipcHw_isVpmHwPhaseAligned(void) |
1490 | { | 1499 | { |
1491 | return (pChipcHw-> | 1500 | return (readl(&pChipcHw-> |
1492 | PhaseAlignStatus & chipcHw_REG_VPM_PHASE_ALIGNED) ? 1 : 0; | 1501 | PhaseAlignStatus) & chipcHw_REG_VPM_PHASE_ALIGNED) ? 1 : 0; |
1493 | } | 1502 | } |
1494 | 1503 | ||
1495 | /****************************************************************************/ | 1504 | /****************************************************************************/ |
@@ -1500,8 +1509,8 @@ static inline uint32_t chipcHw_isVpmHwPhaseAligned(void) | |||
1500 | /****************************************************************************/ | 1509 | /****************************************************************************/ |
1501 | static inline uint32_t chipcHw_getDdrHwPhaseAlignStatus(void) | 1510 | static inline uint32_t chipcHw_getDdrHwPhaseAlignStatus(void) |
1502 | { | 1511 | { |
1503 | return (pChipcHw-> | 1512 | return (readl(&pChipcHw-> |
1504 | PhaseAlignStatus & chipcHw_REG_DDR_PHASE_STATUS_MASK) >> | 1513 | PhaseAlignStatus) & chipcHw_REG_DDR_PHASE_STATUS_MASK) >> |
1505 | chipcHw_REG_DDR_PHASE_STATUS_SHIFT; | 1514 | chipcHw_REG_DDR_PHASE_STATUS_SHIFT; |
1506 | } | 1515 | } |
1507 | 1516 | ||
@@ -1513,8 +1522,8 @@ static inline uint32_t chipcHw_getDdrHwPhaseAlignStatus(void) | |||
1513 | /****************************************************************************/ | 1522 | /****************************************************************************/ |
1514 | static inline uint32_t chipcHw_getVpmHwPhaseAlignStatus(void) | 1523 | static inline uint32_t chipcHw_getVpmHwPhaseAlignStatus(void) |
1515 | { | 1524 | { |
1516 | return (pChipcHw-> | 1525 | return (readl(&pChipcHw-> |
1517 | PhaseAlignStatus & chipcHw_REG_VPM_PHASE_STATUS_MASK) >> | 1526 | PhaseAlignStatus) & chipcHw_REG_VPM_PHASE_STATUS_MASK) >> |
1518 | chipcHw_REG_VPM_PHASE_STATUS_SHIFT; | 1527 | chipcHw_REG_VPM_PHASE_STATUS_SHIFT; |
1519 | } | 1528 | } |
1520 | 1529 | ||
@@ -1526,8 +1535,8 @@ static inline uint32_t chipcHw_getVpmHwPhaseAlignStatus(void) | |||
1526 | /****************************************************************************/ | 1535 | /****************************************************************************/ |
1527 | static inline uint32_t chipcHw_getDdrPhaseControl(void) | 1536 | static inline uint32_t chipcHw_getDdrPhaseControl(void) |
1528 | { | 1537 | { |
1529 | return (pChipcHw-> | 1538 | return (readl(&pChipcHw-> |
1530 | PhaseAlignStatus & chipcHw_REG_DDR_PHASE_CTRL_MASK) >> | 1539 | PhaseAlignStatus) & chipcHw_REG_DDR_PHASE_CTRL_MASK) >> |
1531 | chipcHw_REG_DDR_PHASE_CTRL_SHIFT; | 1540 | chipcHw_REG_DDR_PHASE_CTRL_SHIFT; |
1532 | } | 1541 | } |
1533 | 1542 | ||
@@ -1539,8 +1548,8 @@ static inline uint32_t chipcHw_getDdrPhaseControl(void) | |||
1539 | /****************************************************************************/ | 1548 | /****************************************************************************/ |
1540 | static inline uint32_t chipcHw_getVpmPhaseControl(void) | 1549 | static inline uint32_t chipcHw_getVpmPhaseControl(void) |
1541 | { | 1550 | { |
1542 | return (pChipcHw-> | 1551 | return (readl(&pChipcHw-> |
1543 | PhaseAlignStatus & chipcHw_REG_VPM_PHASE_CTRL_MASK) >> | 1552 | PhaseAlignStatus) & chipcHw_REG_VPM_PHASE_CTRL_MASK) >> |
1544 | chipcHw_REG_VPM_PHASE_CTRL_SHIFT; | 1553 | chipcHw_REG_VPM_PHASE_CTRL_SHIFT; |
1545 | } | 1554 | } |
1546 | 1555 | ||
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h index b162448f613c..26f5d0e4e1dd 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h +++ b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #define CHIPCHW_REG_H | 24 | #define CHIPCHW_REG_H |
25 | 25 | ||
26 | #include <mach/csp/mm_io.h> | 26 | #include <mach/csp/mm_io.h> |
27 | #include <csp/reg.h> | 27 | #include <mach/csp/reg.h> |
28 | #include <mach/csp/ddrcReg.h> | 28 | #include <mach/csp/ddrcReg.h> |
29 | 29 | ||
30 | #define chipcHw_BASE_ADDRESS MM_IO_BASE_CHIPC | 30 | #define chipcHw_BASE_ADDRESS MM_IO_BASE_CHIPC |
@@ -131,8 +131,8 @@ typedef struct { | |||
131 | uint32_t MiscInput_0_15; /* Input type for MISC 0 - 16 */ | 131 | uint32_t MiscInput_0_15; /* Input type for MISC 0 - 16 */ |
132 | } chipcHw_REG_t; | 132 | } chipcHw_REG_t; |
133 | 133 | ||
134 | #define pChipcHw ((volatile chipcHw_REG_t *) chipcHw_BASE_ADDRESS) | 134 | #define pChipcHw ((chipcHw_REG_t __iomem *) chipcHw_BASE_ADDRESS) |
135 | #define pChipcPhysical ((volatile chipcHw_REG_t *) MM_ADDR_IO_CHIPC) | 135 | #define pChipcPhysical (MM_ADDR_IO_CHIPC) |
136 | 136 | ||
137 | #define chipcHw_REG_CHIPID_BASE_MASK 0xFFFFF000 | 137 | #define chipcHw_REG_CHIPID_BASE_MASK 0xFFFFF000 |
138 | #define chipcHw_REG_CHIPID_BASE_SHIFT 12 | 138 | #define chipcHw_REG_CHIPID_BASE_SHIFT 12 |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h b/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h index f1b68e26fa6d..39da2c1fdafb 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h +++ b/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h | |||
@@ -30,8 +30,8 @@ extern "C" { | |||
30 | 30 | ||
31 | /* ---- Include Files ---------------------------------------------------- */ | 31 | /* ---- Include Files ---------------------------------------------------- */ |
32 | 32 | ||
33 | #include <csp/reg.h> | 33 | #include <mach/csp/reg.h> |
34 | #include <csp/stdint.h> | 34 | #include <linux/types.h> |
35 | 35 | ||
36 | #include <mach/csp/mm_io.h> | 36 | #include <mach/csp/mm_io.h> |
37 | 37 | ||
@@ -416,7 +416,7 @@ extern "C" { | |||
416 | } ddrcReg_PHY_ADDR_CTL_REG_t; | 416 | } ddrcReg_PHY_ADDR_CTL_REG_t; |
417 | 417 | ||
418 | #define ddrcReg_PHY_ADDR_CTL_REG_OFFSET 0x0400 | 418 | #define ddrcReg_PHY_ADDR_CTL_REG_OFFSET 0x0400 |
419 | #define ddrcReg_PHY_ADDR_CTL_REGP ((volatile ddrcReg_PHY_ADDR_CTL_REG_t *) (MM_IO_BASE_DDRC + ddrcReg_PHY_ADDR_CTL_REG_OFFSET)) | 419 | #define ddrcReg_PHY_ADDR_CTL_REGP ((volatile ddrcReg_PHY_ADDR_CTL_REG_t __iomem*) (MM_IO_BASE_DDRC + ddrcReg_PHY_ADDR_CTL_REG_OFFSET)) |
420 | 420 | ||
421 | /* @todo These SS definitions are duplicates of ones below */ | 421 | /* @todo These SS definitions are duplicates of ones below */ |
422 | 422 | ||
diff --git a/arch/arm/mach-bcmring/include/csp/dmacHw.h b/arch/arm/mach-bcmring/include/mach/csp/dmacHw.h index e6a1dc484ca7..9dc90f46a84d 100644 --- a/arch/arm/mach-bcmring/include/csp/dmacHw.h +++ b/arch/arm/mach-bcmring/include/mach/csp/dmacHw.h | |||
@@ -23,9 +23,9 @@ | |||
23 | #ifndef _DMACHW_H | 23 | #ifndef _DMACHW_H |
24 | #define _DMACHW_H | 24 | #define _DMACHW_H |
25 | 25 | ||
26 | #include <stddef.h> | 26 | #include <linux/stddef.h> |
27 | 27 | ||
28 | #include <csp/stdint.h> | 28 | #include <linux/types.h> |
29 | #include <mach/csp/dmacHw_reg.h> | 29 | #include <mach/csp/dmacHw_reg.h> |
30 | 30 | ||
31 | /* Define DMA Channel ID using DMA controller number (m) and channel number (c). | 31 | /* Define DMA Channel ID using DMA controller number (m) and channel number (c). |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h index d67e2f8c22de..9d9455e0c391 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h +++ b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #ifndef _DMACHW_PRIV_H | 24 | #ifndef _DMACHW_PRIV_H |
25 | #define _DMACHW_PRIV_H | 25 | #define _DMACHW_PRIV_H |
26 | 26 | ||
27 | #include <csp/stdint.h> | 27 | #include <linux/types.h> |
28 | 28 | ||
29 | /* Data type for DMA Link List Item */ | 29 | /* Data type for DMA Link List Item */ |
30 | typedef struct { | 30 | typedef struct { |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h index f1ecf96f2da5..7cd0aafa6f6e 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h +++ b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #ifndef _DMACHW_REG_H | 24 | #ifndef _DMACHW_REG_H |
25 | #define _DMACHW_REG_H | 25 | #define _DMACHW_REG_H |
26 | 26 | ||
27 | #include <csp/stdint.h> | 27 | #include <linux/types.h> |
28 | #include <mach/csp/mm_io.h> | 28 | #include <mach/csp/mm_io.h> |
29 | 29 | ||
30 | /* Data type for 64 bit little endian register */ | 30 | /* Data type for 64 bit little endian register */ |
@@ -121,75 +121,75 @@ typedef struct { | |||
121 | } dmacHw_MISC_t; | 121 | } dmacHw_MISC_t; |
122 | 122 | ||
123 | /* Base registers */ | 123 | /* Base registers */ |
124 | #define dmacHw_0_MODULE_BASE_ADDR (char *) MM_IO_BASE_DMA0 /* DMAC 0 module's base address */ | 124 | #define dmacHw_0_MODULE_BASE_ADDR (char __iomem*) MM_IO_BASE_DMA0 /* DMAC 0 module's base address */ |
125 | #define dmacHw_1_MODULE_BASE_ADDR (char *) MM_IO_BASE_DMA1 /* DMAC 1 module's base address */ | 125 | #define dmacHw_1_MODULE_BASE_ADDR (char __iomem*) MM_IO_BASE_DMA1 /* DMAC 1 module's base address */ |
126 | 126 | ||
127 | extern uint32_t dmaChannelCount_0; | 127 | extern uint32_t dmaChannelCount_0; |
128 | extern uint32_t dmaChannelCount_1; | 128 | extern uint32_t dmaChannelCount_1; |
129 | 129 | ||
130 | /* Define channel specific registers */ | 130 | /* Define channel specific registers */ |
131 | #define dmacHw_CHAN_BASE(module, chan) ((dmacHw_CH_REG_t *) ((char *)((module) ? dmacHw_1_MODULE_BASE_ADDR : dmacHw_0_MODULE_BASE_ADDR) + ((chan) * sizeof(dmacHw_CH_REG_t)))) | 131 | #define dmacHw_CHAN_BASE(module, chan) ((dmacHw_CH_REG_t __iomem*) ((char __iomem*)((module) ? dmacHw_1_MODULE_BASE_ADDR : dmacHw_0_MODULE_BASE_ADDR) + ((chan) * sizeof(dmacHw_CH_REG_t)))) |
132 | 132 | ||
133 | /* Raw interrupt status registers */ | 133 | /* Raw interrupt status registers */ |
134 | #define dmacHw_REG_INT_RAW_BASE(module) ((char *)dmacHw_CHAN_BASE((module), ((module) ? dmaChannelCount_1 : dmaChannelCount_0))) | 134 | #define dmacHw_REG_INT_RAW_BASE(module) ((char __iomem *)dmacHw_CHAN_BASE((module), ((module) ? dmaChannelCount_1 : dmaChannelCount_0))) |
135 | #define dmacHw_REG_INT_RAW_TRAN(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawTfr.lo) | 135 | #define dmacHw_REG_INT_RAW_TRAN(module) (((dmacHw_INT_RAW_t __iomem *) dmacHw_REG_INT_RAW_BASE((module)))->RawTfr.lo) |
136 | #define dmacHw_REG_INT_RAW_BLOCK(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawBlock.lo) | 136 | #define dmacHw_REG_INT_RAW_BLOCK(module) (((dmacHw_INT_RAW_t __iomem *) dmacHw_REG_INT_RAW_BASE((module)))->RawBlock.lo) |
137 | #define dmacHw_REG_INT_RAW_STRAN(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawSrcTran.lo) | 137 | #define dmacHw_REG_INT_RAW_STRAN(module) (((dmacHw_INT_RAW_t __iomem *) dmacHw_REG_INT_RAW_BASE((module)))->RawSrcTran.lo) |
138 | #define dmacHw_REG_INT_RAW_DTRAN(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawDstTran.lo) | 138 | #define dmacHw_REG_INT_RAW_DTRAN(module) (((dmacHw_INT_RAW_t __iomem *) dmacHw_REG_INT_RAW_BASE((module)))->RawDstTran.lo) |
139 | #define dmacHw_REG_INT_RAW_ERROR(module) (((dmacHw_INT_RAW_t *) dmacHw_REG_INT_RAW_BASE((module)))->RawErr.lo) | 139 | #define dmacHw_REG_INT_RAW_ERROR(module) (((dmacHw_INT_RAW_t __iomem *) dmacHw_REG_INT_RAW_BASE((module)))->RawErr.lo) |
140 | 140 | ||
141 | /* Interrupt status registers */ | 141 | /* Interrupt status registers */ |
142 | #define dmacHw_REG_INT_STAT_BASE(module) ((char *)(dmacHw_REG_INT_RAW_BASE((module)) + sizeof(dmacHw_INT_RAW_t))) | 142 | #define dmacHw_REG_INT_STAT_BASE(module) ((char __iomem*)(dmacHw_REG_INT_RAW_BASE((module)) + sizeof(dmacHw_INT_RAW_t))) |
143 | #define dmacHw_REG_INT_STAT_TRAN(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusTfr.lo) | 143 | #define dmacHw_REG_INT_STAT_TRAN(module) (((dmacHw_INT_STATUS_t __iomem *) dmacHw_REG_INT_STAT_BASE((module)))->StatusTfr.lo) |
144 | #define dmacHw_REG_INT_STAT_BLOCK(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusBlock.lo) | 144 | #define dmacHw_REG_INT_STAT_BLOCK(module) (((dmacHw_INT_STATUS_t __iomem *) dmacHw_REG_INT_STAT_BASE((module)))->StatusBlock.lo) |
145 | #define dmacHw_REG_INT_STAT_STRAN(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusSrcTran.lo) | 145 | #define dmacHw_REG_INT_STAT_STRAN(module) (((dmacHw_INT_STATUS_t __iomem *) dmacHw_REG_INT_STAT_BASE((module)))->StatusSrcTran.lo) |
146 | #define dmacHw_REG_INT_STAT_DTRAN(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusDstTran.lo) | 146 | #define dmacHw_REG_INT_STAT_DTRAN(module) (((dmacHw_INT_STATUS_t __iomem *) dmacHw_REG_INT_STAT_BASE((module)))->StatusDstTran.lo) |
147 | #define dmacHw_REG_INT_STAT_ERROR(module) (((dmacHw_INT_STATUS_t *) dmacHw_REG_INT_STAT_BASE((module)))->StatusErr.lo) | 147 | #define dmacHw_REG_INT_STAT_ERROR(module) (((dmacHw_INT_STATUS_t __iomem *) dmacHw_REG_INT_STAT_BASE((module)))->StatusErr.lo) |
148 | 148 | ||
149 | /* Interrupt status registers */ | 149 | /* Interrupt status registers */ |
150 | #define dmacHw_REG_INT_MASK_BASE(module) ((char *)(dmacHw_REG_INT_STAT_BASE((module)) + sizeof(dmacHw_INT_STATUS_t))) | 150 | #define dmacHw_REG_INT_MASK_BASE(module) ((char __iomem*)(dmacHw_REG_INT_STAT_BASE((module)) + sizeof(dmacHw_INT_STATUS_t))) |
151 | #define dmacHw_REG_INT_MASK_TRAN(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskTfr.lo) | 151 | #define dmacHw_REG_INT_MASK_TRAN(module) (((dmacHw_INT_MASK_t __iomem *) dmacHw_REG_INT_MASK_BASE((module)))->MaskTfr.lo) |
152 | #define dmacHw_REG_INT_MASK_BLOCK(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskBlock.lo) | 152 | #define dmacHw_REG_INT_MASK_BLOCK(module) (((dmacHw_INT_MASK_t __iomem *) dmacHw_REG_INT_MASK_BASE((module)))->MaskBlock.lo) |
153 | #define dmacHw_REG_INT_MASK_STRAN(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskSrcTran.lo) | 153 | #define dmacHw_REG_INT_MASK_STRAN(module) (((dmacHw_INT_MASK_t __iomem *) dmacHw_REG_INT_MASK_BASE((module)))->MaskSrcTran.lo) |
154 | #define dmacHw_REG_INT_MASK_DTRAN(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskDstTran.lo) | 154 | #define dmacHw_REG_INT_MASK_DTRAN(module) (((dmacHw_INT_MASK_t __iomem *) dmacHw_REG_INT_MASK_BASE((module)))->MaskDstTran.lo) |
155 | #define dmacHw_REG_INT_MASK_ERROR(module) (((dmacHw_INT_MASK_t *) dmacHw_REG_INT_MASK_BASE((module)))->MaskErr.lo) | 155 | #define dmacHw_REG_INT_MASK_ERROR(module) (((dmacHw_INT_MASK_t __iomem *) dmacHw_REG_INT_MASK_BASE((module)))->MaskErr.lo) |
156 | 156 | ||
157 | /* Interrupt clear registers */ | 157 | /* Interrupt clear registers */ |
158 | #define dmacHw_REG_INT_CLEAR_BASE(module) ((char *)(dmacHw_REG_INT_MASK_BASE((module)) + sizeof(dmacHw_INT_MASK_t))) | 158 | #define dmacHw_REG_INT_CLEAR_BASE(module) ((char __iomem*)(dmacHw_REG_INT_MASK_BASE((module)) + sizeof(dmacHw_INT_MASK_t))) |
159 | #define dmacHw_REG_INT_CLEAR_TRAN(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearTfr.lo) | 159 | #define dmacHw_REG_INT_CLEAR_TRAN(module) (((dmacHw_INT_CLEAR_t __iomem *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearTfr.lo) |
160 | #define dmacHw_REG_INT_CLEAR_BLOCK(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearBlock.lo) | 160 | #define dmacHw_REG_INT_CLEAR_BLOCK(module) (((dmacHw_INT_CLEAR_t __iomem *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearBlock.lo) |
161 | #define dmacHw_REG_INT_CLEAR_STRAN(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearSrcTran.lo) | 161 | #define dmacHw_REG_INT_CLEAR_STRAN(module) (((dmacHw_INT_CLEAR_t __iomem *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearSrcTran.lo) |
162 | #define dmacHw_REG_INT_CLEAR_DTRAN(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearDstTran.lo) | 162 | #define dmacHw_REG_INT_CLEAR_DTRAN(module) (((dmacHw_INT_CLEAR_t __iomem *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearDstTran.lo) |
163 | #define dmacHw_REG_INT_CLEAR_ERROR(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearErr.lo) | 163 | #define dmacHw_REG_INT_CLEAR_ERROR(module) (((dmacHw_INT_CLEAR_t __iomem *) dmacHw_REG_INT_CLEAR_BASE((module)))->ClearErr.lo) |
164 | #define dmacHw_REG_INT_STATUS(module) (((dmacHw_INT_CLEAR_t *) dmacHw_REG_INT_CLEAR_BASE((module)))->StatusInt.lo) | 164 | #define dmacHw_REG_INT_STATUS(module) (((dmacHw_INT_CLEAR_t __iomem *) dmacHw_REG_INT_CLEAR_BASE((module)))->StatusInt.lo) |
165 | 165 | ||
166 | /* Software handshaking registers */ | 166 | /* Software handshaking registers */ |
167 | #define dmacHw_REG_SW_HS_BASE(module) ((char *)(dmacHw_REG_INT_CLEAR_BASE((module)) + sizeof(dmacHw_INT_CLEAR_t))) | 167 | #define dmacHw_REG_SW_HS_BASE(module) ((char __iomem*)(dmacHw_REG_INT_CLEAR_BASE((module)) + sizeof(dmacHw_INT_CLEAR_t))) |
168 | #define dmacHw_REG_SW_HS_SRC_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->ReqSrcReg.lo) | 168 | #define dmacHw_REG_SW_HS_SRC_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) dmacHw_REG_SW_HS_BASE((module)))->ReqSrcReg.lo) |
169 | #define dmacHw_REG_SW_HS_DST_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->ReqDstReg.lo) | 169 | #define dmacHw_REG_SW_HS_DST_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) dmacHw_REG_SW_HS_BASE((module)))->ReqDstReg.lo) |
170 | #define dmacHw_REG_SW_HS_SRC_SGL_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->SglReqSrcReg.lo) | 170 | #define dmacHw_REG_SW_HS_SRC_SGL_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) dmacHw_REG_SW_HS_BASE((module)))->SglReqSrcReg.lo) |
171 | #define dmacHw_REG_SW_HS_DST_SGL_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->SglReqDstReg.lo) | 171 | #define dmacHw_REG_SW_HS_DST_SGL_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) dmacHw_REG_SW_HS_BASE((module)))->SglReqDstReg.lo) |
172 | #define dmacHw_REG_SW_HS_SRC_LST_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->LstSrcReg.lo) | 172 | #define dmacHw_REG_SW_HS_SRC_LST_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) dmacHw_REG_SW_HS_BASE((module)))->LstSrcReg.lo) |
173 | #define dmacHw_REG_SW_HS_DST_LST_REQ(module) (((dmacHw_SW_HANDSHAKE_t *) dmacHw_REG_SW_HS_BASE((module)))->LstDstReg.lo) | 173 | #define dmacHw_REG_SW_HS_DST_LST_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) dmacHw_REG_SW_HS_BASE((module)))->LstDstReg.lo) |
174 | 174 | ||
175 | /* Miscellaneous registers */ | 175 | /* Miscellaneous registers */ |
176 | #define dmacHw_REG_MISC_BASE(module) ((char *)(dmacHw_REG_SW_HS_BASE((module)) + sizeof(dmacHw_SW_HANDSHAKE_t))) | 176 | #define dmacHw_REG_MISC_BASE(module) ((char __iomem*)(dmacHw_REG_SW_HS_BASE((module)) + sizeof(dmacHw_SW_HANDSHAKE_t))) |
177 | #define dmacHw_REG_MISC_CFG(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->DmaCfgReg.lo) | 177 | #define dmacHw_REG_MISC_CFG(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->DmaCfgReg.lo) |
178 | #define dmacHw_REG_MISC_CH_ENABLE(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->ChEnReg.lo) | 178 | #define dmacHw_REG_MISC_CH_ENABLE(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->ChEnReg.lo) |
179 | #define dmacHw_REG_MISC_ID(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->DmaIdReg.lo) | 179 | #define dmacHw_REG_MISC_ID(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->DmaIdReg.lo) |
180 | #define dmacHw_REG_MISC_TEST(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->DmaTestReg.lo) | 180 | #define dmacHw_REG_MISC_TEST(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->DmaTestReg.lo) |
181 | #define dmacHw_REG_MISC_COMP_PARAM1_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm1.lo) | 181 | #define dmacHw_REG_MISC_COMP_PARAM1_LO(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm1.lo) |
182 | #define dmacHw_REG_MISC_COMP_PARAM1_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm1.hi) | 182 | #define dmacHw_REG_MISC_COMP_PARAM1_HI(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm1.hi) |
183 | #define dmacHw_REG_MISC_COMP_PARAM2_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm2.lo) | 183 | #define dmacHw_REG_MISC_COMP_PARAM2_LO(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm2.lo) |
184 | #define dmacHw_REG_MISC_COMP_PARAM2_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm2.hi) | 184 | #define dmacHw_REG_MISC_COMP_PARAM2_HI(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm2.hi) |
185 | #define dmacHw_REG_MISC_COMP_PARAM3_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm3.lo) | 185 | #define dmacHw_REG_MISC_COMP_PARAM3_LO(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm3.lo) |
186 | #define dmacHw_REG_MISC_COMP_PARAM3_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm3.hi) | 186 | #define dmacHw_REG_MISC_COMP_PARAM3_HI(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm3.hi) |
187 | #define dmacHw_REG_MISC_COMP_PARAM4_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm4.lo) | 187 | #define dmacHw_REG_MISC_COMP_PARAM4_LO(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm4.lo) |
188 | #define dmacHw_REG_MISC_COMP_PARAM4_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm4.hi) | 188 | #define dmacHw_REG_MISC_COMP_PARAM4_HI(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm4.hi) |
189 | #define dmacHw_REG_MISC_COMP_PARAM5_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm5.lo) | 189 | #define dmacHw_REG_MISC_COMP_PARAM5_LO(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm5.lo) |
190 | #define dmacHw_REG_MISC_COMP_PARAM5_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm5.hi) | 190 | #define dmacHw_REG_MISC_COMP_PARAM5_HI(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm5.hi) |
191 | #define dmacHw_REG_MISC_COMP_PARAM6_LO(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm6.lo) | 191 | #define dmacHw_REG_MISC_COMP_PARAM6_LO(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm6.lo) |
192 | #define dmacHw_REG_MISC_COMP_PARAM6_HI(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->CompParm6.hi) | 192 | #define dmacHw_REG_MISC_COMP_PARAM6_HI(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm6.hi) |
193 | 193 | ||
194 | /* Channel control registers */ | 194 | /* Channel control registers */ |
195 | #define dmacHw_REG_SAR(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelSar.lo) | 195 | #define dmacHw_REG_SAR(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelSar.lo) |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h b/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h index cfa91bed9d34..27f59dd27792 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h +++ b/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | /* ---- Include Files ---------------------------------------------------- */ | 19 | /* ---- Include Files ---------------------------------------------------- */ |
20 | 20 | ||
21 | #include <cfg_global.h> | 21 | #include <mach/cfg_global.h> |
22 | #include <mach/csp/cap_inline.h> | 22 | #include <mach/csp/cap_inline.h> |
23 | 23 | ||
24 | #if defined(__KERNEL__) | 24 | #if defined(__KERNEL__) |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h index 0aeb6a6fe7f8..f59db25b5632 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h +++ b/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h | |||
@@ -27,8 +27,8 @@ | |||
27 | #define _INTCHW_REG_H | 27 | #define _INTCHW_REG_H |
28 | 28 | ||
29 | /* ---- Include Files ---------------------------------------------------- */ | 29 | /* ---- Include Files ---------------------------------------------------- */ |
30 | #include <csp/stdint.h> | 30 | #include <linux/types.h> |
31 | #include <csp/reg.h> | 31 | #include <mach/csp/reg.h> |
32 | #include <mach/csp/mm_io.h> | 32 | #include <mach/csp/mm_io.h> |
33 | 33 | ||
34 | /* ---- Public Constants and Types --------------------------------------- */ | 34 | /* ---- Public Constants and Types --------------------------------------- */ |
@@ -37,9 +37,9 @@ | |||
37 | #define INTCHW_NUM_INTC 3 | 37 | #define INTCHW_NUM_INTC 3 |
38 | 38 | ||
39 | /* Defines for interrupt controllers. This simplifies and cleans up the function calls. */ | 39 | /* Defines for interrupt controllers. This simplifies and cleans up the function calls. */ |
40 | #define INTCHW_INTC0 ((void *)MM_IO_BASE_INTC0) | 40 | #define INTCHW_INTC0 (MM_IO_BASE_INTC0) |
41 | #define INTCHW_INTC1 ((void *)MM_IO_BASE_INTC1) | 41 | #define INTCHW_INTC1 (MM_IO_BASE_INTC1) |
42 | #define INTCHW_SINTC ((void *)MM_IO_BASE_SINTC) | 42 | #define INTCHW_SINTC (MM_IO_BASE_SINTC) |
43 | 43 | ||
44 | /* INTC0 - interrupt controller 0 */ | 44 | /* INTC0 - interrupt controller 0 */ |
45 | #define INTCHW_INTC0_PIF_BITNUM 31 /* Peripheral interface interrupt */ | 45 | #define INTCHW_INTC0_PIF_BITNUM 31 /* Peripheral interface interrupt */ |
@@ -232,15 +232,15 @@ | |||
232 | /* ---- Public Variable Externs ------------------------------------------ */ | 232 | /* ---- Public Variable Externs ------------------------------------------ */ |
233 | /* ---- Public Function Prototypes --------------------------------------- */ | 233 | /* ---- Public Function Prototypes --------------------------------------- */ |
234 | /* Clear one or more IRQ interrupts. */ | 234 | /* Clear one or more IRQ interrupts. */ |
235 | static inline void intcHw_irq_disable(void *basep, uint32_t mask) | 235 | static inline void intcHw_irq_disable(void __iomem *basep, uint32_t mask) |
236 | { | 236 | { |
237 | __REG32(basep + INTCHW_INTENCLEAR) = mask; | 237 | writel(mask, basep + INTCHW_INTENCLEAR); |
238 | } | 238 | } |
239 | 239 | ||
240 | /* Enables one or more IRQ interrupts. */ | 240 | /* Enables one or more IRQ interrupts. */ |
241 | static inline void intcHw_irq_enable(void *basep, uint32_t mask) | 241 | static inline void intcHw_irq_enable(void __iomem *basep, uint32_t mask) |
242 | { | 242 | { |
243 | __REG32(basep + INTCHW_INTENABLE) = mask; | 243 | writel(mask, basep + INTCHW_INTENABLE); |
244 | } | 244 | } |
245 | 245 | ||
246 | #endif /* _INTCHW_REG_H */ | 246 | #endif /* _INTCHW_REG_H */ |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h b/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h index ad58cf873377..d571962f2904 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h +++ b/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h | |||
@@ -29,7 +29,7 @@ | |||
29 | /* ---- Include Files ---------------------------------------------------- */ | 29 | /* ---- Include Files ---------------------------------------------------- */ |
30 | 30 | ||
31 | #if !defined(CSP_SIMULATION) | 31 | #if !defined(CSP_SIMULATION) |
32 | #include <cfg_global.h> | 32 | #include <mach/cfg_global.h> |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /* ---- Public Constants and Types --------------------------------------- */ | 35 | /* ---- Public Constants and Types --------------------------------------- */ |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/mm_io.h b/arch/arm/mach-bcmring/include/mach/csp/mm_io.h index de92ec6a01aa..47450c23685a 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/mm_io.h +++ b/arch/arm/mach-bcmring/include/mach/csp/mm_io.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <mach/csp/mm_addr.h> | 30 | #include <mach/csp/mm_addr.h> |
31 | 31 | ||
32 | #if !defined(CSP_SIMULATION) | 32 | #if !defined(CSP_SIMULATION) |
33 | #include <cfg_global.h> | 33 | #include <mach/cfg_global.h> |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | /* ---- Public Constants and Types --------------------------------------- */ | 36 | /* ---- Public Constants and Types --------------------------------------- */ |
@@ -49,7 +49,7 @@ | |||
49 | #ifdef __ASSEMBLY__ | 49 | #ifdef __ASSEMBLY__ |
50 | #define MM_IO_PHYS_TO_VIRT(phys) (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF)) | 50 | #define MM_IO_PHYS_TO_VIRT(phys) (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF)) |
51 | #else | 51 | #else |
52 | #define MM_IO_PHYS_TO_VIRT(phys) (((phys) == MM_ADDR_IO_VPM_EXTMEM_RSVD) ? 0xF0000000 : \ | 52 | #define MM_IO_PHYS_TO_VIRT(phys) (void __iomem *)(((phys) == MM_ADDR_IO_VPM_EXTMEM_RSVD) ? 0xF0000000 : \ |
53 | (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF))) | 53 | (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF))) |
54 | #endif | 54 | #endif |
55 | #endif | 55 | #endif |
@@ -60,8 +60,8 @@ | |||
60 | #ifdef __ASSEMBLY__ | 60 | #ifdef __ASSEMBLY__ |
61 | #define MM_IO_VIRT_TO_PHYS(virt) ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF)) | 61 | #define MM_IO_VIRT_TO_PHYS(virt) ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF)) |
62 | #else | 62 | #else |
63 | #define MM_IO_VIRT_TO_PHYS(virt) (((virt) == 0xF0000000) ? MM_ADDR_IO_VPM_EXTMEM_RSVD : \ | 63 | #define MM_IO_VIRT_TO_PHYS(virt) (((unsigned long)(virt) == 0xF0000000) ? MM_ADDR_IO_VPM_EXTMEM_RSVD : \ |
64 | ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF))) | 64 | ((((unsigned long)(virt) & 0x0F000000) << 4) | ((unsigned long)(virt) & 0xFFFFFF))) |
65 | #endif | 65 | #endif |
66 | #endif | 66 | #endif |
67 | 67 | ||
diff --git a/arch/arm/mach-bcmring/include/csp/reg.h b/arch/arm/mach-bcmring/include/mach/csp/reg.h index 56654d23c3d7..d9cbdca8cd25 100644 --- a/arch/arm/mach-bcmring/include/csp/reg.h +++ b/arch/arm/mach-bcmring/include/mach/csp/reg.h | |||
@@ -25,13 +25,14 @@ | |||
25 | 25 | ||
26 | /* ---- Include Files ---------------------------------------------------- */ | 26 | /* ---- Include Files ---------------------------------------------------- */ |
27 | 27 | ||
28 | #include <csp/stdint.h> | 28 | #include <linux/types.h> |
29 | #include <linux/io.h> | ||
29 | 30 | ||
30 | /* ---- Public Constants and Types --------------------------------------- */ | 31 | /* ---- Public Constants and Types --------------------------------------- */ |
31 | 32 | ||
32 | #define __REG32(x) (*((volatile uint32_t *)(x))) | 33 | #define __REG32(x) (*((volatile uint32_t __iomem *)(x))) |
33 | #define __REG16(x) (*((volatile uint16_t *)(x))) | 34 | #define __REG16(x) (*((volatile uint16_t __iomem *)(x))) |
34 | #define __REG8(x) (*((volatile uint8_t *) (x))) | 35 | #define __REG8(x) (*((volatile uint8_t __iomem *) (x))) |
35 | 36 | ||
36 | /* Macros used to define a sequence of reserved registers. The start / end */ | 37 | /* Macros used to define a sequence of reserved registers. The start / end */ |
37 | /* are byte offsets in the particular register definition, with the "end" */ | 38 | /* are byte offsets in the particular register definition, with the "end" */ |
@@ -84,31 +85,31 @@ | |||
84 | 85 | ||
85 | #endif | 86 | #endif |
86 | 87 | ||
87 | static inline void reg32_modify_and(volatile uint32_t *reg, uint32_t value) | 88 | static inline void reg32_modify_and(volatile uint32_t __iomem *reg, uint32_t value) |
88 | { | 89 | { |
89 | REG_LOCAL_IRQ_SAVE; | 90 | REG_LOCAL_IRQ_SAVE; |
90 | *reg &= value; | 91 | __raw_writel(__raw_readl(reg) & value, reg); |
91 | REG_LOCAL_IRQ_RESTORE; | 92 | REG_LOCAL_IRQ_RESTORE; |
92 | } | 93 | } |
93 | 94 | ||
94 | static inline void reg32_modify_or(volatile uint32_t *reg, uint32_t value) | 95 | static inline void reg32_modify_or(volatile uint32_t __iomem *reg, uint32_t value) |
95 | { | 96 | { |
96 | REG_LOCAL_IRQ_SAVE; | 97 | REG_LOCAL_IRQ_SAVE; |
97 | *reg |= value; | 98 | __raw_writel(__raw_readl(reg) | value, reg); |
98 | REG_LOCAL_IRQ_RESTORE; | 99 | REG_LOCAL_IRQ_RESTORE; |
99 | } | 100 | } |
100 | 101 | ||
101 | static inline void reg32_modify_mask(volatile uint32_t *reg, uint32_t mask, | 102 | static inline void reg32_modify_mask(volatile uint32_t __iomem *reg, uint32_t mask, |
102 | uint32_t value) | 103 | uint32_t value) |
103 | { | 104 | { |
104 | REG_LOCAL_IRQ_SAVE; | 105 | REG_LOCAL_IRQ_SAVE; |
105 | *reg = (*reg & mask) | value; | 106 | __raw_writel((__raw_readl(reg) & mask) | value, reg); |
106 | REG_LOCAL_IRQ_RESTORE; | 107 | REG_LOCAL_IRQ_RESTORE; |
107 | } | 108 | } |
108 | 109 | ||
109 | static inline void reg32_write(volatile uint32_t *reg, uint32_t value) | 110 | static inline void reg32_write(volatile uint32_t __iomem *reg, uint32_t value) |
110 | { | 111 | { |
111 | *reg = value; | 112 | __raw_writel(value, reg); |
112 | } | 113 | } |
113 | 114 | ||
114 | #endif /* CSP_REG_H */ | 115 | #endif /* CSP_REG_H */ |
diff --git a/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h b/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h index 9cd6a032ab71..55d3cd4fd1e7 100644 --- a/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h +++ b/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h | |||
@@ -34,7 +34,7 @@ | |||
34 | /****************************************************************************/ | 34 | /****************************************************************************/ |
35 | static inline void secHw_setSecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */ | 35 | static inline void secHw_setSecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */ |
36 | ) { | 36 | ) { |
37 | secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC; | 37 | secHw_REGS_t __iomem *regp = MM_IO_BASE_TZPC; |
38 | 38 | ||
39 | if (mask & 0x0000FFFF) { | 39 | if (mask & 0x0000FFFF) { |
40 | regp->reg[secHw_IDX_LS].setSecure = mask & 0x0000FFFF; | 40 | regp->reg[secHw_IDX_LS].setSecure = mask & 0x0000FFFF; |
@@ -53,13 +53,13 @@ static inline void secHw_setSecure(uint32_t mask /* mask of type secHw_BLK_MASK | |||
53 | /****************************************************************************/ | 53 | /****************************************************************************/ |
54 | static inline void secHw_setUnsecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */ | 54 | static inline void secHw_setUnsecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */ |
55 | ) { | 55 | ) { |
56 | secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC; | 56 | secHw_REGS_t __iomem *regp = MM_IO_BASE_TZPC; |
57 | 57 | ||
58 | if (mask & 0x0000FFFF) { | 58 | if (mask & 0x0000FFFF) { |
59 | regp->reg[secHw_IDX_LS].setUnsecure = mask & 0x0000FFFF; | 59 | writel(mask & 0x0000FFFF, ®p->reg[secHw_IDX_LS].setUnsecure); |
60 | } | 60 | } |
61 | if (mask & 0xFFFF0000) { | 61 | if (mask & 0xFFFF0000) { |
62 | regp->reg[secHw_IDX_MS].setUnsecure = mask >> 16; | 62 | writel(mask >> 16, ®p->reg[secHw_IDX_MS].setUnsecure); |
63 | } | 63 | } |
64 | } | 64 | } |
65 | 65 | ||
@@ -71,7 +71,7 @@ static inline void secHw_setUnsecure(uint32_t mask /* mask of type secHw_BLK_MA | |||
71 | /****************************************************************************/ | 71 | /****************************************************************************/ |
72 | static inline uint32_t secHw_getStatus(void) | 72 | static inline uint32_t secHw_getStatus(void) |
73 | { | 73 | { |
74 | secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC; | 74 | secHw_REGS_t __iomem *regp = MM_IO_BASE_TZPC; |
75 | 75 | ||
76 | return (regp->reg[1].status << 16) + regp->reg[0].status; | 76 | return (regp->reg[1].status << 16) + regp->reg[0].status; |
77 | } | 77 | } |
diff --git a/arch/arm/mach-bcmring/include/csp/tmrHw.h b/arch/arm/mach-bcmring/include/mach/csp/tmrHw.h index 2cbb530db8ea..1cc882ae60f5 100644 --- a/arch/arm/mach-bcmring/include/csp/tmrHw.h +++ b/arch/arm/mach-bcmring/include/mach/csp/tmrHw.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #ifndef _TMRHW_H | 23 | #ifndef _TMRHW_H |
24 | #define _TMRHW_H | 24 | #define _TMRHW_H |
25 | 25 | ||
26 | #include <csp/stdint.h> | 26 | #include <linux/types.h> |
27 | 27 | ||
28 | typedef uint32_t tmrHw_ID_t; /* Timer ID */ | 28 | typedef uint32_t tmrHw_ID_t; /* Timer ID */ |
29 | typedef uint32_t tmrHw_COUNT_t; /* Timer count */ | 29 | typedef uint32_t tmrHw_COUNT_t; /* Timer count */ |
diff --git a/arch/arm/mach-bcmring/include/mach/dma.h b/arch/arm/mach-bcmring/include/mach/dma.h index 72543781207b..13e01384d6fc 100644 --- a/arch/arm/mach-bcmring/include/mach/dma.h +++ b/arch/arm/mach-bcmring/include/mach/dma.h | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/semaphore.h> | 29 | #include <linux/semaphore.h> |
30 | #include <csp/dmacHw.h> | 30 | #include <mach/csp/dmacHw.h> |
31 | #include <mach/timer.h> | 31 | #include <mach/timer.h> |
32 | 32 | ||
33 | /* ---- Constants and Types ---------------------------------------------- */ | 33 | /* ---- Constants and Types ---------------------------------------------- */ |
diff --git a/arch/arm/mach-bcmring/include/mach/hardware.h b/arch/arm/mach-bcmring/include/mach/hardware.h index 6ae20a649a97..a0c92b4b8c60 100644 --- a/arch/arm/mach-bcmring/include/mach/hardware.h +++ b/arch/arm/mach-bcmring/include/mach/hardware.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define __ASM_ARCH_HARDWARE_H | 22 | #define __ASM_ARCH_HARDWARE_H |
23 | 23 | ||
24 | #include <asm/sizes.h> | 24 | #include <asm/sizes.h> |
25 | #include <cfg_global.h> | 25 | #include <mach/cfg_global.h> |
26 | #include <mach/csp/mm_io.h> | 26 | #include <mach/csp/mm_io.h> |
27 | 27 | ||
28 | /* Hardware addresses of major areas. | 28 | /* Hardware addresses of major areas. |
diff --git a/arch/arm/mach-bcmring/include/mach/reg_nand.h b/arch/arm/mach-bcmring/include/mach/reg_nand.h index 387376ffb56b..f8d51a8b0b15 100644 --- a/arch/arm/mach-bcmring/include/mach/reg_nand.h +++ b/arch/arm/mach-bcmring/include/mach/reg_nand.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #define __ASM_ARCH_REG_NAND_H | 30 | #define __ASM_ARCH_REG_NAND_H |
31 | 31 | ||
32 | /* ---- Include Files ---------------------------------------------------- */ | 32 | /* ---- Include Files ---------------------------------------------------- */ |
33 | #include <csp/reg.h> | 33 | #include <mach/csp/reg.h> |
34 | #include <mach/reg_umi.h> | 34 | #include <mach/reg_umi.h> |
35 | 35 | ||
36 | /* ---- Constants and Types ---------------------------------------------- */ | 36 | /* ---- Constants and Types ---------------------------------------------- */ |
diff --git a/arch/arm/mach-bcmring/include/mach/reg_umi.h b/arch/arm/mach-bcmring/include/mach/reg_umi.h index 0992842caa77..56dd9de7d83f 100644 --- a/arch/arm/mach-bcmring/include/mach/reg_umi.h +++ b/arch/arm/mach-bcmring/include/mach/reg_umi.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #define __ASM_ARCH_REG_UMI_H | 30 | #define __ASM_ARCH_REG_UMI_H |
31 | 31 | ||
32 | /* ---- Include Files ---------------------------------------------------- */ | 32 | /* ---- Include Files ---------------------------------------------------- */ |
33 | #include <csp/reg.h> | 33 | #include <mach/csp/reg.h> |
34 | #include <mach/csp/mm_io.h> | 34 | #include <mach/csp/mm_io.h> |
35 | 35 | ||
36 | /* ---- Constants and Types ---------------------------------------------- */ | 36 | /* ---- Constants and Types ---------------------------------------------- */ |
@@ -233,5 +233,5 @@ | |||
233 | #define REG_UMI_BCH_ERR_LOC_WORD 0x00000018 | 233 | #define REG_UMI_BCH_ERR_LOC_WORD 0x00000018 |
234 | /* location within a page (512 byte) */ | 234 | /* location within a page (512 byte) */ |
235 | #define REG_UMI_BCH_ERR_LOC_PAGE 0x00001FE0 | 235 | #define REG_UMI_BCH_ERR_LOC_PAGE 0x00001FE0 |
236 | #define REG_UMI_BCH_ERR_LOC_ADDR(index) (__REG32(HW_UMI_BASE + 0x64 + (index / 2)*4) >> ((index % 2) * 16)) | 236 | #define REG_UMI_BCH_ERR_LOC_ADDR(index) (readl(HW_UMI_BASE + 0x64 + (index / 2)*4) >> ((index % 2) * 16)) |
237 | #endif | 237 | #endif |
diff --git a/arch/arm/mach-bcmring/mm.c b/arch/arm/mach-bcmring/mm.c index 1adec78ec940..33824a81cac4 100644 --- a/arch/arm/mach-bcmring/mm.c +++ b/arch/arm/mach-bcmring/mm.c | |||
@@ -20,12 +20,12 @@ | |||
20 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
21 | #include <mach/csp/mm_io.h> | 21 | #include <mach/csp/mm_io.h> |
22 | 22 | ||
23 | #define IO_DESC(va, sz) { .virtual = va, \ | 23 | #define IO_DESC(va, sz) { .virtual = (unsigned long)va, \ |
24 | .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \ | 24 | .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \ |
25 | .length = sz, \ | 25 | .length = sz, \ |
26 | .type = MT_DEVICE } | 26 | .type = MT_DEVICE } |
27 | 27 | ||
28 | #define MEM_DESC(va, sz) { .virtual = va, \ | 28 | #define MEM_DESC(va, sz) { .virtual = (unsigned long)va, \ |
29 | .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \ | 29 | .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \ |
30 | .length = sz, \ | 30 | .length = sz, \ |
31 | .type = MT_MEMORY } | 31 | .type = MT_MEMORY } |
diff --git a/arch/arm/mach-bcmring/timer.c b/arch/arm/mach-bcmring/timer.c index af9c3d7e2a0c..59412903466e 100644 --- a/arch/arm/mach-bcmring/timer.c +++ b/arch/arm/mach-bcmring/timer.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <csp/tmrHw.h> | 17 | #include <mach/csp/tmrHw.h> |
18 | 18 | ||
19 | #include <mach/timer.h> | 19 | #include <mach/timer.h> |
20 | /* The core.c file initializes timers 1 and 3 as a linux clocksource. */ | 20 | /* The core.c file initializes timers 1 and 3 as a linux clocksource. */ |
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 6321567d8eaa..cc4c6a5a357c 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -49,16 +49,6 @@ static struct map_desc dove_io_desc[] __initdata = { | |||
49 | .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE), | 49 | .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE), |
50 | .length = DOVE_NB_REGS_SIZE, | 50 | .length = DOVE_NB_REGS_SIZE, |
51 | .type = MT_DEVICE, | 51 | .type = MT_DEVICE, |
52 | }, { | ||
53 | .virtual = DOVE_PCIE0_IO_VIRT_BASE, | ||
54 | .pfn = __phys_to_pfn(DOVE_PCIE0_IO_PHYS_BASE), | ||
55 | .length = DOVE_PCIE0_IO_SIZE, | ||
56 | .type = MT_DEVICE, | ||
57 | }, { | ||
58 | .virtual = DOVE_PCIE1_IO_VIRT_BASE, | ||
59 | .pfn = __phys_to_pfn(DOVE_PCIE1_IO_PHYS_BASE), | ||
60 | .length = DOVE_PCIE1_IO_SIZE, | ||
61 | .type = MT_DEVICE, | ||
62 | }, | 52 | }, |
63 | }; | 53 | }; |
64 | 54 | ||
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h index d52b0ef313b7..c91e3004a47b 100644 --- a/arch/arm/mach-dove/include/mach/dove.h +++ b/arch/arm/mach-dove/include/mach/dove.h | |||
@@ -50,14 +50,12 @@ | |||
50 | #define DOVE_NB_REGS_SIZE SZ_8M | 50 | #define DOVE_NB_REGS_SIZE SZ_8M |
51 | 51 | ||
52 | #define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000 | 52 | #define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000 |
53 | #define DOVE_PCIE0_IO_VIRT_BASE 0xfee00000 | ||
54 | #define DOVE_PCIE0_IO_BUS_BASE 0x00000000 | 53 | #define DOVE_PCIE0_IO_BUS_BASE 0x00000000 |
55 | #define DOVE_PCIE0_IO_SIZE SZ_1M | 54 | #define DOVE_PCIE0_IO_SIZE SZ_64K |
56 | 55 | ||
57 | #define DOVE_PCIE1_IO_PHYS_BASE 0xf2100000 | 56 | #define DOVE_PCIE1_IO_PHYS_BASE 0xf2100000 |
58 | #define DOVE_PCIE1_IO_VIRT_BASE 0xfef00000 | 57 | #define DOVE_PCIE1_IO_BUS_BASE 0x00010000 |
59 | #define DOVE_PCIE1_IO_BUS_BASE 0x00100000 | 58 | #define DOVE_PCIE1_IO_SIZE SZ_64K |
60 | #define DOVE_PCIE1_IO_SIZE SZ_1M | ||
61 | 59 | ||
62 | /* | 60 | /* |
63 | * Dove Core Registers Map | 61 | * Dove Core Registers Map |
diff --git a/arch/arm/mach-dove/include/mach/io.h b/arch/arm/mach-dove/include/mach/io.h deleted file mode 100644 index 29c8b85355a5..000000000000 --- a/arch/arm/mach-dove/include/mach/io.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-dove/include/mach/io.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ARCH_IO_H | ||
10 | #define __ASM_ARCH_IO_H | ||
11 | |||
12 | #include "dove.h" | ||
13 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | ||
15 | |||
16 | #define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \ | ||
17 | DOVE_PCIE0_IO_VIRT_BASE)) | ||
18 | |||
19 | #endif | ||
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c index 47921b0cdc65..355332d502cb 100644 --- a/arch/arm/mach-dove/pcie.c +++ b/arch/arm/mach-dove/pcie.c | |||
@@ -26,9 +26,8 @@ struct pcie_port { | |||
26 | u8 root_bus_nr; | 26 | u8 root_bus_nr; |
27 | void __iomem *base; | 27 | void __iomem *base; |
28 | spinlock_t conf_lock; | 28 | spinlock_t conf_lock; |
29 | char io_space_name[16]; | ||
30 | char mem_space_name[16]; | 29 | char mem_space_name[16]; |
31 | struct resource res[2]; | 30 | struct resource res; |
32 | }; | 31 | }; |
33 | 32 | ||
34 | static struct pcie_port pcie_port[2]; | 33 | static struct pcie_port pcie_port[2]; |
@@ -53,24 +52,10 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) | |||
53 | 52 | ||
54 | orion_pcie_setup(pp->base); | 53 | orion_pcie_setup(pp->base); |
55 | 54 | ||
56 | /* | 55 | if (pp->index == 0) |
57 | * IORESOURCE_IO | 56 | pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE0_IO_PHYS_BASE); |
58 | */ | 57 | else |
59 | snprintf(pp->io_space_name, sizeof(pp->io_space_name), | 58 | pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE1_IO_PHYS_BASE); |
60 | "PCIe %d I/O", pp->index); | ||
61 | pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0; | ||
62 | pp->res[0].name = pp->io_space_name; | ||
63 | if (pp->index == 0) { | ||
64 | pp->res[0].start = DOVE_PCIE0_IO_PHYS_BASE; | ||
65 | pp->res[0].end = pp->res[0].start + DOVE_PCIE0_IO_SIZE - 1; | ||
66 | } else { | ||
67 | pp->res[0].start = DOVE_PCIE1_IO_PHYS_BASE; | ||
68 | pp->res[0].end = pp->res[0].start + DOVE_PCIE1_IO_SIZE - 1; | ||
69 | } | ||
70 | pp->res[0].flags = IORESOURCE_IO; | ||
71 | if (request_resource(&ioport_resource, &pp->res[0])) | ||
72 | panic("Request PCIe IO resource failed\n"); | ||
73 | pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset); | ||
74 | 59 | ||
75 | /* | 60 | /* |
76 | * IORESOURCE_MEM | 61 | * IORESOURCE_MEM |
@@ -78,18 +63,18 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) | |||
78 | snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), | 63 | snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), |
79 | "PCIe %d MEM", pp->index); | 64 | "PCIe %d MEM", pp->index); |
80 | pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; | 65 | pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; |
81 | pp->res[1].name = pp->mem_space_name; | 66 | pp->res.name = pp->mem_space_name; |
82 | if (pp->index == 0) { | 67 | if (pp->index == 0) { |
83 | pp->res[1].start = DOVE_PCIE0_MEM_PHYS_BASE; | 68 | pp->res.start = DOVE_PCIE0_MEM_PHYS_BASE; |
84 | pp->res[1].end = pp->res[1].start + DOVE_PCIE0_MEM_SIZE - 1; | 69 | pp->res.end = pp->res.start + DOVE_PCIE0_MEM_SIZE - 1; |
85 | } else { | 70 | } else { |
86 | pp->res[1].start = DOVE_PCIE1_MEM_PHYS_BASE; | 71 | pp->res.start = DOVE_PCIE1_MEM_PHYS_BASE; |
87 | pp->res[1].end = pp->res[1].start + DOVE_PCIE1_MEM_SIZE - 1; | 72 | pp->res.end = pp->res.start + DOVE_PCIE1_MEM_SIZE - 1; |
88 | } | 73 | } |
89 | pp->res[1].flags = IORESOURCE_MEM; | 74 | pp->res.flags = IORESOURCE_MEM; |
90 | if (request_resource(&iomem_resource, &pp->res[1])) | 75 | if (request_resource(&iomem_resource, &pp->res)) |
91 | panic("Request PCIe Memory resource failed\n"); | 76 | panic("Request PCIe Memory resource failed\n"); |
92 | pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); | 77 | pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset); |
93 | 78 | ||
94 | return 1; | 79 | return 1; |
95 | } | 80 | } |
@@ -210,7 +195,7 @@ static void __init add_pcie_port(int index, unsigned long base) | |||
210 | pp->root_bus_nr = -1; | 195 | pp->root_bus_nr = -1; |
211 | pp->base = (void __iomem *)base; | 196 | pp->base = (void __iomem *)base; |
212 | spin_lock_init(&pp->conf_lock); | 197 | spin_lock_init(&pp->conf_lock); |
213 | memset(pp->res, 0, sizeof(pp->res)); | 198 | memset(&pp->res, 0, sizeof(pp->res)); |
214 | } else { | 199 | } else { |
215 | printk(KERN_INFO "link down, ignoring\n"); | 200 | printk(KERN_INFO "link down, ignoring\n"); |
216 | } | 201 | } |
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c index 6f8068692edf..f0fe6b5350e2 100644 --- a/arch/arm/mach-ebsa110/core.c +++ b/arch/arm/mach-ebsa110/core.c | |||
@@ -74,22 +74,22 @@ static struct map_desc ebsa110_io_desc[] __initdata = { | |||
74 | * sparse external-decode ISAIO space | 74 | * sparse external-decode ISAIO space |
75 | */ | 75 | */ |
76 | { /* IRQ_STAT/IRQ_MCLR */ | 76 | { /* IRQ_STAT/IRQ_MCLR */ |
77 | .virtual = IRQ_STAT, | 77 | .virtual = (unsigned long)IRQ_STAT, |
78 | .pfn = __phys_to_pfn(TRICK4_PHYS), | 78 | .pfn = __phys_to_pfn(TRICK4_PHYS), |
79 | .length = TRICK4_SIZE, | 79 | .length = TRICK4_SIZE, |
80 | .type = MT_DEVICE | 80 | .type = MT_DEVICE |
81 | }, { /* IRQ_MASK/IRQ_MSET */ | 81 | }, { /* IRQ_MASK/IRQ_MSET */ |
82 | .virtual = IRQ_MASK, | 82 | .virtual = (unsigned long)IRQ_MASK, |
83 | .pfn = __phys_to_pfn(TRICK3_PHYS), | 83 | .pfn = __phys_to_pfn(TRICK3_PHYS), |
84 | .length = TRICK3_SIZE, | 84 | .length = TRICK3_SIZE, |
85 | .type = MT_DEVICE | 85 | .type = MT_DEVICE |
86 | }, { /* SOFT_BASE */ | 86 | }, { /* SOFT_BASE */ |
87 | .virtual = SOFT_BASE, | 87 | .virtual = (unsigned long)SOFT_BASE, |
88 | .pfn = __phys_to_pfn(TRICK1_PHYS), | 88 | .pfn = __phys_to_pfn(TRICK1_PHYS), |
89 | .length = TRICK1_SIZE, | 89 | .length = TRICK1_SIZE, |
90 | .type = MT_DEVICE | 90 | .type = MT_DEVICE |
91 | }, { /* PIT_BASE */ | 91 | }, { /* PIT_BASE */ |
92 | .virtual = PIT_BASE, | 92 | .virtual = (unsigned long)PIT_BASE, |
93 | .pfn = __phys_to_pfn(TRICK0_PHYS), | 93 | .pfn = __phys_to_pfn(TRICK0_PHYS), |
94 | .length = TRICK0_SIZE, | 94 | .length = TRICK0_SIZE, |
95 | .type = MT_DEVICE | 95 | .type = MT_DEVICE |
diff --git a/arch/arm/mach-ebsa110/core.h b/arch/arm/mach-ebsa110/core.h index c93c9e43012d..afe137ee172e 100644 --- a/arch/arm/mach-ebsa110/core.h +++ b/arch/arm/mach-ebsa110/core.h | |||
@@ -31,11 +31,11 @@ | |||
31 | #define TRICK7_PHYS 0xf3c00000 | 31 | #define TRICK7_PHYS 0xf3c00000 |
32 | 32 | ||
33 | /* Virtual addresses */ | 33 | /* Virtual addresses */ |
34 | #define PIT_BASE 0xfc000000 /* trick 0 */ | 34 | #define PIT_BASE IOMEM(0xfc000000) /* trick 0 */ |
35 | #define SOFT_BASE 0xfd000000 /* trick 1 */ | 35 | #define SOFT_BASE IOMEM(0xfd000000) /* trick 1 */ |
36 | #define IRQ_MASK 0xfe000000 /* trick 3 - read */ | 36 | #define IRQ_MASK IOMEM(0xfe000000) /* trick 3 - read */ |
37 | #define IRQ_MSET 0xfe000000 /* trick 3 - write */ | 37 | #define IRQ_MSET IOMEM(0xfe000000) /* trick 3 - write */ |
38 | #define IRQ_STAT 0xff000000 /* trick 4 - read */ | 38 | #define IRQ_STAT IOMEM(0xff000000) /* trick 4 - read */ |
39 | #define IRQ_MCLR 0xff000000 /* trick 4 - write */ | 39 | #define IRQ_MCLR IOMEM(0xff000000) /* trick 4 - write */ |
40 | 40 | ||
41 | #endif | 41 | #endif |
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c index 774533c67066..3b00e299b624 100644 --- a/arch/arm/mach-exynos/clock-exynos5.c +++ b/arch/arm/mach-exynos/clock-exynos5.c | |||
@@ -166,11 +166,6 @@ static int exynos5_clk_ip_gen_ctrl(struct clk *clk, int enable) | |||
166 | return s5p_gatectrl(EXYNOS5_CLKGATE_IP_GEN, clk, enable); | 166 | return s5p_gatectrl(EXYNOS5_CLKGATE_IP_GEN, clk, enable); |
167 | } | 167 | } |
168 | 168 | ||
169 | static int exynos5_clk_ip_gps_ctrl(struct clk *clk, int enable) | ||
170 | { | ||
171 | return s5p_gatectrl(EXYNOS5_CLKGATE_IP_GPS, clk, enable); | ||
172 | } | ||
173 | |||
174 | static int exynos5_clk_ip_mfc_ctrl(struct clk *clk, int enable) | 169 | static int exynos5_clk_ip_mfc_ctrl(struct clk *clk, int enable) |
175 | { | 170 | { |
176 | return s5p_gatectrl(EXYNOS5_CLKGATE_IP_MFC, clk, enable); | 171 | return s5p_gatectrl(EXYNOS5_CLKGATE_IP_MFC, clk, enable); |
@@ -672,10 +667,6 @@ static struct clk exynos5_init_clocks_off[] = { | |||
672 | .enable = exynos5_clk_ip_fsys_ctrl, | 667 | .enable = exynos5_clk_ip_fsys_ctrl, |
673 | .ctrlbit = (1 << 7), | 668 | .ctrlbit = (1 << 7), |
674 | }, { | 669 | }, { |
675 | .name = "gps", | ||
676 | .enable = exynos5_clk_ip_gps_ctrl, | ||
677 | .ctrlbit = ((1 << 3) | (1 << 2) | (1 << 0)), | ||
678 | }, { | ||
679 | .name = "nfcon", | 670 | .name = "nfcon", |
680 | .enable = exynos5_clk_ip_fsys_ctrl, | 671 | .enable = exynos5_clk_ip_fsys_ctrl, |
681 | .ctrlbit = (1 << 22), | 672 | .ctrlbit = (1 << 22), |
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index c941053dd5a1..6d33f50c2e56 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h | |||
@@ -131,7 +131,6 @@ | |||
131 | #define EXYNOS5_PA_SYSMMU_JPEG 0x11F20000 | 131 | #define EXYNOS5_PA_SYSMMU_JPEG 0x11F20000 |
132 | #define EXYNOS5_PA_SYSMMU_IOP 0x12360000 | 132 | #define EXYNOS5_PA_SYSMMU_IOP 0x12360000 |
133 | #define EXYNOS5_PA_SYSMMU_RTIC 0x12370000 | 133 | #define EXYNOS5_PA_SYSMMU_RTIC 0x12370000 |
134 | #define EXYNOS5_PA_SYSMMU_GPS 0x12630000 | ||
135 | #define EXYNOS5_PA_SYSMMU_ISP 0x13260000 | 134 | #define EXYNOS5_PA_SYSMMU_ISP 0x13260000 |
136 | #define EXYNOS5_PA_SYSMMU_DRC 0x12370000 | 135 | #define EXYNOS5_PA_SYSMMU_DRC 0x12370000 |
137 | #define EXYNOS5_PA_SYSMMU_SCALERC 0x13280000 | 136 | #define EXYNOS5_PA_SYSMMU_SCALERC 0x13280000 |
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c index 3e6aaa6361da..a42b369bc439 100644 --- a/arch/arm/mach-footbridge/common.c +++ b/arch/arm/mach-footbridge/common.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
18 | 18 | ||
19 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | #include <asm/irq.h> | 21 | #include <asm/irq.h> |
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <asm/mach/irq.h> | 27 | #include <asm/mach/irq.h> |
28 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
29 | #include <asm/mach/pci.h> | ||
29 | 30 | ||
30 | #include "common.h" | 31 | #include "common.h" |
31 | 32 | ||
@@ -175,11 +176,6 @@ static struct map_desc ebsa285_host_io_desc[] __initdata = { | |||
175 | .pfn = __phys_to_pfn(DC21285_PCI_IACK), | 176 | .pfn = __phys_to_pfn(DC21285_PCI_IACK), |
176 | .length = PCIIACK_SIZE, | 177 | .length = PCIIACK_SIZE, |
177 | .type = MT_DEVICE, | 178 | .type = MT_DEVICE, |
178 | }, { | ||
179 | .virtual = PCIO_BASE, | ||
180 | .pfn = __phys_to_pfn(DC21285_PCI_IO), | ||
181 | .length = PCIO_SIZE, | ||
182 | .type = MT_DEVICE, | ||
183 | }, | 179 | }, |
184 | #endif | 180 | #endif |
185 | }; | 181 | }; |
@@ -196,8 +192,10 @@ void __init footbridge_map_io(void) | |||
196 | * Now, work out what we've got to map in addition on this | 192 | * Now, work out what we've got to map in addition on this |
197 | * platform. | 193 | * platform. |
198 | */ | 194 | */ |
199 | if (footbridge_cfn_mode()) | 195 | if (footbridge_cfn_mode()) { |
200 | iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); | 196 | iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); |
197 | pci_map_io_early(__phys_to_pfn(DC21285_PCI_IO)); | ||
198 | } | ||
201 | } | 199 | } |
202 | 200 | ||
203 | void footbridge_restart(char mode, const char *cmd) | 201 | void footbridge_restart(char mode, const char *cmd) |
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 9d62e3381024..a7cd2cf5e08d 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c | |||
@@ -276,8 +276,8 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys) | |||
276 | 276 | ||
277 | sys->mem_offset = DC21285_PCI_MEM; | 277 | sys->mem_offset = DC21285_PCI_MEM; |
278 | 278 | ||
279 | pci_add_resource_offset(&sys->resources, | 279 | pci_ioremap_io(0, DC21285_PCI_IO); |
280 | &ioport_resource, sys->io_offset); | 280 | |
281 | pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset); | 281 | pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset); |
282 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); | 282 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); |
283 | 283 | ||
@@ -298,7 +298,7 @@ void __init dc21285_preinit(void) | |||
298 | mem_size = (unsigned int)high_memory - PAGE_OFFSET; | 298 | mem_size = (unsigned int)high_memory - PAGE_OFFSET; |
299 | for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) | 299 | for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) |
300 | if (mem_mask >= mem_size) | 300 | if (mem_mask >= mem_size) |
301 | break; | 301 | break; |
302 | 302 | ||
303 | /* | 303 | /* |
304 | * These registers need to be set up whether we're the | 304 | * These registers need to be set up whether we're the |
@@ -350,14 +350,6 @@ void __init dc21285_preinit(void) | |||
350 | "PCI data parity", NULL); | 350 | "PCI data parity", NULL); |
351 | 351 | ||
352 | if (cfn_mode) { | 352 | if (cfn_mode) { |
353 | static struct resource csrio; | ||
354 | |||
355 | csrio.flags = IORESOURCE_IO; | ||
356 | csrio.name = "Footbridge"; | ||
357 | |||
358 | allocate_resource(&ioport_resource, &csrio, 128, | ||
359 | 0xff00, 0xffff, 128, NULL, NULL); | ||
360 | |||
361 | /* | 353 | /* |
362 | * Map our SDRAM at a known address in PCI space, just in case | 354 | * Map our SDRAM at a known address in PCI space, just in case |
363 | * the firmware had other ideas. Using a nonzero base is | 355 | * the firmware had other ideas. Using a nonzero base is |
@@ -365,7 +357,7 @@ void __init dc21285_preinit(void) | |||
365 | * in the range 0x000a0000 to 0x000c0000. (eg, S3 cards). | 357 | * in the range 0x000a0000 to 0x000c0000. (eg, S3 cards). |
366 | */ | 358 | */ |
367 | *CSR_PCICSRBASE = 0xf4000000; | 359 | *CSR_PCICSRBASE = 0xf4000000; |
368 | *CSR_PCICSRIOBASE = csrio.start; | 360 | *CSR_PCICSRIOBASE = 0; |
369 | *CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET); | 361 | *CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET); |
370 | *CSR_PCIROMBASE = 0; | 362 | *CSR_PCIROMBASE = 0; |
371 | *CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | | 363 | *CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | |
diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S index e5acde25ffc5..c169f0c99b2a 100644 --- a/arch/arm/mach-footbridge/include/mach/debug-macro.S +++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S | |||
@@ -17,7 +17,8 @@ | |||
17 | /* For NetWinder debugging */ | 17 | /* For NetWinder debugging */ |
18 | .macro addruart, rp, rv, tmp | 18 | .macro addruart, rp, rv, tmp |
19 | mov \rp, #0x000003f8 | 19 | mov \rp, #0x000003f8 |
20 | orr \rv, \rp, #0xff000000 @ virtual | 20 | orr \rv, \rp, #0xfe000000 @ virtual |
21 | orr \rv, \rv, #0x00e00000 @ virtual | ||
21 | orr \rp, \rp, #0x7c000000 @ physical | 22 | orr \rp, \rp, #0x7c000000 @ physical |
22 | .endm | 23 | .endm |
23 | 24 | ||
diff --git a/arch/arm/mach-footbridge/include/mach/io.h b/arch/arm/mach-footbridge/include/mach/io.h index aba531eebbc6..aba46388cc0c 100644 --- a/arch/arm/mach-footbridge/include/mach/io.h +++ b/arch/arm/mach-footbridge/include/mach/io.h | |||
@@ -14,18 +14,10 @@ | |||
14 | #ifndef __ASM_ARM_ARCH_IO_H | 14 | #ifndef __ASM_ARM_ARCH_IO_H |
15 | #define __ASM_ARM_ARCH_IO_H | 15 | #define __ASM_ARM_ARCH_IO_H |
16 | 16 | ||
17 | #ifdef CONFIG_MMU | ||
18 | #define MMU_IO(a, b) (a) | ||
19 | #else | ||
20 | #define MMU_IO(a, b) (b) | ||
21 | #endif | ||
22 | |||
23 | #define PCIO_SIZE 0x00100000 | ||
24 | #define PCIO_BASE MMU_IO(0xff000000, 0x7c000000) | ||
25 | |||
26 | /* | 17 | /* |
27 | * Translation of various region addresses to virtual addresses | 18 | * Translation of various i/o addresses to host addresses for !CONFIG_MMU |
28 | */ | 19 | */ |
20 | #define PCIO_BASE 0x7c000000 | ||
29 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) | 21 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) |
30 | 22 | ||
31 | #endif | 23 | #endif |
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index d004d37ad9d8..d1204198ca83 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -13,7 +13,7 @@ imx5-pm-$(CONFIG_PM) += pm-imx5.o | |||
13 | obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o $(imx5-pm-y) cpu_op-mx51.o | 13 | obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o $(imx5-pm-y) cpu_op-mx51.o |
14 | 14 | ||
15 | obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \ | 15 | obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \ |
16 | clk-pfd.o clk-busy.o | 16 | clk-pfd.o clk-busy.o clk.o |
17 | 17 | ||
18 | # Support for CMOS sensor interface | 18 | # Support for CMOS sensor interface |
19 | obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o | 19 | obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o |
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c index ea13e61bd5f3..cf65148bc519 100644 --- a/arch/arm/mach-imx/clk-imx21.c +++ b/arch/arm/mach-imx/clk-imx21.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/clk-provider.h> | 23 | #include <linux/clk-provider.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/clkdev.h> | ||
27 | #include <linux/err.h> | 26 | #include <linux/err.h> |
28 | 27 | ||
29 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index 4bdcaa97bd98..f89c4403a922 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c | |||
@@ -39,10 +39,10 @@ static const char *ssi_ext2_com_sels[] = { "ssi_ext2_podf", "ssi2_root_gate", }; | |||
39 | static const char *emi_slow_sel[] = { "main_bus", "ahb", }; | 39 | static const char *emi_slow_sel[] = { "main_bus", "ahb", }; |
40 | static const char *usb_phy_sel_str[] = { "osc", "usb_phy_podf", }; | 40 | static const char *usb_phy_sel_str[] = { "osc", "usb_phy_podf", }; |
41 | static const char *mx51_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "tve_di", }; | 41 | static const char *mx51_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "tve_di", }; |
42 | static const char *mx53_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "di_pll4_podf", "dummy", "ldb_di0", }; | 42 | static const char *mx53_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "di_pll4_podf", "dummy", "ldb_di0_gate", }; |
43 | static const char *mx53_ldb_di0_sel[] = { "pll3_sw", "pll4_sw", }; | 43 | static const char *mx53_ldb_di0_sel[] = { "pll3_sw", "pll4_sw", }; |
44 | static const char *mx51_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", }; | 44 | static const char *mx51_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", }; |
45 | static const char *mx53_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", "ldb_di1", }; | 45 | static const char *mx53_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", "ldb_di1_gate", }; |
46 | static const char *mx53_ldb_di1_sel[] = { "pll3_sw", "pll4_sw", }; | 46 | static const char *mx53_ldb_di1_sel[] = { "pll3_sw", "pll4_sw", }; |
47 | static const char *mx51_tve_ext_sel[] = { "osc", "ckih1", }; | 47 | static const char *mx51_tve_ext_sel[] = { "osc", "ckih1", }; |
48 | static const char *mx53_tve_ext_sel[] = { "pll4_sw", "ckih1", }; | 48 | static const char *mx53_tve_ext_sel[] = { "pll4_sw", "ckih1", }; |
diff --git a/arch/arm/mach-imx/clk-pllv1.c b/arch/arm/mach-imx/clk-pllv1.c index 2d856f9ccf59..02be73178912 100644 --- a/arch/arm/mach-imx/clk-pllv1.c +++ b/arch/arm/mach-imx/clk-pllv1.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/err.h> | 6 | #include <linux/err.h> |
7 | #include <mach/common.h> | 7 | #include <mach/common.h> |
8 | #include <mach/hardware.h> | 8 | #include <mach/hardware.h> |
9 | #include <mach/clock.h> | 9 | |
10 | #include "clk.h" | 10 | #include "clk.h" |
11 | 11 | ||
12 | /** | 12 | /** |
@@ -29,8 +29,53 @@ static unsigned long clk_pllv1_recalc_rate(struct clk_hw *hw, | |||
29 | unsigned long parent_rate) | 29 | unsigned long parent_rate) |
30 | { | 30 | { |
31 | struct clk_pllv1 *pll = to_clk_pllv1(hw); | 31 | struct clk_pllv1 *pll = to_clk_pllv1(hw); |
32 | long long ll; | ||
33 | int mfn_abs; | ||
34 | unsigned int mfi, mfn, mfd, pd; | ||
35 | u32 reg; | ||
36 | unsigned long rate; | ||
37 | |||
38 | reg = readl(pll->base); | ||
39 | |||
40 | /* | ||
41 | * Get the resulting clock rate from a PLL register value and the input | ||
42 | * frequency. PLLs with this register layout can be found on i.MX1, | ||
43 | * i.MX21, i.MX27 and i,MX31 | ||
44 | * | ||
45 | * mfi + mfn / (mfd + 1) | ||
46 | * f = 2 * f_ref * -------------------- | ||
47 | * pd + 1 | ||
48 | */ | ||
49 | |||
50 | mfi = (reg >> 10) & 0xf; | ||
51 | mfn = reg & 0x3ff; | ||
52 | mfd = (reg >> 16) & 0x3ff; | ||
53 | pd = (reg >> 26) & 0xf; | ||
54 | |||
55 | mfi = mfi <= 5 ? 5 : mfi; | ||
56 | |||
57 | mfn_abs = mfn; | ||
58 | |||
59 | /* | ||
60 | * On all i.MXs except i.MX1 and i.MX21 mfn is a 10bit | ||
61 | * 2's complements number | ||
62 | */ | ||
63 | if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200) | ||
64 | mfn_abs = 0x400 - mfn; | ||
65 | |||
66 | rate = parent_rate * 2; | ||
67 | rate /= pd + 1; | ||
68 | |||
69 | ll = (unsigned long long)rate * mfn_abs; | ||
70 | |||
71 | do_div(ll, mfd + 1); | ||
72 | |||
73 | if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200) | ||
74 | ll = -ll; | ||
75 | |||
76 | ll = (rate * mfi) + ll; | ||
32 | 77 | ||
33 | return mxc_decode_pll(readl(pll->base), parent_rate); | 78 | return ll; |
34 | } | 79 | } |
35 | 80 | ||
36 | struct clk_ops clk_pllv1_ops = { | 81 | struct clk_ops clk_pllv1_ops = { |
diff --git a/arch/arm/mach-imx/clk.c b/arch/arm/mach-imx/clk.c new file mode 100644 index 000000000000..f5e8be8e7f11 --- /dev/null +++ b/arch/arm/mach-imx/clk.c | |||
@@ -0,0 +1,3 @@ | |||
1 | #include <linux/spinlock.h> | ||
2 | |||
3 | DEFINE_SPINLOCK(imx_ccm_lock); | ||
diff --git a/arch/arm/mach-imx/clk.h b/arch/arm/mach-imx/clk.h index 1bf64fe2523c..5f2d8acca25f 100644 --- a/arch/arm/mach-imx/clk.h +++ b/arch/arm/mach-imx/clk.h | |||
@@ -3,7 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <linux/clk-provider.h> | 5 | #include <linux/clk-provider.h> |
6 | #include <mach/clock.h> | 6 | |
7 | extern spinlock_t imx_ccm_lock; | ||
7 | 8 | ||
8 | struct clk *imx_clk_pllv1(const char *name, const char *parent, | 9 | struct clk *imx_clk_pllv1(const char *name, const char *parent, |
9 | void __iomem *base); | 10 | void __iomem *base); |
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c index 5d08533ab2c7..0330078ff788 100644 --- a/arch/arm/mach-imx/mach-kzm_arm11_01.c +++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <asm/mach/map.h> | 36 | #include <asm/mach/map.h> |
37 | #include <asm/mach/time.h> | 37 | #include <asm/mach/time.h> |
38 | 38 | ||
39 | #include <mach/clock.h> | ||
40 | #include <mach/common.h> | 39 | #include <mach/common.h> |
41 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
42 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
@@ -259,13 +258,13 @@ static void __init kzm_board_init(void) | |||
259 | */ | 258 | */ |
260 | static struct map_desc kzm_io_desc[] __initdata = { | 259 | static struct map_desc kzm_io_desc[] __initdata = { |
261 | { | 260 | { |
262 | .virtual = MX31_CS4_BASE_ADDR_VIRT, | 261 | .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT, |
263 | .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), | 262 | .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), |
264 | .length = MX31_CS4_SIZE, | 263 | .length = MX31_CS4_SIZE, |
265 | .type = MT_DEVICE | 264 | .type = MT_DEVICE |
266 | }, | 265 | }, |
267 | { | 266 | { |
268 | .virtual = MX31_CS5_BASE_ADDR_VIRT, | 267 | .virtual = (unsigned long)MX31_CS5_BASE_ADDR_VIRT, |
269 | .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR), | 268 | .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR), |
270 | .length = MX31_CS5_SIZE, | 269 | .length = MX31_CS5_SIZE, |
271 | .type = MT_DEVICE | 270 | .type = MT_DEVICE |
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c index d37f4809c556..e774b07f48d3 100644 --- a/arch/arm/mach-imx/mach-mx31ads.c +++ b/arch/arm/mach-imx/mach-mx31ads.c | |||
@@ -540,7 +540,7 @@ static void __init mxc_init_audio(void) | |||
540 | */ | 540 | */ |
541 | static struct map_desc mx31ads_io_desc[] __initdata = { | 541 | static struct map_desc mx31ads_io_desc[] __initdata = { |
542 | { | 542 | { |
543 | .virtual = MX31_CS4_BASE_ADDR_VIRT, | 543 | .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT, |
544 | .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), | 544 | .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), |
545 | .length = CS4_CS8900_MMIO_START, | 545 | .length = CS4_CS8900_MMIO_START, |
546 | .type = MT_DEVICE | 546 | .type = MT_DEVICE |
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c index c8785b39eaed..ef57cff5abfb 100644 --- a/arch/arm/mach-imx/mach-mx31lite.c +++ b/arch/arm/mach-imx/mach-mx31lite.c | |||
@@ -207,7 +207,7 @@ static struct platform_device physmap_flash_device = { | |||
207 | */ | 207 | */ |
208 | static struct map_desc mx31lite_io_desc[] __initdata = { | 208 | static struct map_desc mx31lite_io_desc[] __initdata = { |
209 | { | 209 | { |
210 | .virtual = MX31_CS4_BASE_ADDR_VIRT, | 210 | .virtual = (unsigned long)MX31_CS4_BASE_ADDR_VIRT, |
211 | .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), | 211 | .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR), |
212 | .length = MX31_CS4_SIZE, | 212 | .length = MX31_CS4_SIZE, |
213 | .type = MT_DEVICE | 213 | .type = MT_DEVICE |
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 3fa6c51390da..a432d4325f89 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c | |||
@@ -95,8 +95,8 @@ arch_initcall(integrator_init); | |||
95 | * UART0 7 6 | 95 | * UART0 7 6 |
96 | * UART1 5 4 | 96 | * UART1 5 4 |
97 | */ | 97 | */ |
98 | #define SC_CTRLC IO_ADDRESS(INTEGRATOR_SC_CTRLC) | 98 | #define SC_CTRLC __io_address(INTEGRATOR_SC_CTRLC) |
99 | #define SC_CTRLS IO_ADDRESS(INTEGRATOR_SC_CTRLS) | 99 | #define SC_CTRLS __io_address(INTEGRATOR_SC_CTRLS) |
100 | 100 | ||
101 | static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) | 101 | static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) |
102 | { | 102 | { |
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c index fbb457779895..590c192cdf4d 100644 --- a/arch/arm/mach-integrator/cpu.c +++ b/arch/arm/mach-integrator/cpu.c | |||
@@ -25,10 +25,10 @@ | |||
25 | 25 | ||
26 | static struct cpufreq_driver integrator_driver; | 26 | static struct cpufreq_driver integrator_driver; |
27 | 27 | ||
28 | #define CM_ID IO_ADDRESS(INTEGRATOR_HDR_ID) | 28 | #define CM_ID __io_address(INTEGRATOR_HDR_ID) |
29 | #define CM_OSC IO_ADDRESS(INTEGRATOR_HDR_OSC) | 29 | #define CM_OSC __io_address(INTEGRATOR_HDR_OSC) |
30 | #define CM_STAT IO_ADDRESS(INTEGRATOR_HDR_STAT) | 30 | #define CM_STAT __io_address(INTEGRATOR_HDR_STAT) |
31 | #define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) | 31 | #define CM_LOCK __io_address(INTEGRATOR_HDR_LOCK) |
32 | 32 | ||
33 | static const struct icst_params lclk_params = { | 33 | static const struct icst_params lclk_params = { |
34 | .ref = 24000000, | 34 | .ref = 24000000, |
diff --git a/arch/arm/mach-integrator/include/mach/io.h b/arch/arm/mach-integrator/include/mach/io.h deleted file mode 100644 index 8de70de3dd0a..000000000000 --- a/arch/arm/mach-integrator/include/mach/io.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-integrator/include/mach/io.h | ||
3 | * | ||
4 | * Copyright (C) 1999 ARM Limited | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __ASM_ARM_ARCH_IO_H | ||
21 | #define __ASM_ARM_ARCH_IO_H | ||
22 | |||
23 | /* | ||
24 | * WARNING: this has to mirror definitions in platform.h | ||
25 | */ | ||
26 | #define PCI_MEMORY_VADDR 0xe8000000 | ||
27 | #define PCI_CONFIG_VADDR 0xec000000 | ||
28 | #define PCI_V3_VADDR 0xed000000 | ||
29 | #define PCI_IO_VADDR 0xee000000 | ||
30 | |||
31 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) | ||
32 | |||
33 | #endif | ||
diff --git a/arch/arm/mach-integrator/include/mach/platform.h b/arch/arm/mach-integrator/include/mach/platform.h index ec467baade09..4c0347526851 100644 --- a/arch/arm/mach-integrator/include/mach/platform.h +++ b/arch/arm/mach-integrator/include/mach/platform.h | |||
@@ -324,6 +324,10 @@ | |||
324 | */ | 324 | */ |
325 | #define PHYS_PCI_V3_BASE 0x62000000 | 325 | #define PHYS_PCI_V3_BASE 0x62000000 |
326 | 326 | ||
327 | #define PCI_MEMORY_VADDR 0xe8000000 | ||
328 | #define PCI_CONFIG_VADDR 0xec000000 | ||
329 | #define PCI_V3_VADDR 0xed000000 | ||
330 | |||
327 | /* ------------------------------------------------------------------------ | 331 | /* ------------------------------------------------------------------------ |
328 | * Integrator Interrupt Controllers | 332 | * Integrator Interrupt Controllers |
329 | * ------------------------------------------------------------------------ | 333 | * ------------------------------------------------------------------------ |
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 3b2267529f5e..2215d96cd735 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <asm/mach/arch.h> | 50 | #include <asm/mach/arch.h> |
51 | #include <asm/mach/irq.h> | 51 | #include <asm/mach/irq.h> |
52 | #include <asm/mach/map.h> | 52 | #include <asm/mach/map.h> |
53 | #include <asm/mach/pci.h> | ||
53 | #include <asm/mach/time.h> | 54 | #include <asm/mach/time.h> |
54 | 55 | ||
55 | #include <plat/fpga-irq.h> | 56 | #include <plat/fpga-irq.h> |
@@ -73,7 +74,7 @@ | |||
73 | * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) | 74 | * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) |
74 | * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) | 75 | * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) |
75 | * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k) | 76 | * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k) |
76 | * ee000000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) | 77 | * fee00000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) |
77 | * ef000000 Cache flush | 78 | * ef000000 Cache flush |
78 | * f1000000 10000000 Core module registers | 79 | * f1000000 10000000 Core module registers |
79 | * f1100000 11000000 System controller registers | 80 | * f1100000 11000000 System controller registers |
@@ -133,25 +134,20 @@ static struct map_desc ap_io_desc[] __initdata = { | |||
133 | .length = SZ_4K, | 134 | .length = SZ_4K, |
134 | .type = MT_DEVICE | 135 | .type = MT_DEVICE |
135 | }, { | 136 | }, { |
136 | .virtual = PCI_MEMORY_VADDR, | 137 | .virtual = (unsigned long)PCI_MEMORY_VADDR, |
137 | .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE), | 138 | .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE), |
138 | .length = SZ_16M, | 139 | .length = SZ_16M, |
139 | .type = MT_DEVICE | 140 | .type = MT_DEVICE |
140 | }, { | 141 | }, { |
141 | .virtual = PCI_CONFIG_VADDR, | 142 | .virtual = (unsigned long)PCI_CONFIG_VADDR, |
142 | .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE), | 143 | .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE), |
143 | .length = SZ_16M, | 144 | .length = SZ_16M, |
144 | .type = MT_DEVICE | 145 | .type = MT_DEVICE |
145 | }, { | 146 | }, { |
146 | .virtual = PCI_V3_VADDR, | 147 | .virtual = (unsigned long)PCI_V3_VADDR, |
147 | .pfn = __phys_to_pfn(PHYS_PCI_V3_BASE), | 148 | .pfn = __phys_to_pfn(PHYS_PCI_V3_BASE), |
148 | .length = SZ_64K, | 149 | .length = SZ_64K, |
149 | .type = MT_DEVICE | 150 | .type = MT_DEVICE |
150 | }, { | ||
151 | .virtual = PCI_IO_VADDR, | ||
152 | .pfn = __phys_to_pfn(PHYS_PCI_IO_BASE), | ||
153 | .length = SZ_64K, | ||
154 | .type = MT_DEVICE | ||
155 | } | 151 | } |
156 | }; | 152 | }; |
157 | 153 | ||
@@ -159,6 +155,7 @@ static void __init ap_map_io(void) | |||
159 | { | 155 | { |
160 | iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); | 156 | iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); |
161 | vga_base = PCI_MEMORY_VADDR; | 157 | vga_base = PCI_MEMORY_VADDR; |
158 | pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE)); | ||
162 | } | 159 | } |
163 | 160 | ||
164 | #define INTEGRATOR_SC_VALID_INT 0x003fffff | 161 | #define INTEGRATOR_SC_VALID_INT 0x003fffff |
@@ -317,9 +314,9 @@ static void __init ap_init(void) | |||
317 | /* | 314 | /* |
318 | * Where is the timer (VA)? | 315 | * Where is the timer (VA)? |
319 | */ | 316 | */ |
320 | #define TIMER0_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER0_BASE) | 317 | #define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE) |
321 | #define TIMER1_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER1_BASE) | 318 | #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE) |
322 | #define TIMER2_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER2_BASE) | 319 | #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE) |
323 | 320 | ||
324 | static unsigned long timer_reload; | 321 | static unsigned long timer_reload; |
325 | 322 | ||
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 82d5c837cc74..3df5fc369361 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -59,7 +59,7 @@ | |||
59 | 59 | ||
60 | #define INTCP_ETH_SIZE 0x10 | 60 | #define INTCP_ETH_SIZE 0x10 |
61 | 61 | ||
62 | #define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE) | 62 | #define INTCP_VA_CTRL_BASE __io_address(INTEGRATOR_CP_CTL_BASE) |
63 | #define INTCP_FLASHPROG 0x04 | 63 | #define INTCP_FLASHPROG 0x04 |
64 | #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) | 64 | #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) |
65 | #define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) | 65 | #define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) |
@@ -265,8 +265,8 @@ static struct platform_device *intcp_devs[] __initdata = { | |||
265 | */ | 265 | */ |
266 | static unsigned int mmc_status(struct device *dev) | 266 | static unsigned int mmc_status(struct device *dev) |
267 | { | 267 | { |
268 | unsigned int status = readl(IO_ADDRESS(0xca000000 + 4)); | 268 | unsigned int status = readl(__io_address(0xca000000 + 4)); |
269 | writel(8, IO_ADDRESS(INTEGRATOR_CP_CTL_BASE + 8)); | 269 | writel(8, __io_address(INTEGRATOR_CP_CTL_BASE + 8)); |
270 | 270 | ||
271 | return status & 8; | 271 | return status & 8; |
272 | } | 272 | } |
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index b866880e82ac..bbeca59df66b 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
@@ -41,61 +41,61 @@ | |||
41 | /* | 41 | /* |
42 | * The V3 PCI interface chip in Integrator provides several windows from | 42 | * The V3 PCI interface chip in Integrator provides several windows from |
43 | * local bus memory into the PCI memory areas. Unfortunately, there | 43 | * local bus memory into the PCI memory areas. Unfortunately, there |
44 | * are not really enough windows for our usage, therefore we reuse | 44 | * are not really enough windows for our usage, therefore we reuse |
45 | * one of the windows for access to PCI configuration space. The | 45 | * one of the windows for access to PCI configuration space. The |
46 | * memory map is as follows: | 46 | * memory map is as follows: |
47 | * | 47 | * |
48 | * Local Bus Memory Usage | 48 | * Local Bus Memory Usage |
49 | * | 49 | * |
50 | * 40000000 - 4FFFFFFF PCI memory. 256M non-prefetchable | 50 | * 40000000 - 4FFFFFFF PCI memory. 256M non-prefetchable |
51 | * 50000000 - 5FFFFFFF PCI memory. 256M prefetchable | 51 | * 50000000 - 5FFFFFFF PCI memory. 256M prefetchable |
52 | * 60000000 - 60FFFFFF PCI IO. 16M | 52 | * 60000000 - 60FFFFFF PCI IO. 16M |
53 | * 61000000 - 61FFFFFF PCI Configuration. 16M | 53 | * 61000000 - 61FFFFFF PCI Configuration. 16M |
54 | * | 54 | * |
55 | * There are three V3 windows, each described by a pair of V3 registers. | 55 | * There are three V3 windows, each described by a pair of V3 registers. |
56 | * These are LB_BASE0/LB_MAP0, LB_BASE1/LB_MAP1 and LB_BASE2/LB_MAP2. | 56 | * These are LB_BASE0/LB_MAP0, LB_BASE1/LB_MAP1 and LB_BASE2/LB_MAP2. |
57 | * Base0 and Base1 can be used for any type of PCI memory access. Base2 | 57 | * Base0 and Base1 can be used for any type of PCI memory access. Base2 |
58 | * can be used either for PCI I/O or for I20 accesses. By default, uHAL | 58 | * can be used either for PCI I/O or for I20 accesses. By default, uHAL |
59 | * uses this only for PCI IO space. | 59 | * uses this only for PCI IO space. |
60 | * | 60 | * |
61 | * Normally these spaces are mapped using the following base registers: | 61 | * Normally these spaces are mapped using the following base registers: |
62 | * | 62 | * |
63 | * Usage Local Bus Memory Base/Map registers used | 63 | * Usage Local Bus Memory Base/Map registers used |
64 | * | 64 | * |
65 | * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0 | 65 | * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0 |
66 | * Mem 50000000 - 5FFFFFFF LB_BASE1/LB_MAP1 | 66 | * Mem 50000000 - 5FFFFFFF LB_BASE1/LB_MAP1 |
67 | * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2 | 67 | * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2 |
68 | * Cfg 61000000 - 61FFFFFF | 68 | * Cfg 61000000 - 61FFFFFF |
69 | * | 69 | * |
70 | * This means that I20 and PCI configuration space accesses will fail. | 70 | * This means that I20 and PCI configuration space accesses will fail. |
71 | * When PCI configuration accesses are needed (via the uHAL PCI | 71 | * When PCI configuration accesses are needed (via the uHAL PCI |
72 | * configuration space primitives) we must remap the spaces as follows: | 72 | * configuration space primitives) we must remap the spaces as follows: |
73 | * | 73 | * |
74 | * Usage Local Bus Memory Base/Map registers used | 74 | * Usage Local Bus Memory Base/Map registers used |
75 | * | 75 | * |
76 | * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0 | 76 | * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0 |
77 | * Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0 | 77 | * Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0 |
78 | * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2 | 78 | * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2 |
79 | * Cfg 61000000 - 61FFFFFF LB_BASE1/LB_MAP1 | 79 | * Cfg 61000000 - 61FFFFFF LB_BASE1/LB_MAP1 |
80 | * | 80 | * |
81 | * To make this work, the code depends on overlapping windows working. | 81 | * To make this work, the code depends on overlapping windows working. |
82 | * The V3 chip translates an address by checking its range within | 82 | * The V3 chip translates an address by checking its range within |
83 | * each of the BASE/MAP pairs in turn (in ascending register number | 83 | * each of the BASE/MAP pairs in turn (in ascending register number |
84 | * order). It will use the first matching pair. So, for example, | 84 | * order). It will use the first matching pair. So, for example, |
85 | * if the same address is mapped by both LB_BASE0/LB_MAP0 and | 85 | * if the same address is mapped by both LB_BASE0/LB_MAP0 and |
86 | * LB_BASE1/LB_MAP1, the V3 will use the translation from | 86 | * LB_BASE1/LB_MAP1, the V3 will use the translation from |
87 | * LB_BASE0/LB_MAP0. | 87 | * LB_BASE0/LB_MAP0. |
88 | * | 88 | * |
89 | * To allow PCI Configuration space access, the code enlarges the | 89 | * To allow PCI Configuration space access, the code enlarges the |
90 | * window mapped by LB_BASE0/LB_MAP0 from 256M to 512M. This occludes | 90 | * window mapped by LB_BASE0/LB_MAP0 from 256M to 512M. This occludes |
91 | * the windows currently mapped by LB_BASE1/LB_MAP1 so that it can | 91 | * the windows currently mapped by LB_BASE1/LB_MAP1 so that it can |
92 | * be remapped for use by configuration cycles. | 92 | * be remapped for use by configuration cycles. |
93 | * | 93 | * |
94 | * At the end of the PCI Configuration space accesses, | 94 | * At the end of the PCI Configuration space accesses, |
95 | * LB_BASE1/LB_MAP1 is reset to map PCI Memory. Finally the window | 95 | * LB_BASE1/LB_MAP1 is reset to map PCI Memory. Finally the window |
96 | * mapped by LB_BASE0/LB_MAP0 is reduced in size from 512M to 256M to | 96 | * mapped by LB_BASE0/LB_MAP0 is reduced in size from 512M to 256M to |
97 | * reveal the now restored LB_BASE1/LB_MAP1 window. | 97 | * reveal the now restored LB_BASE1/LB_MAP1 window. |
98 | * | 98 | * |
99 | * NOTE: We do not set up I2O mapping. I suspect that this is only | 99 | * NOTE: We do not set up I2O mapping. I suspect that this is only |
100 | * for an intelligent (target) device. Using I2O disables most of | 100 | * for an intelligent (target) device. Using I2O disables most of |
101 | * the mappings into PCI memory. | 101 | * the mappings into PCI memory. |
@@ -127,8 +127,8 @@ | |||
127 | * | 127 | * |
128 | * returns: configuration address to play on the PCI bus | 128 | * returns: configuration address to play on the PCI bus |
129 | * | 129 | * |
130 | * To generate the appropriate PCI configuration cycles in the PCI | 130 | * To generate the appropriate PCI configuration cycles in the PCI |
131 | * configuration address space, you present the V3 with the following pattern | 131 | * configuration address space, you present the V3 with the following pattern |
132 | * (which is very nearly a type 1 (except that the lower two bits are 00 and | 132 | * (which is very nearly a type 1 (except that the lower two bits are 00 and |
133 | * not 01). In order for this mapping to work you need to set up one of | 133 | * not 01). In order for this mapping to work you need to set up one of |
134 | * the local to PCI aperatures to 16Mbytes in length translating to | 134 | * the local to PCI aperatures to 16Mbytes in length translating to |
@@ -138,7 +138,7 @@ | |||
138 | * | 138 | * |
139 | * Type 0: | 139 | * Type 0: |
140 | * | 140 | * |
141 | * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 | 141 | * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 |
142 | * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0 | 142 | * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0 |
143 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 143 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
144 | * | | |D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|0| | 144 | * | | |D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|0| |
@@ -150,7 +150,7 @@ | |||
150 | * | 150 | * |
151 | * Type 1: | 151 | * Type 1: |
152 | * | 152 | * |
153 | * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 | 153 | * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1 |
154 | * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0 | 154 | * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0 |
155 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 155 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
156 | * | | | | | | | | | | |B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|1| | 156 | * | | | | | | | | | | |B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|1| |
@@ -161,7 +161,7 @@ | |||
161 | * 15:11 Device number (5 bits) | 161 | * 15:11 Device number (5 bits) |
162 | * 10:8 function number | 162 | * 10:8 function number |
163 | * 7:2 register number | 163 | * 7:2 register number |
164 | * | 164 | * |
165 | */ | 165 | */ |
166 | static DEFINE_RAW_SPINLOCK(v3_lock); | 166 | static DEFINE_RAW_SPINLOCK(v3_lock); |
167 | 167 | ||
@@ -181,7 +181,7 @@ static DEFINE_RAW_SPINLOCK(v3_lock); | |||
181 | #undef V3_LB_BASE_PREFETCH | 181 | #undef V3_LB_BASE_PREFETCH |
182 | #define V3_LB_BASE_PREFETCH 0 | 182 | #define V3_LB_BASE_PREFETCH 0 |
183 | 183 | ||
184 | static unsigned long v3_open_config_window(struct pci_bus *bus, | 184 | static void __iomem *v3_open_config_window(struct pci_bus *bus, |
185 | unsigned int devfn, int offset) | 185 | unsigned int devfn, int offset) |
186 | { | 186 | { |
187 | unsigned int address, mapaddress, busnr; | 187 | unsigned int address, mapaddress, busnr; |
@@ -280,7 +280,7 @@ static void v3_close_config_window(void) | |||
280 | static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where, | 280 | static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where, |
281 | int size, u32 *val) | 281 | int size, u32 *val) |
282 | { | 282 | { |
283 | unsigned long addr; | 283 | void __iomem *addr; |
284 | unsigned long flags; | 284 | unsigned long flags; |
285 | u32 v; | 285 | u32 v; |
286 | 286 | ||
@@ -311,7 +311,7 @@ static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where, | |||
311 | static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where, | 311 | static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where, |
312 | int size, u32 val) | 312 | int size, u32 val) |
313 | { | 313 | { |
314 | unsigned long addr; | 314 | void __iomem *addr; |
315 | unsigned long flags; | 315 | unsigned long flags; |
316 | 316 | ||
317 | raw_spin_lock_irqsave(&v3_lock, flags); | 317 | raw_spin_lock_irqsave(&v3_lock, flags); |
@@ -374,12 +374,9 @@ static int __init pci_v3_setup_resources(struct pci_sys_data *sys) | |||
374 | } | 374 | } |
375 | 375 | ||
376 | /* | 376 | /* |
377 | * the IO resource for this bus | ||
378 | * the mem resource for this bus | 377 | * the mem resource for this bus |
379 | * the prefetch mem resource for this bus | 378 | * the prefetch mem resource for this bus |
380 | */ | 379 | */ |
381 | pci_add_resource_offset(&sys->resources, | ||
382 | &ioport_resource, sys->io_offset); | ||
383 | pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset); | 380 | pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset); |
384 | pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset); | 381 | pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset); |
385 | 382 | ||
@@ -391,9 +388,9 @@ static int __init pci_v3_setup_resources(struct pci_sys_data *sys) | |||
391 | * means I can't get additional information on the reason for the pm2fb | 388 | * means I can't get additional information on the reason for the pm2fb |
392 | * problems. I suppose I'll just have to mind-meld with the machine. ;) | 389 | * problems. I suppose I'll just have to mind-meld with the machine. ;) |
393 | */ | 390 | */ |
394 | #define SC_PCI IO_ADDRESS(INTEGRATOR_SC_PCIENABLE) | 391 | #define SC_PCI __io_address(INTEGRATOR_SC_PCIENABLE) |
395 | #define SC_LBFADDR IO_ADDRESS(INTEGRATOR_SC_BASE + 0x20) | 392 | #define SC_LBFADDR __io_address(INTEGRATOR_SC_BASE + 0x20) |
396 | #define SC_LBFCODE IO_ADDRESS(INTEGRATOR_SC_BASE + 0x24) | 393 | #define SC_LBFCODE __io_address(INTEGRATOR_SC_BASE + 0x24) |
397 | 394 | ||
398 | static int | 395 | static int |
399 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | 396 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) |
@@ -498,7 +495,6 @@ void __init pci_v3_preinit(void) | |||
498 | unsigned int temp; | 495 | unsigned int temp; |
499 | int ret; | 496 | int ret; |
500 | 497 | ||
501 | pcibios_min_io = 0x6000; | ||
502 | pcibios_min_mem = 0x00100000; | 498 | pcibios_min_mem = 0x00100000; |
503 | 499 | ||
504 | /* | 500 | /* |
diff --git a/arch/arm/mach-iop13xx/include/mach/io.h b/arch/arm/mach-iop13xx/include/mach/io.h deleted file mode 100644 index f13188518025..000000000000 --- a/arch/arm/mach-iop13xx/include/mach/io.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | /* | ||
2 | * iop13xx custom ioremap implementation | ||
3 | * Copyright (c) 2005-2006, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
16 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
17 | * | ||
18 | */ | ||
19 | #ifndef __ASM_ARM_ARCH_IO_H | ||
20 | #define __ASM_ARM_ARCH_IO_H | ||
21 | |||
22 | #define IO_SPACE_LIMIT 0xffffffff | ||
23 | |||
24 | #define __io(a) __iop13xx_io(a) | ||
25 | |||
26 | extern void __iomem * __iop13xx_io(unsigned long io_addr); | ||
27 | |||
28 | #endif | ||
diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h index e190dcd7d72d..7480f58267aa 100644 --- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h +++ b/arch/arm/mach-iop13xx/include/mach/iop13xx.h | |||
@@ -69,21 +69,11 @@ extern unsigned long get_iop_tick_rate(void); | |||
69 | * 0x8000.0000 + 928M 0x2.8000.0000 (ioremap) PCIE outbound memory window | 69 | * 0x8000.0000 + 928M 0x2.8000.0000 (ioremap) PCIE outbound memory window |
70 | * | 70 | * |
71 | * IO MAP | 71 | * IO MAP |
72 | * 0x1000 + 64K 0x0.fffb.1000 0xfec6.1000 PCIX outbound i/o window | 72 | * 0x00000 + 64K 0x0.fffb.0000 0xfee0.0000 PCIX outbound i/o window |
73 | * 0x1000 + 64K 0x0.fffd.1000 0xfed7.1000 PCIE outbound i/o window | 73 | * 0x10000 + 64K 0x0.fffd.0000 0xfee1.0000 PCIE outbound i/o window |
74 | */ | 74 | */ |
75 | #define IOP13XX_PCIX_IO_WINDOW_SIZE 0x10000UL | ||
76 | #define IOP13XX_PCIX_LOWER_IO_PA 0xfffb0000UL | 75 | #define IOP13XX_PCIX_LOWER_IO_PA 0xfffb0000UL |
77 | #define IOP13XX_PCIX_LOWER_IO_VA 0xfec60000UL | ||
78 | #define IOP13XX_PCIX_LOWER_IO_BA 0x0UL /* OIOTVR */ | 76 | #define IOP13XX_PCIX_LOWER_IO_BA 0x0UL /* OIOTVR */ |
79 | #define IOP13XX_PCIX_IO_BUS_OFFSET 0x1000UL | ||
80 | #define IOP13XX_PCIX_UPPER_IO_PA (IOP13XX_PCIX_LOWER_IO_PA +\ | ||
81 | IOP13XX_PCIX_IO_WINDOW_SIZE - 1) | ||
82 | #define IOP13XX_PCIX_UPPER_IO_VA (IOP13XX_PCIX_LOWER_IO_VA +\ | ||
83 | IOP13XX_PCIX_IO_WINDOW_SIZE - 1) | ||
84 | #define IOP13XX_PCIX_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ | ||
85 | (IOP13XX_PCIX_LOWER_IO_PA\ | ||
86 | - IOP13XX_PCIX_LOWER_IO_VA)) | ||
87 | 77 | ||
88 | #define IOP13XX_PCIX_MEM_PHYS_OFFSET 0x100000000ULL | 78 | #define IOP13XX_PCIX_MEM_PHYS_OFFSET 0x100000000ULL |
89 | #define IOP13XX_PCIX_MEM_WINDOW_SIZE 0x3a000000UL | 79 | #define IOP13XX_PCIX_MEM_WINDOW_SIZE 0x3a000000UL |
@@ -103,20 +93,8 @@ extern unsigned long get_iop_tick_rate(void); | |||
103 | IOP13XX_PCIX_LOWER_MEM_BA) | 93 | IOP13XX_PCIX_LOWER_MEM_BA) |
104 | 94 | ||
105 | /* PCI-E ranges */ | 95 | /* PCI-E ranges */ |
106 | #define IOP13XX_PCIE_IO_WINDOW_SIZE 0x10000UL | ||
107 | #define IOP13XX_PCIE_LOWER_IO_PA 0xfffd0000UL | 96 | #define IOP13XX_PCIE_LOWER_IO_PA 0xfffd0000UL |
108 | #define IOP13XX_PCIE_LOWER_IO_VA 0xfed70000UL | 97 | #define IOP13XX_PCIE_LOWER_IO_BA 0x10000UL /* OIOTVR */ |
109 | #define IOP13XX_PCIE_LOWER_IO_BA 0x0UL /* OIOTVR */ | ||
110 | #define IOP13XX_PCIE_IO_BUS_OFFSET 0x1000UL | ||
111 | #define IOP13XX_PCIE_UPPER_IO_PA (IOP13XX_PCIE_LOWER_IO_PA +\ | ||
112 | IOP13XX_PCIE_IO_WINDOW_SIZE - 1) | ||
113 | #define IOP13XX_PCIE_UPPER_IO_VA (IOP13XX_PCIE_LOWER_IO_VA +\ | ||
114 | IOP13XX_PCIE_IO_WINDOW_SIZE - 1) | ||
115 | #define IOP13XX_PCIE_UPPER_IO_BA (IOP13XX_PCIE_LOWER_IO_BA +\ | ||
116 | IOP13XX_PCIE_IO_WINDOW_SIZE - 1) | ||
117 | #define IOP13XX_PCIE_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ | ||
118 | (IOP13XX_PCIE_LOWER_IO_PA\ | ||
119 | - IOP13XX_PCIE_LOWER_IO_VA)) | ||
120 | 98 | ||
121 | #define IOP13XX_PCIE_MEM_PHYS_OFFSET 0x200000000ULL | 99 | #define IOP13XX_PCIE_MEM_PHYS_OFFSET 0x200000000ULL |
122 | #define IOP13XX_PCIE_MEM_WINDOW_SIZE 0x3a000000UL | 100 | #define IOP13XX_PCIE_MEM_WINDOW_SIZE 0x3a000000UL |
@@ -148,18 +126,16 @@ extern unsigned long get_iop_tick_rate(void); | |||
148 | * IOP13XX chipset registers | 126 | * IOP13XX chipset registers |
149 | */ | 127 | */ |
150 | #define IOP13XX_PMMR_PHYS_MEM_BASE 0xffd80000UL /* PMMR phys. address */ | 128 | #define IOP13XX_PMMR_PHYS_MEM_BASE 0xffd80000UL /* PMMR phys. address */ |
151 | #define IOP13XX_PMMR_VIRT_MEM_BASE 0xfee80000UL /* PMMR phys. address */ | 129 | #define IOP13XX_PMMR_VIRT_MEM_BASE (void __iomem *)(0xfee80000UL) /* PMMR phys. address */ |
152 | #define IOP13XX_PMMR_MEM_WINDOW_SIZE 0x80000 | 130 | #define IOP13XX_PMMR_MEM_WINDOW_SIZE 0x80000 |
153 | #define IOP13XX_PMMR_UPPER_MEM_VA (IOP13XX_PMMR_VIRT_MEM_BASE +\ | 131 | #define IOP13XX_PMMR_UPPER_MEM_VA (IOP13XX_PMMR_VIRT_MEM_BASE +\ |
154 | IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) | 132 | IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) |
155 | #define IOP13XX_PMMR_UPPER_MEM_PA (IOP13XX_PMMR_PHYS_MEM_BASE +\ | 133 | #define IOP13XX_PMMR_UPPER_MEM_PA (IOP13XX_PMMR_PHYS_MEM_BASE +\ |
156 | IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) | 134 | IOP13XX_PMMR_MEM_WINDOW_SIZE - 1) |
157 | #define IOP13XX_PMMR_VIRT_TO_PHYS(addr) (u32) ((u32) addr +\ | 135 | #define IOP13XX_PMMR_VIRT_TO_PHYS(addr) (((addr) - IOP13XX_PMMR_VIRT_MEM_BASE)\ |
158 | (IOP13XX_PMMR_PHYS_MEM_BASE\ | 136 | + IOP13XX_PMMR_PHYS_MEM_BASE) |
159 | - IOP13XX_PMMR_VIRT_MEM_BASE)) | 137 | #define IOP13XX_PMMR_PHYS_TO_VIRT(addr) (((addr) - IOP13XX_PMMR_PHYS_MEM_BASE)\ |
160 | #define IOP13XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ | 138 | + IOP13XX_PMMR_VIRT_MEM_BASE) |
161 | (IOP13XX_PMMR_PHYS_MEM_BASE\ | ||
162 | - IOP13XX_PMMR_VIRT_MEM_BASE)) | ||
163 | #define IOP13XX_REG_ADDR32(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) | 139 | #define IOP13XX_REG_ADDR32(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) |
164 | #define IOP13XX_REG_ADDR16(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) | 140 | #define IOP13XX_REG_ADDR16(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) |
165 | #define IOP13XX_REG_ADDR8(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) | 141 | #define IOP13XX_REG_ADDR8(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg)) |
@@ -169,10 +145,10 @@ extern unsigned long get_iop_tick_rate(void); | |||
169 | #define IOP13XX_PMMR_SIZE 0x00080000 | 145 | #define IOP13XX_PMMR_SIZE 0x00080000 |
170 | 146 | ||
171 | /*=================== Defines for Platform Devices =====================*/ | 147 | /*=================== Defines for Platform Devices =====================*/ |
172 | #define IOP13XX_UART0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002300) | 148 | #define IOP13XX_UART0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE + 0x00002300) |
173 | #define IOP13XX_UART1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002340) | 149 | #define IOP13XX_UART1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE + 0x00002340) |
174 | #define IOP13XX_UART0_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002300) | 150 | #define IOP13XX_UART0_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x00002300) |
175 | #define IOP13XX_UART1_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002340) | 151 | #define IOP13XX_UART1_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x00002340) |
176 | 152 | ||
177 | #define IOP13XX_I2C0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002500) | 153 | #define IOP13XX_I2C0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002500) |
178 | #define IOP13XX_I2C1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002520) | 154 | #define IOP13XX_I2C1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002520) |
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h index 1afa99ef97fa..7c032d0ab24a 100644 --- a/arch/arm/mach-iop13xx/include/mach/memory.h +++ b/arch/arm/mach-iop13xx/include/mach/memory.h | |||
@@ -16,12 +16,12 @@ | |||
16 | #define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE) | 16 | #define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE) |
17 | #define IOP13XX_PMMR_P_END (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE) | 17 | #define IOP13XX_PMMR_P_END (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE) |
18 | 18 | ||
19 | static inline dma_addr_t __virt_to_lbus(unsigned long x) | 19 | static inline dma_addr_t __virt_to_lbus(void __iomem *x) |
20 | { | 20 | { |
21 | return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE; | 21 | return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE; |
22 | } | 22 | } |
23 | 23 | ||
24 | static inline unsigned long __lbus_to_virt(dma_addr_t x) | 24 | static inline void __iomem *__lbus_to_virt(dma_addr_t x) |
25 | { | 25 | { |
26 | return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE; | 26 | return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE; |
27 | } | 27 | } |
@@ -38,23 +38,23 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x) | |||
38 | 38 | ||
39 | #define __arch_dma_to_virt(dev, addr) \ | 39 | #define __arch_dma_to_virt(dev, addr) \ |
40 | ({ \ | 40 | ({ \ |
41 | unsigned long __virt; \ | 41 | void * __virt; \ |
42 | dma_addr_t __dma = addr; \ | 42 | dma_addr_t __dma = addr; \ |
43 | if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \ | 43 | if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \ |
44 | __virt = __lbus_to_virt(__dma); \ | 44 | __virt = __lbus_to_virt(__dma); \ |
45 | else \ | 45 | else \ |
46 | __virt = __phys_to_virt(__dma); \ | 46 | __virt = (void *)__phys_to_virt(__dma); \ |
47 | (void *)__virt; \ | 47 | __virt; \ |
48 | }) | 48 | }) |
49 | 49 | ||
50 | #define __arch_virt_to_dma(dev, addr) \ | 50 | #define __arch_virt_to_dma(dev, addr) \ |
51 | ({ \ | 51 | ({ \ |
52 | unsigned long __virt = (unsigned long)addr; \ | 52 | void * __virt = addr; \ |
53 | dma_addr_t __dma; \ | 53 | dma_addr_t __dma; \ |
54 | if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \ | 54 | if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \ |
55 | __dma = __virt_to_lbus(__virt); \ | 55 | __dma = __virt_to_lbus(__virt); \ |
56 | else \ | 56 | else \ |
57 | __dma = __virt_to_phys(__virt); \ | 57 | __dma = __virt_to_phys((unsigned long)__virt); \ |
58 | __dma; \ | 58 | __dma; \ |
59 | }) | 59 | }) |
60 | 60 | ||
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c index 3c364198db9c..183dc8b5511b 100644 --- a/arch/arm/mach-iop13xx/io.c +++ b/arch/arm/mach-iop13xx/io.c | |||
@@ -23,25 +23,6 @@ | |||
23 | 23 | ||
24 | #include "pci.h" | 24 | #include "pci.h" |
25 | 25 | ||
26 | void * __iomem __iop13xx_io(unsigned long io_addr) | ||
27 | { | ||
28 | void __iomem * io_virt; | ||
29 | |||
30 | switch (io_addr) { | ||
31 | case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA: | ||
32 | io_virt = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(io_addr); | ||
33 | break; | ||
34 | case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA: | ||
35 | io_virt = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(io_addr); | ||
36 | break; | ||
37 | default: | ||
38 | BUG(); | ||
39 | } | ||
40 | |||
41 | return io_virt; | ||
42 | } | ||
43 | EXPORT_SYMBOL(__iop13xx_io); | ||
44 | |||
45 | static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie, | 26 | static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie, |
46 | size_t size, unsigned int mtype, void *caller) | 27 | size_t size, unsigned int mtype, void *caller) |
47 | { | 28 | { |
@@ -52,14 +33,14 @@ static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie, | |||
52 | if (unlikely(!iop13xx_atux_mem_base)) | 33 | if (unlikely(!iop13xx_atux_mem_base)) |
53 | retval = NULL; | 34 | retval = NULL; |
54 | else | 35 | else |
55 | retval = (void *)(iop13xx_atux_mem_base + | 36 | retval = (iop13xx_atux_mem_base + |
56 | (cookie - IOP13XX_PCIX_LOWER_MEM_RA)); | 37 | (cookie - IOP13XX_PCIX_LOWER_MEM_RA)); |
57 | break; | 38 | break; |
58 | case IOP13XX_PCIE_LOWER_MEM_RA ... IOP13XX_PCIE_UPPER_MEM_RA: | 39 | case IOP13XX_PCIE_LOWER_MEM_RA ... IOP13XX_PCIE_UPPER_MEM_RA: |
59 | if (unlikely(!iop13xx_atue_mem_base)) | 40 | if (unlikely(!iop13xx_atue_mem_base)) |
60 | retval = NULL; | 41 | retval = NULL; |
61 | else | 42 | else |
62 | retval = (void *)(iop13xx_atue_mem_base + | 43 | retval = (iop13xx_atue_mem_base + |
63 | (cookie - IOP13XX_PCIE_LOWER_MEM_RA)); | 44 | (cookie - IOP13XX_PCIE_LOWER_MEM_RA)); |
64 | break; | 45 | break; |
65 | case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA: | 46 | case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA: |
@@ -67,14 +48,8 @@ static void __iomem *__iop13xx_ioremap_caller(unsigned long cookie, | |||
67 | (cookie - IOP13XX_PBI_LOWER_MEM_RA), | 48 | (cookie - IOP13XX_PBI_LOWER_MEM_RA), |
68 | size, mtype, __builtin_return_address(0)); | 49 | size, mtype, __builtin_return_address(0)); |
69 | break; | 50 | break; |
70 | case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA: | ||
71 | retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie); | ||
72 | break; | ||
73 | case IOP13XX_PCIX_LOWER_IO_PA ... IOP13XX_PCIX_UPPER_IO_PA: | ||
74 | retval = (void *) IOP13XX_PCIX_IO_PHYS_TO_VIRT(cookie); | ||
75 | break; | ||
76 | case IOP13XX_PMMR_PHYS_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_PA: | 51 | case IOP13XX_PMMR_PHYS_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_PA: |
77 | retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie); | 52 | retval = IOP13XX_PMMR_PHYS_TO_VIRT(cookie); |
78 | break; | 53 | break; |
79 | default: | 54 | default: |
80 | retval = __arm_ioremap_caller(cookie, size, mtype, | 55 | retval = __arm_ioremap_caller(cookie, size, mtype, |
@@ -99,9 +74,7 @@ static void __iop13xx_iounmap(volatile void __iomem *addr) | |||
99 | goto skip; | 74 | goto skip; |
100 | 75 | ||
101 | switch ((u32) addr) { | 76 | switch ((u32) addr) { |
102 | case IOP13XX_PCIE_LOWER_IO_VA ... IOP13XX_PCIE_UPPER_IO_VA: | 77 | case (u32)IOP13XX_PMMR_VIRT_MEM_BASE ... (u32)IOP13XX_PMMR_UPPER_MEM_VA: |
103 | case IOP13XX_PCIX_LOWER_IO_VA ... IOP13XX_PCIX_UPPER_IO_VA: | ||
104 | case IOP13XX_PMMR_VIRT_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_VA: | ||
105 | goto skip; | 78 | goto skip; |
106 | } | 79 | } |
107 | __iounmap(addr); | 80 | __iounmap(addr); |
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c index 861cb12ef436..9082b84aeebb 100644 --- a/arch/arm/mach-iop13xx/pci.c +++ b/arch/arm/mach-iop13xx/pci.c | |||
@@ -36,8 +36,8 @@ u32 iop13xx_atux_pmmr_offset; /* This offset can change based on strapping */ | |||
36 | u32 iop13xx_atue_pmmr_offset; /* This offset can change based on strapping */ | 36 | u32 iop13xx_atue_pmmr_offset; /* This offset can change based on strapping */ |
37 | static struct pci_bus *pci_bus_atux = 0; | 37 | static struct pci_bus *pci_bus_atux = 0; |
38 | static struct pci_bus *pci_bus_atue = 0; | 38 | static struct pci_bus *pci_bus_atue = 0; |
39 | u32 iop13xx_atue_mem_base; | 39 | void __iomem *iop13xx_atue_mem_base; |
40 | u32 iop13xx_atux_mem_base; | 40 | void __iomem *iop13xx_atux_mem_base; |
41 | size_t iop13xx_atue_mem_size; | 41 | size_t iop13xx_atue_mem_size; |
42 | size_t iop13xx_atux_mem_size; | 42 | size_t iop13xx_atux_mem_size; |
43 | 43 | ||
@@ -88,8 +88,7 @@ void iop13xx_map_pci_memory(void) | |||
88 | } | 88 | } |
89 | 89 | ||
90 | if (end) { | 90 | if (end) { |
91 | iop13xx_atux_mem_base = | 91 | iop13xx_atux_mem_base = __arm_ioremap_pfn( |
92 | (u32) __arm_ioremap_pfn( | ||
93 | __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA) | 92 | __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA) |
94 | , 0, iop13xx_atux_mem_size, MT_DEVICE); | 93 | , 0, iop13xx_atux_mem_size, MT_DEVICE); |
95 | if (!iop13xx_atux_mem_base) { | 94 | if (!iop13xx_atux_mem_base) { |
@@ -99,7 +98,7 @@ void iop13xx_map_pci_memory(void) | |||
99 | } | 98 | } |
100 | } else | 99 | } else |
101 | iop13xx_atux_mem_size = 0; | 100 | iop13xx_atux_mem_size = 0; |
102 | PRINTK("%s: atu: %d bus_size: %d mem_base: %x\n", | 101 | PRINTK("%s: atu: %d bus_size: %d mem_base: %p\n", |
103 | __func__, atu, iop13xx_atux_mem_size, | 102 | __func__, atu, iop13xx_atux_mem_size, |
104 | iop13xx_atux_mem_base); | 103 | iop13xx_atux_mem_base); |
105 | break; | 104 | break; |
@@ -114,8 +113,7 @@ void iop13xx_map_pci_memory(void) | |||
114 | } | 113 | } |
115 | 114 | ||
116 | if (end) { | 115 | if (end) { |
117 | iop13xx_atue_mem_base = | 116 | iop13xx_atue_mem_base = __arm_ioremap_pfn( |
118 | (u32) __arm_ioremap_pfn( | ||
119 | __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA) | 117 | __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA) |
120 | , 0, iop13xx_atue_mem_size, MT_DEVICE); | 118 | , 0, iop13xx_atue_mem_size, MT_DEVICE); |
121 | if (!iop13xx_atue_mem_base) { | 119 | if (!iop13xx_atue_mem_base) { |
@@ -125,13 +123,13 @@ void iop13xx_map_pci_memory(void) | |||
125 | } | 123 | } |
126 | } else | 124 | } else |
127 | iop13xx_atue_mem_size = 0; | 125 | iop13xx_atue_mem_size = 0; |
128 | PRINTK("%s: atu: %d bus_size: %d mem_base: %x\n", | 126 | PRINTK("%s: atu: %d bus_size: %d mem_base: %p\n", |
129 | __func__, atu, iop13xx_atue_mem_size, | 127 | __func__, atu, iop13xx_atue_mem_size, |
130 | iop13xx_atue_mem_base); | 128 | iop13xx_atue_mem_base); |
131 | break; | 129 | break; |
132 | } | 130 | } |
133 | 131 | ||
134 | printk("%s: Initialized (%uM @ resource/virtual: %08lx/%08x)\n", | 132 | printk("%s: Initialized (%uM @ resource/virtual: %08lx/%p)\n", |
135 | atu ? "ATUE" : "ATUX", | 133 | atu ? "ATUE" : "ATUX", |
136 | (atu ? iop13xx_atue_mem_size : iop13xx_atux_mem_size) / | 134 | (atu ? iop13xx_atue_mem_size : iop13xx_atux_mem_size) / |
137 | SZ_1M, | 135 | SZ_1M, |
@@ -970,7 +968,6 @@ void __init iop13xx_pci_init(void) | |||
970 | __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3, IOP13XX_XBG_BECSR); | 968 | __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3, IOP13XX_XBG_BECSR); |
971 | 969 | ||
972 | /* Setup the Min Address for PCI memory... */ | 970 | /* Setup the Min Address for PCI memory... */ |
973 | pcibios_min_io = 0; | ||
974 | pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA; | 971 | pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA; |
975 | 972 | ||
976 | /* if Linux is given control of an ATU | 973 | /* if Linux is given control of an ATU |
@@ -1003,7 +1000,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) | |||
1003 | if (nr > 1) | 1000 | if (nr > 1) |
1004 | return 0; | 1001 | return 0; |
1005 | 1002 | ||
1006 | res = kcalloc(2, sizeof(struct resource), GFP_KERNEL); | 1003 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); |
1007 | if (!res) | 1004 | if (!res) |
1008 | panic("PCI: unable to alloc resources"); | 1005 | panic("PCI: unable to alloc resources"); |
1009 | 1006 | ||
@@ -1042,17 +1039,13 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) | |||
1042 | << IOP13XX_ATUX_PCIXSR_FUNC_NUM; | 1039 | << IOP13XX_ATUX_PCIXSR_FUNC_NUM; |
1043 | __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR); | 1040 | __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR); |
1044 | 1041 | ||
1045 | res[0].start = IOP13XX_PCIX_LOWER_IO_PA + IOP13XX_PCIX_IO_BUS_OFFSET; | 1042 | pci_ioremap_io(0, IOP13XX_PCIX_LOWER_IO_PA); |
1046 | res[0].end = IOP13XX_PCIX_UPPER_IO_PA; | ||
1047 | res[0].name = "IQ81340 ATUX PCI I/O Space"; | ||
1048 | res[0].flags = IORESOURCE_IO; | ||
1049 | 1043 | ||
1050 | res[1].start = IOP13XX_PCIX_LOWER_MEM_RA; | 1044 | res->start = IOP13XX_PCIX_LOWER_MEM_RA; |
1051 | res[1].end = IOP13XX_PCIX_UPPER_MEM_RA; | 1045 | res->end = IOP13XX_PCIX_UPPER_MEM_RA; |
1052 | res[1].name = "IQ81340 ATUX PCI Memory Space"; | 1046 | res->name = "IQ81340 ATUX PCI Memory Space"; |
1053 | res[1].flags = IORESOURCE_MEM; | 1047 | res->flags = IORESOURCE_MEM; |
1054 | sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET; | 1048 | sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET; |
1055 | sys->io_offset = IOP13XX_PCIX_LOWER_IO_PA; | ||
1056 | break; | 1049 | break; |
1057 | case IOP13XX_INIT_ATU_ATUE: | 1050 | case IOP13XX_INIT_ATU_ATUE: |
1058 | /* Note: the function number field in the PCSR is ro */ | 1051 | /* Note: the function number field in the PCSR is ro */ |
@@ -1063,17 +1056,13 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) | |||
1063 | 1056 | ||
1064 | __raw_writel(pcsr, IOP13XX_ATUE_PCSR); | 1057 | __raw_writel(pcsr, IOP13XX_ATUE_PCSR); |
1065 | 1058 | ||
1066 | res[0].start = IOP13XX_PCIE_LOWER_IO_PA + IOP13XX_PCIE_IO_BUS_OFFSET; | 1059 | pci_ioremap_io(SZ_64K, IOP13XX_PCIE_LOWER_IO_PA); |
1067 | res[0].end = IOP13XX_PCIE_UPPER_IO_PA; | ||
1068 | res[0].name = "IQ81340 ATUE PCI I/O Space"; | ||
1069 | res[0].flags = IORESOURCE_IO; | ||
1070 | 1060 | ||
1071 | res[1].start = IOP13XX_PCIE_LOWER_MEM_RA; | 1061 | res->start = IOP13XX_PCIE_LOWER_MEM_RA; |
1072 | res[1].end = IOP13XX_PCIE_UPPER_MEM_RA; | 1062 | res->end = IOP13XX_PCIE_UPPER_MEM_RA; |
1073 | res[1].name = "IQ81340 ATUE PCI Memory Space"; | 1063 | res->name = "IQ81340 ATUE PCI Memory Space"; |
1074 | res[1].flags = IORESOURCE_MEM; | 1064 | res->flags = IORESOURCE_MEM; |
1075 | sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET; | 1065 | sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET; |
1076 | sys->io_offset = IOP13XX_PCIE_LOWER_IO_PA; | ||
1077 | sys->map_irq = iop13xx_pcie_map_irq; | 1066 | sys->map_irq = iop13xx_pcie_map_irq; |
1078 | break; | 1067 | break; |
1079 | default: | 1068 | default: |
@@ -1081,11 +1070,9 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys) | |||
1081 | return 0; | 1070 | return 0; |
1082 | } | 1071 | } |
1083 | 1072 | ||
1084 | request_resource(&ioport_resource, &res[0]); | 1073 | request_resource(&iomem_resource, res); |
1085 | request_resource(&iomem_resource, &res[1]); | ||
1086 | 1074 | ||
1087 | pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); | 1075 | pci_add_resource_offset(&sys->resources, res, sys->mem_offset); |
1088 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); | ||
1089 | 1076 | ||
1090 | return 1; | 1077 | return 1; |
1091 | } | 1078 | } |
diff --git a/arch/arm/mach-iop13xx/pci.h b/arch/arm/mach-iop13xx/pci.h index c70cf5b41e31..d45a80b3080e 100644 --- a/arch/arm/mach-iop13xx/pci.h +++ b/arch/arm/mach-iop13xx/pci.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #include <linux/types.h> | 1 | #include <linux/types.h> |
2 | 2 | ||
3 | extern u32 iop13xx_atue_mem_base; | 3 | extern void __iomem *iop13xx_atue_mem_base; |
4 | extern u32 iop13xx_atux_mem_base; | 4 | extern void __iomem *iop13xx_atux_mem_base; |
5 | extern size_t iop13xx_atue_mem_size; | 5 | extern size_t iop13xx_atue_mem_size; |
6 | extern size_t iop13xx_atux_mem_size; | 6 | extern size_t iop13xx_atux_mem_size; |
diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c index daabb1fa6c2c..3181f61ea63e 100644 --- a/arch/arm/mach-iop13xx/setup.c +++ b/arch/arm/mach-iop13xx/setup.c | |||
@@ -36,20 +36,10 @@ | |||
36 | */ | 36 | */ |
37 | static struct map_desc iop13xx_std_desc[] __initdata = { | 37 | static struct map_desc iop13xx_std_desc[] __initdata = { |
38 | { /* mem mapped registers */ | 38 | { /* mem mapped registers */ |
39 | .virtual = IOP13XX_PMMR_VIRT_MEM_BASE, | 39 | .virtual = (unsigned long)IOP13XX_PMMR_VIRT_MEM_BASE, |
40 | .pfn = __phys_to_pfn(IOP13XX_PMMR_PHYS_MEM_BASE), | 40 | .pfn = __phys_to_pfn(IOP13XX_PMMR_PHYS_MEM_BASE), |
41 | .length = IOP13XX_PMMR_SIZE, | 41 | .length = IOP13XX_PMMR_SIZE, |
42 | .type = MT_DEVICE, | 42 | .type = MT_DEVICE, |
43 | }, { /* PCIE IO space */ | ||
44 | .virtual = IOP13XX_PCIE_LOWER_IO_VA, | ||
45 | .pfn = __phys_to_pfn(IOP13XX_PCIE_LOWER_IO_PA), | ||
46 | .length = IOP13XX_PCIX_IO_WINDOW_SIZE, | ||
47 | .type = MT_DEVICE, | ||
48 | }, { /* PCIX IO space */ | ||
49 | .virtual = IOP13XX_PCIX_LOWER_IO_VA, | ||
50 | .pfn = __phys_to_pfn(IOP13XX_PCIX_LOWER_IO_PA), | ||
51 | .length = IOP13XX_PCIX_IO_WINDOW_SIZE, | ||
52 | .type = MT_DEVICE, | ||
53 | }, | 43 | }, |
54 | }; | 44 | }; |
55 | 45 | ||
@@ -81,8 +71,8 @@ static struct resource iop13xx_uart1_resources[] = { | |||
81 | 71 | ||
82 | static struct plat_serial8250_port iop13xx_uart0_data[] = { | 72 | static struct plat_serial8250_port iop13xx_uart0_data[] = { |
83 | { | 73 | { |
84 | .membase = (char*)(IOP13XX_UART0_VIRT), | 74 | .membase = IOP13XX_UART0_VIRT, |
85 | .mapbase = (IOP13XX_UART0_PHYS), | 75 | .mapbase = IOP13XX_UART0_PHYS, |
86 | .irq = IRQ_IOP13XX_UART0, | 76 | .irq = IRQ_IOP13XX_UART0, |
87 | .uartclk = IOP13XX_UART_XTAL, | 77 | .uartclk = IOP13XX_UART_XTAL, |
88 | .regshift = 2, | 78 | .regshift = 2, |
@@ -94,8 +84,8 @@ static struct plat_serial8250_port iop13xx_uart0_data[] = { | |||
94 | 84 | ||
95 | static struct plat_serial8250_port iop13xx_uart1_data[] = { | 85 | static struct plat_serial8250_port iop13xx_uart1_data[] = { |
96 | { | 86 | { |
97 | .membase = (char*)(IOP13XX_UART1_VIRT), | 87 | .membase = IOP13XX_UART1_VIRT, |
98 | .mapbase = (IOP13XX_UART1_PHYS), | 88 | .mapbase = IOP13XX_UART1_PHYS, |
99 | .irq = IRQ_IOP13XX_UART1, | 89 | .irq = IRQ_IOP13XX_UART1, |
100 | .uartclk = IOP13XX_UART_XTAL, | 90 | .uartclk = IOP13XX_UART_XTAL, |
101 | .regshift = 2, | 91 | .regshift = 2, |
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c index c15a100ba779..02e20c3912ba 100644 --- a/arch/arm/mach-iop32x/glantank.c +++ b/arch/arm/mach-iop32x/glantank.c | |||
@@ -183,7 +183,7 @@ static struct i2c_board_info __initdata glantank_i2c_devices[] = { | |||
183 | 183 | ||
184 | static void glantank_power_off(void) | 184 | static void glantank_power_off(void) |
185 | { | 185 | { |
186 | __raw_writeb(0x01, 0xfe8d0004); | 186 | __raw_writeb(0x01, IOMEM(0xfe8d0004)); |
187 | 187 | ||
188 | while (1) | 188 | while (1) |
189 | ; | 189 | ; |
diff --git a/arch/arm/mach-iop32x/include/mach/io.h b/arch/arm/mach-iop32x/include/mach/io.h deleted file mode 100644 index e2ada265bb8d..000000000000 --- a/arch/arm/mach-iop32x/include/mach/io.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-iop32x/include/mach/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/iop3xx.h> | ||
15 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | ||
17 | #define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) | ||
18 | |||
19 | #endif | ||
diff --git a/arch/arm/mach-iop33x/include/mach/io.h b/arch/arm/mach-iop33x/include/mach/io.h deleted file mode 100644 index f7c1b6595660..000000000000 --- a/arch/arm/mach-iop33x/include/mach/io.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-iop33x/include/mach/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/iop3xx.h> | ||
15 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | ||
17 | #define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p)) | ||
18 | |||
19 | #endif | ||
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index a9f80943d01f..fdf91a160884 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -53,24 +53,24 @@ static struct clock_event_device clockevent_ixp4xx; | |||
53 | *************************************************************************/ | 53 | *************************************************************************/ |
54 | static struct map_desc ixp4xx_io_desc[] __initdata = { | 54 | static struct map_desc ixp4xx_io_desc[] __initdata = { |
55 | { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACs, USB .... */ | 55 | { /* UART, Interrupt ctrl, GPIO, timers, NPEs, MACs, USB .... */ |
56 | .virtual = IXP4XX_PERIPHERAL_BASE_VIRT, | 56 | .virtual = (unsigned long)IXP4XX_PERIPHERAL_BASE_VIRT, |
57 | .pfn = __phys_to_pfn(IXP4XX_PERIPHERAL_BASE_PHYS), | 57 | .pfn = __phys_to_pfn(IXP4XX_PERIPHERAL_BASE_PHYS), |
58 | .length = IXP4XX_PERIPHERAL_REGION_SIZE, | 58 | .length = IXP4XX_PERIPHERAL_REGION_SIZE, |
59 | .type = MT_DEVICE | 59 | .type = MT_DEVICE |
60 | }, { /* Expansion Bus Config Registers */ | 60 | }, { /* Expansion Bus Config Registers */ |
61 | .virtual = IXP4XX_EXP_CFG_BASE_VIRT, | 61 | .virtual = (unsigned long)IXP4XX_EXP_CFG_BASE_VIRT, |
62 | .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS), | 62 | .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS), |
63 | .length = IXP4XX_EXP_CFG_REGION_SIZE, | 63 | .length = IXP4XX_EXP_CFG_REGION_SIZE, |
64 | .type = MT_DEVICE | 64 | .type = MT_DEVICE |
65 | }, { /* PCI Registers */ | 65 | }, { /* PCI Registers */ |
66 | .virtual = IXP4XX_PCI_CFG_BASE_VIRT, | 66 | .virtual = (unsigned long)IXP4XX_PCI_CFG_BASE_VIRT, |
67 | .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS), | 67 | .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS), |
68 | .length = IXP4XX_PCI_CFG_REGION_SIZE, | 68 | .length = IXP4XX_PCI_CFG_REGION_SIZE, |
69 | .type = MT_DEVICE | 69 | .type = MT_DEVICE |
70 | }, | 70 | }, |
71 | #ifdef CONFIG_DEBUG_LL | 71 | #ifdef CONFIG_DEBUG_LL |
72 | { /* Debug UART mapping */ | 72 | { /* Debug UART mapping */ |
73 | .virtual = IXP4XX_DEBUG_UART_BASE_VIRT, | 73 | .virtual = (unsigned long)IXP4XX_DEBUG_UART_BASE_VIRT, |
74 | .pfn = __phys_to_pfn(IXP4XX_DEBUG_UART_BASE_PHYS), | 74 | .pfn = __phys_to_pfn(IXP4XX_DEBUG_UART_BASE_PHYS), |
75 | .length = IXP4XX_DEBUG_UART_REGION_SIZE, | 75 | .length = IXP4XX_DEBUG_UART_REGION_SIZE, |
76 | .type = MT_DEVICE | 76 | .type = MT_DEVICE |
diff --git a/arch/arm/mach-ixp4xx/include/mach/cpu.h b/arch/arm/mach-ixp4xx/include/mach/cpu.h index b2ef65db0e91..ebc0ba31ce85 100644 --- a/arch/arm/mach-ixp4xx/include/mach/cpu.h +++ b/arch/arm/mach-ixp4xx/include/mach/cpu.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #ifndef __ASM_ARCH_CPU_H__ | 14 | #ifndef __ASM_ARCH_CPU_H__ |
15 | #define __ASM_ARCH_CPU_H__ | 15 | #define __ASM_ARCH_CPU_H__ |
16 | 16 | ||
17 | #include <linux/io.h> | ||
17 | #include <asm/cputype.h> | 18 | #include <asm/cputype.h> |
18 | 19 | ||
19 | /* Processor id value in CP15 Register 0 */ | 20 | /* Processor id value in CP15 Register 0 */ |
@@ -37,7 +38,7 @@ | |||
37 | 38 | ||
38 | static inline u32 ixp4xx_read_feature_bits(void) | 39 | static inline u32 ixp4xx_read_feature_bits(void) |
39 | { | 40 | { |
40 | u32 val = ~*IXP4XX_EXP_CFG2; | 41 | u32 val = ~__raw_readl(IXP4XX_EXP_CFG2); |
41 | 42 | ||
42 | if (cpu_is_ixp42x_rev_a0()) | 43 | if (cpu_is_ixp42x_rev_a0()) |
43 | return IXP42X_FEATURE_MASK & ~(IXP4XX_FEATURE_RCOMP | | 44 | return IXP42X_FEATURE_MASK & ~(IXP4XX_FEATURE_RCOMP | |
@@ -51,7 +52,7 @@ static inline u32 ixp4xx_read_feature_bits(void) | |||
51 | 52 | ||
52 | static inline void ixp4xx_write_feature_bits(u32 value) | 53 | static inline void ixp4xx_write_feature_bits(u32 value) |
53 | { | 54 | { |
54 | *IXP4XX_EXP_CFG2 = ~value; | 55 | __raw_writel(~value, IXP4XX_EXP_CFG2); |
55 | } | 56 | } |
56 | 57 | ||
57 | #endif /* _ASM_ARCH_CPU_H */ | 58 | #endif /* _ASM_ARCH_CPU_H */ |
diff --git a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h index 97c530f66e78..eb68b61ce975 100644 --- a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h +++ b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h | |||
@@ -49,21 +49,21 @@ | |||
49 | * Expansion BUS Configuration registers | 49 | * Expansion BUS Configuration registers |
50 | */ | 50 | */ |
51 | #define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) | 51 | #define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) |
52 | #define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFE000) | 52 | #define IXP4XX_EXP_CFG_BASE_VIRT IOMEM(0xFFBFE000) |
53 | #define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) | 53 | #define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * PCI Config registers | 56 | * PCI Config registers |
57 | */ | 57 | */ |
58 | #define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000) | 58 | #define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000) |
59 | #define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFF000) | 59 | #define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFFBFF000) |
60 | #define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000) | 60 | #define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000) |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * Peripheral space | 63 | * Peripheral space |
64 | */ | 64 | */ |
65 | #define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000) | 65 | #define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000) |
66 | #define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBEB000) | 66 | #define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFFBEB000) |
67 | #define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000) | 67 | #define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000) |
68 | 68 | ||
69 | /* | 69 | /* |
@@ -73,7 +73,7 @@ | |||
73 | * aligned so that it * can be used with the low-level debug code. | 73 | * aligned so that it * can be used with the low-level debug code. |
74 | */ | 74 | */ |
75 | #define IXP4XX_DEBUG_UART_BASE_PHYS (0xC8000000) | 75 | #define IXP4XX_DEBUG_UART_BASE_PHYS (0xC8000000) |
76 | #define IXP4XX_DEBUG_UART_BASE_VIRT (0xffb00000) | 76 | #define IXP4XX_DEBUG_UART_BASE_VIRT IOMEM(0xffb00000) |
77 | #define IXP4XX_DEBUG_UART_REGION_SIZE (0x00001000) | 77 | #define IXP4XX_DEBUG_UART_REGION_SIZE (0x00001000) |
78 | 78 | ||
79 | #define IXP4XX_EXP_CS0_OFFSET 0x00 | 79 | #define IXP4XX_EXP_CS0_OFFSET 0x00 |
@@ -92,7 +92,7 @@ | |||
92 | /* | 92 | /* |
93 | * Expansion Bus Controller registers. | 93 | * Expansion Bus Controller registers. |
94 | */ | 94 | */ |
95 | #define IXP4XX_EXP_REG(x) ((volatile u32 *)(IXP4XX_EXP_CFG_BASE_VIRT+(x))) | 95 | #define IXP4XX_EXP_REG(x) ((volatile u32 __iomem *)(IXP4XX_EXP_CFG_BASE_VIRT+(x))) |
96 | 96 | ||
97 | #define IXP4XX_EXP_CS0 IXP4XX_EXP_REG(IXP4XX_EXP_CS0_OFFSET) | 97 | #define IXP4XX_EXP_CS0 IXP4XX_EXP_REG(IXP4XX_EXP_CS0_OFFSET) |
98 | #define IXP4XX_EXP_CS1 IXP4XX_EXP_REG(IXP4XX_EXP_CS1_OFFSET) | 98 | #define IXP4XX_EXP_CS1 IXP4XX_EXP_REG(IXP4XX_EXP_CS1_OFFSET) |
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 1201191d7f1b..3f7b05f30b46 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -42,16 +42,6 @@ | |||
42 | ****************************************************************************/ | 42 | ****************************************************************************/ |
43 | static struct map_desc kirkwood_io_desc[] __initdata = { | 43 | static struct map_desc kirkwood_io_desc[] __initdata = { |
44 | { | 44 | { |
45 | .virtual = KIRKWOOD_PCIE_IO_VIRT_BASE, | ||
46 | .pfn = __phys_to_pfn(KIRKWOOD_PCIE_IO_PHYS_BASE), | ||
47 | .length = KIRKWOOD_PCIE_IO_SIZE, | ||
48 | .type = MT_DEVICE, | ||
49 | }, { | ||
50 | .virtual = KIRKWOOD_PCIE1_IO_VIRT_BASE, | ||
51 | .pfn = __phys_to_pfn(KIRKWOOD_PCIE1_IO_PHYS_BASE), | ||
52 | .length = KIRKWOOD_PCIE1_IO_SIZE, | ||
53 | .type = MT_DEVICE, | ||
54 | }, { | ||
55 | .virtual = KIRKWOOD_REGS_VIRT_BASE, | 45 | .virtual = KIRKWOOD_REGS_VIRT_BASE, |
56 | .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), | 46 | .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), |
57 | .length = KIRKWOOD_REGS_SIZE, | 47 | .length = KIRKWOOD_REGS_SIZE, |
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h deleted file mode 100644 index 5d0ab61700d2..000000000000 --- a/arch/arm/mach-kirkwood/include/mach/io.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/include/mach/io.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ARCH_IO_H | ||
10 | #define __ASM_ARCH_IO_H | ||
11 | |||
12 | #include "kirkwood.h" | ||
13 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | ||
15 | |||
16 | static inline void __iomem *__io(unsigned long addr) | ||
17 | { | ||
18 | return (void __iomem *)((addr - KIRKWOOD_PCIE_IO_BUS_BASE) | ||
19 | + KIRKWOOD_PCIE_IO_VIRT_BASE); | ||
20 | } | ||
21 | |||
22 | #define __io(a) __io(a) | ||
23 | |||
24 | #endif | ||
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index c5b68510776b..af4f0000dcef 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -37,14 +37,12 @@ | |||
37 | #define KIRKWOOD_NAND_MEM_SIZE SZ_1K | 37 | #define KIRKWOOD_NAND_MEM_SIZE SZ_1K |
38 | 38 | ||
39 | #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 | 39 | #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 |
40 | #define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 | 40 | #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00010000 |
41 | #define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000 | 41 | #define KIRKWOOD_PCIE1_IO_SIZE SZ_64K |
42 | #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M | ||
43 | 42 | ||
44 | #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 | 43 | #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 |
45 | #define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfee00000 | ||
46 | #define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000 | 44 | #define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000 |
47 | #define KIRKWOOD_PCIE_IO_SIZE SZ_1M | 45 | #define KIRKWOOD_PCIE_IO_SIZE SZ_64K |
48 | 46 | ||
49 | #define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 | 47 | #define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 |
50 | #define KIRKWOOD_REGS_VIRT_BASE 0xfed00000 | 48 | #define KIRKWOOD_REGS_VIRT_BASE 0xfed00000 |
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index 6e8b2efa3c35..532d8acb38f9 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -56,7 +56,7 @@ struct pcie_port { | |||
56 | void __iomem *base; | 56 | void __iomem *base; |
57 | spinlock_t conf_lock; | 57 | spinlock_t conf_lock; |
58 | int irq; | 58 | int irq; |
59 | struct resource res[2]; | 59 | struct resource res; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | static int pcie_port_map[2]; | 62 | static int pcie_port_map[2]; |
@@ -137,20 +137,12 @@ static void __init pcie0_ioresources_init(struct pcie_port *pp) | |||
137 | pp->irq = IRQ_KIRKWOOD_PCIE; | 137 | pp->irq = IRQ_KIRKWOOD_PCIE; |
138 | 138 | ||
139 | /* | 139 | /* |
140 | * IORESOURCE_IO | ||
141 | */ | ||
142 | pp->res[0].name = "PCIe 0 I/O Space"; | ||
143 | pp->res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE; | ||
144 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1; | ||
145 | pp->res[0].flags = IORESOURCE_IO; | ||
146 | |||
147 | /* | ||
148 | * IORESOURCE_MEM | 140 | * IORESOURCE_MEM |
149 | */ | 141 | */ |
150 | pp->res[1].name = "PCIe 0 MEM"; | 142 | pp->res.name = "PCIe 0 MEM"; |
151 | pp->res[1].start = KIRKWOOD_PCIE_MEM_PHYS_BASE; | 143 | pp->res.start = KIRKWOOD_PCIE_MEM_PHYS_BASE; |
152 | pp->res[1].end = pp->res[1].start + KIRKWOOD_PCIE_MEM_SIZE - 1; | 144 | pp->res.end = pp->res.start + KIRKWOOD_PCIE_MEM_SIZE - 1; |
153 | pp->res[1].flags = IORESOURCE_MEM; | 145 | pp->res.flags = IORESOURCE_MEM; |
154 | } | 146 | } |
155 | 147 | ||
156 | static void __init pcie1_ioresources_init(struct pcie_port *pp) | 148 | static void __init pcie1_ioresources_init(struct pcie_port *pp) |
@@ -159,20 +151,12 @@ static void __init pcie1_ioresources_init(struct pcie_port *pp) | |||
159 | pp->irq = IRQ_KIRKWOOD_PCIE1; | 151 | pp->irq = IRQ_KIRKWOOD_PCIE1; |
160 | 152 | ||
161 | /* | 153 | /* |
162 | * IORESOURCE_IO | ||
163 | */ | ||
164 | pp->res[0].name = "PCIe 1 I/O Space"; | ||
165 | pp->res[0].start = KIRKWOOD_PCIE1_IO_BUS_BASE; | ||
166 | pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1; | ||
167 | pp->res[0].flags = IORESOURCE_IO; | ||
168 | |||
169 | /* | ||
170 | * IORESOURCE_MEM | 154 | * IORESOURCE_MEM |
171 | */ | 155 | */ |
172 | pp->res[1].name = "PCIe 1 MEM"; | 156 | pp->res.name = "PCIe 1 MEM"; |
173 | pp->res[1].start = KIRKWOOD_PCIE1_MEM_PHYS_BASE; | 157 | pp->res.start = KIRKWOOD_PCIE1_MEM_PHYS_BASE; |
174 | pp->res[1].end = pp->res[1].start + KIRKWOOD_PCIE1_MEM_SIZE - 1; | 158 | pp->res.end = pp->res.start + KIRKWOOD_PCIE1_MEM_SIZE - 1; |
175 | pp->res[1].flags = IORESOURCE_MEM; | 159 | pp->res.flags = IORESOURCE_MEM; |
176 | } | 160 | } |
177 | 161 | ||
178 | static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) | 162 | static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) |
@@ -197,23 +181,21 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) | |||
197 | case 0: | 181 | case 0: |
198 | kirkwood_enable_pcie_clk("0"); | 182 | kirkwood_enable_pcie_clk("0"); |
199 | pcie0_ioresources_init(pp); | 183 | pcie0_ioresources_init(pp); |
184 | pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE_IO_PHYS_BASE); | ||
200 | break; | 185 | break; |
201 | case 1: | 186 | case 1: |
202 | kirkwood_enable_pcie_clk("1"); | 187 | kirkwood_enable_pcie_clk("1"); |
203 | pcie1_ioresources_init(pp); | 188 | pcie1_ioresources_init(pp); |
189 | pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE1_IO_PHYS_BASE); | ||
204 | break; | 190 | break; |
205 | default: | 191 | default: |
206 | panic("PCIe setup: invalid controller %d", index); | 192 | panic("PCIe setup: invalid controller %d", index); |
207 | } | 193 | } |
208 | 194 | ||
209 | if (request_resource(&ioport_resource, &pp->res[0])) | 195 | if (request_resource(&iomem_resource, &pp->res)) |
210 | panic("Request PCIe%d IO resource failed\n", index); | ||
211 | if (request_resource(&iomem_resource, &pp->res[1])) | ||
212 | panic("Request PCIe%d Memory resource failed\n", index); | 196 | panic("Request PCIe%d Memory resource failed\n", index); |
213 | 197 | ||
214 | sys->io_offset = 0; | 198 | pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset); |
215 | pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset); | ||
216 | pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); | ||
217 | 199 | ||
218 | /* | 200 | /* |
219 | * Generic PCIe unit setup. | 201 | * Generic PCIe unit setup. |
diff --git a/arch/arm/mach-ks8695/cpu.c b/arch/arm/mach-ks8695/cpu.c index 7f3f24053a00..ddb24222918e 100644 --- a/arch/arm/mach-ks8695/cpu.c +++ b/arch/arm/mach-ks8695/cpu.c | |||
@@ -36,7 +36,7 @@ | |||
36 | 36 | ||
37 | static struct __initdata map_desc ks8695_io_desc[] = { | 37 | static struct __initdata map_desc ks8695_io_desc[] = { |
38 | { | 38 | { |
39 | .virtual = KS8695_IO_VA, | 39 | .virtual = (unsigned long)KS8695_IO_VA, |
40 | .pfn = __phys_to_pfn(KS8695_IO_PA), | 40 | .pfn = __phys_to_pfn(KS8695_IO_PA), |
41 | .length = KS8695_IO_SIZE, | 41 | .length = KS8695_IO_SIZE, |
42 | .type = MT_DEVICE, | 42 | .type = MT_DEVICE, |
diff --git a/arch/arm/mach-ks8695/include/mach/hardware.h b/arch/arm/mach-ks8695/include/mach/hardware.h index 5e0c388143da..5090338c0db2 100644 --- a/arch/arm/mach-ks8695/include/mach/hardware.h +++ b/arch/arm/mach-ks8695/include/mach/hardware.h | |||
@@ -33,7 +33,7 @@ | |||
33 | * head debug code as the initial MMU setup only deals in L1 sections. | 33 | * head debug code as the initial MMU setup only deals in L1 sections. |
34 | */ | 34 | */ |
35 | #define KS8695_IO_PA 0x03F00000 | 35 | #define KS8695_IO_PA 0x03F00000 |
36 | #define KS8695_IO_VA 0xF0000000 | 36 | #define KS8695_IO_VA IOMEM(0xF0000000) |
37 | #define KS8695_IO_SIZE SZ_1M | 37 | #define KS8695_IO_SIZE SZ_1M |
38 | 38 | ||
39 | #define KS8695_PCIMEM_PA 0x60000000 | 39 | #define KS8695_PCIMEM_PA 0x60000000 |
diff --git a/arch/arm/mach-ks8695/include/mach/regs-timer.h b/arch/arm/mach-ks8695/include/mach/regs-timer.h deleted file mode 100644 index e620cda99d2d..000000000000 --- a/arch/arm/mach-ks8695/include/mach/regs-timer.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ks8695/include/mach/regs-timer.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk> | ||
5 | * Copyright (C) 2006 Simtec Electronics | ||
6 | * | ||
7 | * KS8695 - Timer registers and bit definitions. | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef KS8695_TIMER_H | ||
15 | #define KS8695_TIMER_H | ||
16 | |||
17 | #define KS8695_TMR_OFFSET (0xF0000 + 0xE400) | ||
18 | #define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET) | ||
19 | #define KS8695_TMR_PA (KS8695_IO_PA + KS8695_TMR_OFFSET) | ||
20 | |||
21 | |||
22 | /* | ||
23 | * Timer registers | ||
24 | */ | ||
25 | #define KS8695_TMCON (0x00) /* Timer Control Register */ | ||
26 | #define KS8695_T1TC (0x04) /* Timer 1 Timeout Count Register */ | ||
27 | #define KS8695_T0TC (0x08) /* Timer 0 Timeout Count Register */ | ||
28 | #define KS8695_T1PD (0x0C) /* Timer 1 Pulse Count Register */ | ||
29 | #define KS8695_T0PD (0x10) /* Timer 0 Pulse Count Register */ | ||
30 | |||
31 | |||
32 | /* Timer Control Register */ | ||
33 | #define TMCON_T1EN (1 << 1) /* Timer 1 Enable */ | ||
34 | #define TMCON_T0EN (1 << 0) /* Timer 0 Enable */ | ||
35 | |||
36 | /* Timer0 Timeout Counter Register */ | ||
37 | #define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */ | ||
38 | |||
39 | |||
40 | #endif | ||
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h index 9495cb4d701a..8879d610308a 100644 --- a/arch/arm/mach-ks8695/include/mach/uncompress.h +++ b/arch/arm/mach-ks8695/include/mach/uncompress.h | |||
@@ -19,15 +19,15 @@ | |||
19 | 19 | ||
20 | static void putc(char c) | 20 | static void putc(char c) |
21 | { | 21 | { |
22 | while (!(__raw_readl(KS8695_UART_PA + KS8695_URLS) & URLS_URTHRE)) | 22 | while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTHRE)) |
23 | barrier(); | 23 | barrier(); |
24 | 24 | ||
25 | __raw_writel(c, KS8695_UART_PA + KS8695_URTH); | 25 | __raw_writel(c, (void __iomem*)KS8695_UART_PA + KS8695_URTH); |
26 | } | 26 | } |
27 | 27 | ||
28 | static inline void flush(void) | 28 | static inline void flush(void) |
29 | { | 29 | { |
30 | while (!(__raw_readl(KS8695_UART_PA + KS8695_URLS) & URLS_URTE)) | 30 | while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTE)) |
31 | barrier(); | 31 | barrier(); |
32 | } | 32 | } |
33 | 33 | ||
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c index ec783a3070ae..46c84bc7792c 100644 --- a/arch/arm/mach-ks8695/time.c +++ b/arch/arm/mach-ks8695/time.c | |||
@@ -25,53 +25,98 @@ | |||
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
28 | #include <linux/clockchips.h> | ||
28 | 29 | ||
29 | #include <asm/mach/time.h> | 30 | #include <asm/mach/time.h> |
30 | #include <asm/system_misc.h> | 31 | #include <asm/system_misc.h> |
31 | 32 | ||
32 | #include <mach/regs-timer.h> | ||
33 | #include <mach/regs-irq.h> | 33 | #include <mach/regs-irq.h> |
34 | 34 | ||
35 | #include "generic.h" | 35 | #include "generic.h" |
36 | 36 | ||
37 | #define KS8695_TMR_OFFSET (0xF0000 + 0xE400) | ||
38 | #define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET) | ||
39 | #define KS8695_TMR_PA (KS8695_IO_PA + KS8695_TMR_OFFSET) | ||
40 | |||
37 | /* | 41 | /* |
38 | * Returns number of ms since last clock interrupt. Note that interrupts | 42 | * Timer registers |
39 | * will have been disabled by do_gettimeoffset() | ||
40 | */ | 43 | */ |
41 | static unsigned long ks8695_gettimeoffset (void) | 44 | #define KS8695_TMCON (0x00) /* Timer Control Register */ |
45 | #define KS8695_T1TC (0x04) /* Timer 1 Timeout Count Register */ | ||
46 | #define KS8695_T0TC (0x08) /* Timer 0 Timeout Count Register */ | ||
47 | #define KS8695_T1PD (0x0C) /* Timer 1 Pulse Count Register */ | ||
48 | #define KS8695_T0PD (0x10) /* Timer 0 Pulse Count Register */ | ||
49 | |||
50 | /* Timer Control Register */ | ||
51 | #define TMCON_T1EN (1 << 1) /* Timer 1 Enable */ | ||
52 | #define TMCON_T0EN (1 << 0) /* Timer 0 Enable */ | ||
53 | |||
54 | /* Timer0 Timeout Counter Register */ | ||
55 | #define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */ | ||
56 | |||
57 | static void ks8695_set_mode(enum clock_event_mode mode, | ||
58 | struct clock_event_device *evt) | ||
42 | { | 59 | { |
43 | unsigned long elapsed, tick2, intpending; | 60 | u32 tmcon; |
44 | 61 | ||
45 | /* | 62 | if (mode == CLOCK_EVT_FEAT_PERIODIC) { |
46 | * Get the current number of ticks. Note that there is a race | 63 | u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ); |
47 | * condition between us reading the timer and checking for an | 64 | u32 half = DIV_ROUND_CLOSEST(rate, 2); |
48 | * interrupt. We solve this by ensuring that the counter has not | 65 | |
49 | * reloaded between our two reads. | 66 | /* Disable timer 1 */ |
50 | */ | 67 | tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON); |
51 | elapsed = __raw_readl(KS8695_TMR_VA + KS8695_T1TC) + __raw_readl(KS8695_TMR_VA + KS8695_T1PD); | 68 | tmcon &= ~TMCON_T1EN; |
52 | do { | 69 | writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); |
53 | tick2 = elapsed; | 70 | |
54 | intpending = __raw_readl(KS8695_IRQ_VA + KS8695_INTST) & (1 << KS8695_IRQ_TIMER1); | 71 | /* Both registers need to count down */ |
55 | elapsed = __raw_readl(KS8695_TMR_VA + KS8695_T1TC) + __raw_readl(KS8695_TMR_VA + KS8695_T1PD); | 72 | writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC); |
56 | } while (elapsed > tick2); | 73 | writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD); |
57 | 74 | ||
58 | /* Convert to number of ticks expired (not remaining) */ | 75 | /* Re-enable timer1 */ |
59 | elapsed = (CLOCK_TICK_RATE / HZ) - elapsed; | 76 | tmcon |= TMCON_T1EN; |
60 | 77 | writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); | |
61 | /* Is interrupt pending? If so, then timer has been reloaded already. */ | 78 | } |
62 | if (intpending) | ||
63 | elapsed += (CLOCK_TICK_RATE / HZ); | ||
64 | |||
65 | /* Convert ticks to usecs */ | ||
66 | return (unsigned long)(elapsed * (tick_nsec / 1000)) / LATCH; | ||
67 | } | 79 | } |
68 | 80 | ||
81 | static int ks8695_set_next_event(unsigned long cycles, | ||
82 | struct clock_event_device *evt) | ||
83 | |||
84 | { | ||
85 | u32 half = DIV_ROUND_CLOSEST(cycles, 2); | ||
86 | u32 tmcon; | ||
87 | |||
88 | /* Disable timer 1 */ | ||
89 | tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON); | ||
90 | tmcon &= ~TMCON_T1EN; | ||
91 | writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); | ||
92 | |||
93 | /* Both registers need to count down */ | ||
94 | writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC); | ||
95 | writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD); | ||
96 | |||
97 | /* Re-enable timer1 */ | ||
98 | tmcon |= TMCON_T1EN; | ||
99 | writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); | ||
100 | |||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | static struct clock_event_device clockevent_ks8695 = { | ||
105 | .name = "ks8695_t1tc", | ||
106 | .rating = 300, /* Reasonably fast and accurate clock event */ | ||
107 | .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, | ||
108 | .set_next_event = ks8695_set_next_event, | ||
109 | .set_mode = ks8695_set_mode, | ||
110 | }; | ||
111 | |||
69 | /* | 112 | /* |
70 | * IRQ handler for the timer. | 113 | * IRQ handler for the timer. |
71 | */ | 114 | */ |
72 | static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id) | 115 | static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id) |
73 | { | 116 | { |
74 | timer_tick(); | 117 | struct clock_event_device *evt = &clockevent_ks8695; |
118 | |||
119 | evt->event_handler(evt); | ||
75 | return IRQ_HANDLED; | 120 | return IRQ_HANDLED; |
76 | } | 121 | } |
77 | 122 | ||
@@ -83,18 +128,22 @@ static struct irqaction ks8695_timer_irq = { | |||
83 | 128 | ||
84 | static void ks8695_timer_setup(void) | 129 | static void ks8695_timer_setup(void) |
85 | { | 130 | { |
86 | unsigned long tmout = CLOCK_TICK_RATE / HZ; | ||
87 | unsigned long tmcon; | 131 | unsigned long tmcon; |
88 | 132 | ||
89 | /* disable timer1 */ | 133 | /* Disable timer 0 and 1 */ |
90 | tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON); | 134 | tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON); |
91 | __raw_writel(tmcon & ~TMCON_T1EN, KS8695_TMR_VA + KS8695_TMCON); | 135 | tmcon &= ~TMCON_T0EN; |
92 | 136 | tmcon &= ~TMCON_T1EN; | |
93 | __raw_writel(tmout / 2, KS8695_TMR_VA + KS8695_T1TC); | 137 | writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); |
94 | __raw_writel(tmout / 2, KS8695_TMR_VA + KS8695_T1PD); | ||
95 | 138 | ||
96 | /* re-enable timer1 */ | 139 | /* |
97 | __raw_writel(tmcon | TMCON_T1EN, KS8695_TMR_VA + KS8695_TMCON); | 140 | * Use timer 1 to fire IRQs on the timeline, minimum 2 cycles |
141 | * (one on each counter) maximum 2*2^32, but the API will only | ||
142 | * accept up to a 32bit full word (0xFFFFFFFFU). | ||
143 | */ | ||
144 | clockevents_config_and_register(&clockevent_ks8695, | ||
145 | KS8695_CLOCK_RATE, 2, | ||
146 | 0xFFFFFFFFU); | ||
98 | } | 147 | } |
99 | 148 | ||
100 | static void __init ks8695_timer_init (void) | 149 | static void __init ks8695_timer_init (void) |
@@ -107,8 +156,6 @@ static void __init ks8695_timer_init (void) | |||
107 | 156 | ||
108 | struct sys_timer ks8695_timer = { | 157 | struct sys_timer ks8695_timer = { |
109 | .init = ks8695_timer_init, | 158 | .init = ks8695_timer_init, |
110 | .offset = ks8695_gettimeoffset, | ||
111 | .resume = ks8695_timer_setup, | ||
112 | }; | 159 | }; |
113 | 160 | ||
114 | void ks8695_restart(char mode, const char *cmd) | 161 | void ks8695_restart(char mode, const char *cmd) |
@@ -119,12 +166,12 @@ void ks8695_restart(char mode, const char *cmd) | |||
119 | soft_restart(0); | 166 | soft_restart(0); |
120 | 167 | ||
121 | /* disable timer0 */ | 168 | /* disable timer0 */ |
122 | reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON); | 169 | reg = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON); |
123 | __raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); | 170 | writel_relaxed(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); |
124 | 171 | ||
125 | /* enable watchdog mode */ | 172 | /* enable watchdog mode */ |
126 | __raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC); | 173 | writel_relaxed((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC); |
127 | 174 | ||
128 | /* re-enable timer0 */ | 175 | /* re-enable timer0 */ |
129 | __raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); | 176 | writel_relaxed(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); |
130 | } | 177 | } |
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index a48dc2dec485..0d4db8c544b5 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c | |||
@@ -177,25 +177,25 @@ u32 clk_get_pclk_div(void) | |||
177 | 177 | ||
178 | static struct map_desc lpc32xx_io_desc[] __initdata = { | 178 | static struct map_desc lpc32xx_io_desc[] __initdata = { |
179 | { | 179 | { |
180 | .virtual = IO_ADDRESS(LPC32XX_AHB0_START), | 180 | .virtual = (unsigned long)IO_ADDRESS(LPC32XX_AHB0_START), |
181 | .pfn = __phys_to_pfn(LPC32XX_AHB0_START), | 181 | .pfn = __phys_to_pfn(LPC32XX_AHB0_START), |
182 | .length = LPC32XX_AHB0_SIZE, | 182 | .length = LPC32XX_AHB0_SIZE, |
183 | .type = MT_DEVICE | 183 | .type = MT_DEVICE |
184 | }, | 184 | }, |
185 | { | 185 | { |
186 | .virtual = IO_ADDRESS(LPC32XX_AHB1_START), | 186 | .virtual = (unsigned long)IO_ADDRESS(LPC32XX_AHB1_START), |
187 | .pfn = __phys_to_pfn(LPC32XX_AHB1_START), | 187 | .pfn = __phys_to_pfn(LPC32XX_AHB1_START), |
188 | .length = LPC32XX_AHB1_SIZE, | 188 | .length = LPC32XX_AHB1_SIZE, |
189 | .type = MT_DEVICE | 189 | .type = MT_DEVICE |
190 | }, | 190 | }, |
191 | { | 191 | { |
192 | .virtual = IO_ADDRESS(LPC32XX_FABAPB_START), | 192 | .virtual = (unsigned long)IO_ADDRESS(LPC32XX_FABAPB_START), |
193 | .pfn = __phys_to_pfn(LPC32XX_FABAPB_START), | 193 | .pfn = __phys_to_pfn(LPC32XX_FABAPB_START), |
194 | .length = LPC32XX_FABAPB_SIZE, | 194 | .length = LPC32XX_FABAPB_SIZE, |
195 | .type = MT_DEVICE | 195 | .type = MT_DEVICE |
196 | }, | 196 | }, |
197 | { | 197 | { |
198 | .virtual = IO_ADDRESS(LPC32XX_IRAM_BASE), | 198 | .virtual = (unsigned long)IO_ADDRESS(LPC32XX_IRAM_BASE), |
199 | .pfn = __phys_to_pfn(LPC32XX_IRAM_BASE), | 199 | .pfn = __phys_to_pfn(LPC32XX_IRAM_BASE), |
200 | .length = (LPC32XX_IRAM_BANK_SIZE * 2), | 200 | .length = (LPC32XX_IRAM_BANK_SIZE * 2), |
201 | .type = MT_DEVICE | 201 | .type = MT_DEVICE |
diff --git a/arch/arm/mach-lpc32xx/include/mach/hardware.h b/arch/arm/mach-lpc32xx/include/mach/hardware.h index 33e1dde37bd9..69065de97a3d 100644 --- a/arch/arm/mach-lpc32xx/include/mach/hardware.h +++ b/arch/arm/mach-lpc32xx/include/mach/hardware.h | |||
@@ -25,7 +25,7 @@ | |||
25 | /* | 25 | /* |
26 | * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 | 26 | * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 |
27 | */ | 27 | */ |
28 | #define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\ | 28 | #define IO_ADDRESS(x) IOMEM(((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\ |
29 | IO_BASE) | 29 | IO_BASE) |
30 | 30 | ||
31 | #define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x)) | 31 | #define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x)) |
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile index b786f7e6cd1f..095c155d6fb8 100644 --- a/arch/arm/mach-mmp/Makefile +++ b/arch/arm/mach-mmp/Makefile | |||
@@ -2,13 +2,19 @@ | |||
2 | # Makefile for Marvell's PXA168 processors line | 2 | # Makefile for Marvell's PXA168 processors line |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y += common.o clock.o devices.o time.o irq.o | 5 | obj-y += common.o devices.o time.o irq.o |
6 | 6 | ||
7 | # SoC support | 7 | # SoC support |
8 | obj-$(CONFIG_CPU_PXA168) += pxa168.o | 8 | obj-$(CONFIG_CPU_PXA168) += pxa168.o |
9 | obj-$(CONFIG_CPU_PXA910) += pxa910.o | 9 | obj-$(CONFIG_CPU_PXA910) += pxa910.o |
10 | obj-$(CONFIG_CPU_MMP2) += mmp2.o sram.o | 10 | obj-$(CONFIG_CPU_MMP2) += mmp2.o sram.o |
11 | 11 | ||
12 | ifeq ($(CONFIG_COMMON_CLK), ) | ||
13 | obj-y += clock.o | ||
14 | obj-$(CONFIG_CPU_PXA168) += clock-pxa168.o | ||
15 | obj-$(CONFIG_CPU_PXA910) += clock-pxa910.o | ||
16 | obj-$(CONFIG_CPU_MMP2) += clock-mmp2.o | ||
17 | endif | ||
12 | ifeq ($(CONFIG_PM),y) | 18 | ifeq ($(CONFIG_PM),y) |
13 | obj-$(CONFIG_CPU_PXA910) += pm-pxa910.o | 19 | obj-$(CONFIG_CPU_PXA910) += pm-pxa910.o |
14 | obj-$(CONFIG_CPU_MMP2) += pm-mmp2.o | 20 | obj-$(CONFIG_CPU_MMP2) += pm-mmp2.o |
diff --git a/arch/arm/mach-mmp/clock-mmp2.c b/arch/arm/mach-mmp/clock-mmp2.c new file mode 100644 index 000000000000..21d22002cd19 --- /dev/null +++ b/arch/arm/mach-mmp/clock-mmp2.c | |||
@@ -0,0 +1,111 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include <linux/kernel.h> | ||
3 | #include <linux/init.h> | ||
4 | #include <linux/list.h> | ||
5 | #include <linux/io.h> | ||
6 | #include <linux/clk.h> | ||
7 | |||
8 | #include <mach/addr-map.h> | ||
9 | |||
10 | #include "common.h" | ||
11 | #include "clock.h" | ||
12 | |||
13 | /* | ||
14 | * APB Clock register offsets for MMP2 | ||
15 | */ | ||
16 | #define APBC_RTC APBC_REG(0x000) | ||
17 | #define APBC_TWSI1 APBC_REG(0x004) | ||
18 | #define APBC_TWSI2 APBC_REG(0x008) | ||
19 | #define APBC_TWSI3 APBC_REG(0x00c) | ||
20 | #define APBC_TWSI4 APBC_REG(0x010) | ||
21 | #define APBC_KPC APBC_REG(0x018) | ||
22 | #define APBC_UART1 APBC_REG(0x02c) | ||
23 | #define APBC_UART2 APBC_REG(0x030) | ||
24 | #define APBC_UART3 APBC_REG(0x034) | ||
25 | #define APBC_GPIO APBC_REG(0x038) | ||
26 | #define APBC_PWM0 APBC_REG(0x03c) | ||
27 | #define APBC_PWM1 APBC_REG(0x040) | ||
28 | #define APBC_PWM2 APBC_REG(0x044) | ||
29 | #define APBC_PWM3 APBC_REG(0x048) | ||
30 | #define APBC_SSP0 APBC_REG(0x04c) | ||
31 | #define APBC_SSP1 APBC_REG(0x050) | ||
32 | #define APBC_SSP2 APBC_REG(0x054) | ||
33 | #define APBC_SSP3 APBC_REG(0x058) | ||
34 | #define APBC_SSP4 APBC_REG(0x05c) | ||
35 | #define APBC_SSP5 APBC_REG(0x060) | ||
36 | #define APBC_TWSI5 APBC_REG(0x07c) | ||
37 | #define APBC_TWSI6 APBC_REG(0x080) | ||
38 | #define APBC_UART4 APBC_REG(0x088) | ||
39 | |||
40 | #define APMU_USB APMU_REG(0x05c) | ||
41 | #define APMU_NAND APMU_REG(0x060) | ||
42 | #define APMU_SDH0 APMU_REG(0x054) | ||
43 | #define APMU_SDH1 APMU_REG(0x058) | ||
44 | #define APMU_SDH2 APMU_REG(0x0e8) | ||
45 | #define APMU_SDH3 APMU_REG(0x0ec) | ||
46 | |||
47 | static void sdhc_clk_enable(struct clk *clk) | ||
48 | { | ||
49 | uint32_t clk_rst; | ||
50 | |||
51 | clk_rst = __raw_readl(clk->clk_rst); | ||
52 | clk_rst |= clk->enable_val; | ||
53 | __raw_writel(clk_rst, clk->clk_rst); | ||
54 | } | ||
55 | |||
56 | static void sdhc_clk_disable(struct clk *clk) | ||
57 | { | ||
58 | uint32_t clk_rst; | ||
59 | |||
60 | clk_rst = __raw_readl(clk->clk_rst); | ||
61 | clk_rst &= ~clk->enable_val; | ||
62 | __raw_writel(clk_rst, clk->clk_rst); | ||
63 | } | ||
64 | |||
65 | struct clkops sdhc_clk_ops = { | ||
66 | .enable = sdhc_clk_enable, | ||
67 | .disable = sdhc_clk_disable, | ||
68 | }; | ||
69 | |||
70 | /* APB peripheral clocks */ | ||
71 | static APBC_CLK(uart1, UART1, 1, 26000000); | ||
72 | static APBC_CLK(uart2, UART2, 1, 26000000); | ||
73 | static APBC_CLK(uart3, UART3, 1, 26000000); | ||
74 | static APBC_CLK(uart4, UART4, 1, 26000000); | ||
75 | static APBC_CLK(twsi1, TWSI1, 0, 26000000); | ||
76 | static APBC_CLK(twsi2, TWSI2, 0, 26000000); | ||
77 | static APBC_CLK(twsi3, TWSI3, 0, 26000000); | ||
78 | static APBC_CLK(twsi4, TWSI4, 0, 26000000); | ||
79 | static APBC_CLK(twsi5, TWSI5, 0, 26000000); | ||
80 | static APBC_CLK(twsi6, TWSI6, 0, 26000000); | ||
81 | static APBC_CLK(gpio, GPIO, 0, 26000000); | ||
82 | |||
83 | static APMU_CLK(nand, NAND, 0xbf, 100000000); | ||
84 | static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops); | ||
85 | static APMU_CLK_OPS(sdh1, SDH1, 0x1b, 200000000, &sdhc_clk_ops); | ||
86 | static APMU_CLK_OPS(sdh2, SDH2, 0x1b, 200000000, &sdhc_clk_ops); | ||
87 | static APMU_CLK_OPS(sdh3, SDH3, 0x1b, 200000000, &sdhc_clk_ops); | ||
88 | |||
89 | static struct clk_lookup mmp2_clkregs[] = { | ||
90 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | ||
91 | INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), | ||
92 | INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL), | ||
93 | INIT_CLKREG(&clk_uart4, "pxa2xx-uart.3", NULL), | ||
94 | INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.0", NULL), | ||
95 | INIT_CLKREG(&clk_twsi2, "pxa2xx-i2c.1", NULL), | ||
96 | INIT_CLKREG(&clk_twsi3, "pxa2xx-i2c.2", NULL), | ||
97 | INIT_CLKREG(&clk_twsi4, "pxa2xx-i2c.3", NULL), | ||
98 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), | ||
99 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), | ||
100 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | ||
101 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
102 | INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"), | ||
103 | INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"), | ||
104 | INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"), | ||
105 | INIT_CLKREG(&clk_sdh3, "sdhci-pxav3.3", "PXA-SDHCLK"), | ||
106 | }; | ||
107 | |||
108 | void __init mmp2_clk_init(void) | ||
109 | { | ||
110 | clkdev_add_table(ARRAY_AND_SIZE(mmp2_clkregs)); | ||
111 | } | ||
diff --git a/arch/arm/mach-mmp/clock-pxa168.c b/arch/arm/mach-mmp/clock-pxa168.c new file mode 100644 index 000000000000..5e6c18ccebd4 --- /dev/null +++ b/arch/arm/mach-mmp/clock-pxa168.c | |||
@@ -0,0 +1,91 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include <linux/kernel.h> | ||
3 | #include <linux/init.h> | ||
4 | #include <linux/list.h> | ||
5 | #include <linux/io.h> | ||
6 | #include <linux/clk.h> | ||
7 | |||
8 | #include <mach/addr-map.h> | ||
9 | |||
10 | #include "common.h" | ||
11 | #include "clock.h" | ||
12 | |||
13 | /* | ||
14 | * APB clock register offsets for PXA168 | ||
15 | */ | ||
16 | #define APBC_UART1 APBC_REG(0x000) | ||
17 | #define APBC_UART2 APBC_REG(0x004) | ||
18 | #define APBC_GPIO APBC_REG(0x008) | ||
19 | #define APBC_PWM1 APBC_REG(0x00c) | ||
20 | #define APBC_PWM2 APBC_REG(0x010) | ||
21 | #define APBC_PWM3 APBC_REG(0x014) | ||
22 | #define APBC_PWM4 APBC_REG(0x018) | ||
23 | #define APBC_RTC APBC_REG(0x028) | ||
24 | #define APBC_TWSI0 APBC_REG(0x02c) | ||
25 | #define APBC_KPC APBC_REG(0x030) | ||
26 | #define APBC_TWSI1 APBC_REG(0x06c) | ||
27 | #define APBC_UART3 APBC_REG(0x070) | ||
28 | #define APBC_SSP1 APBC_REG(0x81c) | ||
29 | #define APBC_SSP2 APBC_REG(0x820) | ||
30 | #define APBC_SSP3 APBC_REG(0x84c) | ||
31 | #define APBC_SSP4 APBC_REG(0x858) | ||
32 | #define APBC_SSP5 APBC_REG(0x85c) | ||
33 | |||
34 | #define APMU_NAND APMU_REG(0x060) | ||
35 | #define APMU_LCD APMU_REG(0x04c) | ||
36 | #define APMU_ETH APMU_REG(0x0fc) | ||
37 | #define APMU_USB APMU_REG(0x05c) | ||
38 | |||
39 | /* APB peripheral clocks */ | ||
40 | static APBC_CLK(uart1, UART1, 1, 14745600); | ||
41 | static APBC_CLK(uart2, UART2, 1, 14745600); | ||
42 | static APBC_CLK(uart3, UART3, 1, 14745600); | ||
43 | static APBC_CLK(twsi0, TWSI0, 1, 33000000); | ||
44 | static APBC_CLK(twsi1, TWSI1, 1, 33000000); | ||
45 | static APBC_CLK(pwm1, PWM1, 1, 13000000); | ||
46 | static APBC_CLK(pwm2, PWM2, 1, 13000000); | ||
47 | static APBC_CLK(pwm3, PWM3, 1, 13000000); | ||
48 | static APBC_CLK(pwm4, PWM4, 1, 13000000); | ||
49 | static APBC_CLK(ssp1, SSP1, 4, 0); | ||
50 | static APBC_CLK(ssp2, SSP2, 4, 0); | ||
51 | static APBC_CLK(ssp3, SSP3, 4, 0); | ||
52 | static APBC_CLK(ssp4, SSP4, 4, 0); | ||
53 | static APBC_CLK(ssp5, SSP5, 4, 0); | ||
54 | static APBC_CLK(gpio, GPIO, 0, 13000000); | ||
55 | static APBC_CLK(keypad, KPC, 0, 32000); | ||
56 | static APBC_CLK(rtc, RTC, 8, 32768); | ||
57 | |||
58 | static APMU_CLK(nand, NAND, 0x19b, 156000000); | ||
59 | static APMU_CLK(lcd, LCD, 0x7f, 312000000); | ||
60 | static APMU_CLK(eth, ETH, 0x09, 0); | ||
61 | static APMU_CLK(usb, USB, 0x12, 0); | ||
62 | |||
63 | /* device and clock bindings */ | ||
64 | static struct clk_lookup pxa168_clkregs[] = { | ||
65 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | ||
66 | INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), | ||
67 | INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL), | ||
68 | INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL), | ||
69 | INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL), | ||
70 | INIT_CLKREG(&clk_pwm1, "pxa168-pwm.0", NULL), | ||
71 | INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL), | ||
72 | INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL), | ||
73 | INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL), | ||
74 | INIT_CLKREG(&clk_ssp1, "pxa168-ssp.0", NULL), | ||
75 | INIT_CLKREG(&clk_ssp2, "pxa168-ssp.1", NULL), | ||
76 | INIT_CLKREG(&clk_ssp3, "pxa168-ssp.2", NULL), | ||
77 | INIT_CLKREG(&clk_ssp4, "pxa168-ssp.3", NULL), | ||
78 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), | ||
79 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | ||
80 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), | ||
81 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
82 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), | ||
83 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), | ||
84 | INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"), | ||
85 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), | ||
86 | }; | ||
87 | |||
88 | void __init pxa168_clk_init(void) | ||
89 | { | ||
90 | clkdev_add_table(ARRAY_AND_SIZE(pxa168_clkregs)); | ||
91 | } | ||
diff --git a/arch/arm/mach-mmp/clock-pxa910.c b/arch/arm/mach-mmp/clock-pxa910.c new file mode 100644 index 000000000000..933ea71d0b56 --- /dev/null +++ b/arch/arm/mach-mmp/clock-pxa910.c | |||
@@ -0,0 +1,67 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include <linux/kernel.h> | ||
3 | #include <linux/init.h> | ||
4 | #include <linux/list.h> | ||
5 | #include <linux/io.h> | ||
6 | #include <linux/clk.h> | ||
7 | |||
8 | #include <mach/addr-map.h> | ||
9 | |||
10 | #include "common.h" | ||
11 | #include "clock.h" | ||
12 | |||
13 | /* | ||
14 | * APB Clock register offsets for PXA910 | ||
15 | */ | ||
16 | #define APBC_UART0 APBC_REG(0x000) | ||
17 | #define APBC_UART1 APBC_REG(0x004) | ||
18 | #define APBC_GPIO APBC_REG(0x008) | ||
19 | #define APBC_PWM1 APBC_REG(0x00c) | ||
20 | #define APBC_PWM2 APBC_REG(0x010) | ||
21 | #define APBC_PWM3 APBC_REG(0x014) | ||
22 | #define APBC_PWM4 APBC_REG(0x018) | ||
23 | #define APBC_SSP1 APBC_REG(0x01c) | ||
24 | #define APBC_SSP2 APBC_REG(0x020) | ||
25 | #define APBC_RTC APBC_REG(0x028) | ||
26 | #define APBC_TWSI0 APBC_REG(0x02c) | ||
27 | #define APBC_KPC APBC_REG(0x030) | ||
28 | #define APBC_SSP3 APBC_REG(0x04c) | ||
29 | #define APBC_TWSI1 APBC_REG(0x06c) | ||
30 | |||
31 | #define APMU_NAND APMU_REG(0x060) | ||
32 | #define APMU_USB APMU_REG(0x05c) | ||
33 | |||
34 | static APBC_CLK(uart1, UART0, 1, 14745600); | ||
35 | static APBC_CLK(uart2, UART1, 1, 14745600); | ||
36 | static APBC_CLK(twsi0, TWSI0, 1, 33000000); | ||
37 | static APBC_CLK(twsi1, TWSI1, 1, 33000000); | ||
38 | static APBC_CLK(pwm1, PWM1, 1, 13000000); | ||
39 | static APBC_CLK(pwm2, PWM2, 1, 13000000); | ||
40 | static APBC_CLK(pwm3, PWM3, 1, 13000000); | ||
41 | static APBC_CLK(pwm4, PWM4, 1, 13000000); | ||
42 | static APBC_CLK(gpio, GPIO, 0, 13000000); | ||
43 | static APBC_CLK(rtc, RTC, 8, 32768); | ||
44 | |||
45 | static APMU_CLK(nand, NAND, 0x19b, 156000000); | ||
46 | static APMU_CLK(u2o, USB, 0x1b, 480000000); | ||
47 | |||
48 | /* device and clock bindings */ | ||
49 | static struct clk_lookup pxa910_clkregs[] = { | ||
50 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | ||
51 | INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), | ||
52 | INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL), | ||
53 | INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL), | ||
54 | INIT_CLKREG(&clk_pwm1, "pxa910-pwm.0", NULL), | ||
55 | INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL), | ||
56 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), | ||
57 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), | ||
58 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | ||
59 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
60 | INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"), | ||
61 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), | ||
62 | }; | ||
63 | |||
64 | void __init pxa910_clk_init(void) | ||
65 | { | ||
66 | clkdev_add_table(ARRAY_AND_SIZE(pxa910_clkregs)); | ||
67 | } | ||
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h index 1c9d6c1ea97a..bd453274fca2 100644 --- a/arch/arm/mach-mmp/common.h +++ b/arch/arm/mach-mmp/common.h | |||
@@ -7,3 +7,6 @@ extern void timer_init(int irq); | |||
7 | extern void __init icu_init_irq(void); | 7 | extern void __init icu_init_irq(void); |
8 | extern void __init mmp_map_io(void); | 8 | extern void __init mmp_map_io(void); |
9 | extern void mmp_restart(char, const char *); | 9 | extern void mmp_restart(char, const char *); |
10 | extern void __init pxa168_clk_init(void); | ||
11 | extern void __init pxa910_clk_init(void); | ||
12 | extern void __init mmp2_clk_init(void); | ||
diff --git a/arch/arm/mach-mmp/include/mach/regs-apbc.h b/arch/arm/mach-mmp/include/mach/regs-apbc.h index 68b0c93ec6a1..ddc812f40341 100644 --- a/arch/arm/mach-mmp/include/mach/regs-apbc.h +++ b/arch/arm/mach-mmp/include/mach/regs-apbc.h | |||
@@ -13,101 +13,6 @@ | |||
13 | 13 | ||
14 | #include <mach/addr-map.h> | 14 | #include <mach/addr-map.h> |
15 | 15 | ||
16 | /* | ||
17 | * APB clock register offsets for PXA168 | ||
18 | */ | ||
19 | #define APBC_PXA168_UART1 APBC_REG(0x000) | ||
20 | #define APBC_PXA168_UART2 APBC_REG(0x004) | ||
21 | #define APBC_PXA168_GPIO APBC_REG(0x008) | ||
22 | #define APBC_PXA168_PWM1 APBC_REG(0x00c) | ||
23 | #define APBC_PXA168_PWM2 APBC_REG(0x010) | ||
24 | #define APBC_PXA168_PWM3 APBC_REG(0x014) | ||
25 | #define APBC_PXA168_PWM4 APBC_REG(0x018) | ||
26 | #define APBC_PXA168_RTC APBC_REG(0x028) | ||
27 | #define APBC_PXA168_TWSI0 APBC_REG(0x02c) | ||
28 | #define APBC_PXA168_KPC APBC_REG(0x030) | ||
29 | #define APBC_PXA168_TIMERS APBC_REG(0x034) | ||
30 | #define APBC_PXA168_AIB APBC_REG(0x03c) | ||
31 | #define APBC_PXA168_SW_JTAG APBC_REG(0x040) | ||
32 | #define APBC_PXA168_ONEWIRE APBC_REG(0x048) | ||
33 | #define APBC_PXA168_ASFAR APBC_REG(0x050) | ||
34 | #define APBC_PXA168_ASSAR APBC_REG(0x054) | ||
35 | #define APBC_PXA168_TWSI1 APBC_REG(0x06c) | ||
36 | #define APBC_PXA168_UART3 APBC_REG(0x070) | ||
37 | #define APBC_PXA168_AC97 APBC_REG(0x084) | ||
38 | #define APBC_PXA168_SSP1 APBC_REG(0x81c) | ||
39 | #define APBC_PXA168_SSP2 APBC_REG(0x820) | ||
40 | #define APBC_PXA168_SSP3 APBC_REG(0x84c) | ||
41 | #define APBC_PXA168_SSP4 APBC_REG(0x858) | ||
42 | #define APBC_PXA168_SSP5 APBC_REG(0x85c) | ||
43 | |||
44 | /* | ||
45 | * APB Clock register offsets for PXA910 | ||
46 | */ | ||
47 | #define APBC_PXA910_UART0 APBC_REG(0x000) | ||
48 | #define APBC_PXA910_UART1 APBC_REG(0x004) | ||
49 | #define APBC_PXA910_GPIO APBC_REG(0x008) | ||
50 | #define APBC_PXA910_PWM1 APBC_REG(0x00c) | ||
51 | #define APBC_PXA910_PWM2 APBC_REG(0x010) | ||
52 | #define APBC_PXA910_PWM3 APBC_REG(0x014) | ||
53 | #define APBC_PXA910_PWM4 APBC_REG(0x018) | ||
54 | #define APBC_PXA910_SSP1 APBC_REG(0x01c) | ||
55 | #define APBC_PXA910_SSP2 APBC_REG(0x020) | ||
56 | #define APBC_PXA910_IPC APBC_REG(0x024) | ||
57 | #define APBC_PXA910_RTC APBC_REG(0x028) | ||
58 | #define APBC_PXA910_TWSI0 APBC_REG(0x02c) | ||
59 | #define APBC_PXA910_KPC APBC_REG(0x030) | ||
60 | #define APBC_PXA910_TIMERS APBC_REG(0x034) | ||
61 | #define APBC_PXA910_TBROT APBC_REG(0x038) | ||
62 | #define APBC_PXA910_AIB APBC_REG(0x03c) | ||
63 | #define APBC_PXA910_SW_JTAG APBC_REG(0x040) | ||
64 | #define APBC_PXA910_TIMERS1 APBC_REG(0x044) | ||
65 | #define APBC_PXA910_ONEWIRE APBC_REG(0x048) | ||
66 | #define APBC_PXA910_SSP3 APBC_REG(0x04c) | ||
67 | #define APBC_PXA910_ASFAR APBC_REG(0x050) | ||
68 | #define APBC_PXA910_ASSAR APBC_REG(0x054) | ||
69 | |||
70 | /* | ||
71 | * APB Clock register offsets for MMP2 | ||
72 | */ | ||
73 | #define APBC_MMP2_RTC APBC_REG(0x000) | ||
74 | #define APBC_MMP2_TWSI1 APBC_REG(0x004) | ||
75 | #define APBC_MMP2_TWSI2 APBC_REG(0x008) | ||
76 | #define APBC_MMP2_TWSI3 APBC_REG(0x00c) | ||
77 | #define APBC_MMP2_TWSI4 APBC_REG(0x010) | ||
78 | #define APBC_MMP2_ONEWIRE APBC_REG(0x014) | ||
79 | #define APBC_MMP2_KPC APBC_REG(0x018) | ||
80 | #define APBC_MMP2_TB_ROTARY APBC_REG(0x01c) | ||
81 | #define APBC_MMP2_SW_JTAG APBC_REG(0x020) | ||
82 | #define APBC_MMP2_TIMERS APBC_REG(0x024) | ||
83 | #define APBC_MMP2_UART1 APBC_REG(0x02c) | ||
84 | #define APBC_MMP2_UART2 APBC_REG(0x030) | ||
85 | #define APBC_MMP2_UART3 APBC_REG(0x034) | ||
86 | #define APBC_MMP2_GPIO APBC_REG(0x038) | ||
87 | #define APBC_MMP2_PWM0 APBC_REG(0x03c) | ||
88 | #define APBC_MMP2_PWM1 APBC_REG(0x040) | ||
89 | #define APBC_MMP2_PWM2 APBC_REG(0x044) | ||
90 | #define APBC_MMP2_PWM3 APBC_REG(0x048) | ||
91 | #define APBC_MMP2_SSP0 APBC_REG(0x04c) | ||
92 | #define APBC_MMP2_SSP1 APBC_REG(0x050) | ||
93 | #define APBC_MMP2_SSP2 APBC_REG(0x054) | ||
94 | #define APBC_MMP2_SSP3 APBC_REG(0x058) | ||
95 | #define APBC_MMP2_SSP4 APBC_REG(0x05c) | ||
96 | #define APBC_MMP2_SSP5 APBC_REG(0x060) | ||
97 | #define APBC_MMP2_AIB APBC_REG(0x064) | ||
98 | #define APBC_MMP2_ASFAR APBC_REG(0x068) | ||
99 | #define APBC_MMP2_ASSAR APBC_REG(0x06c) | ||
100 | #define APBC_MMP2_USIM APBC_REG(0x070) | ||
101 | #define APBC_MMP2_MPMU APBC_REG(0x074) | ||
102 | #define APBC_MMP2_IPC APBC_REG(0x078) | ||
103 | #define APBC_MMP2_TWSI5 APBC_REG(0x07c) | ||
104 | #define APBC_MMP2_TWSI6 APBC_REG(0x080) | ||
105 | #define APBC_MMP2_TWSI_INTSTS APBC_REG(0x084) | ||
106 | #define APBC_MMP2_UART4 APBC_REG(0x088) | ||
107 | #define APBC_MMP2_RIPC APBC_REG(0x08c) | ||
108 | #define APBC_MMP2_THSENS1 APBC_REG(0x090) /* Thermal Sensor */ | ||
109 | #define APBC_MMP2_THSENS_INTSTS APBC_REG(0x0a4) | ||
110 | |||
111 | /* Common APB clock register bit definitions */ | 16 | /* Common APB clock register bit definitions */ |
112 | #define APBC_APBCLK (1 << 0) /* APB Bus Clock Enable */ | 17 | #define APBC_APBCLK (1 << 0) /* APB Bus Clock Enable */ |
113 | #define APBC_FNCLK (1 << 1) /* Functional Clock Enable */ | 18 | #define APBC_FNCLK (1 << 1) /* Functional Clock Enable */ |
diff --git a/arch/arm/mach-mmp/include/mach/regs-apmu.h b/arch/arm/mach-mmp/include/mach/regs-apmu.h index 7af8deb63e83..93c8d0e29bb9 100644 --- a/arch/arm/mach-mmp/include/mach/regs-apmu.h +++ b/arch/arm/mach-mmp/include/mach/regs-apmu.h | |||
@@ -13,21 +13,6 @@ | |||
13 | 13 | ||
14 | #include <mach/addr-map.h> | 14 | #include <mach/addr-map.h> |
15 | 15 | ||
16 | /* Clock Reset Control */ | ||
17 | #define APMU_IRE APMU_REG(0x048) | ||
18 | #define APMU_LCD APMU_REG(0x04c) | ||
19 | #define APMU_CCIC APMU_REG(0x050) | ||
20 | #define APMU_SDH0 APMU_REG(0x054) | ||
21 | #define APMU_SDH1 APMU_REG(0x058) | ||
22 | #define APMU_USB APMU_REG(0x05c) | ||
23 | #define APMU_NAND APMU_REG(0x060) | ||
24 | #define APMU_DMA APMU_REG(0x064) | ||
25 | #define APMU_GEU APMU_REG(0x068) | ||
26 | #define APMU_BUS APMU_REG(0x06c) | ||
27 | #define APMU_SDH2 APMU_REG(0x0e8) | ||
28 | #define APMU_SDH3 APMU_REG(0x0ec) | ||
29 | #define APMU_ETH APMU_REG(0x0fc) | ||
30 | |||
31 | #define APMU_FNCLK_EN (1 << 4) | 16 | #define APMU_FNCLK_EN (1 << 4) |
32 | #define APMU_AXICLK_EN (1 << 3) | 17 | #define APMU_AXICLK_EN (1 << 3) |
33 | #define APMU_FNRST_DIS (1 << 1) | 18 | #define APMU_FNRST_DIS (1 << 1) |
diff --git a/arch/arm/mach-mmp/irq.c b/arch/arm/mach-mmp/irq.c index e60c7d98922b..3c71246cd994 100644 --- a/arch/arm/mach-mmp/irq.c +++ b/arch/arm/mach-mmp/irq.c | |||
@@ -153,10 +153,8 @@ static void icu_mux_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
153 | status = readl_relaxed(data->reg_status) & ~mask; | 153 | status = readl_relaxed(data->reg_status) & ~mask; |
154 | if (status == 0) | 154 | if (status == 0) |
155 | break; | 155 | break; |
156 | n = find_first_bit(&status, BITS_PER_LONG); | 156 | for_each_set_bit(n, &status, BITS_PER_LONG) { |
157 | while (n < BITS_PER_LONG) { | ||
158 | generic_handle_irq(icu_data[i].virq_base + n); | 157 | generic_handle_irq(icu_data[i].virq_base + n); |
159 | n = find_next_bit(&status, BITS_PER_LONG, n + 1); | ||
160 | } | 158 | } |
161 | } | 159 | } |
162 | } | 160 | } |
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index c709a24a9d25..c2ce3d05b044 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <asm/mach/time.h> | 20 | #include <asm/mach/time.h> |
21 | #include <mach/addr-map.h> | 21 | #include <mach/addr-map.h> |
22 | #include <mach/regs-apbc.h> | 22 | #include <mach/regs-apbc.h> |
23 | #include <mach/regs-apmu.h> | ||
24 | #include <mach/cputype.h> | 23 | #include <mach/cputype.h> |
25 | #include <mach/irqs.h> | 24 | #include <mach/irqs.h> |
26 | #include <mach/dma.h> | 25 | #include <mach/dma.h> |
@@ -29,7 +28,6 @@ | |||
29 | #include <mach/mmp2.h> | 28 | #include <mach/mmp2.h> |
30 | 29 | ||
31 | #include "common.h" | 30 | #include "common.h" |
32 | #include "clock.h" | ||
33 | 31 | ||
34 | #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) | 32 | #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) |
35 | 33 | ||
@@ -98,67 +96,6 @@ void __init mmp2_init_irq(void) | |||
98 | mmp2_init_icu(); | 96 | mmp2_init_icu(); |
99 | } | 97 | } |
100 | 98 | ||
101 | static void sdhc_clk_enable(struct clk *clk) | ||
102 | { | ||
103 | uint32_t clk_rst; | ||
104 | |||
105 | clk_rst = __raw_readl(clk->clk_rst); | ||
106 | clk_rst |= clk->enable_val; | ||
107 | __raw_writel(clk_rst, clk->clk_rst); | ||
108 | } | ||
109 | |||
110 | static void sdhc_clk_disable(struct clk *clk) | ||
111 | { | ||
112 | uint32_t clk_rst; | ||
113 | |||
114 | clk_rst = __raw_readl(clk->clk_rst); | ||
115 | clk_rst &= ~clk->enable_val; | ||
116 | __raw_writel(clk_rst, clk->clk_rst); | ||
117 | } | ||
118 | |||
119 | struct clkops sdhc_clk_ops = { | ||
120 | .enable = sdhc_clk_enable, | ||
121 | .disable = sdhc_clk_disable, | ||
122 | }; | ||
123 | |||
124 | /* APB peripheral clocks */ | ||
125 | static APBC_CLK(uart1, MMP2_UART1, 1, 26000000); | ||
126 | static APBC_CLK(uart2, MMP2_UART2, 1, 26000000); | ||
127 | static APBC_CLK(uart3, MMP2_UART3, 1, 26000000); | ||
128 | static APBC_CLK(uart4, MMP2_UART4, 1, 26000000); | ||
129 | static APBC_CLK(twsi1, MMP2_TWSI1, 0, 26000000); | ||
130 | static APBC_CLK(twsi2, MMP2_TWSI2, 0, 26000000); | ||
131 | static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000); | ||
132 | static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000); | ||
133 | static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000); | ||
134 | static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000); | ||
135 | static APBC_CLK(gpio, MMP2_GPIO, 0, 26000000); | ||
136 | |||
137 | static APMU_CLK(nand, NAND, 0xbf, 100000000); | ||
138 | static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops); | ||
139 | static APMU_CLK_OPS(sdh1, SDH1, 0x1b, 200000000, &sdhc_clk_ops); | ||
140 | static APMU_CLK_OPS(sdh2, SDH2, 0x1b, 200000000, &sdhc_clk_ops); | ||
141 | static APMU_CLK_OPS(sdh3, SDH3, 0x1b, 200000000, &sdhc_clk_ops); | ||
142 | |||
143 | static struct clk_lookup mmp2_clkregs[] = { | ||
144 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | ||
145 | INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), | ||
146 | INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL), | ||
147 | INIT_CLKREG(&clk_uart4, "pxa2xx-uart.3", NULL), | ||
148 | INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.0", NULL), | ||
149 | INIT_CLKREG(&clk_twsi2, "pxa2xx-i2c.1", NULL), | ||
150 | INIT_CLKREG(&clk_twsi3, "pxa2xx-i2c.2", NULL), | ||
151 | INIT_CLKREG(&clk_twsi4, "pxa2xx-i2c.3", NULL), | ||
152 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), | ||
153 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), | ||
154 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | ||
155 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
156 | INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"), | ||
157 | INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"), | ||
158 | INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"), | ||
159 | INIT_CLKREG(&clk_sdh3, "sdhci-pxav3.3", "PXA-SDHCLK"), | ||
160 | }; | ||
161 | |||
162 | static int __init mmp2_init(void) | 99 | static int __init mmp2_init(void) |
163 | { | 100 | { |
164 | if (cpu_is_mmp2()) { | 101 | if (cpu_is_mmp2()) { |
@@ -168,25 +105,27 @@ static int __init mmp2_init(void) | |||
168 | mfp_init_base(MFPR_VIRT_BASE); | 105 | mfp_init_base(MFPR_VIRT_BASE); |
169 | mfp_init_addr(mmp2_addr_map); | 106 | mfp_init_addr(mmp2_addr_map); |
170 | pxa_init_dma(IRQ_MMP2_DMA_RIQ, 16); | 107 | pxa_init_dma(IRQ_MMP2_DMA_RIQ, 16); |
171 | clkdev_add_table(ARRAY_AND_SIZE(mmp2_clkregs)); | 108 | mmp2_clk_init(); |
172 | } | 109 | } |
173 | 110 | ||
174 | return 0; | 111 | return 0; |
175 | } | 112 | } |
176 | postcore_initcall(mmp2_init); | 113 | postcore_initcall(mmp2_init); |
177 | 114 | ||
115 | #define APBC_TIMERS APBC_REG(0x024) | ||
116 | |||
178 | static void __init mmp2_timer_init(void) | 117 | static void __init mmp2_timer_init(void) |
179 | { | 118 | { |
180 | unsigned long clk_rst; | 119 | unsigned long clk_rst; |
181 | 120 | ||
182 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_MMP2_TIMERS); | 121 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); |
183 | 122 | ||
184 | /* | 123 | /* |
185 | * enable bus/functional clock, enable 6.5MHz (divider 4), | 124 | * enable bus/functional clock, enable 6.5MHz (divider 4), |
186 | * release reset | 125 | * release reset |
187 | */ | 126 | */ |
188 | clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1); | 127 | clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1); |
189 | __raw_writel(clk_rst, APBC_MMP2_TIMERS); | 128 | __raw_writel(clk_rst, APBC_TIMERS); |
190 | 129 | ||
191 | timer_init(IRQ_MMP2_TIMER1); | 130 | timer_init(IRQ_MMP2_TIMER1); |
192 | } | 131 | } |
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 62d787c34475..b7f074f15498 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -18,8 +18,8 @@ | |||
18 | 18 | ||
19 | #include <asm/mach/time.h> | 19 | #include <asm/mach/time.h> |
20 | #include <asm/system_misc.h> | 20 | #include <asm/system_misc.h> |
21 | #include <mach/addr-map.h> | ||
22 | #include <mach/cputype.h> | 21 | #include <mach/cputype.h> |
22 | #include <mach/addr-map.h> | ||
23 | #include <mach/regs-apbc.h> | 23 | #include <mach/regs-apbc.h> |
24 | #include <mach/regs-apmu.h> | 24 | #include <mach/regs-apmu.h> |
25 | #include <mach/irqs.h> | 25 | #include <mach/irqs.h> |
@@ -50,62 +50,13 @@ void __init pxa168_init_irq(void) | |||
50 | icu_init_irq(); | 50 | icu_init_irq(); |
51 | } | 51 | } |
52 | 52 | ||
53 | /* APB peripheral clocks */ | ||
54 | static APBC_CLK(uart1, PXA168_UART1, 1, 14745600); | ||
55 | static APBC_CLK(uart2, PXA168_UART2, 1, 14745600); | ||
56 | static APBC_CLK(uart3, PXA168_UART3, 1, 14745600); | ||
57 | static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000); | ||
58 | static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000); | ||
59 | static APBC_CLK(pwm1, PXA168_PWM1, 1, 13000000); | ||
60 | static APBC_CLK(pwm2, PXA168_PWM2, 1, 13000000); | ||
61 | static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000); | ||
62 | static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000); | ||
63 | static APBC_CLK(ssp1, PXA168_SSP1, 4, 0); | ||
64 | static APBC_CLK(ssp2, PXA168_SSP2, 4, 0); | ||
65 | static APBC_CLK(ssp3, PXA168_SSP3, 4, 0); | ||
66 | static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); | ||
67 | static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); | ||
68 | static APBC_CLK(gpio, PXA168_GPIO, 0, 13000000); | ||
69 | static APBC_CLK(keypad, PXA168_KPC, 0, 32000); | ||
70 | static APBC_CLK(rtc, PXA168_RTC, 8, 32768); | ||
71 | |||
72 | static APMU_CLK(nand, NAND, 0x19b, 156000000); | ||
73 | static APMU_CLK(lcd, LCD, 0x7f, 312000000); | ||
74 | static APMU_CLK(eth, ETH, 0x09, 0); | ||
75 | static APMU_CLK(usb, USB, 0x12, 0); | ||
76 | |||
77 | /* device and clock bindings */ | ||
78 | static struct clk_lookup pxa168_clkregs[] = { | ||
79 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | ||
80 | INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), | ||
81 | INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL), | ||
82 | INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL), | ||
83 | INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL), | ||
84 | INIT_CLKREG(&clk_pwm1, "pxa168-pwm.0", NULL), | ||
85 | INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL), | ||
86 | INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL), | ||
87 | INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL), | ||
88 | INIT_CLKREG(&clk_ssp1, "pxa168-ssp.0", NULL), | ||
89 | INIT_CLKREG(&clk_ssp2, "pxa168-ssp.1", NULL), | ||
90 | INIT_CLKREG(&clk_ssp3, "pxa168-ssp.2", NULL), | ||
91 | INIT_CLKREG(&clk_ssp4, "pxa168-ssp.3", NULL), | ||
92 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), | ||
93 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | ||
94 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), | ||
95 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
96 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), | ||
97 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), | ||
98 | INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"), | ||
99 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), | ||
100 | }; | ||
101 | |||
102 | static int __init pxa168_init(void) | 53 | static int __init pxa168_init(void) |
103 | { | 54 | { |
104 | if (cpu_is_pxa168()) { | 55 | if (cpu_is_pxa168()) { |
105 | mfp_init_base(MFPR_VIRT_BASE); | 56 | mfp_init_base(MFPR_VIRT_BASE); |
106 | mfp_init_addr(pxa168_mfp_addr_map); | 57 | mfp_init_addr(pxa168_mfp_addr_map); |
107 | pxa_init_dma(IRQ_PXA168_DMA_INT0, 32); | 58 | pxa_init_dma(IRQ_PXA168_DMA_INT0, 32); |
108 | clkdev_add_table(ARRAY_AND_SIZE(pxa168_clkregs)); | 59 | pxa168_clk_init(); |
109 | } | 60 | } |
110 | 61 | ||
111 | return 0; | 62 | return 0; |
@@ -114,6 +65,7 @@ postcore_initcall(pxa168_init); | |||
114 | 65 | ||
115 | /* system timer - clock enabled, 3.25MHz */ | 66 | /* system timer - clock enabled, 3.25MHz */ |
116 | #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) | 67 | #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) |
68 | #define APBC_TIMERS APBC_REG(0x34) | ||
117 | 69 | ||
118 | static void __init pxa168_timer_init(void) | 70 | static void __init pxa168_timer_init(void) |
119 | { | 71 | { |
@@ -121,10 +73,10 @@ static void __init pxa168_timer_init(void) | |||
121 | * ourselves instead of using clk_* API. Clock rate is defined | 73 | * ourselves instead of using clk_* API. Clock rate is defined |
122 | * by APBC_TIMERS_CLK_RST (3.25MHz) and enabled free-running | 74 | * by APBC_TIMERS_CLK_RST (3.25MHz) and enabled free-running |
123 | */ | 75 | */ |
124 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_PXA168_TIMERS); | 76 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); |
125 | 77 | ||
126 | /* 3.25MHz, bus/functional clock enabled, release reset */ | 78 | /* 3.25MHz, bus/functional clock enabled, release reset */ |
127 | __raw_writel(TIMER_CLK_RST, APBC_PXA168_TIMERS); | 79 | __raw_writel(TIMER_CLK_RST, APBC_TIMERS); |
128 | 80 | ||
129 | timer_init(IRQ_PXA168_TIMER1); | 81 | timer_init(IRQ_PXA168_TIMER1); |
130 | } | 82 | } |
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 6da52e9f2bdc..7d84521bb715 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <asm/mach/time.h> | 17 | #include <asm/mach/time.h> |
18 | #include <mach/addr-map.h> | 18 | #include <mach/addr-map.h> |
19 | #include <mach/regs-apbc.h> | 19 | #include <mach/regs-apbc.h> |
20 | #include <mach/regs-apmu.h> | ||
21 | #include <mach/cputype.h> | 20 | #include <mach/cputype.h> |
22 | #include <mach/irqs.h> | 21 | #include <mach/irqs.h> |
23 | #include <mach/dma.h> | 22 | #include <mach/dma.h> |
@@ -25,7 +24,6 @@ | |||
25 | #include <mach/devices.h> | 24 | #include <mach/devices.h> |
26 | 25 | ||
27 | #include "common.h" | 26 | #include "common.h" |
28 | #include "clock.h" | ||
29 | 27 | ||
30 | #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) | 28 | #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) |
31 | 29 | ||
@@ -82,44 +80,13 @@ void __init pxa910_init_irq(void) | |||
82 | icu_init_irq(); | 80 | icu_init_irq(); |
83 | } | 81 | } |
84 | 82 | ||
85 | /* APB peripheral clocks */ | ||
86 | static APBC_CLK(uart1, PXA910_UART0, 1, 14745600); | ||
87 | static APBC_CLK(uart2, PXA910_UART1, 1, 14745600); | ||
88 | static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000); | ||
89 | static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000); | ||
90 | static APBC_CLK(pwm1, PXA910_PWM1, 1, 13000000); | ||
91 | static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); | ||
92 | static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); | ||
93 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); | ||
94 | static APBC_CLK(gpio, PXA910_GPIO, 0, 13000000); | ||
95 | static APBC_CLK(rtc, PXA910_RTC, 8, 32768); | ||
96 | |||
97 | static APMU_CLK(nand, NAND, 0x19b, 156000000); | ||
98 | static APMU_CLK(u2o, USB, 0x1b, 480000000); | ||
99 | |||
100 | /* device and clock bindings */ | ||
101 | static struct clk_lookup pxa910_clkregs[] = { | ||
102 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | ||
103 | INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), | ||
104 | INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL), | ||
105 | INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL), | ||
106 | INIT_CLKREG(&clk_pwm1, "pxa910-pwm.0", NULL), | ||
107 | INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL), | ||
108 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), | ||
109 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), | ||
110 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | ||
111 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
112 | INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"), | ||
113 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), | ||
114 | }; | ||
115 | |||
116 | static int __init pxa910_init(void) | 83 | static int __init pxa910_init(void) |
117 | { | 84 | { |
118 | if (cpu_is_pxa910()) { | 85 | if (cpu_is_pxa910()) { |
119 | mfp_init_base(MFPR_VIRT_BASE); | 86 | mfp_init_base(MFPR_VIRT_BASE); |
120 | mfp_init_addr(pxa910_mfp_addr_map); | 87 | mfp_init_addr(pxa910_mfp_addr_map); |
121 | pxa_init_dma(IRQ_PXA910_DMA_INT0, 32); | 88 | pxa_init_dma(IRQ_PXA910_DMA_INT0, 32); |
122 | clkdev_add_table(ARRAY_AND_SIZE(pxa910_clkregs)); | 89 | pxa910_clk_init(); |
123 | } | 90 | } |
124 | 91 | ||
125 | return 0; | 92 | return 0; |
@@ -128,12 +95,13 @@ postcore_initcall(pxa910_init); | |||
128 | 95 | ||
129 | /* system timer - clock enabled, 3.25MHz */ | 96 | /* system timer - clock enabled, 3.25MHz */ |
130 | #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) | 97 | #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) |
98 | #define APBC_TIMERS APBC_REG(0x34) | ||
131 | 99 | ||
132 | static void __init pxa910_timer_init(void) | 100 | static void __init pxa910_timer_init(void) |
133 | { | 101 | { |
134 | /* reset and configure */ | 102 | /* reset and configure */ |
135 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_PXA910_TIMERS); | 103 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); |
136 | __raw_writel(TIMER_CLK_RST, APBC_PXA910_TIMERS); | 104 | __raw_writel(TIMER_CLK_RST, APBC_TIMERS); |
137 | 105 | ||
138 | timer_init(IRQ_PXA910_AP1_TIMER1); | 106 | timer_init(IRQ_PXA910_AP1_TIMER1); |
139 | } | 107 | } |
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile index 4ad3969b9881..6a6c197212eb 100644 --- a/arch/arm/mach-msm/Makefile +++ b/arch/arm/mach-msm/Makefile | |||
@@ -1,11 +1,11 @@ | |||
1 | obj-y += io.o idle.o timer.o | 1 | obj-y += io.o timer.o |
2 | obj-y += clock.o | 2 | obj-y += clock.o |
3 | obj-$(CONFIG_DEBUG_FS) += clock-debug.o | 3 | obj-$(CONFIG_DEBUG_FS) += clock-debug.o |
4 | 4 | ||
5 | obj-$(CONFIG_MSM_VIC) += irq-vic.o | 5 | obj-$(CONFIG_MSM_VIC) += irq-vic.o |
6 | obj-$(CONFIG_MSM_IOMMU) += devices-iommu.o | 6 | obj-$(CONFIG_MSM_IOMMU) += devices-iommu.o |
7 | 7 | ||
8 | obj-$(CONFIG_ARCH_MSM7X00A) += dma.o irq.o acpuclock-arm11.o | 8 | obj-$(CONFIG_ARCH_MSM7X00A) += dma.o irq.o |
9 | obj-$(CONFIG_ARCH_MSM7X30) += dma.o | 9 | obj-$(CONFIG_ARCH_MSM7X30) += dma.o |
10 | obj-$(CONFIG_ARCH_QSD8X50) += dma.o sirc.o | 10 | obj-$(CONFIG_ARCH_QSD8X50) += dma.o sirc.o |
11 | 11 | ||
diff --git a/arch/arm/mach-msm/acpuclock-arm11.c b/arch/arm/mach-msm/acpuclock-arm11.c deleted file mode 100644 index 805d4ee53f7e..000000000000 --- a/arch/arm/mach-msm/acpuclock-arm11.c +++ /dev/null | |||
@@ -1,525 +0,0 @@ | |||
1 | /* arch/arm/mach-msm/acpuclock.c | ||
2 | * | ||
3 | * MSM architecture clock driver | ||
4 | * | ||
5 | * Copyright (C) 2007 Google, Inc. | ||
6 | * Copyright (c) 2007 QUALCOMM Incorporated | ||
7 | * Author: San Mehat <san@android.com> | ||
8 | * | ||
9 | * This software is licensed under the terms of the GNU General Public | ||
10 | * License version 2, as published by the Free Software Foundation, and | ||
11 | * may be copied, distributed, and modified under those terms. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/list.h> | ||
23 | #include <linux/errno.h> | ||
24 | #include <linux/string.h> | ||
25 | #include <linux/delay.h> | ||
26 | #include <linux/clk.h> | ||
27 | #include <linux/cpufreq.h> | ||
28 | #include <linux/mutex.h> | ||
29 | #include <linux/io.h> | ||
30 | #include <mach/board.h> | ||
31 | #include <mach/msm_iomap.h> | ||
32 | |||
33 | #include "proc_comm.h" | ||
34 | #include "acpuclock.h" | ||
35 | |||
36 | |||
37 | #define A11S_CLK_CNTL_ADDR (MSM_CSR_BASE + 0x100) | ||
38 | #define A11S_CLK_SEL_ADDR (MSM_CSR_BASE + 0x104) | ||
39 | #define A11S_VDD_SVS_PLEVEL_ADDR (MSM_CSR_BASE + 0x124) | ||
40 | |||
41 | /* | ||
42 | * ARM11 clock configuration for specific ACPU speeds | ||
43 | */ | ||
44 | |||
45 | #define ACPU_PLL_TCXO -1 | ||
46 | #define ACPU_PLL_0 0 | ||
47 | #define ACPU_PLL_1 1 | ||
48 | #define ACPU_PLL_2 2 | ||
49 | #define ACPU_PLL_3 3 | ||
50 | |||
51 | #define PERF_SWITCH_DEBUG 0 | ||
52 | #define PERF_SWITCH_STEP_DEBUG 0 | ||
53 | |||
54 | struct clock_state | ||
55 | { | ||
56 | struct clkctl_acpu_speed *current_speed; | ||
57 | struct mutex lock; | ||
58 | uint32_t acpu_switch_time_us; | ||
59 | uint32_t max_speed_delta_khz; | ||
60 | uint32_t vdd_switch_time_us; | ||
61 | unsigned long power_collapse_khz; | ||
62 | unsigned long wait_for_irq_khz; | ||
63 | }; | ||
64 | |||
65 | static struct clk *ebi1_clk; | ||
66 | static struct clock_state drv_state = { 0 }; | ||
67 | |||
68 | static void __init acpuclk_init(void); | ||
69 | |||
70 | /* MSM7201A Levels 3-6 all correspond to 1.2V, level 7 corresponds to 1.325V. */ | ||
71 | enum { | ||
72 | VDD_0 = 0, | ||
73 | VDD_1 = 1, | ||
74 | VDD_2 = 2, | ||
75 | VDD_3 = 3, | ||
76 | VDD_4 = 3, | ||
77 | VDD_5 = 3, | ||
78 | VDD_6 = 3, | ||
79 | VDD_7 = 7, | ||
80 | VDD_END | ||
81 | }; | ||
82 | |||
83 | struct clkctl_acpu_speed { | ||
84 | unsigned int a11clk_khz; | ||
85 | int pll; | ||
86 | unsigned int a11clk_src_sel; | ||
87 | unsigned int a11clk_src_div; | ||
88 | unsigned int ahbclk_khz; | ||
89 | unsigned int ahbclk_div; | ||
90 | int vdd; | ||
91 | unsigned int axiclk_khz; | ||
92 | unsigned long lpj; /* loops_per_jiffy */ | ||
93 | /* Index in acpu_freq_tbl[] for steppings. */ | ||
94 | short down; | ||
95 | short up; | ||
96 | }; | ||
97 | |||
98 | /* | ||
99 | * ACPU speed table. Complete table is shown but certain speeds are commented | ||
100 | * out to optimized speed switching. Initialize loops_per_jiffy to 0. | ||
101 | * | ||
102 | * Table stepping up/down is optimized for 256mhz jumps while staying on the | ||
103 | * same PLL. | ||
104 | */ | ||
105 | #if (0) | ||
106 | static struct clkctl_acpu_speed acpu_freq_tbl[] = { | ||
107 | { 19200, ACPU_PLL_TCXO, 0, 0, 19200, 0, VDD_0, 30720, 0, 0, 8 }, | ||
108 | { 61440, ACPU_PLL_0, 4, 3, 61440, 0, VDD_0, 30720, 0, 0, 8 }, | ||
109 | { 81920, ACPU_PLL_0, 4, 2, 40960, 1, VDD_0, 61440, 0, 0, 8 }, | ||
110 | { 96000, ACPU_PLL_1, 1, 7, 48000, 1, VDD_0, 61440, 0, 0, 9 }, | ||
111 | { 122880, ACPU_PLL_0, 4, 1, 61440, 1, VDD_3, 61440, 0, 0, 8 }, | ||
112 | { 128000, ACPU_PLL_1, 1, 5, 64000, 1, VDD_3, 61440, 0, 0, 12 }, | ||
113 | { 176000, ACPU_PLL_2, 2, 5, 88000, 1, VDD_3, 61440, 0, 0, 11 }, | ||
114 | { 192000, ACPU_PLL_1, 1, 3, 64000, 2, VDD_3, 61440, 0, 0, 12 }, | ||
115 | { 245760, ACPU_PLL_0, 4, 0, 81920, 2, VDD_4, 61440, 0, 0, 12 }, | ||
116 | { 256000, ACPU_PLL_1, 1, 2, 128000, 2, VDD_5, 128000, 0, 0, 12 }, | ||
117 | { 264000, ACPU_PLL_2, 2, 3, 88000, 2, VDD_5, 128000, 0, 6, 13 }, | ||
118 | { 352000, ACPU_PLL_2, 2, 2, 88000, 3, VDD_5, 128000, 0, 6, 13 }, | ||
119 | { 384000, ACPU_PLL_1, 1, 1, 128000, 2, VDD_6, 128000, 0, 5, -1 }, | ||
120 | { 528000, ACPU_PLL_2, 2, 1, 132000, 3, VDD_7, 128000, 0, 11, -1 }, | ||
121 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
122 | }; | ||
123 | #else /* Table of freq we currently use. */ | ||
124 | static struct clkctl_acpu_speed acpu_freq_tbl[] = { | ||
125 | { 19200, ACPU_PLL_TCXO, 0, 0, 19200, 0, VDD_0, 30720, 0, 0, 4 }, | ||
126 | { 122880, ACPU_PLL_0, 4, 1, 61440, 1, VDD_3, 61440, 0, 0, 4 }, | ||
127 | { 128000, ACPU_PLL_1, 1, 5, 64000, 1, VDD_3, 61440, 0, 0, 6 }, | ||
128 | { 176000, ACPU_PLL_2, 2, 5, 88000, 1, VDD_3, 61440, 0, 0, 5 }, | ||
129 | { 245760, ACPU_PLL_0, 4, 0, 81920, 2, VDD_4, 61440, 0, 0, 5 }, | ||
130 | { 352000, ACPU_PLL_2, 2, 2, 88000, 3, VDD_5, 128000, 0, 3, 7 }, | ||
131 | { 384000, ACPU_PLL_1, 1, 1, 128000, 2, VDD_6, 128000, 0, 2, -1 }, | ||
132 | { 528000, ACPU_PLL_2, 2, 1, 132000, 3, VDD_7, 128000, 0, 5, -1 }, | ||
133 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, | ||
134 | }; | ||
135 | #endif | ||
136 | |||
137 | |||
138 | #ifdef CONFIG_CPU_FREQ_TABLE | ||
139 | static struct cpufreq_frequency_table freq_table[] = { | ||
140 | { 0, 122880 }, | ||
141 | { 1, 128000 }, | ||
142 | { 2, 245760 }, | ||
143 | { 3, 384000 }, | ||
144 | { 4, 528000 }, | ||
145 | { 5, CPUFREQ_TABLE_END }, | ||
146 | }; | ||
147 | #endif | ||
148 | |||
149 | static int pc_pll_request(unsigned id, unsigned on) | ||
150 | { | ||
151 | int res; | ||
152 | on = !!on; | ||
153 | |||
154 | #if PERF_SWITCH_DEBUG | ||
155 | if (on) | ||
156 | printk(KERN_DEBUG "Enabling PLL %d\n", id); | ||
157 | else | ||
158 | printk(KERN_DEBUG "Disabling PLL %d\n", id); | ||
159 | #endif | ||
160 | |||
161 | res = msm_proc_comm(PCOM_CLKCTL_RPC_PLL_REQUEST, &id, &on); | ||
162 | if (res < 0) | ||
163 | return res; | ||
164 | |||
165 | #if PERF_SWITCH_DEBUG | ||
166 | if (on) | ||
167 | printk(KERN_DEBUG "PLL %d enabled\n", id); | ||
168 | else | ||
169 | printk(KERN_DEBUG "PLL %d disabled\n", id); | ||
170 | #endif | ||
171 | return res; | ||
172 | } | ||
173 | |||
174 | |||
175 | /*---------------------------------------------------------------------------- | ||
176 | * ARM11 'owned' clock control | ||
177 | *---------------------------------------------------------------------------*/ | ||
178 | |||
179 | unsigned long acpuclk_power_collapse(void) { | ||
180 | int ret = acpuclk_get_rate(); | ||
181 | ret *= 1000; | ||
182 | if (ret > drv_state.power_collapse_khz) | ||
183 | acpuclk_set_rate(drv_state.power_collapse_khz, 1); | ||
184 | return ret; | ||
185 | } | ||
186 | |||
187 | unsigned long acpuclk_get_wfi_rate(void) | ||
188 | { | ||
189 | return drv_state.wait_for_irq_khz; | ||
190 | } | ||
191 | |||
192 | unsigned long acpuclk_wait_for_irq(void) { | ||
193 | int ret = acpuclk_get_rate(); | ||
194 | ret *= 1000; | ||
195 | if (ret > drv_state.wait_for_irq_khz) | ||
196 | acpuclk_set_rate(drv_state.wait_for_irq_khz, 1); | ||
197 | return ret; | ||
198 | } | ||
199 | |||
200 | static int acpuclk_set_vdd_level(int vdd) | ||
201 | { | ||
202 | uint32_t current_vdd; | ||
203 | |||
204 | current_vdd = readl(A11S_VDD_SVS_PLEVEL_ADDR) & 0x07; | ||
205 | |||
206 | #if PERF_SWITCH_DEBUG | ||
207 | printk(KERN_DEBUG "acpuclock: Switching VDD from %u -> %d\n", | ||
208 | current_vdd, vdd); | ||
209 | #endif | ||
210 | writel((1 << 7) | (vdd << 3), A11S_VDD_SVS_PLEVEL_ADDR); | ||
211 | udelay(drv_state.vdd_switch_time_us); | ||
212 | if ((readl(A11S_VDD_SVS_PLEVEL_ADDR) & 0x7) != vdd) { | ||
213 | #if PERF_SWITCH_DEBUG | ||
214 | printk(KERN_ERR "acpuclock: VDD set failed\n"); | ||
215 | #endif | ||
216 | return -EIO; | ||
217 | } | ||
218 | |||
219 | #if PERF_SWITCH_DEBUG | ||
220 | printk(KERN_DEBUG "acpuclock: VDD switched\n"); | ||
221 | #endif | ||
222 | return 0; | ||
223 | } | ||
224 | |||
225 | /* Set proper dividers for the given clock speed. */ | ||
226 | static void acpuclk_set_div(const struct clkctl_acpu_speed *hunt_s) { | ||
227 | uint32_t reg_clkctl, reg_clksel, clk_div; | ||
228 | |||
229 | /* AHB_CLK_DIV */ | ||
230 | clk_div = (readl(A11S_CLK_SEL_ADDR) >> 1) & 0x03; | ||
231 | /* | ||
232 | * If the new clock divider is higher than the previous, then | ||
233 | * program the divider before switching the clock | ||
234 | */ | ||
235 | if (hunt_s->ahbclk_div > clk_div) { | ||
236 | reg_clksel = readl(A11S_CLK_SEL_ADDR); | ||
237 | reg_clksel &= ~(0x3 << 1); | ||
238 | reg_clksel |= (hunt_s->ahbclk_div << 1); | ||
239 | writel(reg_clksel, A11S_CLK_SEL_ADDR); | ||
240 | } | ||
241 | if ((readl(A11S_CLK_SEL_ADDR) & 0x01) == 0) { | ||
242 | /* SRC0 */ | ||
243 | |||
244 | /* Program clock source */ | ||
245 | reg_clkctl = readl(A11S_CLK_CNTL_ADDR); | ||
246 | reg_clkctl &= ~(0x07 << 4); | ||
247 | reg_clkctl |= (hunt_s->a11clk_src_sel << 4); | ||
248 | writel(reg_clkctl, A11S_CLK_CNTL_ADDR); | ||
249 | |||
250 | /* Program clock divider */ | ||
251 | reg_clkctl = readl(A11S_CLK_CNTL_ADDR); | ||
252 | reg_clkctl &= ~0xf; | ||
253 | reg_clkctl |= hunt_s->a11clk_src_div; | ||
254 | writel(reg_clkctl, A11S_CLK_CNTL_ADDR); | ||
255 | |||
256 | /* Program clock source selection */ | ||
257 | reg_clksel = readl(A11S_CLK_SEL_ADDR); | ||
258 | reg_clksel |= 1; /* CLK_SEL_SRC1NO == SRC1 */ | ||
259 | writel(reg_clksel, A11S_CLK_SEL_ADDR); | ||
260 | } else { | ||
261 | /* SRC1 */ | ||
262 | |||
263 | /* Program clock source */ | ||
264 | reg_clkctl = readl(A11S_CLK_CNTL_ADDR); | ||
265 | reg_clkctl &= ~(0x07 << 12); | ||
266 | reg_clkctl |= (hunt_s->a11clk_src_sel << 12); | ||
267 | writel(reg_clkctl, A11S_CLK_CNTL_ADDR); | ||
268 | |||
269 | /* Program clock divider */ | ||
270 | reg_clkctl = readl(A11S_CLK_CNTL_ADDR); | ||
271 | reg_clkctl &= ~(0xf << 8); | ||
272 | reg_clkctl |= (hunt_s->a11clk_src_div << 8); | ||
273 | writel(reg_clkctl, A11S_CLK_CNTL_ADDR); | ||
274 | |||
275 | /* Program clock source selection */ | ||
276 | reg_clksel = readl(A11S_CLK_SEL_ADDR); | ||
277 | reg_clksel &= ~1; /* CLK_SEL_SRC1NO == SRC0 */ | ||
278 | writel(reg_clksel, A11S_CLK_SEL_ADDR); | ||
279 | } | ||
280 | |||
281 | /* | ||
282 | * If the new clock divider is lower than the previous, then | ||
283 | * program the divider after switching the clock | ||
284 | */ | ||
285 | if (hunt_s->ahbclk_div < clk_div) { | ||
286 | reg_clksel = readl(A11S_CLK_SEL_ADDR); | ||
287 | reg_clksel &= ~(0x3 << 1); | ||
288 | reg_clksel |= (hunt_s->ahbclk_div << 1); | ||
289 | writel(reg_clksel, A11S_CLK_SEL_ADDR); | ||
290 | } | ||
291 | } | ||
292 | |||
293 | int acpuclk_set_rate(unsigned long rate, int for_power_collapse) | ||
294 | { | ||
295 | uint32_t reg_clkctl; | ||
296 | struct clkctl_acpu_speed *cur_s, *tgt_s, *strt_s; | ||
297 | int rc = 0; | ||
298 | unsigned int plls_enabled = 0, pll; | ||
299 | |||
300 | strt_s = cur_s = drv_state.current_speed; | ||
301 | |||
302 | WARN_ONCE(cur_s == NULL, "acpuclk_set_rate: not initialized\n"); | ||
303 | if (cur_s == NULL) | ||
304 | return -ENOENT; | ||
305 | |||
306 | if (rate == (cur_s->a11clk_khz * 1000)) | ||
307 | return 0; | ||
308 | |||
309 | for (tgt_s = acpu_freq_tbl; tgt_s->a11clk_khz != 0; tgt_s++) { | ||
310 | if (tgt_s->a11clk_khz == (rate / 1000)) | ||
311 | break; | ||
312 | } | ||
313 | |||
314 | if (tgt_s->a11clk_khz == 0) | ||
315 | return -EINVAL; | ||
316 | |||
317 | /* Choose the highest speed speed at or below 'rate' with same PLL. */ | ||
318 | if (for_power_collapse && tgt_s->a11clk_khz < cur_s->a11clk_khz) { | ||
319 | while (tgt_s->pll != ACPU_PLL_TCXO && tgt_s->pll != cur_s->pll) | ||
320 | tgt_s--; | ||
321 | } | ||
322 | |||
323 | if (strt_s->pll != ACPU_PLL_TCXO) | ||
324 | plls_enabled |= 1 << strt_s->pll; | ||
325 | |||
326 | if (!for_power_collapse) { | ||
327 | mutex_lock(&drv_state.lock); | ||
328 | if (strt_s->pll != tgt_s->pll && tgt_s->pll != ACPU_PLL_TCXO) { | ||
329 | rc = pc_pll_request(tgt_s->pll, 1); | ||
330 | if (rc < 0) { | ||
331 | pr_err("PLL%d enable failed (%d)\n", | ||
332 | tgt_s->pll, rc); | ||
333 | goto out; | ||
334 | } | ||
335 | plls_enabled |= 1 << tgt_s->pll; | ||
336 | } | ||
337 | /* Increase VDD if needed. */ | ||
338 | if (tgt_s->vdd > cur_s->vdd) { | ||
339 | if ((rc = acpuclk_set_vdd_level(tgt_s->vdd)) < 0) { | ||
340 | printk(KERN_ERR "Unable to switch ACPU vdd\n"); | ||
341 | goto out; | ||
342 | } | ||
343 | } | ||
344 | } | ||
345 | |||
346 | /* Set wait states for CPU between frequency changes */ | ||
347 | reg_clkctl = readl(A11S_CLK_CNTL_ADDR); | ||
348 | reg_clkctl |= (100 << 16); /* set WT_ST_CNT */ | ||
349 | writel(reg_clkctl, A11S_CLK_CNTL_ADDR); | ||
350 | |||
351 | #if PERF_SWITCH_DEBUG | ||
352 | printk(KERN_INFO "acpuclock: Switching from ACPU rate %u -> %u\n", | ||
353 | strt_s->a11clk_khz * 1000, tgt_s->a11clk_khz * 1000); | ||
354 | #endif | ||
355 | |||
356 | while (cur_s != tgt_s) { | ||
357 | /* | ||
358 | * Always jump to target freq if within 256mhz, regulardless of | ||
359 | * PLL. If differnece is greater, use the predefinied | ||
360 | * steppings in the table. | ||
361 | */ | ||
362 | int d = abs((int)(cur_s->a11clk_khz - tgt_s->a11clk_khz)); | ||
363 | if (d > drv_state.max_speed_delta_khz) { | ||
364 | /* Step up or down depending on target vs current. */ | ||
365 | int clk_index = tgt_s->a11clk_khz > cur_s->a11clk_khz ? | ||
366 | cur_s->up : cur_s->down; | ||
367 | if (clk_index < 0) { /* This should not happen. */ | ||
368 | printk(KERN_ERR "cur:%u target: %u\n", | ||
369 | cur_s->a11clk_khz, tgt_s->a11clk_khz); | ||
370 | rc = -EINVAL; | ||
371 | goto out; | ||
372 | } | ||
373 | cur_s = &acpu_freq_tbl[clk_index]; | ||
374 | } else { | ||
375 | cur_s = tgt_s; | ||
376 | } | ||
377 | #if PERF_SWITCH_STEP_DEBUG | ||
378 | printk(KERN_DEBUG "%s: STEP khz = %u, pll = %d\n", | ||
379 | __FUNCTION__, cur_s->a11clk_khz, cur_s->pll); | ||
380 | #endif | ||
381 | if (!for_power_collapse&& cur_s->pll != ACPU_PLL_TCXO | ||
382 | && !(plls_enabled & (1 << cur_s->pll))) { | ||
383 | rc = pc_pll_request(cur_s->pll, 1); | ||
384 | if (rc < 0) { | ||
385 | pr_err("PLL%d enable failed (%d)\n", | ||
386 | cur_s->pll, rc); | ||
387 | goto out; | ||
388 | } | ||
389 | plls_enabled |= 1 << cur_s->pll; | ||
390 | } | ||
391 | |||
392 | acpuclk_set_div(cur_s); | ||
393 | drv_state.current_speed = cur_s; | ||
394 | /* Re-adjust lpj for the new clock speed. */ | ||
395 | loops_per_jiffy = cur_s->lpj; | ||
396 | udelay(drv_state.acpu_switch_time_us); | ||
397 | } | ||
398 | |||
399 | /* Nothing else to do for power collapse. */ | ||
400 | if (for_power_collapse) | ||
401 | return 0; | ||
402 | |||
403 | /* Disable PLLs we are not using anymore. */ | ||
404 | plls_enabled &= ~(1 << tgt_s->pll); | ||
405 | for (pll = ACPU_PLL_0; pll <= ACPU_PLL_2; pll++) | ||
406 | if (plls_enabled & (1 << pll)) { | ||
407 | rc = pc_pll_request(pll, 0); | ||
408 | if (rc < 0) { | ||
409 | pr_err("PLL%d disable failed (%d)\n", pll, rc); | ||
410 | goto out; | ||
411 | } | ||
412 | } | ||
413 | |||
414 | /* Change the AXI bus frequency if we can. */ | ||
415 | if (strt_s->axiclk_khz != tgt_s->axiclk_khz) { | ||
416 | rc = clk_set_rate(ebi1_clk, tgt_s->axiclk_khz * 1000); | ||
417 | if (rc < 0) | ||
418 | pr_err("Setting AXI min rate failed!\n"); | ||
419 | } | ||
420 | |||
421 | /* Drop VDD level if we can. */ | ||
422 | if (tgt_s->vdd < strt_s->vdd) { | ||
423 | if (acpuclk_set_vdd_level(tgt_s->vdd) < 0) | ||
424 | printk(KERN_ERR "acpuclock: Unable to drop ACPU vdd\n"); | ||
425 | } | ||
426 | |||
427 | #if PERF_SWITCH_DEBUG | ||
428 | printk(KERN_DEBUG "%s: ACPU speed change complete\n", __FUNCTION__); | ||
429 | #endif | ||
430 | out: | ||
431 | if (!for_power_collapse) | ||
432 | mutex_unlock(&drv_state.lock); | ||
433 | return rc; | ||
434 | } | ||
435 | |||
436 | static void __init acpuclk_init(void) | ||
437 | { | ||
438 | struct clkctl_acpu_speed *speed; | ||
439 | uint32_t div, sel; | ||
440 | int rc; | ||
441 | |||
442 | /* | ||
443 | * Determine the rate of ACPU clock | ||
444 | */ | ||
445 | |||
446 | if (!(readl(A11S_CLK_SEL_ADDR) & 0x01)) { /* CLK_SEL_SRC1N0 */ | ||
447 | /* CLK_SRC0_SEL */ | ||
448 | sel = (readl(A11S_CLK_CNTL_ADDR) >> 12) & 0x7; | ||
449 | /* CLK_SRC0_DIV */ | ||
450 | div = (readl(A11S_CLK_CNTL_ADDR) >> 8) & 0x0f; | ||
451 | } else { | ||
452 | /* CLK_SRC1_SEL */ | ||
453 | sel = (readl(A11S_CLK_CNTL_ADDR) >> 4) & 0x07; | ||
454 | /* CLK_SRC1_DIV */ | ||
455 | div = readl(A11S_CLK_CNTL_ADDR) & 0x0f; | ||
456 | } | ||
457 | |||
458 | for (speed = acpu_freq_tbl; speed->a11clk_khz != 0; speed++) { | ||
459 | if (speed->a11clk_src_sel == sel | ||
460 | && (speed->a11clk_src_div == div)) | ||
461 | break; | ||
462 | } | ||
463 | if (speed->a11clk_khz == 0) { | ||
464 | printk(KERN_WARNING "Warning - ACPU clock reports invalid speed\n"); | ||
465 | return; | ||
466 | } | ||
467 | |||
468 | drv_state.current_speed = speed; | ||
469 | |||
470 | rc = clk_set_rate(ebi1_clk, speed->axiclk_khz * 1000); | ||
471 | if (rc < 0) | ||
472 | pr_err("Setting AXI min rate failed!\n"); | ||
473 | |||
474 | printk(KERN_INFO "ACPU running at %d KHz\n", speed->a11clk_khz); | ||
475 | } | ||
476 | |||
477 | unsigned long acpuclk_get_rate(void) | ||
478 | { | ||
479 | WARN_ONCE(drv_state.current_speed == NULL, | ||
480 | "acpuclk_get_rate: not initialized\n"); | ||
481 | if (drv_state.current_speed) | ||
482 | return drv_state.current_speed->a11clk_khz; | ||
483 | else | ||
484 | return 0; | ||
485 | } | ||
486 | |||
487 | uint32_t acpuclk_get_switch_time(void) | ||
488 | { | ||
489 | return drv_state.acpu_switch_time_us; | ||
490 | } | ||
491 | |||
492 | /*---------------------------------------------------------------------------- | ||
493 | * Clock driver initialization | ||
494 | *---------------------------------------------------------------------------*/ | ||
495 | |||
496 | /* Initialize the lpj field in the acpu_freq_tbl. */ | ||
497 | static void __init lpj_init(void) | ||
498 | { | ||
499 | int i; | ||
500 | const struct clkctl_acpu_speed *base_clk = drv_state.current_speed; | ||
501 | for (i = 0; acpu_freq_tbl[i].a11clk_khz; i++) { | ||
502 | acpu_freq_tbl[i].lpj = cpufreq_scale(loops_per_jiffy, | ||
503 | base_clk->a11clk_khz, | ||
504 | acpu_freq_tbl[i].a11clk_khz); | ||
505 | } | ||
506 | } | ||
507 | |||
508 | void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *clkdata) | ||
509 | { | ||
510 | pr_info("acpu_clock_init()\n"); | ||
511 | |||
512 | ebi1_clk = clk_get(NULL, "ebi1_clk"); | ||
513 | |||
514 | mutex_init(&drv_state.lock); | ||
515 | drv_state.acpu_switch_time_us = clkdata->acpu_switch_time_us; | ||
516 | drv_state.max_speed_delta_khz = clkdata->max_speed_delta_khz; | ||
517 | drv_state.vdd_switch_time_us = clkdata->vdd_switch_time_us; | ||
518 | drv_state.power_collapse_khz = clkdata->power_collapse_khz; | ||
519 | drv_state.wait_for_irq_khz = clkdata->wait_for_irq_khz; | ||
520 | acpuclk_init(); | ||
521 | lpj_init(); | ||
522 | #ifdef CONFIG_CPU_FREQ_TABLE | ||
523 | cpufreq_frequency_table_get_attr(freq_table, smp_processor_id()); | ||
524 | #endif | ||
525 | } | ||
diff --git a/arch/arm/mach-msm/acpuclock.h b/arch/arm/mach-msm/acpuclock.h deleted file mode 100644 index 415de2eb9a5e..000000000000 --- a/arch/arm/mach-msm/acpuclock.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* arch/arm/mach-msm/acpuclock.h | ||
2 | * | ||
3 | * MSM architecture clock driver header | ||
4 | * | ||
5 | * Copyright (C) 2007 Google, Inc. | ||
6 | * Copyright (c) 2007 QUALCOMM Incorporated | ||
7 | * Author: San Mehat <san@android.com> | ||
8 | * | ||
9 | * This software is licensed under the terms of the GNU General Public | ||
10 | * License version 2, as published by the Free Software Foundation, and | ||
11 | * may be copied, distributed, and modified under those terms. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __ARCH_ARM_MACH_MSM_ACPUCLOCK_H | ||
21 | #define __ARCH_ARM_MACH_MSM_ACPUCLOCK_H | ||
22 | |||
23 | int acpuclk_set_rate(unsigned long rate, int for_power_collapse); | ||
24 | unsigned long acpuclk_get_rate(void); | ||
25 | uint32_t acpuclk_get_switch_time(void); | ||
26 | unsigned long acpuclk_wait_for_irq(void); | ||
27 | unsigned long acpuclk_power_collapse(void); | ||
28 | unsigned long acpuclk_get_wfi_rate(void); | ||
29 | |||
30 | |||
31 | #endif | ||
32 | |||
diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c index cf1f89a5dc62..df00bc03ce74 100644 --- a/arch/arm/mach-msm/board-mahimahi.c +++ b/arch/arm/mach-msm/board-mahimahi.c | |||
@@ -30,7 +30,6 @@ | |||
30 | 30 | ||
31 | #include <mach/board.h> | 31 | #include <mach/board.h> |
32 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
33 | #include <mach/system.h> | ||
34 | 33 | ||
35 | #include "board-mahimahi.h" | 34 | #include "board-mahimahi.h" |
36 | #include "devices.h" | 35 | #include "devices.h" |
diff --git a/arch/arm/mach-msm/board-msm7x27.c b/arch/arm/mach-msm/board-msm7x27.c deleted file mode 100644 index 451ab1d43c92..000000000000 --- a/arch/arm/mach-msm/board-msm7x27.c +++ /dev/null | |||
@@ -1,170 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Google, Inc. | ||
3 | * Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. | ||
4 | * Author: Brian Swetland <swetland@google.com> | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | #include <linux/gpio.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/input.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/delay.h> | ||
23 | #include <linux/power_supply.h> | ||
24 | |||
25 | #include <mach/hardware.h> | ||
26 | #include <asm/mach-types.h> | ||
27 | #include <asm/mach/arch.h> | ||
28 | #include <asm/mach/map.h> | ||
29 | #include <asm/mach/flash.h> | ||
30 | #include <asm/setup.h> | ||
31 | #ifdef CONFIG_CACHE_L2X0 | ||
32 | #include <asm/hardware/cache-l2x0.h> | ||
33 | #endif | ||
34 | |||
35 | #include <mach/vreg.h> | ||
36 | #include <mach/mpp.h> | ||
37 | #include <mach/board.h> | ||
38 | #include <mach/msm_iomap.h> | ||
39 | |||
40 | #include <linux/mtd/nand.h> | ||
41 | #include <linux/mtd/partitions.h> | ||
42 | |||
43 | #include "devices.h" | ||
44 | #include "socinfo.h" | ||
45 | #include "clock.h" | ||
46 | |||
47 | static struct resource smc91x_resources[] = { | ||
48 | [0] = { | ||
49 | .start = 0x9C004300, | ||
50 | .end = 0x9C0043ff, | ||
51 | .flags = IORESOURCE_MEM, | ||
52 | }, | ||
53 | [1] = { | ||
54 | .start = MSM_GPIO_TO_INT(132), | ||
55 | .end = MSM_GPIO_TO_INT(132), | ||
56 | .flags = IORESOURCE_IRQ, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static struct platform_device smc91x_device = { | ||
61 | .name = "smc91x", | ||
62 | .id = 0, | ||
63 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
64 | .resource = smc91x_resources, | ||
65 | }; | ||
66 | |||
67 | static struct platform_device *devices[] __initdata = { | ||
68 | &msm_device_uart3, | ||
69 | &msm_device_smd, | ||
70 | &msm_device_dmov, | ||
71 | &msm_device_nand, | ||
72 | &smc91x_device, | ||
73 | }; | ||
74 | |||
75 | extern struct sys_timer msm_timer; | ||
76 | |||
77 | static void __init msm7x2x_init_irq(void) | ||
78 | { | ||
79 | msm_init_irq(); | ||
80 | } | ||
81 | |||
82 | static void __init msm7x2x_init(void) | ||
83 | { | ||
84 | if (socinfo_init() < 0) | ||
85 | BUG(); | ||
86 | |||
87 | if (machine_is_msm7x25_ffa() || machine_is_msm7x27_ffa()) { | ||
88 | smc91x_resources[0].start = 0x98000300; | ||
89 | smc91x_resources[0].end = 0x980003ff; | ||
90 | smc91x_resources[1].start = MSM_GPIO_TO_INT(85); | ||
91 | smc91x_resources[1].end = MSM_GPIO_TO_INT(85); | ||
92 | if (gpio_tlmm_config(GPIO_CFG(85, 0, | ||
93 | GPIO_INPUT, | ||
94 | GPIO_PULL_DOWN, | ||
95 | GPIO_2MA), | ||
96 | GPIO_ENABLE)) { | ||
97 | printk(KERN_ERR | ||
98 | "%s: Err: Config GPIO-85 INT\n", | ||
99 | __func__); | ||
100 | } | ||
101 | } | ||
102 | |||
103 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
104 | } | ||
105 | |||
106 | static void __init msm7x2x_map_io(void) | ||
107 | { | ||
108 | msm_map_common_io(); | ||
109 | /* Technically dependent on the SoC but using machine_is | ||
110 | * macros since socinfo is not available this early and there | ||
111 | * are plans to restructure the code which will eliminate the | ||
112 | * need for socinfo. | ||
113 | */ | ||
114 | if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa()) | ||
115 | msm_clock_init(msm_clocks_7x27, msm_num_clocks_7x27); | ||
116 | |||
117 | if (machine_is_msm7x25_surf() || machine_is_msm7x25_ffa()) | ||
118 | msm_clock_init(msm_clocks_7x25, msm_num_clocks_7x25); | ||
119 | |||
120 | #ifdef CONFIG_CACHE_L2X0 | ||
121 | if (machine_is_msm7x27_surf() || machine_is_msm7x27_ffa()) { | ||
122 | /* 7x27 has 256KB L2 cache: | ||
123 | 64Kb/Way and 4-Way Associativity; | ||
124 | R/W latency: 3 cycles; | ||
125 | evmon/parity/share disabled. */ | ||
126 | l2x0_init(MSM_L2CC_BASE, 0x00068012, 0xfe000000); | ||
127 | } | ||
128 | #endif | ||
129 | } | ||
130 | |||
131 | static void __init msm7x2x_init_late(void) | ||
132 | { | ||
133 | smd_debugfs_init(); | ||
134 | } | ||
135 | |||
136 | MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF") | ||
137 | .atag_offset = 0x100, | ||
138 | .map_io = msm7x2x_map_io, | ||
139 | .init_irq = msm7x2x_init_irq, | ||
140 | .init_machine = msm7x2x_init, | ||
141 | .init_late = msm7x2x_init_late, | ||
142 | .timer = &msm_timer, | ||
143 | MACHINE_END | ||
144 | |||
145 | MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA") | ||
146 | .atag_offset = 0x100, | ||
147 | .map_io = msm7x2x_map_io, | ||
148 | .init_irq = msm7x2x_init_irq, | ||
149 | .init_machine = msm7x2x_init, | ||
150 | .init_late = msm7x2x_init_late, | ||
151 | .timer = &msm_timer, | ||
152 | MACHINE_END | ||
153 | |||
154 | MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF") | ||
155 | .atag_offset = 0x100, | ||
156 | .map_io = msm7x2x_map_io, | ||
157 | .init_irq = msm7x2x_init_irq, | ||
158 | .init_machine = msm7x2x_init, | ||
159 | .init_late = msm7x2x_init_late, | ||
160 | .timer = &msm_timer, | ||
161 | MACHINE_END | ||
162 | |||
163 | MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA") | ||
164 | .atag_offset = 0x100, | ||
165 | .map_io = msm7x2x_map_io, | ||
166 | .init_irq = msm7x2x_init_irq, | ||
167 | .init_machine = msm7x2x_init, | ||
168 | .init_late = msm7x2x_init_late, | ||
169 | .timer = &msm_timer, | ||
170 | MACHINE_END | ||
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c index 2e569ab10eef..b7b0fc7e3278 100644 --- a/arch/arm/mach-msm/board-sapphire.c +++ b/arch/arm/mach-msm/board-sapphire.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
29 | #include <asm/mach/flash.h> | 29 | #include <asm/mach/flash.h> |
30 | #include <mach/system.h> | ||
31 | #include <mach/vreg.h> | 30 | #include <mach/vreg.h> |
32 | #include <mach/board.h> | 31 | #include <mach/board.h> |
33 | 32 | ||
diff --git a/arch/arm/mach-msm/clock-pcom.c b/arch/arm/mach-msm/clock-pcom.c index 63b711311086..a52c970df157 100644 --- a/arch/arm/mach-msm/clock-pcom.c +++ b/arch/arm/mach-msm/clock-pcom.c | |||
@@ -25,7 +25,7 @@ | |||
25 | /* | 25 | /* |
26 | * glue for the proc_comm interface | 26 | * glue for the proc_comm interface |
27 | */ | 27 | */ |
28 | int pc_clk_enable(unsigned id) | 28 | static int pc_clk_enable(unsigned id) |
29 | { | 29 | { |
30 | int rc = msm_proc_comm(PCOM_CLKCTL_RPC_ENABLE, &id, NULL); | 30 | int rc = msm_proc_comm(PCOM_CLKCTL_RPC_ENABLE, &id, NULL); |
31 | if (rc < 0) | 31 | if (rc < 0) |
@@ -34,7 +34,7 @@ int pc_clk_enable(unsigned id) | |||
34 | return (int)id < 0 ? -EINVAL : 0; | 34 | return (int)id < 0 ? -EINVAL : 0; |
35 | } | 35 | } |
36 | 36 | ||
37 | void pc_clk_disable(unsigned id) | 37 | static void pc_clk_disable(unsigned id) |
38 | { | 38 | { |
39 | msm_proc_comm(PCOM_CLKCTL_RPC_DISABLE, &id, NULL); | 39 | msm_proc_comm(PCOM_CLKCTL_RPC_DISABLE, &id, NULL); |
40 | } | 40 | } |
@@ -54,7 +54,7 @@ int pc_clk_reset(unsigned id, enum clk_reset_action action) | |||
54 | return (int)id < 0 ? -EINVAL : 0; | 54 | return (int)id < 0 ? -EINVAL : 0; |
55 | } | 55 | } |
56 | 56 | ||
57 | int pc_clk_set_rate(unsigned id, unsigned rate) | 57 | static int pc_clk_set_rate(unsigned id, unsigned rate) |
58 | { | 58 | { |
59 | /* The rate _might_ be rounded off to the nearest KHz value by the | 59 | /* The rate _might_ be rounded off to the nearest KHz value by the |
60 | * remote function. So a return value of 0 doesn't necessarily mean | 60 | * remote function. So a return value of 0 doesn't necessarily mean |
@@ -67,7 +67,7 @@ int pc_clk_set_rate(unsigned id, unsigned rate) | |||
67 | return (int)id < 0 ? -EINVAL : 0; | 67 | return (int)id < 0 ? -EINVAL : 0; |
68 | } | 68 | } |
69 | 69 | ||
70 | int pc_clk_set_min_rate(unsigned id, unsigned rate) | 70 | static int pc_clk_set_min_rate(unsigned id, unsigned rate) |
71 | { | 71 | { |
72 | int rc = msm_proc_comm(PCOM_CLKCTL_RPC_MIN_RATE, &id, &rate); | 72 | int rc = msm_proc_comm(PCOM_CLKCTL_RPC_MIN_RATE, &id, &rate); |
73 | if (rc < 0) | 73 | if (rc < 0) |
@@ -76,7 +76,7 @@ int pc_clk_set_min_rate(unsigned id, unsigned rate) | |||
76 | return (int)id < 0 ? -EINVAL : 0; | 76 | return (int)id < 0 ? -EINVAL : 0; |
77 | } | 77 | } |
78 | 78 | ||
79 | int pc_clk_set_max_rate(unsigned id, unsigned rate) | 79 | static int pc_clk_set_max_rate(unsigned id, unsigned rate) |
80 | { | 80 | { |
81 | int rc = msm_proc_comm(PCOM_CLKCTL_RPC_MAX_RATE, &id, &rate); | 81 | int rc = msm_proc_comm(PCOM_CLKCTL_RPC_MAX_RATE, &id, &rate); |
82 | if (rc < 0) | 82 | if (rc < 0) |
@@ -85,7 +85,7 @@ int pc_clk_set_max_rate(unsigned id, unsigned rate) | |||
85 | return (int)id < 0 ? -EINVAL : 0; | 85 | return (int)id < 0 ? -EINVAL : 0; |
86 | } | 86 | } |
87 | 87 | ||
88 | int pc_clk_set_flags(unsigned id, unsigned flags) | 88 | static int pc_clk_set_flags(unsigned id, unsigned flags) |
89 | { | 89 | { |
90 | int rc = msm_proc_comm(PCOM_CLKCTL_RPC_SET_FLAGS, &id, &flags); | 90 | int rc = msm_proc_comm(PCOM_CLKCTL_RPC_SET_FLAGS, &id, &flags); |
91 | if (rc < 0) | 91 | if (rc < 0) |
@@ -94,7 +94,7 @@ int pc_clk_set_flags(unsigned id, unsigned flags) | |||
94 | return (int)id < 0 ? -EINVAL : 0; | 94 | return (int)id < 0 ? -EINVAL : 0; |
95 | } | 95 | } |
96 | 96 | ||
97 | unsigned pc_clk_get_rate(unsigned id) | 97 | static unsigned pc_clk_get_rate(unsigned id) |
98 | { | 98 | { |
99 | if (msm_proc_comm(PCOM_CLKCTL_RPC_RATE, &id, NULL)) | 99 | if (msm_proc_comm(PCOM_CLKCTL_RPC_RATE, &id, NULL)) |
100 | return 0; | 100 | return 0; |
@@ -102,7 +102,7 @@ unsigned pc_clk_get_rate(unsigned id) | |||
102 | return id; | 102 | return id; |
103 | } | 103 | } |
104 | 104 | ||
105 | unsigned pc_clk_is_enabled(unsigned id) | 105 | static unsigned pc_clk_is_enabled(unsigned id) |
106 | { | 106 | { |
107 | if (msm_proc_comm(PCOM_CLKCTL_RPC_ENABLED, &id, NULL)) | 107 | if (msm_proc_comm(PCOM_CLKCTL_RPC_ENABLED, &id, NULL)) |
108 | return 0; | 108 | return 0; |
@@ -110,7 +110,7 @@ unsigned pc_clk_is_enabled(unsigned id) | |||
110 | return id; | 110 | return id; |
111 | } | 111 | } |
112 | 112 | ||
113 | long pc_clk_round_rate(unsigned id, unsigned rate) | 113 | static long pc_clk_round_rate(unsigned id, unsigned rate) |
114 | { | 114 | { |
115 | 115 | ||
116 | /* Not really supported; pc_clk_set_rate() does rounding on it's own. */ | 116 | /* Not really supported; pc_clk_set_rate() does rounding on it's own. */ |
diff --git a/arch/arm/mach-msm/dma.c b/arch/arm/mach-msm/dma.c index 02cae5e2951c..354b91d4c3ac 100644 --- a/arch/arm/mach-msm/dma.c +++ b/arch/arm/mach-msm/dma.c | |||
@@ -223,8 +223,7 @@ static irqreturn_t msm_datamover_irq_handler(int irq, void *dev_id) | |||
223 | PRINT_FLOW("msm_datamover_irq_handler id %d, status %x\n", id, ch_status); | 223 | PRINT_FLOW("msm_datamover_irq_handler id %d, status %x\n", id, ch_status); |
224 | if ((ch_status & DMOV_STATUS_CMD_PTR_RDY) && !list_empty(&ready_commands[id])) { | 224 | if ((ch_status & DMOV_STATUS_CMD_PTR_RDY) && !list_empty(&ready_commands[id])) { |
225 | cmd = list_entry(ready_commands[id].next, typeof(*cmd), list); | 225 | cmd = list_entry(ready_commands[id].next, typeof(*cmd), list); |
226 | list_del(&cmd->list); | 226 | list_move_tail(&cmd->list, &active_commands[id]); |
227 | list_add_tail(&cmd->list, &active_commands[id]); | ||
228 | if (cmd->execute_func) | 227 | if (cmd->execute_func) |
229 | cmd->execute_func(cmd); | 228 | cmd->execute_func(cmd); |
230 | PRINT_FLOW("msm_datamover_irq_handler id %d, start command\n", id); | 229 | PRINT_FLOW("msm_datamover_irq_handler id %d, start command\n", id); |
diff --git a/arch/arm/mach-msm/idle.c b/arch/arm/mach-msm/idle.c deleted file mode 100644 index 0c9e13c65743..000000000000 --- a/arch/arm/mach-msm/idle.c +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* arch/arm/mach-msm/idle.c | ||
2 | * | ||
3 | * Idle processing for MSM7K - work around bugs with SWFI. | ||
4 | * | ||
5 | * Copyright (c) 2007 QUALCOMM Incorporated. | ||
6 | * Copyright (C) 2007 Google, Inc. | ||
7 | * | ||
8 | * This software is licensed under the terms of the GNU General Public | ||
9 | * License version 2, as published by the Free Software Foundation, and | ||
10 | * may be copied, distributed, and modified under those terms. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #include <linux/init.h> | ||
20 | #include <asm/system.h> | ||
21 | |||
22 | static void msm_idle(void) | ||
23 | { | ||
24 | #ifdef CONFIG_MSM7X00A_IDLE | ||
25 | asm volatile ( | ||
26 | |||
27 | "mrc p15, 0, r1, c1, c0, 0 /* read current CR */ \n\t" | ||
28 | "bic r0, r1, #(1 << 2) /* clear dcache bit */ \n\t" | ||
29 | "bic r0, r0, #(1 << 12) /* clear icache bit */ \n\t" | ||
30 | "mcr p15, 0, r0, c1, c0, 0 /* disable d/i cache */ \n\t" | ||
31 | |||
32 | "mov r0, #0 /* prepare wfi value */ \n\t" | ||
33 | "mcr p15, 0, r0, c7, c10, 0 /* flush the cache */ \n\t" | ||
34 | "mcr p15, 0, r0, c7, c10, 4 /* memory barrier */ \n\t" | ||
35 | "mcr p15, 0, r0, c7, c0, 4 /* wait for interrupt */ \n\t" | ||
36 | |||
37 | "mcr p15, 0, r1, c1, c0, 0 /* restore d/i cache */ \n\t" | ||
38 | |||
39 | : : : "r0","r1" ); | ||
40 | #endif | ||
41 | } | ||
42 | |||
43 | static int __init msm_idle_init(void) | ||
44 | { | ||
45 | arm_pm_idle = msm_idle; | ||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | arch_initcall(msm_idle_init); | ||
diff --git a/arch/arm/mach-msm/include/mach/board.h b/arch/arm/mach-msm/include/mach/board.h index 435f8edfafd1..5a0811a4c851 100644 --- a/arch/arm/mach-msm/include/mach/board.h +++ b/arch/arm/mach-msm/include/mach/board.h | |||
@@ -22,15 +22,6 @@ | |||
22 | 22 | ||
23 | /* platform device data structures */ | 23 | /* platform device data structures */ |
24 | 24 | ||
25 | struct msm_acpu_clock_platform_data | ||
26 | { | ||
27 | uint32_t acpu_switch_time_us; | ||
28 | uint32_t max_speed_delta_khz; | ||
29 | uint32_t vdd_switch_time_us; | ||
30 | unsigned long power_collapse_khz; | ||
31 | unsigned long wait_for_irq_khz; | ||
32 | }; | ||
33 | |||
34 | struct clk_lookup; | 25 | struct clk_lookup; |
35 | 26 | ||
36 | extern struct sys_timer msm_timer; | 27 | extern struct sys_timer msm_timer; |
@@ -42,7 +33,6 @@ void __init msm_map_common_io(void); | |||
42 | void __init msm_init_irq(void); | 33 | void __init msm_init_irq(void); |
43 | void __init msm_init_gpio(void); | 34 | void __init msm_init_gpio(void); |
44 | void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks); | 35 | void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks); |
45 | void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *); | ||
46 | int __init msm_add_sdcc(unsigned int controller, | 36 | int __init msm_add_sdcc(unsigned int controller, |
47 | struct msm_mmc_platform_data *plat, | 37 | struct msm_mmc_platform_data *plat, |
48 | unsigned int stat_irq, unsigned long stat_irq_flags); | 38 | unsigned int stat_irq, unsigned long stat_irq_flags); |
diff --git a/arch/arm/mach-msm/include/mach/system.h b/arch/arm/mach-msm/include/mach/system.h deleted file mode 100644 index f5fb2ec87ffe..000000000000 --- a/arch/arm/mach-msm/include/mach/system.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* arch/arm/mach-msm/include/mach/system.h | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | /* low level hardware reset hook -- for example, hitting the | ||
17 | * PSHOLD line on the PMIC to hard reset the system | ||
18 | */ | ||
19 | extern void (*msm_hw_reset_hook)(void); | ||
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c index af43f6acd7fc..3cb4f4c35710 100644 --- a/arch/arm/mach-msm/io.c +++ b/arch/arm/mach-msm/io.c | |||
@@ -42,8 +42,7 @@ | |||
42 | MSM_CHIP_DEVICE_TYPE(name, chip, MT_DEVICE) | 42 | MSM_CHIP_DEVICE_TYPE(name, chip, MT_DEVICE) |
43 | #define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM) | 43 | #define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM) |
44 | 44 | ||
45 | #if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_MSM7X27) \ | 45 | #if defined(CONFIG_ARCH_MSM7X00A) |
46 | || defined(CONFIG_ARCH_MSM7X25) | ||
47 | static struct map_desc msm_io_desc[] __initdata = { | 46 | static struct map_desc msm_io_desc[] __initdata = { |
48 | MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED), | 47 | MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED), |
49 | MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED), | 48 | MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED), |
diff --git a/arch/arm/mach-msm/proc_comm.c b/arch/arm/mach-msm/proc_comm.c index 9980dc736e7b..8f1eecd88186 100644 --- a/arch/arm/mach-msm/proc_comm.c +++ b/arch/arm/mach-msm/proc_comm.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | #include <mach/msm_iomap.h> | 21 | #include <mach/msm_iomap.h> |
22 | #include <mach/system.h> | ||
23 | 22 | ||
24 | #include "proc_comm.h" | 23 | #include "proc_comm.h" |
25 | 24 | ||
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c index 657be73297db..c5a2eddc6cdc 100644 --- a/arch/arm/mach-msm/smd.c +++ b/arch/arm/mach-msm/smd.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
31 | 31 | ||
32 | #include <mach/msm_smd.h> | 32 | #include <mach/msm_smd.h> |
33 | #include <mach/system.h> | ||
34 | 33 | ||
35 | #include "smd_private.h" | 34 | #include "smd_private.h" |
36 | #include "proc_comm.h" | 35 | #include "proc_comm.h" |
@@ -39,8 +38,6 @@ | |||
39 | #define CONFIG_QDSP6 1 | 38 | #define CONFIG_QDSP6 1 |
40 | #endif | 39 | #endif |
41 | 40 | ||
42 | void (*msm_hw_reset_hook)(void); | ||
43 | |||
44 | #define MODULE_NAME "msm_smd" | 41 | #define MODULE_NAME "msm_smd" |
45 | 42 | ||
46 | enum { | 43 | enum { |
@@ -52,13 +49,14 @@ static int msm_smd_debug_mask; | |||
52 | 49 | ||
53 | struct shared_info { | 50 | struct shared_info { |
54 | int ready; | 51 | int ready; |
55 | unsigned state; | 52 | void __iomem *state; |
56 | }; | 53 | }; |
57 | 54 | ||
58 | static unsigned dummy_state[SMSM_STATE_COUNT]; | 55 | static unsigned dummy_state[SMSM_STATE_COUNT]; |
59 | 56 | ||
60 | static struct shared_info smd_info = { | 57 | static struct shared_info smd_info = { |
61 | .state = (unsigned) &dummy_state, | 58 | /* FIXME: not a real __iomem pointer */ |
59 | .state = &dummy_state, | ||
62 | }; | 60 | }; |
63 | 61 | ||
64 | module_param_named(debug_mask, msm_smd_debug_mask, | 62 | module_param_named(debug_mask, msm_smd_debug_mask, |
@@ -101,10 +99,6 @@ static void handle_modem_crash(void) | |||
101 | pr_err("ARM9 has CRASHED\n"); | 99 | pr_err("ARM9 has CRASHED\n"); |
102 | smd_diag(); | 100 | smd_diag(); |
103 | 101 | ||
104 | /* hard reboot if possible */ | ||
105 | if (msm_hw_reset_hook) | ||
106 | msm_hw_reset_hook(); | ||
107 | |||
108 | /* in this case the modem or watchdog should reboot us */ | 102 | /* in this case the modem or watchdog should reboot us */ |
109 | for (;;) | 103 | for (;;) |
110 | ; | 104 | ; |
@@ -796,22 +790,22 @@ void *smem_alloc(unsigned id, unsigned size) | |||
796 | return smem_find(id, size); | 790 | return smem_find(id, size); |
797 | } | 791 | } |
798 | 792 | ||
799 | void *smem_item(unsigned id, unsigned *size) | 793 | void __iomem *smem_item(unsigned id, unsigned *size) |
800 | { | 794 | { |
801 | struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE; | 795 | struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE; |
802 | struct smem_heap_entry *toc = shared->heap_toc; | 796 | struct smem_heap_entry *toc = shared->heap_toc; |
803 | 797 | ||
804 | if (id >= SMEM_NUM_ITEMS) | 798 | if (id >= SMEM_NUM_ITEMS) |
805 | return 0; | 799 | return NULL; |
806 | 800 | ||
807 | if (toc[id].allocated) { | 801 | if (toc[id].allocated) { |
808 | *size = toc[id].size; | 802 | *size = toc[id].size; |
809 | return (void *) (MSM_SHARED_RAM_BASE + toc[id].offset); | 803 | return (MSM_SHARED_RAM_BASE + toc[id].offset); |
810 | } else { | 804 | } else { |
811 | *size = 0; | 805 | *size = 0; |
812 | } | 806 | } |
813 | 807 | ||
814 | return 0; | 808 | return NULL; |
815 | } | 809 | } |
816 | 810 | ||
817 | void *smem_find(unsigned id, unsigned size_in) | 811 | void *smem_find(unsigned id, unsigned size_in) |
@@ -857,7 +851,7 @@ static irqreturn_t smsm_irq_handler(int irq, void *data) | |||
857 | int smsm_change_state(enum smsm_state_item item, | 851 | int smsm_change_state(enum smsm_state_item item, |
858 | uint32_t clear_mask, uint32_t set_mask) | 852 | uint32_t clear_mask, uint32_t set_mask) |
859 | { | 853 | { |
860 | unsigned long addr = smd_info.state + item * 4; | 854 | void __iomem *addr = smd_info.state + item * 4; |
861 | unsigned long flags; | 855 | unsigned long flags; |
862 | unsigned state; | 856 | unsigned state; |
863 | 857 | ||
@@ -943,10 +937,10 @@ int smd_core_init(void) | |||
943 | /* wait for essential items to be initialized */ | 937 | /* wait for essential items to be initialized */ |
944 | for (;;) { | 938 | for (;;) { |
945 | unsigned size; | 939 | unsigned size; |
946 | void *state; | 940 | void __iomem *state; |
947 | state = smem_item(SMEM_SMSM_SHARED_STATE, &size); | 941 | state = smem_item(SMEM_SMSM_SHARED_STATE, &size); |
948 | if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) { | 942 | if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) { |
949 | smd_info.state = (unsigned)state; | 943 | smd_info.state = state; |
950 | break; | 944 | break; |
951 | } | 945 | } |
952 | } | 946 | } |
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 812808254936..004f93515a4e 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -101,7 +101,7 @@ static struct clock_event_device msm_clockevent = { | |||
101 | 101 | ||
102 | static union { | 102 | static union { |
103 | struct clock_event_device *evt; | 103 | struct clock_event_device *evt; |
104 | struct clock_event_device __percpu **percpu_evt; | 104 | struct clock_event_device * __percpu *percpu_evt; |
105 | } msm_evt; | 105 | } msm_evt; |
106 | 106 | ||
107 | static void __iomem *source_base; | 107 | static void __iomem *source_base; |
diff --git a/arch/arm/mach-mv78xx0/addr-map.c b/arch/arm/mach-mv78xx0/addr-map.c index a9bc84180d21..137e479d15a0 100644 --- a/arch/arm/mach-mv78xx0/addr-map.c +++ b/arch/arm/mach-mv78xx0/addr-map.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/mbus.h> | 13 | #include <linux/mbus.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <plat/addr-map.h> | 15 | #include <plat/addr-map.h> |
16 | #include <mach/mv78xx0.h> | ||
16 | #include "common.h" | 17 | #include "common.h" |
17 | 18 | ||
18 | /* | 19 | /* |
@@ -81,7 +82,7 @@ void __init mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, | |||
81 | int maj, int min) | 82 | int maj, int min) |
82 | { | 83 | { |
83 | orion_setup_cpu_win(&addr_map_cfg, window, base, size, | 84 | orion_setup_cpu_win(&addr_map_cfg, window, base, size, |
84 | TARGET_PCIE(maj), ATTR_PCIE_IO(min), -1); | 85 | TARGET_PCIE(maj), ATTR_PCIE_IO(min), 0); |
85 | } | 86 | } |
86 | 87 | ||
87 | void __init mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, | 88 | void __init mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, |
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index 3057f7d4329a..6b0c38735527 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -135,11 +135,6 @@ static struct map_desc mv78xx0_io_desc[] __initdata = { | |||
135 | .length = MV78XX0_CORE_REGS_SIZE, | 135 | .length = MV78XX0_CORE_REGS_SIZE, |
136 | .type = MT_DEVICE, | 136 | .type = MT_DEVICE, |
137 | }, { | 137 | }, { |
138 | .virtual = MV78XX0_PCIE_IO_VIRT_BASE(0), | ||
139 | .pfn = __phys_to_pfn(MV78XX0_PCIE_IO_PHYS_BASE(0)), | ||
140 | .length = MV78XX0_PCIE_IO_SIZE * 8, | ||
141 | .type = MT_DEVICE, | ||
142 | }, { | ||
143 | .virtual = MV78XX0_REGS_VIRT_BASE, | 138 | .virtual = MV78XX0_REGS_VIRT_BASE, |
144 | .pfn = __phys_to_pfn(MV78XX0_REGS_PHYS_BASE), | 139 | .pfn = __phys_to_pfn(MV78XX0_REGS_PHYS_BASE), |
145 | .length = MV78XX0_REGS_SIZE, | 140 | .length = MV78XX0_REGS_SIZE, |
diff --git a/arch/arm/mach-mv78xx0/include/mach/io.h b/arch/arm/mach-mv78xx0/include/mach/io.h deleted file mode 100644 index c7d9d00d8fc1..000000000000 --- a/arch/arm/mach-mv78xx0/include/mach/io.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mv78xx0/include/mach/io.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ARCH_IO_H | ||
10 | #define __ASM_ARCH_IO_H | ||
11 | |||
12 | #include "mv78xx0.h" | ||
13 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | ||
15 | |||
16 | static inline void __iomem *__io(unsigned long addr) | ||
17 | { | ||
18 | return (void __iomem *)((addr - MV78XX0_PCIE_IO_PHYS_BASE(0)) | ||
19 | + MV78XX0_PCIE_IO_VIRT_BASE(0)); | ||
20 | } | ||
21 | |||
22 | #define __io(a) __io(a) | ||
23 | |||
24 | #endif | ||
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h index e807c4c52a0b..bd03fed1128e 100644 --- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h +++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h | |||
@@ -29,15 +29,15 @@ | |||
29 | * | 29 | * |
30 | * virt phys size | 30 | * virt phys size |
31 | * fe400000 f102x000 16K core-specific peripheral registers | 31 | * fe400000 f102x000 16K core-specific peripheral registers |
32 | * fe700000 f0800000 1M PCIe #0 I/O space | 32 | * fee00000 f0800000 64K PCIe #0 I/O space |
33 | * fe800000 f0900000 1M PCIe #1 I/O space | 33 | * fee10000 f0900000 64K PCIe #1 I/O space |
34 | * fe900000 f0a00000 1M PCIe #2 I/O space | 34 | * fee20000 f0a00000 64K PCIe #2 I/O space |
35 | * fea00000 f0b00000 1M PCIe #3 I/O space | 35 | * fee30000 f0b00000 64K PCIe #3 I/O space |
36 | * feb00000 f0c00000 1M PCIe #4 I/O space | 36 | * fee40000 f0c00000 64K PCIe #4 I/O space |
37 | * fec00000 f0d00000 1M PCIe #5 I/O space | 37 | * fee50000 f0d00000 64K PCIe #5 I/O space |
38 | * fed00000 f0e00000 1M PCIe #6 I/O space | 38 | * fee60000 f0e00000 64K PCIe #6 I/O space |
39 | * fee00000 f0f00000 1M PCIe #7 I/O space | 39 | * fee70000 f0f00000 64K PCIe #7 I/O space |
40 | * fef00000 f1000000 1M on-chip peripheral registers | 40 | * fd000000 f1000000 1M on-chip peripheral registers |
41 | */ | 41 | */ |
42 | #define MV78XX0_CORE0_REGS_PHYS_BASE 0xf1020000 | 42 | #define MV78XX0_CORE0_REGS_PHYS_BASE 0xf1020000 |
43 | #define MV78XX0_CORE1_REGS_PHYS_BASE 0xf1024000 | 43 | #define MV78XX0_CORE1_REGS_PHYS_BASE 0xf1024000 |
@@ -46,11 +46,10 @@ | |||
46 | #define MV78XX0_CORE_REGS_SIZE SZ_16K | 46 | #define MV78XX0_CORE_REGS_SIZE SZ_16K |
47 | 47 | ||
48 | #define MV78XX0_PCIE_IO_PHYS_BASE(i) (0xf0800000 + ((i) << 20)) | 48 | #define MV78XX0_PCIE_IO_PHYS_BASE(i) (0xf0800000 + ((i) << 20)) |
49 | #define MV78XX0_PCIE_IO_VIRT_BASE(i) (0xfe700000 + ((i) << 20)) | ||
50 | #define MV78XX0_PCIE_IO_SIZE SZ_1M | 49 | #define MV78XX0_PCIE_IO_SIZE SZ_1M |
51 | 50 | ||
52 | #define MV78XX0_REGS_PHYS_BASE 0xf1000000 | 51 | #define MV78XX0_REGS_PHYS_BASE 0xf1000000 |
53 | #define MV78XX0_REGS_VIRT_BASE 0xfef00000 | 52 | #define MV78XX0_REGS_VIRT_BASE 0xfd000000 |
54 | #define MV78XX0_REGS_SIZE SZ_1M | 53 | #define MV78XX0_REGS_SIZE SZ_1M |
55 | 54 | ||
56 | #define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000 | 55 | #define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000 |
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c index 2e56e86b6d68..26a059b4f472 100644 --- a/arch/arm/mach-mv78xx0/pcie.c +++ b/arch/arm/mach-mv78xx0/pcie.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/mach/pci.h> | 15 | #include <asm/mach/pci.h> |
16 | #include <plat/pcie.h> | 16 | #include <plat/pcie.h> |
17 | #include <plat/addr-map.h> | 17 | #include <plat/addr-map.h> |
18 | #include <mach/mv78xx0.h> | ||
18 | #include "common.h" | 19 | #include "common.h" |
19 | 20 | ||
20 | struct pcie_port { | 21 | struct pcie_port { |
@@ -23,16 +24,13 @@ struct pcie_port { | |||
23 | u8 root_bus_nr; | 24 | u8 root_bus_nr; |
24 | void __iomem *base; | 25 | void __iomem *base; |
25 | spinlock_t conf_lock; | 26 | spinlock_t conf_lock; |
26 | char io_space_name[16]; | ||
27 | char mem_space_name[16]; | 27 | char mem_space_name[16]; |
28 | struct resource res[2]; | 28 | struct resource res; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | static struct pcie_port pcie_port[8]; | 31 | static struct pcie_port pcie_port[8]; |
32 | static int num_pcie_ports; | 32 | static int num_pcie_ports; |
33 | static struct resource pcie_io_space; | 33 | static struct resource pcie_io_space; |
34 | static struct resource pcie_mem_space; | ||
35 | |||
36 | 34 | ||
37 | void __init mv78xx0_pcie_id(u32 *dev, u32 *rev) | 35 | void __init mv78xx0_pcie_id(u32 *dev, u32 *rev) |
38 | { | 36 | { |
@@ -40,102 +38,59 @@ void __init mv78xx0_pcie_id(u32 *dev, u32 *rev) | |||
40 | *rev = orion_pcie_rev((void __iomem *)PCIE00_VIRT_BASE); | 38 | *rev = orion_pcie_rev((void __iomem *)PCIE00_VIRT_BASE); |
41 | } | 39 | } |
42 | 40 | ||
41 | u32 pcie_port_size[8] = { | ||
42 | 0, | ||
43 | 0x30000000, | ||
44 | 0x10000000, | ||
45 | 0x10000000, | ||
46 | 0x08000000, | ||
47 | 0x08000000, | ||
48 | 0x08000000, | ||
49 | 0x04000000, | ||
50 | }; | ||
51 | |||
43 | static void __init mv78xx0_pcie_preinit(void) | 52 | static void __init mv78xx0_pcie_preinit(void) |
44 | { | 53 | { |
45 | int i; | 54 | int i; |
46 | u32 size_each; | 55 | u32 size_each; |
47 | u32 start; | 56 | u32 start; |
48 | int win; | 57 | int win = 0; |
49 | 58 | ||
50 | pcie_io_space.name = "PCIe I/O Space"; | 59 | pcie_io_space.name = "PCIe I/O Space"; |
51 | pcie_io_space.start = MV78XX0_PCIE_IO_PHYS_BASE(0); | 60 | pcie_io_space.start = MV78XX0_PCIE_IO_PHYS_BASE(0); |
52 | pcie_io_space.end = | 61 | pcie_io_space.end = |
53 | MV78XX0_PCIE_IO_PHYS_BASE(0) + MV78XX0_PCIE_IO_SIZE * 8 - 1; | 62 | MV78XX0_PCIE_IO_PHYS_BASE(0) + MV78XX0_PCIE_IO_SIZE * 8 - 1; |
54 | pcie_io_space.flags = IORESOURCE_IO; | 63 | pcie_io_space.flags = IORESOURCE_MEM; |
55 | if (request_resource(&iomem_resource, &pcie_io_space)) | 64 | if (request_resource(&iomem_resource, &pcie_io_space)) |
56 | panic("can't allocate PCIe I/O space"); | 65 | panic("can't allocate PCIe I/O space"); |
57 | 66 | ||
58 | pcie_mem_space.name = "PCIe MEM Space"; | 67 | if (num_pcie_ports > 7) |
59 | pcie_mem_space.start = MV78XX0_PCIE_MEM_PHYS_BASE; | 68 | panic("invalid number of PCIe ports"); |
60 | pcie_mem_space.end = | 69 | |
61 | MV78XX0_PCIE_MEM_PHYS_BASE + MV78XX0_PCIE_MEM_SIZE - 1; | 70 | size_each = pcie_port_size[num_pcie_ports]; |
62 | pcie_mem_space.flags = IORESOURCE_MEM; | ||
63 | if (request_resource(&iomem_resource, &pcie_mem_space)) | ||
64 | panic("can't allocate PCIe MEM space"); | ||
65 | 71 | ||
72 | start = MV78XX0_PCIE_MEM_PHYS_BASE; | ||
66 | for (i = 0; i < num_pcie_ports; i++) { | 73 | for (i = 0; i < num_pcie_ports; i++) { |
67 | struct pcie_port *pp = pcie_port + i; | 74 | struct pcie_port *pp = pcie_port + i; |
68 | 75 | ||
69 | snprintf(pp->io_space_name, sizeof(pp->io_space_name), | ||
70 | "PCIe %d.%d I/O", pp->maj, pp->min); | ||
71 | pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0; | ||
72 | pp->res[0].name = pp->io_space_name; | ||
73 | pp->res[0].start = MV78XX0_PCIE_IO_PHYS_BASE(i); | ||
74 | pp->res[0].end = pp->res[0].start + MV78XX0_PCIE_IO_SIZE - 1; | ||
75 | pp->res[0].flags = IORESOURCE_IO; | ||
76 | |||
77 | snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), | 76 | snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), |
78 | "PCIe %d.%d MEM", pp->maj, pp->min); | 77 | "PCIe %d.%d MEM", pp->maj, pp->min); |
79 | pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; | 78 | pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; |
80 | pp->res[1].name = pp->mem_space_name; | 79 | pp->res.name = pp->mem_space_name; |
81 | pp->res[1].flags = IORESOURCE_MEM; | 80 | pp->res.flags = IORESOURCE_MEM; |
82 | } | 81 | pp->res.start = start; |
83 | 82 | pp->res.end = start + size_each - 1; | |
84 | switch (num_pcie_ports) { | ||
85 | case 0: | ||
86 | size_each = 0; | ||
87 | break; | ||
88 | |||
89 | case 1: | ||
90 | size_each = 0x30000000; | ||
91 | break; | ||
92 | |||
93 | case 2 ... 3: | ||
94 | size_each = 0x10000000; | ||
95 | break; | ||
96 | |||
97 | case 4 ... 6: | ||
98 | size_each = 0x08000000; | ||
99 | break; | ||
100 | |||
101 | case 7: | ||
102 | size_each = 0x04000000; | ||
103 | break; | ||
104 | |||
105 | default: | ||
106 | panic("invalid number of PCIe ports"); | ||
107 | } | ||
108 | |||
109 | start = MV78XX0_PCIE_MEM_PHYS_BASE; | ||
110 | for (i = 0; i < num_pcie_ports; i++) { | ||
111 | struct pcie_port *pp = pcie_port + i; | ||
112 | |||
113 | pp->res[1].start = start; | ||
114 | pp->res[1].end = start + size_each - 1; | ||
115 | start += size_each; | 83 | start += size_each; |
116 | } | ||
117 | |||
118 | for (i = 0; i < num_pcie_ports; i++) { | ||
119 | struct pcie_port *pp = pcie_port + i; | ||
120 | 84 | ||
121 | if (request_resource(&pcie_io_space, &pp->res[0])) | 85 | if (request_resource(&iomem_resource, &pp->res)) |
122 | panic("can't allocate PCIe I/O sub-space"); | ||
123 | |||
124 | if (request_resource(&pcie_mem_space, &pp->res[1])) | ||
125 | panic("can't allocate PCIe MEM sub-space"); | 86 | panic("can't allocate PCIe MEM sub-space"); |
126 | } | ||
127 | 87 | ||
128 | win = 0; | 88 | mv78xx0_setup_pcie_mem_win(win + i + 8, pp->res.start, |
129 | for (i = 0; i < num_pcie_ports; i++) { | 89 | resource_size(&pp->res), |
130 | struct pcie_port *pp = pcie_port + i; | 90 | pp->maj, pp->min); |
131 | 91 | ||
132 | mv78xx0_setup_pcie_io_win(win++, pp->res[0].start, | 92 | mv78xx0_setup_pcie_io_win(win + i, i * SZ_64K, SZ_64K, |
133 | resource_size(&pp->res[0]), | ||
134 | pp->maj, pp->min); | 93 | pp->maj, pp->min); |
135 | |||
136 | mv78xx0_setup_pcie_mem_win(win++, pp->res[1].start, | ||
137 | resource_size(&pp->res[1]), | ||
138 | pp->maj, pp->min); | ||
139 | } | 94 | } |
140 | } | 95 | } |
141 | 96 | ||
@@ -156,8 +111,9 @@ static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys) | |||
156 | orion_pcie_set_local_bus_nr(pp->base, sys->busnr); | 111 | orion_pcie_set_local_bus_nr(pp->base, sys->busnr); |
157 | orion_pcie_setup(pp->base); | 112 | orion_pcie_setup(pp->base); |
158 | 113 | ||
159 | pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset); | 114 | pci_ioremap_io(nr * SZ_64K, MV78XX0_PCIE_IO_PHYS_BASE(nr)); |
160 | pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); | 115 | |
116 | pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset); | ||
161 | 117 | ||
162 | return 1; | 118 | return 1; |
163 | } | 119 | } |
@@ -281,7 +237,7 @@ static void __init add_pcie_port(int maj, int min, unsigned long base) | |||
281 | pp->root_bus_nr = -1; | 237 | pp->root_bus_nr = -1; |
282 | pp->base = (void __iomem *)base; | 238 | pp->base = (void __iomem *)base; |
283 | spin_lock_init(&pp->conf_lock); | 239 | spin_lock_init(&pp->conf_lock); |
284 | memset(pp->res, 0, sizeof(pp->res)); | 240 | memset(&pp->res, 0, sizeof(pp->res)); |
285 | } else { | 241 | } else { |
286 | printk("link down, ignoring\n"); | 242 | printk("link down, ignoring\n"); |
287 | } | 243 | } |
diff --git a/arch/arm/mach-nomadik/include/mach/hardware.h b/arch/arm/mach-nomadik/include/mach/hardware.h index 6316dba3bfc8..02035e459f50 100644 --- a/arch/arm/mach-nomadik/include/mach/hardware.h +++ b/arch/arm/mach-nomadik/include/mach/hardware.h | |||
@@ -30,7 +30,7 @@ | |||
30 | - NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL) | 30 | - NOMADIK_IO_VIRTUAL + NOMADIK_IO_PHYSICAL) |
31 | 31 | ||
32 | /* used in asm code, so no casts */ | 32 | /* used in asm code, so no casts */ |
33 | #define IO_ADDRESS(x) ((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL) | 33 | #define IO_ADDRESS(x) IOMEM((x) - NOMADIK_IO_PHYSICAL + NOMADIK_IO_VIRTUAL) |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Base address defination for Nomadik Onchip Logic Block | 36 | * Base address defination for Nomadik Onchip Logic Block |
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h index 071003bc8456..7d4687e9cbdf 100644 --- a/arch/arm/mach-nomadik/include/mach/uncompress.h +++ b/arch/arm/mach-nomadik/include/mach/uncompress.h | |||
@@ -27,10 +27,10 @@ | |||
27 | struct amba_device; | 27 | struct amba_device; |
28 | #include <linux/amba/serial.h> | 28 | #include <linux/amba/serial.h> |
29 | 29 | ||
30 | #define NOMADIK_UART_DR 0x101FB000 | 30 | #define NOMADIK_UART_DR (void __iomem *)0x101FB000 |
31 | #define NOMADIK_UART_LCRH 0x101FB02c | 31 | #define NOMADIK_UART_LCRH (void __iomem *)0x101FB02c |
32 | #define NOMADIK_UART_CR 0x101FB030 | 32 | #define NOMADIK_UART_CR (void __iomem *)0x101FB030 |
33 | #define NOMADIK_UART_FR 0x101FB018 | 33 | #define NOMADIK_UART_FR (void __iomem *)0x101FB018 |
34 | 34 | ||
35 | static void putc(const char c) | 35 | static void putc(const char c) |
36 | { | 36 | { |
diff --git a/arch/arm/mach-omap1/ams-delta-fiq-handler.S b/arch/arm/mach-omap1/ams-delta-fiq-handler.S index a051cb8ae57f..3d1e1c250a1a 100644 --- a/arch/arm/mach-omap1/ams-delta-fiq-handler.S +++ b/arch/arm/mach-omap1/ams-delta-fiq-handler.S | |||
@@ -16,8 +16,9 @@ | |||
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <asm/assembler.h> | 17 | #include <asm/assembler.h> |
18 | 18 | ||
19 | #include <plat/board-ams-delta.h> | 19 | #include <mach/board-ams-delta.h> |
20 | 20 | ||
21 | #include <mach/irqs.h> | ||
21 | #include <mach/ams-delta-fiq.h> | 22 | #include <mach/ams-delta-fiq.h> |
22 | 23 | ||
23 | #include "iomap.h" | 24 | #include "iomap.h" |
diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c index 68e8e5654c0a..f12a12af3523 100644 --- a/arch/arm/mach-omap1/ams-delta-fiq.c +++ b/arch/arm/mach-omap1/ams-delta-fiq.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | 21 | ||
22 | #include <plat/board-ams-delta.h> | 22 | #include <mach/board-ams-delta.h> |
23 | 23 | ||
24 | #include <asm/fiq.h> | 24 | #include <asm/fiq.h> |
25 | 25 | ||
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index c53469802c03..9518bf5996dc 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/export.h> | 26 | #include <linux/export.h> |
27 | #include <linux/omapfb.h> | 27 | #include <linux/omapfb.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/platform_data/gpio-omap.h> | ||
29 | 30 | ||
30 | #include <media/soc_camera.h> | 31 | #include <media/soc_camera.h> |
31 | 32 | ||
@@ -34,10 +35,9 @@ | |||
34 | #include <asm/mach/arch.h> | 35 | #include <asm/mach/arch.h> |
35 | #include <asm/mach/map.h> | 36 | #include <asm/mach/map.h> |
36 | 37 | ||
37 | #include <plat/board-ams-delta.h> | 38 | #include <mach/board-ams-delta.h> |
38 | #include <plat/keypad.h> | 39 | #include <linux/platform_data/keypad-omap.h> |
39 | #include <plat/mux.h> | 40 | #include <mach/mux.h> |
40 | #include <plat/board.h> | ||
41 | 41 | ||
42 | #include <mach/hardware.h> | 42 | #include <mach/hardware.h> |
43 | #include <mach/ams-delta-fiq.h> | 43 | #include <mach/ams-delta-fiq.h> |
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 6872f3fd400f..4b6de70c47a6 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c | |||
@@ -28,11 +28,10 @@ | |||
28 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
29 | 29 | ||
30 | #include <plat/tc.h> | 30 | #include <plat/tc.h> |
31 | #include <plat/mux.h> | 31 | #include <mach/mux.h> |
32 | #include <plat/flash.h> | 32 | #include <mach/flash.h> |
33 | #include <plat/fpga.h> | 33 | #include <plat/fpga.h> |
34 | #include <plat/keypad.h> | 34 | #include <linux/platform_data/keypad-omap.h> |
35 | #include <plat/board.h> | ||
36 | 35 | ||
37 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
38 | 37 | ||
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c index 6ec385e2b98e..4ec579fdd366 100644 --- a/arch/arm/mach-omap1/board-generic.c +++ b/arch/arm/mach-omap1/board-generic.c | |||
@@ -22,8 +22,7 @@ | |||
22 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/map.h> | 23 | #include <asm/mach/map.h> |
24 | 24 | ||
25 | #include <plat/mux.h> | 25 | #include <mach/mux.h> |
26 | #include <plat/board.h> | ||
27 | 26 | ||
28 | #include <mach/usb.h> | 27 | #include <mach/usb.h> |
29 | 28 | ||
@@ -52,9 +51,6 @@ static struct omap_usb_config generic1610_usb_config __initdata = { | |||
52 | }; | 51 | }; |
53 | #endif | 52 | #endif |
54 | 53 | ||
55 | static struct omap_board_config_kernel generic_config[] __initdata = { | ||
56 | }; | ||
57 | |||
58 | static void __init omap_generic_init(void) | 54 | static void __init omap_generic_init(void) |
59 | { | 55 | { |
60 | #ifdef CONFIG_ARCH_OMAP15XX | 56 | #ifdef CONFIG_ARCH_OMAP15XX |
@@ -76,8 +72,6 @@ static void __init omap_generic_init(void) | |||
76 | } | 72 | } |
77 | #endif | 73 | #endif |
78 | 74 | ||
79 | omap_board_config = generic_config; | ||
80 | omap_board_config_size = ARRAY_SIZE(generic_config); | ||
81 | omap_serial_init(); | 75 | omap_serial_init(); |
82 | omap_register_i2c_bus(1, 100, NULL, 0); | 76 | omap_register_i2c_bus(1, 100, NULL, 0); |
83 | } | 77 | } |
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 44a4ab195fbc..af283a2bc7c7 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -31,17 +31,18 @@ | |||
31 | #include <linux/i2c/tps65010.h> | 31 | #include <linux/i2c/tps65010.h> |
32 | #include <linux/smc91x.h> | 32 | #include <linux/smc91x.h> |
33 | #include <linux/omapfb.h> | 33 | #include <linux/omapfb.h> |
34 | #include <linux/platform_data/gpio-omap.h> | ||
34 | 35 | ||
35 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
36 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
37 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
38 | 39 | ||
39 | #include <plat/mux.h> | 40 | #include <mach/mux.h> |
40 | #include <plat/dma.h> | 41 | #include <plat/dma.h> |
41 | #include <plat/tc.h> | 42 | #include <plat/tc.h> |
42 | #include <plat/irda.h> | 43 | #include <mach/irda.h> |
43 | #include <plat/keypad.h> | 44 | #include <linux/platform_data/keypad-omap.h> |
44 | #include <plat/flash.h> | 45 | #include <mach/flash.h> |
45 | 46 | ||
46 | #include <mach/hardware.h> | 47 | #include <mach/hardware.h> |
47 | #include <mach/usb.h> | 48 | #include <mach/usb.h> |
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 86cb5a04a404..06d11b1ee9c6 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/i2c/tps65010.h> | 31 | #include <linux/i2c/tps65010.h> |
32 | #include <linux/smc91x.h> | 32 | #include <linux/smc91x.h> |
33 | #include <linux/omapfb.h> | 33 | #include <linux/omapfb.h> |
34 | #include <linux/platform_data/gpio-omap.h> | ||
34 | 35 | ||
35 | #include <asm/setup.h> | 36 | #include <asm/setup.h> |
36 | #include <asm/page.h> | 37 | #include <asm/page.h> |
@@ -38,11 +39,11 @@ | |||
38 | #include <asm/mach/arch.h> | 39 | #include <asm/mach/arch.h> |
39 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
40 | 41 | ||
41 | #include <plat/mux.h> | 42 | #include <mach/mux.h> |
42 | #include <plat/tc.h> | 43 | #include <plat/tc.h> |
43 | #include <plat/keypad.h> | 44 | #include <linux/platform_data/keypad-omap.h> |
44 | #include <plat/dma.h> | 45 | #include <plat/dma.h> |
45 | #include <plat/flash.h> | 46 | #include <mach/flash.h> |
46 | 47 | ||
47 | #include <mach/hardware.h> | 48 | #include <mach/hardware.h> |
48 | #include <mach/irqs.h> | 49 | #include <mach/irqs.h> |
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c index b3f6e943e661..87ab2086ef96 100644 --- a/arch/arm/mach-omap1/board-htcherald.c +++ b/arch/arm/mach-omap1/board-htcherald.c | |||
@@ -37,13 +37,12 @@ | |||
37 | #include <linux/spi/spi.h> | 37 | #include <linux/spi/spi.h> |
38 | #include <linux/spi/ads7846.h> | 38 | #include <linux/spi/ads7846.h> |
39 | #include <linux/omapfb.h> | 39 | #include <linux/omapfb.h> |
40 | #include <linux/platform_data/keypad-omap.h> | ||
40 | 41 | ||
41 | #include <asm/mach-types.h> | 42 | #include <asm/mach-types.h> |
42 | #include <asm/mach/arch.h> | 43 | #include <asm/mach/arch.h> |
43 | 44 | ||
44 | #include <plat/omap7xx.h> | 45 | #include <mach/omap7xx.h> |
45 | #include <plat/board.h> | ||
46 | #include <plat/keypad.h> | ||
47 | #include <plat/mmc.h> | 46 | #include <plat/mmc.h> |
48 | 47 | ||
49 | #include <mach/irqs.h> | 48 | #include <mach/irqs.h> |
@@ -476,8 +475,7 @@ static void __init htcherald_lcd_init(void) | |||
476 | break; | 475 | break; |
477 | } | 476 | } |
478 | if (!tries) | 477 | if (!tries) |
479 | printk(KERN_WARNING "Timeout waiting for end of frame " | 478 | pr_err("Timeout waiting for end of frame -- LCD may not be available\n"); |
480 | "-- LCD may not be available\n"); | ||
481 | 479 | ||
482 | /* turn off DMA */ | 480 | /* turn off DMA */ |
483 | reg = omap_readw(OMAP_DMA_LCD_CCR); | 481 | reg = omap_readw(OMAP_DMA_LCD_CCR); |
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c index f21c2966daad..db5f7d2976e7 100644 --- a/arch/arm/mach-omap1/board-innovator.c +++ b/arch/arm/mach-omap1/board-innovator.c | |||
@@ -31,11 +31,11 @@ | |||
31 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/map.h> | 32 | #include <asm/mach/map.h> |
33 | 33 | ||
34 | #include <plat/mux.h> | 34 | #include <mach/mux.h> |
35 | #include <plat/flash.h> | 35 | #include <mach/flash.h> |
36 | #include <plat/fpga.h> | 36 | #include <plat/fpga.h> |
37 | #include <plat/tc.h> | 37 | #include <plat/tc.h> |
38 | #include <plat/keypad.h> | 38 | #include <linux/platform_data/keypad-omap.h> |
39 | #include <plat/mmc.h> | 39 | #include <plat/mmc.h> |
40 | 40 | ||
41 | #include <mach/hardware.h> | 41 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 2c0ca8fc3380..7d5c06d6a52a 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
@@ -21,14 +21,14 @@ | |||
21 | #include <linux/workqueue.h> | 21 | #include <linux/workqueue.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | 23 | ||
24 | #include <linux/platform_data/keypad-omap.h> | ||
25 | #include <linux/platform_data/lcd-mipid.h> | ||
26 | |||
24 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
26 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
27 | 30 | ||
28 | #include <plat/mux.h> | 31 | #include <mach/mux.h> |
29 | #include <plat/board.h> | ||
30 | #include <plat/keypad.h> | ||
31 | #include <plat/lcd_mipid.h> | ||
32 | #include <plat/mmc.h> | 32 | #include <plat/mmc.h> |
33 | #include <plat/clock.h> | 33 | #include <plat/clock.h> |
34 | 34 | ||
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 8784705edb60..2f1f9b967576 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c | |||
@@ -39,13 +39,15 @@ | |||
39 | #include <linux/mtd/partitions.h> | 39 | #include <linux/mtd/partitions.h> |
40 | #include <linux/mtd/physmap.h> | 40 | #include <linux/mtd/physmap.h> |
41 | #include <linux/i2c/tps65010.h> | 41 | #include <linux/i2c/tps65010.h> |
42 | #include <linux/platform_data/gpio-omap.h> | ||
43 | #include <linux/platform_data/omap1_bl.h> | ||
42 | 44 | ||
43 | #include <asm/mach-types.h> | 45 | #include <asm/mach-types.h> |
44 | #include <asm/mach/arch.h> | 46 | #include <asm/mach/arch.h> |
45 | #include <asm/mach/map.h> | 47 | #include <asm/mach/map.h> |
46 | 48 | ||
47 | #include <plat/flash.h> | 49 | #include <mach/flash.h> |
48 | #include <plat/mux.h> | 50 | #include <mach/mux.h> |
49 | #include <plat/tc.h> | 51 | #include <plat/tc.h> |
50 | 52 | ||
51 | #include <mach/hardware.h> | 53 | #include <mach/hardware.h> |
@@ -302,7 +304,7 @@ static struct omap_lcd_config osk_lcd_config __initdata = { | |||
302 | #include <linux/spi/spi.h> | 304 | #include <linux/spi/spi.h> |
303 | #include <linux/spi/ads7846.h> | 305 | #include <linux/spi/ads7846.h> |
304 | 306 | ||
305 | #include <plat/keypad.h> | 307 | #include <linux/platform_data/keypad-omap.h> |
306 | 308 | ||
307 | static struct at24_platform_data at24c04 = { | 309 | static struct at24_platform_data at24c04 = { |
308 | .byte_len = SZ_4K / 8, | 310 | .byte_len = SZ_4K / 8, |
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index 26bcb9defcdc..1c578d58923a 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c | |||
@@ -28,18 +28,18 @@ | |||
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/apm-emulation.h> | 29 | #include <linux/apm-emulation.h> |
30 | #include <linux/omapfb.h> | 30 | #include <linux/omapfb.h> |
31 | #include <linux/platform_data/omap1_bl.h> | ||
31 | 32 | ||
32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
33 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
34 | #include <asm/mach/map.h> | 35 | #include <asm/mach/map.h> |
35 | 36 | ||
36 | #include <plat/flash.h> | 37 | #include <mach/flash.h> |
37 | #include <plat/mux.h> | 38 | #include <mach/mux.h> |
38 | #include <plat/tc.h> | 39 | #include <plat/tc.h> |
39 | #include <plat/dma.h> | 40 | #include <plat/dma.h> |
40 | #include <plat/board.h> | 41 | #include <mach/irda.h> |
41 | #include <plat/irda.h> | 42 | #include <linux/platform_data/keypad-omap.h> |
42 | #include <plat/keypad.h> | ||
43 | 43 | ||
44 | #include <mach/hardware.h> | 44 | #include <mach/hardware.h> |
45 | #include <mach/usb.h> | 45 | #include <mach/usb.h> |
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c index 4d099446dfa8..97158095083c 100644 --- a/arch/arm/mach-omap1/board-palmtt.c +++ b/arch/arm/mach-omap1/board-palmtt.c | |||
@@ -27,19 +27,19 @@ | |||
27 | #include <linux/omapfb.h> | 27 | #include <linux/omapfb.h> |
28 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
29 | #include <linux/spi/ads7846.h> | 29 | #include <linux/spi/ads7846.h> |
30 | #include <linux/platform_data/omap1_bl.h> | ||
30 | 31 | ||
31 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
33 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
34 | 35 | ||
35 | #include <plat/led.h> | 36 | #include <plat/led.h> |
36 | #include <plat/flash.h> | 37 | #include <mach/flash.h> |
37 | #include <plat/mux.h> | 38 | #include <mach/mux.h> |
38 | #include <plat/dma.h> | 39 | #include <plat/dma.h> |
39 | #include <plat/tc.h> | 40 | #include <plat/tc.h> |
40 | #include <plat/board.h> | 41 | #include <mach/irda.h> |
41 | #include <plat/irda.h> | 42 | #include <linux/platform_data/keypad-omap.h> |
42 | #include <plat/keypad.h> | ||
43 | 43 | ||
44 | #include <mach/hardware.h> | 44 | #include <mach/hardware.h> |
45 | #include <mach/usb.h> | 45 | #include <mach/usb.h> |
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c index 355980321c2d..e311032e7eeb 100644 --- a/arch/arm/mach-omap1/board-palmz71.c +++ b/arch/arm/mach-omap1/board-palmz71.c | |||
@@ -30,18 +30,18 @@ | |||
30 | #include <linux/omapfb.h> | 30 | #include <linux/omapfb.h> |
31 | #include <linux/spi/spi.h> | 31 | #include <linux/spi/spi.h> |
32 | #include <linux/spi/ads7846.h> | 32 | #include <linux/spi/ads7846.h> |
33 | #include <linux/platform_data/omap1_bl.h> | ||
33 | 34 | ||
34 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
35 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
36 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
37 | 38 | ||
38 | #include <plat/flash.h> | 39 | #include <mach/flash.h> |
39 | #include <plat/mux.h> | 40 | #include <mach/mux.h> |
40 | #include <plat/dma.h> | 41 | #include <plat/dma.h> |
41 | #include <plat/tc.h> | 42 | #include <plat/tc.h> |
42 | #include <plat/board.h> | 43 | #include <mach/irda.h> |
43 | #include <plat/irda.h> | 44 | #include <linux/platform_data/keypad-omap.h> |
44 | #include <plat/keypad.h> | ||
45 | 45 | ||
46 | #include <mach/hardware.h> | 46 | #include <mach/hardware.h> |
47 | #include <mach/usb.h> | 47 | #include <mach/usb.h> |
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c index 703d55ecffe2..198b05417bfc 100644 --- a/arch/arm/mach-omap1/board-perseus2.c +++ b/arch/arm/mach-omap1/board-perseus2.c | |||
@@ -22,17 +22,16 @@ | |||
22 | #include <linux/input.h> | 22 | #include <linux/input.h> |
23 | #include <linux/smc91x.h> | 23 | #include <linux/smc91x.h> |
24 | #include <linux/omapfb.h> | 24 | #include <linux/omapfb.h> |
25 | #include <linux/platform_data/keypad-omap.h> | ||
25 | 26 | ||
26 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
29 | 30 | ||
30 | #include <plat/tc.h> | 31 | #include <plat/tc.h> |
31 | #include <plat/mux.h> | 32 | #include <mach/mux.h> |
32 | #include <plat/fpga.h> | 33 | #include <plat/fpga.h> |
33 | #include <plat/flash.h> | 34 | #include <mach/flash.h> |
34 | #include <plat/keypad.h> | ||
35 | #include <plat/board.h> | ||
36 | 35 | ||
37 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
38 | 37 | ||
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c index b59f78850e69..5932d56e17bf 100644 --- a/arch/arm/mach-omap1/board-sx1-mmc.c +++ b/arch/arm/mach-omap1/board-sx1-mmc.c | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #include <mach/hardware.h> | 18 | #include <mach/hardware.h> |
19 | #include <plat/mmc.h> | 19 | #include <plat/mmc.h> |
20 | #include <plat/board-sx1.h> | 20 | #include <mach/board-sx1.h> |
21 | 21 | ||
22 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) | 22 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) |
23 | 23 | ||
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index 8c665bd16ac2..13bf2cc56814 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c | |||
@@ -28,19 +28,18 @@ | |||
28 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
29 | #include <linux/export.h> | 29 | #include <linux/export.h> |
30 | #include <linux/omapfb.h> | 30 | #include <linux/omapfb.h> |
31 | #include <linux/platform_data/keypad-omap.h> | ||
31 | 32 | ||
32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
33 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
34 | #include <asm/mach/map.h> | 35 | #include <asm/mach/map.h> |
35 | 36 | ||
36 | #include <plat/flash.h> | 37 | #include <mach/flash.h> |
37 | #include <plat/mux.h> | 38 | #include <mach/mux.h> |
38 | #include <plat/dma.h> | 39 | #include <plat/dma.h> |
39 | #include <plat/irda.h> | 40 | #include <mach/irda.h> |
40 | #include <plat/tc.h> | 41 | #include <plat/tc.h> |
41 | #include <plat/board.h> | 42 | #include <mach/board-sx1.h> |
42 | #include <plat/keypad.h> | ||
43 | #include <plat/board-sx1.h> | ||
44 | 43 | ||
45 | #include <mach/hardware.h> | 44 | #include <mach/hardware.h> |
46 | #include <mach/usb.h> | 45 | #include <mach/usb.h> |
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index 3497769eb353..ad75e3411d46 100644 --- a/arch/arm/mach-omap1/board-voiceblue.c +++ b/arch/arm/mach-omap1/board-voiceblue.c | |||
@@ -31,11 +31,10 @@ | |||
31 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/map.h> | 32 | #include <asm/mach/map.h> |
33 | 33 | ||
34 | #include <plat/board-voiceblue.h> | 34 | #include <mach/board-voiceblue.h> |
35 | #include <plat/flash.h> | 35 | #include <mach/flash.h> |
36 | #include <plat/mux.h> | 36 | #include <mach/mux.h> |
37 | #include <plat/tc.h> | 37 | #include <plat/tc.h> |
38 | #include <plat/board.h> | ||
39 | 38 | ||
40 | #include <mach/hardware.h> | 39 | #include <mach/hardware.h> |
41 | #include <mach/usb.h> | 40 | #include <mach/usb.h> |
@@ -155,9 +154,6 @@ static struct omap_usb_config voiceblue_usb_config __initdata = { | |||
155 | .pins[2] = 6, | 154 | .pins[2] = 6, |
156 | }; | 155 | }; |
157 | 156 | ||
158 | static struct omap_board_config_kernel voiceblue_config[] = { | ||
159 | }; | ||
160 | |||
161 | #define MACHINE_PANICED 1 | 157 | #define MACHINE_PANICED 1 |
162 | #define MACHINE_REBOOTING 2 | 158 | #define MACHINE_REBOOTING 2 |
163 | #define MACHINE_REBOOT 4 | 159 | #define MACHINE_REBOOT 4 |
@@ -275,8 +271,6 @@ static void __init voiceblue_init(void) | |||
275 | voiceblue_smc91x_resources[1].start = gpio_to_irq(8); | 271 | voiceblue_smc91x_resources[1].start = gpio_to_irq(8); |
276 | voiceblue_smc91x_resources[1].end = gpio_to_irq(8); | 272 | voiceblue_smc91x_resources[1].end = gpio_to_irq(8); |
277 | platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); | 273 | platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); |
278 | omap_board_config = voiceblue_config; | ||
279 | omap_board_config_size = ARRAY_SIZE(voiceblue_config); | ||
280 | omap_serial_init(); | 274 | omap_serial_init(); |
281 | omap1_usb_init(&voiceblue_usb_config); | 275 | omap1_usb_init(&voiceblue_usb_config); |
282 | omap_register_i2c_bus(1, 100, NULL, 0); | 276 | omap_register_i2c_bus(1, 100, NULL, 0); |
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index a9ee06b6cb42..638f4070fc70 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c | |||
@@ -587,8 +587,8 @@ void omap1_clk_disable_unused(struct clk *clk) | |||
587 | /* Clocks in the DSP domain need api_ck. Just assume bootloader | 587 | /* Clocks in the DSP domain need api_ck. Just assume bootloader |
588 | * has not enabled any DSP clocks */ | 588 | * has not enabled any DSP clocks */ |
589 | if (clk->enable_reg == DSP_IDLECT2) { | 589 | if (clk->enable_reg == DSP_IDLECT2) { |
590 | printk(KERN_INFO "Skipping reset check for DSP domain " | 590 | pr_info("Skipping reset check for DSP domain clock \"%s\"\n", |
591 | "clock \"%s\"\n", clk->name); | 591 | clk->name); |
592 | return; | 592 | return; |
593 | } | 593 | } |
594 | 594 | ||
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index c007d80dfb62..9b45f4b0ee22 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <plat/clock.h> | 25 | #include <plat/clock.h> |
26 | #include <plat/cpu.h> | 26 | #include <plat/cpu.h> |
27 | #include <plat/clkdev_omap.h> | 27 | #include <plat/clkdev_omap.h> |
28 | #include <plat/board.h> | ||
29 | #include <plat/sram.h> /* for omap_sram_reprogram_clock() */ | 28 | #include <plat/sram.h> /* for omap_sram_reprogram_clock() */ |
30 | 29 | ||
31 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
@@ -776,11 +775,10 @@ static struct clk_functions omap1_clk_functions = { | |||
776 | 775 | ||
777 | static void __init omap1_show_rates(void) | 776 | static void __init omap1_show_rates(void) |
778 | { | 777 | { |
779 | pr_notice("Clocking rate (xtal/DPLL1/MPU): " | 778 | pr_notice("Clocking rate (xtal/DPLL1/MPU): %ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n", |
780 | "%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n", | 779 | ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10, |
781 | ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10, | 780 | ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, |
782 | ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, | 781 | arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); |
783 | arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); | ||
784 | } | 782 | } |
785 | 783 | ||
786 | u32 cpu_mask; | 784 | u32 cpu_mask; |
@@ -788,7 +786,6 @@ u32 cpu_mask; | |||
788 | int __init omap1_clk_init(void) | 786 | int __init omap1_clk_init(void) |
789 | { | 787 | { |
790 | struct omap_clk *c; | 788 | struct omap_clk *c; |
791 | const struct omap_clock_config *info; | ||
792 | int crystal_type = 0; /* Default 12 MHz */ | 789 | int crystal_type = 0; /* Default 12 MHz */ |
793 | u32 reg; | 790 | u32 reg; |
794 | 791 | ||
@@ -837,19 +834,13 @@ int __init omap1_clk_init(void) | |||
837 | ck_dpll1_p = clk_get(NULL, "ck_dpll1"); | 834 | ck_dpll1_p = clk_get(NULL, "ck_dpll1"); |
838 | ck_ref_p = clk_get(NULL, "ck_ref"); | 835 | ck_ref_p = clk_get(NULL, "ck_ref"); |
839 | 836 | ||
840 | info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config); | ||
841 | if (info != NULL) { | ||
842 | if (!cpu_is_omap15xx()) | ||
843 | crystal_type = info->system_clock_type; | ||
844 | } | ||
845 | |||
846 | if (cpu_is_omap7xx()) | 837 | if (cpu_is_omap7xx()) |
847 | ck_ref.rate = 13000000; | 838 | ck_ref.rate = 13000000; |
848 | if (cpu_is_omap16xx() && crystal_type == 2) | 839 | if (cpu_is_omap16xx() && crystal_type == 2) |
849 | ck_ref.rate = 19200000; | 840 | ck_ref.rate = 19200000; |
850 | 841 | ||
851 | pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: " | 842 | pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: 0x%04x\n", |
852 | "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL), | 843 | omap_readw(ARM_SYSST), omap_readw(DPLL_CTL), |
853 | omap_readw(ARM_CKCTL)); | 844 | omap_readw(ARM_CKCTL)); |
854 | 845 | ||
855 | /* We want to be in syncronous scalable mode */ | 846 | /* We want to be in syncronous scalable mode */ |
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index fa1fa4deb6aa..0cc54dd553e3 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c | |||
@@ -20,12 +20,11 @@ | |||
20 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
21 | 21 | ||
22 | #include <plat/tc.h> | 22 | #include <plat/tc.h> |
23 | #include <plat/board.h> | 23 | #include <mach/mux.h> |
24 | #include <plat/mux.h> | ||
25 | #include <plat/dma.h> | 24 | #include <plat/dma.h> |
26 | #include <plat/mmc.h> | 25 | #include <plat/mmc.h> |
27 | #include <plat/omap7xx.h> | ||
28 | 26 | ||
27 | #include <mach/omap7xx.h> | ||
29 | #include <mach/camera.h> | 28 | #include <mach/camera.h> |
30 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
31 | 30 | ||
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c index 3ef7d52316b4..29007fef84cd 100644 --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c | |||
@@ -27,7 +27,8 @@ | |||
27 | 27 | ||
28 | #include <plat/dma.h> | 28 | #include <plat/dma.h> |
29 | #include <plat/tc.h> | 29 | #include <plat/tc.h> |
30 | #include <plat/irqs.h> | 30 | |
31 | #include <mach/irqs.h> | ||
31 | 32 | ||
32 | #define OMAP1_DMA_BASE (0xfffed800) | 33 | #define OMAP1_DMA_BASE (0xfffed800) |
33 | #define OMAP1_LOGICAL_DMA_CH_COUNT 17 | 34 | #define OMAP1_LOGICAL_DMA_CH_COUNT 17 |
@@ -330,8 +331,9 @@ static int __init omap1_system_dma_init(void) | |||
330 | d->chan = kzalloc(sizeof(struct omap_dma_lch) * | 331 | d->chan = kzalloc(sizeof(struct omap_dma_lch) * |
331 | (d->lch_count), GFP_KERNEL); | 332 | (d->lch_count), GFP_KERNEL); |
332 | if (!d->chan) { | 333 | if (!d->chan) { |
333 | dev_err(&pdev->dev, "%s: Memory allocation failed" | 334 | dev_err(&pdev->dev, |
334 | "for d->chan!!!\n", __func__); | 335 | "%s: Memory allocation failed for d->chan!\n", |
336 | __func__); | ||
335 | goto exit_release_d; | 337 | goto exit_release_d; |
336 | } | 338 | } |
337 | 339 | ||
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c index 401eb3c080c2..73ae6169aa4a 100644 --- a/arch/arm/mach-omap1/flash.c +++ b/arch/arm/mach-omap1/flash.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/mtd/map.h> | 11 | #include <linux/mtd/map.h> |
12 | 12 | ||
13 | #include <plat/tc.h> | 13 | #include <plat/tc.h> |
14 | #include <plat/flash.h> | 14 | #include <mach/flash.h> |
15 | 15 | ||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | 17 | ||
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c index ebef15e5e7b7..98e6f39224a4 100644 --- a/arch/arm/mach-omap1/gpio15xx.c +++ b/arch/arm/mach-omap1/gpio15xx.c | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/platform_data/gpio-omap.h> | ||
20 | 21 | ||
21 | #define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE | 22 | #define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE |
22 | #define OMAP1510_GPIO_BASE 0xFFFCE000 | 23 | #define OMAP1510_GPIO_BASE 0xFFFCE000 |
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c index 2a48cd2e1754..33f419236b17 100644 --- a/arch/arm/mach-omap1/gpio16xx.c +++ b/arch/arm/mach-omap1/gpio16xx.c | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/platform_data/gpio-omap.h> | ||
20 | 21 | ||
21 | #define OMAP1610_GPIO1_BASE 0xfffbe400 | 22 | #define OMAP1610_GPIO1_BASE 0xfffbe400 |
22 | #define OMAP1610_GPIO2_BASE 0xfffbec00 | 23 | #define OMAP1610_GPIO2_BASE 0xfffbec00 |
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c index acf12b73eace..958ce9acee95 100644 --- a/arch/arm/mach-omap1/gpio7xx.c +++ b/arch/arm/mach-omap1/gpio7xx.c | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/platform_data/gpio-omap.h> | ||
20 | 21 | ||
21 | #define OMAP7XX_GPIO1_BASE 0xfffbc000 | 22 | #define OMAP7XX_GPIO1_BASE 0xfffbc000 |
22 | #define OMAP7XX_GPIO2_BASE 0xfffbc800 | 23 | #define OMAP7XX_GPIO2_BASE 0xfffbc800 |
diff --git a/arch/arm/mach-omap1/i2c.c b/arch/arm/mach-omap1/i2c.c index 5446c9912641..a0551a6d7451 100644 --- a/arch/arm/mach-omap1/i2c.c +++ b/arch/arm/mach-omap1/i2c.c | |||
@@ -20,7 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <plat/i2c.h> | 22 | #include <plat/i2c.h> |
23 | #include <plat/mux.h> | 23 | #include <mach/mux.h> |
24 | #include <plat/cpu.h> | 24 | #include <plat/cpu.h> |
25 | 25 | ||
26 | void __init omap1_i2c_mux_pins(int bus_id) | 26 | void __init omap1_i2c_mux_pins(int bus_id) |
diff --git a/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h b/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h index 23eed0035ed8..adb5e7649659 100644 --- a/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h +++ b/arch/arm/mach-omap1/include/mach/ams-delta-fiq.h | |||
@@ -14,8 +14,6 @@ | |||
14 | #ifndef __AMS_DELTA_FIQ_H | 14 | #ifndef __AMS_DELTA_FIQ_H |
15 | #define __AMS_DELTA_FIQ_H | 15 | #define __AMS_DELTA_FIQ_H |
16 | 16 | ||
17 | #include <plat/irqs.h> | ||
18 | |||
19 | /* | 17 | /* |
20 | * Interrupt number used for passing control from FIQ to IRQ. | 18 | * Interrupt number used for passing control from FIQ to IRQ. |
21 | * IRQ12, described as reserved, has been selected. | 19 | * IRQ12, described as reserved, has been selected. |
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/mach-omap1/include/mach/board-ams-delta.h index ad6f865d1f16..ad6f865d1f16 100644 --- a/arch/arm/plat-omap/include/plat/board-ams-delta.h +++ b/arch/arm/mach-omap1/include/mach/board-ams-delta.h | |||
diff --git a/arch/arm/plat-omap/include/plat/board-sx1.h b/arch/arm/mach-omap1/include/mach/board-sx1.h index 355adbdaae33..355adbdaae33 100644 --- a/arch/arm/plat-omap/include/plat/board-sx1.h +++ b/arch/arm/mach-omap1/include/mach/board-sx1.h | |||
diff --git a/arch/arm/plat-omap/include/plat/board-voiceblue.h b/arch/arm/mach-omap1/include/mach/board-voiceblue.h index 27916b210f57..27916b210f57 100644 --- a/arch/arm/plat-omap/include/plat/board-voiceblue.h +++ b/arch/arm/mach-omap1/include/mach/board-voiceblue.h | |||
diff --git a/arch/arm/plat-omap/include/plat/flash.h b/arch/arm/mach-omap1/include/mach/flash.h index 0d88499b79e9..0d88499b79e9 100644 --- a/arch/arm/plat-omap/include/plat/flash.h +++ b/arch/arm/mach-omap1/include/mach/flash.h | |||
diff --git a/arch/arm/mach-omap1/include/mach/gpio.h b/arch/arm/mach-omap1/include/mach/gpio.h index e737706a8fe1..ebf86c0f4f46 100644 --- a/arch/arm/mach-omap1/include/mach/gpio.h +++ b/arch/arm/mach-omap1/include/mach/gpio.h | |||
@@ -1,5 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-omap1/include/mach/gpio.h | 2 | * arch/arm/mach-omap1/include/mach/gpio.h |
3 | */ | 3 | */ |
4 | |||
5 | #include <plat/gpio.h> | ||
diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h index 01e35fa106b8..84248d250adb 100644 --- a/arch/arm/mach-omap1/include/mach/hardware.h +++ b/arch/arm/mach-omap1/include/mach/hardware.h | |||
@@ -1,11 +1,46 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-omap1/include/mach/hardware.h | 2 | * arch/arm/mach-omap1/include/mach/hardware.h |
3 | * | ||
4 | * Hardware definitions for TI OMAP processors and boards | ||
5 | * | ||
6 | * NOTE: Please put device driver specific defines into a separate header | ||
7 | * file for each driver. | ||
8 | * | ||
9 | * Copyright (C) 2001 RidgeRun, Inc. | ||
10 | * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com> | ||
11 | * | ||
12 | * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com> | ||
13 | * and Dirk Behme <dirk.behme@de.bosch.com> | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify it | ||
16 | * under the terms of the GNU General Public License as published by the | ||
17 | * Free Software Foundation; either version 2 of the License, or (at your | ||
18 | * option) any later version. | ||
19 | * | ||
20 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
21 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
23 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
25 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
26 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
27 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
29 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
30 | * | ||
31 | * You should have received a copy of the GNU General Public License along | ||
32 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
33 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
3 | */ | 34 | */ |
4 | 35 | ||
5 | #ifndef __MACH_HARDWARE_H | 36 | #ifndef __ASM_ARCH_OMAP_HARDWARE_H |
6 | #define __MACH_HARDWARE_H | 37 | #define __ASM_ARCH_OMAP_HARDWARE_H |
7 | 38 | ||
39 | #include <asm/sizes.h> | ||
8 | #ifndef __ASSEMBLER__ | 40 | #ifndef __ASSEMBLER__ |
41 | #include <asm/types.h> | ||
42 | #include <plat/cpu.h> | ||
43 | |||
9 | /* | 44 | /* |
10 | * NOTE: Please use ioremap + __raw_read/write where possible instead of these | 45 | * NOTE: Please use ioremap + __raw_read/write where possible instead of these |
11 | */ | 46 | */ |
@@ -35,7 +70,249 @@ static inline u32 omap_cs3_phys(void) | |||
35 | ? 0 : OMAP_CS3_PHYS; | 70 | ? 0 : OMAP_CS3_PHYS; |
36 | } | 71 | } |
37 | 72 | ||
73 | #endif /* ifndef __ASSEMBLER__ */ | ||
74 | |||
75 | #include <plat/serial.h> | ||
76 | |||
77 | /* | ||
78 | * --------------------------------------------------------------------------- | ||
79 | * Common definitions for all OMAP processors | ||
80 | * NOTE: Put all processor or board specific parts to the special header | ||
81 | * files. | ||
82 | * --------------------------------------------------------------------------- | ||
83 | */ | ||
84 | |||
85 | /* | ||
86 | * ---------------------------------------------------------------------------- | ||
87 | * Timers | ||
88 | * ---------------------------------------------------------------------------- | ||
89 | */ | ||
90 | #define OMAP_MPU_TIMER1_BASE (0xfffec500) | ||
91 | #define OMAP_MPU_TIMER2_BASE (0xfffec600) | ||
92 | #define OMAP_MPU_TIMER3_BASE (0xfffec700) | ||
93 | #define MPU_TIMER_FREE (1 << 6) | ||
94 | #define MPU_TIMER_CLOCK_ENABLE (1 << 5) | ||
95 | #define MPU_TIMER_AR (1 << 1) | ||
96 | #define MPU_TIMER_ST (1 << 0) | ||
97 | |||
98 | /* | ||
99 | * ---------------------------------------------------------------------------- | ||
100 | * Clocks | ||
101 | * ---------------------------------------------------------------------------- | ||
102 | */ | ||
103 | #define CLKGEN_REG_BASE (0xfffece00) | ||
104 | #define ARM_CKCTL (CLKGEN_REG_BASE + 0x0) | ||
105 | #define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4) | ||
106 | #define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8) | ||
107 | #define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC) | ||
108 | #define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10) | ||
109 | #define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14) | ||
110 | #define ARM_SYSST (CLKGEN_REG_BASE + 0x18) | ||
111 | #define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24) | ||
112 | |||
113 | #define CK_RATEF 1 | ||
114 | #define CK_IDLEF 2 | ||
115 | #define CK_ENABLEF 4 | ||
116 | #define CK_SELECTF 8 | ||
117 | #define SETARM_IDLE_SHIFT | ||
118 | |||
119 | /* DPLL control registers */ | ||
120 | #define DPLL_CTL (0xfffecf00) | ||
121 | |||
122 | /* DSP clock control. Must use __raw_readw() and __raw_writew() with these */ | ||
123 | #define DSP_CONFIG_REG_BASE IOMEM(0xe1008000) | ||
124 | #define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0) | ||
125 | #define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4) | ||
126 | #define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8) | ||
127 | #define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14) | ||
128 | |||
129 | /* | ||
130 | * --------------------------------------------------------------------------- | ||
131 | * UPLD | ||
132 | * --------------------------------------------------------------------------- | ||
133 | */ | ||
134 | #define ULPD_REG_BASE (0xfffe0800) | ||
135 | #define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14) | ||
136 | #define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24) | ||
137 | #define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30) | ||
138 | # define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */ | ||
139 | # define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */ | ||
140 | #define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34) | ||
141 | # define SOFT_UDC_REQ (1 << 4) | ||
142 | # define SOFT_USB_CLK_REQ (1 << 3) | ||
143 | # define SOFT_DPLL_REQ (1 << 0) | ||
144 | #define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c) | ||
145 | #define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40) | ||
146 | #define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c) | ||
147 | #define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50) | ||
148 | #define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68) | ||
149 | # define DIS_MMC2_DPLL_REQ (1 << 11) | ||
150 | # define DIS_MMC1_DPLL_REQ (1 << 10) | ||
151 | # define DIS_UART3_DPLL_REQ (1 << 9) | ||
152 | # define DIS_UART2_DPLL_REQ (1 << 8) | ||
153 | # define DIS_UART1_DPLL_REQ (1 << 7) | ||
154 | # define DIS_USB_HOST_DPLL_REQ (1 << 6) | ||
155 | #define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74) | ||
156 | #define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c) | ||
157 | |||
158 | /* | ||
159 | * --------------------------------------------------------------------------- | ||
160 | * Watchdog timer | ||
161 | * --------------------------------------------------------------------------- | ||
162 | */ | ||
163 | |||
164 | /* Watchdog timer within the OMAP3.2 gigacell */ | ||
165 | #define OMAP_MPU_WATCHDOG_BASE (0xfffec800) | ||
166 | #define OMAP_WDT_TIMER (OMAP_MPU_WATCHDOG_BASE + 0x0) | ||
167 | #define OMAP_WDT_LOAD_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4) | ||
168 | #define OMAP_WDT_READ_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4) | ||
169 | #define OMAP_WDT_TIMER_MODE (OMAP_MPU_WATCHDOG_BASE + 0x8) | ||
170 | |||
171 | /* | ||
172 | * --------------------------------------------------------------------------- | ||
173 | * Interrupts | ||
174 | * --------------------------------------------------------------------------- | ||
175 | */ | ||
176 | #ifdef CONFIG_ARCH_OMAP1 | ||
177 | |||
178 | /* | ||
179 | * XXX: These probably want to be moved to arch/arm/mach-omap/omap1/irq.c | ||
180 | * or something similar.. -- PFM. | ||
181 | */ | ||
182 | |||
183 | #define OMAP_IH1_BASE 0xfffecb00 | ||
184 | #define OMAP_IH2_BASE 0xfffe0000 | ||
185 | |||
186 | #define OMAP_IH1_ITR (OMAP_IH1_BASE + 0x00) | ||
187 | #define OMAP_IH1_MIR (OMAP_IH1_BASE + 0x04) | ||
188 | #define OMAP_IH1_SIR_IRQ (OMAP_IH1_BASE + 0x10) | ||
189 | #define OMAP_IH1_SIR_FIQ (OMAP_IH1_BASE + 0x14) | ||
190 | #define OMAP_IH1_CONTROL (OMAP_IH1_BASE + 0x18) | ||
191 | #define OMAP_IH1_ILR0 (OMAP_IH1_BASE + 0x1c) | ||
192 | #define OMAP_IH1_ISR (OMAP_IH1_BASE + 0x9c) | ||
193 | |||
194 | #define OMAP_IH2_ITR (OMAP_IH2_BASE + 0x00) | ||
195 | #define OMAP_IH2_MIR (OMAP_IH2_BASE + 0x04) | ||
196 | #define OMAP_IH2_SIR_IRQ (OMAP_IH2_BASE + 0x10) | ||
197 | #define OMAP_IH2_SIR_FIQ (OMAP_IH2_BASE + 0x14) | ||
198 | #define OMAP_IH2_CONTROL (OMAP_IH2_BASE + 0x18) | ||
199 | #define OMAP_IH2_ILR0 (OMAP_IH2_BASE + 0x1c) | ||
200 | #define OMAP_IH2_ISR (OMAP_IH2_BASE + 0x9c) | ||
201 | |||
202 | #define IRQ_ITR_REG_OFFSET 0x00 | ||
203 | #define IRQ_MIR_REG_OFFSET 0x04 | ||
204 | #define IRQ_SIR_IRQ_REG_OFFSET 0x10 | ||
205 | #define IRQ_SIR_FIQ_REG_OFFSET 0x14 | ||
206 | #define IRQ_CONTROL_REG_OFFSET 0x18 | ||
207 | #define IRQ_ISR_REG_OFFSET 0x9c | ||
208 | #define IRQ_ILR0_REG_OFFSET 0x1c | ||
209 | #define IRQ_GMR_REG_OFFSET 0xa0 | ||
210 | |||
38 | #endif | 211 | #endif |
39 | #endif | ||
40 | 212 | ||
41 | #include <plat/hardware.h> | 213 | /* |
214 | * ---------------------------------------------------------------------------- | ||
215 | * System control registers | ||
216 | * ---------------------------------------------------------------------------- | ||
217 | */ | ||
218 | #define MOD_CONF_CTRL_0 0xfffe1080 | ||
219 | #define MOD_CONF_CTRL_1 0xfffe1110 | ||
220 | |||
221 | /* | ||
222 | * ---------------------------------------------------------------------------- | ||
223 | * Pin multiplexing registers | ||
224 | * ---------------------------------------------------------------------------- | ||
225 | */ | ||
226 | #define FUNC_MUX_CTRL_0 0xfffe1000 | ||
227 | #define FUNC_MUX_CTRL_1 0xfffe1004 | ||
228 | #define FUNC_MUX_CTRL_2 0xfffe1008 | ||
229 | #define COMP_MODE_CTRL_0 0xfffe100c | ||
230 | #define FUNC_MUX_CTRL_3 0xfffe1010 | ||
231 | #define FUNC_MUX_CTRL_4 0xfffe1014 | ||
232 | #define FUNC_MUX_CTRL_5 0xfffe1018 | ||
233 | #define FUNC_MUX_CTRL_6 0xfffe101C | ||
234 | #define FUNC_MUX_CTRL_7 0xfffe1020 | ||
235 | #define FUNC_MUX_CTRL_8 0xfffe1024 | ||
236 | #define FUNC_MUX_CTRL_9 0xfffe1028 | ||
237 | #define FUNC_MUX_CTRL_A 0xfffe102C | ||
238 | #define FUNC_MUX_CTRL_B 0xfffe1030 | ||
239 | #define FUNC_MUX_CTRL_C 0xfffe1034 | ||
240 | #define FUNC_MUX_CTRL_D 0xfffe1038 | ||
241 | #define PULL_DWN_CTRL_0 0xfffe1040 | ||
242 | #define PULL_DWN_CTRL_1 0xfffe1044 | ||
243 | #define PULL_DWN_CTRL_2 0xfffe1048 | ||
244 | #define PULL_DWN_CTRL_3 0xfffe104c | ||
245 | #define PULL_DWN_CTRL_4 0xfffe10ac | ||
246 | |||
247 | /* OMAP-1610 specific multiplexing registers */ | ||
248 | #define FUNC_MUX_CTRL_E 0xfffe1090 | ||
249 | #define FUNC_MUX_CTRL_F 0xfffe1094 | ||
250 | #define FUNC_MUX_CTRL_10 0xfffe1098 | ||
251 | #define FUNC_MUX_CTRL_11 0xfffe109c | ||
252 | #define FUNC_MUX_CTRL_12 0xfffe10a0 | ||
253 | #define PU_PD_SEL_0 0xfffe10b4 | ||
254 | #define PU_PD_SEL_1 0xfffe10b8 | ||
255 | #define PU_PD_SEL_2 0xfffe10bc | ||
256 | #define PU_PD_SEL_3 0xfffe10c0 | ||
257 | #define PU_PD_SEL_4 0xfffe10c4 | ||
258 | |||
259 | /* Timer32K for 1610 and 1710*/ | ||
260 | #define OMAP_TIMER32K_BASE 0xFFFBC400 | ||
261 | |||
262 | /* | ||
263 | * --------------------------------------------------------------------------- | ||
264 | * TIPB bus interface | ||
265 | * --------------------------------------------------------------------------- | ||
266 | */ | ||
267 | #define TIPB_PUBLIC_CNTL_BASE 0xfffed300 | ||
268 | #define MPU_PUBLIC_TIPB_CNTL (TIPB_PUBLIC_CNTL_BASE + 0x8) | ||
269 | #define TIPB_PRIVATE_CNTL_BASE 0xfffeca00 | ||
270 | #define MPU_PRIVATE_TIPB_CNTL (TIPB_PRIVATE_CNTL_BASE + 0x8) | ||
271 | |||
272 | /* | ||
273 | * ---------------------------------------------------------------------------- | ||
274 | * MPUI interface | ||
275 | * ---------------------------------------------------------------------------- | ||
276 | */ | ||
277 | #define MPUI_BASE (0xfffec900) | ||
278 | #define MPUI_CTRL (MPUI_BASE + 0x0) | ||
279 | #define MPUI_DEBUG_ADDR (MPUI_BASE + 0x4) | ||
280 | #define MPUI_DEBUG_DATA (MPUI_BASE + 0x8) | ||
281 | #define MPUI_DEBUG_FLAG (MPUI_BASE + 0xc) | ||
282 | #define MPUI_STATUS_REG (MPUI_BASE + 0x10) | ||
283 | #define MPUI_DSP_STATUS (MPUI_BASE + 0x14) | ||
284 | #define MPUI_DSP_BOOT_CONFIG (MPUI_BASE + 0x18) | ||
285 | #define MPUI_DSP_API_CONFIG (MPUI_BASE + 0x1c) | ||
286 | |||
287 | /* | ||
288 | * ---------------------------------------------------------------------------- | ||
289 | * LED Pulse Generator | ||
290 | * ---------------------------------------------------------------------------- | ||
291 | */ | ||
292 | #define OMAP_LPG1_BASE 0xfffbd000 | ||
293 | #define OMAP_LPG2_BASE 0xfffbd800 | ||
294 | #define OMAP_LPG1_LCR (OMAP_LPG1_BASE + 0x00) | ||
295 | #define OMAP_LPG1_PMR (OMAP_LPG1_BASE + 0x04) | ||
296 | #define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00) | ||
297 | #define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04) | ||
298 | |||
299 | /* | ||
300 | * ---------------------------------------------------------------------------- | ||
301 | * Pulse-Width Light | ||
302 | * ---------------------------------------------------------------------------- | ||
303 | */ | ||
304 | #define OMAP_PWL_BASE 0xfffb5800 | ||
305 | #define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00) | ||
306 | #define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04) | ||
307 | |||
308 | /* | ||
309 | * --------------------------------------------------------------------------- | ||
310 | * Processor specific defines | ||
311 | * --------------------------------------------------------------------------- | ||
312 | */ | ||
313 | |||
314 | #include "omap7xx.h" | ||
315 | #include "omap1510.h" | ||
316 | #include "omap16xx.h" | ||
317 | |||
318 | #endif /* __ASM_ARCH_OMAP_HARDWARE_H */ | ||
diff --git a/arch/arm/plat-omap/include/plat/irda.h b/arch/arm/mach-omap1/include/mach/irda.h index 40f60339d1c6..40f60339d1c6 100644 --- a/arch/arm/plat-omap/include/plat/irda.h +++ b/arch/arm/mach-omap1/include/mach/irda.h | |||
diff --git a/arch/arm/mach-omap1/include/mach/irqs.h b/arch/arm/mach-omap1/include/mach/irqs.h index 9292fdc1cb0b..729992d7d26a 100644 --- a/arch/arm/mach-omap1/include/mach/irqs.h +++ b/arch/arm/mach-omap1/include/mach/irqs.h | |||
@@ -1,5 +1,268 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-omap1/include/mach/irqs.h | 2 | * arch/arm/plat-omap/include/mach/irqs.h |
3 | * | ||
4 | * Copyright (C) Greg Lonnon 2001 | ||
5 | * Updated for OMAP-1610 by Tony Lindgren <tony@atomide.com> | ||
6 | * | ||
7 | * Copyright (C) 2009 Texas Instruments | ||
8 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
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 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | * NOTE: The interrupt vectors for the OMAP-1509, OMAP-1510, and OMAP-1610 | ||
25 | * are different. | ||
3 | */ | 26 | */ |
4 | 27 | ||
5 | #include <plat/irqs.h> | 28 | #ifndef __ASM_ARCH_OMAP15XX_IRQS_H |
29 | #define __ASM_ARCH_OMAP15XX_IRQS_H | ||
30 | |||
31 | /* | ||
32 | * IRQ numbers for interrupt handler 1 | ||
33 | * | ||
34 | * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below | ||
35 | * | ||
36 | */ | ||
37 | #define INT_CAMERA 1 | ||
38 | #define INT_FIQ 3 | ||
39 | #define INT_RTDX 6 | ||
40 | #define INT_DSP_MMU_ABORT 7 | ||
41 | #define INT_HOST 8 | ||
42 | #define INT_ABORT 9 | ||
43 | #define INT_BRIDGE_PRIV 13 | ||
44 | #define INT_GPIO_BANK1 14 | ||
45 | #define INT_UART3 15 | ||
46 | #define INT_TIMER3 16 | ||
47 | #define INT_DMA_CH0_6 19 | ||
48 | #define INT_DMA_CH1_7 20 | ||
49 | #define INT_DMA_CH2_8 21 | ||
50 | #define INT_DMA_CH3 22 | ||
51 | #define INT_DMA_CH4 23 | ||
52 | #define INT_DMA_CH5 24 | ||
53 | #define INT_TIMER1 26 | ||
54 | #define INT_WD_TIMER 27 | ||
55 | #define INT_BRIDGE_PUB 28 | ||
56 | #define INT_TIMER2 30 | ||
57 | #define INT_LCD_CTRL 31 | ||
58 | |||
59 | /* | ||
60 | * OMAP-1510 specific IRQ numbers for interrupt handler 1 | ||
61 | */ | ||
62 | #define INT_1510_IH2_IRQ 0 | ||
63 | #define INT_1510_RES2 2 | ||
64 | #define INT_1510_SPI_TX 4 | ||
65 | #define INT_1510_SPI_RX 5 | ||
66 | #define INT_1510_DSP_MAILBOX1 10 | ||
67 | #define INT_1510_DSP_MAILBOX2 11 | ||
68 | #define INT_1510_RES12 12 | ||
69 | #define INT_1510_LB_MMU 17 | ||
70 | #define INT_1510_RES18 18 | ||
71 | #define INT_1510_LOCAL_BUS 29 | ||
72 | |||
73 | /* | ||
74 | * OMAP-1610 specific IRQ numbers for interrupt handler 1 | ||
75 | */ | ||
76 | #define INT_1610_IH2_IRQ INT_1510_IH2_IRQ | ||
77 | #define INT_1610_IH2_FIQ 2 | ||
78 | #define INT_1610_McBSP2_TX 4 | ||
79 | #define INT_1610_McBSP2_RX 5 | ||
80 | #define INT_1610_DSP_MAILBOX1 10 | ||
81 | #define INT_1610_DSP_MAILBOX2 11 | ||
82 | #define INT_1610_LCD_LINE 12 | ||
83 | #define INT_1610_GPTIMER1 17 | ||
84 | #define INT_1610_GPTIMER2 18 | ||
85 | #define INT_1610_SSR_FIFO_0 29 | ||
86 | |||
87 | /* | ||
88 | * OMAP-7xx specific IRQ numbers for interrupt handler 1 | ||
89 | */ | ||
90 | #define INT_7XX_IH2_FIQ 0 | ||
91 | #define INT_7XX_IH2_IRQ 1 | ||
92 | #define INT_7XX_USB_NON_ISO 2 | ||
93 | #define INT_7XX_USB_ISO 3 | ||
94 | #define INT_7XX_ICR 4 | ||
95 | #define INT_7XX_EAC 5 | ||
96 | #define INT_7XX_GPIO_BANK1 6 | ||
97 | #define INT_7XX_GPIO_BANK2 7 | ||
98 | #define INT_7XX_GPIO_BANK3 8 | ||
99 | #define INT_7XX_McBSP2TX 10 | ||
100 | #define INT_7XX_McBSP2RX 11 | ||
101 | #define INT_7XX_McBSP2RX_OVF 12 | ||
102 | #define INT_7XX_LCD_LINE 14 | ||
103 | #define INT_7XX_GSM_PROTECT 15 | ||
104 | #define INT_7XX_TIMER3 16 | ||
105 | #define INT_7XX_GPIO_BANK5 17 | ||
106 | #define INT_7XX_GPIO_BANK6 18 | ||
107 | #define INT_7XX_SPGIO_WR 29 | ||
108 | |||
109 | /* | ||
110 | * IRQ numbers for interrupt handler 2 | ||
111 | * | ||
112 | * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below | ||
113 | */ | ||
114 | #define IH2_BASE 32 | ||
115 | |||
116 | #define INT_KEYBOARD (1 + IH2_BASE) | ||
117 | #define INT_uWireTX (2 + IH2_BASE) | ||
118 | #define INT_uWireRX (3 + IH2_BASE) | ||
119 | #define INT_I2C (4 + IH2_BASE) | ||
120 | #define INT_MPUIO (5 + IH2_BASE) | ||
121 | #define INT_USB_HHC_1 (6 + IH2_BASE) | ||
122 | #define INT_McBSP3TX (10 + IH2_BASE) | ||
123 | #define INT_McBSP3RX (11 + IH2_BASE) | ||
124 | #define INT_McBSP1TX (12 + IH2_BASE) | ||
125 | #define INT_McBSP1RX (13 + IH2_BASE) | ||
126 | #define INT_UART1 (14 + IH2_BASE) | ||
127 | #define INT_UART2 (15 + IH2_BASE) | ||
128 | #define INT_BT_MCSI1TX (16 + IH2_BASE) | ||
129 | #define INT_BT_MCSI1RX (17 + IH2_BASE) | ||
130 | #define INT_SOSSI_MATCH (19 + IH2_BASE) | ||
131 | #define INT_USB_W2FC (20 + IH2_BASE) | ||
132 | #define INT_1WIRE (21 + IH2_BASE) | ||
133 | #define INT_OS_TIMER (22 + IH2_BASE) | ||
134 | #define INT_MMC (23 + IH2_BASE) | ||
135 | #define INT_GAUGE_32K (24 + IH2_BASE) | ||
136 | #define INT_RTC_TIMER (25 + IH2_BASE) | ||
137 | #define INT_RTC_ALARM (26 + IH2_BASE) | ||
138 | #define INT_MEM_STICK (27 + IH2_BASE) | ||
139 | |||
140 | /* | ||
141 | * OMAP-1510 specific IRQ numbers for interrupt handler 2 | ||
142 | */ | ||
143 | #define INT_1510_DSP_MMU (28 + IH2_BASE) | ||
144 | #define INT_1510_COM_SPI_RO (31 + IH2_BASE) | ||
145 | |||
146 | /* | ||
147 | * OMAP-1610 specific IRQ numbers for interrupt handler 2 | ||
148 | */ | ||
149 | #define INT_1610_FAC (0 + IH2_BASE) | ||
150 | #define INT_1610_USB_HHC_2 (7 + IH2_BASE) | ||
151 | #define INT_1610_USB_OTG (8 + IH2_BASE) | ||
152 | #define INT_1610_SoSSI (9 + IH2_BASE) | ||
153 | #define INT_1610_SoSSI_MATCH (19 + IH2_BASE) | ||
154 | #define INT_1610_DSP_MMU (28 + IH2_BASE) | ||
155 | #define INT_1610_McBSP2RX_OF (31 + IH2_BASE) | ||
156 | #define INT_1610_STI (32 + IH2_BASE) | ||
157 | #define INT_1610_STI_WAKEUP (33 + IH2_BASE) | ||
158 | #define INT_1610_GPTIMER3 (34 + IH2_BASE) | ||
159 | #define INT_1610_GPTIMER4 (35 + IH2_BASE) | ||
160 | #define INT_1610_GPTIMER5 (36 + IH2_BASE) | ||
161 | #define INT_1610_GPTIMER6 (37 + IH2_BASE) | ||
162 | #define INT_1610_GPTIMER7 (38 + IH2_BASE) | ||
163 | #define INT_1610_GPTIMER8 (39 + IH2_BASE) | ||
164 | #define INT_1610_GPIO_BANK2 (40 + IH2_BASE) | ||
165 | #define INT_1610_GPIO_BANK3 (41 + IH2_BASE) | ||
166 | #define INT_1610_MMC2 (42 + IH2_BASE) | ||
167 | #define INT_1610_CF (43 + IH2_BASE) | ||
168 | #define INT_1610_WAKE_UP_REQ (46 + IH2_BASE) | ||
169 | #define INT_1610_GPIO_BANK4 (48 + IH2_BASE) | ||
170 | #define INT_1610_SPI (49 + IH2_BASE) | ||
171 | #define INT_1610_DMA_CH6 (53 + IH2_BASE) | ||
172 | #define INT_1610_DMA_CH7 (54 + IH2_BASE) | ||
173 | #define INT_1610_DMA_CH8 (55 + IH2_BASE) | ||
174 | #define INT_1610_DMA_CH9 (56 + IH2_BASE) | ||
175 | #define INT_1610_DMA_CH10 (57 + IH2_BASE) | ||
176 | #define INT_1610_DMA_CH11 (58 + IH2_BASE) | ||
177 | #define INT_1610_DMA_CH12 (59 + IH2_BASE) | ||
178 | #define INT_1610_DMA_CH13 (60 + IH2_BASE) | ||
179 | #define INT_1610_DMA_CH14 (61 + IH2_BASE) | ||
180 | #define INT_1610_DMA_CH15 (62 + IH2_BASE) | ||
181 | #define INT_1610_NAND (63 + IH2_BASE) | ||
182 | #define INT_1610_SHA1MD5 (91 + IH2_BASE) | ||
183 | |||
184 | /* | ||
185 | * OMAP-7xx specific IRQ numbers for interrupt handler 2 | ||
186 | */ | ||
187 | #define INT_7XX_HW_ERRORS (0 + IH2_BASE) | ||
188 | #define INT_7XX_NFIQ_PWR_FAIL (1 + IH2_BASE) | ||
189 | #define INT_7XX_CFCD (2 + IH2_BASE) | ||
190 | #define INT_7XX_CFIREQ (3 + IH2_BASE) | ||
191 | #define INT_7XX_I2C (4 + IH2_BASE) | ||
192 | #define INT_7XX_PCC (5 + IH2_BASE) | ||
193 | #define INT_7XX_MPU_EXT_NIRQ (6 + IH2_BASE) | ||
194 | #define INT_7XX_SPI_100K_1 (7 + IH2_BASE) | ||
195 | #define INT_7XX_SYREN_SPI (8 + IH2_BASE) | ||
196 | #define INT_7XX_VLYNQ (9 + IH2_BASE) | ||
197 | #define INT_7XX_GPIO_BANK4 (10 + IH2_BASE) | ||
198 | #define INT_7XX_McBSP1TX (11 + IH2_BASE) | ||
199 | #define INT_7XX_McBSP1RX (12 + IH2_BASE) | ||
200 | #define INT_7XX_McBSP1RX_OF (13 + IH2_BASE) | ||
201 | #define INT_7XX_UART_MODEM_IRDA_2 (14 + IH2_BASE) | ||
202 | #define INT_7XX_UART_MODEM_1 (15 + IH2_BASE) | ||
203 | #define INT_7XX_MCSI (16 + IH2_BASE) | ||
204 | #define INT_7XX_uWireTX (17 + IH2_BASE) | ||
205 | #define INT_7XX_uWireRX (18 + IH2_BASE) | ||
206 | #define INT_7XX_SMC_CD (19 + IH2_BASE) | ||
207 | #define INT_7XX_SMC_IREQ (20 + IH2_BASE) | ||
208 | #define INT_7XX_HDQ_1WIRE (21 + IH2_BASE) | ||
209 | #define INT_7XX_TIMER32K (22 + IH2_BASE) | ||
210 | #define INT_7XX_MMC_SDIO (23 + IH2_BASE) | ||
211 | #define INT_7XX_UPLD (24 + IH2_BASE) | ||
212 | #define INT_7XX_USB_HHC_1 (27 + IH2_BASE) | ||
213 | #define INT_7XX_USB_HHC_2 (28 + IH2_BASE) | ||
214 | #define INT_7XX_USB_GENI (29 + IH2_BASE) | ||
215 | #define INT_7XX_USB_OTG (30 + IH2_BASE) | ||
216 | #define INT_7XX_CAMERA_IF (31 + IH2_BASE) | ||
217 | #define INT_7XX_RNG (32 + IH2_BASE) | ||
218 | #define INT_7XX_DUAL_MODE_TIMER (33 + IH2_BASE) | ||
219 | #define INT_7XX_DBB_RF_EN (34 + IH2_BASE) | ||
220 | #define INT_7XX_MPUIO_KEYPAD (35 + IH2_BASE) | ||
221 | #define INT_7XX_SHA1_MD5 (36 + IH2_BASE) | ||
222 | #define INT_7XX_SPI_100K_2 (37 + IH2_BASE) | ||
223 | #define INT_7XX_RNG_IDLE (38 + IH2_BASE) | ||
224 | #define INT_7XX_MPUIO (39 + IH2_BASE) | ||
225 | #define INT_7XX_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE) | ||
226 | #define INT_7XX_LLPC_OE_FALLING (41 + IH2_BASE) | ||
227 | #define INT_7XX_LLPC_OE_RISING (42 + IH2_BASE) | ||
228 | #define INT_7XX_LLPC_VSYNC (43 + IH2_BASE) | ||
229 | #define INT_7XX_WAKE_UP_REQ (46 + IH2_BASE) | ||
230 | #define INT_7XX_DMA_CH6 (53 + IH2_BASE) | ||
231 | #define INT_7XX_DMA_CH7 (54 + IH2_BASE) | ||
232 | #define INT_7XX_DMA_CH8 (55 + IH2_BASE) | ||
233 | #define INT_7XX_DMA_CH9 (56 + IH2_BASE) | ||
234 | #define INT_7XX_DMA_CH10 (57 + IH2_BASE) | ||
235 | #define INT_7XX_DMA_CH11 (58 + IH2_BASE) | ||
236 | #define INT_7XX_DMA_CH12 (59 + IH2_BASE) | ||
237 | #define INT_7XX_DMA_CH13 (60 + IH2_BASE) | ||
238 | #define INT_7XX_DMA_CH14 (61 + IH2_BASE) | ||
239 | #define INT_7XX_DMA_CH15 (62 + IH2_BASE) | ||
240 | #define INT_7XX_NAND (63 + IH2_BASE) | ||
241 | |||
242 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and | ||
243 | * 16 MPUIO lines */ | ||
244 | #define OMAP_MAX_GPIO_LINES 192 | ||
245 | #define IH_GPIO_BASE (128 + IH2_BASE) | ||
246 | #define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE) | ||
247 | #define OMAP_IRQ_END (IH_MPUIO_BASE + 16) | ||
248 | |||
249 | /* External FPGA handles interrupts on Innovator boards */ | ||
250 | #define OMAP_FPGA_IRQ_BASE (OMAP_IRQ_END) | ||
251 | #ifdef CONFIG_MACH_OMAP_INNOVATOR | ||
252 | #define OMAP_FPGA_NR_IRQS 24 | ||
253 | #else | ||
254 | #define OMAP_FPGA_NR_IRQS 0 | ||
255 | #endif | ||
256 | #define OMAP_FPGA_IRQ_END (OMAP_FPGA_IRQ_BASE + OMAP_FPGA_NR_IRQS) | ||
257 | |||
258 | #define NR_IRQS OMAP_FPGA_IRQ_END | ||
259 | |||
260 | #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) | ||
261 | |||
262 | #include <mach/hardware.h> | ||
263 | |||
264 | #ifdef CONFIG_FIQ | ||
265 | #define FIQ_START 1024 | ||
266 | #endif | ||
267 | |||
268 | #endif | ||
diff --git a/arch/arm/plat-omap/include/plat/mux.h b/arch/arm/mach-omap1/include/mach/mux.h index 323948959200..323948959200 100644 --- a/arch/arm/plat-omap/include/plat/mux.h +++ b/arch/arm/mach-omap1/include/mach/mux.h | |||
diff --git a/arch/arm/plat-omap/include/plat/omap1510.h b/arch/arm/mach-omap1/include/mach/omap1510.h index d24004668138..8fe05d6137c0 100644 --- a/arch/arm/plat-omap/include/plat/omap1510.h +++ b/arch/arm/mach-omap1/include/mach/omap1510.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* arch/arm/plat-omap/include/mach/omap1510.h | 1 | /* |
2 | * | ||
3 | * Hardware definitions for TI OMAP1510 processor. | 2 | * Hardware definitions for TI OMAP1510 processor. |
4 | * | 3 | * |
5 | * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> | 4 | * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> |
diff --git a/arch/arm/plat-omap/include/plat/omap16xx.h b/arch/arm/mach-omap1/include/mach/omap16xx.h index e69e1d857b45..cd1c724869c7 100644 --- a/arch/arm/plat-omap/include/plat/omap16xx.h +++ b/arch/arm/mach-omap1/include/mach/omap16xx.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* arch/arm/plat-omap/include/mach/omap16xx.h | 1 | /* |
2 | * | ||
3 | * Hardware definitions for TI OMAP1610/5912/1710 processors. | 2 | * Hardware definitions for TI OMAP1610/5912/1710 processors. |
4 | * | 3 | * |
5 | * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> | 4 | * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> |
diff --git a/arch/arm/plat-omap/include/plat/omap7xx.h b/arch/arm/mach-omap1/include/mach/omap7xx.h index 48e4757e1e30..63da994bc609 100644 --- a/arch/arm/plat-omap/include/plat/omap7xx.h +++ b/arch/arm/mach-omap1/include/mach/omap7xx.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* arch/arm/plat-omap/include/mach/omap7xx.h | 1 | /* |
2 | * | ||
3 | * Hardware definitions for TI OMAP7XX processor. | 2 | * Hardware definitions for TI OMAP7XX processor. |
4 | * | 3 | * |
5 | * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> | 4 | * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> |
diff --git a/arch/arm/mach-omap1/include/mach/smp.h b/arch/arm/mach-omap1/include/mach/smp.h deleted file mode 100644 index 80a371c06e59..000000000000 --- a/arch/arm/mach-omap1/include/mach/smp.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-omap1/include/mach/smp.h | ||
3 | */ | ||
4 | |||
5 | #include <plat/smp.h> | ||
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c index 6c95a59f0f16..6a5baab1f4cb 100644 --- a/arch/arm/mach-omap1/io.c +++ b/arch/arm/mach-omap1/io.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <asm/tlb.h> | 16 | #include <asm/tlb.h> |
17 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
18 | 18 | ||
19 | #include <plat/mux.h> | 19 | #include <mach/mux.h> |
20 | #include <plat/tc.h> | 20 | #include <plat/tc.h> |
21 | #include <plat/dma.h> | 21 | #include <plat/dma.h> |
22 | 22 | ||
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c index 5769c71815b2..ed42628611bc 100644 --- a/arch/arm/mach-omap1/lcd_dma.c +++ b/arch/arm/mach-omap1/lcd_dma.c | |||
@@ -113,8 +113,7 @@ EXPORT_SYMBOL(omap_set_lcd_dma_b1_mirror); | |||
113 | void omap_set_lcd_dma_b1_vxres(unsigned long vxres) | 113 | void omap_set_lcd_dma_b1_vxres(unsigned long vxres) |
114 | { | 114 | { |
115 | if (cpu_is_omap15xx()) { | 115 | if (cpu_is_omap15xx()) { |
116 | printk(KERN_ERR "DMA virtual resolution is not supported " | 116 | pr_err("DMA virtual resolution is not supported in 1510 mode\n"); |
117 | "in 1510 mode\n"); | ||
118 | BUG(); | 117 | BUG(); |
119 | } | 118 | } |
120 | lcd_dma.vxres = vxres; | 119 | lcd_dma.vxres = vxres; |
@@ -437,8 +436,7 @@ static int __init omap_init_lcd_dma(void) | |||
437 | r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0, | 436 | r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0, |
438 | "LCD DMA", NULL); | 437 | "LCD DMA", NULL); |
439 | if (r != 0) | 438 | if (r != 0) |
440 | printk(KERN_ERR "unable to request IRQ for LCD DMA " | 439 | pr_err("unable to request IRQ for LCD DMA (error %d)\n", r); |
441 | "(error %d)\n", r); | ||
442 | 440 | ||
443 | return r; | 441 | return r; |
444 | } | 442 | } |
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c index f6b14a14a957..6f958aec9459 100644 --- a/arch/arm/mach-omap1/leds-h2p2-debug.c +++ b/arch/arm/mach-omap1/leds-h2p2-debug.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/kernel_stat.h> | 14 | #include <linux/kernel_stat.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/platform_data/gpio-omap.h> | ||
17 | 18 | ||
18 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
19 | #include <asm/leds.h> | 20 | #include <asm/leds.h> |
@@ -68,11 +69,13 @@ void h2p2_dbg_leds_event(led_event_t evt) | |||
68 | gpio_set_value(GPIO_IDLE, 0); | 69 | gpio_set_value(GPIO_IDLE, 0); |
69 | } | 70 | } |
70 | 71 | ||
71 | __raw_writew(~0, &fpga->leds); | ||
72 | led_state &= ~LED_STATE_ENABLED; | 72 | led_state &= ~LED_STATE_ENABLED; |
73 | if (evt == led_halted) { | 73 | if (fpga) { |
74 | iounmap(fpga); | 74 | __raw_writew(~0, &fpga->leds); |
75 | fpga = NULL; | 75 | if (evt == led_halted) { |
76 | iounmap(fpga); | ||
77 | fpga = NULL; | ||
78 | } | ||
76 | } | 79 | } |
77 | 80 | ||
78 | goto done; | 81 | goto done; |
@@ -158,7 +161,7 @@ void h2p2_dbg_leds_event(led_event_t evt) | |||
158 | /* | 161 | /* |
159 | * Actually burn the LEDs | 162 | * Actually burn the LEDs |
160 | */ | 163 | */ |
161 | if (led_state & LED_STATE_ENABLED) | 164 | if (led_state & LED_STATE_ENABLED && fpga) |
162 | __raw_writew(~hw_led_state, &fpga->leds); | 165 | __raw_writew(~hw_led_state, &fpga->leds); |
163 | 166 | ||
164 | done: | 167 | done: |
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c index ae6dd93b8ddc..4071479f7106 100644 --- a/arch/arm/mach-omap1/leds.c +++ b/arch/arm/mach-omap1/leds.c | |||
@@ -6,11 +6,12 @@ | |||
6 | #include <linux/gpio.h> | 6 | #include <linux/gpio.h> |
7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
9 | #include <linux/platform_data/gpio-omap.h> | ||
9 | 10 | ||
10 | #include <asm/leds.h> | 11 | #include <asm/leds.h> |
11 | #include <asm/mach-types.h> | 12 | #include <asm/mach-types.h> |
12 | 13 | ||
13 | #include <plat/mux.h> | 14 | #include <mach/mux.h> |
14 | 15 | ||
15 | #include "leds.h" | 16 | #include "leds.h" |
16 | 17 | ||
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index adf00975b9bb..bdc2e7541adb 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c | |||
@@ -20,9 +20,9 @@ | |||
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | 21 | ||
22 | #include <plat/dma.h> | 22 | #include <plat/dma.h> |
23 | #include <plat/mux.h> | 23 | #include <mach/mux.h> |
24 | #include <plat/cpu.h> | 24 | #include <plat/cpu.h> |
25 | #include <plat/mcbsp.h> | 25 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
26 | 26 | ||
27 | #include <mach/irqs.h> | 27 | #include <mach/irqs.h> |
28 | 28 | ||
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c index e9cc52d4cb28..667ce5027f63 100644 --- a/arch/arm/mach-omap1/mux.c +++ b/arch/arm/mach-omap1/mux.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | 31 | ||
32 | #include <plat/mux.h> | 32 | #include <mach/mux.h> |
33 | 33 | ||
34 | #ifdef CONFIG_OMAP_MUX | 34 | #ifdef CONFIG_OMAP_MUX |
35 | 35 | ||
@@ -451,6 +451,56 @@ static int __init_or_module omap1_cfg_reg(const struct pin_config *cfg) | |||
451 | #endif | 451 | #endif |
452 | } | 452 | } |
453 | 453 | ||
454 | static struct omap_mux_cfg *mux_cfg; | ||
455 | |||
456 | int __init omap_mux_register(struct omap_mux_cfg *arch_mux_cfg) | ||
457 | { | ||
458 | if (!arch_mux_cfg || !arch_mux_cfg->pins || arch_mux_cfg->size == 0 | ||
459 | || !arch_mux_cfg->cfg_reg) { | ||
460 | printk(KERN_ERR "Invalid pin table\n"); | ||
461 | return -EINVAL; | ||
462 | } | ||
463 | |||
464 | mux_cfg = arch_mux_cfg; | ||
465 | |||
466 | return 0; | ||
467 | } | ||
468 | |||
469 | /* | ||
470 | * Sets the Omap MUX and PULL_DWN registers based on the table | ||
471 | */ | ||
472 | int __init_or_module omap_cfg_reg(const unsigned long index) | ||
473 | { | ||
474 | struct pin_config *reg; | ||
475 | |||
476 | if (!cpu_class_is_omap1()) { | ||
477 | printk(KERN_ERR "mux: Broken omap_cfg_reg(%lu) entry\n", | ||
478 | index); | ||
479 | WARN_ON(1); | ||
480 | return -EINVAL; | ||
481 | } | ||
482 | |||
483 | if (mux_cfg == NULL) { | ||
484 | printk(KERN_ERR "Pin mux table not initialized\n"); | ||
485 | return -ENODEV; | ||
486 | } | ||
487 | |||
488 | if (index >= mux_cfg->size) { | ||
489 | printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n", | ||
490 | index, mux_cfg->size); | ||
491 | dump_stack(); | ||
492 | return -ENODEV; | ||
493 | } | ||
494 | |||
495 | reg = &mux_cfg->pins[index]; | ||
496 | |||
497 | if (!mux_cfg->cfg_reg) | ||
498 | return -ENODEV; | ||
499 | |||
500 | return mux_cfg->cfg_reg(reg); | ||
501 | } | ||
502 | EXPORT_SYMBOL(omap_cfg_reg); | ||
503 | |||
454 | int __init omap1_mux_init(void) | 504 | int __init omap1_mux_init(void) |
455 | { | 505 | { |
456 | if (cpu_is_omap7xx()) { | 506 | if (cpu_is_omap7xx()) { |
@@ -468,4 +518,8 @@ int __init omap1_mux_init(void) | |||
468 | return omap_mux_register(&arch_mux_cfg); | 518 | return omap_mux_register(&arch_mux_cfg); |
469 | } | 519 | } |
470 | 520 | ||
471 | #endif | 521 | #else |
522 | #define omap_mux_init() do {} while(0) | ||
523 | #define omap_cfg_reg(x) do {} while(0) | ||
524 | #endif /* CONFIG_OMAP_MUX */ | ||
525 | |||
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index b2560d32b3a0..47ec16155483 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c | |||
@@ -53,7 +53,7 @@ | |||
53 | #include <plat/clock.h> | 53 | #include <plat/clock.h> |
54 | #include <plat/sram.h> | 54 | #include <plat/sram.h> |
55 | #include <plat/tc.h> | 55 | #include <plat/tc.h> |
56 | #include <plat/mux.h> | 56 | #include <mach/mux.h> |
57 | #include <plat/dma.h> | 57 | #include <plat/dma.h> |
58 | #include <plat/dmtimer.h> | 58 | #include <plat/dmtimer.h> |
59 | 59 | ||
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c index 6809c9e56c93..b9d6834af835 100644 --- a/arch/arm/mach-omap1/serial.c +++ b/arch/arm/mach-omap1/serial.c | |||
@@ -22,8 +22,7 @@ | |||
22 | 22 | ||
23 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
24 | 24 | ||
25 | #include <plat/board.h> | 25 | #include <mach/mux.h> |
26 | #include <plat/mux.h> | ||
27 | #include <plat/fpga.h> | 26 | #include <plat/fpga.h> |
28 | 27 | ||
29 | #include "pm.h" | 28 | #include "pm.h" |
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c index 65f88176fba8..84267edd9421 100644 --- a/arch/arm/mach-omap1/usb.c +++ b/arch/arm/mach-omap1/usb.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
28 | 28 | ||
29 | #include <plat/mux.h> | 29 | #include <mach/mux.h> |
30 | 30 | ||
31 | #include <mach/usb.h> | 31 | #include <mach/usb.h> |
32 | 32 | ||
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 34c2c7f59f0a..7706fdfd0252 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -4,36 +4,30 @@ | |||
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \ | 6 | obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \ |
7 | common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o | 7 | common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o |
8 | 8 | ||
9 | omap-2-3-common = irq.o | 9 | # INTCPS IP block support - XXX should be moved to drivers/ |
10 | hwmod-common = omap_hwmod.o \ | 10 | obj-$(CONFIG_ARCH_OMAP2) += irq.o |
11 | omap_hwmod_common_data.o | 11 | obj-$(CONFIG_ARCH_OMAP3) += irq.o |
12 | clock-common = clock.o clock_common_data.o \ | 12 | obj-$(CONFIG_SOC_AM33XX) += irq.o |
13 | clkt_dpll.o clkt_clksel.o | ||
14 | secure-common = omap-smc.o omap-secure.o | ||
15 | 13 | ||
16 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) | 14 | # Secure monitor API support |
17 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common) | 15 | obj-$(CONFIG_ARCH_OMAP3) += omap-smc.o omap-secure.o |
18 | obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common) | 16 | obj-$(CONFIG_ARCH_OMAP4) += omap-smc.o omap-secure.o |
19 | obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common) | 17 | obj-$(CONFIG_SOC_OMAP5) += omap-smc.o omap-secure.o |
20 | obj-$(CONFIG_SOC_OMAP5) += prm44xx.o $(hwmod-common) $(secure-common) | ||
21 | 18 | ||
22 | ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) | 19 | ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) |
23 | obj-y += mcbsp.o | 20 | obj-y += mcbsp.o |
24 | endif | 21 | endif |
25 | 22 | ||
26 | obj-$(CONFIG_TWL4030_CORE) += omap_twl.o | 23 | obj-$(CONFIG_TWL4030_CORE) += omap_twl.o |
27 | obj-$(CONFIG_SOC_HAS_OMAP2_SDRC) += sdrc.o | ||
28 | 24 | ||
29 | # SMP support ONLY available for OMAP4 | 25 | # SMP support ONLY available for OMAP4 |
30 | 26 | ||
31 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o | 27 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o |
32 | obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o | 28 | obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o |
33 | omap-4-5-common = omap4-common.o omap-wakeupgen.o \ | 29 | obj-$(CONFIG_ARCH_OMAP4) += omap4-common.o omap-wakeupgen.o |
34 | sleep44xx.o | 30 | obj-$(CONFIG_SOC_OMAP5) += omap4-common.o omap-wakeupgen.o |
35 | obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-common) | ||
36 | obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-common) | ||
37 | 31 | ||
38 | plus_sec := $(call as-instr,.arch_extension sec,+sec) | 32 | plus_sec := $(call as-instr,.arch_extension sec,+sec) |
39 | AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) | 33 | AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) |
@@ -58,6 +52,7 @@ obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o | |||
58 | # SMS/SDRC | 52 | # SMS/SDRC |
59 | obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o | 53 | obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o |
60 | # obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o | 54 | # obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o |
55 | obj-$(CONFIG_SOC_HAS_OMAP2_SDRC) += sdrc.o | ||
61 | 56 | ||
62 | # OPP table initialization | 57 | # OPP table initialization |
63 | ifeq ($(CONFIG_PM_OPP),y) | 58 | ifeq ($(CONFIG_PM_OPP),y) |
@@ -68,15 +63,15 @@ endif | |||
68 | 63 | ||
69 | # Power Management | 64 | # Power Management |
70 | ifeq ($(CONFIG_PM),y) | 65 | ifeq ($(CONFIG_PM),y) |
71 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o | 66 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o sleep24xx.o |
72 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o | ||
73 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o | 67 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o |
74 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o | 68 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o |
75 | obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o | 69 | obj-$(CONFIG_ARCH_OMAP4) += sleep44xx.o |
70 | obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o sleep44xx.o | ||
76 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o | 71 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o |
77 | 72 | ||
78 | obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o | 73 | obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o |
79 | obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o | 74 | obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o |
80 | 75 | ||
81 | AFLAGS_sleep24xx.o :=-Wa,-march=armv6 | 76 | AFLAGS_sleep24xx.o :=-Wa,-march=armv6 |
82 | AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec) | 77 | AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec) |
@@ -88,92 +83,76 @@ endif | |||
88 | endif | 83 | endif |
89 | 84 | ||
90 | ifeq ($(CONFIG_CPU_IDLE),y) | 85 | ifeq ($(CONFIG_CPU_IDLE),y) |
91 | obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o | 86 | obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o |
92 | obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o | 87 | obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o |
93 | endif | 88 | endif |
94 | 89 | ||
95 | # PRCM | 90 | # PRCM |
96 | omap-prcm-4-5-common = prcm.o cminst44xx.o cm44xx.o \ | 91 | obj-y += prcm.o prm_common.o |
97 | prcm_mpu44xx.o prminst44xx.o \ | 92 | obj-$(CONFIG_ARCH_OMAP2) += cm2xxx_3xxx.o prm2xxx_3xxx.o |
98 | vc44xx_data.o vp44xx_data.o | 93 | obj-$(CONFIG_ARCH_OMAP3) += cm2xxx_3xxx.o prm2xxx_3xxx.o |
99 | obj-y += prm_common.o | ||
100 | obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o | ||
101 | obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o | ||
102 | obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o | 94 | obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o |
103 | obj-$(CONFIG_SOC_AM33XX) += prcm.o prm33xx.o cm33xx.o | 95 | obj-$(CONFIG_SOC_AM33XX) += prm33xx.o cm33xx.o |
104 | obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common) prm44xx.o | 96 | omap-prcm-4-5-common = cminst44xx.o cm44xx.o prm44xx.o \ |
97 | prcm_mpu44xx.o prminst44xx.o \ | ||
98 | vc44xx_data.o vp44xx_data.o \ | ||
99 | prm44xx.o | ||
100 | obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common) | ||
105 | obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common) | 101 | obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common) |
106 | 102 | ||
107 | # OMAP voltage domains | 103 | # OMAP voltage domains |
108 | voltagedomain-common := voltage.o vc.o vp.o | 104 | obj-y += voltage.o vc.o vp.o |
109 | obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common) | ||
110 | obj-$(CONFIG_ARCH_OMAP2) += voltagedomains2xxx_data.o | 105 | obj-$(CONFIG_ARCH_OMAP2) += voltagedomains2xxx_data.o |
111 | obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common) | ||
112 | obj-$(CONFIG_ARCH_OMAP3) += voltagedomains3xxx_data.o | 106 | obj-$(CONFIG_ARCH_OMAP3) += voltagedomains3xxx_data.o |
113 | obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common) | ||
114 | obj-$(CONFIG_ARCH_OMAP4) += voltagedomains44xx_data.o | 107 | obj-$(CONFIG_ARCH_OMAP4) += voltagedomains44xx_data.o |
115 | obj-$(CONFIG_SOC_AM33XX) += $(voltagedomain-common) | 108 | obj-$(CONFIG_SOC_AM33XX) += voltagedomains33xx_data.o |
116 | obj-$(CONFIG_SOC_AM33XX) += voltagedomains33xx_data.o | ||
117 | obj-$(CONFIG_SOC_OMAP5) += $(voltagedomain-common) | ||
118 | 109 | ||
119 | # OMAP powerdomain framework | 110 | # OMAP powerdomain framework |
120 | powerdomain-common += powerdomain.o powerdomain-common.o | 111 | obj-y += powerdomain.o powerdomain-common.o |
121 | obj-$(CONFIG_ARCH_OMAP2) += $(powerdomain-common) | ||
122 | obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_data.o | 112 | obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_data.o |
123 | obj-$(CONFIG_ARCH_OMAP2) += powerdomain2xxx_3xxx.o | 113 | obj-$(CONFIG_ARCH_OMAP2) += powerdomain2xxx_3xxx.o |
124 | obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_3xxx_data.o | 114 | obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_3xxx_data.o |
125 | obj-$(CONFIG_ARCH_OMAP3) += $(powerdomain-common) | ||
126 | obj-$(CONFIG_ARCH_OMAP3) += powerdomain2xxx_3xxx.o | 115 | obj-$(CONFIG_ARCH_OMAP3) += powerdomain2xxx_3xxx.o |
127 | obj-$(CONFIG_ARCH_OMAP3) += powerdomains3xxx_data.o | 116 | obj-$(CONFIG_ARCH_OMAP3) += powerdomains3xxx_data.o |
128 | obj-$(CONFIG_ARCH_OMAP3) += powerdomains2xxx_3xxx_data.o | 117 | obj-$(CONFIG_ARCH_OMAP3) += powerdomains2xxx_3xxx_data.o |
129 | obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) | ||
130 | obj-$(CONFIG_ARCH_OMAP4) += powerdomain44xx.o | 118 | obj-$(CONFIG_ARCH_OMAP4) += powerdomain44xx.o |
131 | obj-$(CONFIG_ARCH_OMAP4) += powerdomains44xx_data.o | 119 | obj-$(CONFIG_ARCH_OMAP4) += powerdomains44xx_data.o |
132 | obj-$(CONFIG_SOC_AM33XX) += $(powerdomain-common) | ||
133 | obj-$(CONFIG_SOC_AM33XX) += powerdomain33xx.o | 120 | obj-$(CONFIG_SOC_AM33XX) += powerdomain33xx.o |
134 | obj-$(CONFIG_SOC_AM33XX) += powerdomains33xx_data.o | 121 | obj-$(CONFIG_SOC_AM33XX) += powerdomains33xx_data.o |
135 | obj-$(CONFIG_SOC_OMAP5) += $(powerdomain-common) | ||
136 | obj-$(CONFIG_SOC_OMAP5) += powerdomain44xx.o | 122 | obj-$(CONFIG_SOC_OMAP5) += powerdomain44xx.o |
137 | 123 | ||
138 | # PRCM clockdomain control | 124 | # PRCM clockdomain control |
139 | clockdomain-common += clockdomain.o | 125 | obj-y += clockdomain.o |
140 | obj-$(CONFIG_ARCH_OMAP2) += $(clockdomain-common) | ||
141 | obj-$(CONFIG_ARCH_OMAP2) += clockdomain2xxx_3xxx.o | 126 | obj-$(CONFIG_ARCH_OMAP2) += clockdomain2xxx_3xxx.o |
142 | obj-$(CONFIG_ARCH_OMAP2) += clockdomains2xxx_3xxx_data.o | 127 | obj-$(CONFIG_ARCH_OMAP2) += clockdomains2xxx_3xxx_data.o |
143 | obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o | 128 | obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o |
144 | obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o | 129 | obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o |
145 | obj-$(CONFIG_ARCH_OMAP3) += $(clockdomain-common) | ||
146 | obj-$(CONFIG_ARCH_OMAP3) += clockdomain2xxx_3xxx.o | 130 | obj-$(CONFIG_ARCH_OMAP3) += clockdomain2xxx_3xxx.o |
147 | obj-$(CONFIG_ARCH_OMAP3) += clockdomains2xxx_3xxx_data.o | 131 | obj-$(CONFIG_ARCH_OMAP3) += clockdomains2xxx_3xxx_data.o |
148 | obj-$(CONFIG_ARCH_OMAP3) += clockdomains3xxx_data.o | 132 | obj-$(CONFIG_ARCH_OMAP3) += clockdomains3xxx_data.o |
149 | obj-$(CONFIG_ARCH_OMAP4) += $(clockdomain-common) | ||
150 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain44xx.o | 133 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain44xx.o |
151 | obj-$(CONFIG_ARCH_OMAP4) += clockdomains44xx_data.o | 134 | obj-$(CONFIG_ARCH_OMAP4) += clockdomains44xx_data.o |
152 | obj-$(CONFIG_SOC_AM33XX) += $(clockdomain-common) | ||
153 | obj-$(CONFIG_SOC_AM33XX) += clockdomain33xx.o | 135 | obj-$(CONFIG_SOC_AM33XX) += clockdomain33xx.o |
154 | obj-$(CONFIG_SOC_AM33XX) += clockdomains33xx_data.o | 136 | obj-$(CONFIG_SOC_AM33XX) += clockdomains33xx_data.o |
155 | obj-$(CONFIG_SOC_OMAP5) += $(clockdomain-common) | ||
156 | obj-$(CONFIG_SOC_OMAP5) += clockdomain44xx.o | 137 | obj-$(CONFIG_SOC_OMAP5) += clockdomain44xx.o |
157 | 138 | ||
158 | # Clock framework | 139 | # Clock framework |
159 | obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o | 140 | obj-y += clock.o clock_common_data.o \ |
160 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_sys.o | 141 | clkt_dpll.o clkt_clksel.o |
161 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o | 142 | obj-$(CONFIG_ARCH_OMAP2) += clock2xxx.o |
143 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o clkt2xxx_sys.o | ||
162 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o | 144 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o |
163 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_apll.o clkt2xxx_osc.o | 145 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_apll.o clkt2xxx_osc.o |
164 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o clkt_iclk.o | 146 | obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o clkt_iclk.o |
165 | obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o | 147 | obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o |
166 | obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o | 148 | obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o |
167 | obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o | 149 | obj-$(CONFIG_ARCH_OMAP3) += clock3xxx.o |
168 | obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o | 150 | obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o |
169 | obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o | 151 | obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o clkt_iclk.o |
170 | obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o clock3xxx_data.o | 152 | obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o clock3xxx_data.o |
171 | obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o | 153 | obj-$(CONFIG_ARCH_OMAP4) += clock44xx_data.o |
172 | obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o | ||
173 | obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o | 154 | obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o |
174 | obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o | 155 | obj-$(CONFIG_SOC_AM33XX) += dpll3xxx.o clock33xx_data.o |
175 | obj-$(CONFIG_SOC_AM33XX) += clock33xx_data.o | ||
176 | obj-$(CONFIG_SOC_OMAP5) += $(clock-common) | ||
177 | obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o | 156 | obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o |
178 | 157 | ||
179 | # OMAP2 clock rate set data (old "OPP" data) | 158 | # OMAP2 clock rate set data (old "OPP" data) |
@@ -181,6 +160,7 @@ obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o | |||
181 | obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o | 160 | obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o |
182 | 161 | ||
183 | # hwmod data | 162 | # hwmod data |
163 | obj-y += omap_hwmod_common_data.o | ||
184 | obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o | 164 | obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o |
185 | obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_ipblock_data.o | 165 | obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_ipblock_data.o |
186 | obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_interconnect_data.o | 166 | obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_interconnect_data.o |
@@ -229,10 +209,10 @@ obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o | |||
229 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o | 209 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o |
230 | obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o | 210 | obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o |
231 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o | 211 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o |
232 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o | 212 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o |
233 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o | 213 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o |
234 | obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o | 214 | obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o |
235 | obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o | 215 | obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o |
236 | obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o | 216 | obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o |
237 | obj-$(CONFIG_MACH_OVERO) += board-overo.o | 217 | obj-$(CONFIG_MACH_OVERO) += board-overo.o |
238 | obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o | 218 | obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o |
diff --git a/arch/arm/plat-omap/include/plat/am33xx.h b/arch/arm/mach-omap2/am33xx.h index 06c19bb7bca6..06c19bb7bca6 100644 --- a/arch/arm/plat-omap/include/plat/am33xx.h +++ b/arch/arm/mach-omap2/am33xx.h | |||
diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c index 2c90ac686686..d0c54c573d34 100644 --- a/arch/arm/mach-omap2/am35xx-emac.c +++ b/arch/arm/mach-omap2/am35xx-emac.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/davinci_emac.h> | 19 | #include <linux/davinci_emac.h> |
20 | #include <asm/system.h> | 20 | #include <asm/system.h> |
21 | #include <plat/omap_device.h> | 21 | #include <plat/omap_device.h> |
22 | #include <mach/am35xx.h> | 22 | #include "am35xx.h" |
23 | #include "control.h" | 23 | #include "control.h" |
24 | #include "am35xx-emac.h" | 24 | #include "am35xx-emac.h" |
25 | 25 | ||
diff --git a/arch/arm/mach-omap2/include/mach/am35xx.h b/arch/arm/mach-omap2/am35xx.h index 95594495fcf6..95594495fcf6 100644 --- a/arch/arm/mach-omap2/include/mach/am35xx.h +++ b/arch/arm/mach-omap2/am35xx.h | |||
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 9511584fdc4f..95b384d54f8a 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -33,11 +33,10 @@ | |||
33 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
34 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
35 | 35 | ||
36 | #include <plat/board.h> | ||
37 | #include "common.h" | 36 | #include "common.h" |
38 | #include <plat/gpmc.h> | 37 | #include <plat/gpmc.h> |
39 | #include <plat/usb.h> | 38 | #include <plat/usb.h> |
40 | #include <plat/gpmc-smc91x.h> | 39 | #include "gpmc-smc91x.h" |
41 | 40 | ||
42 | #include <video/omapdss.h> | 41 | #include <video/omapdss.h> |
43 | #include <video/omap-panel-generic-dpi.h> | 42 | #include <video/omap-panel-generic-dpi.h> |
@@ -212,9 +211,6 @@ static struct regulator_init_data sdp2430_vmmc1 = { | |||
212 | }; | 211 | }; |
213 | 212 | ||
214 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { | 213 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { |
215 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
216 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
217 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
218 | }; | 214 | }; |
219 | 215 | ||
220 | static struct twl4030_platform_data sdp2430_twldata = { | 216 | static struct twl4030_platform_data sdp2430_twldata = { |
@@ -235,7 +231,7 @@ static int __init omap2430_i2c_init(void) | |||
235 | sdp2430_i2c1_boardinfo[0].irq = gpio_to_irq(78); | 231 | sdp2430_i2c1_boardinfo[0].irq = gpio_to_irq(78); |
236 | omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo, | 232 | omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo, |
237 | ARRAY_SIZE(sdp2430_i2c1_boardinfo)); | 233 | ARRAY_SIZE(sdp2430_i2c1_boardinfo)); |
238 | omap_pmic_init(2, 100, "twl4030", INT_24XX_SYS_NIRQ, | 234 | omap_pmic_init(2, 100, "twl4030", 7 + OMAP_INTC_START, |
239 | &sdp2430_twldata); | 235 | &sdp2430_twldata); |
240 | return 0; | 236 | return 0; |
241 | } | 237 | } |
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index a98c688058a9..96cd3693e1ae 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -24,14 +24,12 @@ | |||
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <linux/mmc/host.h> | 26 | #include <linux/mmc/host.h> |
27 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
27 | 28 | ||
28 | #include <mach/hardware.h> | ||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
31 | #include <asm/mach/map.h> | 31 | #include <asm/mach/map.h> |
32 | 32 | ||
33 | #include <plat/mcspi.h> | ||
34 | #include <plat/board.h> | ||
35 | #include <plat/usb.h> | 33 | #include <plat/usb.h> |
36 | #include "common.h" | 34 | #include "common.h" |
37 | #include <plat/dma.h> | 35 | #include <plat/dma.h> |
@@ -39,7 +37,7 @@ | |||
39 | #include <video/omapdss.h> | 37 | #include <video/omapdss.h> |
40 | #include <video/omap-panel-tfp410.h> | 38 | #include <video/omap-panel-tfp410.h> |
41 | 39 | ||
42 | #include <plat/gpmc-smc91x.h> | 40 | #include "gpmc-smc91x.h" |
43 | 41 | ||
44 | #include "board-flash.h" | 42 | #include "board-flash.h" |
45 | #include "mux.h" | 43 | #include "mux.h" |
@@ -191,9 +189,6 @@ static struct omap_dss_board_info sdp3430_dss_data = { | |||
191 | .default_device = &sdp3430_lcd_device, | 189 | .default_device = &sdp3430_lcd_device, |
192 | }; | 190 | }; |
193 | 191 | ||
194 | static struct omap_board_config_kernel sdp3430_config[] __initdata = { | ||
195 | }; | ||
196 | |||
197 | static struct omap2_hsmmc_info mmc[] = { | 192 | static struct omap2_hsmmc_info mmc[] = { |
198 | { | 193 | { |
199 | .mmc = 1, | 194 | .mmc = 1, |
@@ -233,9 +228,6 @@ static int sdp3430_twl_gpio_setup(struct device *dev, | |||
233 | } | 228 | } |
234 | 229 | ||
235 | static struct twl4030_gpio_platform_data sdp3430_gpio_data = { | 230 | static struct twl4030_gpio_platform_data sdp3430_gpio_data = { |
236 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
237 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
238 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
239 | .pulldowns = BIT(2) | BIT(6) | BIT(8) | BIT(13) | 231 | .pulldowns = BIT(2) | BIT(6) | BIT(8) | BIT(13) |
240 | | BIT(16) | BIT(17), | 232 | | BIT(16) | BIT(17), |
241 | .setup = sdp3430_twl_gpio_setup, | 233 | .setup = sdp3430_twl_gpio_setup, |
@@ -576,8 +568,6 @@ static void __init omap_3430sdp_init(void) | |||
576 | int gpio_pendown; | 568 | int gpio_pendown; |
577 | 569 | ||
578 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 570 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
579 | omap_board_config = sdp3430_config; | ||
580 | omap_board_config_size = ARRAY_SIZE(sdp3430_config); | ||
581 | omap_hsmmc_init(mmc); | 571 | omap_hsmmc_init(mmc); |
582 | omap3430_i2c_init(); | 572 | omap3430_i2c_init(); |
583 | omap_display_init(&sdp3430_dss_data); | 573 | omap_display_init(&sdp3430_dss_data); |
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index 2dc9ba523c7a..fc224ad86747 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c | |||
@@ -17,8 +17,7 @@ | |||
17 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
18 | 18 | ||
19 | #include "common.h" | 19 | #include "common.h" |
20 | #include <plat/board.h> | 20 | #include "gpmc-smc91x.h" |
21 | #include <plat/gpmc-smc91x.h> | ||
22 | #include <plat/usb.h> | 21 | #include <plat/usb.h> |
23 | 22 | ||
24 | #include <mach/board-zoom.h> | 23 | #include <mach/board-zoom.h> |
@@ -67,9 +66,6 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = { | |||
67 | .reset_gpio_port[2] = -EINVAL | 66 | .reset_gpio_port[2] = -EINVAL |
68 | }; | 67 | }; |
69 | 68 | ||
70 | static struct omap_board_config_kernel sdp_config[] __initdata = { | ||
71 | }; | ||
72 | |||
73 | #ifdef CONFIG_OMAP_MUX | 69 | #ifdef CONFIG_OMAP_MUX |
74 | static struct omap_board_mux board_mux[] __initdata = { | 70 | static struct omap_board_mux board_mux[] __initdata = { |
75 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 71 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
@@ -197,8 +193,6 @@ static struct flash_partitions sdp_flash_partitions[] = { | |||
197 | static void __init omap_sdp_init(void) | 193 | static void __init omap_sdp_init(void) |
198 | { | 194 | { |
199 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); | 195 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); |
200 | omap_board_config = sdp_config; | ||
201 | omap_board_config_size = ARRAY_SIZE(sdp_config); | ||
202 | zoom_peripherals_init(); | 196 | zoom_peripherals_init(); |
203 | omap_sdrc_init(h8mbx00u0mer0em_sdrc_params, | 197 | omap_sdrc_init(h8mbx00u0mer0em_sdrc_params, |
204 | h8mbx00u0mer0em_sdrc_params); | 198 | h8mbx00u0mer0em_sdrc_params); |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index ad8a7d94afcd..749ce9634e8e 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -28,23 +28,22 @@ | |||
28 | #include <linux/leds_pwm.h> | 28 | #include <linux/leds_pwm.h> |
29 | #include <linux/platform_data/omap4-keypad.h> | 29 | #include <linux/platform_data/omap4-keypad.h> |
30 | 30 | ||
31 | #include <mach/hardware.h> | ||
32 | #include <asm/hardware/gic.h> | 31 | #include <asm/hardware/gic.h> |
33 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
35 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
36 | 35 | ||
37 | #include <plat/board.h> | ||
38 | #include "common.h" | 36 | #include "common.h" |
39 | #include <plat/usb.h> | 37 | #include <plat/usb.h> |
40 | #include <plat/mmc.h> | 38 | #include <plat/mmc.h> |
41 | #include <plat/omap4-keypad.h> | 39 | #include "omap4-keypad.h" |
42 | #include <video/omapdss.h> | 40 | #include <video/omapdss.h> |
43 | #include <video/omap-panel-nokia-dsi.h> | 41 | #include <video/omap-panel-nokia-dsi.h> |
44 | #include <video/omap-panel-picodlp.h> | 42 | #include <video/omap-panel-picodlp.h> |
45 | #include <linux/wl12xx.h> | 43 | #include <linux/wl12xx.h> |
46 | #include <linux/platform_data/omap-abe-twl6040.h> | 44 | #include <linux/platform_data/omap-abe-twl6040.h> |
47 | 45 | ||
46 | #include "soc.h" | ||
48 | #include "mux.h" | 47 | #include "mux.h" |
49 | #include "hsmmc.h" | 48 | #include "hsmmc.h" |
50 | #include "control.h" | 49 | #include "control.h" |
@@ -544,7 +543,14 @@ static struct twl6040_platform_data twl6040_data = { | |||
544 | .codec = &twl6040_codec, | 543 | .codec = &twl6040_codec, |
545 | .vibra = &twl6040_vibra, | 544 | .vibra = &twl6040_vibra, |
546 | .audpwron_gpio = 127, | 545 | .audpwron_gpio = 127, |
547 | .irq_base = TWL6040_CODEC_IRQ_BASE, | 546 | }; |
547 | |||
548 | static struct i2c_board_info __initdata sdp4430_i2c_1_boardinfo[] = { | ||
549 | { | ||
550 | I2C_BOARD_INFO("twl6040", 0x4b), | ||
551 | .irq = 119 + OMAP44XX_IRQ_GIC_START, | ||
552 | .platform_data = &twl6040_data, | ||
553 | }, | ||
548 | }; | 554 | }; |
549 | 555 | ||
550 | static struct twl4030_platform_data sdp4430_twldata = { | 556 | static struct twl4030_platform_data sdp4430_twldata = { |
@@ -580,8 +586,8 @@ static int __init omap4_i2c_init(void) | |||
580 | TWL_COMMON_REGULATOR_CLK32KG | | 586 | TWL_COMMON_REGULATOR_CLK32KG | |
581 | TWL_COMMON_REGULATOR_V1V8 | | 587 | TWL_COMMON_REGULATOR_V1V8 | |
582 | TWL_COMMON_REGULATOR_V2V1); | 588 | TWL_COMMON_REGULATOR_V2V1); |
583 | omap4_pmic_init("twl6030", &sdp4430_twldata, | 589 | omap4_pmic_init("twl6030", &sdp4430_twldata, sdp4430_i2c_1_boardinfo, |
584 | &twl6040_data, OMAP44XX_IRQ_SYS_2N); | 590 | ARRAY_SIZE(sdp4430_i2c_1_boardinfo)); |
585 | omap_register_i2c_bus(2, 400, NULL, 0); | 591 | omap_register_i2c_bus(2, 400, NULL, 0); |
586 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, | 592 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, |
587 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); | 593 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); |
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c index 92432c28673d..318feadb1d6e 100644 --- a/arch/arm/mach-omap2/board-am3517crane.c +++ b/arch/arm/mach-omap2/board-am3517crane.c | |||
@@ -21,12 +21,10 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
23 | 23 | ||
24 | #include <mach/hardware.h> | ||
25 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
26 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
28 | 27 | ||
29 | #include <plat/board.h> | ||
30 | #include "common.h" | 28 | #include "common.h" |
31 | #include <plat/usb.h> | 29 | #include <plat/usb.h> |
32 | 30 | ||
@@ -37,11 +35,6 @@ | |||
37 | #define GPIO_USB_POWER 35 | 35 | #define GPIO_USB_POWER 35 |
38 | #define GPIO_USB_NRESET 38 | 36 | #define GPIO_USB_NRESET 38 |
39 | 37 | ||
40 | |||
41 | /* Board initialization */ | ||
42 | static struct omap_board_config_kernel am3517_crane_config[] __initdata = { | ||
43 | }; | ||
44 | |||
45 | #ifdef CONFIG_OMAP_MUX | 38 | #ifdef CONFIG_OMAP_MUX |
46 | static struct omap_board_mux board_mux[] __initdata = { | 39 | static struct omap_board_mux board_mux[] __initdata = { |
47 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 40 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
@@ -67,9 +60,6 @@ static void __init am3517_crane_init(void) | |||
67 | omap_serial_init(); | 60 | omap_serial_init(); |
68 | omap_sdrc_init(NULL, NULL); | 61 | omap_sdrc_init(NULL, NULL); |
69 | 62 | ||
70 | omap_board_config = am3517_crane_config; | ||
71 | omap_board_config_size = ARRAY_SIZE(am3517_crane_config); | ||
72 | |||
73 | /* Configure GPIO for EHCI port */ | 63 | /* Configure GPIO for EHCI port */ |
74 | if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { | 64 | if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { |
75 | pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", | 65 | pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", |
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 18f601096ce1..0d99c9110d01 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -25,14 +25,13 @@ | |||
25 | #include <linux/can/platform/ti_hecc.h> | 25 | #include <linux/can/platform/ti_hecc.h> |
26 | #include <linux/davinci_emac.h> | 26 | #include <linux/davinci_emac.h> |
27 | #include <linux/mmc/host.h> | 27 | #include <linux/mmc/host.h> |
28 | #include <linux/platform_data/gpio-omap.h> | ||
28 | 29 | ||
29 | #include <mach/hardware.h> | 30 | #include "am35xx.h" |
30 | #include <mach/am35xx.h> | ||
31 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
33 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
34 | 34 | ||
35 | #include <plat/board.h> | ||
36 | #include "common.h" | 35 | #include "common.h" |
37 | #include <plat/usb.h> | 36 | #include <plat/usb.h> |
38 | #include <video/omapdss.h> | 37 | #include <video/omapdss.h> |
@@ -296,8 +295,7 @@ static struct resource am3517_hecc_resources[] = { | |||
296 | .flags = IORESOURCE_MEM, | 295 | .flags = IORESOURCE_MEM, |
297 | }, | 296 | }, |
298 | { | 297 | { |
299 | .start = INT_35XX_HECC0_IRQ, | 298 | .start = 24 + OMAP_INTC_START, |
300 | .end = INT_35XX_HECC0_IRQ, | ||
301 | .flags = IORESOURCE_IRQ, | 299 | .flags = IORESOURCE_IRQ, |
302 | }, | 300 | }, |
303 | }; | 301 | }; |
@@ -324,9 +322,6 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata) | |||
324 | platform_device_register(&am3517_hecc_device); | 322 | platform_device_register(&am3517_hecc_device); |
325 | } | 323 | } |
326 | 324 | ||
327 | static struct omap_board_config_kernel am3517_evm_config[] __initdata = { | ||
328 | }; | ||
329 | |||
330 | static struct omap2_hsmmc_info mmc[] = { | 325 | static struct omap2_hsmmc_info mmc[] = { |
331 | { | 326 | { |
332 | .mmc = 1, | 327 | .mmc = 1, |
@@ -346,8 +341,6 @@ static struct omap2_hsmmc_info mmc[] = { | |||
346 | 341 | ||
347 | static void __init am3517_evm_init(void) | 342 | static void __init am3517_evm_init(void) |
348 | { | 343 | { |
349 | omap_board_config = am3517_evm_config; | ||
350 | omap_board_config_size = ARRAY_SIZE(am3517_evm_config); | ||
351 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 344 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
352 | 345 | ||
353 | am3517_evm_i2c_init(); | 346 | am3517_evm_i2c_init(); |
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index e5fa46bfde2f..3e2d76f05af4 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -29,13 +29,11 @@ | |||
29 | #include <linux/smc91x.h> | 29 | #include <linux/smc91x.h> |
30 | #include <linux/gpio.h> | 30 | #include <linux/gpio.h> |
31 | 31 | ||
32 | #include <mach/hardware.h> | ||
33 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
35 | #include <asm/mach/flash.h> | 34 | #include <asm/mach/flash.h> |
36 | 35 | ||
37 | #include <plat/led.h> | 36 | #include <plat/led.h> |
38 | #include <plat/board.h> | ||
39 | #include "common.h" | 37 | #include "common.h" |
40 | #include <plat/gpmc.h> | 38 | #include <plat/gpmc.h> |
41 | 39 | ||
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 97d719047af3..8ffd612c5e07 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/input/matrix_keypad.h> | 23 | #include <linux/input/matrix_keypad.h> |
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <linux/platform_data/gpio-omap.h> | ||
26 | 27 | ||
27 | #include <linux/i2c/at24.h> | 28 | #include <linux/i2c/at24.h> |
28 | #include <linux/i2c/twl.h> | 29 | #include <linux/i2c/twl.h> |
@@ -37,15 +38,14 @@ | |||
37 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
38 | #include <asm/mach/map.h> | 39 | #include <asm/mach/map.h> |
39 | 40 | ||
40 | #include <plat/board.h> | ||
41 | #include "common.h" | 41 | #include "common.h" |
42 | #include <plat/nand.h> | 42 | #include <linux/platform_data/mtd-nand-omap2.h> |
43 | #include <plat/gpmc.h> | 43 | #include <plat/gpmc.h> |
44 | #include <plat/usb.h> | 44 | #include <plat/usb.h> |
45 | #include <video/omapdss.h> | 45 | #include <video/omapdss.h> |
46 | #include <video/omap-panel-generic-dpi.h> | 46 | #include <video/omap-panel-generic-dpi.h> |
47 | #include <video/omap-panel-tfp410.h> | 47 | #include <video/omap-panel-tfp410.h> |
48 | #include <plat/mcspi.h> | 48 | #include <linux/platform_data/spi-omap2-mcspi.h> |
49 | 49 | ||
50 | #include <mach/hardware.h> | 50 | #include <mach/hardware.h> |
51 | 51 | ||
@@ -64,7 +64,7 @@ | |||
64 | 64 | ||
65 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 65 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
66 | #include <linux/smsc911x.h> | 66 | #include <linux/smsc911x.h> |
67 | #include <plat/gpmc-smsc911x.h> | 67 | #include "gpmc-smsc911x.h" |
68 | 68 | ||
69 | static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = { | 69 | static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = { |
70 | .id = 0, | 70 | .id = 0, |
@@ -470,9 +470,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, | |||
470 | } | 470 | } |
471 | 471 | ||
472 | static struct twl4030_gpio_platform_data cm_t35_gpio_data = { | 472 | static struct twl4030_gpio_platform_data cm_t35_gpio_data = { |
473 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
474 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
475 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
476 | .setup = cm_t35_twl_gpio_setup, | 473 | .setup = cm_t35_twl_gpio_setup, |
477 | }; | 474 | }; |
478 | 475 | ||
@@ -714,13 +711,8 @@ static inline void cm_t35_init_mux(void) {} | |||
714 | static inline void cm_t3730_init_mux(void) {} | 711 | static inline void cm_t3730_init_mux(void) {} |
715 | #endif | 712 | #endif |
716 | 713 | ||
717 | static struct omap_board_config_kernel cm_t35_config[] __initdata = { | ||
718 | }; | ||
719 | |||
720 | static void __init cm_t3x_common_init(void) | 714 | static void __init cm_t3x_common_init(void) |
721 | { | 715 | { |
722 | omap_board_config = cm_t35_config; | ||
723 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); | ||
724 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 716 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
725 | omap_serial_init(); | 717 | omap_serial_init(); |
726 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, | 718 | omap_sdrc_init(mt46h32m32lf6_sdrc_params, |
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index a33ad4641d9a..59c0a45f75b0 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
@@ -38,13 +38,12 @@ | |||
38 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
39 | #include <asm/mach/map.h> | 39 | #include <asm/mach/map.h> |
40 | 40 | ||
41 | #include <plat/board.h> | ||
42 | #include "common.h" | 41 | #include "common.h" |
43 | #include <plat/usb.h> | 42 | #include <plat/usb.h> |
44 | #include <plat/nand.h> | 43 | #include <linux/platform_data/mtd-nand-omap2.h> |
45 | #include <plat/gpmc.h> | 44 | #include <plat/gpmc.h> |
46 | 45 | ||
47 | #include <mach/am35xx.h> | 46 | #include "am35xx.h" |
48 | 47 | ||
49 | #include "mux.h" | 48 | #include "mux.h" |
50 | #include "control.h" | 49 | #include "control.h" |
@@ -90,8 +89,7 @@ static struct resource cm_t3517_hecc_resources[] = { | |||
90 | .flags = IORESOURCE_MEM, | 89 | .flags = IORESOURCE_MEM, |
91 | }, | 90 | }, |
92 | { | 91 | { |
93 | .start = INT_35XX_HECC0_IRQ, | 92 | .start = 24 + OMAP_INTC_START, |
94 | .end = INT_35XX_HECC0_IRQ, | ||
95 | .flags = IORESOURCE_IRQ, | 93 | .flags = IORESOURCE_IRQ, |
96 | }, | 94 | }, |
97 | }; | 95 | }; |
@@ -249,9 +247,6 @@ static void __init cm_t3517_init_nand(void) | |||
249 | static inline void cm_t3517_init_nand(void) {} | 247 | static inline void cm_t3517_init_nand(void) {} |
250 | #endif | 248 | #endif |
251 | 249 | ||
252 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { | ||
253 | }; | ||
254 | |||
255 | #ifdef CONFIG_OMAP_MUX | 250 | #ifdef CONFIG_OMAP_MUX |
256 | static struct omap_board_mux board_mux[] __initdata = { | 251 | static struct omap_board_mux board_mux[] __initdata = { |
257 | /* GPIO186 - Green LED */ | 252 | /* GPIO186 - Green LED */ |
@@ -285,8 +280,6 @@ static void __init cm_t3517_init(void) | |||
285 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 280 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
286 | omap_serial_init(); | 281 | omap_serial_init(); |
287 | omap_sdrc_init(NULL, NULL); | 282 | omap_sdrc_init(NULL, NULL); |
288 | omap_board_config = cm_t3517_config; | ||
289 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); | ||
290 | cm_t3517_init_leds(); | 283 | cm_t3517_init_leds(); |
291 | cm_t3517_init_nand(); | 284 | cm_t3517_init_nand(); |
292 | cm_t3517_init_rtc(); | 285 | cm_t3517_init_rtc(); |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 6567c1cd5572..7bb8056d4388 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -32,31 +32,27 @@ | |||
32 | 32 | ||
33 | #include <linux/regulator/machine.h> | 33 | #include <linux/regulator/machine.h> |
34 | #include <linux/i2c/twl.h> | 34 | #include <linux/i2c/twl.h> |
35 | 35 | #include "id.h" | |
36 | #include <mach/hardware.h> | ||
37 | #include <mach/id.h> | ||
38 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
39 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
40 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
41 | #include <asm/mach/flash.h> | 39 | #include <asm/mach/flash.h> |
42 | 40 | ||
43 | #include <plat/board.h> | ||
44 | #include "common.h" | 41 | #include "common.h" |
45 | #include <plat/gpmc.h> | 42 | #include <plat/gpmc.h> |
46 | #include <plat/nand.h> | 43 | #include <linux/platform_data/mtd-nand-omap2.h> |
47 | #include <plat/usb.h> | 44 | #include <plat/usb.h> |
48 | #include <video/omapdss.h> | 45 | #include <video/omapdss.h> |
49 | #include <video/omap-panel-generic-dpi.h> | 46 | #include <video/omap-panel-generic-dpi.h> |
50 | #include <video/omap-panel-tfp410.h> | 47 | #include <video/omap-panel-tfp410.h> |
51 | 48 | ||
52 | #include <plat/mcspi.h> | 49 | #include <linux/platform_data/spi-omap2-mcspi.h> |
53 | #include <linux/input/matrix_keypad.h> | 50 | #include <linux/input/matrix_keypad.h> |
54 | #include <linux/spi/spi.h> | 51 | #include <linux/spi/spi.h> |
55 | #include <linux/dm9000.h> | 52 | #include <linux/dm9000.h> |
56 | #include <linux/interrupt.h> | 53 | #include <linux/interrupt.h> |
57 | 54 | ||
58 | #include "sdram-micron-mt46h32m32lf-6.h" | 55 | #include "sdram-micron-mt46h32m32lf-6.h" |
59 | |||
60 | #include "mux.h" | 56 | #include "mux.h" |
61 | #include "hsmmc.h" | 57 | #include "hsmmc.h" |
62 | #include "common-board-devices.h" | 58 | #include "common-board-devices.h" |
@@ -236,9 +232,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev, | |||
236 | } | 232 | } |
237 | 233 | ||
238 | static struct twl4030_gpio_platform_data devkit8000_gpio_data = { | 234 | static struct twl4030_gpio_platform_data devkit8000_gpio_data = { |
239 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
240 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
241 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
242 | .use_leds = true, | 235 | .use_leds = true, |
243 | .pulldowns = BIT(1) | BIT(2) | BIT(6) | BIT(8) | BIT(13) | 236 | .pulldowns = BIT(1) | BIT(2) | BIT(6) | BIT(8) | BIT(13) |
244 | | BIT(15) | BIT(16) | BIT(17), | 237 | | BIT(15) | BIT(16) | BIT(17), |
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index 53c39d239d6e..0cabe61cd507 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c | |||
@@ -16,13 +16,14 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/mtd/physmap.h> | 17 | #include <linux/mtd/physmap.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <plat/irqs.h> | ||
20 | 19 | ||
20 | #include <plat/cpu.h> | ||
21 | #include <plat/gpmc.h> | 21 | #include <plat/gpmc.h> |
22 | #include <plat/nand.h> | 22 | #include <linux/platform_data/mtd-nand-omap2.h> |
23 | #include <plat/onenand.h> | 23 | #include <linux/platform_data/mtd-onenand-omap2.h> |
24 | #include <plat/tc.h> | 24 | #include <plat/tc.h> |
25 | 25 | ||
26 | #include "common.h" | ||
26 | #include "board-flash.h" | 27 | #include "board-flash.h" |
27 | 28 | ||
28 | #define REG_FPGA_REV 0x10 | 29 | #define REG_FPGA_REV 0x10 |
@@ -140,7 +141,6 @@ __init board_nand_init(struct mtd_partition *nand_parts, | |||
140 | board_nand_data.devsize = nand_type; | 141 | board_nand_data.devsize = nand_type; |
141 | 142 | ||
142 | board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; | 143 | board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; |
143 | board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs; | ||
144 | gpmc_nand_init(&board_nand_data); | 144 | gpmc_nand_init(&board_nand_data); |
145 | } | 145 | } |
146 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ | 146 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 6f93a20536ea..2ea7c577b295 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -16,11 +16,9 @@ | |||
16 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
17 | #include <linux/irqdomain.h> | 17 | #include <linux/irqdomain.h> |
18 | 18 | ||
19 | #include <mach/hardware.h> | ||
20 | #include <asm/hardware/gic.h> | 19 | #include <asm/hardware/gic.h> |
21 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
22 | 21 | ||
23 | #include <plat/board.h> | ||
24 | #include "common.h" | 22 | #include "common.h" |
25 | #include "common-board-devices.h" | 23 | #include "common-board-devices.h" |
26 | 24 | ||
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index ace20482e3e1..f6c48dd764fe 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -27,20 +27,19 @@ | |||
27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
28 | #include <linux/input/matrix_keypad.h> | 28 | #include <linux/input/matrix_keypad.h> |
29 | 29 | ||
30 | #include <mach/hardware.h> | ||
31 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
33 | #include <asm/mach/map.h> | 32 | #include <asm/mach/map.h> |
34 | 33 | ||
35 | #include <plat/board.h> | ||
36 | #include "common.h" | ||
37 | #include <plat/menelaus.h> | 34 | #include <plat/menelaus.h> |
38 | #include <plat/dma.h> | 35 | #include <plat/dma.h> |
39 | #include <plat/gpmc.h> | 36 | #include <plat/gpmc.h> |
37 | #include "debug-devices.h" | ||
40 | 38 | ||
41 | #include <video/omapdss.h> | 39 | #include <video/omapdss.h> |
42 | #include <video/omap-panel-generic-dpi.h> | 40 | #include <video/omap-panel-generic-dpi.h> |
43 | 41 | ||
42 | #include "common.h" | ||
44 | #include "mux.h" | 43 | #include "mux.h" |
45 | #include "control.h" | 44 | #include "control.h" |
46 | 45 | ||
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 28214483aaba..fb8bd837dd13 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -29,13 +29,13 @@ | |||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
31 | 31 | ||
32 | #include <plat/board.h> | ||
33 | #include "common.h" | 32 | #include "common.h" |
34 | #include <plat/gpmc.h> | 33 | #include <plat/gpmc.h> |
35 | #include <plat/usb.h> | 34 | #include <plat/usb.h> |
35 | |||
36 | #include <video/omapdss.h> | 36 | #include <video/omapdss.h> |
37 | #include <video/omap-panel-tfp410.h> | 37 | #include <video/omap-panel-tfp410.h> |
38 | #include <plat/onenand.h> | 38 | #include <linux/platform_data/mtd-onenand-omap2.h> |
39 | 39 | ||
40 | #include "mux.h" | 40 | #include "mux.h" |
41 | #include "hsmmc.h" | 41 | #include "hsmmc.h" |
@@ -192,7 +192,7 @@ static void __init igep_flash_init(void) {} | |||
192 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 192 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
193 | 193 | ||
194 | #include <linux/smsc911x.h> | 194 | #include <linux/smsc911x.h> |
195 | #include <plat/gpmc-smsc911x.h> | 195 | #include "gpmc-smsc911x.h" |
196 | 196 | ||
197 | static struct omap_smsc911x_platform_data smsc911x_cfg = { | 197 | static struct omap_smsc911x_platform_data smsc911x_cfg = { |
198 | .cs = IGEP2_SMSC911X_CS, | 198 | .cs = IGEP2_SMSC911X_CS, |
@@ -425,9 +425,6 @@ static int igep_twl_gpio_setup(struct device *dev, | |||
425 | }; | 425 | }; |
426 | 426 | ||
427 | static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = { | 427 | static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = { |
428 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
429 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
430 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
431 | .use_leds = true, | 428 | .use_leds = true, |
432 | .setup = igep_twl_gpio_setup, | 429 | .setup = igep_twl_gpio_setup, |
433 | }; | 430 | }; |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index ef9e82977499..ee8c3cfb95b3 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -28,21 +28,17 @@ | |||
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/smsc911x.h> | 29 | #include <linux/smsc911x.h> |
30 | #include <linux/mmc/host.h> | 30 | #include <linux/mmc/host.h> |
31 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
31 | 32 | ||
32 | #include <mach/hardware.h> | ||
33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
35 | #include <asm/mach/map.h> | 35 | #include <asm/mach/map.h> |
36 | 36 | ||
37 | #include <plat/mcspi.h> | ||
38 | #include <plat/board.h> | ||
39 | #include "common.h" | 37 | #include "common.h" |
40 | #include <plat/gpmc.h> | 38 | #include <plat/gpmc.h> |
41 | #include <mach/board-zoom.h> | 39 | #include <mach/board-zoom.h> |
42 | |||
43 | #include <asm/delay.h> | ||
44 | #include <plat/usb.h> | 40 | #include <plat/usb.h> |
45 | #include <plat/gpmc-smsc911x.h> | 41 | #include "gpmc-smsc911x.h" |
46 | 42 | ||
47 | #include <video/omapdss.h> | 43 | #include <video/omapdss.h> |
48 | #include <video/omap-panel-generic-dpi.h> | 44 | #include <video/omap-panel-generic-dpi.h> |
@@ -275,9 +271,6 @@ static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) | |||
275 | } | 271 | } |
276 | 272 | ||
277 | static struct twl4030_gpio_platform_data ldp_gpio_data = { | 273 | static struct twl4030_gpio_platform_data ldp_gpio_data = { |
278 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
279 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
280 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
281 | .setup = ldp_twl_gpio_setup, | 274 | .setup = ldp_twl_gpio_setup, |
282 | }; | 275 | }; |
283 | 276 | ||
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 677357ff61ac..d95f727ca39a 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -20,19 +20,16 @@ | |||
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/spi/spi.h> | 21 | #include <linux/spi/spi.h> |
22 | #include <linux/usb/musb.h> | 22 | #include <linux/usb/musb.h> |
23 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
24 | #include <linux/platform_data/mtd-onenand-omap2.h> | ||
23 | #include <sound/tlv320aic3x.h> | 25 | #include <sound/tlv320aic3x.h> |
24 | 26 | ||
25 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
26 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
27 | 29 | ||
28 | #include <plat/board.h> | ||
29 | #include "common.h" | 30 | #include "common.h" |
30 | #include <plat/menelaus.h> | 31 | #include <plat/menelaus.h> |
31 | #include <mach/irqs.h> | ||
32 | #include <plat/mcspi.h> | ||
33 | #include <plat/onenand.h> | ||
34 | #include <plat/mmc.h> | 32 | #include <plat/mmc.h> |
35 | #include <plat/serial.h> | ||
36 | 33 | ||
37 | #include "mux.h" | 34 | #include "mux.h" |
38 | 35 | ||
@@ -553,8 +550,8 @@ static int n8x0_auto_sleep_regulators(void) | |||
553 | 550 | ||
554 | ret = menelaus_set_regulator_sleep(1, val); | 551 | ret = menelaus_set_regulator_sleep(1, val); |
555 | if (ret < 0) { | 552 | if (ret < 0) { |
556 | printk(KERN_ERR "Could not set regulators to sleep on " | 553 | pr_err("Could not set regulators to sleep on menelaus: %u\n", |
557 | "menelaus: %u\n", ret); | 554 | ret); |
558 | return ret; | 555 | return ret; |
559 | } | 556 | } |
560 | return 0; | 557 | return 0; |
@@ -566,8 +563,7 @@ static int n8x0_auto_voltage_scale(void) | |||
566 | 563 | ||
567 | ret = menelaus_set_vcore_hw(1400, 1050); | 564 | ret = menelaus_set_vcore_hw(1400, 1050); |
568 | if (ret < 0) { | 565 | if (ret < 0) { |
569 | printk(KERN_ERR "Could not set VCORE voltage on " | 566 | pr_err("Could not set VCORE voltage on menelaus: %u\n", ret); |
570 | "menelaus: %u\n", ret); | ||
571 | return ret; | 567 | return ret; |
572 | } | 568 | } |
573 | return 0; | 569 | return 0; |
@@ -600,7 +596,7 @@ static struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = { | |||
600 | static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = { | 596 | static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = { |
601 | { | 597 | { |
602 | I2C_BOARD_INFO("menelaus", 0x72), | 598 | I2C_BOARD_INFO("menelaus", 0x72), |
603 | .irq = INT_24XX_SYS_NIRQ, | 599 | .irq = 7 + OMAP_INTC_START, |
604 | .platform_data = &n8x0_menelaus_platform_data, | 600 | .platform_data = &n8x0_menelaus_platform_data, |
605 | }, | 601 | }, |
606 | }; | 602 | }; |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 6202fc76e490..68ff8d51973c 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -33,18 +33,16 @@ | |||
33 | #include <linux/regulator/machine.h> | 33 | #include <linux/regulator/machine.h> |
34 | #include <linux/i2c/twl.h> | 34 | #include <linux/i2c/twl.h> |
35 | 35 | ||
36 | #include <mach/hardware.h> | ||
37 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
38 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
39 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
40 | #include <asm/mach/flash.h> | 39 | #include <asm/mach/flash.h> |
41 | 40 | ||
42 | #include <plat/board.h> | ||
43 | #include "common.h" | 41 | #include "common.h" |
44 | #include <video/omapdss.h> | 42 | #include <video/omapdss.h> |
45 | #include <video/omap-panel-tfp410.h> | 43 | #include <video/omap-panel-tfp410.h> |
46 | #include <plat/gpmc.h> | 44 | #include <plat/gpmc.h> |
47 | #include <plat/nand.h> | 45 | #include <linux/platform_data/mtd-nand-omap2.h> |
48 | #include <plat/usb.h> | 46 | #include <plat/usb.h> |
49 | #include <plat/omap_device.h> | 47 | #include <plat/omap_device.h> |
50 | 48 | ||
@@ -297,9 +295,6 @@ static int beagle_twl_gpio_setup(struct device *dev, | |||
297 | } | 295 | } |
298 | 296 | ||
299 | static struct twl4030_gpio_platform_data beagle_gpio_data = { | 297 | static struct twl4030_gpio_platform_data beagle_gpio_data = { |
300 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
301 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
302 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
303 | .use_leds = true, | 298 | .use_leds = true, |
304 | .pullups = BIT(1), | 299 | .pullups = BIT(1), |
305 | .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13) | 300 | .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13) |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 3d2a988e3d9a..c64e565bdef5 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -41,16 +41,14 @@ | |||
41 | #include <linux/mmc/host.h> | 41 | #include <linux/mmc/host.h> |
42 | #include <linux/export.h> | 42 | #include <linux/export.h> |
43 | 43 | ||
44 | #include <mach/hardware.h> | ||
45 | #include <asm/mach-types.h> | 44 | #include <asm/mach-types.h> |
46 | #include <asm/mach/arch.h> | 45 | #include <asm/mach/arch.h> |
47 | #include <asm/mach/map.h> | 46 | #include <asm/mach/map.h> |
48 | 47 | ||
49 | #include <plat/board.h> | ||
50 | #include <plat/usb.h> | 48 | #include <plat/usb.h> |
51 | #include <plat/nand.h> | 49 | #include <linux/platform_data/mtd-nand-omap2.h> |
52 | #include "common.h" | 50 | #include "common.h" |
53 | #include <plat/mcspi.h> | 51 | #include <linux/platform_data/spi-omap2-mcspi.h> |
54 | #include <video/omapdss.h> | 52 | #include <video/omapdss.h> |
55 | #include <video/omap-panel-tfp410.h> | 53 | #include <video/omap-panel-tfp410.h> |
56 | 54 | ||
@@ -76,6 +74,18 @@ | |||
76 | #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64 | 74 | #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64 |
77 | #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7 | 75 | #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7 |
78 | 76 | ||
77 | /* | ||
78 | * OMAP35x EVM revision | ||
79 | * Run time detection of EVM revision is done by reading Ethernet | ||
80 | * PHY ID - | ||
81 | * GEN_1 = 0x01150000 | ||
82 | * GEN_2 = 0x92200000 | ||
83 | */ | ||
84 | enum { | ||
85 | OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */ | ||
86 | OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */ | ||
87 | }; | ||
88 | |||
79 | static u8 omap3_evm_version; | 89 | static u8 omap3_evm_version; |
80 | 90 | ||
81 | u8 get_omap3_evm_rev(void) | 91 | u8 get_omap3_evm_rev(void) |
@@ -109,7 +119,7 @@ static void __init omap3_evm_get_revision(void) | |||
109 | } | 119 | } |
110 | 120 | ||
111 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 121 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
112 | #include <plat/gpmc-smsc911x.h> | 122 | #include "gpmc-smsc911x.h" |
113 | 123 | ||
114 | static struct omap_smsc911x_platform_data smsc911x_cfg = { | 124 | static struct omap_smsc911x_platform_data smsc911x_cfg = { |
115 | .cs = OMAP3EVM_SMSC911X_CS, | 125 | .cs = OMAP3EVM_SMSC911X_CS, |
@@ -378,9 +388,6 @@ static int omap3evm_twl_gpio_setup(struct device *dev, | |||
378 | } | 388 | } |
379 | 389 | ||
380 | static struct twl4030_gpio_platform_data omap3evm_gpio_data = { | 390 | static struct twl4030_gpio_platform_data omap3evm_gpio_data = { |
381 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
382 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
383 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
384 | .use_leds = true, | 391 | .use_leds = true, |
385 | .setup = omap3evm_twl_gpio_setup, | 392 | .setup = omap3evm_twl_gpio_setup, |
386 | }; | 393 | }; |
@@ -527,9 +534,6 @@ static int __init omap3_evm_i2c_init(void) | |||
527 | return 0; | 534 | return 0; |
528 | } | 535 | } |
529 | 536 | ||
530 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { | ||
531 | }; | ||
532 | |||
533 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { | 537 | static struct usbhs_omap_board_data usbhs_bdata __initdata = { |
534 | 538 | ||
535 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, | 539 | .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, |
@@ -689,9 +693,6 @@ static void __init omap3_evm_init(void) | |||
689 | obm = (cpu_is_omap3630()) ? omap36x_board_mux : omap35x_board_mux; | 693 | obm = (cpu_is_omap3630()) ? omap36x_board_mux : omap35x_board_mux; |
690 | omap3_mux_init(obm, OMAP_PACKAGE_CBB); | 694 | omap3_mux_init(obm, OMAP_PACKAGE_CBB); |
691 | 695 | ||
692 | omap_board_config = omap3_evm_config; | ||
693 | omap_board_config_size = ARRAY_SIZE(omap3_evm_config); | ||
694 | |||
695 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); | 696 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); |
696 | omap_hsmmc_init(mmc); | 697 | omap_hsmmc_init(mmc); |
697 | 698 | ||
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c index fca93d1afd43..7bd8253b5d1d 100644 --- a/arch/arm/mach-omap2/board-omap3logic.c +++ b/arch/arm/mach-omap2/board-omap3logic.c | |||
@@ -30,24 +30,21 @@ | |||
30 | #include <linux/i2c/twl.h> | 30 | #include <linux/i2c/twl.h> |
31 | #include <linux/mmc/host.h> | 31 | #include <linux/mmc/host.h> |
32 | 32 | ||
33 | #include <mach/hardware.h> | ||
34 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
35 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
36 | #include <asm/mach/map.h> | 35 | #include <asm/mach/map.h> |
37 | 36 | ||
37 | #include "gpmc-smsc911x.h" | ||
38 | #include <plat/gpmc.h> | ||
39 | #include <plat/sdrc.h> | ||
40 | #include <plat/usb.h> | ||
41 | |||
42 | #include "common.h" | ||
38 | #include "mux.h" | 43 | #include "mux.h" |
39 | #include "hsmmc.h" | 44 | #include "hsmmc.h" |
40 | #include "control.h" | 45 | #include "control.h" |
41 | #include "common-board-devices.h" | 46 | #include "common-board-devices.h" |
42 | 47 | ||
43 | #include <plat/mux.h> | ||
44 | #include <plat/board.h> | ||
45 | #include "common.h" | ||
46 | #include <plat/gpmc-smsc911x.h> | ||
47 | #include <plat/gpmc.h> | ||
48 | #include <plat/sdrc.h> | ||
49 | #include <plat/usb.h> | ||
50 | |||
51 | #define OMAP3LOGIC_SMSC911X_CS 1 | 48 | #define OMAP3LOGIC_SMSC911X_CS 1 |
52 | 49 | ||
53 | #define OMAP3530_LV_SOM_MMC_GPIO_CD 110 | 50 | #define OMAP3530_LV_SOM_MMC_GPIO_CD 110 |
@@ -78,9 +75,6 @@ static struct regulator_init_data omap3logic_vmmc1 = { | |||
78 | }; | 75 | }; |
79 | 76 | ||
80 | static struct twl4030_gpio_platform_data omap3logic_gpio_data = { | 77 | static struct twl4030_gpio_platform_data omap3logic_gpio_data = { |
81 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
82 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
83 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
84 | .use_leds = true, | 78 | .use_leds = true, |
85 | .pullups = BIT(1), | 79 | .pullups = BIT(1), |
86 | .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | 80 | .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 57aebee44fd0..00a1f4ae6e44 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -35,18 +35,16 @@ | |||
35 | #include <linux/mmc/host.h> | 35 | #include <linux/mmc/host.h> |
36 | #include <linux/mmc/card.h> | 36 | #include <linux/mmc/card.h> |
37 | #include <linux/regulator/fixed.h> | 37 | #include <linux/regulator/fixed.h> |
38 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
38 | 39 | ||
39 | #include <asm/mach-types.h> | 40 | #include <asm/mach-types.h> |
40 | #include <asm/mach/arch.h> | 41 | #include <asm/mach/arch.h> |
41 | #include <asm/mach/map.h> | 42 | #include <asm/mach/map.h> |
42 | 43 | ||
43 | #include <plat/board.h> | ||
44 | #include "common.h" | 44 | #include "common.h" |
45 | #include <mach/hardware.h> | ||
46 | #include <plat/mcspi.h> | ||
47 | #include <plat/usb.h> | 45 | #include <plat/usb.h> |
48 | #include <video/omapdss.h> | 46 | #include <video/omapdss.h> |
49 | #include <plat/nand.h> | 47 | #include <linux/platform_data/mtd-nand-omap2.h> |
50 | 48 | ||
51 | #include "mux.h" | 49 | #include "mux.h" |
52 | #include "sdram-micron-mt46h32m32lf-6.h" | 50 | #include "sdram-micron-mt46h32m32lf-6.h" |
@@ -321,9 +319,6 @@ static int omap3pandora_twl_gpio_setup(struct device *dev, | |||
321 | } | 319 | } |
322 | 320 | ||
323 | static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { | 321 | static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { |
324 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
325 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
326 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
327 | .setup = omap3pandora_twl_gpio_setup, | 322 | .setup = omap3pandora_twl_gpio_setup, |
328 | }; | 323 | }; |
329 | 324 | ||
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index b318f5602e36..c7f3d026e6d4 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -28,23 +28,26 @@ | |||
28 | #include <linux/regulator/machine.h> | 28 | #include <linux/regulator/machine.h> |
29 | #include <linux/i2c/twl.h> | 29 | #include <linux/i2c/twl.h> |
30 | #include <linux/mmc/host.h> | 30 | #include <linux/mmc/host.h> |
31 | #include <linux/input/matrix_keypad.h> | ||
32 | #include <linux/spi/spi.h> | ||
33 | #include <linux/interrupt.h> | ||
34 | #include <linux/smsc911x.h> | ||
35 | #include <linux/i2c/at24.h> | ||
31 | 36 | ||
32 | #include <mach/hardware.h> | ||
33 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
35 | #include <asm/mach/map.h> | 39 | #include <asm/mach/map.h> |
36 | #include <asm/mach/flash.h> | 40 | #include <asm/mach/flash.h> |
37 | 41 | ||
38 | #include <plat/board.h> | ||
39 | #include "common.h" | 42 | #include "common.h" |
40 | #include <plat/gpmc.h> | 43 | #include <plat/gpmc.h> |
41 | #include <plat/nand.h> | 44 | #include <linux/platform_data/mtd-nand-omap2.h> |
42 | #include <plat/usb.h> | 45 | #include <plat/usb.h> |
43 | #include <video/omapdss.h> | 46 | #include <video/omapdss.h> |
44 | #include <video/omap-panel-generic-dpi.h> | 47 | #include <video/omap-panel-generic-dpi.h> |
45 | #include <video/omap-panel-tfp410.h> | 48 | #include <video/omap-panel-tfp410.h> |
46 | 49 | ||
47 | #include <plat/mcspi.h> | 50 | #include <linux/platform_data/spi-omap2-mcspi.h> |
48 | #include <linux/input/matrix_keypad.h> | 51 | #include <linux/input/matrix_keypad.h> |
49 | #include <linux/spi/spi.h> | 52 | #include <linux/spi/spi.h> |
50 | #include <linux/interrupt.h> | 53 | #include <linux/interrupt.h> |
@@ -57,7 +60,7 @@ | |||
57 | #include "common-board-devices.h" | 60 | #include "common-board-devices.h" |
58 | 61 | ||
59 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 62 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
60 | #include <plat/gpmc-smsc911x.h> | 63 | #include "gpmc-smsc911x.h" |
61 | 64 | ||
62 | #define OMAP3STALKER_ETHR_START 0x2c000000 | 65 | #define OMAP3STALKER_ETHR_START 0x2c000000 |
63 | #define OMAP3STALKER_ETHR_SIZE 1024 | 66 | #define OMAP3STALKER_ETHR_SIZE 1024 |
@@ -279,9 +282,6 @@ omap3stalker_twl_gpio_setup(struct device *dev, | |||
279 | } | 282 | } |
280 | 283 | ||
281 | static struct twl4030_gpio_platform_data omap3stalker_gpio_data = { | 284 | static struct twl4030_gpio_platform_data omap3stalker_gpio_data = { |
282 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
283 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
284 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
285 | .use_leds = true, | 285 | .use_leds = true, |
286 | .setup = omap3stalker_twl_gpio_setup, | 286 | .setup = omap3stalker_twl_gpio_setup, |
287 | }; | 287 | }; |
@@ -362,9 +362,6 @@ static int __init omap3_stalker_i2c_init(void) | |||
362 | 362 | ||
363 | #define OMAP3_STALKER_TS_GPIO 175 | 363 | #define OMAP3_STALKER_TS_GPIO 175 |
364 | 364 | ||
365 | static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { | ||
366 | }; | ||
367 | |||
368 | static struct platform_device *omap3_stalker_devices[] __initdata = { | 365 | static struct platform_device *omap3_stalker_devices[] __initdata = { |
369 | &keys_gpio, | 366 | &keys_gpio, |
370 | }; | 367 | }; |
@@ -399,8 +396,6 @@ static void __init omap3_stalker_init(void) | |||
399 | { | 396 | { |
400 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | 397 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); |
401 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 398 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
402 | omap_board_config = omap3_stalker_config; | ||
403 | omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); | ||
404 | 399 | ||
405 | omap_mux_init_gpio(23, OMAP_PIN_INPUT); | 400 | omap_mux_init_gpio(23, OMAP_PIN_INPUT); |
406 | omap_hsmmc_init(mmc); | 401 | omap_hsmmc_init(mmc); |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 485d14d6a8cd..944ffc436577 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/mtd/nand.h> | 29 | #include <linux/mtd/nand.h> |
30 | #include <linux/mmc/host.h> | 30 | #include <linux/mmc/host.h> |
31 | 31 | ||
32 | #include <plat/mcspi.h> | 32 | #include <linux/platform_data/spi-omap2-mcspi.h> |
33 | #include <linux/spi/spi.h> | 33 | #include <linux/spi/spi.h> |
34 | 34 | ||
35 | #include <linux/spi/ads7846.h> | 35 | #include <linux/spi/ads7846.h> |
@@ -37,17 +37,15 @@ | |||
37 | #include <linux/regulator/machine.h> | 37 | #include <linux/regulator/machine.h> |
38 | #include <linux/i2c/twl.h> | 38 | #include <linux/i2c/twl.h> |
39 | 39 | ||
40 | #include <mach/hardware.h> | ||
41 | #include <asm/mach-types.h> | 40 | #include <asm/mach-types.h> |
42 | #include <asm/mach/arch.h> | 41 | #include <asm/mach/arch.h> |
43 | #include <asm/mach/map.h> | 42 | #include <asm/mach/map.h> |
44 | #include <asm/mach/flash.h> | 43 | #include <asm/mach/flash.h> |
45 | #include <asm/system_info.h> | 44 | #include <asm/system_info.h> |
46 | 45 | ||
47 | #include <plat/board.h> | ||
48 | #include "common.h" | 46 | #include "common.h" |
49 | #include <plat/gpmc.h> | 47 | #include <plat/gpmc.h> |
50 | #include <plat/nand.h> | 48 | #include <linux/platform_data/mtd-nand-omap2.h> |
51 | #include <plat/usb.h> | 49 | #include <plat/usb.h> |
52 | 50 | ||
53 | #include "mux.h" | 51 | #include "mux.h" |
@@ -139,9 +137,6 @@ static int touchbook_twl_gpio_setup(struct device *dev, | |||
139 | } | 137 | } |
140 | 138 | ||
141 | static struct twl4030_gpio_platform_data touchbook_gpio_data = { | 139 | static struct twl4030_gpio_platform_data touchbook_gpio_data = { |
142 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
143 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
144 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
145 | .use_leds = true, | 140 | .use_leds = true, |
146 | .pullups = BIT(1), | 141 | .pullups = BIT(1), |
147 | .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13) | 142 | .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13) |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 70f6d1d25463..7b592d3d7797 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -32,19 +32,18 @@ | |||
32 | #include <linux/wl12xx.h> | 32 | #include <linux/wl12xx.h> |
33 | #include <linux/platform_data/omap-abe-twl6040.h> | 33 | #include <linux/platform_data/omap-abe-twl6040.h> |
34 | 34 | ||
35 | #include <mach/hardware.h> | ||
36 | #include <asm/hardware/gic.h> | 35 | #include <asm/hardware/gic.h> |
37 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
38 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
39 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
40 | #include <video/omapdss.h> | 39 | #include <video/omapdss.h> |
41 | 40 | ||
42 | #include <plat/board.h> | ||
43 | #include "common.h" | 41 | #include "common.h" |
44 | #include <plat/usb.h> | 42 | #include <plat/usb.h> |
45 | #include <plat/mmc.h> | 43 | #include <plat/mmc.h> |
46 | #include <video/omap-panel-tfp410.h> | 44 | #include <video/omap-panel-tfp410.h> |
47 | 45 | ||
46 | #include "soc.h" | ||
48 | #include "hsmmc.h" | 47 | #include "hsmmc.h" |
49 | #include "control.h" | 48 | #include "control.h" |
50 | #include "mux.h" | 49 | #include "mux.h" |
@@ -263,7 +262,14 @@ static struct twl6040_codec_data twl6040_codec = { | |||
263 | static struct twl6040_platform_data twl6040_data = { | 262 | static struct twl6040_platform_data twl6040_data = { |
264 | .codec = &twl6040_codec, | 263 | .codec = &twl6040_codec, |
265 | .audpwron_gpio = 127, | 264 | .audpwron_gpio = 127, |
266 | .irq_base = TWL6040_CODEC_IRQ_BASE, | 265 | }; |
266 | |||
267 | static struct i2c_board_info __initdata panda_i2c_1_boardinfo[] = { | ||
268 | { | ||
269 | I2C_BOARD_INFO("twl6040", 0x4b), | ||
270 | .irq = 119 + OMAP44XX_IRQ_GIC_START, | ||
271 | .platform_data = &twl6040_data, | ||
272 | }, | ||
267 | }; | 273 | }; |
268 | 274 | ||
269 | /* Panda board uses the common PMIC configuration */ | 275 | /* Panda board uses the common PMIC configuration */ |
@@ -293,8 +299,8 @@ static int __init omap4_panda_i2c_init(void) | |||
293 | TWL_COMMON_REGULATOR_CLK32KG | | 299 | TWL_COMMON_REGULATOR_CLK32KG | |
294 | TWL_COMMON_REGULATOR_V1V8 | | 300 | TWL_COMMON_REGULATOR_V1V8 | |
295 | TWL_COMMON_REGULATOR_V2V1); | 301 | TWL_COMMON_REGULATOR_V2V1); |
296 | omap4_pmic_init("twl6030", &omap4_panda_twldata, | 302 | omap4_pmic_init("twl6030", &omap4_panda_twldata, panda_i2c_1_boardinfo, |
297 | &twl6040_data, OMAP44XX_IRQ_SYS_2N); | 303 | ARRAY_SIZE(panda_i2c_1_boardinfo)); |
298 | omap_register_i2c_bus(2, 400, NULL, 0); | 304 | omap_register_i2c_bus(2, 400, NULL, 0); |
299 | /* | 305 | /* |
300 | * Bus 3 is attached to the DVI port where devices like the pico DLP | 306 | * Bus 3 is attached to the DVI port where devices like the pico DLP |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 779734d8ba37..2e7f24030fc9 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -37,21 +37,19 @@ | |||
37 | #include <linux/mtd/partitions.h> | 37 | #include <linux/mtd/partitions.h> |
38 | #include <linux/mmc/host.h> | 38 | #include <linux/mmc/host.h> |
39 | 39 | ||
40 | #include <linux/platform_data/mtd-nand-omap2.h> | ||
41 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
42 | |||
40 | #include <asm/mach-types.h> | 43 | #include <asm/mach-types.h> |
41 | #include <asm/mach/arch.h> | 44 | #include <asm/mach/arch.h> |
42 | #include <asm/mach/flash.h> | 45 | #include <asm/mach/flash.h> |
43 | #include <asm/mach/map.h> | 46 | #include <asm/mach/map.h> |
44 | 47 | ||
45 | #include <plat/board.h> | ||
46 | #include "common.h" | 48 | #include "common.h" |
47 | #include <video/omapdss.h> | 49 | #include <video/omapdss.h> |
48 | #include <video/omap-panel-generic-dpi.h> | 50 | #include <video/omap-panel-generic-dpi.h> |
49 | #include <video/omap-panel-tfp410.h> | 51 | #include <video/omap-panel-tfp410.h> |
50 | #include <plat/gpmc.h> | 52 | #include <plat/gpmc.h> |
51 | #include <mach/hardware.h> | ||
52 | #include <plat/nand.h> | ||
53 | #include <plat/mcspi.h> | ||
54 | #include <plat/mux.h> | ||
55 | #include <plat/usb.h> | 53 | #include <plat/usb.h> |
56 | 54 | ||
57 | #include "mux.h" | 55 | #include "mux.h" |
@@ -116,7 +114,7 @@ static inline void __init overo_ads7846_init(void) { return; } | |||
116 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 114 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
117 | 115 | ||
118 | #include <linux/smsc911x.h> | 116 | #include <linux/smsc911x.h> |
119 | #include <plat/gpmc-smsc911x.h> | 117 | #include "gpmc-smsc911x.h" |
120 | 118 | ||
121 | static struct omap_smsc911x_platform_data smsc911x_cfg = { | 119 | static struct omap_smsc911x_platform_data smsc911x_cfg = { |
122 | .id = 0, | 120 | .id = 0, |
@@ -399,9 +397,6 @@ static int overo_twl_gpio_setup(struct device *dev, | |||
399 | } | 397 | } |
400 | 398 | ||
401 | static struct twl4030_gpio_platform_data overo_gpio_data = { | 399 | static struct twl4030_gpio_platform_data overo_gpio_data = { |
402 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
403 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
404 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
405 | .use_leds = true, | 400 | .use_leds = true, |
406 | .setup = overo_twl_gpio_setup, | 401 | .setup = overo_twl_gpio_setup, |
407 | }; | 402 | }; |
@@ -522,8 +517,7 @@ static void __init overo_init(void) | |||
522 | udelay(10); | 517 | udelay(10); |
523 | gpio_set_value(OVERO_GPIO_W2W_NRESET, 1); | 518 | gpio_set_value(OVERO_GPIO_W2W_NRESET, 1); |
524 | } else { | 519 | } else { |
525 | printk(KERN_ERR "could not obtain gpio for " | 520 | pr_err("could not obtain gpio for OVERO_GPIO_W2W_NRESET\n"); |
526 | "OVERO_GPIO_W2W_NRESET\n"); | ||
527 | } | 521 | } |
528 | 522 | ||
529 | ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios)); | 523 | ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios)); |
@@ -542,8 +536,7 @@ static void __init overo_init(void) | |||
542 | if (ret == 0) | 536 | if (ret == 0) |
543 | gpio_export(OVERO_GPIO_USBH_CPEN, 0); | 537 | gpio_export(OVERO_GPIO_USBH_CPEN, 0); |
544 | else | 538 | else |
545 | printk(KERN_ERR "could not obtain gpio for " | 539 | pr_err("could not obtain gpio for OVERO_GPIO_USBH_CPEN\n"); |
546 | "OVERO_GPIO_USBH_CPEN\n"); | ||
547 | } | 540 | } |
548 | 541 | ||
549 | MACHINE_START(OVERO, "Gumstix Overo") | 542 | MACHINE_START(OVERO, "Gumstix Overo") |
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c index 0ad1bb3bdb98..45997bfbcbd2 100644 --- a/arch/arm/mach-omap2/board-rm680.c +++ b/arch/arm/mach-omap2/board-rm680.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/regulator/fixed.h> | 17 | #include <linux/regulator/fixed.h> |
18 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
19 | #include <linux/regulator/consumer.h> | 19 | #include <linux/regulator/consumer.h> |
20 | #include <linux/platform_data/mtd-onenand-omap2.h> | ||
20 | 21 | ||
21 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
@@ -26,7 +27,7 @@ | |||
26 | #include <plat/usb.h> | 27 | #include <plat/usb.h> |
27 | #include <plat/gpmc.h> | 28 | #include <plat/gpmc.h> |
28 | #include "common.h" | 29 | #include "common.h" |
29 | #include <plat/onenand.h> | 30 | #include <plat/serial.h> |
30 | 31 | ||
31 | #include "mux.h" | 32 | #include "mux.h" |
32 | #include "hsmmc.h" | 33 | #include "hsmmc.h" |
@@ -72,9 +73,6 @@ static struct platform_device *rm680_peripherals_devices[] __initdata = { | |||
72 | 73 | ||
73 | /* TWL */ | 74 | /* TWL */ |
74 | static struct twl4030_gpio_platform_data rm680_gpio_data = { | 75 | static struct twl4030_gpio_platform_data rm680_gpio_data = { |
75 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
76 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
77 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
78 | .pullups = BIT(0), | 76 | .pullups = BIT(0), |
79 | .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15), | 77 | .pulldowns = BIT(1) | BIT(2) | BIT(8) | BIT(15), |
80 | }; | 78 | }; |
@@ -87,7 +85,7 @@ static struct twl4030_platform_data rm680_twl_data = { | |||
87 | static void __init rm680_i2c_init(void) | 85 | static void __init rm680_i2c_init(void) |
88 | { | 86 | { |
89 | omap3_pmic_get_config(&rm680_twl_data, TWL_COMMON_PDATA_USB, 0); | 87 | omap3_pmic_get_config(&rm680_twl_data, TWL_COMMON_PDATA_USB, 0); |
90 | omap_pmic_init(1, 2900, "twl5031", INT_34XX_SYS_NIRQ, &rm680_twl_data); | 88 | omap_pmic_init(1, 2900, "twl5031", 7 + OMAP_INTC_START, &rm680_twl_data); |
91 | omap_register_i2c_bus(2, 400, NULL, 0); | 89 | omap_register_i2c_bus(2, 400, NULL, 0); |
92 | omap_register_i2c_bus(3, 400, NULL, 0); | 90 | omap_register_i2c_bus(3, 400, NULL, 0); |
93 | } | 91 | } |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index df2534de3361..3945c5017085 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -25,17 +25,17 @@ | |||
25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
26 | #include <linux/mmc/host.h> | 26 | #include <linux/mmc/host.h> |
27 | #include <linux/power/isp1704_charger.h> | 27 | #include <linux/power/isp1704_charger.h> |
28 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
29 | #include <linux/platform_data/mtd-onenand-omap2.h> | ||
30 | |||
28 | #include <asm/system_info.h> | 31 | #include <asm/system_info.h> |
29 | 32 | ||
30 | #include <plat/mcspi.h> | ||
31 | #include <plat/board.h> | ||
32 | #include "common.h" | 33 | #include "common.h" |
33 | #include <plat/dma.h> | 34 | #include <plat/dma.h> |
34 | #include <plat/gpmc.h> | 35 | #include <plat/gpmc.h> |
35 | #include <plat/onenand.h> | 36 | #include "gpmc-smc91x.h" |
36 | #include <plat/gpmc-smc91x.h> | ||
37 | 37 | ||
38 | #include <mach/board-rx51.h> | 38 | #include "board-rx51.h" |
39 | 39 | ||
40 | #include <sound/tlv320aic3x.h> | 40 | #include <sound/tlv320aic3x.h> |
41 | #include <sound/tpa6130a2-plat.h> | 41 | #include <sound/tpa6130a2-plat.h> |
@@ -774,9 +774,6 @@ static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) | |||
774 | } | 774 | } |
775 | 775 | ||
776 | static struct twl4030_gpio_platform_data rx51_gpio_data = { | 776 | static struct twl4030_gpio_platform_data rx51_gpio_data = { |
777 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
778 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
779 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
780 | .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3) | 777 | .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3) |
781 | | BIT(4) | BIT(5) | 778 | | BIT(4) | BIT(5) |
782 | | BIT(8) | BIT(9) | BIT(10) | BIT(11) | 779 | | BIT(8) | BIT(9) | BIT(10) | BIT(11) |
@@ -1051,7 +1048,7 @@ static int __init rx51_i2c_init(void) | |||
1051 | rx51_twldata.vdac->constraints.apply_uV = true; | 1048 | rx51_twldata.vdac->constraints.apply_uV = true; |
1052 | rx51_twldata.vdac->constraints.name = "VDAC"; | 1049 | rx51_twldata.vdac->constraints.name = "VDAC"; |
1053 | 1050 | ||
1054 | omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); | 1051 | omap_pmic_init(1, 2200, "twl5030", 7 + OMAP_INTC_START, &rx51_twldata); |
1055 | omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, | 1052 | omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, |
1056 | ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); | 1053 | ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); |
1057 | #if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE) | 1054 | #if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE) |
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c index 2c1289bd5e6a..c22e111bcd00 100644 --- a/arch/arm/mach-omap2/board-rx51-video.c +++ b/arch/arm/mach-omap2/board-rx51-video.c | |||
@@ -17,9 +17,9 @@ | |||
17 | #include <asm/mach-types.h> | 17 | #include <asm/mach-types.h> |
18 | #include <video/omapdss.h> | 18 | #include <video/omapdss.h> |
19 | #include <plat/vram.h> | 19 | #include <plat/vram.h> |
20 | #include <plat/mcspi.h> | 20 | #include <linux/platform_data/spi-omap2-mcspi.h> |
21 | 21 | ||
22 | #include <mach/board-rx51.h> | 22 | #include "board-rx51.h" |
23 | 23 | ||
24 | #include "mux.h" | 24 | #include "mux.h" |
25 | 25 | ||
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 345dd931f76f..7bbb05d9689b 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c | |||
@@ -17,14 +17,12 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/leds.h> | 19 | #include <linux/leds.h> |
20 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
20 | 21 | ||
21 | #include <mach/hardware.h> | ||
22 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
23 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
24 | #include <asm/mach/map.h> | 24 | #include <asm/mach/map.h> |
25 | 25 | ||
26 | #include <plat/mcspi.h> | ||
27 | #include <plat/board.h> | ||
28 | #include "common.h" | 26 | #include "common.h" |
29 | #include <plat/dma.h> | 27 | #include <plat/dma.h> |
30 | #include <plat/gpmc.h> | 28 | #include <plat/gpmc.h> |
diff --git a/arch/arm/mach-omap2/include/mach/board-rx51.h b/arch/arm/mach-omap2/board-rx51.h index b76f49e7eed5..b76f49e7eed5 100644 --- a/arch/arm/mach-omap2/include/mach/board-rx51.h +++ b/arch/arm/mach-omap2/board-rx51.h | |||
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c index d4c8392cadb6..c4f8833b4c3c 100644 --- a/arch/arm/mach-omap2/board-ti8168evm.c +++ b/arch/arm/mach-omap2/board-ti8168evm.c | |||
@@ -15,13 +15,10 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | 17 | ||
18 | #include <mach/hardware.h> | ||
19 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
20 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
21 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
22 | 21 | ||
23 | #include <plat/irqs.h> | ||
24 | #include <plat/board.h> | ||
25 | #include "common.h" | 22 | #include "common.h" |
26 | #include <plat/usb.h> | 23 | #include <plat/usb.h> |
27 | 24 | ||
@@ -32,15 +29,10 @@ static struct omap_musb_board_data musb_board_data = { | |||
32 | .power = 500, | 29 | .power = 500, |
33 | }; | 30 | }; |
34 | 31 | ||
35 | static struct omap_board_config_kernel ti81xx_evm_config[] __initdata = { | ||
36 | }; | ||
37 | |||
38 | static void __init ti81xx_evm_init(void) | 32 | static void __init ti81xx_evm_init(void) |
39 | { | 33 | { |
40 | omap_serial_init(); | 34 | omap_serial_init(); |
41 | omap_sdrc_init(NULL, NULL); | 35 | omap_sdrc_init(NULL, NULL); |
42 | omap_board_config = ti81xx_evm_config; | ||
43 | omap_board_config_size = ARRAY_SIZE(ti81xx_evm_config); | ||
44 | usb_musb_init(&musb_board_data); | 36 | usb_musb_init(&musb_board_data); |
45 | } | 37 | } |
46 | 38 | ||
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c index f64f44173061..afb2278a29f6 100644 --- a/arch/arm/mach-omap2/board-zoom-debugboard.c +++ b/arch/arm/mach-omap2/board-zoom-debugboard.c | |||
@@ -18,10 +18,13 @@ | |||
18 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
19 | 19 | ||
20 | #include <plat/gpmc.h> | 20 | #include <plat/gpmc.h> |
21 | #include <plat/gpmc-smsc911x.h> | 21 | #include "gpmc-smsc911x.h" |
22 | 22 | ||
23 | #include <mach/board-zoom.h> | 23 | #include <mach/board-zoom.h> |
24 | 24 | ||
25 | #include "soc.h" | ||
26 | #include "common.h" | ||
27 | |||
25 | #define ZOOM_SMSC911X_CS 7 | 28 | #define ZOOM_SMSC911X_CS 7 |
26 | #define ZOOM_SMSC911X_GPIO 158 | 29 | #define ZOOM_SMSC911X_GPIO 158 |
27 | #define ZOOM_QUADUART_CS 3 | 30 | #define ZOOM_QUADUART_CS 3 |
@@ -81,8 +84,7 @@ static inline void __init zoom_init_quaduart(void) | |||
81 | quart_cs = ZOOM_QUADUART_CS; | 84 | quart_cs = ZOOM_QUADUART_CS; |
82 | 85 | ||
83 | if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) { | 86 | if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) { |
84 | printk(KERN_ERR "Failed to request GPMC mem" | 87 | pr_err("Failed to request GPMC mem for Quad UART(TL16CP754C)\n"); |
85 | "for Quad UART(TL16CP754C)\n"); | ||
86 | return; | 88 | return; |
87 | } | 89 | } |
88 | 90 | ||
@@ -104,8 +106,8 @@ static inline int omap_zoom_debugboard_detect(void) | |||
104 | 106 | ||
105 | if (gpio_request_one(debug_board_detect, GPIOF_IN, | 107 | if (gpio_request_one(debug_board_detect, GPIOF_IN, |
106 | "Zoom debug board detect") < 0) { | 108 | "Zoom debug board detect") < 0) { |
107 | printk(KERN_ERR "Failed to request GPIO%d for Zoom debug" | 109 | pr_err("Failed to request GPIO%d for Zoom debug board detect\n", |
108 | "board detect\n", debug_board_detect); | 110 | debug_board_detect); |
109 | return 0; | 111 | return 0; |
110 | } | 112 | } |
111 | 113 | ||
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c index 28187f134fff..b940ab2259fb 100644 --- a/arch/arm/mach-omap2/board-zoom-display.c +++ b/arch/arm/mach-omap2/board-zoom-display.c | |||
@@ -14,10 +14,12 @@ | |||
14 | #include <linux/gpio.h> | 14 | #include <linux/gpio.h> |
15 | #include <linux/i2c/twl.h> | 15 | #include <linux/i2c/twl.h> |
16 | #include <linux/spi/spi.h> | 16 | #include <linux/spi/spi.h> |
17 | #include <plat/mcspi.h> | 17 | #include <linux/platform_data/spi-omap2-mcspi.h> |
18 | #include <video/omapdss.h> | 18 | #include <video/omapdss.h> |
19 | #include <mach/board-zoom.h> | 19 | #include <mach/board-zoom.h> |
20 | 20 | ||
21 | #include "common.h" | ||
22 | |||
21 | #define LCD_PANEL_RESET_GPIO_PROD 96 | 23 | #define LCD_PANEL_RESET_GPIO_PROD 96 |
22 | #define LCD_PANEL_RESET_GPIO_PILOT 55 | 24 | #define LCD_PANEL_RESET_GPIO_PILOT 55 |
23 | #define LCD_PANEL_QVGA_GPIO 56 | 25 | #define LCD_PANEL_QVGA_GPIO 56 |
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index b797cb279618..6bcc107b9fc3 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/regulator/fixed.h> | 19 | #include <linux/regulator/fixed.h> |
20 | #include <linux/wl12xx.h> | 20 | #include <linux/wl12xx.h> |
21 | #include <linux/mmc/host.h> | 21 | #include <linux/mmc/host.h> |
22 | #include <linux/platform_data/gpio-omap.h> | ||
22 | 23 | ||
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
24 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
@@ -251,9 +252,6 @@ static void zoom2_set_hs_extmute(int mute) | |||
251 | } | 252 | } |
252 | 253 | ||
253 | static struct twl4030_gpio_platform_data zoom_gpio_data = { | 254 | static struct twl4030_gpio_platform_data zoom_gpio_data = { |
254 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
255 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
256 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
257 | .setup = zoom_twl_gpio_setup, | 255 | .setup = zoom_twl_gpio_setup, |
258 | }; | 256 | }; |
259 | 257 | ||
@@ -281,7 +279,7 @@ static int __init omap_i2c_init(void) | |||
281 | codec_data->hs_extmute = 1; | 279 | codec_data->hs_extmute = 1; |
282 | codec_data->set_hs_extmute = zoom2_set_hs_extmute; | 280 | codec_data->set_hs_extmute = zoom2_set_hs_extmute; |
283 | } | 281 | } |
284 | omap_pmic_init(1, 2400, "twl5030", INT_34XX_SYS_NIRQ, &zoom_twldata); | 282 | omap_pmic_init(1, 2400, "twl5030", 7 + OMAP_INTC_START, &zoom_twldata); |
285 | omap_register_i2c_bus(2, 400, NULL, 0); | 283 | omap_register_i2c_bus(2, 400, NULL, 0); |
286 | omap_register_i2c_bus(3, 400, NULL, 0); | 284 | omap_register_i2c_bus(3, 400, NULL, 0); |
287 | return 0; | 285 | return 0; |
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c index 4e7e56142e6f..4994438e1f46 100644 --- a/arch/arm/mach-omap2/board-zoom.c +++ b/arch/arm/mach-omap2/board-zoom.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
23 | 23 | ||
24 | #include "common.h" | 24 | #include "common.h" |
25 | #include <plat/board.h> | ||
26 | #include <plat/usb.h> | 25 | #include <plat/usb.h> |
27 | 26 | ||
28 | #include <mach/board-zoom.h> | 27 | #include <mach/board-zoom.h> |
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 3d9d746b221a..cabcfdba5246 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | |||
@@ -33,11 +33,11 @@ | |||
33 | #include <linux/cpufreq.h> | 33 | #include <linux/cpufreq.h> |
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | 35 | ||
36 | #include <plat/cpu.h> | ||
37 | #include <plat/clock.h> | 36 | #include <plat/clock.h> |
38 | #include <plat/sram.h> | 37 | #include <plat/sram.h> |
39 | #include <plat/sdrc.h> | 38 | #include <plat/sdrc.h> |
40 | 39 | ||
40 | #include "soc.h" | ||
41 | #include "clock.h" | 41 | #include "clock.h" |
42 | #include "clock2xxx.h" | 42 | #include "clock2xxx.h" |
43 | #include "opp2xxx.h" | 43 | #include "opp2xxx.h" |
diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c index d6e34dd9e7e7..298887b5bf66 100644 --- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c +++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c | |||
@@ -92,15 +92,13 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) | |||
92 | 92 | ||
93 | pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, | 93 | pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, |
94 | validrate); | 94 | validrate); |
95 | pr_debug("clock: SDRC CS0 timing params used:" | 95 | pr_debug("clock: SDRC CS0 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", |
96 | " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", | ||
97 | sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, | 96 | sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, |
98 | sdrc_cs0->actim_ctrlb, sdrc_cs0->mr); | 97 | sdrc_cs0->actim_ctrlb, sdrc_cs0->mr); |
99 | if (sdrc_cs1) | 98 | if (sdrc_cs1) |
100 | pr_debug("clock: SDRC CS1 timing params used: " | 99 | pr_debug("clock: SDRC CS1 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", |
101 | " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", | 100 | sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, |
102 | sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, | 101 | sdrc_cs1->actim_ctrlb, sdrc_cs1->mr); |
103 | sdrc_cs1->actim_ctrlb, sdrc_cs1->mr); | ||
104 | 102 | ||
105 | if (sdrc_cs1) | 103 | if (sdrc_cs1) |
106 | omap3_configure_core_dpll( | 104 | omap3_configure_core_dpll( |
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c index 04d551b1f7f7..19a980956d44 100644 --- a/arch/arm/mach-omap2/clkt_clksel.c +++ b/arch/arm/mach-omap2/clkt_clksel.c | |||
@@ -71,8 +71,8 @@ static const struct clksel *_get_clksel_by_parent(struct clk *clk, | |||
71 | 71 | ||
72 | if (!clks->parent) { | 72 | if (!clks->parent) { |
73 | /* This indicates a data problem */ | 73 | /* This indicates a data problem */ |
74 | WARN(1, "clock: Could not find parent clock %s in clksel array " | 74 | WARN(1, "clock: %s: could not find parent clock %s in clksel array\n", |
75 | "of clock %s\n", src_clk->name, clk->name); | 75 | clk->name, src_clk->name); |
76 | return NULL; | 76 | return NULL; |
77 | } | 77 | } |
78 | 78 | ||
@@ -126,8 +126,8 @@ static u8 _get_div_and_fieldval(struct clk *src_clk, struct clk *clk, | |||
126 | 126 | ||
127 | if (max_div == 0) { | 127 | if (max_div == 0) { |
128 | /* This indicates an error in the clksel data */ | 128 | /* This indicates an error in the clksel data */ |
129 | WARN(1, "clock: Could not find divisor for clock %s parent %s" | 129 | WARN(1, "clock: %s: could not find divisor for parent %s\n", |
130 | "\n", clk->name, src_clk->parent->name); | 130 | clk->name, src_clk->parent->name); |
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
133 | 133 | ||
@@ -191,8 +191,8 @@ static u32 _clksel_to_divisor(struct clk *clk, u32 field_val) | |||
191 | 191 | ||
192 | if (!clkr->div) { | 192 | if (!clkr->div) { |
193 | /* This indicates a data error */ | 193 | /* This indicates a data error */ |
194 | WARN(1, "clock: Could not find fieldval %d for clock %s parent " | 194 | WARN(1, "clock: %s: could not find fieldval %d parent %s\n", |
195 | "%s\n", field_val, clk->name, clk->parent->name); | 195 | clk->name, field_val, clk->parent->name); |
196 | return 0; | 196 | return 0; |
197 | } | 197 | } |
198 | 198 | ||
@@ -230,8 +230,8 @@ static u32 _divisor_to_clksel(struct clk *clk, u32 div) | |||
230 | } | 230 | } |
231 | 231 | ||
232 | if (!clkr->div) { | 232 | if (!clkr->div) { |
233 | pr_err("clock: Could not find divisor %d for clock %s parent " | 233 | pr_err("clock: %s: could not find divisor %d parent %s\n", |
234 | "%s\n", div, clk->name, clk->parent->name); | 234 | clk->name, div, clk->parent->name); |
235 | return ~0; | 235 | return ~0; |
236 | } | 236 | } |
237 | 237 | ||
@@ -300,8 +300,8 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, | |||
300 | 300 | ||
301 | /* Sanity check */ | 301 | /* Sanity check */ |
302 | if (clkr->div <= last_div) | 302 | if (clkr->div <= last_div) |
303 | pr_err("clock: clksel_rate table not sorted " | 303 | pr_err("clock: %s: clksel_rate table not sorted", |
304 | "for clock %s", clk->name); | 304 | clk->name); |
305 | 305 | ||
306 | last_div = clkr->div; | 306 | last_div = clkr->div; |
307 | 307 | ||
@@ -312,9 +312,8 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, | |||
312 | } | 312 | } |
313 | 313 | ||
314 | if (!clkr->div) { | 314 | if (!clkr->div) { |
315 | pr_err("clock: Could not find divisor for target " | 315 | pr_err("clock: %s: could not find divisor for target rate %ld parent %s\n", |
316 | "rate %ld for clock %s parent %s\n", target_rate, | 316 | clk->name, target_rate, clk->parent->name); |
317 | clk->name, clk->parent->name); | ||
318 | return ~0; | 317 | return ~0; |
319 | } | 318 | } |
320 | 319 | ||
@@ -359,8 +358,7 @@ void omap2_init_clksel_parent(struct clk *clk) | |||
359 | 358 | ||
360 | if (clkr->val == r) { | 359 | if (clkr->val == r) { |
361 | if (clk->parent != clks->parent) { | 360 | if (clk->parent != clks->parent) { |
362 | pr_debug("clock: inited %s parent " | 361 | pr_debug("clock: %s: inited parent to %s (was %s)\n", |
363 | "to %s (was %s)\n", | ||
364 | clk->name, clks->parent->name, | 362 | clk->name, clks->parent->name, |
365 | ((clk->parent) ? | 363 | ((clk->parent) ? |
366 | clk->parent->name : "NULL")); | 364 | clk->parent->name : "NULL")); |
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index cd7fd0f91149..a3b60c7b9aa8 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
@@ -22,8 +22,8 @@ | |||
22 | #include <asm/div64.h> | 22 | #include <asm/div64.h> |
23 | 23 | ||
24 | #include <plat/clock.h> | 24 | #include <plat/clock.h> |
25 | #include <plat/cpu.h> | ||
26 | 25 | ||
26 | #include "soc.h" | ||
27 | #include "clock.h" | 27 | #include "clock.h" |
28 | #include "cm-regbits-24xx.h" | 28 | #include "cm-regbits-24xx.h" |
29 | #include "cm-regbits-34xx.h" | 29 | #include "cm-regbits-34xx.h" |
@@ -105,13 +105,13 @@ static int _dpll_test_fint(struct clk *clk, u8 n) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | if (fint < fint_min) { | 107 | if (fint < fint_min) { |
108 | pr_debug("rejecting n=%d due to Fint failure, " | 108 | pr_debug("rejecting n=%d due to Fint failure, lowering max_divider\n", |
109 | "lowering max_divider\n", n); | 109 | n); |
110 | dd->max_divider = n; | 110 | dd->max_divider = n; |
111 | ret = DPLL_FINT_UNDERFLOW; | 111 | ret = DPLL_FINT_UNDERFLOW; |
112 | } else if (fint > fint_max) { | 112 | } else if (fint > fint_max) { |
113 | pr_debug("rejecting n=%d due to Fint failure, " | 113 | pr_debug("rejecting n=%d due to Fint failure, boosting min_divider\n", |
114 | "boosting min_divider\n", n); | 114 | n); |
115 | dd->min_divider = n; | 115 | dd->min_divider = n; |
116 | ret = DPLL_FINT_INVALID; | 116 | ret = DPLL_FINT_INVALID; |
117 | } else if (cpu_is_omap3430() && fint > OMAP3430_DPLL_FINT_BAND1_MAX && | 117 | } else if (cpu_is_omap3430() && fint > OMAP3430_DPLL_FINT_BAND1_MAX && |
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index ea3f565ba1a4..e97f98ffe8b2 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -22,14 +22,16 @@ | |||
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/bitops.h> | 24 | #include <linux/bitops.h> |
25 | #include <trace/events/power.h> | ||
26 | 25 | ||
27 | #include <asm/cpu.h> | 26 | #include <asm/cpu.h> |
27 | |||
28 | #include <plat/clock.h> | 28 | #include <plat/clock.h> |
29 | #include "clockdomain.h" | ||
30 | #include <plat/cpu.h> | ||
31 | #include <plat/prcm.h> | 29 | #include <plat/prcm.h> |
32 | 30 | ||
31 | #include <trace/events/power.h> | ||
32 | |||
33 | #include "soc.h" | ||
34 | #include "clockdomain.h" | ||
33 | #include "clock.h" | 35 | #include "clock.h" |
34 | #include "cm2xxx_3xxx.h" | 36 | #include "cm2xxx_3xxx.h" |
35 | #include "cm-regbits-24xx.h" | 37 | #include "cm-regbits-24xx.h" |
@@ -102,8 +104,8 @@ void omap2_init_clk_clkdm(struct clk *clk) | |||
102 | clk->name, clk->clkdm_name); | 104 | clk->name, clk->clkdm_name); |
103 | clk->clkdm = clkdm; | 105 | clk->clkdm = clkdm; |
104 | } else { | 106 | } else { |
105 | pr_debug("clock: could not associate clk %s to " | 107 | pr_debug("clock: could not associate clk %s to clkdm %s\n", |
106 | "clkdm %s\n", clk->name, clk->clkdm_name); | 108 | clk->name, clk->clkdm_name); |
107 | } | 109 | } |
108 | } | 110 | } |
109 | 111 | ||
@@ -226,8 +228,7 @@ void omap2_dflt_clk_disable(struct clk *clk) | |||
226 | * 'Independent' here refers to a clock which is not | 228 | * 'Independent' here refers to a clock which is not |
227 | * controlled by its parent. | 229 | * controlled by its parent. |
228 | */ | 230 | */ |
229 | printk(KERN_ERR "clock: clk_disable called on independent " | 231 | pr_err("clock: clk_disable called on independent clock %s which has no enable_reg\n", clk->name); |
230 | "clock %s which has no enable_reg\n", clk->name); | ||
231 | return; | 232 | return; |
232 | } | 233 | } |
233 | 234 | ||
@@ -270,8 +271,7 @@ const struct clkops clkops_omap2_dflt = { | |||
270 | void omap2_clk_disable(struct clk *clk) | 271 | void omap2_clk_disable(struct clk *clk) |
271 | { | 272 | { |
272 | if (clk->usecount == 0) { | 273 | if (clk->usecount == 0) { |
273 | WARN(1, "clock: %s: omap2_clk_disable() called, but usecount " | 274 | WARN(1, "clock: %s: omap2_clk_disable() called, but usecount already 0?", clk->name); |
274 | "already 0?", clk->name); | ||
275 | return; | 275 | return; |
276 | } | 276 | } |
277 | 277 | ||
@@ -332,8 +332,8 @@ int omap2_clk_enable(struct clk *clk) | |||
332 | if (clkdm_control && clk->clkdm) { | 332 | if (clkdm_control && clk->clkdm) { |
333 | ret = clkdm_clk_enable(clk->clkdm, clk); | 333 | ret = clkdm_clk_enable(clk->clkdm, clk); |
334 | if (ret) { | 334 | if (ret) { |
335 | WARN(1, "clock: %s: could not enable clockdomain %s: " | 335 | WARN(1, "clock: %s: could not enable clockdomain %s: %d\n", |
336 | "%d\n", clk->name, clk->clkdm->name, ret); | 336 | clk->name, clk->clkdm->name, ret); |
337 | goto oce_err2; | 337 | goto oce_err2; |
338 | } | 338 | } |
339 | } | 339 | } |
@@ -501,10 +501,8 @@ void __init omap2_clk_print_new_rates(const char *hfclkin_ck_name, | |||
501 | 501 | ||
502 | hfclkin_rate = clk_get_rate(hfclkin_ck); | 502 | hfclkin_rate = clk_get_rate(hfclkin_ck); |
503 | 503 | ||
504 | pr_info("Switched to new clocking rate (Crystal/Core/MPU): " | 504 | pr_info("Switched to new clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n", |
505 | "%ld.%01ld/%ld/%ld MHz\n", | 505 | (hfclkin_rate / 1000000), ((hfclkin_rate / 100000) % 10), |
506 | (hfclkin_rate / 1000000), | ||
507 | ((hfclkin_rate / 100000) % 10), | ||
508 | (clk_get_rate(core_ck) / 1000000), | 506 | (clk_get_rate(core_ck) / 1000000), |
509 | (clk_get_rate(mpu_ck) / 1000000)); | 507 | (clk_get_rate(mpu_ck) / 1000000)); |
510 | } | 508 | } |
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c index 002745181ad6..12c178dbc9f5 100644 --- a/arch/arm/mach-omap2/clock2420_data.c +++ b/arch/arm/mach-omap2/clock2420_data.c | |||
@@ -18,9 +18,9 @@ | |||
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
20 | 20 | ||
21 | #include <plat/hardware.h> | ||
22 | #include <plat/clkdev_omap.h> | 21 | #include <plat/clkdev_omap.h> |
23 | 22 | ||
23 | #include "soc.h" | ||
24 | #include "iomap.h" | 24 | #include "iomap.h" |
25 | #include "clock.h" | 25 | #include "clock.h" |
26 | #include "clock2xxx.h" | 26 | #include "clock2xxx.h" |
diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c index dfda9a3f2cb2..a8e326177466 100644 --- a/arch/arm/mach-omap2/clock2430.c +++ b/arch/arm/mach-omap2/clock2430.c | |||
@@ -21,9 +21,9 @@ | |||
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | 23 | ||
24 | #include <plat/hardware.h> | ||
25 | #include <plat/clock.h> | 24 | #include <plat/clock.h> |
26 | 25 | ||
26 | #include "soc.h" | ||
27 | #include "iomap.h" | 27 | #include "iomap.h" |
28 | #include "clock.h" | 28 | #include "clock.h" |
29 | #include "clock2xxx.h" | 29 | #include "clock2xxx.h" |
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index cacabb070e22..7ea91398217a 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c | |||
@@ -17,9 +17,9 @@ | |||
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/list.h> | 18 | #include <linux/list.h> |
19 | 19 | ||
20 | #include <plat/hardware.h> | ||
21 | #include <plat/clkdev_omap.h> | 20 | #include <plat/clkdev_omap.h> |
22 | 21 | ||
22 | #include "soc.h" | ||
23 | #include "iomap.h" | 23 | #include "iomap.h" |
24 | #include "clock.h" | 24 | #include "clock.h" |
25 | #include "clock2xxx.h" | 25 | #include "clock2xxx.h" |
@@ -1856,6 +1856,7 @@ static struct omap_clk omap2430_clks[] = { | |||
1856 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X), | 1856 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X), |
1857 | CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X), | 1857 | CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X), |
1858 | CLK(NULL, "osc_ck", &osc_ck, CK_243X), | 1858 | CLK(NULL, "osc_ck", &osc_ck, CK_243X), |
1859 | CLK("twl", "fck", &osc_ck, CK_243X), | ||
1859 | CLK(NULL, "sys_ck", &sys_ck, CK_243X), | 1860 | CLK(NULL, "sys_ck", &sys_ck, CK_243X), |
1860 | CLK(NULL, "alt_ck", &alt_ck, CK_243X), | 1861 | CLK(NULL, "alt_ck", &alt_ck, CK_243X), |
1861 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X), | 1862 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X), |
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c index 12500097378d..e92be1fc1a00 100644 --- a/arch/arm/mach-omap2/clock2xxx.c +++ b/arch/arm/mach-omap2/clock2xxx.c | |||
@@ -22,9 +22,9 @@ | |||
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | ||
25 | #include <plat/cpu.h> | ||
26 | #include <plat/clock.h> | 25 | #include <plat/clock.h> |
27 | 26 | ||
27 | #include "soc.h" | ||
28 | #include "clock.h" | 28 | #include "clock.h" |
29 | #include "clock2xxx.h" | 29 | #include "clock2xxx.h" |
30 | #include "cm.h" | 30 | #include "cm.h" |
diff --git a/arch/arm/mach-omap2/clock33xx_data.c b/arch/arm/mach-omap2/clock33xx_data.c index ae27de8899a6..8e06de665b14 100644 --- a/arch/arm/mach-omap2/clock33xx_data.c +++ b/arch/arm/mach-omap2/clock33xx_data.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <linux/list.h> | 18 | #include <linux/list.h> |
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <plat/clkdev_omap.h> | 20 | #include <plat/clkdev_omap.h> |
21 | #include <plat/am33xx.h> | ||
22 | 21 | ||
22 | #include "am33xx.h" | ||
23 | #include "iomap.h" | 23 | #include "iomap.h" |
24 | #include "control.h" | 24 | #include "control.h" |
25 | #include "clock.h" | 25 | #include "clock.h" |
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c index 794d82702c85..15cdc6471737 100644 --- a/arch/arm/mach-omap2/clock3xxx.c +++ b/arch/arm/mach-omap2/clock3xxx.c | |||
@@ -21,9 +21,9 @@ | |||
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | 23 | ||
24 | #include <plat/hardware.h> | ||
25 | #include <plat/clock.h> | 24 | #include <plat/clock.h> |
26 | 25 | ||
26 | #include "soc.h" | ||
27 | #include "clock.h" | 27 | #include "clock.h" |
28 | #include "clock3xxx.h" | 28 | #include "clock3xxx.h" |
29 | #include "prm2xxx_3xxx.h" | 29 | #include "prm2xxx_3xxx.h" |
@@ -49,8 +49,7 @@ int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate) | |||
49 | * on DPLL4. | 49 | * on DPLL4. |
50 | */ | 50 | */ |
51 | if (omap_rev() == OMAP3430_REV_ES1_0) { | 51 | if (omap_rev() == OMAP3430_REV_ES1_0) { |
52 | pr_err("clock: DPLL4 cannot change rate due to " | 52 | pr_err("clock: DPLL4 cannot change rate due to silicon 'Limitation 2.5' on 3430ES1.\n"); |
53 | "silicon 'Limitation 2.5' on 3430ES1.\n"); | ||
54 | return -EINVAL; | 53 | return -EINVAL; |
55 | } | 54 | } |
56 | 55 | ||
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index 83bed9ad3017..700317a1bd16 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -21,9 +21,9 @@ | |||
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | 23 | ||
24 | #include <plat/hardware.h> | ||
25 | #include <plat/clkdev_omap.h> | 24 | #include <plat/clkdev_omap.h> |
26 | 25 | ||
26 | #include "soc.h" | ||
27 | #include "iomap.h" | 27 | #include "iomap.h" |
28 | #include "clock.h" | 28 | #include "clock.h" |
29 | #include "clock3xxx.h" | 29 | #include "clock3xxx.h" |
@@ -3226,6 +3226,7 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3226 | CLK(NULL, "virt_26000000_ck", &virt_26000000_ck, CK_3XXX), | 3226 | CLK(NULL, "virt_26000000_ck", &virt_26000000_ck, CK_3XXX), |
3227 | CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX), | 3227 | CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX), |
3228 | CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_3XXX), | 3228 | CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_3XXX), |
3229 | CLK("twl", "fck", &osc_sys_ck, CK_3XXX), | ||
3229 | CLK(NULL, "sys_ck", &sys_ck, CK_3XXX), | 3230 | CLK(NULL, "sys_ck", &sys_ck, CK_3XXX), |
3230 | CLK(NULL, "sys_altclk", &sys_altclk, CK_3XXX), | 3231 | CLK(NULL, "sys_altclk", &sys_altclk, CK_3XXX), |
3231 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_3XXX), | 3232 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_3XXX), |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index d7f55e43b761..500682c051c1 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -28,9 +28,9 @@ | |||
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | 30 | ||
31 | #include <plat/hardware.h> | ||
32 | #include <plat/clkdev_omap.h> | 31 | #include <plat/clkdev_omap.h> |
33 | 32 | ||
33 | #include "soc.h" | ||
34 | #include "iomap.h" | 34 | #include "iomap.h" |
35 | #include "clock.h" | 35 | #include "clock.h" |
36 | #include "clock44xx.h" | 36 | #include "clock44xx.h" |
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 8664f5a8bfb6..a1555627ad97 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -174,9 +174,8 @@ void _clkdm_add_autodeps(struct clockdomain *clkdm) | |||
174 | if (IS_ERR(autodep->clkdm.ptr)) | 174 | if (IS_ERR(autodep->clkdm.ptr)) |
175 | continue; | 175 | continue; |
176 | 176 | ||
177 | pr_debug("clockdomain: adding %s sleepdep/wkdep for " | 177 | pr_debug("clockdomain: %s: adding %s sleepdep/wkdep\n", |
178 | "clkdm %s\n", autodep->clkdm.ptr->name, | 178 | clkdm->name, autodep->clkdm.ptr->name); |
179 | clkdm->name); | ||
180 | 179 | ||
181 | clkdm_add_sleepdep(clkdm, autodep->clkdm.ptr); | 180 | clkdm_add_sleepdep(clkdm, autodep->clkdm.ptr); |
182 | clkdm_add_wkdep(clkdm, autodep->clkdm.ptr); | 181 | clkdm_add_wkdep(clkdm, autodep->clkdm.ptr); |
@@ -205,9 +204,8 @@ void _clkdm_del_autodeps(struct clockdomain *clkdm) | |||
205 | if (IS_ERR(autodep->clkdm.ptr)) | 204 | if (IS_ERR(autodep->clkdm.ptr)) |
206 | continue; | 205 | continue; |
207 | 206 | ||
208 | pr_debug("clockdomain: removing %s sleepdep/wkdep for " | 207 | pr_debug("clockdomain: %s: removing %s sleepdep/wkdep\n", |
209 | "clkdm %s\n", autodep->clkdm.ptr->name, | 208 | clkdm->name, autodep->clkdm.ptr->name); |
210 | clkdm->name); | ||
211 | 209 | ||
212 | clkdm_del_sleepdep(clkdm, autodep->clkdm.ptr); | 210 | clkdm_del_sleepdep(clkdm, autodep->clkdm.ptr); |
213 | clkdm_del_wkdep(clkdm, autodep->clkdm.ptr); | 211 | clkdm_del_wkdep(clkdm, autodep->clkdm.ptr); |
@@ -469,14 +467,14 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
469 | ret = -EINVAL; | 467 | ret = -EINVAL; |
470 | 468 | ||
471 | if (ret) { | 469 | if (ret) { |
472 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | 470 | pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n", |
473 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | 471 | clkdm1->name, clkdm2->name); |
474 | return ret; | 472 | return ret; |
475 | } | 473 | } |
476 | 474 | ||
477 | if (atomic_inc_return(&cd->wkdep_usecount) == 1) { | 475 | if (atomic_inc_return(&cd->wkdep_usecount) == 1) { |
478 | pr_debug("clockdomain: hardware will wake up %s when %s wakes " | 476 | pr_debug("clockdomain: hardware will wake up %s when %s wakes up\n", |
479 | "up\n", clkdm1->name, clkdm2->name); | 477 | clkdm1->name, clkdm2->name); |
480 | 478 | ||
481 | ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2); | 479 | ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2); |
482 | } | 480 | } |
@@ -510,14 +508,14 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
510 | ret = -EINVAL; | 508 | ret = -EINVAL; |
511 | 509 | ||
512 | if (ret) { | 510 | if (ret) { |
513 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | 511 | pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n", |
514 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | 512 | clkdm1->name, clkdm2->name); |
515 | return ret; | 513 | return ret; |
516 | } | 514 | } |
517 | 515 | ||
518 | if (atomic_dec_return(&cd->wkdep_usecount) == 0) { | 516 | if (atomic_dec_return(&cd->wkdep_usecount) == 0) { |
519 | pr_debug("clockdomain: hardware will no longer wake up %s " | 517 | pr_debug("clockdomain: hardware will no longer wake up %s after %s wakes up\n", |
520 | "after %s wakes up\n", clkdm1->name, clkdm2->name); | 518 | clkdm1->name, clkdm2->name); |
521 | 519 | ||
522 | ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2); | 520 | ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2); |
523 | } | 521 | } |
@@ -555,8 +553,8 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
555 | ret = -EINVAL; | 553 | ret = -EINVAL; |
556 | 554 | ||
557 | if (ret) { | 555 | if (ret) { |
558 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | 556 | pr_debug("clockdomain: hardware cannot set/clear wake up of %s when %s wakes up\n", |
559 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | 557 | clkdm1->name, clkdm2->name); |
560 | return ret; | 558 | return ret; |
561 | } | 559 | } |
562 | 560 | ||
@@ -613,15 +611,14 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
613 | ret = -EINVAL; | 611 | ret = -EINVAL; |
614 | 612 | ||
615 | if (ret) { | 613 | if (ret) { |
616 | pr_debug("clockdomain: hardware cannot set/clear sleep " | 614 | pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n", |
617 | "dependency affecting %s from %s\n", clkdm1->name, | 615 | clkdm1->name, clkdm2->name); |
618 | clkdm2->name); | ||
619 | return ret; | 616 | return ret; |
620 | } | 617 | } |
621 | 618 | ||
622 | if (atomic_inc_return(&cd->sleepdep_usecount) == 1) { | 619 | if (atomic_inc_return(&cd->sleepdep_usecount) == 1) { |
623 | pr_debug("clockdomain: will prevent %s from sleeping if %s " | 620 | pr_debug("clockdomain: will prevent %s from sleeping if %s is active\n", |
624 | "is active\n", clkdm1->name, clkdm2->name); | 621 | clkdm1->name, clkdm2->name); |
625 | 622 | ||
626 | ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2); | 623 | ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2); |
627 | } | 624 | } |
@@ -657,16 +654,14 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
657 | ret = -EINVAL; | 654 | ret = -EINVAL; |
658 | 655 | ||
659 | if (ret) { | 656 | if (ret) { |
660 | pr_debug("clockdomain: hardware cannot set/clear sleep " | 657 | pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n", |
661 | "dependency affecting %s from %s\n", clkdm1->name, | 658 | clkdm1->name, clkdm2->name); |
662 | clkdm2->name); | ||
663 | return ret; | 659 | return ret; |
664 | } | 660 | } |
665 | 661 | ||
666 | if (atomic_dec_return(&cd->sleepdep_usecount) == 0) { | 662 | if (atomic_dec_return(&cd->sleepdep_usecount) == 0) { |
667 | pr_debug("clockdomain: will no longer prevent %s from " | 663 | pr_debug("clockdomain: will no longer prevent %s from sleeping if %s is active\n", |
668 | "sleeping if %s is active\n", clkdm1->name, | 664 | clkdm1->name, clkdm2->name); |
669 | clkdm2->name); | ||
670 | 665 | ||
671 | ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2); | 666 | ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2); |
672 | } | 667 | } |
@@ -706,9 +701,8 @@ int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | |||
706 | ret = -EINVAL; | 701 | ret = -EINVAL; |
707 | 702 | ||
708 | if (ret) { | 703 | if (ret) { |
709 | pr_debug("clockdomain: hardware cannot set/clear sleep " | 704 | pr_debug("clockdomain: hardware cannot set/clear sleep dependency affecting %s from %s\n", |
710 | "dependency affecting %s from %s\n", clkdm1->name, | 705 | clkdm1->name, clkdm2->name); |
711 | clkdm2->name); | ||
712 | return ret; | 706 | return ret; |
713 | } | 707 | } |
714 | 708 | ||
@@ -755,8 +749,8 @@ int clkdm_sleep(struct clockdomain *clkdm) | |||
755 | return -EINVAL; | 749 | return -EINVAL; |
756 | 750 | ||
757 | if (!(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) { | 751 | if (!(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) { |
758 | pr_debug("clockdomain: %s does not support forcing " | 752 | pr_debug("clockdomain: %s does not support forcing sleep via software\n", |
759 | "sleep via software\n", clkdm->name); | 753 | clkdm->name); |
760 | return -EINVAL; | 754 | return -EINVAL; |
761 | } | 755 | } |
762 | 756 | ||
@@ -790,8 +784,8 @@ int clkdm_wakeup(struct clockdomain *clkdm) | |||
790 | return -EINVAL; | 784 | return -EINVAL; |
791 | 785 | ||
792 | if (!(clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) { | 786 | if (!(clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) { |
793 | pr_debug("clockdomain: %s does not support forcing " | 787 | pr_debug("clockdomain: %s does not support forcing wakeup via software\n", |
794 | "wakeup via software\n", clkdm->name); | 788 | clkdm->name); |
795 | return -EINVAL; | 789 | return -EINVAL; |
796 | } | 790 | } |
797 | 791 | ||
@@ -826,8 +820,8 @@ void clkdm_allow_idle(struct clockdomain *clkdm) | |||
826 | return; | 820 | return; |
827 | 821 | ||
828 | if (!(clkdm->flags & CLKDM_CAN_ENABLE_AUTO)) { | 822 | if (!(clkdm->flags & CLKDM_CAN_ENABLE_AUTO)) { |
829 | pr_debug("clock: automatic idle transitions cannot be enabled " | 823 | pr_debug("clock: %s: automatic idle transitions cannot be enabled\n", |
830 | "on clockdomain %s\n", clkdm->name); | 824 | clkdm->name); |
831 | return; | 825 | return; |
832 | } | 826 | } |
833 | 827 | ||
@@ -861,8 +855,8 @@ void clkdm_deny_idle(struct clockdomain *clkdm) | |||
861 | return; | 855 | return; |
862 | 856 | ||
863 | if (!(clkdm->flags & CLKDM_CAN_DISABLE_AUTO)) { | 857 | if (!(clkdm->flags & CLKDM_CAN_DISABLE_AUTO)) { |
864 | pr_debug("clockdomain: automatic idle transitions cannot be " | 858 | pr_debug("clockdomain: %s: automatic idle transitions cannot be disabled\n", |
865 | "disabled on %s\n", clkdm->name); | 859 | clkdm->name); |
866 | return; | 860 | return; |
867 | } | 861 | } |
868 | 862 | ||
@@ -927,7 +921,7 @@ static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm) | |||
927 | pwrdm_state_switch(clkdm->pwrdm.ptr); | 921 | pwrdm_state_switch(clkdm->pwrdm.ptr); |
928 | spin_unlock_irqrestore(&clkdm->lock, flags); | 922 | spin_unlock_irqrestore(&clkdm->lock, flags); |
929 | 923 | ||
930 | pr_debug("clockdomain: clkdm %s: enabled\n", clkdm->name); | 924 | pr_debug("clockdomain: %s: enabled\n", clkdm->name); |
931 | 925 | ||
932 | return 0; | 926 | return 0; |
933 | } | 927 | } |
@@ -952,7 +946,7 @@ static int _clkdm_clk_hwmod_disable(struct clockdomain *clkdm) | |||
952 | pwrdm_state_switch(clkdm->pwrdm.ptr); | 946 | pwrdm_state_switch(clkdm->pwrdm.ptr); |
953 | spin_unlock_irqrestore(&clkdm->lock, flags); | 947 | spin_unlock_irqrestore(&clkdm->lock, flags); |
954 | 948 | ||
955 | pr_debug("clockdomain: clkdm %s: disabled\n", clkdm->name); | 949 | pr_debug("clockdomain: %s: disabled\n", clkdm->name); |
956 | 950 | ||
957 | return 0; | 951 | return 0; |
958 | } | 952 | } |
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c index 389f9f8b570c..a911e76b4ecf 100644 --- a/arch/arm/mach-omap2/cm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c | |||
@@ -18,8 +18,7 @@ | |||
18 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | 20 | ||
21 | #include <plat/hardware.h> | 21 | #include "soc.h" |
22 | |||
23 | #include "iomap.h" | 22 | #include "iomap.h" |
24 | #include "common.h" | 23 | #include "common.h" |
25 | #include "cm.h" | 24 | #include "cm.h" |
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c index c1875862679f..48daac2581b4 100644 --- a/arch/arm/mach-omap2/common-board-devices.c +++ b/arch/arm/mach-omap2/common-board-devices.c | |||
@@ -24,9 +24,10 @@ | |||
24 | #include <linux/spi/spi.h> | 24 | #include <linux/spi/spi.h> |
25 | #include <linux/spi/ads7846.h> | 25 | #include <linux/spi/ads7846.h> |
26 | 26 | ||
27 | #include <plat/mcspi.h> | 27 | #include <linux/platform_data/spi-omap2-mcspi.h> |
28 | #include <plat/nand.h> | 28 | #include <linux/platform_data/mtd-nand-omap2.h> |
29 | 29 | ||
30 | #include "common.h" | ||
30 | #include "common-board-devices.h" | 31 | #include "common-board-devices.h" |
31 | 32 | ||
32 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | 33 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ |
@@ -119,8 +120,7 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts, | |||
119 | } | 120 | } |
120 | 121 | ||
121 | if (nandcs > GPMC_CS_NUM) { | 122 | if (nandcs > GPMC_CS_NUM) { |
122 | printk(KERN_INFO "NAND: Unable to find configuration " | 123 | pr_info("NAND: Unable to find configuration in GPMC\n"); |
123 | "in GPMC\n "); | ||
124 | return; | 124 | return; |
125 | } | 125 | } |
126 | 126 | ||
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c index 069f9725b1c3..17950c6e130b 100644 --- a/arch/arm/mach-omap2/common.c +++ b/arch/arm/mach-omap2/common.c | |||
@@ -17,11 +17,9 @@ | |||
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | 19 | ||
20 | #include <plat/hardware.h> | ||
21 | #include <plat/board.h> | ||
22 | #include <plat/mux.h> | ||
23 | #include <plat/clock.h> | 20 | #include <plat/clock.h> |
24 | 21 | ||
22 | #include "soc.h" | ||
25 | #include "iomap.h" | 23 | #include "iomap.h" |
26 | #include "common.h" | 24 | #include "common.h" |
27 | #include "sdrc.h" | 25 | #include "sdrc.h" |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 1f65b1871c23..da0f5c187353 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -26,11 +26,18 @@ | |||
26 | #define __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H | 26 | #define __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H |
27 | #ifndef __ASSEMBLER__ | 27 | #ifndef __ASSEMBLER__ |
28 | 28 | ||
29 | #include <linux/irq.h> | ||
29 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
30 | #include <linux/i2c/twl.h> | 31 | #include <linux/i2c/twl.h> |
31 | #include <plat/common.h> | 32 | |
32 | #include <asm/proc-fns.h> | 33 | #include <asm/proc-fns.h> |
33 | 34 | ||
35 | #include <plat/cpu.h> | ||
36 | #include <plat/serial.h> | ||
37 | #include <plat/common.h> | ||
38 | |||
39 | #define OMAP_INTC_START NR_IRQS | ||
40 | |||
34 | #ifdef CONFIG_SOC_OMAP2420 | 41 | #ifdef CONFIG_SOC_OMAP2420 |
35 | extern void omap242x_map_common_io(void); | 42 | extern void omap242x_map_common_io(void); |
36 | #else | 43 | #else |
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index 3223b81e7532..d1ff8399a222 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c | |||
@@ -15,9 +15,9 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | 17 | ||
18 | #include <plat/hardware.h> | ||
19 | #include <plat/sdrc.h> | 18 | #include <plat/sdrc.h> |
20 | 19 | ||
20 | #include "soc.h" | ||
21 | #include "iomap.h" | 21 | #include "iomap.h" |
22 | #include "common.h" | 22 | #include "common.h" |
23 | #include "cm-regbits-34xx.h" | 23 | #include "cm-regbits-34xx.h" |
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index b8cdc8531b60..123186ac7d2e 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h | |||
@@ -16,12 +16,12 @@ | |||
16 | #ifndef __ARCH_ARM_MACH_OMAP2_CONTROL_H | 16 | #ifndef __ARCH_ARM_MACH_OMAP2_CONTROL_H |
17 | #define __ARCH_ARM_MACH_OMAP2_CONTROL_H | 17 | #define __ARCH_ARM_MACH_OMAP2_CONTROL_H |
18 | 18 | ||
19 | #include <mach/ctrl_module_core_44xx.h> | 19 | #include "ctrl_module_core_44xx.h" |
20 | #include <mach/ctrl_module_wkup_44xx.h> | 20 | #include "ctrl_module_wkup_44xx.h" |
21 | #include <mach/ctrl_module_pad_core_44xx.h> | 21 | #include "ctrl_module_pad_core_44xx.h" |
22 | #include <mach/ctrl_module_pad_wkup_44xx.h> | 22 | #include "ctrl_module_pad_wkup_44xx.h" |
23 | 23 | ||
24 | #include <plat/am33xx.h> | 24 | #include "am33xx.h" |
25 | 25 | ||
26 | #ifndef __ASSEMBLY__ | 26 | #ifndef __ASSEMBLY__ |
27 | #define OMAP242X_CTRL_REGADDR(reg) \ | 27 | #define OMAP242X_CTRL_REGADDR(reg) \ |
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index f2a49a48ef59..bc2756959be5 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/cpu_pm.h> | 28 | #include <linux/cpu_pm.h> |
29 | 29 | ||
30 | #include <plat/prcm.h> | 30 | #include <plat/prcm.h> |
31 | #include <plat/irqs.h> | ||
32 | #include "powerdomain.h" | 31 | #include "powerdomain.h" |
33 | #include "clockdomain.h" | 32 | #include "clockdomain.h" |
34 | 33 | ||
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h b/arch/arm/mach-omap2/ctrl_module_core_44xx.h index 01970824e0e5..01970824e0e5 100644 --- a/arch/arm/mach-omap2/include/mach/ctrl_module_core_44xx.h +++ b/arch/arm/mach-omap2/ctrl_module_core_44xx.h | |||
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h b/arch/arm/mach-omap2/ctrl_module_pad_core_44xx.h index c88420de1151..c88420de1151 100644 --- a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h +++ b/arch/arm/mach-omap2/ctrl_module_pad_core_44xx.h | |||
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_wkup_44xx.h b/arch/arm/mach-omap2/ctrl_module_pad_wkup_44xx.h index 17c9b37042c0..17c9b37042c0 100644 --- a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_wkup_44xx.h +++ b/arch/arm/mach-omap2/ctrl_module_pad_wkup_44xx.h | |||
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h b/arch/arm/mach-omap2/ctrl_module_wkup_44xx.h index a0af9baec3f7..a0af9baec3f7 100644 --- a/arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h +++ b/arch/arm/mach-omap2/ctrl_module_wkup_44xx.h | |||
diff --git a/arch/arm/mach-omap2/debug-devices.h b/arch/arm/mach-omap2/debug-devices.h new file mode 100644 index 000000000000..a4edbd2f7484 --- /dev/null +++ b/arch/arm/mach-omap2/debug-devices.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _OMAP_DEBUG_DEVICES_H | ||
2 | #define _OMAP_DEBUG_DEVICES_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* for TI reference platforms sharing the same debug card */ | ||
7 | extern int debug_card_init(u32 addr, unsigned gpio); | ||
8 | |||
9 | #endif | ||
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index c00c68961bb8..d092d2a89ee0 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -17,21 +17,20 @@ | |||
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/of.h> | 19 | #include <linux/of.h> |
20 | #include <linux/pinctrl/machine.h> | ||
20 | #include <linux/platform_data/omap4-keypad.h> | 21 | #include <linux/platform_data/omap4-keypad.h> |
21 | 22 | ||
22 | #include <mach/hardware.h> | ||
23 | #include <mach/irqs.h> | ||
24 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
25 | #include <asm/mach/map.h> | 24 | #include <asm/mach/map.h> |
26 | #include <asm/pmu.h> | ||
27 | 25 | ||
28 | #include "iomap.h" | 26 | #include "iomap.h" |
29 | #include <plat/board.h> | ||
30 | #include <plat/dma.h> | 27 | #include <plat/dma.h> |
31 | #include <plat/omap_hwmod.h> | 28 | #include <plat/omap_hwmod.h> |
32 | #include <plat/omap_device.h> | 29 | #include <plat/omap_device.h> |
33 | #include <plat/omap4-keypad.h> | 30 | #include "omap4-keypad.h" |
34 | 31 | ||
32 | #include "soc.h" | ||
33 | #include "common.h" | ||
35 | #include "mux.h" | 34 | #include "mux.h" |
36 | #include "control.h" | 35 | #include "control.h" |
37 | #include "devices.h" | 36 | #include "devices.h" |
@@ -112,7 +111,7 @@ static struct resource omap2cam_resources[] = { | |||
112 | .flags = IORESOURCE_MEM, | 111 | .flags = IORESOURCE_MEM, |
113 | }, | 112 | }, |
114 | { | 113 | { |
115 | .start = INT_24XX_CAM_IRQ, | 114 | .start = 24 + OMAP_INTC_START, |
116 | .flags = IORESOURCE_IRQ, | 115 | .flags = IORESOURCE_IRQ, |
117 | } | 116 | } |
118 | }; | 117 | }; |
@@ -201,7 +200,7 @@ static struct resource omap3isp_resources[] = { | |||
201 | .flags = IORESOURCE_MEM, | 200 | .flags = IORESOURCE_MEM, |
202 | }, | 201 | }, |
203 | { | 202 | { |
204 | .start = INT_34XX_CAM_IRQ, | 203 | .start = 24 + OMAP_INTC_START, |
205 | .flags = IORESOURCE_IRQ, | 204 | .flags = IORESOURCE_IRQ, |
206 | } | 205 | } |
207 | }; | 206 | }; |
@@ -385,7 +384,7 @@ static inline void omap_init_hdmi_audio(void) {} | |||
385 | 384 | ||
386 | #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) | 385 | #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) |
387 | 386 | ||
388 | #include <plat/mcspi.h> | 387 | #include <linux/platform_data/spi-omap2-mcspi.h> |
389 | 388 | ||
390 | static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused) | 389 | static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused) |
391 | { | 390 | { |
@@ -435,20 +434,18 @@ static inline void omap_init_mcspi(void) {} | |||
435 | #endif | 434 | #endif |
436 | 435 | ||
437 | static struct resource omap2_pmu_resource = { | 436 | static struct resource omap2_pmu_resource = { |
438 | .start = 3, | 437 | .start = 3 + OMAP_INTC_START, |
439 | .end = 3, | ||
440 | .flags = IORESOURCE_IRQ, | 438 | .flags = IORESOURCE_IRQ, |
441 | }; | 439 | }; |
442 | 440 | ||
443 | static struct resource omap3_pmu_resource = { | 441 | static struct resource omap3_pmu_resource = { |
444 | .start = INT_34XX_BENCH_MPU_EMUL, | 442 | .start = 3 + OMAP_INTC_START, |
445 | .end = INT_34XX_BENCH_MPU_EMUL, | ||
446 | .flags = IORESOURCE_IRQ, | 443 | .flags = IORESOURCE_IRQ, |
447 | }; | 444 | }; |
448 | 445 | ||
449 | static struct platform_device omap_pmu_device = { | 446 | static struct platform_device omap_pmu_device = { |
450 | .name = "arm-pmu", | 447 | .name = "arm-pmu", |
451 | .id = ARM_PMU_DEVICE_CPU, | 448 | .id = -1, |
452 | .num_resources = 1, | 449 | .num_resources = 1, |
453 | }; | 450 | }; |
454 | 451 | ||
@@ -475,7 +472,7 @@ static struct resource omap2_sham_resources[] = { | |||
475 | .flags = IORESOURCE_MEM, | 472 | .flags = IORESOURCE_MEM, |
476 | }, | 473 | }, |
477 | { | 474 | { |
478 | .start = INT_24XX_SHA1MD5, | 475 | .start = 51 + OMAP_INTC_START, |
479 | .flags = IORESOURCE_IRQ, | 476 | .flags = IORESOURCE_IRQ, |
480 | } | 477 | } |
481 | }; | 478 | }; |
@@ -493,7 +490,7 @@ static struct resource omap3_sham_resources[] = { | |||
493 | .flags = IORESOURCE_MEM, | 490 | .flags = IORESOURCE_MEM, |
494 | }, | 491 | }, |
495 | { | 492 | { |
496 | .start = INT_34XX_SHA1MD52_IRQ, | 493 | .start = 49 + OMAP_INTC_START, |
497 | .flags = IORESOURCE_IRQ, | 494 | .flags = IORESOURCE_IRQ, |
498 | }, | 495 | }, |
499 | { | 496 | { |
@@ -631,6 +628,10 @@ static inline void omap_init_vout(void) {} | |||
631 | 628 | ||
632 | static int __init omap2_init_devices(void) | 629 | static int __init omap2_init_devices(void) |
633 | { | 630 | { |
631 | /* Enable dummy states for those platforms without pinctrl support */ | ||
632 | if (!of_have_populated_dt()) | ||
633 | pinctrl_provide_dummies(); | ||
634 | |||
634 | /* | 635 | /* |
635 | * please keep these calls, and their implementations above, | 636 | * please keep these calls, and their implementations above, |
636 | * in alphabetical order so they're easier to sort through. | 637 | * in alphabetical order so they're easier to sort through. |
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index b9c8d2f6a81f..ef666455c13a 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -28,9 +28,9 @@ | |||
28 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
29 | #include <linux/clkdev.h> | 29 | #include <linux/clkdev.h> |
30 | 30 | ||
31 | #include <plat/cpu.h> | ||
32 | #include <plat/clock.h> | 31 | #include <plat/clock.h> |
33 | 32 | ||
33 | #include "soc.h" | ||
34 | #include "clock.h" | 34 | #include "clock.h" |
35 | #include "cm2xxx_3xxx.h" | 35 | #include "cm2xxx_3xxx.h" |
36 | #include "cm-regbits-34xx.h" | 36 | #include "cm-regbits-34xx.h" |
@@ -623,8 +623,11 @@ unsigned long omap3_clkoutx2_recalc(struct clk *clk) | |||
623 | while (pclk && !pclk->dpll_data) | 623 | while (pclk && !pclk->dpll_data) |
624 | pclk = pclk->parent; | 624 | pclk = pclk->parent; |
625 | 625 | ||
626 | /* clk does not have a DPLL as a parent? */ | 626 | /* clk does not have a DPLL as a parent? error in the clock data */ |
627 | WARN_ON(!pclk); | 627 | if (!pclk) { |
628 | WARN_ON(1); | ||
629 | return 0; | ||
630 | } | ||
628 | 631 | ||
629 | dd = pclk->dpll_data; | 632 | dd = pclk->dpll_data; |
630 | 633 | ||
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c index 9c6a296b3dc3..09d0ccccb861 100644 --- a/arch/arm/mach-omap2/dpll44xx.c +++ b/arch/arm/mach-omap2/dpll44xx.c | |||
@@ -15,9 +15,9 @@ | |||
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/bitops.h> | 16 | #include <linux/bitops.h> |
17 | 17 | ||
18 | #include <plat/cpu.h> | ||
19 | #include <plat/clock.h> | 18 | #include <plat/clock.h> |
20 | 19 | ||
20 | #include "soc.h" | ||
21 | #include "clock.h" | 21 | #include "clock.h" |
22 | #include "clock44xx.h" | 22 | #include "clock44xx.h" |
23 | #include "cm-regbits-44xx.h" | 23 | #include "cm-regbits-44xx.h" |
diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c index a636ebc16b39..98388109f22a 100644 --- a/arch/arm/mach-omap2/dsp.c +++ b/arch/arm/mach-omap2/dsp.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <plat/omap-pm.h> | 30 | #include <plat/omap-pm.h> |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #include <plat/dsp.h> | 33 | #include <linux/platform_data/dsp-omap.h> |
34 | 34 | ||
35 | static struct platform_device *omap_dsp_pdev; | 35 | static struct platform_device *omap_dsp_pdev; |
36 | 36 | ||
diff --git a/arch/arm/mach-omap2/emu.c b/arch/arm/mach-omap2/emu.c index e28e761b7ab9..b3566f68a559 100644 --- a/arch/arm/mach-omap2/emu.c +++ b/arch/arm/mach-omap2/emu.c | |||
@@ -21,8 +21,7 @@ | |||
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/err.h> | 22 | #include <linux/err.h> |
23 | 23 | ||
24 | #include <mach/hardware.h> | 24 | #include "soc.h" |
25 | |||
26 | #include "iomap.h" | 25 | #include "iomap.h" |
27 | 26 | ||
28 | MODULE_LICENSE("GPL"); | 27 | MODULE_LICENSE("GPL"); |
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c index fe626e903dea..d1058f16fb40 100644 --- a/arch/arm/mach-omap2/gpio.c +++ b/arch/arm/mach-omap2/gpio.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | #include <linux/of.h> | 23 | #include <linux/of.h> |
24 | #include <linux/platform_data/gpio-omap.h> | ||
24 | 25 | ||
25 | #include <plat/omap_hwmod.h> | 26 | #include <plat/omap_hwmod.h> |
26 | #include <plat/omap_device.h> | 27 | #include <plat/omap_device.h> |
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 386dec8d2351..4acf497faeb3 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c | |||
@@ -13,23 +13,31 @@ | |||
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/mtd/nand.h> | 15 | #include <linux/mtd/nand.h> |
16 | #include <linux/platform_data/mtd-nand-omap2.h> | ||
16 | 17 | ||
17 | #include <asm/mach/flash.h> | 18 | #include <asm/mach/flash.h> |
18 | 19 | ||
19 | #include <plat/cpu.h> | ||
20 | #include <plat/nand.h> | ||
21 | #include <plat/board.h> | ||
22 | #include <plat/gpmc.h> | 20 | #include <plat/gpmc.h> |
23 | 21 | ||
24 | static struct resource gpmc_nand_resource = { | 22 | #include "soc.h" |
25 | .flags = IORESOURCE_MEM, | 23 | |
24 | static struct resource gpmc_nand_resource[] = { | ||
25 | { | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | { | ||
29 | .flags = IORESOURCE_IRQ, | ||
30 | }, | ||
31 | { | ||
32 | .flags = IORESOURCE_IRQ, | ||
33 | }, | ||
26 | }; | 34 | }; |
27 | 35 | ||
28 | static struct platform_device gpmc_nand_device = { | 36 | static struct platform_device gpmc_nand_device = { |
29 | .name = "omap2-nand", | 37 | .name = "omap2-nand", |
30 | .id = 0, | 38 | .id = 0, |
31 | .num_resources = 1, | 39 | .num_resources = ARRAY_SIZE(gpmc_nand_resource), |
32 | .resource = &gpmc_nand_resource, | 40 | .resource = gpmc_nand_resource, |
33 | }; | 41 | }; |
34 | 42 | ||
35 | static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data) | 43 | static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data) |
@@ -75,6 +83,7 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data | |||
75 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0); | 83 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0); |
76 | gpmc_cs_configure(gpmc_nand_data->cs, | 84 | gpmc_cs_configure(gpmc_nand_data->cs, |
77 | GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); | 85 | GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); |
86 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0); | ||
78 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); | 87 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); |
79 | if (err) | 88 | if (err) |
80 | return err; | 89 | return err; |
@@ -90,12 +99,19 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data) | |||
90 | gpmc_nand_device.dev.platform_data = gpmc_nand_data; | 99 | gpmc_nand_device.dev.platform_data = gpmc_nand_data; |
91 | 100 | ||
92 | err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, | 101 | err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, |
93 | &gpmc_nand_data->phys_base); | 102 | (unsigned long *)&gpmc_nand_resource[0].start); |
94 | if (err < 0) { | 103 | if (err < 0) { |
95 | dev_err(dev, "Cannot request GPMC CS\n"); | 104 | dev_err(dev, "Cannot request GPMC CS\n"); |
96 | return err; | 105 | return err; |
97 | } | 106 | } |
98 | 107 | ||
108 | gpmc_nand_resource[0].end = gpmc_nand_resource[0].start + | ||
109 | NAND_IO_SIZE - 1; | ||
110 | |||
111 | gpmc_nand_resource[1].start = | ||
112 | gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE); | ||
113 | gpmc_nand_resource[2].start = | ||
114 | gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT); | ||
99 | /* Set timings in GPMC */ | 115 | /* Set timings in GPMC */ |
100 | err = omap2_nand_gpmc_retime(gpmc_nand_data); | 116 | err = omap2_nand_gpmc_retime(gpmc_nand_data); |
101 | if (err < 0) { | 117 | if (err < 0) { |
@@ -108,6 +124,8 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data) | |||
108 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1); | 124 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1); |
109 | } | 125 | } |
110 | 126 | ||
127 | gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs); | ||
128 | |||
111 | err = platform_device_register(&gpmc_nand_device); | 129 | err = platform_device_register(&gpmc_nand_device); |
112 | if (err < 0) { | 130 | if (err < 0) { |
113 | dev_err(dev, "Unable to register NAND device\n"); | 131 | dev_err(dev, "Unable to register NAND device\n"); |
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c index a0fa9bb2bda5..916716e1da3b 100644 --- a/arch/arm/mach-omap2/gpmc-onenand.c +++ b/arch/arm/mach-omap2/gpmc-onenand.c | |||
@@ -15,19 +15,27 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/mtd/onenand_regs.h> | 16 | #include <linux/mtd/onenand_regs.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/platform_data/mtd-onenand-omap2.h> | ||
18 | 19 | ||
19 | #include <asm/mach/flash.h> | 20 | #include <asm/mach/flash.h> |
20 | 21 | ||
21 | #include <plat/cpu.h> | ||
22 | #include <plat/onenand.h> | ||
23 | #include <plat/board.h> | ||
24 | #include <plat/gpmc.h> | 22 | #include <plat/gpmc.h> |
25 | 23 | ||
24 | #include "soc.h" | ||
25 | |||
26 | #define ONENAND_IO_SIZE SZ_128K | ||
27 | |||
26 | static struct omap_onenand_platform_data *gpmc_onenand_data; | 28 | static struct omap_onenand_platform_data *gpmc_onenand_data; |
27 | 29 | ||
30 | static struct resource gpmc_onenand_resource = { | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }; | ||
33 | |||
28 | static struct platform_device gpmc_onenand_device = { | 34 | static struct platform_device gpmc_onenand_device = { |
29 | .name = "omap2-onenand", | 35 | .name = "omap2-onenand", |
30 | .id = -1, | 36 | .id = -1, |
37 | .num_resources = 1, | ||
38 | .resource = &gpmc_onenand_resource, | ||
31 | }; | 39 | }; |
32 | 40 | ||
33 | static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) | 41 | static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) |
@@ -390,6 +398,8 @@ static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr) | |||
390 | 398 | ||
391 | void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) | 399 | void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) |
392 | { | 400 | { |
401 | int err; | ||
402 | |||
393 | gpmc_onenand_data = _onenand_data; | 403 | gpmc_onenand_data = _onenand_data; |
394 | gpmc_onenand_data->onenand_setup = gpmc_onenand_setup; | 404 | gpmc_onenand_data->onenand_setup = gpmc_onenand_setup; |
395 | gpmc_onenand_device.dev.platform_data = gpmc_onenand_data; | 405 | gpmc_onenand_device.dev.platform_data = gpmc_onenand_data; |
@@ -401,8 +411,19 @@ void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) | |||
401 | gpmc_onenand_data->flags |= ONENAND_SYNC_READ; | 411 | gpmc_onenand_data->flags |= ONENAND_SYNC_READ; |
402 | } | 412 | } |
403 | 413 | ||
414 | err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE, | ||
415 | (unsigned long *)&gpmc_onenand_resource.start); | ||
416 | if (err < 0) { | ||
417 | pr_err("%s: Cannot request GPMC CS\n", __func__); | ||
418 | return; | ||
419 | } | ||
420 | |||
421 | gpmc_onenand_resource.end = gpmc_onenand_resource.start + | ||
422 | ONENAND_IO_SIZE - 1; | ||
423 | |||
404 | if (platform_device_register(&gpmc_onenand_device) < 0) { | 424 | if (platform_device_register(&gpmc_onenand_device) < 0) { |
405 | printk(KERN_ERR "Unable to register OneNAND device\n"); | 425 | pr_err("%s: Unable to register OneNAND device\n", __func__); |
426 | gpmc_cs_free(gpmc_onenand_data->cs); | ||
406 | return; | 427 | return; |
407 | } | 428 | } |
408 | } | 429 | } |
diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c index ba10c24f3d8d..565475310374 100644 --- a/arch/arm/mach-omap2/gpmc-smc91x.c +++ b/arch/arm/mach-omap2/gpmc-smc91x.c | |||
@@ -17,9 +17,10 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/smc91x.h> | 18 | #include <linux/smc91x.h> |
19 | 19 | ||
20 | #include <plat/board.h> | ||
21 | #include <plat/gpmc.h> | 20 | #include <plat/gpmc.h> |
22 | #include <plat/gpmc-smc91x.h> | 21 | #include "gpmc-smc91x.h" |
22 | |||
23 | #include "soc.h" | ||
23 | 24 | ||
24 | static struct omap_smc91x_platform_data *gpmc_cfg; | 25 | static struct omap_smc91x_platform_data *gpmc_cfg; |
25 | 26 | ||
diff --git a/arch/arm/plat-omap/include/plat/gpmc-smc91x.h b/arch/arm/mach-omap2/gpmc-smc91x.h index b64fbee4d567..b64fbee4d567 100644 --- a/arch/arm/plat-omap/include/plat/gpmc-smc91x.h +++ b/arch/arm/mach-omap2/gpmc-smc91x.h | |||
diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c index b6c77be3e8f7..249a0b440cd6 100644 --- a/arch/arm/mach-omap2/gpmc-smsc911x.c +++ b/arch/arm/mach-omap2/gpmc-smsc911x.c | |||
@@ -20,9 +20,8 @@ | |||
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/smsc911x.h> | 21 | #include <linux/smsc911x.h> |
22 | 22 | ||
23 | #include <plat/board.h> | ||
24 | #include <plat/gpmc.h> | 23 | #include <plat/gpmc.h> |
25 | #include <plat/gpmc-smsc911x.h> | 24 | #include "gpmc-smsc911x.h" |
26 | 25 | ||
27 | static struct resource gpmc_smsc911x_resources[] = { | 26 | static struct resource gpmc_smsc911x_resources[] = { |
28 | [0] = { | 27 | [0] = { |
diff --git a/arch/arm/plat-omap/include/plat/gpmc-smsc911x.h b/arch/arm/mach-omap2/gpmc-smsc911x.h index ea6c9c88c725..ea6c9c88c725 100644 --- a/arch/arm/plat-omap/include/plat/gpmc-smsc911x.h +++ b/arch/arm/mach-omap2/gpmc-smsc911x.h | |||
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index b2b5759ab0fe..72428bd45efc 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -28,8 +28,13 @@ | |||
28 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
29 | #include <plat/gpmc.h> | 29 | #include <plat/gpmc.h> |
30 | 30 | ||
31 | #include <plat/cpu.h> | ||
32 | #include <plat/gpmc.h> | ||
31 | #include <plat/sdrc.h> | 33 | #include <plat/sdrc.h> |
32 | 34 | ||
35 | #include "soc.h" | ||
36 | #include "common.h" | ||
37 | |||
33 | /* GPMC register offsets */ | 38 | /* GPMC register offsets */ |
34 | #define GPMC_REVISION 0x00 | 39 | #define GPMC_REVISION 0x00 |
35 | #define GPMC_SYSCONFIG 0x10 | 40 | #define GPMC_SYSCONFIG 0x10 |
@@ -78,6 +83,15 @@ | |||
78 | #define ENABLE_PREFETCH (0x1 << 7) | 83 | #define ENABLE_PREFETCH (0x1 << 7) |
79 | #define DMA_MPU_MODE 2 | 84 | #define DMA_MPU_MODE 2 |
80 | 85 | ||
86 | /* XXX: Only NAND irq has been considered,currently these are the only ones used | ||
87 | */ | ||
88 | #define GPMC_NR_IRQ 2 | ||
89 | |||
90 | struct gpmc_client_irq { | ||
91 | unsigned irq; | ||
92 | u32 bitmask; | ||
93 | }; | ||
94 | |||
81 | /* Structure to save gpmc cs context */ | 95 | /* Structure to save gpmc cs context */ |
82 | struct gpmc_cs_config { | 96 | struct gpmc_cs_config { |
83 | u32 config1; | 97 | u32 config1; |
@@ -105,6 +119,10 @@ struct omap3_gpmc_regs { | |||
105 | struct gpmc_cs_config cs_context[GPMC_CS_NUM]; | 119 | struct gpmc_cs_config cs_context[GPMC_CS_NUM]; |
106 | }; | 120 | }; |
107 | 121 | ||
122 | static struct gpmc_client_irq gpmc_client_irq[GPMC_NR_IRQ]; | ||
123 | static struct irq_chip gpmc_irq_chip; | ||
124 | static unsigned gpmc_irq_start; | ||
125 | |||
108 | static struct resource gpmc_mem_root; | 126 | static struct resource gpmc_mem_root; |
109 | static struct resource gpmc_cs_mem[GPMC_CS_NUM]; | 127 | static struct resource gpmc_cs_mem[GPMC_CS_NUM]; |
110 | static DEFINE_SPINLOCK(gpmc_mem_lock); | 128 | static DEFINE_SPINLOCK(gpmc_mem_lock); |
@@ -279,7 +297,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t) | |||
279 | 297 | ||
280 | div = gpmc_cs_calc_divider(cs, t->sync_clk); | 298 | div = gpmc_cs_calc_divider(cs, t->sync_clk); |
281 | if (div < 0) | 299 | if (div < 0) |
282 | return -1; | 300 | return div; |
283 | 301 | ||
284 | GPMC_SET_ONE(GPMC_CS_CONFIG2, 0, 3, cs_on); | 302 | GPMC_SET_ONE(GPMC_CS_CONFIG2, 0, 3, cs_on); |
285 | GPMC_SET_ONE(GPMC_CS_CONFIG2, 8, 12, cs_rd_off); | 303 | GPMC_SET_ONE(GPMC_CS_CONFIG2, 8, 12, cs_rd_off); |
@@ -682,6 +700,117 @@ int gpmc_prefetch_reset(int cs) | |||
682 | } | 700 | } |
683 | EXPORT_SYMBOL(gpmc_prefetch_reset); | 701 | EXPORT_SYMBOL(gpmc_prefetch_reset); |
684 | 702 | ||
703 | void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs) | ||
704 | { | ||
705 | reg->gpmc_status = gpmc_base + GPMC_STATUS; | ||
706 | reg->gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET + | ||
707 | GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs; | ||
708 | reg->gpmc_nand_address = gpmc_base + GPMC_CS0_OFFSET + | ||
709 | GPMC_CS_NAND_ADDRESS + GPMC_CS_SIZE * cs; | ||
710 | reg->gpmc_nand_data = gpmc_base + GPMC_CS0_OFFSET + | ||
711 | GPMC_CS_NAND_DATA + GPMC_CS_SIZE * cs; | ||
712 | reg->gpmc_prefetch_config1 = gpmc_base + GPMC_PREFETCH_CONFIG1; | ||
713 | reg->gpmc_prefetch_config2 = gpmc_base + GPMC_PREFETCH_CONFIG2; | ||
714 | reg->gpmc_prefetch_control = gpmc_base + GPMC_PREFETCH_CONTROL; | ||
715 | reg->gpmc_prefetch_status = gpmc_base + GPMC_PREFETCH_STATUS; | ||
716 | reg->gpmc_ecc_config = gpmc_base + GPMC_ECC_CONFIG; | ||
717 | reg->gpmc_ecc_control = gpmc_base + GPMC_ECC_CONTROL; | ||
718 | reg->gpmc_ecc_size_config = gpmc_base + GPMC_ECC_SIZE_CONFIG; | ||
719 | reg->gpmc_ecc1_result = gpmc_base + GPMC_ECC1_RESULT; | ||
720 | reg->gpmc_bch_result0 = gpmc_base + GPMC_ECC_BCH_RESULT_0; | ||
721 | } | ||
722 | |||
723 | int gpmc_get_client_irq(unsigned irq_config) | ||
724 | { | ||
725 | int i; | ||
726 | |||
727 | if (hweight32(irq_config) > 1) | ||
728 | return 0; | ||
729 | |||
730 | for (i = 0; i < GPMC_NR_IRQ; i++) | ||
731 | if (gpmc_client_irq[i].bitmask & irq_config) | ||
732 | return gpmc_client_irq[i].irq; | ||
733 | |||
734 | return 0; | ||
735 | } | ||
736 | |||
737 | static int gpmc_irq_endis(unsigned irq, bool endis) | ||
738 | { | ||
739 | int i; | ||
740 | u32 regval; | ||
741 | |||
742 | for (i = 0; i < GPMC_NR_IRQ; i++) | ||
743 | if (irq == gpmc_client_irq[i].irq) { | ||
744 | regval = gpmc_read_reg(GPMC_IRQENABLE); | ||
745 | if (endis) | ||
746 | regval |= gpmc_client_irq[i].bitmask; | ||
747 | else | ||
748 | regval &= ~gpmc_client_irq[i].bitmask; | ||
749 | gpmc_write_reg(GPMC_IRQENABLE, regval); | ||
750 | break; | ||
751 | } | ||
752 | |||
753 | return 0; | ||
754 | } | ||
755 | |||
756 | static void gpmc_irq_disable(struct irq_data *p) | ||
757 | { | ||
758 | gpmc_irq_endis(p->irq, false); | ||
759 | } | ||
760 | |||
761 | static void gpmc_irq_enable(struct irq_data *p) | ||
762 | { | ||
763 | gpmc_irq_endis(p->irq, true); | ||
764 | } | ||
765 | |||
766 | static void gpmc_irq_noop(struct irq_data *data) { } | ||
767 | |||
768 | static unsigned int gpmc_irq_noop_ret(struct irq_data *data) { return 0; } | ||
769 | |||
770 | static int gpmc_setup_irq(int gpmc_irq) | ||
771 | { | ||
772 | int i; | ||
773 | u32 regval; | ||
774 | |||
775 | if (!gpmc_irq) | ||
776 | return -EINVAL; | ||
777 | |||
778 | gpmc_irq_start = irq_alloc_descs(-1, 0, GPMC_NR_IRQ, 0); | ||
779 | if (IS_ERR_VALUE(gpmc_irq_start)) { | ||
780 | pr_err("irq_alloc_descs failed\n"); | ||
781 | return gpmc_irq_start; | ||
782 | } | ||
783 | |||
784 | gpmc_irq_chip.name = "gpmc"; | ||
785 | gpmc_irq_chip.irq_startup = gpmc_irq_noop_ret; | ||
786 | gpmc_irq_chip.irq_enable = gpmc_irq_enable; | ||
787 | gpmc_irq_chip.irq_disable = gpmc_irq_disable; | ||
788 | gpmc_irq_chip.irq_shutdown = gpmc_irq_noop; | ||
789 | gpmc_irq_chip.irq_ack = gpmc_irq_noop; | ||
790 | gpmc_irq_chip.irq_mask = gpmc_irq_noop; | ||
791 | gpmc_irq_chip.irq_unmask = gpmc_irq_noop; | ||
792 | |||
793 | gpmc_client_irq[0].bitmask = GPMC_IRQ_FIFOEVENTENABLE; | ||
794 | gpmc_client_irq[1].bitmask = GPMC_IRQ_COUNT_EVENT; | ||
795 | |||
796 | for (i = 0; i < GPMC_NR_IRQ; i++) { | ||
797 | gpmc_client_irq[i].irq = gpmc_irq_start + i; | ||
798 | irq_set_chip_and_handler(gpmc_client_irq[i].irq, | ||
799 | &gpmc_irq_chip, handle_simple_irq); | ||
800 | set_irq_flags(gpmc_client_irq[i].irq, | ||
801 | IRQF_VALID | IRQF_NOAUTOEN); | ||
802 | } | ||
803 | |||
804 | /* Disable interrupts */ | ||
805 | gpmc_write_reg(GPMC_IRQENABLE, 0); | ||
806 | |||
807 | /* clear interrupts */ | ||
808 | regval = gpmc_read_reg(GPMC_IRQSTATUS); | ||
809 | gpmc_write_reg(GPMC_IRQSTATUS, regval); | ||
810 | |||
811 | return request_irq(gpmc_irq, gpmc_handle_irq, 0, "gpmc", NULL); | ||
812 | } | ||
813 | |||
685 | static void __init gpmc_mem_init(void) | 814 | static void __init gpmc_mem_init(void) |
686 | { | 815 | { |
687 | int cs; | 816 | int cs; |
@@ -711,8 +840,8 @@ static void __init gpmc_mem_init(void) | |||
711 | 840 | ||
712 | static int __init gpmc_init(void) | 841 | static int __init gpmc_init(void) |
713 | { | 842 | { |
714 | u32 l, irq; | 843 | u32 l; |
715 | int cs, ret = -EINVAL; | 844 | int ret = -EINVAL; |
716 | int gpmc_irq; | 845 | int gpmc_irq; |
717 | char *ck = NULL; | 846 | char *ck = NULL; |
718 | 847 | ||
@@ -722,16 +851,16 @@ static int __init gpmc_init(void) | |||
722 | l = OMAP2420_GPMC_BASE; | 851 | l = OMAP2420_GPMC_BASE; |
723 | else | 852 | else |
724 | l = OMAP34XX_GPMC_BASE; | 853 | l = OMAP34XX_GPMC_BASE; |
725 | gpmc_irq = INT_34XX_GPMC_IRQ; | 854 | gpmc_irq = 20 + OMAP_INTC_START; |
726 | } else if (cpu_is_omap34xx()) { | 855 | } else if (cpu_is_omap34xx()) { |
727 | ck = "gpmc_fck"; | 856 | ck = "gpmc_fck"; |
728 | l = OMAP34XX_GPMC_BASE; | 857 | l = OMAP34XX_GPMC_BASE; |
729 | gpmc_irq = INT_34XX_GPMC_IRQ; | 858 | gpmc_irq = 20 + OMAP_INTC_START; |
730 | } else if (cpu_is_omap44xx() || soc_is_omap54xx()) { | 859 | } else if (cpu_is_omap44xx() || soc_is_omap54xx()) { |
731 | /* Base address and irq number are same for OMAP4/5 */ | 860 | /* Base address and irq number are same for OMAP4/5 */ |
732 | ck = "gpmc_ck"; | 861 | ck = "gpmc_ck"; |
733 | l = OMAP44XX_GPMC_BASE; | 862 | l = OMAP44XX_GPMC_BASE; |
734 | gpmc_irq = OMAP44XX_IRQ_GPMC; | 863 | gpmc_irq = 20 + OMAP44XX_IRQ_GIC_START; |
735 | } | 864 | } |
736 | 865 | ||
737 | if (WARN_ON(!ck)) | 866 | if (WARN_ON(!ck)) |
@@ -761,16 +890,7 @@ static int __init gpmc_init(void) | |||
761 | gpmc_write_reg(GPMC_SYSCONFIG, l); | 890 | gpmc_write_reg(GPMC_SYSCONFIG, l); |
762 | gpmc_mem_init(); | 891 | gpmc_mem_init(); |
763 | 892 | ||
764 | /* initalize the irq_chained */ | 893 | ret = gpmc_setup_irq(gpmc_irq); |
765 | irq = OMAP_GPMC_IRQ_BASE; | ||
766 | for (cs = 0; cs < GPMC_CS_NUM; cs++) { | ||
767 | irq_set_chip_and_handler(irq, &dummy_irq_chip, | ||
768 | handle_simple_irq); | ||
769 | set_irq_flags(irq, IRQF_VALID); | ||
770 | irq++; | ||
771 | } | ||
772 | |||
773 | ret = request_irq(gpmc_irq, gpmc_handle_irq, IRQF_SHARED, "gpmc", NULL); | ||
774 | if (ret) | 894 | if (ret) |
775 | pr_err("gpmc: irq-%d could not claim: err %d\n", | 895 | pr_err("gpmc: irq-%d could not claim: err %d\n", |
776 | gpmc_irq, ret); | 896 | gpmc_irq, ret); |
@@ -780,12 +900,19 @@ postcore_initcall(gpmc_init); | |||
780 | 900 | ||
781 | static irqreturn_t gpmc_handle_irq(int irq, void *dev) | 901 | static irqreturn_t gpmc_handle_irq(int irq, void *dev) |
782 | { | 902 | { |
783 | u8 cs; | 903 | int i; |
904 | u32 regval; | ||
905 | |||
906 | regval = gpmc_read_reg(GPMC_IRQSTATUS); | ||
907 | |||
908 | if (!regval) | ||
909 | return IRQ_NONE; | ||
910 | |||
911 | for (i = 0; i < GPMC_NR_IRQ; i++) | ||
912 | if (regval & gpmc_client_irq[i].bitmask) | ||
913 | generic_handle_irq(gpmc_client_irq[i].irq); | ||
784 | 914 | ||
785 | /* check cs to invoke the irq */ | 915 | gpmc_write_reg(GPMC_IRQSTATUS, regval); |
786 | cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7; | ||
787 | if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END) | ||
788 | generic_handle_irq(OMAP_GPMC_IRQ_BASE+cs); | ||
789 | 916 | ||
790 | return IRQ_HANDLED; | 917 | return IRQ_HANDLED; |
791 | } | 918 | } |
diff --git a/arch/arm/mach-omap2/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c index cdd6dda03828..e003f2bba30c 100644 --- a/arch/arm/mach-omap2/hdq1w.c +++ b/arch/arm/mach-omap2/hdq1w.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #include <plat/omap_hwmod.h> | 30 | #include <plat/omap_hwmod.h> |
31 | #include <plat/omap_device.h> | 31 | #include <plat/omap_device.h> |
32 | #include <plat/hdq1w.h> | 32 | #include "hdq1w.h" |
33 | 33 | ||
34 | #include "common.h" | 34 | #include "common.h" |
35 | 35 | ||
diff --git a/arch/arm/plat-omap/include/plat/hdq1w.h b/arch/arm/mach-omap2/hdq1w.h index 0c1efc846d8d..0c1efc846d8d 100644 --- a/arch/arm/plat-omap/include/plat/hdq1w.h +++ b/arch/arm/mach-omap2/hdq1w.h | |||
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index a9675d8d1822..03ebf47cfa9a 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c | |||
@@ -15,9 +15,10 @@ | |||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/gpio.h> | 16 | #include <linux/gpio.h> |
17 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
18 | #include <linux/platform_data/gpio-omap.h> | ||
19 | |||
18 | #include <plat/mmc.h> | 20 | #include <plat/mmc.h> |
19 | #include <plat/omap-pm.h> | 21 | #include <plat/omap-pm.h> |
20 | #include <plat/mux.h> | ||
21 | #include <plat/omap_device.h> | 22 | #include <plat/omap_device.h> |
22 | 23 | ||
23 | #include "mux.h" | 24 | #include "mux.h" |
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c index a12e224eb97d..fc57e67b321f 100644 --- a/arch/arm/mach-omap2/i2c.c +++ b/arch/arm/mach-omap2/i2c.c | |||
@@ -19,7 +19,6 @@ | |||
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <plat/cpu.h> | ||
23 | #include <plat/i2c.h> | 22 | #include <plat/i2c.h> |
24 | #include "common.h" | 23 | #include "common.h" |
25 | #include <plat/omap_hwmod.h> | 24 | #include <plat/omap_hwmod.h> |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 40373db649aa..cf2362ccb234 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -22,10 +22,10 @@ | |||
22 | #include <asm/cputype.h> | 22 | #include <asm/cputype.h> |
23 | 23 | ||
24 | #include "common.h" | 24 | #include "common.h" |
25 | #include <plat/cpu.h> | ||
26 | 25 | ||
27 | #include <mach/id.h> | 26 | #include "id.h" |
28 | 27 | ||
28 | #include "soc.h" | ||
29 | #include "control.h" | 29 | #include "control.h" |
30 | 30 | ||
31 | static unsigned int omap_revision; | 31 | static unsigned int omap_revision; |
@@ -161,9 +161,8 @@ void __init omap2xxx_check_revision(void) | |||
161 | } | 161 | } |
162 | 162 | ||
163 | if (j == ARRAY_SIZE(omap_ids)) { | 163 | if (j == ARRAY_SIZE(omap_ids)) { |
164 | printk(KERN_ERR "Unknown OMAP device type. " | 164 | pr_err("Unknown OMAP device type. Handling it as OMAP%04x\n", |
165 | "Handling it as OMAP%04x\n", | 165 | omap_ids[i].type >> 16); |
166 | omap_ids[i].type >> 16); | ||
167 | j = i; | 166 | j = i; |
168 | } | 167 | } |
169 | 168 | ||
diff --git a/arch/arm/mach-omap2/include/mach/id.h b/arch/arm/mach-omap2/id.h index 02ed3aa56f1e..02ed3aa56f1e 100644 --- a/arch/arm/mach-omap2/include/mach/id.h +++ b/arch/arm/mach-omap2/id.h | |||
diff --git a/arch/arm/mach-omap2/include/mach/gpio.h b/arch/arm/mach-omap2/include/mach/gpio.h index be4d290d57ee..5621cc59c9f4 100644 --- a/arch/arm/mach-omap2/include/mach/gpio.h +++ b/arch/arm/mach-omap2/include/mach/gpio.h | |||
@@ -1,5 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-omap2/include/mach/gpio.h | 2 | * arch/arm/mach-omap2/include/mach/gpio.h |
3 | */ | 3 | */ |
4 | |||
5 | #include <plat/gpio.h> | ||
diff --git a/arch/arm/mach-omap2/include/mach/hardware.h b/arch/arm/mach-omap2/include/mach/hardware.h index 78edf9d33f71..54492dbf6973 100644 --- a/arch/arm/mach-omap2/include/mach/hardware.h +++ b/arch/arm/mach-omap2/include/mach/hardware.h | |||
@@ -1,5 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-omap2/include/mach/hardware.h | 2 | * arch/arm/mach-omap2/include/mach/hardware.h |
3 | */ | 3 | */ |
4 | |||
5 | #include <plat/hardware.h> | ||
diff --git a/arch/arm/mach-omap2/include/mach/irqs.h b/arch/arm/mach-omap2/include/mach/irqs.h index 44dab7725696..ba5282cafa42 100644 --- a/arch/arm/mach-omap2/include/mach/irqs.h +++ b/arch/arm/mach-omap2/include/mach/irqs.h | |||
@@ -1,5 +1,3 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-omap2/include/mach/irqs.h | 2 | * arch/arm/mach-omap2/include/mach/irqs.h |
3 | */ | 3 | */ |
4 | |||
5 | #include <plat/irqs.h> | ||
diff --git a/arch/arm/mach-omap2/include/mach/smp.h b/arch/arm/mach-omap2/include/mach/smp.h deleted file mode 100644 index 323675f21b69..000000000000 --- a/arch/arm/mach-omap2/include/mach/smp.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-omap2/include/mach/smp.h | ||
3 | */ | ||
4 | |||
5 | #include <plat/smp.h> | ||
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 4d2d981ff5c5..0d79c23e9f88 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <plat/multi.h> | 33 | #include <plat/multi.h> |
34 | #include <plat/dma.h> | 34 | #include <plat/dma.h> |
35 | 35 | ||
36 | #include "soc.h" | ||
36 | #include "iomap.h" | 37 | #include "iomap.h" |
37 | #include "voltage.h" | 38 | #include "voltage.h" |
38 | #include "powerdomain.h" | 39 | #include "powerdomain.h" |
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index bcd83db41bbc..3926f370448f 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c | |||
@@ -23,8 +23,7 @@ | |||
23 | #include <linux/of_address.h> | 23 | #include <linux/of_address.h> |
24 | #include <linux/of_irq.h> | 24 | #include <linux/of_irq.h> |
25 | 25 | ||
26 | #include <mach/hardware.h> | 26 | #include "soc.h" |
27 | |||
28 | #include "iomap.h" | 27 | #include "iomap.h" |
29 | #include "common.h" | 28 | #include "common.h" |
30 | 29 | ||
@@ -49,6 +48,8 @@ | |||
49 | #define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE) | 48 | #define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE) |
50 | #define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */ | 49 | #define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */ |
51 | #define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */ | 50 | #define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */ |
51 | #define INTCPS_NR_MIR_REGS 3 | ||
52 | #define INTCPS_NR_IRQS 96 | ||
52 | 53 | ||
53 | /* | 54 | /* |
54 | * OMAP2 has a number of different interrupt controllers, each interrupt | 55 | * OMAP2 has a number of different interrupt controllers, each interrupt |
@@ -107,9 +108,8 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank) | |||
107 | unsigned long tmp; | 108 | unsigned long tmp; |
108 | 109 | ||
109 | tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff; | 110 | tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff; |
110 | printk(KERN_INFO "IRQ: Found an INTC at 0x%p " | 111 | pr_info("IRQ: Found an INTC at 0x%p (revision %ld.%ld) with %d interrupts\n", |
111 | "(revision %ld.%ld) with %d interrupts\n", | 112 | bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs); |
112 | bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs); | ||
113 | 113 | ||
114 | tmp = intc_bank_read_reg(bank, INTC_SYSCONFIG); | 114 | tmp = intc_bank_read_reg(bank, INTC_SYSCONFIG); |
115 | tmp |= 1 << 1; /* soft reset */ | 115 | tmp |= 1 << 1; /* soft reset */ |
diff --git a/arch/arm/plat-omap/include/plat/l3_2xxx.h b/arch/arm/mach-omap2/l3_2xxx.h index b8b5641379b0..b8b5641379b0 100644 --- a/arch/arm/plat-omap/include/plat/l3_2xxx.h +++ b/arch/arm/mach-omap2/l3_2xxx.h | |||
diff --git a/arch/arm/plat-omap/include/plat/l3_3xxx.h b/arch/arm/mach-omap2/l3_3xxx.h index cde1938c5f82..cde1938c5f82 100644 --- a/arch/arm/plat-omap/include/plat/l3_3xxx.h +++ b/arch/arm/mach-omap2/l3_3xxx.h | |||
diff --git a/arch/arm/plat-omap/include/plat/l4_2xxx.h b/arch/arm/mach-omap2/l4_2xxx.h index 3f39cf8a35c6..3f39cf8a35c6 100644 --- a/arch/arm/plat-omap/include/plat/l4_2xxx.h +++ b/arch/arm/mach-omap2/l4_2xxx.h | |||
diff --git a/arch/arm/plat-omap/include/plat/l4_3xxx.h b/arch/arm/mach-omap2/l4_3xxx.h index 881a858b1ffc..881a858b1ffc 100644 --- a/arch/arm/plat-omap/include/plat/l4_3xxx.h +++ b/arch/arm/mach-omap2/l4_3xxx.h | |||
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 6875be837d9f..0d974565f8ca 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c | |||
@@ -16,8 +16,10 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/pm_runtime.h> | 18 | #include <linux/pm_runtime.h> |
19 | |||
19 | #include <plat/mailbox.h> | 20 | #include <plat/mailbox.h> |
20 | #include <mach/irqs.h> | 21 | |
22 | #include "soc.h" | ||
21 | 23 | ||
22 | #define MAILBOX_REVISION 0x000 | 24 | #define MAILBOX_REVISION 0x000 |
23 | #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) | 25 | #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 577cb77db26c..7d47407d6d46 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -17,11 +17,9 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/platform_data/asoc-ti-mcbsp.h> | ||
20 | 21 | ||
21 | #include <mach/irqs.h> | ||
22 | #include <plat/dma.h> | 22 | #include <plat/dma.h> |
23 | #include <plat/cpu.h> | ||
24 | #include <plat/mcbsp.h> | ||
25 | #include <plat/omap_device.h> | 23 | #include <plat/omap_device.h> |
26 | #include <linux/pm_runtime.h> | 24 | #include <linux/pm_runtime.h> |
27 | 25 | ||
diff --git a/arch/arm/mach-omap2/msdi.c b/arch/arm/mach-omap2/msdi.c index fb5bc6cf3773..9e57b4aadb06 100644 --- a/arch/arm/mach-omap2/msdi.c +++ b/arch/arm/mach-omap2/msdi.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/platform_data/gpio-omap.h> | ||
26 | 27 | ||
27 | #include <plat/omap_hwmod.h> | 28 | #include <plat/omap_hwmod.h> |
28 | #include <plat/omap_device.h> | 29 | #include <plat/omap_device.h> |
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c index 414083b427df..765a2aceb665 100644 --- a/arch/arm/mach-omap2/omap-hotplug.c +++ b/arch/arm/mach-omap2/omap-hotplug.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | 21 | ||
22 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
23 | #include <mach/omap-wakeupgen.h> | 23 | #include "omap-wakeupgen.h" |
24 | 24 | ||
25 | #include "common.h" | 25 | #include "common.h" |
26 | 26 | ||
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c index 1be8bcb52e93..df298d46707c 100644 --- a/arch/arm/mach-omap2/omap-iommu.c +++ b/arch/arm/mach-omap2/omap-iommu.c | |||
@@ -14,7 +14,9 @@ | |||
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | 15 | ||
16 | #include <plat/iommu.h> | 16 | #include <plat/iommu.h> |
17 | #include <plat/irqs.h> | 17 | |
18 | #include "soc.h" | ||
19 | #include "common.h" | ||
18 | 20 | ||
19 | struct iommu_device { | 21 | struct iommu_device { |
20 | resource_size_t base; | 22 | resource_size_t base; |
@@ -29,7 +31,7 @@ static int num_iommu_devices; | |||
29 | static struct iommu_device omap3_devices[] = { | 31 | static struct iommu_device omap3_devices[] = { |
30 | { | 32 | { |
31 | .base = 0x480bd400, | 33 | .base = 0x480bd400, |
32 | .irq = 24, | 34 | .irq = 24 + OMAP_INTC_START, |
33 | .pdata = { | 35 | .pdata = { |
34 | .name = "isp", | 36 | .name = "isp", |
35 | .nr_tlb_entries = 8, | 37 | .nr_tlb_entries = 8, |
@@ -41,7 +43,7 @@ static struct iommu_device omap3_devices[] = { | |||
41 | #if defined(CONFIG_OMAP_IOMMU_IVA2) | 43 | #if defined(CONFIG_OMAP_IOMMU_IVA2) |
42 | { | 44 | { |
43 | .base = 0x5d000000, | 45 | .base = 0x5d000000, |
44 | .irq = 28, | 46 | .irq = 28 + OMAP_INTC_START, |
45 | .pdata = { | 47 | .pdata = { |
46 | .name = "iva2", | 48 | .name = "iva2", |
47 | .nr_tlb_entries = 32, | 49 | .nr_tlb_entries = 32, |
@@ -64,7 +66,7 @@ static struct platform_device *omap3_iommu_pdev[NR_OMAP3_IOMMU_DEVICES]; | |||
64 | static struct iommu_device omap4_devices[] = { | 66 | static struct iommu_device omap4_devices[] = { |
65 | { | 67 | { |
66 | .base = OMAP4_MMU1_BASE, | 68 | .base = OMAP4_MMU1_BASE, |
67 | .irq = OMAP44XX_IRQ_DUCATI_MMU, | 69 | .irq = 100 + OMAP44XX_IRQ_GIC_START, |
68 | .pdata = { | 70 | .pdata = { |
69 | .name = "ducati", | 71 | .name = "ducati", |
70 | .nr_tlb_entries = 32, | 72 | .nr_tlb_entries = 32, |
@@ -75,7 +77,7 @@ static struct iommu_device omap4_devices[] = { | |||
75 | }, | 77 | }, |
76 | { | 78 | { |
77 | .base = OMAP4_MMU2_BASE, | 79 | .base = OMAP4_MMU2_BASE, |
78 | .irq = OMAP44XX_IRQ_TESLA_MMU, | 80 | .irq = 28 + OMAP44XX_IRQ_GIC_START, |
79 | .pdata = { | 81 | .pdata = { |
80 | .name = "tesla", | 82 | .name = "tesla", |
81 | .nr_tlb_entries = 32, | 83 | .nr_tlb_entries = 32, |
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c index 637a1bdf2ac4..ff4e6a0e9c7c 100644 --- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c +++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c | |||
@@ -50,9 +50,8 @@ | |||
50 | #include <asm/suspend.h> | 50 | #include <asm/suspend.h> |
51 | #include <asm/hardware/cache-l2x0.h> | 51 | #include <asm/hardware/cache-l2x0.h> |
52 | 52 | ||
53 | #include <plat/omap44xx.h> | ||
54 | |||
55 | #include "common.h" | 53 | #include "common.h" |
54 | #include "omap44xx.h" | ||
56 | #include "omap4-sar-layout.h" | 55 | #include "omap4-sar-layout.h" |
57 | #include "pm.h" | 56 | #include "pm.h" |
58 | #include "prcm_mpu44xx.h" | 57 | #include "prcm_mpu44xx.h" |
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c index d9ae4a53d818..a004cb9acf52 100644 --- a/arch/arm/mach-omap2/omap-secure.c +++ b/arch/arm/mach-omap2/omap-secure.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <asm/memblock.h> | 19 | #include <asm/memblock.h> |
20 | 20 | ||
21 | #include <plat/omap-secure.h> | 21 | #include <plat/omap-secure.h> |
22 | #include <mach/omap-secure.h> | 22 | #include "omap-secure.h" |
23 | 23 | ||
24 | static phys_addr_t omap_secure_memblock_base; | 24 | static phys_addr_t omap_secure_memblock_base; |
25 | 25 | ||
diff --git a/arch/arm/mach-omap2/include/mach/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h index c90a43589abe..c90a43589abe 100644 --- a/arch/arm/mach-omap2/include/mach/omap-secure.h +++ b/arch/arm/mach-omap2/omap-secure.h | |||
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 9a35adf91232..06d8bc3a8886 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
@@ -24,11 +24,11 @@ | |||
24 | #include <asm/hardware/gic.h> | 24 | #include <asm/hardware/gic.h> |
25 | #include <asm/smp_scu.h> | 25 | #include <asm/smp_scu.h> |
26 | 26 | ||
27 | #include <mach/hardware.h> | 27 | #include "omap-secure.h" |
28 | #include <mach/omap-secure.h> | 28 | #include "omap-wakeupgen.h" |
29 | #include <mach/omap-wakeupgen.h> | ||
30 | #include <asm/cputype.h> | 29 | #include <asm/cputype.h> |
31 | 30 | ||
31 | #include "soc.h" | ||
32 | #include "iomap.h" | 32 | #include "iomap.h" |
33 | #include "common.h" | 33 | #include "common.h" |
34 | #include "clockdomain.h" | 34 | #include "clockdomain.h" |
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c index c4bee21f4210..5d3b4f4f81ae 100644 --- a/arch/arm/mach-omap2/omap-wakeupgen.c +++ b/arch/arm/mach-omap2/omap-wakeupgen.c | |||
@@ -27,9 +27,10 @@ | |||
27 | 27 | ||
28 | #include <asm/hardware/gic.h> | 28 | #include <asm/hardware/gic.h> |
29 | 29 | ||
30 | #include <mach/omap-wakeupgen.h> | 30 | #include "omap-wakeupgen.h" |
31 | #include <mach/omap-secure.h> | 31 | #include "omap-secure.h" |
32 | 32 | ||
33 | #include "soc.h" | ||
33 | #include "omap4-sar-layout.h" | 34 | #include "omap4-sar-layout.h" |
34 | #include "common.h" | 35 | #include "common.h" |
35 | 36 | ||
diff --git a/arch/arm/mach-omap2/include/mach/omap-wakeupgen.h b/arch/arm/mach-omap2/omap-wakeupgen.h index b0fd16f5c391..b0fd16f5c391 100644 --- a/arch/arm/mach-omap2/include/mach/omap-wakeupgen.h +++ b/arch/arm/mach-omap2/omap-wakeupgen.h | |||
diff --git a/arch/arm/plat-omap/include/plat/omap24xx.h b/arch/arm/mach-omap2/omap24xx.h index 92df9e27cc5c..641a2c8d2eee 100644 --- a/arch/arm/plat-omap/include/plat/omap24xx.h +++ b/arch/arm/mach-omap2/omap24xx.h | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-omap/include/mach/omap24xx.h | ||
3 | * | ||
4 | * This file contains the processor specific definitions | 2 | * This file contains the processor specific definitions |
5 | * of the TI OMAP24XX. | 3 | * of the TI OMAP24XX. |
6 | * | 4 | * |
diff --git a/arch/arm/plat-omap/include/plat/omap34xx.h b/arch/arm/mach-omap2/omap34xx.h index 0d818acf3917..c0d1b4b1653f 100644 --- a/arch/arm/plat-omap/include/plat/omap34xx.h +++ b/arch/arm/mach-omap2/omap34xx.h | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-omap/include/mach/omap34xx.h | ||
3 | * | ||
4 | * This file contains the processor specific definitions of the TI OMAP34XX. | 2 | * This file contains the processor specific definitions of the TI OMAP34XX. |
5 | * | 3 | * |
6 | * Copyright (C) 2007 Texas Instruments. | 4 | * Copyright (C) 2007 Texas Instruments. |
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index c29dee998a79..9fc865502f0c 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -16,26 +16,25 @@ | |||
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/memblock.h> | 18 | #include <linux/memblock.h> |
19 | #include <linux/of_irq.h> | ||
20 | #include <linux/of_platform.h> | ||
21 | #include <linux/export.h> | ||
19 | 22 | ||
20 | #include <asm/hardware/gic.h> | 23 | #include <asm/hardware/gic.h> |
21 | #include <asm/hardware/cache-l2x0.h> | 24 | #include <asm/hardware/cache-l2x0.h> |
22 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
23 | #include <asm/memblock.h> | 26 | #include <asm/memblock.h> |
24 | #include <linux/of_irq.h> | ||
25 | #include <linux/of_platform.h> | ||
26 | 27 | ||
27 | #include <plat/irqs.h> | ||
28 | #include <plat/sram.h> | 28 | #include <plat/sram.h> |
29 | #include <plat/omap-secure.h> | 29 | #include <plat/omap-secure.h> |
30 | #include <plat/mmc.h> | 30 | #include <plat/mmc.h> |
31 | 31 | ||
32 | #include <mach/hardware.h> | 32 | #include "omap-wakeupgen.h" |
33 | #include <mach/omap-wakeupgen.h> | ||
34 | 33 | ||
34 | #include "soc.h" | ||
35 | #include "common.h" | 35 | #include "common.h" |
36 | #include "hsmmc.h" | 36 | #include "hsmmc.h" |
37 | #include "omap4-sar-layout.h" | 37 | #include "omap4-sar-layout.h" |
38 | #include <linux/export.h> | ||
39 | 38 | ||
40 | #ifdef CONFIG_CACHE_L2X0 | 39 | #ifdef CONFIG_CACHE_L2X0 |
41 | static void __iomem *l2cache_base; | 40 | static void __iomem *l2cache_base; |
diff --git a/arch/arm/plat-omap/include/plat/omap4-keypad.h b/arch/arm/mach-omap2/omap4-keypad.h index 8ad0a377a54b..20de0d5a7e77 100644 --- a/arch/arm/plat-omap/include/plat/omap4-keypad.h +++ b/arch/arm/mach-omap2/omap4-keypad.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef ARCH_ARM_PLAT_OMAP4_KEYPAD_H | 1 | #ifndef ARCH_ARM_PLAT_OMAP4_KEYPAD_H |
2 | #define ARCH_ARM_PLAT_OMAP4_KEYPAD_H | 2 | #define ARCH_ARM_PLAT_OMAP4_KEYPAD_H |
3 | 3 | ||
4 | struct omap_board_data; | ||
5 | |||
4 | extern int omap4_keyboard_init(struct omap4_keypad_platform_data *, | 6 | extern int omap4_keyboard_init(struct omap4_keypad_platform_data *, |
5 | struct omap_board_data *); | 7 | struct omap_board_data *); |
6 | #endif | 8 | #endif |
diff --git a/arch/arm/plat-omap/include/plat/omap44xx.h b/arch/arm/mach-omap2/omap44xx.h index c0d478e55c84..43b927b2e2e8 100644 --- a/arch/arm/plat-omap/include/plat/omap44xx.h +++ b/arch/arm/mach-omap2/omap44xx.h | |||
@@ -39,12 +39,12 @@ | |||
39 | #define IRQ_SIR_IRQ 0x0040 | 39 | #define IRQ_SIR_IRQ 0x0040 |
40 | #define OMAP44XX_GIC_DIST_BASE 0x48241000 | 40 | #define OMAP44XX_GIC_DIST_BASE 0x48241000 |
41 | #define OMAP44XX_GIC_CPU_BASE 0x48240100 | 41 | #define OMAP44XX_GIC_CPU_BASE 0x48240100 |
42 | #define OMAP44XX_IRQ_GIC_START 32 | ||
42 | #define OMAP44XX_SCU_BASE 0x48240000 | 43 | #define OMAP44XX_SCU_BASE 0x48240000 |
43 | #define OMAP44XX_LOCAL_TWD_BASE 0x48240600 | 44 | #define OMAP44XX_LOCAL_TWD_BASE 0x48240600 |
44 | #define OMAP44XX_L2CACHE_BASE 0x48242000 | 45 | #define OMAP44XX_L2CACHE_BASE 0x48242000 |
45 | #define OMAP44XX_WKUPGEN_BASE 0x48281000 | 46 | #define OMAP44XX_WKUPGEN_BASE 0x48281000 |
46 | #define OMAP44XX_MCPDM_BASE 0x40132000 | 47 | #define OMAP44XX_MCPDM_BASE 0x40132000 |
47 | #define OMAP44XX_MCPDM_L3_BASE 0x49032000 | ||
48 | #define OMAP44XX_SAR_RAM_BASE 0x4a326000 | 48 | #define OMAP44XX_SAR_RAM_BASE 0x4a326000 |
49 | 49 | ||
50 | #define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) | 50 | #define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) |
diff --git a/arch/arm/plat-omap/include/plat/omap54xx.h b/arch/arm/mach-omap2/omap54xx.h index a2582bb3cab3..a2582bb3cab3 100644 --- a/arch/arm/plat-omap/include/plat/omap54xx.h +++ b/arch/arm/mach-omap2/omap54xx.h | |||
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 37afbd173c2c..3615e0d9ee3c 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -139,14 +139,14 @@ | |||
139 | #include <linux/slab.h> | 139 | #include <linux/slab.h> |
140 | #include <linux/bootmem.h> | 140 | #include <linux/bootmem.h> |
141 | 141 | ||
142 | #include "common.h" | ||
143 | #include <plat/cpu.h> | ||
144 | #include "clockdomain.h" | ||
145 | #include "powerdomain.h" | ||
146 | #include <plat/clock.h> | 142 | #include <plat/clock.h> |
147 | #include <plat/omap_hwmod.h> | 143 | #include <plat/omap_hwmod.h> |
148 | #include <plat/prcm.h> | 144 | #include <plat/prcm.h> |
149 | 145 | ||
146 | #include "soc.h" | ||
147 | #include "common.h" | ||
148 | #include "clockdomain.h" | ||
149 | #include "powerdomain.h" | ||
150 | #include "cm2xxx_3xxx.h" | 150 | #include "cm2xxx_3xxx.h" |
151 | #include "cminst44xx.h" | 151 | #include "cminst44xx.h" |
152 | #include "prm2xxx_3xxx.h" | 152 | #include "prm2xxx_3xxx.h" |
@@ -1438,8 +1438,8 @@ static int _init_clocks(struct omap_hwmod *oh, void *data) | |||
1438 | * Return the bit position of the reset line that match the | 1438 | * Return the bit position of the reset line that match the |
1439 | * input name. Return -ENOENT if not found. | 1439 | * input name. Return -ENOENT if not found. |
1440 | */ | 1440 | */ |
1441 | static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name, | 1441 | static int _lookup_hardreset(struct omap_hwmod *oh, const char *name, |
1442 | struct omap_hwmod_rst_info *ohri) | 1442 | struct omap_hwmod_rst_info *ohri) |
1443 | { | 1443 | { |
1444 | int i; | 1444 | int i; |
1445 | 1445 | ||
@@ -1475,7 +1475,7 @@ static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name, | |||
1475 | static int _assert_hardreset(struct omap_hwmod *oh, const char *name) | 1475 | static int _assert_hardreset(struct omap_hwmod *oh, const char *name) |
1476 | { | 1476 | { |
1477 | struct omap_hwmod_rst_info ohri; | 1477 | struct omap_hwmod_rst_info ohri; |
1478 | u8 ret = -EINVAL; | 1478 | int ret = -EINVAL; |
1479 | 1479 | ||
1480 | if (!oh) | 1480 | if (!oh) |
1481 | return -EINVAL; | 1481 | return -EINVAL; |
@@ -1484,7 +1484,7 @@ static int _assert_hardreset(struct omap_hwmod *oh, const char *name) | |||
1484 | return -ENOSYS; | 1484 | return -ENOSYS; |
1485 | 1485 | ||
1486 | ret = _lookup_hardreset(oh, name, &ohri); | 1486 | ret = _lookup_hardreset(oh, name, &ohri); |
1487 | if (IS_ERR_VALUE(ret)) | 1487 | if (ret < 0) |
1488 | return ret; | 1488 | return ret; |
1489 | 1489 | ||
1490 | ret = soc_ops.assert_hardreset(oh, &ohri); | 1490 | ret = soc_ops.assert_hardreset(oh, &ohri); |
@@ -1542,7 +1542,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name) | |||
1542 | static int _read_hardreset(struct omap_hwmod *oh, const char *name) | 1542 | static int _read_hardreset(struct omap_hwmod *oh, const char *name) |
1543 | { | 1543 | { |
1544 | struct omap_hwmod_rst_info ohri; | 1544 | struct omap_hwmod_rst_info ohri; |
1545 | u8 ret = -EINVAL; | 1545 | int ret = -EINVAL; |
1546 | 1546 | ||
1547 | if (!oh) | 1547 | if (!oh) |
1548 | return -EINVAL; | 1548 | return -EINVAL; |
@@ -1551,7 +1551,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name) | |||
1551 | return -ENOSYS; | 1551 | return -ENOSYS; |
1552 | 1552 | ||
1553 | ret = _lookup_hardreset(oh, name, &ohri); | 1553 | ret = _lookup_hardreset(oh, name, &ohri); |
1554 | if (IS_ERR_VALUE(ret)) | 1554 | if (ret < 0) |
1555 | return ret; | 1555 | return ret; |
1556 | 1556 | ||
1557 | return soc_ops.is_hardreset_asserted(oh, &ohri); | 1557 | return soc_ops.is_hardreset_asserted(oh, &ohri); |
@@ -1641,8 +1641,8 @@ static int _ocp_softreset(struct omap_hwmod *oh) | |||
1641 | 1641 | ||
1642 | /* clocks must be on for this operation */ | 1642 | /* clocks must be on for this operation */ |
1643 | if (oh->_state != _HWMOD_STATE_ENABLED) { | 1643 | if (oh->_state != _HWMOD_STATE_ENABLED) { |
1644 | pr_warning("omap_hwmod: %s: reset can only be entered from " | 1644 | pr_warn("omap_hwmod: %s: reset can only be entered from enabled state\n", |
1645 | "enabled state\n", oh->name); | 1645 | oh->name); |
1646 | return -EINVAL; | 1646 | return -EINVAL; |
1647 | } | 1647 | } |
1648 | 1648 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index 50cfab61b0e2..10575a1bc1f1 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c | |||
@@ -12,17 +12,15 @@ | |||
12 | * XXX handle crossbar/shared link difference for L3? | 12 | * XXX handle crossbar/shared link difference for L3? |
13 | * XXX these should be marked initdata for multi-OMAP kernels | 13 | * XXX these should be marked initdata for multi-OMAP kernels |
14 | */ | 14 | */ |
15 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
16 | |||
15 | #include <plat/omap_hwmod.h> | 17 | #include <plat/omap_hwmod.h> |
16 | #include <mach/irqs.h> | ||
17 | #include <plat/cpu.h> | ||
18 | #include <plat/dma.h> | 18 | #include <plat/dma.h> |
19 | #include <plat/serial.h> | 19 | #include <plat/serial.h> |
20 | #include <plat/i2c.h> | 20 | #include <plat/i2c.h> |
21 | #include <plat/gpio.h> | ||
22 | #include <plat/mcspi.h> | ||
23 | #include <plat/dmtimer.h> | 21 | #include <plat/dmtimer.h> |
24 | #include <plat/l3_2xxx.h> | 22 | #include "l3_2xxx.h" |
25 | #include <plat/l4_2xxx.h> | 23 | #include "l4_2xxx.h" |
26 | #include <plat/mmc.h> | 24 | #include <plat/mmc.h> |
27 | 25 | ||
28 | #include "omap_hwmod_common_data.h" | 26 | #include "omap_hwmod_common_data.h" |
@@ -162,9 +160,9 @@ static struct omap_hwmod omap2420_dma_system_hwmod = { | |||
162 | 160 | ||
163 | /* mailbox */ | 161 | /* mailbox */ |
164 | static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { | 162 | static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { |
165 | { .name = "dsp", .irq = 26 }, | 163 | { .name = "dsp", .irq = 26 + OMAP_INTC_START, }, |
166 | { .name = "iva", .irq = 34 }, | 164 | { .name = "iva", .irq = 34 + OMAP_INTC_START, }, |
167 | { .irq = -1 } | 165 | { .irq = -1 }, |
168 | }; | 166 | }; |
169 | 167 | ||
170 | static struct omap_hwmod omap2420_mailbox_hwmod = { | 168 | static struct omap_hwmod omap2420_mailbox_hwmod = { |
@@ -199,9 +197,9 @@ static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = { | |||
199 | 197 | ||
200 | /* mcbsp1 */ | 198 | /* mcbsp1 */ |
201 | static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = { | 199 | static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = { |
202 | { .name = "tx", .irq = 59 }, | 200 | { .name = "tx", .irq = 59 + OMAP_INTC_START, }, |
203 | { .name = "rx", .irq = 60 }, | 201 | { .name = "rx", .irq = 60 + OMAP_INTC_START, }, |
204 | { .irq = -1 } | 202 | { .irq = -1 }, |
205 | }; | 203 | }; |
206 | 204 | ||
207 | static struct omap_hwmod omap2420_mcbsp1_hwmod = { | 205 | static struct omap_hwmod omap2420_mcbsp1_hwmod = { |
@@ -225,9 +223,9 @@ static struct omap_hwmod omap2420_mcbsp1_hwmod = { | |||
225 | 223 | ||
226 | /* mcbsp2 */ | 224 | /* mcbsp2 */ |
227 | static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = { | 225 | static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = { |
228 | { .name = "tx", .irq = 62 }, | 226 | { .name = "tx", .irq = 62 + OMAP_INTC_START, }, |
229 | { .name = "rx", .irq = 63 }, | 227 | { .name = "rx", .irq = 63 + OMAP_INTC_START, }, |
230 | { .irq = -1 } | 228 | { .irq = -1 }, |
231 | }; | 229 | }; |
232 | 230 | ||
233 | static struct omap_hwmod omap2420_mcbsp2_hwmod = { | 231 | static struct omap_hwmod omap2420_mcbsp2_hwmod = { |
@@ -265,8 +263,8 @@ static struct omap_hwmod_class omap2420_msdi_hwmod_class = { | |||
265 | 263 | ||
266 | /* msdi1 */ | 264 | /* msdi1 */ |
267 | static struct omap_hwmod_irq_info omap2420_msdi1_irqs[] = { | 265 | static struct omap_hwmod_irq_info omap2420_msdi1_irqs[] = { |
268 | { .irq = 83 }, | 266 | { .irq = 83 + OMAP_INTC_START, }, |
269 | { .irq = -1 } | 267 | { .irq = -1 }, |
270 | }; | 268 | }; |
271 | 269 | ||
272 | static struct omap_hwmod_dma_info omap2420_msdi1_sdma_reqs[] = { | 270 | static struct omap_hwmod_dma_info omap2420_msdi1_sdma_reqs[] = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index 58b5bc196d32..60de70feeae5 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c | |||
@@ -12,21 +12,19 @@ | |||
12 | * XXX handle crossbar/shared link difference for L3? | 12 | * XXX handle crossbar/shared link difference for L3? |
13 | * XXX these should be marked initdata for multi-OMAP kernels | 13 | * XXX these should be marked initdata for multi-OMAP kernels |
14 | */ | 14 | */ |
15 | #include <linux/platform_data/asoc-ti-mcbsp.h> | ||
16 | #include <linux/platform_data/spi-omap2-mcspi.h> | ||
17 | |||
15 | #include <plat/omap_hwmod.h> | 18 | #include <plat/omap_hwmod.h> |
16 | #include <mach/irqs.h> | ||
17 | #include <plat/cpu.h> | ||
18 | #include <plat/dma.h> | 19 | #include <plat/dma.h> |
19 | #include <plat/serial.h> | 20 | #include <plat/serial.h> |
20 | #include <plat/i2c.h> | 21 | #include <plat/i2c.h> |
21 | #include <plat/gpio.h> | ||
22 | #include <plat/mcbsp.h> | ||
23 | #include <plat/mcspi.h> | ||
24 | #include <plat/dmtimer.h> | 22 | #include <plat/dmtimer.h> |
25 | #include <plat/mmc.h> | 23 | #include <plat/mmc.h> |
26 | #include <plat/l3_2xxx.h> | 24 | #include "l3_2xxx.h" |
27 | 25 | ||
26 | #include "soc.h" | ||
28 | #include "omap_hwmod_common_data.h" | 27 | #include "omap_hwmod_common_data.h" |
29 | |||
30 | #include "prm-regbits-24xx.h" | 28 | #include "prm-regbits-24xx.h" |
31 | #include "cm-regbits-24xx.h" | 29 | #include "cm-regbits-24xx.h" |
32 | #include "wd_timer.h" | 30 | #include "wd_timer.h" |
@@ -133,8 +131,8 @@ static struct omap_hwmod omap2430_i2c2_hwmod = { | |||
133 | 131 | ||
134 | /* gpio5 */ | 132 | /* gpio5 */ |
135 | static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = { | 133 | static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = { |
136 | { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */ | 134 | { .irq = 33 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK5 */ |
137 | { .irq = -1 } | 135 | { .irq = -1 }, |
138 | }; | 136 | }; |
139 | 137 | ||
140 | static struct omap_hwmod omap2430_gpio5_hwmod = { | 138 | static struct omap_hwmod omap2430_gpio5_hwmod = { |
@@ -173,8 +171,8 @@ static struct omap_hwmod omap2430_dma_system_hwmod = { | |||
173 | 171 | ||
174 | /* mailbox */ | 172 | /* mailbox */ |
175 | static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { | 173 | static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { |
176 | { .irq = 26 }, | 174 | { .irq = 26 + OMAP_INTC_START, }, |
177 | { .irq = -1 } | 175 | { .irq = -1 }, |
178 | }; | 176 | }; |
179 | 177 | ||
180 | static struct omap_hwmod omap2430_mailbox_hwmod = { | 178 | static struct omap_hwmod omap2430_mailbox_hwmod = { |
@@ -195,8 +193,8 @@ static struct omap_hwmod omap2430_mailbox_hwmod = { | |||
195 | 193 | ||
196 | /* mcspi3 */ | 194 | /* mcspi3 */ |
197 | static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = { | 195 | static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = { |
198 | { .irq = 91 }, | 196 | { .irq = 91 + OMAP_INTC_START, }, |
199 | { .irq = -1 } | 197 | { .irq = -1 }, |
200 | }; | 198 | }; |
201 | 199 | ||
202 | static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = { | 200 | static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = { |
@@ -250,9 +248,9 @@ static struct omap_hwmod_class usbotg_class = { | |||
250 | /* usb_otg_hs */ | 248 | /* usb_otg_hs */ |
251 | static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = { | 249 | static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = { |
252 | 250 | ||
253 | { .name = "mc", .irq = 92 }, | 251 | { .name = "mc", .irq = 92 + OMAP_INTC_START, }, |
254 | { .name = "dma", .irq = 93 }, | 252 | { .name = "dma", .irq = 93 + OMAP_INTC_START, }, |
255 | { .irq = -1 } | 253 | { .irq = -1 }, |
256 | }; | 254 | }; |
257 | 255 | ||
258 | static struct omap_hwmod omap2430_usbhsotg_hwmod = { | 256 | static struct omap_hwmod omap2430_usbhsotg_hwmod = { |
@@ -303,11 +301,11 @@ static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = { | |||
303 | 301 | ||
304 | /* mcbsp1 */ | 302 | /* mcbsp1 */ |
305 | static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = { | 303 | static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = { |
306 | { .name = "tx", .irq = 59 }, | 304 | { .name = "tx", .irq = 59 + OMAP_INTC_START, }, |
307 | { .name = "rx", .irq = 60 }, | 305 | { .name = "rx", .irq = 60 + OMAP_INTC_START, }, |
308 | { .name = "ovr", .irq = 61 }, | 306 | { .name = "ovr", .irq = 61 + OMAP_INTC_START, }, |
309 | { .name = "common", .irq = 64 }, | 307 | { .name = "common", .irq = 64 + OMAP_INTC_START, }, |
310 | { .irq = -1 } | 308 | { .irq = -1 }, |
311 | }; | 309 | }; |
312 | 310 | ||
313 | static struct omap_hwmod omap2430_mcbsp1_hwmod = { | 311 | static struct omap_hwmod omap2430_mcbsp1_hwmod = { |
@@ -331,10 +329,10 @@ static struct omap_hwmod omap2430_mcbsp1_hwmod = { | |||
331 | 329 | ||
332 | /* mcbsp2 */ | 330 | /* mcbsp2 */ |
333 | static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = { | 331 | static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = { |
334 | { .name = "tx", .irq = 62 }, | 332 | { .name = "tx", .irq = 62 + OMAP_INTC_START, }, |
335 | { .name = "rx", .irq = 63 }, | 333 | { .name = "rx", .irq = 63 + OMAP_INTC_START, }, |
336 | { .name = "common", .irq = 16 }, | 334 | { .name = "common", .irq = 16 + OMAP_INTC_START, }, |
337 | { .irq = -1 } | 335 | { .irq = -1 }, |
338 | }; | 336 | }; |
339 | 337 | ||
340 | static struct omap_hwmod omap2430_mcbsp2_hwmod = { | 338 | static struct omap_hwmod omap2430_mcbsp2_hwmod = { |
@@ -358,10 +356,10 @@ static struct omap_hwmod omap2430_mcbsp2_hwmod = { | |||
358 | 356 | ||
359 | /* mcbsp3 */ | 357 | /* mcbsp3 */ |
360 | static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = { | 358 | static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = { |
361 | { .name = "tx", .irq = 89 }, | 359 | { .name = "tx", .irq = 89 + OMAP_INTC_START, }, |
362 | { .name = "rx", .irq = 90 }, | 360 | { .name = "rx", .irq = 90 + OMAP_INTC_START, }, |
363 | { .name = "common", .irq = 17 }, | 361 | { .name = "common", .irq = 17 + OMAP_INTC_START, }, |
364 | { .irq = -1 } | 362 | { .irq = -1 }, |
365 | }; | 363 | }; |
366 | 364 | ||
367 | static struct omap_hwmod omap2430_mcbsp3_hwmod = { | 365 | static struct omap_hwmod omap2430_mcbsp3_hwmod = { |
@@ -385,10 +383,10 @@ static struct omap_hwmod omap2430_mcbsp3_hwmod = { | |||
385 | 383 | ||
386 | /* mcbsp4 */ | 384 | /* mcbsp4 */ |
387 | static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = { | 385 | static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = { |
388 | { .name = "tx", .irq = 54 }, | 386 | { .name = "tx", .irq = 54 + OMAP_INTC_START, }, |
389 | { .name = "rx", .irq = 55 }, | 387 | { .name = "rx", .irq = 55 + OMAP_INTC_START, }, |
390 | { .name = "common", .irq = 18 }, | 388 | { .name = "common", .irq = 18 + OMAP_INTC_START, }, |
391 | { .irq = -1 } | 389 | { .irq = -1 }, |
392 | }; | 390 | }; |
393 | 391 | ||
394 | static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = { | 392 | static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = { |
@@ -418,10 +416,10 @@ static struct omap_hwmod omap2430_mcbsp4_hwmod = { | |||
418 | 416 | ||
419 | /* mcbsp5 */ | 417 | /* mcbsp5 */ |
420 | static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = { | 418 | static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = { |
421 | { .name = "tx", .irq = 81 }, | 419 | { .name = "tx", .irq = 81 + OMAP_INTC_START, }, |
422 | { .name = "rx", .irq = 82 }, | 420 | { .name = "rx", .irq = 82 + OMAP_INTC_START, }, |
423 | { .name = "common", .irq = 19 }, | 421 | { .name = "common", .irq = 19 + OMAP_INTC_START, }, |
424 | { .irq = -1 } | 422 | { .irq = -1 }, |
425 | }; | 423 | }; |
426 | 424 | ||
427 | static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = { | 425 | static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = { |
@@ -468,8 +466,8 @@ static struct omap_hwmod_class omap2430_mmc_class = { | |||
468 | 466 | ||
469 | /* MMC/SD/SDIO1 */ | 467 | /* MMC/SD/SDIO1 */ |
470 | static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = { | 468 | static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = { |
471 | { .irq = 83 }, | 469 | { .irq = 83 + OMAP_INTC_START, }, |
472 | { .irq = -1 } | 470 | { .irq = -1 }, |
473 | }; | 471 | }; |
474 | 472 | ||
475 | static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = { | 473 | static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = { |
@@ -509,8 +507,8 @@ static struct omap_hwmod omap2430_mmc1_hwmod = { | |||
509 | 507 | ||
510 | /* MMC/SD/SDIO2 */ | 508 | /* MMC/SD/SDIO2 */ |
511 | static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = { | 509 | static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = { |
512 | { .irq = 86 }, | 510 | { .irq = 86 + OMAP_INTC_START, }, |
513 | { .irq = -1 } | 511 | { .irq = -1 }, |
514 | }; | 512 | }; |
515 | 513 | ||
516 | static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = { | 514 | static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c index 102d76e9e9ea..8851bbb6bb24 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c | |||
@@ -13,9 +13,7 @@ | |||
13 | #include <plat/serial.h> | 13 | #include <plat/serial.h> |
14 | #include <plat/dma.h> | 14 | #include <plat/dma.h> |
15 | #include <plat/common.h> | 15 | #include <plat/common.h> |
16 | #include <plat/hdq1w.h> | 16 | #include "hdq1w.h" |
17 | |||
18 | #include <mach/irqs.h> | ||
19 | 17 | ||
20 | #include "omap_hwmod_common_data.h" | 18 | #include "omap_hwmod_common_data.h" |
21 | 19 | ||
@@ -182,126 +180,126 @@ struct omap_hwmod_class iva_hwmod_class = { | |||
182 | /* Common MPU IRQ line data */ | 180 | /* Common MPU IRQ line data */ |
183 | 181 | ||
184 | struct omap_hwmod_irq_info omap2_timer1_mpu_irqs[] = { | 182 | struct omap_hwmod_irq_info omap2_timer1_mpu_irqs[] = { |
185 | { .irq = 37, }, | 183 | { .irq = 37 + OMAP_INTC_START, }, |
186 | { .irq = -1 } | 184 | { .irq = -1 }, |
187 | }; | 185 | }; |
188 | 186 | ||
189 | struct omap_hwmod_irq_info omap2_timer2_mpu_irqs[] = { | 187 | struct omap_hwmod_irq_info omap2_timer2_mpu_irqs[] = { |
190 | { .irq = 38, }, | 188 | { .irq = 38 + OMAP_INTC_START, }, |
191 | { .irq = -1 } | 189 | { .irq = -1 }, |
192 | }; | 190 | }; |
193 | 191 | ||
194 | struct omap_hwmod_irq_info omap2_timer3_mpu_irqs[] = { | 192 | struct omap_hwmod_irq_info omap2_timer3_mpu_irqs[] = { |
195 | { .irq = 39, }, | 193 | { .irq = 39 + OMAP_INTC_START, }, |
196 | { .irq = -1 } | 194 | { .irq = -1 }, |
197 | }; | 195 | }; |
198 | 196 | ||
199 | struct omap_hwmod_irq_info omap2_timer4_mpu_irqs[] = { | 197 | struct omap_hwmod_irq_info omap2_timer4_mpu_irqs[] = { |
200 | { .irq = 40, }, | 198 | { .irq = 40 + OMAP_INTC_START, }, |
201 | { .irq = -1 } | 199 | { .irq = -1 }, |
202 | }; | 200 | }; |
203 | 201 | ||
204 | struct omap_hwmod_irq_info omap2_timer5_mpu_irqs[] = { | 202 | struct omap_hwmod_irq_info omap2_timer5_mpu_irqs[] = { |
205 | { .irq = 41, }, | 203 | { .irq = 41 + OMAP_INTC_START, }, |
206 | { .irq = -1 } | 204 | { .irq = -1 }, |
207 | }; | 205 | }; |
208 | 206 | ||
209 | struct omap_hwmod_irq_info omap2_timer6_mpu_irqs[] = { | 207 | struct omap_hwmod_irq_info omap2_timer6_mpu_irqs[] = { |
210 | { .irq = 42, }, | 208 | { .irq = 42 + OMAP_INTC_START, }, |
211 | { .irq = -1 } | 209 | { .irq = -1 }, |
212 | }; | 210 | }; |
213 | 211 | ||
214 | struct omap_hwmod_irq_info omap2_timer7_mpu_irqs[] = { | 212 | struct omap_hwmod_irq_info omap2_timer7_mpu_irqs[] = { |
215 | { .irq = 43, }, | 213 | { .irq = 43 + OMAP_INTC_START, }, |
216 | { .irq = -1 } | 214 | { .irq = -1 }, |
217 | }; | 215 | }; |
218 | 216 | ||
219 | struct omap_hwmod_irq_info omap2_timer8_mpu_irqs[] = { | 217 | struct omap_hwmod_irq_info omap2_timer8_mpu_irqs[] = { |
220 | { .irq = 44, }, | 218 | { .irq = 44 + OMAP_INTC_START, }, |
221 | { .irq = -1 } | 219 | { .irq = -1 }, |
222 | }; | 220 | }; |
223 | 221 | ||
224 | struct omap_hwmod_irq_info omap2_timer9_mpu_irqs[] = { | 222 | struct omap_hwmod_irq_info omap2_timer9_mpu_irqs[] = { |
225 | { .irq = 45, }, | 223 | { .irq = 45 + OMAP_INTC_START, }, |
226 | { .irq = -1 } | 224 | { .irq = -1 }, |
227 | }; | 225 | }; |
228 | 226 | ||
229 | struct omap_hwmod_irq_info omap2_timer10_mpu_irqs[] = { | 227 | struct omap_hwmod_irq_info omap2_timer10_mpu_irqs[] = { |
230 | { .irq = 46, }, | 228 | { .irq = 46 + OMAP_INTC_START, }, |
231 | { .irq = -1 } | 229 | { .irq = -1 }, |
232 | }; | 230 | }; |
233 | 231 | ||
234 | struct omap_hwmod_irq_info omap2_timer11_mpu_irqs[] = { | 232 | struct omap_hwmod_irq_info omap2_timer11_mpu_irqs[] = { |
235 | { .irq = 47, }, | 233 | { .irq = 47 + OMAP_INTC_START, }, |
236 | { .irq = -1 } | 234 | { .irq = -1 }, |
237 | }; | 235 | }; |
238 | 236 | ||
239 | struct omap_hwmod_irq_info omap2_uart1_mpu_irqs[] = { | 237 | struct omap_hwmod_irq_info omap2_uart1_mpu_irqs[] = { |
240 | { .irq = INT_24XX_UART1_IRQ, }, | 238 | { .irq = 72 + OMAP_INTC_START, }, |
241 | { .irq = -1 } | 239 | { .irq = -1 }, |
242 | }; | 240 | }; |
243 | 241 | ||
244 | struct omap_hwmod_irq_info omap2_uart2_mpu_irqs[] = { | 242 | struct omap_hwmod_irq_info omap2_uart2_mpu_irqs[] = { |
245 | { .irq = INT_24XX_UART2_IRQ, }, | 243 | { .irq = 73 + OMAP_INTC_START, }, |
246 | { .irq = -1 } | 244 | { .irq = -1 }, |
247 | }; | 245 | }; |
248 | 246 | ||
249 | struct omap_hwmod_irq_info omap2_uart3_mpu_irqs[] = { | 247 | struct omap_hwmod_irq_info omap2_uart3_mpu_irqs[] = { |
250 | { .irq = INT_24XX_UART3_IRQ, }, | 248 | { .irq = 74 + OMAP_INTC_START, }, |
251 | { .irq = -1 } | 249 | { .irq = -1 }, |
252 | }; | 250 | }; |
253 | 251 | ||
254 | struct omap_hwmod_irq_info omap2_dispc_irqs[] = { | 252 | struct omap_hwmod_irq_info omap2_dispc_irqs[] = { |
255 | { .irq = 25 }, | 253 | { .irq = 25 + OMAP_INTC_START, }, |
256 | { .irq = -1 } | 254 | { .irq = -1 }, |
257 | }; | 255 | }; |
258 | 256 | ||
259 | struct omap_hwmod_irq_info omap2_i2c1_mpu_irqs[] = { | 257 | struct omap_hwmod_irq_info omap2_i2c1_mpu_irqs[] = { |
260 | { .irq = INT_24XX_I2C1_IRQ, }, | 258 | { .irq = 56 + OMAP_INTC_START, }, |
261 | { .irq = -1 } | 259 | { .irq = -1 }, |
262 | }; | 260 | }; |
263 | 261 | ||
264 | struct omap_hwmod_irq_info omap2_i2c2_mpu_irqs[] = { | 262 | struct omap_hwmod_irq_info omap2_i2c2_mpu_irqs[] = { |
265 | { .irq = INT_24XX_I2C2_IRQ, }, | 263 | { .irq = 57 + OMAP_INTC_START, }, |
266 | { .irq = -1 } | 264 | { .irq = -1 }, |
267 | }; | 265 | }; |
268 | 266 | ||
269 | struct omap_hwmod_irq_info omap2_gpio1_irqs[] = { | 267 | struct omap_hwmod_irq_info omap2_gpio1_irqs[] = { |
270 | { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */ | 268 | { .irq = 29 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK1 */ |
271 | { .irq = -1 } | 269 | { .irq = -1 }, |
272 | }; | 270 | }; |
273 | 271 | ||
274 | struct omap_hwmod_irq_info omap2_gpio2_irqs[] = { | 272 | struct omap_hwmod_irq_info omap2_gpio2_irqs[] = { |
275 | { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */ | 273 | { .irq = 30 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK2 */ |
276 | { .irq = -1 } | 274 | { .irq = -1 }, |
277 | }; | 275 | }; |
278 | 276 | ||
279 | struct omap_hwmod_irq_info omap2_gpio3_irqs[] = { | 277 | struct omap_hwmod_irq_info omap2_gpio3_irqs[] = { |
280 | { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */ | 278 | { .irq = 31 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK3 */ |
281 | { .irq = -1 } | 279 | { .irq = -1 }, |
282 | }; | 280 | }; |
283 | 281 | ||
284 | struct omap_hwmod_irq_info omap2_gpio4_irqs[] = { | 282 | struct omap_hwmod_irq_info omap2_gpio4_irqs[] = { |
285 | { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */ | 283 | { .irq = 32 + OMAP_INTC_START, }, /* INT_24XX_GPIO_BANK4 */ |
286 | { .irq = -1 } | 284 | { .irq = -1 }, |
287 | }; | 285 | }; |
288 | 286 | ||
289 | struct omap_hwmod_irq_info omap2_dma_system_irqs[] = { | 287 | struct omap_hwmod_irq_info omap2_dma_system_irqs[] = { |
290 | { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */ | 288 | { .name = "0", .irq = 12 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ0 */ |
291 | { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */ | 289 | { .name = "1", .irq = 13 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ1 */ |
292 | { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */ | 290 | { .name = "2", .irq = 14 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ2 */ |
293 | { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */ | 291 | { .name = "3", .irq = 15 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ3 */ |
294 | { .irq = -1 } | 292 | { .irq = -1 }, |
295 | }; | 293 | }; |
296 | 294 | ||
297 | struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[] = { | 295 | struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[] = { |
298 | { .irq = 65 }, | 296 | { .irq = 65 + OMAP_INTC_START, }, |
299 | { .irq = -1 } | 297 | { .irq = -1 }, |
300 | }; | 298 | }; |
301 | 299 | ||
302 | struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[] = { | 300 | struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[] = { |
303 | { .irq = 66 }, | 301 | { .irq = 66 + OMAP_INTC_START, }, |
304 | { .irq = -1 } | 302 | { .irq = -1 }, |
305 | }; | 303 | }; |
306 | 304 | ||
307 | struct omap_hwmod_class_sysconfig omap2_hdq1w_sysc = { | 305 | struct omap_hwmod_class_sysconfig omap2_hdq1w_sysc = { |
@@ -320,7 +318,7 @@ struct omap_hwmod_class omap2_hdq1w_class = { | |||
320 | }; | 318 | }; |
321 | 319 | ||
322 | struct omap_hwmod_irq_info omap2_hdq1w_mpu_irqs[] = { | 320 | struct omap_hwmod_irq_info omap2_hdq1w_mpu_irqs[] = { |
323 | { .irq = 58, }, | 321 | { .irq = 58 + OMAP_INTC_START, }, |
324 | { .irq = -1 } | 322 | { .irq = -1 }, |
325 | }; | 323 | }; |
326 | 324 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c index 5178e40e84f9..f853a0b1d5ca 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c | |||
@@ -15,8 +15,8 @@ | |||
15 | 15 | ||
16 | #include <plat/omap_hwmod.h> | 16 | #include <plat/omap_hwmod.h> |
17 | #include <plat/serial.h> | 17 | #include <plat/serial.h> |
18 | #include <plat/l3_2xxx.h> | 18 | #include "l3_2xxx.h" |
19 | #include <plat/l4_2xxx.h> | 19 | #include "l4_2xxx.h" |
20 | 20 | ||
21 | #include "omap_hwmod_common_data.h" | 21 | #include "omap_hwmod_common_data.h" |
22 | 22 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c index afad69c6ba6e..feeb401cf87e 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | |||
@@ -10,12 +10,10 @@ | |||
10 | */ | 10 | */ |
11 | #include <plat/omap_hwmod.h> | 11 | #include <plat/omap_hwmod.h> |
12 | #include <plat/serial.h> | 12 | #include <plat/serial.h> |
13 | #include <plat/gpio.h> | 13 | #include <linux/platform_data/gpio-omap.h> |
14 | #include <plat/dma.h> | 14 | #include <plat/dma.h> |
15 | #include <plat/dmtimer.h> | 15 | #include <plat/dmtimer.h> |
16 | #include <plat/mcspi.h> | 16 | #include <linux/platform_data/spi-omap2-mcspi.h> |
17 | |||
18 | #include <mach/irqs.h> | ||
19 | 17 | ||
20 | #include "omap_hwmod_common_data.h" | 18 | #include "omap_hwmod_common_data.h" |
21 | #include "cm-regbits-24xx.h" | 19 | #include "cm-regbits-24xx.h" |
@@ -23,8 +21,8 @@ | |||
23 | #include "wd_timer.h" | 21 | #include "wd_timer.h" |
24 | 22 | ||
25 | struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = { | 23 | struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = { |
26 | { .irq = 48, }, | 24 | { .irq = 48 + OMAP_INTC_START, }, |
27 | { .irq = -1 } | 25 | { .irq = -1 }, |
28 | }; | 26 | }; |
29 | 27 | ||
30 | struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = { | 28 | struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index ce7e6068768f..94b38af17055 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -15,26 +15,26 @@ | |||
15 | * XXX these should be marked initdata for multi-OMAP kernels | 15 | * XXX these should be marked initdata for multi-OMAP kernels |
16 | */ | 16 | */ |
17 | #include <linux/power/smartreflex.h> | 17 | #include <linux/power/smartreflex.h> |
18 | #include <linux/platform_data/gpio-omap.h> | ||
18 | 19 | ||
19 | #include <plat/omap_hwmod.h> | 20 | #include <plat/omap_hwmod.h> |
20 | #include <mach/irqs.h> | ||
21 | #include <plat/cpu.h> | ||
22 | #include <plat/dma.h> | 21 | #include <plat/dma.h> |
23 | #include <plat/serial.h> | 22 | #include <plat/serial.h> |
24 | #include <plat/l3_3xxx.h> | 23 | #include "l3_3xxx.h" |
25 | #include <plat/l4_3xxx.h> | 24 | #include "l4_3xxx.h" |
26 | #include <plat/i2c.h> | 25 | #include <plat/i2c.h> |
27 | #include <plat/gpio.h> | ||
28 | #include <plat/mmc.h> | 26 | #include <plat/mmc.h> |
29 | #include <plat/mcbsp.h> | 27 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
30 | #include <plat/mcspi.h> | 28 | #include <linux/platform_data/spi-omap2-mcspi.h> |
31 | #include <plat/dmtimer.h> | 29 | #include <plat/dmtimer.h> |
32 | 30 | ||
31 | #include "am35xx.h" | ||
32 | |||
33 | #include "soc.h" | ||
33 | #include "omap_hwmod_common_data.h" | 34 | #include "omap_hwmod_common_data.h" |
34 | #include "prm-regbits-34xx.h" | 35 | #include "prm-regbits-34xx.h" |
35 | #include "cm-regbits-34xx.h" | 36 | #include "cm-regbits-34xx.h" |
36 | #include "wd_timer.h" | 37 | #include "wd_timer.h" |
37 | #include <mach/am35xx.h> | ||
38 | 38 | ||
39 | /* | 39 | /* |
40 | * OMAP3xxx hardware module integration data | 40 | * OMAP3xxx hardware module integration data |
@@ -51,9 +51,9 @@ | |||
51 | 51 | ||
52 | /* L3 */ | 52 | /* L3 */ |
53 | static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = { | 53 | static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = { |
54 | { .irq = INT_34XX_L3_DBG_IRQ }, | 54 | { .irq = 9 + OMAP_INTC_START, }, |
55 | { .irq = INT_34XX_L3_APP_IRQ }, | 55 | { .irq = 10 + OMAP_INTC_START, }, |
56 | { .irq = -1 } | 56 | { .irq = -1 }, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static struct omap_hwmod omap3xxx_l3_main_hwmod = { | 59 | static struct omap_hwmod omap3xxx_l3_main_hwmod = { |
@@ -364,8 +364,8 @@ static struct omap_hwmod omap3xxx_timer11_hwmod = { | |||
364 | 364 | ||
365 | /* timer12 */ | 365 | /* timer12 */ |
366 | static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = { | 366 | static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = { |
367 | { .irq = 95, }, | 367 | { .irq = 95 + OMAP_INTC_START, }, |
368 | { .irq = -1 } | 368 | { .irq = -1 }, |
369 | }; | 369 | }; |
370 | 370 | ||
371 | static struct omap_hwmod omap3xxx_timer12_hwmod = { | 371 | static struct omap_hwmod omap3xxx_timer12_hwmod = { |
@@ -499,8 +499,8 @@ static struct omap_hwmod omap3xxx_uart3_hwmod = { | |||
499 | 499 | ||
500 | /* UART4 */ | 500 | /* UART4 */ |
501 | static struct omap_hwmod_irq_info uart4_mpu_irqs[] = { | 501 | static struct omap_hwmod_irq_info uart4_mpu_irqs[] = { |
502 | { .irq = INT_36XX_UART4_IRQ, }, | 502 | { .irq = 80 + OMAP_INTC_START, }, |
503 | { .irq = -1 } | 503 | { .irq = -1 }, |
504 | }; | 504 | }; |
505 | 505 | ||
506 | static struct omap_hwmod_dma_info uart4_sdma_reqs[] = { | 506 | static struct omap_hwmod_dma_info uart4_sdma_reqs[] = { |
@@ -527,8 +527,8 @@ static struct omap_hwmod omap36xx_uart4_hwmod = { | |||
527 | }; | 527 | }; |
528 | 528 | ||
529 | static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = { | 529 | static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = { |
530 | { .irq = INT_35XX_UART4_IRQ, }, | 530 | { .irq = 84 + OMAP_INTC_START, }, |
531 | { .irq = -1 } | 531 | { .irq = -1 }, |
532 | }; | 532 | }; |
533 | 533 | ||
534 | static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = { | 534 | static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = { |
@@ -683,8 +683,8 @@ static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = { | |||
683 | }; | 683 | }; |
684 | 684 | ||
685 | static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = { | 685 | static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = { |
686 | { .irq = 25 }, | 686 | { .irq = 25 + OMAP_INTC_START, }, |
687 | { .irq = -1 } | 687 | { .irq = -1 }, |
688 | }; | 688 | }; |
689 | 689 | ||
690 | /* dss_dsi1 */ | 690 | /* dss_dsi1 */ |
@@ -813,8 +813,8 @@ static struct omap_i2c_dev_attr i2c3_dev_attr = { | |||
813 | }; | 813 | }; |
814 | 814 | ||
815 | static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = { | 815 | static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = { |
816 | { .irq = INT_34XX_I2C3_IRQ, }, | 816 | { .irq = 61 + OMAP_INTC_START, }, |
817 | { .irq = -1 } | 817 | { .irq = -1 }, |
818 | }; | 818 | }; |
819 | 819 | ||
820 | static struct omap_hwmod_dma_info i2c3_sdma_reqs[] = { | 820 | static struct omap_hwmod_dma_info i2c3_sdma_reqs[] = { |
@@ -972,8 +972,8 @@ static struct omap_hwmod omap3xxx_gpio4_hwmod = { | |||
972 | 972 | ||
973 | /* gpio5 */ | 973 | /* gpio5 */ |
974 | static struct omap_hwmod_irq_info omap3xxx_gpio5_irqs[] = { | 974 | static struct omap_hwmod_irq_info omap3xxx_gpio5_irqs[] = { |
975 | { .irq = 33 }, /* INT_34XX_GPIO_BANK5 */ | 975 | { .irq = 33 + OMAP_INTC_START, }, /* INT_34XX_GPIO_BANK5 */ |
976 | { .irq = -1 } | 976 | { .irq = -1 }, |
977 | }; | 977 | }; |
978 | 978 | ||
979 | static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { | 979 | static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { |
@@ -1002,8 +1002,8 @@ static struct omap_hwmod omap3xxx_gpio5_hwmod = { | |||
1002 | 1002 | ||
1003 | /* gpio6 */ | 1003 | /* gpio6 */ |
1004 | static struct omap_hwmod_irq_info omap3xxx_gpio6_irqs[] = { | 1004 | static struct omap_hwmod_irq_info omap3xxx_gpio6_irqs[] = { |
1005 | { .irq = 34 }, /* INT_34XX_GPIO_BANK6 */ | 1005 | { .irq = 34 + OMAP_INTC_START, }, /* INT_34XX_GPIO_BANK6 */ |
1006 | { .irq = -1 } | 1006 | { .irq = -1 }, |
1007 | }; | 1007 | }; |
1008 | 1008 | ||
1009 | static struct omap_hwmod_opt_clk gpio6_opt_clks[] = { | 1009 | static struct omap_hwmod_opt_clk gpio6_opt_clks[] = { |
@@ -1107,10 +1107,10 @@ static struct omap_hwmod_opt_clk mcbsp234_opt_clks[] = { | |||
1107 | 1107 | ||
1108 | /* mcbsp1 */ | 1108 | /* mcbsp1 */ |
1109 | static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = { | 1109 | static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = { |
1110 | { .name = "common", .irq = 16 }, | 1110 | { .name = "common", .irq = 16 + OMAP_INTC_START, }, |
1111 | { .name = "tx", .irq = 59 }, | 1111 | { .name = "tx", .irq = 59 + OMAP_INTC_START, }, |
1112 | { .name = "rx", .irq = 60 }, | 1112 | { .name = "rx", .irq = 60 + OMAP_INTC_START, }, |
1113 | { .irq = -1 } | 1113 | { .irq = -1 }, |
1114 | }; | 1114 | }; |
1115 | 1115 | ||
1116 | static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { | 1116 | static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { |
@@ -1134,10 +1134,10 @@ static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { | |||
1134 | 1134 | ||
1135 | /* mcbsp2 */ | 1135 | /* mcbsp2 */ |
1136 | static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = { | 1136 | static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = { |
1137 | { .name = "common", .irq = 17 }, | 1137 | { .name = "common", .irq = 17 + OMAP_INTC_START, }, |
1138 | { .name = "tx", .irq = 62 }, | 1138 | { .name = "tx", .irq = 62 + OMAP_INTC_START, }, |
1139 | { .name = "rx", .irq = 63 }, | 1139 | { .name = "rx", .irq = 63 + OMAP_INTC_START, }, |
1140 | { .irq = -1 } | 1140 | { .irq = -1 }, |
1141 | }; | 1141 | }; |
1142 | 1142 | ||
1143 | static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = { | 1143 | static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = { |
@@ -1166,10 +1166,10 @@ static struct omap_hwmod omap3xxx_mcbsp2_hwmod = { | |||
1166 | 1166 | ||
1167 | /* mcbsp3 */ | 1167 | /* mcbsp3 */ |
1168 | static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = { | 1168 | static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = { |
1169 | { .name = "common", .irq = 22 }, | 1169 | { .name = "common", .irq = 22 + OMAP_INTC_START, }, |
1170 | { .name = "tx", .irq = 89 }, | 1170 | { .name = "tx", .irq = 89 + OMAP_INTC_START, }, |
1171 | { .name = "rx", .irq = 90 }, | 1171 | { .name = "rx", .irq = 90 + OMAP_INTC_START, }, |
1172 | { .irq = -1 } | 1172 | { .irq = -1 }, |
1173 | }; | 1173 | }; |
1174 | 1174 | ||
1175 | static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = { | 1175 | static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = { |
@@ -1198,10 +1198,10 @@ static struct omap_hwmod omap3xxx_mcbsp3_hwmod = { | |||
1198 | 1198 | ||
1199 | /* mcbsp4 */ | 1199 | /* mcbsp4 */ |
1200 | static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = { | 1200 | static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = { |
1201 | { .name = "common", .irq = 23 }, | 1201 | { .name = "common", .irq = 23 + OMAP_INTC_START, }, |
1202 | { .name = "tx", .irq = 54 }, | 1202 | { .name = "tx", .irq = 54 + OMAP_INTC_START, }, |
1203 | { .name = "rx", .irq = 55 }, | 1203 | { .name = "rx", .irq = 55 + OMAP_INTC_START, }, |
1204 | { .irq = -1 } | 1204 | { .irq = -1 }, |
1205 | }; | 1205 | }; |
1206 | 1206 | ||
1207 | static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = { | 1207 | static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = { |
@@ -1231,10 +1231,10 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod = { | |||
1231 | 1231 | ||
1232 | /* mcbsp5 */ | 1232 | /* mcbsp5 */ |
1233 | static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = { | 1233 | static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = { |
1234 | { .name = "common", .irq = 27 }, | 1234 | { .name = "common", .irq = 27 + OMAP_INTC_START, }, |
1235 | { .name = "tx", .irq = 81 }, | 1235 | { .name = "tx", .irq = 81 + OMAP_INTC_START, }, |
1236 | { .name = "rx", .irq = 82 }, | 1236 | { .name = "rx", .irq = 82 + OMAP_INTC_START, }, |
1237 | { .irq = -1 } | 1237 | { .irq = -1 }, |
1238 | }; | 1238 | }; |
1239 | 1239 | ||
1240 | static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = { | 1240 | static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = { |
@@ -1276,8 +1276,8 @@ static struct omap_hwmod_class omap3xxx_mcbsp_sidetone_hwmod_class = { | |||
1276 | 1276 | ||
1277 | /* mcbsp2_sidetone */ | 1277 | /* mcbsp2_sidetone */ |
1278 | static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = { | 1278 | static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = { |
1279 | { .name = "irq", .irq = 4 }, | 1279 | { .name = "irq", .irq = 4 + OMAP_INTC_START, }, |
1280 | { .irq = -1 } | 1280 | { .irq = -1 }, |
1281 | }; | 1281 | }; |
1282 | 1282 | ||
1283 | static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { | 1283 | static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { |
@@ -1298,8 +1298,8 @@ static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { | |||
1298 | 1298 | ||
1299 | /* mcbsp3_sidetone */ | 1299 | /* mcbsp3_sidetone */ |
1300 | static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = { | 1300 | static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = { |
1301 | { .name = "irq", .irq = 5 }, | 1301 | { .name = "irq", .irq = 5 + OMAP_INTC_START, }, |
1302 | { .irq = -1 } | 1302 | { .irq = -1 }, |
1303 | }; | 1303 | }; |
1304 | 1304 | ||
1305 | static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = { | 1305 | static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = { |
@@ -1361,8 +1361,8 @@ static struct omap_smartreflex_dev_attr sr1_dev_attr = { | |||
1361 | }; | 1361 | }; |
1362 | 1362 | ||
1363 | static struct omap_hwmod_irq_info omap3_smartreflex_mpu_irqs[] = { | 1363 | static struct omap_hwmod_irq_info omap3_smartreflex_mpu_irqs[] = { |
1364 | { .irq = 18 }, | 1364 | { .irq = 18 + OMAP_INTC_START, }, |
1365 | { .irq = -1 } | 1365 | { .irq = -1 }, |
1366 | }; | 1366 | }; |
1367 | 1367 | ||
1368 | static struct omap_hwmod omap34xx_sr1_hwmod = { | 1368 | static struct omap_hwmod omap34xx_sr1_hwmod = { |
@@ -1406,8 +1406,8 @@ static struct omap_smartreflex_dev_attr sr2_dev_attr = { | |||
1406 | }; | 1406 | }; |
1407 | 1407 | ||
1408 | static struct omap_hwmod_irq_info omap3_smartreflex_core_irqs[] = { | 1408 | static struct omap_hwmod_irq_info omap3_smartreflex_core_irqs[] = { |
1409 | { .irq = 19 }, | 1409 | { .irq = 19 + OMAP_INTC_START, }, |
1410 | { .irq = -1 } | 1410 | { .irq = -1 }, |
1411 | }; | 1411 | }; |
1412 | 1412 | ||
1413 | static struct omap_hwmod omap34xx_sr2_hwmod = { | 1413 | static struct omap_hwmod omap34xx_sr2_hwmod = { |
@@ -1467,8 +1467,8 @@ static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = { | |||
1467 | }; | 1467 | }; |
1468 | 1468 | ||
1469 | static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = { | 1469 | static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = { |
1470 | { .irq = 26 }, | 1470 | { .irq = 26 + OMAP_INTC_START, }, |
1471 | { .irq = -1 } | 1471 | { .irq = -1 }, |
1472 | }; | 1472 | }; |
1473 | 1473 | ||
1474 | static struct omap_hwmod omap3xxx_mailbox_hwmod = { | 1474 | static struct omap_hwmod omap3xxx_mailbox_hwmod = { |
@@ -1558,8 +1558,8 @@ static struct omap_hwmod omap34xx_mcspi2 = { | |||
1558 | 1558 | ||
1559 | /* mcspi3 */ | 1559 | /* mcspi3 */ |
1560 | static struct omap_hwmod_irq_info omap34xx_mcspi3_mpu_irqs[] = { | 1560 | static struct omap_hwmod_irq_info omap34xx_mcspi3_mpu_irqs[] = { |
1561 | { .name = "irq", .irq = 91 }, /* 91 */ | 1561 | { .name = "irq", .irq = 91 + OMAP_INTC_START, }, /* 91 */ |
1562 | { .irq = -1 } | 1562 | { .irq = -1 }, |
1563 | }; | 1563 | }; |
1564 | 1564 | ||
1565 | static struct omap_hwmod_dma_info omap34xx_mcspi3_sdma_reqs[] = { | 1565 | static struct omap_hwmod_dma_info omap34xx_mcspi3_sdma_reqs[] = { |
@@ -1594,8 +1594,8 @@ static struct omap_hwmod omap34xx_mcspi3 = { | |||
1594 | 1594 | ||
1595 | /* mcspi4 */ | 1595 | /* mcspi4 */ |
1596 | static struct omap_hwmod_irq_info omap34xx_mcspi4_mpu_irqs[] = { | 1596 | static struct omap_hwmod_irq_info omap34xx_mcspi4_mpu_irqs[] = { |
1597 | { .name = "irq", .irq = INT_34XX_SPI4_IRQ }, /* 48 */ | 1597 | { .name = "irq", .irq = 48 + OMAP_INTC_START, }, |
1598 | { .irq = -1 } | 1598 | { .irq = -1 }, |
1599 | }; | 1599 | }; |
1600 | 1600 | ||
1601 | static struct omap_hwmod_dma_info omap34xx_mcspi4_sdma_reqs[] = { | 1601 | static struct omap_hwmod_dma_info omap34xx_mcspi4_sdma_reqs[] = { |
@@ -1647,9 +1647,9 @@ static struct omap_hwmod_class usbotg_class = { | |||
1647 | /* usb_otg_hs */ | 1647 | /* usb_otg_hs */ |
1648 | static struct omap_hwmod_irq_info omap3xxx_usbhsotg_mpu_irqs[] = { | 1648 | static struct omap_hwmod_irq_info omap3xxx_usbhsotg_mpu_irqs[] = { |
1649 | 1649 | ||
1650 | { .name = "mc", .irq = 92 }, | 1650 | { .name = "mc", .irq = 92 + OMAP_INTC_START, }, |
1651 | { .name = "dma", .irq = 93 }, | 1651 | { .name = "dma", .irq = 93 + OMAP_INTC_START, }, |
1652 | { .irq = -1 } | 1652 | { .irq = -1 }, |
1653 | }; | 1653 | }; |
1654 | 1654 | ||
1655 | static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { | 1655 | static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { |
@@ -1679,8 +1679,8 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { | |||
1679 | 1679 | ||
1680 | /* usb_otg_hs */ | 1680 | /* usb_otg_hs */ |
1681 | static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = { | 1681 | static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = { |
1682 | { .name = "mc", .irq = 71 }, | 1682 | { .name = "mc", .irq = 71 + OMAP_INTC_START, }, |
1683 | { .irq = -1 } | 1683 | { .irq = -1 }, |
1684 | }; | 1684 | }; |
1685 | 1685 | ||
1686 | static struct omap_hwmod_class am35xx_usbotg_class = { | 1686 | static struct omap_hwmod_class am35xx_usbotg_class = { |
@@ -1715,8 +1715,8 @@ static struct omap_hwmod_class omap34xx_mmc_class = { | |||
1715 | /* MMC/SD/SDIO1 */ | 1715 | /* MMC/SD/SDIO1 */ |
1716 | 1716 | ||
1717 | static struct omap_hwmod_irq_info omap34xx_mmc1_mpu_irqs[] = { | 1717 | static struct omap_hwmod_irq_info omap34xx_mmc1_mpu_irqs[] = { |
1718 | { .irq = 83, }, | 1718 | { .irq = 83 + OMAP_INTC_START, }, |
1719 | { .irq = -1 } | 1719 | { .irq = -1 }, |
1720 | }; | 1720 | }; |
1721 | 1721 | ||
1722 | static struct omap_hwmod_dma_info omap34xx_mmc1_sdma_reqs[] = { | 1722 | static struct omap_hwmod_dma_info omap34xx_mmc1_sdma_reqs[] = { |
@@ -1782,8 +1782,8 @@ static struct omap_hwmod omap3xxx_es3plus_mmc1_hwmod = { | |||
1782 | /* MMC/SD/SDIO2 */ | 1782 | /* MMC/SD/SDIO2 */ |
1783 | 1783 | ||
1784 | static struct omap_hwmod_irq_info omap34xx_mmc2_mpu_irqs[] = { | 1784 | static struct omap_hwmod_irq_info omap34xx_mmc2_mpu_irqs[] = { |
1785 | { .irq = INT_24XX_MMC2_IRQ, }, | 1785 | { .irq = 86 + OMAP_INTC_START, }, |
1786 | { .irq = -1 } | 1786 | { .irq = -1 }, |
1787 | }; | 1787 | }; |
1788 | 1788 | ||
1789 | static struct omap_hwmod_dma_info omap34xx_mmc2_sdma_reqs[] = { | 1789 | static struct omap_hwmod_dma_info omap34xx_mmc2_sdma_reqs[] = { |
@@ -1843,8 +1843,8 @@ static struct omap_hwmod omap3xxx_es3plus_mmc2_hwmod = { | |||
1843 | /* MMC/SD/SDIO3 */ | 1843 | /* MMC/SD/SDIO3 */ |
1844 | 1844 | ||
1845 | static struct omap_hwmod_irq_info omap34xx_mmc3_mpu_irqs[] = { | 1845 | static struct omap_hwmod_irq_info omap34xx_mmc3_mpu_irqs[] = { |
1846 | { .irq = 94, }, | 1846 | { .irq = 94 + OMAP_INTC_START, }, |
1847 | { .irq = -1 } | 1847 | { .irq = -1 }, |
1848 | }; | 1848 | }; |
1849 | 1849 | ||
1850 | static struct omap_hwmod_dma_info omap34xx_mmc3_sdma_reqs[] = { | 1850 | static struct omap_hwmod_dma_info omap34xx_mmc3_sdma_reqs[] = { |
@@ -1902,9 +1902,9 @@ static struct omap_hwmod_opt_clk omap3xxx_usb_host_hs_opt_clks[] = { | |||
1902 | }; | 1902 | }; |
1903 | 1903 | ||
1904 | static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = { | 1904 | static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = { |
1905 | { .name = "ohci-irq", .irq = 76 }, | 1905 | { .name = "ohci-irq", .irq = 76 + OMAP_INTC_START, }, |
1906 | { .name = "ehci-irq", .irq = 77 }, | 1906 | { .name = "ehci-irq", .irq = 77 + OMAP_INTC_START, }, |
1907 | { .irq = -1 } | 1907 | { .irq = -1 }, |
1908 | }; | 1908 | }; |
1909 | 1909 | ||
1910 | static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = { | 1910 | static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = { |
@@ -1996,8 +1996,8 @@ static struct omap_hwmod_class omap3xxx_usb_tll_hs_hwmod_class = { | |||
1996 | }; | 1996 | }; |
1997 | 1997 | ||
1998 | static struct omap_hwmod_irq_info omap3xxx_usb_tll_hs_irqs[] = { | 1998 | static struct omap_hwmod_irq_info omap3xxx_usb_tll_hs_irqs[] = { |
1999 | { .name = "tll-irq", .irq = 78 }, | 1999 | { .name = "tll-irq", .irq = 78 + OMAP_INTC_START, }, |
2000 | { .irq = -1 } | 2000 | { .irq = -1 }, |
2001 | }; | 2001 | }; |
2002 | 2002 | ||
2003 | static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = { | 2003 | static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = { |
@@ -3223,11 +3223,11 @@ static struct omap_hwmod_ocp_if am35xx_l4_core__mdio = { | |||
3223 | }; | 3223 | }; |
3224 | 3224 | ||
3225 | static struct omap_hwmod_irq_info am35xx_emac_mpu_irqs[] = { | 3225 | static struct omap_hwmod_irq_info am35xx_emac_mpu_irqs[] = { |
3226 | { .name = "rxthresh", .irq = INT_35XX_EMAC_C0_RXTHRESH_IRQ }, | 3226 | { .name = "rxthresh", .irq = 67 + OMAP_INTC_START, }, |
3227 | { .name = "rx_pulse", .irq = INT_35XX_EMAC_C0_RX_PULSE_IRQ }, | 3227 | { .name = "rx_pulse", .irq = 68 + OMAP_INTC_START, }, |
3228 | { .name = "tx_pulse", .irq = INT_35XX_EMAC_C0_TX_PULSE_IRQ }, | 3228 | { .name = "tx_pulse", .irq = 69 + OMAP_INTC_START }, |
3229 | { .name = "misc_pulse", .irq = INT_35XX_EMAC_C0_MISC_PULSE_IRQ }, | 3229 | { .name = "misc_pulse", .irq = 70 + OMAP_INTC_START }, |
3230 | { .irq = -1 } | 3230 | { .irq = -1 }, |
3231 | }; | 3231 | }; |
3232 | 3232 | ||
3233 | static struct omap_hwmod_class am35xx_emac_class = { | 3233 | static struct omap_hwmod_class am35xx_emac_class = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 64b564f13d5b..c7dcb606cd0c 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -19,15 +19,14 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/platform_data/gpio-omap.h> | ||
22 | #include <linux/power/smartreflex.h> | 23 | #include <linux/power/smartreflex.h> |
23 | 24 | ||
24 | #include <plat/omap_hwmod.h> | 25 | #include <plat/omap_hwmod.h> |
25 | #include <plat/cpu.h> | ||
26 | #include <plat/i2c.h> | 26 | #include <plat/i2c.h> |
27 | #include <plat/gpio.h> | ||
28 | #include <plat/dma.h> | 27 | #include <plat/dma.h> |
29 | #include <plat/mcspi.h> | 28 | #include <linux/platform_data/spi-omap2-mcspi.h> |
30 | #include <plat/mcbsp.h> | 29 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
31 | #include <plat/mmc.h> | 30 | #include <plat/mmc.h> |
32 | #include <plat/dmtimer.h> | 31 | #include <plat/dmtimer.h> |
33 | #include <plat/common.h> | 32 | #include <plat/common.h> |
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h index e7e8eeae95e5..dddb677fed68 100644 --- a/arch/arm/mach-omap2/omap_hwmod_common_data.h +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <plat/omap_hwmod.h> | 17 | #include <plat/omap_hwmod.h> |
18 | 18 | ||
19 | #include "common.h" | ||
19 | #include "display.h" | 20 | #include "display.h" |
20 | 21 | ||
21 | /* Common address space across OMAP2xxx */ | 22 | /* Common address space across OMAP2xxx */ |
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c index d15225ff5c49..f447e02102bb 100644 --- a/arch/arm/mach-omap2/omap_l3_noc.c +++ b/arch/arm/mach-omap2/omap_l3_noc.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | 30 | ||
31 | #include "soc.h" | ||
31 | #include "omap_l3_noc.h" | 32 | #include "omap_l3_noc.h" |
32 | 33 | ||
33 | /* | 34 | /* |
@@ -190,7 +191,7 @@ static int __devinit omap4_l3_probe(struct platform_device *pdev) | |||
190 | IRQF_DISABLED, "l3-dbg-irq", l3); | 191 | IRQF_DISABLED, "l3-dbg-irq", l3); |
191 | if (ret) { | 192 | if (ret) { |
192 | pr_crit("L3: request_irq failed to register for 0x%x\n", | 193 | pr_crit("L3: request_irq failed to register for 0x%x\n", |
193 | OMAP44XX_IRQ_L3_DBG); | 194 | 9 + OMAP44XX_IRQ_GIC_START); |
194 | goto err3; | 195 | goto err3; |
195 | } | 196 | } |
196 | 197 | ||
@@ -200,7 +201,7 @@ static int __devinit omap4_l3_probe(struct platform_device *pdev) | |||
200 | IRQF_DISABLED, "l3-app-irq", l3); | 201 | IRQF_DISABLED, "l3-app-irq", l3); |
201 | if (ret) { | 202 | if (ret) { |
202 | pr_crit("L3: request_irq failed to register for 0x%x\n", | 203 | pr_crit("L3: request_irq failed to register for 0x%x\n", |
203 | OMAP44XX_IRQ_L3_APP); | 204 | 10 + OMAP44XX_IRQ_GIC_START); |
204 | goto err4; | 205 | goto err4; |
205 | } | 206 | } |
206 | 207 | ||
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c index 874aecc0faca..d992db8ff0b0 100644 --- a/arch/arm/mach-omap2/omap_phy_internal.c +++ b/arch/arm/mach-omap2/omap_phy_internal.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <linux/usb.h> | 29 | #include <linux/usb.h> |
30 | 30 | ||
31 | #include <plat/usb.h> | 31 | #include <plat/usb.h> |
32 | |||
33 | #include "soc.h" | ||
32 | #include "control.h" | 34 | #include "control.h" |
33 | 35 | ||
34 | void am35x_musb_reset(void) | 36 | void am35x_musb_reset(void) |
diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c index d8f6dbf45d16..45ad7f74f356 100644 --- a/arch/arm/mach-omap2/opp.c +++ b/arch/arm/mach-omap2/opp.c | |||
@@ -64,25 +64,22 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def, | |||
64 | } | 64 | } |
65 | oh = omap_hwmod_lookup(opp_def->hwmod_name); | 65 | oh = omap_hwmod_lookup(opp_def->hwmod_name); |
66 | if (!oh || !oh->od) { | 66 | if (!oh || !oh->od) { |
67 | pr_debug("%s: no hwmod or odev for %s, [%d] " | 67 | pr_debug("%s: no hwmod or odev for %s, [%d] cannot add OPPs.\n", |
68 | "cannot add OPPs.\n", __func__, | 68 | __func__, opp_def->hwmod_name, i); |
69 | opp_def->hwmod_name, i); | ||
70 | continue; | 69 | continue; |
71 | } | 70 | } |
72 | dev = &oh->od->pdev->dev; | 71 | dev = &oh->od->pdev->dev; |
73 | 72 | ||
74 | r = opp_add(dev, opp_def->freq, opp_def->u_volt); | 73 | r = opp_add(dev, opp_def->freq, opp_def->u_volt); |
75 | if (r) { | 74 | if (r) { |
76 | dev_err(dev, "%s: add OPP %ld failed for %s [%d] " | 75 | dev_err(dev, "%s: add OPP %ld failed for %s [%d] result=%d\n", |
77 | "result=%d\n", | 76 | __func__, opp_def->freq, |
78 | __func__, opp_def->freq, | 77 | opp_def->hwmod_name, i, r); |
79 | opp_def->hwmod_name, i, r); | ||
80 | } else { | 78 | } else { |
81 | if (!opp_def->default_available) | 79 | if (!opp_def->default_available) |
82 | r = opp_disable(dev, opp_def->freq); | 80 | r = opp_disable(dev, opp_def->freq); |
83 | if (r) | 81 | if (r) |
84 | dev_err(dev, "%s: disable %ld failed for %s " | 82 | dev_err(dev, "%s: disable %ld failed for %s [%d] result=%d\n", |
85 | "[%d] result=%d\n", | ||
86 | __func__, opp_def->freq, | 83 | __func__, opp_def->freq, |
87 | opp_def->hwmod_name, i, r); | 84 | opp_def->hwmod_name, i, r); |
88 | } | 85 | } |
diff --git a/arch/arm/mach-omap2/opp2420_data.c b/arch/arm/mach-omap2/opp2420_data.c index 5037e76e4e23..a9e8cf21705d 100644 --- a/arch/arm/mach-omap2/opp2420_data.c +++ b/arch/arm/mach-omap2/opp2420_data.c | |||
@@ -28,7 +28,7 @@ | |||
28 | * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/ | 28 | * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <plat/hardware.h> | 31 | #include <linux/kernel.h> |
32 | 32 | ||
33 | #include "opp2xxx.h" | 33 | #include "opp2xxx.h" |
34 | #include "sdrc.h" | 34 | #include "sdrc.h" |
diff --git a/arch/arm/mach-omap2/opp2430_data.c b/arch/arm/mach-omap2/opp2430_data.c index 750805c528d8..0e75ec3e114b 100644 --- a/arch/arm/mach-omap2/opp2430_data.c +++ b/arch/arm/mach-omap2/opp2430_data.c | |||
@@ -26,7 +26,7 @@ | |||
26 | * This is technically part of the OMAP2xxx clock code. | 26 | * This is technically part of the OMAP2xxx clock code. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <plat/hardware.h> | 29 | #include <linux/kernel.h> |
30 | 30 | ||
31 | #include "opp2xxx.h" | 31 | #include "opp2xxx.h" |
32 | #include "sdrc.h" | 32 | #include "sdrc.h" |
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c index d95f3f945d4a..75cef5f67a8a 100644 --- a/arch/arm/mach-omap2/opp3xxx_data.c +++ b/arch/arm/mach-omap2/opp3xxx_data.c | |||
@@ -19,8 +19,6 @@ | |||
19 | */ | 19 | */ |
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | 21 | ||
22 | #include <plat/cpu.h> | ||
23 | |||
24 | #include "control.h" | 22 | #include "control.h" |
25 | #include "omap_opp_data.h" | 23 | #include "omap_opp_data.h" |
26 | #include "pm.h" | 24 | #include "pm.h" |
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c index c95415da23c2..a9fd6d5fe79e 100644 --- a/arch/arm/mach-omap2/opp4xxx_data.c +++ b/arch/arm/mach-omap2/opp4xxx_data.c | |||
@@ -20,8 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | 22 | ||
23 | #include <plat/cpu.h> | 23 | #include "soc.h" |
24 | |||
25 | #include "control.h" | 24 | #include "control.h" |
26 | #include "omap_opp_data.h" | 25 | #include "omap_opp_data.h" |
27 | #include "pm.h" | 26 | #include "pm.h" |
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 814bcd901596..3e1345fc0713 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | 29 | ||
30 | #include <plat/clock.h> | 30 | #include <plat/clock.h> |
31 | #include <plat/board.h> | ||
32 | #include "powerdomain.h" | 31 | #include "powerdomain.h" |
33 | #include "clockdomain.h" | 32 | #include "clockdomain.h" |
34 | #include <plat/dmtimer.h> | 33 | #include <plat/dmtimer.h> |
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 9cb5cede0f50..939bd6f70b51 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -203,8 +203,8 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, | |||
203 | bootup_volt = opp_get_voltage(opp); | 203 | bootup_volt = opp_get_voltage(opp); |
204 | rcu_read_unlock(); | 204 | rcu_read_unlock(); |
205 | if (!bootup_volt) { | 205 | if (!bootup_volt) { |
206 | pr_err("%s: unable to find voltage corresponding " | 206 | pr_err("%s: unable to find voltage corresponding to the bootup OPP for vdd_%s\n", |
207 | "to the bootup OPP for vdd_%s\n", __func__, vdd_name); | 207 | __func__, vdd_name); |
208 | goto exit; | 208 | goto exit; |
209 | } | 209 | } |
210 | 210 | ||
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 2edeffc923a6..8af6cd6ac331 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/irq.h> | 29 | #include <linux/irq.h> |
30 | #include <linux/time.h> | 30 | #include <linux/time.h> |
31 | #include <linux/gpio.h> | 31 | #include <linux/gpio.h> |
32 | #include <linux/platform_data/gpio-omap.h> | ||
32 | 33 | ||
33 | #include <asm/mach/time.h> | 34 | #include <asm/mach/time.h> |
34 | #include <asm/mach/irq.h> | 35 | #include <asm/mach/irq.h> |
@@ -38,9 +39,6 @@ | |||
38 | #include <plat/clock.h> | 39 | #include <plat/clock.h> |
39 | #include <plat/sram.h> | 40 | #include <plat/sram.h> |
40 | #include <plat/dma.h> | 41 | #include <plat/dma.h> |
41 | #include <plat/board.h> | ||
42 | |||
43 | #include <mach/irqs.h> | ||
44 | 42 | ||
45 | #include "common.h" | 43 | #include "common.h" |
46 | #include "prm2xxx_3xxx.h" | 44 | #include "prm2xxx_3xxx.h" |
@@ -352,16 +350,6 @@ int __init omap2_pm_init(void) | |||
352 | 350 | ||
353 | prcm_setup_regs(); | 351 | prcm_setup_regs(); |
354 | 352 | ||
355 | /* Hack to prevent MPU retention when STI console is enabled. */ | ||
356 | { | ||
357 | const struct omap_sti_console_config *sti; | ||
358 | |||
359 | sti = omap_get_config(OMAP_TAG_STI_CONSOLE, | ||
360 | struct omap_sti_console_config); | ||
361 | if (sti != NULL && sti->enable) | ||
362 | sti_console_enabled = 1; | ||
363 | } | ||
364 | |||
365 | /* | 353 | /* |
366 | * We copy the assembler sleep/wakeup routines to SRAM. | 354 | * We copy the assembler sleep/wakeup routines to SRAM. |
367 | * These routines need to be in SRAM as that's the only | 355 | * These routines need to be in SRAM as that's the only |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 05bd8f02723f..ba670db1fd37 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/platform_data/gpio-omap.h> | ||
32 | |||
31 | #include <trace/events/power.h> | 33 | #include <trace/events/power.h> |
32 | 34 | ||
33 | #include <asm/suspend.h> | 35 | #include <asm/suspend.h> |
@@ -389,9 +391,8 @@ restore: | |||
389 | list_for_each_entry(pwrst, &pwrst_list, node) { | 391 | list_for_each_entry(pwrst, &pwrst_list, node) { |
390 | state = pwrdm_read_prev_pwrst(pwrst->pwrdm); | 392 | state = pwrdm_read_prev_pwrst(pwrst->pwrdm); |
391 | if (state > pwrst->next_state) { | 393 | if (state > pwrst->next_state) { |
392 | pr_info("Powerdomain (%s) didn't enter " | 394 | pr_info("Powerdomain (%s) didn't enter target state %d\n", |
393 | "target state %d\n", | 395 | pwrst->pwrdm->name, pwrst->next_state); |
394 | pwrst->pwrdm->name, pwrst->next_state); | ||
395 | ret = -1; | 396 | ret = -1; |
396 | } | 397 | } |
397 | omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); | 398 | omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); |
@@ -731,8 +732,7 @@ int __init omap3_pm_init(void) | |||
731 | omap3_secure_ram_storage = | 732 | omap3_secure_ram_storage = |
732 | kmalloc(0x803F, GFP_KERNEL); | 733 | kmalloc(0x803F, GFP_KERNEL); |
733 | if (!omap3_secure_ram_storage) | 734 | if (!omap3_secure_ram_storage) |
734 | pr_err("Memory allocation failed when " | 735 | pr_err("Memory allocation failed when allocating for secure sram context\n"); |
735 | "allocating for secure sram context\n"); | ||
736 | 736 | ||
737 | local_irq_disable(); | 737 | local_irq_disable(); |
738 | local_fiq_disable(); | 738 | local_fiq_disable(); |
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index ea24174f5707..04922d149068 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c | |||
@@ -69,9 +69,8 @@ static int omap4_pm_suspend(void) | |||
69 | list_for_each_entry(pwrst, &pwrst_list, node) { | 69 | list_for_each_entry(pwrst, &pwrst_list, node) { |
70 | state = pwrdm_read_prev_pwrst(pwrst->pwrdm); | 70 | state = pwrdm_read_prev_pwrst(pwrst->pwrdm); |
71 | if (state > pwrst->next_state) { | 71 | if (state > pwrst->next_state) { |
72 | pr_info("Powerdomain (%s) didn't enter " | 72 | pr_info("Powerdomain (%s) didn't enter target state %d\n", |
73 | "target state %d\n", | 73 | pwrst->pwrdm->name, pwrst->next_state); |
74 | pwrst->pwrdm->name, pwrst->next_state); | ||
75 | ret = -1; | 74 | ret = -1; |
76 | } | 75 | } |
77 | omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); | 76 | omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); |
@@ -189,8 +188,7 @@ int __init omap4_pm_init(void) | |||
189 | ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm); | 188 | ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm); |
190 | ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm); | 189 | ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm); |
191 | if (ret) { | 190 | if (ret) { |
192 | pr_err("Failed to add MPUSS -> L3/EMIF/L4PER, DUCATI -> L3 " | 191 | pr_err("Failed to add MPUSS -> L3/EMIF/L4PER, DUCATI -> L3 wakeup dependency\n"); |
193 | "wakeup dependency\n"); | ||
194 | goto err2; | 192 | goto err2; |
195 | } | 193 | } |
196 | 194 | ||
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 69b36e185e9b..1678a3284233 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -28,11 +28,13 @@ | |||
28 | #include "prm44xx.h" | 28 | #include "prm44xx.h" |
29 | 29 | ||
30 | #include <asm/cpu.h> | 30 | #include <asm/cpu.h> |
31 | #include <plat/cpu.h> | 31 | |
32 | #include <plat/prcm.h> | ||
33 | |||
32 | #include "powerdomain.h" | 34 | #include "powerdomain.h" |
33 | #include "clockdomain.h" | 35 | #include "clockdomain.h" |
34 | #include <plat/prcm.h> | ||
35 | 36 | ||
37 | #include "soc.h" | ||
36 | #include "pm.h" | 38 | #include "pm.h" |
37 | 39 | ||
38 | #define PWRDM_TRACE_STATES_FLAG (1<<31) | 40 | #define PWRDM_TRACE_STATES_FLAG (1<<31) |
@@ -339,8 +341,8 @@ int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | |||
339 | if (!pwrdm || !clkdm) | 341 | if (!pwrdm || !clkdm) |
340 | return -EINVAL; | 342 | return -EINVAL; |
341 | 343 | ||
342 | pr_debug("powerdomain: associating clockdomain %s with powerdomain " | 344 | pr_debug("powerdomain: %s: associating clockdomain %s\n", |
343 | "%s\n", clkdm->name, pwrdm->name); | 345 | pwrdm->name, clkdm->name); |
344 | 346 | ||
345 | for (i = 0; i < PWRDM_MAX_CLKDMS; i++) { | 347 | for (i = 0; i < PWRDM_MAX_CLKDMS; i++) { |
346 | if (!pwrdm->pwrdm_clkdms[i]) | 348 | if (!pwrdm->pwrdm_clkdms[i]) |
@@ -354,8 +356,8 @@ int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | |||
354 | } | 356 | } |
355 | 357 | ||
356 | if (i == PWRDM_MAX_CLKDMS) { | 358 | if (i == PWRDM_MAX_CLKDMS) { |
357 | pr_debug("powerdomain: increase PWRDM_MAX_CLKDMS for " | 359 | pr_debug("powerdomain: %s: increase PWRDM_MAX_CLKDMS for clkdm %s\n", |
358 | "pwrdm %s clkdm %s\n", pwrdm->name, clkdm->name); | 360 | pwrdm->name, clkdm->name); |
359 | WARN_ON(1); | 361 | WARN_ON(1); |
360 | ret = -ENOMEM; | 362 | ret = -ENOMEM; |
361 | goto pac_exit; | 363 | goto pac_exit; |
@@ -387,16 +389,16 @@ int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | |||
387 | if (!pwrdm || !clkdm) | 389 | if (!pwrdm || !clkdm) |
388 | return -EINVAL; | 390 | return -EINVAL; |
389 | 391 | ||
390 | pr_debug("powerdomain: dissociating clockdomain %s from powerdomain " | 392 | pr_debug("powerdomain: %s: dissociating clockdomain %s\n", |
391 | "%s\n", clkdm->name, pwrdm->name); | 393 | pwrdm->name, clkdm->name); |
392 | 394 | ||
393 | for (i = 0; i < PWRDM_MAX_CLKDMS; i++) | 395 | for (i = 0; i < PWRDM_MAX_CLKDMS; i++) |
394 | if (pwrdm->pwrdm_clkdms[i] == clkdm) | 396 | if (pwrdm->pwrdm_clkdms[i] == clkdm) |
395 | break; | 397 | break; |
396 | 398 | ||
397 | if (i == PWRDM_MAX_CLKDMS) { | 399 | if (i == PWRDM_MAX_CLKDMS) { |
398 | pr_debug("powerdomain: clkdm %s not associated with pwrdm " | 400 | pr_debug("powerdomain: %s: clkdm %s not associated?!\n", |
399 | "%s ?!\n", clkdm->name, pwrdm->name); | 401 | pwrdm->name, clkdm->name); |
400 | ret = -ENOENT; | 402 | ret = -ENOENT; |
401 | goto pdc_exit; | 403 | goto pdc_exit; |
402 | } | 404 | } |
@@ -485,7 +487,7 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) | |||
485 | if (!(pwrdm->pwrsts & (1 << pwrst))) | 487 | if (!(pwrdm->pwrsts & (1 << pwrst))) |
486 | return -EINVAL; | 488 | return -EINVAL; |
487 | 489 | ||
488 | pr_debug("powerdomain: setting next powerstate for %s to %0x\n", | 490 | pr_debug("powerdomain: %s: setting next powerstate to %0x\n", |
489 | pwrdm->name, pwrst); | 491 | pwrdm->name, pwrst); |
490 | 492 | ||
491 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) { | 493 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) { |
@@ -587,7 +589,7 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) | |||
587 | if (!(pwrdm->pwrsts_logic_ret & (1 << pwrst))) | 589 | if (!(pwrdm->pwrsts_logic_ret & (1 << pwrst))) |
588 | return -EINVAL; | 590 | return -EINVAL; |
589 | 591 | ||
590 | pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n", | 592 | pr_debug("powerdomain: %s: setting next logic powerstate to %0x\n", |
591 | pwrdm->name, pwrst); | 593 | pwrdm->name, pwrst); |
592 | 594 | ||
593 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_logic_retst) | 595 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_logic_retst) |
@@ -624,8 +626,8 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | |||
624 | if (!(pwrdm->pwrsts_mem_on[bank] & (1 << pwrst))) | 626 | if (!(pwrdm->pwrsts_mem_on[bank] & (1 << pwrst))) |
625 | return -EINVAL; | 627 | return -EINVAL; |
626 | 628 | ||
627 | pr_debug("powerdomain: setting next memory powerstate for domain %s " | 629 | pr_debug("powerdomain: %s: setting next memory powerstate for bank %0x while pwrdm-ON to %0x\n", |
628 | "bank %0x while pwrdm-ON to %0x\n", pwrdm->name, bank, pwrst); | 630 | pwrdm->name, bank, pwrst); |
629 | 631 | ||
630 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_onst) | 632 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_onst) |
631 | ret = arch_pwrdm->pwrdm_set_mem_onst(pwrdm, bank, pwrst); | 633 | ret = arch_pwrdm->pwrdm_set_mem_onst(pwrdm, bank, pwrst); |
@@ -662,8 +664,8 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | |||
662 | if (!(pwrdm->pwrsts_mem_ret[bank] & (1 << pwrst))) | 664 | if (!(pwrdm->pwrsts_mem_ret[bank] & (1 << pwrst))) |
663 | return -EINVAL; | 665 | return -EINVAL; |
664 | 666 | ||
665 | pr_debug("powerdomain: setting next memory powerstate for domain %s " | 667 | pr_debug("powerdomain: %s: setting next memory powerstate for bank %0x while pwrdm-RET to %0x\n", |
666 | "bank %0x while pwrdm-RET to %0x\n", pwrdm->name, bank, pwrst); | 668 | pwrdm->name, bank, pwrst); |
667 | 669 | ||
668 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_retst) | 670 | if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_retst) |
669 | ret = arch_pwrdm->pwrdm_set_mem_retst(pwrdm, bank, pwrst); | 671 | ret = arch_pwrdm->pwrdm_set_mem_retst(pwrdm, bank, pwrst); |
@@ -841,7 +843,7 @@ int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm) | |||
841 | * warn & fail if it is not ON. | 843 | * warn & fail if it is not ON. |
842 | */ | 844 | */ |
843 | 845 | ||
844 | pr_debug("powerdomain: clearing previous power state reg for %s\n", | 846 | pr_debug("powerdomain: %s: clearing previous power state reg\n", |
845 | pwrdm->name); | 847 | pwrdm->name); |
846 | 848 | ||
847 | if (arch_pwrdm && arch_pwrdm->pwrdm_clear_all_prev_pwrst) | 849 | if (arch_pwrdm && arch_pwrdm->pwrdm_clear_all_prev_pwrst) |
@@ -871,8 +873,7 @@ int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm) | |||
871 | if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) | 873 | if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) |
872 | return ret; | 874 | return ret; |
873 | 875 | ||
874 | pr_debug("powerdomain: %s: setting SAVEANDRESTORE bit\n", | 876 | pr_debug("powerdomain: %s: setting SAVEANDRESTORE bit\n", pwrdm->name); |
875 | pwrdm->name); | ||
876 | 877 | ||
877 | if (arch_pwrdm && arch_pwrdm->pwrdm_enable_hdwr_sar) | 878 | if (arch_pwrdm && arch_pwrdm->pwrdm_enable_hdwr_sar) |
878 | ret = arch_pwrdm->pwrdm_enable_hdwr_sar(pwrdm); | 879 | ret = arch_pwrdm->pwrdm_enable_hdwr_sar(pwrdm); |
@@ -901,8 +902,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) | |||
901 | if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) | 902 | if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) |
902 | return ret; | 903 | return ret; |
903 | 904 | ||
904 | pr_debug("powerdomain: %s: clearing SAVEANDRESTORE bit\n", | 905 | pr_debug("powerdomain: %s: clearing SAVEANDRESTORE bit\n", pwrdm->name); |
905 | pwrdm->name); | ||
906 | 906 | ||
907 | if (arch_pwrdm && arch_pwrdm->pwrdm_disable_hdwr_sar) | 907 | if (arch_pwrdm && arch_pwrdm->pwrdm_disable_hdwr_sar) |
908 | ret = arch_pwrdm->pwrdm_disable_hdwr_sar(pwrdm); | 908 | ret = arch_pwrdm->pwrdm_disable_hdwr_sar(pwrdm); |
diff --git a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c index 0f0a9f1592fe..3950ccfe5f4a 100644 --- a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c +++ b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c | |||
@@ -122,8 +122,8 @@ static int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm) | |||
122 | udelay(1); | 122 | udelay(1); |
123 | 123 | ||
124 | if (c > PWRDM_TRANSITION_BAILOUT) { | 124 | if (c > PWRDM_TRANSITION_BAILOUT) { |
125 | printk(KERN_ERR "powerdomain: waited too long for " | 125 | pr_err("powerdomain: %s: waited too long to complete transition\n", |
126 | "powerdomain %s to complete transition\n", pwrdm->name); | 126 | pwrdm->name); |
127 | return -EAGAIN; | 127 | return -EAGAIN; |
128 | } | 128 | } |
129 | 129 | ||
diff --git a/arch/arm/mach-omap2/powerdomain44xx.c b/arch/arm/mach-omap2/powerdomain44xx.c index 601325b852a4..aeac6f35ca10 100644 --- a/arch/arm/mach-omap2/powerdomain44xx.c +++ b/arch/arm/mach-omap2/powerdomain44xx.c | |||
@@ -198,8 +198,8 @@ static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm) | |||
198 | udelay(1); | 198 | udelay(1); |
199 | 199 | ||
200 | if (c > PWRDM_TRANSITION_BAILOUT) { | 200 | if (c > PWRDM_TRANSITION_BAILOUT) { |
201 | printk(KERN_ERR "powerdomain: waited too long for " | 201 | pr_err("powerdomain: %s: waited too long to complete transition\n", |
202 | "powerdomain %s to complete transition\n", pwrdm->name); | 202 | pwrdm->name); |
203 | return -EAGAIN; | 203 | return -EAGAIN; |
204 | } | 204 | } |
205 | 205 | ||
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c index bb883e463078..8b23d234fb55 100644 --- a/arch/arm/mach-omap2/powerdomains3xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c | |||
@@ -15,11 +15,9 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/bug.h> | 16 | #include <linux/bug.h> |
17 | 17 | ||
18 | #include <plat/cpu.h> | 18 | #include "soc.h" |
19 | |||
20 | #include "powerdomain.h" | 19 | #include "powerdomain.h" |
21 | #include "powerdomains2xxx_3xxx_data.h" | 20 | #include "powerdomains2xxx_3xxx_data.h" |
22 | |||
23 | #include "prcm-common.h" | 21 | #include "prcm-common.h" |
24 | #include "prm2xxx_3xxx.h" | 22 | #include "prm2xxx_3xxx.h" |
25 | #include "prm-regbits-34xx.h" | 23 | #include "prm-regbits-34xx.h" |
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 053e24ed3c48..0f51e034e0aa 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -27,7 +27,6 @@ | |||
27 | 27 | ||
28 | #include "common.h" | 28 | #include "common.h" |
29 | #include <plat/prcm.h> | 29 | #include <plat/prcm.h> |
30 | #include <plat/irqs.h> | ||
31 | 30 | ||
32 | #include "clock.h" | 31 | #include "clock.h" |
33 | #include "clock2xxx.h" | 32 | #include "clock2xxx.h" |
@@ -140,11 +139,11 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, | |||
140 | MAX_MODULE_ENABLE_WAIT, i); | 139 | MAX_MODULE_ENABLE_WAIT, i); |
141 | 140 | ||
142 | if (i < MAX_MODULE_ENABLE_WAIT) | 141 | if (i < MAX_MODULE_ENABLE_WAIT) |
143 | pr_debug("cm: Module associated with clock %s ready after %d " | 142 | pr_debug("cm: Module associated with clock %s ready after %d loops\n", |
144 | "loops\n", name, i); | 143 | name, i); |
145 | else | 144 | else |
146 | pr_err("cm: Module associated with clock %s didn't enable in " | 145 | pr_err("cm: Module associated with clock %s didn't enable in %d tries\n", |
147 | "%d tries\n", name, MAX_MODULE_ENABLE_WAIT); | 146 | name, MAX_MODULE_ENABLE_WAIT); |
148 | 147 | ||
149 | return (i < MAX_MODULE_ENABLE_WAIT) ? 1 : 0; | 148 | return (i < MAX_MODULE_ENABLE_WAIT) ? 1 : 0; |
150 | }; | 149 | }; |
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c index a0309dea6794..9529984d8d2b 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c | |||
@@ -17,11 +17,10 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
19 | 19 | ||
20 | #include "common.h" | ||
21 | #include <plat/cpu.h> | ||
22 | #include <plat/prcm.h> | 20 | #include <plat/prcm.h> |
23 | #include <plat/irqs.h> | ||
24 | 21 | ||
22 | #include "soc.h" | ||
23 | #include "common.h" | ||
25 | #include "vp.h" | 24 | #include "vp.h" |
26 | 25 | ||
27 | #include "prm2xxx_3xxx.h" | 26 | #include "prm2xxx_3xxx.h" |
@@ -40,7 +39,7 @@ static struct omap_prcm_irq_setup omap3_prcm_irq_setup = { | |||
40 | .nr_regs = 1, | 39 | .nr_regs = 1, |
41 | .irqs = omap3_prcm_irqs, | 40 | .irqs = omap3_prcm_irqs, |
42 | .nr_irqs = ARRAY_SIZE(omap3_prcm_irqs), | 41 | .nr_irqs = ARRAY_SIZE(omap3_prcm_irqs), |
43 | .irq = INT_34XX_PRCM_MPU_IRQ, | 42 | .irq = 11 + OMAP_INTC_START, |
44 | .read_pending_irqs = &omap3xxx_prm_read_pending_irqs, | 43 | .read_pending_irqs = &omap3xxx_prm_read_pending_irqs, |
45 | .ocp_barrier = &omap3xxx_prm_ocp_barrier, | 44 | .ocp_barrier = &omap3xxx_prm_ocp_barrier, |
46 | .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen, | 45 | .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen, |
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index bb727c2d9337..f0c4d5f4a174 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -17,10 +17,9 @@ | |||
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | 19 | ||
20 | #include <plat/cpu.h> | ||
21 | #include <plat/irqs.h> | ||
22 | #include <plat/prcm.h> | 20 | #include <plat/prcm.h> |
23 | 21 | ||
22 | #include "soc.h" | ||
24 | #include "iomap.h" | 23 | #include "iomap.h" |
25 | #include "common.h" | 24 | #include "common.h" |
26 | #include "vp.h" | 25 | #include "vp.h" |
@@ -40,7 +39,7 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = { | |||
40 | .nr_regs = 2, | 39 | .nr_regs = 2, |
41 | .irqs = omap4_prcm_irqs, | 40 | .irqs = omap4_prcm_irqs, |
42 | .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs), | 41 | .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs), |
43 | .irq = OMAP44XX_IRQ_PRCM, | 42 | .irq = 11 + OMAP44XX_IRQ_GIC_START, |
44 | .read_pending_irqs = &omap44xx_prm_read_pending_irqs, | 43 | .read_pending_irqs = &omap44xx_prm_read_pending_irqs, |
45 | .ocp_barrier = &omap44xx_prm_ocp_barrier, | 44 | .ocp_barrier = &omap44xx_prm_ocp_barrier, |
46 | .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen, | 45 | .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen, |
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index 03b126d9ad94..6b4d332be2f6 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include <plat/common.h> | 27 | #include <plat/common.h> |
28 | #include <plat/prcm.h> | 28 | #include <plat/prcm.h> |
29 | #include <plat/irqs.h> | ||
30 | 29 | ||
31 | #include "prm2xxx_3xxx.h" | 30 | #include "prm2xxx_3xxx.h" |
32 | #include "prm44xx.h" | 31 | #include "prm44xx.h" |
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c index 1133bb2f632b..73e55e485329 100644 --- a/arch/arm/mach-omap2/sdrc2xxx.c +++ b/arch/arm/mach-omap2/sdrc2xxx.c | |||
@@ -24,11 +24,11 @@ | |||
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | 26 | ||
27 | #include <plat/hardware.h> | ||
28 | #include <plat/clock.h> | 27 | #include <plat/clock.h> |
29 | #include <plat/sram.h> | 28 | #include <plat/sram.h> |
30 | #include <plat/sdrc.h> | 29 | #include <plat/sdrc.h> |
31 | 30 | ||
31 | #include "soc.h" | ||
32 | #include "iomap.h" | 32 | #include "iomap.h" |
33 | #include "common.h" | 33 | #include "common.h" |
34 | #include "prm2xxx_3xxx.h" | 34 | #include "prm2xxx_3xxx.h" |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 9e80d209d138..0405c8190803 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -29,11 +29,11 @@ | |||
29 | 29 | ||
30 | #include <plat/omap-serial.h> | 30 | #include <plat/omap-serial.h> |
31 | #include "common.h" | 31 | #include "common.h" |
32 | #include <plat/board.h> | ||
33 | #include <plat/dma.h> | 32 | #include <plat/dma.h> |
34 | #include <plat/omap_hwmod.h> | 33 | #include <plat/omap_hwmod.h> |
35 | #include <plat/omap_device.h> | 34 | #include <plat/omap_device.h> |
36 | #include <plat/omap-pm.h> | 35 | #include <plat/omap-pm.h> |
36 | #include <plat/serial.h> | ||
37 | 37 | ||
38 | #include "prm2xxx_3xxx.h" | 38 | #include "prm2xxx_3xxx.h" |
39 | #include "pm.h" | 39 | #include "pm.h" |
@@ -232,9 +232,8 @@ static int __init omap_serial_early_init(void) | |||
232 | 232 | ||
233 | if (console_loglevel >= 10) { | 233 | if (console_loglevel >= 10) { |
234 | uart_debug = true; | 234 | uart_debug = true; |
235 | pr_info("%s used as console in debug mode" | 235 | pr_info("%s used as console in debug mode: uart%d clocks will not be gated", |
236 | " uart%d clocks will not be" | 236 | uart_name, uart->num); |
237 | " gated", uart_name, uart->num); | ||
238 | } | 237 | } |
239 | 238 | ||
240 | if (cmdline_find_option("no_console_suspend")) | 239 | if (cmdline_find_option("no_console_suspend")) |
@@ -319,8 +318,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata, | |||
319 | 318 | ||
320 | pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size, | 319 | pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size, |
321 | NULL, 0, false); | 320 | NULL, 0, false); |
322 | WARN(IS_ERR(pdev), "Could not build omap_device for %s: %s.\n", | 321 | if (IS_ERR(pdev)) { |
323 | name, oh->name); | 322 | WARN(1, "Could not build omap_device for %s: %s.\n", name, |
323 | oh->name); | ||
324 | return; | ||
325 | } | ||
324 | 326 | ||
325 | if ((console_uart_id == bdata->id) && no_console_suspend) | 327 | if ((console_uart_id == bdata->id) && no_console_suspend) |
326 | omap_device_disable_idle_on_suspend(pdev); | 328 | omap_device_disable_idle_on_suspend(pdev); |
diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S index d4bf904d84ab..ce0ccd26efbd 100644 --- a/arch/arm/mach-omap2/sleep24xx.S +++ b/arch/arm/mach-omap2/sleep24xx.S | |||
@@ -28,8 +28,7 @@ | |||
28 | #include <linux/linkage.h> | 28 | #include <linux/linkage.h> |
29 | #include <asm/assembler.h> | 29 | #include <asm/assembler.h> |
30 | 30 | ||
31 | #include <plat/omap24xx.h> | 31 | #include "omap24xx.h" |
32 | |||
33 | #include "sdrc.h" | 32 | #include "sdrc.h" |
34 | 33 | ||
35 | /* First address of reserved address space? apparently valid for OMAP2 & 3 */ | 34 | /* First address of reserved address space? apparently valid for OMAP2 & 3 */ |
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 1f62f23673fb..506987979c1c 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
@@ -26,9 +26,9 @@ | |||
26 | 26 | ||
27 | #include <asm/assembler.h> | 27 | #include <asm/assembler.h> |
28 | 28 | ||
29 | #include <plat/hardware.h> | ||
30 | #include <plat/sram.h> | 29 | #include <plat/sram.h> |
31 | 30 | ||
31 | #include "omap34xx.h" | ||
32 | #include "iomap.h" | 32 | #include "iomap.h" |
33 | #include "cm2xxx_3xxx.h" | 33 | #include "cm2xxx_3xxx.h" |
34 | #include "prm2xxx_3xxx.h" | 34 | #include "prm2xxx_3xxx.h" |
diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S index 91e71d8f46f0..88ff83a0942e 100644 --- a/arch/arm/mach-omap2/sleep44xx.S +++ b/arch/arm/mach-omap2/sleep44xx.S | |||
@@ -14,10 +14,10 @@ | |||
14 | #include <asm/memory.h> | 14 | #include <asm/memory.h> |
15 | #include <asm/hardware/cache-l2x0.h> | 15 | #include <asm/hardware/cache-l2x0.h> |
16 | 16 | ||
17 | #include <plat/omap44xx.h> | 17 | #include "omap-secure.h" |
18 | #include <mach/omap-secure.h> | ||
19 | 18 | ||
20 | #include "common.h" | 19 | #include "common.h" |
20 | #include "omap44xx.h" | ||
21 | #include "omap4-sar-layout.h" | 21 | #include "omap4-sar-layout.h" |
22 | 22 | ||
23 | #if defined(CONFIG_SMP) && defined(CONFIG_PM) | 23 | #if defined(CONFIG_SMP) && defined(CONFIG_PM) |
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h new file mode 100644 index 000000000000..fc9b96daf851 --- /dev/null +++ b/arch/arm/mach-omap2/soc.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #include <plat/cpu.h> | ||
2 | #include "omap24xx.h" | ||
3 | #include "omap34xx.h" | ||
4 | #include "omap44xx.h" | ||
5 | #include "ti81xx.h" | ||
6 | #include "am33xx.h" | ||
7 | #include "omap54xx.h" | ||
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index d033a65f4e4e..cbeae56b56a9 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c | |||
@@ -104,16 +104,15 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user) | |||
104 | 104 | ||
105 | sr_data = kzalloc(sizeof(struct omap_sr_data), GFP_KERNEL); | 105 | sr_data = kzalloc(sizeof(struct omap_sr_data), GFP_KERNEL); |
106 | if (!sr_data) { | 106 | if (!sr_data) { |
107 | pr_err("%s: Unable to allocate memory for %s sr_data.Error!\n", | 107 | pr_err("%s: Unable to allocate memory for %s sr_data\n", |
108 | __func__, oh->name); | 108 | __func__, oh->name); |
109 | return -ENOMEM; | 109 | return -ENOMEM; |
110 | } | 110 | } |
111 | 111 | ||
112 | sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr; | 112 | sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr; |
113 | if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) { | 113 | if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) { |
114 | pr_err("%s: No voltage domain specified for %s." | 114 | pr_err("%s: No voltage domain specified for %s. Cannot initialize\n", |
115 | "Cannot initialize\n", __func__, | 115 | __func__, oh->name); |
116 | oh->name); | ||
117 | goto exit; | 116 | goto exit; |
118 | } | 117 | } |
119 | 118 | ||
@@ -131,8 +130,8 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user) | |||
131 | 130 | ||
132 | omap_voltage_get_volttable(sr_data->voltdm, &volt_data); | 131 | omap_voltage_get_volttable(sr_data->voltdm, &volt_data); |
133 | if (!volt_data) { | 132 | if (!volt_data) { |
134 | pr_warning("%s: No Voltage table registered fo VDD%d." | 133 | pr_err("%s: No Voltage table registered for VDD%d\n", |
135 | "Something really wrong\n\n", __func__, i + 1); | 134 | __func__, i + 1); |
136 | goto exit; | 135 | goto exit; |
137 | } | 136 | } |
138 | 137 | ||
diff --git a/arch/arm/mach-omap2/sram242x.S b/arch/arm/mach-omap2/sram242x.S index ee0bfcc1410f..8f7326cd435b 100644 --- a/arch/arm/mach-omap2/sram242x.S +++ b/arch/arm/mach-omap2/sram242x.S | |||
@@ -32,8 +32,7 @@ | |||
32 | 32 | ||
33 | #include <asm/assembler.h> | 33 | #include <asm/assembler.h> |
34 | 34 | ||
35 | #include <mach/hardware.h> | 35 | #include "soc.h" |
36 | |||
37 | #include "iomap.h" | 36 | #include "iomap.h" |
38 | #include "prm2xxx_3xxx.h" | 37 | #include "prm2xxx_3xxx.h" |
39 | #include "cm2xxx_3xxx.h" | 38 | #include "cm2xxx_3xxx.h" |
diff --git a/arch/arm/mach-omap2/sram243x.S b/arch/arm/mach-omap2/sram243x.S index d4d39ef04769..b140d6578529 100644 --- a/arch/arm/mach-omap2/sram243x.S +++ b/arch/arm/mach-omap2/sram243x.S | |||
@@ -32,8 +32,7 @@ | |||
32 | 32 | ||
33 | #include <asm/assembler.h> | 33 | #include <asm/assembler.h> |
34 | 34 | ||
35 | #include <mach/hardware.h> | 35 | #include "soc.h" |
36 | |||
37 | #include "iomap.h" | 36 | #include "iomap.h" |
38 | #include "prm2xxx_3xxx.h" | 37 | #include "prm2xxx_3xxx.h" |
39 | #include "cm2xxx_3xxx.h" | 38 | #include "cm2xxx_3xxx.h" |
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S index df5a21322b0a..2d0ceaa23fb8 100644 --- a/arch/arm/mach-omap2/sram34xx.S +++ b/arch/arm/mach-omap2/sram34xx.S | |||
@@ -29,8 +29,7 @@ | |||
29 | 29 | ||
30 | #include <asm/assembler.h> | 30 | #include <asm/assembler.h> |
31 | 31 | ||
32 | #include <mach/hardware.h> | 32 | #include "soc.h" |
33 | |||
34 | #include "iomap.h" | 33 | #include "iomap.h" |
35 | #include "sdrc.h" | 34 | #include "sdrc.h" |
36 | #include "cm2xxx_3xxx.h" | 35 | #include "cm2xxx_3xxx.h" |
diff --git a/arch/arm/plat-omap/include/plat/ti81xx.h b/arch/arm/mach-omap2/ti81xx.h index 8f9843f78422..8f9843f78422 100644 --- a/arch/arm/plat-omap/include/plat/ti81xx.h +++ b/arch/arm/mach-omap2/ti81xx.h | |||
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 2ba4f57dda86..5214d5bfba27 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -38,14 +38,16 @@ | |||
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | 39 | ||
40 | #include <asm/mach/time.h> | 40 | #include <asm/mach/time.h> |
41 | #include <plat/dmtimer.h> | ||
42 | #include <asm/smp_twd.h> | 41 | #include <asm/smp_twd.h> |
43 | #include <asm/sched_clock.h> | 42 | #include <asm/sched_clock.h> |
44 | #include "common.h" | 43 | |
45 | #include <plat/omap_hwmod.h> | 44 | #include <plat/omap_hwmod.h> |
46 | #include <plat/omap_device.h> | 45 | #include <plat/omap_device.h> |
46 | #include <plat/dmtimer.h> | ||
47 | #include <plat/omap-pm.h> | 47 | #include <plat/omap-pm.h> |
48 | 48 | ||
49 | #include "soc.h" | ||
50 | #include "common.h" | ||
49 | #include "powerdomain.h" | 51 | #include "powerdomain.h" |
50 | 52 | ||
51 | /* Parent clocks, eventually these will come from the clock framework */ | 53 | /* Parent clocks, eventually these will come from the clock framework */ |
@@ -211,7 +213,7 @@ static void __init omap2_gp_clockevent_init(int gptimer_id, | |||
211 | res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source); | 213 | res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source); |
212 | BUG_ON(res); | 214 | BUG_ON(res); |
213 | 215 | ||
214 | omap2_gp_timer_irq.dev_id = (void *)&clkev; | 216 | omap2_gp_timer_irq.dev_id = &clkev; |
215 | setup_irq(clkev.irq, &omap2_gp_timer_irq); | 217 | setup_irq(clkev.irq, &omap2_gp_timer_irq); |
216 | 218 | ||
217 | __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW); | 219 | __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW); |
@@ -380,8 +382,7 @@ OMAP_SYS_TIMER(3_am33xx) | |||
380 | #ifdef CONFIG_ARCH_OMAP4 | 382 | #ifdef CONFIG_ARCH_OMAP4 |
381 | #ifdef CONFIG_LOCAL_TIMERS | 383 | #ifdef CONFIG_LOCAL_TIMERS |
382 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, | 384 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, |
383 | OMAP44XX_LOCAL_TWD_BASE, | 385 | OMAP44XX_LOCAL_TWD_BASE, 29 + OMAP_INTC_START); |
384 | OMAP44XX_IRQ_LOCALTIMER); | ||
385 | #endif | 386 | #endif |
386 | 387 | ||
387 | static void __init omap4_timer_init(void) | 388 | static void __init omap4_timer_init(void) |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 329b726012f3..45f77413c21d 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <plat/i2c.h> | 29 | #include <plat/i2c.h> |
30 | #include <plat/usb.h> | 30 | #include <plat/usb.h> |
31 | 31 | ||
32 | #include "soc.h" | ||
32 | #include "twl-common.h" | 33 | #include "twl-common.h" |
33 | #include "pm.h" | 34 | #include "pm.h" |
34 | #include "voltage.h" | 35 | #include "voltage.h" |
@@ -39,16 +40,6 @@ static struct i2c_board_info __initdata pmic_i2c_board_info = { | |||
39 | .flags = I2C_CLIENT_WAKE, | 40 | .flags = I2C_CLIENT_WAKE, |
40 | }; | 41 | }; |
41 | 42 | ||
42 | static struct i2c_board_info __initdata omap4_i2c1_board_info[] = { | ||
43 | { | ||
44 | .addr = 0x48, | ||
45 | .flags = I2C_CLIENT_WAKE, | ||
46 | }, | ||
47 | { | ||
48 | I2C_BOARD_INFO("twl6040", 0x4b), | ||
49 | }, | ||
50 | }; | ||
51 | |||
52 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | 43 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
53 | static int twl_set_voltage(void *data, int target_uV) | 44 | static int twl_set_voltage(void *data, int target_uV) |
54 | { | 45 | { |
@@ -78,30 +69,25 @@ void __init omap_pmic_init(int bus, u32 clkrate, | |||
78 | 69 | ||
79 | void __init omap4_pmic_init(const char *pmic_type, | 70 | void __init omap4_pmic_init(const char *pmic_type, |
80 | struct twl4030_platform_data *pmic_data, | 71 | struct twl4030_platform_data *pmic_data, |
81 | struct twl6040_platform_data *twl6040_data, int twl6040_irq) | 72 | struct i2c_board_info *devices, int nr_devices) |
82 | { | 73 | { |
83 | /* PMIC part*/ | 74 | /* PMIC part*/ |
84 | omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); | 75 | omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); |
85 | strncpy(omap4_i2c1_board_info[0].type, pmic_type, | 76 | omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data); |
86 | sizeof(omap4_i2c1_board_info[0].type)); | ||
87 | omap4_i2c1_board_info[0].irq = OMAP44XX_IRQ_SYS_1N; | ||
88 | omap4_i2c1_board_info[0].platform_data = pmic_data; | ||
89 | |||
90 | /* TWL6040 audio IC part */ | ||
91 | omap4_i2c1_board_info[1].irq = twl6040_irq; | ||
92 | omap4_i2c1_board_info[1].platform_data = twl6040_data; | ||
93 | |||
94 | omap_register_i2c_bus(1, 400, omap4_i2c1_board_info, 2); | ||
95 | 77 | ||
78 | /* Register additional devices on i2c1 bus if needed */ | ||
79 | if (devices) | ||
80 | i2c_register_board_info(1, devices, nr_devices); | ||
96 | } | 81 | } |
97 | 82 | ||
98 | void __init omap_pmic_late_init(void) | 83 | void __init omap_pmic_late_init(void) |
99 | { | 84 | { |
100 | /* Init the OMAP TWL parameters (if PMIC has been registered) */ | 85 | /* Init the OMAP TWL parameters (if PMIC has been registerd) */ |
101 | if (pmic_i2c_board_info.irq) | 86 | if (!pmic_i2c_board_info.irq) |
102 | omap3_twl_init(); | 87 | return; |
103 | if (omap4_i2c1_board_info[0].irq) | 88 | |
104 | omap4_twl_init(); | 89 | omap3_twl_init(); |
90 | omap4_twl_init(); | ||
105 | } | 91 | } |
106 | 92 | ||
107 | #if defined(CONFIG_ARCH_OMAP3) | 93 | #if defined(CONFIG_ARCH_OMAP3) |
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h index 8fe71cfd002c..2256efe90cf1 100644 --- a/arch/arm/mach-omap2/twl-common.h +++ b/arch/arm/mach-omap2/twl-common.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __OMAP_PMIC_COMMON__ | 1 | #ifndef __OMAP_PMIC_COMMON__ |
2 | #define __OMAP_PMIC_COMMON__ | 2 | #define __OMAP_PMIC_COMMON__ |
3 | 3 | ||
4 | #include <plat/irqs.h> | 4 | #include "common.h" |
5 | 5 | ||
6 | #define TWL_COMMON_PDATA_USB (1 << 0) | 6 | #define TWL_COMMON_PDATA_USB (1 << 0) |
7 | #define TWL_COMMON_PDATA_BCI (1 << 1) | 7 | #define TWL_COMMON_PDATA_BCI (1 << 1) |
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | struct twl4030_platform_data; | 33 | struct twl4030_platform_data; |
34 | struct twl6040_platform_data; | 34 | struct twl6040_platform_data; |
35 | struct i2c_board_info; | ||
35 | 36 | ||
36 | void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, | 37 | void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, |
37 | struct twl4030_platform_data *pmic_data); | 38 | struct twl4030_platform_data *pmic_data); |
@@ -40,18 +41,18 @@ void omap_pmic_late_init(void); | |||
40 | static inline void omap2_pmic_init(const char *pmic_type, | 41 | static inline void omap2_pmic_init(const char *pmic_type, |
41 | struct twl4030_platform_data *pmic_data) | 42 | struct twl4030_platform_data *pmic_data) |
42 | { | 43 | { |
43 | omap_pmic_init(2, 2600, pmic_type, INT_24XX_SYS_NIRQ, pmic_data); | 44 | omap_pmic_init(2, 2600, pmic_type, 7 + OMAP_INTC_START, pmic_data); |
44 | } | 45 | } |
45 | 46 | ||
46 | static inline void omap3_pmic_init(const char *pmic_type, | 47 | static inline void omap3_pmic_init(const char *pmic_type, |
47 | struct twl4030_platform_data *pmic_data) | 48 | struct twl4030_platform_data *pmic_data) |
48 | { | 49 | { |
49 | omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data); | 50 | omap_pmic_init(1, 2600, pmic_type, 7 + OMAP_INTC_START, pmic_data); |
50 | } | 51 | } |
51 | 52 | ||
52 | void omap4_pmic_init(const char *pmic_type, | 53 | void omap4_pmic_init(const char *pmic_type, |
53 | struct twl4030_platform_data *pmic_data, | 54 | struct twl4030_platform_data *pmic_data, |
54 | struct twl6040_platform_data *audio_data, int twl6040_irq); | 55 | struct i2c_board_info *devices, int nr_devices); |
55 | 56 | ||
56 | void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, | 57 | void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, |
57 | u32 pdata_flags, u32 regulators_flags); | 58 | u32 pdata_flags, u32 regulators_flags); |
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c index dde8a11f47d5..ac95daaa4702 100644 --- a/arch/arm/mach-omap2/usb-host.c +++ b/arch/arm/mach-omap2/usb-host.c | |||
@@ -25,8 +25,6 @@ | |||
25 | 25 | ||
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | 27 | ||
28 | #include <mach/hardware.h> | ||
29 | #include <mach/irqs.h> | ||
30 | #include <plat/usb.h> | 28 | #include <plat/usb.h> |
31 | #include <plat/omap_device.h> | 29 | #include <plat/omap_device.h> |
32 | 30 | ||
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index e9b4b234dc5f..51da21cb78f1 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -23,14 +23,13 @@ | |||
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/dma-mapping.h> | 24 | #include <linux/dma-mapping.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | |||
27 | #include <linux/usb/musb.h> | 26 | #include <linux/usb/musb.h> |
28 | 27 | ||
29 | #include <mach/hardware.h> | ||
30 | #include <mach/irqs.h> | ||
31 | #include <mach/am35xx.h> | ||
32 | #include <plat/usb.h> | 28 | #include <plat/usb.h> |
33 | #include <plat/omap_device.h> | 29 | #include <plat/omap_device.h> |
30 | |||
31 | #include "am35xx.h" | ||
32 | |||
34 | #include "mux.h" | 33 | #include "mux.h" |
35 | 34 | ||
36 | static struct musb_hdrc_config musb_config = { | 35 | static struct musb_hdrc_config musb_config = { |
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 84da34f9a7cf..880249b17012 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c | |||
@@ -12,8 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/bug.h> | 13 | #include <linux/bug.h> |
14 | 14 | ||
15 | #include <plat/cpu.h> | 15 | #include "soc.h" |
16 | |||
17 | #include "voltage.h" | 16 | #include "voltage.h" |
18 | #include "vc.h" | 17 | #include "vc.h" |
19 | #include "prm-regbits-34xx.h" | 18 | #include "prm-regbits-34xx.h" |
@@ -116,9 +115,8 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm, | |||
116 | } | 115 | } |
117 | 116 | ||
118 | if (!voltdm->pmic->uv_to_vsel) { | 117 | if (!voltdm->pmic->uv_to_vsel) { |
119 | pr_err("%s: PMIC function to convert voltage in uV to" | 118 | pr_err("%s: PMIC function to convert voltage in uV to vsel not registered. Hence unable to scale voltage for vdd_%s\n", |
120 | "vsel not registered. Hence unable to scale voltage" | 119 | __func__, voltdm->name); |
121 | "for vdd_%s\n", __func__, voltdm->name); | ||
122 | return -ENODATA; | 120 | return -ENODATA; |
123 | } | 121 | } |
124 | 122 | ||
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 4dc60e83e00d..3ac8fe1d8213 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c | |||
@@ -195,8 +195,8 @@ struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | |||
195 | return &voltdm->volt_data[i]; | 195 | return &voltdm->volt_data[i]; |
196 | } | 196 | } |
197 | 197 | ||
198 | pr_notice("%s: Unable to match the current voltage with the voltage" | 198 | pr_notice("%s: Unable to match the current voltage with the voltage table for vdd_%s\n", |
199 | "table for vdd_%s\n", __func__, voltdm->name); | 199 | __func__, voltdm->name); |
200 | 200 | ||
201 | return ERR_PTR(-ENODATA); | 201 | return ERR_PTR(-ENODATA); |
202 | } | 202 | } |
@@ -249,8 +249,8 @@ void omap_change_voltscale_method(struct voltagedomain *voltdm, | |||
249 | voltdm->scale = omap_vc_bypass_scale; | 249 | voltdm->scale = omap_vc_bypass_scale; |
250 | return; | 250 | return; |
251 | default: | 251 | default: |
252 | pr_warning("%s: Trying to change the method of voltage scaling" | 252 | pr_warn("%s: Trying to change the method of voltage scaling to an unsupported one!\n", |
253 | "to an unsupported one!\n", __func__); | 253 | __func__); |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
@@ -331,8 +331,8 @@ int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm) | |||
331 | if (!voltdm || !pwrdm) | 331 | if (!voltdm || !pwrdm) |
332 | return -EINVAL; | 332 | return -EINVAL; |
333 | 333 | ||
334 | pr_debug("voltagedomain: associating powerdomain %s with voltagedomain " | 334 | pr_debug("voltagedomain: %s: associating powerdomain %s\n", |
335 | "%s\n", pwrdm->name, voltdm->name); | 335 | voltdm->name, pwrdm->name); |
336 | 336 | ||
337 | list_add(&pwrdm->voltdm_node, &voltdm->pwrdm_list); | 337 | list_add(&pwrdm->voltdm_node, &voltdm->pwrdm_list); |
338 | 338 | ||
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h index 0ac2caf15941..7283b7ed7de8 100644 --- a/arch/arm/mach-omap2/voltage.h +++ b/arch/arm/mach-omap2/voltage.h | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | 18 | ||
19 | #include <plat/voltage.h> | 19 | #include <linux/platform_data/voltage-omap.h> |
20 | 20 | ||
21 | #include "vc.h" | 21 | #include "vc.h" |
22 | #include "vp.h" | 22 | #include "vp.h" |
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c index d0103c80d040..63afbfed3cbc 100644 --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c | |||
@@ -18,9 +18,8 @@ | |||
18 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | 20 | ||
21 | #include "soc.h" | ||
21 | #include "common.h" | 22 | #include "common.h" |
22 | #include <plat/cpu.h> | ||
23 | |||
24 | #include "prm-regbits-34xx.h" | 23 | #include "prm-regbits-34xx.h" |
25 | #include "omap_opp_data.h" | 24 | #include "omap_opp_data.h" |
26 | #include "voltage.h" | 25 | #include "voltage.h" |
diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index f95c1bad9dc6..85241b828c02 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c | |||
@@ -138,8 +138,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, | |||
138 | udelay(1); | 138 | udelay(1); |
139 | } | 139 | } |
140 | if (timeout >= VP_TRANXDONE_TIMEOUT) { | 140 | if (timeout >= VP_TRANXDONE_TIMEOUT) { |
141 | pr_warning("%s: vdd_%s TRANXDONE timeout exceeded." | 141 | pr_warn("%s: vdd_%s TRANXDONE timeout exceeded. Voltage change aborted", |
142 | "Voltage change aborted", __func__, voltdm->name); | 142 | __func__, voltdm->name); |
143 | return -ETIMEDOUT; | 143 | return -ETIMEDOUT; |
144 | } | 144 | } |
145 | 145 | ||
@@ -157,9 +157,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, | |||
157 | omap_test_timeout(vp->common->ops->check_txdone(vp->id), | 157 | omap_test_timeout(vp->common->ops->check_txdone(vp->id), |
158 | VP_TRANXDONE_TIMEOUT, timeout); | 158 | VP_TRANXDONE_TIMEOUT, timeout); |
159 | if (timeout >= VP_TRANXDONE_TIMEOUT) | 159 | if (timeout >= VP_TRANXDONE_TIMEOUT) |
160 | pr_err("%s: vdd_%s TRANXDONE timeout exceeded." | 160 | pr_err("%s: vdd_%s TRANXDONE timeout exceeded. TRANXDONE never got set after the voltage update\n", |
161 | "TRANXDONE never got set after the voltage update\n", | 161 | __func__, voltdm->name); |
162 | __func__, voltdm->name); | ||
163 | 162 | ||
164 | omap_vc_post_scale(voltdm, target_volt, target_vsel, current_vsel); | 163 | omap_vc_post_scale(voltdm, target_volt, target_vsel, current_vsel); |
165 | 164 | ||
@@ -176,8 +175,7 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, | |||
176 | } | 175 | } |
177 | 176 | ||
178 | if (timeout >= VP_TRANXDONE_TIMEOUT) | 177 | if (timeout >= VP_TRANXDONE_TIMEOUT) |
179 | pr_warning("%s: vdd_%s TRANXDONE timeout exceeded while trying" | 178 | pr_warn("%s: vdd_%s TRANXDONE timeout exceeded while trying to clear the TRANXDONE status\n", |
180 | "to clear the TRANXDONE status\n", | ||
181 | __func__, voltdm->name); | 179 | __func__, voltdm->name); |
182 | 180 | ||
183 | /* Clear force bit */ | 181 | /* Clear force bit */ |
@@ -257,8 +255,8 @@ void omap_vp_disable(struct voltagedomain *voltdm) | |||
257 | 255 | ||
258 | /* If VP is already disabled, do nothing. Return */ | 256 | /* If VP is already disabled, do nothing. Return */ |
259 | if (!vp->enabled) { | 257 | if (!vp->enabled) { |
260 | pr_warning("%s: Trying to disable VP for vdd_%s when" | 258 | pr_warn("%s: Trying to disable VP for vdd_%s when it is already disabled\n", |
261 | "it is already disabled\n", __func__, voltdm->name); | 259 | __func__, voltdm->name); |
262 | return; | 260 | return; |
263 | } | 261 | } |
264 | 262 | ||
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index a6cd14ab1e4e..2fdd4e4f559a 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -47,16 +47,6 @@ static struct map_desc orion5x_io_desc[] __initdata = { | |||
47 | .length = ORION5X_REGS_SIZE, | 47 | .length = ORION5X_REGS_SIZE, |
48 | .type = MT_DEVICE, | 48 | .type = MT_DEVICE, |
49 | }, { | 49 | }, { |
50 | .virtual = ORION5X_PCIE_IO_VIRT_BASE, | ||
51 | .pfn = __phys_to_pfn(ORION5X_PCIE_IO_PHYS_BASE), | ||
52 | .length = ORION5X_PCIE_IO_SIZE, | ||
53 | .type = MT_DEVICE, | ||
54 | }, { | ||
55 | .virtual = ORION5X_PCI_IO_VIRT_BASE, | ||
56 | .pfn = __phys_to_pfn(ORION5X_PCI_IO_PHYS_BASE), | ||
57 | .length = ORION5X_PCI_IO_SIZE, | ||
58 | .type = MT_DEVICE, | ||
59 | }, { | ||
60 | .virtual = ORION5X_PCIE_WA_VIRT_BASE, | 50 | .virtual = ORION5X_PCIE_WA_VIRT_BASE, |
61 | .pfn = __phys_to_pfn(ORION5X_PCIE_WA_PHYS_BASE), | 51 | .pfn = __phys_to_pfn(ORION5X_PCIE_WA_PHYS_BASE), |
62 | .length = ORION5X_PCIE_WA_SIZE, | 52 | .length = ORION5X_PCIE_WA_SIZE, |
diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h deleted file mode 100644 index 1aa5d0a50a0b..000000000000 --- a/arch/arm/mach-orion5x/include/mach/io.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-orion5x/include/mach/io.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ARCH_IO_H | ||
10 | #define __ASM_ARCH_IO_H | ||
11 | |||
12 | #include <mach/orion5x.h> | ||
13 | #include <asm/sizes.h> | ||
14 | |||
15 | #define IO_SPACE_LIMIT SZ_2M | ||
16 | static inline void __iomem *__io(unsigned long addr) | ||
17 | { | ||
18 | return (void __iomem *)(addr + ORION5X_PCIE_IO_VIRT_BASE); | ||
19 | } | ||
20 | |||
21 | #define __io(a) __io(a) | ||
22 | #endif | ||
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h index 683e085ce162..1b60131b7f60 100644 --- a/arch/arm/mach-orion5x/include/mach/orion5x.h +++ b/arch/arm/mach-orion5x/include/mach/orion5x.h | |||
@@ -31,31 +31,29 @@ | |||
31 | * fc000000 device bus mappings (cs0/cs1) | 31 | * fc000000 device bus mappings (cs0/cs1) |
32 | * | 32 | * |
33 | * virt phys size | 33 | * virt phys size |
34 | * fdd00000 f1000000 1M on-chip peripheral registers | 34 | * fe000000 f1000000 1M on-chip peripheral registers |
35 | * fde00000 f2000000 1M PCIe I/O space | 35 | * fee00000 f2000000 64K PCIe I/O space |
36 | * fdf00000 f2100000 1M PCI I/O space | 36 | * fee10000 f2100000 64K PCI I/O space |
37 | * fe000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only) | 37 | * fd000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only) |
38 | ****************************************************************************/ | 38 | ****************************************************************************/ |
39 | #define ORION5X_REGS_PHYS_BASE 0xf1000000 | 39 | #define ORION5X_REGS_PHYS_BASE 0xf1000000 |
40 | #define ORION5X_REGS_VIRT_BASE 0xfdd00000 | 40 | #define ORION5X_REGS_VIRT_BASE 0xfe000000 |
41 | #define ORION5X_REGS_SIZE SZ_1M | 41 | #define ORION5X_REGS_SIZE SZ_1M |
42 | 42 | ||
43 | #define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000 | 43 | #define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000 |
44 | #define ORION5X_PCIE_IO_VIRT_BASE 0xfde00000 | ||
45 | #define ORION5X_PCIE_IO_BUS_BASE 0x00000000 | 44 | #define ORION5X_PCIE_IO_BUS_BASE 0x00000000 |
46 | #define ORION5X_PCIE_IO_SIZE SZ_1M | 45 | #define ORION5X_PCIE_IO_SIZE SZ_64K |
47 | 46 | ||
48 | #define ORION5X_PCI_IO_PHYS_BASE 0xf2100000 | 47 | #define ORION5X_PCI_IO_PHYS_BASE 0xf2100000 |
49 | #define ORION5X_PCI_IO_VIRT_BASE 0xfdf00000 | 48 | #define ORION5X_PCI_IO_BUS_BASE 0x00010000 |
50 | #define ORION5X_PCI_IO_BUS_BASE 0x00100000 | 49 | #define ORION5X_PCI_IO_SIZE SZ_64K |
51 | #define ORION5X_PCI_IO_SIZE SZ_1M | ||
52 | 50 | ||
53 | #define ORION5X_SRAM_PHYS_BASE (0xf2200000) | 51 | #define ORION5X_SRAM_PHYS_BASE (0xf2200000) |
54 | #define ORION5X_SRAM_SIZE SZ_8K | 52 | #define ORION5X_SRAM_SIZE SZ_8K |
55 | 53 | ||
56 | /* Relevant only for Orion-1/Orion-NAS */ | 54 | /* Relevant only for Orion-1/Orion-NAS */ |
57 | #define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000 | 55 | #define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000 |
58 | #define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000 | 56 | #define ORION5X_PCIE_WA_VIRT_BASE 0xfd000000 |
59 | #define ORION5X_PCIE_WA_SIZE SZ_16M | 57 | #define ORION5X_PCIE_WA_SIZE SZ_16M |
60 | 58 | ||
61 | #define ORION5X_PCIE_MEM_PHYS_BASE 0xe0000000 | 59 | #define ORION5X_PCIE_MEM_PHYS_BASE 0xe0000000 |
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index cb19e1661bb3..6921d49b988d 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c | |||
@@ -162,35 +162,25 @@ static int __init pcie_setup(struct pci_sys_data *sys) | |||
162 | pcie_ops.read = pcie_rd_conf_wa; | 162 | pcie_ops.read = pcie_rd_conf_wa; |
163 | } | 163 | } |
164 | 164 | ||
165 | pci_ioremap_io(sys->busnr * SZ_64K, ORION5X_PCIE_IO_PHYS_BASE); | ||
166 | |||
165 | /* | 167 | /* |
166 | * Request resources. | 168 | * Request resources. |
167 | */ | 169 | */ |
168 | res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL); | 170 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); |
169 | if (!res) | 171 | if (!res) |
170 | panic("pcie_setup unable to alloc resources"); | 172 | panic("pcie_setup unable to alloc resources"); |
171 | 173 | ||
172 | /* | 174 | /* |
173 | * IORESOURCE_IO | ||
174 | */ | ||
175 | sys->io_offset = 0; | ||
176 | res[0].name = "PCIe I/O Space"; | ||
177 | res[0].flags = IORESOURCE_IO; | ||
178 | res[0].start = ORION5X_PCIE_IO_BUS_BASE; | ||
179 | res[0].end = res[0].start + ORION5X_PCIE_IO_SIZE - 1; | ||
180 | if (request_resource(&ioport_resource, &res[0])) | ||
181 | panic("Request PCIe IO resource failed\n"); | ||
182 | pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); | ||
183 | |||
184 | /* | ||
185 | * IORESOURCE_MEM | 175 | * IORESOURCE_MEM |
186 | */ | 176 | */ |
187 | res[1].name = "PCIe Memory Space"; | 177 | res->name = "PCIe Memory Space"; |
188 | res[1].flags = IORESOURCE_MEM; | 178 | res->flags = IORESOURCE_MEM; |
189 | res[1].start = ORION5X_PCIE_MEM_PHYS_BASE; | 179 | res->start = ORION5X_PCIE_MEM_PHYS_BASE; |
190 | res[1].end = res[1].start + ORION5X_PCIE_MEM_SIZE - 1; | 180 | res->end = res->start + ORION5X_PCIE_MEM_SIZE - 1; |
191 | if (request_resource(&iomem_resource, &res[1])) | 181 | if (request_resource(&iomem_resource, res)) |
192 | panic("Request PCIe Memory resource failed\n"); | 182 | panic("Request PCIe Memory resource failed\n"); |
193 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); | 183 | pci_add_resource_offset(&sys->resources, res, sys->mem_offset); |
194 | 184 | ||
195 | return 1; | 185 | return 1; |
196 | } | 186 | } |
@@ -489,35 +479,25 @@ static int __init pci_setup(struct pci_sys_data *sys) | |||
489 | */ | 479 | */ |
490 | orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER); | 480 | orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER); |
491 | 481 | ||
482 | pci_ioremap_io(sys->busnr * SZ_64K, ORION5X_PCI_IO_PHYS_BASE); | ||
483 | |||
492 | /* | 484 | /* |
493 | * Request resources | 485 | * Request resources |
494 | */ | 486 | */ |
495 | res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL); | 487 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); |
496 | if (!res) | 488 | if (!res) |
497 | panic("pci_setup unable to alloc resources"); | 489 | panic("pci_setup unable to alloc resources"); |
498 | 490 | ||
499 | /* | 491 | /* |
500 | * IORESOURCE_IO | ||
501 | */ | ||
502 | sys->io_offset = 0; | ||
503 | res[0].name = "PCI I/O Space"; | ||
504 | res[0].flags = IORESOURCE_IO; | ||
505 | res[0].start = ORION5X_PCI_IO_BUS_BASE; | ||
506 | res[0].end = res[0].start + ORION5X_PCI_IO_SIZE - 1; | ||
507 | if (request_resource(&ioport_resource, &res[0])) | ||
508 | panic("Request PCI IO resource failed\n"); | ||
509 | pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); | ||
510 | |||
511 | /* | ||
512 | * IORESOURCE_MEM | 492 | * IORESOURCE_MEM |
513 | */ | 493 | */ |
514 | res[1].name = "PCI Memory Space"; | 494 | res->name = "PCI Memory Space"; |
515 | res[1].flags = IORESOURCE_MEM; | 495 | res->flags = IORESOURCE_MEM; |
516 | res[1].start = ORION5X_PCI_MEM_PHYS_BASE; | 496 | res->start = ORION5X_PCI_MEM_PHYS_BASE; |
517 | res[1].end = res[1].start + ORION5X_PCI_MEM_SIZE - 1; | 497 | res->end = res->start + ORION5X_PCI_MEM_SIZE - 1; |
518 | if (request_resource(&iomem_resource, &res[1])) | 498 | if (request_resource(&iomem_resource, res)) |
519 | panic("Request PCI Memory resource failed\n"); | 499 | panic("Request PCI Memory resource failed\n"); |
520 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); | 500 | pci_add_resource_offset(&sys->resources, res, sys->mem_offset); |
521 | 501 | ||
522 | return 1; | 502 | return 1; |
523 | } | 503 | } |
diff --git a/arch/arm/mach-pnx4008/Makefile b/arch/arm/mach-pnx4008/Makefile deleted file mode 100644 index 777564c90a12..000000000000 --- a/arch/arm/mach-pnx4008/Makefile +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | # | ||
2 | # Makefile for the linux kernel. | ||
3 | # | ||
4 | |||
5 | obj-y := core.o irq.o time.o clock.o gpio.o serial.o dma.o i2c.o | ||
6 | obj-m := | ||
7 | obj-n := | ||
8 | obj- := | ||
9 | |||
10 | # Power Management | ||
11 | obj-$(CONFIG_PM) += pm.o sleep.o | ||
12 | |||
diff --git a/arch/arm/mach-pnx4008/Makefile.boot b/arch/arm/mach-pnx4008/Makefile.boot deleted file mode 100644 index 9fa19baa7f2e..000000000000 --- a/arch/arm/mach-pnx4008/Makefile.boot +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | zreladdr-y += 0x80008000 | ||
2 | params_phys-y := 0x80000100 | ||
3 | initrd_phys-y := 0x80800000 | ||
4 | |||
diff --git a/arch/arm/mach-pnx4008/clock.c b/arch/arm/mach-pnx4008/clock.c deleted file mode 100644 index a4a3819c96cb..000000000000 --- a/arch/arm/mach-pnx4008/clock.c +++ /dev/null | |||
@@ -1,1001 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/clock.c | ||
3 | * | ||
4 | * Clock control driver for PNX4008 | ||
5 | * | ||
6 | * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com> | ||
7 | * Generic clock management functions are partially based on: | ||
8 | * linux/arch/arm/mach-omap/clock.c | ||
9 | * | ||
10 | * 2005-2006 (c) MontaVista Software, Inc. This file is licensed under | ||
11 | * the terms of the GNU General Public License version 2. This program | ||
12 | * is licensed "as is" without any warranty of any kind, whether express | ||
13 | * or implied. | ||
14 | */ | ||
15 | |||
16 | #include <linux/module.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/list.h> | ||
19 | #include <linux/errno.h> | ||
20 | #include <linux/device.h> | ||
21 | #include <linux/err.h> | ||
22 | #include <linux/delay.h> | ||
23 | #include <linux/io.h> | ||
24 | #include <linux/clkdev.h> | ||
25 | |||
26 | #include <mach/hardware.h> | ||
27 | #include <mach/clock.h> | ||
28 | #include "clock.h" | ||
29 | |||
30 | /*forward declaration*/ | ||
31 | static struct clk per_ck; | ||
32 | static struct clk hclk_ck; | ||
33 | static struct clk ck_1MHz; | ||
34 | static struct clk ck_13MHz; | ||
35 | static struct clk ck_pll1; | ||
36 | static int local_set_rate(struct clk *clk, u32 rate); | ||
37 | |||
38 | static inline void clock_lock(void) | ||
39 | { | ||
40 | local_irq_disable(); | ||
41 | } | ||
42 | |||
43 | static inline void clock_unlock(void) | ||
44 | { | ||
45 | local_irq_enable(); | ||
46 | } | ||
47 | |||
48 | static void propagate_rate(struct clk *clk) | ||
49 | { | ||
50 | struct clk *tmp_clk; | ||
51 | |||
52 | tmp_clk = clk; | ||
53 | while (tmp_clk->propagate_next) { | ||
54 | tmp_clk = tmp_clk->propagate_next; | ||
55 | local_set_rate(tmp_clk, tmp_clk->user_rate); | ||
56 | } | ||
57 | } | ||
58 | |||
59 | static void clk_reg_disable(struct clk *clk) | ||
60 | { | ||
61 | if (clk->enable_reg) | ||
62 | __raw_writel(__raw_readl(clk->enable_reg) & | ||
63 | ~(1 << clk->enable_shift), clk->enable_reg); | ||
64 | } | ||
65 | |||
66 | static int clk_reg_enable(struct clk *clk) | ||
67 | { | ||
68 | if (clk->enable_reg) | ||
69 | __raw_writel(__raw_readl(clk->enable_reg) | | ||
70 | (1 << clk->enable_shift), clk->enable_reg); | ||
71 | return 0; | ||
72 | } | ||
73 | |||
74 | static inline void clk_reg_disable1(struct clk *clk) | ||
75 | { | ||
76 | if (clk->enable_reg1) | ||
77 | __raw_writel(__raw_readl(clk->enable_reg1) & | ||
78 | ~(1 << clk->enable_shift1), clk->enable_reg1); | ||
79 | } | ||
80 | |||
81 | static inline void clk_reg_enable1(struct clk *clk) | ||
82 | { | ||
83 | if (clk->enable_reg1) | ||
84 | __raw_writel(__raw_readl(clk->enable_reg1) | | ||
85 | (1 << clk->enable_shift1), clk->enable_reg1); | ||
86 | } | ||
87 | |||
88 | static int clk_wait_for_pll_lock(struct clk *clk) | ||
89 | { | ||
90 | int i; | ||
91 | i = 0; | ||
92 | while (i++ < 0xFFF && !(__raw_readl(clk->scale_reg) & 1)) ; /*wait for PLL to lock */ | ||
93 | |||
94 | if (!(__raw_readl(clk->scale_reg) & 1)) { | ||
95 | printk(KERN_ERR | ||
96 | "%s ERROR: failed to lock, scale reg data: %x\n", | ||
97 | clk->name, __raw_readl(clk->scale_reg)); | ||
98 | return -1; | ||
99 | } | ||
100 | return 0; | ||
101 | } | ||
102 | |||
103 | static int switch_to_dirty_13mhz(struct clk *clk) | ||
104 | { | ||
105 | int i; | ||
106 | int ret; | ||
107 | u32 tmp_reg; | ||
108 | |||
109 | ret = 0; | ||
110 | |||
111 | if (!clk->rate) | ||
112 | clk_reg_enable1(clk); | ||
113 | |||
114 | tmp_reg = __raw_readl(clk->parent_switch_reg); | ||
115 | /*if 13Mhz clock selected, select 13'MHz (dirty) source from OSC */ | ||
116 | if (!(tmp_reg & 1)) { | ||
117 | tmp_reg |= (1 << 1); /* Trigger switch to 13'MHz (dirty) clock */ | ||
118 | __raw_writel(tmp_reg, clk->parent_switch_reg); | ||
119 | i = 0; | ||
120 | while (i++ < 0xFFF && !(__raw_readl(clk->parent_switch_reg) & 1)) ; /*wait for 13'MHz selection status */ | ||
121 | |||
122 | if (!(__raw_readl(clk->parent_switch_reg) & 1)) { | ||
123 | printk(KERN_ERR | ||
124 | "%s ERROR: failed to select 13'MHz, parent sw reg data: %x\n", | ||
125 | clk->name, __raw_readl(clk->parent_switch_reg)); | ||
126 | ret = -1; | ||
127 | } | ||
128 | } | ||
129 | |||
130 | if (!clk->rate) | ||
131 | clk_reg_disable1(clk); | ||
132 | |||
133 | return ret; | ||
134 | } | ||
135 | |||
136 | static int switch_to_clean_13mhz(struct clk *clk) | ||
137 | { | ||
138 | int i; | ||
139 | int ret; | ||
140 | u32 tmp_reg; | ||
141 | |||
142 | ret = 0; | ||
143 | |||
144 | if (!clk->rate) | ||
145 | clk_reg_enable1(clk); | ||
146 | |||
147 | tmp_reg = __raw_readl(clk->parent_switch_reg); | ||
148 | /*if 13'Mhz clock selected, select 13MHz (clean) source from OSC */ | ||
149 | if (tmp_reg & 1) { | ||
150 | tmp_reg &= ~(1 << 1); /* Trigger switch to 13MHz (clean) clock */ | ||
151 | __raw_writel(tmp_reg, clk->parent_switch_reg); | ||
152 | i = 0; | ||
153 | while (i++ < 0xFFF && (__raw_readl(clk->parent_switch_reg) & 1)) ; /*wait for 13MHz selection status */ | ||
154 | |||
155 | if (__raw_readl(clk->parent_switch_reg) & 1) { | ||
156 | printk(KERN_ERR | ||
157 | "%s ERROR: failed to select 13MHz, parent sw reg data: %x\n", | ||
158 | clk->name, __raw_readl(clk->parent_switch_reg)); | ||
159 | ret = -1; | ||
160 | } | ||
161 | } | ||
162 | |||
163 | if (!clk->rate) | ||
164 | clk_reg_disable1(clk); | ||
165 | |||
166 | return ret; | ||
167 | } | ||
168 | |||
169 | static int set_13MHz_parent(struct clk *clk, struct clk *parent) | ||
170 | { | ||
171 | int ret = -EINVAL; | ||
172 | |||
173 | if (parent == &ck_13MHz) | ||
174 | ret = switch_to_clean_13mhz(clk); | ||
175 | else if (parent == &ck_pll1) | ||
176 | ret = switch_to_dirty_13mhz(clk); | ||
177 | |||
178 | return ret; | ||
179 | } | ||
180 | |||
181 | #define PLL160_MIN_FCCO 156000 | ||
182 | #define PLL160_MAX_FCCO 320000 | ||
183 | |||
184 | /* | ||
185 | * Calculate pll160 settings. | ||
186 | * Possible input: up to 320MHz with step of clk->parent->rate. | ||
187 | * In PNX4008 parent rate for pll160s may be either 1 or 13MHz. | ||
188 | * Ignored paths: "feedback" (bit 13 set), "div-by-N". | ||
189 | * Setting ARM PLL4 rate to 0 will put CPU into direct run mode. | ||
190 | * Setting PLL5 and PLL3 rate to 0 will disable USB and DSP clock input. | ||
191 | * Please refer to PNX4008 IC manual for details. | ||
192 | */ | ||
193 | |||
194 | static int pll160_set_rate(struct clk *clk, u32 rate) | ||
195 | { | ||
196 | u32 tmp_reg, tmp_m, tmp_2p, i; | ||
197 | u32 parent_rate; | ||
198 | int ret = -EINVAL; | ||
199 | |||
200 | parent_rate = clk->parent->rate; | ||
201 | |||
202 | if (!parent_rate) | ||
203 | goto out; | ||
204 | |||
205 | /* set direct run for ARM or disable output for others */ | ||
206 | clk_reg_disable(clk); | ||
207 | |||
208 | /* disable source input as well (ignored for ARM) */ | ||
209 | clk_reg_disable1(clk); | ||
210 | |||
211 | tmp_reg = __raw_readl(clk->scale_reg); | ||
212 | tmp_reg &= ~0x1ffff; /*clear all settings, power down */ | ||
213 | __raw_writel(tmp_reg, clk->scale_reg); | ||
214 | |||
215 | rate -= rate % parent_rate; /*round down the input */ | ||
216 | |||
217 | if (rate > PLL160_MAX_FCCO) | ||
218 | rate = PLL160_MAX_FCCO; | ||
219 | |||
220 | if (!rate) { | ||
221 | clk->rate = 0; | ||
222 | ret = 0; | ||
223 | goto out; | ||
224 | } | ||
225 | |||
226 | clk_reg_enable1(clk); | ||
227 | tmp_reg = __raw_readl(clk->scale_reg); | ||
228 | |||
229 | if (rate == parent_rate) { | ||
230 | /*enter direct bypass mode */ | ||
231 | tmp_reg |= ((1 << 14) | (1 << 15)); | ||
232 | __raw_writel(tmp_reg, clk->scale_reg); | ||
233 | clk->rate = parent_rate; | ||
234 | clk_reg_enable(clk); | ||
235 | ret = 0; | ||
236 | goto out; | ||
237 | } | ||
238 | |||
239 | i = 0; | ||
240 | for (tmp_2p = 1; tmp_2p < 16; tmp_2p <<= 1) { | ||
241 | if (rate * tmp_2p >= PLL160_MIN_FCCO) | ||
242 | break; | ||
243 | i++; | ||
244 | } | ||
245 | |||
246 | if (tmp_2p > 1) | ||
247 | tmp_reg |= ((i - 1) << 11); | ||
248 | else | ||
249 | tmp_reg |= (1 << 14); /*direct mode, no divide */ | ||
250 | |||
251 | tmp_m = rate * tmp_2p; | ||
252 | tmp_m /= parent_rate; | ||
253 | |||
254 | tmp_reg |= (tmp_m - 1) << 1; /*calculate M */ | ||
255 | tmp_reg |= (1 << 16); /*power up PLL */ | ||
256 | __raw_writel(tmp_reg, clk->scale_reg); | ||
257 | |||
258 | if (clk_wait_for_pll_lock(clk) < 0) { | ||
259 | clk_reg_disable(clk); | ||
260 | clk_reg_disable1(clk); | ||
261 | |||
262 | tmp_reg = __raw_readl(clk->scale_reg); | ||
263 | tmp_reg &= ~0x1ffff; /*clear all settings, power down */ | ||
264 | __raw_writel(tmp_reg, clk->scale_reg); | ||
265 | clk->rate = 0; | ||
266 | ret = -EFAULT; | ||
267 | goto out; | ||
268 | } | ||
269 | |||
270 | clk->rate = (tmp_m * parent_rate) / tmp_2p; | ||
271 | |||
272 | if (clk->flags & RATE_PROPAGATES) | ||
273 | propagate_rate(clk); | ||
274 | |||
275 | clk_reg_enable(clk); | ||
276 | ret = 0; | ||
277 | |||
278 | out: | ||
279 | return ret; | ||
280 | } | ||
281 | |||
282 | /*configure PER_CLK*/ | ||
283 | static int per_clk_set_rate(struct clk *clk, u32 rate) | ||
284 | { | ||
285 | u32 tmp; | ||
286 | |||
287 | tmp = __raw_readl(clk->scale_reg); | ||
288 | tmp &= ~(0x1f << 2); | ||
289 | tmp |= ((clk->parent->rate / clk->rate) - 1) << 2; | ||
290 | __raw_writel(tmp, clk->scale_reg); | ||
291 | clk->rate = rate; | ||
292 | return 0; | ||
293 | } | ||
294 | |||
295 | /*configure HCLK*/ | ||
296 | static int hclk_set_rate(struct clk *clk, u32 rate) | ||
297 | { | ||
298 | u32 tmp; | ||
299 | tmp = __raw_readl(clk->scale_reg); | ||
300 | tmp = tmp & ~0x3; | ||
301 | switch (rate) { | ||
302 | case 1: | ||
303 | break; | ||
304 | case 2: | ||
305 | tmp |= 1; | ||
306 | break; | ||
307 | case 4: | ||
308 | tmp |= 2; | ||
309 | break; | ||
310 | } | ||
311 | |||
312 | __raw_writel(tmp, clk->scale_reg); | ||
313 | clk->rate = rate; | ||
314 | return 0; | ||
315 | } | ||
316 | |||
317 | static u32 hclk_round_rate(struct clk *clk, u32 rate) | ||
318 | { | ||
319 | switch (rate) { | ||
320 | case 1: | ||
321 | case 4: | ||
322 | return rate; | ||
323 | } | ||
324 | return 2; | ||
325 | } | ||
326 | |||
327 | static u32 per_clk_round_rate(struct clk *clk, u32 rate) | ||
328 | { | ||
329 | return CLK_RATE_13MHZ; | ||
330 | } | ||
331 | |||
332 | static int on_off_set_rate(struct clk *clk, u32 rate) | ||
333 | { | ||
334 | if (rate) { | ||
335 | clk_reg_enable(clk); | ||
336 | clk->rate = 1; | ||
337 | } else { | ||
338 | clk_reg_disable(clk); | ||
339 | clk->rate = 0; | ||
340 | } | ||
341 | return 0; | ||
342 | } | ||
343 | |||
344 | static int on_off_inv_set_rate(struct clk *clk, u32 rate) | ||
345 | { | ||
346 | if (rate) { | ||
347 | clk_reg_disable(clk); /*enable bit is inverted */ | ||
348 | clk->rate = 1; | ||
349 | } else { | ||
350 | clk_reg_enable(clk); | ||
351 | clk->rate = 0; | ||
352 | } | ||
353 | return 0; | ||
354 | } | ||
355 | |||
356 | static u32 on_off_round_rate(struct clk *clk, u32 rate) | ||
357 | { | ||
358 | return (rate ? 1 : 0); | ||
359 | } | ||
360 | |||
361 | static u32 pll4_round_rate(struct clk *clk, u32 rate) | ||
362 | { | ||
363 | if (rate > CLK_RATE_208MHZ) | ||
364 | rate = CLK_RATE_208MHZ; | ||
365 | if (rate == CLK_RATE_208MHZ && hclk_ck.user_rate == 1) | ||
366 | rate = CLK_RATE_208MHZ - CLK_RATE_13MHZ; | ||
367 | return (rate - (rate % (hclk_ck.user_rate * CLK_RATE_13MHZ))); | ||
368 | } | ||
369 | |||
370 | static u32 pll3_round_rate(struct clk *clk, u32 rate) | ||
371 | { | ||
372 | if (rate > CLK_RATE_208MHZ) | ||
373 | rate = CLK_RATE_208MHZ; | ||
374 | return (rate - rate % CLK_RATE_13MHZ); | ||
375 | } | ||
376 | |||
377 | static u32 pll5_round_rate(struct clk *clk, u32 rate) | ||
378 | { | ||
379 | return (rate ? CLK_RATE_48MHZ : 0); | ||
380 | } | ||
381 | |||
382 | static u32 ck_13MHz_round_rate(struct clk *clk, u32 rate) | ||
383 | { | ||
384 | return (rate ? CLK_RATE_13MHZ : 0); | ||
385 | } | ||
386 | |||
387 | static int ck_13MHz_set_rate(struct clk *clk, u32 rate) | ||
388 | { | ||
389 | if (rate) { | ||
390 | clk_reg_disable(clk); /*enable bit is inverted */ | ||
391 | udelay(500); | ||
392 | clk->rate = CLK_RATE_13MHZ; | ||
393 | ck_1MHz.rate = CLK_RATE_1MHZ; | ||
394 | } else { | ||
395 | clk_reg_enable(clk); | ||
396 | clk->rate = 0; | ||
397 | ck_1MHz.rate = 0; | ||
398 | } | ||
399 | return 0; | ||
400 | } | ||
401 | |||
402 | static int pll1_set_rate(struct clk *clk, u32 rate) | ||
403 | { | ||
404 | #if 0 /* doesn't work on some boards, probably a HW BUG */ | ||
405 | if (rate) { | ||
406 | clk_reg_disable(clk); /*enable bit is inverted */ | ||
407 | if (!clk_wait_for_pll_lock(clk)) { | ||
408 | clk->rate = CLK_RATE_13MHZ; | ||
409 | } else { | ||
410 | clk_reg_enable(clk); | ||
411 | clk->rate = 0; | ||
412 | } | ||
413 | |||
414 | } else { | ||
415 | clk_reg_enable(clk); | ||
416 | clk->rate = 0; | ||
417 | } | ||
418 | #endif | ||
419 | return 0; | ||
420 | } | ||
421 | |||
422 | /* Clock sources */ | ||
423 | |||
424 | static struct clk osc_13MHz = { | ||
425 | .name = "osc_13MHz", | ||
426 | .flags = FIXED_RATE, | ||
427 | .rate = CLK_RATE_13MHZ, | ||
428 | }; | ||
429 | |||
430 | static struct clk ck_13MHz = { | ||
431 | .name = "ck_13MHz", | ||
432 | .parent = &osc_13MHz, | ||
433 | .flags = NEEDS_INITIALIZATION, | ||
434 | .round_rate = &ck_13MHz_round_rate, | ||
435 | .set_rate = &ck_13MHz_set_rate, | ||
436 | .enable_reg = OSC13CTRL_REG, | ||
437 | .enable_shift = 0, | ||
438 | .rate = CLK_RATE_13MHZ, | ||
439 | }; | ||
440 | |||
441 | static struct clk osc_32KHz = { | ||
442 | .name = "osc_32KHz", | ||
443 | .flags = FIXED_RATE, | ||
444 | .rate = CLK_RATE_32KHZ, | ||
445 | }; | ||
446 | |||
447 | /*attached to PLL5*/ | ||
448 | static struct clk ck_1MHz = { | ||
449 | .name = "ck_1MHz", | ||
450 | .flags = FIXED_RATE | PARENT_SET_RATE, | ||
451 | .parent = &ck_13MHz, | ||
452 | }; | ||
453 | |||
454 | /* PLL1 (397) - provides 13' MHz clock */ | ||
455 | static struct clk ck_pll1 = { | ||
456 | .name = "ck_pll1", | ||
457 | .parent = &osc_32KHz, | ||
458 | .flags = NEEDS_INITIALIZATION, | ||
459 | .round_rate = &ck_13MHz_round_rate, | ||
460 | .set_rate = &pll1_set_rate, | ||
461 | .enable_reg = PLLCTRL_REG, | ||
462 | .enable_shift = 1, | ||
463 | .scale_reg = PLLCTRL_REG, | ||
464 | .rate = CLK_RATE_13MHZ, | ||
465 | }; | ||
466 | |||
467 | /* CPU/Bus PLL */ | ||
468 | static struct clk ck_pll4 = { | ||
469 | .name = "ck_pll4", | ||
470 | .parent = &ck_pll1, | ||
471 | .flags = RATE_PROPAGATES | NEEDS_INITIALIZATION, | ||
472 | .propagate_next = &per_ck, | ||
473 | .round_rate = &pll4_round_rate, | ||
474 | .set_rate = &pll160_set_rate, | ||
475 | .rate = CLK_RATE_208MHZ, | ||
476 | .scale_reg = HCLKPLLCTRL_REG, | ||
477 | .enable_reg = PWRCTRL_REG, | ||
478 | .enable_shift = 2, | ||
479 | .parent_switch_reg = SYSCLKCTRL_REG, | ||
480 | .set_parent = &set_13MHz_parent, | ||
481 | }; | ||
482 | |||
483 | /* USB PLL */ | ||
484 | static struct clk ck_pll5 = { | ||
485 | .name = "ck_pll5", | ||
486 | .parent = &ck_1MHz, | ||
487 | .flags = NEEDS_INITIALIZATION, | ||
488 | .round_rate = &pll5_round_rate, | ||
489 | .set_rate = &pll160_set_rate, | ||
490 | .scale_reg = USBCTRL_REG, | ||
491 | .enable_reg = USBCTRL_REG, | ||
492 | .enable_shift = 18, | ||
493 | .enable_reg1 = USBCTRL_REG, | ||
494 | .enable_shift1 = 17, | ||
495 | }; | ||
496 | |||
497 | /* XPERTTeak DSP PLL */ | ||
498 | static struct clk ck_pll3 = { | ||
499 | .name = "ck_pll3", | ||
500 | .parent = &ck_pll1, | ||
501 | .flags = NEEDS_INITIALIZATION, | ||
502 | .round_rate = &pll3_round_rate, | ||
503 | .set_rate = &pll160_set_rate, | ||
504 | .scale_reg = DSPPLLCTRL_REG, | ||
505 | .enable_reg = DSPCLKCTRL_REG, | ||
506 | .enable_shift = 3, | ||
507 | .enable_reg1 = DSPCLKCTRL_REG, | ||
508 | .enable_shift1 = 2, | ||
509 | .parent_switch_reg = DSPCLKCTRL_REG, | ||
510 | .set_parent = &set_13MHz_parent, | ||
511 | }; | ||
512 | |||
513 | static struct clk hclk_ck = { | ||
514 | .name = "hclk_ck", | ||
515 | .parent = &ck_pll4, | ||
516 | .flags = PARENT_SET_RATE, | ||
517 | .set_rate = &hclk_set_rate, | ||
518 | .round_rate = &hclk_round_rate, | ||
519 | .scale_reg = HCLKDIVCTRL_REG, | ||
520 | .rate = 2, | ||
521 | .user_rate = 2, | ||
522 | }; | ||
523 | |||
524 | static struct clk per_ck = { | ||
525 | .name = "per_ck", | ||
526 | .parent = &ck_pll4, | ||
527 | .flags = FIXED_RATE, | ||
528 | .propagate_next = &hclk_ck, | ||
529 | .set_rate = &per_clk_set_rate, | ||
530 | .round_rate = &per_clk_round_rate, | ||
531 | .scale_reg = HCLKDIVCTRL_REG, | ||
532 | .rate = CLK_RATE_13MHZ, | ||
533 | .user_rate = CLK_RATE_13MHZ, | ||
534 | }; | ||
535 | |||
536 | static struct clk m2hclk_ck = { | ||
537 | .name = "m2hclk_ck", | ||
538 | .parent = &hclk_ck, | ||
539 | .flags = NEEDS_INITIALIZATION, | ||
540 | .round_rate = &on_off_round_rate, | ||
541 | .set_rate = &on_off_inv_set_rate, | ||
542 | .rate = 1, | ||
543 | .enable_shift = 6, | ||
544 | .enable_reg = PWRCTRL_REG, | ||
545 | }; | ||
546 | |||
547 | static struct clk vfp9_ck = { | ||
548 | .name = "vfp9_ck", | ||
549 | .parent = &ck_pll4, | ||
550 | .flags = NEEDS_INITIALIZATION, | ||
551 | .round_rate = &on_off_round_rate, | ||
552 | .set_rate = &on_off_set_rate, | ||
553 | .rate = 1, | ||
554 | .enable_shift = 4, | ||
555 | .enable_reg = VFP9CLKCTRL_REG, | ||
556 | }; | ||
557 | |||
558 | static struct clk keyscan_ck = { | ||
559 | .name = "keyscan_ck", | ||
560 | .parent = &osc_32KHz, | ||
561 | .flags = NEEDS_INITIALIZATION, | ||
562 | .round_rate = &on_off_round_rate, | ||
563 | .set_rate = &on_off_set_rate, | ||
564 | .enable_shift = 0, | ||
565 | .enable_reg = KEYCLKCTRL_REG, | ||
566 | }; | ||
567 | |||
568 | static struct clk touch_ck = { | ||
569 | .name = "touch_ck", | ||
570 | .parent = &osc_32KHz, | ||
571 | .flags = NEEDS_INITIALIZATION, | ||
572 | .round_rate = &on_off_round_rate, | ||
573 | .set_rate = &on_off_set_rate, | ||
574 | .enable_shift = 0, | ||
575 | .enable_reg = TSCLKCTRL_REG, | ||
576 | }; | ||
577 | |||
578 | static struct clk pwm1_ck = { | ||
579 | .name = "pwm1_ck", | ||
580 | .parent = &osc_32KHz, | ||
581 | .flags = NEEDS_INITIALIZATION, | ||
582 | .round_rate = &on_off_round_rate, | ||
583 | .set_rate = &on_off_set_rate, | ||
584 | .enable_shift = 0, | ||
585 | .enable_reg = PWMCLKCTRL_REG, | ||
586 | }; | ||
587 | |||
588 | static struct clk pwm2_ck = { | ||
589 | .name = "pwm2_ck", | ||
590 | .parent = &osc_32KHz, | ||
591 | .flags = NEEDS_INITIALIZATION, | ||
592 | .round_rate = &on_off_round_rate, | ||
593 | .set_rate = &on_off_set_rate, | ||
594 | .enable_shift = 2, | ||
595 | .enable_reg = PWMCLKCTRL_REG, | ||
596 | }; | ||
597 | |||
598 | static struct clk jpeg_ck = { | ||
599 | .name = "jpeg_ck", | ||
600 | .parent = &hclk_ck, | ||
601 | .flags = NEEDS_INITIALIZATION, | ||
602 | .round_rate = &on_off_round_rate, | ||
603 | .set_rate = &on_off_set_rate, | ||
604 | .enable_shift = 0, | ||
605 | .enable_reg = JPEGCLKCTRL_REG, | ||
606 | }; | ||
607 | |||
608 | static struct clk ms_ck = { | ||
609 | .name = "ms_ck", | ||
610 | .parent = &ck_pll4, | ||
611 | .flags = NEEDS_INITIALIZATION, | ||
612 | .round_rate = &on_off_round_rate, | ||
613 | .set_rate = &on_off_set_rate, | ||
614 | .enable_shift = 5, | ||
615 | .enable_reg = MSCTRL_REG, | ||
616 | }; | ||
617 | |||
618 | static struct clk dum_ck = { | ||
619 | .name = "dum_ck", | ||
620 | .parent = &hclk_ck, | ||
621 | .flags = NEEDS_INITIALIZATION, | ||
622 | .round_rate = &on_off_round_rate, | ||
623 | .set_rate = &on_off_set_rate, | ||
624 | .enable_shift = 0, | ||
625 | .enable_reg = DUMCLKCTRL_REG, | ||
626 | }; | ||
627 | |||
628 | static struct clk flash_ck = { | ||
629 | .name = "flash_ck", | ||
630 | .parent = &hclk_ck, | ||
631 | .round_rate = &on_off_round_rate, | ||
632 | .set_rate = &on_off_set_rate, | ||
633 | .enable_shift = 1, /* Only MLC clock supported */ | ||
634 | .enable_reg = FLASHCLKCTRL_REG, | ||
635 | }; | ||
636 | |||
637 | static struct clk i2c0_ck = { | ||
638 | .name = "i2c0_ck", | ||
639 | .parent = &per_ck, | ||
640 | .flags = NEEDS_INITIALIZATION | FIXED_RATE, | ||
641 | .enable_shift = 0, | ||
642 | .enable_reg = I2CCLKCTRL_REG, | ||
643 | .rate = 13000000, | ||
644 | .enable = clk_reg_enable, | ||
645 | .disable = clk_reg_disable, | ||
646 | }; | ||
647 | |||
648 | static struct clk i2c1_ck = { | ||
649 | .name = "i2c1_ck", | ||
650 | .parent = &per_ck, | ||
651 | .flags = NEEDS_INITIALIZATION | FIXED_RATE, | ||
652 | .enable_shift = 1, | ||
653 | .enable_reg = I2CCLKCTRL_REG, | ||
654 | .rate = 13000000, | ||
655 | .enable = clk_reg_enable, | ||
656 | .disable = clk_reg_disable, | ||
657 | }; | ||
658 | |||
659 | static struct clk i2c2_ck = { | ||
660 | .name = "i2c2_ck", | ||
661 | .parent = &per_ck, | ||
662 | .flags = NEEDS_INITIALIZATION | FIXED_RATE, | ||
663 | .enable_shift = 2, | ||
664 | .enable_reg = USB_OTG_CLKCTRL_REG, | ||
665 | .rate = 13000000, | ||
666 | .enable = clk_reg_enable, | ||
667 | .disable = clk_reg_disable, | ||
668 | }; | ||
669 | |||
670 | static struct clk spi0_ck = { | ||
671 | .name = "spi0_ck", | ||
672 | .parent = &hclk_ck, | ||
673 | .flags = NEEDS_INITIALIZATION, | ||
674 | .round_rate = &on_off_round_rate, | ||
675 | .set_rate = &on_off_set_rate, | ||
676 | .enable_shift = 0, | ||
677 | .enable_reg = SPICTRL_REG, | ||
678 | }; | ||
679 | |||
680 | static struct clk spi1_ck = { | ||
681 | .name = "spi1_ck", | ||
682 | .parent = &hclk_ck, | ||
683 | .flags = NEEDS_INITIALIZATION, | ||
684 | .round_rate = &on_off_round_rate, | ||
685 | .set_rate = &on_off_set_rate, | ||
686 | .enable_shift = 4, | ||
687 | .enable_reg = SPICTRL_REG, | ||
688 | }; | ||
689 | |||
690 | static struct clk dma_ck = { | ||
691 | .name = "dma_ck", | ||
692 | .parent = &hclk_ck, | ||
693 | .round_rate = &on_off_round_rate, | ||
694 | .set_rate = &on_off_set_rate, | ||
695 | .enable_shift = 0, | ||
696 | .enable_reg = DMACLKCTRL_REG, | ||
697 | }; | ||
698 | |||
699 | static struct clk uart3_ck = { | ||
700 | .name = "uart3_ck", | ||
701 | .parent = &per_ck, | ||
702 | .flags = NEEDS_INITIALIZATION, | ||
703 | .round_rate = &on_off_round_rate, | ||
704 | .set_rate = &on_off_set_rate, | ||
705 | .rate = 1, | ||
706 | .enable_shift = 0, | ||
707 | .enable_reg = UARTCLKCTRL_REG, | ||
708 | }; | ||
709 | |||
710 | static struct clk uart4_ck = { | ||
711 | .name = "uart4_ck", | ||
712 | .parent = &per_ck, | ||
713 | .flags = NEEDS_INITIALIZATION, | ||
714 | .round_rate = &on_off_round_rate, | ||
715 | .set_rate = &on_off_set_rate, | ||
716 | .enable_shift = 1, | ||
717 | .enable_reg = UARTCLKCTRL_REG, | ||
718 | }; | ||
719 | |||
720 | static struct clk uart5_ck = { | ||
721 | .name = "uart5_ck", | ||
722 | .parent = &per_ck, | ||
723 | .flags = NEEDS_INITIALIZATION, | ||
724 | .round_rate = &on_off_round_rate, | ||
725 | .set_rate = &on_off_set_rate, | ||
726 | .rate = 1, | ||
727 | .enable_shift = 2, | ||
728 | .enable_reg = UARTCLKCTRL_REG, | ||
729 | }; | ||
730 | |||
731 | static struct clk uart6_ck = { | ||
732 | .name = "uart6_ck", | ||
733 | .parent = &per_ck, | ||
734 | .flags = NEEDS_INITIALIZATION, | ||
735 | .round_rate = &on_off_round_rate, | ||
736 | .set_rate = &on_off_set_rate, | ||
737 | .enable_shift = 3, | ||
738 | .enable_reg = UARTCLKCTRL_REG, | ||
739 | }; | ||
740 | |||
741 | static struct clk wdt_ck = { | ||
742 | .name = "wdt_ck", | ||
743 | .parent = &per_ck, | ||
744 | .flags = NEEDS_INITIALIZATION, | ||
745 | .enable_shift = 0, | ||
746 | .enable_reg = TIMCLKCTRL_REG, | ||
747 | .enable = clk_reg_enable, | ||
748 | .disable = clk_reg_disable, | ||
749 | }; | ||
750 | |||
751 | /* These clocks are visible outside this module | ||
752 | * and can be initialized | ||
753 | */ | ||
754 | static struct clk *onchip_clks[] __initdata = { | ||
755 | &ck_13MHz, | ||
756 | &ck_pll1, | ||
757 | &ck_pll4, | ||
758 | &ck_pll5, | ||
759 | &ck_pll3, | ||
760 | &vfp9_ck, | ||
761 | &m2hclk_ck, | ||
762 | &hclk_ck, | ||
763 | &dma_ck, | ||
764 | &flash_ck, | ||
765 | &dum_ck, | ||
766 | &keyscan_ck, | ||
767 | &pwm1_ck, | ||
768 | &pwm2_ck, | ||
769 | &jpeg_ck, | ||
770 | &ms_ck, | ||
771 | &touch_ck, | ||
772 | &i2c0_ck, | ||
773 | &i2c1_ck, | ||
774 | &i2c2_ck, | ||
775 | &spi0_ck, | ||
776 | &spi1_ck, | ||
777 | &uart3_ck, | ||
778 | &uart4_ck, | ||
779 | &uart5_ck, | ||
780 | &uart6_ck, | ||
781 | &wdt_ck, | ||
782 | }; | ||
783 | |||
784 | static struct clk_lookup onchip_clkreg[] = { | ||
785 | { .clk = &ck_13MHz, .con_id = "ck_13MHz" }, | ||
786 | { .clk = &ck_pll1, .con_id = "ck_pll1" }, | ||
787 | { .clk = &ck_pll4, .con_id = "ck_pll4" }, | ||
788 | { .clk = &ck_pll5, .con_id = "ck_pll5" }, | ||
789 | { .clk = &ck_pll3, .con_id = "ck_pll3" }, | ||
790 | { .clk = &vfp9_ck, .con_id = "vfp9_ck" }, | ||
791 | { .clk = &m2hclk_ck, .con_id = "m2hclk_ck" }, | ||
792 | { .clk = &hclk_ck, .con_id = "hclk_ck" }, | ||
793 | { .clk = &dma_ck, .con_id = "dma_ck" }, | ||
794 | { .clk = &flash_ck, .con_id = "flash_ck" }, | ||
795 | { .clk = &dum_ck, .con_id = "dum_ck" }, | ||
796 | { .clk = &keyscan_ck, .con_id = "keyscan_ck" }, | ||
797 | { .clk = &pwm1_ck, .con_id = "pwm1_ck" }, | ||
798 | { .clk = &pwm2_ck, .con_id = "pwm2_ck" }, | ||
799 | { .clk = &jpeg_ck, .con_id = "jpeg_ck" }, | ||
800 | { .clk = &ms_ck, .con_id = "ms_ck" }, | ||
801 | { .clk = &touch_ck, .con_id = "touch_ck" }, | ||
802 | { .clk = &i2c0_ck, .dev_id = "pnx-i2c.0" }, | ||
803 | { .clk = &i2c1_ck, .dev_id = "pnx-i2c.1" }, | ||
804 | { .clk = &i2c2_ck, .dev_id = "pnx-i2c.2" }, | ||
805 | { .clk = &spi0_ck, .con_id = "spi0_ck" }, | ||
806 | { .clk = &spi1_ck, .con_id = "spi1_ck" }, | ||
807 | { .clk = &uart3_ck, .con_id = "uart3_ck" }, | ||
808 | { .clk = &uart4_ck, .con_id = "uart4_ck" }, | ||
809 | { .clk = &uart5_ck, .con_id = "uart5_ck" }, | ||
810 | { .clk = &uart6_ck, .con_id = "uart6_ck" }, | ||
811 | { .clk = &wdt_ck, .dev_id = "pnx4008-watchdog" }, | ||
812 | }; | ||
813 | |||
814 | static void local_clk_disable(struct clk *clk) | ||
815 | { | ||
816 | if (WARN_ON(clk->usecount == 0)) | ||
817 | return; | ||
818 | |||
819 | if (!(--clk->usecount)) { | ||
820 | if (clk->disable) | ||
821 | clk->disable(clk); | ||
822 | else if (!(clk->flags & FIXED_RATE) && clk->rate && clk->set_rate) | ||
823 | clk->set_rate(clk, 0); | ||
824 | if (clk->parent) | ||
825 | local_clk_disable(clk->parent); | ||
826 | } | ||
827 | } | ||
828 | |||
829 | static int local_clk_enable(struct clk *clk) | ||
830 | { | ||
831 | int ret = 0; | ||
832 | |||
833 | if (clk->usecount == 0) { | ||
834 | if (clk->parent) { | ||
835 | ret = local_clk_enable(clk->parent); | ||
836 | if (ret != 0) | ||
837 | goto out; | ||
838 | } | ||
839 | |||
840 | if (clk->enable) | ||
841 | ret = clk->enable(clk); | ||
842 | else if (!(clk->flags & FIXED_RATE) && !clk->rate && clk->set_rate | ||
843 | && clk->user_rate) | ||
844 | ret = clk->set_rate(clk, clk->user_rate); | ||
845 | |||
846 | if (ret != 0 && clk->parent) { | ||
847 | local_clk_disable(clk->parent); | ||
848 | goto out; | ||
849 | } | ||
850 | |||
851 | clk->usecount++; | ||
852 | } | ||
853 | out: | ||
854 | return ret; | ||
855 | } | ||
856 | |||
857 | static int local_set_rate(struct clk *clk, u32 rate) | ||
858 | { | ||
859 | int ret = -EINVAL; | ||
860 | if (clk->set_rate) { | ||
861 | |||
862 | if (clk->user_rate == clk->rate && clk->parent->rate) { | ||
863 | /* if clock enabled or rate not set */ | ||
864 | clk->user_rate = clk->round_rate(clk, rate); | ||
865 | ret = clk->set_rate(clk, clk->user_rate); | ||
866 | } else | ||
867 | clk->user_rate = clk->round_rate(clk, rate); | ||
868 | ret = 0; | ||
869 | } | ||
870 | return ret; | ||
871 | } | ||
872 | |||
873 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
874 | { | ||
875 | int ret = -EINVAL; | ||
876 | |||
877 | if (clk->flags & FIXED_RATE) | ||
878 | goto out; | ||
879 | |||
880 | clock_lock(); | ||
881 | if ((clk->flags & PARENT_SET_RATE) && clk->parent) { | ||
882 | |||
883 | clk->user_rate = clk->round_rate(clk, rate); | ||
884 | /* parent clock needs to be refreshed | ||
885 | for the setting to take effect */ | ||
886 | } else { | ||
887 | ret = local_set_rate(clk, rate); | ||
888 | } | ||
889 | ret = 0; | ||
890 | clock_unlock(); | ||
891 | |||
892 | out: | ||
893 | return ret; | ||
894 | } | ||
895 | |||
896 | EXPORT_SYMBOL(clk_set_rate); | ||
897 | |||
898 | unsigned long clk_get_rate(struct clk *clk) | ||
899 | { | ||
900 | unsigned long ret; | ||
901 | clock_lock(); | ||
902 | ret = clk->rate; | ||
903 | clock_unlock(); | ||
904 | return ret; | ||
905 | } | ||
906 | EXPORT_SYMBOL(clk_get_rate); | ||
907 | |||
908 | int clk_enable(struct clk *clk) | ||
909 | { | ||
910 | int ret; | ||
911 | |||
912 | clock_lock(); | ||
913 | ret = local_clk_enable(clk); | ||
914 | clock_unlock(); | ||
915 | return ret; | ||
916 | } | ||
917 | |||
918 | EXPORT_SYMBOL(clk_enable); | ||
919 | |||
920 | void clk_disable(struct clk *clk) | ||
921 | { | ||
922 | clock_lock(); | ||
923 | local_clk_disable(clk); | ||
924 | clock_unlock(); | ||
925 | } | ||
926 | |||
927 | EXPORT_SYMBOL(clk_disable); | ||
928 | |||
929 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
930 | { | ||
931 | long ret; | ||
932 | clock_lock(); | ||
933 | if (clk->round_rate) | ||
934 | ret = clk->round_rate(clk, rate); | ||
935 | else | ||
936 | ret = clk->rate; | ||
937 | clock_unlock(); | ||
938 | return ret; | ||
939 | } | ||
940 | |||
941 | EXPORT_SYMBOL(clk_round_rate); | ||
942 | |||
943 | int clk_set_parent(struct clk *clk, struct clk *parent) | ||
944 | { | ||
945 | int ret = -ENODEV; | ||
946 | if (!clk->set_parent) | ||
947 | goto out; | ||
948 | |||
949 | clock_lock(); | ||
950 | ret = clk->set_parent(clk, parent); | ||
951 | if (!ret) | ||
952 | clk->parent = parent; | ||
953 | clock_unlock(); | ||
954 | |||
955 | out: | ||
956 | return ret; | ||
957 | } | ||
958 | |||
959 | EXPORT_SYMBOL(clk_set_parent); | ||
960 | |||
961 | static int __init clk_init(void) | ||
962 | { | ||
963 | struct clk **clkp; | ||
964 | |||
965 | /* Disable autoclocking, as it doesn't seem to work */ | ||
966 | __raw_writel(0xff, AUTOCLK_CTRL); | ||
967 | |||
968 | for (clkp = onchip_clks; clkp < onchip_clks + ARRAY_SIZE(onchip_clks); | ||
969 | clkp++) { | ||
970 | struct clk *clk = *clkp; | ||
971 | if (clk->flags & NEEDS_INITIALIZATION) { | ||
972 | if (clk->set_rate) { | ||
973 | clk->user_rate = clk->rate; | ||
974 | local_set_rate(clk, clk->user_rate); | ||
975 | if (clk->set_parent) | ||
976 | clk->set_parent(clk, clk->parent); | ||
977 | } | ||
978 | if (clk->enable && clk->usecount) | ||
979 | clk->enable(clk); | ||
980 | if (clk->disable && !clk->usecount) | ||
981 | clk->disable(clk); | ||
982 | } | ||
983 | pr_debug("%s: clock %s, rate %ld\n", | ||
984 | __func__, clk->name, clk->rate); | ||
985 | } | ||
986 | |||
987 | local_clk_enable(&ck_pll4); | ||
988 | |||
989 | /* if ck_13MHz is not used, disable it. */ | ||
990 | if (ck_13MHz.usecount == 0) | ||
991 | local_clk_disable(&ck_13MHz); | ||
992 | |||
993 | /* Disable autoclocking */ | ||
994 | __raw_writeb(0xff, AUTOCLK_CTRL); | ||
995 | |||
996 | clkdev_add_table(onchip_clkreg, ARRAY_SIZE(onchip_clkreg)); | ||
997 | |||
998 | return 0; | ||
999 | } | ||
1000 | |||
1001 | arch_initcall(clk_init); | ||
diff --git a/arch/arm/mach-pnx4008/clock.h b/arch/arm/mach-pnx4008/clock.h deleted file mode 100644 index 39720d6c0d01..000000000000 --- a/arch/arm/mach-pnx4008/clock.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/clock.h | ||
3 | * | ||
4 | * Clock control driver for PNX4008 - internal header file | ||
5 | * | ||
6 | * Author: Vitaly Wool <source@mvista.com> | ||
7 | * | ||
8 | * 2006 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | #ifndef __ARCH_ARM_PNX4008_CLOCK_H__ | ||
14 | #define __ARCH_ARM_PNX4008_CLOCK_H__ | ||
15 | |||
16 | struct clk { | ||
17 | const char *name; | ||
18 | struct clk *parent; | ||
19 | struct clk *propagate_next; | ||
20 | u32 rate; | ||
21 | u32 user_rate; | ||
22 | s8 usecount; | ||
23 | u32 flags; | ||
24 | u32 scale_reg; | ||
25 | u8 enable_shift; | ||
26 | u32 enable_reg; | ||
27 | u8 enable_shift1; | ||
28 | u32 enable_reg1; | ||
29 | u32 parent_switch_reg; | ||
30 | u32(*round_rate) (struct clk *, u32); | ||
31 | int (*set_rate) (struct clk *, u32); | ||
32 | int (*set_parent) (struct clk * clk, struct clk * parent); | ||
33 | int (*enable)(struct clk *); | ||
34 | void (*disable)(struct clk *); | ||
35 | }; | ||
36 | |||
37 | /* Flags */ | ||
38 | #define RATE_PROPAGATES (1<<0) | ||
39 | #define NEEDS_INITIALIZATION (1<<1) | ||
40 | #define PARENT_SET_RATE (1<<2) | ||
41 | #define FIXED_RATE (1<<3) | ||
42 | |||
43 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/core.c b/arch/arm/mach-pnx4008/core.c deleted file mode 100644 index a00d2f1254ed..000000000000 --- a/arch/arm/mach-pnx4008/core.c +++ /dev/null | |||
@@ -1,290 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/core.c | ||
3 | * | ||
4 | * PNX4008 core startup code | ||
5 | * | ||
6 | * Authors: Vitaly Wool, Dmitry Chigirev, | ||
7 | * Grigory Tolstolytkin, Dmitry Pervushin <source@mvista.com> | ||
8 | * | ||
9 | * Based on reference code received from Philips: | ||
10 | * Copyright (C) 2003 Philips Semiconductors | ||
11 | * | ||
12 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
13 | * the terms of the GNU General Public License version 2. This program | ||
14 | * is licensed "as is" without any warranty of any kind, whether express | ||
15 | * or implied. | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <linux/mm.h> | ||
21 | #include <linux/interrupt.h> | ||
22 | #include <linux/list.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/ioport.h> | ||
25 | #include <linux/serial_8250.h> | ||
26 | #include <linux/device.h> | ||
27 | #include <linux/spi/spi.h> | ||
28 | #include <linux/io.h> | ||
29 | |||
30 | #include <mach/hardware.h> | ||
31 | #include <asm/setup.h> | ||
32 | #include <asm/mach-types.h> | ||
33 | #include <asm/pgtable.h> | ||
34 | #include <asm/page.h> | ||
35 | #include <asm/system_misc.h> | ||
36 | |||
37 | #include <asm/mach/arch.h> | ||
38 | #include <asm/mach/map.h> | ||
39 | #include <asm/mach/time.h> | ||
40 | |||
41 | #include <mach/irq.h> | ||
42 | #include <mach/clock.h> | ||
43 | #include <mach/dma.h> | ||
44 | |||
45 | struct resource spipnx_0_resources[] = { | ||
46 | { | ||
47 | .start = PNX4008_SPI1_BASE, | ||
48 | .end = PNX4008_SPI1_BASE + SZ_4K, | ||
49 | .flags = IORESOURCE_MEM, | ||
50 | }, { | ||
51 | .start = PER_SPI1_REC_XMIT, | ||
52 | .flags = IORESOURCE_DMA, | ||
53 | }, { | ||
54 | .start = SPI1_INT, | ||
55 | .flags = IORESOURCE_IRQ, | ||
56 | }, { | ||
57 | .flags = 0, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | struct resource spipnx_1_resources[] = { | ||
62 | { | ||
63 | .start = PNX4008_SPI2_BASE, | ||
64 | .end = PNX4008_SPI2_BASE + SZ_4K, | ||
65 | .flags = IORESOURCE_MEM, | ||
66 | }, { | ||
67 | .start = PER_SPI2_REC_XMIT, | ||
68 | .flags = IORESOURCE_DMA, | ||
69 | }, { | ||
70 | .start = SPI2_INT, | ||
71 | .flags = IORESOURCE_IRQ, | ||
72 | }, { | ||
73 | .flags = 0, | ||
74 | } | ||
75 | }; | ||
76 | |||
77 | static struct spi_board_info spi_board_info[] __initdata = { | ||
78 | { | ||
79 | .modalias = "m25p80", | ||
80 | .max_speed_hz = 1000000, | ||
81 | .bus_num = 1, | ||
82 | .chip_select = 0, | ||
83 | }, | ||
84 | }; | ||
85 | |||
86 | static struct platform_device spipnx_1 = { | ||
87 | .name = "spipnx", | ||
88 | .id = 1, | ||
89 | .num_resources = ARRAY_SIZE(spipnx_0_resources), | ||
90 | .resource = spipnx_0_resources, | ||
91 | .dev = { | ||
92 | .coherent_dma_mask = 0xFFFFFFFF, | ||
93 | }, | ||
94 | }; | ||
95 | |||
96 | static struct platform_device spipnx_2 = { | ||
97 | .name = "spipnx", | ||
98 | .id = 2, | ||
99 | .num_resources = ARRAY_SIZE(spipnx_1_resources), | ||
100 | .resource = spipnx_1_resources, | ||
101 | .dev = { | ||
102 | .coherent_dma_mask = 0xFFFFFFFF, | ||
103 | }, | ||
104 | }; | ||
105 | |||
106 | static struct plat_serial8250_port platform_serial_ports[] = { | ||
107 | { | ||
108 | .membase = (void *)__iomem(IO_ADDRESS(PNX4008_UART5_BASE)), | ||
109 | .mapbase = (unsigned long)PNX4008_UART5_BASE, | ||
110 | .irq = IIR5_INT, | ||
111 | .uartclk = PNX4008_UART_CLK, | ||
112 | .regshift = 2, | ||
113 | .iotype = UPIO_MEM, | ||
114 | .flags = UPF_BOOT_AUTOCONF | UPF_BUGGY_UART | UPF_SKIP_TEST, | ||
115 | }, | ||
116 | { | ||
117 | .membase = (void *)__iomem(IO_ADDRESS(PNX4008_UART3_BASE)), | ||
118 | .mapbase = (unsigned long)PNX4008_UART3_BASE, | ||
119 | .irq = IIR3_INT, | ||
120 | .uartclk = PNX4008_UART_CLK, | ||
121 | .regshift = 2, | ||
122 | .iotype = UPIO_MEM, | ||
123 | .flags = UPF_BOOT_AUTOCONF | UPF_BUGGY_UART | UPF_SKIP_TEST, | ||
124 | }, | ||
125 | {} | ||
126 | }; | ||
127 | |||
128 | static struct platform_device serial_device = { | ||
129 | .name = "serial8250", | ||
130 | .id = PLAT8250_DEV_PLATFORM, | ||
131 | .dev = { | ||
132 | .platform_data = &platform_serial_ports, | ||
133 | }, | ||
134 | }; | ||
135 | |||
136 | static struct platform_device nand_flash_device = { | ||
137 | .name = "pnx4008-flash", | ||
138 | .id = -1, | ||
139 | .dev = { | ||
140 | .coherent_dma_mask = 0xFFFFFFFF, | ||
141 | }, | ||
142 | }; | ||
143 | |||
144 | /* The dmamask must be set for OHCI to work */ | ||
145 | static u64 ohci_dmamask = ~(u32) 0; | ||
146 | |||
147 | static struct resource ohci_resources[] = { | ||
148 | { | ||
149 | .start = IO_ADDRESS(PNX4008_USB_CONFIG_BASE), | ||
150 | .end = IO_ADDRESS(PNX4008_USB_CONFIG_BASE + 0x100), | ||
151 | .flags = IORESOURCE_MEM, | ||
152 | }, { | ||
153 | .start = USB_HOST_INT, | ||
154 | .flags = IORESOURCE_IRQ, | ||
155 | }, | ||
156 | }; | ||
157 | |||
158 | static struct platform_device ohci_device = { | ||
159 | .name = "pnx4008-usb-ohci", | ||
160 | .id = -1, | ||
161 | .dev = { | ||
162 | .dma_mask = &ohci_dmamask, | ||
163 | .coherent_dma_mask = 0xffffffff, | ||
164 | }, | ||
165 | .num_resources = ARRAY_SIZE(ohci_resources), | ||
166 | .resource = ohci_resources, | ||
167 | }; | ||
168 | |||
169 | static struct platform_device sdum_device = { | ||
170 | .name = "pnx4008-sdum", | ||
171 | .id = 0, | ||
172 | .dev = { | ||
173 | .coherent_dma_mask = 0xffffffff, | ||
174 | }, | ||
175 | }; | ||
176 | |||
177 | static struct platform_device rgbfb_device = { | ||
178 | .name = "pnx4008-rgbfb", | ||
179 | .id = 0, | ||
180 | .dev = { | ||
181 | .coherent_dma_mask = 0xffffffff, | ||
182 | } | ||
183 | }; | ||
184 | |||
185 | struct resource watchdog_resources[] = { | ||
186 | { | ||
187 | .start = PNX4008_WDOG_BASE, | ||
188 | .end = PNX4008_WDOG_BASE + SZ_4K - 1, | ||
189 | .flags = IORESOURCE_MEM, | ||
190 | }, | ||
191 | }; | ||
192 | |||
193 | static struct platform_device watchdog_device = { | ||
194 | .name = "pnx4008-watchdog", | ||
195 | .id = -1, | ||
196 | .num_resources = ARRAY_SIZE(watchdog_resources), | ||
197 | .resource = watchdog_resources, | ||
198 | }; | ||
199 | |||
200 | static struct platform_device *devices[] __initdata = { | ||
201 | &spipnx_1, | ||
202 | &spipnx_2, | ||
203 | &serial_device, | ||
204 | &ohci_device, | ||
205 | &nand_flash_device, | ||
206 | &sdum_device, | ||
207 | &rgbfb_device, | ||
208 | &watchdog_device, | ||
209 | }; | ||
210 | |||
211 | |||
212 | extern void pnx4008_uart_init(void); | ||
213 | |||
214 | static void __init pnx4008_init(void) | ||
215 | { | ||
216 | /*disable all START interrupt sources, | ||
217 | and clear all START interrupt flags */ | ||
218 | __raw_writel(0, START_INT_ER_REG(SE_PIN_BASE_INT)); | ||
219 | __raw_writel(0, START_INT_ER_REG(SE_INT_BASE_INT)); | ||
220 | __raw_writel(0xffffffff, START_INT_RSR_REG(SE_PIN_BASE_INT)); | ||
221 | __raw_writel(0xffffffff, START_INT_RSR_REG(SE_INT_BASE_INT)); | ||
222 | |||
223 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
224 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); | ||
225 | /* Switch on the UART clocks */ | ||
226 | pnx4008_uart_init(); | ||
227 | } | ||
228 | |||
229 | static struct map_desc pnx4008_io_desc[] __initdata = { | ||
230 | { | ||
231 | .virtual = IO_ADDRESS(PNX4008_IRAM_BASE), | ||
232 | .pfn = __phys_to_pfn(PNX4008_IRAM_BASE), | ||
233 | .length = SZ_64K, | ||
234 | .type = MT_DEVICE, | ||
235 | }, { | ||
236 | .virtual = IO_ADDRESS(PNX4008_NDF_FLASH_BASE), | ||
237 | .pfn = __phys_to_pfn(PNX4008_NDF_FLASH_BASE), | ||
238 | .length = SZ_1M - SZ_128K, | ||
239 | .type = MT_DEVICE, | ||
240 | }, { | ||
241 | .virtual = IO_ADDRESS(PNX4008_JPEG_CONFIG_BASE), | ||
242 | .pfn = __phys_to_pfn(PNX4008_JPEG_CONFIG_BASE), | ||
243 | .length = SZ_128K * 3, | ||
244 | .type = MT_DEVICE, | ||
245 | }, { | ||
246 | .virtual = IO_ADDRESS(PNX4008_DMA_CONFIG_BASE), | ||
247 | .pfn = __phys_to_pfn(PNX4008_DMA_CONFIG_BASE), | ||
248 | .length = SZ_1M, | ||
249 | .type = MT_DEVICE, | ||
250 | }, { | ||
251 | .virtual = IO_ADDRESS(PNX4008_AHB2FAB_BASE), | ||
252 | .pfn = __phys_to_pfn(PNX4008_AHB2FAB_BASE), | ||
253 | .length = SZ_1M, | ||
254 | .type = MT_DEVICE, | ||
255 | }, | ||
256 | }; | ||
257 | |||
258 | void __init pnx4008_map_io(void) | ||
259 | { | ||
260 | iotable_init(pnx4008_io_desc, ARRAY_SIZE(pnx4008_io_desc)); | ||
261 | } | ||
262 | |||
263 | static void pnx4008_restart(char mode, const char *cmd) | ||
264 | { | ||
265 | soft_restart(0); | ||
266 | } | ||
267 | |||
268 | #ifdef CONFIG_PM | ||
269 | extern int pnx4008_pm_init(void); | ||
270 | #else | ||
271 | static inline int pnx4008_pm_init(void) { return 0; } | ||
272 | #endif | ||
273 | |||
274 | void __init pnx4008_init_late(void) | ||
275 | { | ||
276 | pnx4008_pm_init(); | ||
277 | } | ||
278 | |||
279 | extern struct sys_timer pnx4008_timer; | ||
280 | |||
281 | MACHINE_START(PNX4008, "Philips PNX4008") | ||
282 | /* Maintainer: MontaVista Software Inc. */ | ||
283 | .atag_offset = 0x100, | ||
284 | .map_io = pnx4008_map_io, | ||
285 | .init_irq = pnx4008_init_irq, | ||
286 | .init_machine = pnx4008_init, | ||
287 | .init_late = pnx4008_init_late, | ||
288 | .timer = &pnx4008_timer, | ||
289 | .restart = pnx4008_restart, | ||
290 | MACHINE_END | ||
diff --git a/arch/arm/mach-pnx4008/dma.c b/arch/arm/mach-pnx4008/dma.c deleted file mode 100644 index a4739e9fb2fb..000000000000 --- a/arch/arm/mach-pnx4008/dma.c +++ /dev/null | |||
@@ -1,1105 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pnx4008/dma.c | ||
3 | * | ||
4 | * PNX4008 DMA registration and IRQ dispatching | ||
5 | * | ||
6 | * Author: Vitaly Wool | ||
7 | * Copyright: MontaVista Software Inc. (c) 2005 | ||
8 | * | ||
9 | * Based on the code from Nicolas Pitre | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #include <linux/module.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/interrupt.h> | ||
20 | #include <linux/errno.h> | ||
21 | #include <linux/err.h> | ||
22 | #include <linux/dma-mapping.h> | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/io.h> | ||
25 | #include <linux/gfp.h> | ||
26 | |||
27 | #include <mach/hardware.h> | ||
28 | #include <mach/dma.h> | ||
29 | #include <asm/dma-mapping.h> | ||
30 | #include <mach/clock.h> | ||
31 | |||
32 | static struct dma_channel { | ||
33 | char *name; | ||
34 | void (*irq_handler) (int, int, void *); | ||
35 | void *data; | ||
36 | struct pnx4008_dma_ll *ll; | ||
37 | u32 ll_dma; | ||
38 | void *target_addr; | ||
39 | int target_id; | ||
40 | } dma_channels[MAX_DMA_CHANNELS]; | ||
41 | |||
42 | static struct ll_pool { | ||
43 | void *vaddr; | ||
44 | void *cur; | ||
45 | dma_addr_t dma_addr; | ||
46 | int count; | ||
47 | } ll_pool; | ||
48 | |||
49 | static DEFINE_SPINLOCK(ll_lock); | ||
50 | |||
51 | struct pnx4008_dma_ll *pnx4008_alloc_ll_entry(dma_addr_t * ll_dma) | ||
52 | { | ||
53 | struct pnx4008_dma_ll *ll = NULL; | ||
54 | unsigned long flags; | ||
55 | |||
56 | spin_lock_irqsave(&ll_lock, flags); | ||
57 | if (ll_pool.count > 4) { /* can give one more */ | ||
58 | ll = *(struct pnx4008_dma_ll **) ll_pool.cur; | ||
59 | *ll_dma = ll_pool.dma_addr + ((void *)ll - ll_pool.vaddr); | ||
60 | *(void **)ll_pool.cur = **(void ***)ll_pool.cur; | ||
61 | memset(ll, 0, sizeof(*ll)); | ||
62 | ll_pool.count--; | ||
63 | } | ||
64 | spin_unlock_irqrestore(&ll_lock, flags); | ||
65 | |||
66 | return ll; | ||
67 | } | ||
68 | |||
69 | EXPORT_SYMBOL_GPL(pnx4008_alloc_ll_entry); | ||
70 | |||
71 | void pnx4008_free_ll_entry(struct pnx4008_dma_ll * ll, dma_addr_t ll_dma) | ||
72 | { | ||
73 | unsigned long flags; | ||
74 | |||
75 | if (ll) { | ||
76 | if ((unsigned long)((long)ll - (long)ll_pool.vaddr) > 0x4000) { | ||
77 | printk(KERN_ERR "Trying to free entry not allocated by DMA\n"); | ||
78 | BUG(); | ||
79 | } | ||
80 | |||
81 | if (ll->flags & DMA_BUFFER_ALLOCATED) | ||
82 | ll->free(ll->alloc_data); | ||
83 | |||
84 | spin_lock_irqsave(&ll_lock, flags); | ||
85 | *(long *)ll = *(long *)ll_pool.cur; | ||
86 | *(long *)ll_pool.cur = (long)ll; | ||
87 | ll_pool.count++; | ||
88 | spin_unlock_irqrestore(&ll_lock, flags); | ||
89 | } | ||
90 | } | ||
91 | |||
92 | EXPORT_SYMBOL_GPL(pnx4008_free_ll_entry); | ||
93 | |||
94 | void pnx4008_free_ll(u32 ll_dma, struct pnx4008_dma_ll * ll) | ||
95 | { | ||
96 | struct pnx4008_dma_ll *ptr; | ||
97 | u32 dma; | ||
98 | |||
99 | while (ll) { | ||
100 | dma = ll->next_dma; | ||
101 | ptr = ll->next; | ||
102 | pnx4008_free_ll_entry(ll, ll_dma); | ||
103 | |||
104 | ll_dma = dma; | ||
105 | ll = ptr; | ||
106 | } | ||
107 | } | ||
108 | |||
109 | EXPORT_SYMBOL_GPL(pnx4008_free_ll); | ||
110 | |||
111 | static int dma_channels_requested = 0; | ||
112 | |||
113 | static inline void dma_increment_usage(void) | ||
114 | { | ||
115 | if (!dma_channels_requested++) { | ||
116 | struct clk *clk = clk_get(0, "dma_ck"); | ||
117 | if (!IS_ERR(clk)) { | ||
118 | clk_set_rate(clk, 1); | ||
119 | clk_put(clk); | ||
120 | } | ||
121 | pnx4008_config_dma(-1, -1, 1); | ||
122 | } | ||
123 | } | ||
124 | static inline void dma_decrement_usage(void) | ||
125 | { | ||
126 | if (!--dma_channels_requested) { | ||
127 | struct clk *clk = clk_get(0, "dma_ck"); | ||
128 | if (!IS_ERR(clk)) { | ||
129 | clk_set_rate(clk, 0); | ||
130 | clk_put(clk); | ||
131 | } | ||
132 | pnx4008_config_dma(-1, -1, 0); | ||
133 | |||
134 | } | ||
135 | } | ||
136 | |||
137 | static DEFINE_SPINLOCK(dma_lock); | ||
138 | |||
139 | static inline void pnx4008_dma_lock(void) | ||
140 | { | ||
141 | spin_lock_irq(&dma_lock); | ||
142 | } | ||
143 | |||
144 | static inline void pnx4008_dma_unlock(void) | ||
145 | { | ||
146 | spin_unlock_irq(&dma_lock); | ||
147 | } | ||
148 | |||
149 | #define VALID_CHANNEL(c) (((c) >= 0) && ((c) < MAX_DMA_CHANNELS)) | ||
150 | |||
151 | int pnx4008_request_channel(char *name, int ch, | ||
152 | void (*irq_handler) (int, int, void *), void *data) | ||
153 | { | ||
154 | int i, found = 0; | ||
155 | |||
156 | /* basic sanity checks */ | ||
157 | if (!name || (ch != -1 && !VALID_CHANNEL(ch))) | ||
158 | return -EINVAL; | ||
159 | |||
160 | pnx4008_dma_lock(); | ||
161 | |||
162 | /* try grabbing a DMA channel with the requested priority */ | ||
163 | for (i = MAX_DMA_CHANNELS - 1; i >= 0; i--) { | ||
164 | if (!dma_channels[i].name && (ch == -1 || ch == i)) { | ||
165 | found = 1; | ||
166 | break; | ||
167 | } | ||
168 | } | ||
169 | |||
170 | if (found) { | ||
171 | dma_increment_usage(); | ||
172 | dma_channels[i].name = name; | ||
173 | dma_channels[i].irq_handler = irq_handler; | ||
174 | dma_channels[i].data = data; | ||
175 | dma_channels[i].ll = NULL; | ||
176 | dma_channels[i].ll_dma = 0; | ||
177 | } else { | ||
178 | printk(KERN_WARNING "No more available DMA channels for %s\n", | ||
179 | name); | ||
180 | i = -ENODEV; | ||
181 | } | ||
182 | |||
183 | pnx4008_dma_unlock(); | ||
184 | return i; | ||
185 | } | ||
186 | |||
187 | EXPORT_SYMBOL_GPL(pnx4008_request_channel); | ||
188 | |||
189 | void pnx4008_free_channel(int ch) | ||
190 | { | ||
191 | if (!dma_channels[ch].name) { | ||
192 | printk(KERN_CRIT | ||
193 | "%s: trying to free channel %d which is already freed\n", | ||
194 | __func__, ch); | ||
195 | return; | ||
196 | } | ||
197 | |||
198 | pnx4008_dma_lock(); | ||
199 | pnx4008_free_ll(dma_channels[ch].ll_dma, dma_channels[ch].ll); | ||
200 | dma_channels[ch].ll = NULL; | ||
201 | dma_decrement_usage(); | ||
202 | |||
203 | dma_channels[ch].name = NULL; | ||
204 | pnx4008_dma_unlock(); | ||
205 | } | ||
206 | |||
207 | EXPORT_SYMBOL_GPL(pnx4008_free_channel); | ||
208 | |||
209 | int pnx4008_config_dma(int ahb_m1_be, int ahb_m2_be, int enable) | ||
210 | { | ||
211 | unsigned long dma_cfg = __raw_readl(DMAC_CONFIG); | ||
212 | |||
213 | switch (ahb_m1_be) { | ||
214 | case 0: | ||
215 | dma_cfg &= ~(1 << 1); | ||
216 | break; | ||
217 | case 1: | ||
218 | dma_cfg |= (1 << 1); | ||
219 | break; | ||
220 | default: | ||
221 | break; | ||
222 | } | ||
223 | |||
224 | switch (ahb_m2_be) { | ||
225 | case 0: | ||
226 | dma_cfg &= ~(1 << 2); | ||
227 | break; | ||
228 | case 1: | ||
229 | dma_cfg |= (1 << 2); | ||
230 | break; | ||
231 | default: | ||
232 | break; | ||
233 | } | ||
234 | |||
235 | switch (enable) { | ||
236 | case 0: | ||
237 | dma_cfg &= ~(1 << 0); | ||
238 | break; | ||
239 | case 1: | ||
240 | dma_cfg |= (1 << 0); | ||
241 | break; | ||
242 | default: | ||
243 | break; | ||
244 | } | ||
245 | |||
246 | pnx4008_dma_lock(); | ||
247 | __raw_writel(dma_cfg, DMAC_CONFIG); | ||
248 | pnx4008_dma_unlock(); | ||
249 | |||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | EXPORT_SYMBOL_GPL(pnx4008_config_dma); | ||
254 | |||
255 | int pnx4008_dma_pack_control(const struct pnx4008_dma_ch_ctrl * ch_ctrl, | ||
256 | unsigned long *ctrl) | ||
257 | { | ||
258 | int i = 0, dbsize, sbsize, err = 0; | ||
259 | |||
260 | if (!ctrl || !ch_ctrl) { | ||
261 | err = -EINVAL; | ||
262 | goto out; | ||
263 | } | ||
264 | |||
265 | *ctrl = 0; | ||
266 | |||
267 | switch (ch_ctrl->tc_mask) { | ||
268 | case 0: | ||
269 | break; | ||
270 | case 1: | ||
271 | *ctrl |= (1 << 31); | ||
272 | break; | ||
273 | |||
274 | default: | ||
275 | err = -EINVAL; | ||
276 | goto out; | ||
277 | } | ||
278 | |||
279 | switch (ch_ctrl->cacheable) { | ||
280 | case 0: | ||
281 | break; | ||
282 | case 1: | ||
283 | *ctrl |= (1 << 30); | ||
284 | break; | ||
285 | |||
286 | default: | ||
287 | err = -EINVAL; | ||
288 | goto out; | ||
289 | } | ||
290 | switch (ch_ctrl->bufferable) { | ||
291 | case 0: | ||
292 | break; | ||
293 | case 1: | ||
294 | *ctrl |= (1 << 29); | ||
295 | break; | ||
296 | |||
297 | default: | ||
298 | err = -EINVAL; | ||
299 | goto out; | ||
300 | } | ||
301 | switch (ch_ctrl->priv_mode) { | ||
302 | case 0: | ||
303 | break; | ||
304 | case 1: | ||
305 | *ctrl |= (1 << 28); | ||
306 | break; | ||
307 | |||
308 | default: | ||
309 | err = -EINVAL; | ||
310 | goto out; | ||
311 | } | ||
312 | switch (ch_ctrl->di) { | ||
313 | case 0: | ||
314 | break; | ||
315 | case 1: | ||
316 | *ctrl |= (1 << 27); | ||
317 | break; | ||
318 | |||
319 | default: | ||
320 | err = -EINVAL; | ||
321 | goto out; | ||
322 | } | ||
323 | switch (ch_ctrl->si) { | ||
324 | case 0: | ||
325 | break; | ||
326 | case 1: | ||
327 | *ctrl |= (1 << 26); | ||
328 | break; | ||
329 | |||
330 | default: | ||
331 | err = -EINVAL; | ||
332 | goto out; | ||
333 | } | ||
334 | switch (ch_ctrl->dest_ahb1) { | ||
335 | case 0: | ||
336 | break; | ||
337 | case 1: | ||
338 | *ctrl |= (1 << 25); | ||
339 | break; | ||
340 | |||
341 | default: | ||
342 | err = -EINVAL; | ||
343 | goto out; | ||
344 | } | ||
345 | switch (ch_ctrl->src_ahb1) { | ||
346 | case 0: | ||
347 | break; | ||
348 | case 1: | ||
349 | *ctrl |= (1 << 24); | ||
350 | break; | ||
351 | |||
352 | default: | ||
353 | err = -EINVAL; | ||
354 | goto out; | ||
355 | } | ||
356 | switch (ch_ctrl->dwidth) { | ||
357 | case WIDTH_BYTE: | ||
358 | *ctrl &= ~(7 << 21); | ||
359 | break; | ||
360 | case WIDTH_HWORD: | ||
361 | *ctrl &= ~(7 << 21); | ||
362 | *ctrl |= (1 << 21); | ||
363 | break; | ||
364 | case WIDTH_WORD: | ||
365 | *ctrl &= ~(7 << 21); | ||
366 | *ctrl |= (2 << 21); | ||
367 | break; | ||
368 | |||
369 | default: | ||
370 | err = -EINVAL; | ||
371 | goto out; | ||
372 | } | ||
373 | switch (ch_ctrl->swidth) { | ||
374 | case WIDTH_BYTE: | ||
375 | *ctrl &= ~(7 << 18); | ||
376 | break; | ||
377 | case WIDTH_HWORD: | ||
378 | *ctrl &= ~(7 << 18); | ||
379 | *ctrl |= (1 << 18); | ||
380 | break; | ||
381 | case WIDTH_WORD: | ||
382 | *ctrl &= ~(7 << 18); | ||
383 | *ctrl |= (2 << 18); | ||
384 | break; | ||
385 | |||
386 | default: | ||
387 | err = -EINVAL; | ||
388 | goto out; | ||
389 | } | ||
390 | dbsize = ch_ctrl->dbsize; | ||
391 | while (!(dbsize & 1)) { | ||
392 | i++; | ||
393 | dbsize >>= 1; | ||
394 | } | ||
395 | if (ch_ctrl->dbsize != 1 || i > 8 || i == 1) { | ||
396 | err = -EINVAL; | ||
397 | goto out; | ||
398 | } else if (i > 1) | ||
399 | i--; | ||
400 | *ctrl &= ~(7 << 15); | ||
401 | *ctrl |= (i << 15); | ||
402 | |||
403 | sbsize = ch_ctrl->sbsize; | ||
404 | while (!(sbsize & 1)) { | ||
405 | i++; | ||
406 | sbsize >>= 1; | ||
407 | } | ||
408 | if (ch_ctrl->sbsize != 1 || i > 8 || i == 1) { | ||
409 | err = -EINVAL; | ||
410 | goto out; | ||
411 | } else if (i > 1) | ||
412 | i--; | ||
413 | *ctrl &= ~(7 << 12); | ||
414 | *ctrl |= (i << 12); | ||
415 | |||
416 | if (ch_ctrl->tr_size > 0x7ff) { | ||
417 | err = -E2BIG; | ||
418 | goto out; | ||
419 | } | ||
420 | *ctrl &= ~0x7ff; | ||
421 | *ctrl |= ch_ctrl->tr_size & 0x7ff; | ||
422 | |||
423 | out: | ||
424 | return err; | ||
425 | } | ||
426 | |||
427 | EXPORT_SYMBOL_GPL(pnx4008_dma_pack_control); | ||
428 | |||
429 | int pnx4008_dma_parse_control(unsigned long ctrl, | ||
430 | struct pnx4008_dma_ch_ctrl * ch_ctrl) | ||
431 | { | ||
432 | int err = 0; | ||
433 | |||
434 | if (!ch_ctrl) { | ||
435 | err = -EINVAL; | ||
436 | goto out; | ||
437 | } | ||
438 | |||
439 | ch_ctrl->tr_size = ctrl & 0x7ff; | ||
440 | ctrl >>= 12; | ||
441 | |||
442 | ch_ctrl->sbsize = 1 << (ctrl & 7); | ||
443 | if (ch_ctrl->sbsize > 1) | ||
444 | ch_ctrl->sbsize <<= 1; | ||
445 | ctrl >>= 3; | ||
446 | |||
447 | ch_ctrl->dbsize = 1 << (ctrl & 7); | ||
448 | if (ch_ctrl->dbsize > 1) | ||
449 | ch_ctrl->dbsize <<= 1; | ||
450 | ctrl >>= 3; | ||
451 | |||
452 | switch (ctrl & 7) { | ||
453 | case 0: | ||
454 | ch_ctrl->swidth = WIDTH_BYTE; | ||
455 | break; | ||
456 | case 1: | ||
457 | ch_ctrl->swidth = WIDTH_HWORD; | ||
458 | break; | ||
459 | case 2: | ||
460 | ch_ctrl->swidth = WIDTH_WORD; | ||
461 | break; | ||
462 | default: | ||
463 | err = -EINVAL; | ||
464 | goto out; | ||
465 | } | ||
466 | ctrl >>= 3; | ||
467 | |||
468 | switch (ctrl & 7) { | ||
469 | case 0: | ||
470 | ch_ctrl->dwidth = WIDTH_BYTE; | ||
471 | break; | ||
472 | case 1: | ||
473 | ch_ctrl->dwidth = WIDTH_HWORD; | ||
474 | break; | ||
475 | case 2: | ||
476 | ch_ctrl->dwidth = WIDTH_WORD; | ||
477 | break; | ||
478 | default: | ||
479 | err = -EINVAL; | ||
480 | goto out; | ||
481 | } | ||
482 | ctrl >>= 3; | ||
483 | |||
484 | ch_ctrl->src_ahb1 = ctrl & 1; | ||
485 | ctrl >>= 1; | ||
486 | |||
487 | ch_ctrl->dest_ahb1 = ctrl & 1; | ||
488 | ctrl >>= 1; | ||
489 | |||
490 | ch_ctrl->si = ctrl & 1; | ||
491 | ctrl >>= 1; | ||
492 | |||
493 | ch_ctrl->di = ctrl & 1; | ||
494 | ctrl >>= 1; | ||
495 | |||
496 | ch_ctrl->priv_mode = ctrl & 1; | ||
497 | ctrl >>= 1; | ||
498 | |||
499 | ch_ctrl->bufferable = ctrl & 1; | ||
500 | ctrl >>= 1; | ||
501 | |||
502 | ch_ctrl->cacheable = ctrl & 1; | ||
503 | ctrl >>= 1; | ||
504 | |||
505 | ch_ctrl->tc_mask = ctrl & 1; | ||
506 | |||
507 | out: | ||
508 | return err; | ||
509 | } | ||
510 | |||
511 | EXPORT_SYMBOL_GPL(pnx4008_dma_parse_control); | ||
512 | |||
513 | int pnx4008_dma_pack_config(const struct pnx4008_dma_ch_config * ch_cfg, | ||
514 | unsigned long *cfg) | ||
515 | { | ||
516 | int err = 0; | ||
517 | |||
518 | if (!cfg || !ch_cfg) { | ||
519 | err = -EINVAL; | ||
520 | goto out; | ||
521 | } | ||
522 | |||
523 | *cfg = 0; | ||
524 | |||
525 | switch (ch_cfg->halt) { | ||
526 | case 0: | ||
527 | break; | ||
528 | case 1: | ||
529 | *cfg |= (1 << 18); | ||
530 | break; | ||
531 | |||
532 | default: | ||
533 | err = -EINVAL; | ||
534 | goto out; | ||
535 | } | ||
536 | switch (ch_cfg->active) { | ||
537 | case 0: | ||
538 | break; | ||
539 | case 1: | ||
540 | *cfg |= (1 << 17); | ||
541 | break; | ||
542 | |||
543 | default: | ||
544 | err = -EINVAL; | ||
545 | goto out; | ||
546 | } | ||
547 | switch (ch_cfg->lock) { | ||
548 | case 0: | ||
549 | break; | ||
550 | case 1: | ||
551 | *cfg |= (1 << 16); | ||
552 | break; | ||
553 | |||
554 | default: | ||
555 | err = -EINVAL; | ||
556 | goto out; | ||
557 | } | ||
558 | switch (ch_cfg->itc) { | ||
559 | case 0: | ||
560 | break; | ||
561 | case 1: | ||
562 | *cfg |= (1 << 15); | ||
563 | break; | ||
564 | |||
565 | default: | ||
566 | err = -EINVAL; | ||
567 | goto out; | ||
568 | } | ||
569 | switch (ch_cfg->ie) { | ||
570 | case 0: | ||
571 | break; | ||
572 | case 1: | ||
573 | *cfg |= (1 << 14); | ||
574 | break; | ||
575 | |||
576 | default: | ||
577 | err = -EINVAL; | ||
578 | goto out; | ||
579 | } | ||
580 | switch (ch_cfg->flow_cntrl) { | ||
581 | case FC_MEM2MEM_DMA: | ||
582 | *cfg &= ~(7 << 11); | ||
583 | break; | ||
584 | case FC_MEM2PER_DMA: | ||
585 | *cfg &= ~(7 << 11); | ||
586 | *cfg |= (1 << 11); | ||
587 | break; | ||
588 | case FC_PER2MEM_DMA: | ||
589 | *cfg &= ~(7 << 11); | ||
590 | *cfg |= (2 << 11); | ||
591 | break; | ||
592 | case FC_PER2PER_DMA: | ||
593 | *cfg &= ~(7 << 11); | ||
594 | *cfg |= (3 << 11); | ||
595 | break; | ||
596 | case FC_PER2PER_DPER: | ||
597 | *cfg &= ~(7 << 11); | ||
598 | *cfg |= (4 << 11); | ||
599 | break; | ||
600 | case FC_MEM2PER_PER: | ||
601 | *cfg &= ~(7 << 11); | ||
602 | *cfg |= (5 << 11); | ||
603 | break; | ||
604 | case FC_PER2MEM_PER: | ||
605 | *cfg &= ~(7 << 11); | ||
606 | *cfg |= (6 << 11); | ||
607 | break; | ||
608 | case FC_PER2PER_SPER: | ||
609 | *cfg |= (7 << 11); | ||
610 | break; | ||
611 | |||
612 | default: | ||
613 | err = -EINVAL; | ||
614 | goto out; | ||
615 | } | ||
616 | *cfg &= ~(0x1f << 6); | ||
617 | *cfg |= ((ch_cfg->dest_per & 0x1f) << 6); | ||
618 | |||
619 | *cfg &= ~(0x1f << 1); | ||
620 | *cfg |= ((ch_cfg->src_per & 0x1f) << 1); | ||
621 | |||
622 | out: | ||
623 | return err; | ||
624 | } | ||
625 | |||
626 | EXPORT_SYMBOL_GPL(pnx4008_dma_pack_config); | ||
627 | |||
628 | int pnx4008_dma_parse_config(unsigned long cfg, | ||
629 | struct pnx4008_dma_ch_config * ch_cfg) | ||
630 | { | ||
631 | int err = 0; | ||
632 | |||
633 | if (!ch_cfg) { | ||
634 | err = -EINVAL; | ||
635 | goto out; | ||
636 | } | ||
637 | |||
638 | cfg >>= 1; | ||
639 | |||
640 | ch_cfg->src_per = cfg & 0x1f; | ||
641 | cfg >>= 5; | ||
642 | |||
643 | ch_cfg->dest_per = cfg & 0x1f; | ||
644 | cfg >>= 5; | ||
645 | |||
646 | switch (cfg & 7) { | ||
647 | case 0: | ||
648 | ch_cfg->flow_cntrl = FC_MEM2MEM_DMA; | ||
649 | break; | ||
650 | case 1: | ||
651 | ch_cfg->flow_cntrl = FC_MEM2PER_DMA; | ||
652 | break; | ||
653 | case 2: | ||
654 | ch_cfg->flow_cntrl = FC_PER2MEM_DMA; | ||
655 | break; | ||
656 | case 3: | ||
657 | ch_cfg->flow_cntrl = FC_PER2PER_DMA; | ||
658 | break; | ||
659 | case 4: | ||
660 | ch_cfg->flow_cntrl = FC_PER2PER_DPER; | ||
661 | break; | ||
662 | case 5: | ||
663 | ch_cfg->flow_cntrl = FC_MEM2PER_PER; | ||
664 | break; | ||
665 | case 6: | ||
666 | ch_cfg->flow_cntrl = FC_PER2MEM_PER; | ||
667 | break; | ||
668 | case 7: | ||
669 | ch_cfg->flow_cntrl = FC_PER2PER_SPER; | ||
670 | } | ||
671 | cfg >>= 3; | ||
672 | |||
673 | ch_cfg->ie = cfg & 1; | ||
674 | cfg >>= 1; | ||
675 | |||
676 | ch_cfg->itc = cfg & 1; | ||
677 | cfg >>= 1; | ||
678 | |||
679 | ch_cfg->lock = cfg & 1; | ||
680 | cfg >>= 1; | ||
681 | |||
682 | ch_cfg->active = cfg & 1; | ||
683 | cfg >>= 1; | ||
684 | |||
685 | ch_cfg->halt = cfg & 1; | ||
686 | |||
687 | out: | ||
688 | return err; | ||
689 | } | ||
690 | |||
691 | EXPORT_SYMBOL_GPL(pnx4008_dma_parse_config); | ||
692 | |||
693 | void pnx4008_dma_split_head_entry(struct pnx4008_dma_config * config, | ||
694 | struct pnx4008_dma_ch_ctrl * ctrl) | ||
695 | { | ||
696 | int new_len = ctrl->tr_size, num_entries = 0; | ||
697 | int old_len = new_len; | ||
698 | int src_width, dest_width, count = 1; | ||
699 | |||
700 | switch (ctrl->swidth) { | ||
701 | case WIDTH_BYTE: | ||
702 | src_width = 1; | ||
703 | break; | ||
704 | case WIDTH_HWORD: | ||
705 | src_width = 2; | ||
706 | break; | ||
707 | case WIDTH_WORD: | ||
708 | src_width = 4; | ||
709 | break; | ||
710 | default: | ||
711 | return; | ||
712 | } | ||
713 | |||
714 | switch (ctrl->dwidth) { | ||
715 | case WIDTH_BYTE: | ||
716 | dest_width = 1; | ||
717 | break; | ||
718 | case WIDTH_HWORD: | ||
719 | dest_width = 2; | ||
720 | break; | ||
721 | case WIDTH_WORD: | ||
722 | dest_width = 4; | ||
723 | break; | ||
724 | default: | ||
725 | return; | ||
726 | } | ||
727 | |||
728 | while (new_len > 0x7FF) { | ||
729 | num_entries++; | ||
730 | new_len = (ctrl->tr_size + num_entries) / (num_entries + 1); | ||
731 | } | ||
732 | if (num_entries != 0) { | ||
733 | struct pnx4008_dma_ll *ll = NULL; | ||
734 | config->ch_ctrl &= ~0x7ff; | ||
735 | config->ch_ctrl |= new_len; | ||
736 | if (!config->is_ll) { | ||
737 | config->is_ll = 1; | ||
738 | while (num_entries) { | ||
739 | if (!ll) { | ||
740 | config->ll = | ||
741 | pnx4008_alloc_ll_entry(&config-> | ||
742 | ll_dma); | ||
743 | ll = config->ll; | ||
744 | } else { | ||
745 | ll->next = | ||
746 | pnx4008_alloc_ll_entry(&ll-> | ||
747 | next_dma); | ||
748 | ll = ll->next; | ||
749 | } | ||
750 | |||
751 | if (ctrl->si) | ||
752 | ll->src_addr = | ||
753 | config->src_addr + | ||
754 | src_width * new_len * count; | ||
755 | else | ||
756 | ll->src_addr = config->src_addr; | ||
757 | if (ctrl->di) | ||
758 | ll->dest_addr = | ||
759 | config->dest_addr + | ||
760 | dest_width * new_len * count; | ||
761 | else | ||
762 | ll->dest_addr = config->dest_addr; | ||
763 | ll->ch_ctrl = config->ch_ctrl & 0x7fffffff; | ||
764 | ll->next_dma = 0; | ||
765 | ll->next = NULL; | ||
766 | num_entries--; | ||
767 | count++; | ||
768 | } | ||
769 | } else { | ||
770 | struct pnx4008_dma_ll *ll_old = config->ll; | ||
771 | unsigned long ll_dma_old = config->ll_dma; | ||
772 | while (num_entries) { | ||
773 | if (!ll) { | ||
774 | config->ll = | ||
775 | pnx4008_alloc_ll_entry(&config-> | ||
776 | ll_dma); | ||
777 | ll = config->ll; | ||
778 | } else { | ||
779 | ll->next = | ||
780 | pnx4008_alloc_ll_entry(&ll-> | ||
781 | next_dma); | ||
782 | ll = ll->next; | ||
783 | } | ||
784 | |||
785 | if (ctrl->si) | ||
786 | ll->src_addr = | ||
787 | config->src_addr + | ||
788 | src_width * new_len * count; | ||
789 | else | ||
790 | ll->src_addr = config->src_addr; | ||
791 | if (ctrl->di) | ||
792 | ll->dest_addr = | ||
793 | config->dest_addr + | ||
794 | dest_width * new_len * count; | ||
795 | else | ||
796 | ll->dest_addr = config->dest_addr; | ||
797 | ll->ch_ctrl = config->ch_ctrl & 0x7fffffff; | ||
798 | ll->next_dma = 0; | ||
799 | ll->next = NULL; | ||
800 | num_entries--; | ||
801 | count++; | ||
802 | } | ||
803 | ll->next_dma = ll_dma_old; | ||
804 | ll->next = ll_old; | ||
805 | } | ||
806 | /* adjust last length/tc */ | ||
807 | ll->ch_ctrl = config->ch_ctrl & (~0x7ff); | ||
808 | ll->ch_ctrl |= old_len - new_len * (count - 1); | ||
809 | config->ch_ctrl &= 0x7fffffff; | ||
810 | } | ||
811 | } | ||
812 | |||
813 | EXPORT_SYMBOL_GPL(pnx4008_dma_split_head_entry); | ||
814 | |||
815 | void pnx4008_dma_split_ll_entry(struct pnx4008_dma_ll * cur_ll, | ||
816 | struct pnx4008_dma_ch_ctrl * ctrl) | ||
817 | { | ||
818 | int new_len = ctrl->tr_size, num_entries = 0; | ||
819 | int old_len = new_len; | ||
820 | int src_width, dest_width, count = 1; | ||
821 | |||
822 | switch (ctrl->swidth) { | ||
823 | case WIDTH_BYTE: | ||
824 | src_width = 1; | ||
825 | break; | ||
826 | case WIDTH_HWORD: | ||
827 | src_width = 2; | ||
828 | break; | ||
829 | case WIDTH_WORD: | ||
830 | src_width = 4; | ||
831 | break; | ||
832 | default: | ||
833 | return; | ||
834 | } | ||
835 | |||
836 | switch (ctrl->dwidth) { | ||
837 | case WIDTH_BYTE: | ||
838 | dest_width = 1; | ||
839 | break; | ||
840 | case WIDTH_HWORD: | ||
841 | dest_width = 2; | ||
842 | break; | ||
843 | case WIDTH_WORD: | ||
844 | dest_width = 4; | ||
845 | break; | ||
846 | default: | ||
847 | return; | ||
848 | } | ||
849 | |||
850 | while (new_len > 0x7FF) { | ||
851 | num_entries++; | ||
852 | new_len = (ctrl->tr_size + num_entries) / (num_entries + 1); | ||
853 | } | ||
854 | if (num_entries != 0) { | ||
855 | struct pnx4008_dma_ll *ll = NULL; | ||
856 | cur_ll->ch_ctrl &= ~0x7ff; | ||
857 | cur_ll->ch_ctrl |= new_len; | ||
858 | if (!cur_ll->next) { | ||
859 | while (num_entries) { | ||
860 | if (!ll) { | ||
861 | cur_ll->next = | ||
862 | pnx4008_alloc_ll_entry(&cur_ll-> | ||
863 | next_dma); | ||
864 | ll = cur_ll->next; | ||
865 | } else { | ||
866 | ll->next = | ||
867 | pnx4008_alloc_ll_entry(&ll-> | ||
868 | next_dma); | ||
869 | ll = ll->next; | ||
870 | } | ||
871 | |||
872 | if (ctrl->si) | ||
873 | ll->src_addr = | ||
874 | cur_ll->src_addr + | ||
875 | src_width * new_len * count; | ||
876 | else | ||
877 | ll->src_addr = cur_ll->src_addr; | ||
878 | if (ctrl->di) | ||
879 | ll->dest_addr = | ||
880 | cur_ll->dest_addr + | ||
881 | dest_width * new_len * count; | ||
882 | else | ||
883 | ll->dest_addr = cur_ll->dest_addr; | ||
884 | ll->ch_ctrl = cur_ll->ch_ctrl & 0x7fffffff; | ||
885 | ll->next_dma = 0; | ||
886 | ll->next = NULL; | ||
887 | num_entries--; | ||
888 | count++; | ||
889 | } | ||
890 | } else { | ||
891 | struct pnx4008_dma_ll *ll_old = cur_ll->next; | ||
892 | unsigned long ll_dma_old = cur_ll->next_dma; | ||
893 | while (num_entries) { | ||
894 | if (!ll) { | ||
895 | cur_ll->next = | ||
896 | pnx4008_alloc_ll_entry(&cur_ll-> | ||
897 | next_dma); | ||
898 | ll = cur_ll->next; | ||
899 | } else { | ||
900 | ll->next = | ||
901 | pnx4008_alloc_ll_entry(&ll-> | ||
902 | next_dma); | ||
903 | ll = ll->next; | ||
904 | } | ||
905 | |||
906 | if (ctrl->si) | ||
907 | ll->src_addr = | ||
908 | cur_ll->src_addr + | ||
909 | src_width * new_len * count; | ||
910 | else | ||
911 | ll->src_addr = cur_ll->src_addr; | ||
912 | if (ctrl->di) | ||
913 | ll->dest_addr = | ||
914 | cur_ll->dest_addr + | ||
915 | dest_width * new_len * count; | ||
916 | else | ||
917 | ll->dest_addr = cur_ll->dest_addr; | ||
918 | ll->ch_ctrl = cur_ll->ch_ctrl & 0x7fffffff; | ||
919 | ll->next_dma = 0; | ||
920 | ll->next = NULL; | ||
921 | num_entries--; | ||
922 | count++; | ||
923 | } | ||
924 | |||
925 | ll->next_dma = ll_dma_old; | ||
926 | ll->next = ll_old; | ||
927 | } | ||
928 | /* adjust last length/tc */ | ||
929 | ll->ch_ctrl = cur_ll->ch_ctrl & (~0x7ff); | ||
930 | ll->ch_ctrl |= old_len - new_len * (count - 1); | ||
931 | cur_ll->ch_ctrl &= 0x7fffffff; | ||
932 | } | ||
933 | } | ||
934 | |||
935 | EXPORT_SYMBOL_GPL(pnx4008_dma_split_ll_entry); | ||
936 | |||
937 | int pnx4008_config_channel(int ch, struct pnx4008_dma_config * config) | ||
938 | { | ||
939 | if (!VALID_CHANNEL(ch) || !dma_channels[ch].name) | ||
940 | return -EINVAL; | ||
941 | |||
942 | pnx4008_dma_lock(); | ||
943 | __raw_writel(config->src_addr, DMAC_Cx_SRC_ADDR(ch)); | ||
944 | __raw_writel(config->dest_addr, DMAC_Cx_DEST_ADDR(ch)); | ||
945 | |||
946 | if (config->is_ll) | ||
947 | __raw_writel(config->ll_dma, DMAC_Cx_LLI(ch)); | ||
948 | else | ||
949 | __raw_writel(0, DMAC_Cx_LLI(ch)); | ||
950 | |||
951 | __raw_writel(config->ch_ctrl, DMAC_Cx_CONTROL(ch)); | ||
952 | __raw_writel(config->ch_cfg, DMAC_Cx_CONFIG(ch)); | ||
953 | pnx4008_dma_unlock(); | ||
954 | |||
955 | return 0; | ||
956 | |||
957 | } | ||
958 | |||
959 | EXPORT_SYMBOL_GPL(pnx4008_config_channel); | ||
960 | |||
961 | int pnx4008_channel_get_config(int ch, struct pnx4008_dma_config * config) | ||
962 | { | ||
963 | if (!VALID_CHANNEL(ch) || !dma_channels[ch].name || !config) | ||
964 | return -EINVAL; | ||
965 | |||
966 | pnx4008_dma_lock(); | ||
967 | config->ch_cfg = __raw_readl(DMAC_Cx_CONFIG(ch)); | ||
968 | config->ch_ctrl = __raw_readl(DMAC_Cx_CONTROL(ch)); | ||
969 | |||
970 | config->ll_dma = __raw_readl(DMAC_Cx_LLI(ch)); | ||
971 | config->is_ll = config->ll_dma ? 1 : 0; | ||
972 | |||
973 | config->src_addr = __raw_readl(DMAC_Cx_SRC_ADDR(ch)); | ||
974 | config->dest_addr = __raw_readl(DMAC_Cx_DEST_ADDR(ch)); | ||
975 | pnx4008_dma_unlock(); | ||
976 | |||
977 | return 0; | ||
978 | } | ||
979 | |||
980 | EXPORT_SYMBOL_GPL(pnx4008_channel_get_config); | ||
981 | |||
982 | int pnx4008_dma_ch_enable(int ch) | ||
983 | { | ||
984 | unsigned long ch_cfg; | ||
985 | |||
986 | if (!VALID_CHANNEL(ch) || !dma_channels[ch].name) | ||
987 | return -EINVAL; | ||
988 | |||
989 | pnx4008_dma_lock(); | ||
990 | ch_cfg = __raw_readl(DMAC_Cx_CONFIG(ch)); | ||
991 | ch_cfg |= 1; | ||
992 | __raw_writel(ch_cfg, DMAC_Cx_CONFIG(ch)); | ||
993 | pnx4008_dma_unlock(); | ||
994 | |||
995 | return 0; | ||
996 | } | ||
997 | |||
998 | EXPORT_SYMBOL_GPL(pnx4008_dma_ch_enable); | ||
999 | |||
1000 | int pnx4008_dma_ch_disable(int ch) | ||
1001 | { | ||
1002 | unsigned long ch_cfg; | ||
1003 | |||
1004 | if (!VALID_CHANNEL(ch) || !dma_channels[ch].name) | ||
1005 | return -EINVAL; | ||
1006 | |||
1007 | pnx4008_dma_lock(); | ||
1008 | ch_cfg = __raw_readl(DMAC_Cx_CONFIG(ch)); | ||
1009 | ch_cfg &= ~1; | ||
1010 | __raw_writel(ch_cfg, DMAC_Cx_CONFIG(ch)); | ||
1011 | pnx4008_dma_unlock(); | ||
1012 | |||
1013 | return 0; | ||
1014 | } | ||
1015 | |||
1016 | EXPORT_SYMBOL_GPL(pnx4008_dma_ch_disable); | ||
1017 | |||
1018 | int pnx4008_dma_ch_enabled(int ch) | ||
1019 | { | ||
1020 | unsigned long ch_cfg; | ||
1021 | |||
1022 | if (!VALID_CHANNEL(ch) || !dma_channels[ch].name) | ||
1023 | return -EINVAL; | ||
1024 | |||
1025 | pnx4008_dma_lock(); | ||
1026 | ch_cfg = __raw_readl(DMAC_Cx_CONFIG(ch)); | ||
1027 | pnx4008_dma_unlock(); | ||
1028 | |||
1029 | return ch_cfg & 1; | ||
1030 | } | ||
1031 | |||
1032 | EXPORT_SYMBOL_GPL(pnx4008_dma_ch_enabled); | ||
1033 | |||
1034 | static irqreturn_t dma_irq_handler(int irq, void *dev_id) | ||
1035 | { | ||
1036 | int i; | ||
1037 | unsigned long dint = __raw_readl(DMAC_INT_STAT); | ||
1038 | unsigned long tcint = __raw_readl(DMAC_INT_TC_STAT); | ||
1039 | unsigned long eint = __raw_readl(DMAC_INT_ERR_STAT); | ||
1040 | unsigned long i_bit; | ||
1041 | |||
1042 | for (i = MAX_DMA_CHANNELS - 1; i >= 0; i--) { | ||
1043 | i_bit = 1 << i; | ||
1044 | if (dint & i_bit) { | ||
1045 | struct dma_channel *channel = &dma_channels[i]; | ||
1046 | |||
1047 | if (channel->name && channel->irq_handler) { | ||
1048 | int cause = 0; | ||
1049 | |||
1050 | if (eint & i_bit) | ||
1051 | cause |= DMA_ERR_INT; | ||
1052 | if (tcint & i_bit) | ||
1053 | cause |= DMA_TC_INT; | ||
1054 | channel->irq_handler(i, cause, channel->data); | ||
1055 | } else { | ||
1056 | /* | ||
1057 | * IRQ for an unregistered DMA channel | ||
1058 | */ | ||
1059 | printk(KERN_WARNING | ||
1060 | "spurious IRQ for DMA channel %d\n", i); | ||
1061 | } | ||
1062 | if (tcint & i_bit) | ||
1063 | __raw_writel(i_bit, DMAC_INT_TC_CLEAR); | ||
1064 | if (eint & i_bit) | ||
1065 | __raw_writel(i_bit, DMAC_INT_ERR_CLEAR); | ||
1066 | } | ||
1067 | } | ||
1068 | return IRQ_HANDLED; | ||
1069 | } | ||
1070 | |||
1071 | static int __init pnx4008_dma_init(void) | ||
1072 | { | ||
1073 | int ret, i; | ||
1074 | |||
1075 | ret = request_irq(DMA_INT, dma_irq_handler, 0, "DMA", NULL); | ||
1076 | if (ret) { | ||
1077 | printk(KERN_CRIT "Wow! Can't register IRQ for DMA\n"); | ||
1078 | goto out; | ||
1079 | } | ||
1080 | |||
1081 | ll_pool.count = 0x4000 / sizeof(struct pnx4008_dma_ll); | ||
1082 | ll_pool.cur = ll_pool.vaddr = | ||
1083 | dma_alloc_coherent(NULL, ll_pool.count * sizeof(struct pnx4008_dma_ll), | ||
1084 | &ll_pool.dma_addr, GFP_KERNEL); | ||
1085 | |||
1086 | if (!ll_pool.vaddr) { | ||
1087 | ret = -ENOMEM; | ||
1088 | free_irq(DMA_INT, NULL); | ||
1089 | goto out; | ||
1090 | } | ||
1091 | |||
1092 | for (i = 0; i < ll_pool.count - 1; i++) { | ||
1093 | void **addr = ll_pool.vaddr + i * sizeof(struct pnx4008_dma_ll); | ||
1094 | *addr = (void *)addr + sizeof(struct pnx4008_dma_ll); | ||
1095 | } | ||
1096 | *(long *)(ll_pool.vaddr + | ||
1097 | (ll_pool.count - 1) * sizeof(struct pnx4008_dma_ll)) = | ||
1098 | (long)ll_pool.vaddr; | ||
1099 | |||
1100 | __raw_writel(1, DMAC_CONFIG); | ||
1101 | |||
1102 | out: | ||
1103 | return ret; | ||
1104 | } | ||
1105 | arch_initcall(pnx4008_dma_init); | ||
diff --git a/arch/arm/mach-pnx4008/gpio.c b/arch/arm/mach-pnx4008/gpio.c deleted file mode 100644 index d3e71d3847b4..000000000000 --- a/arch/arm/mach-pnx4008/gpio.c +++ /dev/null | |||
@@ -1,328 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/gpio.c | ||
3 | * | ||
4 | * PNX4008 GPIO driver | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * Based on reference code by Iwo Mergler and Z.Tabaaloute from Philips: | ||
9 | * Copyright (c) 2005 Koninklijke Philips Electronics N.V. | ||
10 | * | ||
11 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
12 | * the terms of the GNU General Public License version 2. This program | ||
13 | * is licensed "as is" without any warranty of any kind, whether express | ||
14 | * or implied. | ||
15 | */ | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <mach/hardware.h> | ||
21 | #include <mach/platform.h> | ||
22 | #include <mach/gpio-pnx4008.h> | ||
23 | |||
24 | /* register definitions */ | ||
25 | #define PIO_VA_BASE IO_ADDRESS(PNX4008_PIO_BASE) | ||
26 | |||
27 | #define PIO_INP_STATE (0x00U) | ||
28 | #define PIO_OUTP_SET (0x04U) | ||
29 | #define PIO_OUTP_CLR (0x08U) | ||
30 | #define PIO_OUTP_STATE (0x0CU) | ||
31 | #define PIO_DRV_SET (0x10U) | ||
32 | #define PIO_DRV_CLR (0x14U) | ||
33 | #define PIO_DRV_STATE (0x18U) | ||
34 | #define PIO_SDINP_STATE (0x1CU) | ||
35 | #define PIO_SDOUTP_SET (0x20U) | ||
36 | #define PIO_SDOUTP_CLR (0x24U) | ||
37 | #define PIO_MUX_SET (0x28U) | ||
38 | #define PIO_MUX_CLR (0x2CU) | ||
39 | #define PIO_MUX_STATE (0x30U) | ||
40 | |||
41 | static inline void gpio_lock(void) | ||
42 | { | ||
43 | local_irq_disable(); | ||
44 | } | ||
45 | |||
46 | static inline void gpio_unlock(void) | ||
47 | { | ||
48 | local_irq_enable(); | ||
49 | } | ||
50 | |||
51 | /* Inline functions */ | ||
52 | static inline int gpio_read_bit(u32 reg, int gpio) | ||
53 | { | ||
54 | u32 bit, val; | ||
55 | int ret = -EFAULT; | ||
56 | |||
57 | if (gpio < 0) | ||
58 | goto out; | ||
59 | |||
60 | bit = GPIO_BIT(gpio); | ||
61 | if (bit) { | ||
62 | val = __raw_readl(PIO_VA_BASE + reg); | ||
63 | ret = (val & bit) ? 1 : 0; | ||
64 | } | ||
65 | out: | ||
66 | return ret; | ||
67 | } | ||
68 | |||
69 | static inline int gpio_set_bit(u32 reg, int gpio) | ||
70 | { | ||
71 | u32 bit, val; | ||
72 | int ret = -EFAULT; | ||
73 | |||
74 | if (gpio < 0) | ||
75 | goto out; | ||
76 | |||
77 | bit = GPIO_BIT(gpio); | ||
78 | if (bit) { | ||
79 | val = __raw_readl(PIO_VA_BASE + reg); | ||
80 | val |= bit; | ||
81 | __raw_writel(val, PIO_VA_BASE + reg); | ||
82 | ret = 0; | ||
83 | } | ||
84 | out: | ||
85 | return ret; | ||
86 | } | ||
87 | |||
88 | /* Very simple access control, bitmap for allocated/free */ | ||
89 | static unsigned long access_map[4]; | ||
90 | #define INP_INDEX 0 | ||
91 | #define OUTP_INDEX 1 | ||
92 | #define GPIO_INDEX 2 | ||
93 | #define MUX_INDEX 3 | ||
94 | |||
95 | /*GPIO to Input Mapping */ | ||
96 | static short gpio_to_inp_map[32] = { | ||
97 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
98 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
99 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
100 | -1, 10, 11, 12, 13, 14, 24, -1 | ||
101 | }; | ||
102 | |||
103 | /*GPIO to Mux Mapping */ | ||
104 | static short gpio_to_mux_map[32] = { | ||
105 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
106 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
107 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
108 | -1, -1, -1, 0, 1, 4, 5, -1 | ||
109 | }; | ||
110 | |||
111 | /*Output to Mux Mapping */ | ||
112 | static short outp_to_mux_map[32] = { | ||
113 | -1, -1, -1, 6, -1, -1, -1, -1, | ||
114 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
115 | -1, -1, -1, -1, -1, 2, -1, -1, | ||
116 | -1, -1, -1, -1, -1, -1, -1, -1 | ||
117 | }; | ||
118 | |||
119 | int pnx4008_gpio_register_pin(unsigned short pin) | ||
120 | { | ||
121 | unsigned long bit = GPIO_BIT(pin); | ||
122 | int ret = -EBUSY; /* Already in use */ | ||
123 | |||
124 | gpio_lock(); | ||
125 | |||
126 | if (GPIO_ISBID(pin)) { | ||
127 | if (access_map[GPIO_INDEX] & bit) | ||
128 | goto out; | ||
129 | access_map[GPIO_INDEX] |= bit; | ||
130 | |||
131 | } else if (GPIO_ISRAM(pin)) { | ||
132 | if (access_map[GPIO_INDEX] & bit) | ||
133 | goto out; | ||
134 | access_map[GPIO_INDEX] |= bit; | ||
135 | |||
136 | } else if (GPIO_ISMUX(pin)) { | ||
137 | if (access_map[MUX_INDEX] & bit) | ||
138 | goto out; | ||
139 | access_map[MUX_INDEX] |= bit; | ||
140 | |||
141 | } else if (GPIO_ISOUT(pin)) { | ||
142 | if (access_map[OUTP_INDEX] & bit) | ||
143 | goto out; | ||
144 | access_map[OUTP_INDEX] |= bit; | ||
145 | |||
146 | } else if (GPIO_ISIN(pin)) { | ||
147 | if (access_map[INP_INDEX] & bit) | ||
148 | goto out; | ||
149 | access_map[INP_INDEX] |= bit; | ||
150 | } else | ||
151 | goto out; | ||
152 | ret = 0; | ||
153 | |||
154 | out: | ||
155 | gpio_unlock(); | ||
156 | return ret; | ||
157 | } | ||
158 | |||
159 | EXPORT_SYMBOL(pnx4008_gpio_register_pin); | ||
160 | |||
161 | int pnx4008_gpio_unregister_pin(unsigned short pin) | ||
162 | { | ||
163 | unsigned long bit = GPIO_BIT(pin); | ||
164 | int ret = -EFAULT; /* Not registered */ | ||
165 | |||
166 | gpio_lock(); | ||
167 | |||
168 | if (GPIO_ISBID(pin)) { | ||
169 | if (~access_map[GPIO_INDEX] & bit) | ||
170 | goto out; | ||
171 | access_map[GPIO_INDEX] &= ~bit; | ||
172 | } else if (GPIO_ISRAM(pin)) { | ||
173 | if (~access_map[GPIO_INDEX] & bit) | ||
174 | goto out; | ||
175 | access_map[GPIO_INDEX] &= ~bit; | ||
176 | } else if (GPIO_ISMUX(pin)) { | ||
177 | if (~access_map[MUX_INDEX] & bit) | ||
178 | goto out; | ||
179 | access_map[MUX_INDEX] &= ~bit; | ||
180 | } else if (GPIO_ISOUT(pin)) { | ||
181 | if (~access_map[OUTP_INDEX] & bit) | ||
182 | goto out; | ||
183 | access_map[OUTP_INDEX] &= ~bit; | ||
184 | } else if (GPIO_ISIN(pin)) { | ||
185 | if (~access_map[INP_INDEX] & bit) | ||
186 | goto out; | ||
187 | access_map[INP_INDEX] &= ~bit; | ||
188 | } else | ||
189 | goto out; | ||
190 | ret = 0; | ||
191 | |||
192 | out: | ||
193 | gpio_unlock(); | ||
194 | return ret; | ||
195 | } | ||
196 | |||
197 | EXPORT_SYMBOL(pnx4008_gpio_unregister_pin); | ||
198 | |||
199 | unsigned long pnx4008_gpio_read_pin(unsigned short pin) | ||
200 | { | ||
201 | unsigned long ret = -EFAULT; | ||
202 | int gpio = GPIO_BIT_MASK(pin); | ||
203 | gpio_lock(); | ||
204 | if (GPIO_ISOUT(pin)) { | ||
205 | ret = gpio_read_bit(PIO_OUTP_STATE, gpio); | ||
206 | } else if (GPIO_ISRAM(pin)) { | ||
207 | if (gpio_read_bit(PIO_DRV_STATE, gpio) == 0) { | ||
208 | ret = gpio_read_bit(PIO_SDINP_STATE, gpio); | ||
209 | } | ||
210 | } else if (GPIO_ISBID(pin)) { | ||
211 | ret = gpio_read_bit(PIO_DRV_STATE, gpio); | ||
212 | if (ret > 0) | ||
213 | ret = gpio_read_bit(PIO_OUTP_STATE, gpio); | ||
214 | else if (ret == 0) | ||
215 | ret = | ||
216 | gpio_read_bit(PIO_INP_STATE, gpio_to_inp_map[gpio]); | ||
217 | } else if (GPIO_ISIN(pin)) { | ||
218 | ret = gpio_read_bit(PIO_INP_STATE, gpio); | ||
219 | } | ||
220 | gpio_unlock(); | ||
221 | return ret; | ||
222 | } | ||
223 | |||
224 | EXPORT_SYMBOL(pnx4008_gpio_read_pin); | ||
225 | |||
226 | /* Write Value to output */ | ||
227 | int pnx4008_gpio_write_pin(unsigned short pin, int output) | ||
228 | { | ||
229 | int gpio = GPIO_BIT_MASK(pin); | ||
230 | int ret = -EFAULT; | ||
231 | |||
232 | gpio_lock(); | ||
233 | if (GPIO_ISOUT(pin)) { | ||
234 | printk( "writing '%x' to '%x'\n", | ||
235 | gpio, output ? PIO_OUTP_SET : PIO_OUTP_CLR ); | ||
236 | ret = gpio_set_bit(output ? PIO_OUTP_SET : PIO_OUTP_CLR, gpio); | ||
237 | } else if (GPIO_ISRAM(pin)) { | ||
238 | if (gpio_read_bit(PIO_DRV_STATE, gpio) > 0) | ||
239 | ret = gpio_set_bit(output ? PIO_SDOUTP_SET : | ||
240 | PIO_SDOUTP_CLR, gpio); | ||
241 | } else if (GPIO_ISBID(pin)) { | ||
242 | if (gpio_read_bit(PIO_DRV_STATE, gpio) > 0) | ||
243 | ret = gpio_set_bit(output ? PIO_OUTP_SET : | ||
244 | PIO_OUTP_CLR, gpio); | ||
245 | } | ||
246 | gpio_unlock(); | ||
247 | return ret; | ||
248 | } | ||
249 | |||
250 | EXPORT_SYMBOL(pnx4008_gpio_write_pin); | ||
251 | |||
252 | /* Value = 1 : Set GPIO pin as output */ | ||
253 | /* Value = 0 : Set GPIO pin as input */ | ||
254 | int pnx4008_gpio_set_pin_direction(unsigned short pin, int output) | ||
255 | { | ||
256 | int gpio = GPIO_BIT_MASK(pin); | ||
257 | int ret = -EFAULT; | ||
258 | |||
259 | gpio_lock(); | ||
260 | if (GPIO_ISBID(pin) || GPIO_ISRAM(pin)) { | ||
261 | ret = gpio_set_bit(output ? PIO_DRV_SET : PIO_DRV_CLR, gpio); | ||
262 | } | ||
263 | gpio_unlock(); | ||
264 | return ret; | ||
265 | } | ||
266 | |||
267 | EXPORT_SYMBOL(pnx4008_gpio_set_pin_direction); | ||
268 | |||
269 | /* Read GPIO pin direction: 0= pin used as input, 1= pin used as output*/ | ||
270 | int pnx4008_gpio_read_pin_direction(unsigned short pin) | ||
271 | { | ||
272 | int gpio = GPIO_BIT_MASK(pin); | ||
273 | int ret = -EFAULT; | ||
274 | |||
275 | gpio_lock(); | ||
276 | if (GPIO_ISBID(pin) || GPIO_ISRAM(pin)) { | ||
277 | ret = gpio_read_bit(PIO_DRV_STATE, gpio); | ||
278 | } | ||
279 | gpio_unlock(); | ||
280 | return ret; | ||
281 | } | ||
282 | |||
283 | EXPORT_SYMBOL(pnx4008_gpio_read_pin_direction); | ||
284 | |||
285 | /* Value = 1 : Set pin to muxed function */ | ||
286 | /* Value = 0 : Set pin as GPIO */ | ||
287 | int pnx4008_gpio_set_pin_mux(unsigned short pin, int output) | ||
288 | { | ||
289 | int gpio = GPIO_BIT_MASK(pin); | ||
290 | int ret = -EFAULT; | ||
291 | |||
292 | gpio_lock(); | ||
293 | if (GPIO_ISBID(pin)) { | ||
294 | ret = | ||
295 | gpio_set_bit(output ? PIO_MUX_SET : PIO_MUX_CLR, | ||
296 | gpio_to_mux_map[gpio]); | ||
297 | } else if (GPIO_ISOUT(pin)) { | ||
298 | ret = | ||
299 | gpio_set_bit(output ? PIO_MUX_SET : PIO_MUX_CLR, | ||
300 | outp_to_mux_map[gpio]); | ||
301 | } else if (GPIO_ISMUX(pin)) { | ||
302 | ret = gpio_set_bit(output ? PIO_MUX_SET : PIO_MUX_CLR, gpio); | ||
303 | } | ||
304 | gpio_unlock(); | ||
305 | return ret; | ||
306 | } | ||
307 | |||
308 | EXPORT_SYMBOL(pnx4008_gpio_set_pin_mux); | ||
309 | |||
310 | /* Read pin mux function: 0= pin used as GPIO, 1= pin used for muxed function*/ | ||
311 | int pnx4008_gpio_read_pin_mux(unsigned short pin) | ||
312 | { | ||
313 | int gpio = GPIO_BIT_MASK(pin); | ||
314 | int ret = -EFAULT; | ||
315 | |||
316 | gpio_lock(); | ||
317 | if (GPIO_ISBID(pin)) { | ||
318 | ret = gpio_read_bit(PIO_MUX_STATE, gpio_to_mux_map[gpio]); | ||
319 | } else if (GPIO_ISOUT(pin)) { | ||
320 | ret = gpio_read_bit(PIO_MUX_STATE, outp_to_mux_map[gpio]); | ||
321 | } else if (GPIO_ISMUX(pin)) { | ||
322 | ret = gpio_read_bit(PIO_MUX_STATE, gpio); | ||
323 | } | ||
324 | gpio_unlock(); | ||
325 | return ret; | ||
326 | } | ||
327 | |||
328 | EXPORT_SYMBOL(pnx4008_gpio_read_pin_mux); | ||
diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c deleted file mode 100644 index 550cfc2a1f2e..000000000000 --- a/arch/arm/mach-pnx4008/i2c.c +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * I2C initialization for PNX4008. | ||
3 | * | ||
4 | * Author: Vitaly Wool <vitalywool@gmail.com> | ||
5 | * | ||
6 | * 2005-2006 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #include <linux/clk.h> | ||
13 | #include <linux/i2c.h> | ||
14 | #include <linux/i2c-pnx.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/err.h> | ||
17 | #include <mach/platform.h> | ||
18 | #include <mach/irqs.h> | ||
19 | |||
20 | static struct resource i2c0_resources[] = { | ||
21 | { | ||
22 | .start = PNX4008_I2C1_BASE, | ||
23 | .end = PNX4008_I2C1_BASE + SZ_4K - 1, | ||
24 | .flags = IORESOURCE_MEM, | ||
25 | }, { | ||
26 | .start = I2C_1_INT, | ||
27 | .end = I2C_1_INT, | ||
28 | .flags = IORESOURCE_IRQ, | ||
29 | }, | ||
30 | }; | ||
31 | |||
32 | static struct resource i2c1_resources[] = { | ||
33 | { | ||
34 | .start = PNX4008_I2C2_BASE, | ||
35 | .end = PNX4008_I2C2_BASE + SZ_4K - 1, | ||
36 | .flags = IORESOURCE_MEM, | ||
37 | }, { | ||
38 | .start = I2C_2_INT, | ||
39 | .end = I2C_2_INT, | ||
40 | .flags = IORESOURCE_IRQ, | ||
41 | }, | ||
42 | }; | ||
43 | |||
44 | static struct resource i2c2_resources[] = { | ||
45 | { | ||
46 | .start = PNX4008_USB_CONFIG_BASE + 0x300, | ||
47 | .end = PNX4008_USB_CONFIG_BASE + 0x300 + SZ_4K - 1, | ||
48 | .flags = IORESOURCE_MEM, | ||
49 | }, { | ||
50 | .start = USB_I2C_INT, | ||
51 | .end = USB_I2C_INT, | ||
52 | .flags = IORESOURCE_IRQ, | ||
53 | }, | ||
54 | }; | ||
55 | |||
56 | static struct platform_device i2c0_device = { | ||
57 | .name = "pnx-i2c.0", | ||
58 | .id = 0, | ||
59 | .resource = i2c0_resources, | ||
60 | .num_resources = ARRAY_SIZE(i2c0_resources), | ||
61 | }; | ||
62 | |||
63 | static struct platform_device i2c1_device = { | ||
64 | .name = "pnx-i2c.1", | ||
65 | .id = 1, | ||
66 | .resource = i2c1_resources, | ||
67 | .num_resources = ARRAY_SIZE(i2c1_resources), | ||
68 | }; | ||
69 | |||
70 | static struct platform_device i2c2_device = { | ||
71 | .name = "pnx-i2c.2", | ||
72 | .id = 2, | ||
73 | .resource = i2c2_resources, | ||
74 | .num_resources = ARRAY_SIZE(i2c2_resources), | ||
75 | }; | ||
76 | |||
77 | static struct platform_device *devices[] __initdata = { | ||
78 | &i2c0_device, | ||
79 | &i2c1_device, | ||
80 | &i2c2_device, | ||
81 | }; | ||
82 | |||
83 | void __init pnx4008_register_i2c_devices(void) | ||
84 | { | ||
85 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
86 | } | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/clock.h b/arch/arm/mach-pnx4008/include/mach/clock.h deleted file mode 100644 index 8d2a5ef52c90..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/clock.h +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/clock.h | ||
3 | * | ||
4 | * Clock control driver for PNX4008 - header file | ||
5 | * | ||
6 | * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | #ifndef __PNX4008_CLOCK_H__ | ||
14 | #define __PNX4008_CLOCK_H__ | ||
15 | |||
16 | struct module; | ||
17 | struct clk; | ||
18 | |||
19 | #define PWRMAN_VA_BASE IO_ADDRESS(PNX4008_PWRMAN_BASE) | ||
20 | #define HCLKDIVCTRL_REG (PWRMAN_VA_BASE + 0x40) | ||
21 | #define PWRCTRL_REG (PWRMAN_VA_BASE + 0x44) | ||
22 | #define PLLCTRL_REG (PWRMAN_VA_BASE + 0x48) | ||
23 | #define OSC13CTRL_REG (PWRMAN_VA_BASE + 0x4c) | ||
24 | #define SYSCLKCTRL_REG (PWRMAN_VA_BASE + 0x50) | ||
25 | #define HCLKPLLCTRL_REG (PWRMAN_VA_BASE + 0x58) | ||
26 | #define USBCTRL_REG (PWRMAN_VA_BASE + 0x64) | ||
27 | #define SDRAMCLKCTRL_REG (PWRMAN_VA_BASE + 0x68) | ||
28 | #define MSCTRL_REG (PWRMAN_VA_BASE + 0x80) | ||
29 | #define BTCLKCTRL (PWRMAN_VA_BASE + 0x84) | ||
30 | #define DUMCLKCTRL_REG (PWRMAN_VA_BASE + 0x90) | ||
31 | #define I2CCLKCTRL_REG (PWRMAN_VA_BASE + 0xac) | ||
32 | #define KEYCLKCTRL_REG (PWRMAN_VA_BASE + 0xb0) | ||
33 | #define TSCLKCTRL_REG (PWRMAN_VA_BASE + 0xb4) | ||
34 | #define PWMCLKCTRL_REG (PWRMAN_VA_BASE + 0xb8) | ||
35 | #define TIMCLKCTRL_REG (PWRMAN_VA_BASE + 0xbc) | ||
36 | #define SPICTRL_REG (PWRMAN_VA_BASE + 0xc4) | ||
37 | #define FLASHCLKCTRL_REG (PWRMAN_VA_BASE + 0xc8) | ||
38 | #define UART3CLK_REG (PWRMAN_VA_BASE + 0xd0) | ||
39 | #define UARTCLKCTRL_REG (PWRMAN_VA_BASE + 0xe4) | ||
40 | #define DMACLKCTRL_REG (PWRMAN_VA_BASE + 0xe8) | ||
41 | #define AUTOCLK_CTRL (PWRMAN_VA_BASE + 0xec) | ||
42 | #define JPEGCLKCTRL_REG (PWRMAN_VA_BASE + 0xfc) | ||
43 | |||
44 | #define AUDIOCONFIG_VA_BASE IO_ADDRESS(PNX4008_AUDIOCONFIG_BASE) | ||
45 | #define DSPPLLCTRL_REG (AUDIOCONFIG_VA_BASE + 0x60) | ||
46 | #define DSPCLKCTRL_REG (AUDIOCONFIG_VA_BASE + 0x64) | ||
47 | #define AUDIOCLKCTRL_REG (AUDIOCONFIG_VA_BASE + 0x68) | ||
48 | #define AUDIOPLLCTRL_REG (AUDIOCONFIG_VA_BASE + 0x6C) | ||
49 | |||
50 | #define USB_OTG_CLKCTRL_REG IO_ADDRESS(PNX4008_USB_CONFIG_BASE + 0xff4) | ||
51 | |||
52 | #define VFP9CLKCTRL_REG IO_ADDRESS(PNX4008_DEBUG_BASE) | ||
53 | |||
54 | #define CLK_RATE_13MHZ 13000 | ||
55 | #define CLK_RATE_1MHZ 1000 | ||
56 | #define CLK_RATE_208MHZ 208000 | ||
57 | #define CLK_RATE_48MHZ 48000 | ||
58 | #define CLK_RATE_32KHZ 32 | ||
59 | |||
60 | #define PNX4008_UART_CLK CLK_RATE_13MHZ * 1000 /* in MHz */ | ||
61 | |||
62 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/debug-macro.S b/arch/arm/mach-pnx4008/include/mach/debug-macro.S deleted file mode 100644 index 469d60d97f5c..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/debug-macro.S +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* arch/arm/mach-pnx4008/include/mach/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, rp, rv, tmp | ||
15 | mov \rp, #0x00090000 | ||
16 | add \rv, \rp, #0xf4000000 @ virtual | ||
17 | add \rp, \rp, #0x40000000 @ physical | ||
18 | .endm | ||
19 | |||
20 | #define UART_SHIFT 2 | ||
21 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/dma.h b/arch/arm/mach-pnx4008/include/mach/dma.h deleted file mode 100644 index f094bf8bfb18..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/dma.h +++ /dev/null | |||
@@ -1,160 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/dma.h | ||
3 | * | ||
4 | * PNX4008 DMA header file | ||
5 | * | ||
6 | * Author: Vitaly Wool | ||
7 | * Copyright: MontaVista Software Inc. (c) 2005 | ||
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 __ASM_ARCH_DMA_H | ||
15 | #define __ASM_ARCH_DMA_H | ||
16 | |||
17 | #include "platform.h" | ||
18 | |||
19 | #define MAX_DMA_CHANNELS 8 | ||
20 | |||
21 | #define DMAC_BASE IO_ADDRESS(PNX4008_DMA_CONFIG_BASE) | ||
22 | #define DMAC_INT_STAT (DMAC_BASE + 0x0000) | ||
23 | #define DMAC_INT_TC_STAT (DMAC_BASE + 0x0004) | ||
24 | #define DMAC_INT_TC_CLEAR (DMAC_BASE + 0x0008) | ||
25 | #define DMAC_INT_ERR_STAT (DMAC_BASE + 0x000c) | ||
26 | #define DMAC_INT_ERR_CLEAR (DMAC_BASE + 0x0010) | ||
27 | #define DMAC_SOFT_SREQ (DMAC_BASE + 0x0024) | ||
28 | #define DMAC_CONFIG (DMAC_BASE + 0x0030) | ||
29 | #define DMAC_Cx_SRC_ADDR(c) (DMAC_BASE + 0x0100 + (c) * 0x20) | ||
30 | #define DMAC_Cx_DEST_ADDR(c) (DMAC_BASE + 0x0104 + (c) * 0x20) | ||
31 | #define DMAC_Cx_LLI(c) (DMAC_BASE + 0x0108 + (c) * 0x20) | ||
32 | #define DMAC_Cx_CONTROL(c) (DMAC_BASE + 0x010c + (c) * 0x20) | ||
33 | #define DMAC_Cx_CONFIG(c) (DMAC_BASE + 0x0110 + (c) * 0x20) | ||
34 | |||
35 | enum { | ||
36 | WIDTH_BYTE = 0, | ||
37 | WIDTH_HWORD, | ||
38 | WIDTH_WORD | ||
39 | }; | ||
40 | |||
41 | enum { | ||
42 | FC_MEM2MEM_DMA, | ||
43 | FC_MEM2PER_DMA, | ||
44 | FC_PER2MEM_DMA, | ||
45 | FC_PER2PER_DMA, | ||
46 | FC_PER2PER_DPER, | ||
47 | FC_MEM2PER_PER, | ||
48 | FC_PER2MEM_PER, | ||
49 | FC_PER2PER_SPER | ||
50 | }; | ||
51 | |||
52 | enum { | ||
53 | DMA_INT_UNKNOWN = 0, | ||
54 | DMA_ERR_INT = 1, | ||
55 | DMA_TC_INT = 2, | ||
56 | }; | ||
57 | |||
58 | enum { | ||
59 | DMA_BUFFER_ALLOCATED = 1, | ||
60 | DMA_HAS_LL = 2, | ||
61 | }; | ||
62 | |||
63 | enum { | ||
64 | PER_CAM_DMA_1 = 0, | ||
65 | PER_NDF_FLASH = 1, | ||
66 | PER_MBX_SLAVE_FIFO = 2, | ||
67 | PER_SPI2_REC_XMIT = 3, | ||
68 | PER_MS_SD_RX_XMIT = 4, | ||
69 | PER_HS_UART_1_XMIT = 5, | ||
70 | PER_HS_UART_1_RX = 6, | ||
71 | PER_HS_UART_2_XMIT = 7, | ||
72 | PER_HS_UART_2_RX = 8, | ||
73 | PER_HS_UART_7_XMIT = 9, | ||
74 | PER_HS_UART_7_RX = 10, | ||
75 | PER_SPI1_REC_XMIT = 11, | ||
76 | PER_MLC_NDF_SREC = 12, | ||
77 | PER_CAM_DMA_2 = 13, | ||
78 | PER_PRNG_INFIFO = 14, | ||
79 | PER_PRNG_OUTFIFO = 15, | ||
80 | }; | ||
81 | |||
82 | struct pnx4008_dma_ch_ctrl { | ||
83 | int tc_mask; | ||
84 | int cacheable; | ||
85 | int bufferable; | ||
86 | int priv_mode; | ||
87 | int di; | ||
88 | int si; | ||
89 | int dest_ahb1; | ||
90 | int src_ahb1; | ||
91 | int dwidth; | ||
92 | int swidth; | ||
93 | int dbsize; | ||
94 | int sbsize; | ||
95 | int tr_size; | ||
96 | }; | ||
97 | |||
98 | struct pnx4008_dma_ch_config { | ||
99 | int halt; | ||
100 | int active; | ||
101 | int lock; | ||
102 | int itc; | ||
103 | int ie; | ||
104 | int flow_cntrl; | ||
105 | int dest_per; | ||
106 | int src_per; | ||
107 | }; | ||
108 | |||
109 | struct pnx4008_dma_ll { | ||
110 | unsigned long src_addr; | ||
111 | unsigned long dest_addr; | ||
112 | u32 next_dma; | ||
113 | unsigned long ch_ctrl; | ||
114 | struct pnx4008_dma_ll *next; | ||
115 | int flags; | ||
116 | void *alloc_data; | ||
117 | int (*free) (void *); | ||
118 | }; | ||
119 | |||
120 | struct pnx4008_dma_config { | ||
121 | int is_ll; | ||
122 | unsigned long src_addr; | ||
123 | unsigned long dest_addr; | ||
124 | unsigned long ch_ctrl; | ||
125 | unsigned long ch_cfg; | ||
126 | struct pnx4008_dma_ll *ll; | ||
127 | u32 ll_dma; | ||
128 | int flags; | ||
129 | void *alloc_data; | ||
130 | int (*free) (void *); | ||
131 | }; | ||
132 | |||
133 | extern struct pnx4008_dma_ll *pnx4008_alloc_ll_entry(dma_addr_t *); | ||
134 | extern void pnx4008_free_ll_entry(struct pnx4008_dma_ll *, dma_addr_t); | ||
135 | extern void pnx4008_free_ll(u32 ll_dma, struct pnx4008_dma_ll *); | ||
136 | |||
137 | extern int pnx4008_request_channel(char *, int, | ||
138 | void (*)(int, int, void *), | ||
139 | void *); | ||
140 | extern void pnx4008_free_channel(int); | ||
141 | extern int pnx4008_config_dma(int, int, int); | ||
142 | extern int pnx4008_dma_pack_control(const struct pnx4008_dma_ch_ctrl *, | ||
143 | unsigned long *); | ||
144 | extern int pnx4008_dma_parse_control(unsigned long, | ||
145 | struct pnx4008_dma_ch_ctrl *); | ||
146 | extern int pnx4008_dma_pack_config(const struct pnx4008_dma_ch_config *, | ||
147 | unsigned long *); | ||
148 | extern int pnx4008_dma_parse_config(unsigned long, | ||
149 | struct pnx4008_dma_ch_config *); | ||
150 | extern int pnx4008_config_channel(int, struct pnx4008_dma_config *); | ||
151 | extern int pnx4008_channel_get_config(int, struct pnx4008_dma_config *); | ||
152 | extern int pnx4008_dma_ch_enable(int); | ||
153 | extern int pnx4008_dma_ch_disable(int); | ||
154 | extern int pnx4008_dma_ch_enabled(int); | ||
155 | extern void pnx4008_dma_split_head_entry(struct pnx4008_dma_config *, | ||
156 | struct pnx4008_dma_ch_ctrl *); | ||
157 | extern void pnx4008_dma_split_ll_entry(struct pnx4008_dma_ll *, | ||
158 | struct pnx4008_dma_ch_ctrl *); | ||
159 | |||
160 | #endif /* _ASM_ARCH_DMA_H */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/entry-macro.S b/arch/arm/mach-pnx4008/include/mach/entry-macro.S deleted file mode 100644 index 77a555846719..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/entry-macro.S +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for PNX4008-based platforms | ||
5 | * | ||
6 | * 2005-2006 (c) MontaVista Software, Inc. | ||
7 | * Author: Vitaly Wool <vwool@ru.mvista.com> | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include "platform.h" | ||
14 | |||
15 | #define IO_BASE 0xF0000000 | ||
16 | #define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE) | ||
17 | |||
18 | #define INTRC_MASK 0x00 | ||
19 | #define INTRC_RAW_STAT 0x04 | ||
20 | #define INTRC_STAT 0x08 | ||
21 | #define INTRC_POLAR 0x0C | ||
22 | #define INTRC_ACT_TYPE 0x10 | ||
23 | #define INTRC_TYPE 0x14 | ||
24 | |||
25 | #define SIC1_BASE_INT 32 | ||
26 | #define SIC2_BASE_INT 64 | ||
27 | |||
28 | .macro get_irqnr_preamble, base, tmp | ||
29 | .endm | ||
30 | |||
31 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
32 | /* decode the MIC interrupt numbers */ | ||
33 | ldr \base, =IO_ADDRESS(PNX4008_INTCTRLMIC_BASE) | ||
34 | ldr \irqstat, [\base, #INTRC_STAT] | ||
35 | |||
36 | cmp \irqstat,#1<<16 | ||
37 | movhs \irqnr,#16 | ||
38 | movlo \irqnr,#0 | ||
39 | movhs \irqstat,\irqstat,lsr#16 | ||
40 | cmp \irqstat,#1<<8 | ||
41 | addhs \irqnr,\irqnr,#8 | ||
42 | movhs \irqstat,\irqstat,lsr#8 | ||
43 | cmp \irqstat,#1<<4 | ||
44 | addhs \irqnr,\irqnr,#4 | ||
45 | movhs \irqstat,\irqstat,lsr#4 | ||
46 | cmp \irqstat,#1<<2 | ||
47 | addhs \irqnr,\irqnr,#2 | ||
48 | movhs \irqstat,\irqstat,lsr#2 | ||
49 | cmp \irqstat,#1<<1 | ||
50 | addhs \irqnr,\irqnr,#1 | ||
51 | |||
52 | /* was there an interrupt ? if not then drop out with EQ status */ | ||
53 | teq \irqstat,#0 | ||
54 | beq 1003f | ||
55 | |||
56 | /* and now check for extended IRQ reasons */ | ||
57 | cmp \irqnr,#1 | ||
58 | bls 1003f | ||
59 | cmp \irqnr,#30 | ||
60 | blo 1002f | ||
61 | |||
62 | /* IRQ 31,30 : High priority cascade IRQ handle */ | ||
63 | /* read the correct SIC */ | ||
64 | /* decoding status after compare : eq is 30 (SIC1) , ne is 31 (SIC2) */ | ||
65 | /* set the base IRQ number */ | ||
66 | ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE) | ||
67 | moveq \irqnr,#SIC1_BASE_INT | ||
68 | ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE) | ||
69 | movne \irqnr,#SIC2_BASE_INT | ||
70 | ldr \irqstat, [\base, #INTRC_STAT] | ||
71 | ldr \tmp, [\base, #INTRC_TYPE] | ||
72 | /* and with inverted mask : low priority interrupts */ | ||
73 | and \irqstat,\irqstat,\tmp | ||
74 | b 1004f | ||
75 | |||
76 | 1003: | ||
77 | /* IRQ 1,0 : Low priority cascade IRQ handle */ | ||
78 | /* read the correct SIC */ | ||
79 | /* decoding status after compare : eq is 1 (SIC2) , ne is 0 (SIC1)*/ | ||
80 | /* read the correct SIC */ | ||
81 | /* set the base IRQ number */ | ||
82 | ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE) | ||
83 | movne \irqnr,#SIC1_BASE_INT | ||
84 | ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE) | ||
85 | moveq \irqnr,#SIC2_BASE_INT | ||
86 | ldr \irqstat, [\base, #INTRC_STAT] | ||
87 | ldr \tmp, [\base, #INTRC_TYPE] | ||
88 | /* and with inverted mask : low priority interrupts */ | ||
89 | bic \irqstat,\irqstat,\tmp | ||
90 | |||
91 | 1004: | ||
92 | |||
93 | cmp \irqstat,#1<<16 | ||
94 | addhs \irqnr,\irqnr,#16 | ||
95 | movhs \irqstat,\irqstat,lsr#16 | ||
96 | cmp \irqstat,#1<<8 | ||
97 | addhs \irqnr,\irqnr,#8 | ||
98 | movhs \irqstat,\irqstat,lsr#8 | ||
99 | cmp \irqstat,#1<<4 | ||
100 | addhs \irqnr,\irqnr,#4 | ||
101 | movhs \irqstat,\irqstat,lsr#4 | ||
102 | cmp \irqstat,#1<<2 | ||
103 | addhs \irqnr,\irqnr,#2 | ||
104 | movhs \irqstat,\irqstat,lsr#2 | ||
105 | cmp \irqstat,#1<<1 | ||
106 | addhs \irqnr,\irqnr,#1 | ||
107 | |||
108 | |||
109 | /* is irqstat not zero */ | ||
110 | |||
111 | 1002: | ||
112 | /* we assert that irqstat is not equal to zero and return ne status if true*/ | ||
113 | teq \irqstat,#0 | ||
114 | 1003: | ||
115 | .endm | ||
116 | |||
diff --git a/arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h b/arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h deleted file mode 100644 index 41027dd7cf74..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h +++ /dev/null | |||
@@ -1,241 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/gpio-pnx4008.h | ||
3 | * | ||
4 | * PNX4008 GPIO driver - header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * Based on reference code by Iwo Mergler and Z.Tabaaloute from Philips: | ||
9 | * Copyright (c) 2005 Koninklijke Philips Electronics N.V. | ||
10 | * | ||
11 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
12 | * the terms of the GNU General Public License version 2. This program | ||
13 | * is licensed "as is" without any warranty of any kind, whether express | ||
14 | * or implied. | ||
15 | */ | ||
16 | |||
17 | #ifndef _PNX4008_GPIO_H_ | ||
18 | #define _PNX4008_GPIO_H_ | ||
19 | |||
20 | |||
21 | /* Block numbers */ | ||
22 | #define GPIO_IN (0) | ||
23 | #define GPIO_OUT (0x100) | ||
24 | #define GPIO_BID (0x200) | ||
25 | #define GPIO_RAM (0x300) | ||
26 | #define GPIO_MUX (0x400) | ||
27 | |||
28 | #define GPIO_TYPE_MASK(K) ((K) & 0x700) | ||
29 | |||
30 | /* INPUT GPIOs */ | ||
31 | /* GPI */ | ||
32 | #define GPI_00 (GPIO_IN | 0) | ||
33 | #define GPI_01 (GPIO_IN | 1) | ||
34 | #define GPI_02 (GPIO_IN | 2) | ||
35 | #define GPI_03 (GPIO_IN | 3) | ||
36 | #define GPI_04 (GPIO_IN | 4) | ||
37 | #define GPI_05 (GPIO_IN | 5) | ||
38 | #define GPI_06 (GPIO_IN | 6) | ||
39 | #define GPI_07 (GPIO_IN | 7) | ||
40 | #define GPI_08 (GPIO_IN | 8) | ||
41 | #define GPI_09 (GPIO_IN | 9) | ||
42 | #define U1_RX (GPIO_IN | 15) | ||
43 | #define U2_HTCS (GPIO_IN | 16) | ||
44 | #define U2_RX (GPIO_IN | 17) | ||
45 | #define U3_RX (GPIO_IN | 18) | ||
46 | #define U4_RX (GPIO_IN | 19) | ||
47 | #define U5_RX (GPIO_IN | 20) | ||
48 | #define U6_IRRX (GPIO_IN | 21) | ||
49 | #define U7_HCTS (GPIO_IN | 22) | ||
50 | #define U7_RX (GPIO_IN | 23) | ||
51 | /* MISC IN */ | ||
52 | #define SPI1_DATIN (GPIO_IN | 25) | ||
53 | #define DISP_SYNC (GPIO_IN | 26) | ||
54 | #define SPI2_DATIN (GPIO_IN | 27) | ||
55 | #define GPI_11 (GPIO_IN | 28) | ||
56 | |||
57 | #define GPIO_IN_MASK 0x1eff83ff | ||
58 | |||
59 | /* OUTPUT GPIOs */ | ||
60 | /* GPO */ | ||
61 | #define GPO_00 (GPIO_OUT | 0) | ||
62 | #define GPO_01 (GPIO_OUT | 1) | ||
63 | #define GPO_02 (GPIO_OUT | 2) | ||
64 | #define GPO_03 (GPIO_OUT | 3) | ||
65 | #define GPO_04 (GPIO_OUT | 4) | ||
66 | #define GPO_05 (GPIO_OUT | 5) | ||
67 | #define GPO_06 (GPIO_OUT | 6) | ||
68 | #define GPO_07 (GPIO_OUT | 7) | ||
69 | #define GPO_08 (GPIO_OUT | 8) | ||
70 | #define GPO_09 (GPIO_OUT | 9) | ||
71 | #define GPO_10 (GPIO_OUT | 10) | ||
72 | #define GPO_11 (GPIO_OUT | 11) | ||
73 | #define GPO_12 (GPIO_OUT | 12) | ||
74 | #define GPO_13 (GPIO_OUT | 13) | ||
75 | #define GPO_14 (GPIO_OUT | 14) | ||
76 | #define GPO_15 (GPIO_OUT | 15) | ||
77 | #define GPO_16 (GPIO_OUT | 16) | ||
78 | #define GPO_17 (GPIO_OUT | 17) | ||
79 | #define GPO_18 (GPIO_OUT | 18) | ||
80 | #define GPO_19 (GPIO_OUT | 19) | ||
81 | #define GPO_20 (GPIO_OUT | 20) | ||
82 | #define GPO_21 (GPIO_OUT | 21) | ||
83 | #define GPO_22 (GPIO_OUT | 22) | ||
84 | #define GPO_23 (GPIO_OUT | 23) | ||
85 | |||
86 | #define GPIO_OUT_MASK 0xffffff | ||
87 | |||
88 | /* BIDIRECTIONAL GPIOs */ | ||
89 | /* RAM pins */ | ||
90 | #define RAM_D19 (GPIO_RAM | 0) | ||
91 | #define RAM_D20 (GPIO_RAM | 1) | ||
92 | #define RAM_D21 (GPIO_RAM | 2) | ||
93 | #define RAM_D22 (GPIO_RAM | 3) | ||
94 | #define RAM_D23 (GPIO_RAM | 4) | ||
95 | #define RAM_D24 (GPIO_RAM | 5) | ||
96 | #define RAM_D25 (GPIO_RAM | 6) | ||
97 | #define RAM_D26 (GPIO_RAM | 7) | ||
98 | #define RAM_D27 (GPIO_RAM | 8) | ||
99 | #define RAM_D28 (GPIO_RAM | 9) | ||
100 | #define RAM_D29 (GPIO_RAM | 10) | ||
101 | #define RAM_D30 (GPIO_RAM | 11) | ||
102 | #define RAM_D31 (GPIO_RAM | 12) | ||
103 | |||
104 | #define GPIO_RAM_MASK 0x1fff | ||
105 | |||
106 | /* I/O pins */ | ||
107 | #define GPIO_00 (GPIO_BID | 25) | ||
108 | #define GPIO_01 (GPIO_BID | 26) | ||
109 | #define GPIO_02 (GPIO_BID | 27) | ||
110 | #define GPIO_03 (GPIO_BID | 28) | ||
111 | #define GPIO_04 (GPIO_BID | 29) | ||
112 | #define GPIO_05 (GPIO_BID | 30) | ||
113 | |||
114 | #define GPIO_BID_MASK 0x7e000000 | ||
115 | |||
116 | /* Non-GPIO multiplexed PIOs. For multiplexing with GPIO, please use GPIO macros */ | ||
117 | #define GPIO_SDRAM_SEL (GPIO_MUX | 3) | ||
118 | |||
119 | #define GPIO_MUX_MASK 0x8 | ||
120 | |||
121 | /* Extraction/assembly macros */ | ||
122 | #define GPIO_BIT_MASK(K) ((K) & 0x1F) | ||
123 | #define GPIO_BIT(K) (1 << GPIO_BIT_MASK(K)) | ||
124 | #define GPIO_ISMUX(K) ((GPIO_TYPE_MASK(K) == GPIO_MUX) && (GPIO_BIT(K) & GPIO_MUX_MASK)) | ||
125 | #define GPIO_ISRAM(K) ((GPIO_TYPE_MASK(K) == GPIO_RAM) && (GPIO_BIT(K) & GPIO_RAM_MASK)) | ||
126 | #define GPIO_ISBID(K) ((GPIO_TYPE_MASK(K) == GPIO_BID) && (GPIO_BIT(K) & GPIO_BID_MASK)) | ||
127 | #define GPIO_ISOUT(K) ((GPIO_TYPE_MASK(K) == GPIO_OUT) && (GPIO_BIT(K) & GPIO_OUT_MASK)) | ||
128 | #define GPIO_ISIN(K) ((GPIO_TYPE_MASK(K) == GPIO_IN) && (GPIO_BIT(K) & GPIO_IN_MASK)) | ||
129 | |||
130 | /* Start Enable Pin Interrupts - table 58 page 66 */ | ||
131 | |||
132 | #define SE_PIN_BASE_INT 32 | ||
133 | |||
134 | #define SE_U7_RX_INT 63 | ||
135 | #define SE_U7_HCTS_INT 62 | ||
136 | #define SE_BT_CLKREQ_INT 61 | ||
137 | #define SE_U6_IRRX_INT 60 | ||
138 | /*59 unused*/ | ||
139 | #define SE_U5_RX_INT 58 | ||
140 | #define SE_GPI_11_INT 57 | ||
141 | #define SE_U3_RX_INT 56 | ||
142 | #define SE_U2_HCTS_INT 55 | ||
143 | #define SE_U2_RX_INT 54 | ||
144 | #define SE_U1_RX_INT 53 | ||
145 | #define SE_DISP_SYNC_INT 52 | ||
146 | /*51 unused*/ | ||
147 | #define SE_SDIO_INT_N 50 | ||
148 | #define SE_MSDIO_START_INT 49 | ||
149 | #define SE_GPI_06_INT 48 | ||
150 | #define SE_GPI_05_INT 47 | ||
151 | #define SE_GPI_04_INT 46 | ||
152 | #define SE_GPI_03_INT 45 | ||
153 | #define SE_GPI_02_INT 44 | ||
154 | #define SE_GPI_01_INT 43 | ||
155 | #define SE_GPI_00_INT 42 | ||
156 | #define SE_SYSCLKEN_PIN_INT 41 | ||
157 | #define SE_SPI1_DATAIN_INT 40 | ||
158 | #define SE_GPI_07_INT 39 | ||
159 | #define SE_SPI2_DATAIN_INT 38 | ||
160 | #define SE_GPI_10_INT 37 | ||
161 | #define SE_GPI_09_INT 36 | ||
162 | #define SE_GPI_08_INT 35 | ||
163 | /*34-32 unused*/ | ||
164 | |||
165 | /* Start Enable Internal Interrupts - table 57 page 65 */ | ||
166 | |||
167 | #define SE_INT_BASE_INT 0 | ||
168 | |||
169 | #define SE_TS_IRQ 31 | ||
170 | #define SE_TS_P_INT 30 | ||
171 | #define SE_TS_AUX_INT 29 | ||
172 | /*27-28 unused*/ | ||
173 | #define SE_USB_AHB_NEED_CLK_INT 26 | ||
174 | #define SE_MSTIMER_INT 25 | ||
175 | #define SE_RTC_INT 24 | ||
176 | #define SE_USB_NEED_CLK_INT 23 | ||
177 | #define SE_USB_INT 22 | ||
178 | #define SE_USB_I2C_INT 21 | ||
179 | #define SE_USB_OTG_TIMER_INT 20 | ||
180 | #define SE_USB_OTG_ATX_INT_N 19 | ||
181 | /*18 unused*/ | ||
182 | #define SE_DSP_GPIO4_INT 17 | ||
183 | #define SE_KEY_IRQ 16 | ||
184 | #define SE_DSP_SLAVEPORT_INT 15 | ||
185 | #define SE_DSP_GPIO1_INT 14 | ||
186 | #define SE_DSP_GPIO0_INT 13 | ||
187 | #define SE_DSP_AHB_INT 12 | ||
188 | /*11-6 unused*/ | ||
189 | #define SE_GPIO_05_INT 5 | ||
190 | #define SE_GPIO_04_INT 4 | ||
191 | #define SE_GPIO_03_INT 3 | ||
192 | #define SE_GPIO_02_INT 2 | ||
193 | #define SE_GPIO_01_INT 1 | ||
194 | #define SE_GPIO_00_INT 0 | ||
195 | |||
196 | #define START_INT_REG_BIT(irq) (1<<((irq)&0x1F)) | ||
197 | |||
198 | #define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1))) | ||
199 | #define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1))) | ||
200 | #define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1))) | ||
201 | #define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1))) | ||
202 | |||
203 | extern int pnx4008_gpio_register_pin(unsigned short pin); | ||
204 | extern int pnx4008_gpio_unregister_pin(unsigned short pin); | ||
205 | extern unsigned long pnx4008_gpio_read_pin(unsigned short pin); | ||
206 | extern int pnx4008_gpio_write_pin(unsigned short pin, int output); | ||
207 | extern int pnx4008_gpio_set_pin_direction(unsigned short pin, int output); | ||
208 | extern int pnx4008_gpio_read_pin_direction(unsigned short pin); | ||
209 | extern int pnx4008_gpio_set_pin_mux(unsigned short pin, int output); | ||
210 | extern int pnx4008_gpio_read_pin_mux(unsigned short pin); | ||
211 | |||
212 | static inline void start_int_umask(u8 irq) | ||
213 | { | ||
214 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) | | ||
215 | START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); | ||
216 | } | ||
217 | |||
218 | static inline void start_int_mask(u8 irq) | ||
219 | { | ||
220 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) & | ||
221 | ~START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); | ||
222 | } | ||
223 | |||
224 | static inline void start_int_ack(u8 irq) | ||
225 | { | ||
226 | __raw_writel(START_INT_REG_BIT(irq), START_INT_RSR_REG(irq)); | ||
227 | } | ||
228 | |||
229 | static inline void start_int_set_falling_edge(u8 irq) | ||
230 | { | ||
231 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) & | ||
232 | ~START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); | ||
233 | } | ||
234 | |||
235 | static inline void start_int_set_rising_edge(u8 irq) | ||
236 | { | ||
237 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) | | ||
238 | START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); | ||
239 | } | ||
240 | |||
241 | #endif /* _PNX4008_GPIO_H_ */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/hardware.h b/arch/arm/mach-pnx4008/include/mach/hardware.h deleted file mode 100644 index 7b98b828d368..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/hardware.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/hardware.h | ||
3 | * | ||
4 | * Copyright (c) 2005 MontaVista Software, Inc. <source@mvista.com> | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __ASM_ARCH_HARDWARE_H | ||
21 | #define __ASM_ARCH_HARDWARE_H | ||
22 | |||
23 | #include <asm/sizes.h> | ||
24 | #include <mach/platform.h> | ||
25 | |||
26 | /* Start of virtual addresses for IO devices */ | ||
27 | #define IO_BASE 0xF0000000 | ||
28 | |||
29 | /* This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 */ | ||
30 | #define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE) | ||
31 | |||
32 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/irq.h b/arch/arm/mach-pnx4008/include/mach/irq.h deleted file mode 100644 index 2a690ca33870..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/irq.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/irq.h | ||
3 | * | ||
4 | * PNX4008 IRQ controller driver - header file | ||
5 | * this one is used in entry-arnv.S as well so it cannot contain C code | ||
6 | * | ||
7 | * Copyright (c) 2005 Philips Semiconductors | ||
8 | * Copyright (c) 2005 MontaVista Software, Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | */ | ||
15 | #ifndef __PNX4008_IRQ_H__ | ||
16 | #define __PNX4008_IRQ_H__ | ||
17 | |||
18 | #define MIC_VA_BASE IO_ADDRESS(PNX4008_INTCTRLMIC_BASE) | ||
19 | #define SIC1_VA_BASE IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE) | ||
20 | #define SIC2_VA_BASE IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE) | ||
21 | |||
22 | /* Manual: Chapter 20, page 195 */ | ||
23 | |||
24 | #define INTC_BIT(irq) (1<< ((irq) & 0x1F)) | ||
25 | |||
26 | #define INTC_ER(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x0 + (((irq)&(0x3<<5))<<9))) | ||
27 | #define INTC_RSR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x4 + (((irq)&(0x3<<5))<<9))) | ||
28 | #define INTC_SR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x8 + (((irq)&(0x3<<5))<<9))) | ||
29 | #define INTC_APR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0xC + (((irq)&(0x3<<5))<<9))) | ||
30 | #define INTC_ATR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x10 + (((irq)&(0x3<<5))<<9))) | ||
31 | #define INTC_ITR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x14 + (((irq)&(0x3<<5))<<9))) | ||
32 | |||
33 | #define START_INT_REG_BIT(irq) (1<<((irq)&0x1F)) | ||
34 | |||
35 | #define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1))) | ||
36 | #define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1))) | ||
37 | #define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1))) | ||
38 | #define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1))) | ||
39 | |||
40 | extern void __init pnx4008_init_irq(void); | ||
41 | |||
42 | #endif /* __PNX4008_IRQ_H__ */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/irqs.h b/arch/arm/mach-pnx4008/include/mach/irqs.h deleted file mode 100644 index f6b33cf23ae2..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/irqs.h +++ /dev/null | |||
@@ -1,215 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/irqs.h | ||
3 | * | ||
4 | * PNX4008 IRQ controller driver - header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | #ifndef __PNX4008_IRQS_h__ | ||
14 | #define __PNX4008_IRQS_h__ | ||
15 | |||
16 | #define NR_IRQS 96 | ||
17 | |||
18 | /*Manual: table 259, page 199*/ | ||
19 | |||
20 | /*SUB2 Interrupt Routing (SIC2)*/ | ||
21 | |||
22 | #define SIC2_BASE_INT 64 | ||
23 | |||
24 | #define CLK_SWITCH_ARM_INT 95 /*manual: Clkswitch ARM */ | ||
25 | #define CLK_SWITCH_DSP_INT 94 /*manual: ClkSwitch DSP */ | ||
26 | #define CLK_SWITCH_AUD_INT 93 /*manual: Clkswitch AUD */ | ||
27 | #define GPI_06_INT 92 | ||
28 | #define GPI_05_INT 91 | ||
29 | #define GPI_04_INT 90 | ||
30 | #define GPI_03_INT 89 | ||
31 | #define GPI_02_INT 88 | ||
32 | #define GPI_01_INT 87 | ||
33 | #define GPI_00_INT 86 | ||
34 | #define BT_CLKREQ_INT 85 | ||
35 | #define SPI1_DATIN_INT 84 | ||
36 | #define U5_RX_INT 83 | ||
37 | #define SDIO_INT_N 82 | ||
38 | #define CAM_HS_INT 81 | ||
39 | #define CAM_VS_INT 80 | ||
40 | #define GPI_07_INT 79 | ||
41 | #define DISP_SYNC_INT 78 | ||
42 | #define DSP_INT8 77 | ||
43 | #define U7_HCTS_INT 76 | ||
44 | #define GPI_10_INT 75 | ||
45 | #define GPI_09_INT 74 | ||
46 | #define GPI_08_INT 73 | ||
47 | #define DSP_INT7 72 | ||
48 | #define U2_HCTS_INT 71 | ||
49 | #define SPI2_DATIN_INT 70 | ||
50 | #define GPIO_05_INT 69 | ||
51 | #define GPIO_04_INT 68 | ||
52 | #define GPIO_03_INT 67 | ||
53 | #define GPIO_02_INT 66 | ||
54 | #define GPIO_01_INT 65 | ||
55 | #define GPIO_00_INT 64 | ||
56 | |||
57 | /*Manual: table 258, page 198*/ | ||
58 | |||
59 | /*SUB1 Interrupt Routing (SIC1)*/ | ||
60 | |||
61 | #define SIC1_BASE_INT 32 | ||
62 | |||
63 | #define USB_I2C_INT 63 | ||
64 | #define USB_DEV_HP_INT 62 | ||
65 | #define USB_DEV_LP_INT 61 | ||
66 | #define USB_DEV_DMA_INT 60 | ||
67 | #define USB_HOST_INT 59 | ||
68 | #define USB_OTG_ATX_INT_N 58 | ||
69 | #define USB_OTG_TIMER_INT 57 | ||
70 | #define SW_INT 56 | ||
71 | #define SPI1_INT 55 | ||
72 | #define KEY_IRQ 54 | ||
73 | #define DSP_M_INT 53 | ||
74 | #define RTC_INT 52 | ||
75 | #define I2C_1_INT 51 | ||
76 | #define I2C_2_INT 50 | ||
77 | #define PLL1_LOCK_INT 49 | ||
78 | #define PLL2_LOCK_INT 48 | ||
79 | #define PLL3_LOCK_INT 47 | ||
80 | #define PLL4_LOCK_INT 46 | ||
81 | #define PLL5_LOCK_INT 45 | ||
82 | #define SPI2_INT 44 | ||
83 | #define DSP_INT1 43 | ||
84 | #define DSP_INT2 42 | ||
85 | #define DSP_TDM_INT2 41 | ||
86 | #define TS_AUX_INT 40 | ||
87 | #define TS_IRQ 39 | ||
88 | #define TS_P_INT 38 | ||
89 | #define UOUT1_TO_PAD_INT 37 | ||
90 | #define GPI_11_INT 36 | ||
91 | #define DSP_INT4 35 | ||
92 | #define JTAG_COMM_RX_INT 34 | ||
93 | #define JTAG_COMM_TX_INT 33 | ||
94 | #define DSP_INT3 32 | ||
95 | |||
96 | /*Manual: table 257, page 197*/ | ||
97 | |||
98 | /*MAIN Interrupt Routing*/ | ||
99 | |||
100 | #define MAIN_BASE_INT 0 | ||
101 | |||
102 | #define SUB2_FIQ_N 31 /*active low */ | ||
103 | #define SUB1_FIQ_N 30 /*active low */ | ||
104 | #define JPEG_INT 29 | ||
105 | #define DMA_INT 28 | ||
106 | #define MSTIMER_INT 27 | ||
107 | #define IIR1_INT 26 | ||
108 | #define IIR2_INT 25 | ||
109 | #define IIR7_INT 24 | ||
110 | #define DSP_TDM_INT0 23 | ||
111 | #define DSP_TDM_INT1 22 | ||
112 | #define DSP_P_INT 21 | ||
113 | #define DSP_INT0 20 | ||
114 | #define DUM_INT 19 | ||
115 | #define UOUT0_TO_PAD_INT 18 | ||
116 | #define MP4_ENC_INT 17 | ||
117 | #define MP4_DEC_INT 16 | ||
118 | #define SD0_INT 15 | ||
119 | #define MBX_INT 14 | ||
120 | #define SD1_INT 13 | ||
121 | #define MS_INT_N 12 | ||
122 | #define FLASH_INT 11 /*NAND*/ | ||
123 | #define IIR6_INT 10 | ||
124 | #define IIR5_INT 9 | ||
125 | #define IIR4_INT 8 | ||
126 | #define IIR3_INT 7 | ||
127 | #define WATCH_INT 6 | ||
128 | #define HSTIMER_INT 5 | ||
129 | #define ARCH_TIMER_IRQ HSTIMER_INT | ||
130 | #define CAM_INT 4 | ||
131 | #define PRNG_INT 3 | ||
132 | #define CRYPTO_INT 2 | ||
133 | #define SUB2_IRQ_N 1 /*active low */ | ||
134 | #define SUB1_IRQ_N 0 /*active low */ | ||
135 | |||
136 | #define PNX4008_IRQ_TYPES \ | ||
137 | { /*IRQ #'s: */ \ | ||
138 | IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, /* 0, 1, 2, 3 */ \ | ||
139 | IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 4, 5, 6, 7 */ \ | ||
140 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 8, 9,10,11 */ \ | ||
141 | IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 12,13,14,15 */ \ | ||
142 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 16,17,18,19 */ \ | ||
143 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 20,21,22,23 */ \ | ||
144 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 24,25,26,27 */ \ | ||
145 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, /* 28,29,30,31 */ \ | ||
146 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 32,33,34,35 */ \ | ||
147 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_HIGH, /* 36,37,38,39 */ \ | ||
148 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 40,41,42,43 */ \ | ||
149 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 44,45,46,47 */ \ | ||
150 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_LOW, /* 48,49,50,51 */ \ | ||
151 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 52,53,54,55 */ \ | ||
152 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH, /* 56,57,58,59 */ \ | ||
153 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 60,61,62,63 */ \ | ||
154 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 64,65,66,67 */ \ | ||
155 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 68,69,70,71 */ \ | ||
156 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 72,73,74,75 */ \ | ||
157 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 76,77,78,79 */ \ | ||
158 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 80,81,82,83 */ \ | ||
159 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 84,85,86,87 */ \ | ||
160 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 88,89,90,91 */ \ | ||
161 | IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_LEVEL_HIGH, /* 92,93,94,95 */ \ | ||
162 | } | ||
163 | |||
164 | /* Start Enable Pin Interrupts - table 58 page 66 */ | ||
165 | |||
166 | #define SE_PIN_BASE_INT 32 | ||
167 | |||
168 | #define SE_U7_RX_INT 63 | ||
169 | #define SE_U7_HCTS_INT 62 | ||
170 | #define SE_BT_CLKREQ_INT 61 | ||
171 | #define SE_U6_IRRX_INT 60 | ||
172 | /*59 unused*/ | ||
173 | #define SE_U5_RX_INT 58 | ||
174 | #define SE_GPI_11_INT 57 | ||
175 | #define SE_U3_RX_INT 56 | ||
176 | #define SE_U2_HCTS_INT 55 | ||
177 | #define SE_U2_RX_INT 54 | ||
178 | #define SE_U1_RX_INT 53 | ||
179 | #define SE_DISP_SYNC_INT 52 | ||
180 | /*51 unused*/ | ||
181 | #define SE_SDIO_INT_N 50 | ||
182 | #define SE_MSDIO_START_INT 49 | ||
183 | #define SE_GPI_06_INT 48 | ||
184 | #define SE_GPI_05_INT 47 | ||
185 | #define SE_GPI_04_INT 46 | ||
186 | #define SE_GPI_03_INT 45 | ||
187 | #define SE_GPI_02_INT 44 | ||
188 | #define SE_GPI_01_INT 43 | ||
189 | #define SE_GPI_00_INT 42 | ||
190 | #define SE_SYSCLKEN_PIN_INT 41 | ||
191 | #define SE_SPI1_DATAIN_INT 40 | ||
192 | #define SE_GPI_07_INT 39 | ||
193 | #define SE_SPI2_DATAIN_INT 38 | ||
194 | #define SE_GPI_10_INT 37 | ||
195 | #define SE_GPI_09_INT 36 | ||
196 | #define SE_GPI_08_INT 35 | ||
197 | /*34-32 unused*/ | ||
198 | |||
199 | /* Start Enable Internal Interrupts - table 57 page 65 */ | ||
200 | |||
201 | #define SE_INT_BASE_INT 0 | ||
202 | |||
203 | #define SE_TS_IRQ 31 | ||
204 | #define SE_TS_P_INT 30 | ||
205 | #define SE_TS_AUX_INT 29 | ||
206 | /*27-28 unused*/ | ||
207 | #define SE_USB_AHB_NEED_CLK_INT 26 | ||
208 | #define SE_MSTIMER_INT 25 | ||
209 | #define SE_RTC_INT 24 | ||
210 | #define SE_USB_NEED_CLK_INT 23 | ||
211 | #define SE_USB_INT 22 | ||
212 | #define SE_USB_I2C_INT 21 | ||
213 | #define SE_USB_OTG_TIMER_INT 20 | ||
214 | |||
215 | #endif /* __PNX4008_IRQS_h__ */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/param.h b/arch/arm/mach-pnx4008/include/mach/param.h deleted file mode 100644 index 6ea02f2176b7..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/param.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/param.h | ||
3 | * | ||
4 | * Copyright (C) 1999 ARM Limited | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #define HZ 100 | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/platform.h b/arch/arm/mach-pnx4008/include/mach/platform.h deleted file mode 100644 index 368c2c10a308..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/platform.h +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/platform.h | ||
3 | * | ||
4 | * PNX4008 Base addresses - header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * Based on reference code received from Philips: | ||
9 | * Copyright (C) 2003 Philips Semiconductors | ||
10 | * | ||
11 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
12 | * the terms of the GNU General Public License version 2. This program | ||
13 | * is licensed "as is" without any warranty of any kind, whether express | ||
14 | * or implied. | ||
15 | */ | ||
16 | |||
17 | |||
18 | #ifndef __ASM_ARCH_PLATFORM_H__ | ||
19 | #define __ASM_ARCH_PLATFORM_H__ | ||
20 | |||
21 | #define PNX4008_IRAM_BASE 0x08000000 | ||
22 | #define PNX4008_IRAM_SIZE 0x00010000 | ||
23 | #define PNX4008_YUV_SLAVE_BASE 0x10000000 | ||
24 | #define PNX4008_DUM_SLAVE_BASE 0x18000000 | ||
25 | #define PNX4008_NDF_FLASH_BASE 0x20020000 | ||
26 | #define PNX4008_SPI1_BASE 0x20088000 | ||
27 | #define PNX4008_SPI2_BASE 0x20090000 | ||
28 | #define PNX4008_SD_CONFIG_BASE 0x20098000 | ||
29 | #define PNX4008_FLASH_DATA 0x200B0000 | ||
30 | #define PNX4008_MLC_FLASH_BASE 0x200B8000 | ||
31 | #define PNX4008_JPEG_CONFIG_BASE 0x300A0000 | ||
32 | #define PNX4008_DMA_CONFIG_BASE 0x31000000 | ||
33 | #define PNX4008_USB_CONFIG_BASE 0x31020000 | ||
34 | #define PNX4008_SDRAM_CFG_BASE 0x31080000 | ||
35 | #define PNX4008_AHB2FAB_BASE 0x40000000 | ||
36 | #define PNX4008_PWRMAN_BASE 0x40004000 | ||
37 | #define PNX4008_INTCTRLMIC_BASE 0x40008000 | ||
38 | #define PNX4008_INTCTRLSIC1_BASE 0x4000C000 | ||
39 | #define PNX4008_INTCTRLSIC2_BASE 0x40010000 | ||
40 | #define PNX4008_HSUART1_BASE 0x40014000 | ||
41 | #define PNX4008_HSUART2_BASE 0x40018000 | ||
42 | #define PNX4008_HSUART7_BASE 0x4001C000 | ||
43 | #define PNX4008_RTC_BASE 0x40024000 | ||
44 | #define PNX4008_PIO_BASE 0x40028000 | ||
45 | #define PNX4008_MSTIMER_BASE 0x40034000 | ||
46 | #define PNX4008_HSTIMER_BASE 0x40038000 | ||
47 | #define PNX4008_WDOG_BASE 0x4003C000 | ||
48 | #define PNX4008_DEBUG_BASE 0x40040000 | ||
49 | #define PNX4008_TOUCH1_BASE 0x40048000 | ||
50 | #define PNX4008_KEYSCAN_BASE 0x40050000 | ||
51 | #define PNX4008_UARTCTRL_BASE 0x40054000 | ||
52 | #define PNX4008_PWM_BASE 0x4005C000 | ||
53 | #define PNX4008_UART3_BASE 0x40080000 | ||
54 | #define PNX4008_UART4_BASE 0x40088000 | ||
55 | #define PNX4008_UART5_BASE 0x40090000 | ||
56 | #define PNX4008_UART6_BASE 0x40098000 | ||
57 | #define PNX4008_I2C1_BASE 0x400A0000 | ||
58 | #define PNX4008_I2C2_BASE 0x400A8000 | ||
59 | #define PNX4008_MAGICGATE_BASE 0x400B0000 | ||
60 | #define PNX4008_DUMCONF_BASE 0x400B8000 | ||
61 | #define PNX4008_DUM_MAINCFG_BASE 0x400BC000 | ||
62 | #define PNX4008_DSP_BASE 0x400C0000 | ||
63 | #define PNX4008_PROFCOUNTER_BASE 0x400C8000 | ||
64 | #define PNX4008_CRYPTO_BASE 0x400D0000 | ||
65 | #define PNX4008_CAMIFCONF_BASE 0x400D8000 | ||
66 | #define PNX4008_YUV2RGB_BASE 0x400E0000 | ||
67 | #define PNX4008_AUDIOCONFIG_BASE 0x400E8000 | ||
68 | |||
69 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/pm.h b/arch/arm/mach-pnx4008/include/mach/pm.h deleted file mode 100644 index 2fa685bff858..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/pm.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/pm.h | ||
3 | * | ||
4 | * PNX4008 Power Management Routiness - header file | ||
5 | * | ||
6 | * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_PNX4008_PM_H | ||
15 | #define __ASM_ARCH_PNX4008_PM_H | ||
16 | |||
17 | #ifndef __ASSEMBLER__ | ||
18 | #include "irq.h" | ||
19 | #include "irqs.h" | ||
20 | #include "clock.h" | ||
21 | |||
22 | extern void pnx4008_pm_idle(void); | ||
23 | extern void pnx4008_pm_suspend(void); | ||
24 | extern unsigned int pnx4008_cpu_suspend_sz; | ||
25 | extern void pnx4008_cpu_suspend(void); | ||
26 | extern unsigned int pnx4008_cpu_standby_sz; | ||
27 | extern void pnx4008_cpu_standby(void); | ||
28 | |||
29 | extern int pnx4008_startup_pll(struct clk *); | ||
30 | extern int pnx4008_shutdown_pll(struct clk *); | ||
31 | |||
32 | #endif /* ASSEMBLER */ | ||
33 | #endif /* __ASM_ARCH_PNX4008_PM_H */ | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/timex.h b/arch/arm/mach-pnx4008/include/mach/timex.h deleted file mode 100644 index b383c7de7ab4..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/timex.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/timex.h | ||
3 | * | ||
4 | * PNX4008 timers header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PNX4008_TIMEX_H | ||
15 | #define __PNX4008_TIMEX_H | ||
16 | |||
17 | #define CLOCK_TICK_RATE 1000000 | ||
18 | |||
19 | #endif | ||
diff --git a/arch/arm/mach-pnx4008/include/mach/uncompress.h b/arch/arm/mach-pnx4008/include/mach/uncompress.h deleted file mode 100644 index bb4751ee2539..000000000000 --- a/arch/arm/mach-pnx4008/include/mach/uncompress.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/uncompress.h | ||
3 | * | ||
4 | * Copyright (C) 1999 ARM Limited | ||
5 | * Copyright (C) 2006 MontaVista Software, Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #define UART5_BASE 0x40090000 | ||
23 | |||
24 | #define UART5_DR (*(volatile unsigned char *) (UART5_BASE)) | ||
25 | #define UART5_FR (*(volatile unsigned char *) (UART5_BASE + 18)) | ||
26 | |||
27 | static __inline__ void putc(char c) | ||
28 | { | ||
29 | while (UART5_FR & (1 << 5)) | ||
30 | barrier(); | ||
31 | |||
32 | UART5_DR = c; | ||
33 | } | ||
34 | |||
35 | /* | ||
36 | * This does not append a newline | ||
37 | */ | ||
38 | static inline void flush(void) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | * nothing to do | ||
44 | */ | ||
45 | #define arch_decomp_setup() | ||
46 | #define arch_decomp_wdog() | ||
diff --git a/arch/arm/mach-pnx4008/irq.c b/arch/arm/mach-pnx4008/irq.c deleted file mode 100644 index 41e4201972d5..000000000000 --- a/arch/arm/mach-pnx4008/irq.c +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/irq.c | ||
3 | * | ||
4 | * PNX4008 IRQ controller driver | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * Based on reference code received from Philips: | ||
9 | * Copyright (C) 2003 Philips Semiconductors | ||
10 | * | ||
11 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
12 | * the terms of the GNU General Public License version 2. This program | ||
13 | * is licensed "as is" without any warranty of any kind, whether express | ||
14 | * or implied. | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <linux/mm.h> | ||
20 | #include <linux/interrupt.h> | ||
21 | #include <linux/list.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/ioport.h> | ||
24 | #include <linux/device.h> | ||
25 | #include <linux/irq.h> | ||
26 | #include <linux/io.h> | ||
27 | #include <mach/hardware.h> | ||
28 | #include <asm/setup.h> | ||
29 | #include <asm/pgtable.h> | ||
30 | #include <asm/page.h> | ||
31 | #include <asm/mach/arch.h> | ||
32 | #include <asm/mach/irq.h> | ||
33 | #include <asm/mach/map.h> | ||
34 | #include <mach/irq.h> | ||
35 | |||
36 | static u8 pnx4008_irq_type[NR_IRQS] = PNX4008_IRQ_TYPES; | ||
37 | |||
38 | static void pnx4008_mask_irq(struct irq_data *d) | ||
39 | { | ||
40 | __raw_writel(__raw_readl(INTC_ER(d->irq)) & ~INTC_BIT(d->irq), INTC_ER(d->irq)); /* mask interrupt */ | ||
41 | } | ||
42 | |||
43 | static void pnx4008_unmask_irq(struct irq_data *d) | ||
44 | { | ||
45 | __raw_writel(__raw_readl(INTC_ER(d->irq)) | INTC_BIT(d->irq), INTC_ER(d->irq)); /* unmask interrupt */ | ||
46 | } | ||
47 | |||
48 | static void pnx4008_mask_ack_irq(struct irq_data *d) | ||
49 | { | ||
50 | __raw_writel(__raw_readl(INTC_ER(d->irq)) & ~INTC_BIT(d->irq), INTC_ER(d->irq)); /* mask interrupt */ | ||
51 | __raw_writel(INTC_BIT(d->irq), INTC_SR(d->irq)); /* clear interrupt status */ | ||
52 | } | ||
53 | |||
54 | static int pnx4008_set_irq_type(struct irq_data *d, unsigned int type) | ||
55 | { | ||
56 | switch (type) { | ||
57 | case IRQ_TYPE_EDGE_RISING: | ||
58 | __raw_writel(__raw_readl(INTC_ATR(d->irq)) | INTC_BIT(d->irq), INTC_ATR(d->irq)); /*edge sensitive */ | ||
59 | __raw_writel(__raw_readl(INTC_APR(d->irq)) | INTC_BIT(d->irq), INTC_APR(d->irq)); /*rising edge */ | ||
60 | irq_set_handler(d->irq, handle_edge_irq); | ||
61 | break; | ||
62 | case IRQ_TYPE_EDGE_FALLING: | ||
63 | __raw_writel(__raw_readl(INTC_ATR(d->irq)) | INTC_BIT(d->irq), INTC_ATR(d->irq)); /*edge sensitive */ | ||
64 | __raw_writel(__raw_readl(INTC_APR(d->irq)) & ~INTC_BIT(d->irq), INTC_APR(d->irq)); /*falling edge */ | ||
65 | irq_set_handler(d->irq, handle_edge_irq); | ||
66 | break; | ||
67 | case IRQ_TYPE_LEVEL_LOW: | ||
68 | __raw_writel(__raw_readl(INTC_ATR(d->irq)) & ~INTC_BIT(d->irq), INTC_ATR(d->irq)); /*level sensitive */ | ||
69 | __raw_writel(__raw_readl(INTC_APR(d->irq)) & ~INTC_BIT(d->irq), INTC_APR(d->irq)); /*low level */ | ||
70 | irq_set_handler(d->irq, handle_level_irq); | ||
71 | break; | ||
72 | case IRQ_TYPE_LEVEL_HIGH: | ||
73 | __raw_writel(__raw_readl(INTC_ATR(d->irq)) & ~INTC_BIT(d->irq), INTC_ATR(d->irq)); /*level sensitive */ | ||
74 | __raw_writel(__raw_readl(INTC_APR(d->irq)) | INTC_BIT(d->irq), INTC_APR(d->irq)); /* high level */ | ||
75 | irq_set_handler(d->irq, handle_level_irq); | ||
76 | break; | ||
77 | |||
78 | /* IRQ_TYPE_EDGE_BOTH is not supported */ | ||
79 | default: | ||
80 | printk(KERN_ERR "PNX4008 IRQ: Unsupported irq type %d\n", type); | ||
81 | return -1; | ||
82 | } | ||
83 | return 0; | ||
84 | } | ||
85 | |||
86 | static struct irq_chip pnx4008_irq_chip = { | ||
87 | .irq_ack = pnx4008_mask_ack_irq, | ||
88 | .irq_mask = pnx4008_mask_irq, | ||
89 | .irq_unmask = pnx4008_unmask_irq, | ||
90 | .irq_set_type = pnx4008_set_irq_type, | ||
91 | }; | ||
92 | |||
93 | void __init pnx4008_init_irq(void) | ||
94 | { | ||
95 | unsigned int i; | ||
96 | |||
97 | /* configure IRQ's */ | ||
98 | for (i = 0; i < NR_IRQS; i++) { | ||
99 | set_irq_flags(i, IRQF_VALID); | ||
100 | irq_set_chip(i, &pnx4008_irq_chip); | ||
101 | pnx4008_set_irq_type(irq_get_irq_data(i), pnx4008_irq_type[i]); | ||
102 | } | ||
103 | |||
104 | /* configure and enable IRQ 0,1,30,31 (cascade interrupts) */ | ||
105 | pnx4008_set_irq_type(irq_get_irq_data(SUB1_IRQ_N), | ||
106 | pnx4008_irq_type[SUB1_IRQ_N]); | ||
107 | pnx4008_set_irq_type(irq_get_irq_data(SUB2_IRQ_N), | ||
108 | pnx4008_irq_type[SUB2_IRQ_N]); | ||
109 | pnx4008_set_irq_type(irq_get_irq_data(SUB1_FIQ_N), | ||
110 | pnx4008_irq_type[SUB1_FIQ_N]); | ||
111 | pnx4008_set_irq_type(irq_get_irq_data(SUB2_FIQ_N), | ||
112 | pnx4008_irq_type[SUB2_FIQ_N]); | ||
113 | |||
114 | /* mask all others */ | ||
115 | __raw_writel((1 << SUB2_FIQ_N) | (1 << SUB1_FIQ_N) | | ||
116 | (1 << SUB2_IRQ_N) | (1 << SUB1_IRQ_N), | ||
117 | INTC_ER(MAIN_BASE_INT)); | ||
118 | __raw_writel(0, INTC_ER(SIC1_BASE_INT)); | ||
119 | __raw_writel(0, INTC_ER(SIC2_BASE_INT)); | ||
120 | } | ||
121 | |||
diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c deleted file mode 100644 index 26f8d06b142a..000000000000 --- a/arch/arm/mach-pnx4008/pm.c +++ /dev/null | |||
@@ -1,153 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/pm.c | ||
3 | * | ||
4 | * Power Management driver for PNX4008 | ||
5 | * | ||
6 | * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/pm.h> | ||
15 | #include <linux/rtc.h> | ||
16 | #include <linux/sched.h> | ||
17 | #include <linux/proc_fs.h> | ||
18 | #include <linux/suspend.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/clk.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/slab.h> | ||
23 | |||
24 | #include <asm/cacheflush.h> | ||
25 | |||
26 | #include <mach/hardware.h> | ||
27 | #include <mach/pm.h> | ||
28 | #include <mach/clock.h> | ||
29 | |||
30 | #define SRAM_VA IO_ADDRESS(PNX4008_IRAM_BASE) | ||
31 | |||
32 | static void *saved_sram; | ||
33 | |||
34 | static struct clk *pll4_clk; | ||
35 | |||
36 | static inline void pnx4008_standby(void) | ||
37 | { | ||
38 | void (*pnx4008_cpu_standby_ptr) (void); | ||
39 | |||
40 | local_irq_disable(); | ||
41 | local_fiq_disable(); | ||
42 | |||
43 | clk_disable(pll4_clk); | ||
44 | |||
45 | /*saving portion of SRAM to be used by suspend function. */ | ||
46 | memcpy(saved_sram, (void *)SRAM_VA, pnx4008_cpu_standby_sz); | ||
47 | |||
48 | /*make sure SRAM copy gets physically written into SDRAM. | ||
49 | SDRAM will be placed into self-refresh during power down */ | ||
50 | flush_cache_all(); | ||
51 | |||
52 | /*copy suspend function into SRAM */ | ||
53 | memcpy((void *)SRAM_VA, pnx4008_cpu_standby, pnx4008_cpu_standby_sz); | ||
54 | |||
55 | /*do suspend */ | ||
56 | pnx4008_cpu_standby_ptr = (void *)SRAM_VA; | ||
57 | pnx4008_cpu_standby_ptr(); | ||
58 | |||
59 | /*restoring portion of SRAM that was used by suspend function */ | ||
60 | memcpy((void *)SRAM_VA, saved_sram, pnx4008_cpu_standby_sz); | ||
61 | |||
62 | clk_enable(pll4_clk); | ||
63 | |||
64 | local_fiq_enable(); | ||
65 | local_irq_enable(); | ||
66 | } | ||
67 | |||
68 | static inline void pnx4008_suspend(void) | ||
69 | { | ||
70 | void (*pnx4008_cpu_suspend_ptr) (void); | ||
71 | |||
72 | local_irq_disable(); | ||
73 | local_fiq_disable(); | ||
74 | |||
75 | clk_disable(pll4_clk); | ||
76 | |||
77 | __raw_writel(0xffffffff, START_INT_RSR_REG(SE_PIN_BASE_INT)); | ||
78 | __raw_writel(0xffffffff, START_INT_RSR_REG(SE_INT_BASE_INT)); | ||
79 | |||
80 | /*saving portion of SRAM to be used by suspend function. */ | ||
81 | memcpy(saved_sram, (void *)SRAM_VA, pnx4008_cpu_suspend_sz); | ||
82 | |||
83 | /*make sure SRAM copy gets physically written into SDRAM. | ||
84 | SDRAM will be placed into self-refresh during power down */ | ||
85 | flush_cache_all(); | ||
86 | |||
87 | /*copy suspend function into SRAM */ | ||
88 | memcpy((void *)SRAM_VA, pnx4008_cpu_suspend, pnx4008_cpu_suspend_sz); | ||
89 | |||
90 | /*do suspend */ | ||
91 | pnx4008_cpu_suspend_ptr = (void *)SRAM_VA; | ||
92 | pnx4008_cpu_suspend_ptr(); | ||
93 | |||
94 | /*restoring portion of SRAM that was used by suspend function */ | ||
95 | memcpy((void *)SRAM_VA, saved_sram, pnx4008_cpu_suspend_sz); | ||
96 | |||
97 | clk_enable(pll4_clk); | ||
98 | |||
99 | local_fiq_enable(); | ||
100 | local_irq_enable(); | ||
101 | } | ||
102 | |||
103 | static int pnx4008_pm_enter(suspend_state_t state) | ||
104 | { | ||
105 | switch (state) { | ||
106 | case PM_SUSPEND_STANDBY: | ||
107 | pnx4008_standby(); | ||
108 | break; | ||
109 | case PM_SUSPEND_MEM: | ||
110 | pnx4008_suspend(); | ||
111 | break; | ||
112 | } | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | static int pnx4008_pm_valid(suspend_state_t state) | ||
117 | { | ||
118 | return (state == PM_SUSPEND_STANDBY) || | ||
119 | (state == PM_SUSPEND_MEM); | ||
120 | } | ||
121 | |||
122 | static const struct platform_suspend_ops pnx4008_pm_ops = { | ||
123 | .enter = pnx4008_pm_enter, | ||
124 | .valid = pnx4008_pm_valid, | ||
125 | }; | ||
126 | |||
127 | int __init pnx4008_pm_init(void) | ||
128 | { | ||
129 | u32 sram_size_to_allocate; | ||
130 | |||
131 | pll4_clk = clk_get(0, "ck_pll4"); | ||
132 | if (IS_ERR(pll4_clk)) { | ||
133 | printk(KERN_ERR | ||
134 | "PM Suspend cannot acquire ARM(PLL4) clock control\n"); | ||
135 | return PTR_ERR(pll4_clk); | ||
136 | } | ||
137 | |||
138 | if (pnx4008_cpu_standby_sz > pnx4008_cpu_suspend_sz) | ||
139 | sram_size_to_allocate = pnx4008_cpu_standby_sz; | ||
140 | else | ||
141 | sram_size_to_allocate = pnx4008_cpu_suspend_sz; | ||
142 | |||
143 | saved_sram = kmalloc(sram_size_to_allocate, GFP_ATOMIC); | ||
144 | if (!saved_sram) { | ||
145 | printk(KERN_ERR | ||
146 | "PM Suspend: cannot allocate memory to save portion of SRAM\n"); | ||
147 | clk_put(pll4_clk); | ||
148 | return -ENOMEM; | ||
149 | } | ||
150 | |||
151 | suspend_set_ops(&pnx4008_pm_ops); | ||
152 | return 0; | ||
153 | } | ||
diff --git a/arch/arm/mach-pnx4008/serial.c b/arch/arm/mach-pnx4008/serial.c deleted file mode 100644 index 374c138ac1ac..000000000000 --- a/arch/arm/mach-pnx4008/serial.c +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pnx4008/serial.c | ||
3 | * | ||
4 | * PNX4008 UART initialization | ||
5 | * | ||
6 | * Copyright: MontaVista Software Inc. (c) 2005 | ||
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 | #include <linux/kernel.h> | ||
13 | #include <linux/types.h> | ||
14 | #include <linux/io.h> | ||
15 | |||
16 | #include <mach/platform.h> | ||
17 | #include <mach/hardware.h> | ||
18 | |||
19 | #include <linux/serial_core.h> | ||
20 | #include <linux/serial_reg.h> | ||
21 | |||
22 | #include <mach/gpio-pnx4008.h> | ||
23 | #include <mach/clock.h> | ||
24 | |||
25 | #define UART_3 0 | ||
26 | #define UART_4 1 | ||
27 | #define UART_5 2 | ||
28 | #define UART_6 3 | ||
29 | #define UART_UNKNOWN (-1) | ||
30 | |||
31 | #define UART3_BASE_VA IO_ADDRESS(PNX4008_UART3_BASE) | ||
32 | #define UART4_BASE_VA IO_ADDRESS(PNX4008_UART4_BASE) | ||
33 | #define UART5_BASE_VA IO_ADDRESS(PNX4008_UART5_BASE) | ||
34 | #define UART6_BASE_VA IO_ADDRESS(PNX4008_UART6_BASE) | ||
35 | |||
36 | #define UART_FCR_OFFSET 8 | ||
37 | #define UART_FIFO_SIZE 64 | ||
38 | |||
39 | void pnx4008_uart_init(void) | ||
40 | { | ||
41 | u32 tmp; | ||
42 | int i = UART_FIFO_SIZE; | ||
43 | |||
44 | __raw_writel(0xC1, UART5_BASE_VA + UART_FCR_OFFSET); | ||
45 | __raw_writel(0xC1, UART3_BASE_VA + UART_FCR_OFFSET); | ||
46 | |||
47 | /* Send a NULL to fix the UART HW bug */ | ||
48 | __raw_writel(0x00, UART5_BASE_VA); | ||
49 | __raw_writel(0x00, UART3_BASE_VA); | ||
50 | |||
51 | while (i--) { | ||
52 | tmp = __raw_readl(UART5_BASE_VA); | ||
53 | tmp = __raw_readl(UART3_BASE_VA); | ||
54 | } | ||
55 | __raw_writel(0, UART5_BASE_VA + UART_FCR_OFFSET); | ||
56 | __raw_writel(0, UART3_BASE_VA + UART_FCR_OFFSET); | ||
57 | |||
58 | /* setup wakeup interrupt */ | ||
59 | start_int_set_rising_edge(SE_U3_RX_INT); | ||
60 | start_int_ack(SE_U3_RX_INT); | ||
61 | start_int_umask(SE_U3_RX_INT); | ||
62 | |||
63 | start_int_set_rising_edge(SE_U5_RX_INT); | ||
64 | start_int_ack(SE_U5_RX_INT); | ||
65 | start_int_umask(SE_U5_RX_INT); | ||
66 | } | ||
67 | |||
diff --git a/arch/arm/mach-pnx4008/sleep.S b/arch/arm/mach-pnx4008/sleep.S deleted file mode 100644 index f4eed495d295..000000000000 --- a/arch/arm/mach-pnx4008/sleep.S +++ /dev/null | |||
@@ -1,195 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pnx4008/sleep.S | ||
3 | * | ||
4 | * PNX4008 support for STOP mode and SDRAM self-refresh | ||
5 | * | ||
6 | * Authors: Dmitry Chigirev, Vitaly Wool <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/linkage.h> | ||
15 | #include <asm/assembler.h> | ||
16 | #include <mach/hardware.h> | ||
17 | |||
18 | #define PWRMAN_VA_BASE IO_ADDRESS(PNX4008_PWRMAN_BASE) | ||
19 | #define PWR_CTRL_REG_OFFS 0x44 | ||
20 | |||
21 | #define SDRAM_CFG_VA_BASE IO_ADDRESS(PNX4008_SDRAM_CFG_BASE) | ||
22 | #define MPMC_STATUS_REG_OFFS 0x4 | ||
23 | |||
24 | .text | ||
25 | |||
26 | ENTRY(pnx4008_cpu_suspend) | ||
27 | @this function should be entered in Direct run mode. | ||
28 | |||
29 | @ save registers on stack | ||
30 | stmfd sp!, {r0 - r6, lr} | ||
31 | |||
32 | @ setup Power Manager base address in r4 | ||
33 | @ and put it's value in r5 | ||
34 | mov r4, #(PWRMAN_VA_BASE & 0xff000000) | ||
35 | orr r4, r4, #(PWRMAN_VA_BASE & 0x00ff0000) | ||
36 | orr r4, r4, #(PWRMAN_VA_BASE & 0x0000ff00) | ||
37 | orr r4, r4, #(PWRMAN_VA_BASE & 0x000000ff) | ||
38 | ldr r5, [r4, #PWR_CTRL_REG_OFFS] | ||
39 | |||
40 | @ setup SDRAM controller base address in r2 | ||
41 | @ and put it's value in r3 | ||
42 | mov r2, #(SDRAM_CFG_VA_BASE & 0xff000000) | ||
43 | orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x00ff0000) | ||
44 | orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x0000ff00) | ||
45 | orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x000000ff) | ||
46 | ldr r3, [r2, #MPMC_STATUS_REG_OFFS] @extra read - HW bug workaround | ||
47 | |||
48 | @ clear SDRAM self-refresh bit latch | ||
49 | and r5, r5, #(~(1 << 8)) | ||
50 | @ clear SDRAM self-refresh bit | ||
51 | and r5, r5, #(~(1 << 9)) | ||
52 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
53 | |||
54 | @ do save current bit settings in r1 | ||
55 | mov r1, r5 | ||
56 | |||
57 | @ set SDRAM self-refresh bit | ||
58 | orr r5, r5, #(1 << 9) | ||
59 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
60 | |||
61 | @ set SDRAM self-refresh bit latch | ||
62 | orr r5, r5, #(1 << 8) | ||
63 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
64 | |||
65 | @ clear SDRAM self-refresh bit latch | ||
66 | and r5, r5, #(~(1 << 8)) | ||
67 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
68 | |||
69 | @ clear SDRAM self-refresh bit | ||
70 | and r5, r5, #(~(1 << 9)) | ||
71 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
72 | |||
73 | @ wait for SDRAM to get into self-refresh mode | ||
74 | 2: ldr r3, [r2, #MPMC_STATUS_REG_OFFS] | ||
75 | tst r3, #(1 << 2) | ||
76 | beq 2b | ||
77 | |||
78 | @ to prepare SDRAM to get out of self-refresh mode after wakeup | ||
79 | orr r5, r5, #(1 << 7) | ||
80 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
81 | |||
82 | @ do enter stop mode | ||
83 | orr r5, r5, #(1 << 0) | ||
84 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
85 | nop | ||
86 | nop | ||
87 | nop | ||
88 | nop | ||
89 | nop | ||
90 | nop | ||
91 | nop | ||
92 | nop | ||
93 | nop | ||
94 | |||
95 | @ sleeping now... | ||
96 | |||
97 | @ coming out of STOP mode into Direct Run mode | ||
98 | @ clear STOP mode and SDRAM self-refresh bits | ||
99 | str r1, [r4, #PWR_CTRL_REG_OFFS] | ||
100 | |||
101 | @ wait for SDRAM to get out self-refresh mode | ||
102 | 3: ldr r3, [r2, #MPMC_STATUS_REG_OFFS] | ||
103 | tst r3, #5 | ||
104 | bne 3b | ||
105 | |||
106 | @ restore regs and return | ||
107 | ldmfd sp!, {r0 - r6, pc} | ||
108 | |||
109 | ENTRY(pnx4008_cpu_suspend_sz) | ||
110 | .word . - pnx4008_cpu_suspend | ||
111 | |||
112 | ENTRY(pnx4008_cpu_standby) | ||
113 | @ save registers on stack | ||
114 | stmfd sp!, {r0 - r6, lr} | ||
115 | |||
116 | @ setup Power Manager base address in r4 | ||
117 | @ and put it's value in r5 | ||
118 | mov r4, #(PWRMAN_VA_BASE & 0xff000000) | ||
119 | orr r4, r4, #(PWRMAN_VA_BASE & 0x00ff0000) | ||
120 | orr r4, r4, #(PWRMAN_VA_BASE & 0x0000ff00) | ||
121 | orr r4, r4, #(PWRMAN_VA_BASE & 0x000000ff) | ||
122 | ldr r5, [r4, #PWR_CTRL_REG_OFFS] | ||
123 | |||
124 | @ setup SDRAM controller base address in r2 | ||
125 | @ and put it's value in r3 | ||
126 | mov r2, #(SDRAM_CFG_VA_BASE & 0xff000000) | ||
127 | orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x00ff0000) | ||
128 | orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x0000ff00) | ||
129 | orr r2, r2, #(SDRAM_CFG_VA_BASE & 0x000000ff) | ||
130 | ldr r3, [r2, #MPMC_STATUS_REG_OFFS] @extra read - HW bug workaround | ||
131 | |||
132 | @ clear SDRAM self-refresh bit latch | ||
133 | and r5, r5, #(~(1 << 8)) | ||
134 | @ clear SDRAM self-refresh bit | ||
135 | and r5, r5, #(~(1 << 9)) | ||
136 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
137 | |||
138 | @ do save current bit settings in r1 | ||
139 | mov r1, r5 | ||
140 | |||
141 | @ set SDRAM self-refresh bit | ||
142 | orr r5, r5, #(1 << 9) | ||
143 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
144 | |||
145 | @ set SDRAM self-refresh bit latch | ||
146 | orr r5, r5, #(1 << 8) | ||
147 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
148 | |||
149 | @ clear SDRAM self-refresh bit latch | ||
150 | and r5, r5, #(~(1 << 8)) | ||
151 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
152 | |||
153 | @ clear SDRAM self-refresh bit | ||
154 | and r5, r5, #(~(1 << 9)) | ||
155 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
156 | |||
157 | @ wait for SDRAM to get into self-refresh mode | ||
158 | 2: ldr r3, [r2, #MPMC_STATUS_REG_OFFS] | ||
159 | tst r3, #(1 << 2) | ||
160 | beq 2b | ||
161 | |||
162 | @ set 'get out of self-refresh mode after wakeup' bit | ||
163 | orr r5, r5, #(1 << 7) | ||
164 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
165 | |||
166 | mcr p15, 0, r0, c7, c0, 4 @ kinda sleeping now... | ||
167 | |||
168 | @ set SDRAM self-refresh bit latch | ||
169 | orr r5, r5, #(1 << 8) | ||
170 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
171 | |||
172 | @ clear SDRAM self-refresh bit latch | ||
173 | and r5, r5, #(~(1 << 8)) | ||
174 | str r5, [r4, #PWR_CTRL_REG_OFFS] | ||
175 | |||
176 | @ wait for SDRAM to get out self-refresh mode | ||
177 | 3: ldr r3, [r2, #MPMC_STATUS_REG_OFFS] | ||
178 | tst r3, #5 | ||
179 | bne 3b | ||
180 | |||
181 | @ restore regs and return | ||
182 | ldmfd sp!, {r0 - r6, pc} | ||
183 | |||
184 | ENTRY(pnx4008_cpu_standby_sz) | ||
185 | .word . - pnx4008_cpu_standby | ||
186 | |||
187 | ENTRY(pnx4008_cache_clean_invalidate) | ||
188 | stmfd sp!, {r0 - r6, lr} | ||
189 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | ||
190 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache | ||
191 | #else | ||
192 | 1: mrc p15, 0, r15, c7, c14, 3 @ test,clean,invalidate | ||
193 | bne 1b | ||
194 | #endif | ||
195 | ldmfd sp!, {r0 - r6, pc} | ||
diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c deleted file mode 100644 index 0cfe8af3d3be..000000000000 --- a/arch/arm/mach-pnx4008/time.c +++ /dev/null | |||
@@ -1,134 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/time.c | ||
3 | * | ||
4 | * PNX4008 Timers | ||
5 | * | ||
6 | * Authors: Vitaly Wool, Dmitry Chigirev, Grigory Tolstolytkin <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/sched.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/module.h> | ||
21 | #include <linux/kallsyms.h> | ||
22 | #include <linux/time.h> | ||
23 | #include <linux/timex.h> | ||
24 | #include <linux/irq.h> | ||
25 | #include <linux/io.h> | ||
26 | |||
27 | #include <mach/hardware.h> | ||
28 | #include <asm/leds.h> | ||
29 | #include <asm/mach/time.h> | ||
30 | #include <asm/errno.h> | ||
31 | |||
32 | #include "time.h" | ||
33 | |||
34 | /*! Note: all timers are UPCOUNTING */ | ||
35 | |||
36 | /*! | ||
37 | * Returns number of us since last clock interrupt. Note that interrupts | ||
38 | * will have been disabled by do_gettimeoffset() | ||
39 | */ | ||
40 | static unsigned long pnx4008_gettimeoffset(void) | ||
41 | { | ||
42 | u32 ticks_to_match = | ||
43 | __raw_readl(HSTIM_MATCH0) - __raw_readl(HSTIM_COUNTER); | ||
44 | u32 elapsed = LATCH - ticks_to_match; | ||
45 | return (elapsed * (tick_nsec / 1000)) / LATCH; | ||
46 | } | ||
47 | |||
48 | /*! | ||
49 | * IRQ handler for the timer | ||
50 | */ | ||
51 | static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id) | ||
52 | { | ||
53 | if (__raw_readl(HSTIM_INT) & MATCH0_INT) { | ||
54 | |||
55 | do { | ||
56 | timer_tick(); | ||
57 | |||
58 | /* | ||
59 | * this algorithm takes care of possible delay | ||
60 | * for this interrupt handling longer than a normal | ||
61 | * timer period | ||
62 | */ | ||
63 | __raw_writel(__raw_readl(HSTIM_MATCH0) + LATCH, | ||
64 | HSTIM_MATCH0); | ||
65 | __raw_writel(MATCH0_INT, HSTIM_INT); /* clear interrupt */ | ||
66 | |||
67 | /* | ||
68 | * The goal is to keep incrementing HSTIM_MATCH0 | ||
69 | * register until HSTIM_MATCH0 indicates time after | ||
70 | * what HSTIM_COUNTER indicates. | ||
71 | */ | ||
72 | } while ((signed) | ||
73 | (__raw_readl(HSTIM_MATCH0) - | ||
74 | __raw_readl(HSTIM_COUNTER)) < 0); | ||
75 | } | ||
76 | |||
77 | return IRQ_HANDLED; | ||
78 | } | ||
79 | |||
80 | static struct irqaction pnx4008_timer_irq = { | ||
81 | .name = "PNX4008 Tick Timer", | ||
82 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
83 | .handler = pnx4008_timer_interrupt | ||
84 | }; | ||
85 | |||
86 | /*! | ||
87 | * Set up timer and timer interrupt. | ||
88 | */ | ||
89 | static __init void pnx4008_setup_timer(void) | ||
90 | { | ||
91 | __raw_writel(RESET_COUNT, MSTIM_CTRL); | ||
92 | while (__raw_readl(MSTIM_COUNTER)) ; /* wait for reset to complete. 100% guarantee event */ | ||
93 | __raw_writel(0, MSTIM_CTRL); /* stop the timer */ | ||
94 | __raw_writel(0, MSTIM_MCTRL); | ||
95 | |||
96 | __raw_writel(RESET_COUNT, HSTIM_CTRL); | ||
97 | while (__raw_readl(HSTIM_COUNTER)) ; /* wait for reset to complete. 100% guarantee event */ | ||
98 | __raw_writel(0, HSTIM_CTRL); | ||
99 | __raw_writel(0, HSTIM_MCTRL); | ||
100 | __raw_writel(0, HSTIM_CCR); | ||
101 | __raw_writel(12, HSTIM_PMATCH); /* scale down to 1 MHZ */ | ||
102 | __raw_writel(LATCH, HSTIM_MATCH0); | ||
103 | __raw_writel(MR0_INT, HSTIM_MCTRL); | ||
104 | |||
105 | setup_irq(HSTIMER_INT, &pnx4008_timer_irq); | ||
106 | |||
107 | __raw_writel(COUNT_ENAB | DEBUG_EN, HSTIM_CTRL); /*start timer, stop when JTAG active */ | ||
108 | } | ||
109 | |||
110 | /* Timer Clock Control in PM register */ | ||
111 | #define TIMCLK_CTRL_REG IO_ADDRESS((PNX4008_PWRMAN_BASE + 0xBC)) | ||
112 | #define WATCHDOG_CLK_EN 1 | ||
113 | #define TIMER_CLK_EN 2 /* HS and MS timers? */ | ||
114 | |||
115 | static u32 timclk_ctrl_reg_save; | ||
116 | |||
117 | void pnx4008_timer_suspend(void) | ||
118 | { | ||
119 | timclk_ctrl_reg_save = __raw_readl(TIMCLK_CTRL_REG); | ||
120 | __raw_writel(0, TIMCLK_CTRL_REG); /* disable timers */ | ||
121 | } | ||
122 | |||
123 | void pnx4008_timer_resume(void) | ||
124 | { | ||
125 | __raw_writel(timclk_ctrl_reg_save, TIMCLK_CTRL_REG); /* enable timers */ | ||
126 | } | ||
127 | |||
128 | struct sys_timer pnx4008_timer = { | ||
129 | .init = pnx4008_setup_timer, | ||
130 | .offset = pnx4008_gettimeoffset, | ||
131 | .suspend = pnx4008_timer_suspend, | ||
132 | .resume = pnx4008_timer_resume, | ||
133 | }; | ||
134 | |||
diff --git a/arch/arm/mach-pnx4008/time.h b/arch/arm/mach-pnx4008/time.h deleted file mode 100644 index 75e88c570aa7..000000000000 --- a/arch/arm/mach-pnx4008/time.h +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pnx4008/include/mach/timex.h | ||
3 | * | ||
4 | * PNX4008 timers header file | ||
5 | * | ||
6 | * Author: Dmitry Chigirev <source@mvista.com> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. This file is licensed under | ||
9 | * the terms of the GNU General Public License version 2. This program | ||
10 | * is licensed "as is" without any warranty of any kind, whether express | ||
11 | * or implied. | ||
12 | */ | ||
13 | #ifndef PNX_TIME_H | ||
14 | #define PNX_TIME_H | ||
15 | |||
16 | #include <linux/io.h> | ||
17 | #include <mach/hardware.h> | ||
18 | |||
19 | #define TICKS2USECS(x) (x) | ||
20 | |||
21 | /* MilliSecond Timer - Chapter 21 Page 202 */ | ||
22 | |||
23 | #define MSTIM_INT IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x0)) | ||
24 | #define MSTIM_CTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x4)) | ||
25 | #define MSTIM_COUNTER IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x8)) | ||
26 | #define MSTIM_MCTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x14)) | ||
27 | #define MSTIM_MATCH0 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x18)) | ||
28 | #define MSTIM_MATCH1 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x1c)) | ||
29 | |||
30 | /* High Speed Timer - Chpater 22, Page 205 */ | ||
31 | |||
32 | #define HSTIM_INT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x0)) | ||
33 | #define HSTIM_CTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x4)) | ||
34 | #define HSTIM_COUNTER IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x8)) | ||
35 | #define HSTIM_PMATCH IO_ADDRESS((PNX4008_HSTIMER_BASE + 0xC)) | ||
36 | #define HSTIM_PCOUNT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x10)) | ||
37 | #define HSTIM_MCTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x14)) | ||
38 | #define HSTIM_MATCH0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x18)) | ||
39 | #define HSTIM_MATCH1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x1c)) | ||
40 | #define HSTIM_MATCH2 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x20)) | ||
41 | #define HSTIM_CCR IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x28)) | ||
42 | #define HSTIM_CR0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x2C)) | ||
43 | #define HSTIM_CR1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x30)) | ||
44 | |||
45 | /* IMPORTANT: both timers are UPCOUNTING */ | ||
46 | |||
47 | /* xSTIM_MCTRL bit definitions */ | ||
48 | #define MR0_INT 1 | ||
49 | #define RESET_COUNT0 (1<<1) | ||
50 | #define STOP_COUNT0 (1<<2) | ||
51 | #define MR1_INT (1<<3) | ||
52 | #define RESET_COUNT1 (1<<4) | ||
53 | #define STOP_COUNT1 (1<<5) | ||
54 | #define MR2_INT (1<<6) | ||
55 | #define RESET_COUNT2 (1<<7) | ||
56 | #define STOP_COUNT2 (1<<8) | ||
57 | |||
58 | /* xSTIM_CTRL bit definitions */ | ||
59 | #define COUNT_ENAB 1 | ||
60 | #define RESET_COUNT (1<<1) | ||
61 | #define DEBUG_EN (1<<2) | ||
62 | |||
63 | /* xSTIM_INT bit definitions */ | ||
64 | #define MATCH0_INT 1 | ||
65 | #define MATCH1_INT (1<<1) | ||
66 | #define MATCH2_INT (1<<2) | ||
67 | #define RTC_TICK0 (1<<4) | ||
68 | #define RTC_TICK1 (1<<5) | ||
69 | |||
70 | #endif | ||
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig new file mode 100644 index 000000000000..41fc85327673 --- /dev/null +++ b/arch/arm/mach-prima2/Kconfig | |||
@@ -0,0 +1,19 @@ | |||
1 | if ARCH_SIRF | ||
2 | |||
3 | menu "CSR SiRF primaII/Marco/Polo Specific Features" | ||
4 | |||
5 | config ARCH_PRIMA2 | ||
6 | bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" | ||
7 | default y | ||
8 | select CPU_V7 | ||
9 | select ZONE_DMA | ||
10 | select SIRF_IRQ | ||
11 | help | ||
12 | Support for CSR SiRFSoC ARM Cortex A9 Platform | ||
13 | |||
14 | endmenu | ||
15 | |||
16 | config SIRF_IRQ | ||
17 | bool | ||
18 | |||
19 | endif | ||
diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile index 841847d56032..fc9ce22e2b5a 100644 --- a/arch/arm/mach-prima2/Makefile +++ b/arch/arm/mach-prima2/Makefile | |||
@@ -1,8 +1,8 @@ | |||
1 | obj-y := timer.o | 1 | obj-y := timer.o |
2 | obj-y += irq.o | ||
3 | obj-y += rstc.o | 2 | obj-y += rstc.o |
4 | obj-y += prima2.o | 3 | obj-y += common.o |
5 | obj-y += rtciobrg.o | 4 | obj-y += rtciobrg.o |
6 | obj-$(CONFIG_DEBUG_LL) += lluart.o | 5 | obj-$(CONFIG_DEBUG_LL) += lluart.o |
7 | obj-$(CONFIG_CACHE_L2X0) += l2x0.o | 6 | obj-$(CONFIG_CACHE_L2X0) += l2x0.o |
8 | obj-$(CONFIG_SUSPEND) += pm.o sleep.o | 7 | obj-$(CONFIG_SUSPEND) += pm.o sleep.o |
8 | obj-$(CONFIG_SIRF_IRQ) += irq.o | ||
diff --git a/arch/arm/mach-prima2/prima2.c b/arch/arm/mach-prima2/common.c index e9a17aebe0d6..f25a54194639 100644 --- a/arch/arm/mach-prima2/prima2.c +++ b/arch/arm/mach-prima2/common.c | |||
@@ -30,20 +30,21 @@ void __init sirfsoc_init_late(void) | |||
30 | sirfsoc_pm_init(); | 30 | sirfsoc_pm_init(); |
31 | } | 31 | } |
32 | 32 | ||
33 | static const char *prima2cb_dt_match[] __initdata = { | 33 | #ifdef CONFIG_ARCH_PRIMA2 |
34 | "sirf,prima2-cb", | 34 | static const char *prima2_dt_match[] __initdata = { |
35 | "sirf,prima2", | ||
35 | NULL | 36 | NULL |
36 | }; | 37 | }; |
37 | 38 | ||
38 | MACHINE_START(PRIMA2_EVB, "prima2cb") | 39 | DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)") |
39 | /* Maintainer: Barry Song <baohua.song@csr.com> */ | 40 | /* Maintainer: Barry Song <baohua.song@csr.com> */ |
40 | .atag_offset = 0x100, | ||
41 | .map_io = sirfsoc_map_lluart, | 41 | .map_io = sirfsoc_map_lluart, |
42 | .init_irq = sirfsoc_of_irq_init, | 42 | .init_irq = sirfsoc_of_irq_init, |
43 | .timer = &sirfsoc_timer, | 43 | .timer = &sirfsoc_timer, |
44 | .dma_zone_size = SZ_256M, | 44 | .dma_zone_size = SZ_256M, |
45 | .init_machine = sirfsoc_mach_init, | 45 | .init_machine = sirfsoc_mach_init, |
46 | .init_late = sirfsoc_init_late, | 46 | .init_late = sirfsoc_init_late, |
47 | .dt_compat = prima2cb_dt_match, | 47 | .dt_compat = prima2_dt_match, |
48 | .restart = sirfsoc_restart, | 48 | .restart = sirfsoc_restart, |
49 | MACHINE_END | 49 | MACHINE_END |
50 | #endif | ||
diff --git a/arch/arm/mach-prima2/include/mach/uncompress.h b/arch/arm/mach-prima2/include/mach/uncompress.h index 83125c6a30b3..0c898fcf909c 100644 --- a/arch/arm/mach-prima2/include/mach/uncompress.h +++ b/arch/arm/mach-prima2/include/mach/uncompress.h | |||
@@ -25,11 +25,11 @@ static __inline__ void putc(char c) | |||
25 | * during kernel decompression, all mappings are flat: | 25 | * during kernel decompression, all mappings are flat: |
26 | * virt_addr == phys_addr | 26 | * virt_addr == phys_addr |
27 | */ | 27 | */ |
28 | while (__raw_readl(SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS) | 28 | while (__raw_readl((void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS) |
29 | & SIRFSOC_UART1_TXFIFO_FULL) | 29 | & SIRFSOC_UART1_TXFIFO_FULL) |
30 | barrier(); | 30 | barrier(); |
31 | 31 | ||
32 | __raw_writel(c, SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_DATA); | 32 | __raw_writel(c, (void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_DATA); |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline void flush(void) | 35 | static inline void flush(void) |
diff --git a/arch/arm/mach-prima2/irq.c b/arch/arm/mach-prima2/irq.c index a7b9415d30f8..7dee9176e77a 100644 --- a/arch/arm/mach-prima2/irq.c +++ b/arch/arm/mach-prima2/irq.c | |||
@@ -63,7 +63,7 @@ void __init sirfsoc_of_irq_init(void) | |||
63 | 63 | ||
64 | np = of_find_matching_node(NULL, intc_ids); | 64 | np = of_find_matching_node(NULL, intc_ids); |
65 | if (!np) | 65 | if (!np) |
66 | panic("unable to find compatible intc node in dtb\n"); | 66 | return; |
67 | 67 | ||
68 | sirfsoc_intc_base = of_iomap(np, 0); | 68 | sirfsoc_intc_base = of_iomap(np, 0); |
69 | if (!sirfsoc_intc_base) | 69 | if (!sirfsoc_intc_base) |
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 166eee5b8a70..c1f3b1279d97 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <linux/spi/pxa2xx_spi.h> | 6 | #include <linux/spi/pxa2xx_spi.h> |
7 | #include <linux/i2c/pxa-i2c.h> | 7 | #include <linux/i2c/pxa-i2c.h> |
8 | 8 | ||
9 | #include <asm/pmu.h> | ||
10 | #include <mach/udc.h> | 9 | #include <mach/udc.h> |
11 | #include <mach/pxa3xx-u2d.h> | 10 | #include <mach/pxa3xx-u2d.h> |
12 | #include <mach/pxafb.h> | 11 | #include <mach/pxafb.h> |
@@ -42,7 +41,7 @@ static struct resource pxa_resource_pmu = { | |||
42 | 41 | ||
43 | struct platform_device pxa_device_pmu = { | 42 | struct platform_device pxa_device_pmu = { |
44 | .name = "arm-pmu", | 43 | .name = "arm-pmu", |
45 | .id = ARM_PMU_DEVICE_CPU, | 44 | .id = -1, |
46 | .resource = &pxa_resource_pmu, | 45 | .resource = &pxa_resource_pmu, |
47 | .num_resources = 1, | 46 | .num_resources = 1, |
48 | }; | 47 | }; |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index a33e33b76733..ce7747692c8b 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
34 | #include <asm/leds.h> | 34 | #include <asm/leds.h> |
35 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
36 | #include <asm/pmu.h> | ||
37 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
38 | #include <asm/hardware/gic.h> | 37 | #include <asm/hardware/gic.h> |
39 | #include <asm/hardware/cache-l2x0.h> | 38 | #include <asm/hardware/cache-l2x0.h> |
@@ -298,7 +297,7 @@ static struct resource pmu_resources[] = { | |||
298 | 297 | ||
299 | static struct platform_device pmu_device = { | 298 | static struct platform_device pmu_device = { |
300 | .name = "arm-pmu", | 299 | .name = "arm-pmu", |
301 | .id = ARM_PMU_DEVICE_CPU, | 300 | .id = -1, |
302 | .num_resources = ARRAY_SIZE(pmu_resources), | 301 | .num_resources = ARRAY_SIZE(pmu_resources), |
303 | .resource = pmu_resources, | 302 | .resource = pmu_resources, |
304 | }; | 303 | }; |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index f0298cbc203e..e21711d72ee2 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
36 | #include <asm/leds.h> | 36 | #include <asm/leds.h> |
37 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
38 | #include <asm/pmu.h> | ||
39 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
40 | #include <asm/hardware/gic.h> | 39 | #include <asm/hardware/gic.h> |
41 | #include <asm/hardware/cache-l2x0.h> | 40 | #include <asm/hardware/cache-l2x0.h> |
@@ -281,7 +280,7 @@ static struct resource pmu_resource = { | |||
281 | 280 | ||
282 | static struct platform_device pmu_device = { | 281 | static struct platform_device pmu_device = { |
283 | .name = "arm-pmu", | 282 | .name = "arm-pmu", |
284 | .id = ARM_PMU_DEVICE_CPU, | 283 | .id = -1, |
285 | .num_resources = 1, | 284 | .num_resources = 1, |
286 | .resource = &pmu_resource, | 285 | .resource = &pmu_resource, |
287 | }; | 286 | }; |
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 1f019f76f7b5..b442fb276d57 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
34 | #include <asm/leds.h> | 34 | #include <asm/leds.h> |
35 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
36 | #include <asm/pmu.h> | ||
37 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
38 | #include <asm/hardware/gic.h> | 37 | #include <asm/hardware/gic.h> |
39 | #include <asm/hardware/cache-l2x0.h> | 38 | #include <asm/hardware/cache-l2x0.h> |
@@ -264,7 +263,7 @@ static struct resource pmu_resources[] = { | |||
264 | 263 | ||
265 | static struct platform_device pmu_device = { | 264 | static struct platform_device pmu_device = { |
266 | .name = "arm-pmu", | 265 | .name = "arm-pmu", |
267 | .id = ARM_PMU_DEVICE_CPU, | 266 | .id = -1, |
268 | .num_resources = ARRAY_SIZE(pmu_resources), | 267 | .num_resources = ARRAY_SIZE(pmu_resources), |
269 | .resource = pmu_resources, | 268 | .resource = pmu_resources, |
270 | }; | 269 | }; |
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index 5032775dbfee..1435cd863965 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
33 | #include <asm/leds.h> | 33 | #include <asm/leds.h> |
34 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
35 | #include <asm/pmu.h> | ||
36 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
37 | #include <asm/hardware/gic.h> | 36 | #include <asm/hardware/gic.h> |
38 | 37 | ||
@@ -242,7 +241,7 @@ static struct resource pmu_resource = { | |||
242 | 241 | ||
243 | static struct platform_device pmu_device = { | 242 | static struct platform_device pmu_device = { |
244 | .name = "arm-pmu", | 243 | .name = "arm-pmu", |
245 | .id = ARM_PMU_DEVICE_CPU, | 244 | .id = -1, |
246 | .num_resources = 1, | 245 | .num_resources = 1, |
247 | .resource = &pmu_resource, | 246 | .resource = &pmu_resource, |
248 | }; | 247 | }; |
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index de64ba0ddb95..5d2c8bebb069 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
32 | #include <asm/leds.h> | 32 | #include <asm/leds.h> |
33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
34 | #include <asm/pmu.h> | ||
35 | #include <asm/smp_twd.h> | 34 | #include <asm/smp_twd.h> |
36 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
37 | #include <asm/hardware/gic.h> | 36 | #include <asm/hardware/gic.h> |
@@ -281,7 +280,7 @@ static struct resource pmu_resources[] = { | |||
281 | 280 | ||
282 | static struct platform_device pmu_device = { | 281 | static struct platform_device pmu_device = { |
283 | .name = "arm-pmu", | 282 | .name = "arm-pmu", |
284 | .id = ARM_PMU_DEVICE_CPU, | 283 | .id = -1, |
285 | .num_resources = ARRAY_SIZE(pmu_resources), | 284 | .num_resources = ARRAY_SIZE(pmu_resources), |
286 | .resource = pmu_resources, | 285 | .resource = pmu_resources, |
287 | }; | 286 | }; |
diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c index a5eeb62ce1c2..57aee916bdb1 100644 --- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c +++ b/arch/arm/mach-s3c24xx/h1940-bluetooth.c | |||
@@ -138,19 +138,7 @@ static struct platform_driver h1940bt_driver = { | |||
138 | .remove = h1940bt_remove, | 138 | .remove = h1940bt_remove, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | 141 | module_platform_driver(h1940bt_driver); | |
142 | static int __init h1940bt_init(void) | ||
143 | { | ||
144 | return platform_driver_register(&h1940bt_driver); | ||
145 | } | ||
146 | |||
147 | static void __exit h1940bt_exit(void) | ||
148 | { | ||
149 | platform_driver_unregister(&h1940bt_driver); | ||
150 | } | ||
151 | |||
152 | module_init(h1940bt_init); | ||
153 | module_exit(h1940bt_exit); | ||
154 | 142 | ||
155 | MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); | 143 | MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); |
156 | MODULE_DESCRIPTION("Driver for the iPAQ H1940 bluetooth chip"); | 144 | MODULE_DESCRIPTION("Driver for the iPAQ H1940 bluetooth chip"); |
diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c index 5a7d0c0010f7..0c7ed7a2b0cd 100644 --- a/arch/arm/mach-s3c24xx/mach-anubis.c +++ b/arch/arm/mach-s3c24xx/mach-anubis.c | |||
@@ -424,7 +424,8 @@ static void __init anubis_map_io(void) | |||
424 | anubis_nand_sets[0].nr_partitions = ARRAY_SIZE(anubis_default_nand_part_large); | 424 | anubis_nand_sets[0].nr_partitions = ARRAY_SIZE(anubis_default_nand_part_large); |
425 | } else { | 425 | } else { |
426 | /* ensure that the GPIO is setup */ | 426 | /* ensure that the GPIO is setup */ |
427 | s3c2410_gpio_setpin(S3C2410_GPA(0), 1); | 427 | gpio_request_one(S3C2410_GPA(0), GPIOF_OUT_INIT_HIGH, NULL); |
428 | gpio_free(S3C2410_GPA(0)); | ||
428 | } | 429 | } |
429 | } | 430 | } |
430 | 431 | ||
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c index ae73ba34ecc6..471334715c37 100644 --- a/arch/arm/mach-s3c24xx/mach-jive.c +++ b/arch/arm/mach-s3c24xx/mach-jive.c | |||
@@ -512,8 +512,8 @@ static void jive_power_off(void) | |||
512 | { | 512 | { |
513 | printk(KERN_INFO "powering system down...\n"); | 513 | printk(KERN_INFO "powering system down...\n"); |
514 | 514 | ||
515 | s3c2410_gpio_setpin(S3C2410_GPC(5), 1); | 515 | gpio_request_one(S3C2410_GPC(5), GPIOF_OUT_INIT_HIGH, NULL); |
516 | s3c_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT); | 516 | gpio_free(S3C2410_GPC(5)); |
517 | } | 517 | } |
518 | 518 | ||
519 | static void __init jive_machine_init(void) | 519 | static void __init jive_machine_init(void) |
@@ -623,11 +623,11 @@ static void __init jive_machine_init(void) | |||
623 | gpio_request(S3C2410_GPB(7), "jive spi"); | 623 | gpio_request(S3C2410_GPB(7), "jive spi"); |
624 | gpio_direction_output(S3C2410_GPB(7), 1); | 624 | gpio_direction_output(S3C2410_GPB(7), 1); |
625 | 625 | ||
626 | s3c2410_gpio_setpin(S3C2410_GPB(6), 0); | 626 | gpio_request_one(S3C2410_GPB(6), GPIOF_OUT_INIT_LOW, NULL); |
627 | s3c_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT); | 627 | gpio_free(S3C2410_GPB(6)); |
628 | 628 | ||
629 | s3c2410_gpio_setpin(S3C2410_GPG(8), 1); | 629 | gpio_request_one(S3C2410_GPG(8), GPIOF_OUT_INIT_HIGH, NULL); |
630 | s3c_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT); | 630 | gpio_free(S3C2410_GPG(8)); |
631 | 631 | ||
632 | /* initialise the WM8750 spi */ | 632 | /* initialise the WM8750 spi */ |
633 | 633 | ||
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c index bd6d2525debe..734bbfe5ea22 100644 --- a/arch/arm/mach-s3c24xx/mach-mini2440.c +++ b/arch/arm/mach-s3c24xx/mach-mini2440.c | |||
@@ -638,9 +638,9 @@ static void __init mini2440_init(void) | |||
638 | gpio_free(S3C2410_GPG(4)); | 638 | gpio_free(S3C2410_GPG(4)); |
639 | 639 | ||
640 | /* remove pullup on optional PWM backlight -- unused on 3.5 and 7"s */ | 640 | /* remove pullup on optional PWM backlight -- unused on 3.5 and 7"s */ |
641 | gpio_request_one(S3C2410_GPB(1), GPIOF_IN, NULL); | ||
641 | s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP); | 642 | s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP); |
642 | s3c2410_gpio_setpin(S3C2410_GPB(1), 0); | 643 | gpio_free(S3C2410_GPB(1)); |
643 | s3c_gpio_cfgpin(S3C2410_GPB(1), S3C2410_GPIO_INPUT); | ||
644 | 644 | ||
645 | /* mark the key as input, without pullups (there is one on the board) */ | 645 | /* mark the key as input, without pullups (there is one on the board) */ |
646 | for (i = 0; i < ARRAY_SIZE(mini2440_buttons); i++) { | 646 | for (i = 0; i < ARRAY_SIZE(mini2440_buttons); i++) { |
diff --git a/arch/arm/mach-s3c24xx/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c index 5c05ba1c330f..a71a551094ef 100644 --- a/arch/arm/mach-s3c24xx/mach-nexcoder.c +++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c | |||
@@ -119,17 +119,17 @@ static struct platform_device *nexcoder_devices[] __initdata = { | |||
119 | 119 | ||
120 | static void __init nexcoder_sensorboard_init(void) | 120 | static void __init nexcoder_sensorboard_init(void) |
121 | { | 121 | { |
122 | // Initialize SCCB bus | 122 | /* Initialize SCCB bus */ |
123 | s3c2410_gpio_setpin(S3C2410_GPE(14), 1); // IICSCL | 123 | gpio_request_one(S3C2410_GPE(14), GPIOF_OUT_INIT_HIGH, NULL); |
124 | s3c_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPIO_OUTPUT); | 124 | gpio_free(S3C2410_GPE(14)); /* IICSCL */ |
125 | s3c2410_gpio_setpin(S3C2410_GPE(15), 1); // IICSDA | 125 | gpio_request_one(S3C2410_GPE(15), GPIOF_OUT_INIT_HIGH, NULL); |
126 | s3c_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPIO_OUTPUT); | 126 | gpio_free(S3C2410_GPE(15)); /* IICSDA */ |
127 | 127 | ||
128 | // Power up the sensor board | 128 | /* Power up the sensor board */ |
129 | s3c2410_gpio_setpin(S3C2410_GPF(1), 1); | 129 | gpio_request_one(S3C2410_GPF(1), GPIOF_OUT_INIT_HIGH, NULL); |
130 | s3c_gpio_cfgpin(S3C2410_GPF(1), S3C2410_GPIO_OUTPUT); // CAM_GPIO7 => nLDO_PWRDN | 130 | gpio_free(S3C2410_GPF(1)); /* CAM_GPIO7 => nLDO_PWRDN */ |
131 | s3c2410_gpio_setpin(S3C2410_GPF(2), 0); | 131 | gpio_request_one(S3C2410_GPF(2), GPIOF_OUT_INIT_LOW, NULL); |
132 | s3c_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); // CAM_GPIO6 => CAM_PWRDN | 132 | gpio_free(S3C2410_GPF(2)); /* CAM_GPIO6 => CAM_PWRDN */ |
133 | } | 133 | } |
134 | 134 | ||
135 | static void __init nexcoder_map_io(void) | 135 | static void __init nexcoder_map_io(void) |
diff --git a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c index ad2792dfbee1..5876c6ba7500 100644 --- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c +++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c | |||
@@ -175,18 +175,7 @@ static struct platform_driver osiris_dvs_driver = { | |||
175 | }, | 175 | }, |
176 | }; | 176 | }; |
177 | 177 | ||
178 | static int __init osiris_dvs_init(void) | 178 | module_platform_driver(osiris_dvs_driver); |
179 | { | ||
180 | return platform_driver_register(&osiris_dvs_driver); | ||
181 | } | ||
182 | |||
183 | static void __exit osiris_dvs_exit(void) | ||
184 | { | ||
185 | platform_driver_unregister(&osiris_dvs_driver); | ||
186 | } | ||
187 | |||
188 | module_init(osiris_dvs_init); | ||
189 | module_exit(osiris_dvs_exit); | ||
190 | 179 | ||
191 | MODULE_DESCRIPTION("Simtec OSIRIS DVS support"); | 180 | MODULE_DESCRIPTION("Simtec OSIRIS DVS support"); |
192 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | 181 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); |
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c index 95d077255024..c0fb3c1bc548 100644 --- a/arch/arm/mach-s3c24xx/mach-osiris.c +++ b/arch/arm/mach-s3c24xx/mach-osiris.c | |||
@@ -274,8 +274,8 @@ static int osiris_pm_suspend(void) | |||
274 | __raw_writeb(tmp, OSIRIS_VA_CTRL0); | 274 | __raw_writeb(tmp, OSIRIS_VA_CTRL0); |
275 | 275 | ||
276 | /* ensure that an nRESET is not generated on resume. */ | 276 | /* ensure that an nRESET is not generated on resume. */ |
277 | s3c2410_gpio_setpin(S3C2410_GPA(21), 1); | 277 | gpio_request_one(S3C2410_GPA(21), GPIOF_OUT_INIT_HIGH, NULL); |
278 | s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT); | 278 | gpio_free(S3C2410_GPA(21)); |
279 | 279 | ||
280 | return 0; | 280 | return 0; |
281 | } | 281 | } |
@@ -396,7 +396,8 @@ static void __init osiris_map_io(void) | |||
396 | osiris_nand_sets[0].nr_partitions = ARRAY_SIZE(osiris_default_nand_part_large); | 396 | osiris_nand_sets[0].nr_partitions = ARRAY_SIZE(osiris_default_nand_part_large); |
397 | } else { | 397 | } else { |
398 | /* write-protect line to the NAND */ | 398 | /* write-protect line to the NAND */ |
399 | s3c2410_gpio_setpin(S3C2410_GPA(0), 1); | 399 | gpio_request_one(S3C2410_GPA(0), GPIOF_OUT_INIT_HIGH, NULL); |
400 | gpio_free(S3C2410_GPA(0)); | ||
400 | } | 401 | } |
401 | 402 | ||
402 | /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */ | 403 | /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */ |
diff --git a/arch/arm/mach-sa1100/include/mach/simpad.h b/arch/arm/mach-sa1100/include/mach/simpad.h index cdea671e8931..ac2ea767215d 100644 --- a/arch/arm/mach-sa1100/include/mach/simpad.h +++ b/arch/arm/mach-sa1100/include/mach/simpad.h | |||
@@ -87,7 +87,7 @@ | |||
87 | #define SIMPAD_CS3_PCMCIA_SHORT (SIMPAD_CS3_GPIO_BASE + 22) | 87 | #define SIMPAD_CS3_PCMCIA_SHORT (SIMPAD_CS3_GPIO_BASE + 22) |
88 | #define SIMPAD_CS3_GPIO_23 (SIMPAD_CS3_GPIO_BASE + 23) | 88 | #define SIMPAD_CS3_GPIO_23 (SIMPAD_CS3_GPIO_BASE + 23) |
89 | 89 | ||
90 | #define CS3_BASE 0xf1000000 | 90 | #define CS3_BASE IOMEM(0xf1000000) |
91 | 91 | ||
92 | long simpad_get_cs3_ro(void); | 92 | long simpad_get_cs3_ro(void); |
93 | long simpad_get_cs3_shadow(void); | 93 | long simpad_get_cs3_shadow(void); |
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c index fbd53593be54..6ca92d0d32b2 100644 --- a/arch/arm/mach-sa1100/simpad.c +++ b/arch/arm/mach-sa1100/simpad.c | |||
@@ -124,7 +124,7 @@ static struct map_desc simpad_io_desc[] __initdata = { | |||
124 | .length = 0x00800000, | 124 | .length = 0x00800000, |
125 | .type = MT_DEVICE | 125 | .type = MT_DEVICE |
126 | }, { /* Simpad CS3 */ | 126 | }, { /* Simpad CS3 */ |
127 | .virtual = CS3_BASE, | 127 | .virtual = (unsigned long)CS3_BASE, |
128 | .pfn = __phys_to_pfn(SA1100_CS3_PHYS), | 128 | .pfn = __phys_to_pfn(SA1100_CS3_PHYS), |
129 | .length = 0x00100000, | 129 | .length = 0x00100000, |
130 | .type = MT_DEVICE | 130 | .type = MT_DEVICE |
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c index 2704bcd869cd..d35b94ef73b7 100644 --- a/arch/arm/mach-shark/core.c +++ b/arch/arm/mach-shark/core.c | |||
@@ -21,9 +21,6 @@ | |||
21 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
22 | #include <asm/mach/time.h> | 22 | #include <asm/mach/time.h> |
23 | 23 | ||
24 | #define IO_BASE 0xe0000000 | ||
25 | #define IO_SIZE 0x08000000 | ||
26 | #define IO_START 0x40000000 | ||
27 | #define ROMCARD_SIZE 0x08000000 | 24 | #define ROMCARD_SIZE 0x08000000 |
28 | #define ROMCARD_START 0x10000000 | 25 | #define ROMCARD_START 0x10000000 |
29 | 26 | ||
@@ -104,20 +101,6 @@ arch_initcall(shark_init); | |||
104 | 101 | ||
105 | extern void shark_init_irq(void); | 102 | extern void shark_init_irq(void); |
106 | 103 | ||
107 | static struct map_desc shark_io_desc[] __initdata = { | ||
108 | { | ||
109 | .virtual = IO_BASE, | ||
110 | .pfn = __phys_to_pfn(IO_START), | ||
111 | .length = IO_SIZE, | ||
112 | .type = MT_DEVICE | ||
113 | } | ||
114 | }; | ||
115 | |||
116 | static void __init shark_map_io(void) | ||
117 | { | ||
118 | iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc)); | ||
119 | } | ||
120 | |||
121 | #define IRQ_TIMER 0 | 104 | #define IRQ_TIMER 0 |
122 | #define HZ_TIME ((1193180 + HZ/2) / HZ) | 105 | #define HZ_TIME ((1193180 + HZ/2) / HZ) |
123 | 106 | ||
@@ -158,7 +141,6 @@ static void shark_init_early(void) | |||
158 | MACHINE_START(SHARK, "Shark") | 141 | MACHINE_START(SHARK, "Shark") |
159 | /* Maintainer: Alexander Schulz */ | 142 | /* Maintainer: Alexander Schulz */ |
160 | .atag_offset = 0x3000, | 143 | .atag_offset = 0x3000, |
161 | .map_io = shark_map_io, | ||
162 | .init_early = shark_init_early, | 144 | .init_early = shark_init_early, |
163 | .init_irq = shark_init_irq, | 145 | .init_irq = shark_init_irq, |
164 | .timer = &shark_timer, | 146 | .timer = &shark_timer, |
diff --git a/arch/arm/mach-shark/include/mach/debug-macro.S b/arch/arm/mach-shark/include/mach/debug-macro.S index 20eb2bf2a42b..d129119a3f69 100644 --- a/arch/arm/mach-shark/include/mach/debug-macro.S +++ b/arch/arm/mach-shark/include/mach/debug-macro.S | |||
@@ -12,9 +12,10 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | .macro addruart, rp, rv, tmp | 14 | .macro addruart, rp, rv, tmp |
15 | mov \rp, #0xe0000000 | 15 | mov \rp, #0x3f8 |
16 | orr \rp, \rp, #0x000003f8 | 16 | orr \rv, \rp, #0xfe000000 |
17 | mov \rv, \rp | 17 | orr \rv, \rv, #0x00e00000 |
18 | orr \rp, \rp, #0x40000000 | ||
18 | .endm | 19 | .endm |
19 | 20 | ||
20 | .macro senduart,rd,rx | 21 | .macro senduart,rd,rx |
diff --git a/arch/arm/mach-shark/include/mach/entry-macro.S b/arch/arm/mach-shark/include/mach/entry-macro.S index 5901b09fc96a..c9e49f049532 100644 --- a/arch/arm/mach-shark/include/mach/entry-macro.S +++ b/arch/arm/mach-shark/include/mach/entry-macro.S | |||
@@ -8,7 +8,8 @@ | |||
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | 9 | */ |
10 | .macro get_irqnr_preamble, base, tmp | 10 | .macro get_irqnr_preamble, base, tmp |
11 | mov \base, #0xe0000000 | 11 | mov \base, #0xfe000000 |
12 | orr \base, \base, #0x00e00000 | ||
12 | .endm | 13 | .endm |
13 | 14 | ||
14 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 15 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
diff --git a/arch/arm/mach-shark/include/mach/io.h b/arch/arm/mach-shark/include/mach/io.h deleted file mode 100644 index 1a45fc01ff1d..000000000000 --- a/arch/arm/mach-shark/include/mach/io.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-shark/include/mach/io.h | ||
3 | * | ||
4 | * by Alexander Schulz | ||
5 | * | ||
6 | * derived from: | ||
7 | * arch/arm/mach-ebsa110/include/mach/io.h | ||
8 | * Copyright (C) 1997,1998 Russell King | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | ||
12 | #define __ASM_ARM_ARCH_IO_H | ||
13 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | ||
15 | |||
16 | #define __io(a) ((void __iomem *)(0xe0000000 + (a))) | ||
17 | |||
18 | #endif | ||
diff --git a/arch/arm/mach-shark/pci.c b/arch/arm/mach-shark/pci.c index 9089407d5326..b8b4ab323a3e 100644 --- a/arch/arm/mach-shark/pci.c +++ b/arch/arm/mach-shark/pci.c | |||
@@ -8,12 +8,15 @@ | |||
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/pci.h> | 9 | #include <linux/pci.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/io.h> | ||
11 | #include <video/vga.h> | 12 | #include <video/vga.h> |
12 | 13 | ||
13 | #include <asm/irq.h> | 14 | #include <asm/irq.h> |
14 | #include <asm/mach/pci.h> | 15 | #include <asm/mach/pci.h> |
15 | #include <asm/mach-types.h> | 16 | #include <asm/mach-types.h> |
16 | 17 | ||
18 | #define IO_START 0x40000000 | ||
19 | |||
17 | static int __init shark_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 20 | static int __init shark_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
18 | { | 21 | { |
19 | if (dev->bus->number == 0) | 22 | if (dev->bus->number == 0) |
@@ -44,6 +47,8 @@ static int __init shark_pci_init(void) | |||
44 | pcibios_min_mem = 0x50000000; | 47 | pcibios_min_mem = 0x50000000; |
45 | vga_base = 0xe8000000; | 48 | vga_base = 0xe8000000; |
46 | 49 | ||
50 | pci_ioremap_io(0, IO_START); | ||
51 | |||
47 | pci_common_init(&shark_pci); | 52 | pci_common_init(&shark_pci); |
48 | 53 | ||
49 | return 0; | 54 | return 0; |
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c index d82c010fdfc6..cfc3b5c43ba8 100644 --- a/arch/arm/mach-shmobile/board-ag5evm.c +++ b/arch/arm/mach-shmobile/board-ag5evm.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <linux/mmc/sh_mobile_sdhi.h> | 40 | #include <linux/mmc/sh_mobile_sdhi.h> |
41 | #include <linux/mfd/tmio.h> | 41 | #include <linux/mfd/tmio.h> |
42 | #include <linux/sh_clk.h> | 42 | #include <linux/sh_clk.h> |
43 | #include <linux/videodev2.h> | ||
44 | #include <video/sh_mobile_lcdc.h> | 43 | #include <video/sh_mobile_lcdc.h> |
45 | #include <video/sh_mipi_dsi.h> | 44 | #include <video/sh_mipi_dsi.h> |
46 | #include <sound/sh_fsi.h> | 45 | #include <sound/sh_fsi.h> |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index f172ca85905c..1089ee5472eb 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -432,7 +432,7 @@ static void usb1_host_port_power(int port, int power) | |||
432 | return; | 432 | return; |
433 | 433 | ||
434 | /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */ | 434 | /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */ |
435 | __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008); | 435 | __raw_writew(__raw_readw(IOMEM(0xE68B0008)) | 0x600, IOMEM(0xE68B0008)); |
436 | } | 436 | } |
437 | 437 | ||
438 | static struct r8a66597_platdata usb1_host_data = { | 438 | static struct r8a66597_platdata usb1_host_data = { |
@@ -1224,9 +1224,9 @@ static struct i2c_board_info i2c1_devices[] = { | |||
1224 | }; | 1224 | }; |
1225 | 1225 | ||
1226 | 1226 | ||
1227 | #define GPIO_PORT9CR 0xE6051009 | 1227 | #define GPIO_PORT9CR IOMEM(0xE6051009) |
1228 | #define GPIO_PORT10CR 0xE605100A | 1228 | #define GPIO_PORT10CR IOMEM(0xE605100A) |
1229 | #define USCCR1 0xE6058144 | 1229 | #define USCCR1 IOMEM(0xE6058144) |
1230 | static void __init ap4evb_init(void) | 1230 | static void __init ap4evb_init(void) |
1231 | { | 1231 | { |
1232 | u32 srcr4; | 1232 | u32 srcr4; |
@@ -1304,7 +1304,7 @@ static void __init ap4evb_init(void) | |||
1304 | gpio_request(GPIO_FN_OVCN2_1, NULL); | 1304 | gpio_request(GPIO_FN_OVCN2_1, NULL); |
1305 | 1305 | ||
1306 | /* setup USB phy */ | 1306 | /* setup USB phy */ |
1307 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */ | 1307 | __raw_writew(0x8a0a, IOMEM(0xE6058130)); /* USBCR4 */ |
1308 | 1308 | ||
1309 | /* enable FSI2 port A (ak4643) */ | 1309 | /* enable FSI2 port A (ak4643) */ |
1310 | gpio_request(GPIO_FN_FSIAIBT, NULL); | 1310 | gpio_request(GPIO_FN_FSIAIBT, NULL); |
@@ -1453,7 +1453,7 @@ static void __init ap4evb_init(void) | |||
1453 | gpio_request(GPIO_FN_HDMI_CEC, NULL); | 1453 | gpio_request(GPIO_FN_HDMI_CEC, NULL); |
1454 | 1454 | ||
1455 | /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */ | 1455 | /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */ |
1456 | #define SRCR4 0xe61580bc | 1456 | #define SRCR4 IOMEM(0xe61580bc) |
1457 | srcr4 = __raw_readl(SRCR4); | 1457 | srcr4 = __raw_readl(SRCR4); |
1458 | __raw_writel(srcr4 | (1 << 13), SRCR4); | 1458 | __raw_writel(srcr4 | (1 << 13), SRCR4); |
1459 | udelay(50); | 1459 | udelay(50); |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 453a6e50db8b..45b33e02dff5 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -135,7 +135,7 @@ | |||
135 | * usbhsf_power_ctrl() | 135 | * usbhsf_power_ctrl() |
136 | */ | 136 | */ |
137 | #define IRQ7 evt2irq(0x02e0) | 137 | #define IRQ7 evt2irq(0x02e0) |
138 | #define USBCR1 0xe605810a | 138 | #define USBCR1 IOMEM(0xe605810a) |
139 | #define USBH 0xC6700000 | 139 | #define USBH 0xC6700000 |
140 | #define USBH_USBCTR 0x10834 | 140 | #define USBH_USBCTR 0x10834 |
141 | 141 | ||
@@ -950,8 +950,8 @@ clock_error: | |||
950 | /* | 950 | /* |
951 | * board init | 951 | * board init |
952 | */ | 952 | */ |
953 | #define GPIO_PORT7CR 0xe6050007 | 953 | #define GPIO_PORT7CR IOMEM(0xe6050007) |
954 | #define GPIO_PORT8CR 0xe6050008 | 954 | #define GPIO_PORT8CR IOMEM(0xe6050008) |
955 | static void __init eva_init(void) | 955 | static void __init eva_init(void) |
956 | { | 956 | { |
957 | struct platform_device *usb = NULL; | 957 | struct platform_device *usb = NULL; |
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c index 4129008eae29..cb8c994e1430 100644 --- a/arch/arm/mach-shmobile/board-bonito.c +++ b/arch/arm/mach-shmobile/board-bonito.c | |||
@@ -108,12 +108,12 @@ static struct regulator_consumer_supply dummy_supplies[] = { | |||
108 | #define FPGA_ETH_IRQ (FPGA_IRQ0 + 15) | 108 | #define FPGA_ETH_IRQ (FPGA_IRQ0 + 15) |
109 | static u16 bonito_fpga_read(u32 offset) | 109 | static u16 bonito_fpga_read(u32 offset) |
110 | { | 110 | { |
111 | return __raw_readw(0xf0003000 + offset); | 111 | return __raw_readw(IOMEM(0xf0003000) + offset); |
112 | } | 112 | } |
113 | 113 | ||
114 | static void bonito_fpga_write(u32 offset, u16 val) | 114 | static void bonito_fpga_write(u32 offset, u16 val) |
115 | { | 115 | { |
116 | __raw_writew(val, 0xf0003000 + offset); | 116 | __raw_writew(val, IOMEM(0xf0003000) + offset); |
117 | } | 117 | } |
118 | 118 | ||
119 | static void bonito_fpga_irq_disable(struct irq_data *data) | 119 | static void bonito_fpga_irq_disable(struct irq_data *data) |
@@ -361,8 +361,8 @@ static void __init bonito_map_io(void) | |||
361 | #define BIT_ON(sw, bit) (sw & (1 << bit)) | 361 | #define BIT_ON(sw, bit) (sw & (1 << bit)) |
362 | #define BIT_OFF(sw, bit) (!(sw & (1 << bit))) | 362 | #define BIT_OFF(sw, bit) (!(sw & (1 << bit))) |
363 | 363 | ||
364 | #define VCCQ1CR 0xE6058140 | 364 | #define VCCQ1CR IOMEM(0xE6058140) |
365 | #define VCCQ1LCDCR 0xE6058186 | 365 | #define VCCQ1LCDCR IOMEM(0xE6058186) |
366 | 366 | ||
367 | static void __init bonito_init(void) | 367 | static void __init bonito_init(void) |
368 | { | 368 | { |
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c index 796fa00ad3c4..b179d4c213bb 100644 --- a/arch/arm/mach-shmobile/board-g3evm.c +++ b/arch/arm/mach-shmobile/board-g3evm.c | |||
@@ -106,7 +106,7 @@ static void usb_host_port_power(int port, int power) | |||
106 | return; | 106 | return; |
107 | 107 | ||
108 | /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */ | 108 | /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */ |
109 | __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008); | 109 | __raw_writew(__raw_readw(IOMEM(0xe6890008)) | 0x600, IOMEM(0xe6890008)); |
110 | } | 110 | } |
111 | 111 | ||
112 | static struct r8a66597_platdata usb_host_data = { | 112 | static struct r8a66597_platdata usb_host_data = { |
@@ -279,10 +279,10 @@ static void __init g3evm_init(void) | |||
279 | gpio_request(GPIO_FN_IDIN, NULL); | 279 | gpio_request(GPIO_FN_IDIN, NULL); |
280 | 280 | ||
281 | /* setup USB phy */ | 281 | /* setup USB phy */ |
282 | __raw_writew(0x0300, 0xe605810a); /* USBCR1 */ | 282 | __raw_writew(0x0300, IOMEM(0xe605810a)); /* USBCR1 */ |
283 | __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */ | 283 | __raw_writew(0x00e0, IOMEM(0xe60581c0)); /* CPFCH */ |
284 | __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */ | 284 | __raw_writew(0x6010, IOMEM(0xe60581c6)); /* CGPOSR */ |
285 | __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */ | 285 | __raw_writew(0x8a0a, IOMEM(0xe605810c)); /* USBCR2 */ |
286 | 286 | ||
287 | /* KEYSC @ CN7 */ | 287 | /* KEYSC @ CN7 */ |
288 | gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL); | 288 | gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL); |
@@ -320,7 +320,7 @@ static void __init g3evm_init(void) | |||
320 | gpio_request(GPIO_FN_WE0_XWR0_FWE, NULL); | 320 | gpio_request(GPIO_FN_WE0_XWR0_FWE, NULL); |
321 | gpio_request(GPIO_FN_FRB, NULL); | 321 | gpio_request(GPIO_FN_FRB, NULL); |
322 | /* FOE, FCDE, FSC on dedicated pins */ | 322 | /* FOE, FCDE, FSC on dedicated pins */ |
323 | __raw_writel(__raw_readl(0xe6158048) & ~(1 << 15), 0xe6158048); | 323 | __raw_writel(__raw_readl(IOMEM(0xe6158048)) & ~(1 << 15), IOMEM(0xe6158048)); |
324 | 324 | ||
325 | /* IrDA */ | 325 | /* IrDA */ |
326 | gpio_request(GPIO_FN_IRDA_OUT, NULL); | 326 | gpio_request(GPIO_FN_IRDA_OUT, NULL); |
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c index fa5dfc5c8ed6..22d689322533 100644 --- a/arch/arm/mach-shmobile/board-g4evm.c +++ b/arch/arm/mach-shmobile/board-g4evm.c | |||
@@ -126,7 +126,7 @@ static void usb_host_port_power(int port, int power) | |||
126 | return; | 126 | return; |
127 | 127 | ||
128 | /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */ | 128 | /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */ |
129 | __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008); | 129 | __raw_writew(__raw_readw(IOMEM(0xe6890008)) | 0x600, IOMEM(0xe6890008)); |
130 | } | 130 | } |
131 | 131 | ||
132 | static struct r8a66597_platdata usb_host_data = { | 132 | static struct r8a66597_platdata usb_host_data = { |
@@ -270,17 +270,17 @@ static struct platform_device *g4evm_devices[] __initdata = { | |||
270 | &sdhi1_device, | 270 | &sdhi1_device, |
271 | }; | 271 | }; |
272 | 272 | ||
273 | #define GPIO_SDHID0_D0 0xe60520fc | 273 | #define GPIO_SDHID0_D0 IOMEM(0xe60520fc) |
274 | #define GPIO_SDHID0_D1 0xe60520fd | 274 | #define GPIO_SDHID0_D1 IOMEM(0xe60520fd) |
275 | #define GPIO_SDHID0_D2 0xe60520fe | 275 | #define GPIO_SDHID0_D2 IOMEM(0xe60520fe) |
276 | #define GPIO_SDHID0_D3 0xe60520ff | 276 | #define GPIO_SDHID0_D3 IOMEM(0xe60520ff) |
277 | #define GPIO_SDHICMD0 0xe6052100 | 277 | #define GPIO_SDHICMD0 IOMEM(0xe6052100) |
278 | 278 | ||
279 | #define GPIO_SDHID1_D0 0xe6052103 | 279 | #define GPIO_SDHID1_D0 IOMEM(0xe6052103) |
280 | #define GPIO_SDHID1_D1 0xe6052104 | 280 | #define GPIO_SDHID1_D1 IOMEM(0xe6052104) |
281 | #define GPIO_SDHID1_D2 0xe6052105 | 281 | #define GPIO_SDHID1_D2 IOMEM(0xe6052105) |
282 | #define GPIO_SDHID1_D3 0xe6052106 | 282 | #define GPIO_SDHID1_D3 IOMEM(0xe6052106) |
283 | #define GPIO_SDHICMD1 0xe6052107 | 283 | #define GPIO_SDHICMD1 IOMEM(0xe6052107) |
284 | 284 | ||
285 | static void __init g4evm_init(void) | 285 | static void __init g4evm_init(void) |
286 | { | 286 | { |
@@ -318,10 +318,10 @@ static void __init g4evm_init(void) | |||
318 | gpio_request(GPIO_FN_IDIN, NULL); | 318 | gpio_request(GPIO_FN_IDIN, NULL); |
319 | 319 | ||
320 | /* setup USB phy */ | 320 | /* setup USB phy */ |
321 | __raw_writew(0x0200, 0xe605810a); /* USBCR1 */ | 321 | __raw_writew(0x0200, IOMEM(0xe605810a)); /* USBCR1 */ |
322 | __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */ | 322 | __raw_writew(0x00e0, IOMEM(0xe60581c0)); /* CPFCH */ |
323 | __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */ | 323 | __raw_writew(0x6010, IOMEM(0xe60581c6)); /* CGPOSR */ |
324 | __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */ | 324 | __raw_writew(0x8a0a, IOMEM(0xe605810c)); /* USBCR2 */ |
325 | 325 | ||
326 | /* KEYSC @ CN31 */ | 326 | /* KEYSC @ CN31 */ |
327 | gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL); | 327 | gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL); |
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index 3b8a0171c3cb..99ae066b87ed 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c | |||
@@ -133,8 +133,8 @@ static struct platform_device usb_host_device = { | |||
133 | 133 | ||
134 | /* USB Func CN17 */ | 134 | /* USB Func CN17 */ |
135 | struct usbhs_private { | 135 | struct usbhs_private { |
136 | unsigned int phy; | 136 | void __iomem *phy; |
137 | unsigned int cr2; | 137 | void __iomem *cr2; |
138 | struct renesas_usbhs_platform_info info; | 138 | struct renesas_usbhs_platform_info info; |
139 | }; | 139 | }; |
140 | 140 | ||
@@ -232,8 +232,8 @@ static u32 usbhs_pipe_cfg[] = { | |||
232 | }; | 232 | }; |
233 | 233 | ||
234 | static struct usbhs_private usbhs_private = { | 234 | static struct usbhs_private usbhs_private = { |
235 | .phy = 0xe60781e0, /* USBPHYINT */ | 235 | .phy = IOMEM(0xe60781e0), /* USBPHYINT */ |
236 | .cr2 = 0xe605810c, /* USBCR2 */ | 236 | .cr2 = IOMEM(0xe605810c), /* USBCR2 */ |
237 | .info = { | 237 | .info = { |
238 | .platform_callback = { | 238 | .platform_callback = { |
239 | .hardware_init = usbhs_hardware_init, | 239 | .hardware_init = usbhs_hardware_init, |
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index c129542f6aed..0dce90ee6cf2 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -583,8 +583,8 @@ out: | |||
583 | #define USBHS0_POLL_INTERVAL (HZ * 5) | 583 | #define USBHS0_POLL_INTERVAL (HZ * 5) |
584 | 584 | ||
585 | struct usbhs_private { | 585 | struct usbhs_private { |
586 | unsigned int usbphyaddr; | 586 | void __iomem *usbphyaddr; |
587 | unsigned int usbcrcaddr; | 587 | void __iomem *usbcrcaddr; |
588 | struct renesas_usbhs_platform_info info; | 588 | struct renesas_usbhs_platform_info info; |
589 | struct delayed_work work; | 589 | struct delayed_work work; |
590 | struct platform_device *pdev; | 590 | struct platform_device *pdev; |
@@ -642,7 +642,7 @@ static void usbhs0_hardware_exit(struct platform_device *pdev) | |||
642 | } | 642 | } |
643 | 643 | ||
644 | static struct usbhs_private usbhs0_private = { | 644 | static struct usbhs_private usbhs0_private = { |
645 | .usbcrcaddr = 0xe605810c, /* USBCR2 */ | 645 | .usbcrcaddr = IOMEM(0xe605810c), /* USBCR2 */ |
646 | .info = { | 646 | .info = { |
647 | .platform_callback = { | 647 | .platform_callback = { |
648 | .hardware_init = usbhs0_hardware_init, | 648 | .hardware_init = usbhs0_hardware_init, |
@@ -776,8 +776,8 @@ static u32 usbhs1_pipe_cfg[] = { | |||
776 | }; | 776 | }; |
777 | 777 | ||
778 | static struct usbhs_private usbhs1_private = { | 778 | static struct usbhs_private usbhs1_private = { |
779 | .usbphyaddr = 0xe60581e2, /* USBPHY1INTAP */ | 779 | .usbphyaddr = IOMEM(0xe60581e2), /* USBPHY1INTAP */ |
780 | .usbcrcaddr = 0xe6058130, /* USBCR4 */ | 780 | .usbcrcaddr = IOMEM(0xe6058130), /* USBCR4 */ |
781 | .info = { | 781 | .info = { |
782 | .platform_callback = { | 782 | .platform_callback = { |
783 | .hardware_init = usbhs1_hardware_init, | 783 | .hardware_init = usbhs1_hardware_init, |
@@ -1402,12 +1402,12 @@ static struct i2c_board_info i2c1_devices[] = { | |||
1402 | }, | 1402 | }, |
1403 | }; | 1403 | }; |
1404 | 1404 | ||
1405 | #define GPIO_PORT9CR 0xE6051009 | 1405 | #define GPIO_PORT9CR IOMEM(0xE6051009) |
1406 | #define GPIO_PORT10CR 0xE605100A | 1406 | #define GPIO_PORT10CR IOMEM(0xE605100A) |
1407 | #define GPIO_PORT167CR 0xE60520A7 | 1407 | #define GPIO_PORT167CR IOMEM(0xE60520A7) |
1408 | #define GPIO_PORT168CR 0xE60520A8 | 1408 | #define GPIO_PORT168CR IOMEM(0xE60520A8) |
1409 | #define SRCR4 0xe61580bc | 1409 | #define SRCR4 IOMEM(0xe61580bc) |
1410 | #define USCCR1 0xE6058144 | 1410 | #define USCCR1 IOMEM(0xE6058144) |
1411 | static void __init mackerel_init(void) | 1411 | static void __init mackerel_init(void) |
1412 | { | 1412 | { |
1413 | u32 srcr4; | 1413 | u32 srcr4; |
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c index ad5fccc7b5e7..6729e0032180 100644 --- a/arch/arm/mach-shmobile/clock-r8a7740.c +++ b/arch/arm/mach-shmobile/clock-r8a7740.c | |||
@@ -41,29 +41,29 @@ | |||
41 | */ | 41 | */ |
42 | 42 | ||
43 | /* CPG registers */ | 43 | /* CPG registers */ |
44 | #define FRQCRA 0xe6150000 | 44 | #define FRQCRA IOMEM(0xe6150000) |
45 | #define FRQCRB 0xe6150004 | 45 | #define FRQCRB IOMEM(0xe6150004) |
46 | #define VCLKCR1 0xE6150008 | 46 | #define VCLKCR1 IOMEM(0xE6150008) |
47 | #define VCLKCR2 0xE615000c | 47 | #define VCLKCR2 IOMEM(0xE615000c) |
48 | #define FRQCRC 0xe61500e0 | 48 | #define FRQCRC IOMEM(0xe61500e0) |
49 | #define FSIACKCR 0xe6150018 | 49 | #define FSIACKCR IOMEM(0xe6150018) |
50 | #define PLLC01CR 0xe6150028 | 50 | #define PLLC01CR IOMEM(0xe6150028) |
51 | 51 | ||
52 | #define SUBCKCR 0xe6150080 | 52 | #define SUBCKCR IOMEM(0xe6150080) |
53 | #define USBCKCR 0xe615008c | 53 | #define USBCKCR IOMEM(0xe615008c) |
54 | 54 | ||
55 | #define MSTPSR0 0xe6150030 | 55 | #define MSTPSR0 IOMEM(0xe6150030) |
56 | #define MSTPSR1 0xe6150038 | 56 | #define MSTPSR1 IOMEM(0xe6150038) |
57 | #define MSTPSR2 0xe6150040 | 57 | #define MSTPSR2 IOMEM(0xe6150040) |
58 | #define MSTPSR3 0xe6150048 | 58 | #define MSTPSR3 IOMEM(0xe6150048) |
59 | #define MSTPSR4 0xe615004c | 59 | #define MSTPSR4 IOMEM(0xe615004c) |
60 | #define FSIBCKCR 0xe6150090 | 60 | #define FSIBCKCR IOMEM(0xe6150090) |
61 | #define HDMICKCR 0xe6150094 | 61 | #define HDMICKCR IOMEM(0xe6150094) |
62 | #define SMSTPCR0 0xe6150130 | 62 | #define SMSTPCR0 IOMEM(0xe6150130) |
63 | #define SMSTPCR1 0xe6150134 | 63 | #define SMSTPCR1 IOMEM(0xe6150134) |
64 | #define SMSTPCR2 0xe6150138 | 64 | #define SMSTPCR2 IOMEM(0xe6150138) |
65 | #define SMSTPCR3 0xe615013c | 65 | #define SMSTPCR3 IOMEM(0xe615013c) |
66 | #define SMSTPCR4 0xe6150140 | 66 | #define SMSTPCR4 IOMEM(0xe6150140) |
67 | 67 | ||
68 | /* Fixed 32 KHz root clock from EXTALR pin */ | 68 | /* Fixed 32 KHz root clock from EXTALR pin */ |
69 | static struct clk extalr_clk = { | 69 | static struct clk extalr_clk = { |
diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c index 162b791b8984..ef0a95e592c4 100644 --- a/arch/arm/mach-shmobile/clock-sh7367.c +++ b/arch/arm/mach-shmobile/clock-sh7367.c | |||
@@ -24,28 +24,28 @@ | |||
24 | #include <mach/common.h> | 24 | #include <mach/common.h> |
25 | 25 | ||
26 | /* SH7367 registers */ | 26 | /* SH7367 registers */ |
27 | #define RTFRQCR 0xe6150000 | 27 | #define RTFRQCR IOMEM(0xe6150000) |
28 | #define SYFRQCR 0xe6150004 | 28 | #define SYFRQCR IOMEM(0xe6150004) |
29 | #define CMFRQCR 0xe61500E0 | 29 | #define CMFRQCR IOMEM(0xe61500E0) |
30 | #define VCLKCR1 0xe6150008 | 30 | #define VCLKCR1 IOMEM(0xe6150008) |
31 | #define VCLKCR2 0xe615000C | 31 | #define VCLKCR2 IOMEM(0xe615000C) |
32 | #define VCLKCR3 0xe615001C | 32 | #define VCLKCR3 IOMEM(0xe615001C) |
33 | #define SCLKACR 0xe6150010 | 33 | #define SCLKACR IOMEM(0xe6150010) |
34 | #define SCLKBCR 0xe6150014 | 34 | #define SCLKBCR IOMEM(0xe6150014) |
35 | #define SUBUSBCKCR 0xe6158080 | 35 | #define SUBUSBCKCR IOMEM(0xe6158080) |
36 | #define SPUCKCR 0xe6150084 | 36 | #define SPUCKCR IOMEM(0xe6150084) |
37 | #define MSUCKCR 0xe6150088 | 37 | #define MSUCKCR IOMEM(0xe6150088) |
38 | #define MVI3CKCR 0xe6150090 | 38 | #define MVI3CKCR IOMEM(0xe6150090) |
39 | #define VOUCKCR 0xe6150094 | 39 | #define VOUCKCR IOMEM(0xe6150094) |
40 | #define MFCK1CR 0xe6150098 | 40 | #define MFCK1CR IOMEM(0xe6150098) |
41 | #define MFCK2CR 0xe615009C | 41 | #define MFCK2CR IOMEM(0xe615009C) |
42 | #define PLLC1CR 0xe6150028 | 42 | #define PLLC1CR IOMEM(0xe6150028) |
43 | #define PLLC2CR 0xe615002C | 43 | #define PLLC2CR IOMEM(0xe615002C) |
44 | #define RTMSTPCR0 0xe6158030 | 44 | #define RTMSTPCR0 IOMEM(0xe6158030) |
45 | #define RTMSTPCR2 0xe6158038 | 45 | #define RTMSTPCR2 IOMEM(0xe6158038) |
46 | #define SYMSTPCR0 0xe6158040 | 46 | #define SYMSTPCR0 IOMEM(0xe6158040) |
47 | #define SYMSTPCR2 0xe6158048 | 47 | #define SYMSTPCR2 IOMEM(0xe6158048) |
48 | #define CMMSTPCR0 0xe615804c | 48 | #define CMMSTPCR0 IOMEM(0xe615804c) |
49 | 49 | ||
50 | /* Fixed 32 KHz root clock from EXTALR pin */ | 50 | /* Fixed 32 KHz root clock from EXTALR pin */ |
51 | static struct clk r_clk = { | 51 | static struct clk r_clk = { |
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index 5a2894b1c965..430a90ffa120 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
@@ -24,36 +24,36 @@ | |||
24 | #include <mach/common.h> | 24 | #include <mach/common.h> |
25 | 25 | ||
26 | /* SH7372 registers */ | 26 | /* SH7372 registers */ |
27 | #define FRQCRA 0xe6150000 | 27 | #define FRQCRA IOMEM(0xe6150000) |
28 | #define FRQCRB 0xe6150004 | 28 | #define FRQCRB IOMEM(0xe6150004) |
29 | #define FRQCRC 0xe61500e0 | 29 | #define FRQCRC IOMEM(0xe61500e0) |
30 | #define FRQCRD 0xe61500e4 | 30 | #define FRQCRD IOMEM(0xe61500e4) |
31 | #define VCLKCR1 0xe6150008 | 31 | #define VCLKCR1 IOMEM(0xe6150008) |
32 | #define VCLKCR2 0xe615000c | 32 | #define VCLKCR2 IOMEM(0xe615000c) |
33 | #define VCLKCR3 0xe615001c | 33 | #define VCLKCR3 IOMEM(0xe615001c) |
34 | #define FMSICKCR 0xe6150010 | 34 | #define FMSICKCR IOMEM(0xe6150010) |
35 | #define FMSOCKCR 0xe6150014 | 35 | #define FMSOCKCR IOMEM(0xe6150014) |
36 | #define FSIACKCR 0xe6150018 | 36 | #define FSIACKCR IOMEM(0xe6150018) |
37 | #define FSIBCKCR 0xe6150090 | 37 | #define FSIBCKCR IOMEM(0xe6150090) |
38 | #define SUBCKCR 0xe6150080 | 38 | #define SUBCKCR IOMEM(0xe6150080) |
39 | #define SPUCKCR 0xe6150084 | 39 | #define SPUCKCR IOMEM(0xe6150084) |
40 | #define VOUCKCR 0xe6150088 | 40 | #define VOUCKCR IOMEM(0xe6150088) |
41 | #define HDMICKCR 0xe6150094 | 41 | #define HDMICKCR IOMEM(0xe6150094) |
42 | #define DSITCKCR 0xe6150060 | 42 | #define DSITCKCR IOMEM(0xe6150060) |
43 | #define DSI0PCKCR 0xe6150064 | 43 | #define DSI0PCKCR IOMEM(0xe6150064) |
44 | #define DSI1PCKCR 0xe6150098 | 44 | #define DSI1PCKCR IOMEM(0xe6150098) |
45 | #define PLLC01CR 0xe6150028 | 45 | #define PLLC01CR IOMEM(0xe6150028) |
46 | #define PLLC2CR 0xe615002c | 46 | #define PLLC2CR IOMEM(0xe615002c) |
47 | #define RMSTPCR0 0xe6150110 | 47 | #define RMSTPCR0 IOMEM(0xe6150110) |
48 | #define RMSTPCR1 0xe6150114 | 48 | #define RMSTPCR1 IOMEM(0xe6150114) |
49 | #define RMSTPCR2 0xe6150118 | 49 | #define RMSTPCR2 IOMEM(0xe6150118) |
50 | #define RMSTPCR3 0xe615011c | 50 | #define RMSTPCR3 IOMEM(0xe615011c) |
51 | #define RMSTPCR4 0xe6150120 | 51 | #define RMSTPCR4 IOMEM(0xe6150120) |
52 | #define SMSTPCR0 0xe6150130 | 52 | #define SMSTPCR0 IOMEM(0xe6150130) |
53 | #define SMSTPCR1 0xe6150134 | 53 | #define SMSTPCR1 IOMEM(0xe6150134) |
54 | #define SMSTPCR2 0xe6150138 | 54 | #define SMSTPCR2 IOMEM(0xe6150138) |
55 | #define SMSTPCR3 0xe615013c | 55 | #define SMSTPCR3 IOMEM(0xe615013c) |
56 | #define SMSTPCR4 0xe6150140 | 56 | #define SMSTPCR4 IOMEM(0xe6150140) |
57 | 57 | ||
58 | #define FSIDIVA 0xFE1F8000 | 58 | #define FSIDIVA 0xFE1F8000 |
59 | #define FSIDIVB 0xFE1F8008 | 59 | #define FSIDIVB 0xFE1F8008 |
diff --git a/arch/arm/mach-shmobile/clock-sh7377.c b/arch/arm/mach-shmobile/clock-sh7377.c index 85f2a3ec2c44..b8480d19e1c8 100644 --- a/arch/arm/mach-shmobile/clock-sh7377.c +++ b/arch/arm/mach-shmobile/clock-sh7377.c | |||
@@ -24,31 +24,31 @@ | |||
24 | #include <mach/common.h> | 24 | #include <mach/common.h> |
25 | 25 | ||
26 | /* SH7377 registers */ | 26 | /* SH7377 registers */ |
27 | #define RTFRQCR 0xe6150000 | 27 | #define RTFRQCR IOMEM(0xe6150000) |
28 | #define SYFRQCR 0xe6150004 | 28 | #define SYFRQCR IOMEM(0xe6150004) |
29 | #define CMFRQCR 0xe61500E0 | 29 | #define CMFRQCR IOMEM(0xe61500E0) |
30 | #define VCLKCR1 0xe6150008 | 30 | #define VCLKCR1 IOMEM(0xe6150008) |
31 | #define VCLKCR2 0xe615000C | 31 | #define VCLKCR2 IOMEM(0xe615000C) |
32 | #define VCLKCR3 0xe615001C | 32 | #define VCLKCR3 IOMEM(0xe615001C) |
33 | #define FMSICKCR 0xe6150010 | 33 | #define FMSICKCR IOMEM(0xe6150010) |
34 | #define FMSOCKCR 0xe6150014 | 34 | #define FMSOCKCR IOMEM(0xe6150014) |
35 | #define FSICKCR 0xe6150018 | 35 | #define FSICKCR IOMEM(0xe6150018) |
36 | #define PLLC1CR 0xe6150028 | 36 | #define PLLC1CR IOMEM(0xe6150028) |
37 | #define PLLC2CR 0xe615002C | 37 | #define PLLC2CR IOMEM(0xe615002C) |
38 | #define SUBUSBCKCR 0xe6150080 | 38 | #define SUBUSBCKCR IOMEM(0xe6150080) |
39 | #define SPUCKCR 0xe6150084 | 39 | #define SPUCKCR IOMEM(0xe6150084) |
40 | #define MSUCKCR 0xe6150088 | 40 | #define MSUCKCR IOMEM(0xe6150088) |
41 | #define MVI3CKCR 0xe6150090 | 41 | #define MVI3CKCR IOMEM(0xe6150090) |
42 | #define HDMICKCR 0xe6150094 | 42 | #define HDMICKCR IOMEM(0xe6150094) |
43 | #define MFCK1CR 0xe6150098 | 43 | #define MFCK1CR IOMEM(0xe6150098) |
44 | #define MFCK2CR 0xe615009C | 44 | #define MFCK2CR IOMEM(0xe615009C) |
45 | #define DSITCKCR 0xe6150060 | 45 | #define DSITCKCR IOMEM(0xe6150060) |
46 | #define DSIPCKCR 0xe6150064 | 46 | #define DSIPCKCR IOMEM(0xe6150064) |
47 | #define SMSTPCR0 0xe6150130 | 47 | #define SMSTPCR0 IOMEM(0xe6150130) |
48 | #define SMSTPCR1 0xe6150134 | 48 | #define SMSTPCR1 IOMEM(0xe6150134) |
49 | #define SMSTPCR2 0xe6150138 | 49 | #define SMSTPCR2 IOMEM(0xe6150138) |
50 | #define SMSTPCR3 0xe615013C | 50 | #define SMSTPCR3 IOMEM(0xe615013C) |
51 | #define SMSTPCR4 0xe6150140 | 51 | #define SMSTPCR4 IOMEM(0xe6150140) |
52 | 52 | ||
53 | /* Fixed 32 KHz root clock from EXTALR pin */ | 53 | /* Fixed 32 KHz root clock from EXTALR pin */ |
54 | static struct clk r_clk = { | 54 | static struct clk r_clk = { |
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 7f8da18a8580..516ff7f3e434 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -23,43 +23,43 @@ | |||
23 | #include <linux/clkdev.h> | 23 | #include <linux/clkdev.h> |
24 | #include <mach/common.h> | 24 | #include <mach/common.h> |
25 | 25 | ||
26 | #define FRQCRA 0xe6150000 | 26 | #define FRQCRA IOMEM(0xe6150000) |
27 | #define FRQCRB 0xe6150004 | 27 | #define FRQCRB IOMEM(0xe6150004) |
28 | #define FRQCRD 0xe61500e4 | 28 | #define FRQCRD IOMEM(0xe61500e4) |
29 | #define VCLKCR1 0xe6150008 | 29 | #define VCLKCR1 IOMEM(0xe6150008) |
30 | #define VCLKCR2 0xe615000C | 30 | #define VCLKCR2 IOMEM(0xe615000C) |
31 | #define VCLKCR3 0xe615001C | 31 | #define VCLKCR3 IOMEM(0xe615001C) |
32 | #define ZBCKCR 0xe6150010 | 32 | #define ZBCKCR IOMEM(0xe6150010) |
33 | #define FLCKCR 0xe6150014 | 33 | #define FLCKCR IOMEM(0xe6150014) |
34 | #define SD0CKCR 0xe6150074 | 34 | #define SD0CKCR IOMEM(0xe6150074) |
35 | #define SD1CKCR 0xe6150078 | 35 | #define SD1CKCR IOMEM(0xe6150078) |
36 | #define SD2CKCR 0xe615007C | 36 | #define SD2CKCR IOMEM(0xe615007C) |
37 | #define FSIACKCR 0xe6150018 | 37 | #define FSIACKCR IOMEM(0xe6150018) |
38 | #define FSIBCKCR 0xe6150090 | 38 | #define FSIBCKCR IOMEM(0xe6150090) |
39 | #define SUBCKCR 0xe6150080 | 39 | #define SUBCKCR IOMEM(0xe6150080) |
40 | #define SPUACKCR 0xe6150084 | 40 | #define SPUACKCR IOMEM(0xe6150084) |
41 | #define SPUVCKCR 0xe6150094 | 41 | #define SPUVCKCR IOMEM(0xe6150094) |
42 | #define MSUCKCR 0xe6150088 | 42 | #define MSUCKCR IOMEM(0xe6150088) |
43 | #define HSICKCR 0xe615008C | 43 | #define HSICKCR IOMEM(0xe615008C) |
44 | #define MFCK1CR 0xe6150098 | 44 | #define MFCK1CR IOMEM(0xe6150098) |
45 | #define MFCK2CR 0xe615009C | 45 | #define MFCK2CR IOMEM(0xe615009C) |
46 | #define DSITCKCR 0xe6150060 | 46 | #define DSITCKCR IOMEM(0xe6150060) |
47 | #define DSI0PCKCR 0xe6150064 | 47 | #define DSI0PCKCR IOMEM(0xe6150064) |
48 | #define DSI1PCKCR 0xe6150068 | 48 | #define DSI1PCKCR IOMEM(0xe6150068) |
49 | #define DSI0PHYCR 0xe615006C | 49 | #define DSI0PHYCR 0xe615006C |
50 | #define DSI1PHYCR 0xe6150070 | 50 | #define DSI1PHYCR 0xe6150070 |
51 | #define PLLECR 0xe61500d0 | 51 | #define PLLECR IOMEM(0xe61500d0) |
52 | #define PLL0CR 0xe61500d8 | 52 | #define PLL0CR IOMEM(0xe61500d8) |
53 | #define PLL1CR 0xe6150028 | 53 | #define PLL1CR IOMEM(0xe6150028) |
54 | #define PLL2CR 0xe615002c | 54 | #define PLL2CR IOMEM(0xe615002c) |
55 | #define PLL3CR 0xe61500dc | 55 | #define PLL3CR IOMEM(0xe61500dc) |
56 | #define SMSTPCR0 0xe6150130 | 56 | #define SMSTPCR0 IOMEM(0xe6150130) |
57 | #define SMSTPCR1 0xe6150134 | 57 | #define SMSTPCR1 IOMEM(0xe6150134) |
58 | #define SMSTPCR2 0xe6150138 | 58 | #define SMSTPCR2 IOMEM(0xe6150138) |
59 | #define SMSTPCR3 0xe615013c | 59 | #define SMSTPCR3 IOMEM(0xe615013c) |
60 | #define SMSTPCR4 0xe6150140 | 60 | #define SMSTPCR4 IOMEM(0xe6150140) |
61 | #define SMSTPCR5 0xe6150144 | 61 | #define SMSTPCR5 IOMEM(0xe6150144) |
62 | #define CKSCR 0xe61500c0 | 62 | #define CKSCR IOMEM(0xe61500c0) |
63 | 63 | ||
64 | /* Fixed 32 KHz root clock from EXTALR pin */ | 64 | /* Fixed 32 KHz root clock from EXTALR pin */ |
65 | static struct clk r_clk = { | 65 | static struct clk r_clk = { |
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h index 844507d937cb..90a92b2c1c52 100644 --- a/arch/arm/mach-shmobile/include/mach/gpio.h +++ b/arch/arm/mach-shmobile/include/mach/gpio.h | |||
@@ -35,12 +35,12 @@ static inline int irq_to_gpio(unsigned int irq) | |||
35 | * the method to control only pull up/down/free. | 35 | * the method to control only pull up/down/free. |
36 | * this function should be replaced by correct gpio function | 36 | * this function should be replaced by correct gpio function |
37 | */ | 37 | */ |
38 | static inline void __init gpio_direction_none(u32 addr) | 38 | static inline void __init gpio_direction_none(void __iomem * addr) |
39 | { | 39 | { |
40 | __raw_writeb(0x00, addr); | 40 | __raw_writeb(0x00, addr); |
41 | } | 41 | } |
42 | 42 | ||
43 | static inline void __init gpio_request_pullup(u32 addr) | 43 | static inline void __init gpio_request_pullup(void __iomem * addr) |
44 | { | 44 | { |
45 | u8 data = __raw_readb(addr); | 45 | u8 data = __raw_readb(addr); |
46 | 46 | ||
@@ -49,7 +49,7 @@ static inline void __init gpio_request_pullup(u32 addr) | |||
49 | __raw_writeb(data, addr); | 49 | __raw_writeb(data, addr); |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline void __init gpio_request_pulldown(u32 addr) | 52 | static inline void __init gpio_request_pulldown(void __iomem * addr) |
53 | { | 53 | { |
54 | u8 data = __raw_readb(addr); | 54 | u8 data = __raw_readb(addr); |
55 | 55 | ||
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c index f04fad4ec4fb..ef66f1a8aa2e 100644 --- a/arch/arm/mach-shmobile/intc-r8a7779.c +++ b/arch/arm/mach-shmobile/intc-r8a7779.c | |||
@@ -29,14 +29,14 @@ | |||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
31 | 31 | ||
32 | #define INT2SMSKCR0 0xfe7822a0 | 32 | #define INT2SMSKCR0 IOMEM(0xfe7822a0) |
33 | #define INT2SMSKCR1 0xfe7822a4 | 33 | #define INT2SMSKCR1 IOMEM(0xfe7822a4) |
34 | #define INT2SMSKCR2 0xfe7822a8 | 34 | #define INT2SMSKCR2 IOMEM(0xfe7822a8) |
35 | #define INT2SMSKCR3 0xfe7822ac | 35 | #define INT2SMSKCR3 IOMEM(0xfe7822ac) |
36 | #define INT2SMSKCR4 0xfe7822b0 | 36 | #define INT2SMSKCR4 IOMEM(0xfe7822b0) |
37 | 37 | ||
38 | #define INT2NTSR0 0xfe700060 | 38 | #define INT2NTSR0 IOMEM(0xfe700060) |
39 | #define INT2NTSR1 0xfe700064 | 39 | #define INT2NTSR1 IOMEM(0xfe700064) |
40 | 40 | ||
41 | static int r8a7779_set_wake(struct irq_data *data, unsigned int on) | 41 | static int r8a7779_set_wake(struct irq_data *data, unsigned int on) |
42 | { | 42 | { |
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index 2587a22842f2..a91caad7db7c 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c | |||
@@ -624,6 +624,9 @@ void sh7372_intcs_resume(void) | |||
624 | __raw_writeb(ffd5[k], intcs_ffd5 + k); | 624 | __raw_writeb(ffd5[k], intcs_ffd5 + k); |
625 | } | 625 | } |
626 | 626 | ||
627 | #define E694_BASE IOMEM(0xe6940000) | ||
628 | #define E695_BASE IOMEM(0xe6950000) | ||
629 | |||
627 | static unsigned short e694[0x200]; | 630 | static unsigned short e694[0x200]; |
628 | static unsigned short e695[0x200]; | 631 | static unsigned short e695[0x200]; |
629 | 632 | ||
@@ -632,22 +635,22 @@ void sh7372_intca_suspend(void) | |||
632 | int k; | 635 | int k; |
633 | 636 | ||
634 | for (k = 0x00; k <= 0x38; k += 4) | 637 | for (k = 0x00; k <= 0x38; k += 4) |
635 | e694[k] = __raw_readw(0xe6940000 + k); | 638 | e694[k] = __raw_readw(E694_BASE + k); |
636 | 639 | ||
637 | for (k = 0x80; k <= 0xb4; k += 4) | 640 | for (k = 0x80; k <= 0xb4; k += 4) |
638 | e694[k] = __raw_readb(0xe6940000 + k); | 641 | e694[k] = __raw_readb(E694_BASE + k); |
639 | 642 | ||
640 | for (k = 0x180; k <= 0x1b4; k += 4) | 643 | for (k = 0x180; k <= 0x1b4; k += 4) |
641 | e694[k] = __raw_readb(0xe6940000 + k); | 644 | e694[k] = __raw_readb(E694_BASE + k); |
642 | 645 | ||
643 | for (k = 0x00; k <= 0x50; k += 4) | 646 | for (k = 0x00; k <= 0x50; k += 4) |
644 | e695[k] = __raw_readw(0xe6950000 + k); | 647 | e695[k] = __raw_readw(E695_BASE + k); |
645 | 648 | ||
646 | for (k = 0x80; k <= 0xa8; k += 4) | 649 | for (k = 0x80; k <= 0xa8; k += 4) |
647 | e695[k] = __raw_readb(0xe6950000 + k); | 650 | e695[k] = __raw_readb(E695_BASE + k); |
648 | 651 | ||
649 | for (k = 0x180; k <= 0x1a8; k += 4) | 652 | for (k = 0x180; k <= 0x1a8; k += 4) |
650 | e695[k] = __raw_readb(0xe6950000 + k); | 653 | e695[k] = __raw_readb(E695_BASE + k); |
651 | } | 654 | } |
652 | 655 | ||
653 | void sh7372_intca_resume(void) | 656 | void sh7372_intca_resume(void) |
@@ -655,20 +658,20 @@ void sh7372_intca_resume(void) | |||
655 | int k; | 658 | int k; |
656 | 659 | ||
657 | for (k = 0x00; k <= 0x38; k += 4) | 660 | for (k = 0x00; k <= 0x38; k += 4) |
658 | __raw_writew(e694[k], 0xe6940000 + k); | 661 | __raw_writew(e694[k], E694_BASE + k); |
659 | 662 | ||
660 | for (k = 0x80; k <= 0xb4; k += 4) | 663 | for (k = 0x80; k <= 0xb4; k += 4) |
661 | __raw_writeb(e694[k], 0xe6940000 + k); | 664 | __raw_writeb(e694[k], E694_BASE + k); |
662 | 665 | ||
663 | for (k = 0x180; k <= 0x1b4; k += 4) | 666 | for (k = 0x180; k <= 0x1b4; k += 4) |
664 | __raw_writeb(e694[k], 0xe6940000 + k); | 667 | __raw_writeb(e694[k], E694_BASE + k); |
665 | 668 | ||
666 | for (k = 0x00; k <= 0x50; k += 4) | 669 | for (k = 0x00; k <= 0x50; k += 4) |
667 | __raw_writew(e695[k], 0xe6950000 + k); | 670 | __raw_writew(e695[k], E695_BASE + k); |
668 | 671 | ||
669 | for (k = 0x80; k <= 0xa8; k += 4) | 672 | for (k = 0x80; k <= 0xa8; k += 4) |
670 | __raw_writeb(e695[k], 0xe6950000 + k); | 673 | __raw_writeb(e695[k], E695_BASE + k); |
671 | 674 | ||
672 | for (k = 0x180; k <= 0x1a8; k += 4) | 675 | for (k = 0x180; k <= 0x1a8; k += 4) |
673 | __raw_writeb(e695[k], 0xe6950000 + k); | 676 | __raw_writeb(e695[k], E695_BASE + k); |
674 | } | 677 | } |
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c index 588555a67d9c..f0c5e5190601 100644 --- a/arch/arm/mach-shmobile/intc-sh73a0.c +++ b/arch/arm/mach-shmobile/intc-sh73a0.c | |||
@@ -366,10 +366,12 @@ static irqreturn_t sh73a0_irq_pin_demux(int irq, void *dev_id) | |||
366 | 366 | ||
367 | static struct irqaction sh73a0_irq_pin_cascade[32]; | 367 | static struct irqaction sh73a0_irq_pin_cascade[32]; |
368 | 368 | ||
369 | #define PINTER0 0xe69000a0 | 369 | #define PINTER0_PHYS 0xe69000a0 |
370 | #define PINTER1 0xe69000a4 | 370 | #define PINTER1_PHYS 0xe69000a4 |
371 | #define PINTRR0 0xe69000d0 | 371 | #define PINTER0_VIRT IOMEM(0xe69000a0) |
372 | #define PINTRR1 0xe69000d4 | 372 | #define PINTER1_VIRT IOMEM(0xe69000a4) |
373 | #define PINTRR0 IOMEM(0xe69000d0) | ||
374 | #define PINTRR1 IOMEM(0xe69000d4) | ||
373 | 375 | ||
374 | #define PINT0A_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq)) | 376 | #define PINT0A_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq)) |
375 | #define PINT0B_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 8)) | 377 | #define PINT0B_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 8)) |
@@ -377,14 +379,14 @@ static struct irqaction sh73a0_irq_pin_cascade[32]; | |||
377 | #define PINT0D_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 24)) | 379 | #define PINT0D_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 24)) |
378 | #define PINT1E_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT1_IRQ(irq)) | 380 | #define PINT1E_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT1_IRQ(irq)) |
379 | 381 | ||
380 | INTC_PINT(intc_pint0, PINTER0, 0xe69000b0, "sh73a0-pint0", \ | 382 | INTC_PINT(intc_pint0, PINTER0_PHYS, 0xe69000b0, "sh73a0-pint0", \ |
381 | INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \ | 383 | INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \ |
382 | INTC_PINT_V(A, PINT0A_IRQ), INTC_PINT_V(B, PINT0B_IRQ), \ | 384 | INTC_PINT_V(A, PINT0A_IRQ), INTC_PINT_V(B, PINT0B_IRQ), \ |
383 | INTC_PINT_V(C, PINT0C_IRQ), INTC_PINT_V(D, PINT0D_IRQ), \ | 385 | INTC_PINT_V(C, PINT0C_IRQ), INTC_PINT_V(D, PINT0D_IRQ), \ |
384 | INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \ | 386 | INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \ |
385 | INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D)); | 387 | INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D)); |
386 | 388 | ||
387 | INTC_PINT(intc_pint1, PINTER1, 0xe69000c0, "sh73a0-pint1", \ | 389 | INTC_PINT(intc_pint1, PINTER1_PHYS, 0xe69000c0, "sh73a0-pint1", \ |
388 | INTC_PINT_E(E), INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, \ | 390 | INTC_PINT_E(E), INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, \ |
389 | INTC_PINT_V(E, PINT1E_IRQ), INTC_PINT_V_NONE, \ | 391 | INTC_PINT_V(E, PINT1E_IRQ), INTC_PINT_V_NONE, \ |
390 | INTC_PINT_V_NONE, INTC_PINT_V_NONE, \ | 392 | INTC_PINT_V_NONE, INTC_PINT_V_NONE, \ |
@@ -394,7 +396,7 @@ INTC_PINT(intc_pint1, PINTER1, 0xe69000c0, "sh73a0-pint1", \ | |||
394 | static struct irqaction sh73a0_pint0_cascade; | 396 | static struct irqaction sh73a0_pint0_cascade; |
395 | static struct irqaction sh73a0_pint1_cascade; | 397 | static struct irqaction sh73a0_pint1_cascade; |
396 | 398 | ||
397 | static void pint_demux(unsigned long rr, unsigned long er, int base_irq) | 399 | static void pint_demux(void __iomem *rr, void __iomem *er, int base_irq) |
398 | { | 400 | { |
399 | unsigned long value = ioread32(rr) & ioread32(er); | 401 | unsigned long value = ioread32(rr) & ioread32(er); |
400 | int k; | 402 | int k; |
@@ -409,13 +411,13 @@ static void pint_demux(unsigned long rr, unsigned long er, int base_irq) | |||
409 | 411 | ||
410 | static irqreturn_t sh73a0_pint0_demux(int irq, void *dev_id) | 412 | static irqreturn_t sh73a0_pint0_demux(int irq, void *dev_id) |
411 | { | 413 | { |
412 | pint_demux(PINTRR0, PINTER0, SH73A0_PINT0_IRQ(0)); | 414 | pint_demux(PINTRR0, PINTER0_VIRT, SH73A0_PINT0_IRQ(0)); |
413 | return IRQ_HANDLED; | 415 | return IRQ_HANDLED; |
414 | } | 416 | } |
415 | 417 | ||
416 | static irqreturn_t sh73a0_pint1_demux(int irq, void *dev_id) | 418 | static irqreturn_t sh73a0_pint1_demux(int irq, void *dev_id) |
417 | { | 419 | { |
418 | pint_demux(PINTRR1, PINTER1, SH73A0_PINT1_IRQ(0)); | 420 | pint_demux(PINTRR1, PINTER1_VIRT, SH73A0_PINT1_IRQ(0)); |
419 | return IRQ_HANDLED; | 421 | return IRQ_HANDLED; |
420 | } | 422 | } |
421 | 423 | ||
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index a8562540f1d6..32e177275e47 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c | |||
@@ -20,9 +20,9 @@ | |||
20 | #include <mach/pm-rmobile.h> | 20 | #include <mach/pm-rmobile.h> |
21 | 21 | ||
22 | /* SYSC */ | 22 | /* SYSC */ |
23 | #define SPDCR 0xe6180008 | 23 | #define SPDCR IOMEM(0xe6180008) |
24 | #define SWUCR 0xe6180014 | 24 | #define SWUCR IOMEM(0xe6180014) |
25 | #define PSTR 0xe6180080 | 25 | #define PSTR IOMEM(0xe6180080) |
26 | 26 | ||
27 | #define PSTR_RETRIES 100 | 27 | #define PSTR_RETRIES 100 |
28 | #define PSTR_DELAY_US 10 | 28 | #define PSTR_DELAY_US 10 |
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index 792037069226..162121842a2b 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c | |||
@@ -29,45 +29,46 @@ | |||
29 | #include <mach/pm-rmobile.h> | 29 | #include <mach/pm-rmobile.h> |
30 | 30 | ||
31 | /* DBG */ | 31 | /* DBG */ |
32 | #define DBGREG1 0xe6100020 | 32 | #define DBGREG1 IOMEM(0xe6100020) |
33 | #define DBGREG9 0xe6100040 | 33 | #define DBGREG9 IOMEM(0xe6100040) |
34 | 34 | ||
35 | /* CPGA */ | 35 | /* CPGA */ |
36 | #define SYSTBCR 0xe6150024 | 36 | #define SYSTBCR IOMEM(0xe6150024) |
37 | #define MSTPSR0 0xe6150030 | 37 | #define MSTPSR0 IOMEM(0xe6150030) |
38 | #define MSTPSR1 0xe6150038 | 38 | #define MSTPSR1 IOMEM(0xe6150038) |
39 | #define MSTPSR2 0xe6150040 | 39 | #define MSTPSR2 IOMEM(0xe6150040) |
40 | #define MSTPSR3 0xe6150048 | 40 | #define MSTPSR3 IOMEM(0xe6150048) |
41 | #define MSTPSR4 0xe615004c | 41 | #define MSTPSR4 IOMEM(0xe615004c) |
42 | #define PLLC01STPCR 0xe61500c8 | 42 | #define PLLC01STPCR IOMEM(0xe61500c8) |
43 | 43 | ||
44 | /* SYSC */ | 44 | /* SYSC */ |
45 | #define SBAR 0xe6180020 | 45 | #define SBAR IOMEM(0xe6180020) |
46 | #define WUPRMSK 0xe6180028 | 46 | #define WUPRMSK IOMEM(0xe6180028) |
47 | #define WUPSMSK 0xe618002c | 47 | #define WUPSMSK IOMEM(0xe618002c) |
48 | #define WUPSMSK2 0xe6180048 | 48 | #define WUPSMSK2 IOMEM(0xe6180048) |
49 | #define WUPSFAC 0xe6180098 | 49 | #define WUPSFAC IOMEM(0xe6180098) |
50 | #define IRQCR 0xe618022c | 50 | #define IRQCR IOMEM(0xe618022c) |
51 | #define IRQCR2 0xe6180238 | 51 | #define IRQCR2 IOMEM(0xe6180238) |
52 | #define IRQCR3 0xe6180244 | 52 | #define IRQCR3 IOMEM(0xe6180244) |
53 | #define IRQCR4 0xe6180248 | 53 | #define IRQCR4 IOMEM(0xe6180248) |
54 | #define PDNSEL 0xe6180254 | 54 | #define PDNSEL IOMEM(0xe6180254) |
55 | 55 | ||
56 | /* INTC */ | 56 | /* INTC */ |
57 | #define ICR1A 0xe6900000 | 57 | #define ICR1A IOMEM(0xe6900000) |
58 | #define ICR2A 0xe6900004 | 58 | #define ICR2A IOMEM(0xe6900004) |
59 | #define ICR3A 0xe6900008 | 59 | #define ICR3A IOMEM(0xe6900008) |
60 | #define ICR4A 0xe690000c | 60 | #define ICR4A IOMEM(0xe690000c) |
61 | #define INTMSK00A 0xe6900040 | 61 | #define INTMSK00A IOMEM(0xe6900040) |
62 | #define INTMSK10A 0xe6900044 | 62 | #define INTMSK10A IOMEM(0xe6900044) |
63 | #define INTMSK20A 0xe6900048 | 63 | #define INTMSK20A IOMEM(0xe6900048) |
64 | #define INTMSK30A 0xe690004c | 64 | #define INTMSK30A IOMEM(0xe690004c) |
65 | 65 | ||
66 | /* MFIS */ | 66 | /* MFIS */ |
67 | /* FIXME: pointing where? */ | ||
67 | #define SMFRAM 0xe6a70000 | 68 | #define SMFRAM 0xe6a70000 |
68 | 69 | ||
69 | /* AP-System Core */ | 70 | /* AP-System Core */ |
70 | #define APARMBAREA 0xe6f10020 | 71 | #define APARMBAREA IOMEM(0xe6f10020) |
71 | 72 | ||
72 | #ifdef CONFIG_PM | 73 | #ifdef CONFIG_PM |
73 | 74 | ||
diff --git a/arch/arm/mach-shmobile/setup-sh7367.c b/arch/arm/mach-shmobile/setup-sh7367.c index 2e3074ab75b3..e647f5410879 100644 --- a/arch/arm/mach-shmobile/setup-sh7367.c +++ b/arch/arm/mach-shmobile/setup-sh7367.c | |||
@@ -462,7 +462,7 @@ static void __init sh7367_earlytimer_init(void) | |||
462 | shmobile_earlytimer_init(); | 462 | shmobile_earlytimer_init(); |
463 | } | 463 | } |
464 | 464 | ||
465 | #define SYMSTPCR2 0xe6158048 | 465 | #define SYMSTPCR2 IOMEM(0xe6158048) |
466 | #define SYMSTPCR2_CMT1 (1 << 29) | 466 | #define SYMSTPCR2_CMT1 (1 << 29) |
467 | 467 | ||
468 | void __init sh7367_add_early_devices(void) | 468 | void __init sh7367_add_early_devices(void) |
diff --git a/arch/arm/mach-shmobile/setup-sh7377.c b/arch/arm/mach-shmobile/setup-sh7377.c index 855b1506caf8..edcf98bb7012 100644 --- a/arch/arm/mach-shmobile/setup-sh7377.c +++ b/arch/arm/mach-shmobile/setup-sh7377.c | |||
@@ -484,7 +484,7 @@ static void __init sh7377_earlytimer_init(void) | |||
484 | shmobile_earlytimer_init(); | 484 | shmobile_earlytimer_init(); |
485 | } | 485 | } |
486 | 486 | ||
487 | #define SMSTPCR3 0xe615013c | 487 | #define SMSTPCR3 IOMEM(0xe615013c) |
488 | #define SMSTPCR3_CMT1 (1 << 29) | 488 | #define SMSTPCR3_CMT1 (1 << 29) |
489 | 489 | ||
490 | void __init sh7377_add_early_devices(void) | 490 | void __init sh7377_add_early_devices(void) |
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index d230af656fc9..a13c97b4ba1d 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c | |||
@@ -759,7 +759,7 @@ static struct platform_device *sh73a0_late_devices[] __initdata = { | |||
759 | &mpdma0_device, | 759 | &mpdma0_device, |
760 | }; | 760 | }; |
761 | 761 | ||
762 | #define SRCR2 0xe61580b0 | 762 | #define SRCR2 IOMEM(0xe61580b0) |
763 | 763 | ||
764 | void __init sh73a0_add_standard_devices(void) | 764 | void __init sh73a0_add_standard_devices(void) |
765 | { | 765 | { |
diff --git a/arch/arm/mach-spear13xx/include/mach/spear.h b/arch/arm/mach-spear13xx/include/mach/spear.h index 65f27def239b..07d90acc92c8 100644 --- a/arch/arm/mach-spear13xx/include/mach/spear.h +++ b/arch/arm/mach-spear13xx/include/mach/spear.h | |||
@@ -17,26 +17,26 @@ | |||
17 | #include <asm/memory.h> | 17 | #include <asm/memory.h> |
18 | 18 | ||
19 | #define PERIP_GRP2_BASE UL(0xB3000000) | 19 | #define PERIP_GRP2_BASE UL(0xB3000000) |
20 | #define VA_PERIP_GRP2_BASE UL(0xFE000000) | 20 | #define VA_PERIP_GRP2_BASE IOMEM(0xFE000000) |
21 | #define MCIF_SDHCI_BASE UL(0xB3000000) | 21 | #define MCIF_SDHCI_BASE UL(0xB3000000) |
22 | #define SYSRAM0_BASE UL(0xB3800000) | 22 | #define SYSRAM0_BASE UL(0xB3800000) |
23 | #define VA_SYSRAM0_BASE UL(0xFE800000) | 23 | #define VA_SYSRAM0_BASE IOMEM(0xFE800000) |
24 | #define SYS_LOCATION (VA_SYSRAM0_BASE + 0x600) | 24 | #define SYS_LOCATION (VA_SYSRAM0_BASE + 0x600) |
25 | 25 | ||
26 | #define PERIP_GRP1_BASE UL(0xE0000000) | 26 | #define PERIP_GRP1_BASE UL(0xE0000000) |
27 | #define VA_PERIP_GRP1_BASE UL(0xFD000000) | 27 | #define VA_PERIP_GRP1_BASE IOMEM(0xFD000000) |
28 | #define UART_BASE UL(0xE0000000) | 28 | #define UART_BASE UL(0xE0000000) |
29 | #define VA_UART_BASE UL(0xFD000000) | 29 | #define VA_UART_BASE IOMEM(0xFD000000) |
30 | #define SSP_BASE UL(0xE0100000) | 30 | #define SSP_BASE UL(0xE0100000) |
31 | #define MISC_BASE UL(0xE0700000) | 31 | #define MISC_BASE UL(0xE0700000) |
32 | #define VA_MISC_BASE IOMEM(UL(0xFD700000)) | 32 | #define VA_MISC_BASE IOMEM(0xFD700000) |
33 | 33 | ||
34 | #define A9SM_AND_MPMC_BASE UL(0xEC000000) | 34 | #define A9SM_AND_MPMC_BASE UL(0xEC000000) |
35 | #define VA_A9SM_AND_MPMC_BASE UL(0xFC000000) | 35 | #define VA_A9SM_AND_MPMC_BASE IOMEM(0xFC000000) |
36 | 36 | ||
37 | /* A9SM peripheral offsets */ | 37 | /* A9SM peripheral offsets */ |
38 | #define A9SM_PERIP_BASE UL(0xEC800000) | 38 | #define A9SM_PERIP_BASE UL(0xEC800000) |
39 | #define VA_A9SM_PERIP_BASE UL(0xFC800000) | 39 | #define VA_A9SM_PERIP_BASE IOMEM(0xFC800000) |
40 | #define VA_SCU_BASE (VA_A9SM_PERIP_BASE + 0x00) | 40 | #define VA_SCU_BASE (VA_A9SM_PERIP_BASE + 0x00) |
41 | 41 | ||
42 | #define L2CC_BASE UL(0xED000000) | 42 | #define L2CC_BASE UL(0xED000000) |
diff --git a/arch/arm/mach-spear13xx/spear13xx.c b/arch/arm/mach-spear13xx/spear13xx.c index cf936b106e27..e10648801b2e 100644 --- a/arch/arm/mach-spear13xx/spear13xx.c +++ b/arch/arm/mach-spear13xx/spear13xx.c | |||
@@ -114,17 +114,17 @@ void __init spear13xx_l2x0_init(void) | |||
114 | */ | 114 | */ |
115 | struct map_desc spear13xx_io_desc[] __initdata = { | 115 | struct map_desc spear13xx_io_desc[] __initdata = { |
116 | { | 116 | { |
117 | .virtual = VA_PERIP_GRP2_BASE, | 117 | .virtual = (unsigned long)VA_PERIP_GRP2_BASE, |
118 | .pfn = __phys_to_pfn(PERIP_GRP2_BASE), | 118 | .pfn = __phys_to_pfn(PERIP_GRP2_BASE), |
119 | .length = SZ_16M, | 119 | .length = SZ_16M, |
120 | .type = MT_DEVICE | 120 | .type = MT_DEVICE |
121 | }, { | 121 | }, { |
122 | .virtual = VA_PERIP_GRP1_BASE, | 122 | .virtual = (unsigned long)VA_PERIP_GRP1_BASE, |
123 | .pfn = __phys_to_pfn(PERIP_GRP1_BASE), | 123 | .pfn = __phys_to_pfn(PERIP_GRP1_BASE), |
124 | .length = SZ_16M, | 124 | .length = SZ_16M, |
125 | .type = MT_DEVICE | 125 | .type = MT_DEVICE |
126 | }, { | 126 | }, { |
127 | .virtual = VA_A9SM_AND_MPMC_BASE, | 127 | .virtual = (unsigned long)VA_A9SM_AND_MPMC_BASE, |
128 | .pfn = __phys_to_pfn(A9SM_AND_MPMC_BASE), | 128 | .pfn = __phys_to_pfn(A9SM_AND_MPMC_BASE), |
129 | .length = SZ_16M, | 129 | .length = SZ_16M, |
130 | .type = MT_DEVICE | 130 | .type = MT_DEVICE |
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 9077aaa398d9..5f3c03b61f8e 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig | |||
@@ -34,7 +34,6 @@ config ARCH_TEGRA_3x_SOC | |||
34 | select USB_ARCH_HAS_EHCI if USB_SUPPORT | 34 | select USB_ARCH_HAS_EHCI if USB_SUPPORT |
35 | select USB_ULPI if USB | 35 | select USB_ULPI if USB |
36 | select USB_ULPI_VIEWPORT if USB_SUPPORT | 36 | select USB_ULPI_VIEWPORT if USB_SUPPORT |
37 | select USE_OF | ||
38 | select ARM_ERRATA_743622 | 37 | select ARM_ERRATA_743622 |
39 | select ARM_ERRATA_751472 | 38 | select ARM_ERRATA_751472 |
40 | select ARM_ERRATA_754322 | 39 | select ARM_ERRATA_754322 |
@@ -60,25 +59,6 @@ config TEGRA_AHB | |||
60 | 59 | ||
61 | comment "Tegra board type" | 60 | comment "Tegra board type" |
62 | 61 | ||
63 | config MACH_HARMONY | ||
64 | bool "Harmony board" | ||
65 | depends on ARCH_TEGRA_2x_SOC | ||
66 | help | ||
67 | Support for nVidia Harmony development platform | ||
68 | |||
69 | config MACH_PAZ00 | ||
70 | bool "Paz00 board" | ||
71 | depends on ARCH_TEGRA_2x_SOC | ||
72 | help | ||
73 | Support for the Toshiba AC100/Dynabook AZ netbook | ||
74 | |||
75 | config MACH_TRIMSLICE | ||
76 | bool "TrimSlice board" | ||
77 | depends on ARCH_TEGRA_2x_SOC | ||
78 | select TEGRA_PCI | ||
79 | help | ||
80 | Support for CompuLab TrimSlice platform | ||
81 | |||
82 | choice | 62 | choice |
83 | prompt "Default low-level debug console UART" | 63 | prompt "Default low-level debug console UART" |
84 | default TEGRA_DEBUG_UART_NONE | 64 | default TEGRA_DEBUG_UART_NONE |
@@ -130,13 +110,6 @@ config TEGRA_DEBUG_UART_AUTO_SCRATCH | |||
130 | 110 | ||
131 | endchoice | 111 | endchoice |
132 | 112 | ||
133 | config TEGRA_SYSTEM_DMA | ||
134 | bool "Enable system DMA driver for NVIDIA Tegra SoCs" | ||
135 | default y | ||
136 | help | ||
137 | Adds system DMA functionality for NVIDIA Tegra SoCs, used by | ||
138 | several Tegra device drivers | ||
139 | |||
140 | config TEGRA_EMC_SCALING_ENABLE | 113 | config TEGRA_EMC_SCALING_ENABLE |
141 | bool "Enable scaling the memory frequency" | 114 | bool "Enable scaling the memory frequency" |
142 | 115 | ||
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index 0e82b7f34fc1..191d973122a5 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile | |||
@@ -18,20 +18,12 @@ obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o | |||
18 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 18 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
19 | obj-$(CONFIG_SMP) += reset.o | 19 | obj-$(CONFIG_SMP) += reset.o |
20 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 20 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
21 | obj-$(CONFIG_TEGRA_SYSTEM_DMA) += dma.o | ||
22 | obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o | 21 | obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o |
23 | obj-$(CONFIG_TEGRA_PCI) += pcie.o | 22 | obj-$(CONFIG_TEGRA_PCI) += pcie.o |
24 | 23 | ||
25 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o | 24 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o |
26 | obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o | 25 | obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o |
27 | 26 | ||
28 | obj-$(CONFIG_MACH_HARMONY) += board-harmony.o | 27 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-harmony-pcie.o |
29 | obj-$(CONFIG_MACH_HARMONY) += board-harmony-pinmux.o | ||
30 | obj-$(CONFIG_MACH_HARMONY) += board-harmony-pcie.o | ||
31 | obj-$(CONFIG_MACH_HARMONY) += board-harmony-power.o | ||
32 | 28 | ||
33 | obj-$(CONFIG_MACH_PAZ00) += board-paz00.o | 29 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-paz00.o |
34 | obj-$(CONFIG_MACH_PAZ00) += board-paz00-pinmux.o | ||
35 | |||
36 | obj-$(CONFIG_MACH_TRIMSLICE) += board-trimslice.o | ||
37 | obj-$(CONFIG_MACH_TRIMSLICE) += board-trimslice-pinmux.o | ||
diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c index dc0fe389be56..b5015d0f1912 100644 --- a/arch/arm/mach-tegra/apbio.c +++ b/arch/arm/mach-tegra/apbio.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #include "apbio.h" | 29 | #include "apbio.h" |
30 | 30 | ||
31 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) || defined(CONFIG_TEGRA20_APB_DMA) | 31 | #if defined(CONFIG_TEGRA20_APB_DMA) |
32 | static DEFINE_MUTEX(tegra_apb_dma_lock); | 32 | static DEFINE_MUTEX(tegra_apb_dma_lock); |
33 | static u32 *tegra_apb_bb; | 33 | static u32 *tegra_apb_bb; |
34 | static dma_addr_t tegra_apb_bb_phys; | 34 | static dma_addr_t tegra_apb_bb_phys; |
@@ -37,121 +37,6 @@ static DECLARE_COMPLETION(tegra_apb_wait); | |||
37 | static u32 tegra_apb_readl_direct(unsigned long offset); | 37 | static u32 tegra_apb_readl_direct(unsigned long offset); |
38 | static void tegra_apb_writel_direct(u32 value, unsigned long offset); | 38 | static void tegra_apb_writel_direct(u32 value, unsigned long offset); |
39 | 39 | ||
40 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
41 | static struct tegra_dma_channel *tegra_apb_dma; | ||
42 | |||
43 | bool tegra_apb_init(void) | ||
44 | { | ||
45 | struct tegra_dma_channel *ch; | ||
46 | |||
47 | mutex_lock(&tegra_apb_dma_lock); | ||
48 | |||
49 | /* Check to see if we raced to setup */ | ||
50 | if (tegra_apb_dma) | ||
51 | goto out; | ||
52 | |||
53 | ch = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT | | ||
54 | TEGRA_DMA_SHARED); | ||
55 | |||
56 | if (!ch) | ||
57 | goto out_fail; | ||
58 | |||
59 | tegra_apb_bb = dma_alloc_coherent(NULL, sizeof(u32), | ||
60 | &tegra_apb_bb_phys, GFP_KERNEL); | ||
61 | if (!tegra_apb_bb) { | ||
62 | pr_err("%s: can not allocate bounce buffer\n", __func__); | ||
63 | tegra_dma_free_channel(ch); | ||
64 | goto out_fail; | ||
65 | } | ||
66 | |||
67 | tegra_apb_dma = ch; | ||
68 | out: | ||
69 | mutex_unlock(&tegra_apb_dma_lock); | ||
70 | return true; | ||
71 | |||
72 | out_fail: | ||
73 | mutex_unlock(&tegra_apb_dma_lock); | ||
74 | return false; | ||
75 | } | ||
76 | |||
77 | static void apb_dma_complete(struct tegra_dma_req *req) | ||
78 | { | ||
79 | complete(&tegra_apb_wait); | ||
80 | } | ||
81 | |||
82 | static u32 tegra_apb_readl_using_dma(unsigned long offset) | ||
83 | { | ||
84 | struct tegra_dma_req req; | ||
85 | int ret; | ||
86 | |||
87 | if (!tegra_apb_dma && !tegra_apb_init()) | ||
88 | return tegra_apb_readl_direct(offset); | ||
89 | |||
90 | mutex_lock(&tegra_apb_dma_lock); | ||
91 | req.complete = apb_dma_complete; | ||
92 | req.to_memory = 1; | ||
93 | req.dest_addr = tegra_apb_bb_phys; | ||
94 | req.dest_bus_width = 32; | ||
95 | req.dest_wrap = 1; | ||
96 | req.source_addr = offset; | ||
97 | req.source_bus_width = 32; | ||
98 | req.source_wrap = 4; | ||
99 | req.req_sel = TEGRA_DMA_REQ_SEL_CNTR; | ||
100 | req.size = 4; | ||
101 | |||
102 | INIT_COMPLETION(tegra_apb_wait); | ||
103 | |||
104 | tegra_dma_enqueue_req(tegra_apb_dma, &req); | ||
105 | |||
106 | ret = wait_for_completion_timeout(&tegra_apb_wait, | ||
107 | msecs_to_jiffies(50)); | ||
108 | |||
109 | if (WARN(ret == 0, "apb read dma timed out")) { | ||
110 | tegra_dma_dequeue_req(tegra_apb_dma, &req); | ||
111 | *(u32 *)tegra_apb_bb = 0; | ||
112 | } | ||
113 | |||
114 | mutex_unlock(&tegra_apb_dma_lock); | ||
115 | return *((u32 *)tegra_apb_bb); | ||
116 | } | ||
117 | |||
118 | static void tegra_apb_writel_using_dma(u32 value, unsigned long offset) | ||
119 | { | ||
120 | struct tegra_dma_req req; | ||
121 | int ret; | ||
122 | |||
123 | if (!tegra_apb_dma && !tegra_apb_init()) { | ||
124 | tegra_apb_writel_direct(value, offset); | ||
125 | return; | ||
126 | } | ||
127 | |||
128 | mutex_lock(&tegra_apb_dma_lock); | ||
129 | *((u32 *)tegra_apb_bb) = value; | ||
130 | req.complete = apb_dma_complete; | ||
131 | req.to_memory = 0; | ||
132 | req.dest_addr = offset; | ||
133 | req.dest_wrap = 4; | ||
134 | req.dest_bus_width = 32; | ||
135 | req.source_addr = tegra_apb_bb_phys; | ||
136 | req.source_bus_width = 32; | ||
137 | req.source_wrap = 1; | ||
138 | req.req_sel = TEGRA_DMA_REQ_SEL_CNTR; | ||
139 | req.size = 4; | ||
140 | |||
141 | INIT_COMPLETION(tegra_apb_wait); | ||
142 | |||
143 | tegra_dma_enqueue_req(tegra_apb_dma, &req); | ||
144 | |||
145 | ret = wait_for_completion_timeout(&tegra_apb_wait, | ||
146 | msecs_to_jiffies(50)); | ||
147 | |||
148 | if (WARN(ret == 0, "apb write dma timed out")) | ||
149 | tegra_dma_dequeue_req(tegra_apb_dma, &req); | ||
150 | |||
151 | mutex_unlock(&tegra_apb_dma_lock); | ||
152 | } | ||
153 | |||
154 | #else | ||
155 | static struct dma_chan *tegra_apb_dma_chan; | 40 | static struct dma_chan *tegra_apb_dma_chan; |
156 | static struct dma_slave_config dma_sconfig; | 41 | static struct dma_slave_config dma_sconfig; |
157 | 42 | ||
@@ -279,7 +164,6 @@ static void tegra_apb_writel_using_dma(u32 value, unsigned long offset) | |||
279 | pr_err("error in writing offset 0x%08lx using dma\n", offset); | 164 | pr_err("error in writing offset 0x%08lx using dma\n", offset); |
280 | mutex_unlock(&tegra_apb_dma_lock); | 165 | mutex_unlock(&tegra_apb_dma_lock); |
281 | } | 166 | } |
282 | #endif | ||
283 | #else | 167 | #else |
284 | #define tegra_apb_readl_using_dma tegra_apb_readl_direct | 168 | #define tegra_apb_readl_using_dma tegra_apb_readl_direct |
285 | #define tegra_apb_writel_using_dma tegra_apb_writel_direct | 169 | #define tegra_apb_writel_using_dma tegra_apb_writel_direct |
@@ -293,12 +177,12 @@ static apbio_write_fptr apbio_write; | |||
293 | 177 | ||
294 | static u32 tegra_apb_readl_direct(unsigned long offset) | 178 | static u32 tegra_apb_readl_direct(unsigned long offset) |
295 | { | 179 | { |
296 | return readl(IO_TO_VIRT(offset)); | 180 | return readl(IO_ADDRESS(offset)); |
297 | } | 181 | } |
298 | 182 | ||
299 | static void tegra_apb_writel_direct(u32 value, unsigned long offset) | 183 | static void tegra_apb_writel_direct(u32 value, unsigned long offset) |
300 | { | 184 | { |
301 | writel(value, IO_TO_VIRT(offset)); | 185 | writel(value, IO_ADDRESS(offset)); |
302 | } | 186 | } |
303 | 187 | ||
304 | void tegra_apb_io_init(void) | 188 | void tegra_apb_io_init(void) |
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c index c0999633a9ab..37007d60bc37 100644 --- a/arch/arm/mach-tegra/board-dt-tegra20.c +++ b/arch/arm/mach-tegra/board-dt-tegra20.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
43 | 43 | ||
44 | #include "board.h" | 44 | #include "board.h" |
45 | #include "board-harmony.h" | ||
46 | #include "clock.h" | 45 | #include "clock.h" |
47 | #include "devices.h" | 46 | #include "devices.h" |
48 | 47 | ||
@@ -95,54 +94,40 @@ static void __init tegra_dt_init(void) | |||
95 | tegra20_auxdata_lookup, NULL); | 94 | tegra20_auxdata_lookup, NULL); |
96 | } | 95 | } |
97 | 96 | ||
98 | #ifdef CONFIG_MACH_TRIMSLICE | ||
99 | static void __init trimslice_init(void) | 97 | static void __init trimslice_init(void) |
100 | { | 98 | { |
99 | #ifdef CONFIG_TEGRA_PCI | ||
101 | int ret; | 100 | int ret; |
102 | 101 | ||
103 | ret = tegra_pcie_init(true, true); | 102 | ret = tegra_pcie_init(true, true); |
104 | if (ret) | 103 | if (ret) |
105 | pr_err("tegra_pci_init() failed: %d\n", ret); | 104 | pr_err("tegra_pci_init() failed: %d\n", ret); |
106 | } | ||
107 | #endif | 105 | #endif |
106 | } | ||
108 | 107 | ||
109 | #ifdef CONFIG_MACH_HARMONY | ||
110 | static void __init harmony_init(void) | 108 | static void __init harmony_init(void) |
111 | { | 109 | { |
110 | #ifdef CONFIG_TEGRA_PCI | ||
112 | int ret; | 111 | int ret; |
113 | 112 | ||
114 | ret = harmony_regulator_init(); | ||
115 | if (ret) { | ||
116 | pr_err("harmony_regulator_init() failed: %d\n", ret); | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | ret = harmony_pcie_init(); | 113 | ret = harmony_pcie_init(); |
121 | if (ret) | 114 | if (ret) |
122 | pr_err("harmony_pcie_init() failed: %d\n", ret); | 115 | pr_err("harmony_pcie_init() failed: %d\n", ret); |
123 | } | ||
124 | #endif | 116 | #endif |
117 | } | ||
125 | 118 | ||
126 | #ifdef CONFIG_MACH_PAZ00 | ||
127 | static void __init paz00_init(void) | 119 | static void __init paz00_init(void) |
128 | { | 120 | { |
129 | tegra_paz00_wifikill_init(); | 121 | tegra_paz00_wifikill_init(); |
130 | } | 122 | } |
131 | #endif | ||
132 | 123 | ||
133 | static struct { | 124 | static struct { |
134 | char *machine; | 125 | char *machine; |
135 | void (*init)(void); | 126 | void (*init)(void); |
136 | } board_init_funcs[] = { | 127 | } board_init_funcs[] = { |
137 | #ifdef CONFIG_MACH_TRIMSLICE | ||
138 | { "compulab,trimslice", trimslice_init }, | 128 | { "compulab,trimslice", trimslice_init }, |
139 | #endif | ||
140 | #ifdef CONFIG_MACH_HARMONY | ||
141 | { "nvidia,harmony", harmony_init }, | 129 | { "nvidia,harmony", harmony_init }, |
142 | #endif | ||
143 | #ifdef CONFIG_MACH_PAZ00 | ||
144 | { "compal,paz00", paz00_init }, | 130 | { "compal,paz00", paz00_init }, |
145 | #endif | ||
146 | }; | 131 | }; |
147 | 132 | ||
148 | static void __init tegra_dt_init_late(void) | 133 | static void __init tegra_dt_init_late(void) |
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c index e8c3fda9bec2..3cdc1bb8254c 100644 --- a/arch/arm/mach-tegra/board-harmony-pcie.c +++ b/arch/arm/mach-tegra/board-harmony-pcie.c | |||
@@ -18,35 +18,57 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/err.h> | 20 | #include <linux/err.h> |
21 | #include <linux/of_gpio.h> | ||
21 | #include <linux/regulator/consumer.h> | 22 | #include <linux/regulator/consumer.h> |
22 | 23 | ||
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
24 | 25 | ||
25 | #include "board.h" | 26 | #include "board.h" |
26 | #include "board-harmony.h" | ||
27 | 27 | ||
28 | #ifdef CONFIG_TEGRA_PCI | 28 | #ifdef CONFIG_TEGRA_PCI |
29 | 29 | ||
30 | int __init harmony_pcie_init(void) | 30 | int __init harmony_pcie_init(void) |
31 | { | 31 | { |
32 | struct device_node *np; | ||
33 | int en_vdd_1v05; | ||
32 | struct regulator *regulator = NULL; | 34 | struct regulator *regulator = NULL; |
33 | int err; | 35 | int err; |
34 | 36 | ||
35 | err = gpio_request(TEGRA_GPIO_EN_VDD_1V05_GPIO, "EN_VDD_1V05"); | 37 | np = of_find_node_by_path("/regulators/regulator@3"); |
36 | if (err) | 38 | if (!np) { |
39 | pr_err("%s: of_find_node_by_path failed\n", __func__); | ||
40 | return -ENODEV; | ||
41 | } | ||
42 | |||
43 | en_vdd_1v05 = of_get_named_gpio(np, "gpio", 0); | ||
44 | if (en_vdd_1v05 < 0) { | ||
45 | pr_err("%s: of_get_named_gpio failed: %d\n", __func__, | ||
46 | en_vdd_1v05); | ||
47 | return en_vdd_1v05; | ||
48 | } | ||
49 | |||
50 | err = gpio_request(en_vdd_1v05, "EN_VDD_1V05"); | ||
51 | if (err) { | ||
52 | pr_err("%s: gpio_request failed: %d\n", __func__, err); | ||
37 | return err; | 53 | return err; |
54 | } | ||
38 | 55 | ||
39 | gpio_direction_output(TEGRA_GPIO_EN_VDD_1V05_GPIO, 1); | 56 | gpio_direction_output(en_vdd_1v05, 1); |
40 | 57 | ||
41 | regulator = regulator_get(NULL, "pex_clk"); | 58 | regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk"); |
42 | if (IS_ERR_OR_NULL(regulator)) | 59 | if (IS_ERR_OR_NULL(regulator)) { |
60 | pr_err("%s: regulator_get failed: %d\n", __func__, | ||
61 | (int)PTR_ERR(regulator)); | ||
43 | goto err_reg; | 62 | goto err_reg; |
63 | } | ||
44 | 64 | ||
45 | regulator_enable(regulator); | 65 | regulator_enable(regulator); |
46 | 66 | ||
47 | err = tegra_pcie_init(true, true); | 67 | err = tegra_pcie_init(true, true); |
48 | if (err) | 68 | if (err) { |
69 | pr_err("%s: tegra_pcie_init failed: %d\n", __func__, err); | ||
49 | goto err_pcie; | 70 | goto err_pcie; |
71 | } | ||
50 | 72 | ||
51 | return 0; | 73 | return 0; |
52 | 74 | ||
@@ -54,20 +76,9 @@ err_pcie: | |||
54 | regulator_disable(regulator); | 76 | regulator_disable(regulator); |
55 | regulator_put(regulator); | 77 | regulator_put(regulator); |
56 | err_reg: | 78 | err_reg: |
57 | gpio_free(TEGRA_GPIO_EN_VDD_1V05_GPIO); | 79 | gpio_free(en_vdd_1v05); |
58 | 80 | ||
59 | return err; | 81 | return err; |
60 | } | 82 | } |
61 | 83 | ||
62 | static int __init harmony_pcie_initcall(void) | ||
63 | { | ||
64 | if (!machine_is_harmony()) | ||
65 | return 0; | ||
66 | |||
67 | return harmony_pcie_init(); | ||
68 | } | ||
69 | |||
70 | /* PCI should be initialized after I2C, mfd and regulators */ | ||
71 | subsys_initcall_sync(harmony_pcie_initcall); | ||
72 | |||
73 | #endif | 84 | #endif |
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c deleted file mode 100644 index 83d420fbc58c..000000000000 --- a/arch/arm/mach-tegra/board-harmony-pinmux.c +++ /dev/null | |||
@@ -1,156 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-harmony-pinmux.c | ||
3 | * | ||
4 | * Copyright (C) 2010 Google, Inc. | ||
5 | * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. | ||
6 | * | ||
7 | * This software is licensed under the terms of the GNU General Public | ||
8 | * License version 2, as published by the Free Software Foundation, and | ||
9 | * may be copied, distributed, and modified under those terms. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | |||
20 | #include "board-harmony.h" | ||
21 | #include "board-pinmux.h" | ||
22 | |||
23 | static struct pinctrl_map harmony_map[] = { | ||
24 | TEGRA_MAP_MUXCONF("ata", "ide", none, driven), | ||
25 | TEGRA_MAP_MUXCONF("atb", "sdio4", none, driven), | ||
26 | TEGRA_MAP_MUXCONF("atc", "nand", none, driven), | ||
27 | TEGRA_MAP_MUXCONF("atd", "gmi", none, driven), | ||
28 | TEGRA_MAP_MUXCONF("ate", "gmi", none, driven), | ||
29 | TEGRA_MAP_MUXCONF("cdev1", "plla_out", none, driven), | ||
30 | TEGRA_MAP_MUXCONF("cdev2", "pllp_out4", down, tristate), | ||
31 | TEGRA_MAP_MUXCONF("crtp", "crt", none, tristate), | ||
32 | TEGRA_MAP_MUXCONF("csus", "vi_sensor_clk", down, tristate), | ||
33 | TEGRA_MAP_MUXCONF("dap1", "dap1", none, driven), | ||
34 | TEGRA_MAP_MUXCONF("dap2", "dap2", none, tristate), | ||
35 | TEGRA_MAP_MUXCONF("dap3", "dap3", none, tristate), | ||
36 | TEGRA_MAP_MUXCONF("dap4", "dap4", none, tristate), | ||
37 | TEGRA_MAP_MUXCONF("ddc", "i2c2", up, driven), | ||
38 | TEGRA_MAP_MUXCONF("dta", "sdio2", up, driven), | ||
39 | TEGRA_MAP_MUXCONF("dtb", "rsvd1", none, driven), | ||
40 | TEGRA_MAP_MUXCONF("dtc", "rsvd1", none, tristate), | ||
41 | TEGRA_MAP_MUXCONF("dtd", "sdio2", up, driven), | ||
42 | TEGRA_MAP_MUXCONF("dte", "rsvd1", none, tristate), | ||
43 | TEGRA_MAP_MUXCONF("dtf", "i2c3", none, tristate), | ||
44 | TEGRA_MAP_MUXCONF("gma", "sdio4", none, driven), | ||
45 | TEGRA_MAP_MUXCONF("gmb", "gmi", none, driven), | ||
46 | TEGRA_MAP_MUXCONF("gmc", "uartd", none, driven), | ||
47 | TEGRA_MAP_MUXCONF("gmd", "gmi", none, driven), | ||
48 | TEGRA_MAP_MUXCONF("gme", "sdio4", none, driven), | ||
49 | TEGRA_MAP_MUXCONF("gpu", "gmi", none, tristate), | ||
50 | TEGRA_MAP_MUXCONF("gpu7", "rtck", none, driven), | ||
51 | TEGRA_MAP_MUXCONF("gpv", "pcie", none, driven), | ||
52 | TEGRA_MAP_MUXCONF("hdint", "hdmi", na, tristate), | ||
53 | TEGRA_MAP_MUXCONF("i2cp", "i2cp", none, driven), | ||
54 | TEGRA_MAP_MUXCONF("irrx", "uarta", up, tristate), | ||
55 | TEGRA_MAP_MUXCONF("irtx", "uarta", up, tristate), | ||
56 | TEGRA_MAP_MUXCONF("kbca", "kbc", up, driven), | ||
57 | TEGRA_MAP_MUXCONF("kbcb", "kbc", up, driven), | ||
58 | TEGRA_MAP_MUXCONF("kbcc", "kbc", up, driven), | ||
59 | TEGRA_MAP_MUXCONF("kbcd", "kbc", up, driven), | ||
60 | TEGRA_MAP_MUXCONF("kbce", "kbc", up, driven), | ||
61 | TEGRA_MAP_MUXCONF("kbcf", "kbc", up, driven), | ||
62 | TEGRA_MAP_MUXCONF("lcsn", "displaya", na, tristate), | ||
63 | TEGRA_MAP_MUXCONF("ld0", "displaya", na, driven), | ||
64 | TEGRA_MAP_MUXCONF("ld1", "displaya", na, driven), | ||
65 | TEGRA_MAP_MUXCONF("ld10", "displaya", na, driven), | ||
66 | TEGRA_MAP_MUXCONF("ld11", "displaya", na, driven), | ||
67 | TEGRA_MAP_MUXCONF("ld12", "displaya", na, driven), | ||
68 | TEGRA_MAP_MUXCONF("ld13", "displaya", na, driven), | ||
69 | TEGRA_MAP_MUXCONF("ld14", "displaya", na, driven), | ||
70 | TEGRA_MAP_MUXCONF("ld15", "displaya", na, driven), | ||
71 | TEGRA_MAP_MUXCONF("ld16", "displaya", na, driven), | ||
72 | TEGRA_MAP_MUXCONF("ld17", "displaya", na, driven), | ||
73 | TEGRA_MAP_MUXCONF("ld2", "displaya", na, driven), | ||
74 | TEGRA_MAP_MUXCONF("ld3", "displaya", na, driven), | ||
75 | TEGRA_MAP_MUXCONF("ld4", "displaya", na, driven), | ||
76 | TEGRA_MAP_MUXCONF("ld5", "displaya", na, driven), | ||
77 | TEGRA_MAP_MUXCONF("ld6", "displaya", na, driven), | ||
78 | TEGRA_MAP_MUXCONF("ld7", "displaya", na, driven), | ||
79 | TEGRA_MAP_MUXCONF("ld8", "displaya", na, driven), | ||
80 | TEGRA_MAP_MUXCONF("ld9", "displaya", na, driven), | ||
81 | TEGRA_MAP_MUXCONF("ldc", "displaya", na, tristate), | ||
82 | TEGRA_MAP_MUXCONF("ldi", "displaya", na, driven), | ||
83 | TEGRA_MAP_MUXCONF("lhp0", "displaya", na, driven), | ||
84 | TEGRA_MAP_MUXCONF("lhp1", "displaya", na, driven), | ||
85 | TEGRA_MAP_MUXCONF("lhp2", "displaya", na, driven), | ||
86 | TEGRA_MAP_MUXCONF("lhs", "displaya", na, driven), | ||
87 | TEGRA_MAP_MUXCONF("lm0", "displaya", na, driven), | ||
88 | TEGRA_MAP_MUXCONF("lm1", "displaya", na, tristate), | ||
89 | TEGRA_MAP_MUXCONF("lpp", "displaya", na, driven), | ||
90 | TEGRA_MAP_MUXCONF("lpw0", "displaya", na, driven), | ||
91 | TEGRA_MAP_MUXCONF("lpw1", "displaya", na, tristate), | ||
92 | TEGRA_MAP_MUXCONF("lpw2", "displaya", na, driven), | ||
93 | TEGRA_MAP_MUXCONF("lsc0", "displaya", na, driven), | ||
94 | TEGRA_MAP_MUXCONF("lsc1", "displaya", na, tristate), | ||
95 | TEGRA_MAP_MUXCONF("lsck", "displaya", na, tristate), | ||
96 | TEGRA_MAP_MUXCONF("lsda", "displaya", na, tristate), | ||
97 | TEGRA_MAP_MUXCONF("lsdi", "displaya", na, tristate), | ||
98 | TEGRA_MAP_MUXCONF("lspi", "displaya", na, driven), | ||
99 | TEGRA_MAP_MUXCONF("lvp0", "displaya", na, tristate), | ||
100 | TEGRA_MAP_MUXCONF("lvp1", "displaya", na, driven), | ||
101 | TEGRA_MAP_MUXCONF("lvs", "displaya", na, driven), | ||
102 | TEGRA_MAP_MUXCONF("owc", "rsvd2", na, tristate), | ||
103 | TEGRA_MAP_MUXCONF("pmc", "pwr_on", na, driven), | ||
104 | TEGRA_MAP_MUXCONF("pta", "hdmi", none, driven), | ||
105 | TEGRA_MAP_MUXCONF("rm", "i2c1", none, driven), | ||
106 | TEGRA_MAP_MUXCONF("sdb", "pwm", na, tristate), | ||
107 | TEGRA_MAP_MUXCONF("sdc", "pwm", up, driven), | ||
108 | TEGRA_MAP_MUXCONF("sdd", "pwm", up, tristate), | ||
109 | TEGRA_MAP_MUXCONF("sdio1", "sdio1", none, tristate), | ||
110 | TEGRA_MAP_MUXCONF("slxa", "pcie", none, driven), | ||
111 | TEGRA_MAP_MUXCONF("slxc", "spdif", none, tristate), | ||
112 | TEGRA_MAP_MUXCONF("slxd", "spdif", none, tristate), | ||
113 | TEGRA_MAP_MUXCONF("slxk", "pcie", none, driven), | ||
114 | TEGRA_MAP_MUXCONF("spdi", "rsvd2", none, tristate), | ||
115 | TEGRA_MAP_MUXCONF("spdo", "rsvd2", none, tristate), | ||
116 | TEGRA_MAP_MUXCONF("spia", "gmi", none, driven), | ||
117 | TEGRA_MAP_MUXCONF("spib", "gmi", none, driven), | ||
118 | TEGRA_MAP_MUXCONF("spic", "gmi", up, tristate), | ||
119 | TEGRA_MAP_MUXCONF("spid", "spi1", down, tristate), | ||
120 | TEGRA_MAP_MUXCONF("spie", "spi1", up, tristate), | ||
121 | TEGRA_MAP_MUXCONF("spif", "spi1", down, tristate), | ||
122 | TEGRA_MAP_MUXCONF("spig", "spi2_alt", none, tristate), | ||
123 | TEGRA_MAP_MUXCONF("spih", "spi2_alt", up, tristate), | ||
124 | TEGRA_MAP_MUXCONF("uaa", "ulpi", up, tristate), | ||
125 | TEGRA_MAP_MUXCONF("uab", "ulpi", up, tristate), | ||
126 | TEGRA_MAP_MUXCONF("uac", "rsvd2", none, tristate), | ||
127 | TEGRA_MAP_MUXCONF("uad", "irda", up, tristate), | ||
128 | TEGRA_MAP_MUXCONF("uca", "uartc", up, tristate), | ||
129 | TEGRA_MAP_MUXCONF("ucb", "uartc", up, tristate), | ||
130 | TEGRA_MAP_MUXCONF("uda", "ulpi", none, tristate), | ||
131 | TEGRA_MAP_CONF("ck32", none, na), | ||
132 | TEGRA_MAP_CONF("ddrc", none, na), | ||
133 | TEGRA_MAP_CONF("pmca", none, na), | ||
134 | TEGRA_MAP_CONF("pmcb", none, na), | ||
135 | TEGRA_MAP_CONF("pmcc", none, na), | ||
136 | TEGRA_MAP_CONF("pmcd", none, na), | ||
137 | TEGRA_MAP_CONF("pmce", none, na), | ||
138 | TEGRA_MAP_CONF("xm2c", none, na), | ||
139 | TEGRA_MAP_CONF("xm2d", none, na), | ||
140 | TEGRA_MAP_CONF("ls", up, na), | ||
141 | TEGRA_MAP_CONF("lc", up, na), | ||
142 | TEGRA_MAP_CONF("ld17_0", down, na), | ||
143 | TEGRA_MAP_CONF("ld19_18", down, na), | ||
144 | TEGRA_MAP_CONF("ld21_20", down, na), | ||
145 | TEGRA_MAP_CONF("ld23_22", down, na), | ||
146 | }; | ||
147 | |||
148 | static struct tegra_board_pinmux_conf conf = { | ||
149 | .maps = harmony_map, | ||
150 | .map_count = ARRAY_SIZE(harmony_map), | ||
151 | }; | ||
152 | |||
153 | void harmony_pinmux_init(void) | ||
154 | { | ||
155 | tegra_board_pinmux_init(&conf, NULL); | ||
156 | } | ||
diff --git a/arch/arm/mach-tegra/board-harmony-power.c b/arch/arm/mach-tegra/board-harmony-power.c deleted file mode 100644 index 94486e7e9dfd..000000000000 --- a/arch/arm/mach-tegra/board-harmony-power.c +++ /dev/null | |||
@@ -1,156 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 NVIDIA, Inc. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
16 | * 02111-1307, USA | ||
17 | */ | ||
18 | #include <linux/i2c.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/gpio.h> | ||
21 | #include <linux/regulator/machine.h> | ||
22 | #include <linux/regulator/fixed.h> | ||
23 | #include <linux/mfd/tps6586x.h> | ||
24 | #include <linux/of.h> | ||
25 | #include <linux/of_i2c.h> | ||
26 | |||
27 | #include <asm/mach-types.h> | ||
28 | |||
29 | #include <mach/irqs.h> | ||
30 | |||
31 | #include "board-harmony.h" | ||
32 | |||
33 | static struct regulator_consumer_supply tps658621_ldo0_supply[] = { | ||
34 | REGULATOR_SUPPLY("pex_clk", NULL), | ||
35 | }; | ||
36 | |||
37 | static struct regulator_init_data ldo0_data = { | ||
38 | .supply_regulator = "vdd_sm2", | ||
39 | .constraints = { | ||
40 | .name = "vdd_ldo0", | ||
41 | .min_uV = 3300 * 1000, | ||
42 | .max_uV = 3300 * 1000, | ||
43 | .valid_modes_mask = (REGULATOR_MODE_NORMAL | | ||
44 | REGULATOR_MODE_STANDBY), | ||
45 | .valid_ops_mask = (REGULATOR_CHANGE_MODE | | ||
46 | REGULATOR_CHANGE_STATUS | | ||
47 | REGULATOR_CHANGE_VOLTAGE), | ||
48 | .apply_uV = 1, | ||
49 | }, | ||
50 | .num_consumer_supplies = ARRAY_SIZE(tps658621_ldo0_supply), | ||
51 | .consumer_supplies = tps658621_ldo0_supply, | ||
52 | }; | ||
53 | |||
54 | #define HARMONY_REGULATOR_INIT(_id, _name, _supply, _minmv, _maxmv, _on)\ | ||
55 | static struct regulator_init_data _id##_data = { \ | ||
56 | .supply_regulator = _supply, \ | ||
57 | .constraints = { \ | ||
58 | .name = _name, \ | ||
59 | .min_uV = (_minmv)*1000, \ | ||
60 | .max_uV = (_maxmv)*1000, \ | ||
61 | .valid_modes_mask = (REGULATOR_MODE_NORMAL | \ | ||
62 | REGULATOR_MODE_STANDBY), \ | ||
63 | .valid_ops_mask = (REGULATOR_CHANGE_MODE | \ | ||
64 | REGULATOR_CHANGE_STATUS | \ | ||
65 | REGULATOR_CHANGE_VOLTAGE), \ | ||
66 | .always_on = _on, \ | ||
67 | }, \ | ||
68 | } | ||
69 | |||
70 | static struct regulator_init_data sys_data = { | ||
71 | .supply_regulator = "vdd_5v0", | ||
72 | .constraints = { | ||
73 | .name = "vdd_sys", | ||
74 | }, | ||
75 | }; | ||
76 | |||
77 | HARMONY_REGULATOR_INIT(sm0, "vdd_sm0", "vdd_sys", 725, 1500, 1); | ||
78 | HARMONY_REGULATOR_INIT(sm1, "vdd_sm1", "vdd_sys", 725, 1500, 1); | ||
79 | HARMONY_REGULATOR_INIT(sm2, "vdd_sm2", "vdd_sys", 3000, 4550, 1); | ||
80 | HARMONY_REGULATOR_INIT(ldo1, "vdd_ldo1", "vdd_sm2", 725, 1500, 1); | ||
81 | HARMONY_REGULATOR_INIT(ldo2, "vdd_ldo2", "vdd_sm2", 725, 1500, 0); | ||
82 | HARMONY_REGULATOR_INIT(ldo3, "vdd_ldo3", "vdd_sm2", 1250, 3300, 1); | ||
83 | HARMONY_REGULATOR_INIT(ldo4, "vdd_ldo4", "vdd_sm2", 1700, 2475, 1); | ||
84 | HARMONY_REGULATOR_INIT(ldo5, "vdd_ldo5", "vdd_sys", 1250, 3300, 1); | ||
85 | HARMONY_REGULATOR_INIT(ldo6, "vdd_ldo6", "vdd_sm2", 1250, 3300, 0); | ||
86 | HARMONY_REGULATOR_INIT(ldo7, "vdd_ldo7", "vdd_sm2", 1250, 3300, 0); | ||
87 | HARMONY_REGULATOR_INIT(ldo8, "vdd_ldo8", "vdd_sm2", 1250, 3300, 0); | ||
88 | HARMONY_REGULATOR_INIT(ldo9, "vdd_ldo9", "vdd_sm2", 1250, 3300, 1); | ||
89 | |||
90 | #define TPS_REG(_id, _data) \ | ||
91 | { \ | ||
92 | .id = TPS6586X_ID_##_id, \ | ||
93 | .name = "tps6586x-regulator", \ | ||
94 | .platform_data = _data, \ | ||
95 | } | ||
96 | |||
97 | static struct tps6586x_subdev_info tps_devs[] = { | ||
98 | TPS_REG(SYS, &sys_data), | ||
99 | TPS_REG(SM_0, &sm0_data), | ||
100 | TPS_REG(SM_1, &sm1_data), | ||
101 | TPS_REG(SM_2, &sm2_data), | ||
102 | TPS_REG(LDO_0, &ldo0_data), | ||
103 | TPS_REG(LDO_1, &ldo1_data), | ||
104 | TPS_REG(LDO_2, &ldo2_data), | ||
105 | TPS_REG(LDO_3, &ldo3_data), | ||
106 | TPS_REG(LDO_4, &ldo4_data), | ||
107 | TPS_REG(LDO_5, &ldo5_data), | ||
108 | TPS_REG(LDO_6, &ldo6_data), | ||
109 | TPS_REG(LDO_7, &ldo7_data), | ||
110 | TPS_REG(LDO_8, &ldo8_data), | ||
111 | TPS_REG(LDO_9, &ldo9_data), | ||
112 | }; | ||
113 | |||
114 | static struct tps6586x_platform_data tps_platform = { | ||
115 | .irq_base = TEGRA_NR_IRQS, | ||
116 | .num_subdevs = ARRAY_SIZE(tps_devs), | ||
117 | .subdevs = tps_devs, | ||
118 | .gpio_base = HARMONY_GPIO_TPS6586X(0), | ||
119 | }; | ||
120 | |||
121 | static struct i2c_board_info __initdata harmony_regulators[] = { | ||
122 | { | ||
123 | I2C_BOARD_INFO("tps6586x", 0x34), | ||
124 | .irq = INT_EXTERNAL_PMU, | ||
125 | .platform_data = &tps_platform, | ||
126 | }, | ||
127 | }; | ||
128 | |||
129 | int __init harmony_regulator_init(void) | ||
130 | { | ||
131 | regulator_register_always_on(0, "vdd_5v0", | ||
132 | NULL, 0, 5000000); | ||
133 | |||
134 | if (machine_is_harmony()) { | ||
135 | i2c_register_board_info(3, harmony_regulators, 1); | ||
136 | } else { /* Harmony, booted using device tree */ | ||
137 | struct device_node *np; | ||
138 | struct i2c_adapter *adapter; | ||
139 | |||
140 | np = of_find_node_by_path("/i2c@7000d000"); | ||
141 | if (np == NULL) { | ||
142 | pr_err("Could not find device_node for DVC I2C\n"); | ||
143 | return -ENODEV; | ||
144 | } | ||
145 | |||
146 | adapter = of_find_i2c_adapter_by_node(np); | ||
147 | if (!adapter) { | ||
148 | pr_err("Could not find i2c_adapter for DVC I2C\n"); | ||
149 | return -ENODEV; | ||
150 | } | ||
151 | |||
152 | i2c_new_device(adapter, harmony_regulators); | ||
153 | } | ||
154 | |||
155 | return 0; | ||
156 | } | ||
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c deleted file mode 100644 index e65e837f4013..000000000000 --- a/arch/arm/mach-tegra/board-harmony.c +++ /dev/null | |||
@@ -1,197 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-harmony.c | ||
3 | * | ||
4 | * Copyright (C) 2010 Google, Inc. | ||
5 | * Copyright (C) 2011 NVIDIA, Inc. | ||
6 | * | ||
7 | * This software is licensed under the terms of the GNU General Public | ||
8 | * License version 2, as published by the Free Software Foundation, and | ||
9 | * may be copied, distributed, and modified under those terms. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/serial_8250.h> | ||
22 | #include <linux/of_serial.h> | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/dma-mapping.h> | ||
25 | #include <linux/pda_power.h> | ||
26 | #include <linux/io.h> | ||
27 | #include <linux/gpio.h> | ||
28 | #include <linux/i2c.h> | ||
29 | |||
30 | #include <sound/wm8903.h> | ||
31 | |||
32 | #include <asm/mach-types.h> | ||
33 | #include <asm/mach/arch.h> | ||
34 | #include <asm/mach/time.h> | ||
35 | #include <asm/hardware/gic.h> | ||
36 | #include <asm/setup.h> | ||
37 | |||
38 | #include <mach/tegra_wm8903_pdata.h> | ||
39 | #include <mach/iomap.h> | ||
40 | #include <mach/irqs.h> | ||
41 | #include <mach/sdhci.h> | ||
42 | |||
43 | #include "board.h" | ||
44 | #include "board-harmony.h" | ||
45 | #include "clock.h" | ||
46 | #include "devices.h" | ||
47 | #include "gpio-names.h" | ||
48 | |||
49 | static struct plat_serial8250_port debug_uart_platform_data[] = { | ||
50 | { | ||
51 | .membase = IO_ADDRESS(TEGRA_UARTD_BASE), | ||
52 | .mapbase = TEGRA_UARTD_BASE, | ||
53 | .irq = INT_UARTD, | ||
54 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
55 | .type = PORT_TEGRA, | ||
56 | .handle_break = tegra_serial_handle_break, | ||
57 | .iotype = UPIO_MEM, | ||
58 | .regshift = 2, | ||
59 | .uartclk = 216000000, | ||
60 | }, { | ||
61 | .flags = 0 | ||
62 | } | ||
63 | }; | ||
64 | |||
65 | static struct platform_device debug_uart = { | ||
66 | .name = "serial8250", | ||
67 | .id = PLAT8250_DEV_PLATFORM, | ||
68 | .dev = { | ||
69 | .platform_data = debug_uart_platform_data, | ||
70 | }, | ||
71 | }; | ||
72 | |||
73 | static struct tegra_wm8903_platform_data harmony_audio_pdata = { | ||
74 | .gpio_spkr_en = TEGRA_GPIO_SPKR_EN, | ||
75 | .gpio_hp_det = TEGRA_GPIO_HP_DET, | ||
76 | .gpio_hp_mute = -1, | ||
77 | .gpio_int_mic_en = TEGRA_GPIO_INT_MIC_EN, | ||
78 | .gpio_ext_mic_en = TEGRA_GPIO_EXT_MIC_EN, | ||
79 | }; | ||
80 | |||
81 | static struct platform_device harmony_audio_device = { | ||
82 | .name = "tegra-snd-wm8903", | ||
83 | .id = 0, | ||
84 | .dev = { | ||
85 | .platform_data = &harmony_audio_pdata, | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | static struct wm8903_platform_data harmony_wm8903_pdata = { | ||
90 | .irq_active_low = 0, | ||
91 | .micdet_cfg = 0, | ||
92 | .micdet_delay = 100, | ||
93 | .gpio_base = HARMONY_GPIO_WM8903(0), | ||
94 | .gpio_cfg = { | ||
95 | 0, | ||
96 | 0, | ||
97 | WM8903_GPIO_CONFIG_ZERO, | ||
98 | 0, | ||
99 | 0, | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | static struct i2c_board_info __initdata wm8903_board_info = { | ||
104 | I2C_BOARD_INFO("wm8903", 0x1a), | ||
105 | .platform_data = &harmony_wm8903_pdata, | ||
106 | }; | ||
107 | |||
108 | static void __init harmony_i2c_init(void) | ||
109 | { | ||
110 | platform_device_register(&tegra_i2c_device1); | ||
111 | platform_device_register(&tegra_i2c_device2); | ||
112 | platform_device_register(&tegra_i2c_device3); | ||
113 | platform_device_register(&tegra_i2c_device4); | ||
114 | |||
115 | wm8903_board_info.irq = gpio_to_irq(TEGRA_GPIO_CDC_IRQ); | ||
116 | i2c_register_board_info(0, &wm8903_board_info, 1); | ||
117 | } | ||
118 | |||
119 | static struct platform_device *harmony_devices[] __initdata = { | ||
120 | &debug_uart, | ||
121 | &tegra_sdhci_device1, | ||
122 | &tegra_sdhci_device2, | ||
123 | &tegra_sdhci_device4, | ||
124 | &tegra_ehci3_device, | ||
125 | &tegra_i2s_device1, | ||
126 | &tegra_das_device, | ||
127 | &harmony_audio_device, | ||
128 | }; | ||
129 | |||
130 | static void __init tegra_harmony_fixup(struct tag *tags, char **cmdline, | ||
131 | struct meminfo *mi) | ||
132 | { | ||
133 | mi->nr_banks = 2; | ||
134 | mi->bank[0].start = PHYS_OFFSET; | ||
135 | mi->bank[0].size = 448 * SZ_1M; | ||
136 | mi->bank[1].start = SZ_512M; | ||
137 | mi->bank[1].size = SZ_512M; | ||
138 | } | ||
139 | |||
140 | static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = { | ||
141 | /* name parent rate enabled */ | ||
142 | { "uartd", "pll_p", 216000000, true }, | ||
143 | { "pll_a", "pll_p_out1", 56448000, true }, | ||
144 | { "pll_a_out0", "pll_a", 11289600, true }, | ||
145 | { "cdev1", NULL, 0, true }, | ||
146 | { "i2s1", "pll_a_out0", 11289600, false}, | ||
147 | { "usb3", "clk_m", 12000000, true }, | ||
148 | { NULL, NULL, 0, 0}, | ||
149 | }; | ||
150 | |||
151 | |||
152 | static struct tegra_sdhci_platform_data sdhci_pdata1 = { | ||
153 | .cd_gpio = -1, | ||
154 | .wp_gpio = -1, | ||
155 | .power_gpio = -1, | ||
156 | }; | ||
157 | |||
158 | static struct tegra_sdhci_platform_data sdhci_pdata2 = { | ||
159 | .cd_gpio = TEGRA_GPIO_SD2_CD, | ||
160 | .wp_gpio = TEGRA_GPIO_SD2_WP, | ||
161 | .power_gpio = TEGRA_GPIO_SD2_POWER, | ||
162 | }; | ||
163 | |||
164 | static struct tegra_sdhci_platform_data sdhci_pdata4 = { | ||
165 | .cd_gpio = TEGRA_GPIO_SD4_CD, | ||
166 | .wp_gpio = TEGRA_GPIO_SD4_WP, | ||
167 | .power_gpio = TEGRA_GPIO_SD4_POWER, | ||
168 | .is_8bit = 1, | ||
169 | }; | ||
170 | |||
171 | static void __init tegra_harmony_init(void) | ||
172 | { | ||
173 | tegra_clk_init_from_table(harmony_clk_init_table); | ||
174 | |||
175 | harmony_pinmux_init(); | ||
176 | |||
177 | tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1; | ||
178 | tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2; | ||
179 | tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; | ||
180 | |||
181 | platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices)); | ||
182 | harmony_i2c_init(); | ||
183 | harmony_regulator_init(); | ||
184 | } | ||
185 | |||
186 | MACHINE_START(HARMONY, "harmony") | ||
187 | .atag_offset = 0x100, | ||
188 | .fixup = tegra_harmony_fixup, | ||
189 | .map_io = tegra_map_common_io, | ||
190 | .init_early = tegra20_init_early, | ||
191 | .init_irq = tegra_init_irq, | ||
192 | .handle_irq = gic_handle_irq, | ||
193 | .timer = &tegra_timer, | ||
194 | .init_machine = tegra_harmony_init, | ||
195 | .init_late = tegra_init_late, | ||
196 | .restart = tegra_assert_system_reset, | ||
197 | MACHINE_END | ||
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h deleted file mode 100644 index 139d96c93843..000000000000 --- a/arch/arm/mach-tegra/board-harmony.h +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-harmony.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Google, Inc. | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #ifndef _MACH_TEGRA_BOARD_HARMONY_H | ||
18 | #define _MACH_TEGRA_BOARD_HARMONY_H | ||
19 | |||
20 | #include <mach/gpio-tegra.h> | ||
21 | |||
22 | #define HARMONY_GPIO_TPS6586X(_x_) (TEGRA_NR_GPIOS + (_x_)) | ||
23 | #define HARMONY_GPIO_WM8903(_x_) (HARMONY_GPIO_TPS6586X(4) + (_x_)) | ||
24 | |||
25 | #define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5 | ||
26 | #define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1 | ||
27 | #define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PT3 | ||
28 | #define TEGRA_GPIO_SD4_CD TEGRA_GPIO_PH2 | ||
29 | #define TEGRA_GPIO_SD4_WP TEGRA_GPIO_PH3 | ||
30 | #define TEGRA_GPIO_SD4_POWER TEGRA_GPIO_PI6 | ||
31 | #define TEGRA_GPIO_CDC_IRQ TEGRA_GPIO_PX3 | ||
32 | #define TEGRA_GPIO_SPKR_EN HARMONY_GPIO_WM8903(2) | ||
33 | #define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW2 | ||
34 | #define TEGRA_GPIO_INT_MIC_EN TEGRA_GPIO_PX0 | ||
35 | #define TEGRA_GPIO_EXT_MIC_EN TEGRA_GPIO_PX1 | ||
36 | #define TEGRA_GPIO_EN_VDD_1V05_GPIO HARMONY_GPIO_TPS6586X(2) | ||
37 | |||
38 | void harmony_pinmux_init(void); | ||
39 | int harmony_regulator_init(void); | ||
40 | |||
41 | #endif | ||
diff --git a/arch/arm/mach-tegra/board-paz00-pinmux.c b/arch/arm/mach-tegra/board-paz00-pinmux.c deleted file mode 100644 index 6f1111b48e7c..000000000000 --- a/arch/arm/mach-tegra/board-paz00-pinmux.c +++ /dev/null | |||
@@ -1,156 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-paz00-pinmux.c | ||
3 | * | ||
4 | * Copyright (C) 2010 Marc Dietrich <marvin24@gmx.de> | ||
5 | * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. | ||
6 | * | ||
7 | * This software is licensed under the terms of the GNU General Public | ||
8 | * License version 2, as published by the Free Software Foundation, and | ||
9 | * may be copied, distributed, and modified under those terms. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | |||
20 | #include "board-paz00.h" | ||
21 | #include "board-pinmux.h" | ||
22 | |||
23 | static struct pinctrl_map paz00_map[] = { | ||
24 | TEGRA_MAP_MUXCONF("ata", "gmi", none, driven), | ||
25 | TEGRA_MAP_MUXCONF("atb", "sdio4", none, driven), | ||
26 | TEGRA_MAP_MUXCONF("atc", "gmi", none, driven), | ||
27 | TEGRA_MAP_MUXCONF("atd", "gmi", none, driven), | ||
28 | TEGRA_MAP_MUXCONF("ate", "gmi", none, driven), | ||
29 | TEGRA_MAP_MUXCONF("cdev1", "plla_out", none, driven), | ||
30 | TEGRA_MAP_MUXCONF("cdev2", "pllp_out4", down, driven), | ||
31 | TEGRA_MAP_MUXCONF("crtp", "crt", none, tristate), | ||
32 | TEGRA_MAP_MUXCONF("csus", "pllc_out1", down, tristate), | ||
33 | TEGRA_MAP_MUXCONF("dap1", "dap1", none, driven), | ||
34 | TEGRA_MAP_MUXCONF("dap2", "gmi", none, driven), | ||
35 | TEGRA_MAP_MUXCONF("dap3", "dap3", none, tristate), | ||
36 | TEGRA_MAP_MUXCONF("dap4", "dap4", none, tristate), | ||
37 | TEGRA_MAP_MUXCONF("ddc", "i2c2", up, driven), | ||
38 | TEGRA_MAP_MUXCONF("dta", "rsvd1", up, tristate), | ||
39 | TEGRA_MAP_MUXCONF("dtb", "rsvd1", none, tristate), | ||
40 | TEGRA_MAP_MUXCONF("dtc", "rsvd1", none, tristate), | ||
41 | TEGRA_MAP_MUXCONF("dtd", "rsvd1", up, tristate), | ||
42 | TEGRA_MAP_MUXCONF("dte", "rsvd1", none, tristate), | ||
43 | TEGRA_MAP_MUXCONF("dtf", "i2c3", none, driven), | ||
44 | TEGRA_MAP_MUXCONF("gma", "sdio4", none, driven), | ||
45 | TEGRA_MAP_MUXCONF("gmb", "gmi", none, driven), | ||
46 | TEGRA_MAP_MUXCONF("gmc", "gmi", none, driven), | ||
47 | TEGRA_MAP_MUXCONF("gmd", "gmi", none, driven), | ||
48 | TEGRA_MAP_MUXCONF("gme", "sdio4", none, driven), | ||
49 | TEGRA_MAP_MUXCONF("gpu", "pwm", none, driven), | ||
50 | TEGRA_MAP_MUXCONF("gpu7", "rtck", none, driven), | ||
51 | TEGRA_MAP_MUXCONF("gpv", "pcie", none, driven), | ||
52 | TEGRA_MAP_MUXCONF("hdint", "hdmi", na, driven), | ||
53 | TEGRA_MAP_MUXCONF("i2cp", "i2cp", none, driven), | ||
54 | TEGRA_MAP_MUXCONF("irrx", "uarta", up, driven), | ||
55 | TEGRA_MAP_MUXCONF("irtx", "uarta", up, driven), | ||
56 | TEGRA_MAP_MUXCONF("kbca", "kbc", up, driven), | ||
57 | TEGRA_MAP_MUXCONF("kbcb", "sdio2", up, driven), | ||
58 | TEGRA_MAP_MUXCONF("kbcc", "kbc", up, driven), | ||
59 | TEGRA_MAP_MUXCONF("kbcd", "sdio2", up, driven), | ||
60 | TEGRA_MAP_MUXCONF("kbce", "kbc", up, driven), | ||
61 | TEGRA_MAP_MUXCONF("kbcf", "kbc", up, driven), | ||
62 | TEGRA_MAP_MUXCONF("lcsn", "displaya", na, tristate), | ||
63 | TEGRA_MAP_MUXCONF("ld0", "displaya", na, driven), | ||
64 | TEGRA_MAP_MUXCONF("ld1", "displaya", na, driven), | ||
65 | TEGRA_MAP_MUXCONF("ld10", "displaya", na, driven), | ||
66 | TEGRA_MAP_MUXCONF("ld11", "displaya", na, driven), | ||
67 | TEGRA_MAP_MUXCONF("ld12", "displaya", na, driven), | ||
68 | TEGRA_MAP_MUXCONF("ld13", "displaya", na, driven), | ||
69 | TEGRA_MAP_MUXCONF("ld14", "displaya", na, driven), | ||
70 | TEGRA_MAP_MUXCONF("ld15", "displaya", na, driven), | ||
71 | TEGRA_MAP_MUXCONF("ld16", "displaya", na, driven), | ||
72 | TEGRA_MAP_MUXCONF("ld17", "displaya", na, driven), | ||
73 | TEGRA_MAP_MUXCONF("ld2", "displaya", na, driven), | ||
74 | TEGRA_MAP_MUXCONF("ld3", "displaya", na, driven), | ||
75 | TEGRA_MAP_MUXCONF("ld4", "displaya", na, driven), | ||
76 | TEGRA_MAP_MUXCONF("ld5", "displaya", na, driven), | ||
77 | TEGRA_MAP_MUXCONF("ld6", "displaya", na, driven), | ||
78 | TEGRA_MAP_MUXCONF("ld7", "displaya", na, driven), | ||
79 | TEGRA_MAP_MUXCONF("ld8", "displaya", na, driven), | ||
80 | TEGRA_MAP_MUXCONF("ld9", "displaya", na, driven), | ||
81 | TEGRA_MAP_MUXCONF("ldc", "displaya", na, driven), | ||
82 | TEGRA_MAP_MUXCONF("ldi", "displaya", na, driven), | ||
83 | TEGRA_MAP_MUXCONF("lhp0", "displaya", na, tristate), | ||
84 | TEGRA_MAP_MUXCONF("lhp1", "displaya", na, tristate), | ||
85 | TEGRA_MAP_MUXCONF("lhp2", "displaya", na, tristate), | ||
86 | TEGRA_MAP_MUXCONF("lhs", "displaya", na, driven), | ||
87 | TEGRA_MAP_MUXCONF("lm0", "displaya", na, tristate), | ||
88 | TEGRA_MAP_MUXCONF("lm1", "displaya", na, tristate), | ||
89 | TEGRA_MAP_MUXCONF("lpp", "displaya", na, tristate), | ||
90 | TEGRA_MAP_MUXCONF("lpw0", "displaya", na, tristate), | ||
91 | TEGRA_MAP_MUXCONF("lpw1", "displaya", na, tristate), | ||
92 | TEGRA_MAP_MUXCONF("lpw2", "displaya", na, tristate), | ||
93 | TEGRA_MAP_MUXCONF("lsc0", "displaya", na, driven), | ||
94 | TEGRA_MAP_MUXCONF("lsc1", "displaya", na, tristate), | ||
95 | TEGRA_MAP_MUXCONF("lsck", "displaya", na, tristate), | ||
96 | TEGRA_MAP_MUXCONF("lsda", "displaya", na, tristate), | ||
97 | TEGRA_MAP_MUXCONF("lsdi", "displaya", na, tristate), | ||
98 | TEGRA_MAP_MUXCONF("lspi", "displaya", na, driven), | ||
99 | TEGRA_MAP_MUXCONF("lvp0", "displaya", na, tristate), | ||
100 | TEGRA_MAP_MUXCONF("lvp1", "displaya", na, tristate), | ||
101 | TEGRA_MAP_MUXCONF("lvs", "displaya", na, driven), | ||
102 | TEGRA_MAP_MUXCONF("owc", "owr", up, tristate), | ||
103 | TEGRA_MAP_MUXCONF("pmc", "pwr_on", na, driven), | ||
104 | TEGRA_MAP_MUXCONF("pta", "hdmi", none, driven), | ||
105 | TEGRA_MAP_MUXCONF("rm", "i2c1", none, driven), | ||
106 | TEGRA_MAP_MUXCONF("sdb", "pwm", na, tristate), | ||
107 | TEGRA_MAP_MUXCONF("sdc", "twc", up, tristate), | ||
108 | TEGRA_MAP_MUXCONF("sdd", "pwm", up, tristate), | ||
109 | TEGRA_MAP_MUXCONF("sdio1", "sdio1", none, driven), | ||
110 | TEGRA_MAP_MUXCONF("slxa", "pcie", none, tristate), | ||
111 | TEGRA_MAP_MUXCONF("slxc", "spi4", none, tristate), | ||
112 | TEGRA_MAP_MUXCONF("slxd", "spi4", none, tristate), | ||
113 | TEGRA_MAP_MUXCONF("slxk", "pcie", none, driven), | ||
114 | TEGRA_MAP_MUXCONF("spdi", "rsvd2", none, tristate), | ||
115 | TEGRA_MAP_MUXCONF("spdo", "rsvd2", none, driven), | ||
116 | TEGRA_MAP_MUXCONF("spia", "gmi", down, tristate), | ||
117 | TEGRA_MAP_MUXCONF("spib", "gmi", down, tristate), | ||
118 | TEGRA_MAP_MUXCONF("spic", "gmi", up, driven), | ||
119 | TEGRA_MAP_MUXCONF("spid", "gmi", down, tristate), | ||
120 | TEGRA_MAP_MUXCONF("spie", "gmi", up, tristate), | ||
121 | TEGRA_MAP_MUXCONF("spif", "rsvd4", down, tristate), | ||
122 | TEGRA_MAP_MUXCONF("spig", "spi2_alt", up, driven), | ||
123 | TEGRA_MAP_MUXCONF("spih", "spi2_alt", up, tristate), | ||
124 | TEGRA_MAP_MUXCONF("uaa", "ulpi", up, driven), | ||
125 | TEGRA_MAP_MUXCONF("uab", "ulpi", up, driven), | ||
126 | TEGRA_MAP_MUXCONF("uac", "rsvd4", none, driven), | ||
127 | TEGRA_MAP_MUXCONF("uad", "spdif", up, tristate), | ||
128 | TEGRA_MAP_MUXCONF("uca", "uartc", up, tristate), | ||
129 | TEGRA_MAP_MUXCONF("ucb", "uartc", up, tristate), | ||
130 | TEGRA_MAP_MUXCONF("uda", "ulpi", none, driven), | ||
131 | TEGRA_MAP_CONF("ck32", none, na), | ||
132 | TEGRA_MAP_CONF("ddrc", none, na), | ||
133 | TEGRA_MAP_CONF("pmca", none, na), | ||
134 | TEGRA_MAP_CONF("pmcb", none, na), | ||
135 | TEGRA_MAP_CONF("pmcc", none, na), | ||
136 | TEGRA_MAP_CONF("pmcd", none, na), | ||
137 | TEGRA_MAP_CONF("pmce", none, na), | ||
138 | TEGRA_MAP_CONF("xm2c", none, na), | ||
139 | TEGRA_MAP_CONF("xm2d", none, na), | ||
140 | TEGRA_MAP_CONF("ls", up, na), | ||
141 | TEGRA_MAP_CONF("lc", up, na), | ||
142 | TEGRA_MAP_CONF("ld17_0", down, na), | ||
143 | TEGRA_MAP_CONF("ld19_18", down, na), | ||
144 | TEGRA_MAP_CONF("ld21_20", down, na), | ||
145 | TEGRA_MAP_CONF("ld23_22", down, na), | ||
146 | }; | ||
147 | |||
148 | static struct tegra_board_pinmux_conf conf = { | ||
149 | .maps = paz00_map, | ||
150 | .map_count = ARRAY_SIZE(paz00_map), | ||
151 | }; | ||
152 | |||
153 | void paz00_pinmux_init(void) | ||
154 | { | ||
155 | tegra_board_pinmux_init(&conf, NULL); | ||
156 | } | ||
diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c index 4b64af5cab27..59305516fadb 100644 --- a/arch/arm/mach-tegra/board-paz00.c +++ b/arch/arm/mach-tegra/board-paz00.c | |||
@@ -17,72 +17,10 @@ | |||
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
23 | #include <linux/serial_8250.h> | ||
24 | #include <linux/of_serial.h> | ||
25 | #include <linux/clk.h> | ||
26 | #include <linux/dma-mapping.h> | ||
27 | #include <linux/gpio_keys.h> | ||
28 | #include <linux/pda_power.h> | ||
29 | #include <linux/io.h> | ||
30 | #include <linux/input.h> | ||
31 | #include <linux/i2c.h> | ||
32 | #include <linux/gpio.h> | ||
33 | #include <linux/rfkill-gpio.h> | 21 | #include <linux/rfkill-gpio.h> |
34 | 22 | ||
35 | #include <asm/hardware/gic.h> | ||
36 | #include <asm/mach-types.h> | ||
37 | #include <asm/mach/arch.h> | ||
38 | #include <asm/mach/time.h> | ||
39 | #include <asm/setup.h> | ||
40 | |||
41 | #include <mach/iomap.h> | ||
42 | #include <mach/irqs.h> | ||
43 | #include <mach/sdhci.h> | ||
44 | |||
45 | #include "board.h" | ||
46 | #include "board-paz00.h" | 23 | #include "board-paz00.h" |
47 | #include "clock.h" | ||
48 | #include "devices.h" | ||
49 | #include "gpio-names.h" | ||
50 | |||
51 | static struct plat_serial8250_port debug_uart_platform_data[] = { | ||
52 | { | ||
53 | /* serial port on JP1 */ | ||
54 | .membase = IO_ADDRESS(TEGRA_UARTA_BASE), | ||
55 | .mapbase = TEGRA_UARTA_BASE, | ||
56 | .irq = INT_UARTA, | ||
57 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
58 | .type = PORT_TEGRA, | ||
59 | .handle_break = tegra_serial_handle_break, | ||
60 | .iotype = UPIO_MEM, | ||
61 | .regshift = 2, | ||
62 | .uartclk = 216000000, | ||
63 | }, { | ||
64 | /* serial port on mini-pcie */ | ||
65 | .membase = IO_ADDRESS(TEGRA_UARTC_BASE), | ||
66 | .mapbase = TEGRA_UARTC_BASE, | ||
67 | .irq = INT_UARTC, | ||
68 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
69 | .type = PORT_TEGRA, | ||
70 | .handle_break = tegra_serial_handle_break, | ||
71 | .iotype = UPIO_MEM, | ||
72 | .regshift = 2, | ||
73 | .uartclk = 216000000, | ||
74 | }, { | ||
75 | .flags = 0 | ||
76 | } | ||
77 | }; | ||
78 | |||
79 | static struct platform_device debug_uart = { | ||
80 | .name = "serial8250", | ||
81 | .id = PLAT8250_DEV_PLATFORM, | ||
82 | .dev = { | ||
83 | .platform_data = debug_uart_platform_data, | ||
84 | }, | ||
85 | }; | ||
86 | 24 | ||
87 | static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = { | 25 | static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = { |
88 | .name = "wifi_rfkill", | 26 | .name = "wifi_rfkill", |
@@ -99,137 +37,7 @@ static struct platform_device wifi_rfkill_device = { | |||
99 | }, | 37 | }, |
100 | }; | 38 | }; |
101 | 39 | ||
102 | static struct gpio_led gpio_leds[] = { | ||
103 | { | ||
104 | .name = "wifi-led", | ||
105 | .default_trigger = "rfkill0", | ||
106 | .gpio = TEGRA_WIFI_LED, | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | static struct gpio_led_platform_data gpio_led_info = { | ||
111 | .leds = gpio_leds, | ||
112 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
113 | }; | ||
114 | |||
115 | static struct platform_device leds_gpio = { | ||
116 | .name = "leds-gpio", | ||
117 | .id = -1, | ||
118 | .dev = { | ||
119 | .platform_data = &gpio_led_info, | ||
120 | }, | ||
121 | }; | ||
122 | |||
123 | static struct gpio_keys_button paz00_gpio_keys_buttons[] = { | ||
124 | { | ||
125 | .code = KEY_POWER, | ||
126 | .gpio = TEGRA_GPIO_POWERKEY, | ||
127 | .active_low = 1, | ||
128 | .desc = "Power", | ||
129 | .type = EV_KEY, | ||
130 | .wakeup = 1, | ||
131 | }, | ||
132 | }; | ||
133 | |||
134 | static struct gpio_keys_platform_data paz00_gpio_keys = { | ||
135 | .buttons = paz00_gpio_keys_buttons, | ||
136 | .nbuttons = ARRAY_SIZE(paz00_gpio_keys_buttons), | ||
137 | }; | ||
138 | |||
139 | static struct platform_device gpio_keys_device = { | ||
140 | .name = "gpio-keys", | ||
141 | .id = -1, | ||
142 | .dev = { | ||
143 | .platform_data = &paz00_gpio_keys, | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | static struct platform_device *paz00_devices[] __initdata = { | ||
148 | &debug_uart, | ||
149 | &tegra_sdhci_device4, | ||
150 | &tegra_sdhci_device1, | ||
151 | &leds_gpio, | ||
152 | &gpio_keys_device, | ||
153 | }; | ||
154 | |||
155 | static void paz00_i2c_init(void) | ||
156 | { | ||
157 | platform_device_register(&tegra_i2c_device1); | ||
158 | platform_device_register(&tegra_i2c_device2); | ||
159 | platform_device_register(&tegra_i2c_device4); | ||
160 | } | ||
161 | |||
162 | static void paz00_usb_init(void) | ||
163 | { | ||
164 | tegra_ehci2_ulpi_phy_config.reset_gpio = TEGRA_ULPI_RST; | ||
165 | |||
166 | platform_device_register(&tegra_ehci2_device); | ||
167 | platform_device_register(&tegra_ehci3_device); | ||
168 | } | ||
169 | |||
170 | static void __init tegra_paz00_fixup(struct tag *tags, char **cmdline, | ||
171 | struct meminfo *mi) | ||
172 | { | ||
173 | mi->nr_banks = 1; | ||
174 | mi->bank[0].start = PHYS_OFFSET; | ||
175 | mi->bank[0].size = 448 * SZ_1M; | ||
176 | } | ||
177 | |||
178 | static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = { | ||
179 | /* name parent rate enabled */ | ||
180 | { "uarta", "pll_p", 216000000, true }, | ||
181 | { "uartc", "pll_p", 216000000, true }, | ||
182 | |||
183 | { "usbd", "clk_m", 12000000, false }, | ||
184 | { "usb2", "clk_m", 12000000, false }, | ||
185 | { "usb3", "clk_m", 12000000, false }, | ||
186 | |||
187 | { NULL, NULL, 0, 0}, | ||
188 | }; | ||
189 | |||
190 | static struct tegra_sdhci_platform_data sdhci_pdata1 = { | ||
191 | .cd_gpio = TEGRA_GPIO_SD1_CD, | ||
192 | .wp_gpio = TEGRA_GPIO_SD1_WP, | ||
193 | .power_gpio = TEGRA_GPIO_SD1_POWER, | ||
194 | }; | ||
195 | |||
196 | static struct tegra_sdhci_platform_data sdhci_pdata4 = { | ||
197 | .cd_gpio = -1, | ||
198 | .wp_gpio = -1, | ||
199 | .power_gpio = -1, | ||
200 | .is_8bit = 1, | ||
201 | }; | ||
202 | |||
203 | void __init tegra_paz00_wifikill_init(void) | 40 | void __init tegra_paz00_wifikill_init(void) |
204 | { | 41 | { |
205 | platform_device_register(&wifi_rfkill_device); | 42 | platform_device_register(&wifi_rfkill_device); |
206 | } | 43 | } |
207 | |||
208 | static void __init tegra_paz00_init(void) | ||
209 | { | ||
210 | tegra_clk_init_from_table(paz00_clk_init_table); | ||
211 | |||
212 | paz00_pinmux_init(); | ||
213 | |||
214 | tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1; | ||
215 | tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; | ||
216 | |||
217 | platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices)); | ||
218 | tegra_paz00_wifikill_init(); | ||
219 | |||
220 | paz00_i2c_init(); | ||
221 | paz00_usb_init(); | ||
222 | } | ||
223 | |||
224 | MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ") | ||
225 | .atag_offset = 0x100, | ||
226 | .fixup = tegra_paz00_fixup, | ||
227 | .map_io = tegra_map_common_io, | ||
228 | .init_early = tegra20_init_early, | ||
229 | .init_irq = tegra_init_irq, | ||
230 | .handle_irq = gic_handle_irq, | ||
231 | .timer = &tegra_timer, | ||
232 | .init_machine = tegra_paz00_init, | ||
233 | .init_late = tegra_init_late, | ||
234 | .restart = tegra_assert_system_reset, | ||
235 | MACHINE_END | ||
diff --git a/arch/arm/mach-tegra/board-paz00.h b/arch/arm/mach-tegra/board-paz00.h index 3c9f8da37ea3..25c08ecef52f 100644 --- a/arch/arm/mach-tegra/board-paz00.h +++ b/arch/arm/mach-tegra/board-paz00.h | |||
@@ -17,24 +17,9 @@ | |||
17 | #ifndef _MACH_TEGRA_BOARD_PAZ00_H | 17 | #ifndef _MACH_TEGRA_BOARD_PAZ00_H |
18 | #define _MACH_TEGRA_BOARD_PAZ00_H | 18 | #define _MACH_TEGRA_BOARD_PAZ00_H |
19 | 19 | ||
20 | #include <mach/gpio-tegra.h> | 20 | #include "gpio-names.h" |
21 | 21 | ||
22 | /* SDCARD */ | ||
23 | #define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5 | ||
24 | #define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1 | ||
25 | #define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PV1 | ||
26 | |||
27 | /* ULPI */ | ||
28 | #define TEGRA_ULPI_RST TEGRA_GPIO_PV0 | ||
29 | |||
30 | /* WIFI */ | ||
31 | #define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 | 22 | #define TEGRA_WIFI_PWRN TEGRA_GPIO_PK5 |
32 | #define TEGRA_WIFI_RST TEGRA_GPIO_PD1 | 23 | #define TEGRA_WIFI_RST TEGRA_GPIO_PD1 |
33 | #define TEGRA_WIFI_LED TEGRA_GPIO_PD0 | ||
34 | |||
35 | /* WakeUp */ | ||
36 | #define TEGRA_GPIO_POWERKEY TEGRA_GPIO_PJ7 | ||
37 | |||
38 | void paz00_pinmux_init(void); | ||
39 | 24 | ||
40 | #endif | 25 | #endif |
diff --git a/arch/arm/mach-tegra/board-trimslice-pinmux.c b/arch/arm/mach-tegra/board-trimslice-pinmux.c deleted file mode 100644 index 7b39511c0d4d..000000000000 --- a/arch/arm/mach-tegra/board-trimslice-pinmux.c +++ /dev/null | |||
@@ -1,155 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-trimslice-pinmux.c | ||
3 | * | ||
4 | * Copyright (C) 2011 CompuLab, Ltd. | ||
5 | * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. | ||
6 | * | ||
7 | * This software is licensed under the terms of the GNU General Public | ||
8 | * License version 2, as published by the Free Software Foundation, and | ||
9 | * may be copied, distributed, and modified under those terms. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | */ | ||
17 | #include <linux/kernel.h> | ||
18 | |||
19 | #include "board-trimslice.h" | ||
20 | #include "board-pinmux.h" | ||
21 | |||
22 | static struct pinctrl_map trimslice_map[] = { | ||
23 | TEGRA_MAP_MUXCONF("ata", "ide", none, tristate), | ||
24 | TEGRA_MAP_MUXCONF("atb", "sdio4", none, driven), | ||
25 | TEGRA_MAP_MUXCONF("atc", "nand", none, tristate), | ||
26 | TEGRA_MAP_MUXCONF("atd", "gmi", none, tristate), | ||
27 | TEGRA_MAP_MUXCONF("ate", "gmi", none, tristate), | ||
28 | TEGRA_MAP_MUXCONF("cdev1", "plla_out", none, driven), | ||
29 | TEGRA_MAP_MUXCONF("cdev2", "pllp_out4", down, tristate), | ||
30 | TEGRA_MAP_MUXCONF("crtp", "crt", none, tristate), | ||
31 | TEGRA_MAP_MUXCONF("csus", "vi_sensor_clk", down, tristate), | ||
32 | TEGRA_MAP_MUXCONF("dap1", "dap1", none, driven), | ||
33 | TEGRA_MAP_MUXCONF("dap2", "dap2", none, tristate), | ||
34 | TEGRA_MAP_MUXCONF("dap3", "dap3", none, tristate), | ||
35 | TEGRA_MAP_MUXCONF("dap4", "dap4", none, tristate), | ||
36 | TEGRA_MAP_MUXCONF("ddc", "i2c2", up, driven), | ||
37 | TEGRA_MAP_MUXCONF("dta", "vi", none, tristate), | ||
38 | TEGRA_MAP_MUXCONF("dtb", "vi", none, tristate), | ||
39 | TEGRA_MAP_MUXCONF("dtc", "vi", none, tristate), | ||
40 | TEGRA_MAP_MUXCONF("dtd", "vi", none, tristate), | ||
41 | TEGRA_MAP_MUXCONF("dte", "vi", none, tristate), | ||
42 | TEGRA_MAP_MUXCONF("dtf", "i2c3", up, driven), | ||
43 | TEGRA_MAP_MUXCONF("gma", "sdio4", none, driven), | ||
44 | TEGRA_MAP_MUXCONF("gmb", "nand", none, tristate), | ||
45 | TEGRA_MAP_MUXCONF("gmc", "sflash", none, driven), | ||
46 | TEGRA_MAP_MUXCONF("gmd", "sflash", none, driven), | ||
47 | TEGRA_MAP_MUXCONF("gme", "gmi", none, tristate), | ||
48 | TEGRA_MAP_MUXCONF("gpu", "uarta", none, driven), | ||
49 | TEGRA_MAP_MUXCONF("gpu7", "rtck", none, driven), | ||
50 | TEGRA_MAP_MUXCONF("gpv", "pcie", none, driven), | ||
51 | TEGRA_MAP_MUXCONF("hdint", "hdmi", na, tristate), | ||
52 | TEGRA_MAP_MUXCONF("i2cp", "i2cp", none, tristate), | ||
53 | TEGRA_MAP_MUXCONF("irrx", "uartb", up, tristate), | ||
54 | TEGRA_MAP_MUXCONF("irtx", "uartb", up, tristate), | ||
55 | TEGRA_MAP_MUXCONF("kbca", "kbc", up, tristate), | ||
56 | TEGRA_MAP_MUXCONF("kbcb", "kbc", up, tristate), | ||
57 | TEGRA_MAP_MUXCONF("kbcc", "kbc", up, tristate), | ||
58 | TEGRA_MAP_MUXCONF("kbcd", "kbc", up, tristate), | ||
59 | TEGRA_MAP_MUXCONF("kbce", "kbc", up, tristate), | ||
60 | TEGRA_MAP_MUXCONF("kbcf", "kbc", up, tristate), | ||
61 | TEGRA_MAP_MUXCONF("lcsn", "displaya", na, tristate), | ||
62 | TEGRA_MAP_MUXCONF("ld0", "displaya", na, driven), | ||
63 | TEGRA_MAP_MUXCONF("ld1", "displaya", na, driven), | ||
64 | TEGRA_MAP_MUXCONF("ld10", "displaya", na, driven), | ||
65 | TEGRA_MAP_MUXCONF("ld11", "displaya", na, driven), | ||
66 | TEGRA_MAP_MUXCONF("ld12", "displaya", na, driven), | ||
67 | TEGRA_MAP_MUXCONF("ld13", "displaya", na, driven), | ||
68 | TEGRA_MAP_MUXCONF("ld14", "displaya", na, driven), | ||
69 | TEGRA_MAP_MUXCONF("ld15", "displaya", na, driven), | ||
70 | TEGRA_MAP_MUXCONF("ld16", "displaya", na, driven), | ||
71 | TEGRA_MAP_MUXCONF("ld17", "displaya", na, driven), | ||
72 | TEGRA_MAP_MUXCONF("ld2", "displaya", na, driven), | ||
73 | TEGRA_MAP_MUXCONF("ld3", "displaya", na, driven), | ||
74 | TEGRA_MAP_MUXCONF("ld4", "displaya", na, driven), | ||
75 | TEGRA_MAP_MUXCONF("ld5", "displaya", na, driven), | ||
76 | TEGRA_MAP_MUXCONF("ld6", "displaya", na, driven), | ||
77 | TEGRA_MAP_MUXCONF("ld7", "displaya", na, driven), | ||
78 | TEGRA_MAP_MUXCONF("ld8", "displaya", na, driven), | ||
79 | TEGRA_MAP_MUXCONF("ld9", "displaya", na, driven), | ||
80 | TEGRA_MAP_MUXCONF("ldc", "displaya", na, tristate), | ||
81 | TEGRA_MAP_MUXCONF("ldi", "displaya", na, driven), | ||
82 | TEGRA_MAP_MUXCONF("lhp0", "displaya", na, driven), | ||
83 | TEGRA_MAP_MUXCONF("lhp1", "displaya", na, driven), | ||
84 | TEGRA_MAP_MUXCONF("lhp2", "displaya", na, driven), | ||
85 | TEGRA_MAP_MUXCONF("lhs", "displaya", na, driven), | ||
86 | TEGRA_MAP_MUXCONF("lm0", "displaya", na, driven), | ||
87 | TEGRA_MAP_MUXCONF("lm1", "displaya", na, tristate), | ||
88 | TEGRA_MAP_MUXCONF("lpp", "displaya", na, driven), | ||
89 | TEGRA_MAP_MUXCONF("lpw0", "displaya", na, driven), | ||
90 | TEGRA_MAP_MUXCONF("lpw1", "displaya", na, tristate), | ||
91 | TEGRA_MAP_MUXCONF("lpw2", "displaya", na, driven), | ||
92 | TEGRA_MAP_MUXCONF("lsc0", "displaya", na, driven), | ||
93 | TEGRA_MAP_MUXCONF("lsc1", "displaya", na, tristate), | ||
94 | TEGRA_MAP_MUXCONF("lsck", "displaya", na, tristate), | ||
95 | TEGRA_MAP_MUXCONF("lsda", "displaya", na, tristate), | ||
96 | TEGRA_MAP_MUXCONF("lsdi", "displaya", na, tristate), | ||
97 | TEGRA_MAP_MUXCONF("lspi", "displaya", na, driven), | ||
98 | TEGRA_MAP_MUXCONF("lvp0", "displaya", na, tristate), | ||
99 | TEGRA_MAP_MUXCONF("lvp1", "displaya", na, driven), | ||
100 | TEGRA_MAP_MUXCONF("lvs", "displaya", na, driven), | ||
101 | TEGRA_MAP_MUXCONF("owc", "rsvd2", up, tristate), | ||
102 | TEGRA_MAP_MUXCONF("pmc", "pwr_on", na, tristate), | ||
103 | TEGRA_MAP_MUXCONF("pta", "gmi", none, tristate), | ||
104 | TEGRA_MAP_MUXCONF("rm", "i2c1", up, driven), | ||
105 | TEGRA_MAP_MUXCONF("sdb", "pwm", na, driven), | ||
106 | TEGRA_MAP_MUXCONF("sdc", "pwm", up, driven), | ||
107 | TEGRA_MAP_MUXCONF("sdd", "pwm", up, driven), | ||
108 | TEGRA_MAP_MUXCONF("sdio1", "sdio1", none, driven), | ||
109 | TEGRA_MAP_MUXCONF("slxa", "pcie", none, driven), | ||
110 | TEGRA_MAP_MUXCONF("slxc", "sdio3", none, tristate), | ||
111 | TEGRA_MAP_MUXCONF("slxd", "sdio3", none, tristate), | ||
112 | TEGRA_MAP_MUXCONF("slxk", "pcie", none, driven), | ||
113 | TEGRA_MAP_MUXCONF("spdi", "spdif", none, tristate), | ||
114 | TEGRA_MAP_MUXCONF("spdo", "spdif", none, tristate), | ||
115 | TEGRA_MAP_MUXCONF("spia", "spi2", down, tristate), | ||
116 | TEGRA_MAP_MUXCONF("spib", "spi2", down, tristate), | ||
117 | TEGRA_MAP_MUXCONF("spic", "spi2", up, tristate), | ||
118 | TEGRA_MAP_MUXCONF("spid", "spi1", down, tristate), | ||
119 | TEGRA_MAP_MUXCONF("spie", "spi1", up, tristate), | ||
120 | TEGRA_MAP_MUXCONF("spif", "spi1", down, tristate), | ||
121 | TEGRA_MAP_MUXCONF("spig", "spi2_alt", up, tristate), | ||
122 | TEGRA_MAP_MUXCONF("spih", "spi2_alt", up, tristate), | ||
123 | TEGRA_MAP_MUXCONF("uaa", "ulpi", up, tristate), | ||
124 | TEGRA_MAP_MUXCONF("uab", "ulpi", up, tristate), | ||
125 | TEGRA_MAP_MUXCONF("uac", "rsvd2", none, driven), | ||
126 | TEGRA_MAP_MUXCONF("uad", "irda", up, tristate), | ||
127 | TEGRA_MAP_MUXCONF("uca", "uartc", up, tristate), | ||
128 | TEGRA_MAP_MUXCONF("ucb", "uartc", up, tristate), | ||
129 | TEGRA_MAP_MUXCONF("uda", "ulpi", none, tristate), | ||
130 | TEGRA_MAP_CONF("ck32", none, na), | ||
131 | TEGRA_MAP_CONF("ddrc", none, na), | ||
132 | TEGRA_MAP_CONF("pmca", none, na), | ||
133 | TEGRA_MAP_CONF("pmcb", none, na), | ||
134 | TEGRA_MAP_CONF("pmcc", none, na), | ||
135 | TEGRA_MAP_CONF("pmcd", none, na), | ||
136 | TEGRA_MAP_CONF("pmce", none, na), | ||
137 | TEGRA_MAP_CONF("xm2c", none, na), | ||
138 | TEGRA_MAP_CONF("xm2d", none, na), | ||
139 | TEGRA_MAP_CONF("ls", up, na), | ||
140 | TEGRA_MAP_CONF("lc", up, na), | ||
141 | TEGRA_MAP_CONF("ld17_0", down, na), | ||
142 | TEGRA_MAP_CONF("ld19_18", down, na), | ||
143 | TEGRA_MAP_CONF("ld21_20", down, na), | ||
144 | TEGRA_MAP_CONF("ld23_22", down, na), | ||
145 | }; | ||
146 | |||
147 | static struct tegra_board_pinmux_conf conf = { | ||
148 | .maps = trimslice_map, | ||
149 | .map_count = ARRAY_SIZE(trimslice_map), | ||
150 | }; | ||
151 | |||
152 | void trimslice_pinmux_init(void) | ||
153 | { | ||
154 | tegra_board_pinmux_init(&conf, NULL); | ||
155 | } | ||
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c deleted file mode 100644 index 776aa9564d5d..000000000000 --- a/arch/arm/mach-tegra/board-trimslice.c +++ /dev/null | |||
@@ -1,183 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-trimslice.c | ||
3 | * | ||
4 | * Copyright (C) 2011 CompuLab, Ltd. | ||
5 | * Author: Mike Rapoport <mike@compulab.co.il> | ||
6 | * | ||
7 | * Based on board-harmony.c | ||
8 | * Copyright (C) 2010 Google, Inc. | ||
9 | * | ||
10 | * This software is licensed under the terms of the GNU General Public | ||
11 | * License version 2, as published by the Free Software Foundation, and | ||
12 | * may be copied, distributed, and modified under those terms. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/serial_8250.h> | ||
25 | #include <linux/of_serial.h> | ||
26 | #include <linux/io.h> | ||
27 | #include <linux/i2c.h> | ||
28 | #include <linux/gpio.h> | ||
29 | #include <linux/platform_data/tegra_usb.h> | ||
30 | |||
31 | #include <asm/hardware/gic.h> | ||
32 | #include <asm/mach-types.h> | ||
33 | #include <asm/mach/arch.h> | ||
34 | #include <asm/setup.h> | ||
35 | |||
36 | #include <mach/iomap.h> | ||
37 | #include <mach/sdhci.h> | ||
38 | |||
39 | #include "board.h" | ||
40 | #include "clock.h" | ||
41 | #include "devices.h" | ||
42 | #include "gpio-names.h" | ||
43 | |||
44 | #include "board-trimslice.h" | ||
45 | |||
46 | static struct plat_serial8250_port debug_uart_platform_data[] = { | ||
47 | { | ||
48 | .membase = IO_ADDRESS(TEGRA_UARTA_BASE), | ||
49 | .mapbase = TEGRA_UARTA_BASE, | ||
50 | .irq = INT_UARTA, | ||
51 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
52 | .type = PORT_TEGRA, | ||
53 | .handle_break = tegra_serial_handle_break, | ||
54 | .iotype = UPIO_MEM, | ||
55 | .regshift = 2, | ||
56 | .uartclk = 216000000, | ||
57 | }, { | ||
58 | .flags = 0 | ||
59 | } | ||
60 | }; | ||
61 | |||
62 | static struct platform_device debug_uart = { | ||
63 | .name = "serial8250", | ||
64 | .id = PLAT8250_DEV_PLATFORM, | ||
65 | .dev = { | ||
66 | .platform_data = debug_uart_platform_data, | ||
67 | }, | ||
68 | }; | ||
69 | static struct tegra_sdhci_platform_data sdhci_pdata1 = { | ||
70 | .cd_gpio = -1, | ||
71 | .wp_gpio = -1, | ||
72 | .power_gpio = -1, | ||
73 | }; | ||
74 | |||
75 | static struct tegra_sdhci_platform_data sdhci_pdata4 = { | ||
76 | .cd_gpio = TRIMSLICE_GPIO_SD4_CD, | ||
77 | .wp_gpio = TRIMSLICE_GPIO_SD4_WP, | ||
78 | .power_gpio = -1, | ||
79 | }; | ||
80 | |||
81 | static struct platform_device trimslice_audio_device = { | ||
82 | .name = "tegra-snd-trimslice", | ||
83 | .id = 0, | ||
84 | }; | ||
85 | |||
86 | static struct platform_device *trimslice_devices[] __initdata = { | ||
87 | &debug_uart, | ||
88 | &tegra_sdhci_device1, | ||
89 | &tegra_sdhci_device4, | ||
90 | &tegra_i2s_device1, | ||
91 | &tegra_das_device, | ||
92 | &trimslice_audio_device, | ||
93 | }; | ||
94 | |||
95 | static struct i2c_board_info trimslice_i2c3_board_info[] = { | ||
96 | { | ||
97 | I2C_BOARD_INFO("tlv320aic23", 0x1a), | ||
98 | }, | ||
99 | { | ||
100 | I2C_BOARD_INFO("em3027", 0x56), | ||
101 | }, | ||
102 | }; | ||
103 | |||
104 | static void trimslice_i2c_init(void) | ||
105 | { | ||
106 | platform_device_register(&tegra_i2c_device1); | ||
107 | platform_device_register(&tegra_i2c_device2); | ||
108 | platform_device_register(&tegra_i2c_device3); | ||
109 | |||
110 | i2c_register_board_info(2, trimslice_i2c3_board_info, | ||
111 | ARRAY_SIZE(trimslice_i2c3_board_info)); | ||
112 | } | ||
113 | |||
114 | static void trimslice_usb_init(void) | ||
115 | { | ||
116 | struct tegra_ehci_platform_data *pdata; | ||
117 | |||
118 | pdata = tegra_ehci1_device.dev.platform_data; | ||
119 | pdata->vbus_gpio = TRIMSLICE_GPIO_USB1_MODE; | ||
120 | |||
121 | tegra_ehci2_ulpi_phy_config.reset_gpio = TEGRA_GPIO_PV0; | ||
122 | |||
123 | platform_device_register(&tegra_ehci3_device); | ||
124 | platform_device_register(&tegra_ehci2_device); | ||
125 | platform_device_register(&tegra_ehci1_device); | ||
126 | } | ||
127 | |||
128 | static void __init tegra_trimslice_fixup(struct tag *tags, char **cmdline, | ||
129 | struct meminfo *mi) | ||
130 | { | ||
131 | mi->nr_banks = 2; | ||
132 | mi->bank[0].start = PHYS_OFFSET; | ||
133 | mi->bank[0].size = 448 * SZ_1M; | ||
134 | mi->bank[1].start = SZ_512M; | ||
135 | mi->bank[1].size = SZ_512M; | ||
136 | } | ||
137 | |||
138 | static __initdata struct tegra_clk_init_table trimslice_clk_init_table[] = { | ||
139 | /* name parent rate enabled */ | ||
140 | { "uarta", "pll_p", 216000000, true }, | ||
141 | { "pll_a", "pll_p_out1", 56448000, true }, | ||
142 | { "pll_a_out0", "pll_a", 11289600, true }, | ||
143 | { "cdev1", NULL, 0, true }, | ||
144 | { "i2s1", "pll_a_out0", 11289600, false}, | ||
145 | { NULL, NULL, 0, 0}, | ||
146 | }; | ||
147 | |||
148 | static int __init tegra_trimslice_pci_init(void) | ||
149 | { | ||
150 | if (!machine_is_trimslice()) | ||
151 | return 0; | ||
152 | |||
153 | return tegra_pcie_init(true, true); | ||
154 | } | ||
155 | subsys_initcall(tegra_trimslice_pci_init); | ||
156 | |||
157 | static void __init tegra_trimslice_init(void) | ||
158 | { | ||
159 | tegra_clk_init_from_table(trimslice_clk_init_table); | ||
160 | |||
161 | trimslice_pinmux_init(); | ||
162 | |||
163 | tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1; | ||
164 | tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; | ||
165 | |||
166 | platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices)); | ||
167 | |||
168 | trimslice_i2c_init(); | ||
169 | trimslice_usb_init(); | ||
170 | } | ||
171 | |||
172 | MACHINE_START(TRIMSLICE, "trimslice") | ||
173 | .atag_offset = 0x100, | ||
174 | .fixup = tegra_trimslice_fixup, | ||
175 | .map_io = tegra_map_common_io, | ||
176 | .init_early = tegra20_init_early, | ||
177 | .init_irq = tegra_init_irq, | ||
178 | .handle_irq = gic_handle_irq, | ||
179 | .timer = &tegra_timer, | ||
180 | .init_machine = tegra_trimslice_init, | ||
181 | .init_late = tegra_init_late, | ||
182 | .restart = tegra_assert_system_reset, | ||
183 | MACHINE_END | ||
diff --git a/arch/arm/mach-tegra/board-trimslice.h b/arch/arm/mach-tegra/board-trimslice.h deleted file mode 100644 index 50f128d87779..000000000000 --- a/arch/arm/mach-tegra/board-trimslice.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/board-trimslice.h | ||
3 | * | ||
4 | * Copyright (C) 2011 CompuLab, Ltd. | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H | ||
18 | #define _MACH_TEGRA_BOARD_TRIMSLICE_H | ||
19 | |||
20 | #include <mach/gpio-tegra.h> | ||
21 | |||
22 | #define TRIMSLICE_GPIO_SD4_CD TEGRA_GPIO_PP1 /* mmc4 cd */ | ||
23 | #define TRIMSLICE_GPIO_SD4_WP TEGRA_GPIO_PP2 /* mmc4 wp */ | ||
24 | |||
25 | #define TRIMSLICE_GPIO_USB1_MODE TEGRA_GPIO_PV2 /* USB1 mode */ | ||
26 | #define TRIMSLICE_GPIO_USB2_RST TEGRA_GPIO_PV0 /* USB2 PHY reset */ | ||
27 | |||
28 | void trimslice_pinmux_init(void); | ||
29 | |||
30 | #endif | ||
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index d8ab76276397..63cc2800dcf8 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/fsl_devices.h> | 23 | #include <linux/fsl_devices.h> |
24 | #include <linux/serial_8250.h> | 24 | #include <linux/serial_8250.h> |
25 | #include <linux/i2c-tegra.h> | 25 | #include <linux/i2c-tegra.h> |
26 | #include <asm/pmu.h> | ||
27 | #include <mach/irqs.h> | 26 | #include <mach/irqs.h> |
28 | #include <mach/iomap.h> | 27 | #include <mach/iomap.h> |
29 | #include <mach/dma.h> | 28 | #include <mach/dma.h> |
@@ -516,7 +515,7 @@ static struct resource tegra_pmu_resources[] = { | |||
516 | 515 | ||
517 | struct platform_device tegra_pmu_device = { | 516 | struct platform_device tegra_pmu_device = { |
518 | .name = "arm-pmu", | 517 | .name = "arm-pmu", |
519 | .id = ARM_PMU_DEVICE_CPU, | 518 | .id = -1, |
520 | .num_resources = ARRAY_SIZE(tegra_pmu_resources), | 519 | .num_resources = ARRAY_SIZE(tegra_pmu_resources), |
521 | .resource = tegra_pmu_resources, | 520 | .resource = tegra_pmu_resources, |
522 | }; | 521 | }; |
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c deleted file mode 100644 index 29c5114d607c..000000000000 --- a/arch/arm/mach-tegra/dma.c +++ /dev/null | |||
@@ -1,823 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/dma.c | ||
3 | * | ||
4 | * System DMA driver for NVIDIA Tegra SoCs | ||
5 | * | ||
6 | * Copyright (c) 2008-2009, NVIDIA Corporation. | ||
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 as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
16 | * more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
21 | */ | ||
22 | |||
23 | #include <linux/io.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | #include <linux/module.h> | ||
26 | #include <linux/spinlock.h> | ||
27 | #include <linux/err.h> | ||
28 | #include <linux/irq.h> | ||
29 | #include <linux/delay.h> | ||
30 | #include <linux/clk.h> | ||
31 | #include <mach/dma.h> | ||
32 | #include <mach/irqs.h> | ||
33 | #include <mach/iomap.h> | ||
34 | #include <mach/suspend.h> | ||
35 | |||
36 | #include "apbio.h" | ||
37 | |||
38 | #define APB_DMA_GEN 0x000 | ||
39 | #define GEN_ENABLE (1<<31) | ||
40 | |||
41 | #define APB_DMA_CNTRL 0x010 | ||
42 | |||
43 | #define APB_DMA_IRQ_MASK 0x01c | ||
44 | |||
45 | #define APB_DMA_IRQ_MASK_SET 0x020 | ||
46 | |||
47 | #define APB_DMA_CHAN_CSR 0x000 | ||
48 | #define CSR_ENB (1<<31) | ||
49 | #define CSR_IE_EOC (1<<30) | ||
50 | #define CSR_HOLD (1<<29) | ||
51 | #define CSR_DIR (1<<28) | ||
52 | #define CSR_ONCE (1<<27) | ||
53 | #define CSR_FLOW (1<<21) | ||
54 | #define CSR_REQ_SEL_SHIFT 16 | ||
55 | #define CSR_WCOUNT_SHIFT 2 | ||
56 | #define CSR_WCOUNT_MASK 0xFFFC | ||
57 | |||
58 | #define APB_DMA_CHAN_STA 0x004 | ||
59 | #define STA_BUSY (1<<31) | ||
60 | #define STA_ISE_EOC (1<<30) | ||
61 | #define STA_HALT (1<<29) | ||
62 | #define STA_PING_PONG (1<<28) | ||
63 | #define STA_COUNT_SHIFT 2 | ||
64 | #define STA_COUNT_MASK 0xFFFC | ||
65 | |||
66 | #define APB_DMA_CHAN_AHB_PTR 0x010 | ||
67 | |||
68 | #define APB_DMA_CHAN_AHB_SEQ 0x014 | ||
69 | #define AHB_SEQ_INTR_ENB (1<<31) | ||
70 | #define AHB_SEQ_BUS_WIDTH_SHIFT 28 | ||
71 | #define AHB_SEQ_BUS_WIDTH_MASK (0x7<<AHB_SEQ_BUS_WIDTH_SHIFT) | ||
72 | #define AHB_SEQ_BUS_WIDTH_8 (0<<AHB_SEQ_BUS_WIDTH_SHIFT) | ||
73 | #define AHB_SEQ_BUS_WIDTH_16 (1<<AHB_SEQ_BUS_WIDTH_SHIFT) | ||
74 | #define AHB_SEQ_BUS_WIDTH_32 (2<<AHB_SEQ_BUS_WIDTH_SHIFT) | ||
75 | #define AHB_SEQ_BUS_WIDTH_64 (3<<AHB_SEQ_BUS_WIDTH_SHIFT) | ||
76 | #define AHB_SEQ_BUS_WIDTH_128 (4<<AHB_SEQ_BUS_WIDTH_SHIFT) | ||
77 | #define AHB_SEQ_DATA_SWAP (1<<27) | ||
78 | #define AHB_SEQ_BURST_MASK (0x7<<24) | ||
79 | #define AHB_SEQ_BURST_1 (4<<24) | ||
80 | #define AHB_SEQ_BURST_4 (5<<24) | ||
81 | #define AHB_SEQ_BURST_8 (6<<24) | ||
82 | #define AHB_SEQ_DBL_BUF (1<<19) | ||
83 | #define AHB_SEQ_WRAP_SHIFT 16 | ||
84 | #define AHB_SEQ_WRAP_MASK (0x7<<AHB_SEQ_WRAP_SHIFT) | ||
85 | |||
86 | #define APB_DMA_CHAN_APB_PTR 0x018 | ||
87 | |||
88 | #define APB_DMA_CHAN_APB_SEQ 0x01c | ||
89 | #define APB_SEQ_BUS_WIDTH_SHIFT 28 | ||
90 | #define APB_SEQ_BUS_WIDTH_MASK (0x7<<APB_SEQ_BUS_WIDTH_SHIFT) | ||
91 | #define APB_SEQ_BUS_WIDTH_8 (0<<APB_SEQ_BUS_WIDTH_SHIFT) | ||
92 | #define APB_SEQ_BUS_WIDTH_16 (1<<APB_SEQ_BUS_WIDTH_SHIFT) | ||
93 | #define APB_SEQ_BUS_WIDTH_32 (2<<APB_SEQ_BUS_WIDTH_SHIFT) | ||
94 | #define APB_SEQ_BUS_WIDTH_64 (3<<APB_SEQ_BUS_WIDTH_SHIFT) | ||
95 | #define APB_SEQ_BUS_WIDTH_128 (4<<APB_SEQ_BUS_WIDTH_SHIFT) | ||
96 | #define APB_SEQ_DATA_SWAP (1<<27) | ||
97 | #define APB_SEQ_WRAP_SHIFT 16 | ||
98 | #define APB_SEQ_WRAP_MASK (0x7<<APB_SEQ_WRAP_SHIFT) | ||
99 | |||
100 | #define TEGRA_SYSTEM_DMA_CH_NR 16 | ||
101 | #define TEGRA_SYSTEM_DMA_AVP_CH_NUM 4 | ||
102 | #define TEGRA_SYSTEM_DMA_CH_MIN 0 | ||
103 | #define TEGRA_SYSTEM_DMA_CH_MAX \ | ||
104 | (TEGRA_SYSTEM_DMA_CH_NR - TEGRA_SYSTEM_DMA_AVP_CH_NUM - 1) | ||
105 | |||
106 | #define NV_DMA_MAX_TRASFER_SIZE 0x10000 | ||
107 | |||
108 | static const unsigned int ahb_addr_wrap_table[8] = { | ||
109 | 0, 32, 64, 128, 256, 512, 1024, 2048 | ||
110 | }; | ||
111 | |||
112 | static const unsigned int apb_addr_wrap_table[8] = { | ||
113 | 0, 1, 2, 4, 8, 16, 32, 64 | ||
114 | }; | ||
115 | |||
116 | static const unsigned int bus_width_table[5] = { | ||
117 | 8, 16, 32, 64, 128 | ||
118 | }; | ||
119 | |||
120 | #define TEGRA_DMA_NAME_SIZE 16 | ||
121 | struct tegra_dma_channel { | ||
122 | struct list_head list; | ||
123 | int id; | ||
124 | spinlock_t lock; | ||
125 | char name[TEGRA_DMA_NAME_SIZE]; | ||
126 | void __iomem *addr; | ||
127 | int mode; | ||
128 | int irq; | ||
129 | int req_transfer_count; | ||
130 | }; | ||
131 | |||
132 | #define NV_DMA_MAX_CHANNELS 32 | ||
133 | |||
134 | static bool tegra_dma_initialized; | ||
135 | static DEFINE_MUTEX(tegra_dma_lock); | ||
136 | static DEFINE_SPINLOCK(enable_lock); | ||
137 | |||
138 | static DECLARE_BITMAP(channel_usage, NV_DMA_MAX_CHANNELS); | ||
139 | static struct tegra_dma_channel dma_channels[NV_DMA_MAX_CHANNELS]; | ||
140 | |||
141 | static void tegra_dma_update_hw(struct tegra_dma_channel *ch, | ||
142 | struct tegra_dma_req *req); | ||
143 | static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch, | ||
144 | struct tegra_dma_req *req); | ||
145 | static void tegra_dma_stop(struct tegra_dma_channel *ch); | ||
146 | |||
147 | void tegra_dma_flush(struct tegra_dma_channel *ch) | ||
148 | { | ||
149 | } | ||
150 | EXPORT_SYMBOL(tegra_dma_flush); | ||
151 | |||
152 | void tegra_dma_dequeue(struct tegra_dma_channel *ch) | ||
153 | { | ||
154 | struct tegra_dma_req *req; | ||
155 | |||
156 | if (tegra_dma_is_empty(ch)) | ||
157 | return; | ||
158 | |||
159 | req = list_entry(ch->list.next, typeof(*req), node); | ||
160 | |||
161 | tegra_dma_dequeue_req(ch, req); | ||
162 | return; | ||
163 | } | ||
164 | |||
165 | static void tegra_dma_stop(struct tegra_dma_channel *ch) | ||
166 | { | ||
167 | u32 csr; | ||
168 | u32 status; | ||
169 | |||
170 | csr = readl(ch->addr + APB_DMA_CHAN_CSR); | ||
171 | csr &= ~CSR_IE_EOC; | ||
172 | writel(csr, ch->addr + APB_DMA_CHAN_CSR); | ||
173 | |||
174 | csr &= ~CSR_ENB; | ||
175 | writel(csr, ch->addr + APB_DMA_CHAN_CSR); | ||
176 | |||
177 | status = readl(ch->addr + APB_DMA_CHAN_STA); | ||
178 | if (status & STA_ISE_EOC) | ||
179 | writel(status, ch->addr + APB_DMA_CHAN_STA); | ||
180 | } | ||
181 | |||
182 | static int tegra_dma_cancel(struct tegra_dma_channel *ch) | ||
183 | { | ||
184 | unsigned long irq_flags; | ||
185 | |||
186 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
187 | while (!list_empty(&ch->list)) | ||
188 | list_del(ch->list.next); | ||
189 | |||
190 | tegra_dma_stop(ch); | ||
191 | |||
192 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
193 | return 0; | ||
194 | } | ||
195 | |||
196 | static unsigned int get_channel_status(struct tegra_dma_channel *ch, | ||
197 | struct tegra_dma_req *req, bool is_stop_dma) | ||
198 | { | ||
199 | void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); | ||
200 | unsigned int status; | ||
201 | |||
202 | if (is_stop_dma) { | ||
203 | /* | ||
204 | * STOP the DMA and get the transfer count. | ||
205 | * Getting the transfer count is tricky. | ||
206 | * - Globally disable DMA on all channels | ||
207 | * - Read the channel's status register to know the number | ||
208 | * of pending bytes to be transfered. | ||
209 | * - Stop the dma channel | ||
210 | * - Globally re-enable DMA to resume other transfers | ||
211 | */ | ||
212 | spin_lock(&enable_lock); | ||
213 | writel(0, addr + APB_DMA_GEN); | ||
214 | udelay(20); | ||
215 | status = readl(ch->addr + APB_DMA_CHAN_STA); | ||
216 | tegra_dma_stop(ch); | ||
217 | writel(GEN_ENABLE, addr + APB_DMA_GEN); | ||
218 | spin_unlock(&enable_lock); | ||
219 | if (status & STA_ISE_EOC) { | ||
220 | pr_err("Got Dma Int here clearing"); | ||
221 | writel(status, ch->addr + APB_DMA_CHAN_STA); | ||
222 | } | ||
223 | req->status = TEGRA_DMA_REQ_ERROR_ABORTED; | ||
224 | } else { | ||
225 | status = readl(ch->addr + APB_DMA_CHAN_STA); | ||
226 | } | ||
227 | return status; | ||
228 | } | ||
229 | |||
230 | /* should be called with the channel lock held */ | ||
231 | static unsigned int dma_active_count(struct tegra_dma_channel *ch, | ||
232 | struct tegra_dma_req *req, unsigned int status) | ||
233 | { | ||
234 | unsigned int to_transfer; | ||
235 | unsigned int req_transfer_count; | ||
236 | unsigned int bytes_transferred; | ||
237 | |||
238 | to_transfer = ((status & STA_COUNT_MASK) >> STA_COUNT_SHIFT) + 1; | ||
239 | req_transfer_count = ch->req_transfer_count + 1; | ||
240 | bytes_transferred = req_transfer_count; | ||
241 | if (status & STA_BUSY) | ||
242 | bytes_transferred -= to_transfer; | ||
243 | /* | ||
244 | * In continuous transfer mode, DMA only tracks the count of the | ||
245 | * half DMA buffer. So, if the DMA already finished half the DMA | ||
246 | * then add the half buffer to the completed count. | ||
247 | */ | ||
248 | if (ch->mode & TEGRA_DMA_MODE_CONTINOUS) { | ||
249 | if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL) | ||
250 | bytes_transferred += req_transfer_count; | ||
251 | if (status & STA_ISE_EOC) | ||
252 | bytes_transferred += req_transfer_count; | ||
253 | } | ||
254 | bytes_transferred *= 4; | ||
255 | return bytes_transferred; | ||
256 | } | ||
257 | |||
258 | int tegra_dma_dequeue_req(struct tegra_dma_channel *ch, | ||
259 | struct tegra_dma_req *_req) | ||
260 | { | ||
261 | unsigned int status; | ||
262 | struct tegra_dma_req *req = NULL; | ||
263 | int found = 0; | ||
264 | unsigned long irq_flags; | ||
265 | int stop = 0; | ||
266 | |||
267 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
268 | |||
269 | if (list_entry(ch->list.next, struct tegra_dma_req, node) == _req) | ||
270 | stop = 1; | ||
271 | |||
272 | list_for_each_entry(req, &ch->list, node) { | ||
273 | if (req == _req) { | ||
274 | list_del(&req->node); | ||
275 | found = 1; | ||
276 | break; | ||
277 | } | ||
278 | } | ||
279 | if (!found) { | ||
280 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
281 | return 0; | ||
282 | } | ||
283 | |||
284 | if (!stop) | ||
285 | goto skip_stop_dma; | ||
286 | |||
287 | status = get_channel_status(ch, req, true); | ||
288 | req->bytes_transferred = dma_active_count(ch, req, status); | ||
289 | |||
290 | if (!list_empty(&ch->list)) { | ||
291 | /* if the list is not empty, queue the next request */ | ||
292 | struct tegra_dma_req *next_req; | ||
293 | next_req = list_entry(ch->list.next, | ||
294 | typeof(*next_req), node); | ||
295 | tegra_dma_update_hw(ch, next_req); | ||
296 | } | ||
297 | |||
298 | skip_stop_dma: | ||
299 | req->status = -TEGRA_DMA_REQ_ERROR_ABORTED; | ||
300 | |||
301 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
302 | |||
303 | /* Callback should be called without any lock */ | ||
304 | req->complete(req); | ||
305 | return 0; | ||
306 | } | ||
307 | EXPORT_SYMBOL(tegra_dma_dequeue_req); | ||
308 | |||
309 | bool tegra_dma_is_empty(struct tegra_dma_channel *ch) | ||
310 | { | ||
311 | unsigned long irq_flags; | ||
312 | bool is_empty; | ||
313 | |||
314 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
315 | if (list_empty(&ch->list)) | ||
316 | is_empty = true; | ||
317 | else | ||
318 | is_empty = false; | ||
319 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
320 | return is_empty; | ||
321 | } | ||
322 | EXPORT_SYMBOL(tegra_dma_is_empty); | ||
323 | |||
324 | bool tegra_dma_is_req_inflight(struct tegra_dma_channel *ch, | ||
325 | struct tegra_dma_req *_req) | ||
326 | { | ||
327 | unsigned long irq_flags; | ||
328 | struct tegra_dma_req *req; | ||
329 | |||
330 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
331 | list_for_each_entry(req, &ch->list, node) { | ||
332 | if (req == _req) { | ||
333 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
334 | return true; | ||
335 | } | ||
336 | } | ||
337 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
338 | return false; | ||
339 | } | ||
340 | EXPORT_SYMBOL(tegra_dma_is_req_inflight); | ||
341 | |||
342 | int tegra_dma_enqueue_req(struct tegra_dma_channel *ch, | ||
343 | struct tegra_dma_req *req) | ||
344 | { | ||
345 | unsigned long irq_flags; | ||
346 | struct tegra_dma_req *_req; | ||
347 | int start_dma = 0; | ||
348 | |||
349 | if (req->size > NV_DMA_MAX_TRASFER_SIZE || | ||
350 | req->source_addr & 0x3 || req->dest_addr & 0x3) { | ||
351 | pr_err("Invalid DMA request for channel %d\n", ch->id); | ||
352 | return -EINVAL; | ||
353 | } | ||
354 | |||
355 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
356 | |||
357 | list_for_each_entry(_req, &ch->list, node) { | ||
358 | if (req == _req) { | ||
359 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
360 | return -EEXIST; | ||
361 | } | ||
362 | } | ||
363 | |||
364 | req->bytes_transferred = 0; | ||
365 | req->status = 0; | ||
366 | req->buffer_status = 0; | ||
367 | if (list_empty(&ch->list)) | ||
368 | start_dma = 1; | ||
369 | |||
370 | list_add_tail(&req->node, &ch->list); | ||
371 | |||
372 | if (start_dma) | ||
373 | tegra_dma_update_hw(ch, req); | ||
374 | |||
375 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
376 | |||
377 | return 0; | ||
378 | } | ||
379 | EXPORT_SYMBOL(tegra_dma_enqueue_req); | ||
380 | |||
381 | struct tegra_dma_channel *tegra_dma_allocate_channel(int mode) | ||
382 | { | ||
383 | int channel; | ||
384 | struct tegra_dma_channel *ch = NULL; | ||
385 | |||
386 | if (!tegra_dma_initialized) | ||
387 | return NULL; | ||
388 | |||
389 | mutex_lock(&tegra_dma_lock); | ||
390 | |||
391 | /* first channel is the shared channel */ | ||
392 | if (mode & TEGRA_DMA_SHARED) { | ||
393 | channel = TEGRA_SYSTEM_DMA_CH_MIN; | ||
394 | } else { | ||
395 | channel = find_first_zero_bit(channel_usage, | ||
396 | ARRAY_SIZE(dma_channels)); | ||
397 | if (channel >= ARRAY_SIZE(dma_channels)) | ||
398 | goto out; | ||
399 | } | ||
400 | __set_bit(channel, channel_usage); | ||
401 | ch = &dma_channels[channel]; | ||
402 | ch->mode = mode; | ||
403 | |||
404 | out: | ||
405 | mutex_unlock(&tegra_dma_lock); | ||
406 | return ch; | ||
407 | } | ||
408 | EXPORT_SYMBOL(tegra_dma_allocate_channel); | ||
409 | |||
410 | void tegra_dma_free_channel(struct tegra_dma_channel *ch) | ||
411 | { | ||
412 | if (ch->mode & TEGRA_DMA_SHARED) | ||
413 | return; | ||
414 | tegra_dma_cancel(ch); | ||
415 | mutex_lock(&tegra_dma_lock); | ||
416 | __clear_bit(ch->id, channel_usage); | ||
417 | mutex_unlock(&tegra_dma_lock); | ||
418 | } | ||
419 | EXPORT_SYMBOL(tegra_dma_free_channel); | ||
420 | |||
421 | static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch, | ||
422 | struct tegra_dma_req *req) | ||
423 | { | ||
424 | u32 apb_ptr; | ||
425 | u32 ahb_ptr; | ||
426 | |||
427 | if (req->to_memory) { | ||
428 | apb_ptr = req->source_addr; | ||
429 | ahb_ptr = req->dest_addr; | ||
430 | } else { | ||
431 | apb_ptr = req->dest_addr; | ||
432 | ahb_ptr = req->source_addr; | ||
433 | } | ||
434 | writel(apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR); | ||
435 | writel(ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR); | ||
436 | |||
437 | req->status = TEGRA_DMA_REQ_INFLIGHT; | ||
438 | return; | ||
439 | } | ||
440 | |||
441 | static void tegra_dma_update_hw(struct tegra_dma_channel *ch, | ||
442 | struct tegra_dma_req *req) | ||
443 | { | ||
444 | int ahb_addr_wrap; | ||
445 | int apb_addr_wrap; | ||
446 | int ahb_bus_width; | ||
447 | int apb_bus_width; | ||
448 | int index; | ||
449 | |||
450 | u32 ahb_seq; | ||
451 | u32 apb_seq; | ||
452 | u32 ahb_ptr; | ||
453 | u32 apb_ptr; | ||
454 | u32 csr; | ||
455 | |||
456 | csr = CSR_IE_EOC | CSR_FLOW; | ||
457 | ahb_seq = AHB_SEQ_INTR_ENB | AHB_SEQ_BURST_1; | ||
458 | apb_seq = 0; | ||
459 | |||
460 | csr |= req->req_sel << CSR_REQ_SEL_SHIFT; | ||
461 | |||
462 | /* One shot mode is always single buffered, | ||
463 | * continuous mode is always double buffered | ||
464 | * */ | ||
465 | if (ch->mode & TEGRA_DMA_MODE_ONESHOT) { | ||
466 | csr |= CSR_ONCE; | ||
467 | ch->req_transfer_count = (req->size >> 2) - 1; | ||
468 | } else { | ||
469 | ahb_seq |= AHB_SEQ_DBL_BUF; | ||
470 | |||
471 | /* In double buffered mode, we set the size to half the | ||
472 | * requested size and interrupt when half the buffer | ||
473 | * is full */ | ||
474 | ch->req_transfer_count = (req->size >> 3) - 1; | ||
475 | } | ||
476 | |||
477 | csr |= ch->req_transfer_count << CSR_WCOUNT_SHIFT; | ||
478 | |||
479 | if (req->to_memory) { | ||
480 | apb_ptr = req->source_addr; | ||
481 | ahb_ptr = req->dest_addr; | ||
482 | |||
483 | apb_addr_wrap = req->source_wrap; | ||
484 | ahb_addr_wrap = req->dest_wrap; | ||
485 | apb_bus_width = req->source_bus_width; | ||
486 | ahb_bus_width = req->dest_bus_width; | ||
487 | |||
488 | } else { | ||
489 | csr |= CSR_DIR; | ||
490 | apb_ptr = req->dest_addr; | ||
491 | ahb_ptr = req->source_addr; | ||
492 | |||
493 | apb_addr_wrap = req->dest_wrap; | ||
494 | ahb_addr_wrap = req->source_wrap; | ||
495 | apb_bus_width = req->dest_bus_width; | ||
496 | ahb_bus_width = req->source_bus_width; | ||
497 | } | ||
498 | |||
499 | apb_addr_wrap >>= 2; | ||
500 | ahb_addr_wrap >>= 2; | ||
501 | |||
502 | /* set address wrap for APB size */ | ||
503 | index = 0; | ||
504 | do { | ||
505 | if (apb_addr_wrap_table[index] == apb_addr_wrap) | ||
506 | break; | ||
507 | index++; | ||
508 | } while (index < ARRAY_SIZE(apb_addr_wrap_table)); | ||
509 | BUG_ON(index == ARRAY_SIZE(apb_addr_wrap_table)); | ||
510 | apb_seq |= index << APB_SEQ_WRAP_SHIFT; | ||
511 | |||
512 | /* set address wrap for AHB size */ | ||
513 | index = 0; | ||
514 | do { | ||
515 | if (ahb_addr_wrap_table[index] == ahb_addr_wrap) | ||
516 | break; | ||
517 | index++; | ||
518 | } while (index < ARRAY_SIZE(ahb_addr_wrap_table)); | ||
519 | BUG_ON(index == ARRAY_SIZE(ahb_addr_wrap_table)); | ||
520 | ahb_seq |= index << AHB_SEQ_WRAP_SHIFT; | ||
521 | |||
522 | for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) { | ||
523 | if (bus_width_table[index] == ahb_bus_width) | ||
524 | break; | ||
525 | } | ||
526 | BUG_ON(index == ARRAY_SIZE(bus_width_table)); | ||
527 | ahb_seq |= index << AHB_SEQ_BUS_WIDTH_SHIFT; | ||
528 | |||
529 | for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) { | ||
530 | if (bus_width_table[index] == apb_bus_width) | ||
531 | break; | ||
532 | } | ||
533 | BUG_ON(index == ARRAY_SIZE(bus_width_table)); | ||
534 | apb_seq |= index << APB_SEQ_BUS_WIDTH_SHIFT; | ||
535 | |||
536 | writel(csr, ch->addr + APB_DMA_CHAN_CSR); | ||
537 | writel(apb_seq, ch->addr + APB_DMA_CHAN_APB_SEQ); | ||
538 | writel(apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR); | ||
539 | writel(ahb_seq, ch->addr + APB_DMA_CHAN_AHB_SEQ); | ||
540 | writel(ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR); | ||
541 | |||
542 | csr |= CSR_ENB; | ||
543 | writel(csr, ch->addr + APB_DMA_CHAN_CSR); | ||
544 | |||
545 | req->status = TEGRA_DMA_REQ_INFLIGHT; | ||
546 | } | ||
547 | |||
548 | static void handle_oneshot_dma(struct tegra_dma_channel *ch) | ||
549 | { | ||
550 | struct tegra_dma_req *req; | ||
551 | unsigned long irq_flags; | ||
552 | |||
553 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
554 | if (list_empty(&ch->list)) { | ||
555 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
556 | return; | ||
557 | } | ||
558 | |||
559 | req = list_entry(ch->list.next, typeof(*req), node); | ||
560 | if (req) { | ||
561 | int bytes_transferred; | ||
562 | |||
563 | bytes_transferred = ch->req_transfer_count; | ||
564 | bytes_transferred += 1; | ||
565 | bytes_transferred <<= 2; | ||
566 | |||
567 | list_del(&req->node); | ||
568 | req->bytes_transferred = bytes_transferred; | ||
569 | req->status = TEGRA_DMA_REQ_SUCCESS; | ||
570 | |||
571 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
572 | /* Callback should be called without any lock */ | ||
573 | pr_debug("%s: transferred %d bytes\n", __func__, | ||
574 | req->bytes_transferred); | ||
575 | req->complete(req); | ||
576 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
577 | } | ||
578 | |||
579 | if (!list_empty(&ch->list)) { | ||
580 | req = list_entry(ch->list.next, typeof(*req), node); | ||
581 | /* the complete function we just called may have enqueued | ||
582 | another req, in which case dma has already started */ | ||
583 | if (req->status != TEGRA_DMA_REQ_INFLIGHT) | ||
584 | tegra_dma_update_hw(ch, req); | ||
585 | } | ||
586 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
587 | } | ||
588 | |||
589 | static void handle_continuous_dma(struct tegra_dma_channel *ch) | ||
590 | { | ||
591 | struct tegra_dma_req *req; | ||
592 | unsigned long irq_flags; | ||
593 | |||
594 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
595 | if (list_empty(&ch->list)) { | ||
596 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
597 | return; | ||
598 | } | ||
599 | |||
600 | req = list_entry(ch->list.next, typeof(*req), node); | ||
601 | if (req) { | ||
602 | if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_EMPTY) { | ||
603 | bool is_dma_ping_complete; | ||
604 | is_dma_ping_complete = (readl(ch->addr + APB_DMA_CHAN_STA) | ||
605 | & STA_PING_PONG) ? true : false; | ||
606 | if (req->to_memory) | ||
607 | is_dma_ping_complete = !is_dma_ping_complete; | ||
608 | /* Out of sync - Release current buffer */ | ||
609 | if (!is_dma_ping_complete) { | ||
610 | int bytes_transferred; | ||
611 | |||
612 | bytes_transferred = ch->req_transfer_count; | ||
613 | bytes_transferred += 1; | ||
614 | bytes_transferred <<= 3; | ||
615 | req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_FULL; | ||
616 | req->bytes_transferred = bytes_transferred; | ||
617 | req->status = TEGRA_DMA_REQ_SUCCESS; | ||
618 | tegra_dma_stop(ch); | ||
619 | |||
620 | if (!list_is_last(&req->node, &ch->list)) { | ||
621 | struct tegra_dma_req *next_req; | ||
622 | |||
623 | next_req = list_entry(req->node.next, | ||
624 | typeof(*next_req), node); | ||
625 | tegra_dma_update_hw(ch, next_req); | ||
626 | } | ||
627 | |||
628 | list_del(&req->node); | ||
629 | |||
630 | /* DMA lock is NOT held when callbak is called */ | ||
631 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
632 | req->complete(req); | ||
633 | return; | ||
634 | } | ||
635 | /* Load the next request into the hardware, if available | ||
636 | * */ | ||
637 | if (!list_is_last(&req->node, &ch->list)) { | ||
638 | struct tegra_dma_req *next_req; | ||
639 | |||
640 | next_req = list_entry(req->node.next, | ||
641 | typeof(*next_req), node); | ||
642 | tegra_dma_update_hw_partial(ch, next_req); | ||
643 | } | ||
644 | req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL; | ||
645 | req->status = TEGRA_DMA_REQ_SUCCESS; | ||
646 | /* DMA lock is NOT held when callback is called */ | ||
647 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
648 | if (likely(req->threshold)) | ||
649 | req->threshold(req); | ||
650 | return; | ||
651 | |||
652 | } else if (req->buffer_status == | ||
653 | TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL) { | ||
654 | /* Callback when the buffer is completely full (i.e on | ||
655 | * the second interrupt */ | ||
656 | int bytes_transferred; | ||
657 | |||
658 | bytes_transferred = ch->req_transfer_count; | ||
659 | bytes_transferred += 1; | ||
660 | bytes_transferred <<= 3; | ||
661 | |||
662 | req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_FULL; | ||
663 | req->bytes_transferred = bytes_transferred; | ||
664 | req->status = TEGRA_DMA_REQ_SUCCESS; | ||
665 | list_del(&req->node); | ||
666 | |||
667 | /* DMA lock is NOT held when callbak is called */ | ||
668 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
669 | req->complete(req); | ||
670 | return; | ||
671 | |||
672 | } else { | ||
673 | BUG(); | ||
674 | } | ||
675 | } | ||
676 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
677 | } | ||
678 | |||
679 | static irqreturn_t dma_isr(int irq, void *data) | ||
680 | { | ||
681 | struct tegra_dma_channel *ch = data; | ||
682 | unsigned long status; | ||
683 | |||
684 | status = readl(ch->addr + APB_DMA_CHAN_STA); | ||
685 | if (status & STA_ISE_EOC) | ||
686 | writel(status, ch->addr + APB_DMA_CHAN_STA); | ||
687 | else { | ||
688 | pr_warning("Got a spurious ISR for DMA channel %d\n", ch->id); | ||
689 | return IRQ_HANDLED; | ||
690 | } | ||
691 | return IRQ_WAKE_THREAD; | ||
692 | } | ||
693 | |||
694 | static irqreturn_t dma_thread_fn(int irq, void *data) | ||
695 | { | ||
696 | struct tegra_dma_channel *ch = data; | ||
697 | |||
698 | if (ch->mode & TEGRA_DMA_MODE_ONESHOT) | ||
699 | handle_oneshot_dma(ch); | ||
700 | else | ||
701 | handle_continuous_dma(ch); | ||
702 | |||
703 | |||
704 | return IRQ_HANDLED; | ||
705 | } | ||
706 | |||
707 | int __init tegra_dma_init(void) | ||
708 | { | ||
709 | int ret = 0; | ||
710 | int i; | ||
711 | unsigned int irq; | ||
712 | void __iomem *addr; | ||
713 | struct clk *c; | ||
714 | |||
715 | bitmap_fill(channel_usage, NV_DMA_MAX_CHANNELS); | ||
716 | |||
717 | c = clk_get_sys("tegra-apbdma", NULL); | ||
718 | if (IS_ERR(c)) { | ||
719 | pr_err("Unable to get clock for APB DMA\n"); | ||
720 | ret = PTR_ERR(c); | ||
721 | goto fail; | ||
722 | } | ||
723 | ret = clk_prepare_enable(c); | ||
724 | if (ret != 0) { | ||
725 | pr_err("Unable to enable clock for APB DMA\n"); | ||
726 | goto fail; | ||
727 | } | ||
728 | |||
729 | addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); | ||
730 | writel(GEN_ENABLE, addr + APB_DMA_GEN); | ||
731 | writel(0, addr + APB_DMA_CNTRL); | ||
732 | writel(0xFFFFFFFFul >> (31 - TEGRA_SYSTEM_DMA_CH_MAX), | ||
733 | addr + APB_DMA_IRQ_MASK_SET); | ||
734 | |||
735 | for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) { | ||
736 | struct tegra_dma_channel *ch = &dma_channels[i]; | ||
737 | |||
738 | ch->id = i; | ||
739 | snprintf(ch->name, TEGRA_DMA_NAME_SIZE, "dma_channel_%d", i); | ||
740 | |||
741 | ch->addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE + | ||
742 | TEGRA_APB_DMA_CH0_SIZE * i); | ||
743 | |||
744 | spin_lock_init(&ch->lock); | ||
745 | INIT_LIST_HEAD(&ch->list); | ||
746 | |||
747 | irq = INT_APB_DMA_CH0 + i; | ||
748 | ret = request_threaded_irq(irq, dma_isr, dma_thread_fn, 0, | ||
749 | dma_channels[i].name, ch); | ||
750 | if (ret) { | ||
751 | pr_err("Failed to register IRQ %d for DMA %d\n", | ||
752 | irq, i); | ||
753 | goto fail; | ||
754 | } | ||
755 | ch->irq = irq; | ||
756 | |||
757 | __clear_bit(i, channel_usage); | ||
758 | } | ||
759 | /* mark the shared channel allocated */ | ||
760 | __set_bit(TEGRA_SYSTEM_DMA_CH_MIN, channel_usage); | ||
761 | |||
762 | tegra_dma_initialized = true; | ||
763 | |||
764 | return 0; | ||
765 | fail: | ||
766 | writel(0, addr + APB_DMA_GEN); | ||
767 | for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) { | ||
768 | struct tegra_dma_channel *ch = &dma_channels[i]; | ||
769 | if (ch->irq) | ||
770 | free_irq(ch->irq, ch); | ||
771 | } | ||
772 | return ret; | ||
773 | } | ||
774 | postcore_initcall(tegra_dma_init); | ||
775 | |||
776 | #ifdef CONFIG_PM | ||
777 | static u32 apb_dma[5*TEGRA_SYSTEM_DMA_CH_NR + 3]; | ||
778 | |||
779 | void tegra_dma_suspend(void) | ||
780 | { | ||
781 | void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); | ||
782 | u32 *ctx = apb_dma; | ||
783 | int i; | ||
784 | |||
785 | *ctx++ = readl(addr + APB_DMA_GEN); | ||
786 | *ctx++ = readl(addr + APB_DMA_CNTRL); | ||
787 | *ctx++ = readl(addr + APB_DMA_IRQ_MASK); | ||
788 | |||
789 | for (i = 0; i < TEGRA_SYSTEM_DMA_CH_NR; i++) { | ||
790 | addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE + | ||
791 | TEGRA_APB_DMA_CH0_SIZE * i); | ||
792 | |||
793 | *ctx++ = readl(addr + APB_DMA_CHAN_CSR); | ||
794 | *ctx++ = readl(addr + APB_DMA_CHAN_AHB_PTR); | ||
795 | *ctx++ = readl(addr + APB_DMA_CHAN_AHB_SEQ); | ||
796 | *ctx++ = readl(addr + APB_DMA_CHAN_APB_PTR); | ||
797 | *ctx++ = readl(addr + APB_DMA_CHAN_APB_SEQ); | ||
798 | } | ||
799 | } | ||
800 | |||
801 | void tegra_dma_resume(void) | ||
802 | { | ||
803 | void __iomem *addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); | ||
804 | u32 *ctx = apb_dma; | ||
805 | int i; | ||
806 | |||
807 | writel(*ctx++, addr + APB_DMA_GEN); | ||
808 | writel(*ctx++, addr + APB_DMA_CNTRL); | ||
809 | writel(*ctx++, addr + APB_DMA_IRQ_MASK); | ||
810 | |||
811 | for (i = 0; i < TEGRA_SYSTEM_DMA_CH_NR; i++) { | ||
812 | addr = IO_ADDRESS(TEGRA_APB_DMA_CH0_BASE + | ||
813 | TEGRA_APB_DMA_CH0_SIZE * i); | ||
814 | |||
815 | writel(*ctx++, addr + APB_DMA_CHAN_CSR); | ||
816 | writel(*ctx++, addr + APB_DMA_CHAN_AHB_PTR); | ||
817 | writel(*ctx++, addr + APB_DMA_CHAN_AHB_SEQ); | ||
818 | writel(*ctx++, addr + APB_DMA_CHAN_APB_PTR); | ||
819 | writel(*ctx++, addr + APB_DMA_CHAN_APB_SEQ); | ||
820 | } | ||
821 | } | ||
822 | |||
823 | #endif | ||
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c index f946d129423c..0b7db174a5de 100644 --- a/arch/arm/mach-tegra/fuse.c +++ b/arch/arm/mach-tegra/fuse.c | |||
@@ -93,9 +93,9 @@ void tegra_init_fuse(void) | |||
93 | { | 93 | { |
94 | u32 id; | 94 | u32 id; |
95 | 95 | ||
96 | u32 reg = readl(IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48)); | 96 | u32 reg = readl(IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48)); |
97 | reg |= 1 << 28; | 97 | reg |= 1 << 28; |
98 | writel(reg, IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48)); | 98 | writel(reg, IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48)); |
99 | 99 | ||
100 | reg = tegra_fuse_readl(FUSE_SKU_INFO); | 100 | reg = tegra_fuse_readl(FUSE_SKU_INFO); |
101 | tegra_sku_id = reg & 0xFF; | 101 | tegra_sku_id = reg & 0xFF; |
diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h index 9077092812c0..3081cc6dda3b 100644 --- a/arch/arm/mach-tegra/include/mach/dma.h +++ b/arch/arm/mach-tegra/include/mach/dma.h | |||
@@ -51,101 +51,4 @@ | |||
51 | #define TEGRA_DMA_REQ_SEL_OWR 25 | 51 | #define TEGRA_DMA_REQ_SEL_OWR 25 |
52 | #define TEGRA_DMA_REQ_SEL_INVALID 31 | 52 | #define TEGRA_DMA_REQ_SEL_INVALID 31 |
53 | 53 | ||
54 | struct tegra_dma_req; | ||
55 | struct tegra_dma_channel; | ||
56 | |||
57 | enum tegra_dma_mode { | ||
58 | TEGRA_DMA_SHARED = 1, | ||
59 | TEGRA_DMA_MODE_CONTINOUS = 2, | ||
60 | TEGRA_DMA_MODE_ONESHOT = 4, | ||
61 | }; | ||
62 | |||
63 | enum tegra_dma_req_error { | ||
64 | TEGRA_DMA_REQ_SUCCESS = 0, | ||
65 | TEGRA_DMA_REQ_ERROR_ABORTED, | ||
66 | TEGRA_DMA_REQ_INFLIGHT, | ||
67 | }; | ||
68 | |||
69 | enum tegra_dma_req_buff_status { | ||
70 | TEGRA_DMA_REQ_BUF_STATUS_EMPTY = 0, | ||
71 | TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL, | ||
72 | TEGRA_DMA_REQ_BUF_STATUS_FULL, | ||
73 | }; | ||
74 | |||
75 | struct tegra_dma_req { | ||
76 | struct list_head node; | ||
77 | unsigned int modid; | ||
78 | int instance; | ||
79 | |||
80 | /* Called when the req is complete and from the DMA ISR context. | ||
81 | * When this is called the req structure is no longer queued by | ||
82 | * the DMA channel. | ||
83 | * | ||
84 | * State of the DMA depends on the number of req it has. If there are | ||
85 | * no DMA requests queued up, then it will STOP the DMA. It there are | ||
86 | * more requests in the DMA, then it will queue the next request. | ||
87 | */ | ||
88 | void (*complete)(struct tegra_dma_req *req); | ||
89 | |||
90 | /* This is a called from the DMA ISR context when the DMA is still in | ||
91 | * progress and is actively filling same buffer. | ||
92 | * | ||
93 | * In case of continuous mode receive, this threshold is 1/2 the buffer | ||
94 | * size. In other cases, this will not even be called as there is no | ||
95 | * hardware support for it. | ||
96 | * | ||
97 | * In the case of continuous mode receive, if there is next req already | ||
98 | * queued, DMA programs the HW to use that req when this req is | ||
99 | * completed. If there is no "next req" queued, then DMA ISR doesn't do | ||
100 | * anything before calling this callback. | ||
101 | * | ||
102 | * This is mainly used by the cases, where the clients has queued | ||
103 | * only one req and want to get some sort of DMA threshold | ||
104 | * callback to program the next buffer. | ||
105 | * | ||
106 | */ | ||
107 | void (*threshold)(struct tegra_dma_req *req); | ||
108 | |||
109 | /* 1 to copy to memory. | ||
110 | * 0 to copy from the memory to device FIFO */ | ||
111 | int to_memory; | ||
112 | |||
113 | void *virt_addr; | ||
114 | |||
115 | unsigned long source_addr; | ||
116 | unsigned long dest_addr; | ||
117 | unsigned long dest_wrap; | ||
118 | unsigned long source_wrap; | ||
119 | unsigned long source_bus_width; | ||
120 | unsigned long dest_bus_width; | ||
121 | unsigned long req_sel; | ||
122 | unsigned int size; | ||
123 | |||
124 | /* Updated by the DMA driver on the conpletion of the request. */ | ||
125 | int bytes_transferred; | ||
126 | int status; | ||
127 | |||
128 | /* DMA completion tracking information */ | ||
129 | int buffer_status; | ||
130 | |||
131 | /* Client specific data */ | ||
132 | void *dev; | ||
133 | }; | ||
134 | |||
135 | int tegra_dma_enqueue_req(struct tegra_dma_channel *ch, | ||
136 | struct tegra_dma_req *req); | ||
137 | int tegra_dma_dequeue_req(struct tegra_dma_channel *ch, | ||
138 | struct tegra_dma_req *req); | ||
139 | void tegra_dma_dequeue(struct tegra_dma_channel *ch); | ||
140 | void tegra_dma_flush(struct tegra_dma_channel *ch); | ||
141 | |||
142 | bool tegra_dma_is_req_inflight(struct tegra_dma_channel *ch, | ||
143 | struct tegra_dma_req *req); | ||
144 | bool tegra_dma_is_empty(struct tegra_dma_channel *ch); | ||
145 | |||
146 | struct tegra_dma_channel *tegra_dma_allocate_channel(int mode); | ||
147 | void tegra_dma_free_channel(struct tegra_dma_channel *ch); | ||
148 | |||
149 | int __init tegra_dma_init(void); | ||
150 | |||
151 | #endif | 54 | #endif |
diff --git a/arch/arm/mach-tegra/include/mach/io.h b/arch/arm/mach-tegra/include/mach/io.h deleted file mode 100644 index fe700f9ce7dc..000000000000 --- a/arch/arm/mach-tegra/include/mach/io.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/include/mach/io.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Google, Inc. | ||
5 | * | ||
6 | * Author: | ||
7 | * Colin Cross <ccross@google.com> | ||
8 | * Erik Gilling <konkers@google.com> | ||
9 | * | ||
10 | * This software is licensed under the terms of the GNU General Public | ||
11 | * License version 2, as published by the Free Software Foundation, and | ||
12 | * may be copied, distributed, and modified under those terms. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | #ifndef __MACH_TEGRA_IO_H | ||
22 | #define __MACH_TEGRA_IO_H | ||
23 | |||
24 | #define IO_SPACE_LIMIT 0xffff | ||
25 | |||
26 | #ifndef __ASSEMBLER__ | ||
27 | |||
28 | #ifdef CONFIG_TEGRA_PCI | ||
29 | extern void __iomem *tegra_pcie_io_base; | ||
30 | |||
31 | static inline void __iomem *__io(unsigned long addr) | ||
32 | { | ||
33 | return tegra_pcie_io_base + (addr & IO_SPACE_LIMIT); | ||
34 | } | ||
35 | #else | ||
36 | static inline void __iomem *__io(unsigned long addr) | ||
37 | { | ||
38 | return (void __iomem *)addr; | ||
39 | } | ||
40 | #endif | ||
41 | |||
42 | #define __io(a) __io(a) | ||
43 | |||
44 | #endif | ||
45 | |||
46 | #endif | ||
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h index 7e76da73121c..fee3a94c4549 100644 --- a/arch/arm/mach-tegra/include/mach/iomap.h +++ b/arch/arm/mach-tegra/include/mach/iomap.h | |||
@@ -303,6 +303,9 @@ | |||
303 | #define IO_APB_VIRT IOMEM(0xFE300000) | 303 | #define IO_APB_VIRT IOMEM(0xFE300000) |
304 | #define IO_APB_SIZE SZ_1M | 304 | #define IO_APB_SIZE SZ_1M |
305 | 305 | ||
306 | #define TEGRA_PCIE_BASE 0x80000000 | ||
307 | #define TEGRA_PCIE_IO_BASE (TEGRA_PCIE_BASE + SZ_4M) | ||
308 | |||
306 | #define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz))) | 309 | #define IO_TO_VIRT_BETWEEN(p, st, sz) ((p) >= (st) && (p) < ((st) + (sz))) |
307 | #define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst))) | 310 | #define IO_TO_VIRT_XLATE(p, pst, vst) (((p) - (pst) + (vst))) |
308 | 311 | ||
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c index c25a2a4f2e3d..a8dba6489c9b 100644 --- a/arch/arm/mach-tegra/pcie.c +++ b/arch/arm/mach-tegra/pcie.c | |||
@@ -171,8 +171,6 @@ static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE); | |||
171 | * 0x90000000 - 0x9fffffff - non-prefetchable memory | 171 | * 0x90000000 - 0x9fffffff - non-prefetchable memory |
172 | * 0xa0000000 - 0xbfffffff - prefetchable memory | 172 | * 0xa0000000 - 0xbfffffff - prefetchable memory |
173 | */ | 173 | */ |
174 | #define TEGRA_PCIE_BASE 0x80000000 | ||
175 | |||
176 | #define PCIE_REGS_SZ SZ_16K | 174 | #define PCIE_REGS_SZ SZ_16K |
177 | #define PCIE_CFG_OFF PCIE_REGS_SZ | 175 | #define PCIE_CFG_OFF PCIE_REGS_SZ |
178 | #define PCIE_CFG_SZ SZ_1M | 176 | #define PCIE_CFG_SZ SZ_1M |
@@ -180,8 +178,6 @@ static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE); | |||
180 | #define PCIE_EXT_CFG_SZ SZ_1M | 178 | #define PCIE_EXT_CFG_SZ SZ_1M |
181 | #define PCIE_IOMAP_SZ (PCIE_REGS_SZ + PCIE_CFG_SZ + PCIE_EXT_CFG_SZ) | 179 | #define PCIE_IOMAP_SZ (PCIE_REGS_SZ + PCIE_CFG_SZ + PCIE_EXT_CFG_SZ) |
182 | 180 | ||
183 | #define MMIO_BASE (TEGRA_PCIE_BASE + SZ_4M) | ||
184 | #define MMIO_SIZE SZ_64K | ||
185 | #define MEM_BASE_0 (TEGRA_PCIE_BASE + SZ_256M) | 181 | #define MEM_BASE_0 (TEGRA_PCIE_BASE + SZ_256M) |
186 | #define MEM_SIZE_0 SZ_128M | 182 | #define MEM_SIZE_0 SZ_128M |
187 | #define MEM_BASE_1 (MEM_BASE_0 + MEM_SIZE_0) | 183 | #define MEM_BASE_1 (MEM_BASE_0 + MEM_SIZE_0) |
@@ -204,10 +200,9 @@ struct tegra_pcie_port { | |||
204 | 200 | ||
205 | bool link_up; | 201 | bool link_up; |
206 | 202 | ||
207 | char io_space_name[16]; | ||
208 | char mem_space_name[16]; | 203 | char mem_space_name[16]; |
209 | char prefetch_space_name[20]; | 204 | char prefetch_space_name[20]; |
210 | struct resource res[3]; | 205 | struct resource res[2]; |
211 | }; | 206 | }; |
212 | 207 | ||
213 | struct tegra_pcie_info { | 208 | struct tegra_pcie_info { |
@@ -223,17 +218,7 @@ struct tegra_pcie_info { | |||
223 | struct clk *pll_e; | 218 | struct clk *pll_e; |
224 | }; | 219 | }; |
225 | 220 | ||
226 | static struct tegra_pcie_info tegra_pcie = { | 221 | static struct tegra_pcie_info tegra_pcie; |
227 | .res_mmio = { | ||
228 | .name = "PCI IO", | ||
229 | .start = MMIO_BASE, | ||
230 | .end = MMIO_BASE + MMIO_SIZE - 1, | ||
231 | .flags = IORESOURCE_MEM, | ||
232 | }, | ||
233 | }; | ||
234 | |||
235 | void __iomem *tegra_pcie_io_base; | ||
236 | EXPORT_SYMBOL(tegra_pcie_io_base); | ||
237 | 222 | ||
238 | static inline void afi_writel(u32 value, unsigned long offset) | 223 | static inline void afi_writel(u32 value, unsigned long offset) |
239 | { | 224 | { |
@@ -381,24 +366,7 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys) | |||
381 | pp = tegra_pcie.port + nr; | 366 | pp = tegra_pcie.port + nr; |
382 | pp->root_bus_nr = sys->busnr; | 367 | pp->root_bus_nr = sys->busnr; |
383 | 368 | ||
384 | /* | 369 | pci_ioremap_io(nr * SZ_64K, TEGRA_PCIE_IO_BASE); |
385 | * IORESOURCE_IO | ||
386 | */ | ||
387 | snprintf(pp->io_space_name, sizeof(pp->io_space_name), | ||
388 | "PCIe %d I/O", pp->index); | ||
389 | pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0; | ||
390 | pp->res[0].name = pp->io_space_name; | ||
391 | if (pp->index == 0) { | ||
392 | pp->res[0].start = PCIBIOS_MIN_IO; | ||
393 | pp->res[0].end = pp->res[0].start + SZ_32K - 1; | ||
394 | } else { | ||
395 | pp->res[0].start = PCIBIOS_MIN_IO + SZ_32K; | ||
396 | pp->res[0].end = IO_SPACE_LIMIT; | ||
397 | } | ||
398 | pp->res[0].flags = IORESOURCE_IO; | ||
399 | if (request_resource(&ioport_resource, &pp->res[0])) | ||
400 | panic("Request PCIe IO resource failed\n"); | ||
401 | pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset); | ||
402 | 370 | ||
403 | /* | 371 | /* |
404 | * IORESOURCE_MEM | 372 | * IORESOURCE_MEM |
@@ -406,18 +374,18 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys) | |||
406 | snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), | 374 | snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), |
407 | "PCIe %d MEM", pp->index); | 375 | "PCIe %d MEM", pp->index); |
408 | pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; | 376 | pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; |
409 | pp->res[1].name = pp->mem_space_name; | 377 | pp->res[0].name = pp->mem_space_name; |
410 | if (pp->index == 0) { | 378 | if (pp->index == 0) { |
411 | pp->res[1].start = MEM_BASE_0; | 379 | pp->res[0].start = MEM_BASE_0; |
412 | pp->res[1].end = pp->res[1].start + MEM_SIZE_0 - 1; | 380 | pp->res[0].end = pp->res[0].start + MEM_SIZE_0 - 1; |
413 | } else { | 381 | } else { |
414 | pp->res[1].start = MEM_BASE_1; | 382 | pp->res[0].start = MEM_BASE_1; |
415 | pp->res[1].end = pp->res[1].start + MEM_SIZE_1 - 1; | 383 | pp->res[0].end = pp->res[0].start + MEM_SIZE_1 - 1; |
416 | } | 384 | } |
417 | pp->res[1].flags = IORESOURCE_MEM; | 385 | pp->res[0].flags = IORESOURCE_MEM; |
418 | if (request_resource(&iomem_resource, &pp->res[1])) | 386 | if (request_resource(&iomem_resource, &pp->res[0])) |
419 | panic("Request PCIe Memory resource failed\n"); | 387 | panic("Request PCIe Memory resource failed\n"); |
420 | pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); | 388 | pci_add_resource_offset(&sys->resources, &pp->res[0], sys->mem_offset); |
421 | 389 | ||
422 | /* | 390 | /* |
423 | * IORESOURCE_MEM | IORESOURCE_PREFETCH | 391 | * IORESOURCE_MEM | IORESOURCE_PREFETCH |
@@ -425,18 +393,18 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys) | |||
425 | snprintf(pp->prefetch_space_name, sizeof(pp->prefetch_space_name), | 393 | snprintf(pp->prefetch_space_name, sizeof(pp->prefetch_space_name), |
426 | "PCIe %d PREFETCH MEM", pp->index); | 394 | "PCIe %d PREFETCH MEM", pp->index); |
427 | pp->prefetch_space_name[sizeof(pp->prefetch_space_name) - 1] = 0; | 395 | pp->prefetch_space_name[sizeof(pp->prefetch_space_name) - 1] = 0; |
428 | pp->res[2].name = pp->prefetch_space_name; | 396 | pp->res[1].name = pp->prefetch_space_name; |
429 | if (pp->index == 0) { | 397 | if (pp->index == 0) { |
430 | pp->res[2].start = PREFETCH_MEM_BASE_0; | 398 | pp->res[1].start = PREFETCH_MEM_BASE_0; |
431 | pp->res[2].end = pp->res[2].start + PREFETCH_MEM_SIZE_0 - 1; | 399 | pp->res[1].end = pp->res[1].start + PREFETCH_MEM_SIZE_0 - 1; |
432 | } else { | 400 | } else { |
433 | pp->res[2].start = PREFETCH_MEM_BASE_1; | 401 | pp->res[1].start = PREFETCH_MEM_BASE_1; |
434 | pp->res[2].end = pp->res[2].start + PREFETCH_MEM_SIZE_1 - 1; | 402 | pp->res[1].end = pp->res[1].start + PREFETCH_MEM_SIZE_1 - 1; |
435 | } | 403 | } |
436 | pp->res[2].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; | 404 | pp->res[1].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; |
437 | if (request_resource(&iomem_resource, &pp->res[2])) | 405 | if (request_resource(&iomem_resource, &pp->res[1])) |
438 | panic("Request PCIe Prefetch Memory resource failed\n"); | 406 | panic("Request PCIe Prefetch Memory resource failed\n"); |
439 | pci_add_resource_offset(&sys->resources, &pp->res[2], sys->mem_offset); | 407 | pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); |
440 | 408 | ||
441 | return 1; | 409 | return 1; |
442 | } | 410 | } |
@@ -531,8 +499,8 @@ static void tegra_pcie_setup_translations(void) | |||
531 | 499 | ||
532 | /* Bar 2: downstream IO bar */ | 500 | /* Bar 2: downstream IO bar */ |
533 | fpci_bar = ((__u32)0xfdfc << 16); | 501 | fpci_bar = ((__u32)0xfdfc << 16); |
534 | size = MMIO_SIZE; | 502 | size = SZ_128K; |
535 | axi_address = MMIO_BASE; | 503 | axi_address = TEGRA_PCIE_IO_BASE; |
536 | afi_writel(axi_address, AFI_AXI_BAR2_START); | 504 | afi_writel(axi_address, AFI_AXI_BAR2_START); |
537 | afi_writel(size >> 12, AFI_AXI_BAR2_SZ); | 505 | afi_writel(size >> 12, AFI_AXI_BAR2_SZ); |
538 | afi_writel(fpci_bar, AFI_FPCI_BAR2); | 506 | afi_writel(fpci_bar, AFI_FPCI_BAR2); |
@@ -766,7 +734,6 @@ static void tegra_pcie_clocks_put(void) | |||
766 | 734 | ||
767 | static int __init tegra_pcie_get_resources(void) | 735 | static int __init tegra_pcie_get_resources(void) |
768 | { | 736 | { |
769 | struct resource *res_mmio = &tegra_pcie.res_mmio; | ||
770 | int err; | 737 | int err; |
771 | 738 | ||
772 | err = tegra_pcie_clocks_get(); | 739 | err = tegra_pcie_clocks_get(); |
@@ -788,34 +755,16 @@ static int __init tegra_pcie_get_resources(void) | |||
788 | goto err_map_reg; | 755 | goto err_map_reg; |
789 | } | 756 | } |
790 | 757 | ||
791 | err = request_resource(&iomem_resource, res_mmio); | ||
792 | if (err) { | ||
793 | pr_err("PCIE: Failed to request resources: %d\n", err); | ||
794 | goto err_req_io; | ||
795 | } | ||
796 | |||
797 | tegra_pcie_io_base = ioremap_nocache(res_mmio->start, | ||
798 | resource_size(res_mmio)); | ||
799 | if (tegra_pcie_io_base == NULL) { | ||
800 | pr_err("PCIE: Failed to map IO\n"); | ||
801 | err = -ENOMEM; | ||
802 | goto err_map_io; | ||
803 | } | ||
804 | |||
805 | err = request_irq(INT_PCIE_INTR, tegra_pcie_isr, | 758 | err = request_irq(INT_PCIE_INTR, tegra_pcie_isr, |
806 | IRQF_SHARED, "PCIE", &tegra_pcie); | 759 | IRQF_SHARED, "PCIE", &tegra_pcie); |
807 | if (err) { | 760 | if (err) { |
808 | pr_err("PCIE: Failed to register IRQ: %d\n", err); | 761 | pr_err("PCIE: Failed to register IRQ: %d\n", err); |
809 | goto err_irq; | 762 | goto err_req_io; |
810 | } | 763 | } |
811 | set_irq_flags(INT_PCIE_INTR, IRQF_VALID); | 764 | set_irq_flags(INT_PCIE_INTR, IRQF_VALID); |
812 | 765 | ||
813 | return 0; | 766 | return 0; |
814 | 767 | ||
815 | err_irq: | ||
816 | iounmap(tegra_pcie_io_base); | ||
817 | err_map_io: | ||
818 | release_resource(&tegra_pcie.res_mmio); | ||
819 | err_req_io: | 768 | err_req_io: |
820 | iounmap(tegra_pcie.regs); | 769 | iounmap(tegra_pcie.regs); |
821 | err_map_reg: | 770 | err_map_reg: |
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig index 54d8f34fdee5..f7e12ede008c 100644 --- a/arch/arm/mach-u300/Kconfig +++ b/arch/arm/mach-u300/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | if ARCH_U300 | 1 | if ARCH_U300 |
2 | 2 | ||
3 | menu "ST-Ericsson AB U300/U330/U335/U365 Platform" | 3 | menu "ST-Ericsson AB U300/U335 Platform" |
4 | 4 | ||
5 | comment "ST-Ericsson Mobile Platform Products" | 5 | comment "ST-Ericsson Mobile Platform Products" |
6 | 6 | ||
@@ -10,46 +10,7 @@ config MACH_U300 | |||
10 | select PINCTRL_U300 | 10 | select PINCTRL_U300 |
11 | select PINCTRL_COH901 | 11 | select PINCTRL_COH901 |
12 | 12 | ||
13 | comment "ST-Ericsson U300/U330/U335/U365 Feature Selections" | 13 | comment "ST-Ericsson U300/U335 Feature Selections" |
14 | |||
15 | choice | ||
16 | prompt "U300/U330/U335/U365 system type" | ||
17 | default MACH_U300_BS2X | ||
18 | ---help--- | ||
19 | You need to select the target system, i.e. the | ||
20 | U300/U330/U335/U365 board that you want to compile your kernel | ||
21 | for. | ||
22 | |||
23 | config MACH_U300_BS2X | ||
24 | bool "S26/S26/B25/B26 Test Products" | ||
25 | depends on MACH_U300 | ||
26 | help | ||
27 | Select this if you're developing on the | ||
28 | S26/S25 test products. (Also works on | ||
29 | B26/B25 big boards.) | ||
30 | |||
31 | config MACH_U300_BS330 | ||
32 | bool "S330/B330 Test Products" | ||
33 | depends on MACH_U300 | ||
34 | help | ||
35 | Select this if you're developing on the | ||
36 | S330/B330 test products. | ||
37 | |||
38 | config MACH_U300_BS335 | ||
39 | bool "S335/B335 Test Products" | ||
40 | depends on MACH_U300 | ||
41 | help | ||
42 | Select this if you're developing on the | ||
43 | S335/B335 test products. | ||
44 | |||
45 | config MACH_U300_BS365 | ||
46 | bool "S365/B365 Test Products" | ||
47 | depends on MACH_U300 | ||
48 | help | ||
49 | Select this if you're developing on the | ||
50 | S365/B365 test products. | ||
51 | |||
52 | endchoice | ||
53 | 14 | ||
54 | config U300_DEBUG | 15 | config U300_DEBUG |
55 | bool "Debug support for U300" | 16 | bool "Debug support for U300" |
diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile index 7e47d37aeb0e..5a86c58da396 100644 --- a/arch/arm/mach-u300/Makefile +++ b/arch/arm/mach-u300/Makefile | |||
@@ -7,7 +7,6 @@ obj-m := | |||
7 | obj-n := | 7 | obj-n := |
8 | obj- := | 8 | obj- := |
9 | 9 | ||
10 | obj-$(CONFIG_ARCH_U300) += u300.o | ||
11 | obj-$(CONFIG_SPI_PL022) += spi.o | 10 | obj-$(CONFIG_SPI_PL022) += spi.o |
12 | obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o | 11 | obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o |
13 | obj-$(CONFIG_I2C_STU300) += i2c.o | 12 | obj-$(CONFIG_I2C_STU300) += i2c.o |
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index 03acf1883ec7..ef6f602b7e48 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * arch/arm/mach-u300/core.c | 3 | * arch/arm/mach-u300/core.c |
4 | * | 4 | * |
5 | * | 5 | * |
6 | * Copyright (C) 2007-2010 ST-Ericsson SA | 6 | * Copyright (C) 2007-2012 ST-Ericsson SA |
7 | * License terms: GNU General Public License (GPL) version 2 | 7 | * License terms: GNU General Public License (GPL) version 2 |
8 | * Core platform support, IRQ handling and device definitions. | 8 | * Core platform support, IRQ handling and device definitions. |
9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | 9 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
@@ -31,23 +31,26 @@ | |||
31 | #include <linux/pinctrl/pinconf-generic.h> | 31 | #include <linux/pinctrl/pinconf-generic.h> |
32 | #include <linux/dma-mapping.h> | 32 | #include <linux/dma-mapping.h> |
33 | #include <linux/platform_data/clk-u300.h> | 33 | #include <linux/platform_data/clk-u300.h> |
34 | #include <linux/platform_data/pinctrl-coh901.h> | ||
34 | 35 | ||
35 | #include <asm/types.h> | 36 | #include <asm/types.h> |
36 | #include <asm/setup.h> | 37 | #include <asm/setup.h> |
37 | #include <asm/memory.h> | 38 | #include <asm/memory.h> |
38 | #include <asm/hardware/vic.h> | 39 | #include <asm/hardware/vic.h> |
39 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
40 | #include <asm/mach/irq.h> | 41 | #include <asm/mach-types.h> |
42 | #include <asm/mach/arch.h> | ||
41 | 43 | ||
42 | #include <mach/coh901318.h> | 44 | #include <mach/coh901318.h> |
43 | #include <mach/hardware.h> | 45 | #include <mach/hardware.h> |
44 | #include <mach/syscon.h> | 46 | #include <mach/syscon.h> |
45 | #include <mach/dma_channels.h> | 47 | #include <mach/irqs.h> |
46 | #include <mach/gpio-u300.h> | ||
47 | 48 | ||
49 | #include "timer.h" | ||
48 | #include "spi.h" | 50 | #include "spi.h" |
49 | #include "i2c.h" | 51 | #include "i2c.h" |
50 | #include "u300-gpio.h" | 52 | #include "u300-gpio.h" |
53 | #include "dma_channels.h" | ||
51 | 54 | ||
52 | /* | 55 | /* |
53 | * Static I/O mappings that are needed for booting the U300 platforms. The | 56 | * Static I/O mappings that are needed for booting the U300 platforms. The |
@@ -76,7 +79,7 @@ static struct map_desc u300_io_desc[] __initdata = { | |||
76 | }, | 79 | }, |
77 | }; | 80 | }; |
78 | 81 | ||
79 | void __init u300_map_io(void) | 82 | static void __init u300_map_io(void) |
80 | { | 83 | { |
81 | iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc)); | 84 | iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc)); |
82 | /* We enable a real big DMA buffer if need be. */ | 85 | /* We enable a real big DMA buffer if need be. */ |
@@ -101,7 +104,6 @@ static AMBA_APB_DEVICE(uart0, "uart0", 0, U300_UART0_BASE, | |||
101 | { IRQ_U300_UART0 }, &uart0_plat_data); | 104 | { IRQ_U300_UART0 }, &uart0_plat_data); |
102 | 105 | ||
103 | /* The U335 have an additional UART1 on the APP CPU */ | 106 | /* The U335 have an additional UART1 on the APP CPU */ |
104 | #ifdef CONFIG_MACH_U300_BS335 | ||
105 | static struct amba_pl011_data uart1_plat_data = { | 107 | static struct amba_pl011_data uart1_plat_data = { |
106 | #ifdef CONFIG_COH901318 | 108 | #ifdef CONFIG_COH901318 |
107 | .dma_filter = coh901318_filter_id, | 109 | .dma_filter = coh901318_filter_id, |
@@ -113,7 +115,6 @@ static struct amba_pl011_data uart1_plat_data = { | |||
113 | /* Fast device at 0x7000 offset */ | 115 | /* Fast device at 0x7000 offset */ |
114 | static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE, | 116 | static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE, |
115 | { IRQ_U300_UART1 }, &uart1_plat_data); | 117 | { IRQ_U300_UART1 }, &uart1_plat_data); |
116 | #endif | ||
117 | 118 | ||
118 | /* AHB device at 0x4000 offset */ | 119 | /* AHB device at 0x4000 offset */ |
119 | static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL); | 120 | static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL); |
@@ -152,9 +153,7 @@ static AMBA_APB_DEVICE(mmcsd, "mmci", 0, U300_MMCSD_BASE, | |||
152 | */ | 153 | */ |
153 | static struct amba_device *amba_devs[] __initdata = { | 154 | static struct amba_device *amba_devs[] __initdata = { |
154 | &uart0_device, | 155 | &uart0_device, |
155 | #ifdef CONFIG_MACH_U300_BS335 | ||
156 | &uart1_device, | 156 | &uart1_device, |
157 | #endif | ||
158 | &pl022_device, | 157 | &pl022_device, |
159 | &pl172_device, | 158 | &pl172_device, |
160 | &mmcsd_device, | 159 | &mmcsd_device, |
@@ -188,7 +187,6 @@ static struct resource gpio_resources[] = { | |||
188 | .end = IRQ_U300_GPIO_PORT2, | 187 | .end = IRQ_U300_GPIO_PORT2, |
189 | .flags = IORESOURCE_IRQ, | 188 | .flags = IORESOURCE_IRQ, |
190 | }, | 189 | }, |
191 | #if defined(CONFIG_MACH_U300_BS365) || defined(CONFIG_MACH_U300_BS335) | ||
192 | { | 190 | { |
193 | .name = "gpio3", | 191 | .name = "gpio3", |
194 | .start = IRQ_U300_GPIO_PORT3, | 192 | .start = IRQ_U300_GPIO_PORT3, |
@@ -201,8 +199,6 @@ static struct resource gpio_resources[] = { | |||
201 | .end = IRQ_U300_GPIO_PORT4, | 199 | .end = IRQ_U300_GPIO_PORT4, |
202 | .flags = IORESOURCE_IRQ, | 200 | .flags = IORESOURCE_IRQ, |
203 | }, | 201 | }, |
204 | #endif | ||
205 | #ifdef CONFIG_MACH_U300_BS335 | ||
206 | { | 202 | { |
207 | .name = "gpio5", | 203 | .name = "gpio5", |
208 | .start = IRQ_U300_GPIO_PORT5, | 204 | .start = IRQ_U300_GPIO_PORT5, |
@@ -215,7 +211,6 @@ static struct resource gpio_resources[] = { | |||
215 | .end = IRQ_U300_GPIO_PORT6, | 211 | .end = IRQ_U300_GPIO_PORT6, |
216 | .flags = IORESOURCE_IRQ, | 212 | .flags = IORESOURCE_IRQ, |
217 | }, | 213 | }, |
218 | #endif /* CONFIG_MACH_U300_BS335 */ | ||
219 | }; | 214 | }; |
220 | 215 | ||
221 | static struct resource keypad_resources[] = { | 216 | static struct resource keypad_resources[] = { |
@@ -323,7 +318,6 @@ static struct resource dma_resource[] = { | |||
323 | } | 318 | } |
324 | }; | 319 | }; |
325 | 320 | ||
326 | #ifdef CONFIG_MACH_U300_BS335 | ||
327 | /* points out all dma slave channels. | 321 | /* points out all dma slave channels. |
328 | * Syntax is [A1, B1, A2, B2, .... ,-1,-1] | 322 | * Syntax is [A1, B1, A2, B2, .... ,-1,-1] |
329 | * Select all channels from A to B, end of list is marked with -1,-1 | 323 | * Select all channels from A to B, end of list is marked with -1,-1 |
@@ -336,14 +330,6 @@ static int dma_slave_channels[] = { | |||
336 | static int dma_memcpy_channels[] = { | 330 | static int dma_memcpy_channels[] = { |
337 | U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1}; | 331 | U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1}; |
338 | 332 | ||
339 | #else /* CONFIG_MACH_U300_BS335 */ | ||
340 | |||
341 | static int dma_slave_channels[] = {U300_DMA_MSL_TX_0, U300_DMA_SPI_RX, -1, -1}; | ||
342 | static int dma_memcpy_channels[] = { | ||
343 | U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_10, -1, -1}; | ||
344 | |||
345 | #endif | ||
346 | |||
347 | /** register dma for memory access | 333 | /** register dma for memory access |
348 | * | 334 | * |
349 | * active 1 means dma intends to access memory | 335 | * active 1 means dma intends to access memory |
@@ -1395,7 +1381,6 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = { | |||
1395 | .param.ctrl_lli = flags_memcpy_lli, | 1381 | .param.ctrl_lli = flags_memcpy_lli, |
1396 | .param.ctrl_lli_last = flags_memcpy_lli_last, | 1382 | .param.ctrl_lli_last = flags_memcpy_lli_last, |
1397 | }, | 1383 | }, |
1398 | #ifdef CONFIG_MACH_U300_BS335 | ||
1399 | { | 1384 | { |
1400 | .number = U300_DMA_UART1_TX, | 1385 | .number = U300_DMA_UART1_TX, |
1401 | .name = "UART1 TX", | 1386 | .name = "UART1 TX", |
@@ -1406,28 +1391,6 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = { | |||
1406 | .name = "UART1 RX", | 1391 | .name = "UART1 RX", |
1407 | .priority_high = 0, | 1392 | .priority_high = 0, |
1408 | } | 1393 | } |
1409 | #else | ||
1410 | { | ||
1411 | .number = U300_DMA_GENERAL_PURPOSE_9, | ||
1412 | .name = "GENERAL 09", | ||
1413 | .priority_high = 0, | ||
1414 | |||
1415 | .param.config = flags_memcpy_config, | ||
1416 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1417 | .param.ctrl_lli = flags_memcpy_lli, | ||
1418 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1419 | }, | ||
1420 | { | ||
1421 | .number = U300_DMA_GENERAL_PURPOSE_10, | ||
1422 | .name = "GENERAL 10", | ||
1423 | .priority_high = 0, | ||
1424 | |||
1425 | .param.config = flags_memcpy_config, | ||
1426 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1427 | .param.ctrl_lli = flags_memcpy_lli, | ||
1428 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1429 | } | ||
1430 | #endif | ||
1431 | }; | 1394 | }; |
1432 | 1395 | ||
1433 | 1396 | ||
@@ -1480,18 +1443,7 @@ static struct platform_device pinctrl_device = { | |||
1480 | * GPIO block, with different number of ports. | 1443 | * GPIO block, with different number of ports. |
1481 | */ | 1444 | */ |
1482 | static struct u300_gpio_platform u300_gpio_plat = { | 1445 | static struct u300_gpio_platform u300_gpio_plat = { |
1483 | #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) | ||
1484 | .variant = U300_GPIO_COH901335, | ||
1485 | .ports = 3, | ||
1486 | #endif | ||
1487 | #ifdef CONFIG_MACH_U300_BS335 | ||
1488 | .variant = U300_GPIO_COH901571_3_BS335, | ||
1489 | .ports = 7, | 1446 | .ports = 7, |
1490 | #endif | ||
1491 | #ifdef CONFIG_MACH_U300_BS365 | ||
1492 | .variant = U300_GPIO_COH901571_3_BS365, | ||
1493 | .ports = 5, | ||
1494 | #endif | ||
1495 | .gpio_base = 0, | 1447 | .gpio_base = 0, |
1496 | .gpio_irq_base = IRQ_U300_GPIO_BASE, | 1448 | .gpio_irq_base = IRQ_U300_GPIO_BASE, |
1497 | .pinctrl_device = &pinctrl_device, | 1449 | .pinctrl_device = &pinctrl_device, |
@@ -1651,7 +1603,7 @@ static struct platform_device *platform_devs[] __initdata = { | |||
1651 | * together so some interrupts are connected to the first one and some | 1603 | * together so some interrupts are connected to the first one and some |
1652 | * to the second one. | 1604 | * to the second one. |
1653 | */ | 1605 | */ |
1654 | void __init u300_init_irq(void) | 1606 | static void __init u300_init_irq(void) |
1655 | { | 1607 | { |
1656 | u32 mask[2] = {0, 0}; | 1608 | u32 mask[2] = {0, 0}; |
1657 | struct clk *clk; | 1609 | struct clk *clk; |
@@ -1756,29 +1708,11 @@ static void __init u300_init_check_chip(void) | |||
1756 | printk(KERN_INFO "Initializing U300 system on %s baseband chip " \ | 1708 | printk(KERN_INFO "Initializing U300 system on %s baseband chip " \ |
1757 | "(chip ID 0x%04x)\n", chipname, val); | 1709 | "(chip ID 0x%04x)\n", chipname, val); |
1758 | 1710 | ||
1759 | #ifdef CONFIG_MACH_U300_BS330 | ||
1760 | if ((val & 0xFF00U) != 0xd800) { | ||
1761 | printk(KERN_ERR "Platform configured for BS330 " \ | ||
1762 | "with DB3200 but %s detected, expect problems!", | ||
1763 | chipname); | ||
1764 | } | ||
1765 | #endif | ||
1766 | #ifdef CONFIG_MACH_U300_BS335 | ||
1767 | if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) { | 1711 | if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) { |
1768 | printk(KERN_ERR "Platform configured for BS335 " \ | 1712 | printk(KERN_ERR "Platform configured for BS335 " \ |
1769 | " with DB3350 but %s detected, expect problems!", | 1713 | " with DB3350 but %s detected, expect problems!", |
1770 | chipname); | 1714 | chipname); |
1771 | } | 1715 | } |
1772 | #endif | ||
1773 | #ifdef CONFIG_MACH_U300_BS365 | ||
1774 | if ((val & 0xFF00U) != 0xe800) { | ||
1775 | printk(KERN_ERR "Platform configured for BS365 " \ | ||
1776 | "with DB3210 but %s detected, expect problems!", | ||
1777 | chipname); | ||
1778 | } | ||
1779 | #endif | ||
1780 | |||
1781 | |||
1782 | } | 1716 | } |
1783 | 1717 | ||
1784 | /* | 1718 | /* |
@@ -1811,7 +1745,7 @@ static void __init u300_assign_physmem(void) | |||
1811 | } | 1745 | } |
1812 | } | 1746 | } |
1813 | 1747 | ||
1814 | void __init u300_init_devices(void) | 1748 | static void __init u300_init_machine(void) |
1815 | { | 1749 | { |
1816 | int i; | 1750 | int i; |
1817 | u16 val; | 1751 | u16 val; |
@@ -1852,7 +1786,7 @@ void __init u300_init_devices(void) | |||
1852 | /* Forward declare this function from the watchdog */ | 1786 | /* Forward declare this function from the watchdog */ |
1853 | void coh901327_watchdog_reset(void); | 1787 | void coh901327_watchdog_reset(void); |
1854 | 1788 | ||
1855 | void u300_restart(char mode, const char *cmd) | 1789 | static void u300_restart(char mode, const char *cmd) |
1856 | { | 1790 | { |
1857 | switch (mode) { | 1791 | switch (mode) { |
1858 | case 's': | 1792 | case 's': |
@@ -1868,3 +1802,15 @@ void u300_restart(char mode, const char *cmd) | |||
1868 | /* Wait for system do die/reset. */ | 1802 | /* Wait for system do die/reset. */ |
1869 | while (1); | 1803 | while (1); |
1870 | } | 1804 | } |
1805 | |||
1806 | MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board") | ||
1807 | /* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */ | ||
1808 | .atag_offset = 0x100, | ||
1809 | .map_io = u300_map_io, | ||
1810 | .nr_irqs = NR_IRQS_U300, | ||
1811 | .init_irq = u300_init_irq, | ||
1812 | .handle_irq = vic_handle_irq, | ||
1813 | .timer = &u300_timer, | ||
1814 | .init_machine = u300_init_machine, | ||
1815 | .restart = u300_restart, | ||
1816 | MACHINE_END | ||
diff --git a/arch/arm/mach-u300/include/mach/dma_channels.h b/arch/arm/mach-u300/dma_channels.h index b239149ba0d0..4e8a88fbca49 100644 --- a/arch/arm/mach-u300/include/mach/dma_channels.h +++ b/arch/arm/mach-u300/dma_channels.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * arch/arm/mach-u300/include/mach/dma_channels.h | 3 | * arch/arm/mach-u300/include/mach/dma_channels.h |
4 | * | 4 | * |
5 | * | 5 | * |
6 | * Copyright (C) 2007-2009 ST-Ericsson | 6 | * Copyright (C) 2007-2012 ST-Ericsson |
7 | * License terms: GNU General Public License (GPL) version 2 | 7 | * License terms: GNU General Public License (GPL) version 2 |
8 | * Map file for the U300 dma driver. | 8 | * Map file for the U300 dma driver. |
9 | * Author: Per Friden <per.friden@stericsson.com> | 9 | * Author: Per Friden <per.friden@stericsson.com> |
@@ -50,19 +50,10 @@ | |||
50 | #define U300_DMA_GENERAL_PURPOSE_6 35 | 50 | #define U300_DMA_GENERAL_PURPOSE_6 35 |
51 | #define U300_DMA_GENERAL_PURPOSE_7 36 | 51 | #define U300_DMA_GENERAL_PURPOSE_7 36 |
52 | #define U300_DMA_GENERAL_PURPOSE_8 37 | 52 | #define U300_DMA_GENERAL_PURPOSE_8 37 |
53 | #ifdef CONFIG_MACH_U300_BS335 | ||
54 | #define U300_DMA_UART1_TX 38 | 53 | #define U300_DMA_UART1_TX 38 |
55 | #define U300_DMA_UART1_RX 39 | 54 | #define U300_DMA_UART1_RX 39 |
56 | #else | ||
57 | #define U300_DMA_GENERAL_PURPOSE_9 38 | ||
58 | #define U300_DMA_GENERAL_PURPOSE_10 39 | ||
59 | #endif | ||
60 | 55 | ||
61 | #ifdef CONFIG_MACH_U300_BS335 | ||
62 | #define U300_DMA_DEVICE_CHANNELS 32 | 56 | #define U300_DMA_DEVICE_CHANNELS 32 |
63 | #else | ||
64 | #define U300_DMA_DEVICE_CHANNELS 30 | ||
65 | #endif | ||
66 | #define U300_DMA_CHANNELS 40 | 57 | #define U300_DMA_CHANNELS 40 |
67 | 58 | ||
68 | 59 | ||
diff --git a/arch/arm/mach-u300/i2c.c b/arch/arm/mach-u300/i2c.c index cb04bd6ab3e7..0d4620ed853c 100644 --- a/arch/arm/mach-u300/i2c.c +++ b/arch/arm/mach-u300/i2c.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-u300/i2c.c | 2 | * arch/arm/mach-u300/i2c.c |
3 | * | 3 | * |
4 | * Copyright (C) 2009 ST-Ericsson AB | 4 | * Copyright (C) 2009-2012 ST-Ericsson AB |
5 | * License terms: GNU General Public License (GPL) version 2 | 5 | * License terms: GNU General Public License (GPL) version 2 |
6 | * | 6 | * |
7 | * Register board i2c devices | 7 | * Register board i2c devices |
@@ -261,7 +261,6 @@ static struct i2c_board_info __initdata bus0_i2c_board_info[] = { | |||
261 | }; | 261 | }; |
262 | 262 | ||
263 | static struct i2c_board_info __initdata bus1_i2c_board_info[] = { | 263 | static struct i2c_board_info __initdata bus1_i2c_board_info[] = { |
264 | #ifdef CONFIG_MACH_U300_BS335 | ||
265 | { | 264 | { |
266 | .type = "fwcam", | 265 | .type = "fwcam", |
267 | .addr = 0x10, | 266 | .addr = 0x10, |
@@ -270,9 +269,6 @@ static struct i2c_board_info __initdata bus1_i2c_board_info[] = { | |||
270 | .type = "fwcam", | 269 | .type = "fwcam", |
271 | .addr = 0x5d, | 270 | .addr = 0x5d, |
272 | }, | 271 | }, |
273 | #else | ||
274 | { }, | ||
275 | #endif | ||
276 | }; | 272 | }; |
277 | 273 | ||
278 | void __init u300_i2c_register_board_devices(void) | 274 | void __init u300_i2c_register_board_devices(void) |
diff --git a/arch/arm/mach-u300/include/mach/clkdev.h b/arch/arm/mach-u300/include/mach/clkdev.h deleted file mode 100644 index 92e3cc872c66..000000000000 --- a/arch/arm/mach-u300/include/mach/clkdev.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __MACH_CLKDEV_H | ||
2 | #define __MACH_CLKDEV_H | ||
3 | |||
4 | int __clk_get(struct clk *clk); | ||
5 | void __clk_put(struct clk *clk); | ||
6 | |||
7 | #endif | ||
diff --git a/arch/arm/mach-u300/include/mach/irqs.h b/arch/arm/mach-u300/include/mach/irqs.h index ec09c1e07b1a..e27425a63fa1 100644 --- a/arch/arm/mach-u300/include/mach/irqs.h +++ b/arch/arm/mach-u300/include/mach/irqs.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * arch/arm/mach-u300/include/mach/irqs.h | 3 | * arch/arm/mach-u300/include/mach/irqs.h |
4 | * | 4 | * |
5 | * | 5 | * |
6 | * Copyright (C) 2006-2009 ST-Ericsson AB | 6 | * Copyright (C) 2006-2012 ST-Ericsson AB |
7 | * License terms: GNU General Public License (GPL) version 2 | 7 | * License terms: GNU General Public License (GPL) version 2 |
8 | * IRQ channel definitions for the U300 platforms. | 8 | * IRQ channel definitions for the U300 platforms. |
9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | 9 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
@@ -31,10 +31,6 @@ | |||
31 | #define IRQ_U300_XGAM_GAMCON 14 | 31 | #define IRQ_U300_XGAM_GAMCON 14 |
32 | #define IRQ_U300_XGAM_CDI 15 | 32 | #define IRQ_U300_XGAM_CDI 15 |
33 | #define IRQ_U300_XGAM_CDICON 16 | 33 | #define IRQ_U300_XGAM_CDICON 16 |
34 | #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) | ||
35 | /* MMIACC not used on the DB3210 or DB3350 chips */ | ||
36 | #define IRQ_U300_XGAM_MMIACC 17 | ||
37 | #endif | ||
38 | #define IRQ_U300_XGAM_PDI 18 | 34 | #define IRQ_U300_XGAM_PDI 18 |
39 | #define IRQ_U300_XGAM_PDICON 19 | 35 | #define IRQ_U300_XGAM_PDICON 19 |
40 | #define IRQ_U300_XGAM_GAMEACC 20 | 36 | #define IRQ_U300_XGAM_GAMEACC 20 |
@@ -55,8 +51,6 @@ | |||
55 | #define IRQ_U300_GPIO_PORT1 34 | 51 | #define IRQ_U300_GPIO_PORT1 34 |
56 | #define IRQ_U300_GPIO_PORT2 35 | 52 | #define IRQ_U300_GPIO_PORT2 35 |
57 | 53 | ||
58 | #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) || \ | ||
59 | defined(CONFIG_MACH_U300_BS335) | ||
60 | /* These are for DB3150, DB3200 and DB3350 */ | 54 | /* These are for DB3150, DB3200 and DB3350 */ |
61 | #define IRQ_U300_WDOG 36 | 55 | #define IRQ_U300_WDOG 36 |
62 | #define IRQ_U300_EVHIST 37 | 56 | #define IRQ_U300_EVHIST 37 |
@@ -68,15 +62,8 @@ | |||
68 | #define IRQ_U300_RTC 43 | 62 | #define IRQ_U300_RTC 43 |
69 | #define IRQ_U300_NFIF 44 | 63 | #define IRQ_U300_NFIF 44 |
70 | #define IRQ_U300_NFIF2 45 | 64 | #define IRQ_U300_NFIF2 45 |
71 | #endif | ||
72 | |||
73 | /* DB3150 and DB3200 have only 45 IRQs */ | ||
74 | #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) | ||
75 | #define U300_VIC_IRQS_END 46 | ||
76 | #endif | ||
77 | 65 | ||
78 | /* The DB3350-specific interrupt lines */ | 66 | /* The DB3350-specific interrupt lines */ |
79 | #ifdef CONFIG_MACH_U300_BS335 | ||
80 | #define IRQ_U300_ISP_F0 46 | 67 | #define IRQ_U300_ISP_F0 46 |
81 | #define IRQ_U300_ISP_F1 47 | 68 | #define IRQ_U300_ISP_F1 47 |
82 | #define IRQ_U300_ISP_F2 48 | 69 | #define IRQ_U300_ISP_F2 48 |
@@ -89,25 +76,6 @@ | |||
89 | #define IRQ_U300_GPIO_PORT5 55 | 76 | #define IRQ_U300_GPIO_PORT5 55 |
90 | #define IRQ_U300_GPIO_PORT6 56 | 77 | #define IRQ_U300_GPIO_PORT6 56 |
91 | #define U300_VIC_IRQS_END 57 | 78 | #define U300_VIC_IRQS_END 57 |
92 | #endif | ||
93 | |||
94 | /* The DB3210-specific interrupt lines */ | ||
95 | #ifdef CONFIG_MACH_U300_BS365 | ||
96 | #define IRQ_U300_GPIO_PORT3 36 | ||
97 | #define IRQ_U300_GPIO_PORT4 37 | ||
98 | #define IRQ_U300_WDOG 38 | ||
99 | #define IRQ_U300_EVHIST 39 | ||
100 | #define IRQ_U300_MSPRO 40 | ||
101 | #define IRQ_U300_MMCSD_MCIINTR0 41 | ||
102 | #define IRQ_U300_MMCSD_MCIINTR1 42 | ||
103 | #define IRQ_U300_I2C0 43 | ||
104 | #define IRQ_U300_I2C1 44 | ||
105 | #define IRQ_U300_RTC 45 | ||
106 | #define IRQ_U300_NFIF 46 | ||
107 | #define IRQ_U300_NFIF2 47 | ||
108 | #define IRQ_U300_SYSCON_PLL_LOCK 48 | ||
109 | #define U300_VIC_IRQS_END 49 | ||
110 | #endif | ||
111 | 79 | ||
112 | /* Maximum 8*7 GPIO lines */ | 80 | /* Maximum 8*7 GPIO lines */ |
113 | #ifdef CONFIG_PINCTRL_COH901 | 81 | #ifdef CONFIG_PINCTRL_COH901 |
@@ -117,6 +85,6 @@ | |||
117 | #define IRQ_U300_GPIO_END (U300_VIC_IRQS_END) | 85 | #define IRQ_U300_GPIO_END (U300_VIC_IRQS_END) |
118 | #endif | 86 | #endif |
119 | 87 | ||
120 | #define NR_IRQS (IRQ_U300_GPIO_END - IRQ_U300_INTCON0_START) | 88 | #define NR_IRQS_U300 (IRQ_U300_GPIO_END - IRQ_U300_INTCON0_START) |
121 | 89 | ||
122 | #endif | 90 | #endif |
diff --git a/arch/arm/mach-u300/include/mach/platform.h b/arch/arm/mach-u300/include/mach/platform.h deleted file mode 100644 index 096333f32fc3..000000000000 --- a/arch/arm/mach-u300/include/mach/platform.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * arch/arm/mach-u300/include/mach/platform.h | ||
4 | * | ||
5 | * | ||
6 | * Copyright (C) 2006-2009 ST-Ericsson AB | ||
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | * Basic platform init and mapping functions. | ||
9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASSEMBLY__ | ||
13 | |||
14 | void u300_map_io(void); | ||
15 | void u300_init_irq(void); | ||
16 | void u300_init_devices(void); | ||
17 | void u300_restart(char, const char *); | ||
18 | extern struct sys_timer u300_timer; | ||
19 | |||
20 | #endif | ||
diff --git a/arch/arm/mach-u300/include/mach/syscon.h b/arch/arm/mach-u300/include/mach/syscon.h index 6e84f07a7c6f..10bdd0be9774 100644 --- a/arch/arm/mach-u300/include/mach/syscon.h +++ b/arch/arm/mach-u300/include/mach/syscon.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * arch/arm/mach-u300/include/mach/syscon.h | 3 | * arch/arm/mach-u300/include/mach/syscon.h |
4 | * | 4 | * |
5 | * | 5 | * |
6 | * Copyright (C) 2008 ST-Ericsson AB | 6 | * Copyright (C) 2008-2012 ST-Ericsson AB |
7 | * | 7 | * |
8 | * Author: Rickard Andersson <rickard.andersson@stericsson.com> | 8 | * Author: Rickard Andersson <rickard.andersson@stericsson.com> |
9 | */ | 9 | */ |
@@ -36,9 +36,7 @@ | |||
36 | #define U300_SYSCON_CSR_PLL13_LOCK_IND (0x0001) | 36 | #define U300_SYSCON_CSR_PLL13_LOCK_IND (0x0001) |
37 | /* Reset lines for SLOW devices 16bit (R/W) */ | 37 | /* Reset lines for SLOW devices 16bit (R/W) */ |
38 | #define U300_SYSCON_RSR (0x0014) | 38 | #define U300_SYSCON_RSR (0x0014) |
39 | #ifdef CONFIG_MACH_U300_BS335 | ||
40 | #define U300_SYSCON_RSR_PPM_RESET_EN (0x0200) | 39 | #define U300_SYSCON_RSR_PPM_RESET_EN (0x0200) |
41 | #endif | ||
42 | #define U300_SYSCON_RSR_ACC_TMR_RESET_EN (0x0100) | 40 | #define U300_SYSCON_RSR_ACC_TMR_RESET_EN (0x0100) |
43 | #define U300_SYSCON_RSR_APP_TMR_RESET_EN (0x0080) | 41 | #define U300_SYSCON_RSR_APP_TMR_RESET_EN (0x0080) |
44 | #define U300_SYSCON_RSR_RTC_RESET_EN (0x0040) | 42 | #define U300_SYSCON_RSR_RTC_RESET_EN (0x0040) |
@@ -50,9 +48,7 @@ | |||
50 | #define U300_SYSCON_RSR_SLOW_BRIDGE_RESET_EN (0x0001) | 48 | #define U300_SYSCON_RSR_SLOW_BRIDGE_RESET_EN (0x0001) |
51 | /* Reset lines for FAST devices 16bit (R/W) */ | 49 | /* Reset lines for FAST devices 16bit (R/W) */ |
52 | #define U300_SYSCON_RFR (0x0018) | 50 | #define U300_SYSCON_RFR (0x0018) |
53 | #ifdef CONFIG_MACH_U300_BS335 | ||
54 | #define U300_SYSCON_RFR_UART1_RESET_ENABLE (0x0080) | 51 | #define U300_SYSCON_RFR_UART1_RESET_ENABLE (0x0080) |
55 | #endif | ||
56 | #define U300_SYSCON_RFR_SPI_RESET_ENABLE (0x0040) | 52 | #define U300_SYSCON_RFR_SPI_RESET_ENABLE (0x0040) |
57 | #define U300_SYSCON_RFR_MMC_RESET_ENABLE (0x0020) | 53 | #define U300_SYSCON_RFR_MMC_RESET_ENABLE (0x0020) |
58 | #define U300_SYSCON_RFR_PCM_I2S1_RESET_ENABLE (0x0010) | 54 | #define U300_SYSCON_RFR_PCM_I2S1_RESET_ENABLE (0x0010) |
@@ -62,10 +58,8 @@ | |||
62 | #define U300_SYSCON_RFR_FAST_BRIDGE_RESET_ENABLE (0x0001) | 58 | #define U300_SYSCON_RFR_FAST_BRIDGE_RESET_ENABLE (0x0001) |
63 | /* Reset lines for the rest of the peripherals 16bit (R/W) */ | 59 | /* Reset lines for the rest of the peripherals 16bit (R/W) */ |
64 | #define U300_SYSCON_RRR (0x001c) | 60 | #define U300_SYSCON_RRR (0x001c) |
65 | #ifdef CONFIG_MACH_U300_BS335 | ||
66 | #define U300_SYSCON_RRR_CDS_RESET_EN (0x4000) | 61 | #define U300_SYSCON_RRR_CDS_RESET_EN (0x4000) |
67 | #define U300_SYSCON_RRR_ISP_RESET_EN (0x2000) | 62 | #define U300_SYSCON_RRR_ISP_RESET_EN (0x2000) |
68 | #endif | ||
69 | #define U300_SYSCON_RRR_INTCON_RESET_EN (0x1000) | 63 | #define U300_SYSCON_RRR_INTCON_RESET_EN (0x1000) |
70 | #define U300_SYSCON_RRR_MSPRO_RESET_EN (0x0800) | 64 | #define U300_SYSCON_RRR_MSPRO_RESET_EN (0x0800) |
71 | #define U300_SYSCON_RRR_XGAM_RESET_EN (0x0100) | 65 | #define U300_SYSCON_RRR_XGAM_RESET_EN (0x0100) |
@@ -79,9 +73,7 @@ | |||
79 | #define U300_SYSCON_RRR_AAIF_RESET_EN (0x0001) | 73 | #define U300_SYSCON_RRR_AAIF_RESET_EN (0x0001) |
80 | /* Clock enable for SLOW peripherals 16bit (R/W) */ | 74 | /* Clock enable for SLOW peripherals 16bit (R/W) */ |
81 | #define U300_SYSCON_CESR (0x0020) | 75 | #define U300_SYSCON_CESR (0x0020) |
82 | #ifdef CONFIG_MACH_U300_BS335 | ||
83 | #define U300_SYSCON_CESR_PPM_CLK_EN (0x0200) | 76 | #define U300_SYSCON_CESR_PPM_CLK_EN (0x0200) |
84 | #endif | ||
85 | #define U300_SYSCON_CESR_ACC_TMR_CLK_EN (0x0100) | 77 | #define U300_SYSCON_CESR_ACC_TMR_CLK_EN (0x0100) |
86 | #define U300_SYSCON_CESR_APP_TMR_CLK_EN (0x0080) | 78 | #define U300_SYSCON_CESR_APP_TMR_CLK_EN (0x0080) |
87 | #define U300_SYSCON_CESR_KEYPAD_CLK_EN (0x0040) | 79 | #define U300_SYSCON_CESR_KEYPAD_CLK_EN (0x0040) |
@@ -92,24 +84,20 @@ | |||
92 | #define U300_SYSCON_CESR_SLOW_BRIDGE_CLK_EN (0x0001) | 84 | #define U300_SYSCON_CESR_SLOW_BRIDGE_CLK_EN (0x0001) |
93 | /* Clock enable for FAST peripherals 16bit (R/W) */ | 85 | /* Clock enable for FAST peripherals 16bit (R/W) */ |
94 | #define U300_SYSCON_CEFR (0x0024) | 86 | #define U300_SYSCON_CEFR (0x0024) |
95 | #ifdef CONFIG_MACH_U300_BS335 | ||
96 | #define U300_SYSCON_CEFR_UART1_CLK_EN (0x0200) | 87 | #define U300_SYSCON_CEFR_UART1_CLK_EN (0x0200) |
97 | #endif | ||
98 | #define U300_SYSCON_CEFR_I2S1_CORE_CLK_EN (0x0100) | 88 | #define U300_SYSCON_CEFR_I2S1_CORE_CLK_EN (0x0100) |
99 | #define U300_SYSCON_CEFR_I2S0_CORE_CLK_EN (0x0080) | 89 | #define U300_SYSCON_CEFR_I2S0_CORE_CLK_EN (0x0080) |
100 | #define U300_SYSCON_CEFR_SPI_CLK_EN (0x0040) | 90 | #define U300_SYSCON_CEFR_SPI_CLK_EN (0x0040) |
101 | #define U300_SYSCON_CEFR_MMC_CLK_EN (0x0020) | 91 | #define U300_SYSCON_CEFR_MMC_CLK_EN (0x0020) |
102 | #define U300_SYSCON_CEFR_I2S1_CLK_EN (0x0010) | 92 | #define U300_SYSCON_CEFR_I2S1_CLK_EN (0x0010) |
103 | #define U300_SYSCON_CEFR_I2S0_CLK_EN (0x0008) | 93 | #define U300_SYSCON_CEFR_I2S0_CLK_EN (0x0008) |
104 | #define U300_SYSCON_CEFR_I2C1_CLK_EN (0x0004) | 94 | #define U300_SYSCON_CEFR_I2C1_CLK_EN (0x0004) |
105 | #define U300_SYSCON_CEFR_I2C0_CLK_EN (0x0002) | 95 | #define U300_SYSCON_CEFR_I2C0_CLK_EN (0x0002) |
106 | #define U300_SYSCON_CEFR_FAST_BRIDGE_CLK_EN (0x0001) | 96 | #define U300_SYSCON_CEFR_FAST_BRIDGE_CLK_EN (0x0001) |
107 | /* Clock enable for the rest of the peripherals 16bit (R/W) */ | 97 | /* Clock enable for the rest of the peripherals 16bit (R/W) */ |
108 | #define U300_SYSCON_CERR (0x0028) | 98 | #define U300_SYSCON_CERR (0x0028) |
109 | #ifdef CONFIG_MACH_U300_BS335 | ||
110 | #define U300_SYSCON_CERR_CDS_CLK_EN (0x2000) | 99 | #define U300_SYSCON_CERR_CDS_CLK_EN (0x2000) |
111 | #define U300_SYSCON_CERR_ISP_CLK_EN (0x1000) | 100 | #define U300_SYSCON_CERR_ISP_CLK_EN (0x1000) |
112 | #endif | ||
113 | #define U300_SYSCON_CERR_MSPRO_CLK_EN (0x0800) | 101 | #define U300_SYSCON_CERR_MSPRO_CLK_EN (0x0800) |
114 | #define U300_SYSCON_CERR_AHB_SUBSYS_BRIDGE_CLK_EN (0x0400) | 102 | #define U300_SYSCON_CERR_AHB_SUBSYS_BRIDGE_CLK_EN (0x0400) |
115 | #define U300_SYSCON_CERR_SEMI_CLK_EN (0x0200) | 103 | #define U300_SYSCON_CERR_SEMI_CLK_EN (0x0200) |
@@ -124,9 +112,7 @@ | |||
124 | #define U300_SYSCON_CERR_AAIF_CLK_EN (0x0001) | 112 | #define U300_SYSCON_CERR_AAIF_CLK_EN (0x0001) |
125 | /* Single block clock enable 16bit (-/W) */ | 113 | /* Single block clock enable 16bit (-/W) */ |
126 | #define U300_SYSCON_SBCER (0x002c) | 114 | #define U300_SYSCON_SBCER (0x002c) |
127 | #ifdef CONFIG_MACH_U300_BS335 | ||
128 | #define U300_SYSCON_SBCER_PPM_CLK_EN (0x0009) | 115 | #define U300_SYSCON_SBCER_PPM_CLK_EN (0x0009) |
129 | #endif | ||
130 | #define U300_SYSCON_SBCER_ACC_TMR_CLK_EN (0x0008) | 116 | #define U300_SYSCON_SBCER_ACC_TMR_CLK_EN (0x0008) |
131 | #define U300_SYSCON_SBCER_APP_TMR_CLK_EN (0x0007) | 117 | #define U300_SYSCON_SBCER_APP_TMR_CLK_EN (0x0007) |
132 | #define U300_SYSCON_SBCER_KEYPAD_CLK_EN (0x0006) | 118 | #define U300_SYSCON_SBCER_KEYPAD_CLK_EN (0x0006) |
@@ -135,9 +121,7 @@ | |||
135 | #define U300_SYSCON_SBCER_BTR_CLK_EN (0x0002) | 121 | #define U300_SYSCON_SBCER_BTR_CLK_EN (0x0002) |
136 | #define U300_SYSCON_SBCER_UART_CLK_EN (0x0001) | 122 | #define U300_SYSCON_SBCER_UART_CLK_EN (0x0001) |
137 | #define U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN (0x0000) | 123 | #define U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN (0x0000) |
138 | #ifdef CONFIG_MACH_U300_BS335 | ||
139 | #define U300_SYSCON_SBCER_UART1_CLK_EN (0x0019) | 124 | #define U300_SYSCON_SBCER_UART1_CLK_EN (0x0019) |
140 | #endif | ||
141 | #define U300_SYSCON_SBCER_I2S1_CORE_CLK_EN (0x0018) | 125 | #define U300_SYSCON_SBCER_I2S1_CORE_CLK_EN (0x0018) |
142 | #define U300_SYSCON_SBCER_I2S0_CORE_CLK_EN (0x0017) | 126 | #define U300_SYSCON_SBCER_I2S0_CORE_CLK_EN (0x0017) |
143 | #define U300_SYSCON_SBCER_SPI_CLK_EN (0x0016) | 127 | #define U300_SYSCON_SBCER_SPI_CLK_EN (0x0016) |
@@ -147,10 +131,8 @@ | |||
147 | #define U300_SYSCON_SBCER_I2C1_CLK_EN (0x0012) | 131 | #define U300_SYSCON_SBCER_I2C1_CLK_EN (0x0012) |
148 | #define U300_SYSCON_SBCER_I2C0_CLK_EN (0x0011) | 132 | #define U300_SYSCON_SBCER_I2C0_CLK_EN (0x0011) |
149 | #define U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN (0x0010) | 133 | #define U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN (0x0010) |
150 | #ifdef CONFIG_MACH_U300_BS335 | ||
151 | #define U300_SYSCON_SBCER_CDS_CLK_EN (0x002D) | 134 | #define U300_SYSCON_SBCER_CDS_CLK_EN (0x002D) |
152 | #define U300_SYSCON_SBCER_ISP_CLK_EN (0x002C) | 135 | #define U300_SYSCON_SBCER_ISP_CLK_EN (0x002C) |
153 | #endif | ||
154 | #define U300_SYSCON_SBCER_MSPRO_CLK_EN (0x002B) | 136 | #define U300_SYSCON_SBCER_MSPRO_CLK_EN (0x002B) |
155 | #define U300_SYSCON_SBCER_AHB_SUBSYS_BRIDGE_CLK_EN (0x002A) | 137 | #define U300_SYSCON_SBCER_AHB_SUBSYS_BRIDGE_CLK_EN (0x002A) |
156 | #define U300_SYSCON_SBCER_SEMI_CLK_EN (0x0029) | 138 | #define U300_SYSCON_SBCER_SEMI_CLK_EN (0x0029) |
@@ -168,9 +150,7 @@ | |||
168 | /* Same values as above for SBCER */ | 150 | /* Same values as above for SBCER */ |
169 | /* Clock force SLOW peripherals 16bit (R/W) */ | 151 | /* Clock force SLOW peripherals 16bit (R/W) */ |
170 | #define U300_SYSCON_CFSR (0x003c) | 152 | #define U300_SYSCON_CFSR (0x003c) |
171 | #ifdef CONFIG_MACH_U300_BS335 | ||
172 | #define U300_SYSCON_CFSR_PPM_CLK_FORCE_EN (0x0200) | 153 | #define U300_SYSCON_CFSR_PPM_CLK_FORCE_EN (0x0200) |
173 | #endif | ||
174 | #define U300_SYSCON_CFSR_ACC_TMR_CLK_FORCE_EN (0x0100) | 154 | #define U300_SYSCON_CFSR_ACC_TMR_CLK_FORCE_EN (0x0100) |
175 | #define U300_SYSCON_CFSR_APP_TMR_CLK_FORCE_EN (0x0080) | 155 | #define U300_SYSCON_CFSR_APP_TMR_CLK_FORCE_EN (0x0080) |
176 | #define U300_SYSCON_CFSR_KEYPAD_CLK_FORCE_EN (0x0020) | 156 | #define U300_SYSCON_CFSR_KEYPAD_CLK_FORCE_EN (0x0020) |
@@ -184,10 +164,8 @@ | |||
184 | /* Values not defined. Define if you want to use them. */ | 164 | /* Values not defined. Define if you want to use them. */ |
185 | /* Clock force the rest of the peripherals 16bit (R/W) */ | 165 | /* Clock force the rest of the peripherals 16bit (R/W) */ |
186 | #define U300_SYSCON_CFRR (0x44) | 166 | #define U300_SYSCON_CFRR (0x44) |
187 | #ifdef CONFIG_MACH_U300_BS335 | ||
188 | #define U300_SYSCON_CFRR_CDS_CLK_FORCE_EN (0x2000) | 167 | #define U300_SYSCON_CFRR_CDS_CLK_FORCE_EN (0x2000) |
189 | #define U300_SYSCON_CFRR_ISP_CLK_FORCE_EN (0x1000) | 168 | #define U300_SYSCON_CFRR_ISP_CLK_FORCE_EN (0x1000) |
190 | #endif | ||
191 | #define U300_SYSCON_CFRR_MSPRO_CLK_FORCE_EN (0x0800) | 169 | #define U300_SYSCON_CFRR_MSPRO_CLK_FORCE_EN (0x0800) |
192 | #define U300_SYSCON_CFRR_AHB_SUBSYS_BRIDGE_CLK_FORCE_EN (0x0400) | 170 | #define U300_SYSCON_CFRR_AHB_SUBSYS_BRIDGE_CLK_FORCE_EN (0x0400) |
193 | #define U300_SYSCON_CFRR_SEMI_CLK_FORCE_EN (0x0200) | 171 | #define U300_SYSCON_CFRR_SEMI_CLK_FORCE_EN (0x0200) |
diff --git a/arch/arm/mach-u300/include/mach/u300-regs.h b/arch/arm/mach-u300/include/mach/u300-regs.h index 65f87c523892..1e49d901f2c9 100644 --- a/arch/arm/mach-u300/include/mach/u300-regs.h +++ b/arch/arm/mach-u300/include/mach/u300-regs.h | |||
@@ -28,7 +28,6 @@ | |||
28 | #define PLAT_NAND_CLE (1 << 16) | 28 | #define PLAT_NAND_CLE (1 << 16) |
29 | #define PLAT_NAND_ALE (1 << 17) | 29 | #define PLAT_NAND_ALE (1 << 17) |
30 | 30 | ||
31 | |||
32 | /* AHB Peripherals */ | 31 | /* AHB Peripherals */ |
33 | #define U300_AHB_PER_PHYS_BASE 0xa0000000 | 32 | #define U300_AHB_PER_PHYS_BASE 0xa0000000 |
34 | #define U300_AHB_PER_VIRT_BASE 0xff010000 | 33 | #define U300_AHB_PER_VIRT_BASE 0xff010000 |
@@ -46,11 +45,7 @@ | |||
46 | #define U300_BOOTROM_VIRT_BASE 0xffff0000 | 45 | #define U300_BOOTROM_VIRT_BASE 0xffff0000 |
47 | 46 | ||
48 | /* SEMI config base */ | 47 | /* SEMI config base */ |
49 | #ifdef CONFIG_MACH_U300_BS335 | ||
50 | #define U300_SEMI_CONFIG_BASE 0x2FFE0000 | 48 | #define U300_SEMI_CONFIG_BASE 0x2FFE0000 |
51 | #else | ||
52 | #define U300_SEMI_CONFIG_BASE 0x30000000 | ||
53 | #endif | ||
54 | 49 | ||
55 | /* | 50 | /* |
56 | * AHB peripherals | 51 | * AHB peripherals |
@@ -99,10 +94,8 @@ | |||
99 | /* SPI controller */ | 94 | /* SPI controller */ |
100 | #define U300_SPI_BASE (U300_FAST_PER_PHYS_BASE+0x6000) | 95 | #define U300_SPI_BASE (U300_FAST_PER_PHYS_BASE+0x6000) |
101 | 96 | ||
102 | #ifdef CONFIG_MACH_U300_BS335 | ||
103 | /* Fast UART1 on U335 only */ | 97 | /* Fast UART1 on U335 only */ |
104 | #define U300_UART1_BASE (U300_SLOW_PER_PHYS_BASE+0x7000) | 98 | #define U300_UART1_BASE (U300_SLOW_PER_PHYS_BASE+0x7000) |
105 | #endif | ||
106 | 99 | ||
107 | /* | 100 | /* |
108 | * SLOW peripherals | 101 | * SLOW peripherals |
@@ -151,10 +144,8 @@ | |||
151 | * REST peripherals | 144 | * REST peripherals |
152 | */ | 145 | */ |
153 | 146 | ||
154 | /* ISP (image signal processor) is only available in U335 */ | 147 | /* ISP (image signal processor) */ |
155 | #ifdef CONFIG_MACH_U300_BS335 | ||
156 | #define U300_ISP_BASE (0xA0008000) | 148 | #define U300_ISP_BASE (0xA0008000) |
157 | #endif | ||
158 | 149 | ||
159 | /* DMA Controller base */ | 150 | /* DMA Controller base */ |
160 | #define U300_DMAC_BASE (0xC0020000) | 151 | #define U300_DMAC_BASE (0xC0020000) |
@@ -166,17 +157,9 @@ | |||
166 | #define U300_APEX_BASE (0xc0030000) | 157 | #define U300_APEX_BASE (0xc0030000) |
167 | 158 | ||
168 | /* Video Encoder Base */ | 159 | /* Video Encoder Base */ |
169 | #ifdef CONFIG_MACH_U300_BS335 | ||
170 | #define U300_VIDEOENC_BASE (0xc0080000) | 160 | #define U300_VIDEOENC_BASE (0xc0080000) |
171 | #else | ||
172 | #define U300_VIDEOENC_BASE (0xc0040000) | ||
173 | #endif | ||
174 | 161 | ||
175 | /* XGAM Base */ | 162 | /* XGAM Base */ |
176 | #define U300_XGAM_BASE (0xd0000000) | 163 | #define U300_XGAM_BASE (0xd0000000) |
177 | 164 | ||
178 | /* | ||
179 | * Virtual accessor macros for static devices | ||
180 | */ | ||
181 | |||
182 | #endif | 165 | #endif |
diff --git a/arch/arm/mach-u300/spi.c b/arch/arm/mach-u300/spi.c index a1affacfa59c..02e6659286d5 100644 --- a/arch/arm/mach-u300/spi.c +++ b/arch/arm/mach-u300/spi.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/amba/pl022.h> | 12 | #include <linux/amba/pl022.h> |
13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
14 | #include <mach/coh901318.h> | 14 | #include <mach/coh901318.h> |
15 | #include <mach/dma_channels.h> | 15 | #include "dma_channels.h" |
16 | 16 | ||
17 | /* | 17 | /* |
18 | * The following is for the actual devices on the SSP/SPI bus | 18 | * The following is for the actual devices on the SSP/SPI bus |
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index 56ac06d38ec1..1da10e20e996 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -17,14 +17,17 @@ | |||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
20 | #include <linux/irq.h> | ||
20 | 21 | ||
21 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
23 | #include <mach/irqs.h> | ||
22 | 24 | ||
23 | /* Generic stuff */ | 25 | /* Generic stuff */ |
24 | #include <asm/sched_clock.h> | 26 | #include <asm/sched_clock.h> |
25 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
26 | #include <asm/mach/time.h> | 28 | #include <asm/mach/time.h> |
27 | #include <asm/mach/irq.h> | 29 | |
30 | #include "timer.h" | ||
28 | 31 | ||
29 | /* | 32 | /* |
30 | * APP side special timer registers | 33 | * APP side special timer registers |
diff --git a/arch/arm/mach-u300/timer.h b/arch/arm/mach-u300/timer.h new file mode 100644 index 000000000000..b5e9791762e0 --- /dev/null +++ b/arch/arm/mach-u300/timer.h | |||
@@ -0,0 +1 @@ | |||
extern struct sys_timer u300_timer; | |||
diff --git a/arch/arm/mach-u300/u300-gpio.h b/arch/arm/mach-u300/u300-gpio.h index 847dc25300c6..83f50772e169 100644 --- a/arch/arm/mach-u300/u300-gpio.h +++ b/arch/arm/mach-u300/u300-gpio.h | |||
@@ -1,50 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * Individual pin assignments for the B26/S26. Notice that the | 2 | * Individual pin assignments for the B335/S335. |
3 | * actual usage of these pins depends on the PAD MUX settings, that | ||
4 | * is why the same number can potentially appear several times. | ||
5 | * In the reference design each pin is only used for one purpose. | ||
6 | * These were determined by inspecting the B26/S26 schematic: | ||
7 | * 2/1911-ROA 128 1603 | ||
8 | */ | ||
9 | #ifdef CONFIG_MACH_U300_BS2X | ||
10 | #define U300_GPIO_PIN_UART_RX 0 | ||
11 | #define U300_GPIO_PIN_UART_TX 1 | ||
12 | #define U300_GPIO_PIN_GPIO02 2 /* Unrouted */ | ||
13 | #define U300_GPIO_PIN_GPIO03 3 /* Unrouted */ | ||
14 | #define U300_GPIO_PIN_CAM_SLEEP 4 | ||
15 | #define U300_GPIO_PIN_CAM_REG_EN 5 | ||
16 | #define U300_GPIO_PIN_GPIO06 6 /* Unrouted */ | ||
17 | #define U300_GPIO_PIN_GPIO07 7 /* Unrouted */ | ||
18 | |||
19 | #define U300_GPIO_PIN_GPIO08 8 /* Service point SP2321 */ | ||
20 | #define U300_GPIO_PIN_GPIO09 9 /* Service point SP2322 */ | ||
21 | #define U300_GPIO_PIN_PHFSENSE 10 /* Headphone jack sensing */ | ||
22 | #define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */ | ||
23 | #define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */ | ||
24 | #define U300_GPIO_PIN_FLIPSENSE 13 /* Mechanical flip sensing */ | ||
25 | #define U300_GPIO_PIN_GPIO14 14 /* DSP JTAG Port RTCK */ | ||
26 | #define U300_GPIO_PIN_GPIO15 15 /* Unrouted */ | ||
27 | |||
28 | #define U300_GPIO_PIN_GPIO16 16 /* Unrouted */ | ||
29 | #define U300_GPIO_PIN_GPIO17 17 /* Unrouted */ | ||
30 | #define U300_GPIO_PIN_GPIO18 18 /* Unrouted */ | ||
31 | #define U300_GPIO_PIN_GPIO19 19 /* Unrouted */ | ||
32 | #define U300_GPIO_PIN_GPIO20 20 /* Unrouted */ | ||
33 | #define U300_GPIO_PIN_GPIO21 21 /* Unrouted */ | ||
34 | #define U300_GPIO_PIN_GPIO22 22 /* Unrouted */ | ||
35 | #define U300_GPIO_PIN_GPIO23 23 /* Unrouted */ | ||
36 | #endif | ||
37 | |||
38 | /* | ||
39 | * Individual pin assignments for the B330/S330 and B365/S365. | ||
40 | * Notice that the actual usage of these pins depends on the | 3 | * Notice that the actual usage of these pins depends on the |
41 | * PAD MUX settings, that is why the same number can potentially | 4 | * PAD MUX settings, that is why the same number can potentially |
42 | * appear several times. In the reference design each pin is only | 5 | * appear several times. In the reference design each pin is only |
43 | * used for one purpose. These were determined by inspecting the | 6 | * used for one purpose. These were determined by inspecting the |
44 | * S365 schematic. | 7 | * S365 schematic. |
45 | */ | 8 | */ |
46 | #if defined(CONFIG_MACH_U300_BS330) || defined(CONFIG_MACH_U300_BS365) || \ | ||
47 | defined(CONFIG_MACH_U300_BS335) | ||
48 | #define U300_GPIO_PIN_UART_RX 0 | 9 | #define U300_GPIO_PIN_UART_RX 0 |
49 | #define U300_GPIO_PIN_UART_TX 1 | 10 | #define U300_GPIO_PIN_UART_TX 1 |
50 | #define U300_GPIO_PIN_UART_CTS 2 | 11 | #define U300_GPIO_PIN_UART_CTS 2 |
@@ -90,8 +51,6 @@ | |||
90 | #define U300_GPIO_PIN_GPIO38 38 /* Unrouted */ | 51 | #define U300_GPIO_PIN_GPIO38 38 /* Unrouted */ |
91 | #define U300_GPIO_PIN_GPIO39 39 /* Unrouted */ | 52 | #define U300_GPIO_PIN_GPIO39 39 /* Unrouted */ |
92 | 53 | ||
93 | #ifdef CONFIG_MACH_U300_BS335 | ||
94 | |||
95 | #define U300_GPIO_PIN_GPIO40 40 /* Unrouted */ | 54 | #define U300_GPIO_PIN_GPIO40 40 /* Unrouted */ |
96 | #define U300_GPIO_PIN_GPIO41 41 /* Unrouted */ | 55 | #define U300_GPIO_PIN_GPIO41 41 /* Unrouted */ |
97 | #define U300_GPIO_PIN_GPIO42 42 /* Unrouted */ | 56 | #define U300_GPIO_PIN_GPIO42 42 /* Unrouted */ |
@@ -109,6 +68,3 @@ | |||
109 | #define U300_GPIO_PIN_GPIO53 53 /* Unrouted */ | 68 | #define U300_GPIO_PIN_GPIO53 53 /* Unrouted */ |
110 | #define U300_GPIO_PIN_GPIO54 54 /* Unrouted */ | 69 | #define U300_GPIO_PIN_GPIO54 54 /* Unrouted */ |
111 | #define U300_GPIO_PIN_GPIO55 55 /* Unrouted */ | 70 | #define U300_GPIO_PIN_GPIO55 55 /* Unrouted */ |
112 | #endif | ||
113 | |||
114 | #endif | ||
diff --git a/arch/arm/mach-u300/u300.c b/arch/arm/mach-u300/u300.c deleted file mode 100644 index f30c69d91d99..000000000000 --- a/arch/arm/mach-u300/u300.c +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * arch/arm/mach-u300/u300.c | ||
4 | * | ||
5 | * | ||
6 | * Copyright (C) 2006-2009 ST-Ericsson AB | ||
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | * Platform machine definition. | ||
9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
10 | */ | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/mm.h> | ||
14 | #include <linux/sched.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/ioport.h> | ||
17 | #include <linux/memblock.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <mach/hardware.h> | ||
21 | #include <mach/platform.h> | ||
22 | #include <asm/hardware/vic.h> | ||
23 | #include <asm/mach-types.h> | ||
24 | #include <asm/mach/arch.h> | ||
25 | #include <asm/memory.h> | ||
26 | |||
27 | static void __init u300_init_machine(void) | ||
28 | { | ||
29 | u300_init_devices(); | ||
30 | } | ||
31 | |||
32 | #ifdef CONFIG_MACH_U300_BS2X | ||
33 | #define MACH_U300_STRING "Ericsson AB U300 S25/S26/B25/B26 Prototype Board" | ||
34 | #endif | ||
35 | |||
36 | #ifdef CONFIG_MACH_U300_BS330 | ||
37 | #define MACH_U300_STRING "Ericsson AB U330 S330/B330 Prototype Board" | ||
38 | #endif | ||
39 | |||
40 | #ifdef CONFIG_MACH_U300_BS335 | ||
41 | #define MACH_U300_STRING "Ericsson AB U335 S335/B335 Prototype Board" | ||
42 | #endif | ||
43 | |||
44 | #ifdef CONFIG_MACH_U300_BS365 | ||
45 | #define MACH_U300_STRING "Ericsson AB U365 S365/B365 Prototype Board" | ||
46 | #endif | ||
47 | |||
48 | MACHINE_START(U300, MACH_U300_STRING) | ||
49 | /* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */ | ||
50 | .atag_offset = 0x100, | ||
51 | .map_io = u300_map_io, | ||
52 | .init_irq = u300_init_irq, | ||
53 | .handle_irq = vic_handle_irq, | ||
54 | .timer = &u300_timer, | ||
55 | .init_machine = u300_init_machine, | ||
56 | .restart = u300_restart, | ||
57 | MACHINE_END | ||
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 4e59746bcff4..7e6c384881a6 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -20,7 +20,6 @@ | |||
20 | 20 | ||
21 | #include <asm/pmu.h> | 21 | #include <asm/pmu.h> |
22 | #include <asm/mach/map.h> | 22 | #include <asm/mach/map.h> |
23 | #include <asm/pmu.h> | ||
24 | #include <plat/gpio-nomadik.h> | 23 | #include <plat/gpio-nomadik.h> |
25 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
26 | #include <mach/setup.h> | 25 | #include <mach/setup.h> |
@@ -123,7 +122,7 @@ struct arm_pmu_platdata db8500_pmu_platdata = { | |||
123 | 122 | ||
124 | static struct platform_device db8500_pmu_device = { | 123 | static struct platform_device db8500_pmu_device = { |
125 | .name = "arm-pmu", | 124 | .name = "arm-pmu", |
126 | .id = ARM_PMU_DEVICE_CPU, | 125 | .id = -1, |
127 | .num_resources = ARRAY_SIZE(db8500_pmu_resources), | 126 | .num_resources = ARRAY_SIZE(db8500_pmu_resources), |
128 | .resource = db8500_pmu_resources, | 127 | .resource = db8500_pmu_resources, |
129 | .dev.platform_data = &db8500_pmu_platdata, | 128 | .dev.platform_data = &db8500_pmu_platdata, |
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index cd8ea3588f93..ca7902c6ed18 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -169,11 +169,6 @@ static struct map_desc versatile_io_desc[] __initdata = { | |||
169 | .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE), | 169 | .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE), |
170 | .length = VERSATILE_PCI_CFG_BASE_SIZE, | 170 | .length = VERSATILE_PCI_CFG_BASE_SIZE, |
171 | .type = MT_DEVICE | 171 | .type = MT_DEVICE |
172 | }, { | ||
173 | .virtual = (unsigned long)VERSATILE_PCI_VIRT_MEM_BASE0, | ||
174 | .pfn = __phys_to_pfn(VERSATILE_PCI_MEM_BASE0), | ||
175 | .length = IO_SPACE_LIMIT, | ||
176 | .type = MT_DEVICE | ||
177 | }, | 172 | }, |
178 | #endif | 173 | #endif |
179 | }; | 174 | }; |
diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h index 408e58da46c6..3e5d425e2a92 100644 --- a/arch/arm/mach-versatile/include/mach/hardware.h +++ b/arch/arm/mach-versatile/include/mach/hardware.h | |||
@@ -29,7 +29,6 @@ | |||
29 | */ | 29 | */ |
30 | #define VERSATILE_PCI_VIRT_BASE (void __iomem *)0xe8000000ul | 30 | #define VERSATILE_PCI_VIRT_BASE (void __iomem *)0xe8000000ul |
31 | #define VERSATILE_PCI_CFG_VIRT_BASE (void __iomem *)0xe9000000ul | 31 | #define VERSATILE_PCI_CFG_VIRT_BASE (void __iomem *)0xe9000000ul |
32 | #define VERSATILE_PCI_VIRT_MEM_BASE0 (void __iomem *)PCIO_BASE | ||
33 | 32 | ||
34 | /* macro to get at MMIO space when running virtually */ | 33 | /* macro to get at MMIO space when running virtually */ |
35 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) | 34 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) |
diff --git a/arch/arm/mach-versatile/include/mach/io.h b/arch/arm/mach-versatile/include/mach/io.h deleted file mode 100644 index 0406513be7d8..000000000000 --- a/arch/arm/mach-versatile/include/mach/io.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-versatile/include/mach/io.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __ASM_ARM_ARCH_IO_H | ||
21 | #define __ASM_ARM_ARCH_IO_H | ||
22 | |||
23 | #define PCIO_BASE 0xeb000000ul | ||
24 | |||
25 | #define __io(a) ((a) + PCIO_BASE) | ||
26 | |||
27 | #endif | ||
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c index e95bf84cc837..2f84f4094f13 100644 --- a/arch/arm/mach-versatile/pci.c +++ b/arch/arm/mach-versatile/pci.c | |||
@@ -169,13 +169,6 @@ static struct pci_ops pci_versatile_ops = { | |||
169 | .write = versatile_write_config, | 169 | .write = versatile_write_config, |
170 | }; | 170 | }; |
171 | 171 | ||
172 | static struct resource io_port = { | ||
173 | .name = "PCI", | ||
174 | .start = 0, | ||
175 | .end = IO_SPACE_LIMIT, | ||
176 | .flags = IORESOURCE_IO, | ||
177 | }; | ||
178 | |||
179 | static struct resource io_mem = { | 172 | static struct resource io_mem = { |
180 | .name = "PCI I/O space", | 173 | .name = "PCI I/O space", |
181 | .start = VERSATILE_PCI_MEM_BASE0, | 174 | .start = VERSATILE_PCI_MEM_BASE0, |
@@ -207,12 +200,6 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys) | |||
207 | "memory region (%d)\n", ret); | 200 | "memory region (%d)\n", ret); |
208 | goto out; | 201 | goto out; |
209 | } | 202 | } |
210 | ret = request_resource(&ioport_resource, &io_port); | ||
211 | if (ret) { | ||
212 | printk(KERN_ERR "PCI: unable to allocate I/O " | ||
213 | "port region (%d)\n", ret); | ||
214 | goto out; | ||
215 | } | ||
216 | ret = request_resource(&iomem_resource, &non_mem); | 203 | ret = request_resource(&iomem_resource, &non_mem); |
217 | if (ret) { | 204 | if (ret) { |
218 | printk(KERN_ERR "PCI: unable to allocate non-prefetchable " | 205 | printk(KERN_ERR "PCI: unable to allocate non-prefetchable " |
@@ -227,11 +214,9 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys) | |||
227 | } | 214 | } |
228 | 215 | ||
229 | /* | 216 | /* |
230 | * the IO resource for this bus | ||
231 | * the mem resource for this bus | 217 | * the mem resource for this bus |
232 | * the prefetch mem resource for this bus | 218 | * the prefetch mem resource for this bus |
233 | */ | 219 | */ |
234 | pci_add_resource_offset(&sys->resources, &io_port, sys->io_offset); | ||
235 | pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset); | 220 | pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset); |
236 | pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset); | 221 | pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset); |
237 | 222 | ||
@@ -260,9 +245,11 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys) | |||
260 | goto out; | 245 | goto out; |
261 | } | 246 | } |
262 | 247 | ||
248 | ret = pci_ioremap_io(0, VERSATILE_PCI_MEM_BASE0); | ||
249 | if (ret) | ||
250 | goto out; | ||
251 | |||
263 | if (nr == 0) { | 252 | if (nr == 0) { |
264 | sys->mem_offset = 0; | ||
265 | sys->io_offset = 0; | ||
266 | ret = pci_versatile_setup_resources(sys); | 253 | ret = pci_versatile_setup_resources(sys); |
267 | if (ret < 0) { | 254 | if (ret < 0) { |
268 | printk("pci_versatile_setup: resources... oops?\n"); | 255 | printk("pci_versatile_setup: resources... oops?\n"); |
@@ -319,7 +306,6 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys) | |||
319 | 306 | ||
320 | void __init pci_versatile_preinit(void) | 307 | void __init pci_versatile_preinit(void) |
321 | { | 308 | { |
322 | pcibios_min_io = 0x44000000; | ||
323 | pcibios_min_mem = 0x50000000; | 309 | pcibios_min_mem = 0x50000000; |
324 | 310 | ||
325 | __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0); | 311 | __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0); |
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index 61c492403b05..e4073a60a864 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <asm/hardware/arm_timer.h> | 13 | #include <asm/hardware/arm_timer.h> |
14 | #include <asm/hardware/cache-l2x0.h> | 14 | #include <asm/hardware/cache-l2x0.h> |
15 | #include <asm/hardware/gic.h> | 15 | #include <asm/hardware/gic.h> |
16 | #include <asm/pmu.h> | ||
17 | #include <asm/smp_scu.h> | 16 | #include <asm/smp_scu.h> |
18 | #include <asm/smp_twd.h> | 17 | #include <asm/smp_twd.h> |
19 | 18 | ||
@@ -144,7 +143,7 @@ static struct resource pmu_resources[] = { | |||
144 | 143 | ||
145 | static struct platform_device pmu_device = { | 144 | static struct platform_device pmu_device = { |
146 | .name = "arm-pmu", | 145 | .name = "arm-pmu", |
147 | .id = ARM_PMU_DEVICE_CPU, | 146 | .id = -1, |
148 | .num_resources = ARRAY_SIZE(pmu_resources), | 147 | .num_resources = ARRAY_SIZE(pmu_resources), |
149 | .resource = pmu_resources, | 148 | .resource = pmu_resources, |
150 | }; | 149 | }; |
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 566750fa57d4..9d869f93a3da 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/system_info.h> | 36 | #include <asm/system_info.h> |
37 | 37 | ||
38 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
39 | #include <asm/mach/pci.h> | ||
39 | #include "mm.h" | 40 | #include "mm.h" |
40 | 41 | ||
41 | int ioremap_page(unsigned long virt, unsigned long phys, | 42 | int ioremap_page(unsigned long virt, unsigned long phys, |
@@ -383,3 +384,16 @@ void __arm_iounmap(volatile void __iomem *io_addr) | |||
383 | arch_iounmap(io_addr); | 384 | arch_iounmap(io_addr); |
384 | } | 385 | } |
385 | EXPORT_SYMBOL(__arm_iounmap); | 386 | EXPORT_SYMBOL(__arm_iounmap); |
387 | |||
388 | #ifdef CONFIG_PCI | ||
389 | int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr) | ||
390 | { | ||
391 | BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT); | ||
392 | |||
393 | return ioremap_page_range(PCI_IO_VIRT_BASE + offset, | ||
394 | PCI_IO_VIRT_BASE + offset + SZ_64K, | ||
395 | phys_addr, | ||
396 | __pgprot(get_mem_type(MT_DEVICE)->prot_pte)); | ||
397 | } | ||
398 | EXPORT_SYMBOL_GPL(pci_ioremap_io); | ||
399 | #endif | ||
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index c2fa21d0103e..18144e6a3115 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
33 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
34 | #include <asm/mach/pci.h> | ||
34 | 35 | ||
35 | #include "mm.h" | 36 | #include "mm.h" |
36 | 37 | ||
@@ -216,7 +217,7 @@ static struct mem_type mem_types[] = { | |||
216 | .prot_l1 = PMD_TYPE_TABLE, | 217 | .prot_l1 = PMD_TYPE_TABLE, |
217 | .prot_sect = PROT_SECT_DEVICE | PMD_SECT_WB, | 218 | .prot_sect = PROT_SECT_DEVICE | PMD_SECT_WB, |
218 | .domain = DOMAIN_IO, | 219 | .domain = DOMAIN_IO, |
219 | }, | 220 | }, |
220 | [MT_DEVICE_WC] = { /* ioremap_wc */ | 221 | [MT_DEVICE_WC] = { /* ioremap_wc */ |
221 | .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_WC, | 222 | .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_WC, |
222 | .prot_l1 = PMD_TYPE_TABLE, | 223 | .prot_l1 = PMD_TYPE_TABLE, |
@@ -777,14 +778,27 @@ void __init iotable_init(struct map_desc *io_desc, int nr) | |||
777 | create_mapping(md); | 778 | create_mapping(md); |
778 | vm->addr = (void *)(md->virtual & PAGE_MASK); | 779 | vm->addr = (void *)(md->virtual & PAGE_MASK); |
779 | vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK)); | 780 | vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK)); |
780 | vm->phys_addr = __pfn_to_phys(md->pfn); | 781 | vm->phys_addr = __pfn_to_phys(md->pfn); |
781 | vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; | 782 | vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; |
782 | vm->flags |= VM_ARM_MTYPE(md->type); | 783 | vm->flags |= VM_ARM_MTYPE(md->type); |
783 | vm->caller = iotable_init; | 784 | vm->caller = iotable_init; |
784 | vm_area_add_early(vm++); | 785 | vm_area_add_early(vm++); |
785 | } | 786 | } |
786 | } | 787 | } |
787 | 788 | ||
789 | void __init vm_reserve_area_early(unsigned long addr, unsigned long size, | ||
790 | void *caller) | ||
791 | { | ||
792 | struct vm_struct *vm; | ||
793 | |||
794 | vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm)); | ||
795 | vm->addr = (void *)addr; | ||
796 | vm->size = size; | ||
797 | vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING; | ||
798 | vm->caller = caller; | ||
799 | vm_area_add_early(vm); | ||
800 | } | ||
801 | |||
788 | #ifndef CONFIG_ARM_LPAE | 802 | #ifndef CONFIG_ARM_LPAE |
789 | 803 | ||
790 | /* | 804 | /* |
@@ -802,14 +816,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr) | |||
802 | 816 | ||
803 | static void __init pmd_empty_section_gap(unsigned long addr) | 817 | static void __init pmd_empty_section_gap(unsigned long addr) |
804 | { | 818 | { |
805 | struct vm_struct *vm; | 819 | vm_reserve_area_early(addr, SECTION_SIZE, pmd_empty_section_gap); |
806 | |||
807 | vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm)); | ||
808 | vm->addr = (void *)addr; | ||
809 | vm->size = SECTION_SIZE; | ||
810 | vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING; | ||
811 | vm->caller = pmd_empty_section_gap; | ||
812 | vm_area_add_early(vm); | ||
813 | } | 820 | } |
814 | 821 | ||
815 | static void __init fill_pmd_gaps(void) | 822 | static void __init fill_pmd_gaps(void) |
@@ -858,6 +865,28 @@ static void __init fill_pmd_gaps(void) | |||
858 | #define fill_pmd_gaps() do { } while (0) | 865 | #define fill_pmd_gaps() do { } while (0) |
859 | #endif | 866 | #endif |
860 | 867 | ||
868 | #if defined(CONFIG_PCI) && !defined(CONFIG_NEED_MACH_IO_H) | ||
869 | static void __init pci_reserve_io(void) | ||
870 | { | ||
871 | struct vm_struct *vm; | ||
872 | unsigned long addr; | ||
873 | |||
874 | /* we're still single threaded hence no lock needed here */ | ||
875 | for (vm = vmlist; vm; vm = vm->next) { | ||
876 | if (!(vm->flags & VM_ARM_STATIC_MAPPING)) | ||
877 | continue; | ||
878 | addr = (unsigned long)vm->addr; | ||
879 | addr &= ~(SZ_2M - 1); | ||
880 | if (addr == PCI_IO_VIRT_BASE) | ||
881 | return; | ||
882 | |||
883 | } | ||
884 | vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io); | ||
885 | } | ||
886 | #else | ||
887 | #define pci_reserve_io() do { } while (0) | ||
888 | #endif | ||
889 | |||
861 | static void * __initdata vmalloc_min = | 890 | static void * __initdata vmalloc_min = |
862 | (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET); | 891 | (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET); |
863 | 892 | ||
@@ -1141,6 +1170,9 @@ static void __init devicemaps_init(struct machine_desc *mdesc) | |||
1141 | mdesc->map_io(); | 1170 | mdesc->map_io(); |
1142 | fill_pmd_gaps(); | 1171 | fill_pmd_gaps(); |
1143 | 1172 | ||
1173 | /* Reserve fixed i/o space in VMALLOC region */ | ||
1174 | pci_reserve_io(); | ||
1175 | |||
1144 | /* | 1176 | /* |
1145 | * Finally flush the caches and tlb to ensure that we're in a | 1177 | * Finally flush the caches and tlb to ensure that we're in a |
1146 | * consistent state wrt the writebuffer. This also ensures that | 1178 | * consistent state wrt the writebuffer. This also ensures that |
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c index 8daae9b230ea..362474b5c40d 100644 --- a/arch/arm/plat-iop/pci.c +++ b/arch/arm/plat-iop/pci.c | |||
@@ -192,30 +192,24 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys) | |||
192 | if (nr != 0) | 192 | if (nr != 0) |
193 | return 0; | 193 | return 0; |
194 | 194 | ||
195 | res = kzalloc(2 * sizeof(struct resource), GFP_KERNEL); | 195 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); |
196 | if (!res) | 196 | if (!res) |
197 | panic("PCI: unable to alloc resources"); | 197 | panic("PCI: unable to alloc resources"); |
198 | 198 | ||
199 | res[0].start = IOP3XX_PCI_LOWER_IO_PA; | 199 | res->start = IOP3XX_PCI_LOWER_MEM_PA; |
200 | res[0].end = IOP3XX_PCI_LOWER_IO_PA + IOP3XX_PCI_IO_WINDOW_SIZE - 1; | 200 | res->end = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE - 1; |
201 | res[0].name = "IOP3XX PCI I/O Space"; | 201 | res->name = "IOP3XX PCI Memory Space"; |
202 | res[0].flags = IORESOURCE_IO; | 202 | res->flags = IORESOURCE_MEM; |
203 | request_resource(&ioport_resource, &res[0]); | 203 | request_resource(&iomem_resource, res); |
204 | |||
205 | res[1].start = IOP3XX_PCI_LOWER_MEM_PA; | ||
206 | res[1].end = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE - 1; | ||
207 | res[1].name = "IOP3XX PCI Memory Space"; | ||
208 | res[1].flags = IORESOURCE_MEM; | ||
209 | request_resource(&iomem_resource, &res[1]); | ||
210 | 204 | ||
211 | /* | 205 | /* |
212 | * Use whatever translation is already setup. | 206 | * Use whatever translation is already setup. |
213 | */ | 207 | */ |
214 | sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0; | 208 | sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0; |
215 | sys->io_offset = IOP3XX_PCI_LOWER_IO_PA - *IOP3XX_OIOWTVR; | ||
216 | 209 | ||
217 | pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); | 210 | pci_add_resource_offset(&sys->resources, res, sys->mem_offset); |
218 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); | 211 | |
212 | pci_ioremap_io(0, IOP3XX_PCI_LOWER_IO_PA); | ||
219 | 213 | ||
220 | return 1; | 214 | return 1; |
221 | } | 215 | } |
@@ -367,7 +361,6 @@ void __init iop3xx_pci_preinit_cond(void) | |||
367 | 361 | ||
368 | void __init iop3xx_pci_preinit(void) | 362 | void __init iop3xx_pci_preinit(void) |
369 | { | 363 | { |
370 | pcibios_min_io = 0; | ||
371 | pcibios_min_mem = 0; | 364 | pcibios_min_mem = 0; |
372 | 365 | ||
373 | iop3xx_atu_disable(); | 366 | iop3xx_atu_disable(); |
diff --git a/arch/arm/plat-iop/pmu.c b/arch/arm/plat-iop/pmu.c index a2024b8685a1..ad9f9744a82d 100644 --- a/arch/arm/plat-iop/pmu.c +++ b/arch/arm/plat-iop/pmu.c | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
12 | #include <asm/pmu.h> | ||
13 | #include <mach/irqs.h> | 12 | #include <mach/irqs.h> |
14 | 13 | ||
15 | static struct resource pmu_resource = { | 14 | static struct resource pmu_resource = { |
@@ -26,7 +25,7 @@ static struct resource pmu_resource = { | |||
26 | 25 | ||
27 | static struct platform_device pmu_device = { | 26 | static struct platform_device pmu_device = { |
28 | .name = "arm-pmu", | 27 | .name = "arm-pmu", |
29 | .id = ARM_PMU_DEVICE_CPU, | 28 | .id = -1, |
30 | .resource = &pmu_resource, | 29 | .resource = &pmu_resource, |
31 | .num_resources = 1, | 30 | .num_resources = 1, |
32 | }; | 31 | }; |
diff --git a/arch/arm/plat-iop/setup.c b/arch/arm/plat-iop/setup.c index bade586fed0f..5b217f460f18 100644 --- a/arch/arm/plat-iop/setup.c +++ b/arch/arm/plat-iop/setup.c | |||
@@ -25,11 +25,6 @@ static struct map_desc iop3xx_std_desc[] __initdata = { | |||
25 | .pfn = __phys_to_pfn(IOP3XX_PERIPHERAL_PHYS_BASE), | 25 | .pfn = __phys_to_pfn(IOP3XX_PERIPHERAL_PHYS_BASE), |
26 | .length = IOP3XX_PERIPHERAL_SIZE, | 26 | .length = IOP3XX_PERIPHERAL_SIZE, |
27 | .type = MT_UNCACHED, | 27 | .type = MT_UNCACHED, |
28 | }, { /* PCI IO space */ | ||
29 | .virtual = IOP3XX_PCI_LOWER_IO_VA, | ||
30 | .pfn = __phys_to_pfn(IOP3XX_PCI_LOWER_IO_PA), | ||
31 | .length = IOP3XX_PCI_IO_WINDOW_SIZE, | ||
32 | .type = MT_DEVICE, | ||
33 | }, | 28 | }, |
34 | }; | 29 | }; |
35 | 30 | ||
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile index 6ac720031150..149237e24850 100644 --- a/arch/arm/plat-mxc/Makefile +++ b/arch/arm/plat-mxc/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := clock.o time.o devices.o cpu.o system.o irq-common.o | 6 | obj-y := time.o devices.o cpu.o system.o irq-common.o |
7 | 7 | ||
8 | obj-$(CONFIG_MXC_TZIC) += tzic.o | 8 | obj-$(CONFIG_MXC_TZIC) += tzic.o |
9 | obj-$(CONFIG_MXC_AVIC) += avic.o | 9 | obj-$(CONFIG_MXC_AVIC) += avic.o |
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c deleted file mode 100644 index 5079787273d2..000000000000 --- a/arch/arm/plat-mxc/clock.c +++ /dev/null | |||
@@ -1,257 +0,0 @@ | |||
1 | /* | ||
2 | * Based on arch/arm/plat-omap/clock.c | ||
3 | * | ||
4 | * Copyright (C) 2004 - 2005 Nokia corporation | ||
5 | * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> | ||
6 | * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com> | ||
7 | * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
8 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version 2 | ||
13 | * of the License, or (at your option) any later version. | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
22 | * MA 02110-1301, USA. | ||
23 | */ | ||
24 | |||
25 | /* #define DEBUG */ | ||
26 | |||
27 | #include <linux/clk.h> | ||
28 | #include <linux/err.h> | ||
29 | #include <linux/errno.h> | ||
30 | #include <linux/init.h> | ||
31 | #include <linux/io.h> | ||
32 | #include <linux/kernel.h> | ||
33 | #include <linux/list.h> | ||
34 | #include <linux/module.h> | ||
35 | #include <linux/mutex.h> | ||
36 | #include <linux/platform_device.h> | ||
37 | #include <linux/proc_fs.h> | ||
38 | #include <linux/semaphore.h> | ||
39 | #include <linux/string.h> | ||
40 | |||
41 | #include <mach/clock.h> | ||
42 | #include <mach/hardware.h> | ||
43 | |||
44 | #ifndef CONFIG_COMMON_CLK | ||
45 | static LIST_HEAD(clocks); | ||
46 | static DEFINE_MUTEX(clocks_mutex); | ||
47 | |||
48 | /*------------------------------------------------------------------------- | ||
49 | * Standard clock functions defined in include/linux/clk.h | ||
50 | *-------------------------------------------------------------------------*/ | ||
51 | |||
52 | static void __clk_disable(struct clk *clk) | ||
53 | { | ||
54 | if (clk == NULL || IS_ERR(clk)) | ||
55 | return; | ||
56 | WARN_ON(!clk->usecount); | ||
57 | |||
58 | if (!(--clk->usecount)) { | ||
59 | if (clk->disable) | ||
60 | clk->disable(clk); | ||
61 | __clk_disable(clk->parent); | ||
62 | __clk_disable(clk->secondary); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | static int __clk_enable(struct clk *clk) | ||
67 | { | ||
68 | if (clk == NULL || IS_ERR(clk)) | ||
69 | return -EINVAL; | ||
70 | |||
71 | if (clk->usecount++ == 0) { | ||
72 | __clk_enable(clk->parent); | ||
73 | __clk_enable(clk->secondary); | ||
74 | |||
75 | if (clk->enable) | ||
76 | clk->enable(clk); | ||
77 | } | ||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | /* This function increments the reference count on the clock and enables the | ||
82 | * clock if not already enabled. The parent clock tree is recursively enabled | ||
83 | */ | ||
84 | int clk_enable(struct clk *clk) | ||
85 | { | ||
86 | int ret = 0; | ||
87 | |||
88 | if (clk == NULL || IS_ERR(clk)) | ||
89 | return -EINVAL; | ||
90 | |||
91 | mutex_lock(&clocks_mutex); | ||
92 | ret = __clk_enable(clk); | ||
93 | mutex_unlock(&clocks_mutex); | ||
94 | |||
95 | return ret; | ||
96 | } | ||
97 | EXPORT_SYMBOL(clk_enable); | ||
98 | |||
99 | /* This function decrements the reference count on the clock and disables | ||
100 | * the clock when reference count is 0. The parent clock tree is | ||
101 | * recursively disabled | ||
102 | */ | ||
103 | void clk_disable(struct clk *clk) | ||
104 | { | ||
105 | if (clk == NULL || IS_ERR(clk)) | ||
106 | return; | ||
107 | |||
108 | mutex_lock(&clocks_mutex); | ||
109 | __clk_disable(clk); | ||
110 | mutex_unlock(&clocks_mutex); | ||
111 | } | ||
112 | EXPORT_SYMBOL(clk_disable); | ||
113 | |||
114 | /* Retrieve the *current* clock rate. If the clock itself | ||
115 | * does not provide a special calculation routine, ask | ||
116 | * its parent and so on, until one is able to return | ||
117 | * a valid clock rate | ||
118 | */ | ||
119 | unsigned long clk_get_rate(struct clk *clk) | ||
120 | { | ||
121 | if (clk == NULL || IS_ERR(clk)) | ||
122 | return 0UL; | ||
123 | |||
124 | if (clk->get_rate) | ||
125 | return clk->get_rate(clk); | ||
126 | |||
127 | return clk_get_rate(clk->parent); | ||
128 | } | ||
129 | EXPORT_SYMBOL(clk_get_rate); | ||
130 | |||
131 | /* Round the requested clock rate to the nearest supported | ||
132 | * rate that is less than or equal to the requested rate. | ||
133 | * This is dependent on the clock's current parent. | ||
134 | */ | ||
135 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
136 | { | ||
137 | if (clk == NULL || IS_ERR(clk) || !clk->round_rate) | ||
138 | return 0; | ||
139 | |||
140 | return clk->round_rate(clk, rate); | ||
141 | } | ||
142 | EXPORT_SYMBOL(clk_round_rate); | ||
143 | |||
144 | /* Set the clock to the requested clock rate. The rate must | ||
145 | * match a supported rate exactly based on what clk_round_rate returns | ||
146 | */ | ||
147 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
148 | { | ||
149 | int ret = -EINVAL; | ||
150 | |||
151 | if (clk == NULL || IS_ERR(clk) || clk->set_rate == NULL || rate == 0) | ||
152 | return ret; | ||
153 | |||
154 | mutex_lock(&clocks_mutex); | ||
155 | ret = clk->set_rate(clk, rate); | ||
156 | mutex_unlock(&clocks_mutex); | ||
157 | |||
158 | return ret; | ||
159 | } | ||
160 | EXPORT_SYMBOL(clk_set_rate); | ||
161 | |||
162 | /* Set the clock's parent to another clock source */ | ||
163 | int clk_set_parent(struct clk *clk, struct clk *parent) | ||
164 | { | ||
165 | int ret = -EINVAL; | ||
166 | struct clk *old; | ||
167 | |||
168 | if (clk == NULL || IS_ERR(clk) || parent == NULL || | ||
169 | IS_ERR(parent) || clk->set_parent == NULL) | ||
170 | return ret; | ||
171 | |||
172 | if (clk->usecount) | ||
173 | clk_enable(parent); | ||
174 | |||
175 | mutex_lock(&clocks_mutex); | ||
176 | ret = clk->set_parent(clk, parent); | ||
177 | if (ret == 0) { | ||
178 | old = clk->parent; | ||
179 | clk->parent = parent; | ||
180 | } else { | ||
181 | old = parent; | ||
182 | } | ||
183 | mutex_unlock(&clocks_mutex); | ||
184 | |||
185 | if (clk->usecount) | ||
186 | clk_disable(old); | ||
187 | |||
188 | return ret; | ||
189 | } | ||
190 | EXPORT_SYMBOL(clk_set_parent); | ||
191 | |||
192 | /* Retrieve the clock's parent clock source */ | ||
193 | struct clk *clk_get_parent(struct clk *clk) | ||
194 | { | ||
195 | struct clk *ret = NULL; | ||
196 | |||
197 | if (clk == NULL || IS_ERR(clk)) | ||
198 | return ret; | ||
199 | |||
200 | return clk->parent; | ||
201 | } | ||
202 | EXPORT_SYMBOL(clk_get_parent); | ||
203 | |||
204 | #else | ||
205 | |||
206 | /* | ||
207 | * Lock to protect the clock module (ccm) registers. Used | ||
208 | * on all i.MXs | ||
209 | */ | ||
210 | DEFINE_SPINLOCK(imx_ccm_lock); | ||
211 | |||
212 | #endif /* CONFIG_COMMON_CLK */ | ||
213 | |||
214 | /* | ||
215 | * Get the resulting clock rate from a PLL register value and the input | ||
216 | * frequency. PLLs with this register layout can at least be found on | ||
217 | * MX1, MX21, MX27 and MX31 | ||
218 | * | ||
219 | * mfi + mfn / (mfd + 1) | ||
220 | * f = 2 * f_ref * -------------------- | ||
221 | * pd + 1 | ||
222 | */ | ||
223 | unsigned long mxc_decode_pll(unsigned int reg_val, u32 freq) | ||
224 | { | ||
225 | long long ll; | ||
226 | int mfn_abs; | ||
227 | unsigned int mfi, mfn, mfd, pd; | ||
228 | |||
229 | mfi = (reg_val >> 10) & 0xf; | ||
230 | mfn = reg_val & 0x3ff; | ||
231 | mfd = (reg_val >> 16) & 0x3ff; | ||
232 | pd = (reg_val >> 26) & 0xf; | ||
233 | |||
234 | mfi = mfi <= 5 ? 5 : mfi; | ||
235 | |||
236 | mfn_abs = mfn; | ||
237 | |||
238 | /* On all i.MXs except i.MX1 and i.MX21 mfn is a 10bit | ||
239 | * 2's complements number | ||
240 | */ | ||
241 | if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200) | ||
242 | mfn_abs = 0x400 - mfn; | ||
243 | |||
244 | freq *= 2; | ||
245 | freq /= pd + 1; | ||
246 | |||
247 | ll = (unsigned long long)freq * mfn_abs; | ||
248 | |||
249 | do_div(ll, mfd + 1); | ||
250 | |||
251 | if (!cpu_is_mx1() && !cpu_is_mx21() && mfn >= 0x200) | ||
252 | ll = -ll; | ||
253 | |||
254 | ll = (freq * mfi) + ll; | ||
255 | |||
256 | return ll; | ||
257 | } | ||
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c index 73db34bf588a..b5b6f8083130 100644 --- a/arch/arm/plat-mxc/cpufreq.c +++ b/arch/arm/plat-mxc/cpufreq.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/err.h> | 23 | #include <linux/err.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | #include <mach/clock.h> | ||
27 | 26 | ||
28 | #define CLK32_FREQ 32768 | 27 | #define CLK32_FREQ 32768 |
29 | #define NANOSECOND (1000 * 1000 * 1000) | 28 | #define NANOSECOND (1000 * 1000 * 1000) |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c index 2020d84956c3..d390f00bd294 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-uart.c +++ b/arch/arm/plat-mxc/devices/platform-imx-uart.c | |||
@@ -87,7 +87,7 @@ const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst = { | |||
87 | #ifdef CONFIG_SOC_IMX35 | 87 | #ifdef CONFIG_SOC_IMX35 |
88 | const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = { | 88 | const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = { |
89 | #define imx35_imx_uart_data_entry(_id, _hwid) \ | 89 | #define imx35_imx_uart_data_entry(_id, _hwid) \ |
90 | imx_imx_uart_1irq_data_entry(MX31, _id, _hwid, SZ_16K) | 90 | imx_imx_uart_1irq_data_entry(MX35, _id, _hwid, SZ_16K) |
91 | imx35_imx_uart_data_entry(0, 1), | 91 | imx35_imx_uart_data_entry(0, 1), |
92 | imx35_imx_uart_data_entry(1, 2), | 92 | imx35_imx_uart_data_entry(1, 2), |
93 | imx35_imx_uart_data_entry(2, 3), | 93 | imx35_imx_uart_data_entry(2, 3), |
diff --git a/arch/arm/plat-mxc/include/mach/clock.h b/arch/arm/plat-mxc/include/mach/clock.h deleted file mode 100644 index bd940c795cbb..000000000000 --- a/arch/arm/plat-mxc/include/mach/clock.h +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __ASM_ARCH_MXC_CLOCK_H__ | ||
21 | #define __ASM_ARCH_MXC_CLOCK_H__ | ||
22 | |||
23 | #ifndef __ASSEMBLY__ | ||
24 | #include <linux/list.h> | ||
25 | |||
26 | #ifndef CONFIG_COMMON_CLK | ||
27 | struct module; | ||
28 | |||
29 | struct clk { | ||
30 | int id; | ||
31 | /* Source clock this clk depends on */ | ||
32 | struct clk *parent; | ||
33 | /* Secondary clock to enable/disable with this clock */ | ||
34 | struct clk *secondary; | ||
35 | /* Reference count of clock enable/disable */ | ||
36 | __s8 usecount; | ||
37 | /* Register bit position for clock's enable/disable control. */ | ||
38 | u8 enable_shift; | ||
39 | /* Register address for clock's enable/disable control. */ | ||
40 | void __iomem *enable_reg; | ||
41 | u32 flags; | ||
42 | /* get the current clock rate (always a fresh value) */ | ||
43 | unsigned long (*get_rate) (struct clk *); | ||
44 | /* Function ptr to set the clock to a new rate. The rate must match a | ||
45 | supported rate returned from round_rate. Leave blank if clock is not | ||
46 | programmable */ | ||
47 | int (*set_rate) (struct clk *, unsigned long); | ||
48 | /* Function ptr to round the requested clock rate to the nearest | ||
49 | supported rate that is less than or equal to the requested rate. */ | ||
50 | unsigned long (*round_rate) (struct clk *, unsigned long); | ||
51 | /* Function ptr to enable the clock. Leave blank if clock can not | ||
52 | be gated. */ | ||
53 | int (*enable) (struct clk *); | ||
54 | /* Function ptr to disable the clock. Leave blank if clock can not | ||
55 | be gated. */ | ||
56 | void (*disable) (struct clk *); | ||
57 | /* Function ptr to set the parent clock of the clock. */ | ||
58 | int (*set_parent) (struct clk *, struct clk *); | ||
59 | }; | ||
60 | |||
61 | int clk_register(struct clk *clk); | ||
62 | void clk_unregister(struct clk *clk); | ||
63 | #endif /* CONFIG_COMMON_CLK */ | ||
64 | |||
65 | extern spinlock_t imx_ccm_lock; | ||
66 | |||
67 | unsigned long mxc_decode_pll(unsigned int pll, u32 f_ref); | ||
68 | |||
69 | #endif /* __ASSEMBLY__ */ | ||
70 | #endif /* __ASM_ARCH_MXC_CLOCK_H__ */ | ||
diff --git a/arch/arm/plat-mxc/include/mach/mx2_cam.h b/arch/arm/plat-mxc/include/mach/mx2_cam.h index 3c080a32dbf5..7ded6f1f74bc 100644 --- a/arch/arm/plat-mxc/include/mach/mx2_cam.h +++ b/arch/arm/plat-mxc/include/mach/mx2_cam.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #ifndef __MACH_MX2_CAM_H_ | 23 | #ifndef __MACH_MX2_CAM_H_ |
24 | #define __MACH_MX2_CAM_H_ | 24 | #define __MACH_MX2_CAM_H_ |
25 | 25 | ||
26 | #define MX2_CAMERA_SWAP16 (1 << 0) | ||
27 | #define MX2_CAMERA_EXT_VSYNC (1 << 1) | 26 | #define MX2_CAMERA_EXT_VSYNC (1 << 1) |
28 | #define MX2_CAMERA_CCIR (1 << 2) | 27 | #define MX2_CAMERA_CCIR (1 << 2) |
29 | #define MX2_CAMERA_CCIR_INTERLACE (1 << 3) | 28 | #define MX2_CAMERA_CCIR_INTERLACE (1 << 3) |
@@ -31,7 +30,6 @@ | |||
31 | #define MX2_CAMERA_GATED_CLOCK (1 << 5) | 30 | #define MX2_CAMERA_GATED_CLOCK (1 << 5) |
32 | #define MX2_CAMERA_INV_DATA (1 << 6) | 31 | #define MX2_CAMERA_INV_DATA (1 << 6) |
33 | #define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7) | 32 | #define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7) |
34 | #define MX2_CAMERA_PACK_DIR_MSB (1 << 8) | ||
35 | 33 | ||
36 | /** | 34 | /** |
37 | * struct mx2_camera_platform_data - optional platform data for mx2_camera | 35 | * struct mx2_camera_platform_data - optional platform data for mx2_camera |
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h index dbced61d9fda..ee9b1f9215df 100644 --- a/arch/arm/plat-mxc/include/mach/mx31.h +++ b/arch/arm/plat-mxc/include/mach/mx31.h | |||
@@ -76,7 +76,7 @@ | |||
76 | #define MX31_RTIC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xec000) | 76 | #define MX31_RTIC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xec000) |
77 | 77 | ||
78 | #define MX31_ROMP_BASE_ADDR 0x60000000 | 78 | #define MX31_ROMP_BASE_ADDR 0x60000000 |
79 | #define MX31_ROMP_BASE_ADDR_VIRT 0xfc500000 | 79 | #define MX31_ROMP_BASE_ADDR_VIRT IOMEM(0xfc500000) |
80 | #define MX31_ROMP_SIZE SZ_1M | 80 | #define MX31_ROMP_SIZE SZ_1M |
81 | 81 | ||
82 | #define MX31_AVIC_BASE_ADDR 0x68000000 | 82 | #define MX31_AVIC_BASE_ADDR 0x68000000 |
@@ -92,11 +92,11 @@ | |||
92 | #define MX31_CS3_BASE_ADDR 0xb2000000 | 92 | #define MX31_CS3_BASE_ADDR 0xb2000000 |
93 | 93 | ||
94 | #define MX31_CS4_BASE_ADDR 0xb4000000 | 94 | #define MX31_CS4_BASE_ADDR 0xb4000000 |
95 | #define MX31_CS4_BASE_ADDR_VIRT 0xf6000000 | 95 | #define MX31_CS4_BASE_ADDR_VIRT IOMEM(0xf6000000) |
96 | #define MX31_CS4_SIZE SZ_32M | 96 | #define MX31_CS4_SIZE SZ_32M |
97 | 97 | ||
98 | #define MX31_CS5_BASE_ADDR 0xb6000000 | 98 | #define MX31_CS5_BASE_ADDR 0xb6000000 |
99 | #define MX31_CS5_BASE_ADDR_VIRT 0xf8000000 | 99 | #define MX31_CS5_BASE_ADDR_VIRT IOMEM(0xf8000000) |
100 | #define MX31_CS5_SIZE SZ_32M | 100 | #define MX31_CS5_SIZE SZ_32M |
101 | 101 | ||
102 | #define MX31_X_MEMC_BASE_ADDR 0xb8000000 | 102 | #define MX31_X_MEMC_BASE_ADDR 0xb8000000 |
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c index 1996c3e3b8fe..3da78cfc5a94 100644 --- a/arch/arm/plat-mxc/system.c +++ b/arch/arm/plat-mxc/system.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/err.h> | 22 | #include <linux/err.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/module.h> | ||
25 | 24 | ||
26 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
27 | #include <mach/common.h> | 26 | #include <mach/common.h> |
@@ -29,9 +28,6 @@ | |||
29 | #include <asm/proc-fns.h> | 28 | #include <asm/proc-fns.h> |
30 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
31 | 30 | ||
32 | void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int) = NULL; | ||
33 | EXPORT_SYMBOL_GPL(imx_ioremap); | ||
34 | |||
35 | static void __iomem *wdog_base; | 31 | static void __iomem *wdog_base; |
36 | 32 | ||
37 | /* | 33 | /* |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index dd36eba9506c..d15a4a6d6146 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -25,6 +25,7 @@ config ARCH_OMAP2PLUS | |||
25 | bool "TI OMAP2/3/4" | 25 | bool "TI OMAP2/3/4" |
26 | select CLKDEV_LOOKUP | 26 | select CLKDEV_LOOKUP |
27 | select GENERIC_IRQ_CHIP | 27 | select GENERIC_IRQ_CHIP |
28 | select SPARSE_IRQ | ||
28 | select OMAP_DM_TIMER | 29 | select OMAP_DM_TIMER |
29 | select USE_OF | 30 | select USE_OF |
30 | select PROC_DEVICETREE if PROC_FS | 31 | select PROC_DEVICETREE if PROC_FS |
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index 961bf859bc0c..dacaee009a4e 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile | |||
@@ -3,8 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := common.o sram.o clock.o devices.o dma.o mux.o \ | 6 | obj-y := common.o sram.o clock.o dma.o fb.o counter_32k.o |
7 | fb.o counter_32k.o | ||
8 | obj-m := | 7 | obj-m := |
9 | obj-n := | 8 | obj-n := |
10 | obj- := | 9 | obj- := |
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index 89a3723b3538..111315a69354 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c | |||
@@ -17,52 +17,12 @@ | |||
17 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
18 | 18 | ||
19 | #include <plat/common.h> | 19 | #include <plat/common.h> |
20 | #include <plat/board.h> | ||
21 | #include <plat/vram.h> | 20 | #include <plat/vram.h> |
22 | #include <plat/dsp.h> | 21 | #include <linux/platform_data/dsp-omap.h> |
23 | #include <plat/dma.h> | 22 | #include <plat/dma.h> |
24 | 23 | ||
25 | #include <plat/omap-secure.h> | 24 | #include <plat/omap-secure.h> |
26 | 25 | ||
27 | |||
28 | #define NO_LENGTH_CHECK 0xffffffff | ||
29 | |||
30 | struct omap_board_config_kernel *omap_board_config __initdata; | ||
31 | int omap_board_config_size; | ||
32 | |||
33 | static const void *__init get_config(u16 tag, size_t len, | ||
34 | int skip, size_t *len_out) | ||
35 | { | ||
36 | struct omap_board_config_kernel *kinfo = NULL; | ||
37 | int i; | ||
38 | |||
39 | /* Try to find the config from the board-specific structures | ||
40 | * in the kernel. */ | ||
41 | for (i = 0; i < omap_board_config_size; i++) { | ||
42 | if (omap_board_config[i].tag == tag) { | ||
43 | if (skip == 0) { | ||
44 | kinfo = &omap_board_config[i]; | ||
45 | break; | ||
46 | } else { | ||
47 | skip--; | ||
48 | } | ||
49 | } | ||
50 | } | ||
51 | if (kinfo == NULL) | ||
52 | return NULL; | ||
53 | return kinfo->data; | ||
54 | } | ||
55 | |||
56 | const void *__init __omap_get_config(u16 tag, size_t len, int nr) | ||
57 | { | ||
58 | return get_config(tag, len, nr, NULL); | ||
59 | } | ||
60 | |||
61 | const void *__init omap_get_var_config(u16 tag, size_t *len) | ||
62 | { | ||
63 | return get_config(tag, NO_LENGTH_CHECK, 0, len); | ||
64 | } | ||
65 | |||
66 | void __init omap_reserve(void) | 26 | void __init omap_reserve(void) |
67 | { | 27 | { |
68 | omap_vram_reserve_sdram_memblock(); | 28 | omap_vram_reserve_sdram_memblock(); |
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c index dbf1e03029a5..2e826f1faf7b 100644 --- a/arch/arm/plat-omap/counter_32k.c +++ b/arch/arm/plat-omap/counter_32k.c | |||
@@ -22,10 +22,7 @@ | |||
22 | #include <asm/mach/time.h> | 22 | #include <asm/mach/time.h> |
23 | #include <asm/sched_clock.h> | 23 | #include <asm/sched_clock.h> |
24 | 24 | ||
25 | #include <plat/hardware.h> | ||
26 | #include <plat/common.h> | 25 | #include <plat/common.h> |
27 | #include <plat/board.h> | ||
28 | |||
29 | #include <plat/clock.h> | 26 | #include <plat/clock.h> |
30 | 27 | ||
31 | /* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */ | 28 | /* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */ |
diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c index caa1f7b6cc21..c7a4c0902b38 100644 --- a/arch/arm/plat-omap/debug-devices.c +++ b/arch/arm/plat-omap/debug-devices.c | |||
@@ -17,9 +17,6 @@ | |||
17 | 17 | ||
18 | #include <mach/hardware.h> | 18 | #include <mach/hardware.h> |
19 | 19 | ||
20 | #include <plat/board.h> | ||
21 | |||
22 | |||
23 | /* Many OMAP development platforms reuse the same "debug board"; these | 20 | /* Many OMAP development platforms reuse the same "debug board"; these |
24 | * platforms include H2, H3, H4, and Perseus2. | 21 | * platforms include H2, H3, H4, and Perseus2. |
25 | */ | 22 | */ |
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c index 39407cbe34c6..195aaae65872 100644 --- a/arch/arm/plat-omap/debug-leds.c +++ b/arch/arm/plat-omap/debug-leds.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/platform_data/gpio-omap.h> | ||
15 | 16 | ||
16 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
17 | #include <asm/leds.h> | 18 | #include <asm/leds.h> |
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c deleted file mode 100644 index 1cba9273d2cb..000000000000 --- a/arch/arm/plat-omap/devices.c +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-omap/devices.c | ||
3 | * | ||
4 | * Common platform device setup/initialization for OMAP1 and OMAP2 | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | #include <linux/gpio.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/io.h> | ||
17 | #include <linux/slab.h> | ||
18 | #include <linux/memblock.h> | ||
19 | |||
20 | #include <mach/hardware.h> | ||
21 | #include <asm/mach-types.h> | ||
22 | #include <asm/mach/map.h> | ||
23 | #include <asm/memblock.h> | ||
24 | |||
25 | #include <plat/tc.h> | ||
26 | #include <plat/board.h> | ||
27 | #include <plat/mmc.h> | ||
28 | #include <plat/menelaus.h> | ||
29 | #include <plat/omap44xx.h> | ||
30 | |||
31 | /*-------------------------------------------------------------------------*/ | ||
32 | |||
33 | #if defined(CONFIG_HW_RANDOM_OMAP) || defined(CONFIG_HW_RANDOM_OMAP_MODULE) | ||
34 | |||
35 | #ifdef CONFIG_ARCH_OMAP2 | ||
36 | #define OMAP_RNG_BASE 0x480A0000 | ||
37 | #else | ||
38 | #define OMAP_RNG_BASE 0xfffe5000 | ||
39 | #endif | ||
40 | |||
41 | static struct resource rng_resources[] = { | ||
42 | { | ||
43 | .start = OMAP_RNG_BASE, | ||
44 | .end = OMAP_RNG_BASE + 0x4f, | ||
45 | .flags = IORESOURCE_MEM, | ||
46 | }, | ||
47 | }; | ||
48 | |||
49 | static struct platform_device omap_rng_device = { | ||
50 | .name = "omap_rng", | ||
51 | .id = -1, | ||
52 | .num_resources = ARRAY_SIZE(rng_resources), | ||
53 | .resource = rng_resources, | ||
54 | }; | ||
55 | |||
56 | static void omap_init_rng(void) | ||
57 | { | ||
58 | (void) platform_device_register(&omap_rng_device); | ||
59 | } | ||
60 | #else | ||
61 | static inline void omap_init_rng(void) {} | ||
62 | #endif | ||
63 | |||
64 | /* | ||
65 | * This gets called after board-specific INIT_MACHINE, and initializes most | ||
66 | * on-chip peripherals accessible on this board (except for few like USB): | ||
67 | * | ||
68 | * (a) Does any "standard config" pin muxing needed. Board-specific | ||
69 | * code will have muxed GPIO pins and done "nonstandard" setup; | ||
70 | * that code could live in the boot loader. | ||
71 | * (b) Populating board-specific platform_data with the data drivers | ||
72 | * rely on to handle wiring variations. | ||
73 | * (c) Creating platform devices as meaningful on this board and | ||
74 | * with this kernel configuration. | ||
75 | * | ||
76 | * Claiming GPIOs, and setting their direction and initial values, is the | ||
77 | * responsibility of the device drivers. So is responding to probe(). | ||
78 | * | ||
79 | * Board-specific knowledge like creating devices or pin setup is to be | ||
80 | * kept out of drivers as much as possible. In particular, pin setup | ||
81 | * may be handled by the boot loader, and drivers should expect it will | ||
82 | * normally have been done by the time they're probed. | ||
83 | */ | ||
84 | static int __init omap_init_devices(void) | ||
85 | { | ||
86 | /* please keep these calls, and their implementations above, | ||
87 | * in alphabetical order so they're easier to sort through. | ||
88 | */ | ||
89 | omap_init_rng(); | ||
90 | return 0; | ||
91 | } | ||
92 | arch_initcall(omap_init_devices); | ||
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 7fe626761e53..c76ed8bff838 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -36,9 +36,8 @@ | |||
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | 38 | ||
39 | #include <mach/hardware.h> | 39 | #include <plat/cpu.h> |
40 | #include <plat/dma.h> | 40 | #include <plat/dma.h> |
41 | |||
42 | #include <plat/tc.h> | 41 | #include <plat/tc.h> |
43 | 42 | ||
44 | /* | 43 | /* |
@@ -969,8 +968,7 @@ void omap_stop_dma(int lch) | |||
969 | l = p->dma_read(CCR, lch); | 968 | l = p->dma_read(CCR, lch); |
970 | } | 969 | } |
971 | if (i >= 100) | 970 | if (i >= 100) |
972 | printk(KERN_ERR "DMA drain did not complete on " | 971 | pr_err("DMA drain did not complete on lch %d\n", lch); |
973 | "lch %d\n", lch); | ||
974 | /* Restore OCP_SYSCONFIG */ | 972 | /* Restore OCP_SYSCONFIG */ |
975 | p->dma_write(sys_cf, OCP_SYSCONFIG, lch); | 973 | p->dma_write(sys_cf, OCP_SYSCONFIG, lch); |
976 | } else { | 974 | } else { |
@@ -1154,8 +1152,7 @@ void omap_dma_link_lch(int lch_head, int lch_queue) | |||
1154 | 1152 | ||
1155 | if ((dma_chan[lch_head].dev_id == -1) || | 1153 | if ((dma_chan[lch_head].dev_id == -1) || |
1156 | (dma_chan[lch_queue].dev_id == -1)) { | 1154 | (dma_chan[lch_queue].dev_id == -1)) { |
1157 | printk(KERN_ERR "omap_dma: trying to link " | 1155 | pr_err("omap_dma: trying to link non requested channels\n"); |
1158 | "non requested channels\n"); | ||
1159 | dump_stack(); | 1156 | dump_stack(); |
1160 | } | 1157 | } |
1161 | 1158 | ||
@@ -1181,15 +1178,13 @@ void omap_dma_unlink_lch(int lch_head, int lch_queue) | |||
1181 | 1178 | ||
1182 | if (dma_chan[lch_head].next_lch != lch_queue || | 1179 | if (dma_chan[lch_head].next_lch != lch_queue || |
1183 | dma_chan[lch_head].next_lch == -1) { | 1180 | dma_chan[lch_head].next_lch == -1) { |
1184 | printk(KERN_ERR "omap_dma: trying to unlink " | 1181 | pr_err("omap_dma: trying to unlink non linked channels\n"); |
1185 | "non linked channels\n"); | ||
1186 | dump_stack(); | 1182 | dump_stack(); |
1187 | } | 1183 | } |
1188 | 1184 | ||
1189 | if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) || | 1185 | if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) || |
1190 | (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) { | 1186 | (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) { |
1191 | printk(KERN_ERR "omap_dma: You need to stop the DMA channels " | 1187 | pr_err("omap_dma: You need to stop the DMA channels before unlinking\n"); |
1192 | "before unlinking\n"); | ||
1193 | dump_stack(); | 1188 | dump_stack(); |
1194 | } | 1189 | } |
1195 | 1190 | ||
@@ -1831,16 +1826,15 @@ static int omap1_dma_handle_ch(int ch) | |||
1831 | if ((csr & 0x3f) == 0) | 1826 | if ((csr & 0x3f) == 0) |
1832 | return 0; | 1827 | return 0; |
1833 | if (unlikely(dma_chan[ch].dev_id == -1)) { | 1828 | if (unlikely(dma_chan[ch].dev_id == -1)) { |
1834 | printk(KERN_WARNING "Spurious interrupt from DMA channel " | 1829 | pr_warn("Spurious interrupt from DMA channel %d (CSR %04x)\n", |
1835 | "%d (CSR %04x)\n", ch, csr); | 1830 | ch, csr); |
1836 | return 0; | 1831 | return 0; |
1837 | } | 1832 | } |
1838 | if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) | 1833 | if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) |
1839 | printk(KERN_WARNING "DMA timeout with device %d\n", | 1834 | pr_warn("DMA timeout with device %d\n", dma_chan[ch].dev_id); |
1840 | dma_chan[ch].dev_id); | ||
1841 | if (unlikely(csr & OMAP_DMA_DROP_IRQ)) | 1835 | if (unlikely(csr & OMAP_DMA_DROP_IRQ)) |
1842 | printk(KERN_WARNING "DMA synchronization event drop occurred " | 1836 | pr_warn("DMA synchronization event drop occurred with device %d\n", |
1843 | "with device %d\n", dma_chan[ch].dev_id); | 1837 | dma_chan[ch].dev_id); |
1844 | if (likely(csr & OMAP_DMA_BLOCK_IRQ)) | 1838 | if (likely(csr & OMAP_DMA_BLOCK_IRQ)) |
1845 | dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; | 1839 | dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; |
1846 | if (likely(dma_chan[ch].callback != NULL)) | 1840 | if (likely(dma_chan[ch].callback != NULL)) |
@@ -1880,21 +1874,19 @@ static int omap2_dma_handle_ch(int ch) | |||
1880 | 1874 | ||
1881 | if (!status) { | 1875 | if (!status) { |
1882 | if (printk_ratelimit()) | 1876 | if (printk_ratelimit()) |
1883 | printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", | 1877 | pr_warn("Spurious DMA IRQ for lch %d\n", ch); |
1884 | ch); | ||
1885 | p->dma_write(1 << ch, IRQSTATUS_L0, ch); | 1878 | p->dma_write(1 << ch, IRQSTATUS_L0, ch); |
1886 | return 0; | 1879 | return 0; |
1887 | } | 1880 | } |
1888 | if (unlikely(dma_chan[ch].dev_id == -1)) { | 1881 | if (unlikely(dma_chan[ch].dev_id == -1)) { |
1889 | if (printk_ratelimit()) | 1882 | if (printk_ratelimit()) |
1890 | printk(KERN_WARNING "IRQ %04x for non-allocated DMA" | 1883 | pr_warn("IRQ %04x for non-allocated DMA channel %d\n", |
1891 | "channel %d\n", status, ch); | 1884 | status, ch); |
1892 | return 0; | 1885 | return 0; |
1893 | } | 1886 | } |
1894 | if (unlikely(status & OMAP_DMA_DROP_IRQ)) | 1887 | if (unlikely(status & OMAP_DMA_DROP_IRQ)) |
1895 | printk(KERN_INFO | 1888 | pr_info("DMA synchronization event drop occurred with device %d\n", |
1896 | "DMA synchronization event drop occurred with device " | 1889 | dma_chan[ch].dev_id); |
1897 | "%d\n", dma_chan[ch].dev_id); | ||
1898 | if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { | 1890 | if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { |
1899 | printk(KERN_INFO "DMA transaction error with device %d\n", | 1891 | printk(KERN_INFO "DMA transaction error with device %d\n", |
1900 | dma_chan[ch].dev_id); | 1892 | dma_chan[ch].dev_id); |
@@ -2014,8 +2006,9 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2014 | 2006 | ||
2015 | p = pdev->dev.platform_data; | 2007 | p = pdev->dev.platform_data; |
2016 | if (!p) { | 2008 | if (!p) { |
2017 | dev_err(&pdev->dev, "%s: System DMA initialized without" | 2009 | dev_err(&pdev->dev, |
2018 | "platform data\n", __func__); | 2010 | "%s: System DMA initialized without platform data\n", |
2011 | __func__); | ||
2019 | return -EINVAL; | 2012 | return -EINVAL; |
2020 | } | 2013 | } |
2021 | 2014 | ||
@@ -2090,8 +2083,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2090 | } | 2083 | } |
2091 | ret = setup_irq(dma_irq, &omap24xx_dma_irq); | 2084 | ret = setup_irq(dma_irq, &omap24xx_dma_irq); |
2092 | if (ret) { | 2085 | if (ret) { |
2093 | dev_err(&pdev->dev, "set_up failed for IRQ %d" | 2086 | dev_err(&pdev->dev, "set_up failed for IRQ %d for DMA (error %d)\n", |
2094 | "for DMA (error %d)\n", dma_irq, ret); | 2087 | dma_irq, ret); |
2095 | goto exit_dma_lch_fail; | 2088 | goto exit_dma_lch_fail; |
2096 | } | 2089 | } |
2097 | } | 2090 | } |
@@ -2099,8 +2092,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2099 | /* reserve dma channels 0 and 1 in high security devices */ | 2092 | /* reserve dma channels 0 and 1 in high security devices */ |
2100 | if (cpu_is_omap34xx() && | 2093 | if (cpu_is_omap34xx() && |
2101 | (omap_type() != OMAP2_DEVICE_TYPE_GP)) { | 2094 | (omap_type() != OMAP2_DEVICE_TYPE_GP)) { |
2102 | printk(KERN_INFO "Reserving DMA channels 0 and 1 for " | 2095 | pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n"); |
2103 | "HS ROM code\n"); | ||
2104 | dma_chan[0].dev_id = 0; | 2096 | dma_chan[0].dev_id = 0; |
2105 | dma_chan[1].dev_id = 1; | 2097 | dma_chan[1].dev_id = 1; |
2106 | } | 2098 | } |
@@ -2108,8 +2100,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2108 | return 0; | 2100 | return 0; |
2109 | 2101 | ||
2110 | exit_dma_irq_fail: | 2102 | exit_dma_irq_fail: |
2111 | dev_err(&pdev->dev, "unable to request IRQ %d" | 2103 | dev_err(&pdev->dev, "unable to request IRQ %d for DMA (error %d)\n", |
2112 | "for DMA (error %d)\n", dma_irq, ret); | 2104 | dma_irq, ret); |
2113 | for (irq_rel = 0; irq_rel < ch; irq_rel++) { | 2105 | for (irq_rel = 0; irq_rel < ch; irq_rel++) { |
2114 | dma_irq = platform_get_irq(pdev, irq_rel); | 2106 | dma_irq = platform_get_irq(pdev, irq_rel); |
2115 | free_irq(dma_irq, (void *)(irq_rel + 1)); | 2107 | free_irq(dma_irq, (void *)(irq_rel + 1)); |
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c index dd6f92c99e56..bcbb9d5dc293 100644 --- a/arch/arm/plat-omap/fb.c +++ b/arch/arm/plat-omap/fb.c | |||
@@ -33,8 +33,6 @@ | |||
33 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
34 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
35 | 35 | ||
36 | #include <plat/board.h> | ||
37 | |||
38 | #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) | 36 | #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) |
39 | 37 | ||
40 | static bool omapfb_lcd_configured; | 38 | static bool omapfb_lcd_configured; |
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c index db071bc71c4d..6013831a043e 100644 --- a/arch/arm/plat-omap/i2c.c +++ b/arch/arm/plat-omap/i2c.c | |||
@@ -32,13 +32,13 @@ | |||
32 | #include <linux/clk.h> | 32 | #include <linux/clk.h> |
33 | 33 | ||
34 | #include <mach/irqs.h> | 34 | #include <mach/irqs.h> |
35 | #include <plat/mux.h> | ||
36 | #include <plat/i2c.h> | 35 | #include <plat/i2c.h> |
37 | #include <plat/omap-pm.h> | 36 | #include <plat/omap-pm.h> |
38 | #include <plat/omap_device.h> | 37 | #include <plat/omap_device.h> |
39 | 38 | ||
40 | #define OMAP_I2C_SIZE 0x3f | 39 | #define OMAP_I2C_SIZE 0x3f |
41 | #define OMAP1_I2C_BASE 0xfffb3800 | 40 | #define OMAP1_I2C_BASE 0xfffb3800 |
41 | #define OMAP1_INT_I2C (32 + 4) | ||
42 | 42 | ||
43 | static const char name[] = "omap_i2c"; | 43 | static const char name[] = "omap_i2c"; |
44 | 44 | ||
@@ -105,7 +105,7 @@ static inline int omap1_i2c_add_bus(int bus_id) | |||
105 | res = pdev->resource; | 105 | res = pdev->resource; |
106 | res[0].start = OMAP1_I2C_BASE; | 106 | res[0].start = OMAP1_I2C_BASE; |
107 | res[0].end = res[0].start + OMAP_I2C_SIZE; | 107 | res[0].end = res[0].start + OMAP_I2C_SIZE; |
108 | res[1].start = INT_I2C; | 108 | res[1].start = OMAP1_INT_I2C; |
109 | pdata = &i2c_pdata[bus_id - 1]; | 109 | pdata = &i2c_pdata[bus_id - 1]; |
110 | 110 | ||
111 | /* all OMAP1 have IP version 1 register set */ | 111 | /* all OMAP1 have IP version 1 register set */ |
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h deleted file mode 100644 index e62f20a5c0af..000000000000 --- a/arch/arm/plat-omap/include/plat/board.h +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/board.h | ||
3 | * | ||
4 | * Information structures for board-specific data | ||
5 | * | ||
6 | * Copyright (C) 2004 Nokia Corporation | ||
7 | * Written by Juha Yrjölä <juha.yrjola@nokia.com> | ||
8 | */ | ||
9 | |||
10 | #ifndef _OMAP_BOARD_H | ||
11 | #define _OMAP_BOARD_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | |||
15 | #include <plat/gpio-switch.h> | ||
16 | |||
17 | /* | ||
18 | * OMAP35x EVM revision | ||
19 | * Run time detection of EVM revision is done by reading Ethernet | ||
20 | * PHY ID - | ||
21 | * GEN_1 = 0x01150000 | ||
22 | * GEN_2 = 0x92200000 | ||
23 | */ | ||
24 | enum { | ||
25 | OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */ | ||
26 | OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */ | ||
27 | }; | ||
28 | |||
29 | /* Different peripheral ids */ | ||
30 | #define OMAP_TAG_CLOCK 0x4f01 | ||
31 | #define OMAP_TAG_GPIO_SWITCH 0x4f06 | ||
32 | #define OMAP_TAG_STI_CONSOLE 0x4f09 | ||
33 | #define OMAP_TAG_CAMERA_SENSOR 0x4f0a | ||
34 | |||
35 | #define OMAP_TAG_BOOT_REASON 0x4f80 | ||
36 | #define OMAP_TAG_FLASH_PART 0x4f81 | ||
37 | #define OMAP_TAG_VERSION_STR 0x4f82 | ||
38 | |||
39 | struct omap_clock_config { | ||
40 | /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */ | ||
41 | u8 system_clock_type; | ||
42 | }; | ||
43 | |||
44 | struct omap_serial_console_config { | ||
45 | u8 console_uart; | ||
46 | u32 console_speed; | ||
47 | }; | ||
48 | |||
49 | struct omap_sti_console_config { | ||
50 | unsigned enable:1; | ||
51 | u8 channel; | ||
52 | }; | ||
53 | |||
54 | struct omap_camera_sensor_config { | ||
55 | u16 reset_gpio; | ||
56 | int (*power_on)(void * data); | ||
57 | int (*power_off)(void * data); | ||
58 | }; | ||
59 | |||
60 | struct omap_lcd_config { | ||
61 | char panel_name[16]; | ||
62 | char ctrl_name[16]; | ||
63 | s16 nreset_gpio; | ||
64 | u8 data_lines; | ||
65 | }; | ||
66 | |||
67 | struct device; | ||
68 | struct fb_info; | ||
69 | struct omap_backlight_config { | ||
70 | int default_intensity; | ||
71 | int (*set_power)(struct device *dev, int state); | ||
72 | }; | ||
73 | |||
74 | struct omap_fbmem_config { | ||
75 | u32 start; | ||
76 | u32 size; | ||
77 | }; | ||
78 | |||
79 | struct omap_pwm_led_platform_data { | ||
80 | const char *name; | ||
81 | int intensity_timer; | ||
82 | int blink_timer; | ||
83 | void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off); | ||
84 | }; | ||
85 | |||
86 | struct omap_uart_config { | ||
87 | /* Bit field of UARTs present; bit 0 --> UART1 */ | ||
88 | unsigned int enabled_uarts; | ||
89 | }; | ||
90 | |||
91 | |||
92 | struct omap_flash_part_config { | ||
93 | char part_table[0]; | ||
94 | }; | ||
95 | |||
96 | struct omap_boot_reason_config { | ||
97 | char reason_str[12]; | ||
98 | }; | ||
99 | |||
100 | struct omap_version_config { | ||
101 | char component[12]; | ||
102 | char version[12]; | ||
103 | }; | ||
104 | |||
105 | struct omap_board_config_entry { | ||
106 | u16 tag; | ||
107 | u16 len; | ||
108 | u8 data[0]; | ||
109 | }; | ||
110 | |||
111 | struct omap_board_config_kernel { | ||
112 | u16 tag; | ||
113 | const void *data; | ||
114 | }; | ||
115 | |||
116 | extern const void *__init __omap_get_config(u16 tag, size_t len, int nr); | ||
117 | |||
118 | #define omap_get_config(tag, type) \ | ||
119 | ((const type *) __omap_get_config((tag), sizeof(type), 0)) | ||
120 | #define omap_get_nr_config(tag, type, nr) \ | ||
121 | ((const type *) __omap_get_config((tag), sizeof(type), (nr))) | ||
122 | |||
123 | extern const void *__init omap_get_var_config(u16 tag, size_t *len); | ||
124 | |||
125 | extern struct omap_board_config_kernel *omap_board_config; | ||
126 | extern int omap_board_config_size; | ||
127 | |||
128 | |||
129 | /* for TI reference platforms sharing the same debug card */ | ||
130 | extern int debug_card_init(u32 addr, unsigned gpio); | ||
131 | |||
132 | /* OMAP3EVM revision */ | ||
133 | #if defined(CONFIG_MACH_OMAP3EVM) | ||
134 | u8 get_omap3_evm_rev(void); | ||
135 | #else | ||
136 | #define get_omap3_evm_rev() (-EINVAL) | ||
137 | #endif | ||
138 | #endif | ||
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index bb5d08a70dbc..67da857783ce 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #ifndef __ASM_ARCH_OMAP_CPU_H | 30 | #ifndef __ASM_ARCH_OMAP_CPU_H |
31 | #define __ASM_ARCH_OMAP_CPU_H | 31 | #define __ASM_ARCH_OMAP_CPU_H |
32 | 32 | ||
33 | #ifndef __ASSEMBLY__ | ||
34 | |||
33 | #include <linux/bitops.h> | 35 | #include <linux/bitops.h> |
34 | #include <plat/multi.h> | 36 | #include <plat/multi.h> |
35 | 37 | ||
@@ -493,4 +495,5 @@ OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ) | |||
493 | OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ) | 495 | OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ) |
494 | OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ) | 496 | OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ) |
495 | 497 | ||
498 | #endif /* __ASSEMBLY__ */ | ||
496 | #endif | 499 | #endif |
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h index c5811d4409b0..0a87b052f8f7 100644 --- a/arch/arm/plat-omap/include/plat/dma.h +++ b/arch/arm/plat-omap/include/plat/dma.h | |||
@@ -31,6 +31,8 @@ | |||
31 | /* Move omap4 specific defines to dma-44xx.h */ | 31 | /* Move omap4 specific defines to dma-44xx.h */ |
32 | #include "dma-44xx.h" | 32 | #include "dma-44xx.h" |
33 | 33 | ||
34 | #define INT_DMA_LCD 25 | ||
35 | |||
34 | /* DMA channels for omap1 */ | 36 | /* DMA channels for omap1 */ |
35 | #define OMAP_DMA_NO_DEVICE 0 | 37 | #define OMAP_DMA_NO_DEVICE 0 |
36 | #define OMAP_DMA_MCSI1_TX 1 | 38 | #define OMAP_DMA_MCSI1_TX 1 |
diff --git a/arch/arm/plat-omap/include/plat/gpio-switch.h b/arch/arm/plat-omap/include/plat/gpio-switch.h deleted file mode 100644 index 10da0e07c0cf..000000000000 --- a/arch/arm/plat-omap/include/plat/gpio-switch.h +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* | ||
2 | * GPIO switch definitions | ||
3 | * | ||
4 | * Copyright (C) 2006 Nokia Corporation | ||
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 __ASM_ARCH_OMAP_GPIO_SWITCH_H | ||
12 | #define __ASM_ARCH_OMAP_GPIO_SWITCH_H | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | |||
16 | /* Cover: | ||
17 | * high -> closed | ||
18 | * low -> open | ||
19 | * Connection: | ||
20 | * high -> connected | ||
21 | * low -> disconnected | ||
22 | * Activity: | ||
23 | * high -> active | ||
24 | * low -> inactive | ||
25 | * | ||
26 | */ | ||
27 | #define OMAP_GPIO_SWITCH_TYPE_COVER 0x0000 | ||
28 | #define OMAP_GPIO_SWITCH_TYPE_CONNECTION 0x0001 | ||
29 | #define OMAP_GPIO_SWITCH_TYPE_ACTIVITY 0x0002 | ||
30 | #define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001 | ||
31 | #define OMAP_GPIO_SWITCH_FLAG_OUTPUT 0x0002 | ||
32 | |||
33 | struct omap_gpio_switch { | ||
34 | const char *name; | ||
35 | s16 gpio; | ||
36 | unsigned flags:4; | ||
37 | unsigned type:4; | ||
38 | |||
39 | /* Time in ms to debounce when transitioning from | ||
40 | * inactive state to active state. */ | ||
41 | u16 debounce_rising; | ||
42 | /* Same for transition from active to inactive state. */ | ||
43 | u16 debounce_falling; | ||
44 | |||
45 | /* notify board-specific code about state changes */ | ||
46 | void (* notify)(void *data, int state); | ||
47 | void *notify_data; | ||
48 | }; | ||
49 | |||
50 | /* Call at init time only */ | ||
51 | extern void omap_register_gpio_switches(const struct omap_gpio_switch *tbl, | ||
52 | int count); | ||
53 | |||
54 | #endif | ||
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h index f37764a36072..2e6e2597178c 100644 --- a/arch/arm/plat-omap/include/plat/gpmc.h +++ b/arch/arm/plat-omap/include/plat/gpmc.h | |||
@@ -133,6 +133,25 @@ struct gpmc_timings { | |||
133 | u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */ | 133 | u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */ |
134 | }; | 134 | }; |
135 | 135 | ||
136 | struct gpmc_nand_regs { | ||
137 | void __iomem *gpmc_status; | ||
138 | void __iomem *gpmc_nand_command; | ||
139 | void __iomem *gpmc_nand_address; | ||
140 | void __iomem *gpmc_nand_data; | ||
141 | void __iomem *gpmc_prefetch_config1; | ||
142 | void __iomem *gpmc_prefetch_config2; | ||
143 | void __iomem *gpmc_prefetch_control; | ||
144 | void __iomem *gpmc_prefetch_status; | ||
145 | void __iomem *gpmc_ecc_config; | ||
146 | void __iomem *gpmc_ecc_control; | ||
147 | void __iomem *gpmc_ecc_size_config; | ||
148 | void __iomem *gpmc_ecc1_result; | ||
149 | void __iomem *gpmc_bch_result0; | ||
150 | }; | ||
151 | |||
152 | extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs); | ||
153 | extern int gpmc_get_client_irq(unsigned irq_config); | ||
154 | |||
136 | extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); | 155 | extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); |
137 | extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps); | 156 | extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps); |
138 | extern unsigned int gpmc_ticks_to_ns(unsigned int ticks); | 157 | extern unsigned int gpmc_ticks_to_ns(unsigned int ticks); |
diff --git a/arch/arm/plat-omap/include/plat/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h deleted file mode 100644 index ddbde38e1e33..000000000000 --- a/arch/arm/plat-omap/include/plat/hardware.h +++ /dev/null | |||
@@ -1,293 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/hardware.h | ||
3 | * | ||
4 | * Hardware definitions for TI OMAP processors and boards | ||
5 | * | ||
6 | * NOTE: Please put device driver specific defines into a separate header | ||
7 | * file for each driver. | ||
8 | * | ||
9 | * Copyright (C) 2001 RidgeRun, Inc. | ||
10 | * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com> | ||
11 | * | ||
12 | * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com> | ||
13 | * and Dirk Behme <dirk.behme@de.bosch.com> | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify it | ||
16 | * under the terms of the GNU General Public License as published by the | ||
17 | * Free Software Foundation; either version 2 of the License, or (at your | ||
18 | * option) any later version. | ||
19 | * | ||
20 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
21 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
23 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
24 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
25 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
26 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
27 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
29 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
30 | * | ||
31 | * You should have received a copy of the GNU General Public License along | ||
32 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
33 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
34 | */ | ||
35 | |||
36 | #ifndef __ASM_ARCH_OMAP_HARDWARE_H | ||
37 | #define __ASM_ARCH_OMAP_HARDWARE_H | ||
38 | |||
39 | #include <asm/sizes.h> | ||
40 | #ifndef __ASSEMBLER__ | ||
41 | #include <asm/types.h> | ||
42 | #include <plat/cpu.h> | ||
43 | #endif | ||
44 | #include <plat/serial.h> | ||
45 | |||
46 | /* | ||
47 | * --------------------------------------------------------------------------- | ||
48 | * Common definitions for all OMAP processors | ||
49 | * NOTE: Put all processor or board specific parts to the special header | ||
50 | * files. | ||
51 | * --------------------------------------------------------------------------- | ||
52 | */ | ||
53 | |||
54 | /* | ||
55 | * ---------------------------------------------------------------------------- | ||
56 | * Timers | ||
57 | * ---------------------------------------------------------------------------- | ||
58 | */ | ||
59 | #define OMAP_MPU_TIMER1_BASE (0xfffec500) | ||
60 | #define OMAP_MPU_TIMER2_BASE (0xfffec600) | ||
61 | #define OMAP_MPU_TIMER3_BASE (0xfffec700) | ||
62 | #define MPU_TIMER_FREE (1 << 6) | ||
63 | #define MPU_TIMER_CLOCK_ENABLE (1 << 5) | ||
64 | #define MPU_TIMER_AR (1 << 1) | ||
65 | #define MPU_TIMER_ST (1 << 0) | ||
66 | |||
67 | /* | ||
68 | * ---------------------------------------------------------------------------- | ||
69 | * Clocks | ||
70 | * ---------------------------------------------------------------------------- | ||
71 | */ | ||
72 | #define CLKGEN_REG_BASE (0xfffece00) | ||
73 | #define ARM_CKCTL (CLKGEN_REG_BASE + 0x0) | ||
74 | #define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4) | ||
75 | #define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8) | ||
76 | #define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC) | ||
77 | #define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10) | ||
78 | #define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14) | ||
79 | #define ARM_SYSST (CLKGEN_REG_BASE + 0x18) | ||
80 | #define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24) | ||
81 | |||
82 | #define CK_RATEF 1 | ||
83 | #define CK_IDLEF 2 | ||
84 | #define CK_ENABLEF 4 | ||
85 | #define CK_SELECTF 8 | ||
86 | #define SETARM_IDLE_SHIFT | ||
87 | |||
88 | /* DPLL control registers */ | ||
89 | #define DPLL_CTL (0xfffecf00) | ||
90 | |||
91 | /* DSP clock control. Must use __raw_readw() and __raw_writew() with these */ | ||
92 | #define DSP_CONFIG_REG_BASE IOMEM(0xe1008000) | ||
93 | #define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0) | ||
94 | #define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4) | ||
95 | #define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8) | ||
96 | #define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14) | ||
97 | |||
98 | /* | ||
99 | * --------------------------------------------------------------------------- | ||
100 | * UPLD | ||
101 | * --------------------------------------------------------------------------- | ||
102 | */ | ||
103 | #define ULPD_REG_BASE (0xfffe0800) | ||
104 | #define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14) | ||
105 | #define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24) | ||
106 | #define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30) | ||
107 | # define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */ | ||
108 | # define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */ | ||
109 | #define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34) | ||
110 | # define SOFT_UDC_REQ (1 << 4) | ||
111 | # define SOFT_USB_CLK_REQ (1 << 3) | ||
112 | # define SOFT_DPLL_REQ (1 << 0) | ||
113 | #define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c) | ||
114 | #define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40) | ||
115 | #define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c) | ||
116 | #define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50) | ||
117 | #define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68) | ||
118 | # define DIS_MMC2_DPLL_REQ (1 << 11) | ||
119 | # define DIS_MMC1_DPLL_REQ (1 << 10) | ||
120 | # define DIS_UART3_DPLL_REQ (1 << 9) | ||
121 | # define DIS_UART2_DPLL_REQ (1 << 8) | ||
122 | # define DIS_UART1_DPLL_REQ (1 << 7) | ||
123 | # define DIS_USB_HOST_DPLL_REQ (1 << 6) | ||
124 | #define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74) | ||
125 | #define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c) | ||
126 | |||
127 | /* | ||
128 | * --------------------------------------------------------------------------- | ||
129 | * Watchdog timer | ||
130 | * --------------------------------------------------------------------------- | ||
131 | */ | ||
132 | |||
133 | /* Watchdog timer within the OMAP3.2 gigacell */ | ||
134 | #define OMAP_MPU_WATCHDOG_BASE (0xfffec800) | ||
135 | #define OMAP_WDT_TIMER (OMAP_MPU_WATCHDOG_BASE + 0x0) | ||
136 | #define OMAP_WDT_LOAD_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4) | ||
137 | #define OMAP_WDT_READ_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4) | ||
138 | #define OMAP_WDT_TIMER_MODE (OMAP_MPU_WATCHDOG_BASE + 0x8) | ||
139 | |||
140 | /* | ||
141 | * --------------------------------------------------------------------------- | ||
142 | * Interrupts | ||
143 | * --------------------------------------------------------------------------- | ||
144 | */ | ||
145 | #ifdef CONFIG_ARCH_OMAP1 | ||
146 | |||
147 | /* | ||
148 | * XXX: These probably want to be moved to arch/arm/mach-omap/omap1/irq.c | ||
149 | * or something similar.. -- PFM. | ||
150 | */ | ||
151 | |||
152 | #define OMAP_IH1_BASE 0xfffecb00 | ||
153 | #define OMAP_IH2_BASE 0xfffe0000 | ||
154 | |||
155 | #define OMAP_IH1_ITR (OMAP_IH1_BASE + 0x00) | ||
156 | #define OMAP_IH1_MIR (OMAP_IH1_BASE + 0x04) | ||
157 | #define OMAP_IH1_SIR_IRQ (OMAP_IH1_BASE + 0x10) | ||
158 | #define OMAP_IH1_SIR_FIQ (OMAP_IH1_BASE + 0x14) | ||
159 | #define OMAP_IH1_CONTROL (OMAP_IH1_BASE + 0x18) | ||
160 | #define OMAP_IH1_ILR0 (OMAP_IH1_BASE + 0x1c) | ||
161 | #define OMAP_IH1_ISR (OMAP_IH1_BASE + 0x9c) | ||
162 | |||
163 | #define OMAP_IH2_ITR (OMAP_IH2_BASE + 0x00) | ||
164 | #define OMAP_IH2_MIR (OMAP_IH2_BASE + 0x04) | ||
165 | #define OMAP_IH2_SIR_IRQ (OMAP_IH2_BASE + 0x10) | ||
166 | #define OMAP_IH2_SIR_FIQ (OMAP_IH2_BASE + 0x14) | ||
167 | #define OMAP_IH2_CONTROL (OMAP_IH2_BASE + 0x18) | ||
168 | #define OMAP_IH2_ILR0 (OMAP_IH2_BASE + 0x1c) | ||
169 | #define OMAP_IH2_ISR (OMAP_IH2_BASE + 0x9c) | ||
170 | |||
171 | #define IRQ_ITR_REG_OFFSET 0x00 | ||
172 | #define IRQ_MIR_REG_OFFSET 0x04 | ||
173 | #define IRQ_SIR_IRQ_REG_OFFSET 0x10 | ||
174 | #define IRQ_SIR_FIQ_REG_OFFSET 0x14 | ||
175 | #define IRQ_CONTROL_REG_OFFSET 0x18 | ||
176 | #define IRQ_ISR_REG_OFFSET 0x9c | ||
177 | #define IRQ_ILR0_REG_OFFSET 0x1c | ||
178 | #define IRQ_GMR_REG_OFFSET 0xa0 | ||
179 | |||
180 | #endif | ||
181 | |||
182 | /* | ||
183 | * ---------------------------------------------------------------------------- | ||
184 | * System control registers | ||
185 | * ---------------------------------------------------------------------------- | ||
186 | */ | ||
187 | #define MOD_CONF_CTRL_0 0xfffe1080 | ||
188 | #define MOD_CONF_CTRL_1 0xfffe1110 | ||
189 | |||
190 | /* | ||
191 | * ---------------------------------------------------------------------------- | ||
192 | * Pin multiplexing registers | ||
193 | * ---------------------------------------------------------------------------- | ||
194 | */ | ||
195 | #define FUNC_MUX_CTRL_0 0xfffe1000 | ||
196 | #define FUNC_MUX_CTRL_1 0xfffe1004 | ||
197 | #define FUNC_MUX_CTRL_2 0xfffe1008 | ||
198 | #define COMP_MODE_CTRL_0 0xfffe100c | ||
199 | #define FUNC_MUX_CTRL_3 0xfffe1010 | ||
200 | #define FUNC_MUX_CTRL_4 0xfffe1014 | ||
201 | #define FUNC_MUX_CTRL_5 0xfffe1018 | ||
202 | #define FUNC_MUX_CTRL_6 0xfffe101C | ||
203 | #define FUNC_MUX_CTRL_7 0xfffe1020 | ||
204 | #define FUNC_MUX_CTRL_8 0xfffe1024 | ||
205 | #define FUNC_MUX_CTRL_9 0xfffe1028 | ||
206 | #define FUNC_MUX_CTRL_A 0xfffe102C | ||
207 | #define FUNC_MUX_CTRL_B 0xfffe1030 | ||
208 | #define FUNC_MUX_CTRL_C 0xfffe1034 | ||
209 | #define FUNC_MUX_CTRL_D 0xfffe1038 | ||
210 | #define PULL_DWN_CTRL_0 0xfffe1040 | ||
211 | #define PULL_DWN_CTRL_1 0xfffe1044 | ||
212 | #define PULL_DWN_CTRL_2 0xfffe1048 | ||
213 | #define PULL_DWN_CTRL_3 0xfffe104c | ||
214 | #define PULL_DWN_CTRL_4 0xfffe10ac | ||
215 | |||
216 | /* OMAP-1610 specific multiplexing registers */ | ||
217 | #define FUNC_MUX_CTRL_E 0xfffe1090 | ||
218 | #define FUNC_MUX_CTRL_F 0xfffe1094 | ||
219 | #define FUNC_MUX_CTRL_10 0xfffe1098 | ||
220 | #define FUNC_MUX_CTRL_11 0xfffe109c | ||
221 | #define FUNC_MUX_CTRL_12 0xfffe10a0 | ||
222 | #define PU_PD_SEL_0 0xfffe10b4 | ||
223 | #define PU_PD_SEL_1 0xfffe10b8 | ||
224 | #define PU_PD_SEL_2 0xfffe10bc | ||
225 | #define PU_PD_SEL_3 0xfffe10c0 | ||
226 | #define PU_PD_SEL_4 0xfffe10c4 | ||
227 | |||
228 | /* Timer32K for 1610 and 1710*/ | ||
229 | #define OMAP_TIMER32K_BASE 0xFFFBC400 | ||
230 | |||
231 | /* | ||
232 | * --------------------------------------------------------------------------- | ||
233 | * TIPB bus interface | ||
234 | * --------------------------------------------------------------------------- | ||
235 | */ | ||
236 | #define TIPB_PUBLIC_CNTL_BASE 0xfffed300 | ||
237 | #define MPU_PUBLIC_TIPB_CNTL (TIPB_PUBLIC_CNTL_BASE + 0x8) | ||
238 | #define TIPB_PRIVATE_CNTL_BASE 0xfffeca00 | ||
239 | #define MPU_PRIVATE_TIPB_CNTL (TIPB_PRIVATE_CNTL_BASE + 0x8) | ||
240 | |||
241 | /* | ||
242 | * ---------------------------------------------------------------------------- | ||
243 | * MPUI interface | ||
244 | * ---------------------------------------------------------------------------- | ||
245 | */ | ||
246 | #define MPUI_BASE (0xfffec900) | ||
247 | #define MPUI_CTRL (MPUI_BASE + 0x0) | ||
248 | #define MPUI_DEBUG_ADDR (MPUI_BASE + 0x4) | ||
249 | #define MPUI_DEBUG_DATA (MPUI_BASE + 0x8) | ||
250 | #define MPUI_DEBUG_FLAG (MPUI_BASE + 0xc) | ||
251 | #define MPUI_STATUS_REG (MPUI_BASE + 0x10) | ||
252 | #define MPUI_DSP_STATUS (MPUI_BASE + 0x14) | ||
253 | #define MPUI_DSP_BOOT_CONFIG (MPUI_BASE + 0x18) | ||
254 | #define MPUI_DSP_API_CONFIG (MPUI_BASE + 0x1c) | ||
255 | |||
256 | /* | ||
257 | * ---------------------------------------------------------------------------- | ||
258 | * LED Pulse Generator | ||
259 | * ---------------------------------------------------------------------------- | ||
260 | */ | ||
261 | #define OMAP_LPG1_BASE 0xfffbd000 | ||
262 | #define OMAP_LPG2_BASE 0xfffbd800 | ||
263 | #define OMAP_LPG1_LCR (OMAP_LPG1_BASE + 0x00) | ||
264 | #define OMAP_LPG1_PMR (OMAP_LPG1_BASE + 0x04) | ||
265 | #define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00) | ||
266 | #define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04) | ||
267 | |||
268 | /* | ||
269 | * ---------------------------------------------------------------------------- | ||
270 | * Pulse-Width Light | ||
271 | * ---------------------------------------------------------------------------- | ||
272 | */ | ||
273 | #define OMAP_PWL_BASE 0xfffb5800 | ||
274 | #define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00) | ||
275 | #define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04) | ||
276 | |||
277 | /* | ||
278 | * --------------------------------------------------------------------------- | ||
279 | * Processor specific defines | ||
280 | * --------------------------------------------------------------------------- | ||
281 | */ | ||
282 | |||
283 | #include <plat/omap7xx.h> | ||
284 | #include <plat/omap1510.h> | ||
285 | #include <plat/omap16xx.h> | ||
286 | #include <plat/omap24xx.h> | ||
287 | #include <plat/omap34xx.h> | ||
288 | #include <plat/omap44xx.h> | ||
289 | #include <plat/ti81xx.h> | ||
290 | #include <plat/am33xx.h> | ||
291 | #include <plat/omap54xx.h> | ||
292 | |||
293 | #endif /* __ASM_ARCH_OMAP_HARDWARE_H */ | ||
diff --git a/arch/arm/plat-omap/include/plat/irqs-44xx.h b/arch/arm/plat-omap/include/plat/irqs-44xx.h deleted file mode 100644 index 518322c80116..000000000000 --- a/arch/arm/plat-omap/include/plat/irqs-44xx.h +++ /dev/null | |||
@@ -1,144 +0,0 @@ | |||
1 | /* | ||
2 | * OMAP4 Interrupt lines definitions | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. | ||
5 | * | ||
6 | * Santosh Shilimkar (santosh.shilimkar@ti.com) | ||
7 | * Benoit Cousson (b-cousson@ti.com) | ||
8 | * | ||
9 | * This file is automatically generated from the OMAP hardware databases. | ||
10 | * We respectfully ask that any modifications to this file be coordinated | ||
11 | * with the public linux-omap@vger.kernel.org mailing list and the | ||
12 | * authors above to ensure that the autogeneration scripts are kept | ||
13 | * up-to-date with the file contents. | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License version 2 as | ||
17 | * published by the Free Software Foundation. | ||
18 | */ | ||
19 | |||
20 | #ifndef __ARCH_ARM_MACH_OMAP2_OMAP44XX_IRQS_H | ||
21 | #define __ARCH_ARM_MACH_OMAP2_OMAP44XX_IRQS_H | ||
22 | |||
23 | /* OMAP44XX IRQs numbers definitions */ | ||
24 | #define OMAP44XX_IRQ_LOCALTIMER 29 | ||
25 | #define OMAP44XX_IRQ_LOCALWDT 30 | ||
26 | |||
27 | #define OMAP44XX_IRQ_GIC_START 32 | ||
28 | |||
29 | #define OMAP44XX_IRQ_PL310 (0 + OMAP44XX_IRQ_GIC_START) | ||
30 | #define OMAP44XX_IRQ_CTI0 (1 + OMAP44XX_IRQ_GIC_START) | ||
31 | #define OMAP44XX_IRQ_CTI1 (2 + OMAP44XX_IRQ_GIC_START) | ||
32 | #define OMAP44XX_IRQ_ELM (4 + OMAP44XX_IRQ_GIC_START) | ||
33 | #define OMAP44XX_IRQ_SYS_1N (7 + OMAP44XX_IRQ_GIC_START) | ||
34 | #define OMAP44XX_IRQ_SECURITY_EVENTS (8 + OMAP44XX_IRQ_GIC_START) | ||
35 | #define OMAP44XX_IRQ_L3_DBG (9 + OMAP44XX_IRQ_GIC_START) | ||
36 | #define OMAP44XX_IRQ_L3_APP (10 + OMAP44XX_IRQ_GIC_START) | ||
37 | #define OMAP44XX_IRQ_PRCM (11 + OMAP44XX_IRQ_GIC_START) | ||
38 | #define OMAP44XX_IRQ_SDMA_0 (12 + OMAP44XX_IRQ_GIC_START) | ||
39 | #define OMAP44XX_IRQ_SDMA_1 (13 + OMAP44XX_IRQ_GIC_START) | ||
40 | #define OMAP44XX_IRQ_SDMA_2 (14 + OMAP44XX_IRQ_GIC_START) | ||
41 | #define OMAP44XX_IRQ_SDMA_3 (15 + OMAP44XX_IRQ_GIC_START) | ||
42 | #define OMAP44XX_IRQ_MCBSP4 (16 + OMAP44XX_IRQ_GIC_START) | ||
43 | #define OMAP44XX_IRQ_MCBSP1 (17 + OMAP44XX_IRQ_GIC_START) | ||
44 | #define OMAP44XX_IRQ_SR_MCU (18 + OMAP44XX_IRQ_GIC_START) | ||
45 | #define OMAP44XX_IRQ_SR_CORE (19 + OMAP44XX_IRQ_GIC_START) | ||
46 | #define OMAP44XX_IRQ_GPMC (20 + OMAP44XX_IRQ_GIC_START) | ||
47 | #define OMAP44XX_IRQ_GFX (21 + OMAP44XX_IRQ_GIC_START) | ||
48 | #define OMAP44XX_IRQ_MCBSP2 (22 + OMAP44XX_IRQ_GIC_START) | ||
49 | #define OMAP44XX_IRQ_MCBSP3 (23 + OMAP44XX_IRQ_GIC_START) | ||
50 | #define OMAP44XX_IRQ_ISS_5 (24 + OMAP44XX_IRQ_GIC_START) | ||
51 | #define OMAP44XX_IRQ_DSS_DISPC (25 + OMAP44XX_IRQ_GIC_START) | ||
52 | #define OMAP44XX_IRQ_MAIL_U0 (26 + OMAP44XX_IRQ_GIC_START) | ||
53 | #define OMAP44XX_IRQ_C2C_SSCM_0 (27 + OMAP44XX_IRQ_GIC_START) | ||
54 | #define OMAP44XX_IRQ_TESLA_MMU (28 + OMAP44XX_IRQ_GIC_START) | ||
55 | #define OMAP44XX_IRQ_GPIO1 (29 + OMAP44XX_IRQ_GIC_START) | ||
56 | #define OMAP44XX_IRQ_GPIO2 (30 + OMAP44XX_IRQ_GIC_START) | ||
57 | #define OMAP44XX_IRQ_GPIO3 (31 + OMAP44XX_IRQ_GIC_START) | ||
58 | #define OMAP44XX_IRQ_GPIO4 (32 + OMAP44XX_IRQ_GIC_START) | ||
59 | #define OMAP44XX_IRQ_GPIO5 (33 + OMAP44XX_IRQ_GIC_START) | ||
60 | #define OMAP44XX_IRQ_GPIO6 (34 + OMAP44XX_IRQ_GIC_START) | ||
61 | #define OMAP44XX_IRQ_USIM (35 + OMAP44XX_IRQ_GIC_START) | ||
62 | #define OMAP44XX_IRQ_WDT3 (36 + OMAP44XX_IRQ_GIC_START) | ||
63 | #define OMAP44XX_IRQ_GPT1 (37 + OMAP44XX_IRQ_GIC_START) | ||
64 | #define OMAP44XX_IRQ_GPT2 (38 + OMAP44XX_IRQ_GIC_START) | ||
65 | #define OMAP44XX_IRQ_GPT3 (39 + OMAP44XX_IRQ_GIC_START) | ||
66 | #define OMAP44XX_IRQ_GPT4 (40 + OMAP44XX_IRQ_GIC_START) | ||
67 | #define OMAP44XX_IRQ_GPT5 (41 + OMAP44XX_IRQ_GIC_START) | ||
68 | #define OMAP44XX_IRQ_GPT6 (42 + OMAP44XX_IRQ_GIC_START) | ||
69 | #define OMAP44XX_IRQ_GPT7 (43 + OMAP44XX_IRQ_GIC_START) | ||
70 | #define OMAP44XX_IRQ_GPT8 (44 + OMAP44XX_IRQ_GIC_START) | ||
71 | #define OMAP44XX_IRQ_GPT9 (45 + OMAP44XX_IRQ_GIC_START) | ||
72 | #define OMAP44XX_IRQ_GPT10 (46 + OMAP44XX_IRQ_GIC_START) | ||
73 | #define OMAP44XX_IRQ_GPT11 (47 + OMAP44XX_IRQ_GIC_START) | ||
74 | #define OMAP44XX_IRQ_SPI4 (48 + OMAP44XX_IRQ_GIC_START) | ||
75 | #define OMAP44XX_IRQ_SHA1_S (49 + OMAP44XX_IRQ_GIC_START) | ||
76 | #define OMAP44XX_IRQ_FPKA_SINTREQUEST_S (50 + OMAP44XX_IRQ_GIC_START) | ||
77 | #define OMAP44XX_IRQ_SHA1_P (51 + OMAP44XX_IRQ_GIC_START) | ||
78 | #define OMAP44XX_IRQ_RNG (52 + OMAP44XX_IRQ_GIC_START) | ||
79 | #define OMAP44XX_IRQ_DSS_DSI1 (53 + OMAP44XX_IRQ_GIC_START) | ||
80 | #define OMAP44XX_IRQ_I2C1 (56 + OMAP44XX_IRQ_GIC_START) | ||
81 | #define OMAP44XX_IRQ_I2C2 (57 + OMAP44XX_IRQ_GIC_START) | ||
82 | #define OMAP44XX_IRQ_HDQ (58 + OMAP44XX_IRQ_GIC_START) | ||
83 | #define OMAP44XX_IRQ_MMC5 (59 + OMAP44XX_IRQ_GIC_START) | ||
84 | #define OMAP44XX_IRQ_I2C3 (61 + OMAP44XX_IRQ_GIC_START) | ||
85 | #define OMAP44XX_IRQ_I2C4 (62 + OMAP44XX_IRQ_GIC_START) | ||
86 | #define OMAP44XX_IRQ_AES2_S (63 + OMAP44XX_IRQ_GIC_START) | ||
87 | #define OMAP44XX_IRQ_AES2_P (64 + OMAP44XX_IRQ_GIC_START) | ||
88 | #define OMAP44XX_IRQ_SPI1 (65 + OMAP44XX_IRQ_GIC_START) | ||
89 | #define OMAP44XX_IRQ_SPI2 (66 + OMAP44XX_IRQ_GIC_START) | ||
90 | #define OMAP44XX_IRQ_HSI_P1 (67 + OMAP44XX_IRQ_GIC_START) | ||
91 | #define OMAP44XX_IRQ_HSI_P2 (68 + OMAP44XX_IRQ_GIC_START) | ||
92 | #define OMAP44XX_IRQ_FDIF_3 (69 + OMAP44XX_IRQ_GIC_START) | ||
93 | #define OMAP44XX_IRQ_UART4 (70 + OMAP44XX_IRQ_GIC_START) | ||
94 | #define OMAP44XX_IRQ_HSI_DMA (71 + OMAP44XX_IRQ_GIC_START) | ||
95 | #define OMAP44XX_IRQ_UART1 (72 + OMAP44XX_IRQ_GIC_START) | ||
96 | #define OMAP44XX_IRQ_UART2 (73 + OMAP44XX_IRQ_GIC_START) | ||
97 | #define OMAP44XX_IRQ_UART3 (74 + OMAP44XX_IRQ_GIC_START) | ||
98 | #define OMAP44XX_IRQ_PBIAS (75 + OMAP44XX_IRQ_GIC_START) | ||
99 | #define OMAP44XX_IRQ_OHCI (76 + OMAP44XX_IRQ_GIC_START) | ||
100 | #define OMAP44XX_IRQ_EHCI (77 + OMAP44XX_IRQ_GIC_START) | ||
101 | #define OMAP44XX_IRQ_TLL (78 + OMAP44XX_IRQ_GIC_START) | ||
102 | #define OMAP44XX_IRQ_AES1_S (79 + OMAP44XX_IRQ_GIC_START) | ||
103 | #define OMAP44XX_IRQ_WDT2 (80 + OMAP44XX_IRQ_GIC_START) | ||
104 | #define OMAP44XX_IRQ_DES_S (81 + OMAP44XX_IRQ_GIC_START) | ||
105 | #define OMAP44XX_IRQ_DES_P (82 + OMAP44XX_IRQ_GIC_START) | ||
106 | #define OMAP44XX_IRQ_MMC1 (83 + OMAP44XX_IRQ_GIC_START) | ||
107 | #define OMAP44XX_IRQ_DSS_DSI2 (84 + OMAP44XX_IRQ_GIC_START) | ||
108 | #define OMAP44XX_IRQ_AES1_P (85 + OMAP44XX_IRQ_GIC_START) | ||
109 | #define OMAP44XX_IRQ_MMC2 (86 + OMAP44XX_IRQ_GIC_START) | ||
110 | #define OMAP44XX_IRQ_MPU_ICR (87 + OMAP44XX_IRQ_GIC_START) | ||
111 | #define OMAP44XX_IRQ_C2C_SSCM_1 (88 + OMAP44XX_IRQ_GIC_START) | ||
112 | #define OMAP44XX_IRQ_FSUSB (89 + OMAP44XX_IRQ_GIC_START) | ||
113 | #define OMAP44XX_IRQ_FSUSB_SMI (90 + OMAP44XX_IRQ_GIC_START) | ||
114 | #define OMAP44XX_IRQ_SPI3 (91 + OMAP44XX_IRQ_GIC_START) | ||
115 | #define OMAP44XX_IRQ_HS_USB_MC_N (92 + OMAP44XX_IRQ_GIC_START) | ||
116 | #define OMAP44XX_IRQ_HS_USB_DMA_N (93 + OMAP44XX_IRQ_GIC_START) | ||
117 | #define OMAP44XX_IRQ_MMC3 (94 + OMAP44XX_IRQ_GIC_START) | ||
118 | #define OMAP44XX_IRQ_GPT12 (95 + OMAP44XX_IRQ_GIC_START) | ||
119 | #define OMAP44XX_IRQ_MMC4 (96 + OMAP44XX_IRQ_GIC_START) | ||
120 | #define OMAP44XX_IRQ_SLIMBUS1 (97 + OMAP44XX_IRQ_GIC_START) | ||
121 | #define OMAP44XX_IRQ_SLIMBUS2 (98 + OMAP44XX_IRQ_GIC_START) | ||
122 | #define OMAP44XX_IRQ_ABE (99 + OMAP44XX_IRQ_GIC_START) | ||
123 | #define OMAP44XX_IRQ_DUCATI_MMU (100 + OMAP44XX_IRQ_GIC_START) | ||
124 | #define OMAP44XX_IRQ_DSS_HDMI (101 + OMAP44XX_IRQ_GIC_START) | ||
125 | #define OMAP44XX_IRQ_SR_IVA (102 + OMAP44XX_IRQ_GIC_START) | ||
126 | #define OMAP44XX_IRQ_IVA_HD_POSYNCITRPEND_1 (103 + OMAP44XX_IRQ_GIC_START) | ||
127 | #define OMAP44XX_IRQ_IVA_HD_POSYNCITRPEND_0 (104 + OMAP44XX_IRQ_GIC_START) | ||
128 | #define OMAP44XX_IRQ_IVA_HD_POMBINTRPEND_0 (107 + OMAP44XX_IRQ_GIC_START) | ||
129 | #define OMAP44XX_IRQ_MCASP1_AR (108 + OMAP44XX_IRQ_GIC_START) | ||
130 | #define OMAP44XX_IRQ_MCASP1_AX (109 + OMAP44XX_IRQ_GIC_START) | ||
131 | #define OMAP44XX_IRQ_EMIF4_1 (110 + OMAP44XX_IRQ_GIC_START) | ||
132 | #define OMAP44XX_IRQ_EMIF4_2 (111 + OMAP44XX_IRQ_GIC_START) | ||
133 | #define OMAP44XX_IRQ_MCPDM (112 + OMAP44XX_IRQ_GIC_START) | ||
134 | #define OMAP44XX_IRQ_DMM (113 + OMAP44XX_IRQ_GIC_START) | ||
135 | #define OMAP44XX_IRQ_DMIC (114 + OMAP44XX_IRQ_GIC_START) | ||
136 | #define OMAP44XX_IRQ_CDMA_0 (115 + OMAP44XX_IRQ_GIC_START) | ||
137 | #define OMAP44XX_IRQ_CDMA_1 (116 + OMAP44XX_IRQ_GIC_START) | ||
138 | #define OMAP44XX_IRQ_CDMA_2 (117 + OMAP44XX_IRQ_GIC_START) | ||
139 | #define OMAP44XX_IRQ_CDMA_3 (118 + OMAP44XX_IRQ_GIC_START) | ||
140 | #define OMAP44XX_IRQ_SYS_2N (119 + OMAP44XX_IRQ_GIC_START) | ||
141 | #define OMAP44XX_IRQ_KBD_CTL (120 + OMAP44XX_IRQ_GIC_START) | ||
142 | #define OMAP44XX_IRQ_UNIPRO1 (124 + OMAP44XX_IRQ_GIC_START) | ||
143 | |||
144 | #endif | ||
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h deleted file mode 100644 index 37bbbbb981b2..000000000000 --- a/arch/arm/plat-omap/include/plat/irqs.h +++ /dev/null | |||
@@ -1,453 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/irqs.h | ||
3 | * | ||
4 | * Copyright (C) Greg Lonnon 2001 | ||
5 | * Updated for OMAP-1610 by Tony Lindgren <tony@atomide.com> | ||
6 | * | ||
7 | * Copyright (C) 2009 Texas Instruments | ||
8 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
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 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | * NOTE: The interrupt vectors for the OMAP-1509, OMAP-1510, and OMAP-1610 | ||
25 | * are different. | ||
26 | */ | ||
27 | |||
28 | #ifndef __ASM_ARCH_OMAP15XX_IRQS_H | ||
29 | #define __ASM_ARCH_OMAP15XX_IRQS_H | ||
30 | |||
31 | /* All OMAP4 specific defines are moved to irqs-44xx.h */ | ||
32 | #include "irqs-44xx.h" | ||
33 | |||
34 | /* | ||
35 | * IRQ numbers for interrupt handler 1 | ||
36 | * | ||
37 | * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below | ||
38 | * | ||
39 | */ | ||
40 | #define INT_CAMERA 1 | ||
41 | #define INT_FIQ 3 | ||
42 | #define INT_RTDX 6 | ||
43 | #define INT_DSP_MMU_ABORT 7 | ||
44 | #define INT_HOST 8 | ||
45 | #define INT_ABORT 9 | ||
46 | #define INT_BRIDGE_PRIV 13 | ||
47 | #define INT_GPIO_BANK1 14 | ||
48 | #define INT_UART3 15 | ||
49 | #define INT_TIMER3 16 | ||
50 | #define INT_DMA_CH0_6 19 | ||
51 | #define INT_DMA_CH1_7 20 | ||
52 | #define INT_DMA_CH2_8 21 | ||
53 | #define INT_DMA_CH3 22 | ||
54 | #define INT_DMA_CH4 23 | ||
55 | #define INT_DMA_CH5 24 | ||
56 | #define INT_DMA_LCD 25 | ||
57 | #define INT_TIMER1 26 | ||
58 | #define INT_WD_TIMER 27 | ||
59 | #define INT_BRIDGE_PUB 28 | ||
60 | #define INT_TIMER2 30 | ||
61 | #define INT_LCD_CTRL 31 | ||
62 | |||
63 | /* | ||
64 | * OMAP-1510 specific IRQ numbers for interrupt handler 1 | ||
65 | */ | ||
66 | #define INT_1510_IH2_IRQ 0 | ||
67 | #define INT_1510_RES2 2 | ||
68 | #define INT_1510_SPI_TX 4 | ||
69 | #define INT_1510_SPI_RX 5 | ||
70 | #define INT_1510_DSP_MAILBOX1 10 | ||
71 | #define INT_1510_DSP_MAILBOX2 11 | ||
72 | #define INT_1510_RES12 12 | ||
73 | #define INT_1510_LB_MMU 17 | ||
74 | #define INT_1510_RES18 18 | ||
75 | #define INT_1510_LOCAL_BUS 29 | ||
76 | |||
77 | /* | ||
78 | * OMAP-1610 specific IRQ numbers for interrupt handler 1 | ||
79 | */ | ||
80 | #define INT_1610_IH2_IRQ INT_1510_IH2_IRQ | ||
81 | #define INT_1610_IH2_FIQ 2 | ||
82 | #define INT_1610_McBSP2_TX 4 | ||
83 | #define INT_1610_McBSP2_RX 5 | ||
84 | #define INT_1610_DSP_MAILBOX1 10 | ||
85 | #define INT_1610_DSP_MAILBOX2 11 | ||
86 | #define INT_1610_LCD_LINE 12 | ||
87 | #define INT_1610_GPTIMER1 17 | ||
88 | #define INT_1610_GPTIMER2 18 | ||
89 | #define INT_1610_SSR_FIFO_0 29 | ||
90 | |||
91 | /* | ||
92 | * OMAP-7xx specific IRQ numbers for interrupt handler 1 | ||
93 | */ | ||
94 | #define INT_7XX_IH2_FIQ 0 | ||
95 | #define INT_7XX_IH2_IRQ 1 | ||
96 | #define INT_7XX_USB_NON_ISO 2 | ||
97 | #define INT_7XX_USB_ISO 3 | ||
98 | #define INT_7XX_ICR 4 | ||
99 | #define INT_7XX_EAC 5 | ||
100 | #define INT_7XX_GPIO_BANK1 6 | ||
101 | #define INT_7XX_GPIO_BANK2 7 | ||
102 | #define INT_7XX_GPIO_BANK3 8 | ||
103 | #define INT_7XX_McBSP2TX 10 | ||
104 | #define INT_7XX_McBSP2RX 11 | ||
105 | #define INT_7XX_McBSP2RX_OVF 12 | ||
106 | #define INT_7XX_LCD_LINE 14 | ||
107 | #define INT_7XX_GSM_PROTECT 15 | ||
108 | #define INT_7XX_TIMER3 16 | ||
109 | #define INT_7XX_GPIO_BANK5 17 | ||
110 | #define INT_7XX_GPIO_BANK6 18 | ||
111 | #define INT_7XX_SPGIO_WR 29 | ||
112 | |||
113 | /* | ||
114 | * IRQ numbers for interrupt handler 2 | ||
115 | * | ||
116 | * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below | ||
117 | */ | ||
118 | #define IH2_BASE 32 | ||
119 | |||
120 | #define INT_KEYBOARD (1 + IH2_BASE) | ||
121 | #define INT_uWireTX (2 + IH2_BASE) | ||
122 | #define INT_uWireRX (3 + IH2_BASE) | ||
123 | #define INT_I2C (4 + IH2_BASE) | ||
124 | #define INT_MPUIO (5 + IH2_BASE) | ||
125 | #define INT_USB_HHC_1 (6 + IH2_BASE) | ||
126 | #define INT_McBSP3TX (10 + IH2_BASE) | ||
127 | #define INT_McBSP3RX (11 + IH2_BASE) | ||
128 | #define INT_McBSP1TX (12 + IH2_BASE) | ||
129 | #define INT_McBSP1RX (13 + IH2_BASE) | ||
130 | #define INT_UART1 (14 + IH2_BASE) | ||
131 | #define INT_UART2 (15 + IH2_BASE) | ||
132 | #define INT_BT_MCSI1TX (16 + IH2_BASE) | ||
133 | #define INT_BT_MCSI1RX (17 + IH2_BASE) | ||
134 | #define INT_SOSSI_MATCH (19 + IH2_BASE) | ||
135 | #define INT_USB_W2FC (20 + IH2_BASE) | ||
136 | #define INT_1WIRE (21 + IH2_BASE) | ||
137 | #define INT_OS_TIMER (22 + IH2_BASE) | ||
138 | #define INT_MMC (23 + IH2_BASE) | ||
139 | #define INT_GAUGE_32K (24 + IH2_BASE) | ||
140 | #define INT_RTC_TIMER (25 + IH2_BASE) | ||
141 | #define INT_RTC_ALARM (26 + IH2_BASE) | ||
142 | #define INT_MEM_STICK (27 + IH2_BASE) | ||
143 | |||
144 | /* | ||
145 | * OMAP-1510 specific IRQ numbers for interrupt handler 2 | ||
146 | */ | ||
147 | #define INT_1510_DSP_MMU (28 + IH2_BASE) | ||
148 | #define INT_1510_COM_SPI_RO (31 + IH2_BASE) | ||
149 | |||
150 | /* | ||
151 | * OMAP-1610 specific IRQ numbers for interrupt handler 2 | ||
152 | */ | ||
153 | #define INT_1610_FAC (0 + IH2_BASE) | ||
154 | #define INT_1610_USB_HHC_2 (7 + IH2_BASE) | ||
155 | #define INT_1610_USB_OTG (8 + IH2_BASE) | ||
156 | #define INT_1610_SoSSI (9 + IH2_BASE) | ||
157 | #define INT_1610_SoSSI_MATCH (19 + IH2_BASE) | ||
158 | #define INT_1610_DSP_MMU (28 + IH2_BASE) | ||
159 | #define INT_1610_McBSP2RX_OF (31 + IH2_BASE) | ||
160 | #define INT_1610_STI (32 + IH2_BASE) | ||
161 | #define INT_1610_STI_WAKEUP (33 + IH2_BASE) | ||
162 | #define INT_1610_GPTIMER3 (34 + IH2_BASE) | ||
163 | #define INT_1610_GPTIMER4 (35 + IH2_BASE) | ||
164 | #define INT_1610_GPTIMER5 (36 + IH2_BASE) | ||
165 | #define INT_1610_GPTIMER6 (37 + IH2_BASE) | ||
166 | #define INT_1610_GPTIMER7 (38 + IH2_BASE) | ||
167 | #define INT_1610_GPTIMER8 (39 + IH2_BASE) | ||
168 | #define INT_1610_GPIO_BANK2 (40 + IH2_BASE) | ||
169 | #define INT_1610_GPIO_BANK3 (41 + IH2_BASE) | ||
170 | #define INT_1610_MMC2 (42 + IH2_BASE) | ||
171 | #define INT_1610_CF (43 + IH2_BASE) | ||
172 | #define INT_1610_WAKE_UP_REQ (46 + IH2_BASE) | ||
173 | #define INT_1610_GPIO_BANK4 (48 + IH2_BASE) | ||
174 | #define INT_1610_SPI (49 + IH2_BASE) | ||
175 | #define INT_1610_DMA_CH6 (53 + IH2_BASE) | ||
176 | #define INT_1610_DMA_CH7 (54 + IH2_BASE) | ||
177 | #define INT_1610_DMA_CH8 (55 + IH2_BASE) | ||
178 | #define INT_1610_DMA_CH9 (56 + IH2_BASE) | ||
179 | #define INT_1610_DMA_CH10 (57 + IH2_BASE) | ||
180 | #define INT_1610_DMA_CH11 (58 + IH2_BASE) | ||
181 | #define INT_1610_DMA_CH12 (59 + IH2_BASE) | ||
182 | #define INT_1610_DMA_CH13 (60 + IH2_BASE) | ||
183 | #define INT_1610_DMA_CH14 (61 + IH2_BASE) | ||
184 | #define INT_1610_DMA_CH15 (62 + IH2_BASE) | ||
185 | #define INT_1610_NAND (63 + IH2_BASE) | ||
186 | #define INT_1610_SHA1MD5 (91 + IH2_BASE) | ||
187 | |||
188 | /* | ||
189 | * OMAP-7xx specific IRQ numbers for interrupt handler 2 | ||
190 | */ | ||
191 | #define INT_7XX_HW_ERRORS (0 + IH2_BASE) | ||
192 | #define INT_7XX_NFIQ_PWR_FAIL (1 + IH2_BASE) | ||
193 | #define INT_7XX_CFCD (2 + IH2_BASE) | ||
194 | #define INT_7XX_CFIREQ (3 + IH2_BASE) | ||
195 | #define INT_7XX_I2C (4 + IH2_BASE) | ||
196 | #define INT_7XX_PCC (5 + IH2_BASE) | ||
197 | #define INT_7XX_MPU_EXT_NIRQ (6 + IH2_BASE) | ||
198 | #define INT_7XX_SPI_100K_1 (7 + IH2_BASE) | ||
199 | #define INT_7XX_SYREN_SPI (8 + IH2_BASE) | ||
200 | #define INT_7XX_VLYNQ (9 + IH2_BASE) | ||
201 | #define INT_7XX_GPIO_BANK4 (10 + IH2_BASE) | ||
202 | #define INT_7XX_McBSP1TX (11 + IH2_BASE) | ||
203 | #define INT_7XX_McBSP1RX (12 + IH2_BASE) | ||
204 | #define INT_7XX_McBSP1RX_OF (13 + IH2_BASE) | ||
205 | #define INT_7XX_UART_MODEM_IRDA_2 (14 + IH2_BASE) | ||
206 | #define INT_7XX_UART_MODEM_1 (15 + IH2_BASE) | ||
207 | #define INT_7XX_MCSI (16 + IH2_BASE) | ||
208 | #define INT_7XX_uWireTX (17 + IH2_BASE) | ||
209 | #define INT_7XX_uWireRX (18 + IH2_BASE) | ||
210 | #define INT_7XX_SMC_CD (19 + IH2_BASE) | ||
211 | #define INT_7XX_SMC_IREQ (20 + IH2_BASE) | ||
212 | #define INT_7XX_HDQ_1WIRE (21 + IH2_BASE) | ||
213 | #define INT_7XX_TIMER32K (22 + IH2_BASE) | ||
214 | #define INT_7XX_MMC_SDIO (23 + IH2_BASE) | ||
215 | #define INT_7XX_UPLD (24 + IH2_BASE) | ||
216 | #define INT_7XX_USB_HHC_1 (27 + IH2_BASE) | ||
217 | #define INT_7XX_USB_HHC_2 (28 + IH2_BASE) | ||
218 | #define INT_7XX_USB_GENI (29 + IH2_BASE) | ||
219 | #define INT_7XX_USB_OTG (30 + IH2_BASE) | ||
220 | #define INT_7XX_CAMERA_IF (31 + IH2_BASE) | ||
221 | #define INT_7XX_RNG (32 + IH2_BASE) | ||
222 | #define INT_7XX_DUAL_MODE_TIMER (33 + IH2_BASE) | ||
223 | #define INT_7XX_DBB_RF_EN (34 + IH2_BASE) | ||
224 | #define INT_7XX_MPUIO_KEYPAD (35 + IH2_BASE) | ||
225 | #define INT_7XX_SHA1_MD5 (36 + IH2_BASE) | ||
226 | #define INT_7XX_SPI_100K_2 (37 + IH2_BASE) | ||
227 | #define INT_7XX_RNG_IDLE (38 + IH2_BASE) | ||
228 | #define INT_7XX_MPUIO (39 + IH2_BASE) | ||
229 | #define INT_7XX_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE) | ||
230 | #define INT_7XX_LLPC_OE_FALLING (41 + IH2_BASE) | ||
231 | #define INT_7XX_LLPC_OE_RISING (42 + IH2_BASE) | ||
232 | #define INT_7XX_LLPC_VSYNC (43 + IH2_BASE) | ||
233 | #define INT_7XX_WAKE_UP_REQ (46 + IH2_BASE) | ||
234 | #define INT_7XX_DMA_CH6 (53 + IH2_BASE) | ||
235 | #define INT_7XX_DMA_CH7 (54 + IH2_BASE) | ||
236 | #define INT_7XX_DMA_CH8 (55 + IH2_BASE) | ||
237 | #define INT_7XX_DMA_CH9 (56 + IH2_BASE) | ||
238 | #define INT_7XX_DMA_CH10 (57 + IH2_BASE) | ||
239 | #define INT_7XX_DMA_CH11 (58 + IH2_BASE) | ||
240 | #define INT_7XX_DMA_CH12 (59 + IH2_BASE) | ||
241 | #define INT_7XX_DMA_CH13 (60 + IH2_BASE) | ||
242 | #define INT_7XX_DMA_CH14 (61 + IH2_BASE) | ||
243 | #define INT_7XX_DMA_CH15 (62 + IH2_BASE) | ||
244 | #define INT_7XX_NAND (63 + IH2_BASE) | ||
245 | |||
246 | #define INT_24XX_SYS_NIRQ 7 | ||
247 | #define INT_24XX_SDMA_IRQ0 12 | ||
248 | #define INT_24XX_SDMA_IRQ1 13 | ||
249 | #define INT_24XX_SDMA_IRQ2 14 | ||
250 | #define INT_24XX_SDMA_IRQ3 15 | ||
251 | #define INT_24XX_CAM_IRQ 24 | ||
252 | #define INT_24XX_DSS_IRQ 25 | ||
253 | #define INT_24XX_MAIL_U0_MPU 26 | ||
254 | #define INT_24XX_DSP_UMA 27 | ||
255 | #define INT_24XX_DSP_MMU 28 | ||
256 | #define INT_24XX_GPIO_BANK1 29 | ||
257 | #define INT_24XX_GPIO_BANK2 30 | ||
258 | #define INT_24XX_GPIO_BANK3 31 | ||
259 | #define INT_24XX_GPIO_BANK4 32 | ||
260 | #define INT_24XX_GPIO_BANK5 33 | ||
261 | #define INT_24XX_MAIL_U3_MPU 34 | ||
262 | #define INT_24XX_GPTIMER1 37 | ||
263 | #define INT_24XX_GPTIMER2 38 | ||
264 | #define INT_24XX_GPTIMER3 39 | ||
265 | #define INT_24XX_GPTIMER4 40 | ||
266 | #define INT_24XX_GPTIMER5 41 | ||
267 | #define INT_24XX_GPTIMER6 42 | ||
268 | #define INT_24XX_GPTIMER7 43 | ||
269 | #define INT_24XX_GPTIMER8 44 | ||
270 | #define INT_24XX_GPTIMER9 45 | ||
271 | #define INT_24XX_GPTIMER10 46 | ||
272 | #define INT_24XX_GPTIMER11 47 | ||
273 | #define INT_24XX_GPTIMER12 48 | ||
274 | #define INT_24XX_SHA1MD5 51 | ||
275 | #define INT_24XX_MCBSP4_IRQ_TX 54 | ||
276 | #define INT_24XX_MCBSP4_IRQ_RX 55 | ||
277 | #define INT_24XX_I2C1_IRQ 56 | ||
278 | #define INT_24XX_I2C2_IRQ 57 | ||
279 | #define INT_24XX_HDQ_IRQ 58 | ||
280 | #define INT_24XX_MCBSP1_IRQ_TX 59 | ||
281 | #define INT_24XX_MCBSP1_IRQ_RX 60 | ||
282 | #define INT_24XX_MCBSP2_IRQ_TX 62 | ||
283 | #define INT_24XX_MCBSP2_IRQ_RX 63 | ||
284 | #define INT_24XX_SPI1_IRQ 65 | ||
285 | #define INT_24XX_SPI2_IRQ 66 | ||
286 | #define INT_24XX_UART1_IRQ 72 | ||
287 | #define INT_24XX_UART2_IRQ 73 | ||
288 | #define INT_24XX_UART3_IRQ 74 | ||
289 | #define INT_24XX_USB_IRQ_GEN 75 | ||
290 | #define INT_24XX_USB_IRQ_NISO 76 | ||
291 | #define INT_24XX_USB_IRQ_ISO 77 | ||
292 | #define INT_24XX_USB_IRQ_HGEN 78 | ||
293 | #define INT_24XX_USB_IRQ_HSOF 79 | ||
294 | #define INT_24XX_USB_IRQ_OTG 80 | ||
295 | #define INT_24XX_MCBSP5_IRQ_TX 81 | ||
296 | #define INT_24XX_MCBSP5_IRQ_RX 82 | ||
297 | #define INT_24XX_MMC_IRQ 83 | ||
298 | #define INT_24XX_MMC2_IRQ 86 | ||
299 | #define INT_24XX_MCBSP3_IRQ_TX 89 | ||
300 | #define INT_24XX_MCBSP3_IRQ_RX 90 | ||
301 | #define INT_24XX_SPI3_IRQ 91 | ||
302 | |||
303 | #define INT_243X_MCBSP2_IRQ 16 | ||
304 | #define INT_243X_MCBSP3_IRQ 17 | ||
305 | #define INT_243X_MCBSP4_IRQ 18 | ||
306 | #define INT_243X_MCBSP5_IRQ 19 | ||
307 | #define INT_243X_MCBSP1_IRQ 64 | ||
308 | #define INT_243X_HS_USB_MC 92 | ||
309 | #define INT_243X_HS_USB_DMA 93 | ||
310 | #define INT_243X_CARKIT_IRQ 94 | ||
311 | |||
312 | #define INT_34XX_BENCH_MPU_EMUL 3 | ||
313 | #define INT_34XX_ST_MCBSP2_IRQ 4 | ||
314 | #define INT_34XX_ST_MCBSP3_IRQ 5 | ||
315 | #define INT_34XX_SSM_ABORT_IRQ 6 | ||
316 | #define INT_34XX_SYS_NIRQ 7 | ||
317 | #define INT_34XX_D2D_FW_IRQ 8 | ||
318 | #define INT_34XX_L3_DBG_IRQ 9 | ||
319 | #define INT_34XX_L3_APP_IRQ 10 | ||
320 | #define INT_34XX_PRCM_MPU_IRQ 11 | ||
321 | #define INT_34XX_MCBSP1_IRQ 16 | ||
322 | #define INT_34XX_MCBSP2_IRQ 17 | ||
323 | #define INT_34XX_GPMC_IRQ 20 | ||
324 | #define INT_34XX_MCBSP3_IRQ 22 | ||
325 | #define INT_34XX_MCBSP4_IRQ 23 | ||
326 | #define INT_34XX_CAM_IRQ 24 | ||
327 | #define INT_34XX_MCBSP5_IRQ 27 | ||
328 | #define INT_34XX_GPIO_BANK1 29 | ||
329 | #define INT_34XX_GPIO_BANK2 30 | ||
330 | #define INT_34XX_GPIO_BANK3 31 | ||
331 | #define INT_34XX_GPIO_BANK4 32 | ||
332 | #define INT_34XX_GPIO_BANK5 33 | ||
333 | #define INT_34XX_GPIO_BANK6 34 | ||
334 | #define INT_34XX_USIM_IRQ 35 | ||
335 | #define INT_34XX_WDT3_IRQ 36 | ||
336 | #define INT_34XX_SPI4_IRQ 48 | ||
337 | #define INT_34XX_SHA1MD52_IRQ 49 | ||
338 | #define INT_34XX_FPKA_READY_IRQ 50 | ||
339 | #define INT_34XX_SHA1MD51_IRQ 51 | ||
340 | #define INT_34XX_RNG_IRQ 52 | ||
341 | #define INT_34XX_I2C3_IRQ 61 | ||
342 | #define INT_34XX_FPKA_ERROR_IRQ 64 | ||
343 | #define INT_34XX_PBIAS_IRQ 75 | ||
344 | #define INT_34XX_OHCI_IRQ 76 | ||
345 | #define INT_34XX_EHCI_IRQ 77 | ||
346 | #define INT_34XX_TLL_IRQ 78 | ||
347 | #define INT_34XX_PARTHASH_IRQ 79 | ||
348 | #define INT_34XX_MMC3_IRQ 94 | ||
349 | #define INT_34XX_GPT12_IRQ 95 | ||
350 | |||
351 | #define INT_36XX_UART4_IRQ 80 | ||
352 | |||
353 | #define INT_35XX_HECC0_IRQ 24 | ||
354 | #define INT_35XX_HECC1_IRQ 28 | ||
355 | #define INT_35XX_EMAC_C0_RXTHRESH_IRQ 67 | ||
356 | #define INT_35XX_EMAC_C0_RX_PULSE_IRQ 68 | ||
357 | #define INT_35XX_EMAC_C0_TX_PULSE_IRQ 69 | ||
358 | #define INT_35XX_EMAC_C0_MISC_PULSE_IRQ 70 | ||
359 | #define INT_35XX_USBOTG_IRQ 71 | ||
360 | #define INT_35XX_UART4_IRQ 84 | ||
361 | #define INT_35XX_CCDC_VD0_IRQ 88 | ||
362 | #define INT_35XX_CCDC_VD1_IRQ 92 | ||
363 | #define INT_35XX_CCDC_VD2_IRQ 93 | ||
364 | |||
365 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and | ||
366 | * 16 MPUIO lines */ | ||
367 | #define OMAP_MAX_GPIO_LINES 192 | ||
368 | #define IH_GPIO_BASE (128 + IH2_BASE) | ||
369 | #define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE) | ||
370 | #define OMAP_IRQ_END (IH_MPUIO_BASE + 16) | ||
371 | |||
372 | /* External FPGA handles interrupts on Innovator boards */ | ||
373 | #define OMAP_FPGA_IRQ_BASE (OMAP_IRQ_END) | ||
374 | #ifdef CONFIG_MACH_OMAP_INNOVATOR | ||
375 | #define OMAP_FPGA_NR_IRQS 24 | ||
376 | #else | ||
377 | #define OMAP_FPGA_NR_IRQS 0 | ||
378 | #endif | ||
379 | #define OMAP_FPGA_IRQ_END (OMAP_FPGA_IRQ_BASE + OMAP_FPGA_NR_IRQS) | ||
380 | |||
381 | /* External TWL4030 can handle interrupts on 2430 and 34xx boards */ | ||
382 | #define TWL4030_IRQ_BASE (OMAP_FPGA_IRQ_END) | ||
383 | #ifdef CONFIG_TWL4030_CORE | ||
384 | #define TWL4030_BASE_NR_IRQS 8 | ||
385 | #define TWL4030_PWR_NR_IRQS 8 | ||
386 | #else | ||
387 | #define TWL4030_BASE_NR_IRQS 0 | ||
388 | #define TWL4030_PWR_NR_IRQS 0 | ||
389 | #endif | ||
390 | #define TWL4030_IRQ_END (TWL4030_IRQ_BASE + TWL4030_BASE_NR_IRQS) | ||
391 | #define TWL4030_PWR_IRQ_BASE TWL4030_IRQ_END | ||
392 | #define TWL4030_PWR_IRQ_END (TWL4030_PWR_IRQ_BASE + TWL4030_PWR_NR_IRQS) | ||
393 | |||
394 | /* External TWL4030 gpio interrupts are optional */ | ||
395 | #define TWL4030_GPIO_IRQ_BASE TWL4030_PWR_IRQ_END | ||
396 | #ifdef CONFIG_GPIO_TWL4030 | ||
397 | #define TWL4030_GPIO_NR_IRQS 18 | ||
398 | #else | ||
399 | #define TWL4030_GPIO_NR_IRQS 0 | ||
400 | #endif | ||
401 | #define TWL4030_GPIO_IRQ_END (TWL4030_GPIO_IRQ_BASE + TWL4030_GPIO_NR_IRQS) | ||
402 | |||
403 | #define TWL6030_IRQ_BASE (OMAP_FPGA_IRQ_END) | ||
404 | #ifdef CONFIG_TWL4030_CORE | ||
405 | #define TWL6030_BASE_NR_IRQS 20 | ||
406 | #else | ||
407 | #define TWL6030_BASE_NR_IRQS 0 | ||
408 | #endif | ||
409 | #define TWL6030_IRQ_END (TWL6030_IRQ_BASE + TWL6030_BASE_NR_IRQS) | ||
410 | |||
411 | #define TWL6040_CODEC_IRQ_BASE TWL6030_IRQ_END | ||
412 | #ifdef CONFIG_TWL6040_CODEC | ||
413 | #define TWL6040_CODEC_NR_IRQS 6 | ||
414 | #else | ||
415 | #define TWL6040_CODEC_NR_IRQS 0 | ||
416 | #endif | ||
417 | #define TWL6040_CODEC_IRQ_END (TWL6040_CODEC_IRQ_BASE + TWL6040_CODEC_NR_IRQS) | ||
418 | |||
419 | /* Total number of interrupts depends on the enabled blocks above */ | ||
420 | #if (TWL4030_GPIO_IRQ_END > TWL6040_CODEC_IRQ_END) | ||
421 | #define TWL_IRQ_END TWL4030_GPIO_IRQ_END | ||
422 | #else | ||
423 | #define TWL_IRQ_END TWL6040_CODEC_IRQ_END | ||
424 | #endif | ||
425 | |||
426 | /* GPMC related */ | ||
427 | #define OMAP_GPMC_IRQ_BASE (TWL_IRQ_END) | ||
428 | #define OMAP_GPMC_NR_IRQS 8 | ||
429 | #define OMAP_GPMC_IRQ_END (OMAP_GPMC_IRQ_BASE + OMAP_GPMC_NR_IRQS) | ||
430 | |||
431 | /* PRCM IRQ handler */ | ||
432 | #ifdef CONFIG_ARCH_OMAP2PLUS | ||
433 | #define OMAP_PRCM_IRQ_BASE (OMAP_GPMC_IRQ_END) | ||
434 | #define OMAP_PRCM_NR_IRQS 64 | ||
435 | #define OMAP_PRCM_IRQ_END (OMAP_PRCM_IRQ_BASE + OMAP_PRCM_NR_IRQS) | ||
436 | #else | ||
437 | #define OMAP_PRCM_IRQ_END OMAP_GPMC_IRQ_END | ||
438 | #endif | ||
439 | |||
440 | #define NR_IRQS OMAP_PRCM_IRQ_END | ||
441 | |||
442 | #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) | ||
443 | |||
444 | #define INTCPS_NR_MIR_REGS 3 | ||
445 | #define INTCPS_NR_IRQS 96 | ||
446 | |||
447 | #include <mach/hardware.h> | ||
448 | |||
449 | #ifdef CONFIG_FIQ | ||
450 | #define FIQ_START 1024 | ||
451 | #endif | ||
452 | |||
453 | #endif | ||
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h index eb3e4d555343..8b4e4f2da2f5 100644 --- a/arch/arm/plat-omap/include/plat/mmc.h +++ b/arch/arm/plat-omap/include/plat/mmc.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
16 | #include <linux/mmc/host.h> | 16 | #include <linux/mmc/host.h> |
17 | 17 | ||
18 | #include <plat/board.h> | ||
19 | #include <plat/omap_hwmod.h> | 18 | #include <plat/omap_hwmod.h> |
20 | 19 | ||
21 | #define OMAP15XX_NR_MMC 1 | 20 | #define OMAP15XX_NR_MMC 1 |
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index a531149823bb..f4a4cd014795 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h | |||
@@ -21,8 +21,6 @@ | |||
21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
22 | #include <linux/pm_qos.h> | 22 | #include <linux/pm_qos.h> |
23 | 23 | ||
24 | #include <plat/mux.h> | ||
25 | |||
26 | #define DRIVER_NAME "omap_uart" | 24 | #define DRIVER_NAME "omap_uart" |
27 | 25 | ||
28 | /* | 26 | /* |
@@ -54,7 +52,7 @@ | |||
54 | 52 | ||
55 | #define OMAP_UART_DMA_CH_FREE -1 | 53 | #define OMAP_UART_DMA_CH_FREE -1 |
56 | 54 | ||
57 | #define OMAP_MAX_HSUART_PORTS 4 | 55 | #define OMAP_MAX_HSUART_PORTS 6 |
58 | 56 | ||
59 | #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA | 57 | #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA |
60 | 58 | ||
diff --git a/arch/arm/plat-omap/include/plat/param.h b/arch/arm/plat-omap/include/plat/param.h deleted file mode 100644 index 1eb4dc326979..000000000000 --- a/arch/arm/plat-omap/include/plat/param.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/param.h | ||
3 | * | ||
4 | */ | ||
5 | |||
6 | #ifdef CONFIG_OMAP_32K_TIMER_HZ | ||
7 | #define HZ CONFIG_OMAP_32K_TIMER_HZ | ||
8 | #endif | ||
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index 548a4c8d63df..bd20588c356b 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h | |||
@@ -5,7 +5,6 @@ | |||
5 | 5 | ||
6 | #include <linux/io.h> | 6 | #include <linux/io.h> |
7 | #include <linux/usb/musb.h> | 7 | #include <linux/usb/musb.h> |
8 | #include <plat/board.h> | ||
9 | 8 | ||
10 | #define OMAP3_HS_USB_PORTS 3 | 9 | #define OMAP3_HS_USB_PORTS 3 |
11 | 10 | ||
diff --git a/arch/arm/plat-omap/mux.c b/arch/arm/plat-omap/mux.c deleted file mode 100644 index cff8712122bb..000000000000 --- a/arch/arm/plat-omap/mux.c +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-omap/mux.c | ||
3 | * | ||
4 | * Utility to set the Omap MUX and PULL_DWN registers from a table in mux.h | ||
5 | * | ||
6 | * Copyright (C) 2003 - 2008 Nokia Corporation | ||
7 | * | ||
8 | * Written by Tony Lindgren | ||
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 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | */ | ||
25 | #include <linux/module.h> | ||
26 | #include <linux/init.h> | ||
27 | #include <linux/kernel.h> | ||
28 | #include <linux/io.h> | ||
29 | #include <linux/spinlock.h> | ||
30 | |||
31 | #include <asm/system.h> | ||
32 | |||
33 | #include <plat/cpu.h> | ||
34 | #include <plat/mux.h> | ||
35 | |||
36 | #ifdef CONFIG_OMAP_MUX | ||
37 | |||
38 | static struct omap_mux_cfg *mux_cfg; | ||
39 | |||
40 | int __init omap_mux_register(struct omap_mux_cfg *arch_mux_cfg) | ||
41 | { | ||
42 | if (!arch_mux_cfg || !arch_mux_cfg->pins || arch_mux_cfg->size == 0 | ||
43 | || !arch_mux_cfg->cfg_reg) { | ||
44 | printk(KERN_ERR "Invalid pin table\n"); | ||
45 | return -EINVAL; | ||
46 | } | ||
47 | |||
48 | mux_cfg = arch_mux_cfg; | ||
49 | |||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | /* | ||
54 | * Sets the Omap MUX and PULL_DWN registers based on the table | ||
55 | */ | ||
56 | int __init_or_module omap_cfg_reg(const unsigned long index) | ||
57 | { | ||
58 | struct pin_config *reg; | ||
59 | |||
60 | if (!cpu_class_is_omap1()) { | ||
61 | printk(KERN_ERR "mux: Broken omap_cfg_reg(%lu) entry\n", | ||
62 | index); | ||
63 | WARN_ON(1); | ||
64 | return -EINVAL; | ||
65 | } | ||
66 | |||
67 | if (mux_cfg == NULL) { | ||
68 | printk(KERN_ERR "Pin mux table not initialized\n"); | ||
69 | return -ENODEV; | ||
70 | } | ||
71 | |||
72 | if (index >= mux_cfg->size) { | ||
73 | printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n", | ||
74 | index, mux_cfg->size); | ||
75 | dump_stack(); | ||
76 | return -ENODEV; | ||
77 | } | ||
78 | |||
79 | reg = (struct pin_config *)&mux_cfg->pins[index]; | ||
80 | |||
81 | if (!mux_cfg->cfg_reg) | ||
82 | return -ENODEV; | ||
83 | |||
84 | return mux_cfg->cfg_reg(reg); | ||
85 | } | ||
86 | EXPORT_SYMBOL(omap_cfg_reg); | ||
87 | #else | ||
88 | #define omap_mux_init() do {} while(0) | ||
89 | #define omap_cfg_reg(x) do {} while(0) | ||
90 | #endif /* CONFIG_OMAP_MUX */ | ||
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c index 5a97b4d98d41..9f6413324df9 100644 --- a/arch/arm/plat-omap/omap-pm-noop.c +++ b/arch/arm/plat-omap/omap-pm-noop.c | |||
@@ -41,11 +41,11 @@ int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t) | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | if (t == -1) | 43 | if (t == -1) |
44 | pr_debug("OMAP PM: remove max MPU wakeup latency constraint: " | 44 | pr_debug("OMAP PM: remove max MPU wakeup latency constraint: dev %s\n", |
45 | "dev %s\n", dev_name(dev)); | 45 | dev_name(dev)); |
46 | else | 46 | else |
47 | pr_debug("OMAP PM: add max MPU wakeup latency constraint: " | 47 | pr_debug("OMAP PM: add max MPU wakeup latency constraint: dev %s, t = %ld usec\n", |
48 | "dev %s, t = %ld usec\n", dev_name(dev), t); | 48 | dev_name(dev), t); |
49 | 49 | ||
50 | /* | 50 | /* |
51 | * For current Linux, this needs to map the MPU to a | 51 | * For current Linux, this needs to map the MPU to a |
@@ -70,11 +70,10 @@ int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r) | |||
70 | }; | 70 | }; |
71 | 71 | ||
72 | if (r == 0) | 72 | if (r == 0) |
73 | pr_debug("OMAP PM: remove min bus tput constraint: " | 73 | pr_debug("OMAP PM: remove min bus tput constraint: dev %s for agent_id %d\n", |
74 | "dev %s for agent_id %d\n", dev_name(dev), agent_id); | 74 | dev_name(dev), agent_id); |
75 | else | 75 | else |
76 | pr_debug("OMAP PM: add min bus tput constraint: " | 76 | pr_debug("OMAP PM: add min bus tput constraint: dev %s for agent_id %d: rate %ld KiB\n", |
77 | "dev %s for agent_id %d: rate %ld KiB\n", | ||
78 | dev_name(dev), agent_id, r); | 77 | dev_name(dev), agent_id, r); |
79 | 78 | ||
80 | /* | 79 | /* |
@@ -97,11 +96,11 @@ int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev, | |||
97 | }; | 96 | }; |
98 | 97 | ||
99 | if (t == -1) | 98 | if (t == -1) |
100 | pr_debug("OMAP PM: remove max device latency constraint: " | 99 | pr_debug("OMAP PM: remove max device latency constraint: dev %s\n", |
101 | "dev %s\n", dev_name(dev)); | 100 | dev_name(dev)); |
102 | else | 101 | else |
103 | pr_debug("OMAP PM: add max device latency constraint: " | 102 | pr_debug("OMAP PM: add max device latency constraint: dev %s, t = %ld usec\n", |
104 | "dev %s, t = %ld usec\n", dev_name(dev), t); | 103 | dev_name(dev), t); |
105 | 104 | ||
106 | /* | 105 | /* |
107 | * For current Linux, this needs to map the device to a | 106 | * For current Linux, this needs to map the device to a |
@@ -127,11 +126,11 @@ int omap_pm_set_max_sdma_lat(struct device *dev, long t) | |||
127 | }; | 126 | }; |
128 | 127 | ||
129 | if (t == -1) | 128 | if (t == -1) |
130 | pr_debug("OMAP PM: remove max DMA latency constraint: " | 129 | pr_debug("OMAP PM: remove max DMA latency constraint: dev %s\n", |
131 | "dev %s\n", dev_name(dev)); | 130 | dev_name(dev)); |
132 | else | 131 | else |
133 | pr_debug("OMAP PM: add max DMA latency constraint: " | 132 | pr_debug("OMAP PM: add max DMA latency constraint: dev %s, t = %ld usec\n", |
134 | "dev %s, t = %ld usec\n", dev_name(dev), t); | 133 | dev_name(dev), t); |
135 | 134 | ||
136 | /* | 135 | /* |
137 | * For current Linux PM QOS params, this code should scan the | 136 | * For current Linux PM QOS params, this code should scan the |
@@ -156,11 +155,11 @@ int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r) | |||
156 | } | 155 | } |
157 | 156 | ||
158 | if (r == 0) | 157 | if (r == 0) |
159 | pr_debug("OMAP PM: remove min clk rate constraint: " | 158 | pr_debug("OMAP PM: remove min clk rate constraint: dev %s\n", |
160 | "dev %s\n", dev_name(dev)); | 159 | dev_name(dev)); |
161 | else | 160 | else |
162 | pr_debug("OMAP PM: add min clk rate constraint: " | 161 | pr_debug("OMAP PM: add min clk rate constraint: dev %s, rate = %ld Hz\n", |
163 | "dev %s, rate = %ld Hz\n", dev_name(dev), r); | 162 | dev_name(dev), r); |
164 | 163 | ||
165 | /* | 164 | /* |
166 | * Code in a real implementation should keep track of these | 165 | * Code in a real implementation should keep track of these |
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index c490240bb82c..b59edb065c70 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | /* | 1 | /* |
3 | * omap_device implementation | 2 | * omap_device implementation |
4 | * | 3 | * |
@@ -153,21 +152,19 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) | |||
153 | act_lat = timespec_to_ns(&c); | 152 | act_lat = timespec_to_ns(&c); |
154 | 153 | ||
155 | dev_dbg(&od->pdev->dev, | 154 | dev_dbg(&od->pdev->dev, |
156 | "omap_device: pm_lat %d: activate: elapsed time " | 155 | "omap_device: pm_lat %d: activate: elapsed time %llu nsec\n", |
157 | "%llu nsec\n", od->pm_lat_level, act_lat); | 156 | od->pm_lat_level, act_lat); |
158 | 157 | ||
159 | if (act_lat > odpl->activate_lat) { | 158 | if (act_lat > odpl->activate_lat) { |
160 | odpl->activate_lat_worst = act_lat; | 159 | odpl->activate_lat_worst = act_lat; |
161 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { | 160 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { |
162 | odpl->activate_lat = act_lat; | 161 | odpl->activate_lat = act_lat; |
163 | dev_dbg(&od->pdev->dev, | 162 | dev_dbg(&od->pdev->dev, |
164 | "new worst case activate latency " | 163 | "new worst case activate latency %d: %llu\n", |
165 | "%d: %llu\n", | ||
166 | od->pm_lat_level, act_lat); | 164 | od->pm_lat_level, act_lat); |
167 | } else | 165 | } else |
168 | dev_warn(&od->pdev->dev, | 166 | dev_warn(&od->pdev->dev, |
169 | "activate latency %d " | 167 | "activate latency %d higher than expected. (%llu > %d)\n", |
170 | "higher than exptected. (%llu > %d)\n", | ||
171 | od->pm_lat_level, act_lat, | 168 | od->pm_lat_level, act_lat, |
172 | odpl->activate_lat); | 169 | odpl->activate_lat); |
173 | } | 170 | } |
@@ -220,21 +217,19 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) | |||
220 | deact_lat = timespec_to_ns(&c); | 217 | deact_lat = timespec_to_ns(&c); |
221 | 218 | ||
222 | dev_dbg(&od->pdev->dev, | 219 | dev_dbg(&od->pdev->dev, |
223 | "omap_device: pm_lat %d: deactivate: elapsed time " | 220 | "omap_device: pm_lat %d: deactivate: elapsed time %llu nsec\n", |
224 | "%llu nsec\n", od->pm_lat_level, deact_lat); | 221 | od->pm_lat_level, deact_lat); |
225 | 222 | ||
226 | if (deact_lat > odpl->deactivate_lat) { | 223 | if (deact_lat > odpl->deactivate_lat) { |
227 | odpl->deactivate_lat_worst = deact_lat; | 224 | odpl->deactivate_lat_worst = deact_lat; |
228 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { | 225 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { |
229 | odpl->deactivate_lat = deact_lat; | 226 | odpl->deactivate_lat = deact_lat; |
230 | dev_dbg(&od->pdev->dev, | 227 | dev_dbg(&od->pdev->dev, |
231 | "new worst case deactivate latency " | 228 | "new worst case deactivate latency %d: %llu\n", |
232 | "%d: %llu\n", | ||
233 | od->pm_lat_level, deact_lat); | 229 | od->pm_lat_level, deact_lat); |
234 | } else | 230 | } else |
235 | dev_warn(&od->pdev->dev, | 231 | dev_warn(&od->pdev->dev, |
236 | "deactivate latency %d " | 232 | "deactivate latency %d higher than expected. (%llu > %d)\n", |
237 | "higher than exptected. (%llu > %d)\n", | ||
238 | od->pm_lat_level, deact_lat, | 233 | od->pm_lat_level, deact_lat, |
239 | odpl->deactivate_lat); | 234 | odpl->deactivate_lat); |
240 | } | 235 | } |
@@ -449,8 +444,8 @@ static int omap_device_count_resources(struct omap_device *od) | |||
449 | for (i = 0; i < od->hwmods_cnt; i++) | 444 | for (i = 0; i < od->hwmods_cnt; i++) |
450 | c += omap_hwmod_count_resources(od->hwmods[i]); | 445 | c += omap_hwmod_count_resources(od->hwmods[i]); |
451 | 446 | ||
452 | pr_debug("omap_device: %s: counted %d total resources across %d " | 447 | pr_debug("omap_device: %s: counted %d total resources across %d hwmods\n", |
453 | "hwmods\n", od->pdev->name, c, od->hwmods_cnt); | 448 | od->pdev->name, c, od->hwmods_cnt); |
454 | 449 | ||
455 | return c; | 450 | return c; |
456 | } | 451 | } |
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 024f3b08db29..28acb383e7df 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | 27 | ||
28 | #include <plat/sram.h> | 28 | #include <plat/sram.h> |
29 | #include <plat/board.h> | ||
30 | #include <plat/cpu.h> | 29 | #include <plat/cpu.h> |
31 | 30 | ||
32 | #include "sram.h" | 31 | #include "sram.h" |
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 2195209aa543..fed07d27e0c9 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <media/s5p_hdmi.h> | 35 | #include <media/s5p_hdmi.h> |
36 | 36 | ||
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | #include <asm/pmu.h> | ||
39 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
40 | #include <asm/mach/map.h> | 39 | #include <asm/mach/map.h> |
41 | #include <asm/mach/irq.h> | 40 | #include <asm/mach/irq.h> |
@@ -1132,7 +1131,7 @@ static struct resource s5p_pmu_resource[] = { | |||
1132 | 1131 | ||
1133 | static struct platform_device s5p_device_pmu = { | 1132 | static struct platform_device s5p_device_pmu = { |
1134 | .name = "arm-pmu", | 1133 | .name = "arm-pmu", |
1135 | .id = ARM_PMU_DEVICE_CPU, | 1134 | .id = -1, |
1136 | .num_resources = ARRAY_SIZE(s5p_pmu_resource), | 1135 | .num_resources = ARRAY_SIZE(s5p_pmu_resource), |
1137 | .resource = s5p_pmu_resource, | 1136 | .resource = s5p_pmu_resource, |
1138 | }; | 1137 | }; |
diff --git a/arch/arm/plat-samsung/include/plat/gpio-fns.h b/arch/arm/plat-samsung/include/plat/gpio-fns.h index bab139201761..d1ecef0e38e0 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-fns.h +++ b/arch/arm/plat-samsung/include/plat/gpio-fns.h | |||
@@ -1,98 +1 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/gpio-fns.h | ||
2 | * | ||
3 | * Copyright (c) 2003-2009 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2410 - hardware | ||
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 | #ifndef __MACH_GPIO_FNS_H | ||
14 | #define __MACH_GPIO_FNS_H __FILE__ | ||
15 | |||
16 | /* These functions are in the to-be-removed category and it is strongly | ||
17 | * encouraged not to use these in new code. They will be marked deprecated | ||
18 | * very soon. | ||
19 | * | ||
20 | * Most of the functionality can be either replaced by the gpiocfg calls | ||
21 | * for the s3c platform or by the generic GPIOlib API. | ||
22 | * | ||
23 | * As of 2.6.35-rc, these will be removed, with the few drivers using them | ||
24 | * either replaced or given a wrapper until the calls can be removed. | ||
25 | */ | ||
26 | |||
27 | #include <plat/gpio-cfg.h> | #include <plat/gpio-cfg.h> | |
28 | |||
29 | static inline void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int cfg) | ||
30 | { | ||
31 | /* 1:1 mapping between cfgpin and setcfg calls at the moment */ | ||
32 | s3c_gpio_cfgpin(pin, cfg); | ||
33 | } | ||
34 | |||
35 | /* external functions for GPIO support | ||
36 | * | ||
37 | * These allow various different clients to access the same GPIO | ||
38 | * registers without conflicting. If your driver only owns the entire | ||
39 | * GPIO register, then it is safe to ioremap/__raw_{read|write} to it. | ||
40 | */ | ||
41 | |||
42 | extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); | ||
43 | |||
44 | /* s3c2410_gpio_getirq | ||
45 | * | ||
46 | * turn the given pin number into the corresponding IRQ number | ||
47 | * | ||
48 | * returns: | ||
49 | * < 0 = no interrupt for this pin | ||
50 | * >=0 = interrupt number for the pin | ||
51 | */ | ||
52 | |||
53 | extern int s3c2410_gpio_getirq(unsigned int pin); | ||
54 | |||
55 | /* s3c2410_gpio_irqfilter | ||
56 | * | ||
57 | * set the irq filtering on the given pin | ||
58 | * | ||
59 | * on = 0 => disable filtering | ||
60 | * 1 => enable filtering | ||
61 | * | ||
62 | * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with | ||
63 | * width of filter (0 through 63) | ||
64 | * | ||
65 | * | ||
66 | */ | ||
67 | |||
68 | extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, | ||
69 | unsigned int config); | ||
70 | |||
71 | /* s3c2410_gpio_pullup | ||
72 | * | ||
73 | * This call should be replaced with s3c_gpio_setpull(). | ||
74 | * | ||
75 | * As a note, there is currently no distinction between pull-up and pull-down | ||
76 | * in the s3c24xx series devices with only an on/off configuration. | ||
77 | */ | ||
78 | |||
79 | /* s3c2410_gpio_pullup | ||
80 | * | ||
81 | * configure the pull-up control on the given pin | ||
82 | * | ||
83 | * to = 1 => disable the pull-up | ||
84 | * 0 => enable the pull-up | ||
85 | * | ||
86 | * eg; | ||
87 | * | ||
88 | * s3c2410_gpio_pullup(S3C2410_GPB(0), 0); | ||
89 | * s3c2410_gpio_pullup(S3C2410_GPE(8), 0); | ||
90 | */ | ||
91 | |||
92 | extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); | ||
93 | |||
94 | extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); | ||
95 | |||
96 | extern unsigned int s3c2410_gpio_getpin(unsigned int pin); | ||
97 | |||
98 | #endif /* __MACH_GPIO_FNS_H */ | ||
diff --git a/arch/arm/plat-samsung/s5p-irq-gpioint.c b/arch/arm/plat-samsung/s5p-irq-gpioint.c index f9431fe5b06e..23557d30e44c 100644 --- a/arch/arm/plat-samsung/s5p-irq-gpioint.c +++ b/arch/arm/plat-samsung/s5p-irq-gpioint.c | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include <asm/mach/irq.h> | 25 | #include <asm/mach/irq.h> |
26 | 26 | ||
27 | #define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u) | 27 | #define GPIO_BASE(chip) ((void __iomem *)((unsigned long)((chip)->base) & 0xFFFFF000u)) |
28 | 28 | ||
29 | #define CON_OFFSET 0x700 | 29 | #define CON_OFFSET 0x700 |
30 | #define MASK_OFFSET 0x900 | 30 | #define MASK_OFFSET 0x900 |
@@ -153,7 +153,7 @@ static __init int s5p_gpioint_add(struct samsung_gpio_chip *chip) | |||
153 | bank->chips[group - bank->start] = chip; | 153 | bank->chips[group - bank->start] = chip; |
154 | 154 | ||
155 | gc = irq_alloc_generic_chip("s5p_gpioint", 1, chip->irq_base, | 155 | gc = irq_alloc_generic_chip("s5p_gpioint", 1, chip->irq_base, |
156 | (void __iomem *)GPIO_BASE(chip), | 156 | GPIO_BASE(chip), |
157 | handle_level_irq); | 157 | handle_level_irq); |
158 | if (!gc) | 158 | if (!gc) |
159 | return -ENOMEM; | 159 | return -ENOMEM; |
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 2997e56ce0dd..7bc7948c5432 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types | |||
@@ -158,7 +158,6 @@ edb9315a MACH_EDB9315A EDB9315A 772 | |||
158 | stargate2 MACH_STARGATE2 STARGATE2 774 | 158 | stargate2 MACH_STARGATE2 STARGATE2 774 |
159 | intelmote2 MACH_INTELMOTE2 INTELMOTE2 775 | 159 | intelmote2 MACH_INTELMOTE2 INTELMOTE2 775 |
160 | trizeps4 MACH_TRIZEPS4 TRIZEPS4 776 | 160 | trizeps4 MACH_TRIZEPS4 TRIZEPS4 776 |
161 | pnx4008 MACH_PNX4008 PNX4008 782 | ||
162 | cpuat91 MACH_CPUAT91 CPUAT91 787 | 161 | cpuat91 MACH_CPUAT91 CPUAT91 787 |
163 | iq81340sc MACH_IQ81340SC IQ81340SC 799 | 162 | iq81340sc MACH_IQ81340SC IQ81340SC 799 |
164 | iq81340mc MACH_IQ81340MC IQ81340MC 801 | 163 | iq81340mc MACH_IQ81340MC IQ81340MC 801 |
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index ae0561826137..2e1662777661 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
19 | 19 | ||
20 | #include "virt-dma.h" | 20 | #include "virt-dma.h" |
21 | |||
22 | #include <plat/cpu.h> | ||
21 | #include <plat/dma.h> | 23 | #include <plat/dma.h> |
22 | 24 | ||
23 | struct omap_dmadev { | 25 | struct omap_dmadev { |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 0725d181581f..94cbc842fbc3 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -25,11 +25,9 @@ | |||
25 | #include <linux/of.h> | 25 | #include <linux/of.h> |
26 | #include <linux/of_device.h> | 26 | #include <linux/of_device.h> |
27 | #include <linux/irqdomain.h> | 27 | #include <linux/irqdomain.h> |
28 | #include <linux/gpio.h> | ||
29 | #include <linux/platform_data/gpio-omap.h> | ||
28 | 30 | ||
29 | #include <mach/hardware.h> | ||
30 | #include <asm/irq.h> | ||
31 | #include <mach/irqs.h> | ||
32 | #include <asm/gpio.h> | ||
33 | #include <asm/mach/irq.h> | 31 | #include <asm/mach/irq.h> |
34 | 32 | ||
35 | #define OFF_MODE 1 | 33 | #define OFF_MODE 1 |
@@ -385,13 +383,16 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, | |||
385 | static int gpio_irq_type(struct irq_data *d, unsigned type) | 383 | static int gpio_irq_type(struct irq_data *d, unsigned type) |
386 | { | 384 | { |
387 | struct gpio_bank *bank = irq_data_get_irq_chip_data(d); | 385 | struct gpio_bank *bank = irq_data_get_irq_chip_data(d); |
388 | unsigned gpio; | 386 | unsigned gpio = 0; |
389 | int retval; | 387 | int retval; |
390 | unsigned long flags; | 388 | unsigned long flags; |
391 | 389 | ||
392 | if (!cpu_class_is_omap2() && d->irq > IH_MPUIO_BASE) | 390 | #ifdef CONFIG_ARCH_OMAP1 |
391 | if (d->irq > IH_MPUIO_BASE) | ||
393 | gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); | 392 | gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); |
394 | else | 393 | #endif |
394 | |||
395 | if (!gpio) | ||
395 | gpio = irq_to_gpio(bank, d->irq); | 396 | gpio = irq_to_gpio(bank, d->irq); |
396 | 397 | ||
397 | if (type & ~IRQ_TYPE_SENSE_MASK) | 398 | if (type & ~IRQ_TYPE_SENSE_MASK) |
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index ba126cc04073..1c169324e357 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c | |||
@@ -3131,46 +3131,6 @@ samsung_gpio_pull_t s3c_gpio_getpull(unsigned int pin) | |||
3131 | } | 3131 | } |
3132 | EXPORT_SYMBOL(s3c_gpio_getpull); | 3132 | EXPORT_SYMBOL(s3c_gpio_getpull); |
3133 | 3133 | ||
3134 | /* gpiolib wrappers until these are totally eliminated */ | ||
3135 | |||
3136 | void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) | ||
3137 | { | ||
3138 | int ret; | ||
3139 | |||
3140 | WARN_ON(to); /* should be none of these left */ | ||
3141 | |||
3142 | if (!to) { | ||
3143 | /* if pull is enabled, try first with up, and if that | ||
3144 | * fails, try using down */ | ||
3145 | |||
3146 | ret = s3c_gpio_setpull(pin, S3C_GPIO_PULL_UP); | ||
3147 | if (ret) | ||
3148 | s3c_gpio_setpull(pin, S3C_GPIO_PULL_DOWN); | ||
3149 | } else { | ||
3150 | s3c_gpio_setpull(pin, S3C_GPIO_PULL_NONE); | ||
3151 | } | ||
3152 | } | ||
3153 | EXPORT_SYMBOL(s3c2410_gpio_pullup); | ||
3154 | |||
3155 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) | ||
3156 | { | ||
3157 | /* do this via gpiolib until all users removed */ | ||
3158 | |||
3159 | gpio_request(pin, "temporary"); | ||
3160 | gpio_set_value(pin, to); | ||
3161 | gpio_free(pin); | ||
3162 | } | ||
3163 | EXPORT_SYMBOL(s3c2410_gpio_setpin); | ||
3164 | |||
3165 | unsigned int s3c2410_gpio_getpin(unsigned int pin) | ||
3166 | { | ||
3167 | struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin); | ||
3168 | unsigned long offs = pin - chip->chip.base; | ||
3169 | |||
3170 | return __raw_readl(chip->base + 0x04) & (1 << offs); | ||
3171 | } | ||
3172 | EXPORT_SYMBOL(s3c2410_gpio_getpin); | ||
3173 | |||
3174 | #ifdef CONFIG_S5P_GPIO_DRVSTR | 3134 | #ifdef CONFIG_S5P_GPIO_DRVSTR |
3175 | s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin) | 3135 | s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin) |
3176 | { | 3136 | { |
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index dc5184d57892..d982593d7563 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c | |||
@@ -30,9 +30,6 @@ | |||
30 | 30 | ||
31 | #include <asm/mach/irq.h> | 31 | #include <asm/mach/irq.h> |
32 | 32 | ||
33 | #include <mach/iomap.h> | ||
34 | #include <mach/suspend.h> | ||
35 | |||
36 | #define GPIO_BANK(x) ((x) >> 5) | 33 | #define GPIO_BANK(x) ((x) >> 5) |
37 | #define GPIO_PORT(x) (((x) >> 3) & 0x3) | 34 | #define GPIO_PORT(x) (((x) >> 3) & 0x3) |
38 | #define GPIO_BIT(x) ((x) & 0x7) | 35 | #define GPIO_BIT(x) ((x) & 0x7) |
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c index 94256fe7bf36..f030880bc9bb 100644 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c | |||
@@ -51,6 +51,7 @@ | |||
51 | 51 | ||
52 | 52 | ||
53 | static struct gpio_chip twl_gpiochip; | 53 | static struct gpio_chip twl_gpiochip; |
54 | static int twl4030_gpio_base; | ||
54 | static int twl4030_gpio_irq_base; | 55 | static int twl4030_gpio_irq_base; |
55 | 56 | ||
56 | /* genirq interfaces are not available to modules */ | 57 | /* genirq interfaces are not available to modules */ |
@@ -428,8 +429,6 @@ no_irqs: | |||
428 | twl_gpiochip.dev = &pdev->dev; | 429 | twl_gpiochip.dev = &pdev->dev; |
429 | 430 | ||
430 | if (pdata) { | 431 | if (pdata) { |
431 | twl_gpiochip.base = pdata->gpio_base; | ||
432 | |||
433 | /* | 432 | /* |
434 | * NOTE: boards may waste power if they don't set pullups | 433 | * NOTE: boards may waste power if they don't set pullups |
435 | * and pulldowns correctly ... default for non-ULPI pins is | 434 | * and pulldowns correctly ... default for non-ULPI pins is |
@@ -461,15 +460,21 @@ no_irqs: | |||
461 | dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret); | 460 | dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret); |
462 | twl_gpiochip.ngpio = 0; | 461 | twl_gpiochip.ngpio = 0; |
463 | gpio_twl4030_remove(pdev); | 462 | gpio_twl4030_remove(pdev); |
464 | } else if (pdata && pdata->setup) { | 463 | goto out; |
464 | } | ||
465 | |||
466 | twl4030_gpio_base = twl_gpiochip.base; | ||
467 | |||
468 | if (pdata && pdata->setup) { | ||
465 | int status; | 469 | int status; |
466 | 470 | ||
467 | status = pdata->setup(&pdev->dev, | 471 | status = pdata->setup(&pdev->dev, |
468 | pdata->gpio_base, TWL4030_GPIO_MAX); | 472 | twl4030_gpio_base, TWL4030_GPIO_MAX); |
469 | if (status) | 473 | if (status) |
470 | dev_dbg(&pdev->dev, "setup --> %d\n", status); | 474 | dev_dbg(&pdev->dev, "setup --> %d\n", status); |
471 | } | 475 | } |
472 | 476 | ||
477 | out: | ||
473 | return ret; | 478 | return ret; |
474 | } | 479 | } |
475 | 480 | ||
@@ -481,7 +486,7 @@ static int gpio_twl4030_remove(struct platform_device *pdev) | |||
481 | 486 | ||
482 | if (pdata && pdata->teardown) { | 487 | if (pdata && pdata->teardown) { |
483 | status = pdata->teardown(&pdev->dev, | 488 | status = pdata->teardown(&pdev->dev, |
484 | pdata->gpio_base, TWL4030_GPIO_MAX); | 489 | twl4030_gpio_base, TWL4030_GPIO_MAX); |
485 | if (status) { | 490 | if (status) { |
486 | dev_dbg(&pdev->dev, "teardown --> %d\n", status); | 491 | dev_dbg(&pdev->dev, "teardown --> %d\n", status); |
487 | return status; | 492 | return status; |
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 970a1612e795..42d9fdd63de0 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -551,7 +551,7 @@ config I2C_PMCMSP | |||
551 | 551 | ||
552 | config I2C_PNX | 552 | config I2C_PNX |
553 | tristate "I2C bus support for Philips PNX and NXP LPC targets" | 553 | tristate "I2C bus support for Philips PNX and NXP LPC targets" |
554 | depends on ARCH_PNX4008 || ARCH_LPC32XX | 554 | depends on ARCH_LPC32XX |
555 | help | 555 | help |
556 | This driver supports the Philips IP3204 I2C IP block master and/or | 556 | This driver supports the Philips IP3204 I2C IP block master and/or |
557 | slave controller | 557 | slave controller |
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index 93f147a96b62..2f99613fd677 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c | |||
@@ -4,13 +4,13 @@ | |||
4 | /* Copyright (C) 2003 Peter Milne, D-TACQ Solutions Ltd | 4 | /* Copyright (C) 2003 Peter Milne, D-TACQ Solutions Ltd |
5 | * <Peter dot Milne at D hyphen TACQ dot com> | 5 | * <Peter dot Milne at D hyphen TACQ dot com> |
6 | * | 6 | * |
7 | * With acknowledgements to i2c-algo-ibm_ocp.c by | 7 | * With acknowledgements to i2c-algo-ibm_ocp.c by |
8 | * Ian DaSilva, MontaVista Software, Inc. idasilva@mvista.com | 8 | * Ian DaSilva, MontaVista Software, Inc. idasilva@mvista.com |
9 | * | 9 | * |
10 | * And i2c-algo-pcf.c, which was created by Simon G. Vogl and Hans Berglund: | 10 | * And i2c-algo-pcf.c, which was created by Simon G. Vogl and Hans Berglund: |
11 | * | 11 | * |
12 | * Copyright (C) 1995-1997 Simon G. Vogl, 1998-2000 Hans Berglund | 12 | * Copyright (C) 1995-1997 Simon G. Vogl, 1998-2000 Hans Berglund |
13 | * | 13 | * |
14 | * And which acknowledged Kyösti Mälkki <kmalkki@cc.hut.fi>, | 14 | * And which acknowledged Kyösti Mälkki <kmalkki@cc.hut.fi>, |
15 | * Frodo Looijaard <frodol@dds.nl>, Martin Bailey<mbailey@littlefeet-inc.com> | 15 | * Frodo Looijaard <frodol@dds.nl>, Martin Bailey<mbailey@littlefeet-inc.com> |
16 | * | 16 | * |
@@ -39,14 +39,15 @@ | |||
39 | #include <linux/platform_device.h> | 39 | #include <linux/platform_device.h> |
40 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
41 | #include <linux/io.h> | 41 | #include <linux/io.h> |
42 | #include <linux/gpio.h> | ||
42 | 43 | ||
43 | #include "i2c-iop3xx.h" | 44 | #include "i2c-iop3xx.h" |
44 | 45 | ||
45 | /* global unit counter */ | 46 | /* global unit counter */ |
46 | static int i2c_id; | 47 | static int i2c_id; |
47 | 48 | ||
48 | static inline unsigned char | 49 | static inline unsigned char |
49 | iic_cook_addr(struct i2c_msg *msg) | 50 | iic_cook_addr(struct i2c_msg *msg) |
50 | { | 51 | { |
51 | unsigned char addr; | 52 | unsigned char addr; |
52 | 53 | ||
@@ -55,38 +56,38 @@ iic_cook_addr(struct i2c_msg *msg) | |||
55 | if (msg->flags & I2C_M_RD) | 56 | if (msg->flags & I2C_M_RD) |
56 | addr |= 1; | 57 | addr |= 1; |
57 | 58 | ||
58 | return addr; | 59 | return addr; |
59 | } | 60 | } |
60 | 61 | ||
61 | static void | 62 | static void |
62 | iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap) | 63 | iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap) |
63 | { | 64 | { |
64 | /* Follows devman 9.3 */ | 65 | /* Follows devman 9.3 */ |
65 | __raw_writel(IOP3XX_ICR_UNIT_RESET, iop3xx_adap->ioaddr + CR_OFFSET); | 66 | __raw_writel(IOP3XX_ICR_UNIT_RESET, iop3xx_adap->ioaddr + CR_OFFSET); |
66 | __raw_writel(IOP3XX_ISR_CLEARBITS, iop3xx_adap->ioaddr + SR_OFFSET); | 67 | __raw_writel(IOP3XX_ISR_CLEARBITS, iop3xx_adap->ioaddr + SR_OFFSET); |
67 | __raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET); | 68 | __raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET); |
68 | } | 69 | } |
69 | 70 | ||
70 | static void | 71 | static void |
71 | iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) | 72 | iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) |
72 | { | 73 | { |
73 | u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE; | 74 | u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE; |
74 | 75 | ||
75 | /* | 76 | /* |
76 | * Every time unit enable is asserted, GPOD needs to be cleared | 77 | * Every time unit enable is asserted, GPOD needs to be cleared |
77 | * on IOP3XX to avoid data corruption on the bus. | 78 | * on IOP3XX to avoid data corruption on the bus. |
78 | */ | 79 | */ |
79 | #if defined(CONFIG_ARCH_IOP32X) || defined(CONFIG_ARCH_IOP33X) | 80 | #if defined(CONFIG_ARCH_IOP32X) || defined(CONFIG_ARCH_IOP33X) |
80 | if (iop3xx_adap->id == 0) { | 81 | if (iop3xx_adap->id == 0) { |
81 | gpio_line_set(IOP3XX_GPIO_LINE(7), GPIO_LOW); | 82 | gpio_set_value(7, 0); |
82 | gpio_line_set(IOP3XX_GPIO_LINE(6), GPIO_LOW); | 83 | gpio_set_value(6, 0); |
83 | } else { | 84 | } else { |
84 | gpio_line_set(IOP3XX_GPIO_LINE(5), GPIO_LOW); | 85 | gpio_set_value(5, 0); |
85 | gpio_line_set(IOP3XX_GPIO_LINE(4), GPIO_LOW); | 86 | gpio_set_value(4, 0); |
86 | } | 87 | } |
87 | #endif | 88 | #endif |
88 | /* NB SR bits not same position as CR IE bits :-( */ | 89 | /* NB SR bits not same position as CR IE bits :-( */ |
89 | iop3xx_adap->SR_enabled = | 90 | iop3xx_adap->SR_enabled = |
90 | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD | | 91 | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD | |
91 | IOP3XX_ISR_RXFULL | IOP3XX_ISR_TXEMPTY; | 92 | IOP3XX_ISR_RXFULL | IOP3XX_ISR_TXEMPTY; |
92 | 93 | ||
@@ -96,23 +97,23 @@ iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) | |||
96 | __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); | 97 | __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); |
97 | } | 98 | } |
98 | 99 | ||
99 | static void | 100 | static void |
100 | iop3xx_i2c_transaction_cleanup(struct i2c_algo_iop3xx_data *iop3xx_adap) | 101 | iop3xx_i2c_transaction_cleanup(struct i2c_algo_iop3xx_data *iop3xx_adap) |
101 | { | 102 | { |
102 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); | 103 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); |
103 | 104 | ||
104 | cr &= ~(IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE | | 105 | cr &= ~(IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE | |
105 | IOP3XX_ICR_MSTOP | IOP3XX_ICR_SCLEN); | 106 | IOP3XX_ICR_MSTOP | IOP3XX_ICR_SCLEN); |
106 | 107 | ||
107 | __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); | 108 | __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); |
108 | } | 109 | } |
109 | 110 | ||
110 | /* | 111 | /* |
111 | * NB: the handler has to clear the source of the interrupt! | 112 | * NB: the handler has to clear the source of the interrupt! |
112 | * Then it passes the SR flags of interest to BH via adap data | 113 | * Then it passes the SR flags of interest to BH via adap data |
113 | */ | 114 | */ |
114 | static irqreturn_t | 115 | static irqreturn_t |
115 | iop3xx_i2c_irq_handler(int this_irq, void *dev_id) | 116 | iop3xx_i2c_irq_handler(int this_irq, void *dev_id) |
116 | { | 117 | { |
117 | struct i2c_algo_iop3xx_data *iop3xx_adap = dev_id; | 118 | struct i2c_algo_iop3xx_data *iop3xx_adap = dev_id; |
118 | u32 sr = __raw_readl(iop3xx_adap->ioaddr + SR_OFFSET); | 119 | u32 sr = __raw_readl(iop3xx_adap->ioaddr + SR_OFFSET); |
@@ -126,7 +127,7 @@ iop3xx_i2c_irq_handler(int this_irq, void *dev_id) | |||
126 | } | 127 | } |
127 | 128 | ||
128 | /* check all error conditions, clear them , report most important */ | 129 | /* check all error conditions, clear them , report most important */ |
129 | static int | 130 | static int |
130 | iop3xx_i2c_error(u32 sr) | 131 | iop3xx_i2c_error(u32 sr) |
131 | { | 132 | { |
132 | int rc = 0; | 133 | int rc = 0; |
@@ -135,12 +136,12 @@ iop3xx_i2c_error(u32 sr) | |||
135 | if ( !rc ) rc = -I2C_ERR_BERR; | 136 | if ( !rc ) rc = -I2C_ERR_BERR; |
136 | } | 137 | } |
137 | if ((sr & IOP3XX_ISR_ALD)) { | 138 | if ((sr & IOP3XX_ISR_ALD)) { |
138 | if ( !rc ) rc = -I2C_ERR_ALD; | 139 | if ( !rc ) rc = -I2C_ERR_ALD; |
139 | } | 140 | } |
140 | return rc; | 141 | return rc; |
141 | } | 142 | } |
142 | 143 | ||
143 | static inline u32 | 144 | static inline u32 |
144 | iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap) | 145 | iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap) |
145 | { | 146 | { |
146 | unsigned long flags; | 147 | unsigned long flags; |
@@ -161,8 +162,8 @@ iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap) | |||
161 | typedef int (* compare_func)(unsigned test, unsigned mask); | 162 | typedef int (* compare_func)(unsigned test, unsigned mask); |
162 | /* returns 1 on correct comparison */ | 163 | /* returns 1 on correct comparison */ |
163 | 164 | ||
164 | static int | 165 | static int |
165 | iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap, | 166 | iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap, |
166 | unsigned flags, unsigned* status, | 167 | unsigned flags, unsigned* status, |
167 | compare_func compare) | 168 | compare_func compare) |
168 | { | 169 | { |
@@ -192,47 +193,47 @@ iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap, | |||
192 | } | 193 | } |
193 | 194 | ||
194 | /* | 195 | /* |
195 | * Concrete compare_funcs | 196 | * Concrete compare_funcs |
196 | */ | 197 | */ |
197 | static int | 198 | static int |
198 | all_bits_clear(unsigned test, unsigned mask) | 199 | all_bits_clear(unsigned test, unsigned mask) |
199 | { | 200 | { |
200 | return (test & mask) == 0; | 201 | return (test & mask) == 0; |
201 | } | 202 | } |
202 | 203 | ||
203 | static int | 204 | static int |
204 | any_bits_set(unsigned test, unsigned mask) | 205 | any_bits_set(unsigned test, unsigned mask) |
205 | { | 206 | { |
206 | return (test & mask) != 0; | 207 | return (test & mask) != 0; |
207 | } | 208 | } |
208 | 209 | ||
209 | static int | 210 | static int |
210 | iop3xx_i2c_wait_tx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) | 211 | iop3xx_i2c_wait_tx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) |
211 | { | 212 | { |
212 | return iop3xx_i2c_wait_event( | 213 | return iop3xx_i2c_wait_event( |
213 | iop3xx_adap, | 214 | iop3xx_adap, |
214 | IOP3XX_ISR_TXEMPTY | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, | 215 | IOP3XX_ISR_TXEMPTY | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, |
215 | status, any_bits_set); | 216 | status, any_bits_set); |
216 | } | 217 | } |
217 | 218 | ||
218 | static int | 219 | static int |
219 | iop3xx_i2c_wait_rx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) | 220 | iop3xx_i2c_wait_rx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) |
220 | { | 221 | { |
221 | return iop3xx_i2c_wait_event( | 222 | return iop3xx_i2c_wait_event( |
222 | iop3xx_adap, | 223 | iop3xx_adap, |
223 | IOP3XX_ISR_RXFULL | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, | 224 | IOP3XX_ISR_RXFULL | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, |
224 | status, any_bits_set); | 225 | status, any_bits_set); |
225 | } | 226 | } |
226 | 227 | ||
227 | static int | 228 | static int |
228 | iop3xx_i2c_wait_idle(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) | 229 | iop3xx_i2c_wait_idle(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) |
229 | { | 230 | { |
230 | return iop3xx_i2c_wait_event( | 231 | return iop3xx_i2c_wait_event( |
231 | iop3xx_adap, IOP3XX_ISR_UNITBUSY, status, all_bits_clear); | 232 | iop3xx_adap, IOP3XX_ISR_UNITBUSY, status, all_bits_clear); |
232 | } | 233 | } |
233 | 234 | ||
234 | static int | 235 | static int |
235 | iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, | 236 | iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, |
236 | struct i2c_msg* msg) | 237 | struct i2c_msg* msg) |
237 | { | 238 | { |
238 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); | 239 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); |
@@ -247,7 +248,7 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, | |||
247 | } | 248 | } |
248 | 249 | ||
249 | __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET); | 250 | __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET); |
250 | 251 | ||
251 | cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK); | 252 | cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK); |
252 | cr |= IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE; | 253 | cr |= IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE; |
253 | 254 | ||
@@ -257,8 +258,8 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, | |||
257 | return rc; | 258 | return rc; |
258 | } | 259 | } |
259 | 260 | ||
260 | static int | 261 | static int |
261 | iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte, | 262 | iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte, |
262 | int stop) | 263 | int stop) |
263 | { | 264 | { |
264 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); | 265 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); |
@@ -277,10 +278,10 @@ iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte, | |||
277 | rc = iop3xx_i2c_wait_tx_done(iop3xx_adap, &status); | 278 | rc = iop3xx_i2c_wait_tx_done(iop3xx_adap, &status); |
278 | 279 | ||
279 | return rc; | 280 | return rc; |
280 | } | 281 | } |
281 | 282 | ||
282 | static int | 283 | static int |
283 | iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte, | 284 | iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte, |
284 | int stop) | 285 | int stop) |
285 | { | 286 | { |
286 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); | 287 | unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); |
@@ -304,19 +305,19 @@ iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte, | |||
304 | return rc; | 305 | return rc; |
305 | } | 306 | } |
306 | 307 | ||
307 | static int | 308 | static int |
308 | iop3xx_i2c_writebytes(struct i2c_adapter *i2c_adap, const char *buf, int count) | 309 | iop3xx_i2c_writebytes(struct i2c_adapter *i2c_adap, const char *buf, int count) |
309 | { | 310 | { |
310 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; | 311 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; |
311 | int ii; | 312 | int ii; |
312 | int rc = 0; | 313 | int rc = 0; |
313 | 314 | ||
314 | for (ii = 0; rc == 0 && ii != count; ++ii) | 315 | for (ii = 0; rc == 0 && ii != count; ++ii) |
315 | rc = iop3xx_i2c_write_byte(iop3xx_adap, buf[ii], ii==count-1); | 316 | rc = iop3xx_i2c_write_byte(iop3xx_adap, buf[ii], ii==count-1); |
316 | return rc; | 317 | return rc; |
317 | } | 318 | } |
318 | 319 | ||
319 | static int | 320 | static int |
320 | iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) | 321 | iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) |
321 | { | 322 | { |
322 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; | 323 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; |
@@ -325,7 +326,7 @@ iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) | |||
325 | 326 | ||
326 | for (ii = 0; rc == 0 && ii != count; ++ii) | 327 | for (ii = 0; rc == 0 && ii != count; ++ii) |
327 | rc = iop3xx_i2c_read_byte(iop3xx_adap, &buf[ii], ii==count-1); | 328 | rc = iop3xx_i2c_read_byte(iop3xx_adap, &buf[ii], ii==count-1); |
328 | 329 | ||
329 | return rc; | 330 | return rc; |
330 | } | 331 | } |
331 | 332 | ||
@@ -336,8 +337,8 @@ iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) | |||
336 | * Each transfer (i.e. a read or a write) is separated by a repeated start | 337 | * Each transfer (i.e. a read or a write) is separated by a repeated start |
337 | * condition. | 338 | * condition. |
338 | */ | 339 | */ |
339 | static int | 340 | static int |
340 | iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg) | 341 | iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg) |
341 | { | 342 | { |
342 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; | 343 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; |
343 | int rc; | 344 | int rc; |
@@ -357,8 +358,8 @@ iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg) | |||
357 | /* | 358 | /* |
358 | * master_xfer() - main read/write entry | 359 | * master_xfer() - main read/write entry |
359 | */ | 360 | */ |
360 | static int | 361 | static int |
361 | iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, | 362 | iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, |
362 | int num) | 363 | int num) |
363 | { | 364 | { |
364 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; | 365 | struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; |
@@ -375,14 +376,14 @@ iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, | |||
375 | } | 376 | } |
376 | 377 | ||
377 | iop3xx_i2c_transaction_cleanup(iop3xx_adap); | 378 | iop3xx_i2c_transaction_cleanup(iop3xx_adap); |
378 | 379 | ||
379 | if(ret) | 380 | if(ret) |
380 | return ret; | 381 | return ret; |
381 | 382 | ||
382 | return im; | 383 | return im; |
383 | } | 384 | } |
384 | 385 | ||
385 | static u32 | 386 | static u32 |
386 | iop3xx_i2c_func(struct i2c_adapter *adap) | 387 | iop3xx_i2c_func(struct i2c_adapter *adap) |
387 | { | 388 | { |
388 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | 389 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; |
@@ -393,11 +394,11 @@ static const struct i2c_algorithm iop3xx_i2c_algo = { | |||
393 | .functionality = iop3xx_i2c_func, | 394 | .functionality = iop3xx_i2c_func, |
394 | }; | 395 | }; |
395 | 396 | ||
396 | static int | 397 | static int |
397 | iop3xx_i2c_remove(struct platform_device *pdev) | 398 | iop3xx_i2c_remove(struct platform_device *pdev) |
398 | { | 399 | { |
399 | struct i2c_adapter *padapter = platform_get_drvdata(pdev); | 400 | struct i2c_adapter *padapter = platform_get_drvdata(pdev); |
400 | struct i2c_algo_iop3xx_data *adapter_data = | 401 | struct i2c_algo_iop3xx_data *adapter_data = |
401 | (struct i2c_algo_iop3xx_data *)padapter->algo_data; | 402 | (struct i2c_algo_iop3xx_data *)padapter->algo_data; |
402 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 403 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
403 | unsigned long cr = __raw_readl(adapter_data->ioaddr + CR_OFFSET); | 404 | unsigned long cr = __raw_readl(adapter_data->ioaddr + CR_OFFSET); |
@@ -419,7 +420,7 @@ iop3xx_i2c_remove(struct platform_device *pdev) | |||
419 | return 0; | 420 | return 0; |
420 | } | 421 | } |
421 | 422 | ||
422 | static int | 423 | static int |
423 | iop3xx_i2c_probe(struct platform_device *pdev) | 424 | iop3xx_i2c_probe(struct platform_device *pdev) |
424 | { | 425 | { |
425 | struct resource *res; | 426 | struct resource *res; |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index c50fa75416f8..b4b65af8612a 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
@@ -533,7 +533,7 @@ config KEYBOARD_DAVINCI | |||
533 | 533 | ||
534 | config KEYBOARD_OMAP | 534 | config KEYBOARD_OMAP |
535 | tristate "TI OMAP keypad support" | 535 | tristate "TI OMAP keypad support" |
536 | depends on (ARCH_OMAP1 || ARCH_OMAP2) | 536 | depends on ARCH_OMAP1 |
537 | select INPUT_MATRIXKMAP | 537 | select INPUT_MATRIXKMAP |
538 | help | 538 | help |
539 | Say Y here if you want to use the OMAP keypad. | 539 | Say Y here if you want to use the OMAP keypad. |
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index a0222db4dc86..6d6b1427ae12 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c | |||
@@ -35,13 +35,9 @@ | |||
35 | #include <linux/mutex.h> | 35 | #include <linux/mutex.h> |
36 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
37 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
38 | #include <asm/gpio.h> | 38 | #include <linux/gpio.h> |
39 | #include <plat/keypad.h> | 39 | #include <linux/platform_data/gpio-omap.h> |
40 | #include <plat/menelaus.h> | 40 | #include <linux/platform_data/keypad-omap.h> |
41 | #include <asm/irq.h> | ||
42 | #include <mach/hardware.h> | ||
43 | #include <asm/io.h> | ||
44 | #include <plat/mux.h> | ||
45 | 41 | ||
46 | #undef NEW_BOARD_LEARNING_MODE | 42 | #undef NEW_BOARD_LEARNING_MODE |
47 | 43 | ||
@@ -96,28 +92,8 @@ static u8 get_row_gpio_val(struct omap_kp *omap_kp) | |||
96 | 92 | ||
97 | static irqreturn_t omap_kp_interrupt(int irq, void *dev_id) | 93 | static irqreturn_t omap_kp_interrupt(int irq, void *dev_id) |
98 | { | 94 | { |
99 | struct omap_kp *omap_kp = dev_id; | ||
100 | |||
101 | /* disable keyboard interrupt and schedule for handling */ | 95 | /* disable keyboard interrupt and schedule for handling */ |
102 | if (cpu_is_omap24xx()) { | 96 | omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); |
103 | int i; | ||
104 | |||
105 | for (i = 0; i < omap_kp->rows; i++) { | ||
106 | int gpio_irq = gpio_to_irq(row_gpios[i]); | ||
107 | /* | ||
108 | * The interrupt which we're currently handling should | ||
109 | * be disabled _nosync() to avoid deadlocks waiting | ||
110 | * for this handler to complete. All others should | ||
111 | * be disabled the regular way for SMP safety. | ||
112 | */ | ||
113 | if (gpio_irq == irq) | ||
114 | disable_irq_nosync(gpio_irq); | ||
115 | else | ||
116 | disable_irq(gpio_irq); | ||
117 | } | ||
118 | } else | ||
119 | /* disable keyboard interrupt and schedule for handling */ | ||
120 | omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); | ||
121 | 97 | ||
122 | tasklet_schedule(&kp_tasklet); | 98 | tasklet_schedule(&kp_tasklet); |
123 | 99 | ||
@@ -133,33 +109,22 @@ static void omap_kp_scan_keypad(struct omap_kp *omap_kp, unsigned char *state) | |||
133 | { | 109 | { |
134 | int col = 0; | 110 | int col = 0; |
135 | 111 | ||
136 | /* read the keypad status */ | 112 | /* disable keyboard interrupt and schedule for handling */ |
137 | if (cpu_is_omap24xx()) { | 113 | omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); |
138 | /* read the keypad status */ | ||
139 | for (col = 0; col < omap_kp->cols; col++) { | ||
140 | set_col_gpio_val(omap_kp, ~(1 << col)); | ||
141 | state[col] = ~(get_row_gpio_val(omap_kp)) & 0xff; | ||
142 | } | ||
143 | set_col_gpio_val(omap_kp, 0); | ||
144 | |||
145 | } else { | ||
146 | /* disable keyboard interrupt and schedule for handling */ | ||
147 | omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); | ||
148 | 114 | ||
149 | /* read the keypad status */ | 115 | /* read the keypad status */ |
150 | omap_writew(0xff, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBC); | 116 | omap_writew(0xff, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBC); |
151 | for (col = 0; col < omap_kp->cols; col++) { | 117 | for (col = 0; col < omap_kp->cols; col++) { |
152 | omap_writew(~(1 << col) & 0xff, | 118 | omap_writew(~(1 << col) & 0xff, |
153 | OMAP1_MPUIO_BASE + OMAP_MPUIO_KBC); | 119 | OMAP1_MPUIO_BASE + OMAP_MPUIO_KBC); |
154 | 120 | ||
155 | udelay(omap_kp->delay); | 121 | udelay(omap_kp->delay); |
156 | 122 | ||
157 | state[col] = ~omap_readw(OMAP1_MPUIO_BASE + | 123 | state[col] = ~omap_readw(OMAP1_MPUIO_BASE + |
158 | OMAP_MPUIO_KBR_LATCH) & 0xff; | 124 | OMAP_MPUIO_KBR_LATCH) & 0xff; |
159 | } | ||
160 | omap_writew(0x00, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBC); | ||
161 | udelay(2); | ||
162 | } | 125 | } |
126 | omap_writew(0x00, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBC); | ||
127 | udelay(2); | ||
163 | } | 128 | } |
164 | 129 | ||
165 | static void omap_kp_tasklet(unsigned long data) | 130 | static void omap_kp_tasklet(unsigned long data) |
@@ -222,14 +187,8 @@ static void omap_kp_tasklet(unsigned long data) | |||
222 | mod_timer(&omap_kp_data->timer, jiffies + delay); | 187 | mod_timer(&omap_kp_data->timer, jiffies + delay); |
223 | } else { | 188 | } else { |
224 | /* enable interrupts */ | 189 | /* enable interrupts */ |
225 | if (cpu_is_omap24xx()) { | 190 | omap_writew(0, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); |
226 | int i; | 191 | kp_cur_group = -1; |
227 | for (i = 0; i < omap_kp_data->rows; i++) | ||
228 | enable_irq(gpio_to_irq(row_gpios[i])); | ||
229 | } else { | ||
230 | omap_writew(0, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); | ||
231 | kp_cur_group = -1; | ||
232 | } | ||
233 | } | 192 | } |
234 | } | 193 | } |
235 | 194 | ||
@@ -242,6 +201,7 @@ static ssize_t omap_kp_enable_show(struct device *dev, | |||
242 | static ssize_t omap_kp_enable_store(struct device *dev, struct device_attribute *attr, | 201 | static ssize_t omap_kp_enable_store(struct device *dev, struct device_attribute *attr, |
243 | const char *buf, size_t count) | 202 | const char *buf, size_t count) |
244 | { | 203 | { |
204 | struct omap_kp *omap_kp = dev_get_drvdata(dev); | ||
245 | int state; | 205 | int state; |
246 | 206 | ||
247 | if (sscanf(buf, "%u", &state) != 1) | 207 | if (sscanf(buf, "%u", &state) != 1) |
@@ -253,9 +213,9 @@ static ssize_t omap_kp_enable_store(struct device *dev, struct device_attribute | |||
253 | mutex_lock(&kp_enable_mutex); | 213 | mutex_lock(&kp_enable_mutex); |
254 | if (state != kp_enable) { | 214 | if (state != kp_enable) { |
255 | if (state) | 215 | if (state) |
256 | enable_irq(INT_KEYBOARD); | 216 | enable_irq(omap_kp->irq); |
257 | else | 217 | else |
258 | disable_irq(INT_KEYBOARD); | 218 | disable_irq(omap_kp->irq); |
259 | kp_enable = state; | 219 | kp_enable = state; |
260 | } | 220 | } |
261 | mutex_unlock(&kp_enable_mutex); | 221 | mutex_unlock(&kp_enable_mutex); |
@@ -289,7 +249,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) | |||
289 | struct omap_kp *omap_kp; | 249 | struct omap_kp *omap_kp; |
290 | struct input_dev *input_dev; | 250 | struct input_dev *input_dev; |
291 | struct omap_kp_platform_data *pdata = pdev->dev.platform_data; | 251 | struct omap_kp_platform_data *pdata = pdev->dev.platform_data; |
292 | int i, col_idx, row_idx, irq_idx, ret; | 252 | int i, col_idx, row_idx, ret; |
293 | unsigned int row_shift, keycodemax; | 253 | unsigned int row_shift, keycodemax; |
294 | 254 | ||
295 | if (!pdata->rows || !pdata->cols || !pdata->keymap_data) { | 255 | if (!pdata->rows || !pdata->cols || !pdata->keymap_data) { |
@@ -314,8 +274,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) | |||
314 | omap_kp->input = input_dev; | 274 | omap_kp->input = input_dev; |
315 | 275 | ||
316 | /* Disable the interrupt for the MPUIO keyboard */ | 276 | /* Disable the interrupt for the MPUIO keyboard */ |
317 | if (!cpu_is_omap24xx()) | 277 | omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); |
318 | omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); | ||
319 | 278 | ||
320 | if (pdata->delay) | 279 | if (pdata->delay) |
321 | omap_kp->delay = pdata->delay; | 280 | omap_kp->delay = pdata->delay; |
@@ -328,31 +287,8 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) | |||
328 | omap_kp->rows = pdata->rows; | 287 | omap_kp->rows = pdata->rows; |
329 | omap_kp->cols = pdata->cols; | 288 | omap_kp->cols = pdata->cols; |
330 | 289 | ||
331 | if (cpu_is_omap24xx()) { | 290 | col_idx = 0; |
332 | /* Cols: outputs */ | 291 | row_idx = 0; |
333 | for (col_idx = 0; col_idx < omap_kp->cols; col_idx++) { | ||
334 | if (gpio_request(col_gpios[col_idx], "omap_kp_col") < 0) { | ||
335 | printk(KERN_ERR "Failed to request" | ||
336 | "GPIO%d for keypad\n", | ||
337 | col_gpios[col_idx]); | ||
338 | goto err1; | ||
339 | } | ||
340 | gpio_direction_output(col_gpios[col_idx], 0); | ||
341 | } | ||
342 | /* Rows: inputs */ | ||
343 | for (row_idx = 0; row_idx < omap_kp->rows; row_idx++) { | ||
344 | if (gpio_request(row_gpios[row_idx], "omap_kp_row") < 0) { | ||
345 | printk(KERN_ERR "Failed to request" | ||
346 | "GPIO%d for keypad\n", | ||
347 | row_gpios[row_idx]); | ||
348 | goto err2; | ||
349 | } | ||
350 | gpio_direction_input(row_gpios[row_idx]); | ||
351 | } | ||
352 | } else { | ||
353 | col_idx = 0; | ||
354 | row_idx = 0; | ||
355 | } | ||
356 | 292 | ||
357 | setup_timer(&omap_kp->timer, omap_kp_timer, (unsigned long)omap_kp); | 293 | setup_timer(&omap_kp->timer, omap_kp_timer, (unsigned long)omap_kp); |
358 | 294 | ||
@@ -394,27 +330,16 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) | |||
394 | 330 | ||
395 | /* scan current status and enable interrupt */ | 331 | /* scan current status and enable interrupt */ |
396 | omap_kp_scan_keypad(omap_kp, keypad_state); | 332 | omap_kp_scan_keypad(omap_kp, keypad_state); |
397 | if (!cpu_is_omap24xx()) { | 333 | omap_kp->irq = platform_get_irq(pdev, 0); |
398 | omap_kp->irq = platform_get_irq(pdev, 0); | 334 | if (omap_kp->irq >= 0) { |
399 | if (omap_kp->irq >= 0) { | 335 | if (request_irq(omap_kp->irq, omap_kp_interrupt, 0, |
400 | if (request_irq(omap_kp->irq, omap_kp_interrupt, 0, | 336 | "omap-keypad", omap_kp) < 0) |
401 | "omap-keypad", omap_kp) < 0) | 337 | goto err4; |
402 | goto err4; | ||
403 | } | ||
404 | omap_writew(0, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); | ||
405 | } else { | ||
406 | for (irq_idx = 0; irq_idx < omap_kp->rows; irq_idx++) { | ||
407 | if (request_irq(gpio_to_irq(row_gpios[irq_idx]), | ||
408 | omap_kp_interrupt, | ||
409 | IRQF_TRIGGER_FALLING, | ||
410 | "omap-keypad", omap_kp) < 0) | ||
411 | goto err5; | ||
412 | } | ||
413 | } | 338 | } |
339 | omap_writew(0, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); | ||
340 | |||
414 | return 0; | 341 | return 0; |
415 | err5: | 342 | |
416 | for (i = irq_idx - 1; i >=0; i--) | ||
417 | free_irq(row_gpios[i], omap_kp); | ||
418 | err4: | 343 | err4: |
419 | input_unregister_device(omap_kp->input); | 344 | input_unregister_device(omap_kp->input); |
420 | input_dev = NULL; | 345 | input_dev = NULL; |
@@ -423,7 +348,6 @@ err3: | |||
423 | err2: | 348 | err2: |
424 | for (i = row_idx - 1; i >=0; i--) | 349 | for (i = row_idx - 1; i >=0; i--) |
425 | gpio_free(row_gpios[i]); | 350 | gpio_free(row_gpios[i]); |
426 | err1: | ||
427 | for (i = col_idx - 1; i >=0; i--) | 351 | for (i = col_idx - 1; i >=0; i--) |
428 | gpio_free(col_gpios[i]); | 352 | gpio_free(col_gpios[i]); |
429 | 353 | ||
@@ -439,18 +363,8 @@ static int __devexit omap_kp_remove(struct platform_device *pdev) | |||
439 | 363 | ||
440 | /* disable keypad interrupt handling */ | 364 | /* disable keypad interrupt handling */ |
441 | tasklet_disable(&kp_tasklet); | 365 | tasklet_disable(&kp_tasklet); |
442 | if (cpu_is_omap24xx()) { | 366 | omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); |
443 | int i; | 367 | free_irq(omap_kp->irq, omap_kp); |
444 | for (i = 0; i < omap_kp->cols; i++) | ||
445 | gpio_free(col_gpios[i]); | ||
446 | for (i = 0; i < omap_kp->rows; i++) { | ||
447 | gpio_free(row_gpios[i]); | ||
448 | free_irq(gpio_to_irq(row_gpios[i]), omap_kp); | ||
449 | } | ||
450 | } else { | ||
451 | omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); | ||
452 | free_irq(omap_kp->irq, omap_kp); | ||
453 | } | ||
454 | 368 | ||
455 | del_timer_sync(&omap_kp->timer); | 369 | del_timer_sync(&omap_kp->timer); |
456 | tasklet_kill(&kp_tasklet); | 370 | tasklet_kill(&kp_tasklet); |
diff --git a/drivers/input/mouse/rpcmouse.c b/drivers/input/mouse/rpcmouse.c index 272deddc8db6..21c60fea5d31 100644 --- a/drivers/input/mouse/rpcmouse.c +++ b/drivers/input/mouse/rpcmouse.c | |||
@@ -42,7 +42,7 @@ static irqreturn_t rpcmouse_irq(int irq, void *dev_id) | |||
42 | 42 | ||
43 | x = (short) iomd_readl(IOMD_MOUSEX); | 43 | x = (short) iomd_readl(IOMD_MOUSEX); |
44 | y = (short) iomd_readl(IOMD_MOUSEY); | 44 | y = (short) iomd_readl(IOMD_MOUSEY); |
45 | b = (short) (__raw_readl(0xe0310000) ^ 0x70); | 45 | b = (short) (__raw_readl(IOMEM(0xe0310000)) ^ 0x70); |
46 | 46 | ||
47 | dx = x - rpcmouse_lastx; | 47 | dx = x - rpcmouse_lastx; |
48 | dy = y - rpcmouse_lasty; | 48 | dy = y - rpcmouse_lasty; |
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index f5fbdf94de3b..45887e31242a 100644 --- a/drivers/input/serio/ams_delta_serio.c +++ b/drivers/input/serio/ams_delta_serio.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | 28 | ||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | #include <plat/board-ams-delta.h> | 30 | #include <mach/board-ams-delta.h> |
31 | 31 | ||
32 | #include <mach/ams-delta-fiq.h> | 32 | #include <mach/ams-delta-fiq.h> |
33 | 33 | ||
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 88cf9d952631..409da0f8e5cf 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <media/v4l2-device.h> | 44 | #include <media/v4l2-device.h> |
45 | #include <media/v4l2-ioctl.h> | 45 | #include <media/v4l2-ioctl.h> |
46 | 46 | ||
47 | #include <plat/cpu.h> | ||
47 | #include <plat/dma.h> | 48 | #include <plat/dma.h> |
48 | #include <plat/vrfb.h> | 49 | #include <plat/vrfb.h> |
49 | #include <video/omapdss.h> | 50 | #include <video/omapdss.h> |
diff --git a/drivers/media/video/omap3isp/isp.c b/drivers/media/video/omap3isp/isp.c index 1c347633e663..43e61fe5df50 100644 --- a/drivers/media/video/omap3isp/isp.c +++ b/drivers/media/video/omap3isp/isp.c | |||
@@ -70,6 +70,8 @@ | |||
70 | #include <media/v4l2-common.h> | 70 | #include <media/v4l2-common.h> |
71 | #include <media/v4l2-device.h> | 71 | #include <media/v4l2-device.h> |
72 | 72 | ||
73 | #include <plat/cpu.h> | ||
74 | |||
73 | #include "isp.h" | 75 | #include "isp.h" |
74 | #include "ispreg.h" | 76 | #include "ispreg.h" |
75 | #include "ispccdc.h" | 77 | #include "ispccdc.h" |
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 1c32afed28aa..9d3a0bc1a65f 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
@@ -1132,12 +1132,7 @@ static void clocks_init(struct device *dev, | |||
1132 | u32 rate; | 1132 | u32 rate; |
1133 | u8 ctrl = HFCLK_FREQ_26_MHZ; | 1133 | u8 ctrl = HFCLK_FREQ_26_MHZ; |
1134 | 1134 | ||
1135 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 1135 | osc = clk_get(dev, "fck"); |
1136 | if (cpu_is_omap2430()) | ||
1137 | osc = clk_get(dev, "osc_ck"); | ||
1138 | else | ||
1139 | osc = clk_get(dev, "osc_sys_ck"); | ||
1140 | |||
1141 | if (IS_ERR(osc)) { | 1136 | if (IS_ERR(osc)) { |
1142 | printk(KERN_WARNING "Skipping twl internal clock init and " | 1137 | printk(KERN_WARNING "Skipping twl internal clock init and " |
1143 | "using bootloader value (unknown osc rate)\n"); | 1138 | "using bootloader value (unknown osc rate)\n"); |
@@ -1147,18 +1142,6 @@ static void clocks_init(struct device *dev, | |||
1147 | rate = clk_get_rate(osc); | 1142 | rate = clk_get_rate(osc); |
1148 | clk_put(osc); | 1143 | clk_put(osc); |
1149 | 1144 | ||
1150 | #else | ||
1151 | /* REVISIT for non-OMAP systems, pass the clock rate from | ||
1152 | * board init code, using platform_data. | ||
1153 | */ | ||
1154 | osc = ERR_PTR(-EIO); | ||
1155 | |||
1156 | printk(KERN_WARNING "Skipping twl internal clock init and " | ||
1157 | "using bootloader value (unknown osc rate)\n"); | ||
1158 | |||
1159 | return; | ||
1160 | #endif | ||
1161 | |||
1162 | switch (rate) { | 1145 | switch (rate) { |
1163 | case 19200000: | 1146 | case 19200000: |
1164 | ctrl = HFCLK_FREQ_19p2_MHZ; | 1147 | ctrl = HFCLK_FREQ_19p2_MHZ; |
@@ -1220,10 +1203,23 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1220 | { | 1203 | { |
1221 | struct twl4030_platform_data *pdata = client->dev.platform_data; | 1204 | struct twl4030_platform_data *pdata = client->dev.platform_data; |
1222 | struct device_node *node = client->dev.of_node; | 1205 | struct device_node *node = client->dev.of_node; |
1206 | struct platform_device *pdev; | ||
1223 | int irq_base = 0; | 1207 | int irq_base = 0; |
1224 | int status; | 1208 | int status; |
1225 | unsigned i, num_slaves; | 1209 | unsigned i, num_slaves; |
1226 | 1210 | ||
1211 | pdev = platform_device_alloc(DRIVER_NAME, -1); | ||
1212 | if (!pdev) { | ||
1213 | dev_err(&client->dev, "can't alloc pdev\n"); | ||
1214 | return -ENOMEM; | ||
1215 | } | ||
1216 | |||
1217 | status = platform_device_add(pdev); | ||
1218 | if (status) { | ||
1219 | platform_device_put(pdev); | ||
1220 | return status; | ||
1221 | } | ||
1222 | |||
1227 | if (node && !pdata) { | 1223 | if (node && !pdata) { |
1228 | /* | 1224 | /* |
1229 | * XXX: Temporary pdata until the information is correctly | 1225 | * XXX: Temporary pdata until the information is correctly |
@@ -1232,23 +1228,30 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1232 | pdata = devm_kzalloc(&client->dev, | 1228 | pdata = devm_kzalloc(&client->dev, |
1233 | sizeof(struct twl4030_platform_data), | 1229 | sizeof(struct twl4030_platform_data), |
1234 | GFP_KERNEL); | 1230 | GFP_KERNEL); |
1235 | if (!pdata) | 1231 | if (!pdata) { |
1236 | return -ENOMEM; | 1232 | status = -ENOMEM; |
1233 | goto free; | ||
1234 | } | ||
1237 | } | 1235 | } |
1238 | 1236 | ||
1239 | if (!pdata) { | 1237 | if (!pdata) { |
1240 | dev_dbg(&client->dev, "no platform data?\n"); | 1238 | dev_dbg(&client->dev, "no platform data?\n"); |
1241 | return -EINVAL; | 1239 | status = -EINVAL; |
1240 | goto free; | ||
1242 | } | 1241 | } |
1243 | 1242 | ||
1243 | platform_set_drvdata(pdev, pdata); | ||
1244 | |||
1244 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { | 1245 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { |
1245 | dev_dbg(&client->dev, "can't talk I2C?\n"); | 1246 | dev_dbg(&client->dev, "can't talk I2C?\n"); |
1246 | return -EIO; | 1247 | status = -EIO; |
1248 | goto free; | ||
1247 | } | 1249 | } |
1248 | 1250 | ||
1249 | if (inuse) { | 1251 | if (inuse) { |
1250 | dev_dbg(&client->dev, "driver is already in use\n"); | 1252 | dev_dbg(&client->dev, "driver is already in use\n"); |
1251 | return -EBUSY; | 1253 | status = -EBUSY; |
1254 | goto free; | ||
1252 | } | 1255 | } |
1253 | 1256 | ||
1254 | if ((id->driver_data) & TWL6030_CLASS) { | 1257 | if ((id->driver_data) & TWL6030_CLASS) { |
@@ -1283,7 +1286,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1283 | inuse = true; | 1286 | inuse = true; |
1284 | 1287 | ||
1285 | /* setup clock framework */ | 1288 | /* setup clock framework */ |
1286 | clocks_init(&client->dev, pdata->clock); | 1289 | clocks_init(&pdev->dev, pdata->clock); |
1287 | 1290 | ||
1288 | /* read TWL IDCODE Register */ | 1291 | /* read TWL IDCODE Register */ |
1289 | if (twl_id == TWL4030_CLASS_ID) { | 1292 | if (twl_id == TWL4030_CLASS_ID) { |
@@ -1333,6 +1336,9 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1333 | fail: | 1336 | fail: |
1334 | if (status < 0) | 1337 | if (status < 0) |
1335 | twl_remove(client); | 1338 | twl_remove(client); |
1339 | free: | ||
1340 | if (status < 0) | ||
1341 | platform_device_unregister(pdev); | ||
1336 | 1342 | ||
1337 | return status; | 1343 | return status; |
1338 | } | 1344 | } |
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index a5999a74496a..c6259a829544 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -33,11 +33,9 @@ | |||
33 | #include <asm/io.h> | 33 | #include <asm/io.h> |
34 | #include <asm/irq.h> | 34 | #include <asm/irq.h> |
35 | 35 | ||
36 | #include <plat/board.h> | ||
37 | #include <plat/mmc.h> | 36 | #include <plat/mmc.h> |
38 | #include <asm/gpio.h> | 37 | #include <asm/gpio.h> |
39 | #include <plat/dma.h> | 38 | #include <plat/dma.h> |
40 | #include <plat/mux.h> | ||
41 | #include <plat/fpga.h> | 39 | #include <plat/fpga.h> |
42 | 40 | ||
43 | #define OMAP_MMC_REG_CMD 0x00 | 41 | #define OMAP_MMC_REG_CMD 0x00 |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 8e2d81f1ee4b..38adc330c007 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <linux/regulator/consumer.h> | 40 | #include <linux/regulator/consumer.h> |
41 | #include <linux/pm_runtime.h> | 41 | #include <linux/pm_runtime.h> |
42 | #include <mach/hardware.h> | 42 | #include <mach/hardware.h> |
43 | #include <plat/board.h> | ||
44 | #include <plat/mmc.h> | 43 | #include <plat/mmc.h> |
45 | #include <plat/cpu.h> | 44 | #include <plat/cpu.h> |
46 | 45 | ||
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 0810ccc23d7e..5393c64de3c8 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c | |||
@@ -27,7 +27,6 @@ | |||
27 | 27 | ||
28 | #include <asm/gpio.h> | 28 | #include <asm/gpio.h> |
29 | 29 | ||
30 | #include <mach/gpio-tegra.h> | ||
31 | #include <mach/sdhci.h> | 30 | #include <mach/sdhci.h> |
32 | 31 | ||
33 | #include "sdhci-pltfm.h" | 32 | #include "sdhci-pltfm.h" |
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c index 861ca8f7e47d..a7040af08536 100644 --- a/drivers/mtd/nand/ams-delta.c +++ b/drivers/mtd/nand/ams-delta.c | |||
@@ -23,11 +23,15 @@ | |||
23 | #include <linux/mtd/mtd.h> | 23 | #include <linux/mtd/mtd.h> |
24 | #include <linux/mtd/nand.h> | 24 | #include <linux/mtd/nand.h> |
25 | #include <linux/mtd/partitions.h> | 25 | #include <linux/mtd/partitions.h> |
26 | #include <linux/gpio.h> | ||
27 | #include <linux/platform_data/gpio-omap.h> | ||
28 | |||
26 | #include <asm/io.h> | 29 | #include <asm/io.h> |
27 | #include <mach/hardware.h> | ||
28 | #include <asm/sizes.h> | 30 | #include <asm/sizes.h> |
29 | #include <linux/gpio.h> | 31 | |
30 | #include <plat/board-ams-delta.h> | 32 | #include <mach/board-ams-delta.h> |
33 | |||
34 | #include <mach/hardware.h> | ||
31 | 35 | ||
32 | /* | 36 | /* |
33 | * MTD structure for E3 (Delta) | 37 | * MTD structure for E3 (Delta) |
diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c index c855e7cd337b..d0d1bd4d0e7d 100644 --- a/drivers/mtd/nand/bcm_umi_nand.c +++ b/drivers/mtd/nand/bcm_umi_nand.c | |||
@@ -249,20 +249,20 @@ static int nand_dev_ready(struct mtd_info *mtd) | |||
249 | int bcm_umi_nand_inithw(void) | 249 | int bcm_umi_nand_inithw(void) |
250 | { | 250 | { |
251 | /* Configure nand timing parameters */ | 251 | /* Configure nand timing parameters */ |
252 | REG_UMI_NAND_TCR &= ~0x7ffff; | 252 | writel(readl(®_UMI_NAND_TCR) & ~0x7ffff, ®_UMI_NAND_TCR); |
253 | REG_UMI_NAND_TCR |= HW_CFG_NAND_TCR; | 253 | writel(readl(®_UMI_NAND_TCR) | HW_CFG_NAND_TCR, ®_UMI_NAND_TCR); |
254 | 254 | ||
255 | #if !defined(CONFIG_MTD_NAND_BCM_UMI_HWCS) | 255 | #if !defined(CONFIG_MTD_NAND_BCM_UMI_HWCS) |
256 | /* enable software control of CS */ | 256 | /* enable software control of CS */ |
257 | REG_UMI_NAND_TCR |= REG_UMI_NAND_TCR_CS_SWCTRL; | 257 | writel(readl(®_UMI_NAND_TCR) | REG_UMI_NAND_TCR_CS_SWCTRL, ®_UMI_NAND_TCR); |
258 | #endif | 258 | #endif |
259 | 259 | ||
260 | /* keep NAND chip select asserted */ | 260 | /* keep NAND chip select asserted */ |
261 | REG_UMI_NAND_RCSR |= REG_UMI_NAND_RCSR_CS_ASSERTED; | 261 | writel(readl(®_UMI_NAND_RCSR) | REG_UMI_NAND_RCSR_CS_ASSERTED, ®_UMI_NAND_RCSR); |
262 | 262 | ||
263 | REG_UMI_NAND_TCR &= ~REG_UMI_NAND_TCR_WORD16; | 263 | writel(readl(®_UMI_NAND_TCR) & ~REG_UMI_NAND_TCR_WORD16, ®_UMI_NAND_TCR); |
264 | /* enable writes to flash */ | 264 | /* enable writes to flash */ |
265 | REG_UMI_MMD_ICR |= REG_UMI_MMD_ICR_FLASH_WP; | 265 | writel(readl(®_UMI_MMD_ICR) | REG_UMI_MMD_ICR_FLASH_WP, ®_UMI_MMD_ICR); |
266 | 266 | ||
267 | writel(NAND_CMD_RESET, bcm_umi_io_base + REG_NAND_CMD_OFFSET); | 267 | writel(NAND_CMD_RESET, bcm_umi_io_base + REG_NAND_CMD_OFFSET); |
268 | nand_bcm_umi_wait_till_ready(); | 268 | nand_bcm_umi_wait_till_ready(); |
diff --git a/drivers/mtd/nand/nand_bcm_umi.h b/drivers/mtd/nand/nand_bcm_umi.h index 198b304d6f72..d90186684db8 100644 --- a/drivers/mtd/nand/nand_bcm_umi.h +++ b/drivers/mtd/nand/nand_bcm_umi.h | |||
@@ -17,7 +17,7 @@ | |||
17 | /* ---- Include Files ---------------------------------------------------- */ | 17 | /* ---- Include Files ---------------------------------------------------- */ |
18 | #include <mach/reg_umi.h> | 18 | #include <mach/reg_umi.h> |
19 | #include <mach/reg_nand.h> | 19 | #include <mach/reg_nand.h> |
20 | #include <cfg_global.h> | 20 | #include <mach/cfg_global.h> |
21 | 21 | ||
22 | /* ---- Constants and Types ---------------------------------------------- */ | 22 | /* ---- Constants and Types ---------------------------------------------- */ |
23 | #if (CFG_GLOBAL_CHIP_FAMILY == CFG_GLOBAL_CHIP_FAMILY_BCMRING) | 23 | #if (CFG_GLOBAL_CHIP_FAMILY == CFG_GLOBAL_CHIP_FAMILY_BCMRING) |
@@ -48,7 +48,7 @@ int nand_bcm_umi_bch_correct_page(uint8_t *datap, uint8_t *readEccData, | |||
48 | /* Check in device is ready */ | 48 | /* Check in device is ready */ |
49 | static inline int nand_bcm_umi_dev_ready(void) | 49 | static inline int nand_bcm_umi_dev_ready(void) |
50 | { | 50 | { |
51 | return REG_UMI_NAND_RCSR & REG_UMI_NAND_RCSR_RDY; | 51 | return readl(®_UMI_NAND_RCSR) & REG_UMI_NAND_RCSR_RDY; |
52 | } | 52 | } |
53 | 53 | ||
54 | /* Wait until device is ready */ | 54 | /* Wait until device is ready */ |
@@ -62,10 +62,11 @@ static inline void nand_bcm_umi_wait_till_ready(void) | |||
62 | static inline void nand_bcm_umi_hamming_enable_hwecc(void) | 62 | static inline void nand_bcm_umi_hamming_enable_hwecc(void) |
63 | { | 63 | { |
64 | /* disable and reset ECC, 512 byte page */ | 64 | /* disable and reset ECC, 512 byte page */ |
65 | REG_UMI_NAND_ECC_CSR &= ~(REG_UMI_NAND_ECC_CSR_ECC_ENABLE | | 65 | writel(readl(®_UMI_NAND_ECC_CSR) & ~(REG_UMI_NAND_ECC_CSR_ECC_ENABLE | |
66 | REG_UMI_NAND_ECC_CSR_256BYTE); | 66 | REG_UMI_NAND_ECC_CSR_256BYTE), ®_UMI_NAND_ECC_CSR); |
67 | /* enable ECC */ | 67 | /* enable ECC */ |
68 | REG_UMI_NAND_ECC_CSR |= REG_UMI_NAND_ECC_CSR_ECC_ENABLE; | 68 | writel(readl(®_UMI_NAND_ECC_CSR) | REG_UMI_NAND_ECC_CSR_ECC_ENABLE, |
69 | ®_UMI_NAND_ECC_CSR); | ||
69 | } | 70 | } |
70 | 71 | ||
71 | #if NAND_ECC_BCH | 72 | #if NAND_ECC_BCH |
@@ -76,18 +77,18 @@ static inline void nand_bcm_umi_hamming_enable_hwecc(void) | |||
76 | static inline void nand_bcm_umi_bch_enable_read_hwecc(void) | 77 | static inline void nand_bcm_umi_bch_enable_read_hwecc(void) |
77 | { | 78 | { |
78 | /* disable and reset ECC */ | 79 | /* disable and reset ECC */ |
79 | REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID; | 80 | writel(REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID, ®_UMI_BCH_CTRL_STATUS); |
80 | /* Turn on ECC */ | 81 | /* Turn on ECC */ |
81 | REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN; | 82 | writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN, ®_UMI_BCH_CTRL_STATUS); |
82 | } | 83 | } |
83 | 84 | ||
84 | /* Enable BCH Write ECC */ | 85 | /* Enable BCH Write ECC */ |
85 | static inline void nand_bcm_umi_bch_enable_write_hwecc(void) | 86 | static inline void nand_bcm_umi_bch_enable_write_hwecc(void) |
86 | { | 87 | { |
87 | /* disable and reset ECC */ | 88 | /* disable and reset ECC */ |
88 | REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID; | 89 | writel(REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID, ®_UMI_BCH_CTRL_STATUS); |
89 | /* Turn on ECC */ | 90 | /* Turn on ECC */ |
90 | REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_WR_EN; | 91 | writel(REG_UMI_BCH_CTRL_STATUS_ECC_WR_EN, ®_UMI_BCH_CTRL_STATUS); |
91 | } | 92 | } |
92 | 93 | ||
93 | /* Config number of BCH ECC bytes */ | 94 | /* Config number of BCH ECC bytes */ |
@@ -99,9 +100,9 @@ static inline void nand_bcm_umi_bch_config_ecc(uint8_t numEccBytes) | |||
99 | uint32_t numBits = numEccBytes * 8; | 100 | uint32_t numBits = numEccBytes * 8; |
100 | 101 | ||
101 | /* disable and reset ECC */ | 102 | /* disable and reset ECC */ |
102 | REG_UMI_BCH_CTRL_STATUS = | 103 | writel(REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID | |
103 | REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID | | 104 | REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID, |
104 | REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID; | 105 | ®_UMI_BCH_CTRL_STATUS); |
105 | 106 | ||
106 | /* Every correctible bit requires 13 ECC bits */ | 107 | /* Every correctible bit requires 13 ECC bits */ |
107 | tValue = (uint32_t) (numBits / ECC_BITS_PER_CORRECTABLE_BIT); | 108 | tValue = (uint32_t) (numBits / ECC_BITS_PER_CORRECTABLE_BIT); |
@@ -113,23 +114,21 @@ static inline void nand_bcm_umi_bch_config_ecc(uint8_t numEccBytes) | |||
113 | kValue = nValue - (tValue * ECC_BITS_PER_CORRECTABLE_BIT); | 114 | kValue = nValue - (tValue * ECC_BITS_PER_CORRECTABLE_BIT); |
114 | 115 | ||
115 | /* Write the settings */ | 116 | /* Write the settings */ |
116 | REG_UMI_BCH_N = nValue; | 117 | writel(nValue, ®_UMI_BCH_N); |
117 | REG_UMI_BCH_T = tValue; | 118 | writel(tValue, ®_UMI_BCH_T); |
118 | REG_UMI_BCH_K = kValue; | 119 | writel(kValue, ®_UMI_BCH_K); |
119 | } | 120 | } |
120 | 121 | ||
121 | /* Pause during ECC read calculation to skip bytes in OOB */ | 122 | /* Pause during ECC read calculation to skip bytes in OOB */ |
122 | static inline void nand_bcm_umi_bch_pause_read_ecc_calc(void) | 123 | static inline void nand_bcm_umi_bch_pause_read_ecc_calc(void) |
123 | { | 124 | { |
124 | REG_UMI_BCH_CTRL_STATUS = | 125 | writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN | REG_UMI_BCH_CTRL_STATUS_PAUSE_ECC_DEC, ®_UMI_BCH_CTRL_STATUS); |
125 | REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN | | ||
126 | REG_UMI_BCH_CTRL_STATUS_PAUSE_ECC_DEC; | ||
127 | } | 126 | } |
128 | 127 | ||
129 | /* Resume during ECC read calculation after skipping bytes in OOB */ | 128 | /* Resume during ECC read calculation after skipping bytes in OOB */ |
130 | static inline void nand_bcm_umi_bch_resume_read_ecc_calc(void) | 129 | static inline void nand_bcm_umi_bch_resume_read_ecc_calc(void) |
131 | { | 130 | { |
132 | REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN; | 131 | writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN, ®_UMI_BCH_CTRL_STATUS); |
133 | } | 132 | } |
134 | 133 | ||
135 | /* Poll read ECC calc to check when hardware completes */ | 134 | /* Poll read ECC calc to check when hardware completes */ |
@@ -139,7 +138,7 @@ static inline uint32_t nand_bcm_umi_bch_poll_read_ecc_calc(void) | |||
139 | 138 | ||
140 | do { | 139 | do { |
141 | /* wait for ECC to be valid */ | 140 | /* wait for ECC to be valid */ |
142 | regVal = REG_UMI_BCH_CTRL_STATUS; | 141 | regVal = readl(®_UMI_BCH_CTRL_STATUS); |
143 | } while ((regVal & REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID) == 0); | 142 | } while ((regVal & REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID) == 0); |
144 | 143 | ||
145 | return regVal; | 144 | return regVal; |
@@ -149,7 +148,7 @@ static inline uint32_t nand_bcm_umi_bch_poll_read_ecc_calc(void) | |||
149 | static inline void nand_bcm_umi_bch_poll_write_ecc_calc(void) | 148 | static inline void nand_bcm_umi_bch_poll_write_ecc_calc(void) |
150 | { | 149 | { |
151 | /* wait for ECC to be valid */ | 150 | /* wait for ECC to be valid */ |
152 | while ((REG_UMI_BCH_CTRL_STATUS & REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID) | 151 | while ((readl(®_UMI_BCH_CTRL_STATUS) & REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID) |
153 | == 0) | 152 | == 0) |
154 | ; | 153 | ; |
155 | } | 154 | } |
@@ -170,9 +169,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize, | |||
170 | if (pageSize != NAND_DATA_ACCESS_SIZE) { | 169 | if (pageSize != NAND_DATA_ACCESS_SIZE) { |
171 | /* skip BI */ | 170 | /* skip BI */ |
172 | #if defined(__KERNEL__) && !defined(STANDALONE) | 171 | #if defined(__KERNEL__) && !defined(STANDALONE) |
173 | *oobp++ = REG_NAND_DATA8; | 172 | *oobp++ = readb(®_NAND_DATA8); |
174 | #else | 173 | #else |
175 | REG_NAND_DATA8; | 174 | readb(®_NAND_DATA8); |
176 | #endif | 175 | #endif |
177 | numToRead--; | 176 | numToRead--; |
178 | } | 177 | } |
@@ -180,9 +179,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize, | |||
180 | while (numToRead > numEccBytes) { | 179 | while (numToRead > numEccBytes) { |
181 | /* skip free oob region */ | 180 | /* skip free oob region */ |
182 | #if defined(__KERNEL__) && !defined(STANDALONE) | 181 | #if defined(__KERNEL__) && !defined(STANDALONE) |
183 | *oobp++ = REG_NAND_DATA8; | 182 | *oobp++ = readb(®_NAND_DATA8); |
184 | #else | 183 | #else |
185 | REG_NAND_DATA8; | 184 | readb(®_NAND_DATA8); |
186 | #endif | 185 | #endif |
187 | numToRead--; | 186 | numToRead--; |
188 | } | 187 | } |
@@ -193,11 +192,11 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize, | |||
193 | 192 | ||
194 | while (numToRead > 11) { | 193 | while (numToRead > 11) { |
195 | #if defined(__KERNEL__) && !defined(STANDALONE) | 194 | #if defined(__KERNEL__) && !defined(STANDALONE) |
196 | *oobp = REG_NAND_DATA8; | 195 | *oobp = readb(®_NAND_DATA8); |
197 | eccCalc[eccPos++] = *oobp; | 196 | eccCalc[eccPos++] = *oobp; |
198 | oobp++; | 197 | oobp++; |
199 | #else | 198 | #else |
200 | eccCalc[eccPos++] = REG_NAND_DATA8; | 199 | eccCalc[eccPos++] = readb(®_NAND_DATA8); |
201 | #endif | 200 | #endif |
202 | numToRead--; | 201 | numToRead--; |
203 | } | 202 | } |
@@ -207,9 +206,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize, | |||
207 | if (numToRead == 11) { | 206 | if (numToRead == 11) { |
208 | /* read BI */ | 207 | /* read BI */ |
209 | #if defined(__KERNEL__) && !defined(STANDALONE) | 208 | #if defined(__KERNEL__) && !defined(STANDALONE) |
210 | *oobp++ = REG_NAND_DATA8; | 209 | *oobp++ = readb(®_NAND_DATA8); |
211 | #else | 210 | #else |
212 | REG_NAND_DATA8; | 211 | readb(®_NAND_DATA8); |
213 | #endif | 212 | #endif |
214 | numToRead--; | 213 | numToRead--; |
215 | } | 214 | } |
@@ -219,11 +218,11 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize, | |||
219 | nand_bcm_umi_bch_resume_read_ecc_calc(); | 218 | nand_bcm_umi_bch_resume_read_ecc_calc(); |
220 | while (numToRead) { | 219 | while (numToRead) { |
221 | #if defined(__KERNEL__) && !defined(STANDALONE) | 220 | #if defined(__KERNEL__) && !defined(STANDALONE) |
222 | *oobp = REG_NAND_DATA8; | 221 | *oobp = readb(®_NAND_DATA8); |
223 | eccCalc[eccPos++] = *oobp; | 222 | eccCalc[eccPos++] = *oobp; |
224 | oobp++; | 223 | oobp++; |
225 | #else | 224 | #else |
226 | eccCalc[eccPos++] = REG_NAND_DATA8; | 225 | eccCalc[eccPos++] = readb(®_NAND_DATA8); |
227 | #endif | 226 | #endif |
228 | numToRead--; | 227 | numToRead--; |
229 | } | 228 | } |
@@ -255,7 +254,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize, | |||
255 | if (pageSize == NAND_DATA_ACCESS_SIZE) { | 254 | if (pageSize == NAND_DATA_ACCESS_SIZE) { |
256 | /* Now fill in the ECC bytes */ | 255 | /* Now fill in the ECC bytes */ |
257 | if (numEccBytes >= 13) | 256 | if (numEccBytes >= 13) |
258 | eccVal = REG_UMI_BCH_WR_ECC_3; | 257 | eccVal = readl(®_UMI_BCH_WR_ECC_3); |
259 | 258 | ||
260 | /* Usually we skip CM in oob[0,1] */ | 259 | /* Usually we skip CM in oob[0,1] */ |
261 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[0], | 260 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[0], |
@@ -268,7 +267,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize, | |||
268 | eccVal & 0xff); /* ECC 12 */ | 267 | eccVal & 0xff); /* ECC 12 */ |
269 | 268 | ||
270 | if (numEccBytes >= 9) | 269 | if (numEccBytes >= 9) |
271 | eccVal = REG_UMI_BCH_WR_ECC_2; | 270 | eccVal = readl(®_UMI_BCH_WR_ECC_2); |
272 | 271 | ||
273 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[3], | 272 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[3], |
274 | (eccVal >> 24) & 0xff); /* ECC11 */ | 273 | (eccVal >> 24) & 0xff); /* ECC11 */ |
@@ -281,7 +280,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize, | |||
281 | 280 | ||
282 | /* Now fill in the ECC bytes */ | 281 | /* Now fill in the ECC bytes */ |
283 | if (numEccBytes >= 13) | 282 | if (numEccBytes >= 13) |
284 | eccVal = REG_UMI_BCH_WR_ECC_3; | 283 | eccVal = readl(®_UMI_BCH_WR_ECC_3); |
285 | 284 | ||
286 | /* Usually skip CM in oob[1,2] */ | 285 | /* Usually skip CM in oob[1,2] */ |
287 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[1], | 286 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[1], |
@@ -294,7 +293,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize, | |||
294 | eccVal & 0xff); /* ECC12 */ | 293 | eccVal & 0xff); /* ECC12 */ |
295 | 294 | ||
296 | if (numEccBytes >= 9) | 295 | if (numEccBytes >= 9) |
297 | eccVal = REG_UMI_BCH_WR_ECC_2; | 296 | eccVal = readl(®_UMI_BCH_WR_ECC_2); |
298 | 297 | ||
299 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[4], | 298 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[4], |
300 | (eccVal >> 24) & 0xff); /* ECC11 */ | 299 | (eccVal >> 24) & 0xff); /* ECC11 */ |
@@ -309,7 +308,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize, | |||
309 | eccVal & 0xff); /* ECC8 */ | 308 | eccVal & 0xff); /* ECC8 */ |
310 | 309 | ||
311 | if (numEccBytes >= 5) | 310 | if (numEccBytes >= 5) |
312 | eccVal = REG_UMI_BCH_WR_ECC_1; | 311 | eccVal = readl(®_UMI_BCH_WR_ECC_1); |
313 | 312 | ||
314 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 8, &oobp[8], | 313 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 8, &oobp[8], |
315 | (eccVal >> 24) & 0xff); /* ECC7 */ | 314 | (eccVal >> 24) & 0xff); /* ECC7 */ |
@@ -321,7 +320,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize, | |||
321 | eccVal & 0xff); /* ECC4 */ | 320 | eccVal & 0xff); /* ECC4 */ |
322 | 321 | ||
323 | if (numEccBytes >= 1) | 322 | if (numEccBytes >= 1) |
324 | eccVal = REG_UMI_BCH_WR_ECC_0; | 323 | eccVal = readl(®_UMI_BCH_WR_ECC_0); |
325 | 324 | ||
326 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 4, &oobp[12], | 325 | NAND_BCM_UMI_ECC_WRITE(numEccBytes, 4, &oobp[12], |
327 | (eccVal >> 24) & 0xff); /* ECC3 */ | 326 | (eccVal >> 24) & 0xff); /* ECC3 */ |
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index ac4fd756eda3..fc8111278d12 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #include <plat/dma.h> | 30 | #include <plat/dma.h> |
31 | #include <plat/gpmc.h> | 31 | #include <plat/gpmc.h> |
32 | #include <plat/nand.h> | 32 | #include <linux/platform_data/mtd-nand-omap2.h> |
33 | 33 | ||
34 | #define DRIVER_NAME "omap2-nand" | 34 | #define DRIVER_NAME "omap2-nand" |
35 | #define OMAP_NAND_TIMEOUT_MS 5000 | 35 | #define OMAP_NAND_TIMEOUT_MS 5000 |
@@ -101,6 +101,16 @@ | |||
101 | #define P4e_s(a) (TF(a & NAND_Ecc_P4e) << 0) | 101 | #define P4e_s(a) (TF(a & NAND_Ecc_P4e) << 0) |
102 | #define P4o_s(a) (TF(a & NAND_Ecc_P4o) << 1) | 102 | #define P4o_s(a) (TF(a & NAND_Ecc_P4o) << 1) |
103 | 103 | ||
104 | #define PREFETCH_CONFIG1_CS_SHIFT 24 | ||
105 | #define ECC_CONFIG_CS_SHIFT 1 | ||
106 | #define CS_MASK 0x7 | ||
107 | #define ENABLE_PREFETCH (0x1 << 7) | ||
108 | #define DMA_MPU_MODE_SHIFT 2 | ||
109 | #define ECCSIZE1_SHIFT 22 | ||
110 | #define ECC1RESULTSIZE 0x1 | ||
111 | #define ECCCLEAR 0x100 | ||
112 | #define ECC1 0x1 | ||
113 | |||
104 | /* oob info generated runtime depending on ecc algorithm and layout selected */ | 114 | /* oob info generated runtime depending on ecc algorithm and layout selected */ |
105 | static struct nand_ecclayout omap_oobinfo; | 115 | static struct nand_ecclayout omap_oobinfo; |
106 | /* Define some generic bad / good block scan pattern which are used | 116 | /* Define some generic bad / good block scan pattern which are used |
@@ -124,15 +134,18 @@ struct omap_nand_info { | |||
124 | 134 | ||
125 | int gpmc_cs; | 135 | int gpmc_cs; |
126 | unsigned long phys_base; | 136 | unsigned long phys_base; |
137 | unsigned long mem_size; | ||
127 | struct completion comp; | 138 | struct completion comp; |
128 | struct dma_chan *dma; | 139 | struct dma_chan *dma; |
129 | int gpmc_irq; | 140 | int gpmc_irq_fifo; |
141 | int gpmc_irq_count; | ||
130 | enum { | 142 | enum { |
131 | OMAP_NAND_IO_READ = 0, /* read */ | 143 | OMAP_NAND_IO_READ = 0, /* read */ |
132 | OMAP_NAND_IO_WRITE, /* write */ | 144 | OMAP_NAND_IO_WRITE, /* write */ |
133 | } iomode; | 145 | } iomode; |
134 | u_char *buf; | 146 | u_char *buf; |
135 | int buf_len; | 147 | int buf_len; |
148 | struct gpmc_nand_regs reg; | ||
136 | 149 | ||
137 | #ifdef CONFIG_MTD_NAND_OMAP_BCH | 150 | #ifdef CONFIG_MTD_NAND_OMAP_BCH |
138 | struct bch_control *bch; | 151 | struct bch_control *bch; |
@@ -141,6 +154,63 @@ struct omap_nand_info { | |||
141 | }; | 154 | }; |
142 | 155 | ||
143 | /** | 156 | /** |
157 | * omap_prefetch_enable - configures and starts prefetch transfer | ||
158 | * @cs: cs (chip select) number | ||
159 | * @fifo_th: fifo threshold to be used for read/ write | ||
160 | * @dma_mode: dma mode enable (1) or disable (0) | ||
161 | * @u32_count: number of bytes to be transferred | ||
162 | * @is_write: prefetch read(0) or write post(1) mode | ||
163 | */ | ||
164 | static int omap_prefetch_enable(int cs, int fifo_th, int dma_mode, | ||
165 | unsigned int u32_count, int is_write, struct omap_nand_info *info) | ||
166 | { | ||
167 | u32 val; | ||
168 | |||
169 | if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) | ||
170 | return -1; | ||
171 | |||
172 | if (readl(info->reg.gpmc_prefetch_control)) | ||
173 | return -EBUSY; | ||
174 | |||
175 | /* Set the amount of bytes to be prefetched */ | ||
176 | writel(u32_count, info->reg.gpmc_prefetch_config2); | ||
177 | |||
178 | /* Set dma/mpu mode, the prefetch read / post write and | ||
179 | * enable the engine. Set which cs is has requested for. | ||
180 | */ | ||
181 | val = ((cs << PREFETCH_CONFIG1_CS_SHIFT) | | ||
182 | PREFETCH_FIFOTHRESHOLD(fifo_th) | ENABLE_PREFETCH | | ||
183 | (dma_mode << DMA_MPU_MODE_SHIFT) | (0x1 & is_write)); | ||
184 | writel(val, info->reg.gpmc_prefetch_config1); | ||
185 | |||
186 | /* Start the prefetch engine */ | ||
187 | writel(0x1, info->reg.gpmc_prefetch_control); | ||
188 | |||
189 | return 0; | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * omap_prefetch_reset - disables and stops the prefetch engine | ||
194 | */ | ||
195 | static int omap_prefetch_reset(int cs, struct omap_nand_info *info) | ||
196 | { | ||
197 | u32 config1; | ||
198 | |||
199 | /* check if the same module/cs is trying to reset */ | ||
200 | config1 = readl(info->reg.gpmc_prefetch_config1); | ||
201 | if (((config1 >> PREFETCH_CONFIG1_CS_SHIFT) & CS_MASK) != cs) | ||
202 | return -EINVAL; | ||
203 | |||
204 | /* Stop the PFPW engine */ | ||
205 | writel(0x0, info->reg.gpmc_prefetch_control); | ||
206 | |||
207 | /* Reset/disable the PFPW engine */ | ||
208 | writel(0x0, info->reg.gpmc_prefetch_config1); | ||
209 | |||
210 | return 0; | ||
211 | } | ||
212 | |||
213 | /** | ||
144 | * omap_hwcontrol - hardware specific access to control-lines | 214 | * omap_hwcontrol - hardware specific access to control-lines |
145 | * @mtd: MTD device structure | 215 | * @mtd: MTD device structure |
146 | * @cmd: command to device | 216 | * @cmd: command to device |
@@ -158,13 +228,13 @@ static void omap_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) | |||
158 | 228 | ||
159 | if (cmd != NAND_CMD_NONE) { | 229 | if (cmd != NAND_CMD_NONE) { |
160 | if (ctrl & NAND_CLE) | 230 | if (ctrl & NAND_CLE) |
161 | gpmc_nand_write(info->gpmc_cs, GPMC_NAND_COMMAND, cmd); | 231 | writeb(cmd, info->reg.gpmc_nand_command); |
162 | 232 | ||
163 | else if (ctrl & NAND_ALE) | 233 | else if (ctrl & NAND_ALE) |
164 | gpmc_nand_write(info->gpmc_cs, GPMC_NAND_ADDRESS, cmd); | 234 | writeb(cmd, info->reg.gpmc_nand_address); |
165 | 235 | ||
166 | else /* NAND_NCE */ | 236 | else /* NAND_NCE */ |
167 | gpmc_nand_write(info->gpmc_cs, GPMC_NAND_DATA, cmd); | 237 | writeb(cmd, info->reg.gpmc_nand_data); |
168 | } | 238 | } |
169 | } | 239 | } |
170 | 240 | ||
@@ -198,7 +268,8 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len) | |||
198 | iowrite8(*p++, info->nand.IO_ADDR_W); | 268 | iowrite8(*p++, info->nand.IO_ADDR_W); |
199 | /* wait until buffer is available for write */ | 269 | /* wait until buffer is available for write */ |
200 | do { | 270 | do { |
201 | status = gpmc_read_status(GPMC_STATUS_BUFFER); | 271 | status = readl(info->reg.gpmc_status) & |
272 | GPMC_STATUS_BUFF_EMPTY; | ||
202 | } while (!status); | 273 | } while (!status); |
203 | } | 274 | } |
204 | } | 275 | } |
@@ -235,7 +306,8 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len) | |||
235 | iowrite16(*p++, info->nand.IO_ADDR_W); | 306 | iowrite16(*p++, info->nand.IO_ADDR_W); |
236 | /* wait until buffer is available for write */ | 307 | /* wait until buffer is available for write */ |
237 | do { | 308 | do { |
238 | status = gpmc_read_status(GPMC_STATUS_BUFFER); | 309 | status = readl(info->reg.gpmc_status) & |
310 | GPMC_STATUS_BUFF_EMPTY; | ||
239 | } while (!status); | 311 | } while (!status); |
240 | } | 312 | } |
241 | } | 313 | } |
@@ -265,8 +337,8 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
265 | } | 337 | } |
266 | 338 | ||
267 | /* configure and start prefetch transfer */ | 339 | /* configure and start prefetch transfer */ |
268 | ret = gpmc_prefetch_enable(info->gpmc_cs, | 340 | ret = omap_prefetch_enable(info->gpmc_cs, |
269 | PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0); | 341 | PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0, info); |
270 | if (ret) { | 342 | if (ret) { |
271 | /* PFPW engine is busy, use cpu copy method */ | 343 | /* PFPW engine is busy, use cpu copy method */ |
272 | if (info->nand.options & NAND_BUSWIDTH_16) | 344 | if (info->nand.options & NAND_BUSWIDTH_16) |
@@ -275,14 +347,15 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
275 | omap_read_buf8(mtd, (u_char *)p, len); | 347 | omap_read_buf8(mtd, (u_char *)p, len); |
276 | } else { | 348 | } else { |
277 | do { | 349 | do { |
278 | r_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT); | 350 | r_count = readl(info->reg.gpmc_prefetch_status); |
351 | r_count = GPMC_PREFETCH_STATUS_FIFO_CNT(r_count); | ||
279 | r_count = r_count >> 2; | 352 | r_count = r_count >> 2; |
280 | ioread32_rep(info->nand.IO_ADDR_R, p, r_count); | 353 | ioread32_rep(info->nand.IO_ADDR_R, p, r_count); |
281 | p += r_count; | 354 | p += r_count; |
282 | len -= r_count << 2; | 355 | len -= r_count << 2; |
283 | } while (len); | 356 | } while (len); |
284 | /* disable and stop the PFPW engine */ | 357 | /* disable and stop the PFPW engine */ |
285 | gpmc_prefetch_reset(info->gpmc_cs); | 358 | omap_prefetch_reset(info->gpmc_cs, info); |
286 | } | 359 | } |
287 | } | 360 | } |
288 | 361 | ||
@@ -301,6 +374,7 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
301 | int i = 0, ret = 0; | 374 | int i = 0, ret = 0; |
302 | u16 *p = (u16 *)buf; | 375 | u16 *p = (u16 *)buf; |
303 | unsigned long tim, limit; | 376 | unsigned long tim, limit; |
377 | u32 val; | ||
304 | 378 | ||
305 | /* take care of subpage writes */ | 379 | /* take care of subpage writes */ |
306 | if (len % 2 != 0) { | 380 | if (len % 2 != 0) { |
@@ -310,8 +384,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
310 | } | 384 | } |
311 | 385 | ||
312 | /* configure and start prefetch transfer */ | 386 | /* configure and start prefetch transfer */ |
313 | ret = gpmc_prefetch_enable(info->gpmc_cs, | 387 | ret = omap_prefetch_enable(info->gpmc_cs, |
314 | PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1); | 388 | PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1, info); |
315 | if (ret) { | 389 | if (ret) { |
316 | /* PFPW engine is busy, use cpu copy method */ | 390 | /* PFPW engine is busy, use cpu copy method */ |
317 | if (info->nand.options & NAND_BUSWIDTH_16) | 391 | if (info->nand.options & NAND_BUSWIDTH_16) |
@@ -320,7 +394,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
320 | omap_write_buf8(mtd, (u_char *)p, len); | 394 | omap_write_buf8(mtd, (u_char *)p, len); |
321 | } else { | 395 | } else { |
322 | while (len) { | 396 | while (len) { |
323 | w_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT); | 397 | w_count = readl(info->reg.gpmc_prefetch_status); |
398 | w_count = GPMC_PREFETCH_STATUS_FIFO_CNT(w_count); | ||
324 | w_count = w_count >> 1; | 399 | w_count = w_count >> 1; |
325 | for (i = 0; (i < w_count) && len; i++, len -= 2) | 400 | for (i = 0; (i < w_count) && len; i++, len -= 2) |
326 | iowrite16(*p++, info->nand.IO_ADDR_W); | 401 | iowrite16(*p++, info->nand.IO_ADDR_W); |
@@ -329,11 +404,14 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
329 | tim = 0; | 404 | tim = 0; |
330 | limit = (loops_per_jiffy * | 405 | limit = (loops_per_jiffy * |
331 | msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); | 406 | msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); |
332 | while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit)) | 407 | do { |
333 | cpu_relax(); | 408 | cpu_relax(); |
409 | val = readl(info->reg.gpmc_prefetch_status); | ||
410 | val = GPMC_PREFETCH_STATUS_COUNT(val); | ||
411 | } while (val && (tim++ < limit)); | ||
334 | 412 | ||
335 | /* disable and stop the PFPW engine */ | 413 | /* disable and stop the PFPW engine */ |
336 | gpmc_prefetch_reset(info->gpmc_cs); | 414 | omap_prefetch_reset(info->gpmc_cs, info); |
337 | } | 415 | } |
338 | } | 416 | } |
339 | 417 | ||
@@ -365,6 +443,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
365 | unsigned long tim, limit; | 443 | unsigned long tim, limit; |
366 | unsigned n; | 444 | unsigned n; |
367 | int ret; | 445 | int ret; |
446 | u32 val; | ||
368 | 447 | ||
369 | if (addr >= high_memory) { | 448 | if (addr >= high_memory) { |
370 | struct page *p1; | 449 | struct page *p1; |
@@ -396,9 +475,9 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
396 | tx->callback_param = &info->comp; | 475 | tx->callback_param = &info->comp; |
397 | dmaengine_submit(tx); | 476 | dmaengine_submit(tx); |
398 | 477 | ||
399 | /* configure and start prefetch transfer */ | 478 | /* configure and start prefetch transfer */ |
400 | ret = gpmc_prefetch_enable(info->gpmc_cs, | 479 | ret = omap_prefetch_enable(info->gpmc_cs, |
401 | PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write); | 480 | PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write, info); |
402 | if (ret) | 481 | if (ret) |
403 | /* PFPW engine is busy, use cpu copy method */ | 482 | /* PFPW engine is busy, use cpu copy method */ |
404 | goto out_copy_unmap; | 483 | goto out_copy_unmap; |
@@ -410,11 +489,15 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
410 | wait_for_completion(&info->comp); | 489 | wait_for_completion(&info->comp); |
411 | tim = 0; | 490 | tim = 0; |
412 | limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); | 491 | limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); |
413 | while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit)) | 492 | |
493 | do { | ||
414 | cpu_relax(); | 494 | cpu_relax(); |
495 | val = readl(info->reg.gpmc_prefetch_status); | ||
496 | val = GPMC_PREFETCH_STATUS_COUNT(val); | ||
497 | } while (val && (tim++ < limit)); | ||
415 | 498 | ||
416 | /* disable and stop the PFPW engine */ | 499 | /* disable and stop the PFPW engine */ |
417 | gpmc_prefetch_reset(info->gpmc_cs); | 500 | omap_prefetch_reset(info->gpmc_cs, info); |
418 | 501 | ||
419 | dma_unmap_sg(info->dma->device->dev, &sg, 1, dir); | 502 | dma_unmap_sg(info->dma->device->dev, &sg, 1, dir); |
420 | return 0; | 503 | return 0; |
@@ -471,13 +554,12 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev) | |||
471 | { | 554 | { |
472 | struct omap_nand_info *info = (struct omap_nand_info *) dev; | 555 | struct omap_nand_info *info = (struct omap_nand_info *) dev; |
473 | u32 bytes; | 556 | u32 bytes; |
474 | u32 irq_stat; | ||
475 | 557 | ||
476 | irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS); | 558 | bytes = readl(info->reg.gpmc_prefetch_status); |
477 | bytes = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT); | 559 | bytes = GPMC_PREFETCH_STATUS_FIFO_CNT(bytes); |
478 | bytes = bytes & 0xFFFC; /* io in multiple of 4 bytes */ | 560 | bytes = bytes & 0xFFFC; /* io in multiple of 4 bytes */ |
479 | if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */ | 561 | if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */ |
480 | if (irq_stat & 0x2) | 562 | if (this_irq == info->gpmc_irq_count) |
481 | goto done; | 563 | goto done; |
482 | 564 | ||
483 | if (info->buf_len && (info->buf_len < bytes)) | 565 | if (info->buf_len && (info->buf_len < bytes)) |
@@ -494,20 +576,17 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev) | |||
494 | (u32 *)info->buf, bytes >> 2); | 576 | (u32 *)info->buf, bytes >> 2); |
495 | info->buf = info->buf + bytes; | 577 | info->buf = info->buf + bytes; |
496 | 578 | ||
497 | if (irq_stat & 0x2) | 579 | if (this_irq == info->gpmc_irq_count) |
498 | goto done; | 580 | goto done; |
499 | } | 581 | } |
500 | gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat); | ||
501 | 582 | ||
502 | return IRQ_HANDLED; | 583 | return IRQ_HANDLED; |
503 | 584 | ||
504 | done: | 585 | done: |
505 | complete(&info->comp); | 586 | complete(&info->comp); |
506 | /* disable irq */ | ||
507 | gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, 0); | ||
508 | 587 | ||
509 | /* clear status */ | 588 | disable_irq_nosync(info->gpmc_irq_fifo); |
510 | gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat); | 589 | disable_irq_nosync(info->gpmc_irq_count); |
511 | 590 | ||
512 | return IRQ_HANDLED; | 591 | return IRQ_HANDLED; |
513 | } | 592 | } |
@@ -534,22 +613,22 @@ static void omap_read_buf_irq_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
534 | init_completion(&info->comp); | 613 | init_completion(&info->comp); |
535 | 614 | ||
536 | /* configure and start prefetch transfer */ | 615 | /* configure and start prefetch transfer */ |
537 | ret = gpmc_prefetch_enable(info->gpmc_cs, | 616 | ret = omap_prefetch_enable(info->gpmc_cs, |
538 | PREFETCH_FIFOTHRESHOLD_MAX/2, 0x0, len, 0x0); | 617 | PREFETCH_FIFOTHRESHOLD_MAX/2, 0x0, len, 0x0, info); |
539 | if (ret) | 618 | if (ret) |
540 | /* PFPW engine is busy, use cpu copy method */ | 619 | /* PFPW engine is busy, use cpu copy method */ |
541 | goto out_copy; | 620 | goto out_copy; |
542 | 621 | ||
543 | info->buf_len = len; | 622 | info->buf_len = len; |
544 | /* enable irq */ | 623 | |
545 | gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, | 624 | enable_irq(info->gpmc_irq_count); |
546 | (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT)); | 625 | enable_irq(info->gpmc_irq_fifo); |
547 | 626 | ||
548 | /* waiting for read to complete */ | 627 | /* waiting for read to complete */ |
549 | wait_for_completion(&info->comp); | 628 | wait_for_completion(&info->comp); |
550 | 629 | ||
551 | /* disable and stop the PFPW engine */ | 630 | /* disable and stop the PFPW engine */ |
552 | gpmc_prefetch_reset(info->gpmc_cs); | 631 | omap_prefetch_reset(info->gpmc_cs, info); |
553 | return; | 632 | return; |
554 | 633 | ||
555 | out_copy: | 634 | out_copy: |
@@ -572,6 +651,7 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd, | |||
572 | struct omap_nand_info, mtd); | 651 | struct omap_nand_info, mtd); |
573 | int ret = 0; | 652 | int ret = 0; |
574 | unsigned long tim, limit; | 653 | unsigned long tim, limit; |
654 | u32 val; | ||
575 | 655 | ||
576 | if (len <= mtd->oobsize) { | 656 | if (len <= mtd->oobsize) { |
577 | omap_write_buf_pref(mtd, buf, len); | 657 | omap_write_buf_pref(mtd, buf, len); |
@@ -583,27 +663,31 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd, | |||
583 | init_completion(&info->comp); | 663 | init_completion(&info->comp); |
584 | 664 | ||
585 | /* configure and start prefetch transfer : size=24 */ | 665 | /* configure and start prefetch transfer : size=24 */ |
586 | ret = gpmc_prefetch_enable(info->gpmc_cs, | 666 | ret = omap_prefetch_enable(info->gpmc_cs, |
587 | (PREFETCH_FIFOTHRESHOLD_MAX * 3) / 8, 0x0, len, 0x1); | 667 | (PREFETCH_FIFOTHRESHOLD_MAX * 3) / 8, 0x0, len, 0x1, info); |
588 | if (ret) | 668 | if (ret) |
589 | /* PFPW engine is busy, use cpu copy method */ | 669 | /* PFPW engine is busy, use cpu copy method */ |
590 | goto out_copy; | 670 | goto out_copy; |
591 | 671 | ||
592 | info->buf_len = len; | 672 | info->buf_len = len; |
593 | /* enable irq */ | 673 | |
594 | gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, | 674 | enable_irq(info->gpmc_irq_count); |
595 | (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT)); | 675 | enable_irq(info->gpmc_irq_fifo); |
596 | 676 | ||
597 | /* waiting for write to complete */ | 677 | /* waiting for write to complete */ |
598 | wait_for_completion(&info->comp); | 678 | wait_for_completion(&info->comp); |
679 | |||
599 | /* wait for data to flushed-out before reset the prefetch */ | 680 | /* wait for data to flushed-out before reset the prefetch */ |
600 | tim = 0; | 681 | tim = 0; |
601 | limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); | 682 | limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); |
602 | while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit)) | 683 | do { |
684 | val = readl(info->reg.gpmc_prefetch_status); | ||
685 | val = GPMC_PREFETCH_STATUS_COUNT(val); | ||
603 | cpu_relax(); | 686 | cpu_relax(); |
687 | } while (val && (tim++ < limit)); | ||
604 | 688 | ||
605 | /* disable and stop the PFPW engine */ | 689 | /* disable and stop the PFPW engine */ |
606 | gpmc_prefetch_reset(info->gpmc_cs); | 690 | omap_prefetch_reset(info->gpmc_cs, info); |
607 | return; | 691 | return; |
608 | 692 | ||
609 | out_copy: | 693 | out_copy: |
@@ -843,7 +927,20 @@ static int omap_calculate_ecc(struct mtd_info *mtd, const u_char *dat, | |||
843 | { | 927 | { |
844 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, | 928 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, |
845 | mtd); | 929 | mtd); |
846 | return gpmc_calculate_ecc(info->gpmc_cs, dat, ecc_code); | 930 | u32 val; |
931 | |||
932 | val = readl(info->reg.gpmc_ecc_config); | ||
933 | if (((val >> ECC_CONFIG_CS_SHIFT) & ~CS_MASK) != info->gpmc_cs) | ||
934 | return -EINVAL; | ||
935 | |||
936 | /* read ecc result */ | ||
937 | val = readl(info->reg.gpmc_ecc1_result); | ||
938 | *ecc_code++ = val; /* P128e, ..., P1e */ | ||
939 | *ecc_code++ = val >> 16; /* P128o, ..., P1o */ | ||
940 | /* P2048o, P1024o, P512o, P256o, P2048e, P1024e, P512e, P256e */ | ||
941 | *ecc_code++ = ((val >> 8) & 0x0f) | ((val >> 20) & 0xf0); | ||
942 | |||
943 | return 0; | ||
847 | } | 944 | } |
848 | 945 | ||
849 | /** | 946 | /** |
@@ -857,8 +954,34 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int mode) | |||
857 | mtd); | 954 | mtd); |
858 | struct nand_chip *chip = mtd->priv; | 955 | struct nand_chip *chip = mtd->priv; |
859 | unsigned int dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0; | 956 | unsigned int dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0; |
957 | u32 val; | ||
958 | |||
959 | /* clear ecc and enable bits */ | ||
960 | val = ECCCLEAR | ECC1; | ||
961 | writel(val, info->reg.gpmc_ecc_control); | ||
962 | |||
963 | /* program ecc and result sizes */ | ||
964 | val = ((((info->nand.ecc.size >> 1) - 1) << ECCSIZE1_SHIFT) | | ||
965 | ECC1RESULTSIZE); | ||
966 | writel(val, info->reg.gpmc_ecc_size_config); | ||
860 | 967 | ||
861 | gpmc_enable_hwecc(info->gpmc_cs, mode, dev_width, info->nand.ecc.size); | 968 | switch (mode) { |
969 | case NAND_ECC_READ: | ||
970 | case NAND_ECC_WRITE: | ||
971 | writel(ECCCLEAR | ECC1, info->reg.gpmc_ecc_control); | ||
972 | break; | ||
973 | case NAND_ECC_READSYN: | ||
974 | writel(ECCCLEAR, info->reg.gpmc_ecc_control); | ||
975 | break; | ||
976 | default: | ||
977 | dev_info(&info->pdev->dev, | ||
978 | "error: unrecognized Mode[%d]!\n", mode); | ||
979 | break; | ||
980 | } | ||
981 | |||
982 | /* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */ | ||
983 | val = (dev_width << 7) | (info->gpmc_cs << 1) | (0x1); | ||
984 | writel(val, info->reg.gpmc_ecc_config); | ||
862 | } | 985 | } |
863 | 986 | ||
864 | /** | 987 | /** |
@@ -886,10 +1009,9 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip) | |||
886 | else | 1009 | else |
887 | timeo += (HZ * 20) / 1000; | 1010 | timeo += (HZ * 20) / 1000; |
888 | 1011 | ||
889 | gpmc_nand_write(info->gpmc_cs, | 1012 | writeb(NAND_CMD_STATUS & 0xFF, info->reg.gpmc_nand_command); |
890 | GPMC_NAND_COMMAND, (NAND_CMD_STATUS & 0xFF)); | ||
891 | while (time_before(jiffies, timeo)) { | 1013 | while (time_before(jiffies, timeo)) { |
892 | status = gpmc_nand_read(info->gpmc_cs, GPMC_NAND_DATA); | 1014 | status = readb(info->reg.gpmc_nand_data); |
893 | if (status & NAND_STATUS_READY) | 1015 | if (status & NAND_STATUS_READY) |
894 | break; | 1016 | break; |
895 | cond_resched(); | 1017 | cond_resched(); |
@@ -909,22 +1031,13 @@ static int omap_dev_ready(struct mtd_info *mtd) | |||
909 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, | 1031 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, |
910 | mtd); | 1032 | mtd); |
911 | 1033 | ||
912 | val = gpmc_read_status(GPMC_GET_IRQ_STATUS); | 1034 | val = readl(info->reg.gpmc_status); |
1035 | |||
913 | if ((val & 0x100) == 0x100) { | 1036 | if ((val & 0x100) == 0x100) { |
914 | /* Clear IRQ Interrupt */ | 1037 | return 1; |
915 | val |= 0x100; | ||
916 | val &= ~(0x0); | ||
917 | gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, val); | ||
918 | } else { | 1038 | } else { |
919 | unsigned int cnt = 0; | 1039 | return 0; |
920 | while (cnt++ < 0x1FF) { | ||
921 | if ((val & 0x100) == 0x100) | ||
922 | return 0; | ||
923 | val = gpmc_read_status(GPMC_GET_IRQ_STATUS); | ||
924 | } | ||
925 | } | 1040 | } |
926 | |||
927 | return 1; | ||
928 | } | 1041 | } |
929 | 1042 | ||
930 | #ifdef CONFIG_MTD_NAND_OMAP_BCH | 1043 | #ifdef CONFIG_MTD_NAND_OMAP_BCH |
@@ -1155,6 +1268,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
1155 | int i, offset; | 1268 | int i, offset; |
1156 | dma_cap_mask_t mask; | 1269 | dma_cap_mask_t mask; |
1157 | unsigned sig; | 1270 | unsigned sig; |
1271 | struct resource *res; | ||
1158 | 1272 | ||
1159 | pdata = pdev->dev.platform_data; | 1273 | pdata = pdev->dev.platform_data; |
1160 | if (pdata == NULL) { | 1274 | if (pdata == NULL) { |
@@ -1174,7 +1288,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
1174 | info->pdev = pdev; | 1288 | info->pdev = pdev; |
1175 | 1289 | ||
1176 | info->gpmc_cs = pdata->cs; | 1290 | info->gpmc_cs = pdata->cs; |
1177 | info->phys_base = pdata->phys_base; | 1291 | info->reg = pdata->reg; |
1178 | 1292 | ||
1179 | info->mtd.priv = &info->nand; | 1293 | info->mtd.priv = &info->nand; |
1180 | info->mtd.name = dev_name(&pdev->dev); | 1294 | info->mtd.name = dev_name(&pdev->dev); |
@@ -1183,16 +1297,23 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
1183 | info->nand.options = pdata->devsize; | 1297 | info->nand.options = pdata->devsize; |
1184 | info->nand.options |= NAND_SKIP_BBTSCAN; | 1298 | info->nand.options |= NAND_SKIP_BBTSCAN; |
1185 | 1299 | ||
1186 | /* NAND write protect off */ | 1300 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1187 | gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_WP, 0); | 1301 | if (res == NULL) { |
1302 | err = -EINVAL; | ||
1303 | dev_err(&pdev->dev, "error getting memory resource\n"); | ||
1304 | goto out_free_info; | ||
1305 | } | ||
1306 | |||
1307 | info->phys_base = res->start; | ||
1308 | info->mem_size = resource_size(res); | ||
1188 | 1309 | ||
1189 | if (!request_mem_region(info->phys_base, NAND_IO_SIZE, | 1310 | if (!request_mem_region(info->phys_base, info->mem_size, |
1190 | pdev->dev.driver->name)) { | 1311 | pdev->dev.driver->name)) { |
1191 | err = -EBUSY; | 1312 | err = -EBUSY; |
1192 | goto out_free_info; | 1313 | goto out_free_info; |
1193 | } | 1314 | } |
1194 | 1315 | ||
1195 | info->nand.IO_ADDR_R = ioremap(info->phys_base, NAND_IO_SIZE); | 1316 | info->nand.IO_ADDR_R = ioremap(info->phys_base, info->mem_size); |
1196 | if (!info->nand.IO_ADDR_R) { | 1317 | if (!info->nand.IO_ADDR_R) { |
1197 | err = -ENOMEM; | 1318 | err = -ENOMEM; |
1198 | goto out_release_mem_region; | 1319 | goto out_release_mem_region; |
@@ -1265,17 +1386,39 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
1265 | break; | 1386 | break; |
1266 | 1387 | ||
1267 | case NAND_OMAP_PREFETCH_IRQ: | 1388 | case NAND_OMAP_PREFETCH_IRQ: |
1268 | err = request_irq(pdata->gpmc_irq, | 1389 | info->gpmc_irq_fifo = platform_get_irq(pdev, 0); |
1269 | omap_nand_irq, IRQF_SHARED, "gpmc-nand", info); | 1390 | if (info->gpmc_irq_fifo <= 0) { |
1391 | dev_err(&pdev->dev, "error getting fifo irq\n"); | ||
1392 | err = -ENODEV; | ||
1393 | goto out_release_mem_region; | ||
1394 | } | ||
1395 | err = request_irq(info->gpmc_irq_fifo, omap_nand_irq, | ||
1396 | IRQF_SHARED, "gpmc-nand-fifo", info); | ||
1270 | if (err) { | 1397 | if (err) { |
1271 | dev_err(&pdev->dev, "requesting irq(%d) error:%d", | 1398 | dev_err(&pdev->dev, "requesting irq(%d) error:%d", |
1272 | pdata->gpmc_irq, err); | 1399 | info->gpmc_irq_fifo, err); |
1400 | info->gpmc_irq_fifo = 0; | ||
1401 | goto out_release_mem_region; | ||
1402 | } | ||
1403 | |||
1404 | info->gpmc_irq_count = platform_get_irq(pdev, 1); | ||
1405 | if (info->gpmc_irq_count <= 0) { | ||
1406 | dev_err(&pdev->dev, "error getting count irq\n"); | ||
1407 | err = -ENODEV; | ||
1408 | goto out_release_mem_region; | ||
1409 | } | ||
1410 | err = request_irq(info->gpmc_irq_count, omap_nand_irq, | ||
1411 | IRQF_SHARED, "gpmc-nand-count", info); | ||
1412 | if (err) { | ||
1413 | dev_err(&pdev->dev, "requesting irq(%d) error:%d", | ||
1414 | info->gpmc_irq_count, err); | ||
1415 | info->gpmc_irq_count = 0; | ||
1273 | goto out_release_mem_region; | 1416 | goto out_release_mem_region; |
1274 | } else { | ||
1275 | info->gpmc_irq = pdata->gpmc_irq; | ||
1276 | info->nand.read_buf = omap_read_buf_irq_pref; | ||
1277 | info->nand.write_buf = omap_write_buf_irq_pref; | ||
1278 | } | 1417 | } |
1418 | |||
1419 | info->nand.read_buf = omap_read_buf_irq_pref; | ||
1420 | info->nand.write_buf = omap_write_buf_irq_pref; | ||
1421 | |||
1279 | break; | 1422 | break; |
1280 | 1423 | ||
1281 | default: | 1424 | default: |
@@ -1363,7 +1506,11 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
1363 | out_release_mem_region: | 1506 | out_release_mem_region: |
1364 | if (info->dma) | 1507 | if (info->dma) |
1365 | dma_release_channel(info->dma); | 1508 | dma_release_channel(info->dma); |
1366 | release_mem_region(info->phys_base, NAND_IO_SIZE); | 1509 | if (info->gpmc_irq_count > 0) |
1510 | free_irq(info->gpmc_irq_count, info); | ||
1511 | if (info->gpmc_irq_fifo > 0) | ||
1512 | free_irq(info->gpmc_irq_fifo, info); | ||
1513 | release_mem_region(info->phys_base, info->mem_size); | ||
1367 | out_free_info: | 1514 | out_free_info: |
1368 | kfree(info); | 1515 | kfree(info); |
1369 | 1516 | ||
@@ -1381,8 +1528,10 @@ static int omap_nand_remove(struct platform_device *pdev) | |||
1381 | if (info->dma) | 1528 | if (info->dma) |
1382 | dma_release_channel(info->dma); | 1529 | dma_release_channel(info->dma); |
1383 | 1530 | ||
1384 | if (info->gpmc_irq) | 1531 | if (info->gpmc_irq_count > 0) |
1385 | free_irq(info->gpmc_irq, info); | 1532 | free_irq(info->gpmc_irq_count, info); |
1533 | if (info->gpmc_irq_fifo > 0) | ||
1534 | free_irq(info->gpmc_irq_fifo, info); | ||
1386 | 1535 | ||
1387 | /* Release NAND device, its internal structures and partitions */ | 1536 | /* Release NAND device, its internal structures and partitions */ |
1388 | nand_release(&info->mtd); | 1537 | nand_release(&info->mtd); |
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index 398a82783848..1961be985171 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c | |||
@@ -39,22 +39,21 @@ | |||
39 | 39 | ||
40 | #include <asm/mach/flash.h> | 40 | #include <asm/mach/flash.h> |
41 | #include <plat/gpmc.h> | 41 | #include <plat/gpmc.h> |
42 | #include <plat/onenand.h> | 42 | #include <linux/platform_data/mtd-onenand-omap2.h> |
43 | #include <asm/gpio.h> | 43 | #include <asm/gpio.h> |
44 | 44 | ||
45 | #include <plat/dma.h> | 45 | #include <plat/dma.h> |
46 | 46 | #include <plat/cpu.h> | |
47 | #include <plat/board.h> | ||
48 | 47 | ||
49 | #define DRIVER_NAME "omap2-onenand" | 48 | #define DRIVER_NAME "omap2-onenand" |
50 | 49 | ||
51 | #define ONENAND_IO_SIZE SZ_128K | ||
52 | #define ONENAND_BUFRAM_SIZE (1024 * 5) | 50 | #define ONENAND_BUFRAM_SIZE (1024 * 5) |
53 | 51 | ||
54 | struct omap2_onenand { | 52 | struct omap2_onenand { |
55 | struct platform_device *pdev; | 53 | struct platform_device *pdev; |
56 | int gpmc_cs; | 54 | int gpmc_cs; |
57 | unsigned long phys_base; | 55 | unsigned long phys_base; |
56 | unsigned int mem_size; | ||
58 | int gpio_irq; | 57 | int gpio_irq; |
59 | struct mtd_info mtd; | 58 | struct mtd_info mtd; |
60 | struct onenand_chip onenand; | 59 | struct onenand_chip onenand; |
@@ -626,6 +625,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) | |||
626 | struct omap2_onenand *c; | 625 | struct omap2_onenand *c; |
627 | struct onenand_chip *this; | 626 | struct onenand_chip *this; |
628 | int r; | 627 | int r; |
628 | struct resource *res; | ||
629 | 629 | ||
630 | pdata = pdev->dev.platform_data; | 630 | pdata = pdev->dev.platform_data; |
631 | if (pdata == NULL) { | 631 | if (pdata == NULL) { |
@@ -647,20 +647,24 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) | |||
647 | c->gpio_irq = 0; | 647 | c->gpio_irq = 0; |
648 | } | 648 | } |
649 | 649 | ||
650 | r = gpmc_cs_request(c->gpmc_cs, ONENAND_IO_SIZE, &c->phys_base); | 650 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
651 | if (r < 0) { | 651 | if (res == NULL) { |
652 | dev_err(&pdev->dev, "Cannot request GPMC CS\n"); | 652 | r = -EINVAL; |
653 | dev_err(&pdev->dev, "error getting memory resource\n"); | ||
653 | goto err_kfree; | 654 | goto err_kfree; |
654 | } | 655 | } |
655 | 656 | ||
656 | if (request_mem_region(c->phys_base, ONENAND_IO_SIZE, | 657 | c->phys_base = res->start; |
658 | c->mem_size = resource_size(res); | ||
659 | |||
660 | if (request_mem_region(c->phys_base, c->mem_size, | ||
657 | pdev->dev.driver->name) == NULL) { | 661 | pdev->dev.driver->name) == NULL) { |
658 | dev_err(&pdev->dev, "Cannot reserve memory region at 0x%08lx, " | 662 | dev_err(&pdev->dev, "Cannot reserve memory region at 0x%08lx, size: 0x%x\n", |
659 | "size: 0x%x\n", c->phys_base, ONENAND_IO_SIZE); | 663 | c->phys_base, c->mem_size); |
660 | r = -EBUSY; | 664 | r = -EBUSY; |
661 | goto err_free_cs; | 665 | goto err_kfree; |
662 | } | 666 | } |
663 | c->onenand.base = ioremap(c->phys_base, ONENAND_IO_SIZE); | 667 | c->onenand.base = ioremap(c->phys_base, c->mem_size); |
664 | if (c->onenand.base == NULL) { | 668 | if (c->onenand.base == NULL) { |
665 | r = -ENOMEM; | 669 | r = -ENOMEM; |
666 | goto err_release_mem_region; | 670 | goto err_release_mem_region; |
@@ -776,9 +780,7 @@ err_release_gpio: | |||
776 | err_iounmap: | 780 | err_iounmap: |
777 | iounmap(c->onenand.base); | 781 | iounmap(c->onenand.base); |
778 | err_release_mem_region: | 782 | err_release_mem_region: |
779 | release_mem_region(c->phys_base, ONENAND_IO_SIZE); | 783 | release_mem_region(c->phys_base, c->mem_size); |
780 | err_free_cs: | ||
781 | gpmc_cs_free(c->gpmc_cs); | ||
782 | err_kfree: | 784 | err_kfree: |
783 | kfree(c); | 785 | kfree(c); |
784 | 786 | ||
@@ -800,7 +802,7 @@ static int __devexit omap2_onenand_remove(struct platform_device *pdev) | |||
800 | gpio_free(c->gpio_irq); | 802 | gpio_free(c->gpio_irq); |
801 | } | 803 | } |
802 | iounmap(c->onenand.base); | 804 | iounmap(c->onenand.base); |
803 | release_mem_region(c->phys_base, ONENAND_IO_SIZE); | 805 | release_mem_region(c->phys_base, c->mem_size); |
804 | gpmc_cs_free(c->gpmc_cs); | 806 | gpmc_cs_free(c->gpmc_cs); |
805 | kfree(c); | 807 | kfree(c); |
806 | 808 | ||
diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c index df808ac8cb65..6a40dd03a32f 100644 --- a/drivers/net/ethernet/seeq/ether3.c +++ b/drivers/net/ethernet/seeq/ether3.c | |||
@@ -99,13 +99,13 @@ typedef enum { | |||
99 | * The SEEQ8005 doesn't like us writing to its registers | 99 | * The SEEQ8005 doesn't like us writing to its registers |
100 | * too quickly. | 100 | * too quickly. |
101 | */ | 101 | */ |
102 | static inline void ether3_outb(int v, const void __iomem *r) | 102 | static inline void ether3_outb(int v, void __iomem *r) |
103 | { | 103 | { |
104 | writeb(v, r); | 104 | writeb(v, r); |
105 | udelay(1); | 105 | udelay(1); |
106 | } | 106 | } |
107 | 107 | ||
108 | static inline void ether3_outw(int v, const void __iomem *r) | 108 | static inline void ether3_outw(int v, void __iomem *r) |
109 | { | 109 | { |
110 | writew(v, r); | 110 | writew(v, r); |
111 | udelay(1); | 111 | udelay(1); |
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 0ad06a3bd562..fa74efe82206 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
25 | #include <asm/sizes.h> | 25 | #include <asm/sizes.h> |
26 | 26 | ||
27 | #include <plat/mux.h> | 27 | #include <mach/mux.h> |
28 | #include <plat/tc.h> | 28 | #include <plat/tc.h> |
29 | 29 | ||
30 | 30 | ||
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c index cc0f00d73d15..b446c9641212 100644 --- a/drivers/pinctrl/pinctrl-coh901.c +++ b/drivers/pinctrl/pinctrl-coh901.c | |||
@@ -1,11 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * U300 GPIO module. | 2 | * U300 GPIO module. |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2011 ST-Ericsson AB | 4 | * Copyright (C) 2007-2012 ST-Ericsson AB |
5 | * License terms: GNU General Public License (GPL) version 2 | 5 | * License terms: GNU General Public License (GPL) version 2 |
6 | * This can driver either of the two basic GPIO cores | ||
7 | * available in the U300 platforms: | ||
8 | * COH 901 335 - Used in DB3150 (U300 1.0) and DB3200 (U330 1.0) | ||
9 | * COH 901 571/3 - Used in DB3210 (U365 2.0) and DB3350 (U335 1.0) | 6 | * COH 901 571/3 - Used in DB3210 (U365 2.0) and DB3350 (U335 1.0) |
10 | * Author: Linus Walleij <linus.walleij@linaro.org> | 7 | * Author: Linus Walleij <linus.walleij@linaro.org> |
11 | * Author: Jonas Aaberg <jonas.aberg@stericsson.com> | 8 | * Author: Jonas Aaberg <jonas.aberg@stericsson.com> |
@@ -24,19 +21,22 @@ | |||
24 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
25 | #include <linux/pinctrl/consumer.h> | 22 | #include <linux/pinctrl/consumer.h> |
26 | #include <linux/pinctrl/pinconf-generic.h> | 23 | #include <linux/pinctrl/pinconf-generic.h> |
27 | #include <mach/gpio-u300.h> | 24 | #include <linux/platform_data/pinctrl-coh901.h> |
28 | #include "pinctrl-coh901.h" | 25 | #include "pinctrl-coh901.h" |
29 | 26 | ||
27 | #define U300_GPIO_PORT_STRIDE (0x30) | ||
30 | /* | 28 | /* |
31 | * Register definitions for COH 901 335 variant | 29 | * Control Register 32bit (R/W) |
30 | * bit 15-9 (mask 0x0000FE00) contains the number of cores. 8*cores | ||
31 | * gives the number of GPIO pins. | ||
32 | * bit 8-2 (mask 0x000001FC) contains the core version ID. | ||
32 | */ | 33 | */ |
33 | #define U300_335_PORT_STRIDE (0x1C) | 34 | #define U300_GPIO_CR (0x00) |
34 | /* Port X Pin Data Register 32bit, this is both input and output (R/W) */ | 35 | #define U300_GPIO_CR_SYNC_SEL_ENABLE (0x00000002UL) |
35 | #define U300_335_PXPDIR (0x00) | 36 | #define U300_GPIO_CR_BLOCK_CLKRQ_ENABLE (0x00000001UL) |
36 | #define U300_335_PXPDOR (0x00) | 37 | #define U300_GPIO_PXPDIR (0x04) |
37 | /* Port X Pin Config Register 32bit (R/W) */ | 38 | #define U300_GPIO_PXPDOR (0x08) |
38 | #define U300_335_PXPCR (0x04) | 39 | #define U300_GPIO_PXPCR (0x0C) |
39 | /* This register layout is the same in both blocks */ | ||
40 | #define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL) | 40 | #define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL) |
41 | #define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL) | 41 | #define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL) |
42 | #define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL) | 42 | #define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL) |
@@ -44,53 +44,17 @@ | |||
44 | #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL) | 44 | #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL) |
45 | #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL) | 45 | #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL) |
46 | #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL) | 46 | #define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL) |
47 | /* Port X Interrupt Event Register 32bit (R/W) */ | 47 | #define U300_GPIO_PXPER (0x10) |
48 | #define U300_335_PXIEV (0x08) | 48 | #define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL) |
49 | /* Port X Interrupt Enable Register 32bit (R/W) */ | 49 | #define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL) |
50 | #define U300_335_PXIEN (0x0C) | 50 | #define U300_GPIO_PXIEV (0x14) |
51 | /* Port X Interrupt Force Register 32bit (R/W) */ | 51 | #define U300_GPIO_PXIEN (0x18) |
52 | #define U300_335_PXIFR (0x10) | 52 | #define U300_GPIO_PXIFR (0x1C) |
53 | /* Port X Interrupt Config Register 32bit (R/W) */ | 53 | #define U300_GPIO_PXICR (0x20) |
54 | #define U300_335_PXICR (0x14) | ||
55 | /* This register layout is the same in both blocks */ | ||
56 | #define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL) | 54 | #define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL) |
57 | #define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL) | 55 | #define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL) |
58 | #define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL) | 56 | #define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL) |
59 | #define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL) | 57 | #define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL) |
60 | /* Port X Pull-up Enable Register 32bit (R/W) */ | ||
61 | #define U300_335_PXPER (0x18) | ||
62 | /* This register layout is the same in both blocks */ | ||
63 | #define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL) | ||
64 | #define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL) | ||
65 | /* Control Register 32bit (R/W) */ | ||
66 | #define U300_335_CR (0x54) | ||
67 | #define U300_335_CR_BLOCK_CLOCK_ENABLE (0x00000001UL) | ||
68 | |||
69 | /* | ||
70 | * Register definitions for COH 901 571 / 3 variant | ||
71 | */ | ||
72 | #define U300_571_PORT_STRIDE (0x30) | ||
73 | /* | ||
74 | * Control Register 32bit (R/W) | ||
75 | * bit 15-9 (mask 0x0000FE00) contains the number of cores. 8*cores | ||
76 | * gives the number of GPIO pins. | ||
77 | * bit 8-2 (mask 0x000001FC) contains the core version ID. | ||
78 | */ | ||
79 | #define U300_571_CR (0x00) | ||
80 | #define U300_571_CR_SYNC_SEL_ENABLE (0x00000002UL) | ||
81 | #define U300_571_CR_BLOCK_CLKRQ_ENABLE (0x00000001UL) | ||
82 | /* | ||
83 | * These registers have the same layout and function as the corresponding | ||
84 | * COH 901 335 registers, just at different offset. | ||
85 | */ | ||
86 | #define U300_571_PXPDIR (0x04) | ||
87 | #define U300_571_PXPDOR (0x08) | ||
88 | #define U300_571_PXPCR (0x0C) | ||
89 | #define U300_571_PXPER (0x10) | ||
90 | #define U300_571_PXIEV (0x14) | ||
91 | #define U300_571_PXIEN (0x18) | ||
92 | #define U300_571_PXIFR (0x1C) | ||
93 | #define U300_571_PXICR (0x20) | ||
94 | 58 | ||
95 | /* 8 bits per port, no version has more than 7 ports */ | 59 | /* 8 bits per port, no version has more than 7 ports */ |
96 | #define U300_GPIO_PINS_PER_PORT 8 | 60 | #define U300_GPIO_PINS_PER_PORT 8 |
@@ -149,8 +113,6 @@ struct u300_gpio_confdata { | |||
149 | 113 | ||
150 | /* BS335 has seven ports of 8 bits each = GPIO pins 0..55 */ | 114 | /* BS335 has seven ports of 8 bits each = GPIO pins 0..55 */ |
151 | #define BS335_GPIO_NUM_PORTS 7 | 115 | #define BS335_GPIO_NUM_PORTS 7 |
152 | /* BS365 has five ports of 8 bits each = GPIO pins 0..39 */ | ||
153 | #define BS365_GPIO_NUM_PORTS 5 | ||
154 | 116 | ||
155 | #define U300_FLOATING_INPUT { \ | 117 | #define U300_FLOATING_INPUT { \ |
156 | .bias_mode = PIN_CONFIG_BIAS_HIGH_IMPEDANCE, \ | 118 | .bias_mode = PIN_CONFIG_BIAS_HIGH_IMPEDANCE, \ |
@@ -172,7 +134,6 @@ struct u300_gpio_confdata { | |||
172 | .outval = 1, \ | 134 | .outval = 1, \ |
173 | } | 135 | } |
174 | 136 | ||
175 | |||
176 | /* Initial configuration */ | 137 | /* Initial configuration */ |
177 | static const struct __initconst u300_gpio_confdata | 138 | static const struct __initconst u300_gpio_confdata |
178 | bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { | 139 | bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { |
@@ -255,66 +216,6 @@ bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { | |||
255 | } | 216 | } |
256 | }; | 217 | }; |
257 | 218 | ||
258 | static const struct __initconst u300_gpio_confdata | ||
259 | bs365_gpio_config[BS365_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { | ||
260 | /* Port 0, pins 0-7 */ | ||
261 | { | ||
262 | U300_FLOATING_INPUT, | ||
263 | U300_OUTPUT_LOW, | ||
264 | U300_FLOATING_INPUT, | ||
265 | U300_OUTPUT_LOW, | ||
266 | U300_OUTPUT_LOW, | ||
267 | U300_OUTPUT_LOW, | ||
268 | U300_PULL_UP_INPUT, | ||
269 | U300_FLOATING_INPUT, | ||
270 | }, | ||
271 | /* Port 1, pins 0-7 */ | ||
272 | { | ||
273 | U300_OUTPUT_LOW, | ||
274 | U300_FLOATING_INPUT, | ||
275 | U300_OUTPUT_LOW, | ||
276 | U300_FLOATING_INPUT, | ||
277 | U300_FLOATING_INPUT, | ||
278 | U300_OUTPUT_HIGH, | ||
279 | U300_OUTPUT_LOW, | ||
280 | U300_OUTPUT_LOW, | ||
281 | }, | ||
282 | /* Port 2, pins 0-7 */ | ||
283 | { | ||
284 | U300_FLOATING_INPUT, | ||
285 | U300_PULL_UP_INPUT, | ||
286 | U300_OUTPUT_LOW, | ||
287 | U300_OUTPUT_LOW, | ||
288 | U300_PULL_UP_INPUT, | ||
289 | U300_PULL_UP_INPUT, | ||
290 | U300_PULL_UP_INPUT, | ||
291 | U300_PULL_UP_INPUT, | ||
292 | }, | ||
293 | /* Port 3, pins 0-7 */ | ||
294 | { | ||
295 | U300_PULL_UP_INPUT, | ||
296 | U300_PULL_UP_INPUT, | ||
297 | U300_PULL_UP_INPUT, | ||
298 | U300_PULL_UP_INPUT, | ||
299 | U300_PULL_UP_INPUT, | ||
300 | U300_PULL_UP_INPUT, | ||
301 | U300_PULL_UP_INPUT, | ||
302 | U300_PULL_UP_INPUT, | ||
303 | }, | ||
304 | /* Port 4, pins 0-7 */ | ||
305 | { | ||
306 | U300_PULL_UP_INPUT, | ||
307 | U300_PULL_UP_INPUT, | ||
308 | U300_PULL_UP_INPUT, | ||
309 | U300_PULL_UP_INPUT, | ||
310 | /* These 4 pins doesn't exist on DB3210 */ | ||
311 | U300_OUTPUT_LOW, | ||
312 | U300_OUTPUT_LOW, | ||
313 | U300_OUTPUT_LOW, | ||
314 | U300_OUTPUT_LOW, | ||
315 | } | ||
316 | }; | ||
317 | |||
318 | /** | 219 | /** |
319 | * to_u300_gpio() - get the pointer to u300_gpio | 220 | * to_u300_gpio() - get the pointer to u300_gpio |
320 | * @chip: the gpio chip member of the structure u300_gpio | 221 | * @chip: the gpio chip member of the structure u300_gpio |
@@ -716,13 +617,7 @@ static void __init u300_gpio_init_coh901571(struct u300_gpio *gpio, | |||
716 | const struct u300_gpio_confdata *conf; | 617 | const struct u300_gpio_confdata *conf; |
717 | int offset = (i*8) + j; | 618 | int offset = (i*8) + j; |
718 | 619 | ||
719 | if (plat->variant == U300_GPIO_COH901571_3_BS335) | 620 | conf = &bs335_gpio_config[i][j]; |
720 | conf = &bs335_gpio_config[i][j]; | ||
721 | else if (plat->variant == U300_GPIO_COH901571_3_BS365) | ||
722 | conf = &bs365_gpio_config[i][j]; | ||
723 | else | ||
724 | break; | ||
725 | |||
726 | u300_gpio_init_pin(gpio, offset, conf); | 621 | u300_gpio_init_pin(gpio, offset, conf); |
727 | } | 622 | } |
728 | } | 623 | } |
@@ -796,50 +691,27 @@ static int __init u300_gpio_probe(struct platform_device *pdev) | |||
796 | goto err_no_ioremap; | 691 | goto err_no_ioremap; |
797 | } | 692 | } |
798 | 693 | ||
799 | if (plat->variant == U300_GPIO_COH901335) { | 694 | dev_info(gpio->dev, |
800 | dev_info(gpio->dev, | 695 | "initializing GPIO Controller COH 901 571/3\n"); |
801 | "initializing GPIO Controller COH 901 335\n"); | 696 | gpio->stride = U300_GPIO_PORT_STRIDE; |
802 | gpio->stride = U300_335_PORT_STRIDE; | 697 | gpio->pcr = U300_GPIO_PXPCR; |
803 | gpio->pcr = U300_335_PXPCR; | 698 | gpio->dor = U300_GPIO_PXPDOR; |
804 | gpio->dor = U300_335_PXPDOR; | 699 | gpio->dir = U300_GPIO_PXPDIR; |
805 | gpio->dir = U300_335_PXPDIR; | 700 | gpio->per = U300_GPIO_PXPER; |
806 | gpio->per = U300_335_PXPER; | 701 | gpio->icr = U300_GPIO_PXICR; |
807 | gpio->icr = U300_335_PXICR; | 702 | gpio->ien = U300_GPIO_PXIEN; |
808 | gpio->ien = U300_335_PXIEN; | 703 | gpio->iev = U300_GPIO_PXIEV; |
809 | gpio->iev = U300_335_PXIEV; | 704 | ifr = U300_GPIO_PXIFR; |
810 | ifr = U300_335_PXIFR; | 705 | |
811 | 706 | val = readl(gpio->base + U300_GPIO_CR); | |
812 | /* Turn on the GPIO block */ | 707 | dev_info(gpio->dev, "COH901571/3 block version: %d, " \ |
813 | writel(U300_335_CR_BLOCK_CLOCK_ENABLE, | 708 | "number of cores: %d totalling %d pins\n", |
814 | gpio->base + U300_335_CR); | 709 | ((val & 0x000001FC) >> 2), |
815 | } else if (plat->variant == U300_GPIO_COH901571_3_BS335 || | 710 | ((val & 0x0000FE00) >> 9), |
816 | plat->variant == U300_GPIO_COH901571_3_BS365) { | 711 | ((val & 0x0000FE00) >> 9) * 8); |
817 | dev_info(gpio->dev, | 712 | writel(U300_GPIO_CR_BLOCK_CLKRQ_ENABLE, |
818 | "initializing GPIO Controller COH 901 571/3\n"); | 713 | gpio->base + U300_GPIO_CR); |
819 | gpio->stride = U300_571_PORT_STRIDE; | 714 | u300_gpio_init_coh901571(gpio, plat); |
820 | gpio->pcr = U300_571_PXPCR; | ||
821 | gpio->dor = U300_571_PXPDOR; | ||
822 | gpio->dir = U300_571_PXPDIR; | ||
823 | gpio->per = U300_571_PXPER; | ||
824 | gpio->icr = U300_571_PXICR; | ||
825 | gpio->ien = U300_571_PXIEN; | ||
826 | gpio->iev = U300_571_PXIEV; | ||
827 | ifr = U300_571_PXIFR; | ||
828 | |||
829 | val = readl(gpio->base + U300_571_CR); | ||
830 | dev_info(gpio->dev, "COH901571/3 block version: %d, " \ | ||
831 | "number of cores: %d totalling %d pins\n", | ||
832 | ((val & 0x000001FC) >> 2), | ||
833 | ((val & 0x0000FE00) >> 9), | ||
834 | ((val & 0x0000FE00) >> 9) * 8); | ||
835 | writel(U300_571_CR_BLOCK_CLKRQ_ENABLE, | ||
836 | gpio->base + U300_571_CR); | ||
837 | u300_gpio_init_coh901571(gpio, plat); | ||
838 | } else { | ||
839 | dev_err(gpio->dev, "unknown block variant\n"); | ||
840 | err = -ENODEV; | ||
841 | goto err_unknown_variant; | ||
842 | } | ||
843 | 715 | ||
844 | /* Add each port with its IRQ separately */ | 716 | /* Add each port with its IRQ separately */ |
845 | INIT_LIST_HEAD(&gpio->port_list); | 717 | INIT_LIST_HEAD(&gpio->port_list); |
@@ -906,7 +778,6 @@ err_no_pinctrl: | |||
906 | err_no_chip: | 778 | err_no_chip: |
907 | err_no_port: | 779 | err_no_port: |
908 | u300_gpio_free_ports(gpio); | 780 | u300_gpio_free_ports(gpio); |
909 | err_unknown_variant: | ||
910 | iounmap(gpio->base); | 781 | iounmap(gpio->base); |
911 | err_no_ioremap: | 782 | err_no_ioremap: |
912 | release_mem_region(gpio->memres->start, resource_size(gpio->memres)); | 783 | release_mem_region(gpio->memres->start, resource_size(gpio->memres)); |
@@ -923,16 +794,11 @@ err_no_clk: | |||
923 | 794 | ||
924 | static int __exit u300_gpio_remove(struct platform_device *pdev) | 795 | static int __exit u300_gpio_remove(struct platform_device *pdev) |
925 | { | 796 | { |
926 | struct u300_gpio_platform *plat = dev_get_platdata(&pdev->dev); | ||
927 | struct u300_gpio *gpio = platform_get_drvdata(pdev); | 797 | struct u300_gpio *gpio = platform_get_drvdata(pdev); |
928 | int err; | 798 | int err; |
929 | 799 | ||
930 | /* Turn off the GPIO block */ | 800 | /* Turn off the GPIO block */ |
931 | if (plat->variant == U300_GPIO_COH901335) | 801 | writel(0x00000000U, gpio->base + U300_GPIO_CR); |
932 | writel(0x00000000U, gpio->base + U300_335_CR); | ||
933 | if (plat->variant == U300_GPIO_COH901571_3_BS335 || | ||
934 | plat->variant == U300_GPIO_COH901571_3_BS365) | ||
935 | writel(0x00000000U, gpio->base + U300_571_CR); | ||
936 | 802 | ||
937 | err = gpiochip_remove(&gpio->chip); | 803 | err = gpiochip_remove(&gpio->chip); |
938 | if (err < 0) { | 804 | if (err < 0) { |
diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c index 44efc6e202af..d4957b4edb62 100644 --- a/drivers/power/avs/smartreflex.c +++ b/drivers/power/avs/smartreflex.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/pm_runtime.h> | 27 | #include <linux/pm_runtime.h> |
28 | #include <linux/power/smartreflex.h> | 28 | #include <linux/power/smartreflex.h> |
29 | 29 | ||
30 | #include <plat/cpu.h> | ||
31 | |||
30 | #define SMARTREFLEX_NAME_LEN 16 | 32 | #define SMARTREFLEX_NAME_LEN 16 |
31 | #define NVALUE_NAME_LEN 40 | 33 | #define NVALUE_NAME_LEN 40 |
32 | #define SR_DISABLE_TIMEOUT 200 | 34 | #define SR_DISABLE_TIMEOUT 200 |
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index a1f7ac1f8cf6..b54504ee61f1 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/remoteproc.h> | 29 | #include <linux/remoteproc.h> |
30 | 30 | ||
31 | #include <plat/mailbox.h> | 31 | #include <plat/mailbox.h> |
32 | #include <plat/remoteproc.h> | 32 | #include <linux/platform_data/remoteproc-omap.h> |
33 | 33 | ||
34 | #include "omap_remoteproc.h" | 34 | #include "omap_remoteproc.h" |
35 | #include "remoteproc_internal.h" | 35 | #include "remoteproc_internal.h" |
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c index edfd12b48c28..968d08358d20 100644 --- a/drivers/scsi/arm/eesox.c +++ b/drivers/scsi/arm/eesox.c | |||
@@ -273,7 +273,7 @@ static void eesoxscsi_buffer_out(void *buf, int length, void __iomem *base) | |||
273 | { | 273 | { |
274 | const void __iomem *reg_fas = base + EESOX_FAS216_OFFSET; | 274 | const void __iomem *reg_fas = base + EESOX_FAS216_OFFSET; |
275 | const void __iomem *reg_dmastat = base + EESOX_DMASTAT; | 275 | const void __iomem *reg_dmastat = base + EESOX_DMASTAT; |
276 | const void __iomem *reg_dmadata = base + EESOX_DMADATA; | 276 | void __iomem *reg_dmadata = base + EESOX_DMADATA; |
277 | 277 | ||
278 | do { | 278 | do { |
279 | unsigned int status; | 279 | unsigned int status; |
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 5f84b5563c2d..2d198a01a410 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig | |||
@@ -366,7 +366,7 @@ config SPI_STMP3XXX | |||
366 | 366 | ||
367 | config SPI_TEGRA | 367 | config SPI_TEGRA |
368 | tristate "Nvidia Tegra SPI controller" | 368 | tristate "Nvidia Tegra SPI controller" |
369 | depends on ARCH_TEGRA && (TEGRA_SYSTEM_DMA || TEGRA20_APB_DMA) | 369 | depends on ARCH_TEGRA && TEGRA20_APB_DMA |
370 | help | 370 | help |
371 | SPI driver for NVidia Tegra SoCs | 371 | SPI driver for NVidia Tegra SoCs |
372 | 372 | ||
diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index 9b0d71696039..0a94d9dc9c31 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c | |||
@@ -52,8 +52,9 @@ | |||
52 | #include <asm/io.h> | 52 | #include <asm/io.h> |
53 | #include <asm/mach-types.h> | 53 | #include <asm/mach-types.h> |
54 | 54 | ||
55 | #include <plat/mux.h> | 55 | #include <mach/mux.h> |
56 | #include <plat/omap7xx.h> /* OMAP7XX_IO_CONF registers */ | 56 | |
57 | #include <mach/omap7xx.h> /* OMAP7XX_IO_CONF registers */ | ||
57 | 58 | ||
58 | 59 | ||
59 | /* FIXME address is now a platform device resource, | 60 | /* FIXME address is now a platform device resource, |
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 569714ebffe0..5d59a69a9064 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include <linux/spi/spi.h> | 42 | #include <linux/spi/spi.h> |
43 | 43 | ||
44 | #include <plat/clock.h> | 44 | #include <plat/clock.h> |
45 | #include <plat/mcspi.h> | 45 | #include <linux/platform_data/spi-omap2-mcspi.h> |
46 | 46 | ||
47 | #define OMAP2_MCSPI_MAX_FREQ 48000000 | 47 | #define OMAP2_MCSPI_MAX_FREQ 48000000 |
48 | #define SPI_AUTOSUSPEND_TIMEOUT 2000 | 48 | #define SPI_AUTOSUSPEND_TIMEOUT 2000 |
diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c index ef52c1c6f5c5..488d9b6e9cbe 100644 --- a/drivers/spi/spi-tegra.c +++ b/drivers/spi/spi-tegra.c | |||
@@ -164,23 +164,15 @@ struct spi_tegra_data { | |||
164 | * for the generic case. | 164 | * for the generic case. |
165 | */ | 165 | */ |
166 | int dma_req_len; | 166 | int dma_req_len; |
167 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
168 | struct tegra_dma_req rx_dma_req; | ||
169 | struct tegra_dma_channel *rx_dma; | ||
170 | #else | ||
171 | struct dma_chan *rx_dma; | 167 | struct dma_chan *rx_dma; |
172 | struct dma_slave_config sconfig; | 168 | struct dma_slave_config sconfig; |
173 | struct dma_async_tx_descriptor *rx_dma_desc; | 169 | struct dma_async_tx_descriptor *rx_dma_desc; |
174 | dma_cookie_t rx_cookie; | 170 | dma_cookie_t rx_cookie; |
175 | #endif | ||
176 | u32 *rx_bb; | 171 | u32 *rx_bb; |
177 | dma_addr_t rx_bb_phys; | 172 | dma_addr_t rx_bb_phys; |
178 | }; | 173 | }; |
179 | 174 | ||
180 | #if !defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
181 | static void tegra_spi_rx_dma_complete(void *args); | 175 | static void tegra_spi_rx_dma_complete(void *args); |
182 | #endif | ||
183 | |||
184 | static inline unsigned long spi_tegra_readl(struct spi_tegra_data *tspi, | 176 | static inline unsigned long spi_tegra_readl(struct spi_tegra_data *tspi, |
185 | unsigned long reg) | 177 | unsigned long reg) |
186 | { | 178 | { |
@@ -204,10 +196,6 @@ static void spi_tegra_go(struct spi_tegra_data *tspi) | |||
204 | val &= ~SLINK_DMA_BLOCK_SIZE(~0) & ~SLINK_DMA_EN; | 196 | val &= ~SLINK_DMA_BLOCK_SIZE(~0) & ~SLINK_DMA_EN; |
205 | val |= SLINK_DMA_BLOCK_SIZE(tspi->dma_req_len / 4 - 1); | 197 | val |= SLINK_DMA_BLOCK_SIZE(tspi->dma_req_len / 4 - 1); |
206 | spi_tegra_writel(tspi, val, SLINK_DMA_CTL); | 198 | spi_tegra_writel(tspi, val, SLINK_DMA_CTL); |
207 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
208 | tspi->rx_dma_req.size = tspi->dma_req_len; | ||
209 | tegra_dma_enqueue_req(tspi->rx_dma, &tspi->rx_dma_req); | ||
210 | #else | ||
211 | tspi->rx_dma_desc = dmaengine_prep_slave_single(tspi->rx_dma, | 199 | tspi->rx_dma_desc = dmaengine_prep_slave_single(tspi->rx_dma, |
212 | tspi->rx_bb_phys, tspi->dma_req_len, | 200 | tspi->rx_bb_phys, tspi->dma_req_len, |
213 | DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT); | 201 | DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT); |
@@ -219,7 +207,6 @@ static void spi_tegra_go(struct spi_tegra_data *tspi) | |||
219 | tspi->rx_dma_desc->callback_param = tspi; | 207 | tspi->rx_dma_desc->callback_param = tspi; |
220 | tspi->rx_cookie = dmaengine_submit(tspi->rx_dma_desc); | 208 | tspi->rx_cookie = dmaengine_submit(tspi->rx_dma_desc); |
221 | dma_async_issue_pending(tspi->rx_dma); | 209 | dma_async_issue_pending(tspi->rx_dma); |
222 | #endif | ||
223 | 210 | ||
224 | val |= SLINK_DMA_EN; | 211 | val |= SLINK_DMA_EN; |
225 | spi_tegra_writel(tspi, val, SLINK_DMA_CTL); | 212 | spi_tegra_writel(tspi, val, SLINK_DMA_CTL); |
@@ -405,19 +392,12 @@ static void handle_spi_rx_dma_complete(struct spi_tegra_data *tspi) | |||
405 | 392 | ||
406 | spin_unlock_irqrestore(&tspi->lock, flags); | 393 | spin_unlock_irqrestore(&tspi->lock, flags); |
407 | } | 394 | } |
408 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | 395 | |
409 | static void tegra_spi_rx_dma_complete(struct tegra_dma_req *req) | ||
410 | { | ||
411 | struct spi_tegra_data *tspi = req->dev; | ||
412 | handle_spi_rx_dma_complete(tspi); | ||
413 | } | ||
414 | #else | ||
415 | static void tegra_spi_rx_dma_complete(void *args) | 396 | static void tegra_spi_rx_dma_complete(void *args) |
416 | { | 397 | { |
417 | struct spi_tegra_data *tspi = args; | 398 | struct spi_tegra_data *tspi = args; |
418 | handle_spi_rx_dma_complete(tspi); | 399 | handle_spi_rx_dma_complete(tspi); |
419 | } | 400 | } |
420 | #endif | ||
421 | 401 | ||
422 | static int spi_tegra_setup(struct spi_device *spi) | 402 | static int spi_tegra_setup(struct spi_device *spi) |
423 | { | 403 | { |
@@ -509,9 +489,7 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev) | |||
509 | struct spi_tegra_data *tspi; | 489 | struct spi_tegra_data *tspi; |
510 | struct resource *r; | 490 | struct resource *r; |
511 | int ret; | 491 | int ret; |
512 | #if !defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
513 | dma_cap_mask_t mask; | 492 | dma_cap_mask_t mask; |
514 | #endif | ||
515 | 493 | ||
516 | master = spi_alloc_master(&pdev->dev, sizeof *tspi); | 494 | master = spi_alloc_master(&pdev->dev, sizeof *tspi); |
517 | if (master == NULL) { | 495 | if (master == NULL) { |
@@ -563,14 +541,6 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev) | |||
563 | 541 | ||
564 | INIT_LIST_HEAD(&tspi->queue); | 542 | INIT_LIST_HEAD(&tspi->queue); |
565 | 543 | ||
566 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
567 | tspi->rx_dma = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT); | ||
568 | if (!tspi->rx_dma) { | ||
569 | dev_err(&pdev->dev, "can not allocate rx dma channel\n"); | ||
570 | ret = -ENODEV; | ||
571 | goto err3; | ||
572 | } | ||
573 | #else | ||
574 | dma_cap_zero(mask); | 544 | dma_cap_zero(mask); |
575 | dma_cap_set(DMA_SLAVE, mask); | 545 | dma_cap_set(DMA_SLAVE, mask); |
576 | tspi->rx_dma = dma_request_channel(mask, NULL, NULL); | 546 | tspi->rx_dma = dma_request_channel(mask, NULL, NULL); |
@@ -580,8 +550,6 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev) | |||
580 | goto err3; | 550 | goto err3; |
581 | } | 551 | } |
582 | 552 | ||
583 | #endif | ||
584 | |||
585 | tspi->rx_bb = dma_alloc_coherent(&pdev->dev, sizeof(u32) * BB_LEN, | 553 | tspi->rx_bb = dma_alloc_coherent(&pdev->dev, sizeof(u32) * BB_LEN, |
586 | &tspi->rx_bb_phys, GFP_KERNEL); | 554 | &tspi->rx_bb_phys, GFP_KERNEL); |
587 | if (!tspi->rx_bb) { | 555 | if (!tspi->rx_bb) { |
@@ -590,17 +558,6 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev) | |||
590 | goto err4; | 558 | goto err4; |
591 | } | 559 | } |
592 | 560 | ||
593 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
594 | tspi->rx_dma_req.complete = tegra_spi_rx_dma_complete; | ||
595 | tspi->rx_dma_req.to_memory = 1; | ||
596 | tspi->rx_dma_req.dest_addr = tspi->rx_bb_phys; | ||
597 | tspi->rx_dma_req.dest_bus_width = 32; | ||
598 | tspi->rx_dma_req.source_addr = tspi->phys + SLINK_RX_FIFO; | ||
599 | tspi->rx_dma_req.source_bus_width = 32; | ||
600 | tspi->rx_dma_req.source_wrap = 4; | ||
601 | tspi->rx_dma_req.req_sel = spi_tegra_req_sels[pdev->id]; | ||
602 | tspi->rx_dma_req.dev = tspi; | ||
603 | #else | ||
604 | /* Dmaengine Dma slave config */ | 561 | /* Dmaengine Dma slave config */ |
605 | tspi->sconfig.src_addr = tspi->phys + SLINK_RX_FIFO; | 562 | tspi->sconfig.src_addr = tspi->phys + SLINK_RX_FIFO; |
606 | tspi->sconfig.dst_addr = tspi->phys + SLINK_RX_FIFO; | 563 | tspi->sconfig.dst_addr = tspi->phys + SLINK_RX_FIFO; |
@@ -616,7 +573,6 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev) | |||
616 | ret); | 573 | ret); |
617 | goto err4; | 574 | goto err4; |
618 | } | 575 | } |
619 | #endif | ||
620 | 576 | ||
621 | master->dev.of_node = pdev->dev.of_node; | 577 | master->dev.of_node = pdev->dev.of_node; |
622 | ret = spi_register_master(master); | 578 | ret = spi_register_master(master); |
@@ -630,11 +586,7 @@ err5: | |||
630 | dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN, | 586 | dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN, |
631 | tspi->rx_bb, tspi->rx_bb_phys); | 587 | tspi->rx_bb, tspi->rx_bb_phys); |
632 | err4: | 588 | err4: |
633 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
634 | tegra_dma_free_channel(tspi->rx_dma); | ||
635 | #else | ||
636 | dma_release_channel(tspi->rx_dma); | 589 | dma_release_channel(tspi->rx_dma); |
637 | #endif | ||
638 | err3: | 590 | err3: |
639 | clk_put(tspi->clk); | 591 | clk_put(tspi->clk); |
640 | err2: | 592 | err2: |
@@ -656,12 +608,7 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev) | |||
656 | tspi = spi_master_get_devdata(master); | 608 | tspi = spi_master_get_devdata(master); |
657 | 609 | ||
658 | spi_unregister_master(master); | 610 | spi_unregister_master(master); |
659 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
660 | tegra_dma_free_channel(tspi->rx_dma); | ||
661 | #else | ||
662 | dma_release_channel(tspi->rx_dma); | 611 | dma_release_channel(tspi->rx_dma); |
663 | #endif | ||
664 | |||
665 | dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN, | 612 | dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN, |
666 | tspi->rx_bb, tspi->rx_bb_phys); | 613 | tspi->rx_bb, tspi->rx_bb_phys); |
667 | 614 | ||
diff --git a/drivers/staging/tidspbridge/core/dsp-clock.c b/drivers/staging/tidspbridge/core/dsp-clock.c index 7eac01e5fe0b..b647207928b1 100644 --- a/drivers/staging/tidspbridge/core/dsp-clock.c +++ b/drivers/staging/tidspbridge/core/dsp-clock.c | |||
@@ -23,7 +23,7 @@ | |||
23 | /* ----------------------------------- Host OS */ | 23 | /* ----------------------------------- Host OS */ |
24 | #include <dspbridge/host_os.h> | 24 | #include <dspbridge/host_os.h> |
25 | #include <plat/dmtimer.h> | 25 | #include <plat/dmtimer.h> |
26 | #include <plat/mcbsp.h> | 26 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
27 | 27 | ||
28 | /* ----------------------------------- DSP/BIOS Bridge */ | 28 | /* ----------------------------------- DSP/BIOS Bridge */ |
29 | #include <dspbridge/dbdefs.h> | 29 | #include <dspbridge/dbdefs.h> |
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index 012c5a0cc6c8..066a3ceec65e 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c | |||
@@ -16,7 +16,7 @@ | |||
16 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 16 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <plat/dsp.h> | 19 | #include <linux/platform_data/dsp-omap.h> |
20 | 20 | ||
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | /* ----------------------------------- Host OS */ | 22 | /* ----------------------------------- Host OS */ |
diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c index 58a1d6dcf098..dafa6d9b2948 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c +++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c | |||
@@ -19,7 +19,7 @@ | |||
19 | /* ----------------------------------- Host OS */ | 19 | /* ----------------------------------- Host OS */ |
20 | #include <dspbridge/host_os.h> | 20 | #include <dspbridge/host_os.h> |
21 | 21 | ||
22 | #include <plat/dsp.h> | 22 | #include <linux/platform_data/dsp-omap.h> |
23 | 23 | ||
24 | /* ----------------------------------- DSP/BIOS Bridge */ | 24 | /* ----------------------------------- DSP/BIOS Bridge */ |
25 | #include <dspbridge/dbdefs.h> | 25 | #include <dspbridge/dbdefs.h> |
diff --git a/drivers/staging/tidspbridge/core/tiomap_io.c b/drivers/staging/tidspbridge/core/tiomap_io.c index 7fda10c36862..f53ed98d18c1 100644 --- a/drivers/staging/tidspbridge/core/tiomap_io.c +++ b/drivers/staging/tidspbridge/core/tiomap_io.c | |||
@@ -16,7 +16,7 @@ | |||
16 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 16 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <plat/dsp.h> | 19 | #include <linux/platform_data/dsp-omap.h> |
20 | 20 | ||
21 | /* ----------------------------------- DSP/BIOS Bridge */ | 21 | /* ----------------------------------- DSP/BIOS Bridge */ |
22 | #include <dspbridge/dbdefs.h> | 22 | #include <dspbridge/dbdefs.h> |
diff --git a/drivers/staging/tidspbridge/core/wdt.c b/drivers/staging/tidspbridge/core/wdt.c index e5adad08f1c4..1dce36fb828f 100644 --- a/drivers/staging/tidspbridge/core/wdt.c +++ b/drivers/staging/tidspbridge/core/wdt.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | 27 | ||
28 | #define OMAP34XX_WDT3_BASE (0x49000000 + 0x30000) | 28 | #define OMAP34XX_WDT3_BASE (0x49000000 + 0x30000) |
29 | #define INT_34XX_WDT3_IRQ 36 | 29 | #define INT_34XX_WDT3_IRQ (36 + NR_IRQS) |
30 | 30 | ||
31 | static struct dsp_wdt_setting dsp_wdt; | 31 | static struct dsp_wdt_setting dsp_wdt; |
32 | 32 | ||
diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c index 6acea2b56aa4..bddea1d3b2c3 100644 --- a/drivers/staging/tidspbridge/rmgr/drv_interface.c +++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c | |||
@@ -16,7 +16,7 @@ | |||
16 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 16 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <plat/dsp.h> | 19 | #include <linux/platform_data/dsp-omap.h> |
20 | 20 | ||
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c index 7c13639c597e..9bd004f9da89 100644 --- a/drivers/tty/serial/serial_ks8695.c +++ b/drivers/tty/serial/serial_ks8695.c | |||
@@ -548,8 +548,8 @@ static struct uart_ops ks8695uart_pops = { | |||
548 | 548 | ||
549 | static struct uart_port ks8695uart_ports[SERIAL_KS8695_NR] = { | 549 | static struct uart_port ks8695uart_ports[SERIAL_KS8695_NR] = { |
550 | { | 550 | { |
551 | .membase = (void *) KS8695_UART_VA, | 551 | .membase = KS8695_UART_VA, |
552 | .mapbase = KS8695_UART_VA, | 552 | .mapbase = KS8695_UART_PA, |
553 | .iotype = SERIAL_IO_MEM, | 553 | .iotype = SERIAL_IO_MEM, |
554 | .irq = KS8695_IRQ_UART_TX, | 554 | .irq = KS8695_IRQ_UART_TX, |
555 | .uartclk = KS8695_CLOCK_RATE * 16, | 555 | .uartclk = KS8695_CLOCK_RATE * 16, |
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 2564b546ba8a..4c90b510d016 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig | |||
@@ -13,7 +13,6 @@ config USB_ARCH_HAS_OHCI | |||
13 | default y if PXA3xx | 13 | default y if PXA3xx |
14 | default y if ARCH_EP93XX | 14 | default y if ARCH_EP93XX |
15 | default y if ARCH_AT91 | 15 | default y if ARCH_AT91 |
16 | default y if ARCH_PNX4008 | ||
17 | default y if MFD_TC6393XB | 16 | default y if MFD_TC6393XB |
18 | default y if ARCH_W90X900 | 17 | default y if ARCH_W90X900 |
19 | default y if ARCH_DAVINCI_DA8XX | 18 | default y if ARCH_DAVINCI_DA8XX |
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index b1deb0fd4197..3f1431d37e1c 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -292,7 +292,7 @@ config USB_OHCI_HCD | |||
292 | depends on USB && USB_ARCH_HAS_OHCI | 292 | depends on USB && USB_ARCH_HAS_OHCI |
293 | select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 | 293 | select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 |
294 | select USB_OTG_UTILS if ARCH_OMAP | 294 | select USB_OTG_UTILS if ARCH_OMAP |
295 | depends on USB_ISP1301 || !(ARCH_LPC32XX || ARCH_PNX4008) | 295 | depends on USB_ISP1301 || !ARCH_LPC32XX |
296 | ---help--- | 296 | ---help--- |
297 | The Open Host Controller Interface (OHCI) is a standard for accessing | 297 | The Open Host Controller Interface (OHCI) is a standard for accessing |
298 | USB 1.1 host controller hardware. It does more in hardware than Intel's | 298 | USB 1.1 host controller hardware. It does more in hardware than Intel's |
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 2b1e8d84c873..6780010e9c3c 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -1049,7 +1049,7 @@ MODULE_LICENSE ("GPL"); | |||
1049 | #define PLATFORM_DRIVER ohci_hcd_at91_driver | 1049 | #define PLATFORM_DRIVER ohci_hcd_at91_driver |
1050 | #endif | 1050 | #endif |
1051 | 1051 | ||
1052 | #if defined(CONFIG_ARCH_PNX4008) || defined(CONFIG_ARCH_LPC32XX) | 1052 | #ifdef CONFIG_ARCH_LPC32XX |
1053 | #include "ohci-nxp.c" | 1053 | #include "ohci-nxp.c" |
1054 | #define PLATFORM_DRIVER usb_hcd_nxp_driver | 1054 | #define PLATFORM_DRIVER usb_hcd_nxp_driver |
1055 | #endif | 1055 | #endif |
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index c60066a63606..e068f034cb9b 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c | |||
@@ -2,7 +2,6 @@ | |||
2 | * driver for NXP USB Host devices | 2 | * driver for NXP USB Host devices |
3 | * | 3 | * |
4 | * Currently supported OHCI host devices: | 4 | * Currently supported OHCI host devices: |
5 | * - Philips PNX4008 | ||
6 | * - NXP LPC32xx | 5 | * - NXP LPC32xx |
7 | * | 6 | * |
8 | * Authors: Dmitry Chigirev <source@mvista.com> | 7 | * Authors: Dmitry Chigirev <source@mvista.com> |
@@ -66,38 +65,6 @@ static struct clk *usb_pll_clk; | |||
66 | static struct clk *usb_dev_clk; | 65 | static struct clk *usb_dev_clk; |
67 | static struct clk *usb_otg_clk; | 66 | static struct clk *usb_otg_clk; |
68 | 67 | ||
69 | static void isp1301_configure_pnx4008(void) | ||
70 | { | ||
71 | /* PNX4008 only supports DAT_SE0 USB mode */ | ||
72 | /* PNX4008 R2A requires setting the MAX603 to output 3.6V */ | ||
73 | /* Power up externel charge-pump */ | ||
74 | |||
75 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
76 | ISP1301_I2C_MODE_CONTROL_1, MC1_DAT_SE0 | MC1_SPEED_REG); | ||
77 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
78 | ISP1301_I2C_MODE_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR, | ||
79 | ~(MC1_DAT_SE0 | MC1_SPEED_REG)); | ||
80 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
81 | ISP1301_I2C_MODE_CONTROL_2, | ||
82 | MC2_BI_DI | MC2_PSW_EN | MC2_SPD_SUSP_CTRL); | ||
83 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
84 | ISP1301_I2C_MODE_CONTROL_2 | ISP1301_I2C_REG_CLEAR_ADDR, | ||
85 | ~(MC2_BI_DI | MC2_PSW_EN | MC2_SPD_SUSP_CTRL)); | ||
86 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
87 | ISP1301_I2C_OTG_CONTROL_1, OTG1_DM_PULLDOWN | OTG1_DP_PULLDOWN); | ||
88 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
89 | ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR, | ||
90 | ~(OTG1_DM_PULLDOWN | OTG1_DP_PULLDOWN)); | ||
91 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
92 | ISP1301_I2C_INTERRUPT_LATCH | ISP1301_I2C_REG_CLEAR_ADDR, 0xFF); | ||
93 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
94 | ISP1301_I2C_INTERRUPT_FALLING | ISP1301_I2C_REG_CLEAR_ADDR, | ||
95 | 0xFF); | ||
96 | i2c_smbus_write_byte_data(isp1301_i2c_client, | ||
97 | ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR, | ||
98 | 0xFF); | ||
99 | } | ||
100 | |||
101 | static void isp1301_configure_lpc32xx(void) | 68 | static void isp1301_configure_lpc32xx(void) |
102 | { | 69 | { |
103 | /* LPC32XX only supports DAT_SE0 USB mode */ | 70 | /* LPC32XX only supports DAT_SE0 USB mode */ |
@@ -149,10 +116,7 @@ static void isp1301_configure_lpc32xx(void) | |||
149 | 116 | ||
150 | static void isp1301_configure(void) | 117 | static void isp1301_configure(void) |
151 | { | 118 | { |
152 | if (machine_is_pnx4008()) | 119 | isp1301_configure_lpc32xx(); |
153 | isp1301_configure_pnx4008(); | ||
154 | else | ||
155 | isp1301_configure_lpc32xx(); | ||
156 | } | 120 | } |
157 | 121 | ||
158 | static inline void isp1301_vbus_on(void) | 122 | static inline void isp1301_vbus_on(void) |
@@ -241,47 +205,6 @@ static const struct hc_driver ohci_nxp_hc_driver = { | |||
241 | .start_port_reset = ohci_start_port_reset, | 205 | .start_port_reset = ohci_start_port_reset, |
242 | }; | 206 | }; |
243 | 207 | ||
244 | static void nxp_set_usb_bits(void) | ||
245 | { | ||
246 | if (machine_is_pnx4008()) { | ||
247 | start_int_set_falling_edge(SE_USB_OTG_ATX_INT_N); | ||
248 | start_int_ack(SE_USB_OTG_ATX_INT_N); | ||
249 | start_int_umask(SE_USB_OTG_ATX_INT_N); | ||
250 | |||
251 | start_int_set_rising_edge(SE_USB_OTG_TIMER_INT); | ||
252 | start_int_ack(SE_USB_OTG_TIMER_INT); | ||
253 | start_int_umask(SE_USB_OTG_TIMER_INT); | ||
254 | |||
255 | start_int_set_rising_edge(SE_USB_I2C_INT); | ||
256 | start_int_ack(SE_USB_I2C_INT); | ||
257 | start_int_umask(SE_USB_I2C_INT); | ||
258 | |||
259 | start_int_set_rising_edge(SE_USB_INT); | ||
260 | start_int_ack(SE_USB_INT); | ||
261 | start_int_umask(SE_USB_INT); | ||
262 | |||
263 | start_int_set_rising_edge(SE_USB_NEED_CLK_INT); | ||
264 | start_int_ack(SE_USB_NEED_CLK_INT); | ||
265 | start_int_umask(SE_USB_NEED_CLK_INT); | ||
266 | |||
267 | start_int_set_rising_edge(SE_USB_AHB_NEED_CLK_INT); | ||
268 | start_int_ack(SE_USB_AHB_NEED_CLK_INT); | ||
269 | start_int_umask(SE_USB_AHB_NEED_CLK_INT); | ||
270 | } | ||
271 | } | ||
272 | |||
273 | static void nxp_unset_usb_bits(void) | ||
274 | { | ||
275 | if (machine_is_pnx4008()) { | ||
276 | start_int_mask(SE_USB_OTG_ATX_INT_N); | ||
277 | start_int_mask(SE_USB_OTG_TIMER_INT); | ||
278 | start_int_mask(SE_USB_I2C_INT); | ||
279 | start_int_mask(SE_USB_INT); | ||
280 | start_int_mask(SE_USB_NEED_CLK_INT); | ||
281 | start_int_mask(SE_USB_AHB_NEED_CLK_INT); | ||
282 | } | ||
283 | } | ||
284 | |||
285 | static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev) | 208 | static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev) |
286 | { | 209 | { |
287 | struct usb_hcd *hcd = 0; | 210 | struct usb_hcd *hcd = 0; |
@@ -376,9 +299,6 @@ static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev) | |||
376 | goto out8; | 299 | goto out8; |
377 | } | 300 | } |
378 | 301 | ||
379 | /* Set all USB bits in the Start Enable register */ | ||
380 | nxp_set_usb_bits(); | ||
381 | |||
382 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 302 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
383 | if (!res) { | 303 | if (!res) { |
384 | dev_err(&pdev->dev, "Failed to get MEM resource\n"); | 304 | dev_err(&pdev->dev, "Failed to get MEM resource\n"); |
@@ -413,7 +333,6 @@ static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev) | |||
413 | 333 | ||
414 | nxp_stop_hc(); | 334 | nxp_stop_hc(); |
415 | out8: | 335 | out8: |
416 | nxp_unset_usb_bits(); | ||
417 | usb_put_hcd(hcd); | 336 | usb_put_hcd(hcd); |
418 | out7: | 337 | out7: |
419 | clk_disable(usb_otg_clk); | 338 | clk_disable(usb_otg_clk); |
@@ -441,7 +360,6 @@ static int usb_hcd_nxp_remove(struct platform_device *pdev) | |||
441 | nxp_stop_hc(); | 360 | nxp_stop_hc(); |
442 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | 361 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
443 | usb_put_hcd(hcd); | 362 | usb_put_hcd(hcd); |
444 | nxp_unset_usb_bits(); | ||
445 | clk_disable(usb_pll_clk); | 363 | clk_disable(usb_pll_clk); |
446 | clk_put(usb_pll_clk); | 364 | clk_put(usb_pll_clk); |
447 | clk_disable(usb_dev_clk); | 365 | clk_disable(usb_dev_clk); |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index f8b2d91851f7..4531d03503c3 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
25 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
26 | 26 | ||
27 | #include <plat/mux.h> | 27 | #include <mach/mux.h> |
28 | #include <plat/fpga.h> | 28 | #include <plat/fpga.h> |
29 | 29 | ||
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 53e25968ed0c..7a62b95dac24 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <plat/dma.h> | 19 | #include <plat/dma.h> |
20 | #include <plat/mux.h> | ||
21 | 20 | ||
22 | #include "musb_core.h" | 21 | #include "musb_core.h" |
23 | #include "tusb6010.h" | 22 | #include "tusb6010.h" |
diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c index 7a88667742b6..81f1f9a0be8f 100644 --- a/drivers/usb/otg/isp1301_omap.c +++ b/drivers/usb/otg/isp1301_omap.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
37 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
38 | 38 | ||
39 | #include <plat/mux.h> | 39 | #include <mach/mux.h> |
40 | 40 | ||
41 | #include <mach/usb.h> | 41 | #include <mach/usb.h> |
42 | 42 | ||
diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index bfdc5fbeaa11..9a046a4c98f5 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c | |||
@@ -27,10 +27,10 @@ | |||
27 | #include <linux/fb.h> | 27 | #include <linux/fb.h> |
28 | #include <linux/backlight.h> | 28 | #include <linux/backlight.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/platform_data/omap1_bl.h> | ||
30 | 31 | ||
31 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
32 | #include <plat/board.h> | 33 | #include <mach/mux.h> |
33 | #include <plat/mux.h> | ||
34 | 34 | ||
35 | #define OMAPBL_MAX_INTENSITY 0xff | 35 | #define OMAPBL_MAX_INTENSITY 0xff |
36 | 36 | ||
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 7ae9d53f2bf1..113d43a16f54 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c | |||
@@ -131,7 +131,7 @@ | |||
131 | #define UPPER_MARGIN 32 | 131 | #define UPPER_MARGIN 32 |
132 | #define LOWER_MARGIN 32 | 132 | #define LOWER_MARGIN 32 |
133 | 133 | ||
134 | static resource_size_t da8xx_fb_reg_base; | 134 | static void __iomem *da8xx_fb_reg_base; |
135 | static struct resource *lcdc_regs; | 135 | static struct resource *lcdc_regs; |
136 | static unsigned int lcd_revision; | 136 | static unsigned int lcd_revision; |
137 | static irq_handler_t lcdc_irq_handler; | 137 | static irq_handler_t lcdc_irq_handler; |
@@ -951,7 +951,7 @@ static int __devexit fb_remove(struct platform_device *dev) | |||
951 | clk_disable(par->lcdc_clk); | 951 | clk_disable(par->lcdc_clk); |
952 | clk_put(par->lcdc_clk); | 952 | clk_put(par->lcdc_clk); |
953 | framebuffer_release(info); | 953 | framebuffer_release(info); |
954 | iounmap((void __iomem *)da8xx_fb_reg_base); | 954 | iounmap(da8xx_fb_reg_base); |
955 | release_mem_region(lcdc_regs->start, resource_size(lcdc_regs)); | 955 | release_mem_region(lcdc_regs->start, resource_size(lcdc_regs)); |
956 | 956 | ||
957 | } | 957 | } |
@@ -1171,7 +1171,7 @@ static int __devinit fb_probe(struct platform_device *device) | |||
1171 | if (!lcdc_regs) | 1171 | if (!lcdc_regs) |
1172 | return -EBUSY; | 1172 | return -EBUSY; |
1173 | 1173 | ||
1174 | da8xx_fb_reg_base = (resource_size_t)ioremap(lcdc_regs->start, len); | 1174 | da8xx_fb_reg_base = ioremap(lcdc_regs->start, len); |
1175 | if (!da8xx_fb_reg_base) { | 1175 | if (!da8xx_fb_reg_base) { |
1176 | ret = -EBUSY; | 1176 | ret = -EBUSY; |
1177 | goto err_request_mem; | 1177 | goto err_request_mem; |
@@ -1392,7 +1392,7 @@ err_clk_put: | |||
1392 | clk_put(fb_clk); | 1392 | clk_put(fb_clk); |
1393 | 1393 | ||
1394 | err_ioremap: | 1394 | err_ioremap: |
1395 | iounmap((void __iomem *)da8xx_fb_reg_base); | 1395 | iounmap(da8xx_fb_reg_base); |
1396 | 1396 | ||
1397 | err_request_mem: | 1397 | err_request_mem: |
1398 | release_mem_region(lcdc_regs->start, len); | 1398 | release_mem_region(lcdc_regs->start, len); |
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c index d3a311327227..ed4cad87fbcd 100644 --- a/drivers/video/omap/lcd_ams_delta.c +++ b/drivers/video/omap/lcd_ams_delta.c | |||
@@ -27,8 +27,7 @@ | |||
27 | #include <linux/lcd.h> | 27 | #include <linux/lcd.h> |
28 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
29 | 29 | ||
30 | #include <plat/board-ams-delta.h> | 30 | #include <mach/board-ams-delta.h> |
31 | #include <mach/hardware.h> | ||
32 | 31 | ||
33 | #include "omapfb.h" | 32 | #include "omapfb.h" |
34 | 33 | ||
diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c index e3880c4a0bb1..b739600c51ac 100644 --- a/drivers/video/omap/lcd_mipid.c +++ b/drivers/video/omap/lcd_mipid.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/spi/spi.h> | 25 | #include <linux/spi/spi.h> |
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | 27 | ||
28 | #include <plat/lcd_mipid.h> | 28 | #include <linux/platform_data/lcd-mipid.h> |
29 | 29 | ||
30 | #include "omapfb.h" | 30 | #include "omapfb.h" |
31 | 31 | ||
diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c index 5914220dfa9c..3aa62da89195 100644 --- a/drivers/video/omap/lcd_osk.c +++ b/drivers/video/omap/lcd_osk.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | 25 | ||
26 | #include <asm/gpio.h> | 26 | #include <asm/gpio.h> |
27 | #include <plat/mux.h> | 27 | #include <mach/mux.h> |
28 | #include "omapfb.h" | 28 | #include "omapfb.h" |
29 | 29 | ||
30 | static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) | 30 | static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) |
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 5b289c5f695b..ee9e29639dcc 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
38 | #include <linux/pm_runtime.h> | 38 | #include <linux/pm_runtime.h> |
39 | 39 | ||
40 | #include <plat/cpu.h> | ||
40 | #include <plat/clock.h> | 41 | #include <plat/clock.h> |
41 | 42 | ||
42 | #include <video/omapdss.h> | 43 | #include <video/omapdss.h> |
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index fc671d3d8004..3c39aa8de928 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/omapfb.h> | 31 | #include <linux/omapfb.h> |
32 | 32 | ||
33 | #include <video/omapdss.h> | 33 | #include <video/omapdss.h> |
34 | #include <plat/cpu.h> | ||
34 | #include <plat/vram.h> | 35 | #include <plat/vram.h> |
35 | #include <plat/vrfb.h> | 36 | #include <plat/vrfb.h> |
36 | 37 | ||
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 53d75719078e..ad1bb9382a96 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -237,12 +237,12 @@ config OMAP_WATCHDOG | |||
237 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. | 237 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. |
238 | 238 | ||
239 | config PNX4008_WATCHDOG | 239 | config PNX4008_WATCHDOG |
240 | tristate "PNX4008 and LPC32XX Watchdog" | 240 | tristate "LPC32XX Watchdog" |
241 | depends on ARCH_PNX4008 || ARCH_LPC32XX | 241 | depends on ARCH_LPC32XX |
242 | select WATCHDOG_CORE | 242 | select WATCHDOG_CORE |
243 | help | 243 | help |
244 | Say Y here if to include support for the watchdog timer | 244 | Say Y here if to include support for the watchdog timer |
245 | in the PNX4008 or LPC32XX processor. | 245 | in the LPC32XX processor. |
246 | This driver can be built as a module by choosing M. The module | 246 | This driver can be built as a module by choosing M. The module |
247 | will be called pnx4008_wdt. | 247 | will be called pnx4008_wdt. |
248 | 248 | ||
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c index 59e75d9a6b7f..c1a4d3bf581d 100644 --- a/drivers/watchdog/ks8695_wdt.c +++ b/drivers/watchdog/ks8695_wdt.c | |||
@@ -24,7 +24,19 @@ | |||
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/uaccess.h> | 25 | #include <linux/uaccess.h> |
26 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
27 | #include <mach/regs-timer.h> | 27 | |
28 | #define KS8695_TMR_OFFSET (0xF0000 + 0xE400) | ||
29 | #define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET) | ||
30 | |||
31 | /* | ||
32 | * Timer registers | ||
33 | */ | ||
34 | #define KS8695_TMCON (0x00) /* Timer Control Register */ | ||
35 | #define KS8695_T0TC (0x08) /* Timer 0 Timeout Count Register */ | ||
36 | #define TMCON_T0EN (1 << 0) /* Timer 0 Enable */ | ||
37 | |||
38 | /* Timer0 Timeout Counter Register */ | ||
39 | #define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */ | ||
28 | 40 | ||
29 | #define WDT_DEFAULT_TIME 5 /* seconds */ | 41 | #define WDT_DEFAULT_TIME 5 /* seconds */ |
30 | #define WDT_MAX_TIME 171 /* seconds */ | 42 | #define WDT_MAX_TIME 171 /* seconds */ |
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index fceec4f4eb7e..f5db18dbc0f9 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/slab.h> | 46 | #include <linux/slab.h> |
47 | #include <linux/pm_runtime.h> | 47 | #include <linux/pm_runtime.h> |
48 | #include <mach/hardware.h> | 48 | #include <mach/hardware.h> |
49 | #include <plat/cpu.h> | ||
49 | #include <plat/prcm.h> | 50 | #include <plat/prcm.h> |
50 | 51 | ||
51 | #include "omap_wdt.h" | 52 | #include "omap_wdt.h" |
@@ -218,12 +219,16 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd, | |||
218 | case WDIOC_GETSTATUS: | 219 | case WDIOC_GETSTATUS: |
219 | return put_user(0, (int __user *)arg); | 220 | return put_user(0, (int __user *)arg); |
220 | case WDIOC_GETBOOTSTATUS: | 221 | case WDIOC_GETBOOTSTATUS: |
222 | #ifdef CONFIG_ARCH_OMAP1 | ||
221 | if (cpu_is_omap16xx()) | 223 | if (cpu_is_omap16xx()) |
222 | return put_user(__raw_readw(ARM_SYSST), | 224 | return put_user(__raw_readw(ARM_SYSST), |
223 | (int __user *)arg); | 225 | (int __user *)arg); |
226 | #endif | ||
227 | #ifdef CONFIG_ARCH_OMAP2PLUS | ||
224 | if (cpu_is_omap24xx()) | 228 | if (cpu_is_omap24xx()) |
225 | return put_user(omap_prcm_get_reset_sources(), | 229 | return put_user(omap_prcm_get_reset_sources(), |
226 | (int __user *)arg); | 230 | (int __user *)arg); |
231 | #endif | ||
227 | return put_user(0, (int __user *)arg); | 232 | return put_user(0, (int __user *)arg); |
228 | case WDIOC_KEEPALIVE: | 233 | case WDIOC_KEEPALIVE: |
229 | spin_lock(&wdt_lock); | 234 | spin_lock(&wdt_lock); |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 7ea898c55a60..a12a38107c1a 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -561,9 +561,6 @@ struct twl4030_bci_platform_data { | |||
561 | 561 | ||
562 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ | 562 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ |
563 | struct twl4030_gpio_platform_data { | 563 | struct twl4030_gpio_platform_data { |
564 | int gpio_base; | ||
565 | unsigned irq_base, irq_end; | ||
566 | |||
567 | /* package the two LED signals as output-only GPIOs? */ | 564 | /* package the two LED signals as output-only GPIOs? */ |
568 | bool use_leds; | 565 | bool use_leds; |
569 | 566 | ||
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index eaad49f7c130..ba43d4806b83 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h | |||
@@ -194,7 +194,6 @@ struct twl6040_vibra_data { | |||
194 | 194 | ||
195 | struct twl6040_platform_data { | 195 | struct twl6040_platform_data { |
196 | int audpwron_gpio; /* audio power-on gpio */ | 196 | int audpwron_gpio; /* audio power-on gpio */ |
197 | unsigned int irq_base; | ||
198 | 197 | ||
199 | struct twl6040_codec_data *codec; | 198 | struct twl6040_codec_data *codec; |
200 | struct twl6040_vibra_data *vibra; | 199 | struct twl6040_vibra_data *vibra; |
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 4ff57e81051d..85af8184691a 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h | |||
@@ -220,7 +220,12 @@ struct omapfb_display_info { | |||
220 | 220 | ||
221 | #ifdef __KERNEL__ | 221 | #ifdef __KERNEL__ |
222 | 222 | ||
223 | #include <plat/board.h> | 223 | struct omap_lcd_config { |
224 | char panel_name[16]; | ||
225 | char ctrl_name[16]; | ||
226 | s16 nreset_gpio; | ||
227 | u8 data_lines; | ||
228 | }; | ||
224 | 229 | ||
225 | struct omapfb_platform_data { | 230 | struct omapfb_platform_data { |
226 | struct omap_lcd_config lcd; | 231 | struct omap_lcd_config lcd; |
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h index 18814127809a..18814127809a 100644 --- a/arch/arm/plat-omap/include/plat/mcbsp.h +++ b/include/linux/platform_data/asoc-ti-mcbsp.h | |||
diff --git a/arch/arm/plat-omap/include/plat/dsp.h b/include/linux/platform_data/dsp-omap.h index 5927709b1908..5927709b1908 100644 --- a/arch/arm/plat-omap/include/plat/dsp.h +++ b/include/linux/platform_data/dsp-omap.h | |||
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/include/linux/platform_data/gpio-omap.h index 50fb7cc000ea..e8741c2678d5 100644 --- a/arch/arm/plat-omap/include/plat/gpio.h +++ b/include/linux/platform_data/gpio-omap.h | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-omap/include/mach/gpio.h | ||
3 | * | ||
4 | * OMAP GPIO handling defines and functions | 2 | * OMAP GPIO handling defines and functions |
5 | * | 3 | * |
6 | * Copyright (C) 2003-2005 Nokia Corporation | 4 | * Copyright (C) 2003-2005 Nokia Corporation |
@@ -155,6 +153,8 @@ | |||
155 | #define OMAP4_GPIO_CLEARDATAOUT 0x0190 | 153 | #define OMAP4_GPIO_CLEARDATAOUT 0x0190 |
156 | #define OMAP4_GPIO_SETDATAOUT 0x0194 | 154 | #define OMAP4_GPIO_SETDATAOUT 0x0194 |
157 | 155 | ||
156 | #define OMAP_MAX_GPIO_LINES 192 | ||
157 | |||
158 | #define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr)) | 158 | #define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr)) |
159 | #define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES) | 159 | #define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES) |
160 | 160 | ||
@@ -213,16 +213,5 @@ extern void omap2_gpio_prepare_for_idle(int off_mode); | |||
213 | extern void omap2_gpio_resume_after_idle(void); | 213 | extern void omap2_gpio_resume_after_idle(void); |
214 | extern void omap_set_gpio_debounce(int gpio, int enable); | 214 | extern void omap_set_gpio_debounce(int gpio, int enable); |
215 | extern void omap_set_gpio_debounce_time(int gpio, int enable); | 215 | extern void omap_set_gpio_debounce_time(int gpio, int enable); |
216 | /*-------------------------------------------------------------------------*/ | ||
217 | |||
218 | /* | ||
219 | * Wrappers for "new style" GPIO calls, using the new infrastructure | ||
220 | * which lets us plug in FPGA, I2C, and other implementations. | ||
221 | * | ||
222 | * The original OMAP-specific calls should eventually be removed. | ||
223 | */ | ||
224 | |||
225 | #include <linux/errno.h> | ||
226 | #include <asm-generic/gpio.h> | ||
227 | 216 | ||
228 | #endif | 217 | #endif |
diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/include/linux/platform_data/keypad-omap.h index a6b21eddb212..a6b21eddb212 100644 --- a/arch/arm/plat-omap/include/plat/keypad.h +++ b/include/linux/platform_data/keypad-omap.h | |||
diff --git a/arch/arm/plat-omap/include/plat/lcd_mipid.h b/include/linux/platform_data/lcd-mipid.h index 8e52c6572281..8e52c6572281 100644 --- a/arch/arm/plat-omap/include/plat/lcd_mipid.h +++ b/include/linux/platform_data/lcd-mipid.h | |||
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/include/linux/platform_data/mtd-nand-omap2.h index 67fc5060183e..1a68c1e5fe53 100644 --- a/arch/arm/plat-omap/include/plat/nand.h +++ b/include/linux/platform_data/mtd-nand-omap2.h | |||
@@ -24,11 +24,10 @@ struct omap_nand_platform_data { | |||
24 | struct gpmc_timings *gpmc_t; | 24 | struct gpmc_timings *gpmc_t; |
25 | int nr_parts; | 25 | int nr_parts; |
26 | bool dev_ready; | 26 | bool dev_ready; |
27 | int gpmc_irq; | ||
28 | enum nand_io xfer_type; | 27 | enum nand_io xfer_type; |
29 | unsigned long phys_base; | ||
30 | int devsize; | 28 | int devsize; |
31 | enum omap_ecc ecc_opt; | 29 | enum omap_ecc ecc_opt; |
30 | struct gpmc_nand_regs reg; | ||
32 | }; | 31 | }; |
33 | 32 | ||
34 | /* minimum size for IO mapping */ | 33 | /* minimum size for IO mapping */ |
diff --git a/arch/arm/plat-omap/include/plat/onenand.h b/include/linux/platform_data/mtd-onenand-omap2.h index 2858667d2e4f..2858667d2e4f 100644 --- a/arch/arm/plat-omap/include/plat/onenand.h +++ b/include/linux/platform_data/mtd-onenand-omap2.h | |||
diff --git a/include/linux/platform_data/omap1_bl.h b/include/linux/platform_data/omap1_bl.h new file mode 100644 index 000000000000..881a8e92d605 --- /dev/null +++ b/include/linux/platform_data/omap1_bl.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef __OMAP1_BL_H__ | ||
2 | #define __OMAP1_BL_H__ | ||
3 | |||
4 | #include <linux/device.h> | ||
5 | |||
6 | struct omap_backlight_config { | ||
7 | int default_intensity; | ||
8 | int (*set_power)(struct device *dev, int state); | ||
9 | }; | ||
10 | |||
11 | #endif | ||
diff --git a/arch/arm/mach-u300/include/mach/gpio-u300.h b/include/linux/platform_data/pinctrl-coh901.h index e81400c1753a..30dea251b835 100644 --- a/arch/arm/mach-u300/include/mach/gpio-u300.h +++ b/include/linux/platform_data/pinctrl-coh901.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2011 ST-Ericsson AB | 2 | * Copyright (C) 2007-2012 ST-Ericsson AB |
3 | * License terms: GNU General Public License (GPL) version 2 | 3 | * License terms: GNU General Public License (GPL) version 2 |
4 | * GPIO block resgister definitions and inline macros for | 4 | * GPIO block resgister definitions and inline macros for |
5 | * U300 GPIO COH 901 335 or COH 901 571/3 | 5 | * U300 GPIO COH 901 335 or COH 901 571/3 |
@@ -10,24 +10,13 @@ | |||
10 | #define __MACH_U300_GPIO_U300_H | 10 | #define __MACH_U300_GPIO_U300_H |
11 | 11 | ||
12 | /** | 12 | /** |
13 | * enum u300_gpio_variant - the type of U300 GPIO employed | ||
14 | */ | ||
15 | enum u300_gpio_variant { | ||
16 | U300_GPIO_COH901335, | ||
17 | U300_GPIO_COH901571_3_BS335, | ||
18 | U300_GPIO_COH901571_3_BS365, | ||
19 | }; | ||
20 | |||
21 | /** | ||
22 | * struct u300_gpio_platform - U300 GPIO platform data | 13 | * struct u300_gpio_platform - U300 GPIO platform data |
23 | * @variant: IP block variant | ||
24 | * @ports: number of GPIO block ports | 14 | * @ports: number of GPIO block ports |
25 | * @gpio_base: first GPIO number for this block (use a free range) | 15 | * @gpio_base: first GPIO number for this block (use a free range) |
26 | * @gpio_irq_base: first GPIO IRQ number for this block (use a free range) | 16 | * @gpio_irq_base: first GPIO IRQ number for this block (use a free range) |
27 | * @pinctrl_device: pin control device to spawn as child | 17 | * @pinctrl_device: pin control device to spawn as child |
28 | */ | 18 | */ |
29 | struct u300_gpio_platform { | 19 | struct u300_gpio_platform { |
30 | enum u300_gpio_variant variant; | ||
31 | u8 ports; | 20 | u8 ports; |
32 | int gpio_base; | 21 | int gpio_base; |
33 | int gpio_irq_base; | 22 | int gpio_irq_base; |
diff --git a/arch/arm/plat-omap/include/plat/remoteproc.h b/include/linux/platform_data/remoteproc-omap.h index b10eac89e2e9..b10eac89e2e9 100644 --- a/arch/arm/plat-omap/include/plat/remoteproc.h +++ b/include/linux/platform_data/remoteproc-omap.h | |||
diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h index a357eb26bd25..a357eb26bd25 100644 --- a/arch/arm/plat-omap/include/plat/mcspi.h +++ b/include/linux/platform_data/spi-omap2-mcspi.h | |||
diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/include/linux/platform_data/voltage-omap.h index 5be4d5def427..5be4d5def427 100644 --- a/arch/arm/plat-omap/include/plat/voltage.h +++ b/include/linux/platform_data/voltage-omap.h | |||
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h index 3101e62a1213..4a496ebc7d73 100644 --- a/include/linux/power/smartreflex.h +++ b/include/linux/power/smartreflex.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <plat/voltage.h> | 26 | #include <linux/platform_data/voltage-omap.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Different Smartreflex IPs version. The v1 is the 65nm version used in | 29 | * Different Smartreflex IPs version. The v1 is the 65nm version used in |
diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c index df65f98211ec..a52e87d28b6e 100644 --- a/sound/soc/omap/am3517evm.c +++ b/sound/soc/omap/am3517evm.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/gpio.h> | 29 | #include <mach/gpio.h> |
30 | #include <plat/mcbsp.h> | 30 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
31 | 31 | ||
32 | #include "omap-mcbsp.h" | 32 | #include "omap-mcbsp.h" |
33 | #include "omap-pcm.h" | 33 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index 7d4fa8ed6699..dc0ee7626626 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c | |||
@@ -32,8 +32,8 @@ | |||
32 | 32 | ||
33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
34 | 34 | ||
35 | #include <plat/board-ams-delta.h> | 35 | #include <mach/board-ams-delta.h> |
36 | #include <plat/mcbsp.h> | 36 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
37 | 37 | ||
38 | #include "omap-mcbsp.h" | 38 | #include "omap-mcbsp.h" |
39 | #include "omap-pcm.h" | 39 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/igep0020.c b/sound/soc/omap/igep0020.c index e8357819175b..5ed871676ed0 100644 --- a/sound/soc/omap/igep0020.c +++ b/sound/soc/omap/igep0020.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | #include <mach/gpio.h> | 31 | #include <mach/gpio.h> |
32 | #include <plat/mcbsp.h> | 32 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
33 | 33 | ||
34 | #include "omap-mcbsp.h" | 34 | #include "omap-mcbsp.h" |
35 | #include "omap-pcm.h" | 35 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index d33c48baaf71..a681a9a8b846 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c | |||
@@ -25,7 +25,9 @@ | |||
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | 27 | ||
28 | #include <plat/mcbsp.h> | 28 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
29 | |||
30 | #include <plat/cpu.h> | ||
29 | 31 | ||
30 | #include "mcbsp.h" | 32 | #include "mcbsp.h" |
31 | 33 | ||
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index abac4b690750..521bfc3d2b2b 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
33 | #include <linux/gpio.h> | 33 | #include <linux/gpio.h> |
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | #include <plat/mcbsp.h> | 35 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
36 | 36 | ||
37 | #include "omap-mcbsp.h" | 37 | #include "omap-mcbsp.h" |
38 | #include "omap-pcm.h" | 38 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 9d93793d3077..45909ca889fa 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c | |||
@@ -31,10 +31,6 @@ | |||
31 | #include <sound/soc.h> | 31 | #include <sound/soc.h> |
32 | #include <sound/jack.h> | 32 | #include <sound/jack.h> |
33 | 33 | ||
34 | #include <asm/mach-types.h> | ||
35 | #include <plat/hardware.h> | ||
36 | #include <plat/mux.h> | ||
37 | |||
38 | #include "omap-dmic.h" | 34 | #include "omap-dmic.h" |
39 | #include "omap-mcpdm.h" | 35 | #include "omap-mcpdm.h" |
40 | #include "omap-pcm.h" | 36 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index acdd3ef14e08..1b18627763ce 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -32,8 +32,9 @@ | |||
32 | #include <sound/initval.h> | 32 | #include <sound/initval.h> |
33 | #include <sound/soc.h> | 33 | #include <sound/soc.h> |
34 | 34 | ||
35 | #include <plat/cpu.h> | ||
35 | #include <plat/dma.h> | 36 | #include <plat/dma.h> |
36 | #include <plat/mcbsp.h> | 37 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
37 | #include "mcbsp.h" | 38 | #include "mcbsp.h" |
38 | #include "omap-mcbsp.h" | 39 | #include "omap-mcbsp.h" |
39 | #include "omap-pcm.h" | 40 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index 2c66e2498a45..ea053c3d2ab1 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c | |||
@@ -45,6 +45,8 @@ | |||
45 | #include "omap-mcpdm.h" | 45 | #include "omap-mcpdm.h" |
46 | #include "omap-pcm.h" | 46 | #include "omap-pcm.h" |
47 | 47 | ||
48 | #define OMAP44XX_MCPDM_L3_BASE 0x49032000 | ||
49 | |||
48 | struct omap_mcpdm { | 50 | struct omap_mcpdm { |
49 | struct device *dev; | 51 | struct device *dev; |
50 | unsigned long phys_base; | 52 | unsigned long phys_base; |
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index f0feb06615f8..b30994179885 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <sound/pcm_params.h> | 30 | #include <sound/pcm_params.h> |
31 | #include <sound/soc.h> | 31 | #include <sound/soc.h> |
32 | 32 | ||
33 | #include <plat/cpu.h> | ||
33 | #include <plat/dma.h> | 34 | #include <plat/dma.h> |
34 | #include "omap-pcm.h" | 35 | #include "omap-pcm.h" |
35 | 36 | ||
diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c index 2830dfd05661..e263188841b6 100644 --- a/sound/soc/omap/omap3beagle.c +++ b/sound/soc/omap/omap3beagle.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | #include <mach/gpio.h> | 31 | #include <mach/gpio.h> |
32 | #include <plat/mcbsp.h> | 32 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
33 | 33 | ||
34 | #include "omap-mcbsp.h" | 34 | #include "omap-mcbsp.h" |
35 | #include "omap-pcm.h" | 35 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c index 3d468c9179d7..d632bfbb6983 100644 --- a/sound/soc/omap/omap3evm.c +++ b/sound/soc/omap/omap3evm.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/gpio.h> | 29 | #include <mach/gpio.h> |
30 | #include <plat/mcbsp.h> | 30 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
31 | 31 | ||
32 | #include "omap-mcbsp.h" | 32 | #include "omap-mcbsp.h" |
33 | #include "omap-pcm.h" | 33 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c index 4c3a0978578a..43d950a79ff9 100644 --- a/sound/soc/omap/omap3pandora.c +++ b/sound/soc/omap/omap3pandora.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <sound/soc.h> | 31 | #include <sound/soc.h> |
32 | 32 | ||
33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
34 | #include <plat/mcbsp.h> | 34 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
35 | 35 | ||
36 | #include "omap-mcbsp.h" | 36 | #include "omap-mcbsp.h" |
37 | #include "omap-pcm.h" | 37 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c index b1a9d64cbc56..3960e8df9c76 100644 --- a/sound/soc/omap/osk5912.c +++ b/sound/soc/omap/osk5912.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
32 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
34 | #include <plat/mcbsp.h> | 34 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
35 | 35 | ||
36 | #include "omap-mcbsp.h" | 36 | #include "omap-mcbsp.h" |
37 | #include "omap-pcm.h" | 37 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/overo.c b/sound/soc/omap/overo.c index 6ac3e0c3c282..502bce299885 100644 --- a/sound/soc/omap/overo.c +++ b/sound/soc/omap/overo.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | #include <mach/gpio.h> | 31 | #include <mach/gpio.h> |
32 | #include <plat/mcbsp.h> | 32 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
33 | 33 | ||
34 | #include "omap-mcbsp.h" | 34 | #include "omap-mcbsp.h" |
35 | #include "omap-pcm.h" | 35 | #include "omap-pcm.h" |
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c index 2712dd232b6d..d921ddbe3ecb 100644 --- a/sound/soc/omap/rx51.c +++ b/sound/soc/omap/rx51.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <sound/jack.h> | 31 | #include <sound/jack.h> |
32 | #include <sound/pcm.h> | 32 | #include <sound/pcm.h> |
33 | #include <sound/soc.h> | 33 | #include <sound/soc.h> |
34 | #include <plat/mcbsp.h> | 34 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
35 | #include "../codecs/tpa6130a2.h" | 35 | #include "../codecs/tpa6130a2.h" |
36 | 36 | ||
37 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c index 0e283226e2bf..597cae769cea 100644 --- a/sound/soc/omap/sdp3430.c +++ b/sound/soc/omap/sdp3430.c | |||
@@ -33,7 +33,8 @@ | |||
33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
34 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
35 | #include <mach/gpio.h> | 35 | #include <mach/gpio.h> |
36 | #include <plat/mcbsp.h> | 36 | #include <linux/platform_data/gpio-omap.h> |
37 | #include <linux/platform_data/asoc-ti-mcbsp.h> | ||
37 | 38 | ||
38 | /* Register descriptions for twl4030 codec part */ | 39 | /* Register descriptions for twl4030 codec part */ |
39 | #include <linux/mfd/twl4030-audio.h> | 40 | #include <linux/mfd/twl4030-audio.h> |
diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c index 920e0d9e03db..23de2b21d696 100644 --- a/sound/soc/omap/zoom2.c +++ b/sound/soc/omap/zoom2.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
30 | #include <mach/gpio.h> | 30 | #include <mach/gpio.h> |
31 | #include <mach/board-zoom.h> | 31 | #include <mach/board-zoom.h> |
32 | #include <plat/mcbsp.h> | 32 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
33 | 33 | ||
34 | /* Register descriptions for twl4030 codec part */ | 34 | /* Register descriptions for twl4030 codec part */ |
35 | #include <linux/mfd/twl4030-audio.h> | 35 | #include <linux/mfd/twl4030-audio.h> |
diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig index 02bcd308c189..19e5fe7cc403 100644 --- a/sound/soc/tegra/Kconfig +++ b/sound/soc/tegra/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config SND_SOC_TEGRA | 1 | config SND_SOC_TEGRA |
2 | tristate "SoC Audio for the Tegra System-on-Chip" | 2 | tristate "SoC Audio for the Tegra System-on-Chip" |
3 | depends on ARCH_TEGRA && (TEGRA_SYSTEM_DMA || TEGRA20_APB_DMA) | 3 | depends on ARCH_TEGRA && TEGRA20_APB_DMA |
4 | select REGMAP_MMIO | 4 | select REGMAP_MMIO |
5 | select SND_SOC_DMAENGINE_PCM if TEGRA20_APB_DMA | 5 | select SND_SOC_DMAENGINE_PCM if TEGRA20_APB_DMA |
6 | help | 6 | help |
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index 8d6900c1ee47..e18733963cb4 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c | |||
@@ -57,237 +57,6 @@ static const struct snd_pcm_hardware tegra_pcm_hardware = { | |||
57 | .fifo_size = 4, | 57 | .fifo_size = 4, |
58 | }; | 58 | }; |
59 | 59 | ||
60 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
61 | static void tegra_pcm_queue_dma(struct tegra_runtime_data *prtd) | ||
62 | { | ||
63 | struct snd_pcm_substream *substream = prtd->substream; | ||
64 | struct snd_dma_buffer *buf = &substream->dma_buffer; | ||
65 | struct tegra_dma_req *dma_req; | ||
66 | unsigned long addr; | ||
67 | |||
68 | dma_req = &prtd->dma_req[prtd->dma_req_idx]; | ||
69 | prtd->dma_req_idx = 1 - prtd->dma_req_idx; | ||
70 | |||
71 | addr = buf->addr + prtd->dma_pos; | ||
72 | prtd->dma_pos += dma_req->size; | ||
73 | if (prtd->dma_pos >= prtd->dma_pos_end) | ||
74 | prtd->dma_pos = 0; | ||
75 | |||
76 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
77 | dma_req->source_addr = addr; | ||
78 | else | ||
79 | dma_req->dest_addr = addr; | ||
80 | |||
81 | tegra_dma_enqueue_req(prtd->dma_chan, dma_req); | ||
82 | } | ||
83 | |||
84 | static void dma_complete_callback(struct tegra_dma_req *req) | ||
85 | { | ||
86 | struct tegra_runtime_data *prtd = (struct tegra_runtime_data *)req->dev; | ||
87 | struct snd_pcm_substream *substream = prtd->substream; | ||
88 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
89 | |||
90 | spin_lock(&prtd->lock); | ||
91 | |||
92 | if (!prtd->running) { | ||
93 | spin_unlock(&prtd->lock); | ||
94 | return; | ||
95 | } | ||
96 | |||
97 | if (++prtd->period_index >= runtime->periods) | ||
98 | prtd->period_index = 0; | ||
99 | |||
100 | tegra_pcm_queue_dma(prtd); | ||
101 | |||
102 | spin_unlock(&prtd->lock); | ||
103 | |||
104 | snd_pcm_period_elapsed(substream); | ||
105 | } | ||
106 | |||
107 | static void setup_dma_tx_request(struct tegra_dma_req *req, | ||
108 | struct tegra_pcm_dma_params * dmap) | ||
109 | { | ||
110 | req->complete = dma_complete_callback; | ||
111 | req->to_memory = false; | ||
112 | req->dest_addr = dmap->addr; | ||
113 | req->dest_wrap = dmap->wrap; | ||
114 | req->source_bus_width = 32; | ||
115 | req->source_wrap = 0; | ||
116 | req->dest_bus_width = dmap->width; | ||
117 | req->req_sel = dmap->req_sel; | ||
118 | } | ||
119 | |||
120 | static void setup_dma_rx_request(struct tegra_dma_req *req, | ||
121 | struct tegra_pcm_dma_params * dmap) | ||
122 | { | ||
123 | req->complete = dma_complete_callback; | ||
124 | req->to_memory = true; | ||
125 | req->source_addr = dmap->addr; | ||
126 | req->dest_wrap = 0; | ||
127 | req->source_bus_width = dmap->width; | ||
128 | req->source_wrap = dmap->wrap; | ||
129 | req->dest_bus_width = 32; | ||
130 | req->req_sel = dmap->req_sel; | ||
131 | } | ||
132 | |||
133 | static int tegra_pcm_open(struct snd_pcm_substream *substream) | ||
134 | { | ||
135 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
136 | struct tegra_runtime_data *prtd; | ||
137 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
138 | struct tegra_pcm_dma_params * dmap; | ||
139 | int ret = 0; | ||
140 | |||
141 | prtd = kzalloc(sizeof(struct tegra_runtime_data), GFP_KERNEL); | ||
142 | if (prtd == NULL) | ||
143 | return -ENOMEM; | ||
144 | |||
145 | runtime->private_data = prtd; | ||
146 | prtd->substream = substream; | ||
147 | |||
148 | spin_lock_init(&prtd->lock); | ||
149 | |||
150 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | ||
151 | dmap = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | ||
152 | setup_dma_tx_request(&prtd->dma_req[0], dmap); | ||
153 | setup_dma_tx_request(&prtd->dma_req[1], dmap); | ||
154 | } else { | ||
155 | dmap = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | ||
156 | setup_dma_rx_request(&prtd->dma_req[0], dmap); | ||
157 | setup_dma_rx_request(&prtd->dma_req[1], dmap); | ||
158 | } | ||
159 | |||
160 | prtd->dma_req[0].dev = prtd; | ||
161 | prtd->dma_req[1].dev = prtd; | ||
162 | |||
163 | prtd->dma_chan = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT); | ||
164 | if (prtd->dma_chan == NULL) { | ||
165 | ret = -ENOMEM; | ||
166 | goto err; | ||
167 | } | ||
168 | |||
169 | /* Set HW params now that initialization is complete */ | ||
170 | snd_soc_set_runtime_hwparams(substream, &tegra_pcm_hardware); | ||
171 | |||
172 | /* Ensure that buffer size is a multiple of period size */ | ||
173 | ret = snd_pcm_hw_constraint_integer(runtime, | ||
174 | SNDRV_PCM_HW_PARAM_PERIODS); | ||
175 | if (ret < 0) | ||
176 | goto err; | ||
177 | |||
178 | return 0; | ||
179 | |||
180 | err: | ||
181 | if (prtd->dma_chan) { | ||
182 | tegra_dma_free_channel(prtd->dma_chan); | ||
183 | } | ||
184 | |||
185 | kfree(prtd); | ||
186 | |||
187 | return ret; | ||
188 | } | ||
189 | |||
190 | static int tegra_pcm_close(struct snd_pcm_substream *substream) | ||
191 | { | ||
192 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
193 | struct tegra_runtime_data *prtd = runtime->private_data; | ||
194 | |||
195 | tegra_dma_free_channel(prtd->dma_chan); | ||
196 | |||
197 | kfree(prtd); | ||
198 | |||
199 | return 0; | ||
200 | } | ||
201 | |||
202 | static int tegra_pcm_hw_params(struct snd_pcm_substream *substream, | ||
203 | struct snd_pcm_hw_params *params) | ||
204 | { | ||
205 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
206 | struct tegra_runtime_data *prtd = runtime->private_data; | ||
207 | |||
208 | snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); | ||
209 | |||
210 | prtd->dma_req[0].size = params_period_bytes(params); | ||
211 | prtd->dma_req[1].size = prtd->dma_req[0].size; | ||
212 | |||
213 | return 0; | ||
214 | } | ||
215 | |||
216 | static int tegra_pcm_hw_free(struct snd_pcm_substream *substream) | ||
217 | { | ||
218 | snd_pcm_set_runtime_buffer(substream, NULL); | ||
219 | |||
220 | return 0; | ||
221 | } | ||
222 | |||
223 | static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | ||
224 | { | ||
225 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
226 | struct tegra_runtime_data *prtd = runtime->private_data; | ||
227 | unsigned long flags; | ||
228 | |||
229 | switch (cmd) { | ||
230 | case SNDRV_PCM_TRIGGER_START: | ||
231 | prtd->dma_pos = 0; | ||
232 | prtd->dma_pos_end = frames_to_bytes(runtime, runtime->periods * runtime->period_size); | ||
233 | prtd->period_index = 0; | ||
234 | prtd->dma_req_idx = 0; | ||
235 | /* Fall-through */ | ||
236 | case SNDRV_PCM_TRIGGER_RESUME: | ||
237 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | ||
238 | spin_lock_irqsave(&prtd->lock, flags); | ||
239 | prtd->running = 1; | ||
240 | spin_unlock_irqrestore(&prtd->lock, flags); | ||
241 | tegra_pcm_queue_dma(prtd); | ||
242 | tegra_pcm_queue_dma(prtd); | ||
243 | break; | ||
244 | case SNDRV_PCM_TRIGGER_STOP: | ||
245 | case SNDRV_PCM_TRIGGER_SUSPEND: | ||
246 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | ||
247 | spin_lock_irqsave(&prtd->lock, flags); | ||
248 | prtd->running = 0; | ||
249 | spin_unlock_irqrestore(&prtd->lock, flags); | ||
250 | tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[0]); | ||
251 | tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[1]); | ||
252 | break; | ||
253 | default: | ||
254 | return -EINVAL; | ||
255 | } | ||
256 | |||
257 | return 0; | ||
258 | } | ||
259 | |||
260 | static snd_pcm_uframes_t tegra_pcm_pointer(struct snd_pcm_substream *substream) | ||
261 | { | ||
262 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
263 | struct tegra_runtime_data *prtd = runtime->private_data; | ||
264 | |||
265 | return prtd->period_index * runtime->period_size; | ||
266 | } | ||
267 | |||
268 | |||
269 | static int tegra_pcm_mmap(struct snd_pcm_substream *substream, | ||
270 | struct vm_area_struct *vma) | ||
271 | { | ||
272 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
273 | |||
274 | return dma_mmap_writecombine(substream->pcm->card->dev, vma, | ||
275 | runtime->dma_area, | ||
276 | runtime->dma_addr, | ||
277 | runtime->dma_bytes); | ||
278 | } | ||
279 | |||
280 | static struct snd_pcm_ops tegra_pcm_ops = { | ||
281 | .open = tegra_pcm_open, | ||
282 | .close = tegra_pcm_close, | ||
283 | .ioctl = snd_pcm_lib_ioctl, | ||
284 | .hw_params = tegra_pcm_hw_params, | ||
285 | .hw_free = tegra_pcm_hw_free, | ||
286 | .trigger = tegra_pcm_trigger, | ||
287 | .pointer = tegra_pcm_pointer, | ||
288 | .mmap = tegra_pcm_mmap, | ||
289 | }; | ||
290 | #else | ||
291 | static int tegra_pcm_open(struct snd_pcm_substream *substream) | 60 | static int tegra_pcm_open(struct snd_pcm_substream *substream) |
292 | { | 61 | { |
293 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 62 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
@@ -399,7 +168,6 @@ static struct snd_pcm_ops tegra_pcm_ops = { | |||
399 | .pointer = snd_dmaengine_pcm_pointer, | 168 | .pointer = snd_dmaengine_pcm_pointer, |
400 | .mmap = tegra_pcm_mmap, | 169 | .mmap = tegra_pcm_mmap, |
401 | }; | 170 | }; |
402 | #endif | ||
403 | 171 | ||
404 | static int tegra_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) | 172 | static int tegra_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) |
405 | { | 173 | { |
diff --git a/sound/soc/tegra/tegra_pcm.h b/sound/soc/tegra/tegra_pcm.h index a3a450352dcf..b40279b9f413 100644 --- a/sound/soc/tegra/tegra_pcm.h +++ b/sound/soc/tegra/tegra_pcm.h | |||
@@ -40,20 +40,6 @@ struct tegra_pcm_dma_params { | |||
40 | unsigned long req_sel; | 40 | unsigned long req_sel; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | #if defined(CONFIG_TEGRA_SYSTEM_DMA) | ||
44 | struct tegra_runtime_data { | ||
45 | struct snd_pcm_substream *substream; | ||
46 | spinlock_t lock; | ||
47 | int running; | ||
48 | int dma_pos; | ||
49 | int dma_pos_end; | ||
50 | int period_index; | ||
51 | int dma_req_idx; | ||
52 | struct tegra_dma_req dma_req[2]; | ||
53 | struct tegra_dma_channel *dma_chan; | ||
54 | }; | ||
55 | #endif | ||
56 | |||
57 | int tegra_pcm_platform_register(struct device *dev); | 43 | int tegra_pcm_platform_register(struct device *dev); |
58 | void tegra_pcm_platform_unregister(struct device *dev); | 44 | void tegra_pcm_platform_unregister(struct device *dev); |
59 | 45 | ||