diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-19 14:37:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-19 14:37:22 -0400 |
commit | 1d3c6ff44ad4b5f113602e153026a338f0f9b3ff (patch) | |
tree | 1e1f2932634fc6d0e4acfe68496c1c727b83a13e /arch/arm | |
parent | 7c7cbaf5b82c418cd3b1dcf718f71d0e6057e639 (diff) | |
parent | 717e7c2672e37253a4d3aa70e4716b5b0a658761 (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (224 commits)
ARM: remove 'select GENERIC_TIME'
ARM: 6136/1: ARCH_REQUIRE_GPIOLIB selects GENERIC_GPIO
ARM: 6074/1: oprofile: convert from sysdev to platform device
ARM: 6073/1: oprofile: remove old files and update KConfig
ARM: 6072/1: oprofile: use perf-events framework as backend
ARM: 6071/1: perf-events: allow modules to query the number of hardware counters
ARM: 6070/1: perf-events: add support for xscale PMUs
ARM: 6069/1: perf-events: use numeric ID to identify PMU
ARM: 6064/1: pmu: register IRQs at runtime
ARM: Optionally allow ARMv6 to use 'normal, bufferable' memory for DMA
ARM: 6134/1: Handle instruction cache maintenance fault properly
ARM: nwfpe: allow debugging output to be configured at runtime
ARM: rename mach_cpu_disable() to platform_cpu_disable()
ARM: 6132/1: PL330: Add common core driver
ARM: 6094/1: Extend cache-l2x0 to support the 16-way PL310
ARM: Move memory mapping into mmu.c
ARM: Ensure meminfo is sorted prior to sanity_check_meminfo
ARM: Remove useless linux/bootmem.h includes
ARM: convert /proc/cpu/aligment to seq_file
arm: use asm-generic/scatterlist.h
...
Diffstat (limited to 'arch/arm')
421 files changed, 27485 insertions, 6818 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 92622eb5cc0d..a07b6c47a6b8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -13,7 +13,7 @@ config ARM | |||
13 | select RTC_LIB | 13 | select RTC_LIB |
14 | select SYS_SUPPORTS_APM_EMULATION | 14 | select SYS_SUPPORTS_APM_EMULATION |
15 | select GENERIC_ATOMIC64 if (!CPU_32v6K) | 15 | select GENERIC_ATOMIC64 if (!CPU_32v6K) |
16 | select HAVE_OPROFILE | 16 | select HAVE_OPROFILE if (HAVE_PERF_EVENTS) |
17 | select HAVE_ARCH_KGDB | 17 | select HAVE_ARCH_KGDB |
18 | select HAVE_KPROBES if (!XIP_KERNEL) | 18 | select HAVE_KPROBES if (!XIP_KERNEL) |
19 | select HAVE_KRETPROBES if (HAVE_KPROBES) | 19 | select HAVE_KRETPROBES if (HAVE_KPROBES) |
@@ -21,6 +21,7 @@ config ARM | |||
21 | select HAVE_GENERIC_DMA_COHERENT | 21 | select HAVE_GENERIC_DMA_COHERENT |
22 | select HAVE_KERNEL_GZIP | 22 | select HAVE_KERNEL_GZIP |
23 | select HAVE_KERNEL_LZO | 23 | select HAVE_KERNEL_LZO |
24 | select HAVE_KERNEL_LZMA | ||
24 | select HAVE_PERF_EVENTS | 25 | select HAVE_PERF_EVENTS |
25 | select PERF_USE_VMALLOC | 26 | select PERF_USE_VMALLOC |
26 | help | 27 | help |
@@ -42,6 +43,11 @@ config GENERIC_GPIO | |||
42 | 43 | ||
43 | config GENERIC_TIME | 44 | config GENERIC_TIME |
44 | bool | 45 | bool |
46 | default y | ||
47 | |||
48 | config ARCH_USES_GETTIMEOFFSET | ||
49 | bool | ||
50 | default n | ||
45 | 51 | ||
46 | config GENERIC_CLOCKEVENTS | 52 | config GENERIC_CLOCKEVENTS |
47 | bool | 53 | bool |
@@ -175,28 +181,6 @@ config ARM_L1_CACHE_SHIFT_6 | |||
175 | help | 181 | help |
176 | Setting ARM L1 cache line size to 64 Bytes. | 182 | Setting ARM L1 cache line size to 64 Bytes. |
177 | 183 | ||
178 | if OPROFILE | ||
179 | |||
180 | config OPROFILE_ARMV6 | ||
181 | def_bool y | ||
182 | depends on CPU_V6 && !SMP | ||
183 | select OPROFILE_ARM11_CORE | ||
184 | |||
185 | config OPROFILE_MPCORE | ||
186 | def_bool y | ||
187 | depends on CPU_V6 && SMP | ||
188 | select OPROFILE_ARM11_CORE | ||
189 | |||
190 | config OPROFILE_ARM11_CORE | ||
191 | bool | ||
192 | |||
193 | config OPROFILE_ARMV7 | ||
194 | def_bool y | ||
195 | depends on CPU_V7 && !SMP | ||
196 | bool | ||
197 | |||
198 | endif | ||
199 | |||
200 | config VECTORS_BASE | 184 | config VECTORS_BASE |
201 | hex | 185 | hex |
202 | default 0xffff0000 if MMU || CPU_HIGH_VECTOR | 186 | default 0xffff0000 if MMU || CPU_HIGH_VECTOR |
@@ -231,6 +215,7 @@ config ARCH_AAEC2000 | |||
231 | select CPU_ARM920T | 215 | select CPU_ARM920T |
232 | select ARM_AMBA | 216 | select ARM_AMBA |
233 | select HAVE_CLK | 217 | select HAVE_CLK |
218 | select ARCH_USES_GETTIMEOFFSET | ||
234 | help | 219 | help |
235 | This enables support for systems based on the Agilent AAEC-2000 | 220 | This enables support for systems based on the Agilent AAEC-2000 |
236 | 221 | ||
@@ -238,21 +223,22 @@ config ARCH_INTEGRATOR | |||
238 | bool "ARM Ltd. Integrator family" | 223 | bool "ARM Ltd. Integrator family" |
239 | select ARM_AMBA | 224 | select ARM_AMBA |
240 | select ARCH_HAS_CPUFREQ | 225 | select ARCH_HAS_CPUFREQ |
241 | select HAVE_CLK | ||
242 | select COMMON_CLKDEV | 226 | select COMMON_CLKDEV |
243 | select ICST525 | 227 | select ICST |
228 | select GENERIC_CLOCKEVENTS | ||
229 | select PLAT_VERSATILE | ||
244 | help | 230 | help |
245 | Support for ARM's Integrator platform. | 231 | Support for ARM's Integrator platform. |
246 | 232 | ||
247 | config ARCH_REALVIEW | 233 | config ARCH_REALVIEW |
248 | bool "ARM Ltd. RealView family" | 234 | bool "ARM Ltd. RealView family" |
249 | select ARM_AMBA | 235 | select ARM_AMBA |
250 | select HAVE_CLK | ||
251 | select COMMON_CLKDEV | 236 | select COMMON_CLKDEV |
252 | select ICST307 | 237 | select ICST |
253 | select GENERIC_TIME | ||
254 | select GENERIC_CLOCKEVENTS | 238 | select GENERIC_CLOCKEVENTS |
255 | select ARCH_WANT_OPTIONAL_GPIOLIB | 239 | select ARCH_WANT_OPTIONAL_GPIOLIB |
240 | select PLAT_VERSATILE | ||
241 | select ARM_TIMER_SP804 | ||
256 | select GPIO_PL061 if GPIOLIB | 242 | select GPIO_PL061 if GPIOLIB |
257 | help | 243 | help |
258 | This enables support for ARM Ltd RealView boards. | 244 | This enables support for ARM Ltd RealView boards. |
@@ -261,20 +247,33 @@ config ARCH_VERSATILE | |||
261 | bool "ARM Ltd. Versatile family" | 247 | bool "ARM Ltd. Versatile family" |
262 | select ARM_AMBA | 248 | select ARM_AMBA |
263 | select ARM_VIC | 249 | select ARM_VIC |
264 | select HAVE_CLK | ||
265 | select COMMON_CLKDEV | 250 | select COMMON_CLKDEV |
266 | select ICST307 | 251 | select ICST |
267 | select GENERIC_TIME | ||
268 | select GENERIC_CLOCKEVENTS | 252 | select GENERIC_CLOCKEVENTS |
269 | select ARCH_WANT_OPTIONAL_GPIOLIB | 253 | select ARCH_WANT_OPTIONAL_GPIOLIB |
254 | select PLAT_VERSATILE | ||
255 | select ARM_TIMER_SP804 | ||
270 | help | 256 | help |
271 | This enables support for ARM Ltd Versatile board. | 257 | This enables support for ARM Ltd Versatile board. |
272 | 258 | ||
259 | config ARCH_VEXPRESS | ||
260 | bool "ARM Ltd. Versatile Express family" | ||
261 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
262 | select ARM_AMBA | ||
263 | select ARM_TIMER_SP804 | ||
264 | select COMMON_CLKDEV | ||
265 | select GENERIC_CLOCKEVENTS | ||
266 | select HAVE_CLK | ||
267 | select ICST | ||
268 | select PLAT_VERSATILE | ||
269 | help | ||
270 | This enables support for the ARM Ltd Versatile Express boards. | ||
271 | |||
273 | config ARCH_AT91 | 272 | config ARCH_AT91 |
274 | bool "Atmel AT91" | 273 | bool "Atmel AT91" |
275 | select GENERIC_GPIO | ||
276 | select ARCH_REQUIRE_GPIOLIB | 274 | select ARCH_REQUIRE_GPIOLIB |
277 | select HAVE_CLK | 275 | select HAVE_CLK |
276 | select ARCH_USES_GETTIMEOFFSET | ||
278 | help | 277 | help |
279 | This enables support for systems based on the Atmel AT91RM9200, | 278 | This enables support for systems based on the Atmel AT91RM9200, |
280 | AT91SAM9 and AT91CAP9 processors. | 279 | AT91SAM9 and AT91CAP9 processors. |
@@ -285,7 +284,6 @@ config ARCH_BCMRING | |||
285 | select CPU_V6 | 284 | select CPU_V6 |
286 | select ARM_AMBA | 285 | select ARM_AMBA |
287 | select COMMON_CLKDEV | 286 | select COMMON_CLKDEV |
288 | select GENERIC_TIME | ||
289 | select GENERIC_CLOCKEVENTS | 287 | select GENERIC_CLOCKEVENTS |
290 | select ARCH_WANT_OPTIONAL_GPIOLIB | 288 | select ARCH_WANT_OPTIONAL_GPIOLIB |
291 | help | 289 | help |
@@ -294,14 +292,23 @@ config ARCH_BCMRING | |||
294 | config ARCH_CLPS711X | 292 | config ARCH_CLPS711X |
295 | bool "Cirrus Logic CLPS711x/EP721x-based" | 293 | bool "Cirrus Logic CLPS711x/EP721x-based" |
296 | select CPU_ARM720T | 294 | select CPU_ARM720T |
295 | select ARCH_USES_GETTIMEOFFSET | ||
297 | help | 296 | help |
298 | Support for Cirrus Logic 711x/721x based boards. | 297 | Support for Cirrus Logic 711x/721x based boards. |
299 | 298 | ||
299 | config ARCH_CNS3XXX | ||
300 | bool "Cavium Networks CNS3XXX family" | ||
301 | select CPU_V6 | ||
302 | select GENERIC_CLOCKEVENTS | ||
303 | select ARM_GIC | ||
304 | help | ||
305 | Support for Cavium Networks CNS3XXX platform. | ||
306 | |||
300 | config ARCH_GEMINI | 307 | config ARCH_GEMINI |
301 | bool "Cortina Systems Gemini" | 308 | bool "Cortina Systems Gemini" |
302 | select CPU_FA526 | 309 | select CPU_FA526 |
303 | select GENERIC_GPIO | ||
304 | select ARCH_REQUIRE_GPIOLIB | 310 | select ARCH_REQUIRE_GPIOLIB |
311 | select ARCH_USES_GETTIMEOFFSET | ||
305 | help | 312 | help |
306 | Support for the Cortina Systems Gemini family SoCs | 313 | Support for the Cortina Systems Gemini family SoCs |
307 | 314 | ||
@@ -310,6 +317,7 @@ config ARCH_EBSA110 | |||
310 | select CPU_SA110 | 317 | select CPU_SA110 |
311 | select ISA | 318 | select ISA |
312 | select NO_IOPORT | 319 | select NO_IOPORT |
320 | select ARCH_USES_GETTIMEOFFSET | ||
313 | help | 321 | help |
314 | This is an evaluation board for the StrongARM processor available | 322 | This is an evaluation board for the StrongARM processor available |
315 | from Digital. It has limited hardware on-board, including an | 323 | from Digital. It has limited hardware on-board, including an |
@@ -321,11 +329,10 @@ config ARCH_EP93XX | |||
321 | select CPU_ARM920T | 329 | select CPU_ARM920T |
322 | select ARM_AMBA | 330 | select ARM_AMBA |
323 | select ARM_VIC | 331 | select ARM_VIC |
324 | select GENERIC_GPIO | ||
325 | select HAVE_CLK | ||
326 | select COMMON_CLKDEV | 332 | select COMMON_CLKDEV |
327 | select ARCH_REQUIRE_GPIOLIB | 333 | select ARCH_REQUIRE_GPIOLIB |
328 | select ARCH_HAS_HOLES_MEMORYMODEL | 334 | select ARCH_HAS_HOLES_MEMORYMODEL |
335 | select ARCH_USES_GETTIMEOFFSET | ||
329 | help | 336 | help |
330 | This enables support for the Cirrus EP93xx series of CPUs. | 337 | This enables support for the Cirrus EP93xx series of CPUs. |
331 | 338 | ||
@@ -333,16 +340,15 @@ config ARCH_FOOTBRIDGE | |||
333 | bool "FootBridge" | 340 | bool "FootBridge" |
334 | select CPU_SA110 | 341 | select CPU_SA110 |
335 | select FOOTBRIDGE | 342 | select FOOTBRIDGE |
343 | select ARCH_USES_GETTIMEOFFSET | ||
336 | help | 344 | help |
337 | Support for systems based on the DC21285 companion chip | 345 | Support for systems based on the DC21285 companion chip |
338 | ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. | 346 | ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. |
339 | 347 | ||
340 | config ARCH_MXC | 348 | config ARCH_MXC |
341 | bool "Freescale MXC/iMX-based" | 349 | bool "Freescale MXC/iMX-based" |
342 | select GENERIC_TIME | ||
343 | select GENERIC_CLOCKEVENTS | 350 | select GENERIC_CLOCKEVENTS |
344 | select ARCH_REQUIRE_GPIOLIB | 351 | select ARCH_REQUIRE_GPIOLIB |
345 | select HAVE_CLK | ||
346 | select COMMON_CLKDEV | 352 | select COMMON_CLKDEV |
347 | help | 353 | help |
348 | Support for Freescale MXC/iMX-based family of processors | 354 | Support for Freescale MXC/iMX-based family of processors |
@@ -350,12 +356,9 @@ config ARCH_MXC | |||
350 | config ARCH_STMP3XXX | 356 | config ARCH_STMP3XXX |
351 | bool "Freescale STMP3xxx" | 357 | bool "Freescale STMP3xxx" |
352 | select CPU_ARM926T | 358 | select CPU_ARM926T |
353 | select HAVE_CLK | ||
354 | select COMMON_CLKDEV | 359 | select COMMON_CLKDEV |
355 | select ARCH_REQUIRE_GPIOLIB | 360 | select ARCH_REQUIRE_GPIOLIB |
356 | select GENERIC_TIME | ||
357 | select GENERIC_CLOCKEVENTS | 361 | select GENERIC_CLOCKEVENTS |
358 | select GENERIC_GPIO | ||
359 | select USB_ARCH_HAS_EHCI | 362 | select USB_ARCH_HAS_EHCI |
360 | help | 363 | help |
361 | Support for systems based on the Freescale 3xxx CPUs. | 364 | Support for systems based on the Freescale 3xxx CPUs. |
@@ -365,7 +368,6 @@ config ARCH_NETX | |||
365 | select CPU_ARM926T | 368 | select CPU_ARM926T |
366 | select ARM_VIC | 369 | select ARM_VIC |
367 | select GENERIC_CLOCKEVENTS | 370 | select GENERIC_CLOCKEVENTS |
368 | select GENERIC_TIME | ||
369 | help | 371 | help |
370 | This enables support for systems based on the Hilscher NetX Soc | 372 | This enables support for systems based on the Hilscher NetX Soc |
371 | 373 | ||
@@ -373,6 +375,7 @@ config ARCH_H720X | |||
373 | bool "Hynix HMS720x-based" | 375 | bool "Hynix HMS720x-based" |
374 | select CPU_ARM720T | 376 | select CPU_ARM720T |
375 | select ISA_DMA_API | 377 | select ISA_DMA_API |
378 | select ARCH_USES_GETTIMEOFFSET | ||
376 | help | 379 | help |
377 | This enables support for systems based on the Hynix HMS720x | 380 | This enables support for systems based on the Hynix HMS720x |
378 | 381 | ||
@@ -393,7 +396,6 @@ config ARCH_IOP32X | |||
393 | select CPU_XSCALE | 396 | select CPU_XSCALE |
394 | select PLAT_IOP | 397 | select PLAT_IOP |
395 | select PCI | 398 | select PCI |
396 | select GENERIC_GPIO | ||
397 | select ARCH_REQUIRE_GPIOLIB | 399 | select ARCH_REQUIRE_GPIOLIB |
398 | help | 400 | help |
399 | Support for Intel's 80219 and IOP32X (XScale) family of | 401 | Support for Intel's 80219 and IOP32X (XScale) family of |
@@ -405,7 +407,6 @@ config ARCH_IOP33X | |||
405 | select CPU_XSCALE | 407 | select CPU_XSCALE |
406 | select PLAT_IOP | 408 | select PLAT_IOP |
407 | select PCI | 409 | select PCI |
408 | select GENERIC_GPIO | ||
409 | select ARCH_REQUIRE_GPIOLIB | 410 | select ARCH_REQUIRE_GPIOLIB |
410 | help | 411 | help |
411 | Support for Intel's IOP33X (XScale) family of processors. | 412 | Support for Intel's IOP33X (XScale) family of processors. |
@@ -415,6 +416,7 @@ config ARCH_IXP23XX | |||
415 | depends on MMU | 416 | depends on MMU |
416 | select CPU_XSC3 | 417 | select CPU_XSC3 |
417 | select PCI | 418 | select PCI |
419 | select ARCH_USES_GETTIMEOFFSET | ||
418 | help | 420 | help |
419 | Support for Intel's IXP23xx (XScale) family of processors. | 421 | Support for Intel's IXP23xx (XScale) family of processors. |
420 | 422 | ||
@@ -423,6 +425,7 @@ config ARCH_IXP2000 | |||
423 | depends on MMU | 425 | depends on MMU |
424 | select CPU_XSCALE | 426 | select CPU_XSCALE |
425 | select PCI | 427 | select PCI |
428 | select ARCH_USES_GETTIMEOFFSET | ||
426 | help | 429 | help |
427 | Support for Intel's IXP2400/2800 (XScale) family of processors. | 430 | Support for Intel's IXP2400/2800 (XScale) family of processors. |
428 | 431 | ||
@@ -431,7 +434,6 @@ config ARCH_IXP4XX | |||
431 | depends on MMU | 434 | depends on MMU |
432 | select CPU_XSCALE | 435 | select CPU_XSCALE |
433 | select GENERIC_GPIO | 436 | select GENERIC_GPIO |
434 | select GENERIC_TIME | ||
435 | select GENERIC_CLOCKEVENTS | 437 | select GENERIC_CLOCKEVENTS |
436 | select DMABOUNCE if PCI | 438 | select DMABOUNCE if PCI |
437 | help | 439 | help |
@@ -441,6 +443,7 @@ config ARCH_L7200 | |||
441 | bool "LinkUp-L7200" | 443 | bool "LinkUp-L7200" |
442 | select CPU_ARM720T | 444 | select CPU_ARM720T |
443 | select FIQ | 445 | select FIQ |
446 | select ARCH_USES_GETTIMEOFFSET | ||
444 | help | 447 | help |
445 | Say Y here if you intend to run this kernel on a LinkUp Systems | 448 | Say Y here if you intend to run this kernel on a LinkUp Systems |
446 | L7200 Software Development Board which uses an ARM720T processor. | 449 | L7200 Software Development Board which uses an ARM720T processor. |
@@ -454,9 +457,7 @@ config ARCH_L7200 | |||
454 | config ARCH_DOVE | 457 | config ARCH_DOVE |
455 | bool "Marvell Dove" | 458 | bool "Marvell Dove" |
456 | select PCI | 459 | select PCI |
457 | select GENERIC_GPIO | ||
458 | select ARCH_REQUIRE_GPIOLIB | 460 | select ARCH_REQUIRE_GPIOLIB |
459 | select GENERIC_TIME | ||
460 | select GENERIC_CLOCKEVENTS | 461 | select GENERIC_CLOCKEVENTS |
461 | select PLAT_ORION | 462 | select PLAT_ORION |
462 | help | 463 | help |
@@ -466,9 +467,7 @@ config ARCH_KIRKWOOD | |||
466 | bool "Marvell Kirkwood" | 467 | bool "Marvell Kirkwood" |
467 | select CPU_FEROCEON | 468 | select CPU_FEROCEON |
468 | select PCI | 469 | select PCI |
469 | select GENERIC_GPIO | ||
470 | select ARCH_REQUIRE_GPIOLIB | 470 | select ARCH_REQUIRE_GPIOLIB |
471 | select GENERIC_TIME | ||
472 | select GENERIC_CLOCKEVENTS | 471 | select GENERIC_CLOCKEVENTS |
473 | select PLAT_ORION | 472 | select PLAT_ORION |
474 | help | 473 | help |
@@ -478,7 +477,6 @@ config ARCH_KIRKWOOD | |||
478 | config ARCH_LOKI | 477 | config ARCH_LOKI |
479 | bool "Marvell Loki (88RC8480)" | 478 | bool "Marvell Loki (88RC8480)" |
480 | select CPU_FEROCEON | 479 | select CPU_FEROCEON |
481 | select GENERIC_TIME | ||
482 | select GENERIC_CLOCKEVENTS | 480 | select GENERIC_CLOCKEVENTS |
483 | select PLAT_ORION | 481 | select PLAT_ORION |
484 | help | 482 | help |
@@ -488,9 +486,7 @@ config ARCH_MV78XX0 | |||
488 | bool "Marvell MV78xx0" | 486 | bool "Marvell MV78xx0" |
489 | select CPU_FEROCEON | 487 | select CPU_FEROCEON |
490 | select PCI | 488 | select PCI |
491 | select GENERIC_GPIO | ||
492 | select ARCH_REQUIRE_GPIOLIB | 489 | select ARCH_REQUIRE_GPIOLIB |
493 | select GENERIC_TIME | ||
494 | select GENERIC_CLOCKEVENTS | 490 | select GENERIC_CLOCKEVENTS |
495 | select PLAT_ORION | 491 | select PLAT_ORION |
496 | help | 492 | help |
@@ -502,9 +498,7 @@ config ARCH_ORION5X | |||
502 | depends on MMU | 498 | depends on MMU |
503 | select CPU_FEROCEON | 499 | select CPU_FEROCEON |
504 | select PCI | 500 | select PCI |
505 | select GENERIC_GPIO | ||
506 | select ARCH_REQUIRE_GPIOLIB | 501 | select ARCH_REQUIRE_GPIOLIB |
507 | select GENERIC_TIME | ||
508 | select GENERIC_CLOCKEVENTS | 502 | select GENERIC_CLOCKEVENTS |
509 | select PLAT_ORION | 503 | select PLAT_ORION |
510 | help | 504 | help |
@@ -515,11 +509,8 @@ config ARCH_ORION5X | |||
515 | config ARCH_MMP | 509 | config ARCH_MMP |
516 | bool "Marvell PXA168/910/MMP2" | 510 | bool "Marvell PXA168/910/MMP2" |
517 | depends on MMU | 511 | depends on MMU |
518 | select GENERIC_GPIO | ||
519 | select ARCH_REQUIRE_GPIOLIB | 512 | select ARCH_REQUIRE_GPIOLIB |
520 | select HAVE_CLK | ||
521 | select COMMON_CLKDEV | 513 | select COMMON_CLKDEV |
522 | select GENERIC_TIME | ||
523 | select GENERIC_CLOCKEVENTS | 514 | select GENERIC_CLOCKEVENTS |
524 | select TICK_ONESHOT | 515 | select TICK_ONESHOT |
525 | select PLAT_PXA | 516 | select PLAT_PXA |
@@ -529,8 +520,8 @@ config ARCH_MMP | |||
529 | config ARCH_KS8695 | 520 | config ARCH_KS8695 |
530 | bool "Micrel/Kendin KS8695" | 521 | bool "Micrel/Kendin KS8695" |
531 | select CPU_ARM922T | 522 | select CPU_ARM922T |
532 | select GENERIC_GPIO | 523 | select ARCH_REQUIRE_GPIOLIB |
533 | select ARCH_REQUIRE_GPIOLIB | 524 | select ARCH_USES_GETTIMEOFFSET |
534 | help | 525 | help |
535 | Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based | 526 | Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based |
536 | System-on-Chip devices. | 527 | System-on-Chip devices. |
@@ -539,7 +530,6 @@ config ARCH_NS9XXX | |||
539 | bool "NetSilicon NS9xxx" | 530 | bool "NetSilicon NS9xxx" |
540 | select CPU_ARM926T | 531 | select CPU_ARM926T |
541 | select GENERIC_GPIO | 532 | select GENERIC_GPIO |
542 | select GENERIC_TIME | ||
543 | select GENERIC_CLOCKEVENTS | 533 | select GENERIC_CLOCKEVENTS |
544 | select HAVE_CLK | 534 | select HAVE_CLK |
545 | help | 535 | help |
@@ -552,10 +542,7 @@ config ARCH_W90X900 | |||
552 | bool "Nuvoton W90X900 CPU" | 542 | bool "Nuvoton W90X900 CPU" |
553 | select CPU_ARM926T | 543 | select CPU_ARM926T |
554 | select ARCH_REQUIRE_GPIOLIB | 544 | select ARCH_REQUIRE_GPIOLIB |
555 | select GENERIC_GPIO | ||
556 | select HAVE_CLK | ||
557 | select COMMON_CLKDEV | 545 | select COMMON_CLKDEV |
558 | select GENERIC_TIME | ||
559 | select GENERIC_CLOCKEVENTS | 546 | select GENERIC_CLOCKEVENTS |
560 | help | 547 | help |
561 | Support for Nuvoton (Winbond logic dept.) ARM9 processor, | 548 | Support for Nuvoton (Winbond logic dept.) ARM9 processor, |
@@ -569,7 +556,6 @@ config ARCH_W90X900 | |||
569 | config ARCH_NUC93X | 556 | config ARCH_NUC93X |
570 | bool "Nuvoton NUC93X CPU" | 557 | bool "Nuvoton NUC93X CPU" |
571 | select CPU_ARM926T | 558 | select CPU_ARM926T |
572 | select HAVE_CLK | ||
573 | select COMMON_CLKDEV | 559 | select COMMON_CLKDEV |
574 | help | 560 | help |
575 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a | 561 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a |
@@ -578,8 +564,8 @@ config ARCH_NUC93X | |||
578 | config ARCH_PNX4008 | 564 | config ARCH_PNX4008 |
579 | bool "Philips Nexperia PNX4008 Mobile" | 565 | bool "Philips Nexperia PNX4008 Mobile" |
580 | select CPU_ARM926T | 566 | select CPU_ARM926T |
581 | select HAVE_CLK | ||
582 | select COMMON_CLKDEV | 567 | select COMMON_CLKDEV |
568 | select ARCH_USES_GETTIMEOFFSET | ||
583 | help | 569 | help |
584 | This enables support for Philips PNX4008 mobile platform. | 570 | This enables support for Philips PNX4008 mobile platform. |
585 | 571 | ||
@@ -588,11 +574,8 @@ config ARCH_PXA | |||
588 | depends on MMU | 574 | depends on MMU |
589 | select ARCH_MTD_XIP | 575 | select ARCH_MTD_XIP |
590 | select ARCH_HAS_CPUFREQ | 576 | select ARCH_HAS_CPUFREQ |
591 | select GENERIC_GPIO | ||
592 | select HAVE_CLK | ||
593 | select COMMON_CLKDEV | 577 | select COMMON_CLKDEV |
594 | select ARCH_REQUIRE_GPIOLIB | 578 | select ARCH_REQUIRE_GPIOLIB |
595 | select GENERIC_TIME | ||
596 | select GENERIC_CLOCKEVENTS | 579 | select GENERIC_CLOCKEVENTS |
597 | select TICK_ONESHOT | 580 | select TICK_ONESHOT |
598 | select PLAT_PXA | 581 | select PLAT_PXA |
@@ -601,14 +584,14 @@ config ARCH_PXA | |||
601 | 584 | ||
602 | config ARCH_MSM | 585 | config ARCH_MSM |
603 | bool "Qualcomm MSM" | 586 | bool "Qualcomm MSM" |
604 | select CPU_V6 | 587 | select HAVE_CLK |
605 | select GENERIC_TIME | ||
606 | select GENERIC_CLOCKEVENTS | 588 | select GENERIC_CLOCKEVENTS |
607 | help | 589 | help |
608 | Support for Qualcomm MSM7K based systems. This runs on the ARM11 | 590 | Support for Qualcomm MSM/QSD based systems. This runs on the |
609 | apps processor of the MSM7K and depends on a shared memory | 591 | apps processor of the MSM/QSD and depends on a shared memory |
610 | interface to the ARM9 modem processor which runs the baseband stack | 592 | interface to the modem processor which runs the baseband |
611 | and controls some vital subsystems (clock and power control, etc). | 593 | stack and controls some vital subsystems |
594 | (clock and power control, etc). | ||
612 | 595 | ||
613 | config ARCH_SHMOBILE | 596 | config ARCH_SHMOBILE |
614 | bool "Renesas SH-Mobile" | 597 | bool "Renesas SH-Mobile" |
@@ -625,6 +608,7 @@ config ARCH_RPC | |||
625 | select ISA_DMA_API | 608 | select ISA_DMA_API |
626 | select NO_IOPORT | 609 | select NO_IOPORT |
627 | select ARCH_SPARSEMEM_ENABLE | 610 | select ARCH_SPARSEMEM_ENABLE |
611 | select ARCH_USES_GETTIMEOFFSET | ||
628 | help | 612 | help |
629 | On the Acorn Risc-PC, Linux can support the internal IDE disk and | 613 | On the Acorn Risc-PC, Linux can support the internal IDE disk and |
630 | CD-ROM interface, serial and parallel port, and the floppy drive. | 614 | CD-ROM interface, serial and parallel port, and the floppy drive. |
@@ -637,8 +621,6 @@ config ARCH_SA1100 | |||
637 | select ARCH_MTD_XIP | 621 | select ARCH_MTD_XIP |
638 | select ARCH_HAS_CPUFREQ | 622 | select ARCH_HAS_CPUFREQ |
639 | select CPU_FREQ | 623 | select CPU_FREQ |
640 | select GENERIC_GPIO | ||
641 | select GENERIC_TIME | ||
642 | select GENERIC_CLOCKEVENTS | 624 | select GENERIC_CLOCKEVENTS |
643 | select HAVE_CLK | 625 | select HAVE_CLK |
644 | select TICK_ONESHOT | 626 | select TICK_ONESHOT |
@@ -647,23 +629,28 @@ config ARCH_SA1100 | |||
647 | Support for StrongARM 11x0 based boards. | 629 | Support for StrongARM 11x0 based boards. |
648 | 630 | ||
649 | config ARCH_S3C2410 | 631 | config ARCH_S3C2410 |
650 | bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443" | 632 | bool "Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443, S3C2450" |
651 | select GENERIC_GPIO | 633 | select GENERIC_GPIO |
652 | select ARCH_HAS_CPUFREQ | 634 | select ARCH_HAS_CPUFREQ |
653 | select HAVE_CLK | 635 | select HAVE_CLK |
636 | select ARCH_USES_GETTIMEOFFSET | ||
654 | help | 637 | help |
655 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics | 638 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics |
656 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or | 639 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or |
657 | the Samsung SMDK2410 development board (and derivatives). | 640 | the Samsung SMDK2410 development board (and derivatives). |
658 | 641 | ||
642 | Note, the S3C2416 and the S3C2450 are so close that they even share | ||
643 | the same SoC ID code. This means that there is no seperate machine | ||
644 | directory (no arch/arm/mach-s3c2450) as the S3C2416 was first. | ||
645 | |||
659 | config ARCH_S3C64XX | 646 | config ARCH_S3C64XX |
660 | bool "Samsung S3C64XX" | 647 | bool "Samsung S3C64XX" |
661 | select PLAT_SAMSUNG | 648 | select PLAT_SAMSUNG |
662 | select CPU_V6 | 649 | select CPU_V6 |
663 | select GENERIC_GPIO | ||
664 | select ARM_VIC | 650 | select ARM_VIC |
665 | select HAVE_CLK | 651 | select HAVE_CLK |
666 | select NO_IOPORT | 652 | select NO_IOPORT |
653 | select ARCH_USES_GETTIMEOFFSET | ||
667 | select ARCH_HAS_CPUFREQ | 654 | select ARCH_HAS_CPUFREQ |
668 | select ARCH_REQUIRE_GPIOLIB | 655 | select ARCH_REQUIRE_GPIOLIB |
669 | select SAMSUNG_CLKSRC | 656 | select SAMSUNG_CLKSRC |
@@ -720,6 +707,7 @@ config ARCH_SHARK | |||
720 | select ISA_DMA | 707 | select ISA_DMA |
721 | select ZONE_DMA | 708 | select ZONE_DMA |
722 | select PCI | 709 | select PCI |
710 | select ARCH_USES_GETTIMEOFFSET | ||
723 | help | 711 | help |
724 | Support for the StrongARM based Digital DNARD machine, also known | 712 | Support for the StrongARM based Digital DNARD machine, also known |
725 | as "Shark" (<http://www.shark-linux.de/shark.html>). | 713 | as "Shark" (<http://www.shark-linux.de/shark.html>). |
@@ -729,6 +717,7 @@ config ARCH_LH7A40X | |||
729 | select CPU_ARM922T | 717 | select CPU_ARM922T |
730 | select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM | 718 | select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM |
731 | select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM | 719 | select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM |
720 | select ARCH_USES_GETTIMEOFFSET | ||
732 | help | 721 | help |
733 | Say Y here for systems based on one of the Sharp LH7A40X | 722 | Say Y here for systems based on one of the Sharp LH7A40X |
734 | System on a Chip processors. These CPUs include an ARM922T | 723 | System on a Chip processors. These CPUs include an ARM922T |
@@ -742,9 +731,7 @@ config ARCH_U300 | |||
742 | select HAVE_TCM | 731 | select HAVE_TCM |
743 | select ARM_AMBA | 732 | select ARM_AMBA |
744 | select ARM_VIC | 733 | select ARM_VIC |
745 | select GENERIC_TIME | ||
746 | select GENERIC_CLOCKEVENTS | 734 | select GENERIC_CLOCKEVENTS |
747 | select HAVE_CLK | ||
748 | select COMMON_CLKDEV | 735 | select COMMON_CLKDEV |
749 | select GENERIC_GPIO | 736 | select GENERIC_GPIO |
750 | help | 737 | help |
@@ -754,9 +741,9 @@ config ARCH_U8500 | |||
754 | bool "ST-Ericsson U8500 Series" | 741 | bool "ST-Ericsson U8500 Series" |
755 | select CPU_V7 | 742 | select CPU_V7 |
756 | select ARM_AMBA | 743 | select ARM_AMBA |
757 | select GENERIC_TIME | ||
758 | select GENERIC_CLOCKEVENTS | 744 | select GENERIC_CLOCKEVENTS |
759 | select COMMON_CLKDEV | 745 | select COMMON_CLKDEV |
746 | select ARCH_REQUIRE_GPIOLIB | ||
760 | help | 747 | help |
761 | Support for ST-Ericsson's Ux500 architecture | 748 | Support for ST-Ericsson's Ux500 architecture |
762 | 749 | ||
@@ -765,11 +752,8 @@ config ARCH_NOMADIK | |||
765 | select ARM_AMBA | 752 | select ARM_AMBA |
766 | select ARM_VIC | 753 | select ARM_VIC |
767 | select CPU_ARM926T | 754 | select CPU_ARM926T |
768 | select HAVE_CLK | ||
769 | select COMMON_CLKDEV | 755 | select COMMON_CLKDEV |
770 | select GENERIC_TIME | ||
771 | select GENERIC_CLOCKEVENTS | 756 | select GENERIC_CLOCKEVENTS |
772 | select GENERIC_GPIO | ||
773 | select ARCH_REQUIRE_GPIOLIB | 757 | select ARCH_REQUIRE_GPIOLIB |
774 | help | 758 | help |
775 | Support for the Nomadik platform by ST-Ericsson | 759 | Support for the Nomadik platform by ST-Ericsson |
@@ -777,11 +761,8 @@ config ARCH_NOMADIK | |||
777 | config ARCH_DAVINCI | 761 | config ARCH_DAVINCI |
778 | bool "TI DaVinci" | 762 | bool "TI DaVinci" |
779 | select CPU_ARM926T | 763 | select CPU_ARM926T |
780 | select GENERIC_TIME | ||
781 | select GENERIC_CLOCKEVENTS | 764 | select GENERIC_CLOCKEVENTS |
782 | select GENERIC_GPIO | ||
783 | select ARCH_REQUIRE_GPIOLIB | 765 | select ARCH_REQUIRE_GPIOLIB |
784 | select HAVE_CLK | ||
785 | select ZONE_DMA | 766 | select ZONE_DMA |
786 | select HAVE_IDE | 767 | select HAVE_IDE |
787 | select COMMON_CLKDEV | 768 | select COMMON_CLKDEV |
@@ -792,16 +773,24 @@ config ARCH_DAVINCI | |||
792 | 773 | ||
793 | config ARCH_OMAP | 774 | config ARCH_OMAP |
794 | bool "TI OMAP" | 775 | bool "TI OMAP" |
795 | select GENERIC_GPIO | ||
796 | select HAVE_CLK | 776 | select HAVE_CLK |
797 | select ARCH_REQUIRE_GPIOLIB | 777 | select ARCH_REQUIRE_GPIOLIB |
798 | select ARCH_HAS_CPUFREQ | 778 | select ARCH_HAS_CPUFREQ |
799 | select GENERIC_TIME | ||
800 | select GENERIC_CLOCKEVENTS | 779 | select GENERIC_CLOCKEVENTS |
801 | select ARCH_HAS_HOLES_MEMORYMODEL | 780 | select ARCH_HAS_HOLES_MEMORYMODEL |
802 | help | 781 | help |
803 | Support for TI's OMAP platform (OMAP1 and OMAP2). | 782 | Support for TI's OMAP platform (OMAP1 and OMAP2). |
804 | 783 | ||
784 | config PLAT_SPEAR | ||
785 | bool "ST SPEAr" | ||
786 | select ARM_AMBA | ||
787 | select ARCH_REQUIRE_GPIOLIB | ||
788 | select COMMON_CLKDEV | ||
789 | select GENERIC_CLOCKEVENTS | ||
790 | select HAVE_CLK | ||
791 | help | ||
792 | Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). | ||
793 | |||
805 | endchoice | 794 | endchoice |
806 | 795 | ||
807 | # | 796 | # |
@@ -817,6 +806,8 @@ source "arch/arm/mach-bcmring/Kconfig" | |||
817 | 806 | ||
818 | source "arch/arm/mach-clps711x/Kconfig" | 807 | source "arch/arm/mach-clps711x/Kconfig" |
819 | 808 | ||
809 | source "arch/arm/mach-cns3xxx/Kconfig" | ||
810 | |||
820 | source "arch/arm/mach-davinci/Kconfig" | 811 | source "arch/arm/mach-davinci/Kconfig" |
821 | 812 | ||
822 | source "arch/arm/mach-dove/Kconfig" | 813 | source "arch/arm/mach-dove/Kconfig" |
@@ -887,11 +878,13 @@ source "arch/arm/plat-samsung/Kconfig" | |||
887 | source "arch/arm/plat-s3c24xx/Kconfig" | 878 | source "arch/arm/plat-s3c24xx/Kconfig" |
888 | source "arch/arm/plat-s5p/Kconfig" | 879 | source "arch/arm/plat-s5p/Kconfig" |
889 | source "arch/arm/plat-s5pc1xx/Kconfig" | 880 | source "arch/arm/plat-s5pc1xx/Kconfig" |
881 | source "arch/arm/plat-spear/Kconfig" | ||
890 | 882 | ||
891 | if ARCH_S3C2410 | 883 | if ARCH_S3C2410 |
892 | source "arch/arm/mach-s3c2400/Kconfig" | 884 | source "arch/arm/mach-s3c2400/Kconfig" |
893 | source "arch/arm/mach-s3c2410/Kconfig" | 885 | source "arch/arm/mach-s3c2410/Kconfig" |
894 | source "arch/arm/mach-s3c2412/Kconfig" | 886 | source "arch/arm/mach-s3c2412/Kconfig" |
887 | source "arch/arm/mach-s3c2416/Kconfig" | ||
895 | source "arch/arm/mach-s3c2440/Kconfig" | 888 | source "arch/arm/mach-s3c2440/Kconfig" |
896 | source "arch/arm/mach-s3c2443/Kconfig" | 889 | source "arch/arm/mach-s3c2443/Kconfig" |
897 | endif | 890 | endif |
@@ -920,6 +913,8 @@ source "arch/arm/mach-ux500/Kconfig" | |||
920 | 913 | ||
921 | source "arch/arm/mach-versatile/Kconfig" | 914 | source "arch/arm/mach-versatile/Kconfig" |
922 | 915 | ||
916 | source "arch/arm/mach-vexpress/Kconfig" | ||
917 | |||
923 | source "arch/arm/mach-w90x900/Kconfig" | 918 | source "arch/arm/mach-w90x900/Kconfig" |
924 | 919 | ||
925 | # Definitions to make life easier | 920 | # Definitions to make life easier |
@@ -929,7 +924,6 @@ config ARCH_ACORN | |||
929 | config PLAT_IOP | 924 | config PLAT_IOP |
930 | bool | 925 | bool |
931 | select GENERIC_CLOCKEVENTS | 926 | select GENERIC_CLOCKEVENTS |
932 | select GENERIC_TIME | ||
933 | 927 | ||
934 | config PLAT_ORION | 928 | config PLAT_ORION |
935 | bool | 929 | bool |
@@ -937,6 +931,12 @@ config PLAT_ORION | |||
937 | config PLAT_PXA | 931 | config PLAT_PXA |
938 | bool | 932 | bool |
939 | 933 | ||
934 | config PLAT_VERSATILE | ||
935 | bool | ||
936 | |||
937 | config ARM_TIMER_SP804 | ||
938 | bool | ||
939 | |||
940 | source arch/arm/mm/Kconfig | 940 | source arch/arm/mm/Kconfig |
941 | 941 | ||
942 | config IWMMXT | 942 | config IWMMXT |
@@ -1065,6 +1065,10 @@ config PCI | |||
1065 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or | 1065 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or |
1066 | VESA. If you have PCI, say Y, otherwise N. | 1066 | VESA. If you have PCI, say Y, otherwise N. |
1067 | 1067 | ||
1068 | config PCI_DOMAINS | ||
1069 | bool | ||
1070 | depends on PCI | ||
1071 | |||
1068 | config PCI_SYSCALL | 1072 | config PCI_SYSCALL |
1069 | def_bool PCI | 1073 | def_bool PCI |
1070 | 1074 | ||
@@ -1093,10 +1097,11 @@ source "kernel/time/Kconfig" | |||
1093 | config SMP | 1097 | config SMP |
1094 | bool "Symmetric Multi-Processing (EXPERIMENTAL)" | 1098 | bool "Symmetric Multi-Processing (EXPERIMENTAL)" |
1095 | depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\ | 1099 | depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\ |
1096 | MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500) | 1100 | MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 ||\ |
1101 | ARCH_U8500 || ARCH_VEXPRESS_CA9X4) | ||
1097 | depends on GENERIC_CLOCKEVENTS | 1102 | depends on GENERIC_CLOCKEVENTS |
1098 | select USE_GENERIC_SMP_HELPERS | 1103 | select USE_GENERIC_SMP_HELPERS |
1099 | select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500) | 1104 | select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4) |
1100 | help | 1105 | help |
1101 | This enables support for systems with more than one CPU. If you have | 1106 | This enables support for systems with more than one CPU. If you have |
1102 | a system with only one CPU, like most personal computers, say N. If | 1107 | a system with only one CPU, like most personal computers, say N. If |
@@ -1277,7 +1282,7 @@ config HIGHPTE | |||
1277 | 1282 | ||
1278 | config HW_PERF_EVENTS | 1283 | config HW_PERF_EVENTS |
1279 | bool "Enable hardware performance counter support for perf events" | 1284 | bool "Enable hardware performance counter support for perf events" |
1280 | depends on PERF_EVENTS && CPU_HAS_PMU && (CPU_V6 || CPU_V7) | 1285 | depends on PERF_EVENTS && CPU_HAS_PMU |
1281 | default y | 1286 | default y |
1282 | help | 1287 | help |
1283 | Enable hardware performance counter support for perf events. If | 1288 | Enable hardware performance counter support for perf events. If |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index ed820e737a8a..d5af3b024300 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -121,6 +121,7 @@ machine-$(CONFIG_ARCH_AAEC2000) := aaec2000 | |||
121 | machine-$(CONFIG_ARCH_AT91) := at91 | 121 | machine-$(CONFIG_ARCH_AT91) := at91 |
122 | machine-$(CONFIG_ARCH_BCMRING) := bcmring | 122 | machine-$(CONFIG_ARCH_BCMRING) := bcmring |
123 | machine-$(CONFIG_ARCH_CLPS711X) := clps711x | 123 | machine-$(CONFIG_ARCH_CLPS711X) := clps711x |
124 | machine-$(CONFIG_ARCH_CNS3XXX) := cns3xxx | ||
124 | machine-$(CONFIG_ARCH_DAVINCI) := davinci | 125 | machine-$(CONFIG_ARCH_DAVINCI) := davinci |
125 | machine-$(CONFIG_ARCH_DOVE) := dove | 126 | machine-$(CONFIG_ARCH_DOVE) := dove |
126 | machine-$(CONFIG_ARCH_EBSA110) := ebsa110 | 127 | machine-$(CONFIG_ARCH_EBSA110) := ebsa110 |
@@ -160,7 +161,7 @@ machine-$(CONFIG_ARCH_PNX4008) := pnx4008 | |||
160 | machine-$(CONFIG_ARCH_PXA) := pxa | 161 | machine-$(CONFIG_ARCH_PXA) := pxa |
161 | machine-$(CONFIG_ARCH_REALVIEW) := realview | 162 | machine-$(CONFIG_ARCH_REALVIEW) := realview |
162 | machine-$(CONFIG_ARCH_RPC) := rpc | 163 | machine-$(CONFIG_ARCH_RPC) := rpc |
163 | machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2443 | 164 | machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2416 s3c2440 s3c2443 |
164 | machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 | 165 | machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 |
165 | machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx | 166 | machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx |
166 | machine-$(CONFIG_ARCH_S5P6440) := s5p6440 | 167 | machine-$(CONFIG_ARCH_S5P6440) := s5p6440 |
@@ -175,9 +176,14 @@ machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx | |||
175 | machine-$(CONFIG_ARCH_U300) := u300 | 176 | machine-$(CONFIG_ARCH_U300) := u300 |
176 | machine-$(CONFIG_ARCH_U8500) := ux500 | 177 | machine-$(CONFIG_ARCH_U8500) := ux500 |
177 | machine-$(CONFIG_ARCH_VERSATILE) := versatile | 178 | machine-$(CONFIG_ARCH_VERSATILE) := versatile |
179 | machine-$(CONFIG_ARCH_VEXPRESS) := vexpress | ||
178 | machine-$(CONFIG_ARCH_W90X900) := w90x900 | 180 | machine-$(CONFIG_ARCH_W90X900) := w90x900 |
179 | machine-$(CONFIG_ARCH_NUC93X) := nuc93x | 181 | machine-$(CONFIG_ARCH_NUC93X) := nuc93x |
180 | machine-$(CONFIG_FOOTBRIDGE) := footbridge | 182 | machine-$(CONFIG_FOOTBRIDGE) := footbridge |
183 | machine-$(CONFIG_MACH_SPEAR300) := spear3xx | ||
184 | machine-$(CONFIG_MACH_SPEAR310) := spear3xx | ||
185 | machine-$(CONFIG_MACH_SPEAR320) := spear3xx | ||
186 | machine-$(CONFIG_MACH_SPEAR600) := spear6xx | ||
181 | 187 | ||
182 | # Platform directory name. This list is sorted alphanumerically | 188 | # Platform directory name. This list is sorted alphanumerically |
183 | # by CONFIG_* macro name. | 189 | # by CONFIG_* macro name. |
@@ -192,6 +198,8 @@ plat-$(CONFIG_PLAT_PXA) := pxa | |||
192 | plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung | 198 | plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung |
193 | plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung | 199 | plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung |
194 | plat-$(CONFIG_PLAT_S5P) := s5p samsung | 200 | plat-$(CONFIG_PLAT_S5P) := s5p samsung |
201 | plat-$(CONFIG_PLAT_SPEAR) := spear | ||
202 | plat-$(CONFIG_PLAT_VERSATILE) := versatile | ||
195 | 203 | ||
196 | ifeq ($(CONFIG_ARCH_EBSA110),y) | 204 | ifeq ($(CONFIG_ARCH_EBSA110),y) |
197 | # This is what happens if you forget the IOCS16 line. | 205 | # This is what happens if you forget the IOCS16 line. |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 97c89e7de7d3..53faa9063a03 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -65,6 +65,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ | |||
65 | 65 | ||
66 | suffix_$(CONFIG_KERNEL_GZIP) = gzip | 66 | suffix_$(CONFIG_KERNEL_GZIP) = gzip |
67 | suffix_$(CONFIG_KERNEL_LZO) = lzo | 67 | suffix_$(CONFIG_KERNEL_LZO) = lzo |
68 | suffix_$(CONFIG_KERNEL_LZMA) = lzma | ||
68 | 69 | ||
69 | targets := vmlinux vmlinux.lds \ | 70 | targets := vmlinux vmlinux.lds \ |
70 | piggy.$(suffix_y) piggy.$(suffix_y).o \ | 71 | piggy.$(suffix_y) piggy.$(suffix_y).o \ |
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c index 9c097073ce4c..4c72a97bc3e1 100644 --- a/arch/arm/boot/compressed/decompress.c +++ b/arch/arm/boot/compressed/decompress.c | |||
@@ -40,6 +40,10 @@ extern void error(char *); | |||
40 | #include "../../../../lib/decompress_unlzo.c" | 40 | #include "../../../../lib/decompress_unlzo.c" |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #ifdef CONFIG_KERNEL_LZMA | ||
44 | #include "../../../../lib/decompress_unlzma.c" | ||
45 | #endif | ||
46 | |||
43 | void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)) | 47 | void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)) |
44 | { | 48 | { |
45 | decompress(input, len, NULL, NULL, output, NULL, error); | 49 | decompress(input, len, NULL, NULL, output, NULL, error); |
diff --git a/arch/arm/boot/compressed/piggy.lzma.S b/arch/arm/boot/compressed/piggy.lzma.S new file mode 100644 index 000000000000..d7e69cffbc0a --- /dev/null +++ b/arch/arm/boot/compressed/piggy.lzma.S | |||
@@ -0,0 +1,6 @@ | |||
1 | .section .piggydata,#alloc | ||
2 | .globl input_data | ||
3 | input_data: | ||
4 | .incbin "arch/arm/boot/compressed/piggy.lzma" | ||
5 | .globl input_data_end | ||
6 | input_data_end: | ||
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig index 4efbb9df0444..0a34c8186924 100644 --- a/arch/arm/common/Kconfig +++ b/arch/arm/common/Kconfig | |||
@@ -12,10 +12,10 @@ config ARM_VIC_NR | |||
12 | The maximum number of VICs available in the system, for | 12 | The maximum number of VICs available in the system, for |
13 | power management. | 13 | power management. |
14 | 14 | ||
15 | config ICST525 | 15 | config ICST |
16 | bool | 16 | bool |
17 | 17 | ||
18 | config ICST307 | 18 | config PL330 |
19 | bool | 19 | bool |
20 | 20 | ||
21 | config SA1111 | 21 | config SA1111 |
@@ -40,3 +40,4 @@ config SHARP_SCOOP | |||
40 | 40 | ||
41 | config COMMON_CLKDEV | 41 | config COMMON_CLKDEV |
42 | bool | 42 | bool |
43 | select HAVE_CLK | ||
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile index 76be7ff2a7ca..e6e8664a9413 100644 --- a/arch/arm/common/Makefile +++ b/arch/arm/common/Makefile | |||
@@ -4,8 +4,8 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_ARM_GIC) += gic.o | 5 | obj-$(CONFIG_ARM_GIC) += gic.o |
6 | obj-$(CONFIG_ARM_VIC) += vic.o | 6 | obj-$(CONFIG_ARM_VIC) += vic.o |
7 | obj-$(CONFIG_ICST525) += icst525.o | 7 | obj-$(CONFIG_ICST) += icst.o |
8 | obj-$(CONFIG_ICST307) += icst307.o | 8 | obj-$(CONFIG_PL330) += pl330.o |
9 | obj-$(CONFIG_SA1111) += sa1111.o | 9 | obj-$(CONFIG_SA1111) += sa1111.o |
10 | obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o | 10 | obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o |
11 | obj-$(CONFIG_DMABOUNCE) += dmabounce.o | 11 | obj-$(CONFIG_DMABOUNCE) += dmabounce.o |
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c index dba4c1da63ed..e2b2bb66e094 100644 --- a/arch/arm/common/clkdev.c +++ b/arch/arm/common/clkdev.c | |||
@@ -53,12 +53,13 @@ static struct clk *clk_find(const char *dev_id, const char *con_id) | |||
53 | continue; | 53 | continue; |
54 | match += 1; | 54 | match += 1; |
55 | } | 55 | } |
56 | if (match == 0) | ||
57 | continue; | ||
58 | 56 | ||
59 | if (match > best) { | 57 | if (match > best) { |
60 | clk = p->clk; | 58 | clk = p->clk; |
61 | best = match; | 59 | if (match != 3) |
60 | best = match; | ||
61 | else | ||
62 | break; | ||
62 | } | 63 | } |
63 | } | 64 | } |
64 | return clk; | 65 | return clk; |
diff --git a/arch/arm/common/icst.c b/arch/arm/common/icst.c new file mode 100644 index 000000000000..9a7f09cff300 --- /dev/null +++ b/arch/arm/common/icst.c | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/common/icst307.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
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 | * Support functions for calculating clocks/divisors for the ICST307 | ||
11 | * clock generators. See http://www.icst.com/ for more information | ||
12 | * on these devices. | ||
13 | * | ||
14 | * This is an almost identical implementation to the ICST525 clock generator. | ||
15 | * The s2div and idx2s files are different | ||
16 | */ | ||
17 | #include <linux/module.h> | ||
18 | #include <linux/kernel.h> | ||
19 | |||
20 | #include <asm/hardware/icst.h> | ||
21 | |||
22 | /* | ||
23 | * Divisors for each OD setting. | ||
24 | */ | ||
25 | const unsigned char icst307_s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 }; | ||
26 | const unsigned char icst525_s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 }; | ||
27 | EXPORT_SYMBOL(icst307_s2div); | ||
28 | EXPORT_SYMBOL(icst525_s2div); | ||
29 | |||
30 | unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco) | ||
31 | { | ||
32 | return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]); | ||
33 | } | ||
34 | |||
35 | EXPORT_SYMBOL(icst_hz); | ||
36 | |||
37 | /* | ||
38 | * Ascending divisor S values. | ||
39 | */ | ||
40 | const unsigned char icst307_idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 }; | ||
41 | const unsigned char icst525_idx2s[8] = { 1, 3, 4, 7, 5, 2, 6, 0 }; | ||
42 | EXPORT_SYMBOL(icst307_idx2s); | ||
43 | EXPORT_SYMBOL(icst525_idx2s); | ||
44 | |||
45 | struct icst_vco | ||
46 | icst_hz_to_vco(const struct icst_params *p, unsigned long freq) | ||
47 | { | ||
48 | struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
49 | unsigned long f; | ||
50 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
51 | |||
52 | /* | ||
53 | * First, find the PLL output divisor such | ||
54 | * that the PLL output is within spec. | ||
55 | */ | ||
56 | do { | ||
57 | f = freq * p->s2div[p->idx2s[i]]; | ||
58 | |||
59 | if (f > p->vco_min && f <= p->vco_max) | ||
60 | break; | ||
61 | } while (i < 8); | ||
62 | |||
63 | if (i >= 8) | ||
64 | return vco; | ||
65 | |||
66 | vco.s = p->idx2s[i]; | ||
67 | |||
68 | /* | ||
69 | * Now find the closest divisor combination | ||
70 | * which gives a PLL output of 'f'. | ||
71 | */ | ||
72 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
73 | unsigned long fref_div, f_pll; | ||
74 | unsigned int vd; | ||
75 | int f_diff; | ||
76 | |||
77 | fref_div = (2 * p->ref) / rd; | ||
78 | |||
79 | vd = (f + fref_div / 2) / fref_div; | ||
80 | if (vd < p->vd_min || vd > p->vd_max) | ||
81 | continue; | ||
82 | |||
83 | f_pll = fref_div * vd; | ||
84 | f_diff = f_pll - f; | ||
85 | if (f_diff < 0) | ||
86 | f_diff = -f_diff; | ||
87 | |||
88 | if ((unsigned)f_diff < best) { | ||
89 | vco.v = vd - 8; | ||
90 | vco.r = rd - 2; | ||
91 | if (f_diff == 0) | ||
92 | break; | ||
93 | best = f_diff; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | return vco; | ||
98 | } | ||
99 | |||
100 | EXPORT_SYMBOL(icst_hz_to_vco); | ||
diff --git a/arch/arm/common/icst307.c b/arch/arm/common/icst307.c deleted file mode 100644 index 6d094c157540..000000000000 --- a/arch/arm/common/icst307.c +++ /dev/null | |||
@@ -1,161 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/common/icst307.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
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 | * Support functions for calculating clocks/divisors for the ICST307 | ||
11 | * clock generators. See http://www.icst.com/ for more information | ||
12 | * on these devices. | ||
13 | * | ||
14 | * This is an almost identical implementation to the ICST525 clock generator. | ||
15 | * The s2div and idx2s files are different | ||
16 | */ | ||
17 | #include <linux/module.h> | ||
18 | #include <linux/kernel.h> | ||
19 | |||
20 | #include <asm/hardware/icst307.h> | ||
21 | |||
22 | /* | ||
23 | * Divisors for each OD setting. | ||
24 | */ | ||
25 | static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 }; | ||
26 | |||
27 | unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco) | ||
28 | { | ||
29 | return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]); | ||
30 | } | ||
31 | |||
32 | EXPORT_SYMBOL(icst307_khz); | ||
33 | |||
34 | /* | ||
35 | * Ascending divisor S values. | ||
36 | */ | ||
37 | static unsigned char idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 }; | ||
38 | |||
39 | struct icst307_vco | ||
40 | icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq) | ||
41 | { | ||
42 | struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
43 | unsigned long f; | ||
44 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
45 | |||
46 | /* | ||
47 | * First, find the PLL output divisor such | ||
48 | * that the PLL output is within spec. | ||
49 | */ | ||
50 | do { | ||
51 | f = freq * s2div[idx2s[i]]; | ||
52 | |||
53 | /* | ||
54 | * f must be between 6MHz and 200MHz (3.3 or 5V) | ||
55 | */ | ||
56 | if (f > 6000 && f <= p->vco_max) | ||
57 | break; | ||
58 | } while (i < ARRAY_SIZE(idx2s)); | ||
59 | |||
60 | if (i >= ARRAY_SIZE(idx2s)) | ||
61 | return vco; | ||
62 | |||
63 | vco.s = idx2s[i]; | ||
64 | |||
65 | /* | ||
66 | * Now find the closest divisor combination | ||
67 | * which gives a PLL output of 'f'. | ||
68 | */ | ||
69 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
70 | unsigned long fref_div, f_pll; | ||
71 | unsigned int vd; | ||
72 | int f_diff; | ||
73 | |||
74 | fref_div = (2 * p->ref) / rd; | ||
75 | |||
76 | vd = (f + fref_div / 2) / fref_div; | ||
77 | if (vd < p->vd_min || vd > p->vd_max) | ||
78 | continue; | ||
79 | |||
80 | f_pll = fref_div * vd; | ||
81 | f_diff = f_pll - f; | ||
82 | if (f_diff < 0) | ||
83 | f_diff = -f_diff; | ||
84 | |||
85 | if ((unsigned)f_diff < best) { | ||
86 | vco.v = vd - 8; | ||
87 | vco.r = rd - 2; | ||
88 | if (f_diff == 0) | ||
89 | break; | ||
90 | best = f_diff; | ||
91 | } | ||
92 | } | ||
93 | |||
94 | return vco; | ||
95 | } | ||
96 | |||
97 | EXPORT_SYMBOL(icst307_khz_to_vco); | ||
98 | |||
99 | struct icst307_vco | ||
100 | icst307_ps_to_vco(const struct icst307_params *p, unsigned long period) | ||
101 | { | ||
102 | struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
103 | unsigned long f, ps; | ||
104 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
105 | |||
106 | ps = 1000000000UL / p->vco_max; | ||
107 | |||
108 | /* | ||
109 | * First, find the PLL output divisor such | ||
110 | * that the PLL output is within spec. | ||
111 | */ | ||
112 | do { | ||
113 | f = period / s2div[idx2s[i]]; | ||
114 | |||
115 | /* | ||
116 | * f must be between 6MHz and 200MHz (3.3 or 5V) | ||
117 | */ | ||
118 | if (f >= ps && f < 1000000000UL / 6000 + 1) | ||
119 | break; | ||
120 | } while (i < ARRAY_SIZE(idx2s)); | ||
121 | |||
122 | if (i >= ARRAY_SIZE(idx2s)) | ||
123 | return vco; | ||
124 | |||
125 | vco.s = idx2s[i]; | ||
126 | |||
127 | ps = 500000000UL / p->ref; | ||
128 | |||
129 | /* | ||
130 | * Now find the closest divisor combination | ||
131 | * which gives a PLL output of 'f'. | ||
132 | */ | ||
133 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
134 | unsigned long f_in_div, f_pll; | ||
135 | unsigned int vd; | ||
136 | int f_diff; | ||
137 | |||
138 | f_in_div = ps * rd; | ||
139 | |||
140 | vd = (f_in_div + f / 2) / f; | ||
141 | if (vd < p->vd_min || vd > p->vd_max) | ||
142 | continue; | ||
143 | |||
144 | f_pll = (f_in_div + vd / 2) / vd; | ||
145 | f_diff = f_pll - f; | ||
146 | if (f_diff < 0) | ||
147 | f_diff = -f_diff; | ||
148 | |||
149 | if ((unsigned)f_diff < best) { | ||
150 | vco.v = vd - 8; | ||
151 | vco.r = rd - 2; | ||
152 | if (f_diff == 0) | ||
153 | break; | ||
154 | best = f_diff; | ||
155 | } | ||
156 | } | ||
157 | |||
158 | return vco; | ||
159 | } | ||
160 | |||
161 | EXPORT_SYMBOL(icst307_ps_to_vco); | ||
diff --git a/arch/arm/common/icst525.c b/arch/arm/common/icst525.c deleted file mode 100644 index 3d377c5bdef6..000000000000 --- a/arch/arm/common/icst525.c +++ /dev/null | |||
@@ -1,160 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/common/icst525.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
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 | * Support functions for calculating clocks/divisors for the ICST525 | ||
11 | * clock generators. See http://www.icst.com/ for more information | ||
12 | * on these devices. | ||
13 | */ | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/kernel.h> | ||
16 | |||
17 | #include <asm/hardware/icst525.h> | ||
18 | |||
19 | /* | ||
20 | * Divisors for each OD setting. | ||
21 | */ | ||
22 | static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 }; | ||
23 | |||
24 | unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco) | ||
25 | { | ||
26 | return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]); | ||
27 | } | ||
28 | |||
29 | EXPORT_SYMBOL(icst525_khz); | ||
30 | |||
31 | /* | ||
32 | * Ascending divisor S values. | ||
33 | */ | ||
34 | static unsigned char idx2s[] = { 1, 3, 4, 7, 5, 2, 6, 0 }; | ||
35 | |||
36 | struct icst525_vco | ||
37 | icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq) | ||
38 | { | ||
39 | struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
40 | unsigned long f; | ||
41 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
42 | |||
43 | /* | ||
44 | * First, find the PLL output divisor such | ||
45 | * that the PLL output is within spec. | ||
46 | */ | ||
47 | do { | ||
48 | f = freq * s2div[idx2s[i]]; | ||
49 | |||
50 | /* | ||
51 | * f must be between 10MHz and | ||
52 | * 320MHz (5V) or 200MHz (3V) | ||
53 | */ | ||
54 | if (f > 10000 && f <= p->vco_max) | ||
55 | break; | ||
56 | } while (i < ARRAY_SIZE(idx2s)); | ||
57 | |||
58 | if (i >= ARRAY_SIZE(idx2s)) | ||
59 | return vco; | ||
60 | |||
61 | vco.s = idx2s[i]; | ||
62 | |||
63 | /* | ||
64 | * Now find the closest divisor combination | ||
65 | * which gives a PLL output of 'f'. | ||
66 | */ | ||
67 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
68 | unsigned long fref_div, f_pll; | ||
69 | unsigned int vd; | ||
70 | int f_diff; | ||
71 | |||
72 | fref_div = (2 * p->ref) / rd; | ||
73 | |||
74 | vd = (f + fref_div / 2) / fref_div; | ||
75 | if (vd < p->vd_min || vd > p->vd_max) | ||
76 | continue; | ||
77 | |||
78 | f_pll = fref_div * vd; | ||
79 | f_diff = f_pll - f; | ||
80 | if (f_diff < 0) | ||
81 | f_diff = -f_diff; | ||
82 | |||
83 | if ((unsigned)f_diff < best) { | ||
84 | vco.v = vd - 8; | ||
85 | vco.r = rd - 2; | ||
86 | if (f_diff == 0) | ||
87 | break; | ||
88 | best = f_diff; | ||
89 | } | ||
90 | } | ||
91 | |||
92 | return vco; | ||
93 | } | ||
94 | |||
95 | EXPORT_SYMBOL(icst525_khz_to_vco); | ||
96 | |||
97 | struct icst525_vco | ||
98 | icst525_ps_to_vco(const struct icst525_params *p, unsigned long period) | ||
99 | { | ||
100 | struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
101 | unsigned long f, ps; | ||
102 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
103 | |||
104 | ps = 1000000000UL / p->vco_max; | ||
105 | |||
106 | /* | ||
107 | * First, find the PLL output divisor such | ||
108 | * that the PLL output is within spec. | ||
109 | */ | ||
110 | do { | ||
111 | f = period / s2div[idx2s[i]]; | ||
112 | |||
113 | /* | ||
114 | * f must be between 10MHz and | ||
115 | * 320MHz (5V) or 200MHz (3V) | ||
116 | */ | ||
117 | if (f >= ps && f < 100000) | ||
118 | break; | ||
119 | } while (i < ARRAY_SIZE(idx2s)); | ||
120 | |||
121 | if (i >= ARRAY_SIZE(idx2s)) | ||
122 | return vco; | ||
123 | |||
124 | vco.s = idx2s[i]; | ||
125 | |||
126 | ps = 500000000UL / p->ref; | ||
127 | |||
128 | /* | ||
129 | * Now find the closest divisor combination | ||
130 | * which gives a PLL output of 'f'. | ||
131 | */ | ||
132 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
133 | unsigned long f_in_div, f_pll; | ||
134 | unsigned int vd; | ||
135 | int f_diff; | ||
136 | |||
137 | f_in_div = ps * rd; | ||
138 | |||
139 | vd = (f_in_div + f / 2) / f; | ||
140 | if (vd < p->vd_min || vd > p->vd_max) | ||
141 | continue; | ||
142 | |||
143 | f_pll = (f_in_div + vd / 2) / vd; | ||
144 | f_diff = f_pll - f; | ||
145 | if (f_diff < 0) | ||
146 | f_diff = -f_diff; | ||
147 | |||
148 | if ((unsigned)f_diff < best) { | ||
149 | vco.v = vd - 8; | ||
150 | vco.r = rd - 2; | ||
151 | if (f_diff == 0) | ||
152 | break; | ||
153 | best = f_diff; | ||
154 | } | ||
155 | } | ||
156 | |||
157 | return vco; | ||
158 | } | ||
159 | |||
160 | EXPORT_SYMBOL(icst525_ps_to_vco); | ||
diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c new file mode 100644 index 000000000000..5ebbab6242a7 --- /dev/null +++ b/arch/arm/common/pl330.c | |||
@@ -0,0 +1,1966 @@ | |||
1 | /* linux/arch/arm/common/pl330.c | ||
2 | * | ||
3 | * Copyright (C) 2010 Samsung Electronics Co Ltd. | ||
4 | * Jaswinder Singh <jassi.brar@samsung.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., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/slab.h> | ||
24 | #include <linux/module.h> | ||
25 | #include <linux/string.h> | ||
26 | #include <linux/io.h> | ||
27 | #include <linux/delay.h> | ||
28 | #include <linux/interrupt.h> | ||
29 | #include <linux/dma-mapping.h> | ||
30 | |||
31 | #include <asm/hardware/pl330.h> | ||
32 | |||
33 | /* Register and Bit field Definitions */ | ||
34 | #define DS 0x0 | ||
35 | #define DS_ST_STOP 0x0 | ||
36 | #define DS_ST_EXEC 0x1 | ||
37 | #define DS_ST_CMISS 0x2 | ||
38 | #define DS_ST_UPDTPC 0x3 | ||
39 | #define DS_ST_WFE 0x4 | ||
40 | #define DS_ST_ATBRR 0x5 | ||
41 | #define DS_ST_QBUSY 0x6 | ||
42 | #define DS_ST_WFP 0x7 | ||
43 | #define DS_ST_KILL 0x8 | ||
44 | #define DS_ST_CMPLT 0x9 | ||
45 | #define DS_ST_FLTCMP 0xe | ||
46 | #define DS_ST_FAULT 0xf | ||
47 | |||
48 | #define DPC 0x4 | ||
49 | #define INTEN 0x20 | ||
50 | #define ES 0x24 | ||
51 | #define INTSTATUS 0x28 | ||
52 | #define INTCLR 0x2c | ||
53 | #define FSM 0x30 | ||
54 | #define FSC 0x34 | ||
55 | #define FTM 0x38 | ||
56 | |||
57 | #define _FTC 0x40 | ||
58 | #define FTC(n) (_FTC + (n)*0x4) | ||
59 | |||
60 | #define _CS 0x100 | ||
61 | #define CS(n) (_CS + (n)*0x8) | ||
62 | #define CS_CNS (1 << 21) | ||
63 | |||
64 | #define _CPC 0x104 | ||
65 | #define CPC(n) (_CPC + (n)*0x8) | ||
66 | |||
67 | #define _SA 0x400 | ||
68 | #define SA(n) (_SA + (n)*0x20) | ||
69 | |||
70 | #define _DA 0x404 | ||
71 | #define DA(n) (_DA + (n)*0x20) | ||
72 | |||
73 | #define _CC 0x408 | ||
74 | #define CC(n) (_CC + (n)*0x20) | ||
75 | |||
76 | #define CC_SRCINC (1 << 0) | ||
77 | #define CC_DSTINC (1 << 14) | ||
78 | #define CC_SRCPRI (1 << 8) | ||
79 | #define CC_DSTPRI (1 << 22) | ||
80 | #define CC_SRCNS (1 << 9) | ||
81 | #define CC_DSTNS (1 << 23) | ||
82 | #define CC_SRCIA (1 << 10) | ||
83 | #define CC_DSTIA (1 << 24) | ||
84 | #define CC_SRCBRSTLEN_SHFT 4 | ||
85 | #define CC_DSTBRSTLEN_SHFT 18 | ||
86 | #define CC_SRCBRSTSIZE_SHFT 1 | ||
87 | #define CC_DSTBRSTSIZE_SHFT 15 | ||
88 | #define CC_SRCCCTRL_SHFT 11 | ||
89 | #define CC_SRCCCTRL_MASK 0x7 | ||
90 | #define CC_DSTCCTRL_SHFT 25 | ||
91 | #define CC_DRCCCTRL_MASK 0x7 | ||
92 | #define CC_SWAP_SHFT 28 | ||
93 | |||
94 | #define _LC0 0x40c | ||
95 | #define LC0(n) (_LC0 + (n)*0x20) | ||
96 | |||
97 | #define _LC1 0x410 | ||
98 | #define LC1(n) (_LC1 + (n)*0x20) | ||
99 | |||
100 | #define DBGSTATUS 0xd00 | ||
101 | #define DBG_BUSY (1 << 0) | ||
102 | |||
103 | #define DBGCMD 0xd04 | ||
104 | #define DBGINST0 0xd08 | ||
105 | #define DBGINST1 0xd0c | ||
106 | |||
107 | #define CR0 0xe00 | ||
108 | #define CR1 0xe04 | ||
109 | #define CR2 0xe08 | ||
110 | #define CR3 0xe0c | ||
111 | #define CR4 0xe10 | ||
112 | #define CRD 0xe14 | ||
113 | |||
114 | #define PERIPH_ID 0xfe0 | ||
115 | #define PCELL_ID 0xff0 | ||
116 | |||
117 | #define CR0_PERIPH_REQ_SET (1 << 0) | ||
118 | #define CR0_BOOT_EN_SET (1 << 1) | ||
119 | #define CR0_BOOT_MAN_NS (1 << 2) | ||
120 | #define CR0_NUM_CHANS_SHIFT 4 | ||
121 | #define CR0_NUM_CHANS_MASK 0x7 | ||
122 | #define CR0_NUM_PERIPH_SHIFT 12 | ||
123 | #define CR0_NUM_PERIPH_MASK 0x1f | ||
124 | #define CR0_NUM_EVENTS_SHIFT 17 | ||
125 | #define CR0_NUM_EVENTS_MASK 0x1f | ||
126 | |||
127 | #define CR1_ICACHE_LEN_SHIFT 0 | ||
128 | #define CR1_ICACHE_LEN_MASK 0x7 | ||
129 | #define CR1_NUM_ICACHELINES_SHIFT 4 | ||
130 | #define CR1_NUM_ICACHELINES_MASK 0xf | ||
131 | |||
132 | #define CRD_DATA_WIDTH_SHIFT 0 | ||
133 | #define CRD_DATA_WIDTH_MASK 0x7 | ||
134 | #define CRD_WR_CAP_SHIFT 4 | ||
135 | #define CRD_WR_CAP_MASK 0x7 | ||
136 | #define CRD_WR_Q_DEP_SHIFT 8 | ||
137 | #define CRD_WR_Q_DEP_MASK 0xf | ||
138 | #define CRD_RD_CAP_SHIFT 12 | ||
139 | #define CRD_RD_CAP_MASK 0x7 | ||
140 | #define CRD_RD_Q_DEP_SHIFT 16 | ||
141 | #define CRD_RD_Q_DEP_MASK 0xf | ||
142 | #define CRD_DATA_BUFF_SHIFT 20 | ||
143 | #define CRD_DATA_BUFF_MASK 0x3ff | ||
144 | |||
145 | #define PART 0x330 | ||
146 | #define DESIGNER 0x41 | ||
147 | #define REVISION 0x0 | ||
148 | #define INTEG_CFG 0x0 | ||
149 | #define PERIPH_ID_VAL ((PART << 0) | (DESIGNER << 12) \ | ||
150 | | (REVISION << 20) | (INTEG_CFG << 24)) | ||
151 | |||
152 | #define PCELL_ID_VAL 0xb105f00d | ||
153 | |||
154 | #define PL330_STATE_STOPPED (1 << 0) | ||
155 | #define PL330_STATE_EXECUTING (1 << 1) | ||
156 | #define PL330_STATE_WFE (1 << 2) | ||
157 | #define PL330_STATE_FAULTING (1 << 3) | ||
158 | #define PL330_STATE_COMPLETING (1 << 4) | ||
159 | #define PL330_STATE_WFP (1 << 5) | ||
160 | #define PL330_STATE_KILLING (1 << 6) | ||
161 | #define PL330_STATE_FAULT_COMPLETING (1 << 7) | ||
162 | #define PL330_STATE_CACHEMISS (1 << 8) | ||
163 | #define PL330_STATE_UPDTPC (1 << 9) | ||
164 | #define PL330_STATE_ATBARRIER (1 << 10) | ||
165 | #define PL330_STATE_QUEUEBUSY (1 << 11) | ||
166 | #define PL330_STATE_INVALID (1 << 15) | ||
167 | |||
168 | #define PL330_STABLE_STATES (PL330_STATE_STOPPED | PL330_STATE_EXECUTING \ | ||
169 | | PL330_STATE_WFE | PL330_STATE_FAULTING) | ||
170 | |||
171 | #define CMD_DMAADDH 0x54 | ||
172 | #define CMD_DMAEND 0x00 | ||
173 | #define CMD_DMAFLUSHP 0x35 | ||
174 | #define CMD_DMAGO 0xa0 | ||
175 | #define CMD_DMALD 0x04 | ||
176 | #define CMD_DMALDP 0x25 | ||
177 | #define CMD_DMALP 0x20 | ||
178 | #define CMD_DMALPEND 0x28 | ||
179 | #define CMD_DMAKILL 0x01 | ||
180 | #define CMD_DMAMOV 0xbc | ||
181 | #define CMD_DMANOP 0x18 | ||
182 | #define CMD_DMARMB 0x12 | ||
183 | #define CMD_DMASEV 0x34 | ||
184 | #define CMD_DMAST 0x08 | ||
185 | #define CMD_DMASTP 0x29 | ||
186 | #define CMD_DMASTZ 0x0c | ||
187 | #define CMD_DMAWFE 0x36 | ||
188 | #define CMD_DMAWFP 0x30 | ||
189 | #define CMD_DMAWMB 0x13 | ||
190 | |||
191 | #define SZ_DMAADDH 3 | ||
192 | #define SZ_DMAEND 1 | ||
193 | #define SZ_DMAFLUSHP 2 | ||
194 | #define SZ_DMALD 1 | ||
195 | #define SZ_DMALDP 2 | ||
196 | #define SZ_DMALP 2 | ||
197 | #define SZ_DMALPEND 2 | ||
198 | #define SZ_DMAKILL 1 | ||
199 | #define SZ_DMAMOV 6 | ||
200 | #define SZ_DMANOP 1 | ||
201 | #define SZ_DMARMB 1 | ||
202 | #define SZ_DMASEV 2 | ||
203 | #define SZ_DMAST 1 | ||
204 | #define SZ_DMASTP 2 | ||
205 | #define SZ_DMASTZ 1 | ||
206 | #define SZ_DMAWFE 2 | ||
207 | #define SZ_DMAWFP 2 | ||
208 | #define SZ_DMAWMB 1 | ||
209 | #define SZ_DMAGO 6 | ||
210 | |||
211 | #define BRST_LEN(ccr) ((((ccr) >> CC_SRCBRSTLEN_SHFT) & 0xf) + 1) | ||
212 | #define BRST_SIZE(ccr) (1 << (((ccr) >> CC_SRCBRSTSIZE_SHFT) & 0x7)) | ||
213 | |||
214 | #define BYTE_TO_BURST(b, ccr) ((b) / BRST_SIZE(ccr) / BRST_LEN(ccr)) | ||
215 | #define BURST_TO_BYTE(c, ccr) ((c) * BRST_SIZE(ccr) * BRST_LEN(ccr)) | ||
216 | |||
217 | /* | ||
218 | * With 256 bytes, we can do more than 2.5MB and 5MB xfers per req | ||
219 | * at 1byte/burst for P<->M and M<->M respectively. | ||
220 | * For typical scenario, at 1word/burst, 10MB and 20MB xfers per req | ||
221 | * should be enough for P<->M and M<->M respectively. | ||
222 | */ | ||
223 | #define MCODE_BUFF_PER_REQ 256 | ||
224 | |||
225 | /* | ||
226 | * Mark a _pl330_req as free. | ||
227 | * We do it by writing DMAEND as the first instruction | ||
228 | * because no valid request is going to have DMAEND as | ||
229 | * its first instruction to execute. | ||
230 | */ | ||
231 | #define MARK_FREE(req) do { \ | ||
232 | _emit_END(0, (req)->mc_cpu); \ | ||
233 | (req)->mc_len = 0; \ | ||
234 | } while (0) | ||
235 | |||
236 | /* If the _pl330_req is available to the client */ | ||
237 | #define IS_FREE(req) (*((u8 *)((req)->mc_cpu)) == CMD_DMAEND) | ||
238 | |||
239 | /* Use this _only_ to wait on transient states */ | ||
240 | #define UNTIL(t, s) while (!(_state(t) & (s))) cpu_relax(); | ||
241 | |||
242 | #ifdef PL330_DEBUG_MCGEN | ||
243 | static unsigned cmd_line; | ||
244 | #define PL330_DBGCMD_DUMP(off, x...) do { \ | ||
245 | printk("%x:", cmd_line); \ | ||
246 | printk(x); \ | ||
247 | cmd_line += off; \ | ||
248 | } while (0) | ||
249 | #define PL330_DBGMC_START(addr) (cmd_line = addr) | ||
250 | #else | ||
251 | #define PL330_DBGCMD_DUMP(off, x...) do {} while (0) | ||
252 | #define PL330_DBGMC_START(addr) do {} while (0) | ||
253 | #endif | ||
254 | |||
255 | struct _xfer_spec { | ||
256 | u32 ccr; | ||
257 | struct pl330_req *r; | ||
258 | struct pl330_xfer *x; | ||
259 | }; | ||
260 | |||
261 | enum dmamov_dst { | ||
262 | SAR = 0, | ||
263 | CCR, | ||
264 | DAR, | ||
265 | }; | ||
266 | |||
267 | enum pl330_dst { | ||
268 | SRC = 0, | ||
269 | DST, | ||
270 | }; | ||
271 | |||
272 | enum pl330_cond { | ||
273 | SINGLE, | ||
274 | BURST, | ||
275 | ALWAYS, | ||
276 | }; | ||
277 | |||
278 | struct _pl330_req { | ||
279 | u32 mc_bus; | ||
280 | void *mc_cpu; | ||
281 | /* Number of bytes taken to setup MC for the req */ | ||
282 | u32 mc_len; | ||
283 | struct pl330_req *r; | ||
284 | /* Hook to attach to DMAC's list of reqs with due callback */ | ||
285 | struct list_head rqd; | ||
286 | }; | ||
287 | |||
288 | /* ToBeDone for tasklet */ | ||
289 | struct _pl330_tbd { | ||
290 | bool reset_dmac; | ||
291 | bool reset_mngr; | ||
292 | u8 reset_chan; | ||
293 | }; | ||
294 | |||
295 | /* A DMAC Thread */ | ||
296 | struct pl330_thread { | ||
297 | u8 id; | ||
298 | int ev; | ||
299 | /* If the channel is not yet acquired by any client */ | ||
300 | bool free; | ||
301 | /* Parent DMAC */ | ||
302 | struct pl330_dmac *dmac; | ||
303 | /* Only two at a time */ | ||
304 | struct _pl330_req req[2]; | ||
305 | /* Index of the last submitted request */ | ||
306 | unsigned lstenq; | ||
307 | }; | ||
308 | |||
309 | enum pl330_dmac_state { | ||
310 | UNINIT, | ||
311 | INIT, | ||
312 | DYING, | ||
313 | }; | ||
314 | |||
315 | /* A DMAC */ | ||
316 | struct pl330_dmac { | ||
317 | spinlock_t lock; | ||
318 | /* Holds list of reqs with due callbacks */ | ||
319 | struct list_head req_done; | ||
320 | /* Pointer to platform specific stuff */ | ||
321 | struct pl330_info *pinfo; | ||
322 | /* Maximum possible events/irqs */ | ||
323 | int events[32]; | ||
324 | /* BUS address of MicroCode buffer */ | ||
325 | u32 mcode_bus; | ||
326 | /* CPU address of MicroCode buffer */ | ||
327 | void *mcode_cpu; | ||
328 | /* List of all Channel threads */ | ||
329 | struct pl330_thread *channels; | ||
330 | /* Pointer to the MANAGER thread */ | ||
331 | struct pl330_thread *manager; | ||
332 | /* To handle bad news in interrupt */ | ||
333 | struct tasklet_struct tasks; | ||
334 | struct _pl330_tbd dmac_tbd; | ||
335 | /* State of DMAC operation */ | ||
336 | enum pl330_dmac_state state; | ||
337 | }; | ||
338 | |||
339 | static inline void _callback(struct pl330_req *r, enum pl330_op_err err) | ||
340 | { | ||
341 | if (r && r->xfer_cb) | ||
342 | r->xfer_cb(r->token, err); | ||
343 | } | ||
344 | |||
345 | static inline bool _queue_empty(struct pl330_thread *thrd) | ||
346 | { | ||
347 | return (IS_FREE(&thrd->req[0]) && IS_FREE(&thrd->req[1])) | ||
348 | ? true : false; | ||
349 | } | ||
350 | |||
351 | static inline bool _queue_full(struct pl330_thread *thrd) | ||
352 | { | ||
353 | return (IS_FREE(&thrd->req[0]) || IS_FREE(&thrd->req[1])) | ||
354 | ? false : true; | ||
355 | } | ||
356 | |||
357 | static inline bool is_manager(struct pl330_thread *thrd) | ||
358 | { | ||
359 | struct pl330_dmac *pl330 = thrd->dmac; | ||
360 | |||
361 | /* MANAGER is indexed at the end */ | ||
362 | if (thrd->id == pl330->pinfo->pcfg.num_chan) | ||
363 | return true; | ||
364 | else | ||
365 | return false; | ||
366 | } | ||
367 | |||
368 | /* If manager of the thread is in Non-Secure mode */ | ||
369 | static inline bool _manager_ns(struct pl330_thread *thrd) | ||
370 | { | ||
371 | struct pl330_dmac *pl330 = thrd->dmac; | ||
372 | |||
373 | return (pl330->pinfo->pcfg.mode & DMAC_MODE_NS) ? true : false; | ||
374 | } | ||
375 | |||
376 | static inline u32 get_id(struct pl330_info *pi, u32 off) | ||
377 | { | ||
378 | void __iomem *regs = pi->base; | ||
379 | u32 id = 0; | ||
380 | |||
381 | id |= (readb(regs + off + 0x0) << 0); | ||
382 | id |= (readb(regs + off + 0x4) << 8); | ||
383 | id |= (readb(regs + off + 0x8) << 16); | ||
384 | id |= (readb(regs + off + 0xc) << 24); | ||
385 | |||
386 | return id; | ||
387 | } | ||
388 | |||
389 | static inline u32 _emit_ADDH(unsigned dry_run, u8 buf[], | ||
390 | enum pl330_dst da, u16 val) | ||
391 | { | ||
392 | if (dry_run) | ||
393 | return SZ_DMAADDH; | ||
394 | |||
395 | buf[0] = CMD_DMAADDH; | ||
396 | buf[0] |= (da << 1); | ||
397 | *((u16 *)&buf[1]) = val; | ||
398 | |||
399 | PL330_DBGCMD_DUMP(SZ_DMAADDH, "\tDMAADDH %s %u\n", | ||
400 | da == 1 ? "DA" : "SA", val); | ||
401 | |||
402 | return SZ_DMAADDH; | ||
403 | } | ||
404 | |||
405 | static inline u32 _emit_END(unsigned dry_run, u8 buf[]) | ||
406 | { | ||
407 | if (dry_run) | ||
408 | return SZ_DMAEND; | ||
409 | |||
410 | buf[0] = CMD_DMAEND; | ||
411 | |||
412 | PL330_DBGCMD_DUMP(SZ_DMAEND, "\tDMAEND\n"); | ||
413 | |||
414 | return SZ_DMAEND; | ||
415 | } | ||
416 | |||
417 | static inline u32 _emit_FLUSHP(unsigned dry_run, u8 buf[], u8 peri) | ||
418 | { | ||
419 | if (dry_run) | ||
420 | return SZ_DMAFLUSHP; | ||
421 | |||
422 | buf[0] = CMD_DMAFLUSHP; | ||
423 | |||
424 | peri &= 0x1f; | ||
425 | peri <<= 3; | ||
426 | buf[1] = peri; | ||
427 | |||
428 | PL330_DBGCMD_DUMP(SZ_DMAFLUSHP, "\tDMAFLUSHP %u\n", peri >> 3); | ||
429 | |||
430 | return SZ_DMAFLUSHP; | ||
431 | } | ||
432 | |||
433 | static inline u32 _emit_LD(unsigned dry_run, u8 buf[], enum pl330_cond cond) | ||
434 | { | ||
435 | if (dry_run) | ||
436 | return SZ_DMALD; | ||
437 | |||
438 | buf[0] = CMD_DMALD; | ||
439 | |||
440 | if (cond == SINGLE) | ||
441 | buf[0] |= (0 << 1) | (1 << 0); | ||
442 | else if (cond == BURST) | ||
443 | buf[0] |= (1 << 1) | (1 << 0); | ||
444 | |||
445 | PL330_DBGCMD_DUMP(SZ_DMALD, "\tDMALD%c\n", | ||
446 | cond == SINGLE ? 'S' : (cond == BURST ? 'B' : 'A')); | ||
447 | |||
448 | return SZ_DMALD; | ||
449 | } | ||
450 | |||
451 | static inline u32 _emit_LDP(unsigned dry_run, u8 buf[], | ||
452 | enum pl330_cond cond, u8 peri) | ||
453 | { | ||
454 | if (dry_run) | ||
455 | return SZ_DMALDP; | ||
456 | |||
457 | buf[0] = CMD_DMALDP; | ||
458 | |||
459 | if (cond == BURST) | ||
460 | buf[0] |= (1 << 1); | ||
461 | |||
462 | peri &= 0x1f; | ||
463 | peri <<= 3; | ||
464 | buf[1] = peri; | ||
465 | |||
466 | PL330_DBGCMD_DUMP(SZ_DMALDP, "\tDMALDP%c %u\n", | ||
467 | cond == SINGLE ? 'S' : 'B', peri >> 3); | ||
468 | |||
469 | return SZ_DMALDP; | ||
470 | } | ||
471 | |||
472 | static inline u32 _emit_LP(unsigned dry_run, u8 buf[], | ||
473 | unsigned loop, u8 cnt) | ||
474 | { | ||
475 | if (dry_run) | ||
476 | return SZ_DMALP; | ||
477 | |||
478 | buf[0] = CMD_DMALP; | ||
479 | |||
480 | if (loop) | ||
481 | buf[0] |= (1 << 1); | ||
482 | |||
483 | cnt--; /* DMAC increments by 1 internally */ | ||
484 | buf[1] = cnt; | ||
485 | |||
486 | PL330_DBGCMD_DUMP(SZ_DMALP, "\tDMALP_%c %u\n", loop ? '1' : '0', cnt); | ||
487 | |||
488 | return SZ_DMALP; | ||
489 | } | ||
490 | |||
491 | struct _arg_LPEND { | ||
492 | enum pl330_cond cond; | ||
493 | bool forever; | ||
494 | unsigned loop; | ||
495 | u8 bjump; | ||
496 | }; | ||
497 | |||
498 | static inline u32 _emit_LPEND(unsigned dry_run, u8 buf[], | ||
499 | const struct _arg_LPEND *arg) | ||
500 | { | ||
501 | enum pl330_cond cond = arg->cond; | ||
502 | bool forever = arg->forever; | ||
503 | unsigned loop = arg->loop; | ||
504 | u8 bjump = arg->bjump; | ||
505 | |||
506 | if (dry_run) | ||
507 | return SZ_DMALPEND; | ||
508 | |||
509 | buf[0] = CMD_DMALPEND; | ||
510 | |||
511 | if (loop) | ||
512 | buf[0] |= (1 << 2); | ||
513 | |||
514 | if (!forever) | ||
515 | buf[0] |= (1 << 4); | ||
516 | |||
517 | if (cond == SINGLE) | ||
518 | buf[0] |= (0 << 1) | (1 << 0); | ||
519 | else if (cond == BURST) | ||
520 | buf[0] |= (1 << 1) | (1 << 0); | ||
521 | |||
522 | buf[1] = bjump; | ||
523 | |||
524 | PL330_DBGCMD_DUMP(SZ_DMALPEND, "\tDMALP%s%c_%c bjmpto_%x\n", | ||
525 | forever ? "FE" : "END", | ||
526 | cond == SINGLE ? 'S' : (cond == BURST ? 'B' : 'A'), | ||
527 | loop ? '1' : '0', | ||
528 | bjump); | ||
529 | |||
530 | return SZ_DMALPEND; | ||
531 | } | ||
532 | |||
533 | static inline u32 _emit_KILL(unsigned dry_run, u8 buf[]) | ||
534 | { | ||
535 | if (dry_run) | ||
536 | return SZ_DMAKILL; | ||
537 | |||
538 | buf[0] = CMD_DMAKILL; | ||
539 | |||
540 | return SZ_DMAKILL; | ||
541 | } | ||
542 | |||
543 | static inline u32 _emit_MOV(unsigned dry_run, u8 buf[], | ||
544 | enum dmamov_dst dst, u32 val) | ||
545 | { | ||
546 | if (dry_run) | ||
547 | return SZ_DMAMOV; | ||
548 | |||
549 | buf[0] = CMD_DMAMOV; | ||
550 | buf[1] = dst; | ||
551 | *((u32 *)&buf[2]) = val; | ||
552 | |||
553 | PL330_DBGCMD_DUMP(SZ_DMAMOV, "\tDMAMOV %s 0x%x\n", | ||
554 | dst == SAR ? "SAR" : (dst == DAR ? "DAR" : "CCR"), val); | ||
555 | |||
556 | return SZ_DMAMOV; | ||
557 | } | ||
558 | |||
559 | static inline u32 _emit_NOP(unsigned dry_run, u8 buf[]) | ||
560 | { | ||
561 | if (dry_run) | ||
562 | return SZ_DMANOP; | ||
563 | |||
564 | buf[0] = CMD_DMANOP; | ||
565 | |||
566 | PL330_DBGCMD_DUMP(SZ_DMANOP, "\tDMANOP\n"); | ||
567 | |||
568 | return SZ_DMANOP; | ||
569 | } | ||
570 | |||
571 | static inline u32 _emit_RMB(unsigned dry_run, u8 buf[]) | ||
572 | { | ||
573 | if (dry_run) | ||
574 | return SZ_DMARMB; | ||
575 | |||
576 | buf[0] = CMD_DMARMB; | ||
577 | |||
578 | PL330_DBGCMD_DUMP(SZ_DMARMB, "\tDMARMB\n"); | ||
579 | |||
580 | return SZ_DMARMB; | ||
581 | } | ||
582 | |||
583 | static inline u32 _emit_SEV(unsigned dry_run, u8 buf[], u8 ev) | ||
584 | { | ||
585 | if (dry_run) | ||
586 | return SZ_DMASEV; | ||
587 | |||
588 | buf[0] = CMD_DMASEV; | ||
589 | |||
590 | ev &= 0x1f; | ||
591 | ev <<= 3; | ||
592 | buf[1] = ev; | ||
593 | |||
594 | PL330_DBGCMD_DUMP(SZ_DMASEV, "\tDMASEV %u\n", ev >> 3); | ||
595 | |||
596 | return SZ_DMASEV; | ||
597 | } | ||
598 | |||
599 | static inline u32 _emit_ST(unsigned dry_run, u8 buf[], enum pl330_cond cond) | ||
600 | { | ||
601 | if (dry_run) | ||
602 | return SZ_DMAST; | ||
603 | |||
604 | buf[0] = CMD_DMAST; | ||
605 | |||
606 | if (cond == SINGLE) | ||
607 | buf[0] |= (0 << 1) | (1 << 0); | ||
608 | else if (cond == BURST) | ||
609 | buf[0] |= (1 << 1) | (1 << 0); | ||
610 | |||
611 | PL330_DBGCMD_DUMP(SZ_DMAST, "\tDMAST%c\n", | ||
612 | cond == SINGLE ? 'S' : (cond == BURST ? 'B' : 'A')); | ||
613 | |||
614 | return SZ_DMAST; | ||
615 | } | ||
616 | |||
617 | static inline u32 _emit_STP(unsigned dry_run, u8 buf[], | ||
618 | enum pl330_cond cond, u8 peri) | ||
619 | { | ||
620 | if (dry_run) | ||
621 | return SZ_DMASTP; | ||
622 | |||
623 | buf[0] = CMD_DMASTP; | ||
624 | |||
625 | if (cond == BURST) | ||
626 | buf[0] |= (1 << 1); | ||
627 | |||
628 | peri &= 0x1f; | ||
629 | peri <<= 3; | ||
630 | buf[1] = peri; | ||
631 | |||
632 | PL330_DBGCMD_DUMP(SZ_DMASTP, "\tDMASTP%c %u\n", | ||
633 | cond == SINGLE ? 'S' : 'B', peri >> 3); | ||
634 | |||
635 | return SZ_DMASTP; | ||
636 | } | ||
637 | |||
638 | static inline u32 _emit_STZ(unsigned dry_run, u8 buf[]) | ||
639 | { | ||
640 | if (dry_run) | ||
641 | return SZ_DMASTZ; | ||
642 | |||
643 | buf[0] = CMD_DMASTZ; | ||
644 | |||
645 | PL330_DBGCMD_DUMP(SZ_DMASTZ, "\tDMASTZ\n"); | ||
646 | |||
647 | return SZ_DMASTZ; | ||
648 | } | ||
649 | |||
650 | static inline u32 _emit_WFE(unsigned dry_run, u8 buf[], u8 ev, | ||
651 | unsigned invalidate) | ||
652 | { | ||
653 | if (dry_run) | ||
654 | return SZ_DMAWFE; | ||
655 | |||
656 | buf[0] = CMD_DMAWFE; | ||
657 | |||
658 | ev &= 0x1f; | ||
659 | ev <<= 3; | ||
660 | buf[1] = ev; | ||
661 | |||
662 | if (invalidate) | ||
663 | buf[1] |= (1 << 1); | ||
664 | |||
665 | PL330_DBGCMD_DUMP(SZ_DMAWFE, "\tDMAWFE %u%s\n", | ||
666 | ev >> 3, invalidate ? ", I" : ""); | ||
667 | |||
668 | return SZ_DMAWFE; | ||
669 | } | ||
670 | |||
671 | static inline u32 _emit_WFP(unsigned dry_run, u8 buf[], | ||
672 | enum pl330_cond cond, u8 peri) | ||
673 | { | ||
674 | if (dry_run) | ||
675 | return SZ_DMAWFP; | ||
676 | |||
677 | buf[0] = CMD_DMAWFP; | ||
678 | |||
679 | if (cond == SINGLE) | ||
680 | buf[0] |= (0 << 1) | (0 << 0); | ||
681 | else if (cond == BURST) | ||
682 | buf[0] |= (1 << 1) | (0 << 0); | ||
683 | else | ||
684 | buf[0] |= (0 << 1) | (1 << 0); | ||
685 | |||
686 | peri &= 0x1f; | ||
687 | peri <<= 3; | ||
688 | buf[1] = peri; | ||
689 | |||
690 | PL330_DBGCMD_DUMP(SZ_DMAWFP, "\tDMAWFP%c %u\n", | ||
691 | cond == SINGLE ? 'S' : (cond == BURST ? 'B' : 'P'), peri >> 3); | ||
692 | |||
693 | return SZ_DMAWFP; | ||
694 | } | ||
695 | |||
696 | static inline u32 _emit_WMB(unsigned dry_run, u8 buf[]) | ||
697 | { | ||
698 | if (dry_run) | ||
699 | return SZ_DMAWMB; | ||
700 | |||
701 | buf[0] = CMD_DMAWMB; | ||
702 | |||
703 | PL330_DBGCMD_DUMP(SZ_DMAWMB, "\tDMAWMB\n"); | ||
704 | |||
705 | return SZ_DMAWMB; | ||
706 | } | ||
707 | |||
708 | struct _arg_GO { | ||
709 | u8 chan; | ||
710 | u32 addr; | ||
711 | unsigned ns; | ||
712 | }; | ||
713 | |||
714 | static inline u32 _emit_GO(unsigned dry_run, u8 buf[], | ||
715 | const struct _arg_GO *arg) | ||
716 | { | ||
717 | u8 chan = arg->chan; | ||
718 | u32 addr = arg->addr; | ||
719 | unsigned ns = arg->ns; | ||
720 | |||
721 | if (dry_run) | ||
722 | return SZ_DMAGO; | ||
723 | |||
724 | buf[0] = CMD_DMAGO; | ||
725 | buf[0] |= (ns << 1); | ||
726 | |||
727 | buf[1] = chan & 0x7; | ||
728 | |||
729 | *((u32 *)&buf[2]) = addr; | ||
730 | |||
731 | return SZ_DMAGO; | ||
732 | } | ||
733 | |||
734 | #define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t) | ||
735 | |||
736 | /* Returns Time-Out */ | ||
737 | static bool _until_dmac_idle(struct pl330_thread *thrd) | ||
738 | { | ||
739 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
740 | unsigned long loops = msecs_to_loops(5); | ||
741 | |||
742 | do { | ||
743 | /* Until Manager is Idle */ | ||
744 | if (!(readl(regs + DBGSTATUS) & DBG_BUSY)) | ||
745 | break; | ||
746 | |||
747 | cpu_relax(); | ||
748 | } while (--loops); | ||
749 | |||
750 | if (!loops) | ||
751 | return true; | ||
752 | |||
753 | return false; | ||
754 | } | ||
755 | |||
756 | static inline void _execute_DBGINSN(struct pl330_thread *thrd, | ||
757 | u8 insn[], bool as_manager) | ||
758 | { | ||
759 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
760 | u32 val; | ||
761 | |||
762 | val = (insn[0] << 16) | (insn[1] << 24); | ||
763 | if (!as_manager) { | ||
764 | val |= (1 << 0); | ||
765 | val |= (thrd->id << 8); /* Channel Number */ | ||
766 | } | ||
767 | writel(val, regs + DBGINST0); | ||
768 | |||
769 | val = *((u32 *)&insn[2]); | ||
770 | writel(val, regs + DBGINST1); | ||
771 | |||
772 | /* If timed out due to halted state-machine */ | ||
773 | if (_until_dmac_idle(thrd)) { | ||
774 | dev_err(thrd->dmac->pinfo->dev, "DMAC halted!\n"); | ||
775 | return; | ||
776 | } | ||
777 | |||
778 | /* Get going */ | ||
779 | writel(0, regs + DBGCMD); | ||
780 | } | ||
781 | |||
782 | static inline u32 _state(struct pl330_thread *thrd) | ||
783 | { | ||
784 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
785 | u32 val; | ||
786 | |||
787 | if (is_manager(thrd)) | ||
788 | val = readl(regs + DS) & 0xf; | ||
789 | else | ||
790 | val = readl(regs + CS(thrd->id)) & 0xf; | ||
791 | |||
792 | switch (val) { | ||
793 | case DS_ST_STOP: | ||
794 | return PL330_STATE_STOPPED; | ||
795 | case DS_ST_EXEC: | ||
796 | return PL330_STATE_EXECUTING; | ||
797 | case DS_ST_CMISS: | ||
798 | return PL330_STATE_CACHEMISS; | ||
799 | case DS_ST_UPDTPC: | ||
800 | return PL330_STATE_UPDTPC; | ||
801 | case DS_ST_WFE: | ||
802 | return PL330_STATE_WFE; | ||
803 | case DS_ST_FAULT: | ||
804 | return PL330_STATE_FAULTING; | ||
805 | case DS_ST_ATBRR: | ||
806 | if (is_manager(thrd)) | ||
807 | return PL330_STATE_INVALID; | ||
808 | else | ||
809 | return PL330_STATE_ATBARRIER; | ||
810 | case DS_ST_QBUSY: | ||
811 | if (is_manager(thrd)) | ||
812 | return PL330_STATE_INVALID; | ||
813 | else | ||
814 | return PL330_STATE_QUEUEBUSY; | ||
815 | case DS_ST_WFP: | ||
816 | if (is_manager(thrd)) | ||
817 | return PL330_STATE_INVALID; | ||
818 | else | ||
819 | return PL330_STATE_WFP; | ||
820 | case DS_ST_KILL: | ||
821 | if (is_manager(thrd)) | ||
822 | return PL330_STATE_INVALID; | ||
823 | else | ||
824 | return PL330_STATE_KILLING; | ||
825 | case DS_ST_CMPLT: | ||
826 | if (is_manager(thrd)) | ||
827 | return PL330_STATE_INVALID; | ||
828 | else | ||
829 | return PL330_STATE_COMPLETING; | ||
830 | case DS_ST_FLTCMP: | ||
831 | if (is_manager(thrd)) | ||
832 | return PL330_STATE_INVALID; | ||
833 | else | ||
834 | return PL330_STATE_FAULT_COMPLETING; | ||
835 | default: | ||
836 | return PL330_STATE_INVALID; | ||
837 | } | ||
838 | } | ||
839 | |||
840 | /* If the request 'req' of thread 'thrd' is currently active */ | ||
841 | static inline bool _req_active(struct pl330_thread *thrd, | ||
842 | struct _pl330_req *req) | ||
843 | { | ||
844 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
845 | u32 buf = req->mc_bus, pc = readl(regs + CPC(thrd->id)); | ||
846 | |||
847 | if (IS_FREE(req)) | ||
848 | return false; | ||
849 | |||
850 | return (pc >= buf && pc <= buf + req->mc_len) ? true : false; | ||
851 | } | ||
852 | |||
853 | /* Returns 0 if the thread is inactive, ID of active req + 1 otherwise */ | ||
854 | static inline unsigned _thrd_active(struct pl330_thread *thrd) | ||
855 | { | ||
856 | if (_req_active(thrd, &thrd->req[0])) | ||
857 | return 1; /* First req active */ | ||
858 | |||
859 | if (_req_active(thrd, &thrd->req[1])) | ||
860 | return 2; /* Second req active */ | ||
861 | |||
862 | return 0; | ||
863 | } | ||
864 | |||
865 | static void _stop(struct pl330_thread *thrd) | ||
866 | { | ||
867 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
868 | u8 insn[6] = {0, 0, 0, 0, 0, 0}; | ||
869 | |||
870 | if (_state(thrd) == PL330_STATE_FAULT_COMPLETING) | ||
871 | UNTIL(thrd, PL330_STATE_FAULTING | PL330_STATE_KILLING); | ||
872 | |||
873 | /* Return if nothing needs to be done */ | ||
874 | if (_state(thrd) == PL330_STATE_COMPLETING | ||
875 | || _state(thrd) == PL330_STATE_KILLING | ||
876 | || _state(thrd) == PL330_STATE_STOPPED) | ||
877 | return; | ||
878 | |||
879 | _emit_KILL(0, insn); | ||
880 | |||
881 | /* Stop generating interrupts for SEV */ | ||
882 | writel(readl(regs + INTEN) & ~(1 << thrd->ev), regs + INTEN); | ||
883 | |||
884 | _execute_DBGINSN(thrd, insn, is_manager(thrd)); | ||
885 | } | ||
886 | |||
887 | /* Start doing req 'idx' of thread 'thrd' */ | ||
888 | static bool _trigger(struct pl330_thread *thrd) | ||
889 | { | ||
890 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
891 | struct _pl330_req *req; | ||
892 | struct pl330_req *r; | ||
893 | struct _arg_GO go; | ||
894 | unsigned ns; | ||
895 | u8 insn[6] = {0, 0, 0, 0, 0, 0}; | ||
896 | |||
897 | /* Return if already ACTIVE */ | ||
898 | if (_state(thrd) != PL330_STATE_STOPPED) | ||
899 | return true; | ||
900 | |||
901 | if (!IS_FREE(&thrd->req[1 - thrd->lstenq])) | ||
902 | req = &thrd->req[1 - thrd->lstenq]; | ||
903 | else if (!IS_FREE(&thrd->req[thrd->lstenq])) | ||
904 | req = &thrd->req[thrd->lstenq]; | ||
905 | else | ||
906 | req = NULL; | ||
907 | |||
908 | /* Return if no request */ | ||
909 | if (!req || !req->r) | ||
910 | return true; | ||
911 | |||
912 | r = req->r; | ||
913 | |||
914 | if (r->cfg) | ||
915 | ns = r->cfg->nonsecure ? 1 : 0; | ||
916 | else if (readl(regs + CS(thrd->id)) & CS_CNS) | ||
917 | ns = 1; | ||
918 | else | ||
919 | ns = 0; | ||
920 | |||
921 | /* See 'Abort Sources' point-4 at Page 2-25 */ | ||
922 | if (_manager_ns(thrd) && !ns) | ||
923 | dev_info(thrd->dmac->pinfo->dev, "%s:%d Recipe for ABORT!\n", | ||
924 | __func__, __LINE__); | ||
925 | |||
926 | go.chan = thrd->id; | ||
927 | go.addr = req->mc_bus; | ||
928 | go.ns = ns; | ||
929 | _emit_GO(0, insn, &go); | ||
930 | |||
931 | /* Set to generate interrupts for SEV */ | ||
932 | writel(readl(regs + INTEN) | (1 << thrd->ev), regs + INTEN); | ||
933 | |||
934 | /* Only manager can execute GO */ | ||
935 | _execute_DBGINSN(thrd, insn, true); | ||
936 | |||
937 | return true; | ||
938 | } | ||
939 | |||
940 | static bool _start(struct pl330_thread *thrd) | ||
941 | { | ||
942 | switch (_state(thrd)) { | ||
943 | case PL330_STATE_FAULT_COMPLETING: | ||
944 | UNTIL(thrd, PL330_STATE_FAULTING | PL330_STATE_KILLING); | ||
945 | |||
946 | if (_state(thrd) == PL330_STATE_KILLING) | ||
947 | UNTIL(thrd, PL330_STATE_STOPPED) | ||
948 | |||
949 | case PL330_STATE_FAULTING: | ||
950 | _stop(thrd); | ||
951 | |||
952 | case PL330_STATE_KILLING: | ||
953 | case PL330_STATE_COMPLETING: | ||
954 | UNTIL(thrd, PL330_STATE_STOPPED) | ||
955 | |||
956 | case PL330_STATE_STOPPED: | ||
957 | return _trigger(thrd); | ||
958 | |||
959 | case PL330_STATE_WFP: | ||
960 | case PL330_STATE_QUEUEBUSY: | ||
961 | case PL330_STATE_ATBARRIER: | ||
962 | case PL330_STATE_UPDTPC: | ||
963 | case PL330_STATE_CACHEMISS: | ||
964 | case PL330_STATE_EXECUTING: | ||
965 | return true; | ||
966 | |||
967 | case PL330_STATE_WFE: /* For RESUME, nothing yet */ | ||
968 | default: | ||
969 | return false; | ||
970 | } | ||
971 | } | ||
972 | |||
973 | static inline int _ldst_memtomem(unsigned dry_run, u8 buf[], | ||
974 | const struct _xfer_spec *pxs, int cyc) | ||
975 | { | ||
976 | int off = 0; | ||
977 | |||
978 | while (cyc--) { | ||
979 | off += _emit_LD(dry_run, &buf[off], ALWAYS); | ||
980 | off += _emit_RMB(dry_run, &buf[off]); | ||
981 | off += _emit_ST(dry_run, &buf[off], ALWAYS); | ||
982 | off += _emit_WMB(dry_run, &buf[off]); | ||
983 | } | ||
984 | |||
985 | return off; | ||
986 | } | ||
987 | |||
988 | static inline int _ldst_devtomem(unsigned dry_run, u8 buf[], | ||
989 | const struct _xfer_spec *pxs, int cyc) | ||
990 | { | ||
991 | int off = 0; | ||
992 | |||
993 | while (cyc--) { | ||
994 | off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->r->peri); | ||
995 | off += _emit_LDP(dry_run, &buf[off], SINGLE, pxs->r->peri); | ||
996 | off += _emit_ST(dry_run, &buf[off], ALWAYS); | ||
997 | off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); | ||
998 | } | ||
999 | |||
1000 | return off; | ||
1001 | } | ||
1002 | |||
1003 | static inline int _ldst_memtodev(unsigned dry_run, u8 buf[], | ||
1004 | const struct _xfer_spec *pxs, int cyc) | ||
1005 | { | ||
1006 | int off = 0; | ||
1007 | |||
1008 | while (cyc--) { | ||
1009 | off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->r->peri); | ||
1010 | off += _emit_LD(dry_run, &buf[off], ALWAYS); | ||
1011 | off += _emit_STP(dry_run, &buf[off], SINGLE, pxs->r->peri); | ||
1012 | off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); | ||
1013 | } | ||
1014 | |||
1015 | return off; | ||
1016 | } | ||
1017 | |||
1018 | static int _bursts(unsigned dry_run, u8 buf[], | ||
1019 | const struct _xfer_spec *pxs, int cyc) | ||
1020 | { | ||
1021 | int off = 0; | ||
1022 | |||
1023 | switch (pxs->r->rqtype) { | ||
1024 | case MEMTODEV: | ||
1025 | off += _ldst_memtodev(dry_run, &buf[off], pxs, cyc); | ||
1026 | break; | ||
1027 | case DEVTOMEM: | ||
1028 | off += _ldst_devtomem(dry_run, &buf[off], pxs, cyc); | ||
1029 | break; | ||
1030 | case MEMTOMEM: | ||
1031 | off += _ldst_memtomem(dry_run, &buf[off], pxs, cyc); | ||
1032 | break; | ||
1033 | default: | ||
1034 | off += 0x40000000; /* Scare off the Client */ | ||
1035 | break; | ||
1036 | } | ||
1037 | |||
1038 | return off; | ||
1039 | } | ||
1040 | |||
1041 | /* Returns bytes consumed and updates bursts */ | ||
1042 | static inline int _loop(unsigned dry_run, u8 buf[], | ||
1043 | unsigned long *bursts, const struct _xfer_spec *pxs) | ||
1044 | { | ||
1045 | int cyc, cycmax, szlp, szlpend, szbrst, off; | ||
1046 | unsigned lcnt0, lcnt1, ljmp0, ljmp1; | ||
1047 | struct _arg_LPEND lpend; | ||
1048 | |||
1049 | /* Max iterations possibile in DMALP is 256 */ | ||
1050 | if (*bursts >= 256*256) { | ||
1051 | lcnt1 = 256; | ||
1052 | lcnt0 = 256; | ||
1053 | cyc = *bursts / lcnt1 / lcnt0; | ||
1054 | } else if (*bursts > 256) { | ||
1055 | lcnt1 = 256; | ||
1056 | lcnt0 = *bursts / lcnt1; | ||
1057 | cyc = 1; | ||
1058 | } else { | ||
1059 | lcnt1 = *bursts; | ||
1060 | lcnt0 = 0; | ||
1061 | cyc = 1; | ||
1062 | } | ||
1063 | |||
1064 | szlp = _emit_LP(1, buf, 0, 0); | ||
1065 | szbrst = _bursts(1, buf, pxs, 1); | ||
1066 | |||
1067 | lpend.cond = ALWAYS; | ||
1068 | lpend.forever = false; | ||
1069 | lpend.loop = 0; | ||
1070 | lpend.bjump = 0; | ||
1071 | szlpend = _emit_LPEND(1, buf, &lpend); | ||
1072 | |||
1073 | if (lcnt0) { | ||
1074 | szlp *= 2; | ||
1075 | szlpend *= 2; | ||
1076 | } | ||
1077 | |||
1078 | /* | ||
1079 | * Max bursts that we can unroll due to limit on the | ||
1080 | * size of backward jump that can be encoded in DMALPEND | ||
1081 | * which is 8-bits and hence 255 | ||
1082 | */ | ||
1083 | cycmax = (255 - (szlp + szlpend)) / szbrst; | ||
1084 | |||
1085 | cyc = (cycmax < cyc) ? cycmax : cyc; | ||
1086 | |||
1087 | off = 0; | ||
1088 | |||
1089 | if (lcnt0) { | ||
1090 | off += _emit_LP(dry_run, &buf[off], 0, lcnt0); | ||
1091 | ljmp0 = off; | ||
1092 | } | ||
1093 | |||
1094 | off += _emit_LP(dry_run, &buf[off], 1, lcnt1); | ||
1095 | ljmp1 = off; | ||
1096 | |||
1097 | off += _bursts(dry_run, &buf[off], pxs, cyc); | ||
1098 | |||
1099 | lpend.cond = ALWAYS; | ||
1100 | lpend.forever = false; | ||
1101 | lpend.loop = 1; | ||
1102 | lpend.bjump = off - ljmp1; | ||
1103 | off += _emit_LPEND(dry_run, &buf[off], &lpend); | ||
1104 | |||
1105 | if (lcnt0) { | ||
1106 | lpend.cond = ALWAYS; | ||
1107 | lpend.forever = false; | ||
1108 | lpend.loop = 0; | ||
1109 | lpend.bjump = off - ljmp0; | ||
1110 | off += _emit_LPEND(dry_run, &buf[off], &lpend); | ||
1111 | } | ||
1112 | |||
1113 | *bursts = lcnt1 * cyc; | ||
1114 | if (lcnt0) | ||
1115 | *bursts *= lcnt0; | ||
1116 | |||
1117 | return off; | ||
1118 | } | ||
1119 | |||
1120 | static inline int _setup_loops(unsigned dry_run, u8 buf[], | ||
1121 | const struct _xfer_spec *pxs) | ||
1122 | { | ||
1123 | struct pl330_xfer *x = pxs->x; | ||
1124 | u32 ccr = pxs->ccr; | ||
1125 | unsigned long c, bursts = BYTE_TO_BURST(x->bytes, ccr); | ||
1126 | int off = 0; | ||
1127 | |||
1128 | while (bursts) { | ||
1129 | c = bursts; | ||
1130 | off += _loop(dry_run, &buf[off], &c, pxs); | ||
1131 | bursts -= c; | ||
1132 | } | ||
1133 | |||
1134 | return off; | ||
1135 | } | ||
1136 | |||
1137 | static inline int _setup_xfer(unsigned dry_run, u8 buf[], | ||
1138 | const struct _xfer_spec *pxs) | ||
1139 | { | ||
1140 | struct pl330_xfer *x = pxs->x; | ||
1141 | int off = 0; | ||
1142 | |||
1143 | /* DMAMOV SAR, x->src_addr */ | ||
1144 | off += _emit_MOV(dry_run, &buf[off], SAR, x->src_addr); | ||
1145 | /* DMAMOV DAR, x->dst_addr */ | ||
1146 | off += _emit_MOV(dry_run, &buf[off], DAR, x->dst_addr); | ||
1147 | |||
1148 | /* Setup Loop(s) */ | ||
1149 | off += _setup_loops(dry_run, &buf[off], pxs); | ||
1150 | |||
1151 | return off; | ||
1152 | } | ||
1153 | |||
1154 | /* | ||
1155 | * A req is a sequence of one or more xfer units. | ||
1156 | * Returns the number of bytes taken to setup the MC for the req. | ||
1157 | */ | ||
1158 | static int _setup_req(unsigned dry_run, struct pl330_thread *thrd, | ||
1159 | unsigned index, struct _xfer_spec *pxs) | ||
1160 | { | ||
1161 | struct _pl330_req *req = &thrd->req[index]; | ||
1162 | struct pl330_xfer *x; | ||
1163 | u8 *buf = req->mc_cpu; | ||
1164 | int off = 0; | ||
1165 | |||
1166 | PL330_DBGMC_START(req->mc_bus); | ||
1167 | |||
1168 | /* DMAMOV CCR, ccr */ | ||
1169 | off += _emit_MOV(dry_run, &buf[off], CCR, pxs->ccr); | ||
1170 | |||
1171 | x = pxs->r->x; | ||
1172 | do { | ||
1173 | /* Error if xfer length is not aligned at burst size */ | ||
1174 | if (x->bytes % (BRST_SIZE(pxs->ccr) * BRST_LEN(pxs->ccr))) | ||
1175 | return -EINVAL; | ||
1176 | |||
1177 | pxs->x = x; | ||
1178 | off += _setup_xfer(dry_run, &buf[off], pxs); | ||
1179 | |||
1180 | x = x->next; | ||
1181 | } while (x); | ||
1182 | |||
1183 | /* DMASEV peripheral/event */ | ||
1184 | off += _emit_SEV(dry_run, &buf[off], thrd->ev); | ||
1185 | /* DMAEND */ | ||
1186 | off += _emit_END(dry_run, &buf[off]); | ||
1187 | |||
1188 | return off; | ||
1189 | } | ||
1190 | |||
1191 | static inline u32 _prepare_ccr(const struct pl330_reqcfg *rqc) | ||
1192 | { | ||
1193 | u32 ccr = 0; | ||
1194 | |||
1195 | if (rqc->src_inc) | ||
1196 | ccr |= CC_SRCINC; | ||
1197 | |||
1198 | if (rqc->dst_inc) | ||
1199 | ccr |= CC_DSTINC; | ||
1200 | |||
1201 | /* We set same protection levels for Src and DST for now */ | ||
1202 | if (rqc->privileged) | ||
1203 | ccr |= CC_SRCPRI | CC_DSTPRI; | ||
1204 | if (rqc->nonsecure) | ||
1205 | ccr |= CC_SRCNS | CC_DSTNS; | ||
1206 | if (rqc->insnaccess) | ||
1207 | ccr |= CC_SRCIA | CC_DSTIA; | ||
1208 | |||
1209 | ccr |= (((rqc->brst_len - 1) & 0xf) << CC_SRCBRSTLEN_SHFT); | ||
1210 | ccr |= (((rqc->brst_len - 1) & 0xf) << CC_DSTBRSTLEN_SHFT); | ||
1211 | |||
1212 | ccr |= (rqc->brst_size << CC_SRCBRSTSIZE_SHFT); | ||
1213 | ccr |= (rqc->brst_size << CC_DSTBRSTSIZE_SHFT); | ||
1214 | |||
1215 | ccr |= (rqc->dcctl << CC_SRCCCTRL_SHFT); | ||
1216 | ccr |= (rqc->scctl << CC_DSTCCTRL_SHFT); | ||
1217 | |||
1218 | ccr |= (rqc->swap << CC_SWAP_SHFT); | ||
1219 | |||
1220 | return ccr; | ||
1221 | } | ||
1222 | |||
1223 | static inline bool _is_valid(u32 ccr) | ||
1224 | { | ||
1225 | enum pl330_dstcachectrl dcctl; | ||
1226 | enum pl330_srccachectrl scctl; | ||
1227 | |||
1228 | dcctl = (ccr >> CC_DSTCCTRL_SHFT) & CC_DRCCCTRL_MASK; | ||
1229 | scctl = (ccr >> CC_SRCCCTRL_SHFT) & CC_SRCCCTRL_MASK; | ||
1230 | |||
1231 | if (dcctl == DINVALID1 || dcctl == DINVALID2 | ||
1232 | || scctl == SINVALID1 || scctl == SINVALID2) | ||
1233 | return false; | ||
1234 | else | ||
1235 | return true; | ||
1236 | } | ||
1237 | |||
1238 | /* | ||
1239 | * Submit a list of xfers after which the client wants notification. | ||
1240 | * Client is not notified after each xfer unit, just once after all | ||
1241 | * xfer units are done or some error occurs. | ||
1242 | */ | ||
1243 | int pl330_submit_req(void *ch_id, struct pl330_req *r) | ||
1244 | { | ||
1245 | struct pl330_thread *thrd = ch_id; | ||
1246 | struct pl330_dmac *pl330; | ||
1247 | struct pl330_info *pi; | ||
1248 | struct _xfer_spec xs; | ||
1249 | unsigned long flags; | ||
1250 | void __iomem *regs; | ||
1251 | unsigned idx; | ||
1252 | u32 ccr; | ||
1253 | int ret = 0; | ||
1254 | |||
1255 | /* No Req or Unacquired Channel or DMAC */ | ||
1256 | if (!r || !thrd || thrd->free) | ||
1257 | return -EINVAL; | ||
1258 | |||
1259 | pl330 = thrd->dmac; | ||
1260 | pi = pl330->pinfo; | ||
1261 | regs = pi->base; | ||
1262 | |||
1263 | if (pl330->state == DYING | ||
1264 | || pl330->dmac_tbd.reset_chan & (1 << thrd->id)) { | ||
1265 | dev_info(thrd->dmac->pinfo->dev, "%s:%d\n", | ||
1266 | __func__, __LINE__); | ||
1267 | return -EAGAIN; | ||
1268 | } | ||
1269 | |||
1270 | /* If request for non-existing peripheral */ | ||
1271 | if (r->rqtype != MEMTOMEM && r->peri >= pi->pcfg.num_peri) { | ||
1272 | dev_info(thrd->dmac->pinfo->dev, | ||
1273 | "%s:%d Invalid peripheral(%u)!\n", | ||
1274 | __func__, __LINE__, r->peri); | ||
1275 | return -EINVAL; | ||
1276 | } | ||
1277 | |||
1278 | spin_lock_irqsave(&pl330->lock, flags); | ||
1279 | |||
1280 | if (_queue_full(thrd)) { | ||
1281 | ret = -EAGAIN; | ||
1282 | goto xfer_exit; | ||
1283 | } | ||
1284 | |||
1285 | /* Prefer Secure Channel */ | ||
1286 | if (!_manager_ns(thrd)) | ||
1287 | r->cfg->nonsecure = 0; | ||
1288 | else | ||
1289 | r->cfg->nonsecure = 1; | ||
1290 | |||
1291 | /* Use last settings, if not provided */ | ||
1292 | if (r->cfg) | ||
1293 | ccr = _prepare_ccr(r->cfg); | ||
1294 | else | ||
1295 | ccr = readl(regs + CC(thrd->id)); | ||
1296 | |||
1297 | /* If this req doesn't have valid xfer settings */ | ||
1298 | if (!_is_valid(ccr)) { | ||
1299 | ret = -EINVAL; | ||
1300 | dev_info(thrd->dmac->pinfo->dev, "%s:%d Invalid CCR(%x)!\n", | ||
1301 | __func__, __LINE__, ccr); | ||
1302 | goto xfer_exit; | ||
1303 | } | ||
1304 | |||
1305 | idx = IS_FREE(&thrd->req[0]) ? 0 : 1; | ||
1306 | |||
1307 | xs.ccr = ccr; | ||
1308 | xs.r = r; | ||
1309 | |||
1310 | /* First dry run to check if req is acceptable */ | ||
1311 | ret = _setup_req(1, thrd, idx, &xs); | ||
1312 | if (ret < 0) | ||
1313 | goto xfer_exit; | ||
1314 | |||
1315 | if (ret > pi->mcbufsz / 2) { | ||
1316 | dev_info(thrd->dmac->pinfo->dev, | ||
1317 | "%s:%d Trying increasing mcbufsz\n", | ||
1318 | __func__, __LINE__); | ||
1319 | ret = -ENOMEM; | ||
1320 | goto xfer_exit; | ||
1321 | } | ||
1322 | |||
1323 | /* Hook the request */ | ||
1324 | thrd->lstenq = idx; | ||
1325 | thrd->req[idx].mc_len = _setup_req(0, thrd, idx, &xs); | ||
1326 | thrd->req[idx].r = r; | ||
1327 | |||
1328 | ret = 0; | ||
1329 | |||
1330 | xfer_exit: | ||
1331 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
1332 | |||
1333 | return ret; | ||
1334 | } | ||
1335 | EXPORT_SYMBOL(pl330_submit_req); | ||
1336 | |||
1337 | static void pl330_dotask(unsigned long data) | ||
1338 | { | ||
1339 | struct pl330_dmac *pl330 = (struct pl330_dmac *) data; | ||
1340 | struct pl330_info *pi = pl330->pinfo; | ||
1341 | unsigned long flags; | ||
1342 | int i; | ||
1343 | |||
1344 | spin_lock_irqsave(&pl330->lock, flags); | ||
1345 | |||
1346 | /* The DMAC itself gone nuts */ | ||
1347 | if (pl330->dmac_tbd.reset_dmac) { | ||
1348 | pl330->state = DYING; | ||
1349 | /* Reset the manager too */ | ||
1350 | pl330->dmac_tbd.reset_mngr = true; | ||
1351 | /* Clear the reset flag */ | ||
1352 | pl330->dmac_tbd.reset_dmac = false; | ||
1353 | } | ||
1354 | |||
1355 | if (pl330->dmac_tbd.reset_mngr) { | ||
1356 | _stop(pl330->manager); | ||
1357 | /* Reset all channels */ | ||
1358 | pl330->dmac_tbd.reset_chan = (1 << pi->pcfg.num_chan) - 1; | ||
1359 | /* Clear the reset flag */ | ||
1360 | pl330->dmac_tbd.reset_mngr = false; | ||
1361 | } | ||
1362 | |||
1363 | for (i = 0; i < pi->pcfg.num_chan; i++) { | ||
1364 | |||
1365 | if (pl330->dmac_tbd.reset_chan & (1 << i)) { | ||
1366 | struct pl330_thread *thrd = &pl330->channels[i]; | ||
1367 | void __iomem *regs = pi->base; | ||
1368 | enum pl330_op_err err; | ||
1369 | |||
1370 | _stop(thrd); | ||
1371 | |||
1372 | if (readl(regs + FSC) & (1 << thrd->id)) | ||
1373 | err = PL330_ERR_FAIL; | ||
1374 | else | ||
1375 | err = PL330_ERR_ABORT; | ||
1376 | |||
1377 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
1378 | |||
1379 | _callback(thrd->req[1 - thrd->lstenq].r, err); | ||
1380 | _callback(thrd->req[thrd->lstenq].r, err); | ||
1381 | |||
1382 | spin_lock_irqsave(&pl330->lock, flags); | ||
1383 | |||
1384 | thrd->req[0].r = NULL; | ||
1385 | thrd->req[1].r = NULL; | ||
1386 | MARK_FREE(&thrd->req[0]); | ||
1387 | MARK_FREE(&thrd->req[1]); | ||
1388 | |||
1389 | /* Clear the reset flag */ | ||
1390 | pl330->dmac_tbd.reset_chan &= ~(1 << i); | ||
1391 | } | ||
1392 | } | ||
1393 | |||
1394 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
1395 | |||
1396 | return; | ||
1397 | } | ||
1398 | |||
1399 | /* Returns 1 if state was updated, 0 otherwise */ | ||
1400 | int pl330_update(const struct pl330_info *pi) | ||
1401 | { | ||
1402 | struct _pl330_req *rqdone; | ||
1403 | struct pl330_dmac *pl330; | ||
1404 | unsigned long flags; | ||
1405 | void __iomem *regs; | ||
1406 | u32 val; | ||
1407 | int id, ev, ret = 0; | ||
1408 | |||
1409 | if (!pi || !pi->pl330_data) | ||
1410 | return 0; | ||
1411 | |||
1412 | regs = pi->base; | ||
1413 | pl330 = pi->pl330_data; | ||
1414 | |||
1415 | spin_lock_irqsave(&pl330->lock, flags); | ||
1416 | |||
1417 | val = readl(regs + FSM) & 0x1; | ||
1418 | if (val) | ||
1419 | pl330->dmac_tbd.reset_mngr = true; | ||
1420 | else | ||
1421 | pl330->dmac_tbd.reset_mngr = false; | ||
1422 | |||
1423 | val = readl(regs + FSC) & ((1 << pi->pcfg.num_chan) - 1); | ||
1424 | pl330->dmac_tbd.reset_chan |= val; | ||
1425 | if (val) { | ||
1426 | int i = 0; | ||
1427 | while (i < pi->pcfg.num_chan) { | ||
1428 | if (val & (1 << i)) { | ||
1429 | dev_info(pi->dev, | ||
1430 | "Reset Channel-%d\t CS-%x FTC-%x\n", | ||
1431 | i, readl(regs + CS(i)), | ||
1432 | readl(regs + FTC(i))); | ||
1433 | _stop(&pl330->channels[i]); | ||
1434 | } | ||
1435 | i++; | ||
1436 | } | ||
1437 | } | ||
1438 | |||
1439 | /* Check which event happened i.e, thread notified */ | ||
1440 | val = readl(regs + ES); | ||
1441 | if (pi->pcfg.num_events < 32 | ||
1442 | && val & ~((1 << pi->pcfg.num_events) - 1)) { | ||
1443 | pl330->dmac_tbd.reset_dmac = true; | ||
1444 | dev_err(pi->dev, "%s:%d Unexpected!\n", __func__, __LINE__); | ||
1445 | ret = 1; | ||
1446 | goto updt_exit; | ||
1447 | } | ||
1448 | |||
1449 | for (ev = 0; ev < pi->pcfg.num_events; ev++) { | ||
1450 | if (val & (1 << ev)) { /* Event occured */ | ||
1451 | struct pl330_thread *thrd; | ||
1452 | u32 inten = readl(regs + INTEN); | ||
1453 | int active; | ||
1454 | |||
1455 | /* Clear the event */ | ||
1456 | if (inten & (1 << ev)) | ||
1457 | writel(1 << ev, regs + INTCLR); | ||
1458 | |||
1459 | ret = 1; | ||
1460 | |||
1461 | id = pl330->events[ev]; | ||
1462 | |||
1463 | thrd = &pl330->channels[id]; | ||
1464 | |||
1465 | active = _thrd_active(thrd); | ||
1466 | if (!active) /* Aborted */ | ||
1467 | continue; | ||
1468 | |||
1469 | active -= 1; | ||
1470 | |||
1471 | rqdone = &thrd->req[active]; | ||
1472 | MARK_FREE(rqdone); | ||
1473 | |||
1474 | /* Get going again ASAP */ | ||
1475 | _start(thrd); | ||
1476 | |||
1477 | /* For now, just make a list of callbacks to be done */ | ||
1478 | list_add_tail(&rqdone->rqd, &pl330->req_done); | ||
1479 | } | ||
1480 | } | ||
1481 | |||
1482 | /* Now that we are in no hurry, do the callbacks */ | ||
1483 | while (!list_empty(&pl330->req_done)) { | ||
1484 | rqdone = container_of(pl330->req_done.next, | ||
1485 | struct _pl330_req, rqd); | ||
1486 | |||
1487 | list_del_init(&rqdone->rqd); | ||
1488 | |||
1489 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
1490 | _callback(rqdone->r, PL330_ERR_NONE); | ||
1491 | spin_lock_irqsave(&pl330->lock, flags); | ||
1492 | } | ||
1493 | |||
1494 | updt_exit: | ||
1495 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
1496 | |||
1497 | if (pl330->dmac_tbd.reset_dmac | ||
1498 | || pl330->dmac_tbd.reset_mngr | ||
1499 | || pl330->dmac_tbd.reset_chan) { | ||
1500 | ret = 1; | ||
1501 | tasklet_schedule(&pl330->tasks); | ||
1502 | } | ||
1503 | |||
1504 | return ret; | ||
1505 | } | ||
1506 | EXPORT_SYMBOL(pl330_update); | ||
1507 | |||
1508 | int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op) | ||
1509 | { | ||
1510 | struct pl330_thread *thrd = ch_id; | ||
1511 | struct pl330_dmac *pl330; | ||
1512 | unsigned long flags; | ||
1513 | int ret = 0, active; | ||
1514 | |||
1515 | if (!thrd || thrd->free || thrd->dmac->state == DYING) | ||
1516 | return -EINVAL; | ||
1517 | |||
1518 | pl330 = thrd->dmac; | ||
1519 | |||
1520 | spin_lock_irqsave(&pl330->lock, flags); | ||
1521 | |||
1522 | switch (op) { | ||
1523 | case PL330_OP_FLUSH: | ||
1524 | /* Make sure the channel is stopped */ | ||
1525 | _stop(thrd); | ||
1526 | |||
1527 | thrd->req[0].r = NULL; | ||
1528 | thrd->req[1].r = NULL; | ||
1529 | MARK_FREE(&thrd->req[0]); | ||
1530 | MARK_FREE(&thrd->req[1]); | ||
1531 | break; | ||
1532 | |||
1533 | case PL330_OP_ABORT: | ||
1534 | active = _thrd_active(thrd); | ||
1535 | |||
1536 | /* Make sure the channel is stopped */ | ||
1537 | _stop(thrd); | ||
1538 | |||
1539 | /* ABORT is only for the active req */ | ||
1540 | if (!active) | ||
1541 | break; | ||
1542 | |||
1543 | active--; | ||
1544 | |||
1545 | thrd->req[active].r = NULL; | ||
1546 | MARK_FREE(&thrd->req[active]); | ||
1547 | |||
1548 | /* Start the next */ | ||
1549 | case PL330_OP_START: | ||
1550 | if (!_start(thrd)) | ||
1551 | ret = -EIO; | ||
1552 | break; | ||
1553 | |||
1554 | default: | ||
1555 | ret = -EINVAL; | ||
1556 | } | ||
1557 | |||
1558 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
1559 | return ret; | ||
1560 | } | ||
1561 | EXPORT_SYMBOL(pl330_chan_ctrl); | ||
1562 | |||
1563 | int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus) | ||
1564 | { | ||
1565 | struct pl330_thread *thrd = ch_id; | ||
1566 | struct pl330_dmac *pl330; | ||
1567 | struct pl330_info *pi; | ||
1568 | void __iomem *regs; | ||
1569 | int active; | ||
1570 | u32 val; | ||
1571 | |||
1572 | if (!pstatus || !thrd || thrd->free) | ||
1573 | return -EINVAL; | ||
1574 | |||
1575 | pl330 = thrd->dmac; | ||
1576 | pi = pl330->pinfo; | ||
1577 | regs = pi->base; | ||
1578 | |||
1579 | /* The client should remove the DMAC and add again */ | ||
1580 | if (pl330->state == DYING) | ||
1581 | pstatus->dmac_halted = true; | ||
1582 | else | ||
1583 | pstatus->dmac_halted = false; | ||
1584 | |||
1585 | val = readl(regs + FSC); | ||
1586 | if (val & (1 << thrd->id)) | ||
1587 | pstatus->faulting = true; | ||
1588 | else | ||
1589 | pstatus->faulting = false; | ||
1590 | |||
1591 | active = _thrd_active(thrd); | ||
1592 | |||
1593 | if (!active) { | ||
1594 | /* Indicate that the thread is not running */ | ||
1595 | pstatus->top_req = NULL; | ||
1596 | pstatus->wait_req = NULL; | ||
1597 | } else { | ||
1598 | active--; | ||
1599 | pstatus->top_req = thrd->req[active].r; | ||
1600 | pstatus->wait_req = !IS_FREE(&thrd->req[1 - active]) | ||
1601 | ? thrd->req[1 - active].r : NULL; | ||
1602 | } | ||
1603 | |||
1604 | pstatus->src_addr = readl(regs + SA(thrd->id)); | ||
1605 | pstatus->dst_addr = readl(regs + DA(thrd->id)); | ||
1606 | |||
1607 | return 0; | ||
1608 | } | ||
1609 | EXPORT_SYMBOL(pl330_chan_status); | ||
1610 | |||
1611 | /* Reserve an event */ | ||
1612 | static inline int _alloc_event(struct pl330_thread *thrd) | ||
1613 | { | ||
1614 | struct pl330_dmac *pl330 = thrd->dmac; | ||
1615 | struct pl330_info *pi = pl330->pinfo; | ||
1616 | int ev; | ||
1617 | |||
1618 | for (ev = 0; ev < pi->pcfg.num_events; ev++) | ||
1619 | if (pl330->events[ev] == -1) { | ||
1620 | pl330->events[ev] = thrd->id; | ||
1621 | return ev; | ||
1622 | } | ||
1623 | |||
1624 | return -1; | ||
1625 | } | ||
1626 | |||
1627 | /* Upon success, returns IdentityToken for the | ||
1628 | * allocated channel, NULL otherwise. | ||
1629 | */ | ||
1630 | void *pl330_request_channel(const struct pl330_info *pi) | ||
1631 | { | ||
1632 | struct pl330_thread *thrd = NULL; | ||
1633 | struct pl330_dmac *pl330; | ||
1634 | unsigned long flags; | ||
1635 | int chans, i; | ||
1636 | |||
1637 | if (!pi || !pi->pl330_data) | ||
1638 | return NULL; | ||
1639 | |||
1640 | pl330 = pi->pl330_data; | ||
1641 | |||
1642 | if (pl330->state == DYING) | ||
1643 | return NULL; | ||
1644 | |||
1645 | chans = pi->pcfg.num_chan; | ||
1646 | |||
1647 | spin_lock_irqsave(&pl330->lock, flags); | ||
1648 | |||
1649 | for (i = 0; i < chans; i++) { | ||
1650 | thrd = &pl330->channels[i]; | ||
1651 | if (thrd->free) { | ||
1652 | thrd->ev = _alloc_event(thrd); | ||
1653 | if (thrd->ev >= 0) { | ||
1654 | thrd->free = false; | ||
1655 | thrd->lstenq = 1; | ||
1656 | thrd->req[0].r = NULL; | ||
1657 | MARK_FREE(&thrd->req[0]); | ||
1658 | thrd->req[1].r = NULL; | ||
1659 | MARK_FREE(&thrd->req[1]); | ||
1660 | break; | ||
1661 | } | ||
1662 | } | ||
1663 | thrd = NULL; | ||
1664 | } | ||
1665 | |||
1666 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
1667 | |||
1668 | return thrd; | ||
1669 | } | ||
1670 | EXPORT_SYMBOL(pl330_request_channel); | ||
1671 | |||
1672 | /* Release an event */ | ||
1673 | static inline void _free_event(struct pl330_thread *thrd, int ev) | ||
1674 | { | ||
1675 | struct pl330_dmac *pl330 = thrd->dmac; | ||
1676 | struct pl330_info *pi = pl330->pinfo; | ||
1677 | |||
1678 | /* If the event is valid and was held by the thread */ | ||
1679 | if (ev >= 0 && ev < pi->pcfg.num_events | ||
1680 | && pl330->events[ev] == thrd->id) | ||
1681 | pl330->events[ev] = -1; | ||
1682 | } | ||
1683 | |||
1684 | void pl330_release_channel(void *ch_id) | ||
1685 | { | ||
1686 | struct pl330_thread *thrd = ch_id; | ||
1687 | struct pl330_dmac *pl330; | ||
1688 | unsigned long flags; | ||
1689 | |||
1690 | if (!thrd || thrd->free) | ||
1691 | return; | ||
1692 | |||
1693 | _stop(thrd); | ||
1694 | |||
1695 | _callback(thrd->req[1 - thrd->lstenq].r, PL330_ERR_ABORT); | ||
1696 | _callback(thrd->req[thrd->lstenq].r, PL330_ERR_ABORT); | ||
1697 | |||
1698 | pl330 = thrd->dmac; | ||
1699 | |||
1700 | spin_lock_irqsave(&pl330->lock, flags); | ||
1701 | _free_event(thrd, thrd->ev); | ||
1702 | thrd->free = true; | ||
1703 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
1704 | } | ||
1705 | EXPORT_SYMBOL(pl330_release_channel); | ||
1706 | |||
1707 | /* Initialize the structure for PL330 configuration, that can be used | ||
1708 | * by the client driver the make best use of the DMAC | ||
1709 | */ | ||
1710 | static void read_dmac_config(struct pl330_info *pi) | ||
1711 | { | ||
1712 | void __iomem *regs = pi->base; | ||
1713 | u32 val; | ||
1714 | |||
1715 | val = readl(regs + CRD) >> CRD_DATA_WIDTH_SHIFT; | ||
1716 | val &= CRD_DATA_WIDTH_MASK; | ||
1717 | pi->pcfg.data_bus_width = 8 * (1 << val); | ||
1718 | |||
1719 | val = readl(regs + CRD) >> CRD_DATA_BUFF_SHIFT; | ||
1720 | val &= CRD_DATA_BUFF_MASK; | ||
1721 | pi->pcfg.data_buf_dep = val + 1; | ||
1722 | |||
1723 | val = readl(regs + CR0) >> CR0_NUM_CHANS_SHIFT; | ||
1724 | val &= CR0_NUM_CHANS_MASK; | ||
1725 | val += 1; | ||
1726 | pi->pcfg.num_chan = val; | ||
1727 | |||
1728 | val = readl(regs + CR0); | ||
1729 | if (val & CR0_PERIPH_REQ_SET) { | ||
1730 | val = (val >> CR0_NUM_PERIPH_SHIFT) & CR0_NUM_PERIPH_MASK; | ||
1731 | val += 1; | ||
1732 | pi->pcfg.num_peri = val; | ||
1733 | pi->pcfg.peri_ns = readl(regs + CR4); | ||
1734 | } else { | ||
1735 | pi->pcfg.num_peri = 0; | ||
1736 | } | ||
1737 | |||
1738 | val = readl(regs + CR0); | ||
1739 | if (val & CR0_BOOT_MAN_NS) | ||
1740 | pi->pcfg.mode |= DMAC_MODE_NS; | ||
1741 | else | ||
1742 | pi->pcfg.mode &= ~DMAC_MODE_NS; | ||
1743 | |||
1744 | val = readl(regs + CR0) >> CR0_NUM_EVENTS_SHIFT; | ||
1745 | val &= CR0_NUM_EVENTS_MASK; | ||
1746 | val += 1; | ||
1747 | pi->pcfg.num_events = val; | ||
1748 | |||
1749 | pi->pcfg.irq_ns = readl(regs + CR3); | ||
1750 | |||
1751 | pi->pcfg.periph_id = get_id(pi, PERIPH_ID); | ||
1752 | pi->pcfg.pcell_id = get_id(pi, PCELL_ID); | ||
1753 | } | ||
1754 | |||
1755 | static inline void _reset_thread(struct pl330_thread *thrd) | ||
1756 | { | ||
1757 | struct pl330_dmac *pl330 = thrd->dmac; | ||
1758 | struct pl330_info *pi = pl330->pinfo; | ||
1759 | |||
1760 | thrd->req[0].mc_cpu = pl330->mcode_cpu | ||
1761 | + (thrd->id * pi->mcbufsz); | ||
1762 | thrd->req[0].mc_bus = pl330->mcode_bus | ||
1763 | + (thrd->id * pi->mcbufsz); | ||
1764 | thrd->req[0].r = NULL; | ||
1765 | MARK_FREE(&thrd->req[0]); | ||
1766 | |||
1767 | thrd->req[1].mc_cpu = thrd->req[0].mc_cpu | ||
1768 | + pi->mcbufsz / 2; | ||
1769 | thrd->req[1].mc_bus = thrd->req[0].mc_bus | ||
1770 | + pi->mcbufsz / 2; | ||
1771 | thrd->req[1].r = NULL; | ||
1772 | MARK_FREE(&thrd->req[1]); | ||
1773 | } | ||
1774 | |||
1775 | static int dmac_alloc_threads(struct pl330_dmac *pl330) | ||
1776 | { | ||
1777 | struct pl330_info *pi = pl330->pinfo; | ||
1778 | int chans = pi->pcfg.num_chan; | ||
1779 | struct pl330_thread *thrd; | ||
1780 | int i; | ||
1781 | |||
1782 | /* Allocate 1 Manager and 'chans' Channel threads */ | ||
1783 | pl330->channels = kzalloc((1 + chans) * sizeof(*thrd), | ||
1784 | GFP_KERNEL); | ||
1785 | if (!pl330->channels) | ||
1786 | return -ENOMEM; | ||
1787 | |||
1788 | /* Init Channel threads */ | ||
1789 | for (i = 0; i < chans; i++) { | ||
1790 | thrd = &pl330->channels[i]; | ||
1791 | thrd->id = i; | ||
1792 | thrd->dmac = pl330; | ||
1793 | _reset_thread(thrd); | ||
1794 | thrd->free = true; | ||
1795 | } | ||
1796 | |||
1797 | /* MANAGER is indexed at the end */ | ||
1798 | thrd = &pl330->channels[chans]; | ||
1799 | thrd->id = chans; | ||
1800 | thrd->dmac = pl330; | ||
1801 | thrd->free = false; | ||
1802 | pl330->manager = thrd; | ||
1803 | |||
1804 | return 0; | ||
1805 | } | ||
1806 | |||
1807 | static int dmac_alloc_resources(struct pl330_dmac *pl330) | ||
1808 | { | ||
1809 | struct pl330_info *pi = pl330->pinfo; | ||
1810 | int chans = pi->pcfg.num_chan; | ||
1811 | int ret; | ||
1812 | |||
1813 | /* | ||
1814 | * Alloc MicroCode buffer for 'chans' Channel threads. | ||
1815 | * A channel's buffer offset is (Channel_Id * MCODE_BUFF_PERCHAN) | ||
1816 | */ | ||
1817 | pl330->mcode_cpu = dma_alloc_coherent(pi->dev, | ||
1818 | chans * pi->mcbufsz, | ||
1819 | &pl330->mcode_bus, GFP_KERNEL); | ||
1820 | if (!pl330->mcode_cpu) { | ||
1821 | dev_err(pi->dev, "%s:%d Can't allocate memory!\n", | ||
1822 | __func__, __LINE__); | ||
1823 | return -ENOMEM; | ||
1824 | } | ||
1825 | |||
1826 | ret = dmac_alloc_threads(pl330); | ||
1827 | if (ret) { | ||
1828 | dev_err(pi->dev, "%s:%d Can't to create channels for DMAC!\n", | ||
1829 | __func__, __LINE__); | ||
1830 | dma_free_coherent(pi->dev, | ||
1831 | chans * pi->mcbufsz, | ||
1832 | pl330->mcode_cpu, pl330->mcode_bus); | ||
1833 | return ret; | ||
1834 | } | ||
1835 | |||
1836 | return 0; | ||
1837 | } | ||
1838 | |||
1839 | int pl330_add(struct pl330_info *pi) | ||
1840 | { | ||
1841 | struct pl330_dmac *pl330; | ||
1842 | void __iomem *regs; | ||
1843 | int i, ret; | ||
1844 | |||
1845 | if (!pi || !pi->dev) | ||
1846 | return -EINVAL; | ||
1847 | |||
1848 | /* If already added */ | ||
1849 | if (pi->pl330_data) | ||
1850 | return -EINVAL; | ||
1851 | |||
1852 | /* | ||
1853 | * If the SoC can perform reset on the DMAC, then do it | ||
1854 | * before reading its configuration. | ||
1855 | */ | ||
1856 | if (pi->dmac_reset) | ||
1857 | pi->dmac_reset(pi); | ||
1858 | |||
1859 | regs = pi->base; | ||
1860 | |||
1861 | /* Check if we can handle this DMAC */ | ||
1862 | if (get_id(pi, PERIPH_ID) != PERIPH_ID_VAL | ||
1863 | || get_id(pi, PCELL_ID) != PCELL_ID_VAL) { | ||
1864 | dev_err(pi->dev, "PERIPH_ID 0x%x, PCELL_ID 0x%x !\n", | ||
1865 | readl(regs + PERIPH_ID), readl(regs + PCELL_ID)); | ||
1866 | return -EINVAL; | ||
1867 | } | ||
1868 | |||
1869 | /* Read the configuration of the DMAC */ | ||
1870 | read_dmac_config(pi); | ||
1871 | |||
1872 | if (pi->pcfg.num_events == 0) { | ||
1873 | dev_err(pi->dev, "%s:%d Can't work without events!\n", | ||
1874 | __func__, __LINE__); | ||
1875 | return -EINVAL; | ||
1876 | } | ||
1877 | |||
1878 | pl330 = kzalloc(sizeof(*pl330), GFP_KERNEL); | ||
1879 | if (!pl330) { | ||
1880 | dev_err(pi->dev, "%s:%d Can't allocate memory!\n", | ||
1881 | __func__, __LINE__); | ||
1882 | return -ENOMEM; | ||
1883 | } | ||
1884 | |||
1885 | /* Assign the info structure and private data */ | ||
1886 | pl330->pinfo = pi; | ||
1887 | pi->pl330_data = pl330; | ||
1888 | |||
1889 | spin_lock_init(&pl330->lock); | ||
1890 | |||
1891 | INIT_LIST_HEAD(&pl330->req_done); | ||
1892 | |||
1893 | /* Use default MC buffer size if not provided */ | ||
1894 | if (!pi->mcbufsz) | ||
1895 | pi->mcbufsz = MCODE_BUFF_PER_REQ * 2; | ||
1896 | |||
1897 | /* Mark all events as free */ | ||
1898 | for (i = 0; i < pi->pcfg.num_events; i++) | ||
1899 | pl330->events[i] = -1; | ||
1900 | |||
1901 | /* Allocate resources needed by the DMAC */ | ||
1902 | ret = dmac_alloc_resources(pl330); | ||
1903 | if (ret) { | ||
1904 | dev_err(pi->dev, "Unable to create channels for DMAC\n"); | ||
1905 | kfree(pl330); | ||
1906 | return ret; | ||
1907 | } | ||
1908 | |||
1909 | tasklet_init(&pl330->tasks, pl330_dotask, (unsigned long) pl330); | ||
1910 | |||
1911 | pl330->state = INIT; | ||
1912 | |||
1913 | return 0; | ||
1914 | } | ||
1915 | EXPORT_SYMBOL(pl330_add); | ||
1916 | |||
1917 | static int dmac_free_threads(struct pl330_dmac *pl330) | ||
1918 | { | ||
1919 | struct pl330_info *pi = pl330->pinfo; | ||
1920 | int chans = pi->pcfg.num_chan; | ||
1921 | struct pl330_thread *thrd; | ||
1922 | int i; | ||
1923 | |||
1924 | /* Release Channel threads */ | ||
1925 | for (i = 0; i < chans; i++) { | ||
1926 | thrd = &pl330->channels[i]; | ||
1927 | pl330_release_channel((void *)thrd); | ||
1928 | } | ||
1929 | |||
1930 | /* Free memory */ | ||
1931 | kfree(pl330->channels); | ||
1932 | |||
1933 | return 0; | ||
1934 | } | ||
1935 | |||
1936 | static void dmac_free_resources(struct pl330_dmac *pl330) | ||
1937 | { | ||
1938 | struct pl330_info *pi = pl330->pinfo; | ||
1939 | int chans = pi->pcfg.num_chan; | ||
1940 | |||
1941 | dmac_free_threads(pl330); | ||
1942 | |||
1943 | dma_free_coherent(pi->dev, chans * pi->mcbufsz, | ||
1944 | pl330->mcode_cpu, pl330->mcode_bus); | ||
1945 | } | ||
1946 | |||
1947 | void pl330_del(struct pl330_info *pi) | ||
1948 | { | ||
1949 | struct pl330_dmac *pl330; | ||
1950 | |||
1951 | if (!pi || !pi->pl330_data) | ||
1952 | return; | ||
1953 | |||
1954 | pl330 = pi->pl330_data; | ||
1955 | |||
1956 | pl330->state = UNINIT; | ||
1957 | |||
1958 | tasklet_kill(&pl330->tasks); | ||
1959 | |||
1960 | /* Free DMAC resources */ | ||
1961 | dmac_free_resources(pl330); | ||
1962 | |||
1963 | kfree(pl330); | ||
1964 | pi->pl330_data = NULL; | ||
1965 | } | ||
1966 | EXPORT_SYMBOL(pl330_del); | ||
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index 1cf999ade4bc..ba65f6eedca6 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c | |||
@@ -266,13 +266,53 @@ static int vic_set_wake(unsigned int irq, unsigned int on) | |||
266 | #endif /* CONFIG_PM */ | 266 | #endif /* CONFIG_PM */ |
267 | 267 | ||
268 | static struct irq_chip vic_chip = { | 268 | static struct irq_chip vic_chip = { |
269 | .name = "VIC", | 269 | .name = "VIC", |
270 | .ack = vic_ack_irq, | 270 | .ack = vic_ack_irq, |
271 | .mask = vic_mask_irq, | 271 | .mask = vic_mask_irq, |
272 | .unmask = vic_unmask_irq, | 272 | .unmask = vic_unmask_irq, |
273 | .set_wake = vic_set_wake, | 273 | .set_wake = vic_set_wake, |
274 | }; | 274 | }; |
275 | 275 | ||
276 | static void __init vic_disable(void __iomem *base) | ||
277 | { | ||
278 | writel(0, base + VIC_INT_SELECT); | ||
279 | writel(0, base + VIC_INT_ENABLE); | ||
280 | writel(~0, base + VIC_INT_ENABLE_CLEAR); | ||
281 | writel(0, base + VIC_IRQ_STATUS); | ||
282 | writel(0, base + VIC_ITCR); | ||
283 | writel(~0, base + VIC_INT_SOFT_CLEAR); | ||
284 | } | ||
285 | |||
286 | static void __init vic_clear_interrupts(void __iomem *base) | ||
287 | { | ||
288 | unsigned int i; | ||
289 | |||
290 | writel(0, base + VIC_PL190_VECT_ADDR); | ||
291 | for (i = 0; i < 19; i++) { | ||
292 | unsigned int value; | ||
293 | |||
294 | value = readl(base + VIC_PL190_VECT_ADDR); | ||
295 | writel(value, base + VIC_PL190_VECT_ADDR); | ||
296 | } | ||
297 | } | ||
298 | |||
299 | static void __init vic_set_irq_sources(void __iomem *base, | ||
300 | unsigned int irq_start, u32 vic_sources) | ||
301 | { | ||
302 | unsigned int i; | ||
303 | |||
304 | for (i = 0; i < 32; i++) { | ||
305 | if (vic_sources & (1 << i)) { | ||
306 | unsigned int irq = irq_start + i; | ||
307 | |||
308 | set_irq_chip(irq, &vic_chip); | ||
309 | set_irq_chip_data(irq, base); | ||
310 | set_irq_handler(irq, handle_level_irq); | ||
311 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
312 | } | ||
313 | } | ||
314 | } | ||
315 | |||
276 | /* | 316 | /* |
277 | * The PL190 cell from ARM has been modified by ST to handle 64 interrupts. | 317 | * The PL190 cell from ARM has been modified by ST to handle 64 interrupts. |
278 | * The original cell has 32 interrupts, while the modified one has 64, | 318 | * The original cell has 32 interrupts, while the modified one has 64, |
@@ -287,13 +327,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | |||
287 | int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0; | 327 | int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0; |
288 | 328 | ||
289 | /* Disable all interrupts initially. */ | 329 | /* Disable all interrupts initially. */ |
290 | 330 | vic_disable(base); | |
291 | writel(0, base + VIC_INT_SELECT); | ||
292 | writel(0, base + VIC_INT_ENABLE); | ||
293 | writel(~0, base + VIC_INT_ENABLE_CLEAR); | ||
294 | writel(0, base + VIC_IRQ_STATUS); | ||
295 | writel(0, base + VIC_ITCR); | ||
296 | writel(~0, base + VIC_INT_SOFT_CLEAR); | ||
297 | 331 | ||
298 | /* | 332 | /* |
299 | * Make sure we clear all existing interrupts. The vector registers | 333 | * Make sure we clear all existing interrupts. The vector registers |
@@ -302,13 +336,8 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | |||
302 | * the second base address, which is 0x20 in the page | 336 | * the second base address, which is 0x20 in the page |
303 | */ | 337 | */ |
304 | if (vic_2nd_block) { | 338 | if (vic_2nd_block) { |
305 | writel(0, base + VIC_PL190_VECT_ADDR); | 339 | vic_clear_interrupts(base); |
306 | for (i = 0; i < 19; i++) { | ||
307 | unsigned int value; | ||
308 | 340 | ||
309 | value = readl(base + VIC_PL190_VECT_ADDR); | ||
310 | writel(value, base + VIC_PL190_VECT_ADDR); | ||
311 | } | ||
312 | /* ST has 16 vectors as well, but we don't enable them by now */ | 341 | /* ST has 16 vectors as well, but we don't enable them by now */ |
313 | for (i = 0; i < 16; i++) { | 342 | for (i = 0; i < 16; i++) { |
314 | void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); | 343 | void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); |
@@ -318,16 +347,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | |||
318 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); | 347 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); |
319 | } | 348 | } |
320 | 349 | ||
321 | for (i = 0; i < 32; i++) { | 350 | vic_set_irq_sources(base, irq_start, vic_sources); |
322 | if (vic_sources & (1 << i)) { | ||
323 | unsigned int irq = irq_start + i; | ||
324 | |||
325 | set_irq_chip(irq, &vic_chip); | ||
326 | set_irq_chip_data(irq, base); | ||
327 | set_irq_handler(irq, handle_level_irq); | ||
328 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
329 | } | ||
330 | } | ||
331 | } | 351 | } |
332 | 352 | ||
333 | /** | 353 | /** |
@@ -365,37 +385,14 @@ void __init vic_init(void __iomem *base, unsigned int irq_start, | |||
365 | } | 385 | } |
366 | 386 | ||
367 | /* Disable all interrupts initially. */ | 387 | /* Disable all interrupts initially. */ |
388 | vic_disable(base); | ||
368 | 389 | ||
369 | writel(0, base + VIC_INT_SELECT); | 390 | /* Make sure we clear all existing interrupts */ |
370 | writel(0, base + VIC_INT_ENABLE); | 391 | vic_clear_interrupts(base); |
371 | writel(~0, base + VIC_INT_ENABLE_CLEAR); | ||
372 | writel(0, base + VIC_IRQ_STATUS); | ||
373 | writel(0, base + VIC_ITCR); | ||
374 | writel(~0, base + VIC_INT_SOFT_CLEAR); | ||
375 | |||
376 | /* | ||
377 | * Make sure we clear all existing interrupts | ||
378 | */ | ||
379 | writel(0, base + VIC_PL190_VECT_ADDR); | ||
380 | for (i = 0; i < 19; i++) { | ||
381 | unsigned int value; | ||
382 | |||
383 | value = readl(base + VIC_PL190_VECT_ADDR); | ||
384 | writel(value, base + VIC_PL190_VECT_ADDR); | ||
385 | } | ||
386 | 392 | ||
387 | vic_init2(base); | 393 | vic_init2(base); |
388 | 394 | ||
389 | for (i = 0; i < 32; i++) { | 395 | vic_set_irq_sources(base, irq_start, vic_sources); |
390 | if (vic_sources & (1 << i)) { | ||
391 | unsigned int irq = irq_start + i; | ||
392 | |||
393 | set_irq_chip(irq, &vic_chip); | ||
394 | set_irq_chip_data(irq, base); | ||
395 | set_irq_handler(irq, handle_level_irq); | ||
396 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
397 | } | ||
398 | } | ||
399 | 396 | ||
400 | vic_pm_register(base, irq_start, resume_sources); | 397 | vic_pm_register(base, irq_start, resume_sources); |
401 | } | 398 | } |
diff --git a/arch/arm/configs/cns3420vb_defconfig b/arch/arm/configs/cns3420vb_defconfig new file mode 100644 index 000000000000..d5c088149e46 --- /dev/null +++ b/arch/arm/configs/cns3420vb_defconfig | |||
@@ -0,0 +1,831 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.34-rc6 | ||
4 | # Sun May 2 21:58:08 2010 | ||
5 | # | ||
6 | CONFIG_ARM=y | ||
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
8 | CONFIG_GENERIC_TIME=y | ||
9 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
10 | CONFIG_HAVE_PROC_CPU=y | ||
11 | CONFIG_GENERIC_HARDIRQS=y | ||
12 | CONFIG_STACKTRACE_SUPPORT=y | ||
13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
14 | CONFIG_LOCKDEP_SUPPORT=y | ||
15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
19 | CONFIG_GENERIC_HWEIGHT=y | ||
20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
21 | CONFIG_NEED_DMA_MAP_STATE=y | ||
22 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
23 | CONFIG_OPROFILE_ARMV6=y | ||
24 | CONFIG_OPROFILE_ARM11_CORE=y | ||
25 | CONFIG_VECTORS_BASE=0xffff0000 | ||
26 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
27 | CONFIG_CONSTRUCTORS=y | ||
28 | |||
29 | # | ||
30 | # General setup | ||
31 | # | ||
32 | CONFIG_EXPERIMENTAL=y | ||
33 | CONFIG_BROKEN_ON_SMP=y | ||
34 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
35 | CONFIG_LOCALVERSION="" | ||
36 | # CONFIG_LOCALVERSION_AUTO is not set | ||
37 | CONFIG_HAVE_KERNEL_GZIP=y | ||
38 | CONFIG_HAVE_KERNEL_LZO=y | ||
39 | CONFIG_KERNEL_GZIP=y | ||
40 | # CONFIG_KERNEL_BZIP2 is not set | ||
41 | # CONFIG_KERNEL_LZMA is not set | ||
42 | # CONFIG_KERNEL_LZO is not set | ||
43 | # CONFIG_SWAP is not set | ||
44 | CONFIG_SYSVIPC=y | ||
45 | CONFIG_SYSVIPC_SYSCTL=y | ||
46 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
47 | |||
48 | # | ||
49 | # RCU Subsystem | ||
50 | # | ||
51 | CONFIG_TREE_RCU=y | ||
52 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
53 | # CONFIG_TINY_RCU is not set | ||
54 | # CONFIG_RCU_TRACE is not set | ||
55 | CONFIG_RCU_FANOUT=32 | ||
56 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
57 | # CONFIG_TREE_RCU_TRACE is not set | ||
58 | CONFIG_IKCONFIG=y | ||
59 | CONFIG_IKCONFIG_PROC=y | ||
60 | CONFIG_LOG_BUF_SHIFT=14 | ||
61 | CONFIG_CGROUPS=y | ||
62 | # CONFIG_CGROUP_DEBUG is not set | ||
63 | # CONFIG_CGROUP_NS is not set | ||
64 | # CONFIG_CGROUP_FREEZER is not set | ||
65 | # CONFIG_CGROUP_DEVICE is not set | ||
66 | # CONFIG_CPUSETS is not set | ||
67 | # CONFIG_CGROUP_CPUACCT is not set | ||
68 | # CONFIG_RESOURCE_COUNTERS is not set | ||
69 | # CONFIG_CGROUP_SCHED is not set | ||
70 | CONFIG_SYSFS_DEPRECATED=y | ||
71 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
72 | CONFIG_RELAY=y | ||
73 | CONFIG_NAMESPACES=y | ||
74 | # CONFIG_UTS_NS is not set | ||
75 | # CONFIG_IPC_NS is not set | ||
76 | # CONFIG_USER_NS is not set | ||
77 | # CONFIG_PID_NS is not set | ||
78 | CONFIG_BLK_DEV_INITRD=y | ||
79 | CONFIG_INITRAMFS_SOURCE="" | ||
80 | CONFIG_RD_GZIP=y | ||
81 | CONFIG_RD_BZIP2=y | ||
82 | CONFIG_RD_LZMA=y | ||
83 | CONFIG_RD_LZO=y | ||
84 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
85 | CONFIG_SYSCTL=y | ||
86 | CONFIG_ANON_INODES=y | ||
87 | # CONFIG_EMBEDDED is not set | ||
88 | CONFIG_UID16=y | ||
89 | CONFIG_SYSCTL_SYSCALL=y | ||
90 | CONFIG_KALLSYMS=y | ||
91 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
92 | CONFIG_HOTPLUG=y | ||
93 | CONFIG_PRINTK=y | ||
94 | CONFIG_BUG=y | ||
95 | CONFIG_ELF_CORE=y | ||
96 | CONFIG_BASE_FULL=y | ||
97 | CONFIG_FUTEX=y | ||
98 | CONFIG_EPOLL=y | ||
99 | CONFIG_SIGNALFD=y | ||
100 | CONFIG_TIMERFD=y | ||
101 | CONFIG_EVENTFD=y | ||
102 | CONFIG_SHMEM=y | ||
103 | CONFIG_AIO=y | ||
104 | CONFIG_HAVE_PERF_EVENTS=y | ||
105 | CONFIG_PERF_USE_VMALLOC=y | ||
106 | |||
107 | # | ||
108 | # Kernel Performance Events And Counters | ||
109 | # | ||
110 | # CONFIG_PERF_EVENTS is not set | ||
111 | # CONFIG_PERF_COUNTERS is not set | ||
112 | CONFIG_VM_EVENT_COUNTERS=y | ||
113 | CONFIG_COMPAT_BRK=y | ||
114 | CONFIG_SLAB=y | ||
115 | # CONFIG_SLUB is not set | ||
116 | # CONFIG_SLOB is not set | ||
117 | CONFIG_PROFILING=y | ||
118 | CONFIG_OPROFILE=m | ||
119 | CONFIG_HAVE_OPROFILE=y | ||
120 | # CONFIG_KPROBES is not set | ||
121 | CONFIG_HAVE_KPROBES=y | ||
122 | CONFIG_HAVE_KRETPROBES=y | ||
123 | |||
124 | # | ||
125 | # GCOV-based kernel profiling | ||
126 | # | ||
127 | # CONFIG_GCOV_KERNEL is not set | ||
128 | CONFIG_SLOW_WORK=y | ||
129 | # CONFIG_SLOW_WORK_DEBUG is not set | ||
130 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
131 | CONFIG_SLABINFO=y | ||
132 | CONFIG_RT_MUTEXES=y | ||
133 | CONFIG_BASE_SMALL=0 | ||
134 | CONFIG_MODULES=y | ||
135 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
136 | CONFIG_MODULE_UNLOAD=y | ||
137 | CONFIG_MODULE_FORCE_UNLOAD=y | ||
138 | CONFIG_MODVERSIONS=y | ||
139 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
140 | CONFIG_BLOCK=y | ||
141 | CONFIG_LBDAF=y | ||
142 | # CONFIG_BLK_DEV_BSG is not set | ||
143 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
144 | |||
145 | # | ||
146 | # IO Schedulers | ||
147 | # | ||
148 | CONFIG_IOSCHED_NOOP=y | ||
149 | CONFIG_IOSCHED_DEADLINE=y | ||
150 | CONFIG_IOSCHED_CFQ=m | ||
151 | # CONFIG_CFQ_GROUP_IOSCHED is not set | ||
152 | CONFIG_DEFAULT_DEADLINE=y | ||
153 | # CONFIG_DEFAULT_CFQ is not set | ||
154 | # CONFIG_DEFAULT_NOOP is not set | ||
155 | CONFIG_DEFAULT_IOSCHED="deadline" | ||
156 | # CONFIG_INLINE_SPIN_TRYLOCK is not set | ||
157 | # CONFIG_INLINE_SPIN_TRYLOCK_BH is not set | ||
158 | # CONFIG_INLINE_SPIN_LOCK is not set | ||
159 | # CONFIG_INLINE_SPIN_LOCK_BH is not set | ||
160 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set | ||
161 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set | ||
162 | CONFIG_INLINE_SPIN_UNLOCK=y | ||
163 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set | ||
164 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y | ||
165 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set | ||
166 | # CONFIG_INLINE_READ_TRYLOCK is not set | ||
167 | # CONFIG_INLINE_READ_LOCK is not set | ||
168 | # CONFIG_INLINE_READ_LOCK_BH is not set | ||
169 | # CONFIG_INLINE_READ_LOCK_IRQ is not set | ||
170 | # CONFIG_INLINE_READ_LOCK_IRQSAVE is not set | ||
171 | CONFIG_INLINE_READ_UNLOCK=y | ||
172 | # CONFIG_INLINE_READ_UNLOCK_BH is not set | ||
173 | CONFIG_INLINE_READ_UNLOCK_IRQ=y | ||
174 | # CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set | ||
175 | # CONFIG_INLINE_WRITE_TRYLOCK is not set | ||
176 | # CONFIG_INLINE_WRITE_LOCK is not set | ||
177 | # CONFIG_INLINE_WRITE_LOCK_BH is not set | ||
178 | # CONFIG_INLINE_WRITE_LOCK_IRQ is not set | ||
179 | # CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set | ||
180 | CONFIG_INLINE_WRITE_UNLOCK=y | ||
181 | # CONFIG_INLINE_WRITE_UNLOCK_BH is not set | ||
182 | CONFIG_INLINE_WRITE_UNLOCK_IRQ=y | ||
183 | # CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set | ||
184 | # CONFIG_MUTEX_SPIN_ON_OWNER is not set | ||
185 | # CONFIG_FREEZER is not set | ||
186 | |||
187 | # | ||
188 | # System Type | ||
189 | # | ||
190 | CONFIG_MMU=y | ||
191 | # CONFIG_ARCH_AAEC2000 is not set | ||
192 | # CONFIG_ARCH_INTEGRATOR is not set | ||
193 | # CONFIG_ARCH_REALVIEW is not set | ||
194 | # CONFIG_ARCH_VERSATILE is not set | ||
195 | # CONFIG_ARCH_AT91 is not set | ||
196 | # CONFIG_ARCH_BCMRING is not set | ||
197 | # CONFIG_ARCH_CLPS711X is not set | ||
198 | CONFIG_ARCH_CNS3XXX=y | ||
199 | # CONFIG_ARCH_GEMINI is not set | ||
200 | # CONFIG_ARCH_EBSA110 is not set | ||
201 | # CONFIG_ARCH_EP93XX is not set | ||
202 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
203 | # CONFIG_ARCH_MXC is not set | ||
204 | # CONFIG_ARCH_STMP3XXX is not set | ||
205 | # CONFIG_ARCH_NETX is not set | ||
206 | # CONFIG_ARCH_H720X is not set | ||
207 | # CONFIG_ARCH_IOP13XX is not set | ||
208 | # CONFIG_ARCH_IOP32X is not set | ||
209 | # CONFIG_ARCH_IOP33X is not set | ||
210 | # CONFIG_ARCH_IXP23XX is not set | ||
211 | # CONFIG_ARCH_IXP2000 is not set | ||
212 | # CONFIG_ARCH_IXP4XX is not set | ||
213 | # CONFIG_ARCH_L7200 is not set | ||
214 | # CONFIG_ARCH_DOVE is not set | ||
215 | # CONFIG_ARCH_KIRKWOOD is not set | ||
216 | # CONFIG_ARCH_LOKI is not set | ||
217 | # CONFIG_ARCH_MV78XX0 is not set | ||
218 | # CONFIG_ARCH_ORION5X is not set | ||
219 | # CONFIG_ARCH_MMP is not set | ||
220 | # CONFIG_ARCH_KS8695 is not set | ||
221 | # CONFIG_ARCH_NS9XXX is not set | ||
222 | # CONFIG_ARCH_W90X900 is not set | ||
223 | # CONFIG_ARCH_NUC93X is not set | ||
224 | # CONFIG_ARCH_PNX4008 is not set | ||
225 | # CONFIG_ARCH_PXA is not set | ||
226 | # CONFIG_ARCH_MSM is not set | ||
227 | # CONFIG_ARCH_SHMOBILE is not set | ||
228 | # CONFIG_ARCH_RPC is not set | ||
229 | # CONFIG_ARCH_SA1100 is not set | ||
230 | # CONFIG_ARCH_S3C2410 is not set | ||
231 | # CONFIG_ARCH_S3C64XX is not set | ||
232 | # CONFIG_ARCH_S5P6440 is not set | ||
233 | # CONFIG_ARCH_S5P6442 is not set | ||
234 | # CONFIG_ARCH_S5PC1XX is not set | ||
235 | # CONFIG_ARCH_S5PV210 is not set | ||
236 | # CONFIG_ARCH_SHARK is not set | ||
237 | # CONFIG_ARCH_LH7A40X is not set | ||
238 | # CONFIG_ARCH_U300 is not set | ||
239 | # CONFIG_ARCH_U8500 is not set | ||
240 | # CONFIG_ARCH_NOMADIK is not set | ||
241 | # CONFIG_ARCH_DAVINCI is not set | ||
242 | # CONFIG_ARCH_OMAP is not set | ||
243 | |||
244 | # | ||
245 | # CNS3XXX platform type | ||
246 | # | ||
247 | CONFIG_MACH_CNS3420VB=y | ||
248 | |||
249 | # | ||
250 | # Processor Type | ||
251 | # | ||
252 | CONFIG_CPU_V6=y | ||
253 | # CONFIG_CPU_32v6K is not set | ||
254 | CONFIG_CPU_32v6=y | ||
255 | CONFIG_CPU_ABRT_EV6=y | ||
256 | CONFIG_CPU_PABRT_V6=y | ||
257 | CONFIG_CPU_CACHE_V6=y | ||
258 | CONFIG_CPU_CACHE_VIPT=y | ||
259 | CONFIG_CPU_COPY_V6=y | ||
260 | CONFIG_CPU_TLB_V6=y | ||
261 | CONFIG_CPU_HAS_ASID=y | ||
262 | CONFIG_CPU_CP15=y | ||
263 | CONFIG_CPU_CP15_MMU=y | ||
264 | |||
265 | # | ||
266 | # Processor Features | ||
267 | # | ||
268 | CONFIG_ARM_THUMB=y | ||
269 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
270 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
271 | # CONFIG_CPU_BPREDICT_DISABLE is not set | ||
272 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
273 | CONFIG_CPU_HAS_PMU=y | ||
274 | # CONFIG_ARM_ERRATA_411920 is not set | ||
275 | CONFIG_ARM_GIC=y | ||
276 | |||
277 | # | ||
278 | # Bus support | ||
279 | # | ||
280 | # CONFIG_PCI_SYSCALL is not set | ||
281 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
282 | # CONFIG_PCCARD is not set | ||
283 | |||
284 | # | ||
285 | # Kernel Features | ||
286 | # | ||
287 | # CONFIG_NO_HZ is not set | ||
288 | # CONFIG_HIGH_RES_TIMERS is not set | ||
289 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
290 | CONFIG_VMSPLIT_3G=y | ||
291 | # CONFIG_VMSPLIT_2G is not set | ||
292 | # CONFIG_VMSPLIT_1G is not set | ||
293 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
294 | CONFIG_PREEMPT_NONE=y | ||
295 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
296 | # CONFIG_PREEMPT is not set | ||
297 | CONFIG_HZ=100 | ||
298 | CONFIG_AEABI=y | ||
299 | CONFIG_OABI_COMPAT=y | ||
300 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
301 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
302 | # CONFIG_HIGHMEM is not set | ||
303 | CONFIG_SELECT_MEMORY_MODEL=y | ||
304 | CONFIG_FLATMEM_MANUAL=y | ||
305 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
306 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
307 | CONFIG_FLATMEM=y | ||
308 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
309 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
310 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
311 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
312 | CONFIG_ZONE_DMA_FLAG=0 | ||
313 | CONFIG_VIRT_TO_BUS=y | ||
314 | # CONFIG_KSM is not set | ||
315 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
316 | CONFIG_ALIGNMENT_TRAP=y | ||
317 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
318 | |||
319 | # | ||
320 | # Boot options | ||
321 | # | ||
322 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
323 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
324 | CONFIG_CMDLINE="console=ttyS0,38400 mem=128M root=/dev/mmcblk0p1 ro rootwait" | ||
325 | # CONFIG_XIP_KERNEL is not set | ||
326 | # CONFIG_KEXEC is not set | ||
327 | |||
328 | # | ||
329 | # CPU Power Management | ||
330 | # | ||
331 | # CONFIG_CPU_IDLE is not set | ||
332 | |||
333 | # | ||
334 | # Floating point emulation | ||
335 | # | ||
336 | |||
337 | # | ||
338 | # At least one emulation must be selected | ||
339 | # | ||
340 | # CONFIG_FPE_NWFPE is not set | ||
341 | # CONFIG_FPE_FASTFPE is not set | ||
342 | # CONFIG_VFP is not set | ||
343 | |||
344 | # | ||
345 | # Userspace binary formats | ||
346 | # | ||
347 | CONFIG_BINFMT_ELF=y | ||
348 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
349 | CONFIG_HAVE_AOUT=y | ||
350 | # CONFIG_BINFMT_AOUT is not set | ||
351 | # CONFIG_BINFMT_MISC is not set | ||
352 | |||
353 | # | ||
354 | # Power management options | ||
355 | # | ||
356 | # CONFIG_PM is not set | ||
357 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
358 | # CONFIG_NET is not set | ||
359 | |||
360 | # | ||
361 | # Device Drivers | ||
362 | # | ||
363 | |||
364 | # | ||
365 | # Generic Driver Options | ||
366 | # | ||
367 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
368 | # CONFIG_DEVTMPFS is not set | ||
369 | CONFIG_STANDALONE=y | ||
370 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
371 | CONFIG_FW_LOADER=y | ||
372 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
373 | CONFIG_EXTRA_FIRMWARE="" | ||
374 | # CONFIG_SYS_HYPERVISOR is not set | ||
375 | CONFIG_MTD=y | ||
376 | # CONFIG_MTD_DEBUG is not set | ||
377 | # CONFIG_MTD_TESTS is not set | ||
378 | # CONFIG_MTD_CONCAT is not set | ||
379 | CONFIG_MTD_PARTITIONS=y | ||
380 | # CONFIG_MTD_REDBOOT_PARTS is not set | ||
381 | CONFIG_MTD_CMDLINE_PARTS=y | ||
382 | # CONFIG_MTD_AFS_PARTS is not set | ||
383 | # CONFIG_MTD_AR7_PARTS is not set | ||
384 | |||
385 | # | ||
386 | # User Modules And Translation Layers | ||
387 | # | ||
388 | CONFIG_MTD_CHAR=y | ||
389 | CONFIG_MTD_BLKDEVS=y | ||
390 | CONFIG_MTD_BLOCK=y | ||
391 | # CONFIG_FTL is not set | ||
392 | # CONFIG_NFTL is not set | ||
393 | # CONFIG_INFTL is not set | ||
394 | # CONFIG_RFD_FTL is not set | ||
395 | # CONFIG_SSFDC is not set | ||
396 | # CONFIG_MTD_OOPS is not set | ||
397 | |||
398 | # | ||
399 | # RAM/ROM/Flash chip drivers | ||
400 | # | ||
401 | CONFIG_MTD_CFI=y | ||
402 | # CONFIG_MTD_JEDECPROBE is not set | ||
403 | CONFIG_MTD_GEN_PROBE=y | ||
404 | # CONFIG_MTD_CFI_ADV_OPTIONS is not set | ||
405 | CONFIG_MTD_MAP_BANK_WIDTH_1=y | ||
406 | CONFIG_MTD_MAP_BANK_WIDTH_2=y | ||
407 | CONFIG_MTD_MAP_BANK_WIDTH_4=y | ||
408 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | ||
409 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | ||
410 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | ||
411 | CONFIG_MTD_CFI_I1=y | ||
412 | CONFIG_MTD_CFI_I2=y | ||
413 | # CONFIG_MTD_CFI_I4 is not set | ||
414 | # CONFIG_MTD_CFI_I8 is not set | ||
415 | # CONFIG_MTD_CFI_INTELEXT is not set | ||
416 | CONFIG_MTD_CFI_AMDSTD=y | ||
417 | # CONFIG_MTD_CFI_STAA is not set | ||
418 | CONFIG_MTD_CFI_UTIL=y | ||
419 | # CONFIG_MTD_RAM is not set | ||
420 | # CONFIG_MTD_ROM is not set | ||
421 | # CONFIG_MTD_ABSENT is not set | ||
422 | |||
423 | # | ||
424 | # Mapping drivers for chip access | ||
425 | # | ||
426 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | ||
427 | CONFIG_MTD_PHYSMAP=y | ||
428 | # CONFIG_MTD_PHYSMAP_COMPAT is not set | ||
429 | # CONFIG_MTD_ARM_INTEGRATOR is not set | ||
430 | # CONFIG_MTD_PLATRAM is not set | ||
431 | |||
432 | # | ||
433 | # Self-contained MTD device drivers | ||
434 | # | ||
435 | # CONFIG_MTD_SLRAM is not set | ||
436 | # CONFIG_MTD_PHRAM is not set | ||
437 | # CONFIG_MTD_MTDRAM is not set | ||
438 | # CONFIG_MTD_BLOCK2MTD is not set | ||
439 | |||
440 | # | ||
441 | # Disk-On-Chip Device Drivers | ||
442 | # | ||
443 | # CONFIG_MTD_DOC2000 is not set | ||
444 | # CONFIG_MTD_DOC2001 is not set | ||
445 | # CONFIG_MTD_DOC2001PLUS is not set | ||
446 | # CONFIG_MTD_NAND is not set | ||
447 | # CONFIG_MTD_ONENAND is not set | ||
448 | |||
449 | # | ||
450 | # LPDDR flash memory drivers | ||
451 | # | ||
452 | # CONFIG_MTD_LPDDR is not set | ||
453 | |||
454 | # | ||
455 | # UBI - Unsorted block images | ||
456 | # | ||
457 | # CONFIG_MTD_UBI is not set | ||
458 | # CONFIG_PARPORT is not set | ||
459 | CONFIG_BLK_DEV=y | ||
460 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
461 | CONFIG_BLK_DEV_LOOP=y | ||
462 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
463 | |||
464 | # | ||
465 | # DRBD disabled because PROC_FS, INET or CONNECTOR not selected | ||
466 | # | ||
467 | CONFIG_BLK_DEV_RAM=y | ||
468 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
469 | CONFIG_BLK_DEV_RAM_SIZE=20000 | ||
470 | # CONFIG_BLK_DEV_XIP is not set | ||
471 | # CONFIG_CDROM_PKTCDVD is not set | ||
472 | # CONFIG_MISC_DEVICES is not set | ||
473 | CONFIG_HAVE_IDE=y | ||
474 | # CONFIG_IDE is not set | ||
475 | |||
476 | # | ||
477 | # SCSI device support | ||
478 | # | ||
479 | CONFIG_SCSI_MOD=y | ||
480 | # CONFIG_RAID_ATTRS is not set | ||
481 | CONFIG_SCSI=y | ||
482 | CONFIG_SCSI_DMA=y | ||
483 | # CONFIG_SCSI_TGT is not set | ||
484 | # CONFIG_SCSI_NETLINK is not set | ||
485 | CONFIG_SCSI_PROC_FS=y | ||
486 | |||
487 | # | ||
488 | # SCSI support type (disk, tape, CD-ROM) | ||
489 | # | ||
490 | CONFIG_BLK_DEV_SD=y | ||
491 | # CONFIG_CHR_DEV_ST is not set | ||
492 | # CONFIG_CHR_DEV_OSST is not set | ||
493 | # CONFIG_BLK_DEV_SR is not set | ||
494 | # CONFIG_CHR_DEV_SG is not set | ||
495 | # CONFIG_CHR_DEV_SCH is not set | ||
496 | # CONFIG_SCSI_MULTI_LUN is not set | ||
497 | # CONFIG_SCSI_CONSTANTS is not set | ||
498 | # CONFIG_SCSI_LOGGING is not set | ||
499 | # CONFIG_SCSI_SCAN_ASYNC is not set | ||
500 | CONFIG_SCSI_WAIT_SCAN=m | ||
501 | |||
502 | # | ||
503 | # SCSI Transports | ||
504 | # | ||
505 | # CONFIG_SCSI_SPI_ATTRS is not set | ||
506 | # CONFIG_SCSI_FC_ATTRS is not set | ||
507 | # CONFIG_SCSI_SAS_LIBSAS is not set | ||
508 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
509 | CONFIG_SCSI_LOWLEVEL=y | ||
510 | # CONFIG_LIBFC is not set | ||
511 | # CONFIG_LIBFCOE is not set | ||
512 | # CONFIG_SCSI_DEBUG is not set | ||
513 | # CONFIG_SCSI_DH is not set | ||
514 | # CONFIG_SCSI_OSD_INITIATOR is not set | ||
515 | CONFIG_ATA=y | ||
516 | # CONFIG_ATA_NONSTANDARD is not set | ||
517 | CONFIG_ATA_VERBOSE_ERROR=y | ||
518 | # CONFIG_SATA_PMP is not set | ||
519 | # CONFIG_ATA_SFF is not set | ||
520 | # CONFIG_MD is not set | ||
521 | # CONFIG_PHONE is not set | ||
522 | |||
523 | # | ||
524 | # Input device support | ||
525 | # | ||
526 | CONFIG_INPUT=y | ||
527 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
528 | # CONFIG_INPUT_POLLDEV is not set | ||
529 | # CONFIG_INPUT_SPARSEKMAP is not set | ||
530 | |||
531 | # | ||
532 | # Userland interfaces | ||
533 | # | ||
534 | CONFIG_INPUT_MOUSEDEV=y | ||
535 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
536 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
537 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
538 | # CONFIG_INPUT_JOYDEV is not set | ||
539 | # CONFIG_INPUT_EVDEV is not set | ||
540 | # CONFIG_INPUT_EVBUG is not set | ||
541 | |||
542 | # | ||
543 | # Input Device Drivers | ||
544 | # | ||
545 | # CONFIG_INPUT_KEYBOARD is not set | ||
546 | # CONFIG_INPUT_MOUSE is not set | ||
547 | # CONFIG_INPUT_JOYSTICK is not set | ||
548 | # CONFIG_INPUT_TABLET is not set | ||
549 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
550 | # CONFIG_INPUT_MISC is not set | ||
551 | |||
552 | # | ||
553 | # Hardware I/O ports | ||
554 | # | ||
555 | # CONFIG_SERIO is not set | ||
556 | # CONFIG_GAMEPORT is not set | ||
557 | |||
558 | # | ||
559 | # Character devices | ||
560 | # | ||
561 | CONFIG_VT=y | ||
562 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
563 | CONFIG_VT_CONSOLE=y | ||
564 | CONFIG_HW_CONSOLE=y | ||
565 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
566 | CONFIG_DEVKMEM=y | ||
567 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
568 | |||
569 | # | ||
570 | # Serial drivers | ||
571 | # | ||
572 | CONFIG_SERIAL_8250=y | ||
573 | CONFIG_SERIAL_8250_CONSOLE=y | ||
574 | CONFIG_SERIAL_8250_NR_UARTS=4 | ||
575 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | ||
576 | # CONFIG_SERIAL_8250_EXTENDED is not set | ||
577 | |||
578 | # | ||
579 | # Non-8250 serial port support | ||
580 | # | ||
581 | CONFIG_SERIAL_CORE=y | ||
582 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
583 | # CONFIG_SERIAL_TIMBERDALE is not set | ||
584 | CONFIG_UNIX98_PTYS=y | ||
585 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
586 | CONFIG_LEGACY_PTYS=y | ||
587 | CONFIG_LEGACY_PTY_COUNT=16 | ||
588 | # CONFIG_IPMI_HANDLER is not set | ||
589 | # CONFIG_HW_RANDOM is not set | ||
590 | # CONFIG_R3964 is not set | ||
591 | # CONFIG_RAW_DRIVER is not set | ||
592 | # CONFIG_TCG_TPM is not set | ||
593 | # CONFIG_I2C is not set | ||
594 | # CONFIG_SPI is not set | ||
595 | |||
596 | # | ||
597 | # PPS support | ||
598 | # | ||
599 | # CONFIG_PPS is not set | ||
600 | # CONFIG_W1 is not set | ||
601 | # CONFIG_POWER_SUPPLY is not set | ||
602 | # CONFIG_HWMON is not set | ||
603 | # CONFIG_THERMAL is not set | ||
604 | # CONFIG_WATCHDOG is not set | ||
605 | CONFIG_SSB_POSSIBLE=y | ||
606 | |||
607 | # | ||
608 | # Sonics Silicon Backplane | ||
609 | # | ||
610 | # CONFIG_SSB is not set | ||
611 | |||
612 | # | ||
613 | # Multifunction device drivers | ||
614 | # | ||
615 | # CONFIG_MFD_CORE is not set | ||
616 | # CONFIG_MFD_SM501 is not set | ||
617 | # CONFIG_HTC_PASIC3 is not set | ||
618 | # CONFIG_MFD_TMIO is not set | ||
619 | # CONFIG_REGULATOR is not set | ||
620 | # CONFIG_MEDIA_SUPPORT is not set | ||
621 | |||
622 | # | ||
623 | # Graphics support | ||
624 | # | ||
625 | # CONFIG_VGASTATE is not set | ||
626 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
627 | # CONFIG_FB is not set | ||
628 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
629 | |||
630 | # | ||
631 | # Display device support | ||
632 | # | ||
633 | # CONFIG_DISPLAY_SUPPORT is not set | ||
634 | |||
635 | # | ||
636 | # Console display driver support | ||
637 | # | ||
638 | # CONFIG_VGA_CONSOLE is not set | ||
639 | CONFIG_DUMMY_CONSOLE=y | ||
640 | # CONFIG_SOUND is not set | ||
641 | # CONFIG_HID_SUPPORT is not set | ||
642 | # CONFIG_USB_SUPPORT is not set | ||
643 | CONFIG_MMC=y | ||
644 | # CONFIG_MMC_DEBUG is not set | ||
645 | # CONFIG_MMC_UNSAFE_RESUME is not set | ||
646 | |||
647 | # | ||
648 | # MMC/SD/SDIO Card Drivers | ||
649 | # | ||
650 | CONFIG_MMC_BLOCK=y | ||
651 | CONFIG_MMC_BLOCK_BOUNCE=y | ||
652 | # CONFIG_SDIO_UART is not set | ||
653 | # CONFIG_MMC_TEST is not set | ||
654 | |||
655 | # | ||
656 | # MMC/SD/SDIO Host Controller Drivers | ||
657 | # | ||
658 | CONFIG_MMC_SDHCI=y | ||
659 | CONFIG_MMC_SDHCI_PLTFM=y | ||
660 | # CONFIG_MEMSTICK is not set | ||
661 | # CONFIG_NEW_LEDS is not set | ||
662 | # CONFIG_ACCESSIBILITY is not set | ||
663 | CONFIG_RTC_LIB=y | ||
664 | # CONFIG_RTC_CLASS is not set | ||
665 | # CONFIG_DMADEVICES is not set | ||
666 | # CONFIG_AUXDISPLAY is not set | ||
667 | # CONFIG_UIO is not set | ||
668 | |||
669 | # | ||
670 | # TI VLYNQ | ||
671 | # | ||
672 | # CONFIG_STAGING is not set | ||
673 | |||
674 | # | ||
675 | # File systems | ||
676 | # | ||
677 | CONFIG_EXT2_FS=y | ||
678 | CONFIG_EXT2_FS_XATTR=y | ||
679 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
680 | # CONFIG_EXT2_FS_SECURITY is not set | ||
681 | # CONFIG_EXT2_FS_XIP is not set | ||
682 | # CONFIG_EXT3_FS is not set | ||
683 | # CONFIG_EXT4_FS is not set | ||
684 | CONFIG_FS_MBCACHE=y | ||
685 | # CONFIG_REISERFS_FS is not set | ||
686 | # CONFIG_JFS_FS is not set | ||
687 | # CONFIG_FS_POSIX_ACL is not set | ||
688 | # CONFIG_XFS_FS is not set | ||
689 | # CONFIG_GFS2_FS is not set | ||
690 | # CONFIG_BTRFS_FS is not set | ||
691 | # CONFIG_NILFS2_FS is not set | ||
692 | CONFIG_FILE_LOCKING=y | ||
693 | CONFIG_FSNOTIFY=y | ||
694 | CONFIG_DNOTIFY=y | ||
695 | CONFIG_INOTIFY=y | ||
696 | CONFIG_INOTIFY_USER=y | ||
697 | # CONFIG_QUOTA is not set | ||
698 | # CONFIG_AUTOFS_FS is not set | ||
699 | CONFIG_AUTOFS4_FS=y | ||
700 | # CONFIG_FUSE_FS is not set | ||
701 | |||
702 | # | ||
703 | # Caches | ||
704 | # | ||
705 | CONFIG_FSCACHE=y | ||
706 | # CONFIG_FSCACHE_STATS is not set | ||
707 | # CONFIG_FSCACHE_HISTOGRAM is not set | ||
708 | # CONFIG_FSCACHE_DEBUG is not set | ||
709 | # CONFIG_FSCACHE_OBJECT_LIST is not set | ||
710 | # CONFIG_CACHEFILES is not set | ||
711 | |||
712 | # | ||
713 | # CD-ROM/DVD Filesystems | ||
714 | # | ||
715 | # CONFIG_ISO9660_FS is not set | ||
716 | # CONFIG_UDF_FS is not set | ||
717 | |||
718 | # | ||
719 | # DOS/FAT/NT Filesystems | ||
720 | # | ||
721 | # CONFIG_MSDOS_FS is not set | ||
722 | # CONFIG_VFAT_FS is not set | ||
723 | # CONFIG_NTFS_FS is not set | ||
724 | |||
725 | # | ||
726 | # Pseudo filesystems | ||
727 | # | ||
728 | CONFIG_PROC_FS=y | ||
729 | CONFIG_PROC_SYSCTL=y | ||
730 | CONFIG_PROC_PAGE_MONITOR=y | ||
731 | CONFIG_SYSFS=y | ||
732 | CONFIG_TMPFS=y | ||
733 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
734 | # CONFIG_HUGETLB_PAGE is not set | ||
735 | # CONFIG_CONFIGFS_FS is not set | ||
736 | CONFIG_MISC_FILESYSTEMS=y | ||
737 | # CONFIG_ADFS_FS is not set | ||
738 | # CONFIG_AFFS_FS is not set | ||
739 | # CONFIG_HFS_FS is not set | ||
740 | # CONFIG_HFSPLUS_FS is not set | ||
741 | # CONFIG_BEFS_FS is not set | ||
742 | # CONFIG_BFS_FS is not set | ||
743 | # CONFIG_EFS_FS is not set | ||
744 | # CONFIG_JFFS2_FS is not set | ||
745 | # CONFIG_LOGFS is not set | ||
746 | # CONFIG_CRAMFS is not set | ||
747 | # CONFIG_SQUASHFS is not set | ||
748 | # CONFIG_VXFS_FS is not set | ||
749 | # CONFIG_MINIX_FS is not set | ||
750 | # CONFIG_OMFS_FS is not set | ||
751 | # CONFIG_HPFS_FS is not set | ||
752 | # CONFIG_QNX4FS_FS is not set | ||
753 | # CONFIG_ROMFS_FS is not set | ||
754 | # CONFIG_SYSV_FS is not set | ||
755 | # CONFIG_UFS_FS is not set | ||
756 | |||
757 | # | ||
758 | # Partition Types | ||
759 | # | ||
760 | # CONFIG_PARTITION_ADVANCED is not set | ||
761 | CONFIG_MSDOS_PARTITION=y | ||
762 | # CONFIG_NLS is not set | ||
763 | |||
764 | # | ||
765 | # Kernel hacking | ||
766 | # | ||
767 | # CONFIG_PRINTK_TIME is not set | ||
768 | # CONFIG_ENABLE_WARN_DEPRECATED is not set | ||
769 | # CONFIG_ENABLE_MUST_CHECK is not set | ||
770 | CONFIG_FRAME_WARN=1024 | ||
771 | # CONFIG_MAGIC_SYSRQ is not set | ||
772 | # CONFIG_STRIP_ASM_SYMS is not set | ||
773 | # CONFIG_UNUSED_SYMBOLS is not set | ||
774 | CONFIG_DEBUG_FS=y | ||
775 | # CONFIG_HEADERS_CHECK is not set | ||
776 | # CONFIG_DEBUG_KERNEL is not set | ||
777 | CONFIG_DEBUG_BUGVERBOSE=y | ||
778 | CONFIG_DEBUG_MEMORY_INIT=y | ||
779 | CONFIG_FRAME_POINTER=y | ||
780 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
781 | # CONFIG_LKDTM is not set | ||
782 | # CONFIG_LATENCYTOP is not set | ||
783 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
784 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
785 | CONFIG_RING_BUFFER=y | ||
786 | CONFIG_RING_BUFFER_ALLOW_SWAP=y | ||
787 | CONFIG_TRACING_SUPPORT=y | ||
788 | # CONFIG_FTRACE is not set | ||
789 | # CONFIG_DYNAMIC_DEBUG is not set | ||
790 | # CONFIG_SAMPLES is not set | ||
791 | CONFIG_HAVE_ARCH_KGDB=y | ||
792 | # CONFIG_ARM_UNWIND is not set | ||
793 | # CONFIG_DEBUG_USER is not set | ||
794 | # CONFIG_OC_ETM is not set | ||
795 | |||
796 | # | ||
797 | # Security options | ||
798 | # | ||
799 | # CONFIG_KEYS is not set | ||
800 | # CONFIG_SECURITY is not set | ||
801 | # CONFIG_SECURITYFS is not set | ||
802 | # CONFIG_DEFAULT_SECURITY_SELINUX is not set | ||
803 | # CONFIG_DEFAULT_SECURITY_SMACK is not set | ||
804 | # CONFIG_DEFAULT_SECURITY_TOMOYO is not set | ||
805 | CONFIG_DEFAULT_SECURITY_DAC=y | ||
806 | CONFIG_DEFAULT_SECURITY="" | ||
807 | # CONFIG_CRYPTO is not set | ||
808 | # CONFIG_BINARY_PRINTF is not set | ||
809 | |||
810 | # | ||
811 | # Library routines | ||
812 | # | ||
813 | CONFIG_BITREVERSE=y | ||
814 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
815 | CONFIG_CRC_CCITT=y | ||
816 | # CONFIG_CRC16 is not set | ||
817 | # CONFIG_CRC_T10DIF is not set | ||
818 | # CONFIG_CRC_ITU_T is not set | ||
819 | CONFIG_CRC32=y | ||
820 | # CONFIG_CRC7 is not set | ||
821 | # CONFIG_LIBCRC32C is not set | ||
822 | CONFIG_ZLIB_INFLATE=y | ||
823 | CONFIG_LZO_DECOMPRESS=y | ||
824 | CONFIG_DECOMPRESS_GZIP=y | ||
825 | CONFIG_DECOMPRESS_BZIP2=y | ||
826 | CONFIG_DECOMPRESS_LZMA=y | ||
827 | CONFIG_DECOMPRESS_LZO=y | ||
828 | CONFIG_HAS_IOMEM=y | ||
829 | CONFIG_HAS_IOPORT=y | ||
830 | CONFIG_HAS_DMA=y | ||
831 | CONFIG_GENERIC_ATOMIC64=y | ||
diff --git a/arch/arm/configs/mmp2_defconfig b/arch/arm/configs/mmp2_defconfig index 03f76cfc941c..4b55dcb60029 100644 --- a/arch/arm/configs/mmp2_defconfig +++ b/arch/arm/configs/mmp2_defconfig | |||
@@ -1,13 +1,14 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.33-rc2 | 3 | # Linux kernel version: 2.6.34-rc5 |
4 | # Tue Jan 5 13:55:22 2010 | 4 | # Wed Apr 28 11:23:19 2010 |
5 | # | 5 | # |
6 | CONFIG_ARM=y | 6 | CONFIG_ARM=y |
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | 7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y |
8 | CONFIG_GENERIC_GPIO=y | 8 | CONFIG_GENERIC_GPIO=y |
9 | CONFIG_GENERIC_TIME=y | 9 | CONFIG_GENERIC_TIME=y |
10 | CONFIG_GENERIC_CLOCKEVENTS=y | 10 | CONFIG_GENERIC_CLOCKEVENTS=y |
11 | CONFIG_HAVE_PROC_CPU=y | ||
11 | CONFIG_GENERIC_HARDIRQS=y | 12 | CONFIG_GENERIC_HARDIRQS=y |
12 | CONFIG_STACKTRACE_SUPPORT=y | 13 | CONFIG_STACKTRACE_SUPPORT=y |
13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | 14 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y |
@@ -18,6 +19,7 @@ CONFIG_GENERIC_IRQ_PROBE=y | |||
18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 19 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
19 | CONFIG_GENERIC_HWEIGHT=y | 20 | CONFIG_GENERIC_HWEIGHT=y |
20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 21 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
22 | CONFIG_NEED_DMA_MAP_STATE=y | ||
21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | 23 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y |
22 | CONFIG_VECTORS_BASE=0xffff0000 | 24 | CONFIG_VECTORS_BASE=0xffff0000 |
23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | 25 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
@@ -32,6 +34,12 @@ CONFIG_LOCK_KERNEL=y | |||
32 | CONFIG_INIT_ENV_ARG_LIMIT=32 | 34 | CONFIG_INIT_ENV_ARG_LIMIT=32 |
33 | CONFIG_LOCALVERSION="" | 35 | CONFIG_LOCALVERSION="" |
34 | CONFIG_LOCALVERSION_AUTO=y | 36 | CONFIG_LOCALVERSION_AUTO=y |
37 | CONFIG_HAVE_KERNEL_GZIP=y | ||
38 | CONFIG_HAVE_KERNEL_LZO=y | ||
39 | CONFIG_KERNEL_GZIP=y | ||
40 | # CONFIG_KERNEL_BZIP2 is not set | ||
41 | # CONFIG_KERNEL_LZMA is not set | ||
42 | # CONFIG_KERNEL_LZO is not set | ||
35 | CONFIG_SWAP=y | 43 | CONFIG_SWAP=y |
36 | CONFIG_SYSVIPC=y | 44 | CONFIG_SYSVIPC=y |
37 | CONFIG_SYSVIPC_SYSCTL=y | 45 | CONFIG_SYSVIPC_SYSCTL=y |
@@ -52,7 +60,6 @@ CONFIG_RCU_FANOUT=32 | |||
52 | # CONFIG_TREE_RCU_TRACE is not set | 60 | # CONFIG_TREE_RCU_TRACE is not set |
53 | # CONFIG_IKCONFIG is not set | 61 | # CONFIG_IKCONFIG is not set |
54 | CONFIG_LOG_BUF_SHIFT=14 | 62 | CONFIG_LOG_BUF_SHIFT=14 |
55 | # CONFIG_GROUP_SCHED is not set | ||
56 | # CONFIG_CGROUPS is not set | 63 | # CONFIG_CGROUPS is not set |
57 | CONFIG_SYSFS_DEPRECATED=y | 64 | CONFIG_SYSFS_DEPRECATED=y |
58 | CONFIG_SYSFS_DEPRECATED_V2=y | 65 | CONFIG_SYSFS_DEPRECATED_V2=y |
@@ -85,10 +92,14 @@ CONFIG_TIMERFD=y | |||
85 | CONFIG_EVENTFD=y | 92 | CONFIG_EVENTFD=y |
86 | CONFIG_SHMEM=y | 93 | CONFIG_SHMEM=y |
87 | CONFIG_AIO=y | 94 | CONFIG_AIO=y |
95 | CONFIG_HAVE_PERF_EVENTS=y | ||
96 | CONFIG_PERF_USE_VMALLOC=y | ||
88 | 97 | ||
89 | # | 98 | # |
90 | # Kernel Performance Events And Counters | 99 | # Kernel Performance Events And Counters |
91 | # | 100 | # |
101 | # CONFIG_PERF_EVENTS is not set | ||
102 | # CONFIG_PERF_COUNTERS is not set | ||
92 | CONFIG_VM_EVENT_COUNTERS=y | 103 | CONFIG_VM_EVENT_COUNTERS=y |
93 | CONFIG_COMPAT_BRK=y | 104 | CONFIG_COMPAT_BRK=y |
94 | CONFIG_SLAB=y | 105 | CONFIG_SLAB=y |
@@ -104,6 +115,7 @@ CONFIG_HAVE_CLK=y | |||
104 | # | 115 | # |
105 | # GCOV-based kernel profiling | 116 | # GCOV-based kernel profiling |
106 | # | 117 | # |
118 | # CONFIG_GCOV_KERNEL is not set | ||
107 | # CONFIG_SLOW_WORK is not set | 119 | # CONFIG_SLOW_WORK is not set |
108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | 120 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y |
109 | CONFIG_SLABINFO=y | 121 | CONFIG_SLABINFO=y |
@@ -170,6 +182,7 @@ CONFIG_MMU=y | |||
170 | # CONFIG_ARCH_REALVIEW is not set | 182 | # CONFIG_ARCH_REALVIEW is not set |
171 | # CONFIG_ARCH_VERSATILE is not set | 183 | # CONFIG_ARCH_VERSATILE is not set |
172 | # CONFIG_ARCH_AT91 is not set | 184 | # CONFIG_ARCH_AT91 is not set |
185 | # CONFIG_ARCH_BCMRING is not set | ||
173 | # CONFIG_ARCH_CLPS711X is not set | 186 | # CONFIG_ARCH_CLPS711X is not set |
174 | # CONFIG_ARCH_GEMINI is not set | 187 | # CONFIG_ARCH_GEMINI is not set |
175 | # CONFIG_ARCH_EBSA110 is not set | 188 | # CONFIG_ARCH_EBSA110 is not set |
@@ -179,7 +192,6 @@ CONFIG_MMU=y | |||
179 | # CONFIG_ARCH_STMP3XXX is not set | 192 | # CONFIG_ARCH_STMP3XXX is not set |
180 | # CONFIG_ARCH_NETX is not set | 193 | # CONFIG_ARCH_NETX is not set |
181 | # CONFIG_ARCH_H720X is not set | 194 | # CONFIG_ARCH_H720X is not set |
182 | # CONFIG_ARCH_NOMADIK is not set | ||
183 | # CONFIG_ARCH_IOP13XX is not set | 195 | # CONFIG_ARCH_IOP13XX is not set |
184 | # CONFIG_ARCH_IOP32X is not set | 196 | # CONFIG_ARCH_IOP32X is not set |
185 | # CONFIG_ARCH_IOP33X is not set | 197 | # CONFIG_ARCH_IOP33X is not set |
@@ -196,21 +208,26 @@ CONFIG_ARCH_MMP=y | |||
196 | # CONFIG_ARCH_KS8695 is not set | 208 | # CONFIG_ARCH_KS8695 is not set |
197 | # CONFIG_ARCH_NS9XXX is not set | 209 | # CONFIG_ARCH_NS9XXX is not set |
198 | # CONFIG_ARCH_W90X900 is not set | 210 | # CONFIG_ARCH_W90X900 is not set |
211 | # CONFIG_ARCH_NUC93X is not set | ||
199 | # CONFIG_ARCH_PNX4008 is not set | 212 | # CONFIG_ARCH_PNX4008 is not set |
200 | # CONFIG_ARCH_PXA is not set | 213 | # CONFIG_ARCH_PXA is not set |
201 | # CONFIG_ARCH_MSM is not set | 214 | # CONFIG_ARCH_MSM is not set |
215 | # CONFIG_ARCH_SHMOBILE is not set | ||
202 | # CONFIG_ARCH_RPC is not set | 216 | # CONFIG_ARCH_RPC is not set |
203 | # CONFIG_ARCH_SA1100 is not set | 217 | # CONFIG_ARCH_SA1100 is not set |
204 | # CONFIG_ARCH_S3C2410 is not set | 218 | # CONFIG_ARCH_S3C2410 is not set |
205 | # CONFIG_ARCH_S3C64XX is not set | 219 | # CONFIG_ARCH_S3C64XX is not set |
220 | # CONFIG_ARCH_S5P6440 is not set | ||
221 | # CONFIG_ARCH_S5P6442 is not set | ||
206 | # CONFIG_ARCH_S5PC1XX is not set | 222 | # CONFIG_ARCH_S5PC1XX is not set |
223 | # CONFIG_ARCH_S5PV210 is not set | ||
207 | # CONFIG_ARCH_SHARK is not set | 224 | # CONFIG_ARCH_SHARK is not set |
208 | # CONFIG_ARCH_LH7A40X is not set | 225 | # CONFIG_ARCH_LH7A40X is not set |
209 | # CONFIG_ARCH_U300 is not set | 226 | # CONFIG_ARCH_U300 is not set |
227 | # CONFIG_ARCH_U8500 is not set | ||
228 | # CONFIG_ARCH_NOMADIK is not set | ||
210 | # CONFIG_ARCH_DAVINCI is not set | 229 | # CONFIG_ARCH_DAVINCI is not set |
211 | # CONFIG_ARCH_OMAP is not set | 230 | # CONFIG_ARCH_OMAP is not set |
212 | # CONFIG_ARCH_BCMRING is not set | ||
213 | # CONFIG_ARCH_U8500 is not set | ||
214 | # CONFIG_MACH_TAVOREVB is not set | 231 | # CONFIG_MACH_TAVOREVB is not set |
215 | 232 | ||
216 | # | 233 | # |
@@ -218,8 +235,10 @@ CONFIG_ARCH_MMP=y | |||
218 | # | 235 | # |
219 | # CONFIG_MACH_ASPENITE is not set | 236 | # CONFIG_MACH_ASPENITE is not set |
220 | # CONFIG_MACH_ZYLONITE2 is not set | 237 | # CONFIG_MACH_ZYLONITE2 is not set |
238 | # CONFIG_MACH_AVENGERS_LITE is not set | ||
221 | # CONFIG_MACH_TTC_DKB is not set | 239 | # CONFIG_MACH_TTC_DKB is not set |
222 | CONFIG_MACH_FLINT=y | 240 | CONFIG_MACH_FLINT=y |
241 | CONFIG_MACH_MARVELL_JASPER=y | ||
223 | CONFIG_CPU_MMP2=y | 242 | CONFIG_CPU_MMP2=y |
224 | CONFIG_PLAT_PXA=y | 243 | CONFIG_PLAT_PXA=y |
225 | 244 | ||
@@ -246,7 +265,10 @@ CONFIG_ARM_THUMB=y | |||
246 | # CONFIG_CPU_ICACHE_DISABLE is not set | 265 | # CONFIG_CPU_ICACHE_DISABLE is not set |
247 | # CONFIG_CPU_DCACHE_DISABLE is not set | 266 | # CONFIG_CPU_DCACHE_DISABLE is not set |
248 | # CONFIG_CPU_BPREDICT_DISABLE is not set | 267 | # CONFIG_CPU_BPREDICT_DISABLE is not set |
268 | CONFIG_OUTER_CACHE=y | ||
269 | CONFIG_CACHE_TAUROS2=y | ||
249 | CONFIG_ARM_L1_CACHE_SHIFT=5 | 270 | CONFIG_ARM_L1_CACHE_SHIFT=5 |
271 | CONFIG_CPU_HAS_PMU=y | ||
250 | # CONFIG_ARM_ERRATA_411920 is not set | 272 | # CONFIG_ARM_ERRATA_411920 is not set |
251 | CONFIG_COMMON_CLKDEV=y | 273 | CONFIG_COMMON_CLKDEV=y |
252 | 274 | ||
@@ -298,7 +320,7 @@ CONFIG_ALIGNMENT_TRAP=y | |||
298 | # | 320 | # |
299 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 321 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
300 | CONFIG_ZBOOT_ROM_BSS=0x0 | 322 | CONFIG_ZBOOT_ROM_BSS=0x0 |
301 | CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M user_debug=255" | 323 | CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on console=ttyS2,38400 mem=128M user_debug=255" |
302 | # CONFIG_XIP_KERNEL is not set | 324 | # CONFIG_XIP_KERNEL is not set |
303 | # CONFIG_KEXEC is not set | 325 | # CONFIG_KEXEC is not set |
304 | 326 | ||
@@ -338,7 +360,6 @@ CONFIG_NET=y | |||
338 | # Networking options | 360 | # Networking options |
339 | # | 361 | # |
340 | CONFIG_PACKET=y | 362 | CONFIG_PACKET=y |
341 | # CONFIG_PACKET_MMAP is not set | ||
342 | CONFIG_UNIX=y | 363 | CONFIG_UNIX=y |
343 | CONFIG_XFRM=y | 364 | CONFIG_XFRM=y |
344 | # CONFIG_XFRM_USER is not set | 365 | # CONFIG_XFRM_USER is not set |
@@ -532,6 +553,7 @@ CONFIG_HAVE_IDE=y | |||
532 | # | 553 | # |
533 | # SCSI device support | 554 | # SCSI device support |
534 | # | 555 | # |
556 | CONFIG_SCSI_MOD=y | ||
535 | # CONFIG_RAID_ATTRS is not set | 557 | # CONFIG_RAID_ATTRS is not set |
536 | # CONFIG_SCSI is not set | 558 | # CONFIG_SCSI is not set |
537 | # CONFIG_SCSI_DMA is not set | 559 | # CONFIG_SCSI_DMA is not set |
@@ -640,6 +662,7 @@ CONFIG_SERIAL_PXA=y | |||
640 | CONFIG_SERIAL_PXA_CONSOLE=y | 662 | CONFIG_SERIAL_PXA_CONSOLE=y |
641 | CONFIG_SERIAL_CORE=y | 663 | CONFIG_SERIAL_CORE=y |
642 | CONFIG_SERIAL_CORE_CONSOLE=y | 664 | CONFIG_SERIAL_CORE_CONSOLE=y |
665 | # CONFIG_SERIAL_TIMBERDALE is not set | ||
643 | CONFIG_UNIX98_PTYS=y | 666 | CONFIG_UNIX98_PTYS=y |
644 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | 667 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set |
645 | # CONFIG_LEGACY_PTYS is not set | 668 | # CONFIG_LEGACY_PTYS is not set |
@@ -667,6 +690,7 @@ CONFIG_I2C_HELPER_AUTO=y | |||
667 | CONFIG_I2C_PXA=y | 690 | CONFIG_I2C_PXA=y |
668 | # CONFIG_I2C_PXA_SLAVE is not set | 691 | # CONFIG_I2C_PXA_SLAVE is not set |
669 | # CONFIG_I2C_SIMTEC is not set | 692 | # CONFIG_I2C_SIMTEC is not set |
693 | # CONFIG_I2C_XILINX is not set | ||
670 | 694 | ||
671 | # | 695 | # |
672 | # External I2C/SMBus adapter drivers | 696 | # External I2C/SMBus adapter drivers |
@@ -679,15 +703,9 @@ CONFIG_I2C_PXA=y | |||
679 | # | 703 | # |
680 | # CONFIG_I2C_PCA_PLATFORM is not set | 704 | # CONFIG_I2C_PCA_PLATFORM is not set |
681 | # CONFIG_I2C_STUB is not set | 705 | # CONFIG_I2C_STUB is not set |
682 | |||
683 | # | ||
684 | # Miscellaneous I2C Chip support | ||
685 | # | ||
686 | # CONFIG_SENSORS_TSL2550 is not set | ||
687 | # CONFIG_I2C_DEBUG_CORE is not set | 706 | # CONFIG_I2C_DEBUG_CORE is not set |
688 | # CONFIG_I2C_DEBUG_ALGO is not set | 707 | # CONFIG_I2C_DEBUG_ALGO is not set |
689 | # CONFIG_I2C_DEBUG_BUS is not set | 708 | # CONFIG_I2C_DEBUG_BUS is not set |
690 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
691 | # CONFIG_SPI is not set | 709 | # CONFIG_SPI is not set |
692 | 710 | ||
693 | # | 711 | # |
@@ -702,13 +720,16 @@ CONFIG_GPIOLIB=y | |||
702 | # | 720 | # |
703 | # Memory mapped GPIO expanders: | 721 | # Memory mapped GPIO expanders: |
704 | # | 722 | # |
723 | # CONFIG_GPIO_IT8761E is not set | ||
705 | 724 | ||
706 | # | 725 | # |
707 | # I2C GPIO expanders: | 726 | # I2C GPIO expanders: |
708 | # | 727 | # |
728 | # CONFIG_GPIO_MAX7300 is not set | ||
709 | # CONFIG_GPIO_MAX732X is not set | 729 | # CONFIG_GPIO_MAX732X is not set |
710 | # CONFIG_GPIO_PCA953X is not set | 730 | # CONFIG_GPIO_PCA953X is not set |
711 | # CONFIG_GPIO_PCF857X is not set | 731 | # CONFIG_GPIO_PCF857X is not set |
732 | # CONFIG_GPIO_ADP5588 is not set | ||
712 | 733 | ||
713 | # | 734 | # |
714 | # PCI GPIO expanders: | 735 | # PCI GPIO expanders: |
@@ -737,10 +758,12 @@ CONFIG_SSB_POSSIBLE=y | |||
737 | # Multifunction device drivers | 758 | # Multifunction device drivers |
738 | # | 759 | # |
739 | CONFIG_MFD_CORE=y | 760 | CONFIG_MFD_CORE=y |
761 | # CONFIG_MFD_88PM860X is not set | ||
740 | # CONFIG_MFD_SM501 is not set | 762 | # CONFIG_MFD_SM501 is not set |
741 | # CONFIG_MFD_ASIC3 is not set | 763 | # CONFIG_MFD_ASIC3 is not set |
742 | # CONFIG_HTC_EGPIO is not set | 764 | # CONFIG_HTC_EGPIO is not set |
743 | # CONFIG_HTC_PASIC3 is not set | 765 | # CONFIG_HTC_PASIC3 is not set |
766 | # CONFIG_HTC_I2CPLD is not set | ||
744 | # CONFIG_TPS65010 is not set | 767 | # CONFIG_TPS65010 is not set |
745 | # CONFIG_TWL4030_CORE is not set | 768 | # CONFIG_TWL4030_CORE is not set |
746 | # CONFIG_MFD_TMIO is not set | 769 | # CONFIG_MFD_TMIO is not set |
@@ -749,24 +772,27 @@ CONFIG_MFD_CORE=y | |||
749 | # CONFIG_MFD_TC6393XB is not set | 772 | # CONFIG_MFD_TC6393XB is not set |
750 | # CONFIG_PMIC_DA903X is not set | 773 | # CONFIG_PMIC_DA903X is not set |
751 | # CONFIG_PMIC_ADP5520 is not set | 774 | # CONFIG_PMIC_ADP5520 is not set |
775 | CONFIG_MFD_MAX8925=y | ||
752 | # CONFIG_MFD_WM8400 is not set | 776 | # CONFIG_MFD_WM8400 is not set |
753 | # CONFIG_MFD_WM831X is not set | 777 | # CONFIG_MFD_WM831X is not set |
754 | # CONFIG_MFD_WM8350_I2C is not set | 778 | # CONFIG_MFD_WM8350_I2C is not set |
779 | # CONFIG_MFD_WM8994 is not set | ||
755 | # CONFIG_MFD_PCF50633 is not set | 780 | # CONFIG_MFD_PCF50633 is not set |
756 | # CONFIG_AB3100_CORE is not set | 781 | # CONFIG_AB3100_CORE is not set |
757 | CONFIG_MFD_88PM8607=y | ||
758 | CONFIG_REGULATOR=y | 782 | CONFIG_REGULATOR=y |
759 | # CONFIG_REGULATOR_DEBUG is not set | 783 | # CONFIG_REGULATOR_DEBUG is not set |
784 | # CONFIG_REGULATOR_DUMMY is not set | ||
760 | # CONFIG_REGULATOR_FIXED_VOLTAGE is not set | 785 | # CONFIG_REGULATOR_FIXED_VOLTAGE is not set |
761 | # CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set | 786 | # CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set |
762 | # CONFIG_REGULATOR_USERSPACE_CONSUMER is not set | 787 | # CONFIG_REGULATOR_USERSPACE_CONSUMER is not set |
763 | # CONFIG_REGULATOR_BQ24022 is not set | 788 | # CONFIG_REGULATOR_BQ24022 is not set |
764 | # CONFIG_REGULATOR_MAX1586 is not set | 789 | # CONFIG_REGULATOR_MAX1586 is not set |
765 | CONFIG_REGULATOR_MAX8660=y | 790 | CONFIG_REGULATOR_MAX8649=y |
791 | # CONFIG_REGULATOR_MAX8660 is not set | ||
792 | CONFIG_REGULATOR_MAX8925=y | ||
766 | # CONFIG_REGULATOR_LP3971 is not set | 793 | # CONFIG_REGULATOR_LP3971 is not set |
767 | # CONFIG_REGULATOR_TPS65023 is not set | 794 | # CONFIG_REGULATOR_TPS65023 is not set |
768 | # CONFIG_REGULATOR_TPS6507X is not set | 795 | # CONFIG_REGULATOR_TPS6507X is not set |
769 | CONFIG_REGULATOR_88PM8607=y | ||
770 | # CONFIG_MEDIA_SUPPORT is not set | 796 | # CONFIG_MEDIA_SUPPORT is not set |
771 | 797 | ||
772 | # | 798 | # |
@@ -781,6 +807,7 @@ CONFIG_LCD_CLASS_DEVICE=y | |||
781 | # CONFIG_LCD_PLATFORM is not set | 807 | # CONFIG_LCD_PLATFORM is not set |
782 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | 808 | CONFIG_BACKLIGHT_CLASS_DEVICE=y |
783 | CONFIG_BACKLIGHT_GENERIC=y | 809 | CONFIG_BACKLIGHT_GENERIC=y |
810 | CONFIG_BACKLIGHT_MAX8925=y | ||
784 | 811 | ||
785 | # | 812 | # |
786 | # Display device support | 813 | # Display device support |
@@ -821,6 +848,7 @@ CONFIG_RTC_INTF_DEV=y | |||
821 | # CONFIG_RTC_DRV_DS1374 is not set | 848 | # CONFIG_RTC_DRV_DS1374 is not set |
822 | # CONFIG_RTC_DRV_DS1672 is not set | 849 | # CONFIG_RTC_DRV_DS1672 is not set |
823 | # CONFIG_RTC_DRV_MAX6900 is not set | 850 | # CONFIG_RTC_DRV_MAX6900 is not set |
851 | CONFIG_RTC_DRV_MAX8925=y | ||
824 | # CONFIG_RTC_DRV_RS5C372 is not set | 852 | # CONFIG_RTC_DRV_RS5C372 is not set |
825 | # CONFIG_RTC_DRV_ISL1208 is not set | 853 | # CONFIG_RTC_DRV_ISL1208 is not set |
826 | # CONFIG_RTC_DRV_X1205 is not set | 854 | # CONFIG_RTC_DRV_X1205 is not set |
@@ -872,7 +900,6 @@ CONFIG_RTC_INTF_DEV=y | |||
872 | # CONFIG_EXT2_FS is not set | 900 | # CONFIG_EXT2_FS is not set |
873 | # CONFIG_EXT3_FS is not set | 901 | # CONFIG_EXT3_FS is not set |
874 | # CONFIG_EXT4_FS is not set | 902 | # CONFIG_EXT4_FS is not set |
875 | CONFIG_EXT4_USE_FOR_EXT23=y | ||
876 | # CONFIG_REISERFS_FS is not set | 903 | # CONFIG_REISERFS_FS is not set |
877 | # CONFIG_JFS_FS is not set | 904 | # CONFIG_JFS_FS is not set |
878 | CONFIG_FS_POSIX_ACL=y | 905 | CONFIG_FS_POSIX_ACL=y |
@@ -883,7 +910,7 @@ CONFIG_FS_POSIX_ACL=y | |||
883 | # CONFIG_NILFS2_FS is not set | 910 | # CONFIG_NILFS2_FS is not set |
884 | CONFIG_FILE_LOCKING=y | 911 | CONFIG_FILE_LOCKING=y |
885 | CONFIG_FSNOTIFY=y | 912 | CONFIG_FSNOTIFY=y |
886 | CONFIG_DNOTIFY=y | 913 | # CONFIG_DNOTIFY is not set |
887 | CONFIG_INOTIFY=y | 914 | CONFIG_INOTIFY=y |
888 | CONFIG_INOTIFY_USER=y | 915 | CONFIG_INOTIFY_USER=y |
889 | # CONFIG_QUOTA is not set | 916 | # CONFIG_QUOTA is not set |
@@ -940,6 +967,7 @@ CONFIG_JFFS2_ZLIB=y | |||
940 | # CONFIG_JFFS2_LZO is not set | 967 | # CONFIG_JFFS2_LZO is not set |
941 | CONFIG_JFFS2_RTIME=y | 968 | CONFIG_JFFS2_RTIME=y |
942 | # CONFIG_JFFS2_RUBIN is not set | 969 | # CONFIG_JFFS2_RUBIN is not set |
970 | # CONFIG_LOGFS is not set | ||
943 | CONFIG_CRAMFS=y | 971 | CONFIG_CRAMFS=y |
944 | # CONFIG_SQUASHFS is not set | 972 | # CONFIG_SQUASHFS is not set |
945 | # CONFIG_VXFS_FS is not set | 973 | # CONFIG_VXFS_FS is not set |
@@ -967,6 +995,7 @@ CONFIG_SUNRPC_GSS=y | |||
967 | CONFIG_RPCSEC_GSS_KRB5=y | 995 | CONFIG_RPCSEC_GSS_KRB5=y |
968 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 996 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
969 | # CONFIG_SMB_FS is not set | 997 | # CONFIG_SMB_FS is not set |
998 | # CONFIG_CEPH_FS is not set | ||
970 | # CONFIG_CIFS is not set | 999 | # CONFIG_CIFS is not set |
971 | # CONFIG_NCP_FS is not set | 1000 | # CONFIG_NCP_FS is not set |
972 | # CONFIG_CODA_FS is not set | 1001 | # CONFIG_CODA_FS is not set |
@@ -990,7 +1019,7 @@ CONFIG_FRAME_WARN=1024 | |||
990 | CONFIG_MAGIC_SYSRQ=y | 1019 | CONFIG_MAGIC_SYSRQ=y |
991 | # CONFIG_STRIP_ASM_SYMS is not set | 1020 | # CONFIG_STRIP_ASM_SYMS is not set |
992 | # CONFIG_UNUSED_SYMBOLS is not set | 1021 | # CONFIG_UNUSED_SYMBOLS is not set |
993 | # CONFIG_DEBUG_FS is not set | 1022 | CONFIG_DEBUG_FS=y |
994 | # CONFIG_HEADERS_CHECK is not set | 1023 | # CONFIG_HEADERS_CHECK is not set |
995 | CONFIG_DEBUG_KERNEL=y | 1024 | CONFIG_DEBUG_KERNEL=y |
996 | # CONFIG_DEBUG_SHIRQ is not set | 1025 | # CONFIG_DEBUG_SHIRQ is not set |
@@ -1032,6 +1061,7 @@ CONFIG_DEBUG_MEMORY_INIT=y | |||
1032 | # CONFIG_BACKTRACE_SELF_TEST is not set | 1061 | # CONFIG_BACKTRACE_SELF_TEST is not set |
1033 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | 1062 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set |
1034 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | 1063 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set |
1064 | # CONFIG_LKDTM is not set | ||
1035 | # CONFIG_FAULT_INJECTION is not set | 1065 | # CONFIG_FAULT_INJECTION is not set |
1036 | # CONFIG_LATENCYTOP is not set | 1066 | # CONFIG_LATENCYTOP is not set |
1037 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | 1067 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set |
@@ -1052,6 +1082,7 @@ CONFIG_BRANCH_PROFILE_NONE=y | |||
1052 | # CONFIG_KMEMTRACE is not set | 1082 | # CONFIG_KMEMTRACE is not set |
1053 | # CONFIG_WORKQUEUE_TRACER is not set | 1083 | # CONFIG_WORKQUEUE_TRACER is not set |
1054 | # CONFIG_BLK_DEV_IO_TRACE is not set | 1084 | # CONFIG_BLK_DEV_IO_TRACE is not set |
1085 | CONFIG_DYNAMIC_DEBUG=y | ||
1055 | # CONFIG_SAMPLES is not set | 1086 | # CONFIG_SAMPLES is not set |
1056 | CONFIG_HAVE_ARCH_KGDB=y | 1087 | CONFIG_HAVE_ARCH_KGDB=y |
1057 | # CONFIG_KGDB is not set | 1088 | # CONFIG_KGDB is not set |
@@ -1059,9 +1090,7 @@ CONFIG_ARM_UNWIND=y | |||
1059 | CONFIG_DEBUG_USER=y | 1090 | CONFIG_DEBUG_USER=y |
1060 | CONFIG_DEBUG_ERRORS=y | 1091 | CONFIG_DEBUG_ERRORS=y |
1061 | # CONFIG_DEBUG_STACK_USAGE is not set | 1092 | # CONFIG_DEBUG_STACK_USAGE is not set |
1062 | CONFIG_DEBUG_LL=y | 1093 | # CONFIG_DEBUG_LL is not set |
1063 | # CONFIG_EARLY_PRINTK is not set | ||
1064 | # CONFIG_DEBUG_ICEDCC is not set | ||
1065 | # CONFIG_OC_ETM is not set | 1094 | # CONFIG_OC_ETM is not set |
1066 | 1095 | ||
1067 | # | 1096 | # |
diff --git a/arch/arm/configs/spear300_defconfig b/arch/arm/configs/spear300_defconfig new file mode 100644 index 000000000000..35e64d1cb750 --- /dev/null +++ b/arch/arm/configs/spear300_defconfig | |||
@@ -0,0 +1,773 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.32 | ||
4 | # Tue Mar 23 14:36:23 2010 | ||
5 | # | ||
6 | CONFIG_ARM=y | ||
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
8 | CONFIG_GENERIC_GPIO=y | ||
9 | CONFIG_GENERIC_TIME=y | ||
10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
11 | CONFIG_GENERIC_HARDIRQS=y | ||
12 | CONFIG_STACKTRACE_SUPPORT=y | ||
13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
14 | CONFIG_LOCKDEP_SUPPORT=y | ||
15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
19 | CONFIG_GENERIC_HWEIGHT=y | ||
20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
22 | CONFIG_VECTORS_BASE=0xffff0000 | ||
23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
24 | CONFIG_CONSTRUCTORS=y | ||
25 | |||
26 | # | ||
27 | # General setup | ||
28 | # | ||
29 | CONFIG_EXPERIMENTAL=y | ||
30 | CONFIG_BROKEN_ON_SMP=y | ||
31 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
32 | CONFIG_LOCALVERSION="" | ||
33 | CONFIG_LOCALVERSION_AUTO=y | ||
34 | CONFIG_SWAP=y | ||
35 | CONFIG_SYSVIPC=y | ||
36 | CONFIG_SYSVIPC_SYSCTL=y | ||
37 | CONFIG_BSD_PROCESS_ACCT=y | ||
38 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
39 | |||
40 | # | ||
41 | # RCU Subsystem | ||
42 | # | ||
43 | CONFIG_TREE_RCU=y | ||
44 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
45 | # CONFIG_RCU_TRACE is not set | ||
46 | CONFIG_RCU_FANOUT=32 | ||
47 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
48 | # CONFIG_TREE_RCU_TRACE is not set | ||
49 | # CONFIG_IKCONFIG is not set | ||
50 | CONFIG_LOG_BUF_SHIFT=17 | ||
51 | # CONFIG_GROUP_SCHED is not set | ||
52 | # CONFIG_CGROUPS is not set | ||
53 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
54 | # CONFIG_RELAY is not set | ||
55 | CONFIG_NAMESPACES=y | ||
56 | # CONFIG_UTS_NS is not set | ||
57 | # CONFIG_IPC_NS is not set | ||
58 | # CONFIG_USER_NS is not set | ||
59 | # CONFIG_PID_NS is not set | ||
60 | CONFIG_BLK_DEV_INITRD=y | ||
61 | CONFIG_INITRAMFS_SOURCE="" | ||
62 | CONFIG_RD_GZIP=y | ||
63 | CONFIG_RD_BZIP2=y | ||
64 | CONFIG_RD_LZMA=y | ||
65 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
66 | CONFIG_SYSCTL=y | ||
67 | CONFIG_ANON_INODES=y | ||
68 | # CONFIG_EMBEDDED is not set | ||
69 | CONFIG_UID16=y | ||
70 | CONFIG_SYSCTL_SYSCALL=y | ||
71 | CONFIG_KALLSYMS=y | ||
72 | # CONFIG_KALLSYMS_ALL is not set | ||
73 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
74 | CONFIG_HOTPLUG=y | ||
75 | CONFIG_PRINTK=y | ||
76 | CONFIG_BUG=y | ||
77 | CONFIG_ELF_CORE=y | ||
78 | CONFIG_BASE_FULL=y | ||
79 | CONFIG_FUTEX=y | ||
80 | CONFIG_EPOLL=y | ||
81 | CONFIG_SIGNALFD=y | ||
82 | CONFIG_TIMERFD=y | ||
83 | CONFIG_EVENTFD=y | ||
84 | CONFIG_SHMEM=y | ||
85 | CONFIG_AIO=y | ||
86 | |||
87 | # | ||
88 | # Kernel Performance Events And Counters | ||
89 | # | ||
90 | CONFIG_VM_EVENT_COUNTERS=y | ||
91 | CONFIG_SLUB_DEBUG=y | ||
92 | CONFIG_COMPAT_BRK=y | ||
93 | # CONFIG_SLAB is not set | ||
94 | CONFIG_SLUB=y | ||
95 | # CONFIG_SLOB is not set | ||
96 | # CONFIG_PROFILING is not set | ||
97 | CONFIG_HAVE_OPROFILE=y | ||
98 | # CONFIG_KPROBES is not set | ||
99 | CONFIG_HAVE_KPROBES=y | ||
100 | CONFIG_HAVE_KRETPROBES=y | ||
101 | CONFIG_HAVE_CLK=y | ||
102 | |||
103 | # | ||
104 | # GCOV-based kernel profiling | ||
105 | # | ||
106 | # CONFIG_GCOV_KERNEL is not set | ||
107 | # CONFIG_SLOW_WORK is not set | ||
108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
109 | CONFIG_SLABINFO=y | ||
110 | CONFIG_RT_MUTEXES=y | ||
111 | CONFIG_BASE_SMALL=0 | ||
112 | CONFIG_MODULES=y | ||
113 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
114 | CONFIG_MODULE_UNLOAD=y | ||
115 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
116 | CONFIG_MODVERSIONS=y | ||
117 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
118 | CONFIG_BLOCK=y | ||
119 | CONFIG_LBDAF=y | ||
120 | CONFIG_BLK_DEV_BSG=y | ||
121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
122 | |||
123 | # | ||
124 | # IO Schedulers | ||
125 | # | ||
126 | CONFIG_IOSCHED_NOOP=y | ||
127 | CONFIG_IOSCHED_AS=y | ||
128 | CONFIG_IOSCHED_DEADLINE=y | ||
129 | CONFIG_IOSCHED_CFQ=y | ||
130 | # CONFIG_DEFAULT_AS is not set | ||
131 | # CONFIG_DEFAULT_DEADLINE is not set | ||
132 | CONFIG_DEFAULT_CFQ=y | ||
133 | # CONFIG_DEFAULT_NOOP is not set | ||
134 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
135 | # CONFIG_FREEZER is not set | ||
136 | |||
137 | # | ||
138 | # System Type | ||
139 | # | ||
140 | CONFIG_MMU=y | ||
141 | # CONFIG_ARCH_AAEC2000 is not set | ||
142 | # CONFIG_ARCH_INTEGRATOR is not set | ||
143 | # CONFIG_ARCH_REALVIEW is not set | ||
144 | # CONFIG_ARCH_VERSATILE is not set | ||
145 | # CONFIG_ARCH_AT91 is not set | ||
146 | # CONFIG_ARCH_CLPS711X is not set | ||
147 | # CONFIG_ARCH_GEMINI is not set | ||
148 | # CONFIG_ARCH_EBSA110 is not set | ||
149 | # CONFIG_ARCH_EP93XX is not set | ||
150 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
151 | # CONFIG_ARCH_MXC is not set | ||
152 | # CONFIG_ARCH_STMP3XXX is not set | ||
153 | # CONFIG_ARCH_NETX is not set | ||
154 | # CONFIG_ARCH_H720X is not set | ||
155 | # CONFIG_ARCH_NOMADIK is not set | ||
156 | # CONFIG_ARCH_IOP13XX is not set | ||
157 | # CONFIG_ARCH_IOP32X is not set | ||
158 | # CONFIG_ARCH_IOP33X is not set | ||
159 | # CONFIG_ARCH_IXP23XX is not set | ||
160 | # CONFIG_ARCH_IXP2000 is not set | ||
161 | # CONFIG_ARCH_IXP4XX is not set | ||
162 | # CONFIG_ARCH_L7200 is not set | ||
163 | # CONFIG_ARCH_KIRKWOOD is not set | ||
164 | # CONFIG_ARCH_LOKI is not set | ||
165 | # CONFIG_ARCH_MV78XX0 is not set | ||
166 | # CONFIG_ARCH_ORION5X is not set | ||
167 | # CONFIG_ARCH_MMP is not set | ||
168 | # CONFIG_ARCH_KS8695 is not set | ||
169 | # CONFIG_ARCH_NS9XXX is not set | ||
170 | # CONFIG_ARCH_W90X900 is not set | ||
171 | # CONFIG_ARCH_PNX4008 is not set | ||
172 | # CONFIG_ARCH_PXA is not set | ||
173 | # CONFIG_ARCH_MSM is not set | ||
174 | # CONFIG_ARCH_RPC is not set | ||
175 | # CONFIG_ARCH_SA1100 is not set | ||
176 | # CONFIG_ARCH_S3C2410 is not set | ||
177 | # CONFIG_ARCH_S3C64XX is not set | ||
178 | # CONFIG_ARCH_S5PC1XX is not set | ||
179 | # CONFIG_ARCH_SHARK is not set | ||
180 | # CONFIG_ARCH_LH7A40X is not set | ||
181 | # CONFIG_ARCH_U300 is not set | ||
182 | # CONFIG_ARCH_DAVINCI is not set | ||
183 | # CONFIG_ARCH_OMAP is not set | ||
184 | # CONFIG_ARCH_BCMRING is not set | ||
185 | CONFIG_PLAT_SPEAR=y | ||
186 | CONFIG_ARCH_SPEAR3XX=y | ||
187 | # CONFIG_ARCH_SPEAR6XX is not set | ||
188 | CONFIG_MACH_SPEAR300=y | ||
189 | # CONFIG_MACH_SPEAR310 is not set | ||
190 | # CONFIG_MACH_SPEAR320 is not set | ||
191 | CONFIG_BOARD_SPEAR300_EVB=y | ||
192 | |||
193 | # | ||
194 | # Processor Type | ||
195 | # | ||
196 | CONFIG_CPU_32=y | ||
197 | CONFIG_CPU_ARM926T=y | ||
198 | CONFIG_CPU_32v5=y | ||
199 | CONFIG_CPU_ABRT_EV5TJ=y | ||
200 | CONFIG_CPU_PABRT_LEGACY=y | ||
201 | CONFIG_CPU_CACHE_VIVT=y | ||
202 | CONFIG_CPU_COPY_V4WB=y | ||
203 | CONFIG_CPU_TLB_V4WBI=y | ||
204 | CONFIG_CPU_CP15=y | ||
205 | CONFIG_CPU_CP15_MMU=y | ||
206 | |||
207 | # | ||
208 | # Processor Features | ||
209 | # | ||
210 | CONFIG_ARM_THUMB=y | ||
211 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
212 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
213 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
214 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
215 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
216 | CONFIG_ARM_VIC=y | ||
217 | CONFIG_ARM_VIC_NR=2 | ||
218 | CONFIG_COMMON_CLKDEV=y | ||
219 | |||
220 | # | ||
221 | # Bus support | ||
222 | # | ||
223 | CONFIG_ARM_AMBA=y | ||
224 | # CONFIG_PCI_SYSCALL is not set | ||
225 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
226 | # CONFIG_PCCARD is not set | ||
227 | |||
228 | # | ||
229 | # Kernel Features | ||
230 | # | ||
231 | # CONFIG_NO_HZ is not set | ||
232 | # CONFIG_HIGH_RES_TIMERS is not set | ||
233 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
234 | CONFIG_VMSPLIT_3G=y | ||
235 | # CONFIG_VMSPLIT_2G is not set | ||
236 | # CONFIG_VMSPLIT_1G is not set | ||
237 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
238 | CONFIG_PREEMPT_NONE=y | ||
239 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
240 | # CONFIG_PREEMPT is not set | ||
241 | CONFIG_HZ=100 | ||
242 | # CONFIG_AEABI is not set | ||
243 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
244 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
245 | # CONFIG_HIGHMEM is not set | ||
246 | CONFIG_SELECT_MEMORY_MODEL=y | ||
247 | CONFIG_FLATMEM_MANUAL=y | ||
248 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
249 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
250 | CONFIG_FLATMEM=y | ||
251 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
252 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
253 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
254 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
255 | CONFIG_ZONE_DMA_FLAG=0 | ||
256 | CONFIG_VIRT_TO_BUS=y | ||
257 | CONFIG_HAVE_MLOCK=y | ||
258 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
259 | # CONFIG_KSM is not set | ||
260 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
261 | CONFIG_ALIGNMENT_TRAP=y | ||
262 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
263 | |||
264 | # | ||
265 | # Boot options | ||
266 | # | ||
267 | CONFIG_ZBOOT_ROM_TEXT=0 | ||
268 | CONFIG_ZBOOT_ROM_BSS=0 | ||
269 | CONFIG_CMDLINE="" | ||
270 | # CONFIG_XIP_KERNEL is not set | ||
271 | # CONFIG_KEXEC is not set | ||
272 | |||
273 | # | ||
274 | # CPU Power Management | ||
275 | # | ||
276 | # CONFIG_CPU_IDLE is not set | ||
277 | |||
278 | # | ||
279 | # Floating point emulation | ||
280 | # | ||
281 | |||
282 | # | ||
283 | # At least one emulation must be selected | ||
284 | # | ||
285 | # CONFIG_FPE_NWFPE is not set | ||
286 | # CONFIG_FPE_FASTFPE is not set | ||
287 | # CONFIG_VFP is not set | ||
288 | |||
289 | # | ||
290 | # Userspace binary formats | ||
291 | # | ||
292 | CONFIG_BINFMT_ELF=y | ||
293 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
294 | CONFIG_HAVE_AOUT=y | ||
295 | # CONFIG_BINFMT_AOUT is not set | ||
296 | CONFIG_BINFMT_MISC=y | ||
297 | |||
298 | # | ||
299 | # Power management options | ||
300 | # | ||
301 | # CONFIG_PM is not set | ||
302 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
303 | # CONFIG_NET is not set | ||
304 | |||
305 | # | ||
306 | # Device Drivers | ||
307 | # | ||
308 | |||
309 | # | ||
310 | # Generic Driver Options | ||
311 | # | ||
312 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
313 | # CONFIG_DEVTMPFS is not set | ||
314 | CONFIG_STANDALONE=y | ||
315 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
316 | CONFIG_FW_LOADER=y | ||
317 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
318 | CONFIG_EXTRA_FIRMWARE="" | ||
319 | # CONFIG_DEBUG_DRIVER is not set | ||
320 | # CONFIG_DEBUG_DEVRES is not set | ||
321 | # CONFIG_SYS_HYPERVISOR is not set | ||
322 | # CONFIG_MTD is not set | ||
323 | # CONFIG_PARPORT is not set | ||
324 | CONFIG_BLK_DEV=y | ||
325 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
326 | # CONFIG_BLK_DEV_LOOP is not set | ||
327 | CONFIG_BLK_DEV_RAM=y | ||
328 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
329 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
330 | # CONFIG_BLK_DEV_XIP is not set | ||
331 | # CONFIG_CDROM_PKTCDVD is not set | ||
332 | CONFIG_MISC_DEVICES=y | ||
333 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
334 | # CONFIG_C2PORT is not set | ||
335 | |||
336 | # | ||
337 | # EEPROM support | ||
338 | # | ||
339 | # CONFIG_EEPROM_93CX6 is not set | ||
340 | CONFIG_HAVE_IDE=y | ||
341 | # CONFIG_IDE is not set | ||
342 | |||
343 | # | ||
344 | # SCSI device support | ||
345 | # | ||
346 | # CONFIG_RAID_ATTRS is not set | ||
347 | # CONFIG_SCSI is not set | ||
348 | # CONFIG_SCSI_DMA is not set | ||
349 | # CONFIG_SCSI_NETLINK is not set | ||
350 | # CONFIG_ATA is not set | ||
351 | # CONFIG_MD is not set | ||
352 | # CONFIG_PHONE is not set | ||
353 | |||
354 | # | ||
355 | # Input device support | ||
356 | # | ||
357 | CONFIG_INPUT=y | ||
358 | CONFIG_INPUT_FF_MEMLESS=y | ||
359 | # CONFIG_INPUT_POLLDEV is not set | ||
360 | |||
361 | # | ||
362 | # Userland interfaces | ||
363 | # | ||
364 | CONFIG_INPUT_MOUSEDEV=y | ||
365 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
366 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
367 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
368 | # CONFIG_INPUT_JOYDEV is not set | ||
369 | # CONFIG_INPUT_EVDEV is not set | ||
370 | # CONFIG_INPUT_EVBUG is not set | ||
371 | |||
372 | # | ||
373 | # Input Device Drivers | ||
374 | # | ||
375 | # CONFIG_INPUT_KEYBOARD is not set | ||
376 | # CONFIG_INPUT_MOUSE is not set | ||
377 | # CONFIG_INPUT_JOYSTICK is not set | ||
378 | # CONFIG_INPUT_TABLET is not set | ||
379 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
380 | # CONFIG_INPUT_MISC is not set | ||
381 | |||
382 | # | ||
383 | # Hardware I/O ports | ||
384 | # | ||
385 | CONFIG_SERIO=y | ||
386 | CONFIG_SERIO_SERPORT=y | ||
387 | # CONFIG_SERIO_AMBAKMI is not set | ||
388 | # CONFIG_SERIO_RAW is not set | ||
389 | # CONFIG_GAMEPORT is not set | ||
390 | |||
391 | # | ||
392 | # Character devices | ||
393 | # | ||
394 | CONFIG_VT=y | ||
395 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
396 | CONFIG_VT_CONSOLE=y | ||
397 | CONFIG_HW_CONSOLE=y | ||
398 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
399 | CONFIG_DEVKMEM=y | ||
400 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
401 | |||
402 | # | ||
403 | # Serial drivers | ||
404 | # | ||
405 | # CONFIG_SERIAL_8250 is not set | ||
406 | |||
407 | # | ||
408 | # Non-8250 serial port support | ||
409 | # | ||
410 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
411 | CONFIG_SERIAL_AMBA_PL011=y | ||
412 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||
413 | CONFIG_SERIAL_CORE=y | ||
414 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
415 | CONFIG_UNIX98_PTYS=y | ||
416 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
417 | # CONFIG_LEGACY_PTYS is not set | ||
418 | # CONFIG_IPMI_HANDLER is not set | ||
419 | # CONFIG_HW_RANDOM is not set | ||
420 | # CONFIG_R3964 is not set | ||
421 | CONFIG_RAW_DRIVER=y | ||
422 | CONFIG_MAX_RAW_DEVS=8192 | ||
423 | # CONFIG_TCG_TPM is not set | ||
424 | # CONFIG_I2C is not set | ||
425 | # CONFIG_SPI is not set | ||
426 | |||
427 | # | ||
428 | # PPS support | ||
429 | # | ||
430 | # CONFIG_PPS is not set | ||
431 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
432 | CONFIG_GPIOLIB=y | ||
433 | # CONFIG_DEBUG_GPIO is not set | ||
434 | CONFIG_GPIO_SYSFS=y | ||
435 | |||
436 | # | ||
437 | # Memory mapped GPIO expanders: | ||
438 | # | ||
439 | CONFIG_GPIO_PL061=y | ||
440 | |||
441 | # | ||
442 | # I2C GPIO expanders: | ||
443 | # | ||
444 | |||
445 | # | ||
446 | # PCI GPIO expanders: | ||
447 | # | ||
448 | |||
449 | # | ||
450 | # SPI GPIO expanders: | ||
451 | # | ||
452 | |||
453 | # | ||
454 | # AC97 GPIO expanders: | ||
455 | # | ||
456 | # CONFIG_W1 is not set | ||
457 | # CONFIG_POWER_SUPPLY is not set | ||
458 | # CONFIG_HWMON is not set | ||
459 | # CONFIG_THERMAL is not set | ||
460 | # CONFIG_WATCHDOG is not set | ||
461 | CONFIG_SSB_POSSIBLE=y | ||
462 | |||
463 | # | ||
464 | # Sonics Silicon Backplane | ||
465 | # | ||
466 | # CONFIG_SSB is not set | ||
467 | |||
468 | # | ||
469 | # Multifunction device drivers | ||
470 | # | ||
471 | # CONFIG_MFD_CORE is not set | ||
472 | # CONFIG_MFD_SM501 is not set | ||
473 | # CONFIG_MFD_ASIC3 is not set | ||
474 | # CONFIG_HTC_EGPIO is not set | ||
475 | # CONFIG_HTC_PASIC3 is not set | ||
476 | # CONFIG_MFD_TMIO is not set | ||
477 | # CONFIG_MFD_T7L66XB is not set | ||
478 | # CONFIG_MFD_TC6387XB is not set | ||
479 | # CONFIG_MFD_TC6393XB is not set | ||
480 | # CONFIG_REGULATOR is not set | ||
481 | # CONFIG_MEDIA_SUPPORT is not set | ||
482 | |||
483 | # | ||
484 | # Graphics support | ||
485 | # | ||
486 | # CONFIG_VGASTATE is not set | ||
487 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
488 | # CONFIG_FB is not set | ||
489 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
490 | |||
491 | # | ||
492 | # Display device support | ||
493 | # | ||
494 | # CONFIG_DISPLAY_SUPPORT is not set | ||
495 | |||
496 | # | ||
497 | # Console display driver support | ||
498 | # | ||
499 | # CONFIG_VGA_CONSOLE is not set | ||
500 | CONFIG_DUMMY_CONSOLE=y | ||
501 | # CONFIG_SOUND is not set | ||
502 | # CONFIG_HID_SUPPORT is not set | ||
503 | # CONFIG_USB_SUPPORT is not set | ||
504 | # CONFIG_MMC is not set | ||
505 | # CONFIG_MEMSTICK is not set | ||
506 | # CONFIG_NEW_LEDS is not set | ||
507 | # CONFIG_ACCESSIBILITY is not set | ||
508 | CONFIG_RTC_LIB=y | ||
509 | # CONFIG_RTC_CLASS is not set | ||
510 | # CONFIG_DMADEVICES is not set | ||
511 | # CONFIG_AUXDISPLAY is not set | ||
512 | # CONFIG_UIO is not set | ||
513 | |||
514 | # | ||
515 | # TI VLYNQ | ||
516 | # | ||
517 | # CONFIG_STAGING is not set | ||
518 | |||
519 | # | ||
520 | # File systems | ||
521 | # | ||
522 | CONFIG_EXT2_FS=y | ||
523 | CONFIG_EXT2_FS_XATTR=y | ||
524 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
525 | CONFIG_EXT2_FS_SECURITY=y | ||
526 | # CONFIG_EXT2_FS_XIP is not set | ||
527 | CONFIG_EXT3_FS=y | ||
528 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
529 | CONFIG_EXT3_FS_XATTR=y | ||
530 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
531 | CONFIG_EXT3_FS_SECURITY=y | ||
532 | # CONFIG_EXT4_FS is not set | ||
533 | CONFIG_JBD=y | ||
534 | # CONFIG_JBD_DEBUG is not set | ||
535 | CONFIG_FS_MBCACHE=y | ||
536 | # CONFIG_REISERFS_FS is not set | ||
537 | # CONFIG_JFS_FS is not set | ||
538 | # CONFIG_FS_POSIX_ACL is not set | ||
539 | # CONFIG_XFS_FS is not set | ||
540 | # CONFIG_GFS2_FS is not set | ||
541 | # CONFIG_BTRFS_FS is not set | ||
542 | # CONFIG_NILFS2_FS is not set | ||
543 | CONFIG_FILE_LOCKING=y | ||
544 | CONFIG_FSNOTIFY=y | ||
545 | CONFIG_DNOTIFY=y | ||
546 | # CONFIG_INOTIFY is not set | ||
547 | CONFIG_INOTIFY_USER=y | ||
548 | # CONFIG_QUOTA is not set | ||
549 | # CONFIG_AUTOFS_FS is not set | ||
550 | CONFIG_AUTOFS4_FS=m | ||
551 | # CONFIG_FUSE_FS is not set | ||
552 | |||
553 | # | ||
554 | # Caches | ||
555 | # | ||
556 | # CONFIG_FSCACHE is not set | ||
557 | |||
558 | # | ||
559 | # CD-ROM/DVD Filesystems | ||
560 | # | ||
561 | # CONFIG_ISO9660_FS is not set | ||
562 | # CONFIG_UDF_FS is not set | ||
563 | |||
564 | # | ||
565 | # DOS/FAT/NT Filesystems | ||
566 | # | ||
567 | CONFIG_FAT_FS=m | ||
568 | CONFIG_MSDOS_FS=m | ||
569 | CONFIG_VFAT_FS=m | ||
570 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
571 | CONFIG_FAT_DEFAULT_IOCHARSET="ascii" | ||
572 | # CONFIG_NTFS_FS is not set | ||
573 | |||
574 | # | ||
575 | # Pseudo filesystems | ||
576 | # | ||
577 | CONFIG_PROC_FS=y | ||
578 | CONFIG_PROC_SYSCTL=y | ||
579 | CONFIG_PROC_PAGE_MONITOR=y | ||
580 | CONFIG_SYSFS=y | ||
581 | CONFIG_TMPFS=y | ||
582 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
583 | # CONFIG_HUGETLB_PAGE is not set | ||
584 | # CONFIG_CONFIGFS_FS is not set | ||
585 | CONFIG_MISC_FILESYSTEMS=y | ||
586 | # CONFIG_ADFS_FS is not set | ||
587 | # CONFIG_AFFS_FS is not set | ||
588 | # CONFIG_HFS_FS is not set | ||
589 | # CONFIG_HFSPLUS_FS is not set | ||
590 | # CONFIG_BEFS_FS is not set | ||
591 | # CONFIG_BFS_FS is not set | ||
592 | # CONFIG_EFS_FS is not set | ||
593 | # CONFIG_SQUASHFS is not set | ||
594 | # CONFIG_VXFS_FS is not set | ||
595 | # CONFIG_MINIX_FS is not set | ||
596 | # CONFIG_OMFS_FS is not set | ||
597 | # CONFIG_HPFS_FS is not set | ||
598 | # CONFIG_QNX4FS_FS is not set | ||
599 | # CONFIG_ROMFS_FS is not set | ||
600 | # CONFIG_SYSV_FS is not set | ||
601 | # CONFIG_UFS_FS is not set | ||
602 | |||
603 | # | ||
604 | # Partition Types | ||
605 | # | ||
606 | CONFIG_PARTITION_ADVANCED=y | ||
607 | # CONFIG_ACORN_PARTITION is not set | ||
608 | # CONFIG_OSF_PARTITION is not set | ||
609 | # CONFIG_AMIGA_PARTITION is not set | ||
610 | # CONFIG_ATARI_PARTITION is not set | ||
611 | # CONFIG_MAC_PARTITION is not set | ||
612 | CONFIG_MSDOS_PARTITION=y | ||
613 | # CONFIG_BSD_DISKLABEL is not set | ||
614 | # CONFIG_MINIX_SUBPARTITION is not set | ||
615 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
616 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
617 | # CONFIG_LDM_PARTITION is not set | ||
618 | # CONFIG_SGI_PARTITION is not set | ||
619 | # CONFIG_ULTRIX_PARTITION is not set | ||
620 | # CONFIG_SUN_PARTITION is not set | ||
621 | # CONFIG_KARMA_PARTITION is not set | ||
622 | # CONFIG_EFI_PARTITION is not set | ||
623 | # CONFIG_SYSV68_PARTITION is not set | ||
624 | CONFIG_NLS=y | ||
625 | CONFIG_NLS_DEFAULT="utf8" | ||
626 | CONFIG_NLS_CODEPAGE_437=y | ||
627 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
628 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
629 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
630 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
631 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
632 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
633 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
634 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
635 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
636 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
637 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
638 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
639 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
640 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
641 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
642 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
643 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
644 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
645 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
646 | # CONFIG_NLS_ISO8859_8 is not set | ||
647 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
648 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
649 | CONFIG_NLS_ASCII=m | ||
650 | # CONFIG_NLS_ISO8859_1 is not set | ||
651 | # CONFIG_NLS_ISO8859_2 is not set | ||
652 | # CONFIG_NLS_ISO8859_3 is not set | ||
653 | # CONFIG_NLS_ISO8859_4 is not set | ||
654 | # CONFIG_NLS_ISO8859_5 is not set | ||
655 | # CONFIG_NLS_ISO8859_6 is not set | ||
656 | # CONFIG_NLS_ISO8859_7 is not set | ||
657 | # CONFIG_NLS_ISO8859_9 is not set | ||
658 | # CONFIG_NLS_ISO8859_13 is not set | ||
659 | # CONFIG_NLS_ISO8859_14 is not set | ||
660 | # CONFIG_NLS_ISO8859_15 is not set | ||
661 | # CONFIG_NLS_KOI8_R is not set | ||
662 | # CONFIG_NLS_KOI8_U is not set | ||
663 | # CONFIG_NLS_UTF8 is not set | ||
664 | |||
665 | # | ||
666 | # Kernel hacking | ||
667 | # | ||
668 | # CONFIG_PRINTK_TIME is not set | ||
669 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
670 | CONFIG_ENABLE_MUST_CHECK=y | ||
671 | CONFIG_FRAME_WARN=1024 | ||
672 | CONFIG_MAGIC_SYSRQ=y | ||
673 | # CONFIG_STRIP_ASM_SYMS is not set | ||
674 | # CONFIG_UNUSED_SYMBOLS is not set | ||
675 | CONFIG_DEBUG_FS=y | ||
676 | # CONFIG_HEADERS_CHECK is not set | ||
677 | CONFIG_DEBUG_KERNEL=y | ||
678 | # CONFIG_DEBUG_SHIRQ is not set | ||
679 | CONFIG_DETECT_SOFTLOCKUP=y | ||
680 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
681 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
682 | CONFIG_DETECT_HUNG_TASK=y | ||
683 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
684 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
685 | CONFIG_SCHED_DEBUG=y | ||
686 | # CONFIG_SCHEDSTATS is not set | ||
687 | # CONFIG_TIMER_STATS is not set | ||
688 | # CONFIG_DEBUG_OBJECTS is not set | ||
689 | # CONFIG_SLUB_DEBUG_ON is not set | ||
690 | # CONFIG_SLUB_STATS is not set | ||
691 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
692 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
693 | # CONFIG_RT_MUTEX_TESTER is not set | ||
694 | CONFIG_DEBUG_SPINLOCK=y | ||
695 | # CONFIG_DEBUG_MUTEXES is not set | ||
696 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
697 | # CONFIG_PROVE_LOCKING is not set | ||
698 | # CONFIG_LOCK_STAT is not set | ||
699 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
700 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
701 | # CONFIG_DEBUG_KOBJECT is not set | ||
702 | CONFIG_DEBUG_BUGVERBOSE=y | ||
703 | CONFIG_DEBUG_INFO=y | ||
704 | # CONFIG_DEBUG_VM is not set | ||
705 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
706 | CONFIG_DEBUG_MEMORY_INIT=y | ||
707 | # CONFIG_DEBUG_LIST is not set | ||
708 | # CONFIG_DEBUG_SG is not set | ||
709 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
710 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
711 | CONFIG_FRAME_POINTER=y | ||
712 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
713 | # CONFIG_RCU_TORTURE_TEST is not set | ||
714 | CONFIG_RCU_CPU_STALL_DETECTOR=y | ||
715 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
716 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
717 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
718 | # CONFIG_FAULT_INJECTION is not set | ||
719 | # CONFIG_LATENCYTOP is not set | ||
720 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
721 | # CONFIG_PAGE_POISONING is not set | ||
722 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
723 | CONFIG_TRACING_SUPPORT=y | ||
724 | CONFIG_FTRACE=y | ||
725 | # CONFIG_FUNCTION_TRACER is not set | ||
726 | # CONFIG_IRQSOFF_TRACER is not set | ||
727 | # CONFIG_SCHED_TRACER is not set | ||
728 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
729 | # CONFIG_BOOT_TRACER is not set | ||
730 | CONFIG_BRANCH_PROFILE_NONE=y | ||
731 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
732 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
733 | # CONFIG_STACK_TRACER is not set | ||
734 | # CONFIG_KMEMTRACE is not set | ||
735 | # CONFIG_WORKQUEUE_TRACER is not set | ||
736 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
737 | # CONFIG_DYNAMIC_DEBUG is not set | ||
738 | # CONFIG_SAMPLES is not set | ||
739 | CONFIG_HAVE_ARCH_KGDB=y | ||
740 | # CONFIG_KGDB is not set | ||
741 | # CONFIG_DEBUG_USER is not set | ||
742 | # CONFIG_DEBUG_ERRORS is not set | ||
743 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
744 | # CONFIG_DEBUG_LL is not set | ||
745 | |||
746 | # | ||
747 | # Security options | ||
748 | # | ||
749 | # CONFIG_KEYS is not set | ||
750 | # CONFIG_SECURITY is not set | ||
751 | # CONFIG_SECURITYFS is not set | ||
752 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
753 | # CONFIG_CRYPTO is not set | ||
754 | # CONFIG_BINARY_PRINTF is not set | ||
755 | |||
756 | # | ||
757 | # Library routines | ||
758 | # | ||
759 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
760 | # CONFIG_CRC_CCITT is not set | ||
761 | # CONFIG_CRC16 is not set | ||
762 | # CONFIG_CRC_T10DIF is not set | ||
763 | # CONFIG_CRC_ITU_T is not set | ||
764 | # CONFIG_CRC32 is not set | ||
765 | # CONFIG_CRC7 is not set | ||
766 | # CONFIG_LIBCRC32C is not set | ||
767 | CONFIG_ZLIB_INFLATE=y | ||
768 | CONFIG_DECOMPRESS_GZIP=y | ||
769 | CONFIG_DECOMPRESS_BZIP2=y | ||
770 | CONFIG_DECOMPRESS_LZMA=y | ||
771 | CONFIG_HAS_IOMEM=y | ||
772 | CONFIG_HAS_IOPORT=y | ||
773 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/arm/configs/spear310_defconfig b/arch/arm/configs/spear310_defconfig new file mode 100644 index 000000000000..cbbfd290bba8 --- /dev/null +++ b/arch/arm/configs/spear310_defconfig | |||
@@ -0,0 +1,775 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.32 | ||
4 | # Tue Mar 23 14:37:01 2010 | ||
5 | # | ||
6 | CONFIG_ARM=y | ||
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
8 | CONFIG_GENERIC_GPIO=y | ||
9 | CONFIG_GENERIC_TIME=y | ||
10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
11 | CONFIG_GENERIC_HARDIRQS=y | ||
12 | CONFIG_STACKTRACE_SUPPORT=y | ||
13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
14 | CONFIG_LOCKDEP_SUPPORT=y | ||
15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
19 | CONFIG_GENERIC_HWEIGHT=y | ||
20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
22 | CONFIG_VECTORS_BASE=0xffff0000 | ||
23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
24 | CONFIG_CONSTRUCTORS=y | ||
25 | |||
26 | # | ||
27 | # General setup | ||
28 | # | ||
29 | CONFIG_EXPERIMENTAL=y | ||
30 | CONFIG_BROKEN_ON_SMP=y | ||
31 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
32 | CONFIG_LOCALVERSION="" | ||
33 | CONFIG_LOCALVERSION_AUTO=y | ||
34 | CONFIG_SWAP=y | ||
35 | CONFIG_SYSVIPC=y | ||
36 | CONFIG_SYSVIPC_SYSCTL=y | ||
37 | CONFIG_BSD_PROCESS_ACCT=y | ||
38 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
39 | |||
40 | # | ||
41 | # RCU Subsystem | ||
42 | # | ||
43 | CONFIG_TREE_RCU=y | ||
44 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
45 | # CONFIG_RCU_TRACE is not set | ||
46 | CONFIG_RCU_FANOUT=32 | ||
47 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
48 | # CONFIG_TREE_RCU_TRACE is not set | ||
49 | # CONFIG_IKCONFIG is not set | ||
50 | CONFIG_LOG_BUF_SHIFT=17 | ||
51 | # CONFIG_GROUP_SCHED is not set | ||
52 | # CONFIG_CGROUPS is not set | ||
53 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
54 | # CONFIG_RELAY is not set | ||
55 | CONFIG_NAMESPACES=y | ||
56 | # CONFIG_UTS_NS is not set | ||
57 | # CONFIG_IPC_NS is not set | ||
58 | # CONFIG_USER_NS is not set | ||
59 | # CONFIG_PID_NS is not set | ||
60 | CONFIG_BLK_DEV_INITRD=y | ||
61 | CONFIG_INITRAMFS_SOURCE="" | ||
62 | CONFIG_RD_GZIP=y | ||
63 | CONFIG_RD_BZIP2=y | ||
64 | CONFIG_RD_LZMA=y | ||
65 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
66 | CONFIG_SYSCTL=y | ||
67 | CONFIG_ANON_INODES=y | ||
68 | # CONFIG_EMBEDDED is not set | ||
69 | CONFIG_UID16=y | ||
70 | CONFIG_SYSCTL_SYSCALL=y | ||
71 | CONFIG_KALLSYMS=y | ||
72 | # CONFIG_KALLSYMS_ALL is not set | ||
73 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
74 | CONFIG_HOTPLUG=y | ||
75 | CONFIG_PRINTK=y | ||
76 | CONFIG_BUG=y | ||
77 | CONFIG_ELF_CORE=y | ||
78 | CONFIG_BASE_FULL=y | ||
79 | CONFIG_FUTEX=y | ||
80 | CONFIG_EPOLL=y | ||
81 | CONFIG_SIGNALFD=y | ||
82 | CONFIG_TIMERFD=y | ||
83 | CONFIG_EVENTFD=y | ||
84 | CONFIG_SHMEM=y | ||
85 | CONFIG_AIO=y | ||
86 | |||
87 | # | ||
88 | # Kernel Performance Events And Counters | ||
89 | # | ||
90 | CONFIG_VM_EVENT_COUNTERS=y | ||
91 | CONFIG_SLUB_DEBUG=y | ||
92 | CONFIG_COMPAT_BRK=y | ||
93 | # CONFIG_SLAB is not set | ||
94 | CONFIG_SLUB=y | ||
95 | # CONFIG_SLOB is not set | ||
96 | # CONFIG_PROFILING is not set | ||
97 | CONFIG_HAVE_OPROFILE=y | ||
98 | # CONFIG_KPROBES is not set | ||
99 | CONFIG_HAVE_KPROBES=y | ||
100 | CONFIG_HAVE_KRETPROBES=y | ||
101 | CONFIG_HAVE_CLK=y | ||
102 | |||
103 | # | ||
104 | # GCOV-based kernel profiling | ||
105 | # | ||
106 | # CONFIG_GCOV_KERNEL is not set | ||
107 | # CONFIG_SLOW_WORK is not set | ||
108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
109 | CONFIG_SLABINFO=y | ||
110 | CONFIG_RT_MUTEXES=y | ||
111 | CONFIG_BASE_SMALL=0 | ||
112 | CONFIG_MODULES=y | ||
113 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
114 | CONFIG_MODULE_UNLOAD=y | ||
115 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
116 | CONFIG_MODVERSIONS=y | ||
117 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
118 | CONFIG_BLOCK=y | ||
119 | CONFIG_LBDAF=y | ||
120 | CONFIG_BLK_DEV_BSG=y | ||
121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
122 | |||
123 | # | ||
124 | # IO Schedulers | ||
125 | # | ||
126 | CONFIG_IOSCHED_NOOP=y | ||
127 | CONFIG_IOSCHED_AS=y | ||
128 | CONFIG_IOSCHED_DEADLINE=y | ||
129 | CONFIG_IOSCHED_CFQ=y | ||
130 | # CONFIG_DEFAULT_AS is not set | ||
131 | # CONFIG_DEFAULT_DEADLINE is not set | ||
132 | CONFIG_DEFAULT_CFQ=y | ||
133 | # CONFIG_DEFAULT_NOOP is not set | ||
134 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
135 | # CONFIG_FREEZER is not set | ||
136 | |||
137 | # | ||
138 | # System Type | ||
139 | # | ||
140 | CONFIG_MMU=y | ||
141 | # CONFIG_ARCH_AAEC2000 is not set | ||
142 | # CONFIG_ARCH_INTEGRATOR is not set | ||
143 | # CONFIG_ARCH_REALVIEW is not set | ||
144 | # CONFIG_ARCH_VERSATILE is not set | ||
145 | # CONFIG_ARCH_AT91 is not set | ||
146 | # CONFIG_ARCH_CLPS711X is not set | ||
147 | # CONFIG_ARCH_GEMINI is not set | ||
148 | # CONFIG_ARCH_EBSA110 is not set | ||
149 | # CONFIG_ARCH_EP93XX is not set | ||
150 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
151 | # CONFIG_ARCH_MXC is not set | ||
152 | # CONFIG_ARCH_STMP3XXX is not set | ||
153 | # CONFIG_ARCH_NETX is not set | ||
154 | # CONFIG_ARCH_H720X is not set | ||
155 | # CONFIG_ARCH_NOMADIK is not set | ||
156 | # CONFIG_ARCH_IOP13XX is not set | ||
157 | # CONFIG_ARCH_IOP32X is not set | ||
158 | # CONFIG_ARCH_IOP33X is not set | ||
159 | # CONFIG_ARCH_IXP23XX is not set | ||
160 | # CONFIG_ARCH_IXP2000 is not set | ||
161 | # CONFIG_ARCH_IXP4XX is not set | ||
162 | # CONFIG_ARCH_L7200 is not set | ||
163 | # CONFIG_ARCH_KIRKWOOD is not set | ||
164 | # CONFIG_ARCH_LOKI is not set | ||
165 | # CONFIG_ARCH_MV78XX0 is not set | ||
166 | # CONFIG_ARCH_ORION5X is not set | ||
167 | # CONFIG_ARCH_MMP is not set | ||
168 | # CONFIG_ARCH_KS8695 is not set | ||
169 | # CONFIG_ARCH_NS9XXX is not set | ||
170 | # CONFIG_ARCH_W90X900 is not set | ||
171 | # CONFIG_ARCH_PNX4008 is not set | ||
172 | # CONFIG_ARCH_PXA is not set | ||
173 | # CONFIG_ARCH_MSM is not set | ||
174 | # CONFIG_ARCH_RPC is not set | ||
175 | # CONFIG_ARCH_SA1100 is not set | ||
176 | # CONFIG_ARCH_S3C2410 is not set | ||
177 | # CONFIG_ARCH_S3C64XX is not set | ||
178 | # CONFIG_ARCH_S5PC1XX is not set | ||
179 | # CONFIG_ARCH_SHARK is not set | ||
180 | # CONFIG_ARCH_LH7A40X is not set | ||
181 | # CONFIG_ARCH_U300 is not set | ||
182 | # CONFIG_ARCH_DAVINCI is not set | ||
183 | # CONFIG_ARCH_OMAP is not set | ||
184 | # CONFIG_ARCH_BCMRING is not set | ||
185 | CONFIG_PLAT_SPEAR=y | ||
186 | CONFIG_ARCH_SPEAR3XX=y | ||
187 | # CONFIG_ARCH_SPEAR6XX is not set | ||
188 | # CONFIG_MACH_SPEAR300 is not set | ||
189 | CONFIG_MACH_SPEAR310=y | ||
190 | # CONFIG_MACH_SPEAR320 is not set | ||
191 | # CONFIG_BOARD_SPEAR300_EVB is not set | ||
192 | CONFIG_BOARD_SPEAR310_EVB=y | ||
193 | |||
194 | # | ||
195 | # Processor Type | ||
196 | # | ||
197 | CONFIG_CPU_32=y | ||
198 | CONFIG_CPU_ARM926T=y | ||
199 | CONFIG_CPU_32v5=y | ||
200 | CONFIG_CPU_ABRT_EV5TJ=y | ||
201 | CONFIG_CPU_PABRT_LEGACY=y | ||
202 | CONFIG_CPU_CACHE_VIVT=y | ||
203 | CONFIG_CPU_COPY_V4WB=y | ||
204 | CONFIG_CPU_TLB_V4WBI=y | ||
205 | CONFIG_CPU_CP15=y | ||
206 | CONFIG_CPU_CP15_MMU=y | ||
207 | |||
208 | # | ||
209 | # Processor Features | ||
210 | # | ||
211 | CONFIG_ARM_THUMB=y | ||
212 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
213 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
214 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
215 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
216 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
217 | CONFIG_ARM_VIC=y | ||
218 | CONFIG_ARM_VIC_NR=2 | ||
219 | CONFIG_COMMON_CLKDEV=y | ||
220 | |||
221 | # | ||
222 | # Bus support | ||
223 | # | ||
224 | CONFIG_ARM_AMBA=y | ||
225 | # CONFIG_PCI_SYSCALL is not set | ||
226 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
227 | # CONFIG_PCCARD is not set | ||
228 | |||
229 | # | ||
230 | # Kernel Features | ||
231 | # | ||
232 | # CONFIG_NO_HZ is not set | ||
233 | # CONFIG_HIGH_RES_TIMERS is not set | ||
234 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
235 | CONFIG_VMSPLIT_3G=y | ||
236 | # CONFIG_VMSPLIT_2G is not set | ||
237 | # CONFIG_VMSPLIT_1G is not set | ||
238 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
239 | CONFIG_PREEMPT_NONE=y | ||
240 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
241 | # CONFIG_PREEMPT is not set | ||
242 | CONFIG_HZ=100 | ||
243 | # CONFIG_AEABI is not set | ||
244 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
245 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
246 | # CONFIG_HIGHMEM is not set | ||
247 | CONFIG_SELECT_MEMORY_MODEL=y | ||
248 | CONFIG_FLATMEM_MANUAL=y | ||
249 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
250 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
251 | CONFIG_FLATMEM=y | ||
252 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
253 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
254 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
255 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
256 | CONFIG_ZONE_DMA_FLAG=0 | ||
257 | CONFIG_VIRT_TO_BUS=y | ||
258 | CONFIG_HAVE_MLOCK=y | ||
259 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
260 | # CONFIG_KSM is not set | ||
261 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
262 | CONFIG_ALIGNMENT_TRAP=y | ||
263 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
264 | |||
265 | # | ||
266 | # Boot options | ||
267 | # | ||
268 | CONFIG_ZBOOT_ROM_TEXT=0 | ||
269 | CONFIG_ZBOOT_ROM_BSS=0 | ||
270 | CONFIG_CMDLINE="" | ||
271 | # CONFIG_XIP_KERNEL is not set | ||
272 | # CONFIG_KEXEC is not set | ||
273 | |||
274 | # | ||
275 | # CPU Power Management | ||
276 | # | ||
277 | # CONFIG_CPU_IDLE is not set | ||
278 | |||
279 | # | ||
280 | # Floating point emulation | ||
281 | # | ||
282 | |||
283 | # | ||
284 | # At least one emulation must be selected | ||
285 | # | ||
286 | # CONFIG_FPE_NWFPE is not set | ||
287 | # CONFIG_FPE_FASTFPE is not set | ||
288 | # CONFIG_VFP is not set | ||
289 | |||
290 | # | ||
291 | # Userspace binary formats | ||
292 | # | ||
293 | CONFIG_BINFMT_ELF=y | ||
294 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
295 | CONFIG_HAVE_AOUT=y | ||
296 | # CONFIG_BINFMT_AOUT is not set | ||
297 | CONFIG_BINFMT_MISC=y | ||
298 | |||
299 | # | ||
300 | # Power management options | ||
301 | # | ||
302 | # CONFIG_PM is not set | ||
303 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
304 | # CONFIG_NET is not set | ||
305 | |||
306 | # | ||
307 | # Device Drivers | ||
308 | # | ||
309 | |||
310 | # | ||
311 | # Generic Driver Options | ||
312 | # | ||
313 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
314 | # CONFIG_DEVTMPFS is not set | ||
315 | CONFIG_STANDALONE=y | ||
316 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
317 | CONFIG_FW_LOADER=y | ||
318 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
319 | CONFIG_EXTRA_FIRMWARE="" | ||
320 | # CONFIG_DEBUG_DRIVER is not set | ||
321 | # CONFIG_DEBUG_DEVRES is not set | ||
322 | # CONFIG_SYS_HYPERVISOR is not set | ||
323 | # CONFIG_MTD is not set | ||
324 | # CONFIG_PARPORT is not set | ||
325 | CONFIG_BLK_DEV=y | ||
326 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
327 | # CONFIG_BLK_DEV_LOOP is not set | ||
328 | CONFIG_BLK_DEV_RAM=y | ||
329 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
330 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
331 | # CONFIG_BLK_DEV_XIP is not set | ||
332 | # CONFIG_CDROM_PKTCDVD is not set | ||
333 | # CONFIG_MG_DISK is not set | ||
334 | CONFIG_MISC_DEVICES=y | ||
335 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
336 | # CONFIG_C2PORT is not set | ||
337 | |||
338 | # | ||
339 | # EEPROM support | ||
340 | # | ||
341 | # CONFIG_EEPROM_93CX6 is not set | ||
342 | CONFIG_HAVE_IDE=y | ||
343 | # CONFIG_IDE is not set | ||
344 | |||
345 | # | ||
346 | # SCSI device support | ||
347 | # | ||
348 | # CONFIG_RAID_ATTRS is not set | ||
349 | # CONFIG_SCSI is not set | ||
350 | # CONFIG_SCSI_DMA is not set | ||
351 | # CONFIG_SCSI_NETLINK is not set | ||
352 | # CONFIG_ATA is not set | ||
353 | # CONFIG_MD is not set | ||
354 | # CONFIG_PHONE is not set | ||
355 | |||
356 | # | ||
357 | # Input device support | ||
358 | # | ||
359 | CONFIG_INPUT=y | ||
360 | CONFIG_INPUT_FF_MEMLESS=y | ||
361 | # CONFIG_INPUT_POLLDEV is not set | ||
362 | |||
363 | # | ||
364 | # Userland interfaces | ||
365 | # | ||
366 | CONFIG_INPUT_MOUSEDEV=y | ||
367 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
368 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
369 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
370 | # CONFIG_INPUT_JOYDEV is not set | ||
371 | # CONFIG_INPUT_EVDEV is not set | ||
372 | # CONFIG_INPUT_EVBUG is not set | ||
373 | |||
374 | # | ||
375 | # Input Device Drivers | ||
376 | # | ||
377 | # CONFIG_INPUT_KEYBOARD is not set | ||
378 | # CONFIG_INPUT_MOUSE is not set | ||
379 | # CONFIG_INPUT_JOYSTICK is not set | ||
380 | # CONFIG_INPUT_TABLET is not set | ||
381 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
382 | # CONFIG_INPUT_MISC is not set | ||
383 | |||
384 | # | ||
385 | # Hardware I/O ports | ||
386 | # | ||
387 | CONFIG_SERIO=y | ||
388 | CONFIG_SERIO_SERPORT=y | ||
389 | # CONFIG_SERIO_AMBAKMI is not set | ||
390 | # CONFIG_SERIO_RAW is not set | ||
391 | # CONFIG_GAMEPORT is not set | ||
392 | |||
393 | # | ||
394 | # Character devices | ||
395 | # | ||
396 | CONFIG_VT=y | ||
397 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
398 | CONFIG_VT_CONSOLE=y | ||
399 | CONFIG_HW_CONSOLE=y | ||
400 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
401 | CONFIG_DEVKMEM=y | ||
402 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
403 | |||
404 | # | ||
405 | # Serial drivers | ||
406 | # | ||
407 | # CONFIG_SERIAL_8250 is not set | ||
408 | |||
409 | # | ||
410 | # Non-8250 serial port support | ||
411 | # | ||
412 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
413 | CONFIG_SERIAL_AMBA_PL011=y | ||
414 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||
415 | CONFIG_SERIAL_CORE=y | ||
416 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
417 | CONFIG_UNIX98_PTYS=y | ||
418 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
419 | # CONFIG_LEGACY_PTYS is not set | ||
420 | # CONFIG_IPMI_HANDLER is not set | ||
421 | # CONFIG_HW_RANDOM is not set | ||
422 | # CONFIG_R3964 is not set | ||
423 | CONFIG_RAW_DRIVER=y | ||
424 | CONFIG_MAX_RAW_DEVS=8192 | ||
425 | # CONFIG_TCG_TPM is not set | ||
426 | # CONFIG_I2C is not set | ||
427 | # CONFIG_SPI is not set | ||
428 | |||
429 | # | ||
430 | # PPS support | ||
431 | # | ||
432 | # CONFIG_PPS is not set | ||
433 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
434 | CONFIG_GPIOLIB=y | ||
435 | # CONFIG_DEBUG_GPIO is not set | ||
436 | CONFIG_GPIO_SYSFS=y | ||
437 | |||
438 | # | ||
439 | # Memory mapped GPIO expanders: | ||
440 | # | ||
441 | CONFIG_GPIO_PL061=y | ||
442 | |||
443 | # | ||
444 | # I2C GPIO expanders: | ||
445 | # | ||
446 | |||
447 | # | ||
448 | # PCI GPIO expanders: | ||
449 | # | ||
450 | |||
451 | # | ||
452 | # SPI GPIO expanders: | ||
453 | # | ||
454 | |||
455 | # | ||
456 | # AC97 GPIO expanders: | ||
457 | # | ||
458 | # CONFIG_W1 is not set | ||
459 | # CONFIG_POWER_SUPPLY is not set | ||
460 | # CONFIG_HWMON is not set | ||
461 | # CONFIG_THERMAL is not set | ||
462 | # CONFIG_WATCHDOG is not set | ||
463 | CONFIG_SSB_POSSIBLE=y | ||
464 | |||
465 | # | ||
466 | # Sonics Silicon Backplane | ||
467 | # | ||
468 | # CONFIG_SSB is not set | ||
469 | |||
470 | # | ||
471 | # Multifunction device drivers | ||
472 | # | ||
473 | # CONFIG_MFD_CORE is not set | ||
474 | # CONFIG_MFD_SM501 is not set | ||
475 | # CONFIG_MFD_ASIC3 is not set | ||
476 | # CONFIG_HTC_EGPIO is not set | ||
477 | # CONFIG_HTC_PASIC3 is not set | ||
478 | # CONFIG_MFD_TMIO is not set | ||
479 | # CONFIG_MFD_T7L66XB is not set | ||
480 | # CONFIG_MFD_TC6387XB is not set | ||
481 | # CONFIG_MFD_TC6393XB is not set | ||
482 | # CONFIG_REGULATOR is not set | ||
483 | # CONFIG_MEDIA_SUPPORT is not set | ||
484 | |||
485 | # | ||
486 | # Graphics support | ||
487 | # | ||
488 | # CONFIG_VGASTATE is not set | ||
489 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
490 | # CONFIG_FB is not set | ||
491 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
492 | |||
493 | # | ||
494 | # Display device support | ||
495 | # | ||
496 | # CONFIG_DISPLAY_SUPPORT is not set | ||
497 | |||
498 | # | ||
499 | # Console display driver support | ||
500 | # | ||
501 | # CONFIG_VGA_CONSOLE is not set | ||
502 | CONFIG_DUMMY_CONSOLE=y | ||
503 | # CONFIG_SOUND is not set | ||
504 | # CONFIG_HID_SUPPORT is not set | ||
505 | # CONFIG_USB_SUPPORT is not set | ||
506 | # CONFIG_MMC is not set | ||
507 | # CONFIG_MEMSTICK is not set | ||
508 | # CONFIG_NEW_LEDS is not set | ||
509 | # CONFIG_ACCESSIBILITY is not set | ||
510 | CONFIG_RTC_LIB=y | ||
511 | # CONFIG_RTC_CLASS is not set | ||
512 | # CONFIG_DMADEVICES is not set | ||
513 | # CONFIG_AUXDISPLAY is not set | ||
514 | # CONFIG_UIO is not set | ||
515 | |||
516 | # | ||
517 | # TI VLYNQ | ||
518 | # | ||
519 | # CONFIG_STAGING is not set | ||
520 | |||
521 | # | ||
522 | # File systems | ||
523 | # | ||
524 | CONFIG_EXT2_FS=y | ||
525 | CONFIG_EXT2_FS_XATTR=y | ||
526 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
527 | CONFIG_EXT2_FS_SECURITY=y | ||
528 | # CONFIG_EXT2_FS_XIP is not set | ||
529 | CONFIG_EXT3_FS=y | ||
530 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
531 | CONFIG_EXT3_FS_XATTR=y | ||
532 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
533 | CONFIG_EXT3_FS_SECURITY=y | ||
534 | # CONFIG_EXT4_FS is not set | ||
535 | CONFIG_JBD=y | ||
536 | # CONFIG_JBD_DEBUG is not set | ||
537 | CONFIG_FS_MBCACHE=y | ||
538 | # CONFIG_REISERFS_FS is not set | ||
539 | # CONFIG_JFS_FS is not set | ||
540 | # CONFIG_FS_POSIX_ACL is not set | ||
541 | # CONFIG_XFS_FS is not set | ||
542 | # CONFIG_GFS2_FS is not set | ||
543 | # CONFIG_BTRFS_FS is not set | ||
544 | # CONFIG_NILFS2_FS is not set | ||
545 | CONFIG_FILE_LOCKING=y | ||
546 | CONFIG_FSNOTIFY=y | ||
547 | CONFIG_DNOTIFY=y | ||
548 | # CONFIG_INOTIFY is not set | ||
549 | CONFIG_INOTIFY_USER=y | ||
550 | # CONFIG_QUOTA is not set | ||
551 | # CONFIG_AUTOFS_FS is not set | ||
552 | CONFIG_AUTOFS4_FS=m | ||
553 | # CONFIG_FUSE_FS is not set | ||
554 | |||
555 | # | ||
556 | # Caches | ||
557 | # | ||
558 | # CONFIG_FSCACHE is not set | ||
559 | |||
560 | # | ||
561 | # CD-ROM/DVD Filesystems | ||
562 | # | ||
563 | # CONFIG_ISO9660_FS is not set | ||
564 | # CONFIG_UDF_FS is not set | ||
565 | |||
566 | # | ||
567 | # DOS/FAT/NT Filesystems | ||
568 | # | ||
569 | CONFIG_FAT_FS=m | ||
570 | CONFIG_MSDOS_FS=m | ||
571 | CONFIG_VFAT_FS=m | ||
572 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
573 | CONFIG_FAT_DEFAULT_IOCHARSET="ascii" | ||
574 | # CONFIG_NTFS_FS is not set | ||
575 | |||
576 | # | ||
577 | # Pseudo filesystems | ||
578 | # | ||
579 | CONFIG_PROC_FS=y | ||
580 | CONFIG_PROC_SYSCTL=y | ||
581 | CONFIG_PROC_PAGE_MONITOR=y | ||
582 | CONFIG_SYSFS=y | ||
583 | CONFIG_TMPFS=y | ||
584 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
585 | # CONFIG_HUGETLB_PAGE is not set | ||
586 | # CONFIG_CONFIGFS_FS is not set | ||
587 | CONFIG_MISC_FILESYSTEMS=y | ||
588 | # CONFIG_ADFS_FS is not set | ||
589 | # CONFIG_AFFS_FS is not set | ||
590 | # CONFIG_HFS_FS is not set | ||
591 | # CONFIG_HFSPLUS_FS is not set | ||
592 | # CONFIG_BEFS_FS is not set | ||
593 | # CONFIG_BFS_FS is not set | ||
594 | # CONFIG_EFS_FS is not set | ||
595 | # CONFIG_SQUASHFS is not set | ||
596 | # CONFIG_VXFS_FS is not set | ||
597 | # CONFIG_MINIX_FS is not set | ||
598 | # CONFIG_OMFS_FS is not set | ||
599 | # CONFIG_HPFS_FS is not set | ||
600 | # CONFIG_QNX4FS_FS is not set | ||
601 | # CONFIG_ROMFS_FS is not set | ||
602 | # CONFIG_SYSV_FS is not set | ||
603 | # CONFIG_UFS_FS is not set | ||
604 | |||
605 | # | ||
606 | # Partition Types | ||
607 | # | ||
608 | CONFIG_PARTITION_ADVANCED=y | ||
609 | # CONFIG_ACORN_PARTITION is not set | ||
610 | # CONFIG_OSF_PARTITION is not set | ||
611 | # CONFIG_AMIGA_PARTITION is not set | ||
612 | # CONFIG_ATARI_PARTITION is not set | ||
613 | # CONFIG_MAC_PARTITION is not set | ||
614 | CONFIG_MSDOS_PARTITION=y | ||
615 | # CONFIG_BSD_DISKLABEL is not set | ||
616 | # CONFIG_MINIX_SUBPARTITION is not set | ||
617 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
618 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
619 | # CONFIG_LDM_PARTITION is not set | ||
620 | # CONFIG_SGI_PARTITION is not set | ||
621 | # CONFIG_ULTRIX_PARTITION is not set | ||
622 | # CONFIG_SUN_PARTITION is not set | ||
623 | # CONFIG_KARMA_PARTITION is not set | ||
624 | # CONFIG_EFI_PARTITION is not set | ||
625 | # CONFIG_SYSV68_PARTITION is not set | ||
626 | CONFIG_NLS=y | ||
627 | CONFIG_NLS_DEFAULT="utf8" | ||
628 | CONFIG_NLS_CODEPAGE_437=y | ||
629 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
630 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
631 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
632 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
633 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
634 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
635 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
636 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
637 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
638 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
639 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
640 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
641 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
642 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
643 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
644 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
645 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
646 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
647 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
648 | # CONFIG_NLS_ISO8859_8 is not set | ||
649 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
650 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
651 | CONFIG_NLS_ASCII=m | ||
652 | # CONFIG_NLS_ISO8859_1 is not set | ||
653 | # CONFIG_NLS_ISO8859_2 is not set | ||
654 | # CONFIG_NLS_ISO8859_3 is not set | ||
655 | # CONFIG_NLS_ISO8859_4 is not set | ||
656 | # CONFIG_NLS_ISO8859_5 is not set | ||
657 | # CONFIG_NLS_ISO8859_6 is not set | ||
658 | # CONFIG_NLS_ISO8859_7 is not set | ||
659 | # CONFIG_NLS_ISO8859_9 is not set | ||
660 | # CONFIG_NLS_ISO8859_13 is not set | ||
661 | # CONFIG_NLS_ISO8859_14 is not set | ||
662 | # CONFIG_NLS_ISO8859_15 is not set | ||
663 | # CONFIG_NLS_KOI8_R is not set | ||
664 | # CONFIG_NLS_KOI8_U is not set | ||
665 | # CONFIG_NLS_UTF8 is not set | ||
666 | |||
667 | # | ||
668 | # Kernel hacking | ||
669 | # | ||
670 | # CONFIG_PRINTK_TIME is not set | ||
671 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
672 | CONFIG_ENABLE_MUST_CHECK=y | ||
673 | CONFIG_FRAME_WARN=1024 | ||
674 | CONFIG_MAGIC_SYSRQ=y | ||
675 | # CONFIG_STRIP_ASM_SYMS is not set | ||
676 | # CONFIG_UNUSED_SYMBOLS is not set | ||
677 | CONFIG_DEBUG_FS=y | ||
678 | # CONFIG_HEADERS_CHECK is not set | ||
679 | CONFIG_DEBUG_KERNEL=y | ||
680 | # CONFIG_DEBUG_SHIRQ is not set | ||
681 | CONFIG_DETECT_SOFTLOCKUP=y | ||
682 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
683 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
684 | CONFIG_DETECT_HUNG_TASK=y | ||
685 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
686 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
687 | CONFIG_SCHED_DEBUG=y | ||
688 | # CONFIG_SCHEDSTATS is not set | ||
689 | # CONFIG_TIMER_STATS is not set | ||
690 | # CONFIG_DEBUG_OBJECTS is not set | ||
691 | # CONFIG_SLUB_DEBUG_ON is not set | ||
692 | # CONFIG_SLUB_STATS is not set | ||
693 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
694 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
695 | # CONFIG_RT_MUTEX_TESTER is not set | ||
696 | CONFIG_DEBUG_SPINLOCK=y | ||
697 | # CONFIG_DEBUG_MUTEXES is not set | ||
698 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
699 | # CONFIG_PROVE_LOCKING is not set | ||
700 | # CONFIG_LOCK_STAT is not set | ||
701 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
702 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
703 | # CONFIG_DEBUG_KOBJECT is not set | ||
704 | CONFIG_DEBUG_BUGVERBOSE=y | ||
705 | CONFIG_DEBUG_INFO=y | ||
706 | # CONFIG_DEBUG_VM is not set | ||
707 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
708 | CONFIG_DEBUG_MEMORY_INIT=y | ||
709 | # CONFIG_DEBUG_LIST is not set | ||
710 | # CONFIG_DEBUG_SG is not set | ||
711 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
712 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
713 | CONFIG_FRAME_POINTER=y | ||
714 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
715 | # CONFIG_RCU_TORTURE_TEST is not set | ||
716 | CONFIG_RCU_CPU_STALL_DETECTOR=y | ||
717 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
718 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
719 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
720 | # CONFIG_FAULT_INJECTION is not set | ||
721 | # CONFIG_LATENCYTOP is not set | ||
722 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
723 | # CONFIG_PAGE_POISONING is not set | ||
724 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
725 | CONFIG_TRACING_SUPPORT=y | ||
726 | CONFIG_FTRACE=y | ||
727 | # CONFIG_FUNCTION_TRACER is not set | ||
728 | # CONFIG_IRQSOFF_TRACER is not set | ||
729 | # CONFIG_SCHED_TRACER is not set | ||
730 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
731 | # CONFIG_BOOT_TRACER is not set | ||
732 | CONFIG_BRANCH_PROFILE_NONE=y | ||
733 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
734 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
735 | # CONFIG_STACK_TRACER is not set | ||
736 | # CONFIG_KMEMTRACE is not set | ||
737 | # CONFIG_WORKQUEUE_TRACER is not set | ||
738 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
739 | # CONFIG_DYNAMIC_DEBUG is not set | ||
740 | # CONFIG_SAMPLES is not set | ||
741 | CONFIG_HAVE_ARCH_KGDB=y | ||
742 | # CONFIG_KGDB is not set | ||
743 | # CONFIG_DEBUG_USER is not set | ||
744 | # CONFIG_DEBUG_ERRORS is not set | ||
745 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
746 | # CONFIG_DEBUG_LL is not set | ||
747 | |||
748 | # | ||
749 | # Security options | ||
750 | # | ||
751 | # CONFIG_KEYS is not set | ||
752 | # CONFIG_SECURITY is not set | ||
753 | # CONFIG_SECURITYFS is not set | ||
754 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
755 | # CONFIG_CRYPTO is not set | ||
756 | # CONFIG_BINARY_PRINTF is not set | ||
757 | |||
758 | # | ||
759 | # Library routines | ||
760 | # | ||
761 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
762 | # CONFIG_CRC_CCITT is not set | ||
763 | # CONFIG_CRC16 is not set | ||
764 | # CONFIG_CRC_T10DIF is not set | ||
765 | # CONFIG_CRC_ITU_T is not set | ||
766 | # CONFIG_CRC32 is not set | ||
767 | # CONFIG_CRC7 is not set | ||
768 | # CONFIG_LIBCRC32C is not set | ||
769 | CONFIG_ZLIB_INFLATE=y | ||
770 | CONFIG_DECOMPRESS_GZIP=y | ||
771 | CONFIG_DECOMPRESS_BZIP2=y | ||
772 | CONFIG_DECOMPRESS_LZMA=y | ||
773 | CONFIG_HAS_IOMEM=y | ||
774 | CONFIG_HAS_IOPORT=y | ||
775 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/arm/configs/spear320_defconfig b/arch/arm/configs/spear320_defconfig new file mode 100644 index 000000000000..2ae3c110a21a --- /dev/null +++ b/arch/arm/configs/spear320_defconfig | |||
@@ -0,0 +1,775 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.32 | ||
4 | # Tue Mar 23 14:37:12 2010 | ||
5 | # | ||
6 | CONFIG_ARM=y | ||
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
8 | CONFIG_GENERIC_GPIO=y | ||
9 | CONFIG_GENERIC_TIME=y | ||
10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
11 | CONFIG_GENERIC_HARDIRQS=y | ||
12 | CONFIG_STACKTRACE_SUPPORT=y | ||
13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
14 | CONFIG_LOCKDEP_SUPPORT=y | ||
15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
19 | CONFIG_GENERIC_HWEIGHT=y | ||
20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
22 | CONFIG_VECTORS_BASE=0xffff0000 | ||
23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
24 | CONFIG_CONSTRUCTORS=y | ||
25 | |||
26 | # | ||
27 | # General setup | ||
28 | # | ||
29 | CONFIG_EXPERIMENTAL=y | ||
30 | CONFIG_BROKEN_ON_SMP=y | ||
31 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
32 | CONFIG_LOCALVERSION="" | ||
33 | CONFIG_LOCALVERSION_AUTO=y | ||
34 | CONFIG_SWAP=y | ||
35 | CONFIG_SYSVIPC=y | ||
36 | CONFIG_SYSVIPC_SYSCTL=y | ||
37 | CONFIG_BSD_PROCESS_ACCT=y | ||
38 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
39 | |||
40 | # | ||
41 | # RCU Subsystem | ||
42 | # | ||
43 | CONFIG_TREE_RCU=y | ||
44 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
45 | # CONFIG_RCU_TRACE is not set | ||
46 | CONFIG_RCU_FANOUT=32 | ||
47 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
48 | # CONFIG_TREE_RCU_TRACE is not set | ||
49 | # CONFIG_IKCONFIG is not set | ||
50 | CONFIG_LOG_BUF_SHIFT=17 | ||
51 | # CONFIG_GROUP_SCHED is not set | ||
52 | # CONFIG_CGROUPS is not set | ||
53 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
54 | # CONFIG_RELAY is not set | ||
55 | CONFIG_NAMESPACES=y | ||
56 | # CONFIG_UTS_NS is not set | ||
57 | # CONFIG_IPC_NS is not set | ||
58 | # CONFIG_USER_NS is not set | ||
59 | # CONFIG_PID_NS is not set | ||
60 | CONFIG_BLK_DEV_INITRD=y | ||
61 | CONFIG_INITRAMFS_SOURCE="" | ||
62 | CONFIG_RD_GZIP=y | ||
63 | CONFIG_RD_BZIP2=y | ||
64 | CONFIG_RD_LZMA=y | ||
65 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
66 | CONFIG_SYSCTL=y | ||
67 | CONFIG_ANON_INODES=y | ||
68 | # CONFIG_EMBEDDED is not set | ||
69 | CONFIG_UID16=y | ||
70 | CONFIG_SYSCTL_SYSCALL=y | ||
71 | CONFIG_KALLSYMS=y | ||
72 | # CONFIG_KALLSYMS_ALL is not set | ||
73 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
74 | CONFIG_HOTPLUG=y | ||
75 | CONFIG_PRINTK=y | ||
76 | CONFIG_BUG=y | ||
77 | CONFIG_ELF_CORE=y | ||
78 | CONFIG_BASE_FULL=y | ||
79 | CONFIG_FUTEX=y | ||
80 | CONFIG_EPOLL=y | ||
81 | CONFIG_SIGNALFD=y | ||
82 | CONFIG_TIMERFD=y | ||
83 | CONFIG_EVENTFD=y | ||
84 | CONFIG_SHMEM=y | ||
85 | CONFIG_AIO=y | ||
86 | |||
87 | # | ||
88 | # Kernel Performance Events And Counters | ||
89 | # | ||
90 | CONFIG_VM_EVENT_COUNTERS=y | ||
91 | CONFIG_SLUB_DEBUG=y | ||
92 | CONFIG_COMPAT_BRK=y | ||
93 | # CONFIG_SLAB is not set | ||
94 | CONFIG_SLUB=y | ||
95 | # CONFIG_SLOB is not set | ||
96 | # CONFIG_PROFILING is not set | ||
97 | CONFIG_HAVE_OPROFILE=y | ||
98 | # CONFIG_KPROBES is not set | ||
99 | CONFIG_HAVE_KPROBES=y | ||
100 | CONFIG_HAVE_KRETPROBES=y | ||
101 | CONFIG_HAVE_CLK=y | ||
102 | |||
103 | # | ||
104 | # GCOV-based kernel profiling | ||
105 | # | ||
106 | # CONFIG_GCOV_KERNEL is not set | ||
107 | # CONFIG_SLOW_WORK is not set | ||
108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
109 | CONFIG_SLABINFO=y | ||
110 | CONFIG_RT_MUTEXES=y | ||
111 | CONFIG_BASE_SMALL=0 | ||
112 | CONFIG_MODULES=y | ||
113 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
114 | CONFIG_MODULE_UNLOAD=y | ||
115 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
116 | CONFIG_MODVERSIONS=y | ||
117 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
118 | CONFIG_BLOCK=y | ||
119 | CONFIG_LBDAF=y | ||
120 | CONFIG_BLK_DEV_BSG=y | ||
121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
122 | |||
123 | # | ||
124 | # IO Schedulers | ||
125 | # | ||
126 | CONFIG_IOSCHED_NOOP=y | ||
127 | CONFIG_IOSCHED_AS=y | ||
128 | CONFIG_IOSCHED_DEADLINE=y | ||
129 | CONFIG_IOSCHED_CFQ=y | ||
130 | # CONFIG_DEFAULT_AS is not set | ||
131 | # CONFIG_DEFAULT_DEADLINE is not set | ||
132 | CONFIG_DEFAULT_CFQ=y | ||
133 | # CONFIG_DEFAULT_NOOP is not set | ||
134 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
135 | # CONFIG_FREEZER is not set | ||
136 | |||
137 | # | ||
138 | # System Type | ||
139 | # | ||
140 | CONFIG_MMU=y | ||
141 | # CONFIG_ARCH_AAEC2000 is not set | ||
142 | # CONFIG_ARCH_INTEGRATOR is not set | ||
143 | # CONFIG_ARCH_REALVIEW is not set | ||
144 | # CONFIG_ARCH_VERSATILE is not set | ||
145 | # CONFIG_ARCH_AT91 is not set | ||
146 | # CONFIG_ARCH_CLPS711X is not set | ||
147 | # CONFIG_ARCH_GEMINI is not set | ||
148 | # CONFIG_ARCH_EBSA110 is not set | ||
149 | # CONFIG_ARCH_EP93XX is not set | ||
150 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
151 | # CONFIG_ARCH_MXC is not set | ||
152 | # CONFIG_ARCH_STMP3XXX is not set | ||
153 | # CONFIG_ARCH_NETX is not set | ||
154 | # CONFIG_ARCH_H720X is not set | ||
155 | # CONFIG_ARCH_NOMADIK is not set | ||
156 | # CONFIG_ARCH_IOP13XX is not set | ||
157 | # CONFIG_ARCH_IOP32X is not set | ||
158 | # CONFIG_ARCH_IOP33X is not set | ||
159 | # CONFIG_ARCH_IXP23XX is not set | ||
160 | # CONFIG_ARCH_IXP2000 is not set | ||
161 | # CONFIG_ARCH_IXP4XX is not set | ||
162 | # CONFIG_ARCH_L7200 is not set | ||
163 | # CONFIG_ARCH_KIRKWOOD is not set | ||
164 | # CONFIG_ARCH_LOKI is not set | ||
165 | # CONFIG_ARCH_MV78XX0 is not set | ||
166 | # CONFIG_ARCH_ORION5X is not set | ||
167 | # CONFIG_ARCH_MMP is not set | ||
168 | # CONFIG_ARCH_KS8695 is not set | ||
169 | # CONFIG_ARCH_NS9XXX is not set | ||
170 | # CONFIG_ARCH_W90X900 is not set | ||
171 | # CONFIG_ARCH_PNX4008 is not set | ||
172 | # CONFIG_ARCH_PXA is not set | ||
173 | # CONFIG_ARCH_MSM is not set | ||
174 | # CONFIG_ARCH_RPC is not set | ||
175 | # CONFIG_ARCH_SA1100 is not set | ||
176 | # CONFIG_ARCH_S3C2410 is not set | ||
177 | # CONFIG_ARCH_S3C64XX is not set | ||
178 | # CONFIG_ARCH_S5PC1XX is not set | ||
179 | # CONFIG_ARCH_SHARK is not set | ||
180 | # CONFIG_ARCH_LH7A40X is not set | ||
181 | # CONFIG_ARCH_U300 is not set | ||
182 | # CONFIG_ARCH_DAVINCI is not set | ||
183 | # CONFIG_ARCH_OMAP is not set | ||
184 | # CONFIG_ARCH_BCMRING is not set | ||
185 | CONFIG_PLAT_SPEAR=y | ||
186 | CONFIG_ARCH_SPEAR3XX=y | ||
187 | # CONFIG_ARCH_SPEAR6XX is not set | ||
188 | # CONFIG_MACH_SPEAR300 is not set | ||
189 | # CONFIG_MACH_SPEAR310 is not set | ||
190 | CONFIG_MACH_SPEAR320=y | ||
191 | # CONFIG_BOARD_SPEAR300_EVB is not set | ||
192 | CONFIG_BOARD_SPEAR320_EVB=y | ||
193 | |||
194 | # | ||
195 | # Processor Type | ||
196 | # | ||
197 | CONFIG_CPU_32=y | ||
198 | CONFIG_CPU_ARM926T=y | ||
199 | CONFIG_CPU_32v5=y | ||
200 | CONFIG_CPU_ABRT_EV5TJ=y | ||
201 | CONFIG_CPU_PABRT_LEGACY=y | ||
202 | CONFIG_CPU_CACHE_VIVT=y | ||
203 | CONFIG_CPU_COPY_V4WB=y | ||
204 | CONFIG_CPU_TLB_V4WBI=y | ||
205 | CONFIG_CPU_CP15=y | ||
206 | CONFIG_CPU_CP15_MMU=y | ||
207 | |||
208 | # | ||
209 | # Processor Features | ||
210 | # | ||
211 | CONFIG_ARM_THUMB=y | ||
212 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
213 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
214 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
215 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
216 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
217 | CONFIG_ARM_VIC=y | ||
218 | CONFIG_ARM_VIC_NR=2 | ||
219 | CONFIG_COMMON_CLKDEV=y | ||
220 | |||
221 | # | ||
222 | # Bus support | ||
223 | # | ||
224 | CONFIG_ARM_AMBA=y | ||
225 | # CONFIG_PCI_SYSCALL is not set | ||
226 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
227 | # CONFIG_PCCARD is not set | ||
228 | |||
229 | # | ||
230 | # Kernel Features | ||
231 | # | ||
232 | # CONFIG_NO_HZ is not set | ||
233 | # CONFIG_HIGH_RES_TIMERS is not set | ||
234 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
235 | CONFIG_VMSPLIT_3G=y | ||
236 | # CONFIG_VMSPLIT_2G is not set | ||
237 | # CONFIG_VMSPLIT_1G is not set | ||
238 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
239 | CONFIG_PREEMPT_NONE=y | ||
240 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
241 | # CONFIG_PREEMPT is not set | ||
242 | CONFIG_HZ=100 | ||
243 | # CONFIG_AEABI is not set | ||
244 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
245 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
246 | # CONFIG_HIGHMEM is not set | ||
247 | CONFIG_SELECT_MEMORY_MODEL=y | ||
248 | CONFIG_FLATMEM_MANUAL=y | ||
249 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
250 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
251 | CONFIG_FLATMEM=y | ||
252 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
253 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
254 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
255 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
256 | CONFIG_ZONE_DMA_FLAG=0 | ||
257 | CONFIG_VIRT_TO_BUS=y | ||
258 | CONFIG_HAVE_MLOCK=y | ||
259 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
260 | # CONFIG_KSM is not set | ||
261 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
262 | CONFIG_ALIGNMENT_TRAP=y | ||
263 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
264 | |||
265 | # | ||
266 | # Boot options | ||
267 | # | ||
268 | CONFIG_ZBOOT_ROM_TEXT=0 | ||
269 | CONFIG_ZBOOT_ROM_BSS=0 | ||
270 | CONFIG_CMDLINE="" | ||
271 | # CONFIG_XIP_KERNEL is not set | ||
272 | # CONFIG_KEXEC is not set | ||
273 | |||
274 | # | ||
275 | # CPU Power Management | ||
276 | # | ||
277 | # CONFIG_CPU_IDLE is not set | ||
278 | |||
279 | # | ||
280 | # Floating point emulation | ||
281 | # | ||
282 | |||
283 | # | ||
284 | # At least one emulation must be selected | ||
285 | # | ||
286 | # CONFIG_FPE_NWFPE is not set | ||
287 | # CONFIG_FPE_FASTFPE is not set | ||
288 | # CONFIG_VFP is not set | ||
289 | |||
290 | # | ||
291 | # Userspace binary formats | ||
292 | # | ||
293 | CONFIG_BINFMT_ELF=y | ||
294 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
295 | CONFIG_HAVE_AOUT=y | ||
296 | # CONFIG_BINFMT_AOUT is not set | ||
297 | CONFIG_BINFMT_MISC=y | ||
298 | |||
299 | # | ||
300 | # Power management options | ||
301 | # | ||
302 | # CONFIG_PM is not set | ||
303 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
304 | # CONFIG_NET is not set | ||
305 | |||
306 | # | ||
307 | # Device Drivers | ||
308 | # | ||
309 | |||
310 | # | ||
311 | # Generic Driver Options | ||
312 | # | ||
313 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
314 | # CONFIG_DEVTMPFS is not set | ||
315 | CONFIG_STANDALONE=y | ||
316 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
317 | CONFIG_FW_LOADER=y | ||
318 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
319 | CONFIG_EXTRA_FIRMWARE="" | ||
320 | # CONFIG_DEBUG_DRIVER is not set | ||
321 | # CONFIG_DEBUG_DEVRES is not set | ||
322 | # CONFIG_SYS_HYPERVISOR is not set | ||
323 | # CONFIG_MTD is not set | ||
324 | # CONFIG_PARPORT is not set | ||
325 | CONFIG_BLK_DEV=y | ||
326 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
327 | # CONFIG_BLK_DEV_LOOP is not set | ||
328 | CONFIG_BLK_DEV_RAM=y | ||
329 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
330 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
331 | # CONFIG_BLK_DEV_XIP is not set | ||
332 | # CONFIG_CDROM_PKTCDVD is not set | ||
333 | # CONFIG_MG_DISK is not set | ||
334 | CONFIG_MISC_DEVICES=y | ||
335 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
336 | # CONFIG_C2PORT is not set | ||
337 | |||
338 | # | ||
339 | # EEPROM support | ||
340 | # | ||
341 | # CONFIG_EEPROM_93CX6 is not set | ||
342 | CONFIG_HAVE_IDE=y | ||
343 | # CONFIG_IDE is not set | ||
344 | |||
345 | # | ||
346 | # SCSI device support | ||
347 | # | ||
348 | # CONFIG_RAID_ATTRS is not set | ||
349 | # CONFIG_SCSI is not set | ||
350 | # CONFIG_SCSI_DMA is not set | ||
351 | # CONFIG_SCSI_NETLINK is not set | ||
352 | # CONFIG_ATA is not set | ||
353 | # CONFIG_MD is not set | ||
354 | # CONFIG_PHONE is not set | ||
355 | |||
356 | # | ||
357 | # Input device support | ||
358 | # | ||
359 | CONFIG_INPUT=y | ||
360 | CONFIG_INPUT_FF_MEMLESS=y | ||
361 | # CONFIG_INPUT_POLLDEV is not set | ||
362 | |||
363 | # | ||
364 | # Userland interfaces | ||
365 | # | ||
366 | CONFIG_INPUT_MOUSEDEV=y | ||
367 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
368 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
369 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
370 | # CONFIG_INPUT_JOYDEV is not set | ||
371 | # CONFIG_INPUT_EVDEV is not set | ||
372 | # CONFIG_INPUT_EVBUG is not set | ||
373 | |||
374 | # | ||
375 | # Input Device Drivers | ||
376 | # | ||
377 | # CONFIG_INPUT_KEYBOARD is not set | ||
378 | # CONFIG_INPUT_MOUSE is not set | ||
379 | # CONFIG_INPUT_JOYSTICK is not set | ||
380 | # CONFIG_INPUT_TABLET is not set | ||
381 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
382 | # CONFIG_INPUT_MISC is not set | ||
383 | |||
384 | # | ||
385 | # Hardware I/O ports | ||
386 | # | ||
387 | CONFIG_SERIO=y | ||
388 | CONFIG_SERIO_SERPORT=y | ||
389 | # CONFIG_SERIO_AMBAKMI is not set | ||
390 | # CONFIG_SERIO_RAW is not set | ||
391 | # CONFIG_GAMEPORT is not set | ||
392 | |||
393 | # | ||
394 | # Character devices | ||
395 | # | ||
396 | CONFIG_VT=y | ||
397 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
398 | CONFIG_VT_CONSOLE=y | ||
399 | CONFIG_HW_CONSOLE=y | ||
400 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
401 | CONFIG_DEVKMEM=y | ||
402 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
403 | |||
404 | # | ||
405 | # Serial drivers | ||
406 | # | ||
407 | # CONFIG_SERIAL_8250 is not set | ||
408 | |||
409 | # | ||
410 | # Non-8250 serial port support | ||
411 | # | ||
412 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
413 | CONFIG_SERIAL_AMBA_PL011=y | ||
414 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||
415 | CONFIG_SERIAL_CORE=y | ||
416 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
417 | CONFIG_UNIX98_PTYS=y | ||
418 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
419 | # CONFIG_LEGACY_PTYS is not set | ||
420 | # CONFIG_IPMI_HANDLER is not set | ||
421 | # CONFIG_HW_RANDOM is not set | ||
422 | # CONFIG_R3964 is not set | ||
423 | CONFIG_RAW_DRIVER=y | ||
424 | CONFIG_MAX_RAW_DEVS=8192 | ||
425 | # CONFIG_TCG_TPM is not set | ||
426 | # CONFIG_I2C is not set | ||
427 | # CONFIG_SPI is not set | ||
428 | |||
429 | # | ||
430 | # PPS support | ||
431 | # | ||
432 | # CONFIG_PPS is not set | ||
433 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
434 | CONFIG_GPIOLIB=y | ||
435 | # CONFIG_DEBUG_GPIO is not set | ||
436 | CONFIG_GPIO_SYSFS=y | ||
437 | |||
438 | # | ||
439 | # Memory mapped GPIO expanders: | ||
440 | # | ||
441 | CONFIG_GPIO_PL061=y | ||
442 | |||
443 | # | ||
444 | # I2C GPIO expanders: | ||
445 | # | ||
446 | |||
447 | # | ||
448 | # PCI GPIO expanders: | ||
449 | # | ||
450 | |||
451 | # | ||
452 | # SPI GPIO expanders: | ||
453 | # | ||
454 | |||
455 | # | ||
456 | # AC97 GPIO expanders: | ||
457 | # | ||
458 | # CONFIG_W1 is not set | ||
459 | # CONFIG_POWER_SUPPLY is not set | ||
460 | # CONFIG_HWMON is not set | ||
461 | # CONFIG_THERMAL is not set | ||
462 | # CONFIG_WATCHDOG is not set | ||
463 | CONFIG_SSB_POSSIBLE=y | ||
464 | |||
465 | # | ||
466 | # Sonics Silicon Backplane | ||
467 | # | ||
468 | # CONFIG_SSB is not set | ||
469 | |||
470 | # | ||
471 | # Multifunction device drivers | ||
472 | # | ||
473 | # CONFIG_MFD_CORE is not set | ||
474 | # CONFIG_MFD_SM501 is not set | ||
475 | # CONFIG_MFD_ASIC3 is not set | ||
476 | # CONFIG_HTC_EGPIO is not set | ||
477 | # CONFIG_HTC_PASIC3 is not set | ||
478 | # CONFIG_MFD_TMIO is not set | ||
479 | # CONFIG_MFD_T7L66XB is not set | ||
480 | # CONFIG_MFD_TC6387XB is not set | ||
481 | # CONFIG_MFD_TC6393XB is not set | ||
482 | # CONFIG_REGULATOR is not set | ||
483 | # CONFIG_MEDIA_SUPPORT is not set | ||
484 | |||
485 | # | ||
486 | # Graphics support | ||
487 | # | ||
488 | # CONFIG_VGASTATE is not set | ||
489 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
490 | # CONFIG_FB is not set | ||
491 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
492 | |||
493 | # | ||
494 | # Display device support | ||
495 | # | ||
496 | # CONFIG_DISPLAY_SUPPORT is not set | ||
497 | |||
498 | # | ||
499 | # Console display driver support | ||
500 | # | ||
501 | # CONFIG_VGA_CONSOLE is not set | ||
502 | CONFIG_DUMMY_CONSOLE=y | ||
503 | # CONFIG_SOUND is not set | ||
504 | # CONFIG_HID_SUPPORT is not set | ||
505 | # CONFIG_USB_SUPPORT is not set | ||
506 | # CONFIG_MMC is not set | ||
507 | # CONFIG_MEMSTICK is not set | ||
508 | # CONFIG_NEW_LEDS is not set | ||
509 | # CONFIG_ACCESSIBILITY is not set | ||
510 | CONFIG_RTC_LIB=y | ||
511 | # CONFIG_RTC_CLASS is not set | ||
512 | # CONFIG_DMADEVICES is not set | ||
513 | # CONFIG_AUXDISPLAY is not set | ||
514 | # CONFIG_UIO is not set | ||
515 | |||
516 | # | ||
517 | # TI VLYNQ | ||
518 | # | ||
519 | # CONFIG_STAGING is not set | ||
520 | |||
521 | # | ||
522 | # File systems | ||
523 | # | ||
524 | CONFIG_EXT2_FS=y | ||
525 | CONFIG_EXT2_FS_XATTR=y | ||
526 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
527 | CONFIG_EXT2_FS_SECURITY=y | ||
528 | # CONFIG_EXT2_FS_XIP is not set | ||
529 | CONFIG_EXT3_FS=y | ||
530 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
531 | CONFIG_EXT3_FS_XATTR=y | ||
532 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
533 | CONFIG_EXT3_FS_SECURITY=y | ||
534 | # CONFIG_EXT4_FS is not set | ||
535 | CONFIG_JBD=y | ||
536 | # CONFIG_JBD_DEBUG is not set | ||
537 | CONFIG_FS_MBCACHE=y | ||
538 | # CONFIG_REISERFS_FS is not set | ||
539 | # CONFIG_JFS_FS is not set | ||
540 | # CONFIG_FS_POSIX_ACL is not set | ||
541 | # CONFIG_XFS_FS is not set | ||
542 | # CONFIG_GFS2_FS is not set | ||
543 | # CONFIG_BTRFS_FS is not set | ||
544 | # CONFIG_NILFS2_FS is not set | ||
545 | CONFIG_FILE_LOCKING=y | ||
546 | CONFIG_FSNOTIFY=y | ||
547 | CONFIG_DNOTIFY=y | ||
548 | # CONFIG_INOTIFY is not set | ||
549 | CONFIG_INOTIFY_USER=y | ||
550 | # CONFIG_QUOTA is not set | ||
551 | # CONFIG_AUTOFS_FS is not set | ||
552 | CONFIG_AUTOFS4_FS=m | ||
553 | # CONFIG_FUSE_FS is not set | ||
554 | |||
555 | # | ||
556 | # Caches | ||
557 | # | ||
558 | # CONFIG_FSCACHE is not set | ||
559 | |||
560 | # | ||
561 | # CD-ROM/DVD Filesystems | ||
562 | # | ||
563 | # CONFIG_ISO9660_FS is not set | ||
564 | # CONFIG_UDF_FS is not set | ||
565 | |||
566 | # | ||
567 | # DOS/FAT/NT Filesystems | ||
568 | # | ||
569 | CONFIG_FAT_FS=m | ||
570 | CONFIG_MSDOS_FS=m | ||
571 | CONFIG_VFAT_FS=m | ||
572 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
573 | CONFIG_FAT_DEFAULT_IOCHARSET="ascii" | ||
574 | # CONFIG_NTFS_FS is not set | ||
575 | |||
576 | # | ||
577 | # Pseudo filesystems | ||
578 | # | ||
579 | CONFIG_PROC_FS=y | ||
580 | CONFIG_PROC_SYSCTL=y | ||
581 | CONFIG_PROC_PAGE_MONITOR=y | ||
582 | CONFIG_SYSFS=y | ||
583 | CONFIG_TMPFS=y | ||
584 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
585 | # CONFIG_HUGETLB_PAGE is not set | ||
586 | # CONFIG_CONFIGFS_FS is not set | ||
587 | CONFIG_MISC_FILESYSTEMS=y | ||
588 | # CONFIG_ADFS_FS is not set | ||
589 | # CONFIG_AFFS_FS is not set | ||
590 | # CONFIG_HFS_FS is not set | ||
591 | # CONFIG_HFSPLUS_FS is not set | ||
592 | # CONFIG_BEFS_FS is not set | ||
593 | # CONFIG_BFS_FS is not set | ||
594 | # CONFIG_EFS_FS is not set | ||
595 | # CONFIG_SQUASHFS is not set | ||
596 | # CONFIG_VXFS_FS is not set | ||
597 | # CONFIG_MINIX_FS is not set | ||
598 | # CONFIG_OMFS_FS is not set | ||
599 | # CONFIG_HPFS_FS is not set | ||
600 | # CONFIG_QNX4FS_FS is not set | ||
601 | # CONFIG_ROMFS_FS is not set | ||
602 | # CONFIG_SYSV_FS is not set | ||
603 | # CONFIG_UFS_FS is not set | ||
604 | |||
605 | # | ||
606 | # Partition Types | ||
607 | # | ||
608 | CONFIG_PARTITION_ADVANCED=y | ||
609 | # CONFIG_ACORN_PARTITION is not set | ||
610 | # CONFIG_OSF_PARTITION is not set | ||
611 | # CONFIG_AMIGA_PARTITION is not set | ||
612 | # CONFIG_ATARI_PARTITION is not set | ||
613 | # CONFIG_MAC_PARTITION is not set | ||
614 | CONFIG_MSDOS_PARTITION=y | ||
615 | # CONFIG_BSD_DISKLABEL is not set | ||
616 | # CONFIG_MINIX_SUBPARTITION is not set | ||
617 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
618 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
619 | # CONFIG_LDM_PARTITION is not set | ||
620 | # CONFIG_SGI_PARTITION is not set | ||
621 | # CONFIG_ULTRIX_PARTITION is not set | ||
622 | # CONFIG_SUN_PARTITION is not set | ||
623 | # CONFIG_KARMA_PARTITION is not set | ||
624 | # CONFIG_EFI_PARTITION is not set | ||
625 | # CONFIG_SYSV68_PARTITION is not set | ||
626 | CONFIG_NLS=y | ||
627 | CONFIG_NLS_DEFAULT="utf8" | ||
628 | CONFIG_NLS_CODEPAGE_437=y | ||
629 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
630 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
631 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
632 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
633 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
634 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
635 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
636 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
637 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
638 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
639 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
640 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
641 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
642 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
643 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
644 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
645 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
646 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
647 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
648 | # CONFIG_NLS_ISO8859_8 is not set | ||
649 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
650 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
651 | CONFIG_NLS_ASCII=m | ||
652 | # CONFIG_NLS_ISO8859_1 is not set | ||
653 | # CONFIG_NLS_ISO8859_2 is not set | ||
654 | # CONFIG_NLS_ISO8859_3 is not set | ||
655 | # CONFIG_NLS_ISO8859_4 is not set | ||
656 | # CONFIG_NLS_ISO8859_5 is not set | ||
657 | # CONFIG_NLS_ISO8859_6 is not set | ||
658 | # CONFIG_NLS_ISO8859_7 is not set | ||
659 | # CONFIG_NLS_ISO8859_9 is not set | ||
660 | # CONFIG_NLS_ISO8859_13 is not set | ||
661 | # CONFIG_NLS_ISO8859_14 is not set | ||
662 | # CONFIG_NLS_ISO8859_15 is not set | ||
663 | # CONFIG_NLS_KOI8_R is not set | ||
664 | # CONFIG_NLS_KOI8_U is not set | ||
665 | # CONFIG_NLS_UTF8 is not set | ||
666 | |||
667 | # | ||
668 | # Kernel hacking | ||
669 | # | ||
670 | # CONFIG_PRINTK_TIME is not set | ||
671 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
672 | CONFIG_ENABLE_MUST_CHECK=y | ||
673 | CONFIG_FRAME_WARN=1024 | ||
674 | CONFIG_MAGIC_SYSRQ=y | ||
675 | # CONFIG_STRIP_ASM_SYMS is not set | ||
676 | # CONFIG_UNUSED_SYMBOLS is not set | ||
677 | CONFIG_DEBUG_FS=y | ||
678 | # CONFIG_HEADERS_CHECK is not set | ||
679 | CONFIG_DEBUG_KERNEL=y | ||
680 | # CONFIG_DEBUG_SHIRQ is not set | ||
681 | CONFIG_DETECT_SOFTLOCKUP=y | ||
682 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
683 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
684 | CONFIG_DETECT_HUNG_TASK=y | ||
685 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
686 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
687 | CONFIG_SCHED_DEBUG=y | ||
688 | # CONFIG_SCHEDSTATS is not set | ||
689 | # CONFIG_TIMER_STATS is not set | ||
690 | # CONFIG_DEBUG_OBJECTS is not set | ||
691 | # CONFIG_SLUB_DEBUG_ON is not set | ||
692 | # CONFIG_SLUB_STATS is not set | ||
693 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
694 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
695 | # CONFIG_RT_MUTEX_TESTER is not set | ||
696 | CONFIG_DEBUG_SPINLOCK=y | ||
697 | # CONFIG_DEBUG_MUTEXES is not set | ||
698 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
699 | # CONFIG_PROVE_LOCKING is not set | ||
700 | # CONFIG_LOCK_STAT is not set | ||
701 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
702 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
703 | # CONFIG_DEBUG_KOBJECT is not set | ||
704 | CONFIG_DEBUG_BUGVERBOSE=y | ||
705 | CONFIG_DEBUG_INFO=y | ||
706 | # CONFIG_DEBUG_VM is not set | ||
707 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
708 | CONFIG_DEBUG_MEMORY_INIT=y | ||
709 | # CONFIG_DEBUG_LIST is not set | ||
710 | # CONFIG_DEBUG_SG is not set | ||
711 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
712 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
713 | CONFIG_FRAME_POINTER=y | ||
714 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
715 | # CONFIG_RCU_TORTURE_TEST is not set | ||
716 | CONFIG_RCU_CPU_STALL_DETECTOR=y | ||
717 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
718 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
719 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
720 | # CONFIG_FAULT_INJECTION is not set | ||
721 | # CONFIG_LATENCYTOP is not set | ||
722 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
723 | # CONFIG_PAGE_POISONING is not set | ||
724 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
725 | CONFIG_TRACING_SUPPORT=y | ||
726 | CONFIG_FTRACE=y | ||
727 | # CONFIG_FUNCTION_TRACER is not set | ||
728 | # CONFIG_IRQSOFF_TRACER is not set | ||
729 | # CONFIG_SCHED_TRACER is not set | ||
730 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
731 | # CONFIG_BOOT_TRACER is not set | ||
732 | CONFIG_BRANCH_PROFILE_NONE=y | ||
733 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
734 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
735 | # CONFIG_STACK_TRACER is not set | ||
736 | # CONFIG_KMEMTRACE is not set | ||
737 | # CONFIG_WORKQUEUE_TRACER is not set | ||
738 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
739 | # CONFIG_DYNAMIC_DEBUG is not set | ||
740 | # CONFIG_SAMPLES is not set | ||
741 | CONFIG_HAVE_ARCH_KGDB=y | ||
742 | # CONFIG_KGDB is not set | ||
743 | # CONFIG_DEBUG_USER is not set | ||
744 | # CONFIG_DEBUG_ERRORS is not set | ||
745 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
746 | # CONFIG_DEBUG_LL is not set | ||
747 | |||
748 | # | ||
749 | # Security options | ||
750 | # | ||
751 | # CONFIG_KEYS is not set | ||
752 | # CONFIG_SECURITY is not set | ||
753 | # CONFIG_SECURITYFS is not set | ||
754 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
755 | # CONFIG_CRYPTO is not set | ||
756 | # CONFIG_BINARY_PRINTF is not set | ||
757 | |||
758 | # | ||
759 | # Library routines | ||
760 | # | ||
761 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
762 | # CONFIG_CRC_CCITT is not set | ||
763 | # CONFIG_CRC16 is not set | ||
764 | # CONFIG_CRC_T10DIF is not set | ||
765 | # CONFIG_CRC_ITU_T is not set | ||
766 | # CONFIG_CRC32 is not set | ||
767 | # CONFIG_CRC7 is not set | ||
768 | # CONFIG_LIBCRC32C is not set | ||
769 | CONFIG_ZLIB_INFLATE=y | ||
770 | CONFIG_DECOMPRESS_GZIP=y | ||
771 | CONFIG_DECOMPRESS_BZIP2=y | ||
772 | CONFIG_DECOMPRESS_LZMA=y | ||
773 | CONFIG_HAS_IOMEM=y | ||
774 | CONFIG_HAS_IOPORT=y | ||
775 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/arm/configs/spear600_defconfig b/arch/arm/configs/spear600_defconfig new file mode 100644 index 000000000000..c85a02924ec5 --- /dev/null +++ b/arch/arm/configs/spear600_defconfig | |||
@@ -0,0 +1,760 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.32 | ||
4 | # Tue Mar 23 14:37:26 2010 | ||
5 | # | ||
6 | CONFIG_ARM=y | ||
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
8 | CONFIG_GENERIC_GPIO=y | ||
9 | CONFIG_GENERIC_TIME=y | ||
10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
11 | CONFIG_GENERIC_HARDIRQS=y | ||
12 | CONFIG_STACKTRACE_SUPPORT=y | ||
13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
14 | CONFIG_LOCKDEP_SUPPORT=y | ||
15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
19 | CONFIG_GENERIC_HWEIGHT=y | ||
20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
22 | CONFIG_VECTORS_BASE=0xffff0000 | ||
23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
24 | CONFIG_CONSTRUCTORS=y | ||
25 | |||
26 | # | ||
27 | # General setup | ||
28 | # | ||
29 | CONFIG_EXPERIMENTAL=y | ||
30 | CONFIG_BROKEN_ON_SMP=y | ||
31 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
32 | CONFIG_LOCALVERSION="" | ||
33 | CONFIG_LOCALVERSION_AUTO=y | ||
34 | CONFIG_SWAP=y | ||
35 | CONFIG_SYSVIPC=y | ||
36 | CONFIG_SYSVIPC_SYSCTL=y | ||
37 | CONFIG_BSD_PROCESS_ACCT=y | ||
38 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
39 | |||
40 | # | ||
41 | # RCU Subsystem | ||
42 | # | ||
43 | CONFIG_TREE_RCU=y | ||
44 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
45 | # CONFIG_RCU_TRACE is not set | ||
46 | CONFIG_RCU_FANOUT=32 | ||
47 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
48 | # CONFIG_TREE_RCU_TRACE is not set | ||
49 | # CONFIG_IKCONFIG is not set | ||
50 | CONFIG_LOG_BUF_SHIFT=17 | ||
51 | # CONFIG_GROUP_SCHED is not set | ||
52 | # CONFIG_CGROUPS is not set | ||
53 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
54 | # CONFIG_RELAY is not set | ||
55 | CONFIG_NAMESPACES=y | ||
56 | # CONFIG_UTS_NS is not set | ||
57 | # CONFIG_IPC_NS is not set | ||
58 | # CONFIG_USER_NS is not set | ||
59 | # CONFIG_PID_NS is not set | ||
60 | CONFIG_BLK_DEV_INITRD=y | ||
61 | CONFIG_INITRAMFS_SOURCE="" | ||
62 | CONFIG_RD_GZIP=y | ||
63 | CONFIG_RD_BZIP2=y | ||
64 | CONFIG_RD_LZMA=y | ||
65 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
66 | CONFIG_SYSCTL=y | ||
67 | CONFIG_ANON_INODES=y | ||
68 | # CONFIG_EMBEDDED is not set | ||
69 | CONFIG_UID16=y | ||
70 | CONFIG_SYSCTL_SYSCALL=y | ||
71 | CONFIG_KALLSYMS=y | ||
72 | # CONFIG_KALLSYMS_ALL is not set | ||
73 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
74 | CONFIG_HOTPLUG=y | ||
75 | CONFIG_PRINTK=y | ||
76 | CONFIG_BUG=y | ||
77 | CONFIG_ELF_CORE=y | ||
78 | CONFIG_BASE_FULL=y | ||
79 | CONFIG_FUTEX=y | ||
80 | CONFIG_EPOLL=y | ||
81 | CONFIG_SIGNALFD=y | ||
82 | CONFIG_TIMERFD=y | ||
83 | CONFIG_EVENTFD=y | ||
84 | CONFIG_SHMEM=y | ||
85 | CONFIG_AIO=y | ||
86 | |||
87 | # | ||
88 | # Kernel Performance Events And Counters | ||
89 | # | ||
90 | CONFIG_VM_EVENT_COUNTERS=y | ||
91 | CONFIG_SLUB_DEBUG=y | ||
92 | CONFIG_COMPAT_BRK=y | ||
93 | # CONFIG_SLAB is not set | ||
94 | CONFIG_SLUB=y | ||
95 | # CONFIG_SLOB is not set | ||
96 | # CONFIG_PROFILING is not set | ||
97 | CONFIG_HAVE_OPROFILE=y | ||
98 | # CONFIG_KPROBES is not set | ||
99 | CONFIG_HAVE_KPROBES=y | ||
100 | CONFIG_HAVE_KRETPROBES=y | ||
101 | CONFIG_HAVE_CLK=y | ||
102 | |||
103 | # | ||
104 | # GCOV-based kernel profiling | ||
105 | # | ||
106 | # CONFIG_GCOV_KERNEL is not set | ||
107 | # CONFIG_SLOW_WORK is not set | ||
108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
109 | CONFIG_SLABINFO=y | ||
110 | CONFIG_RT_MUTEXES=y | ||
111 | CONFIG_BASE_SMALL=0 | ||
112 | CONFIG_MODULES=y | ||
113 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
114 | CONFIG_MODULE_UNLOAD=y | ||
115 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
116 | CONFIG_MODVERSIONS=y | ||
117 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
118 | CONFIG_BLOCK=y | ||
119 | CONFIG_LBDAF=y | ||
120 | CONFIG_BLK_DEV_BSG=y | ||
121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
122 | |||
123 | # | ||
124 | # IO Schedulers | ||
125 | # | ||
126 | CONFIG_IOSCHED_NOOP=y | ||
127 | CONFIG_IOSCHED_AS=y | ||
128 | CONFIG_IOSCHED_DEADLINE=y | ||
129 | CONFIG_IOSCHED_CFQ=y | ||
130 | # CONFIG_DEFAULT_AS is not set | ||
131 | # CONFIG_DEFAULT_DEADLINE is not set | ||
132 | CONFIG_DEFAULT_CFQ=y | ||
133 | # CONFIG_DEFAULT_NOOP is not set | ||
134 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
135 | # CONFIG_FREEZER is not set | ||
136 | |||
137 | # | ||
138 | # System Type | ||
139 | # | ||
140 | CONFIG_MMU=y | ||
141 | # CONFIG_ARCH_AAEC2000 is not set | ||
142 | # CONFIG_ARCH_INTEGRATOR is not set | ||
143 | # CONFIG_ARCH_REALVIEW is not set | ||
144 | # CONFIG_ARCH_VERSATILE is not set | ||
145 | # CONFIG_ARCH_AT91 is not set | ||
146 | # CONFIG_ARCH_CLPS711X is not set | ||
147 | # CONFIG_ARCH_GEMINI is not set | ||
148 | # CONFIG_ARCH_EBSA110 is not set | ||
149 | # CONFIG_ARCH_EP93XX is not set | ||
150 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
151 | # CONFIG_ARCH_MXC is not set | ||
152 | # CONFIG_ARCH_STMP3XXX is not set | ||
153 | # CONFIG_ARCH_NETX is not set | ||
154 | # CONFIG_ARCH_H720X is not set | ||
155 | # CONFIG_ARCH_NOMADIK is not set | ||
156 | # CONFIG_ARCH_IOP13XX is not set | ||
157 | # CONFIG_ARCH_IOP32X is not set | ||
158 | # CONFIG_ARCH_IOP33X is not set | ||
159 | # CONFIG_ARCH_IXP23XX is not set | ||
160 | # CONFIG_ARCH_IXP2000 is not set | ||
161 | # CONFIG_ARCH_IXP4XX is not set | ||
162 | # CONFIG_ARCH_L7200 is not set | ||
163 | # CONFIG_ARCH_KIRKWOOD is not set | ||
164 | # CONFIG_ARCH_LOKI is not set | ||
165 | # CONFIG_ARCH_MV78XX0 is not set | ||
166 | # CONFIG_ARCH_ORION5X is not set | ||
167 | # CONFIG_ARCH_MMP is not set | ||
168 | # CONFIG_ARCH_KS8695 is not set | ||
169 | # CONFIG_ARCH_NS9XXX is not set | ||
170 | # CONFIG_ARCH_W90X900 is not set | ||
171 | # CONFIG_ARCH_PNX4008 is not set | ||
172 | # CONFIG_ARCH_PXA is not set | ||
173 | # CONFIG_ARCH_MSM is not set | ||
174 | # CONFIG_ARCH_RPC is not set | ||
175 | # CONFIG_ARCH_SA1100 is not set | ||
176 | # CONFIG_ARCH_S3C2410 is not set | ||
177 | # CONFIG_ARCH_S3C64XX is not set | ||
178 | # CONFIG_ARCH_S5PC1XX is not set | ||
179 | # CONFIG_ARCH_SHARK is not set | ||
180 | # CONFIG_ARCH_LH7A40X is not set | ||
181 | # CONFIG_ARCH_U300 is not set | ||
182 | # CONFIG_ARCH_DAVINCI is not set | ||
183 | # CONFIG_ARCH_OMAP is not set | ||
184 | # CONFIG_ARCH_BCMRING is not set | ||
185 | CONFIG_PLAT_SPEAR=y | ||
186 | # CONFIG_ARCH_SPEAR3XX is not set | ||
187 | CONFIG_ARCH_SPEAR6XX=y | ||
188 | # CONFIG_MACH_SPEAR300 is not set | ||
189 | # CONFIG_MACH_SPEAR310 is not set | ||
190 | # CONFIG_MACH_SPEAR320 is not set | ||
191 | # CONFIG_BOARD_SPEAR300_EVB is not set | ||
192 | CONFIG_MACH_SPEAR600=y | ||
193 | CONFIG_BOARD_SPEAR600_EVB=y | ||
194 | |||
195 | # | ||
196 | # Processor Type | ||
197 | # | ||
198 | CONFIG_CPU_32=y | ||
199 | CONFIG_CPU_ARM926T=y | ||
200 | CONFIG_CPU_32v5=y | ||
201 | CONFIG_CPU_ABRT_EV5TJ=y | ||
202 | CONFIG_CPU_PABRT_LEGACY=y | ||
203 | CONFIG_CPU_CACHE_VIVT=y | ||
204 | CONFIG_CPU_COPY_V4WB=y | ||
205 | CONFIG_CPU_TLB_V4WBI=y | ||
206 | CONFIG_CPU_CP15=y | ||
207 | CONFIG_CPU_CP15_MMU=y | ||
208 | |||
209 | # | ||
210 | # Processor Features | ||
211 | # | ||
212 | CONFIG_ARM_THUMB=y | ||
213 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
214 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
215 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
216 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
217 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
218 | CONFIG_ARM_VIC=y | ||
219 | CONFIG_ARM_VIC_NR=2 | ||
220 | CONFIG_COMMON_CLKDEV=y | ||
221 | |||
222 | # | ||
223 | # Bus support | ||
224 | # | ||
225 | CONFIG_ARM_AMBA=y | ||
226 | # CONFIG_PCI_SYSCALL is not set | ||
227 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
228 | # CONFIG_PCCARD is not set | ||
229 | |||
230 | # | ||
231 | # Kernel Features | ||
232 | # | ||
233 | # CONFIG_NO_HZ is not set | ||
234 | # CONFIG_HIGH_RES_TIMERS is not set | ||
235 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
236 | CONFIG_VMSPLIT_3G=y | ||
237 | # CONFIG_VMSPLIT_2G is not set | ||
238 | # CONFIG_VMSPLIT_1G is not set | ||
239 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
240 | CONFIG_PREEMPT_NONE=y | ||
241 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
242 | # CONFIG_PREEMPT is not set | ||
243 | CONFIG_HZ=100 | ||
244 | # CONFIG_AEABI is not set | ||
245 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
246 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
247 | # CONFIG_HIGHMEM is not set | ||
248 | CONFIG_SELECT_MEMORY_MODEL=y | ||
249 | CONFIG_FLATMEM_MANUAL=y | ||
250 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
251 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
252 | CONFIG_FLATMEM=y | ||
253 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
254 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
255 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
256 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
257 | CONFIG_ZONE_DMA_FLAG=0 | ||
258 | CONFIG_VIRT_TO_BUS=y | ||
259 | CONFIG_HAVE_MLOCK=y | ||
260 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
261 | # CONFIG_KSM is not set | ||
262 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
263 | CONFIG_ALIGNMENT_TRAP=y | ||
264 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
265 | |||
266 | # | ||
267 | # Boot options | ||
268 | # | ||
269 | CONFIG_ZBOOT_ROM_TEXT=0 | ||
270 | CONFIG_ZBOOT_ROM_BSS=0 | ||
271 | CONFIG_CMDLINE="" | ||
272 | # CONFIG_XIP_KERNEL is not set | ||
273 | # CONFIG_KEXEC is not set | ||
274 | |||
275 | # | ||
276 | # CPU Power Management | ||
277 | # | ||
278 | # CONFIG_CPU_IDLE is not set | ||
279 | |||
280 | # | ||
281 | # Floating point emulation | ||
282 | # | ||
283 | |||
284 | # | ||
285 | # At least one emulation must be selected | ||
286 | # | ||
287 | # CONFIG_FPE_NWFPE is not set | ||
288 | # CONFIG_FPE_FASTFPE is not set | ||
289 | # CONFIG_VFP is not set | ||
290 | |||
291 | # | ||
292 | # Userspace binary formats | ||
293 | # | ||
294 | CONFIG_BINFMT_ELF=y | ||
295 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
296 | CONFIG_HAVE_AOUT=y | ||
297 | # CONFIG_BINFMT_AOUT is not set | ||
298 | CONFIG_BINFMT_MISC=y | ||
299 | # CONFIG_ARTHUR is not set | ||
300 | |||
301 | # | ||
302 | # Power management options | ||
303 | # | ||
304 | # CONFIG_PM is not set | ||
305 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
306 | # CONFIG_NET is not set | ||
307 | |||
308 | # | ||
309 | # Device Drivers | ||
310 | # | ||
311 | |||
312 | # | ||
313 | # Generic Driver Options | ||
314 | # | ||
315 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
316 | # CONFIG_DEVTMPFS is not set | ||
317 | CONFIG_STANDALONE=y | ||
318 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
319 | CONFIG_FW_LOADER=y | ||
320 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
321 | CONFIG_EXTRA_FIRMWARE="" | ||
322 | # CONFIG_DEBUG_DRIVER is not set | ||
323 | # CONFIG_DEBUG_DEVRES is not set | ||
324 | # CONFIG_SYS_HYPERVISOR is not set | ||
325 | # CONFIG_MTD is not set | ||
326 | # CONFIG_PARPORT is not set | ||
327 | CONFIG_BLK_DEV=y | ||
328 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
329 | # CONFIG_BLK_DEV_LOOP is not set | ||
330 | CONFIG_BLK_DEV_RAM=y | ||
331 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
332 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
333 | # CONFIG_BLK_DEV_XIP is not set | ||
334 | # CONFIG_CDROM_PKTCDVD is not set | ||
335 | CONFIG_MISC_DEVICES=y | ||
336 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
337 | # CONFIG_C2PORT is not set | ||
338 | |||
339 | # | ||
340 | # EEPROM support | ||
341 | # | ||
342 | # CONFIG_EEPROM_93CX6 is not set | ||
343 | CONFIG_HAVE_IDE=y | ||
344 | # CONFIG_IDE is not set | ||
345 | |||
346 | # | ||
347 | # SCSI device support | ||
348 | # | ||
349 | # CONFIG_RAID_ATTRS is not set | ||
350 | # CONFIG_SCSI is not set | ||
351 | # CONFIG_SCSI_DMA is not set | ||
352 | # CONFIG_SCSI_NETLINK is not set | ||
353 | # CONFIG_ATA is not set | ||
354 | # CONFIG_MD is not set | ||
355 | # CONFIG_PHONE is not set | ||
356 | |||
357 | # | ||
358 | # Input device support | ||
359 | # | ||
360 | CONFIG_INPUT=y | ||
361 | CONFIG_INPUT_FF_MEMLESS=y | ||
362 | # CONFIG_INPUT_POLLDEV is not set | ||
363 | |||
364 | # | ||
365 | # Userland interfaces | ||
366 | # | ||
367 | CONFIG_INPUT_MOUSEDEV=y | ||
368 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
369 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
370 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
371 | # CONFIG_INPUT_JOYDEV is not set | ||
372 | # CONFIG_INPUT_EVDEV is not set | ||
373 | # CONFIG_INPUT_EVBUG is not set | ||
374 | |||
375 | # | ||
376 | # Hardware I/O ports | ||
377 | # | ||
378 | CONFIG_SERIO=y | ||
379 | CONFIG_SERIO_SERPORT=y | ||
380 | # CONFIG_SERIO_AMBAKMI is not set | ||
381 | # CONFIG_SERIO_RAW is not set | ||
382 | # CONFIG_GAMEPORT is not set | ||
383 | |||
384 | # | ||
385 | # Character devices | ||
386 | # | ||
387 | CONFIG_VT=y | ||
388 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
389 | CONFIG_VT_CONSOLE=y | ||
390 | CONFIG_HW_CONSOLE=y | ||
391 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
392 | CONFIG_DEVKMEM=y | ||
393 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
394 | |||
395 | # | ||
396 | # Serial drivers | ||
397 | # | ||
398 | # CONFIG_SERIAL_8250 is not set | ||
399 | |||
400 | # | ||
401 | # Non-8250 serial port support | ||
402 | # | ||
403 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
404 | CONFIG_SERIAL_AMBA_PL011=y | ||
405 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||
406 | CONFIG_SERIAL_CORE=y | ||
407 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
408 | CONFIG_UNIX98_PTYS=y | ||
409 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
410 | # CONFIG_LEGACY_PTYS is not set | ||
411 | # CONFIG_R3964 is not set | ||
412 | CONFIG_RAW_DRIVER=y | ||
413 | CONFIG_MAX_RAW_DEVS=8192 | ||
414 | # CONFIG_TCG_TPM is not set | ||
415 | # CONFIG_I2C is not set | ||
416 | # CONFIG_SPI is not set | ||
417 | |||
418 | # | ||
419 | # PPS support | ||
420 | # | ||
421 | # CONFIG_PPS is not set | ||
422 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
423 | CONFIG_GPIOLIB=y | ||
424 | # CONFIG_DEBUG_GPIO is not set | ||
425 | CONFIG_GPIO_SYSFS=y | ||
426 | |||
427 | # | ||
428 | # Memory mapped GPIO expanders: | ||
429 | # | ||
430 | CONFIG_GPIO_PL061=y | ||
431 | |||
432 | # | ||
433 | # I2C GPIO expanders: | ||
434 | # | ||
435 | |||
436 | # | ||
437 | # PCI GPIO expanders: | ||
438 | # | ||
439 | |||
440 | # | ||
441 | # SPI GPIO expanders: | ||
442 | # | ||
443 | |||
444 | # | ||
445 | # AC97 GPIO expanders: | ||
446 | # | ||
447 | # CONFIG_W1 is not set | ||
448 | # CONFIG_POWER_SUPPLY is not set | ||
449 | # CONFIG_HWMON is not set | ||
450 | # CONFIG_THERMAL is not set | ||
451 | # CONFIG_WATCHDOG is not set | ||
452 | CONFIG_SSB_POSSIBLE=y | ||
453 | |||
454 | # | ||
455 | # Sonics Silicon Backplane | ||
456 | # | ||
457 | # CONFIG_SSB is not set | ||
458 | |||
459 | # | ||
460 | # Multifunction device drivers | ||
461 | # | ||
462 | # CONFIG_MFD_CORE is not set | ||
463 | # CONFIG_MFD_SM501 is not set | ||
464 | # CONFIG_HTC_PASIC3 is not set | ||
465 | # CONFIG_MFD_TMIO is not set | ||
466 | # CONFIG_MFD_T7L66XB is not set | ||
467 | # CONFIG_MFD_TC6387XB is not set | ||
468 | # CONFIG_REGULATOR is not set | ||
469 | # CONFIG_MEDIA_SUPPORT is not set | ||
470 | |||
471 | # | ||
472 | # Graphics support | ||
473 | # | ||
474 | # CONFIG_VGASTATE is not set | ||
475 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
476 | # CONFIG_FB is not set | ||
477 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
478 | |||
479 | # | ||
480 | # Display device support | ||
481 | # | ||
482 | # CONFIG_DISPLAY_SUPPORT is not set | ||
483 | |||
484 | # | ||
485 | # Console display driver support | ||
486 | # | ||
487 | # CONFIG_VGA_CONSOLE is not set | ||
488 | CONFIG_DUMMY_CONSOLE=y | ||
489 | # CONFIG_HID_SUPPORT is not set | ||
490 | # CONFIG_USB_SUPPORT is not set | ||
491 | # CONFIG_MMC is not set | ||
492 | # CONFIG_MEMSTICK is not set | ||
493 | # CONFIG_NEW_LEDS is not set | ||
494 | # CONFIG_ACCESSIBILITY is not set | ||
495 | CONFIG_RTC_LIB=y | ||
496 | # CONFIG_RTC_CLASS is not set | ||
497 | # CONFIG_DMADEVICES is not set | ||
498 | # CONFIG_AUXDISPLAY is not set | ||
499 | # CONFIG_UIO is not set | ||
500 | |||
501 | # | ||
502 | # TI VLYNQ | ||
503 | # | ||
504 | # CONFIG_STAGING is not set | ||
505 | |||
506 | # | ||
507 | # File systems | ||
508 | # | ||
509 | CONFIG_EXT2_FS=y | ||
510 | CONFIG_EXT2_FS_XATTR=y | ||
511 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
512 | CONFIG_EXT2_FS_SECURITY=y | ||
513 | # CONFIG_EXT2_FS_XIP is not set | ||
514 | CONFIG_EXT3_FS=y | ||
515 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
516 | CONFIG_EXT3_FS_XATTR=y | ||
517 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
518 | CONFIG_EXT3_FS_SECURITY=y | ||
519 | # CONFIG_EXT4_FS is not set | ||
520 | CONFIG_JBD=y | ||
521 | # CONFIG_JBD_DEBUG is not set | ||
522 | CONFIG_FS_MBCACHE=y | ||
523 | # CONFIG_REISERFS_FS is not set | ||
524 | # CONFIG_JFS_FS is not set | ||
525 | # CONFIG_FS_POSIX_ACL is not set | ||
526 | # CONFIG_XFS_FS is not set | ||
527 | # CONFIG_GFS2_FS is not set | ||
528 | # CONFIG_BTRFS_FS is not set | ||
529 | # CONFIG_NILFS2_FS is not set | ||
530 | CONFIG_FILE_LOCKING=y | ||
531 | CONFIG_FSNOTIFY=y | ||
532 | CONFIG_DNOTIFY=y | ||
533 | # CONFIG_INOTIFY is not set | ||
534 | CONFIG_INOTIFY_USER=y | ||
535 | # CONFIG_QUOTA is not set | ||
536 | # CONFIG_AUTOFS_FS is not set | ||
537 | CONFIG_AUTOFS4_FS=m | ||
538 | # CONFIG_FUSE_FS is not set | ||
539 | |||
540 | # | ||
541 | # Caches | ||
542 | # | ||
543 | # CONFIG_FSCACHE is not set | ||
544 | |||
545 | # | ||
546 | # CD-ROM/DVD Filesystems | ||
547 | # | ||
548 | # CONFIG_ISO9660_FS is not set | ||
549 | # CONFIG_UDF_FS is not set | ||
550 | |||
551 | # | ||
552 | # DOS/FAT/NT Filesystems | ||
553 | # | ||
554 | CONFIG_FAT_FS=m | ||
555 | CONFIG_MSDOS_FS=m | ||
556 | CONFIG_VFAT_FS=m | ||
557 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
558 | CONFIG_FAT_DEFAULT_IOCHARSET="ascii" | ||
559 | # CONFIG_NTFS_FS is not set | ||
560 | |||
561 | # | ||
562 | # Pseudo filesystems | ||
563 | # | ||
564 | CONFIG_PROC_FS=y | ||
565 | CONFIG_PROC_SYSCTL=y | ||
566 | CONFIG_PROC_PAGE_MONITOR=y | ||
567 | CONFIG_SYSFS=y | ||
568 | CONFIG_TMPFS=y | ||
569 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
570 | # CONFIG_HUGETLB_PAGE is not set | ||
571 | # CONFIG_CONFIGFS_FS is not set | ||
572 | CONFIG_MISC_FILESYSTEMS=y | ||
573 | # CONFIG_ADFS_FS is not set | ||
574 | # CONFIG_AFFS_FS is not set | ||
575 | # CONFIG_HFS_FS is not set | ||
576 | # CONFIG_HFSPLUS_FS is not set | ||
577 | # CONFIG_BEFS_FS is not set | ||
578 | # CONFIG_BFS_FS is not set | ||
579 | # CONFIG_EFS_FS is not set | ||
580 | # CONFIG_SQUASHFS is not set | ||
581 | # CONFIG_VXFS_FS is not set | ||
582 | # CONFIG_MINIX_FS is not set | ||
583 | # CONFIG_OMFS_FS is not set | ||
584 | # CONFIG_HPFS_FS is not set | ||
585 | # CONFIG_QNX4FS_FS is not set | ||
586 | # CONFIG_ROMFS_FS is not set | ||
587 | # CONFIG_SYSV_FS is not set | ||
588 | # CONFIG_UFS_FS is not set | ||
589 | |||
590 | # | ||
591 | # Partition Types | ||
592 | # | ||
593 | CONFIG_PARTITION_ADVANCED=y | ||
594 | # CONFIG_ACORN_PARTITION is not set | ||
595 | # CONFIG_OSF_PARTITION is not set | ||
596 | # CONFIG_AMIGA_PARTITION is not set | ||
597 | # CONFIG_ATARI_PARTITION is not set | ||
598 | # CONFIG_MAC_PARTITION is not set | ||
599 | CONFIG_MSDOS_PARTITION=y | ||
600 | # CONFIG_BSD_DISKLABEL is not set | ||
601 | # CONFIG_MINIX_SUBPARTITION is not set | ||
602 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
603 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
604 | # CONFIG_LDM_PARTITION is not set | ||
605 | # CONFIG_SGI_PARTITION is not set | ||
606 | # CONFIG_ULTRIX_PARTITION is not set | ||
607 | # CONFIG_SUN_PARTITION is not set | ||
608 | # CONFIG_KARMA_PARTITION is not set | ||
609 | # CONFIG_EFI_PARTITION is not set | ||
610 | # CONFIG_SYSV68_PARTITION is not set | ||
611 | CONFIG_NLS=y | ||
612 | CONFIG_NLS_DEFAULT="utf8" | ||
613 | CONFIG_NLS_CODEPAGE_437=y | ||
614 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
615 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
616 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
617 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
618 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
619 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
620 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
621 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
622 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
623 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
624 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
625 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
626 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
627 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
628 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
629 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
630 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
631 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
632 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
633 | # CONFIG_NLS_ISO8859_8 is not set | ||
634 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
635 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
636 | CONFIG_NLS_ASCII=m | ||
637 | # CONFIG_NLS_ISO8859_1 is not set | ||
638 | # CONFIG_NLS_ISO8859_2 is not set | ||
639 | # CONFIG_NLS_ISO8859_3 is not set | ||
640 | # CONFIG_NLS_ISO8859_4 is not set | ||
641 | # CONFIG_NLS_ISO8859_5 is not set | ||
642 | # CONFIG_NLS_ISO8859_6 is not set | ||
643 | # CONFIG_NLS_ISO8859_7 is not set | ||
644 | # CONFIG_NLS_ISO8859_9 is not set | ||
645 | # CONFIG_NLS_ISO8859_13 is not set | ||
646 | # CONFIG_NLS_ISO8859_14 is not set | ||
647 | # CONFIG_NLS_ISO8859_15 is not set | ||
648 | # CONFIG_NLS_KOI8_R is not set | ||
649 | # CONFIG_NLS_KOI8_U is not set | ||
650 | # CONFIG_NLS_UTF8 is not set | ||
651 | |||
652 | # | ||
653 | # Kernel hacking | ||
654 | # | ||
655 | # CONFIG_PRINTK_TIME is not set | ||
656 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
657 | CONFIG_ENABLE_MUST_CHECK=y | ||
658 | CONFIG_FRAME_WARN=1024 | ||
659 | CONFIG_MAGIC_SYSRQ=y | ||
660 | # CONFIG_STRIP_ASM_SYMS is not set | ||
661 | # CONFIG_UNUSED_SYMBOLS is not set | ||
662 | CONFIG_DEBUG_FS=y | ||
663 | # CONFIG_HEADERS_CHECK is not set | ||
664 | CONFIG_DEBUG_KERNEL=y | ||
665 | # CONFIG_DEBUG_SHIRQ is not set | ||
666 | CONFIG_DETECT_SOFTLOCKUP=y | ||
667 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
668 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
669 | CONFIG_DETECT_HUNG_TASK=y | ||
670 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
671 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
672 | CONFIG_SCHED_DEBUG=y | ||
673 | # CONFIG_SCHEDSTATS is not set | ||
674 | # CONFIG_TIMER_STATS is not set | ||
675 | # CONFIG_DEBUG_OBJECTS is not set | ||
676 | # CONFIG_SLUB_DEBUG_ON is not set | ||
677 | # CONFIG_SLUB_STATS is not set | ||
678 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
679 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
680 | # CONFIG_RT_MUTEX_TESTER is not set | ||
681 | CONFIG_DEBUG_SPINLOCK=y | ||
682 | # CONFIG_DEBUG_MUTEXES is not set | ||
683 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
684 | # CONFIG_PROVE_LOCKING is not set | ||
685 | # CONFIG_LOCK_STAT is not set | ||
686 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
687 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
688 | # CONFIG_DEBUG_KOBJECT is not set | ||
689 | CONFIG_DEBUG_BUGVERBOSE=y | ||
690 | CONFIG_DEBUG_INFO=y | ||
691 | # CONFIG_DEBUG_VM is not set | ||
692 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
693 | CONFIG_DEBUG_MEMORY_INIT=y | ||
694 | # CONFIG_DEBUG_LIST is not set | ||
695 | # CONFIG_DEBUG_SG is not set | ||
696 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
697 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
698 | CONFIG_FRAME_POINTER=y | ||
699 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
700 | # CONFIG_RCU_TORTURE_TEST is not set | ||
701 | CONFIG_RCU_CPU_STALL_DETECTOR=y | ||
702 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
703 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
704 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
705 | # CONFIG_FAULT_INJECTION is not set | ||
706 | # CONFIG_LATENCYTOP is not set | ||
707 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
708 | # CONFIG_PAGE_POISONING is not set | ||
709 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
710 | CONFIG_TRACING_SUPPORT=y | ||
711 | CONFIG_FTRACE=y | ||
712 | # CONFIG_FUNCTION_TRACER is not set | ||
713 | # CONFIG_IRQSOFF_TRACER is not set | ||
714 | # CONFIG_SCHED_TRACER is not set | ||
715 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
716 | # CONFIG_BOOT_TRACER is not set | ||
717 | CONFIG_BRANCH_PROFILE_NONE=y | ||
718 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
719 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
720 | # CONFIG_STACK_TRACER is not set | ||
721 | # CONFIG_KMEMTRACE is not set | ||
722 | # CONFIG_WORKQUEUE_TRACER is not set | ||
723 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
724 | # CONFIG_DYNAMIC_DEBUG is not set | ||
725 | # CONFIG_SAMPLES is not set | ||
726 | CONFIG_HAVE_ARCH_KGDB=y | ||
727 | # CONFIG_KGDB is not set | ||
728 | # CONFIG_DEBUG_USER is not set | ||
729 | # CONFIG_DEBUG_ERRORS is not set | ||
730 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
731 | # CONFIG_DEBUG_LL is not set | ||
732 | |||
733 | # | ||
734 | # Security options | ||
735 | # | ||
736 | # CONFIG_KEYS is not set | ||
737 | # CONFIG_SECURITY is not set | ||
738 | # CONFIG_SECURITYFS is not set | ||
739 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
740 | # CONFIG_CRYPTO is not set | ||
741 | # CONFIG_BINARY_PRINTF is not set | ||
742 | |||
743 | # | ||
744 | # Library routines | ||
745 | # | ||
746 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
747 | # CONFIG_CRC_CCITT is not set | ||
748 | # CONFIG_CRC16 is not set | ||
749 | # CONFIG_CRC_T10DIF is not set | ||
750 | # CONFIG_CRC_ITU_T is not set | ||
751 | # CONFIG_CRC32 is not set | ||
752 | # CONFIG_CRC7 is not set | ||
753 | # CONFIG_LIBCRC32C is not set | ||
754 | CONFIG_ZLIB_INFLATE=y | ||
755 | CONFIG_DECOMPRESS_GZIP=y | ||
756 | CONFIG_DECOMPRESS_BZIP2=y | ||
757 | CONFIG_DECOMPRESS_LZMA=y | ||
758 | CONFIG_HAS_IOMEM=y | ||
759 | CONFIG_HAS_IOPORT=y | ||
760 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/arm/configs/stamp9g20_defconfig b/arch/arm/configs/stamp9g20_defconfig new file mode 100644 index 000000000000..06a8293c61ca --- /dev/null +++ b/arch/arm/configs/stamp9g20_defconfig | |||
@@ -0,0 +1,1456 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.34-rc1 | ||
4 | # Wed Mar 17 16:38:03 2010 | ||
5 | # | ||
6 | CONFIG_ARM=y | ||
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
8 | CONFIG_GENERIC_GPIO=y | ||
9 | CONFIG_GENERIC_TIME=y | ||
10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
11 | CONFIG_HAVE_PROC_CPU=y | ||
12 | CONFIG_GENERIC_HARDIRQS=y | ||
13 | CONFIG_STACKTRACE_SUPPORT=y | ||
14 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
15 | CONFIG_LOCKDEP_SUPPORT=y | ||
16 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
17 | CONFIG_HARDIRQS_SW_RESEND=y | ||
18 | CONFIG_GENERIC_IRQ_PROBE=y | ||
19 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
20 | CONFIG_GENERIC_HWEIGHT=y | ||
21 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
22 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
23 | CONFIG_VECTORS_BASE=0xffff0000 | ||
24 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
25 | CONFIG_CONSTRUCTORS=y | ||
26 | |||
27 | # | ||
28 | # General setup | ||
29 | # | ||
30 | CONFIG_EXPERIMENTAL=y | ||
31 | CONFIG_BROKEN_ON_SMP=y | ||
32 | CONFIG_LOCK_KERNEL=y | ||
33 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
34 | CONFIG_LOCALVERSION="" | ||
35 | # CONFIG_LOCALVERSION_AUTO is not set | ||
36 | CONFIG_HAVE_KERNEL_GZIP=y | ||
37 | CONFIG_HAVE_KERNEL_LZO=y | ||
38 | CONFIG_KERNEL_GZIP=y | ||
39 | # CONFIG_KERNEL_BZIP2 is not set | ||
40 | # CONFIG_KERNEL_LZMA is not set | ||
41 | # CONFIG_KERNEL_LZO is not set | ||
42 | # CONFIG_SWAP is not set | ||
43 | CONFIG_SYSVIPC=y | ||
44 | CONFIG_SYSVIPC_SYSCTL=y | ||
45 | # CONFIG_POSIX_MQUEUE is not set | ||
46 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
47 | # CONFIG_TASKSTATS is not set | ||
48 | # CONFIG_AUDIT is not set | ||
49 | |||
50 | # | ||
51 | # RCU Subsystem | ||
52 | # | ||
53 | # CONFIG_TREE_RCU is not set | ||
54 | CONFIG_TREE_PREEMPT_RCU=y | ||
55 | # CONFIG_TINY_RCU is not set | ||
56 | # CONFIG_RCU_TRACE is not set | ||
57 | CONFIG_RCU_FANOUT=32 | ||
58 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
59 | # CONFIG_TREE_RCU_TRACE is not set | ||
60 | # CONFIG_IKCONFIG is not set | ||
61 | CONFIG_LOG_BUF_SHIFT=14 | ||
62 | # CONFIG_CGROUPS is not set | ||
63 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
64 | # CONFIG_RELAY is not set | ||
65 | CONFIG_NAMESPACES=y | ||
66 | # CONFIG_UTS_NS is not set | ||
67 | # CONFIG_IPC_NS is not set | ||
68 | # CONFIG_USER_NS is not set | ||
69 | # CONFIG_PID_NS is not set | ||
70 | # CONFIG_NET_NS is not set | ||
71 | CONFIG_BLK_DEV_INITRD=y | ||
72 | CONFIG_INITRAMFS_SOURCE="" | ||
73 | CONFIG_RD_GZIP=y | ||
74 | CONFIG_RD_BZIP2=y | ||
75 | CONFIG_RD_LZMA=y | ||
76 | CONFIG_RD_LZO=y | ||
77 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
78 | CONFIG_SYSCTL=y | ||
79 | CONFIG_ANON_INODES=y | ||
80 | # CONFIG_EMBEDDED is not set | ||
81 | CONFIG_UID16=y | ||
82 | CONFIG_SYSCTL_SYSCALL=y | ||
83 | CONFIG_KALLSYMS=y | ||
84 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
85 | CONFIG_HOTPLUG=y | ||
86 | CONFIG_PRINTK=y | ||
87 | CONFIG_BUG=y | ||
88 | CONFIG_ELF_CORE=y | ||
89 | CONFIG_BASE_FULL=y | ||
90 | CONFIG_FUTEX=y | ||
91 | CONFIG_EPOLL=y | ||
92 | CONFIG_SIGNALFD=y | ||
93 | CONFIG_TIMERFD=y | ||
94 | CONFIG_EVENTFD=y | ||
95 | CONFIG_SHMEM=y | ||
96 | CONFIG_AIO=y | ||
97 | CONFIG_HAVE_PERF_EVENTS=y | ||
98 | CONFIG_PERF_USE_VMALLOC=y | ||
99 | |||
100 | # | ||
101 | # Kernel Performance Events And Counters | ||
102 | # | ||
103 | # CONFIG_PERF_EVENTS is not set | ||
104 | # CONFIG_PERF_COUNTERS is not set | ||
105 | CONFIG_VM_EVENT_COUNTERS=y | ||
106 | CONFIG_COMPAT_BRK=y | ||
107 | CONFIG_SLAB=y | ||
108 | # CONFIG_SLUB is not set | ||
109 | # CONFIG_SLOB is not set | ||
110 | # CONFIG_PROFILING is not set | ||
111 | CONFIG_HAVE_OPROFILE=y | ||
112 | # CONFIG_KPROBES is not set | ||
113 | CONFIG_HAVE_KPROBES=y | ||
114 | CONFIG_HAVE_KRETPROBES=y | ||
115 | CONFIG_HAVE_CLK=y | ||
116 | |||
117 | # | ||
118 | # GCOV-based kernel profiling | ||
119 | # | ||
120 | # CONFIG_SLOW_WORK is not set | ||
121 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
122 | CONFIG_SLABINFO=y | ||
123 | CONFIG_RT_MUTEXES=y | ||
124 | CONFIG_BASE_SMALL=0 | ||
125 | CONFIG_MODULES=y | ||
126 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
127 | CONFIG_MODULE_UNLOAD=y | ||
128 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
129 | # CONFIG_MODVERSIONS is not set | ||
130 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
131 | CONFIG_BLOCK=y | ||
132 | # CONFIG_LBDAF is not set | ||
133 | # CONFIG_BLK_DEV_BSG is not set | ||
134 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
135 | |||
136 | # | ||
137 | # IO Schedulers | ||
138 | # | ||
139 | CONFIG_IOSCHED_NOOP=y | ||
140 | # CONFIG_IOSCHED_DEADLINE is not set | ||
141 | CONFIG_IOSCHED_CFQ=y | ||
142 | # CONFIG_DEFAULT_DEADLINE is not set | ||
143 | CONFIG_DEFAULT_CFQ=y | ||
144 | # CONFIG_DEFAULT_NOOP is not set | ||
145 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
146 | # CONFIG_INLINE_SPIN_TRYLOCK is not set | ||
147 | # CONFIG_INLINE_SPIN_TRYLOCK_BH is not set | ||
148 | # CONFIG_INLINE_SPIN_LOCK is not set | ||
149 | # CONFIG_INLINE_SPIN_LOCK_BH is not set | ||
150 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set | ||
151 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set | ||
152 | # CONFIG_INLINE_SPIN_UNLOCK is not set | ||
153 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set | ||
154 | # CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set | ||
155 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set | ||
156 | # CONFIG_INLINE_READ_TRYLOCK is not set | ||
157 | # CONFIG_INLINE_READ_LOCK is not set | ||
158 | # CONFIG_INLINE_READ_LOCK_BH is not set | ||
159 | # CONFIG_INLINE_READ_LOCK_IRQ is not set | ||
160 | # CONFIG_INLINE_READ_LOCK_IRQSAVE is not set | ||
161 | # CONFIG_INLINE_READ_UNLOCK is not set | ||
162 | # CONFIG_INLINE_READ_UNLOCK_BH is not set | ||
163 | # CONFIG_INLINE_READ_UNLOCK_IRQ is not set | ||
164 | # CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set | ||
165 | # CONFIG_INLINE_WRITE_TRYLOCK is not set | ||
166 | # CONFIG_INLINE_WRITE_LOCK is not set | ||
167 | # CONFIG_INLINE_WRITE_LOCK_BH is not set | ||
168 | # CONFIG_INLINE_WRITE_LOCK_IRQ is not set | ||
169 | # CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set | ||
170 | # CONFIG_INLINE_WRITE_UNLOCK is not set | ||
171 | # CONFIG_INLINE_WRITE_UNLOCK_BH is not set | ||
172 | # CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set | ||
173 | # CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set | ||
174 | # CONFIG_MUTEX_SPIN_ON_OWNER is not set | ||
175 | CONFIG_FREEZER=y | ||
176 | |||
177 | # | ||
178 | # System Type | ||
179 | # | ||
180 | CONFIG_MMU=y | ||
181 | # CONFIG_ARCH_AAEC2000 is not set | ||
182 | # CONFIG_ARCH_INTEGRATOR is not set | ||
183 | # CONFIG_ARCH_REALVIEW is not set | ||
184 | # CONFIG_ARCH_VERSATILE is not set | ||
185 | CONFIG_ARCH_AT91=y | ||
186 | # CONFIG_ARCH_CLPS711X is not set | ||
187 | # CONFIG_ARCH_GEMINI is not set | ||
188 | # CONFIG_ARCH_EBSA110 is not set | ||
189 | # CONFIG_ARCH_EP93XX is not set | ||
190 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
191 | # CONFIG_ARCH_MXC is not set | ||
192 | # CONFIG_ARCH_STMP3XXX is not set | ||
193 | # CONFIG_ARCH_NETX is not set | ||
194 | # CONFIG_ARCH_H720X is not set | ||
195 | # CONFIG_ARCH_NOMADIK is not set | ||
196 | # CONFIG_ARCH_IOP13XX is not set | ||
197 | # CONFIG_ARCH_IOP32X is not set | ||
198 | # CONFIG_ARCH_IOP33X is not set | ||
199 | # CONFIG_ARCH_IXP23XX is not set | ||
200 | # CONFIG_ARCH_IXP2000 is not set | ||
201 | # CONFIG_ARCH_IXP4XX is not set | ||
202 | # CONFIG_ARCH_L7200 is not set | ||
203 | # CONFIG_ARCH_DOVE is not set | ||
204 | # CONFIG_ARCH_KIRKWOOD is not set | ||
205 | # CONFIG_ARCH_LOKI is not set | ||
206 | # CONFIG_ARCH_MV78XX0 is not set | ||
207 | # CONFIG_ARCH_ORION5X is not set | ||
208 | # CONFIG_ARCH_MMP is not set | ||
209 | # CONFIG_ARCH_KS8695 is not set | ||
210 | # CONFIG_ARCH_NS9XXX is not set | ||
211 | # CONFIG_ARCH_W90X900 is not set | ||
212 | # CONFIG_ARCH_NUC93X is not set | ||
213 | # CONFIG_ARCH_PNX4008 is not set | ||
214 | # CONFIG_ARCH_PXA is not set | ||
215 | # CONFIG_ARCH_MSM is not set | ||
216 | # CONFIG_ARCH_RPC is not set | ||
217 | # CONFIG_ARCH_SA1100 is not set | ||
218 | # CONFIG_ARCH_S3C2410 is not set | ||
219 | # CONFIG_ARCH_S3C64XX is not set | ||
220 | # CONFIG_ARCH_S5PC1XX is not set | ||
221 | # CONFIG_ARCH_SHARK is not set | ||
222 | # CONFIG_ARCH_LH7A40X is not set | ||
223 | # CONFIG_ARCH_U300 is not set | ||
224 | # CONFIG_ARCH_DAVINCI is not set | ||
225 | # CONFIG_ARCH_OMAP is not set | ||
226 | # CONFIG_ARCH_BCMRING is not set | ||
227 | # CONFIG_ARCH_U8500 is not set | ||
228 | CONFIG_HAVE_AT91_USART3=y | ||
229 | CONFIG_HAVE_AT91_USART4=y | ||
230 | CONFIG_HAVE_AT91_USART5=y | ||
231 | |||
232 | # | ||
233 | # Atmel AT91 System-on-Chip | ||
234 | # | ||
235 | # CONFIG_ARCH_AT91RM9200 is not set | ||
236 | # CONFIG_ARCH_AT91SAM9260 is not set | ||
237 | # CONFIG_ARCH_AT91SAM9261 is not set | ||
238 | # CONFIG_ARCH_AT91SAM9G10 is not set | ||
239 | # CONFIG_ARCH_AT91SAM9263 is not set | ||
240 | # CONFIG_ARCH_AT91SAM9RL is not set | ||
241 | CONFIG_ARCH_AT91SAM9G20=y | ||
242 | # CONFIG_ARCH_AT91SAM9G45 is not set | ||
243 | # CONFIG_ARCH_AT91CAP9 is not set | ||
244 | # CONFIG_ARCH_AT572D940HF is not set | ||
245 | # CONFIG_ARCH_AT91X40 is not set | ||
246 | CONFIG_AT91_PMC_UNIT=y | ||
247 | |||
248 | # | ||
249 | # AT91SAM9G20 Board Type | ||
250 | # | ||
251 | # CONFIG_MACH_AT91SAM9G20EK is not set | ||
252 | # CONFIG_MACH_AT91SAM9G20EK_2MMC is not set | ||
253 | # CONFIG_MACH_CPU9G20 is not set | ||
254 | CONFIG_MACH_PORTUXG20=y | ||
255 | CONFIG_MACH_STAMP9G20=y | ||
256 | |||
257 | # | ||
258 | # AT91 Board Options | ||
259 | # | ||
260 | |||
261 | # | ||
262 | # AT91 Feature Selections | ||
263 | # | ||
264 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
265 | CONFIG_AT91_SLOW_CLOCK=y | ||
266 | CONFIG_AT91_TIMER_HZ=100 | ||
267 | CONFIG_AT91_EARLY_DBGU=y | ||
268 | # CONFIG_AT91_EARLY_USART0 is not set | ||
269 | # CONFIG_AT91_EARLY_USART1 is not set | ||
270 | # CONFIG_AT91_EARLY_USART2 is not set | ||
271 | # CONFIG_AT91_EARLY_USART3 is not set | ||
272 | # CONFIG_AT91_EARLY_USART4 is not set | ||
273 | # CONFIG_AT91_EARLY_USART5 is not set | ||
274 | |||
275 | # | ||
276 | # Processor Type | ||
277 | # | ||
278 | CONFIG_CPU_ARM926T=y | ||
279 | CONFIG_CPU_32v5=y | ||
280 | CONFIG_CPU_ABRT_EV5TJ=y | ||
281 | CONFIG_CPU_PABRT_LEGACY=y | ||
282 | CONFIG_CPU_CACHE_VIVT=y | ||
283 | CONFIG_CPU_COPY_V4WB=y | ||
284 | CONFIG_CPU_TLB_V4WBI=y | ||
285 | CONFIG_CPU_CP15=y | ||
286 | CONFIG_CPU_CP15_MMU=y | ||
287 | |||
288 | # | ||
289 | # Processor Features | ||
290 | # | ||
291 | CONFIG_ARM_THUMB=y | ||
292 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
293 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
294 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
295 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
296 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
297 | |||
298 | # | ||
299 | # Bus support | ||
300 | # | ||
301 | # CONFIG_PCI_SYSCALL is not set | ||
302 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
303 | # CONFIG_PCCARD is not set | ||
304 | |||
305 | # | ||
306 | # Kernel Features | ||
307 | # | ||
308 | CONFIG_TICK_ONESHOT=y | ||
309 | CONFIG_NO_HZ=y | ||
310 | CONFIG_HIGH_RES_TIMERS=y | ||
311 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
312 | CONFIG_VMSPLIT_3G=y | ||
313 | # CONFIG_VMSPLIT_2G is not set | ||
314 | # CONFIG_VMSPLIT_1G is not set | ||
315 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
316 | # CONFIG_PREEMPT_NONE is not set | ||
317 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
318 | CONFIG_PREEMPT=y | ||
319 | CONFIG_HZ=100 | ||
320 | CONFIG_AEABI=y | ||
321 | # CONFIG_OABI_COMPAT is not set | ||
322 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
323 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
324 | # CONFIG_HIGHMEM is not set | ||
325 | CONFIG_SELECT_MEMORY_MODEL=y | ||
326 | CONFIG_FLATMEM_MANUAL=y | ||
327 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
328 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
329 | CONFIG_FLATMEM=y | ||
330 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
331 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
332 | CONFIG_SPLIT_PTLOCK_CPUS=999999 | ||
333 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
334 | CONFIG_ZONE_DMA_FLAG=0 | ||
335 | CONFIG_VIRT_TO_BUS=y | ||
336 | # CONFIG_KSM is not set | ||
337 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
338 | # CONFIG_LEDS is not set | ||
339 | CONFIG_ALIGNMENT_TRAP=y | ||
340 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
341 | |||
342 | # | ||
343 | # Boot options | ||
344 | # | ||
345 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
346 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
347 | CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw" | ||
348 | # CONFIG_XIP_KERNEL is not set | ||
349 | CONFIG_KEXEC=y | ||
350 | CONFIG_ATAGS_PROC=y | ||
351 | |||
352 | # | ||
353 | # CPU Power Management | ||
354 | # | ||
355 | CONFIG_CPU_IDLE=y | ||
356 | CONFIG_CPU_IDLE_GOV_LADDER=y | ||
357 | CONFIG_CPU_IDLE_GOV_MENU=y | ||
358 | |||
359 | # | ||
360 | # Floating point emulation | ||
361 | # | ||
362 | |||
363 | # | ||
364 | # At least one emulation must be selected | ||
365 | # | ||
366 | # CONFIG_VFP is not set | ||
367 | |||
368 | # | ||
369 | # Userspace binary formats | ||
370 | # | ||
371 | CONFIG_BINFMT_ELF=y | ||
372 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
373 | CONFIG_HAVE_AOUT=y | ||
374 | # CONFIG_BINFMT_AOUT is not set | ||
375 | # CONFIG_BINFMT_MISC is not set | ||
376 | |||
377 | # | ||
378 | # Power management options | ||
379 | # | ||
380 | CONFIG_PM=y | ||
381 | # CONFIG_PM_DEBUG is not set | ||
382 | CONFIG_PM_SLEEP=y | ||
383 | CONFIG_SUSPEND=y | ||
384 | CONFIG_SUSPEND_FREEZER=y | ||
385 | # CONFIG_APM_EMULATION is not set | ||
386 | # CONFIG_PM_RUNTIME is not set | ||
387 | CONFIG_PM_OPS=y | ||
388 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
389 | CONFIG_NET=y | ||
390 | |||
391 | # | ||
392 | # Networking options | ||
393 | # | ||
394 | CONFIG_PACKET=y | ||
395 | CONFIG_UNIX=y | ||
396 | # CONFIG_NET_KEY is not set | ||
397 | CONFIG_INET=y | ||
398 | # CONFIG_IP_MULTICAST is not set | ||
399 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
400 | CONFIG_IP_FIB_HASH=y | ||
401 | # CONFIG_IP_PNP is not set | ||
402 | # CONFIG_NET_IPIP is not set | ||
403 | # CONFIG_NET_IPGRE is not set | ||
404 | # CONFIG_ARPD is not set | ||
405 | # CONFIG_SYN_COOKIES is not set | ||
406 | # CONFIG_INET_AH is not set | ||
407 | # CONFIG_INET_ESP is not set | ||
408 | # CONFIG_INET_IPCOMP is not set | ||
409 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
410 | # CONFIG_INET_TUNNEL is not set | ||
411 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
412 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
413 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
414 | # CONFIG_INET_LRO is not set | ||
415 | CONFIG_INET_DIAG=y | ||
416 | CONFIG_INET_TCP_DIAG=y | ||
417 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
418 | CONFIG_TCP_CONG_CUBIC=y | ||
419 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
420 | # CONFIG_TCP_MD5SIG is not set | ||
421 | # CONFIG_IPV6 is not set | ||
422 | # CONFIG_NETWORK_SECMARK is not set | ||
423 | # CONFIG_NETFILTER is not set | ||
424 | # CONFIG_IP_DCCP is not set | ||
425 | # CONFIG_IP_SCTP is not set | ||
426 | # CONFIG_RDS is not set | ||
427 | # CONFIG_TIPC is not set | ||
428 | # CONFIG_ATM is not set | ||
429 | # CONFIG_BRIDGE is not set | ||
430 | # CONFIG_NET_DSA is not set | ||
431 | # CONFIG_VLAN_8021Q is not set | ||
432 | # CONFIG_DECNET is not set | ||
433 | # CONFIG_LLC2 is not set | ||
434 | # CONFIG_IPX is not set | ||
435 | # CONFIG_ATALK is not set | ||
436 | # CONFIG_X25 is not set | ||
437 | # CONFIG_LAPB is not set | ||
438 | # CONFIG_ECONET is not set | ||
439 | # CONFIG_WAN_ROUTER is not set | ||
440 | # CONFIG_PHONET is not set | ||
441 | # CONFIG_IEEE802154 is not set | ||
442 | # CONFIG_NET_SCHED is not set | ||
443 | # CONFIG_DCB is not set | ||
444 | |||
445 | # | ||
446 | # Network testing | ||
447 | # | ||
448 | # CONFIG_NET_PKTGEN is not set | ||
449 | # CONFIG_HAMRADIO is not set | ||
450 | # CONFIG_CAN is not set | ||
451 | # CONFIG_IRDA is not set | ||
452 | # CONFIG_BT is not set | ||
453 | # CONFIG_AF_RXRPC is not set | ||
454 | # CONFIG_WIRELESS is not set | ||
455 | # CONFIG_WIMAX is not set | ||
456 | # CONFIG_RFKILL is not set | ||
457 | # CONFIG_NET_9P is not set | ||
458 | |||
459 | # | ||
460 | # Device Drivers | ||
461 | # | ||
462 | |||
463 | # | ||
464 | # Generic Driver Options | ||
465 | # | ||
466 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
467 | # CONFIG_DEVTMPFS is not set | ||
468 | CONFIG_STANDALONE=y | ||
469 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
470 | CONFIG_FW_LOADER=y | ||
471 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
472 | CONFIG_EXTRA_FIRMWARE="" | ||
473 | # CONFIG_SYS_HYPERVISOR is not set | ||
474 | # CONFIG_CONNECTOR is not set | ||
475 | CONFIG_MTD=y | ||
476 | # CONFIG_MTD_DEBUG is not set | ||
477 | # CONFIG_MTD_TESTS is not set | ||
478 | CONFIG_MTD_CONCAT=y | ||
479 | CONFIG_MTD_PARTITIONS=y | ||
480 | # CONFIG_MTD_REDBOOT_PARTS is not set | ||
481 | CONFIG_MTD_CMDLINE_PARTS=y | ||
482 | # CONFIG_MTD_AFS_PARTS is not set | ||
483 | # CONFIG_MTD_AR7_PARTS is not set | ||
484 | |||
485 | # | ||
486 | # User Modules And Translation Layers | ||
487 | # | ||
488 | CONFIG_MTD_CHAR=y | ||
489 | CONFIG_MTD_BLKDEVS=y | ||
490 | CONFIG_MTD_BLOCK=y | ||
491 | # CONFIG_FTL is not set | ||
492 | # CONFIG_NFTL is not set | ||
493 | # CONFIG_INFTL is not set | ||
494 | # CONFIG_RFD_FTL is not set | ||
495 | # CONFIG_SSFDC is not set | ||
496 | # CONFIG_MTD_OOPS is not set | ||
497 | |||
498 | # | ||
499 | # RAM/ROM/Flash chip drivers | ||
500 | # | ||
501 | # CONFIG_MTD_CFI is not set | ||
502 | # CONFIG_MTD_JEDECPROBE is not set | ||
503 | CONFIG_MTD_MAP_BANK_WIDTH_1=y | ||
504 | CONFIG_MTD_MAP_BANK_WIDTH_2=y | ||
505 | CONFIG_MTD_MAP_BANK_WIDTH_4=y | ||
506 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | ||
507 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | ||
508 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | ||
509 | CONFIG_MTD_CFI_I1=y | ||
510 | CONFIG_MTD_CFI_I2=y | ||
511 | # CONFIG_MTD_CFI_I4 is not set | ||
512 | # CONFIG_MTD_CFI_I8 is not set | ||
513 | # CONFIG_MTD_RAM is not set | ||
514 | # CONFIG_MTD_ROM is not set | ||
515 | # CONFIG_MTD_ABSENT is not set | ||
516 | |||
517 | # | ||
518 | # Mapping drivers for chip access | ||
519 | # | ||
520 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | ||
521 | # CONFIG_MTD_PLATRAM is not set | ||
522 | |||
523 | # | ||
524 | # Self-contained MTD device drivers | ||
525 | # | ||
526 | CONFIG_MTD_DATAFLASH=y | ||
527 | # CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set | ||
528 | # CONFIG_MTD_DATAFLASH_OTP is not set | ||
529 | # CONFIG_MTD_M25P80 is not set | ||
530 | # CONFIG_MTD_SST25L is not set | ||
531 | # CONFIG_MTD_SLRAM is not set | ||
532 | # CONFIG_MTD_PHRAM is not set | ||
533 | # CONFIG_MTD_MTDRAM is not set | ||
534 | # CONFIG_MTD_BLOCK2MTD is not set | ||
535 | |||
536 | # | ||
537 | # Disk-On-Chip Device Drivers | ||
538 | # | ||
539 | # CONFIG_MTD_DOC2000 is not set | ||
540 | # CONFIG_MTD_DOC2001 is not set | ||
541 | # CONFIG_MTD_DOC2001PLUS is not set | ||
542 | CONFIG_MTD_NAND=y | ||
543 | # CONFIG_MTD_NAND_VERIFY_WRITE is not set | ||
544 | # CONFIG_MTD_NAND_ECC_SMC is not set | ||
545 | # CONFIG_MTD_NAND_MUSEUM_IDS is not set | ||
546 | # CONFIG_MTD_NAND_GPIO is not set | ||
547 | CONFIG_MTD_NAND_IDS=y | ||
548 | # CONFIG_MTD_NAND_DISKONCHIP is not set | ||
549 | CONFIG_MTD_NAND_ATMEL=y | ||
550 | # CONFIG_MTD_NAND_ATMEL_ECC_HW is not set | ||
551 | CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y | ||
552 | # CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set | ||
553 | # CONFIG_MTD_NAND_NANDSIM is not set | ||
554 | # CONFIG_MTD_NAND_PLATFORM is not set | ||
555 | # CONFIG_MTD_ALAUDA is not set | ||
556 | # CONFIG_MTD_ONENAND is not set | ||
557 | |||
558 | # | ||
559 | # LPDDR flash memory drivers | ||
560 | # | ||
561 | # CONFIG_MTD_LPDDR is not set | ||
562 | |||
563 | # | ||
564 | # UBI - Unsorted block images | ||
565 | # | ||
566 | # CONFIG_MTD_UBI is not set | ||
567 | # CONFIG_PARPORT is not set | ||
568 | CONFIG_BLK_DEV=y | ||
569 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
570 | CONFIG_BLK_DEV_LOOP=y | ||
571 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
572 | |||
573 | # | ||
574 | # DRBD disabled because PROC_FS, INET or CONNECTOR not selected | ||
575 | # | ||
576 | # CONFIG_BLK_DEV_NBD is not set | ||
577 | # CONFIG_BLK_DEV_UB is not set | ||
578 | CONFIG_BLK_DEV_RAM=y | ||
579 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
580 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
581 | # CONFIG_BLK_DEV_XIP is not set | ||
582 | # CONFIG_CDROM_PKTCDVD is not set | ||
583 | # CONFIG_ATA_OVER_ETH is not set | ||
584 | # CONFIG_MG_DISK is not set | ||
585 | # CONFIG_MISC_DEVICES is not set | ||
586 | CONFIG_HAVE_IDE=y | ||
587 | # CONFIG_IDE is not set | ||
588 | |||
589 | # | ||
590 | # SCSI device support | ||
591 | # | ||
592 | # CONFIG_RAID_ATTRS is not set | ||
593 | CONFIG_SCSI=y | ||
594 | CONFIG_SCSI_DMA=y | ||
595 | # CONFIG_SCSI_TGT is not set | ||
596 | # CONFIG_SCSI_NETLINK is not set | ||
597 | CONFIG_SCSI_PROC_FS=y | ||
598 | |||
599 | # | ||
600 | # SCSI support type (disk, tape, CD-ROM) | ||
601 | # | ||
602 | CONFIG_BLK_DEV_SD=y | ||
603 | # CONFIG_CHR_DEV_ST is not set | ||
604 | # CONFIG_CHR_DEV_OSST is not set | ||
605 | # CONFIG_BLK_DEV_SR is not set | ||
606 | # CONFIG_CHR_DEV_SG is not set | ||
607 | # CONFIG_CHR_DEV_SCH is not set | ||
608 | CONFIG_SCSI_MULTI_LUN=y | ||
609 | # CONFIG_SCSI_CONSTANTS is not set | ||
610 | # CONFIG_SCSI_LOGGING is not set | ||
611 | # CONFIG_SCSI_SCAN_ASYNC is not set | ||
612 | CONFIG_SCSI_WAIT_SCAN=m | ||
613 | |||
614 | # | ||
615 | # SCSI Transports | ||
616 | # | ||
617 | # CONFIG_SCSI_SPI_ATTRS is not set | ||
618 | # CONFIG_SCSI_FC_ATTRS is not set | ||
619 | # CONFIG_SCSI_ISCSI_ATTRS is not set | ||
620 | # CONFIG_SCSI_SAS_LIBSAS is not set | ||
621 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
622 | # CONFIG_SCSI_LOWLEVEL is not set | ||
623 | # CONFIG_SCSI_DH is not set | ||
624 | # CONFIG_SCSI_OSD_INITIATOR is not set | ||
625 | # CONFIG_ATA is not set | ||
626 | # CONFIG_MD is not set | ||
627 | CONFIG_NETDEVICES=y | ||
628 | # CONFIG_DUMMY is not set | ||
629 | # CONFIG_BONDING is not set | ||
630 | # CONFIG_MACVLAN is not set | ||
631 | # CONFIG_EQUALIZER is not set | ||
632 | # CONFIG_TUN is not set | ||
633 | # CONFIG_VETH is not set | ||
634 | CONFIG_PHYLIB=y | ||
635 | |||
636 | # | ||
637 | # MII PHY device drivers | ||
638 | # | ||
639 | # CONFIG_MARVELL_PHY is not set | ||
640 | # CONFIG_DAVICOM_PHY is not set | ||
641 | # CONFIG_QSEMI_PHY is not set | ||
642 | # CONFIG_LXT_PHY is not set | ||
643 | # CONFIG_CICADA_PHY is not set | ||
644 | # CONFIG_VITESSE_PHY is not set | ||
645 | # CONFIG_SMSC_PHY is not set | ||
646 | # CONFIG_BROADCOM_PHY is not set | ||
647 | # CONFIG_ICPLUS_PHY is not set | ||
648 | # CONFIG_REALTEK_PHY is not set | ||
649 | # CONFIG_NATIONAL_PHY is not set | ||
650 | # CONFIG_STE10XP is not set | ||
651 | # CONFIG_LSI_ET1011C_PHY is not set | ||
652 | # CONFIG_FIXED_PHY is not set | ||
653 | # CONFIG_MDIO_BITBANG is not set | ||
654 | CONFIG_NET_ETHERNET=y | ||
655 | # CONFIG_MII is not set | ||
656 | CONFIG_MACB=y | ||
657 | # CONFIG_AX88796 is not set | ||
658 | # CONFIG_SMC91X is not set | ||
659 | # CONFIG_DM9000 is not set | ||
660 | # CONFIG_ENC28J60 is not set | ||
661 | # CONFIG_ETHOC is not set | ||
662 | # CONFIG_SMC911X is not set | ||
663 | # CONFIG_SMSC911X is not set | ||
664 | # CONFIG_DNET is not set | ||
665 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
666 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
667 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
668 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
669 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | ||
670 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | ||
671 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | ||
672 | # CONFIG_B44 is not set | ||
673 | # CONFIG_KS8842 is not set | ||
674 | # CONFIG_KS8851 is not set | ||
675 | # CONFIG_KS8851_MLL is not set | ||
676 | # CONFIG_NETDEV_1000 is not set | ||
677 | # CONFIG_NETDEV_10000 is not set | ||
678 | # CONFIG_WLAN is not set | ||
679 | |||
680 | # | ||
681 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
682 | # | ||
683 | |||
684 | # | ||
685 | # USB Network Adapters | ||
686 | # | ||
687 | # CONFIG_USB_CATC is not set | ||
688 | # CONFIG_USB_KAWETH is not set | ||
689 | # CONFIG_USB_PEGASUS is not set | ||
690 | # CONFIG_USB_RTL8150 is not set | ||
691 | # CONFIG_USB_USBNET is not set | ||
692 | # CONFIG_WAN is not set | ||
693 | # CONFIG_PPP is not set | ||
694 | # CONFIG_SLIP is not set | ||
695 | # CONFIG_NETCONSOLE is not set | ||
696 | # CONFIG_NETPOLL is not set | ||
697 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
698 | # CONFIG_ISDN is not set | ||
699 | # CONFIG_PHONE is not set | ||
700 | |||
701 | # | ||
702 | # Input device support | ||
703 | # | ||
704 | CONFIG_INPUT=y | ||
705 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
706 | # CONFIG_INPUT_POLLDEV is not set | ||
707 | # CONFIG_INPUT_SPARSEKMAP is not set | ||
708 | |||
709 | # | ||
710 | # Userland interfaces | ||
711 | # | ||
712 | CONFIG_INPUT_MOUSEDEV=y | ||
713 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
714 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=320 | ||
715 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240 | ||
716 | # CONFIG_INPUT_JOYDEV is not set | ||
717 | # CONFIG_INPUT_EVDEV is not set | ||
718 | # CONFIG_INPUT_EVBUG is not set | ||
719 | |||
720 | # | ||
721 | # Input Device Drivers | ||
722 | # | ||
723 | # CONFIG_INPUT_KEYBOARD is not set | ||
724 | # CONFIG_INPUT_MOUSE is not set | ||
725 | # CONFIG_INPUT_JOYSTICK is not set | ||
726 | # CONFIG_INPUT_TABLET is not set | ||
727 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
728 | # CONFIG_INPUT_MISC is not set | ||
729 | |||
730 | # | ||
731 | # Hardware I/O ports | ||
732 | # | ||
733 | # CONFIG_SERIO is not set | ||
734 | # CONFIG_GAMEPORT is not set | ||
735 | |||
736 | # | ||
737 | # Character devices | ||
738 | # | ||
739 | CONFIG_VT=y | ||
740 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
741 | CONFIG_VT_CONSOLE=y | ||
742 | CONFIG_HW_CONSOLE=y | ||
743 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
744 | CONFIG_DEVKMEM=y | ||
745 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
746 | |||
747 | # | ||
748 | # Serial drivers | ||
749 | # | ||
750 | # CONFIG_SERIAL_8250 is not set | ||
751 | |||
752 | # | ||
753 | # Non-8250 serial port support | ||
754 | # | ||
755 | CONFIG_SERIAL_ATMEL=y | ||
756 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
757 | CONFIG_SERIAL_ATMEL_PDC=y | ||
758 | # CONFIG_SERIAL_ATMEL_TTYAT is not set | ||
759 | # CONFIG_SERIAL_MAX3100 is not set | ||
760 | CONFIG_SERIAL_CORE=y | ||
761 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
762 | # CONFIG_SERIAL_TIMBERDALE is not set | ||
763 | CONFIG_UNIX98_PTYS=y | ||
764 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
765 | # CONFIG_LEGACY_PTYS is not set | ||
766 | # CONFIG_IPMI_HANDLER is not set | ||
767 | # CONFIG_HW_RANDOM is not set | ||
768 | # CONFIG_R3964 is not set | ||
769 | # CONFIG_RAW_DRIVER is not set | ||
770 | # CONFIG_TCG_TPM is not set | ||
771 | CONFIG_I2C=y | ||
772 | CONFIG_I2C_BOARDINFO=y | ||
773 | CONFIG_I2C_COMPAT=y | ||
774 | CONFIG_I2C_CHARDEV=y | ||
775 | CONFIG_I2C_HELPER_AUTO=y | ||
776 | CONFIG_I2C_ALGOBIT=y | ||
777 | |||
778 | # | ||
779 | # I2C Hardware Bus support | ||
780 | # | ||
781 | |||
782 | # | ||
783 | # I2C system bus drivers (mostly embedded / system-on-chip) | ||
784 | # | ||
785 | # CONFIG_I2C_DESIGNWARE is not set | ||
786 | CONFIG_I2C_GPIO=y | ||
787 | # CONFIG_I2C_OCORES is not set | ||
788 | # CONFIG_I2C_SIMTEC is not set | ||
789 | # CONFIG_I2C_XILINX is not set | ||
790 | |||
791 | # | ||
792 | # External I2C/SMBus adapter drivers | ||
793 | # | ||
794 | # CONFIG_I2C_PARPORT_LIGHT is not set | ||
795 | # CONFIG_I2C_TAOS_EVM is not set | ||
796 | # CONFIG_I2C_TINY_USB is not set | ||
797 | |||
798 | # | ||
799 | # Other I2C/SMBus bus drivers | ||
800 | # | ||
801 | # CONFIG_I2C_PCA_PLATFORM is not set | ||
802 | # CONFIG_I2C_STUB is not set | ||
803 | |||
804 | # | ||
805 | # Miscellaneous I2C Chip support | ||
806 | # | ||
807 | # CONFIG_SENSORS_TSL2550 is not set | ||
808 | # CONFIG_I2C_DEBUG_CORE is not set | ||
809 | # CONFIG_I2C_DEBUG_ALGO is not set | ||
810 | # CONFIG_I2C_DEBUG_BUS is not set | ||
811 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
812 | CONFIG_SPI=y | ||
813 | CONFIG_SPI_MASTER=y | ||
814 | |||
815 | # | ||
816 | # SPI Master Controller Drivers | ||
817 | # | ||
818 | CONFIG_SPI_ATMEL=y | ||
819 | # CONFIG_SPI_BITBANG is not set | ||
820 | # CONFIG_SPI_GPIO is not set | ||
821 | # CONFIG_SPI_XILINX is not set | ||
822 | # CONFIG_SPI_DESIGNWARE is not set | ||
823 | |||
824 | # | ||
825 | # SPI Protocol Masters | ||
826 | # | ||
827 | CONFIG_SPI_SPIDEV=y | ||
828 | # CONFIG_SPI_TLE62X0 is not set | ||
829 | |||
830 | # | ||
831 | # PPS support | ||
832 | # | ||
833 | # CONFIG_PPS is not set | ||
834 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
835 | CONFIG_GPIOLIB=y | ||
836 | CONFIG_GPIO_SYSFS=y | ||
837 | |||
838 | # | ||
839 | # Memory mapped GPIO expanders: | ||
840 | # | ||
841 | # CONFIG_GPIO_IT8761E is not set | ||
842 | |||
843 | # | ||
844 | # I2C GPIO expanders: | ||
845 | # | ||
846 | # CONFIG_GPIO_MAX7300 is not set | ||
847 | # CONFIG_GPIO_MAX732X is not set | ||
848 | # CONFIG_GPIO_PCA953X is not set | ||
849 | # CONFIG_GPIO_PCF857X is not set | ||
850 | # CONFIG_GPIO_ADP5588 is not set | ||
851 | |||
852 | # | ||
853 | # PCI GPIO expanders: | ||
854 | # | ||
855 | |||
856 | # | ||
857 | # SPI GPIO expanders: | ||
858 | # | ||
859 | # CONFIG_GPIO_MAX7301 is not set | ||
860 | # CONFIG_GPIO_MCP23S08 is not set | ||
861 | # CONFIG_GPIO_MC33880 is not set | ||
862 | |||
863 | # | ||
864 | # AC97 GPIO expanders: | ||
865 | # | ||
866 | CONFIG_W1=y | ||
867 | |||
868 | # | ||
869 | # 1-wire Bus Masters | ||
870 | # | ||
871 | # CONFIG_W1_MASTER_DS2490 is not set | ||
872 | # CONFIG_W1_MASTER_DS2482 is not set | ||
873 | # CONFIG_W1_MASTER_DS1WM is not set | ||
874 | CONFIG_W1_MASTER_GPIO=y | ||
875 | |||
876 | # | ||
877 | # 1-wire Slaves | ||
878 | # | ||
879 | CONFIG_W1_SLAVE_THERM=y | ||
880 | # CONFIG_W1_SLAVE_SMEM is not set | ||
881 | CONFIG_W1_SLAVE_DS2431=y | ||
882 | # CONFIG_W1_SLAVE_DS2433 is not set | ||
883 | # CONFIG_W1_SLAVE_DS2760 is not set | ||
884 | # CONFIG_W1_SLAVE_BQ27000 is not set | ||
885 | # CONFIG_POWER_SUPPLY is not set | ||
886 | # CONFIG_HWMON is not set | ||
887 | # CONFIG_THERMAL is not set | ||
888 | CONFIG_WATCHDOG=y | ||
889 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
890 | |||
891 | # | ||
892 | # Watchdog Device Drivers | ||
893 | # | ||
894 | # CONFIG_SOFT_WATCHDOG is not set | ||
895 | # CONFIG_MAX63XX_WATCHDOG is not set | ||
896 | CONFIG_AT91SAM9X_WATCHDOG=y | ||
897 | |||
898 | # | ||
899 | # USB-based Watchdog Cards | ||
900 | # | ||
901 | # CONFIG_USBPCWATCHDOG is not set | ||
902 | CONFIG_SSB_POSSIBLE=y | ||
903 | |||
904 | # | ||
905 | # Sonics Silicon Backplane | ||
906 | # | ||
907 | # CONFIG_SSB is not set | ||
908 | |||
909 | # | ||
910 | # Multifunction device drivers | ||
911 | # | ||
912 | # CONFIG_MFD_CORE is not set | ||
913 | # CONFIG_MFD_88PM860X is not set | ||
914 | # CONFIG_MFD_SM501 is not set | ||
915 | # CONFIG_MFD_ASIC3 is not set | ||
916 | # CONFIG_HTC_EGPIO is not set | ||
917 | # CONFIG_HTC_PASIC3 is not set | ||
918 | # CONFIG_HTC_I2CPLD is not set | ||
919 | # CONFIG_TPS65010 is not set | ||
920 | # CONFIG_TWL4030_CORE is not set | ||
921 | # CONFIG_MFD_TMIO is not set | ||
922 | # CONFIG_MFD_T7L66XB is not set | ||
923 | # CONFIG_MFD_TC6387XB is not set | ||
924 | # CONFIG_MFD_TC6393XB is not set | ||
925 | # CONFIG_PMIC_DA903X is not set | ||
926 | # CONFIG_PMIC_ADP5520 is not set | ||
927 | # CONFIG_MFD_MAX8925 is not set | ||
928 | # CONFIG_MFD_WM8400 is not set | ||
929 | # CONFIG_MFD_WM831X is not set | ||
930 | # CONFIG_MFD_WM8350_I2C is not set | ||
931 | # CONFIG_MFD_WM8994 is not set | ||
932 | # CONFIG_MFD_PCF50633 is not set | ||
933 | # CONFIG_MFD_MC13783 is not set | ||
934 | # CONFIG_AB3100_CORE is not set | ||
935 | # CONFIG_EZX_PCAP is not set | ||
936 | # CONFIG_AB4500_CORE is not set | ||
937 | # CONFIG_REGULATOR is not set | ||
938 | # CONFIG_MEDIA_SUPPORT is not set | ||
939 | |||
940 | # | ||
941 | # Graphics support | ||
942 | # | ||
943 | # CONFIG_VGASTATE is not set | ||
944 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
945 | # CONFIG_FB is not set | ||
946 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
947 | |||
948 | # | ||
949 | # Display device support | ||
950 | # | ||
951 | # CONFIG_DISPLAY_SUPPORT is not set | ||
952 | |||
953 | # | ||
954 | # Console display driver support | ||
955 | # | ||
956 | # CONFIG_VGA_CONSOLE is not set | ||
957 | CONFIG_DUMMY_CONSOLE=y | ||
958 | # CONFIG_SOUND is not set | ||
959 | # CONFIG_HID_SUPPORT is not set | ||
960 | CONFIG_USB_SUPPORT=y | ||
961 | CONFIG_USB_ARCH_HAS_HCD=y | ||
962 | CONFIG_USB_ARCH_HAS_OHCI=y | ||
963 | # CONFIG_USB_ARCH_HAS_EHCI is not set | ||
964 | CONFIG_USB=y | ||
965 | # CONFIG_USB_DEBUG is not set | ||
966 | # CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set | ||
967 | |||
968 | # | ||
969 | # Miscellaneous USB options | ||
970 | # | ||
971 | CONFIG_USB_DEVICEFS=y | ||
972 | # CONFIG_USB_DEVICE_CLASS is not set | ||
973 | # CONFIG_USB_DYNAMIC_MINORS is not set | ||
974 | # CONFIG_USB_OTG is not set | ||
975 | CONFIG_USB_MON=y | ||
976 | # CONFIG_USB_WUSB is not set | ||
977 | # CONFIG_USB_WUSB_CBAF is not set | ||
978 | |||
979 | # | ||
980 | # USB Host Controller Drivers | ||
981 | # | ||
982 | # CONFIG_USB_C67X00_HCD is not set | ||
983 | # CONFIG_USB_OXU210HP_HCD is not set | ||
984 | # CONFIG_USB_ISP116X_HCD is not set | ||
985 | # CONFIG_USB_ISP1760_HCD is not set | ||
986 | # CONFIG_USB_ISP1362_HCD is not set | ||
987 | CONFIG_USB_OHCI_HCD=y | ||
988 | # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set | ||
989 | # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set | ||
990 | CONFIG_USB_OHCI_LITTLE_ENDIAN=y | ||
991 | # CONFIG_USB_SL811_HCD is not set | ||
992 | # CONFIG_USB_R8A66597_HCD is not set | ||
993 | # CONFIG_USB_HWA_HCD is not set | ||
994 | # CONFIG_USB_MUSB_HDRC is not set | ||
995 | # CONFIG_USB_GADGET_MUSB_HDRC is not set | ||
996 | |||
997 | # | ||
998 | # USB Device Class drivers | ||
999 | # | ||
1000 | # CONFIG_USB_ACM is not set | ||
1001 | # CONFIG_USB_PRINTER is not set | ||
1002 | # CONFIG_USB_WDM is not set | ||
1003 | # CONFIG_USB_TMC is not set | ||
1004 | |||
1005 | # | ||
1006 | # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may | ||
1007 | # | ||
1008 | |||
1009 | # | ||
1010 | # also be needed; see USB_STORAGE Help for more info | ||
1011 | # | ||
1012 | CONFIG_USB_STORAGE=y | ||
1013 | # CONFIG_USB_STORAGE_DEBUG is not set | ||
1014 | # CONFIG_USB_STORAGE_DATAFAB is not set | ||
1015 | # CONFIG_USB_STORAGE_FREECOM is not set | ||
1016 | # CONFIG_USB_STORAGE_ISD200 is not set | ||
1017 | # CONFIG_USB_STORAGE_USBAT is not set | ||
1018 | # CONFIG_USB_STORAGE_SDDR09 is not set | ||
1019 | # CONFIG_USB_STORAGE_SDDR55 is not set | ||
1020 | # CONFIG_USB_STORAGE_JUMPSHOT is not set | ||
1021 | # CONFIG_USB_STORAGE_ALAUDA is not set | ||
1022 | # CONFIG_USB_STORAGE_ONETOUCH is not set | ||
1023 | # CONFIG_USB_STORAGE_KARMA is not set | ||
1024 | # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set | ||
1025 | # CONFIG_USB_LIBUSUAL is not set | ||
1026 | |||
1027 | # | ||
1028 | # USB Imaging devices | ||
1029 | # | ||
1030 | # CONFIG_USB_MDC800 is not set | ||
1031 | # CONFIG_USB_MICROTEK is not set | ||
1032 | |||
1033 | # | ||
1034 | # USB port drivers | ||
1035 | # | ||
1036 | # CONFIG_USB_SERIAL is not set | ||
1037 | |||
1038 | # | ||
1039 | # USB Miscellaneous drivers | ||
1040 | # | ||
1041 | # CONFIG_USB_EMI62 is not set | ||
1042 | # CONFIG_USB_EMI26 is not set | ||
1043 | # CONFIG_USB_ADUTUX is not set | ||
1044 | # CONFIG_USB_SEVSEG is not set | ||
1045 | # CONFIG_USB_RIO500 is not set | ||
1046 | # CONFIG_USB_LEGOTOWER is not set | ||
1047 | # CONFIG_USB_LCD is not set | ||
1048 | # CONFIG_USB_LED is not set | ||
1049 | # CONFIG_USB_CYPRESS_CY7C63 is not set | ||
1050 | # CONFIG_USB_CYTHERM is not set | ||
1051 | # CONFIG_USB_IDMOUSE is not set | ||
1052 | # CONFIG_USB_FTDI_ELAN is not set | ||
1053 | # CONFIG_USB_APPLEDISPLAY is not set | ||
1054 | # CONFIG_USB_LD is not set | ||
1055 | # CONFIG_USB_TRANCEVIBRATOR is not set | ||
1056 | # CONFIG_USB_IOWARRIOR is not set | ||
1057 | # CONFIG_USB_TEST is not set | ||
1058 | # CONFIG_USB_ISIGHTFW is not set | ||
1059 | CONFIG_USB_GADGET=m | ||
1060 | # CONFIG_USB_GADGET_DEBUG_FILES is not set | ||
1061 | CONFIG_USB_GADGET_VBUS_DRAW=2 | ||
1062 | CONFIG_USB_GADGET_SELECTED=y | ||
1063 | CONFIG_USB_GADGET_AT91=y | ||
1064 | CONFIG_USB_AT91=m | ||
1065 | # CONFIG_USB_GADGET_ATMEL_USBA is not set | ||
1066 | # CONFIG_USB_GADGET_FSL_USB2 is not set | ||
1067 | # CONFIG_USB_GADGET_LH7A40X is not set | ||
1068 | # CONFIG_USB_GADGET_OMAP is not set | ||
1069 | # CONFIG_USB_GADGET_PXA25X is not set | ||
1070 | # CONFIG_USB_GADGET_R8A66597 is not set | ||
1071 | # CONFIG_USB_GADGET_PXA27X is not set | ||
1072 | # CONFIG_USB_GADGET_S3C_HSOTG is not set | ||
1073 | # CONFIG_USB_GADGET_IMX is not set | ||
1074 | # CONFIG_USB_GADGET_S3C2410 is not set | ||
1075 | # CONFIG_USB_GADGET_M66592 is not set | ||
1076 | # CONFIG_USB_GADGET_AMD5536UDC is not set | ||
1077 | # CONFIG_USB_GADGET_FSL_QE is not set | ||
1078 | # CONFIG_USB_GADGET_CI13XXX is not set | ||
1079 | # CONFIG_USB_GADGET_NET2280 is not set | ||
1080 | # CONFIG_USB_GADGET_GOKU is not set | ||
1081 | # CONFIG_USB_GADGET_LANGWELL is not set | ||
1082 | # CONFIG_USB_GADGET_DUMMY_HCD is not set | ||
1083 | # CONFIG_USB_GADGET_DUALSPEED is not set | ||
1084 | CONFIG_USB_ZERO=m | ||
1085 | # CONFIG_USB_AUDIO is not set | ||
1086 | CONFIG_USB_ETH=m | ||
1087 | CONFIG_USB_ETH_RNDIS=y | ||
1088 | # CONFIG_USB_ETH_EEM is not set | ||
1089 | # CONFIG_USB_GADGETFS is not set | ||
1090 | CONFIG_USB_FILE_STORAGE=m | ||
1091 | # CONFIG_USB_FILE_STORAGE_TEST is not set | ||
1092 | # CONFIG_USB_MASS_STORAGE is not set | ||
1093 | CONFIG_USB_G_SERIAL=m | ||
1094 | # CONFIG_USB_MIDI_GADGET is not set | ||
1095 | # CONFIG_USB_G_PRINTER is not set | ||
1096 | # CONFIG_USB_CDC_COMPOSITE is not set | ||
1097 | # CONFIG_USB_G_NOKIA is not set | ||
1098 | # CONFIG_USB_G_MULTI is not set | ||
1099 | |||
1100 | # | ||
1101 | # OTG and related infrastructure | ||
1102 | # | ||
1103 | # CONFIG_USB_GPIO_VBUS is not set | ||
1104 | # CONFIG_USB_ULPI is not set | ||
1105 | # CONFIG_NOP_USB_XCEIV is not set | ||
1106 | CONFIG_MMC=y | ||
1107 | # CONFIG_MMC_DEBUG is not set | ||
1108 | # CONFIG_MMC_UNSAFE_RESUME is not set | ||
1109 | |||
1110 | # | ||
1111 | # MMC/SD/SDIO Card Drivers | ||
1112 | # | ||
1113 | CONFIG_MMC_BLOCK=y | ||
1114 | CONFIG_MMC_BLOCK_BOUNCE=y | ||
1115 | # CONFIG_SDIO_UART is not set | ||
1116 | # CONFIG_MMC_TEST is not set | ||
1117 | |||
1118 | # | ||
1119 | # MMC/SD/SDIO Host Controller Drivers | ||
1120 | # | ||
1121 | # CONFIG_MMC_SDHCI is not set | ||
1122 | # CONFIG_MMC_AT91 is not set | ||
1123 | CONFIG_MMC_ATMELMCI=y | ||
1124 | # CONFIG_MMC_SPI is not set | ||
1125 | # CONFIG_MEMSTICK is not set | ||
1126 | CONFIG_NEW_LEDS=y | ||
1127 | CONFIG_LEDS_CLASS=y | ||
1128 | |||
1129 | # | ||
1130 | # LED drivers | ||
1131 | # | ||
1132 | # CONFIG_LEDS_PCA9532 is not set | ||
1133 | CONFIG_LEDS_GPIO=y | ||
1134 | CONFIG_LEDS_GPIO_PLATFORM=y | ||
1135 | # CONFIG_LEDS_LP3944 is not set | ||
1136 | # CONFIG_LEDS_PCA955X is not set | ||
1137 | # CONFIG_LEDS_DAC124S085 is not set | ||
1138 | # CONFIG_LEDS_BD2802 is not set | ||
1139 | # CONFIG_LEDS_LT3593 is not set | ||
1140 | |||
1141 | # | ||
1142 | # LED Triggers | ||
1143 | # | ||
1144 | CONFIG_LEDS_TRIGGERS=y | ||
1145 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
1146 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
1147 | # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set | ||
1148 | # CONFIG_LEDS_TRIGGER_GPIO is not set | ||
1149 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
1150 | |||
1151 | # | ||
1152 | # iptables trigger is under Netfilter config (LED target) | ||
1153 | # | ||
1154 | # CONFIG_ACCESSIBILITY is not set | ||
1155 | CONFIG_RTC_LIB=y | ||
1156 | CONFIG_RTC_CLASS=y | ||
1157 | CONFIG_RTC_HCTOSYS=y | ||
1158 | CONFIG_RTC_HCTOSYS_DEVICE="rtc0" | ||
1159 | # CONFIG_RTC_DEBUG is not set | ||
1160 | |||
1161 | # | ||
1162 | # RTC interfaces | ||
1163 | # | ||
1164 | CONFIG_RTC_INTF_SYSFS=y | ||
1165 | CONFIG_RTC_INTF_PROC=y | ||
1166 | CONFIG_RTC_INTF_DEV=y | ||
1167 | # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set | ||
1168 | # CONFIG_RTC_DRV_TEST is not set | ||
1169 | |||
1170 | # | ||
1171 | # I2C RTC drivers | ||
1172 | # | ||
1173 | # CONFIG_RTC_DRV_DS1307 is not set | ||
1174 | # CONFIG_RTC_DRV_DS1374 is not set | ||
1175 | # CONFIG_RTC_DRV_DS1672 is not set | ||
1176 | # CONFIG_RTC_DRV_MAX6900 is not set | ||
1177 | # CONFIG_RTC_DRV_RS5C372 is not set | ||
1178 | # CONFIG_RTC_DRV_ISL1208 is not set | ||
1179 | # CONFIG_RTC_DRV_X1205 is not set | ||
1180 | # CONFIG_RTC_DRV_PCF8563 is not set | ||
1181 | # CONFIG_RTC_DRV_PCF8583 is not set | ||
1182 | # CONFIG_RTC_DRV_M41T80 is not set | ||
1183 | # CONFIG_RTC_DRV_BQ32K is not set | ||
1184 | # CONFIG_RTC_DRV_S35390A is not set | ||
1185 | # CONFIG_RTC_DRV_FM3130 is not set | ||
1186 | # CONFIG_RTC_DRV_RX8581 is not set | ||
1187 | # CONFIG_RTC_DRV_RX8025 is not set | ||
1188 | |||
1189 | # | ||
1190 | # SPI RTC drivers | ||
1191 | # | ||
1192 | # CONFIG_RTC_DRV_M41T94 is not set | ||
1193 | # CONFIG_RTC_DRV_DS1305 is not set | ||
1194 | # CONFIG_RTC_DRV_DS1390 is not set | ||
1195 | # CONFIG_RTC_DRV_MAX6902 is not set | ||
1196 | # CONFIG_RTC_DRV_R9701 is not set | ||
1197 | # CONFIG_RTC_DRV_RS5C348 is not set | ||
1198 | # CONFIG_RTC_DRV_DS3234 is not set | ||
1199 | # CONFIG_RTC_DRV_PCF2123 is not set | ||
1200 | |||
1201 | # | ||
1202 | # Platform RTC drivers | ||
1203 | # | ||
1204 | # CONFIG_RTC_DRV_CMOS is not set | ||
1205 | # CONFIG_RTC_DRV_DS1286 is not set | ||
1206 | # CONFIG_RTC_DRV_DS1511 is not set | ||
1207 | # CONFIG_RTC_DRV_DS1553 is not set | ||
1208 | # CONFIG_RTC_DRV_DS1742 is not set | ||
1209 | # CONFIG_RTC_DRV_STK17TA8 is not set | ||
1210 | # CONFIG_RTC_DRV_M48T86 is not set | ||
1211 | # CONFIG_RTC_DRV_M48T35 is not set | ||
1212 | # CONFIG_RTC_DRV_M48T59 is not set | ||
1213 | # CONFIG_RTC_DRV_MSM6242 is not set | ||
1214 | # CONFIG_RTC_DRV_BQ4802 is not set | ||
1215 | # CONFIG_RTC_DRV_RP5C01 is not set | ||
1216 | # CONFIG_RTC_DRV_V3020 is not set | ||
1217 | |||
1218 | # | ||
1219 | # on-CPU RTC drivers | ||
1220 | # | ||
1221 | CONFIG_RTC_DRV_AT91SAM9=y | ||
1222 | CONFIG_RTC_DRV_AT91SAM9_RTT=0 | ||
1223 | CONFIG_RTC_DRV_AT91SAM9_GPBR=0 | ||
1224 | # CONFIG_DMADEVICES is not set | ||
1225 | # CONFIG_AUXDISPLAY is not set | ||
1226 | # CONFIG_UIO is not set | ||
1227 | |||
1228 | # | ||
1229 | # TI VLYNQ | ||
1230 | # | ||
1231 | # CONFIG_STAGING is not set | ||
1232 | |||
1233 | # | ||
1234 | # File systems | ||
1235 | # | ||
1236 | CONFIG_EXT2_FS=y | ||
1237 | # CONFIG_EXT2_FS_XATTR is not set | ||
1238 | # CONFIG_EXT2_FS_XIP is not set | ||
1239 | CONFIG_EXT3_FS=y | ||
1240 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
1241 | CONFIG_EXT3_FS_XATTR=y | ||
1242 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
1243 | # CONFIG_EXT3_FS_SECURITY is not set | ||
1244 | # CONFIG_EXT4_FS is not set | ||
1245 | CONFIG_JBD=y | ||
1246 | CONFIG_FS_MBCACHE=y | ||
1247 | # CONFIG_REISERFS_FS is not set | ||
1248 | # CONFIG_JFS_FS is not set | ||
1249 | # CONFIG_FS_POSIX_ACL is not set | ||
1250 | # CONFIG_XFS_FS is not set | ||
1251 | # CONFIG_OCFS2_FS is not set | ||
1252 | # CONFIG_BTRFS_FS is not set | ||
1253 | # CONFIG_NILFS2_FS is not set | ||
1254 | CONFIG_FILE_LOCKING=y | ||
1255 | CONFIG_FSNOTIFY=y | ||
1256 | CONFIG_DNOTIFY=y | ||
1257 | CONFIG_INOTIFY=y | ||
1258 | CONFIG_INOTIFY_USER=y | ||
1259 | # CONFIG_QUOTA is not set | ||
1260 | # CONFIG_AUTOFS_FS is not set | ||
1261 | # CONFIG_AUTOFS4_FS is not set | ||
1262 | # CONFIG_FUSE_FS is not set | ||
1263 | |||
1264 | # | ||
1265 | # Caches | ||
1266 | # | ||
1267 | # CONFIG_FSCACHE is not set | ||
1268 | |||
1269 | # | ||
1270 | # CD-ROM/DVD Filesystems | ||
1271 | # | ||
1272 | # CONFIG_ISO9660_FS is not set | ||
1273 | # CONFIG_UDF_FS is not set | ||
1274 | |||
1275 | # | ||
1276 | # DOS/FAT/NT Filesystems | ||
1277 | # | ||
1278 | CONFIG_FAT_FS=y | ||
1279 | # CONFIG_MSDOS_FS is not set | ||
1280 | CONFIG_VFAT_FS=y | ||
1281 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
1282 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | ||
1283 | # CONFIG_NTFS_FS is not set | ||
1284 | |||
1285 | # | ||
1286 | # Pseudo filesystems | ||
1287 | # | ||
1288 | CONFIG_PROC_FS=y | ||
1289 | CONFIG_PROC_SYSCTL=y | ||
1290 | CONFIG_PROC_PAGE_MONITOR=y | ||
1291 | CONFIG_SYSFS=y | ||
1292 | CONFIG_TMPFS=y | ||
1293 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
1294 | # CONFIG_HUGETLB_PAGE is not set | ||
1295 | # CONFIG_CONFIGFS_FS is not set | ||
1296 | CONFIG_MISC_FILESYSTEMS=y | ||
1297 | # CONFIG_ADFS_FS is not set | ||
1298 | # CONFIG_AFFS_FS is not set | ||
1299 | # CONFIG_HFS_FS is not set | ||
1300 | # CONFIG_HFSPLUS_FS is not set | ||
1301 | # CONFIG_BEFS_FS is not set | ||
1302 | # CONFIG_BFS_FS is not set | ||
1303 | # CONFIG_EFS_FS is not set | ||
1304 | CONFIG_JFFS2_FS=y | ||
1305 | CONFIG_JFFS2_FS_DEBUG=0 | ||
1306 | CONFIG_JFFS2_FS_WRITEBUFFER=y | ||
1307 | # CONFIG_JFFS2_FS_WBUF_VERIFY is not set | ||
1308 | CONFIG_JFFS2_SUMMARY=y | ||
1309 | # CONFIG_JFFS2_FS_XATTR is not set | ||
1310 | # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set | ||
1311 | CONFIG_JFFS2_ZLIB=y | ||
1312 | # CONFIG_JFFS2_LZO is not set | ||
1313 | CONFIG_JFFS2_RTIME=y | ||
1314 | # CONFIG_JFFS2_RUBIN is not set | ||
1315 | # CONFIG_LOGFS is not set | ||
1316 | # CONFIG_CRAMFS is not set | ||
1317 | # CONFIG_SQUASHFS is not set | ||
1318 | # CONFIG_VXFS_FS is not set | ||
1319 | # CONFIG_MINIX_FS is not set | ||
1320 | # CONFIG_OMFS_FS is not set | ||
1321 | # CONFIG_HPFS_FS is not set | ||
1322 | # CONFIG_QNX4FS_FS is not set | ||
1323 | # CONFIG_ROMFS_FS is not set | ||
1324 | # CONFIG_SYSV_FS is not set | ||
1325 | # CONFIG_UFS_FS is not set | ||
1326 | CONFIG_NETWORK_FILESYSTEMS=y | ||
1327 | CONFIG_NFS_FS=y | ||
1328 | CONFIG_NFS_V3=y | ||
1329 | # CONFIG_NFS_V3_ACL is not set | ||
1330 | # CONFIG_NFS_V4 is not set | ||
1331 | # CONFIG_NFSD is not set | ||
1332 | CONFIG_LOCKD=y | ||
1333 | CONFIG_LOCKD_V4=y | ||
1334 | CONFIG_NFS_COMMON=y | ||
1335 | CONFIG_SUNRPC=y | ||
1336 | # CONFIG_RPCSEC_GSS_KRB5 is not set | ||
1337 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
1338 | # CONFIG_SMB_FS is not set | ||
1339 | # CONFIG_CIFS is not set | ||
1340 | # CONFIG_NCP_FS is not set | ||
1341 | # CONFIG_CODA_FS is not set | ||
1342 | # CONFIG_AFS_FS is not set | ||
1343 | |||
1344 | # | ||
1345 | # Partition Types | ||
1346 | # | ||
1347 | # CONFIG_PARTITION_ADVANCED is not set | ||
1348 | CONFIG_MSDOS_PARTITION=y | ||
1349 | CONFIG_NLS=y | ||
1350 | CONFIG_NLS_DEFAULT="iso8859-1" | ||
1351 | CONFIG_NLS_CODEPAGE_437=y | ||
1352 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
1353 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
1354 | CONFIG_NLS_CODEPAGE_850=y | ||
1355 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
1356 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
1357 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
1358 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
1359 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
1360 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
1361 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
1362 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
1363 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
1364 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
1365 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
1366 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
1367 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
1368 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
1369 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
1370 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
1371 | # CONFIG_NLS_ISO8859_8 is not set | ||
1372 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
1373 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
1374 | # CONFIG_NLS_ASCII is not set | ||
1375 | CONFIG_NLS_ISO8859_1=y | ||
1376 | # CONFIG_NLS_ISO8859_2 is not set | ||
1377 | # CONFIG_NLS_ISO8859_3 is not set | ||
1378 | # CONFIG_NLS_ISO8859_4 is not set | ||
1379 | # CONFIG_NLS_ISO8859_5 is not set | ||
1380 | # CONFIG_NLS_ISO8859_6 is not set | ||
1381 | # CONFIG_NLS_ISO8859_7 is not set | ||
1382 | # CONFIG_NLS_ISO8859_9 is not set | ||
1383 | # CONFIG_NLS_ISO8859_13 is not set | ||
1384 | # CONFIG_NLS_ISO8859_14 is not set | ||
1385 | CONFIG_NLS_ISO8859_15=y | ||
1386 | # CONFIG_NLS_KOI8_R is not set | ||
1387 | # CONFIG_NLS_KOI8_U is not set | ||
1388 | CONFIG_NLS_UTF8=y | ||
1389 | # CONFIG_DLM is not set | ||
1390 | |||
1391 | # | ||
1392 | # Kernel hacking | ||
1393 | # | ||
1394 | # CONFIG_PRINTK_TIME is not set | ||
1395 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
1396 | CONFIG_ENABLE_MUST_CHECK=y | ||
1397 | CONFIG_FRAME_WARN=1024 | ||
1398 | # CONFIG_MAGIC_SYSRQ is not set | ||
1399 | # CONFIG_STRIP_ASM_SYMS is not set | ||
1400 | # CONFIG_UNUSED_SYMBOLS is not set | ||
1401 | # CONFIG_DEBUG_FS is not set | ||
1402 | # CONFIG_HEADERS_CHECK is not set | ||
1403 | # CONFIG_DEBUG_KERNEL is not set | ||
1404 | CONFIG_DEBUG_BUGVERBOSE=y | ||
1405 | CONFIG_DEBUG_MEMORY_INIT=y | ||
1406 | CONFIG_FRAME_POINTER=y | ||
1407 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
1408 | # CONFIG_LATENCYTOP is not set | ||
1409 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
1410 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
1411 | CONFIG_TRACING_SUPPORT=y | ||
1412 | # CONFIG_FTRACE is not set | ||
1413 | # CONFIG_SAMPLES is not set | ||
1414 | CONFIG_HAVE_ARCH_KGDB=y | ||
1415 | # CONFIG_ARM_UNWIND is not set | ||
1416 | # CONFIG_DEBUG_USER is not set | ||
1417 | # CONFIG_OC_ETM is not set | ||
1418 | |||
1419 | # | ||
1420 | # Security options | ||
1421 | # | ||
1422 | # CONFIG_KEYS is not set | ||
1423 | # CONFIG_SECURITY is not set | ||
1424 | # CONFIG_SECURITYFS is not set | ||
1425 | # CONFIG_DEFAULT_SECURITY_SELINUX is not set | ||
1426 | # CONFIG_DEFAULT_SECURITY_SMACK is not set | ||
1427 | # CONFIG_DEFAULT_SECURITY_TOMOYO is not set | ||
1428 | CONFIG_DEFAULT_SECURITY_DAC=y | ||
1429 | CONFIG_DEFAULT_SECURITY="" | ||
1430 | # CONFIG_CRYPTO is not set | ||
1431 | # CONFIG_BINARY_PRINTF is not set | ||
1432 | |||
1433 | # | ||
1434 | # Library routines | ||
1435 | # | ||
1436 | CONFIG_BITREVERSE=y | ||
1437 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
1438 | # CONFIG_CRC_CCITT is not set | ||
1439 | # CONFIG_CRC16 is not set | ||
1440 | # CONFIG_CRC_T10DIF is not set | ||
1441 | # CONFIG_CRC_ITU_T is not set | ||
1442 | CONFIG_CRC32=y | ||
1443 | # CONFIG_CRC7 is not set | ||
1444 | # CONFIG_LIBCRC32C is not set | ||
1445 | CONFIG_ZLIB_INFLATE=y | ||
1446 | CONFIG_ZLIB_DEFLATE=y | ||
1447 | CONFIG_LZO_DECOMPRESS=y | ||
1448 | CONFIG_DECOMPRESS_GZIP=y | ||
1449 | CONFIG_DECOMPRESS_BZIP2=y | ||
1450 | CONFIG_DECOMPRESS_LZMA=y | ||
1451 | CONFIG_DECOMPRESS_LZO=y | ||
1452 | CONFIG_HAS_IOMEM=y | ||
1453 | CONFIG_HAS_IOPORT=y | ||
1454 | CONFIG_HAS_DMA=y | ||
1455 | CONFIG_NLATTR=y | ||
1456 | CONFIG_GENERIC_ATOMIC64=y | ||
diff --git a/arch/arm/include/asm/hardware/arm_timer.h b/arch/arm/include/asm/hardware/arm_timer.h index 04be3bdf46b8..c0f4e7bf22de 100644 --- a/arch/arm/include/asm/hardware/arm_timer.h +++ b/arch/arm/include/asm/hardware/arm_timer.h | |||
@@ -1,21 +1,30 @@ | |||
1 | #ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H | 1 | #ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H |
2 | #define __ASM_ARM_HARDWARE_ARM_TIMER_H | 2 | #define __ASM_ARM_HARDWARE_ARM_TIMER_H |
3 | 3 | ||
4 | #define TIMER_LOAD 0x00 | 4 | /* |
5 | #define TIMER_VALUE 0x04 | 5 | * ARM timer implementation, found in Integrator, Versatile and Realview |
6 | #define TIMER_CTRL 0x08 | 6 | * platforms. Not all platforms support all registers and bits in these |
7 | #define TIMER_CTRL_ONESHOT (1 << 0) | 7 | * registers, so we mark them with A for Integrator AP, C for Integrator |
8 | #define TIMER_CTRL_32BIT (1 << 1) | 8 | * CP, V for Versatile and R for Realview. |
9 | #define TIMER_CTRL_DIV1 (0 << 2) | 9 | * |
10 | #define TIMER_CTRL_DIV16 (1 << 2) | 10 | * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview |
11 | #define TIMER_CTRL_DIV256 (2 << 2) | 11 | * can have 16-bit or 32-bit selectable via a bit in the control register. |
12 | #define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable (versatile only) */ | 12 | */ |
13 | #define TIMER_CTRL_PERIODIC (1 << 6) | 13 | #define TIMER_LOAD 0x00 /* ACVR rw */ |
14 | #define TIMER_CTRL_ENABLE (1 << 7) | 14 | #define TIMER_VALUE 0x04 /* ACVR ro */ |
15 | #define TIMER_CTRL 0x08 /* ACVR rw */ | ||
16 | #define TIMER_CTRL_ONESHOT (1 << 0) /* CVR */ | ||
17 | #define TIMER_CTRL_32BIT (1 << 1) /* CVR */ | ||
18 | #define TIMER_CTRL_DIV1 (0 << 2) /* ACVR */ | ||
19 | #define TIMER_CTRL_DIV16 (1 << 2) /* ACVR */ | ||
20 | #define TIMER_CTRL_DIV256 (2 << 2) /* ACVR */ | ||
21 | #define TIMER_CTRL_IE (1 << 5) /* VR */ | ||
22 | #define TIMER_CTRL_PERIODIC (1 << 6) /* ACVR */ | ||
23 | #define TIMER_CTRL_ENABLE (1 << 7) /* ACVR */ | ||
15 | 24 | ||
16 | #define TIMER_INTCLR 0x0c | 25 | #define TIMER_INTCLR 0x0c /* ACVR wo */ |
17 | #define TIMER_RIS 0x10 | 26 | #define TIMER_RIS 0x10 /* CVR ro */ |
18 | #define TIMER_MIS 0x14 | 27 | #define TIMER_MIS 0x14 /* CVR ro */ |
19 | #define TIMER_BGLOAD 0x18 | 28 | #define TIMER_BGLOAD 0x18 /* CVR rw */ |
20 | 29 | ||
21 | #endif | 30 | #endif |
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h index cdb9022716fd..6bcba48800fe 100644 --- a/arch/arm/include/asm/hardware/cache-l2x0.h +++ b/arch/arm/include/asm/hardware/cache-l2x0.h | |||
@@ -21,6 +21,9 @@ | |||
21 | #define __ASM_ARM_HARDWARE_L2X0_H | 21 | #define __ASM_ARM_HARDWARE_L2X0_H |
22 | 22 | ||
23 | #define L2X0_CACHE_ID 0x000 | 23 | #define L2X0_CACHE_ID 0x000 |
24 | #define L2X0_CACHE_ID_PART_MASK (0xf << 6) | ||
25 | #define L2X0_CACHE_ID_PART_L210 (1 << 6) | ||
26 | #define L2X0_CACHE_ID_PART_L310 (3 << 6) | ||
24 | #define L2X0_CACHE_TYPE 0x004 | 27 | #define L2X0_CACHE_TYPE 0x004 |
25 | #define L2X0_CTRL 0x100 | 28 | #define L2X0_CTRL 0x100 |
26 | #define L2X0_AUX_CTRL 0x104 | 29 | #define L2X0_AUX_CTRL 0x104 |
diff --git a/arch/arm/include/asm/hardware/icst.h b/arch/arm/include/asm/hardware/icst.h new file mode 100644 index 000000000000..10382a3dcec9 --- /dev/null +++ b/arch/arm/include/asm/hardware/icst.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/hardware/icst.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
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 | * Support functions for calculating clocks/divisors for the ICST | ||
11 | * clock generators. See http://www.icst.com/ for more information | ||
12 | * on these devices. | ||
13 | */ | ||
14 | #ifndef ASMARM_HARDWARE_ICST_H | ||
15 | #define ASMARM_HARDWARE_ICST_H | ||
16 | |||
17 | struct icst_params { | ||
18 | unsigned long ref; | ||
19 | unsigned long vco_max; /* inclusive */ | ||
20 | unsigned long vco_min; /* exclusive */ | ||
21 | unsigned short vd_min; /* inclusive */ | ||
22 | unsigned short vd_max; /* inclusive */ | ||
23 | unsigned char rd_min; /* inclusive */ | ||
24 | unsigned char rd_max; /* inclusive */ | ||
25 | const unsigned char *s2div; /* chip specific s2div array */ | ||
26 | const unsigned char *idx2s; /* chip specific idx2s array */ | ||
27 | }; | ||
28 | |||
29 | struct icst_vco { | ||
30 | unsigned short v; | ||
31 | unsigned char r; | ||
32 | unsigned char s; | ||
33 | }; | ||
34 | |||
35 | unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco); | ||
36 | struct icst_vco icst_hz_to_vco(const struct icst_params *p, unsigned long freq); | ||
37 | |||
38 | /* | ||
39 | * ICST307 VCO frequency must be between 6MHz and 200MHz (3.3 or 5V). | ||
40 | * This frequency is pre-output divider. | ||
41 | */ | ||
42 | #define ICST307_VCO_MIN 6000000 | ||
43 | #define ICST307_VCO_MAX 200000000 | ||
44 | |||
45 | extern const unsigned char icst307_s2div[]; | ||
46 | extern const unsigned char icst307_idx2s[]; | ||
47 | |||
48 | /* | ||
49 | * ICST525 VCO frequency must be between 10MHz and 200MHz (3V) or 320MHz (5V). | ||
50 | * This frequency is pre-output divider. | ||
51 | */ | ||
52 | #define ICST525_VCO_MIN 10000000 | ||
53 | #define ICST525_VCO_MAX_3V 200000000 | ||
54 | #define ICST525_VCO_MAX_5V 320000000 | ||
55 | |||
56 | extern const unsigned char icst525_s2div[]; | ||
57 | extern const unsigned char icst525_idx2s[]; | ||
58 | |||
59 | #endif | ||
diff --git a/arch/arm/include/asm/hardware/icst307.h b/arch/arm/include/asm/hardware/icst307.h deleted file mode 100644 index 554f128a1046..000000000000 --- a/arch/arm/include/asm/hardware/icst307.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/hardware/icst307.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
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 | * Support functions for calculating clocks/divisors for the ICS307 | ||
11 | * clock generators. See http://www.icst.com/ for more information | ||
12 | * on these devices. | ||
13 | * | ||
14 | * This file is similar to the icst525.h file | ||
15 | */ | ||
16 | #ifndef ASMARM_HARDWARE_ICST307_H | ||
17 | #define ASMARM_HARDWARE_ICST307_H | ||
18 | |||
19 | struct icst307_params { | ||
20 | unsigned long ref; | ||
21 | unsigned long vco_max; /* inclusive */ | ||
22 | unsigned short vd_min; /* inclusive */ | ||
23 | unsigned short vd_max; /* inclusive */ | ||
24 | unsigned char rd_min; /* inclusive */ | ||
25 | unsigned char rd_max; /* inclusive */ | ||
26 | }; | ||
27 | |||
28 | struct icst307_vco { | ||
29 | unsigned short v; | ||
30 | unsigned char r; | ||
31 | unsigned char s; | ||
32 | }; | ||
33 | |||
34 | unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco); | ||
35 | struct icst307_vco icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq); | ||
36 | struct icst307_vco icst307_ps_to_vco(const struct icst307_params *p, unsigned long period); | ||
37 | |||
38 | #endif | ||
diff --git a/arch/arm/include/asm/hardware/icst525.h b/arch/arm/include/asm/hardware/icst525.h deleted file mode 100644 index 58f0dc43e2ed..000000000000 --- a/arch/arm/include/asm/hardware/icst525.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/hardware/icst525.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
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 | * Support functions for calculating clocks/divisors for the ICST525 | ||
11 | * clock generators. See http://www.icst.com/ for more information | ||
12 | * on these devices. | ||
13 | */ | ||
14 | #ifndef ASMARM_HARDWARE_ICST525_H | ||
15 | #define ASMARM_HARDWARE_ICST525_H | ||
16 | |||
17 | struct icst525_params { | ||
18 | unsigned long ref; | ||
19 | unsigned long vco_max; /* inclusive */ | ||
20 | unsigned short vd_min; /* inclusive */ | ||
21 | unsigned short vd_max; /* inclusive */ | ||
22 | unsigned char rd_min; /* inclusive */ | ||
23 | unsigned char rd_max; /* inclusive */ | ||
24 | }; | ||
25 | |||
26 | struct icst525_vco { | ||
27 | unsigned short v; | ||
28 | unsigned char r; | ||
29 | unsigned char s; | ||
30 | }; | ||
31 | |||
32 | unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco); | ||
33 | struct icst525_vco icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq); | ||
34 | struct icst525_vco icst525_ps_to_vco(const struct icst525_params *p, unsigned long period); | ||
35 | |||
36 | #endif | ||
diff --git a/arch/arm/include/asm/hardware/pl330.h b/arch/arm/include/asm/hardware/pl330.h new file mode 100644 index 000000000000..575fa8186ca0 --- /dev/null +++ b/arch/arm/include/asm/hardware/pl330.h | |||
@@ -0,0 +1,217 @@ | |||
1 | /* linux/include/asm/hardware/pl330.h | ||
2 | * | ||
3 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
4 | * Jaswinder Singh <jassi.brar@samsung.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., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef __PL330_CORE_H | ||
22 | #define __PL330_CORE_H | ||
23 | |||
24 | #define PL330_MAX_CHAN 8 | ||
25 | #define PL330_MAX_IRQS 32 | ||
26 | #define PL330_MAX_PERI 32 | ||
27 | |||
28 | enum pl330_srccachectrl { | ||
29 | SCCTRL0 = 0, /* Noncacheable and nonbufferable */ | ||
30 | SCCTRL1, /* Bufferable only */ | ||
31 | SCCTRL2, /* Cacheable, but do not allocate */ | ||
32 | SCCTRL3, /* Cacheable and bufferable, but do not allocate */ | ||
33 | SINVALID1, | ||
34 | SINVALID2, | ||
35 | SCCTRL6, /* Cacheable write-through, allocate on reads only */ | ||
36 | SCCTRL7, /* Cacheable write-back, allocate on reads only */ | ||
37 | }; | ||
38 | |||
39 | enum pl330_dstcachectrl { | ||
40 | DCCTRL0 = 0, /* Noncacheable and nonbufferable */ | ||
41 | DCCTRL1, /* Bufferable only */ | ||
42 | DCCTRL2, /* Cacheable, but do not allocate */ | ||
43 | DCCTRL3, /* Cacheable and bufferable, but do not allocate */ | ||
44 | DINVALID1 = 8, | ||
45 | DINVALID2, | ||
46 | DCCTRL6, /* Cacheable write-through, allocate on writes only */ | ||
47 | DCCTRL7, /* Cacheable write-back, allocate on writes only */ | ||
48 | }; | ||
49 | |||
50 | /* Populated by the PL330 core driver for DMA API driver's info */ | ||
51 | struct pl330_config { | ||
52 | u32 periph_id; | ||
53 | u32 pcell_id; | ||
54 | #define DMAC_MODE_NS (1 << 0) | ||
55 | unsigned int mode; | ||
56 | unsigned int data_bus_width:10; /* In number of bits */ | ||
57 | unsigned int data_buf_dep:10; | ||
58 | unsigned int num_chan:4; | ||
59 | unsigned int num_peri:6; | ||
60 | u32 peri_ns; | ||
61 | unsigned int num_events:6; | ||
62 | u32 irq_ns; | ||
63 | }; | ||
64 | |||
65 | /* Handle to the DMAC provided to the PL330 core */ | ||
66 | struct pl330_info { | ||
67 | /* Owning device */ | ||
68 | struct device *dev; | ||
69 | /* Size of MicroCode buffers for each channel. */ | ||
70 | unsigned mcbufsz; | ||
71 | /* ioremap'ed address of PL330 registers. */ | ||
72 | void __iomem *base; | ||
73 | /* Client can freely use it. */ | ||
74 | void *client_data; | ||
75 | /* PL330 core data, Client must not touch it. */ | ||
76 | void *pl330_data; | ||
77 | /* Populated by the PL330 core driver during pl330_add */ | ||
78 | struct pl330_config pcfg; | ||
79 | /* | ||
80 | * If the DMAC has some reset mechanism, then the | ||
81 | * client may want to provide pointer to the method. | ||
82 | */ | ||
83 | void (*dmac_reset)(struct pl330_info *pi); | ||
84 | }; | ||
85 | |||
86 | enum pl330_byteswap { | ||
87 | SWAP_NO = 0, | ||
88 | SWAP_2, | ||
89 | SWAP_4, | ||
90 | SWAP_8, | ||
91 | SWAP_16, | ||
92 | }; | ||
93 | |||
94 | /** | ||
95 | * Request Configuration. | ||
96 | * The PL330 core does not modify this and uses the last | ||
97 | * working configuration if the request doesn't provide any. | ||
98 | * | ||
99 | * The Client may want to provide this info only for the | ||
100 | * first request and a request with new settings. | ||
101 | */ | ||
102 | struct pl330_reqcfg { | ||
103 | /* Address Incrementing */ | ||
104 | unsigned dst_inc:1; | ||
105 | unsigned src_inc:1; | ||
106 | |||
107 | /* | ||
108 | * For now, the SRC & DST protection levels | ||
109 | * and burst size/length are assumed same. | ||
110 | */ | ||
111 | bool nonsecure; | ||
112 | bool privileged; | ||
113 | bool insnaccess; | ||
114 | unsigned brst_len:5; | ||
115 | unsigned brst_size:3; /* in power of 2 */ | ||
116 | |||
117 | enum pl330_dstcachectrl dcctl; | ||
118 | enum pl330_srccachectrl scctl; | ||
119 | enum pl330_byteswap swap; | ||
120 | }; | ||
121 | |||
122 | /* | ||
123 | * One cycle of DMAC operation. | ||
124 | * There may be more than one xfer in a request. | ||
125 | */ | ||
126 | struct pl330_xfer { | ||
127 | u32 src_addr; | ||
128 | u32 dst_addr; | ||
129 | /* Size to xfer */ | ||
130 | u32 bytes; | ||
131 | /* | ||
132 | * Pointer to next xfer in the list. | ||
133 | * The last xfer in the req must point to NULL. | ||
134 | */ | ||
135 | struct pl330_xfer *next; | ||
136 | }; | ||
137 | |||
138 | /* The xfer callbacks are made with one of these arguments. */ | ||
139 | enum pl330_op_err { | ||
140 | /* The all xfers in the request were success. */ | ||
141 | PL330_ERR_NONE, | ||
142 | /* If req aborted due to global error. */ | ||
143 | PL330_ERR_ABORT, | ||
144 | /* If req failed due to problem with Channel. */ | ||
145 | PL330_ERR_FAIL, | ||
146 | }; | ||
147 | |||
148 | enum pl330_reqtype { | ||
149 | MEMTOMEM, | ||
150 | MEMTODEV, | ||
151 | DEVTOMEM, | ||
152 | DEVTODEV, | ||
153 | }; | ||
154 | |||
155 | /* A request defining Scatter-Gather List ending with NULL xfer. */ | ||
156 | struct pl330_req { | ||
157 | enum pl330_reqtype rqtype; | ||
158 | /* Index of peripheral for the xfer. */ | ||
159 | unsigned peri:5; | ||
160 | /* Unique token for this xfer, set by the client. */ | ||
161 | void *token; | ||
162 | /* Callback to be called after xfer. */ | ||
163 | void (*xfer_cb)(void *token, enum pl330_op_err err); | ||
164 | /* If NULL, req will be done at last set parameters. */ | ||
165 | struct pl330_reqcfg *cfg; | ||
166 | /* Pointer to first xfer in the request. */ | ||
167 | struct pl330_xfer *x; | ||
168 | }; | ||
169 | |||
170 | /* | ||
171 | * To know the status of the channel and DMAC, the client | ||
172 | * provides a pointer to this structure. The PL330 core | ||
173 | * fills it with current information. | ||
174 | */ | ||
175 | struct pl330_chanstatus { | ||
176 | /* | ||
177 | * If the DMAC engine halted due to some error, | ||
178 | * the client should remove-add DMAC. | ||
179 | */ | ||
180 | bool dmac_halted; | ||
181 | /* | ||
182 | * If channel is halted due to some error, | ||
183 | * the client should ABORT/FLUSH and START the channel. | ||
184 | */ | ||
185 | bool faulting; | ||
186 | /* Location of last load */ | ||
187 | u32 src_addr; | ||
188 | /* Location of last store */ | ||
189 | u32 dst_addr; | ||
190 | /* | ||
191 | * Pointer to the currently active req, NULL if channel is | ||
192 | * inactive, even though the requests may be present. | ||
193 | */ | ||
194 | struct pl330_req *top_req; | ||
195 | /* Pointer to req waiting second in the queue if any. */ | ||
196 | struct pl330_req *wait_req; | ||
197 | }; | ||
198 | |||
199 | enum pl330_chan_op { | ||
200 | /* Start the channel */ | ||
201 | PL330_OP_START, | ||
202 | /* Abort the active xfer */ | ||
203 | PL330_OP_ABORT, | ||
204 | /* Stop xfer and flush queue */ | ||
205 | PL330_OP_FLUSH, | ||
206 | }; | ||
207 | |||
208 | extern int pl330_add(struct pl330_info *); | ||
209 | extern void pl330_del(struct pl330_info *pi); | ||
210 | extern int pl330_update(const struct pl330_info *pi); | ||
211 | extern void pl330_release_channel(void *ch_id); | ||
212 | extern void *pl330_request_channel(const struct pl330_info *pi); | ||
213 | extern int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus); | ||
214 | extern int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op); | ||
215 | extern int pl330_submit_req(void *ch_id, struct pl330_req *r); | ||
216 | |||
217 | #endif /* __PL330_CORE_H */ | ||
diff --git a/arch/arm/include/asm/hardware/sp810.h b/arch/arm/include/asm/hardware/sp810.h new file mode 100644 index 000000000000..a101f10bb5b1 --- /dev/null +++ b/arch/arm/include/asm/hardware/sp810.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/hardware/sp810.h | ||
3 | * | ||
4 | * ARM PrimeXsys System Controller SP810 header file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARM_SP810_H | ||
15 | #define __ASM_ARM_SP810_H | ||
16 | |||
17 | #include <linux/io.h> | ||
18 | |||
19 | /* sysctl registers offset */ | ||
20 | #define SCCTRL 0x000 | ||
21 | #define SCSYSSTAT 0x004 | ||
22 | #define SCIMCTRL 0x008 | ||
23 | #define SCIMSTAT 0x00C | ||
24 | #define SCXTALCTRL 0x010 | ||
25 | #define SCPLLCTRL 0x014 | ||
26 | #define SCPLLFCTRL 0x018 | ||
27 | #define SCPERCTRL0 0x01C | ||
28 | #define SCPERCTRL1 0x020 | ||
29 | #define SCPEREN 0x024 | ||
30 | #define SCPERDIS 0x028 | ||
31 | #define SCPERCLKEN 0x02C | ||
32 | #define SCPERSTAT 0x030 | ||
33 | #define SCSYSID0 0xEE0 | ||
34 | #define SCSYSID1 0xEE4 | ||
35 | #define SCSYSID2 0xEE8 | ||
36 | #define SCSYSID3 0xEEC | ||
37 | #define SCITCR 0xF00 | ||
38 | #define SCITIR0 0xF04 | ||
39 | #define SCITIR1 0xF08 | ||
40 | #define SCITOR 0xF0C | ||
41 | #define SCCNTCTRL 0xF10 | ||
42 | #define SCCNTDATA 0xF14 | ||
43 | #define SCCNTSTEP 0xF18 | ||
44 | #define SCPERIPHID0 0xFE0 | ||
45 | #define SCPERIPHID1 0xFE4 | ||
46 | #define SCPERIPHID2 0xFE8 | ||
47 | #define SCPERIPHID3 0xFEC | ||
48 | #define SCPCELLID0 0xFF0 | ||
49 | #define SCPCELLID1 0xFF4 | ||
50 | #define SCPCELLID2 0xFF8 | ||
51 | #define SCPCELLID3 0xFFC | ||
52 | |||
53 | static inline void sysctl_soft_reset(void __iomem *base) | ||
54 | { | ||
55 | /* writing any value to SCSYSSTAT reg will reset system */ | ||
56 | writel(0, base + SCSYSSTAT); | ||
57 | } | ||
58 | |||
59 | #endif /* __ASM_ARM_SP810_H */ | ||
diff --git a/arch/arm/include/asm/ioctls.h b/arch/arm/include/asm/ioctls.h index a91d8a1523cf..7f0b6d13296a 100644 --- a/arch/arm/include/asm/ioctls.h +++ b/arch/arm/include/asm/ioctls.h | |||
@@ -53,6 +53,9 @@ | |||
53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
55 | 55 | ||
56 | #define TIOCGRS485 0x542E | ||
57 | #define TIOCSRS485 0x542F | ||
58 | |||
56 | #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ | 59 | #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ |
57 | #define FIOCLEX 0x5451 | 60 | #define FIOCLEX 0x5451 |
58 | #define FIOASYNC 0x5452 | 61 | #define FIOASYNC 0x5452 |
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index a38bdc7afa34..52f0da1e97df 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h | |||
@@ -8,10 +8,16 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef __ASM_MACH_PCI_H | ||
12 | #define __ASM_MACH_PCI_H | ||
13 | |||
11 | struct pci_sys_data; | 14 | struct pci_sys_data; |
12 | struct pci_bus; | 15 | struct pci_bus; |
13 | 16 | ||
14 | struct hw_pci { | 17 | struct hw_pci { |
18 | #ifdef CONFIG_PCI_DOMAINS | ||
19 | int domain; | ||
20 | #endif | ||
15 | struct list_head buses; | 21 | struct list_head buses; |
16 | int nr_controllers; | 22 | int nr_controllers; |
17 | int (*setup)(int nr, struct pci_sys_data *); | 23 | int (*setup)(int nr, struct pci_sys_data *); |
@@ -26,6 +32,9 @@ struct hw_pci { | |||
26 | * Per-controller structure | 32 | * Per-controller structure |
27 | */ | 33 | */ |
28 | struct pci_sys_data { | 34 | struct pci_sys_data { |
35 | #ifdef CONFIG_PCI_DOMAINS | ||
36 | int domain; | ||
37 | #endif | ||
29 | struct list_head node; | 38 | struct list_head node; |
30 | int busnr; /* primary bus number */ | 39 | int busnr; /* primary bus number */ |
31 | u64 mem_offset; /* bus->cpu memory mapping offset */ | 40 | u64 mem_offset; /* bus->cpu memory mapping offset */ |
@@ -70,3 +79,5 @@ extern int pci_v3_setup(int nr, struct pci_sys_data *); | |||
70 | extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *); | 79 | extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *); |
71 | extern void pci_v3_preinit(void); | 80 | extern void pci_v3_preinit(void); |
72 | extern void pci_v3_postinit(void); | 81 | extern void pci_v3_postinit(void); |
82 | |||
83 | #endif /* __ASM_MACH_PCI_H */ | ||
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index 8bffc3ff3acf..35d408f6dccf 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h | |||
@@ -38,7 +38,7 @@ struct sys_timer { | |||
38 | void (*init)(void); | 38 | void (*init)(void); |
39 | void (*suspend)(void); | 39 | void (*suspend)(void); |
40 | void (*resume)(void); | 40 | void (*resume)(void); |
41 | #ifndef CONFIG_GENERIC_TIME | 41 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET |
42 | unsigned long (*offset)(void); | 42 | unsigned long (*offset)(void); |
43 | #endif | 43 | #endif |
44 | }; | 44 | }; |
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h index 47980118d0a5..92e2a833693d 100644 --- a/arch/arm/include/asm/pci.h +++ b/arch/arm/include/asm/pci.h | |||
@@ -4,8 +4,23 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | #include <asm-generic/pci-dma-compat.h> | 5 | #include <asm-generic/pci-dma-compat.h> |
6 | 6 | ||
7 | #include <asm/mach/pci.h> /* for pci_sys_data */ | ||
7 | #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ | 8 | #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ |
8 | 9 | ||
10 | #ifdef CONFIG_PCI_DOMAINS | ||
11 | static inline int pci_domain_nr(struct pci_bus *bus) | ||
12 | { | ||
13 | struct pci_sys_data *root = bus->sysdata; | ||
14 | |||
15 | return root->domain; | ||
16 | } | ||
17 | |||
18 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
19 | { | ||
20 | return pci_domain_nr(bus); | ||
21 | } | ||
22 | #endif /* CONFIG_PCI_DOMAINS */ | ||
23 | |||
9 | #ifdef CONFIG_PCI_HOST_ITE8152 | 24 | #ifdef CONFIG_PCI_HOST_ITE8152 |
10 | /* ITE bridge requires setting latency timer to avoid early bus access | 25 | /* ITE bridge requires setting latency timer to avoid early bus access |
11 | termination by PIC bus mater devices | 26 | termination by PIC bus mater devices |
diff --git a/arch/arm/include/asm/perf_event.h b/arch/arm/include/asm/perf_event.h index 49e3049aba32..48837e6d8887 100644 --- a/arch/arm/include/asm/perf_event.h +++ b/arch/arm/include/asm/perf_event.h | |||
@@ -28,4 +28,21 @@ set_perf_event_pending(void) | |||
28 | * same indexes here for consistency. */ | 28 | * same indexes here for consistency. */ |
29 | #define PERF_EVENT_INDEX_OFFSET 1 | 29 | #define PERF_EVENT_INDEX_OFFSET 1 |
30 | 30 | ||
31 | /* ARM perf PMU IDs for use by internal perf clients. */ | ||
32 | enum arm_perf_pmu_ids { | ||
33 | ARM_PERF_PMU_ID_XSCALE1 = 0, | ||
34 | ARM_PERF_PMU_ID_XSCALE2, | ||
35 | ARM_PERF_PMU_ID_V6, | ||
36 | ARM_PERF_PMU_ID_V6MP, | ||
37 | ARM_PERF_PMU_ID_CA8, | ||
38 | ARM_PERF_PMU_ID_CA9, | ||
39 | ARM_NUM_PMU_IDS, | ||
40 | }; | ||
41 | |||
42 | extern enum arm_perf_pmu_ids | ||
43 | armpmu_get_pmu_id(void); | ||
44 | |||
45 | extern int | ||
46 | armpmu_get_max_events(void); | ||
47 | |||
31 | #endif /* __ARM_PERF_EVENT_H__ */ | 48 | #endif /* __ARM_PERF_EVENT_H__ */ |
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 11397687f42c..ab68cf1ef80f 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -314,7 +314,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
314 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED) | 314 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED) |
315 | #define pgprot_writecombine(prot) \ | 315 | #define pgprot_writecombine(prot) \ |
316 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE) | 316 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE) |
317 | #if __LINUX_ARM_ARCH__ >= 7 | 317 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE |
318 | #define pgprot_dmacoherent(prot) \ | 318 | #define pgprot_dmacoherent(prot) \ |
319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) | 319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) |
320 | #else | 320 | #else |
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h index 2829b9f981a1..8ccea012722c 100644 --- a/arch/arm/include/asm/pmu.h +++ b/arch/arm/include/asm/pmu.h | |||
@@ -12,33 +12,33 @@ | |||
12 | #ifndef __ARM_PMU_H__ | 12 | #ifndef __ARM_PMU_H__ |
13 | #define __ARM_PMU_H__ | 13 | #define __ARM_PMU_H__ |
14 | 14 | ||
15 | #ifdef CONFIG_CPU_HAS_PMU | 15 | enum arm_pmu_type { |
16 | 16 | ARM_PMU_DEVICE_CPU = 0, | |
17 | struct pmu_irqs { | 17 | ARM_NUM_PMU_DEVICES, |
18 | const int *irqs; | ||
19 | int num_irqs; | ||
20 | }; | 18 | }; |
21 | 19 | ||
20 | #ifdef CONFIG_CPU_HAS_PMU | ||
21 | |||
22 | /** | 22 | /** |
23 | * reserve_pmu() - reserve the hardware performance counters | 23 | * reserve_pmu() - reserve the hardware performance counters |
24 | * | 24 | * |
25 | * Reserve the hardware performance counters in the system for exclusive use. | 25 | * Reserve the hardware performance counters in the system for exclusive use. |
26 | * The 'struct pmu_irqs' for the system is returned on success, ERR_PTR() | 26 | * The platform_device for the system is returned on success, ERR_PTR() |
27 | * encoded error on failure. | 27 | * encoded error on failure. |
28 | */ | 28 | */ |
29 | extern const struct pmu_irqs * | 29 | extern struct platform_device * |
30 | reserve_pmu(void); | 30 | reserve_pmu(enum arm_pmu_type device); |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * release_pmu() - Relinquish control of the performance counters | 33 | * release_pmu() - Relinquish control of the performance counters |
34 | * | 34 | * |
35 | * Release the performance counters and allow someone else to use them. | 35 | * Release the performance counters and allow someone else to use them. |
36 | * Callers must have disabled the counters and released IRQs before calling | 36 | * Callers must have disabled the counters and released IRQs before calling |
37 | * this. The 'struct pmu_irqs' returned from reserve_pmu() must be passed as | 37 | * this. The platform_device returned from reserve_pmu() must be passed as |
38 | * a cookie. | 38 | * a cookie. |
39 | */ | 39 | */ |
40 | extern int | 40 | extern int |
41 | release_pmu(const struct pmu_irqs *irqs); | 41 | release_pmu(struct platform_device *pdev); |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * init_pmu() - Initialise the PMU. | 44 | * init_pmu() - Initialise the PMU. |
@@ -48,24 +48,26 @@ release_pmu(const struct pmu_irqs *irqs); | |||
48 | * the actual hardware initialisation. | 48 | * the actual hardware initialisation. |
49 | */ | 49 | */ |
50 | extern int | 50 | extern int |
51 | init_pmu(void); | 51 | init_pmu(enum arm_pmu_type device); |
52 | 52 | ||
53 | #else /* CONFIG_CPU_HAS_PMU */ | 53 | #else /* CONFIG_CPU_HAS_PMU */ |
54 | 54 | ||
55 | static inline const struct pmu_irqs * | 55 | #include <linux/err.h> |
56 | reserve_pmu(void) | 56 | |
57 | static inline struct platform_device * | ||
58 | reserve_pmu(enum arm_pmu_type device) | ||
57 | { | 59 | { |
58 | return ERR_PTR(-ENODEV); | 60 | return ERR_PTR(-ENODEV); |
59 | } | 61 | } |
60 | 62 | ||
61 | static inline int | 63 | static inline int |
62 | release_pmu(const struct pmu_irqs *irqs) | 64 | release_pmu(struct platform_device *pdev) |
63 | { | 65 | { |
64 | return -ENODEV; | 66 | return -ENODEV; |
65 | } | 67 | } |
66 | 68 | ||
67 | static inline int | 69 | static inline int |
68 | init_pmu(void) | 70 | init_pmu(enum arm_pmu_type device) |
69 | { | 71 | { |
70 | return -ENODEV; | 72 | return -ENODEV; |
71 | } | 73 | } |
diff --git a/arch/arm/include/asm/scatterlist.h b/arch/arm/include/asm/scatterlist.h index ca0a37d03400..bcda59f39941 100644 --- a/arch/arm/include/asm/scatterlist.h +++ b/arch/arm/include/asm/scatterlist.h | |||
@@ -4,24 +4,8 @@ | |||
4 | #include <asm/memory.h> | 4 | #include <asm/memory.h> |
5 | #include <asm/types.h> | 5 | #include <asm/types.h> |
6 | 6 | ||
7 | struct scatterlist { | 7 | #include <asm-generic/scatterlist.h> |
8 | #ifdef CONFIG_DEBUG_SG | ||
9 | unsigned long sg_magic; | ||
10 | #endif | ||
11 | unsigned long page_link; | ||
12 | unsigned int offset; /* buffer offset */ | ||
13 | dma_addr_t dma_address; /* dma address */ | ||
14 | unsigned int length; /* length */ | ||
15 | }; | ||
16 | 8 | ||
17 | /* | 9 | #undef ARCH_HAS_SG_CHAIN |
18 | * These macros should be used after a pci_map_sg call has been done | ||
19 | * to get bus addresses of each of the SG entries and their lengths. | ||
20 | * You should only work with the number of sg entries pci_map_sg | ||
21 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
22 | * is 0. | ||
23 | */ | ||
24 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
25 | #define sg_dma_len(sg) ((sg)->length) | ||
26 | 10 | ||
27 | #endif /* _ASMARM_SCATTERLIST_H */ | 11 | #endif /* _ASMARM_SCATTERLIST_H */ |
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index e0d763be1846..3d05190797cb 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
@@ -82,7 +82,7 @@ struct secondary_data { | |||
82 | extern struct secondary_data secondary_data; | 82 | extern struct secondary_data secondary_data; |
83 | 83 | ||
84 | extern int __cpu_disable(void); | 84 | extern int __cpu_disable(void); |
85 | extern int mach_cpu_disable(unsigned int cpu); | 85 | extern int platform_cpu_disable(unsigned int cpu); |
86 | 86 | ||
87 | extern void __cpu_die(unsigned int cpu); | 87 | extern void __cpu_die(unsigned int cpu); |
88 | extern void cpu_die(void); | 88 | extern void cpu_die(void); |
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 4ace45ec3ef8..5f4f48002734 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
@@ -141,7 +141,7 @@ extern unsigned int user_debug; | |||
141 | 141 | ||
142 | #ifdef CONFIG_ARCH_HAS_BARRIERS | 142 | #ifdef CONFIG_ARCH_HAS_BARRIERS |
143 | #include <mach/barriers.h> | 143 | #include <mach/barriers.h> |
144 | #elif __LINUX_ARM_ARCH__ >= 7 || defined(CONFIG_SMP) | 144 | #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) |
145 | #define mb() do { dsb(); outer_sync(); } while (0) | 145 | #define mb() do { dsb(); outer_sync(); } while (0) |
146 | #define rmb() dmb() | 146 | #define rmb() dmb() |
147 | #define wmb() mb() | 147 | #define wmb() mb() |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index bd397e0b663e..c6273a3bfc25 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -527,6 +527,9 @@ static void __init pcibios_init_hw(struct hw_pci *hw) | |||
527 | if (!sys) | 527 | if (!sys) |
528 | panic("PCI: unable to allocate sys data!"); | 528 | panic("PCI: unable to allocate sys data!"); |
529 | 529 | ||
530 | #ifdef CONFIG_PCI_DOMAINS | ||
531 | sys->domain = hw->domain; | ||
532 | #endif | ||
530 | sys->hw = hw; | 533 | sys->hw = hw; |
531 | sys->busnr = busnr; | 534 | sys->busnr = busnr; |
532 | sys->swizzle = hw->swizzle; | 535 | sys->swizzle = hw->swizzle; |
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c index 7d5b9fb01e71..2c4a185f92cd 100644 --- a/arch/arm/kernel/dma.c +++ b/arch/arm/kernel/dma.c | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/scatterlist.h> | 18 | #include <linux/scatterlist.h> |
19 | #include <linux/seq_file.h> | ||
20 | #include <linux/proc_fs.h> | ||
19 | 21 | ||
20 | #include <asm/dma.h> | 22 | #include <asm/dma.h> |
21 | 23 | ||
@@ -264,3 +266,37 @@ int get_dma_residue(unsigned int chan) | |||
264 | return ret; | 266 | return ret; |
265 | } | 267 | } |
266 | EXPORT_SYMBOL(get_dma_residue); | 268 | EXPORT_SYMBOL(get_dma_residue); |
269 | |||
270 | #ifdef CONFIG_PROC_FS | ||
271 | static int proc_dma_show(struct seq_file *m, void *v) | ||
272 | { | ||
273 | int i; | ||
274 | |||
275 | for (i = 0 ; i < MAX_DMA_CHANNELS ; i++) { | ||
276 | dma_t *dma = dma_channel(i); | ||
277 | if (dma && dma->lock) | ||
278 | seq_printf(m, "%2d: %s\n", i, dma->device_id); | ||
279 | } | ||
280 | return 0; | ||
281 | } | ||
282 | |||
283 | static int proc_dma_open(struct inode *inode, struct file *file) | ||
284 | { | ||
285 | return single_open(file, proc_dma_show, NULL); | ||
286 | } | ||
287 | |||
288 | static const struct file_operations proc_dma_operations = { | ||
289 | .open = proc_dma_open, | ||
290 | .read = seq_read, | ||
291 | .llseek = seq_lseek, | ||
292 | .release = single_release, | ||
293 | }; | ||
294 | |||
295 | static int __init proc_dma_init(void) | ||
296 | { | ||
297 | proc_create("dma", 0, NULL, &proc_dma_operations); | ||
298 | return 0; | ||
299 | } | ||
300 | |||
301 | __initcall(proc_dma_init); | ||
302 | #endif | ||
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 9e70f2053f9a..c45768614c8a 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -16,7 +16,9 @@ | |||
16 | 16 | ||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/module.h> | ||
19 | #include <linux/perf_event.h> | 20 | #include <linux/perf_event.h> |
21 | #include <linux/platform_device.h> | ||
20 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
21 | #include <linux/uaccess.h> | 23 | #include <linux/uaccess.h> |
22 | 24 | ||
@@ -26,7 +28,7 @@ | |||
26 | #include <asm/pmu.h> | 28 | #include <asm/pmu.h> |
27 | #include <asm/stacktrace.h> | 29 | #include <asm/stacktrace.h> |
28 | 30 | ||
29 | static const struct pmu_irqs *pmu_irqs; | 31 | static struct platform_device *pmu_device; |
30 | 32 | ||
31 | /* | 33 | /* |
32 | * Hardware lock to serialize accesses to PMU registers. Needed for the | 34 | * Hardware lock to serialize accesses to PMU registers. Needed for the |
@@ -67,8 +69,18 @@ struct cpu_hw_events { | |||
67 | }; | 69 | }; |
68 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); | 70 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); |
69 | 71 | ||
72 | /* PMU names. */ | ||
73 | static const char *arm_pmu_names[] = { | ||
74 | [ARM_PERF_PMU_ID_XSCALE1] = "xscale1", | ||
75 | [ARM_PERF_PMU_ID_XSCALE2] = "xscale2", | ||
76 | [ARM_PERF_PMU_ID_V6] = "v6", | ||
77 | [ARM_PERF_PMU_ID_V6MP] = "v6mpcore", | ||
78 | [ARM_PERF_PMU_ID_CA8] = "ARMv7 Cortex-A8", | ||
79 | [ARM_PERF_PMU_ID_CA9] = "ARMv7 Cortex-A9", | ||
80 | }; | ||
81 | |||
70 | struct arm_pmu { | 82 | struct arm_pmu { |
71 | char *name; | 83 | enum arm_perf_pmu_ids id; |
72 | irqreturn_t (*handle_irq)(int irq_num, void *dev); | 84 | irqreturn_t (*handle_irq)(int irq_num, void *dev); |
73 | void (*enable)(struct hw_perf_event *evt, int idx); | 85 | void (*enable)(struct hw_perf_event *evt, int idx); |
74 | void (*disable)(struct hw_perf_event *evt, int idx); | 86 | void (*disable)(struct hw_perf_event *evt, int idx); |
@@ -87,6 +99,30 @@ struct arm_pmu { | |||
87 | /* Set at runtime when we know what CPU type we are. */ | 99 | /* Set at runtime when we know what CPU type we are. */ |
88 | static const struct arm_pmu *armpmu; | 100 | static const struct arm_pmu *armpmu; |
89 | 101 | ||
102 | enum arm_perf_pmu_ids | ||
103 | armpmu_get_pmu_id(void) | ||
104 | { | ||
105 | int id = -ENODEV; | ||
106 | |||
107 | if (armpmu != NULL) | ||
108 | id = armpmu->id; | ||
109 | |||
110 | return id; | ||
111 | } | ||
112 | EXPORT_SYMBOL_GPL(armpmu_get_pmu_id); | ||
113 | |||
114 | int | ||
115 | armpmu_get_max_events(void) | ||
116 | { | ||
117 | int max_events = 0; | ||
118 | |||
119 | if (armpmu != NULL) | ||
120 | max_events = armpmu->num_events; | ||
121 | |||
122 | return max_events; | ||
123 | } | ||
124 | EXPORT_SYMBOL_GPL(armpmu_get_max_events); | ||
125 | |||
90 | #define HW_OP_UNSUPPORTED 0xFFFF | 126 | #define HW_OP_UNSUPPORTED 0xFFFF |
91 | 127 | ||
92 | #define C(_x) \ | 128 | #define C(_x) \ |
@@ -314,38 +350,44 @@ validate_group(struct perf_event *event) | |||
314 | static int | 350 | static int |
315 | armpmu_reserve_hardware(void) | 351 | armpmu_reserve_hardware(void) |
316 | { | 352 | { |
317 | int i; | 353 | int i, err = -ENODEV, irq; |
318 | int err; | ||
319 | 354 | ||
320 | pmu_irqs = reserve_pmu(); | 355 | pmu_device = reserve_pmu(ARM_PMU_DEVICE_CPU); |
321 | if (IS_ERR(pmu_irqs)) { | 356 | if (IS_ERR(pmu_device)) { |
322 | pr_warning("unable to reserve pmu\n"); | 357 | pr_warning("unable to reserve pmu\n"); |
323 | return PTR_ERR(pmu_irqs); | 358 | return PTR_ERR(pmu_device); |
324 | } | 359 | } |
325 | 360 | ||
326 | init_pmu(); | 361 | init_pmu(ARM_PMU_DEVICE_CPU); |
327 | 362 | ||
328 | if (pmu_irqs->num_irqs < 1) { | 363 | if (pmu_device->num_resources < 1) { |
329 | pr_err("no irqs for PMUs defined\n"); | 364 | pr_err("no irqs for PMUs defined\n"); |
330 | return -ENODEV; | 365 | return -ENODEV; |
331 | } | 366 | } |
332 | 367 | ||
333 | for (i = 0; i < pmu_irqs->num_irqs; ++i) { | 368 | for (i = 0; i < pmu_device->num_resources; ++i) { |
334 | err = request_irq(pmu_irqs->irqs[i], armpmu->handle_irq, | 369 | irq = platform_get_irq(pmu_device, i); |
370 | if (irq < 0) | ||
371 | continue; | ||
372 | |||
373 | err = request_irq(irq, armpmu->handle_irq, | ||
335 | IRQF_DISABLED | IRQF_NOBALANCING, | 374 | IRQF_DISABLED | IRQF_NOBALANCING, |
336 | "armpmu", NULL); | 375 | "armpmu", NULL); |
337 | if (err) { | 376 | if (err) { |
338 | pr_warning("unable to request IRQ%d for ARM " | 377 | pr_warning("unable to request IRQ%d for ARM perf " |
339 | "perf counters\n", pmu_irqs->irqs[i]); | 378 | "counters\n", irq); |
340 | break; | 379 | break; |
341 | } | 380 | } |
342 | } | 381 | } |
343 | 382 | ||
344 | if (err) { | 383 | if (err) { |
345 | for (i = i - 1; i >= 0; --i) | 384 | for (i = i - 1; i >= 0; --i) { |
346 | free_irq(pmu_irqs->irqs[i], NULL); | 385 | irq = platform_get_irq(pmu_device, i); |
347 | release_pmu(pmu_irqs); | 386 | if (irq >= 0) |
348 | pmu_irqs = NULL; | 387 | free_irq(irq, NULL); |
388 | } | ||
389 | release_pmu(pmu_device); | ||
390 | pmu_device = NULL; | ||
349 | } | 391 | } |
350 | 392 | ||
351 | return err; | 393 | return err; |
@@ -354,14 +396,17 @@ armpmu_reserve_hardware(void) | |||
354 | static void | 396 | static void |
355 | armpmu_release_hardware(void) | 397 | armpmu_release_hardware(void) |
356 | { | 398 | { |
357 | int i; | 399 | int i, irq; |
358 | 400 | ||
359 | for (i = pmu_irqs->num_irqs - 1; i >= 0; --i) | 401 | for (i = pmu_device->num_resources - 1; i >= 0; --i) { |
360 | free_irq(pmu_irqs->irqs[i], NULL); | 402 | irq = platform_get_irq(pmu_device, i); |
403 | if (irq >= 0) | ||
404 | free_irq(irq, NULL); | ||
405 | } | ||
361 | armpmu->stop(); | 406 | armpmu->stop(); |
362 | 407 | ||
363 | release_pmu(pmu_irqs); | 408 | release_pmu(pmu_device); |
364 | pmu_irqs = NULL; | 409 | pmu_device = NULL; |
365 | } | 410 | } |
366 | 411 | ||
367 | static atomic_t active_events = ATOMIC_INIT(0); | 412 | static atomic_t active_events = ATOMIC_INIT(0); |
@@ -1144,7 +1189,7 @@ armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc, | |||
1144 | } | 1189 | } |
1145 | 1190 | ||
1146 | static const struct arm_pmu armv6pmu = { | 1191 | static const struct arm_pmu armv6pmu = { |
1147 | .name = "v6", | 1192 | .id = ARM_PERF_PMU_ID_V6, |
1148 | .handle_irq = armv6pmu_handle_irq, | 1193 | .handle_irq = armv6pmu_handle_irq, |
1149 | .enable = armv6pmu_enable_event, | 1194 | .enable = armv6pmu_enable_event, |
1150 | .disable = armv6pmu_disable_event, | 1195 | .disable = armv6pmu_disable_event, |
@@ -1167,7 +1212,7 @@ static const struct arm_pmu armv6pmu = { | |||
1167 | * reset the period and enable the interrupt reporting. | 1212 | * reset the period and enable the interrupt reporting. |
1168 | */ | 1213 | */ |
1169 | static const struct arm_pmu armv6mpcore_pmu = { | 1214 | static const struct arm_pmu armv6mpcore_pmu = { |
1170 | .name = "v6mpcore", | 1215 | .id = ARM_PERF_PMU_ID_V6MP, |
1171 | .handle_irq = armv6pmu_handle_irq, | 1216 | .handle_irq = armv6pmu_handle_irq, |
1172 | .enable = armv6pmu_enable_event, | 1217 | .enable = armv6pmu_enable_event, |
1173 | .disable = armv6mpcore_pmu_disable_event, | 1218 | .disable = armv6mpcore_pmu_disable_event, |
@@ -1197,10 +1242,6 @@ static const struct arm_pmu armv6mpcore_pmu = { | |||
1197 | * counter and all 4 performance counters together can be reset separately. | 1242 | * counter and all 4 performance counters together can be reset separately. |
1198 | */ | 1243 | */ |
1199 | 1244 | ||
1200 | #define ARMV7_PMU_CORTEX_A8_NAME "ARMv7 Cortex-A8" | ||
1201 | |||
1202 | #define ARMV7_PMU_CORTEX_A9_NAME "ARMv7 Cortex-A9" | ||
1203 | |||
1204 | /* Common ARMv7 event types */ | 1245 | /* Common ARMv7 event types */ |
1205 | enum armv7_perf_types { | 1246 | enum armv7_perf_types { |
1206 | ARMV7_PERFCTR_PMNC_SW_INCR = 0x00, | 1247 | ARMV7_PERFCTR_PMNC_SW_INCR = 0x00, |
@@ -2079,6 +2120,803 @@ static u32 __init armv7_reset_read_pmnc(void) | |||
2079 | return nb_cnt + 1; | 2120 | return nb_cnt + 1; |
2080 | } | 2121 | } |
2081 | 2122 | ||
2123 | /* | ||
2124 | * ARMv5 [xscale] Performance counter handling code. | ||
2125 | * | ||
2126 | * Based on xscale OProfile code. | ||
2127 | * | ||
2128 | * There are two variants of the xscale PMU that we support: | ||
2129 | * - xscale1pmu: 2 event counters and a cycle counter | ||
2130 | * - xscale2pmu: 4 event counters and a cycle counter | ||
2131 | * The two variants share event definitions, but have different | ||
2132 | * PMU structures. | ||
2133 | */ | ||
2134 | |||
2135 | enum xscale_perf_types { | ||
2136 | XSCALE_PERFCTR_ICACHE_MISS = 0x00, | ||
2137 | XSCALE_PERFCTR_ICACHE_NO_DELIVER = 0x01, | ||
2138 | XSCALE_PERFCTR_DATA_STALL = 0x02, | ||
2139 | XSCALE_PERFCTR_ITLB_MISS = 0x03, | ||
2140 | XSCALE_PERFCTR_DTLB_MISS = 0x04, | ||
2141 | XSCALE_PERFCTR_BRANCH = 0x05, | ||
2142 | XSCALE_PERFCTR_BRANCH_MISS = 0x06, | ||
2143 | XSCALE_PERFCTR_INSTRUCTION = 0x07, | ||
2144 | XSCALE_PERFCTR_DCACHE_FULL_STALL = 0x08, | ||
2145 | XSCALE_PERFCTR_DCACHE_FULL_STALL_CONTIG = 0x09, | ||
2146 | XSCALE_PERFCTR_DCACHE_ACCESS = 0x0A, | ||
2147 | XSCALE_PERFCTR_DCACHE_MISS = 0x0B, | ||
2148 | XSCALE_PERFCTR_DCACHE_WRITE_BACK = 0x0C, | ||
2149 | XSCALE_PERFCTR_PC_CHANGED = 0x0D, | ||
2150 | XSCALE_PERFCTR_BCU_REQUEST = 0x10, | ||
2151 | XSCALE_PERFCTR_BCU_FULL = 0x11, | ||
2152 | XSCALE_PERFCTR_BCU_DRAIN = 0x12, | ||
2153 | XSCALE_PERFCTR_BCU_ECC_NO_ELOG = 0x14, | ||
2154 | XSCALE_PERFCTR_BCU_1_BIT_ERR = 0x15, | ||
2155 | XSCALE_PERFCTR_RMW = 0x16, | ||
2156 | /* XSCALE_PERFCTR_CCNT is not hardware defined */ | ||
2157 | XSCALE_PERFCTR_CCNT = 0xFE, | ||
2158 | XSCALE_PERFCTR_UNUSED = 0xFF, | ||
2159 | }; | ||
2160 | |||
2161 | enum xscale_counters { | ||
2162 | XSCALE_CYCLE_COUNTER = 1, | ||
2163 | XSCALE_COUNTER0, | ||
2164 | XSCALE_COUNTER1, | ||
2165 | XSCALE_COUNTER2, | ||
2166 | XSCALE_COUNTER3, | ||
2167 | }; | ||
2168 | |||
2169 | static const unsigned xscale_perf_map[PERF_COUNT_HW_MAX] = { | ||
2170 | [PERF_COUNT_HW_CPU_CYCLES] = XSCALE_PERFCTR_CCNT, | ||
2171 | [PERF_COUNT_HW_INSTRUCTIONS] = XSCALE_PERFCTR_INSTRUCTION, | ||
2172 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
2173 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
2174 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = XSCALE_PERFCTR_BRANCH, | ||
2175 | [PERF_COUNT_HW_BRANCH_MISSES] = XSCALE_PERFCTR_BRANCH_MISS, | ||
2176 | [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, | ||
2177 | }; | ||
2178 | |||
2179 | static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
2180 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
2181 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
2182 | [C(L1D)] = { | ||
2183 | [C(OP_READ)] = { | ||
2184 | [C(RESULT_ACCESS)] = XSCALE_PERFCTR_DCACHE_ACCESS, | ||
2185 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DCACHE_MISS, | ||
2186 | }, | ||
2187 | [C(OP_WRITE)] = { | ||
2188 | [C(RESULT_ACCESS)] = XSCALE_PERFCTR_DCACHE_ACCESS, | ||
2189 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DCACHE_MISS, | ||
2190 | }, | ||
2191 | [C(OP_PREFETCH)] = { | ||
2192 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2193 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2194 | }, | ||
2195 | }, | ||
2196 | [C(L1I)] = { | ||
2197 | [C(OP_READ)] = { | ||
2198 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2199 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, | ||
2200 | }, | ||
2201 | [C(OP_WRITE)] = { | ||
2202 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2203 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, | ||
2204 | }, | ||
2205 | [C(OP_PREFETCH)] = { | ||
2206 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2207 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2208 | }, | ||
2209 | }, | ||
2210 | [C(LL)] = { | ||
2211 | [C(OP_READ)] = { | ||
2212 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2213 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2214 | }, | ||
2215 | [C(OP_WRITE)] = { | ||
2216 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2217 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2218 | }, | ||
2219 | [C(OP_PREFETCH)] = { | ||
2220 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2221 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2222 | }, | ||
2223 | }, | ||
2224 | [C(DTLB)] = { | ||
2225 | [C(OP_READ)] = { | ||
2226 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2227 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DTLB_MISS, | ||
2228 | }, | ||
2229 | [C(OP_WRITE)] = { | ||
2230 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2231 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DTLB_MISS, | ||
2232 | }, | ||
2233 | [C(OP_PREFETCH)] = { | ||
2234 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2235 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2236 | }, | ||
2237 | }, | ||
2238 | [C(ITLB)] = { | ||
2239 | [C(OP_READ)] = { | ||
2240 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2241 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ITLB_MISS, | ||
2242 | }, | ||
2243 | [C(OP_WRITE)] = { | ||
2244 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2245 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ITLB_MISS, | ||
2246 | }, | ||
2247 | [C(OP_PREFETCH)] = { | ||
2248 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2249 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2250 | }, | ||
2251 | }, | ||
2252 | [C(BPU)] = { | ||
2253 | [C(OP_READ)] = { | ||
2254 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2255 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2256 | }, | ||
2257 | [C(OP_WRITE)] = { | ||
2258 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2259 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2260 | }, | ||
2261 | [C(OP_PREFETCH)] = { | ||
2262 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
2263 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
2264 | }, | ||
2265 | }, | ||
2266 | }; | ||
2267 | |||
2268 | #define XSCALE_PMU_ENABLE 0x001 | ||
2269 | #define XSCALE_PMN_RESET 0x002 | ||
2270 | #define XSCALE_CCNT_RESET 0x004 | ||
2271 | #define XSCALE_PMU_RESET (CCNT_RESET | PMN_RESET) | ||
2272 | #define XSCALE_PMU_CNT64 0x008 | ||
2273 | |||
2274 | static inline int | ||
2275 | xscalepmu_event_map(int config) | ||
2276 | { | ||
2277 | int mapping = xscale_perf_map[config]; | ||
2278 | if (HW_OP_UNSUPPORTED == mapping) | ||
2279 | mapping = -EOPNOTSUPP; | ||
2280 | return mapping; | ||
2281 | } | ||
2282 | |||
2283 | static u64 | ||
2284 | xscalepmu_raw_event(u64 config) | ||
2285 | { | ||
2286 | return config & 0xff; | ||
2287 | } | ||
2288 | |||
2289 | #define XSCALE1_OVERFLOWED_MASK 0x700 | ||
2290 | #define XSCALE1_CCOUNT_OVERFLOW 0x400 | ||
2291 | #define XSCALE1_COUNT0_OVERFLOW 0x100 | ||
2292 | #define XSCALE1_COUNT1_OVERFLOW 0x200 | ||
2293 | #define XSCALE1_CCOUNT_INT_EN 0x040 | ||
2294 | #define XSCALE1_COUNT0_INT_EN 0x010 | ||
2295 | #define XSCALE1_COUNT1_INT_EN 0x020 | ||
2296 | #define XSCALE1_COUNT0_EVT_SHFT 12 | ||
2297 | #define XSCALE1_COUNT0_EVT_MASK (0xff << XSCALE1_COUNT0_EVT_SHFT) | ||
2298 | #define XSCALE1_COUNT1_EVT_SHFT 20 | ||
2299 | #define XSCALE1_COUNT1_EVT_MASK (0xff << XSCALE1_COUNT1_EVT_SHFT) | ||
2300 | |||
2301 | static inline u32 | ||
2302 | xscale1pmu_read_pmnc(void) | ||
2303 | { | ||
2304 | u32 val; | ||
2305 | asm volatile("mrc p14, 0, %0, c0, c0, 0" : "=r" (val)); | ||
2306 | return val; | ||
2307 | } | ||
2308 | |||
2309 | static inline void | ||
2310 | xscale1pmu_write_pmnc(u32 val) | ||
2311 | { | ||
2312 | /* upper 4bits and 7, 11 are write-as-0 */ | ||
2313 | val &= 0xffff77f; | ||
2314 | asm volatile("mcr p14, 0, %0, c0, c0, 0" : : "r" (val)); | ||
2315 | } | ||
2316 | |||
2317 | static inline int | ||
2318 | xscale1_pmnc_counter_has_overflowed(unsigned long pmnc, | ||
2319 | enum xscale_counters counter) | ||
2320 | { | ||
2321 | int ret = 0; | ||
2322 | |||
2323 | switch (counter) { | ||
2324 | case XSCALE_CYCLE_COUNTER: | ||
2325 | ret = pmnc & XSCALE1_CCOUNT_OVERFLOW; | ||
2326 | break; | ||
2327 | case XSCALE_COUNTER0: | ||
2328 | ret = pmnc & XSCALE1_COUNT0_OVERFLOW; | ||
2329 | break; | ||
2330 | case XSCALE_COUNTER1: | ||
2331 | ret = pmnc & XSCALE1_COUNT1_OVERFLOW; | ||
2332 | break; | ||
2333 | default: | ||
2334 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
2335 | } | ||
2336 | |||
2337 | return ret; | ||
2338 | } | ||
2339 | |||
2340 | static irqreturn_t | ||
2341 | xscale1pmu_handle_irq(int irq_num, void *dev) | ||
2342 | { | ||
2343 | unsigned long pmnc; | ||
2344 | struct perf_sample_data data; | ||
2345 | struct cpu_hw_events *cpuc; | ||
2346 | struct pt_regs *regs; | ||
2347 | int idx; | ||
2348 | |||
2349 | /* | ||
2350 | * NOTE: there's an A stepping erratum that states if an overflow | ||
2351 | * bit already exists and another occurs, the previous | ||
2352 | * Overflow bit gets cleared. There's no workaround. | ||
2353 | * Fixed in B stepping or later. | ||
2354 | */ | ||
2355 | pmnc = xscale1pmu_read_pmnc(); | ||
2356 | |||
2357 | /* | ||
2358 | * Write the value back to clear the overflow flags. Overflow | ||
2359 | * flags remain in pmnc for use below. We also disable the PMU | ||
2360 | * while we process the interrupt. | ||
2361 | */ | ||
2362 | xscale1pmu_write_pmnc(pmnc & ~XSCALE_PMU_ENABLE); | ||
2363 | |||
2364 | if (!(pmnc & XSCALE1_OVERFLOWED_MASK)) | ||
2365 | return IRQ_NONE; | ||
2366 | |||
2367 | regs = get_irq_regs(); | ||
2368 | |||
2369 | perf_sample_data_init(&data, 0); | ||
2370 | |||
2371 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
2372 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
2373 | struct perf_event *event = cpuc->events[idx]; | ||
2374 | struct hw_perf_event *hwc; | ||
2375 | |||
2376 | if (!test_bit(idx, cpuc->active_mask)) | ||
2377 | continue; | ||
2378 | |||
2379 | if (!xscale1_pmnc_counter_has_overflowed(pmnc, idx)) | ||
2380 | continue; | ||
2381 | |||
2382 | hwc = &event->hw; | ||
2383 | armpmu_event_update(event, hwc, idx); | ||
2384 | data.period = event->hw.last_period; | ||
2385 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
2386 | continue; | ||
2387 | |||
2388 | if (perf_event_overflow(event, 0, &data, regs)) | ||
2389 | armpmu->disable(hwc, idx); | ||
2390 | } | ||
2391 | |||
2392 | perf_event_do_pending(); | ||
2393 | |||
2394 | /* | ||
2395 | * Re-enable the PMU. | ||
2396 | */ | ||
2397 | pmnc = xscale1pmu_read_pmnc() | XSCALE_PMU_ENABLE; | ||
2398 | xscale1pmu_write_pmnc(pmnc); | ||
2399 | |||
2400 | return IRQ_HANDLED; | ||
2401 | } | ||
2402 | |||
2403 | static void | ||
2404 | xscale1pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
2405 | { | ||
2406 | unsigned long val, mask, evt, flags; | ||
2407 | |||
2408 | switch (idx) { | ||
2409 | case XSCALE_CYCLE_COUNTER: | ||
2410 | mask = 0; | ||
2411 | evt = XSCALE1_CCOUNT_INT_EN; | ||
2412 | break; | ||
2413 | case XSCALE_COUNTER0: | ||
2414 | mask = XSCALE1_COUNT0_EVT_MASK; | ||
2415 | evt = (hwc->config_base << XSCALE1_COUNT0_EVT_SHFT) | | ||
2416 | XSCALE1_COUNT0_INT_EN; | ||
2417 | break; | ||
2418 | case XSCALE_COUNTER1: | ||
2419 | mask = XSCALE1_COUNT1_EVT_MASK; | ||
2420 | evt = (hwc->config_base << XSCALE1_COUNT1_EVT_SHFT) | | ||
2421 | XSCALE1_COUNT1_INT_EN; | ||
2422 | break; | ||
2423 | default: | ||
2424 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
2425 | return; | ||
2426 | } | ||
2427 | |||
2428 | spin_lock_irqsave(&pmu_lock, flags); | ||
2429 | val = xscale1pmu_read_pmnc(); | ||
2430 | val &= ~mask; | ||
2431 | val |= evt; | ||
2432 | xscale1pmu_write_pmnc(val); | ||
2433 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2434 | } | ||
2435 | |||
2436 | static void | ||
2437 | xscale1pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
2438 | { | ||
2439 | unsigned long val, mask, evt, flags; | ||
2440 | |||
2441 | switch (idx) { | ||
2442 | case XSCALE_CYCLE_COUNTER: | ||
2443 | mask = XSCALE1_CCOUNT_INT_EN; | ||
2444 | evt = 0; | ||
2445 | break; | ||
2446 | case XSCALE_COUNTER0: | ||
2447 | mask = XSCALE1_COUNT0_INT_EN | XSCALE1_COUNT0_EVT_MASK; | ||
2448 | evt = XSCALE_PERFCTR_UNUSED << XSCALE1_COUNT0_EVT_SHFT; | ||
2449 | break; | ||
2450 | case XSCALE_COUNTER1: | ||
2451 | mask = XSCALE1_COUNT1_INT_EN | XSCALE1_COUNT1_EVT_MASK; | ||
2452 | evt = XSCALE_PERFCTR_UNUSED << XSCALE1_COUNT1_EVT_SHFT; | ||
2453 | break; | ||
2454 | default: | ||
2455 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
2456 | return; | ||
2457 | } | ||
2458 | |||
2459 | spin_lock_irqsave(&pmu_lock, flags); | ||
2460 | val = xscale1pmu_read_pmnc(); | ||
2461 | val &= ~mask; | ||
2462 | val |= evt; | ||
2463 | xscale1pmu_write_pmnc(val); | ||
2464 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2465 | } | ||
2466 | |||
2467 | static int | ||
2468 | xscale1pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
2469 | struct hw_perf_event *event) | ||
2470 | { | ||
2471 | if (XSCALE_PERFCTR_CCNT == event->config_base) { | ||
2472 | if (test_and_set_bit(XSCALE_CYCLE_COUNTER, cpuc->used_mask)) | ||
2473 | return -EAGAIN; | ||
2474 | |||
2475 | return XSCALE_CYCLE_COUNTER; | ||
2476 | } else { | ||
2477 | if (!test_and_set_bit(XSCALE_COUNTER1, cpuc->used_mask)) { | ||
2478 | return XSCALE_COUNTER1; | ||
2479 | } | ||
2480 | |||
2481 | if (!test_and_set_bit(XSCALE_COUNTER0, cpuc->used_mask)) { | ||
2482 | return XSCALE_COUNTER0; | ||
2483 | } | ||
2484 | |||
2485 | return -EAGAIN; | ||
2486 | } | ||
2487 | } | ||
2488 | |||
2489 | static void | ||
2490 | xscale1pmu_start(void) | ||
2491 | { | ||
2492 | unsigned long flags, val; | ||
2493 | |||
2494 | spin_lock_irqsave(&pmu_lock, flags); | ||
2495 | val = xscale1pmu_read_pmnc(); | ||
2496 | val |= XSCALE_PMU_ENABLE; | ||
2497 | xscale1pmu_write_pmnc(val); | ||
2498 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2499 | } | ||
2500 | |||
2501 | static void | ||
2502 | xscale1pmu_stop(void) | ||
2503 | { | ||
2504 | unsigned long flags, val; | ||
2505 | |||
2506 | spin_lock_irqsave(&pmu_lock, flags); | ||
2507 | val = xscale1pmu_read_pmnc(); | ||
2508 | val &= ~XSCALE_PMU_ENABLE; | ||
2509 | xscale1pmu_write_pmnc(val); | ||
2510 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2511 | } | ||
2512 | |||
2513 | static inline u32 | ||
2514 | xscale1pmu_read_counter(int counter) | ||
2515 | { | ||
2516 | u32 val = 0; | ||
2517 | |||
2518 | switch (counter) { | ||
2519 | case XSCALE_CYCLE_COUNTER: | ||
2520 | asm volatile("mrc p14, 0, %0, c1, c0, 0" : "=r" (val)); | ||
2521 | break; | ||
2522 | case XSCALE_COUNTER0: | ||
2523 | asm volatile("mrc p14, 0, %0, c2, c0, 0" : "=r" (val)); | ||
2524 | break; | ||
2525 | case XSCALE_COUNTER1: | ||
2526 | asm volatile("mrc p14, 0, %0, c3, c0, 0" : "=r" (val)); | ||
2527 | break; | ||
2528 | } | ||
2529 | |||
2530 | return val; | ||
2531 | } | ||
2532 | |||
2533 | static inline void | ||
2534 | xscale1pmu_write_counter(int counter, u32 val) | ||
2535 | { | ||
2536 | switch (counter) { | ||
2537 | case XSCALE_CYCLE_COUNTER: | ||
2538 | asm volatile("mcr p14, 0, %0, c1, c0, 0" : : "r" (val)); | ||
2539 | break; | ||
2540 | case XSCALE_COUNTER0: | ||
2541 | asm volatile("mcr p14, 0, %0, c2, c0, 0" : : "r" (val)); | ||
2542 | break; | ||
2543 | case XSCALE_COUNTER1: | ||
2544 | asm volatile("mcr p14, 0, %0, c3, c0, 0" : : "r" (val)); | ||
2545 | break; | ||
2546 | } | ||
2547 | } | ||
2548 | |||
2549 | static const struct arm_pmu xscale1pmu = { | ||
2550 | .id = ARM_PERF_PMU_ID_XSCALE1, | ||
2551 | .handle_irq = xscale1pmu_handle_irq, | ||
2552 | .enable = xscale1pmu_enable_event, | ||
2553 | .disable = xscale1pmu_disable_event, | ||
2554 | .event_map = xscalepmu_event_map, | ||
2555 | .raw_event = xscalepmu_raw_event, | ||
2556 | .read_counter = xscale1pmu_read_counter, | ||
2557 | .write_counter = xscale1pmu_write_counter, | ||
2558 | .get_event_idx = xscale1pmu_get_event_idx, | ||
2559 | .start = xscale1pmu_start, | ||
2560 | .stop = xscale1pmu_stop, | ||
2561 | .num_events = 3, | ||
2562 | .max_period = (1LLU << 32) - 1, | ||
2563 | }; | ||
2564 | |||
2565 | #define XSCALE2_OVERFLOWED_MASK 0x01f | ||
2566 | #define XSCALE2_CCOUNT_OVERFLOW 0x001 | ||
2567 | #define XSCALE2_COUNT0_OVERFLOW 0x002 | ||
2568 | #define XSCALE2_COUNT1_OVERFLOW 0x004 | ||
2569 | #define XSCALE2_COUNT2_OVERFLOW 0x008 | ||
2570 | #define XSCALE2_COUNT3_OVERFLOW 0x010 | ||
2571 | #define XSCALE2_CCOUNT_INT_EN 0x001 | ||
2572 | #define XSCALE2_COUNT0_INT_EN 0x002 | ||
2573 | #define XSCALE2_COUNT1_INT_EN 0x004 | ||
2574 | #define XSCALE2_COUNT2_INT_EN 0x008 | ||
2575 | #define XSCALE2_COUNT3_INT_EN 0x010 | ||
2576 | #define XSCALE2_COUNT0_EVT_SHFT 0 | ||
2577 | #define XSCALE2_COUNT0_EVT_MASK (0xff << XSCALE2_COUNT0_EVT_SHFT) | ||
2578 | #define XSCALE2_COUNT1_EVT_SHFT 8 | ||
2579 | #define XSCALE2_COUNT1_EVT_MASK (0xff << XSCALE2_COUNT1_EVT_SHFT) | ||
2580 | #define XSCALE2_COUNT2_EVT_SHFT 16 | ||
2581 | #define XSCALE2_COUNT2_EVT_MASK (0xff << XSCALE2_COUNT2_EVT_SHFT) | ||
2582 | #define XSCALE2_COUNT3_EVT_SHFT 24 | ||
2583 | #define XSCALE2_COUNT3_EVT_MASK (0xff << XSCALE2_COUNT3_EVT_SHFT) | ||
2584 | |||
2585 | static inline u32 | ||
2586 | xscale2pmu_read_pmnc(void) | ||
2587 | { | ||
2588 | u32 val; | ||
2589 | asm volatile("mrc p14, 0, %0, c0, c1, 0" : "=r" (val)); | ||
2590 | /* bits 1-2 and 4-23 are read-unpredictable */ | ||
2591 | return val & 0xff000009; | ||
2592 | } | ||
2593 | |||
2594 | static inline void | ||
2595 | xscale2pmu_write_pmnc(u32 val) | ||
2596 | { | ||
2597 | /* bits 4-23 are write-as-0, 24-31 are write ignored */ | ||
2598 | val &= 0xf; | ||
2599 | asm volatile("mcr p14, 0, %0, c0, c1, 0" : : "r" (val)); | ||
2600 | } | ||
2601 | |||
2602 | static inline u32 | ||
2603 | xscale2pmu_read_overflow_flags(void) | ||
2604 | { | ||
2605 | u32 val; | ||
2606 | asm volatile("mrc p14, 0, %0, c5, c1, 0" : "=r" (val)); | ||
2607 | return val; | ||
2608 | } | ||
2609 | |||
2610 | static inline void | ||
2611 | xscale2pmu_write_overflow_flags(u32 val) | ||
2612 | { | ||
2613 | asm volatile("mcr p14, 0, %0, c5, c1, 0" : : "r" (val)); | ||
2614 | } | ||
2615 | |||
2616 | static inline u32 | ||
2617 | xscale2pmu_read_event_select(void) | ||
2618 | { | ||
2619 | u32 val; | ||
2620 | asm volatile("mrc p14, 0, %0, c8, c1, 0" : "=r" (val)); | ||
2621 | return val; | ||
2622 | } | ||
2623 | |||
2624 | static inline void | ||
2625 | xscale2pmu_write_event_select(u32 val) | ||
2626 | { | ||
2627 | asm volatile("mcr p14, 0, %0, c8, c1, 0" : : "r"(val)); | ||
2628 | } | ||
2629 | |||
2630 | static inline u32 | ||
2631 | xscale2pmu_read_int_enable(void) | ||
2632 | { | ||
2633 | u32 val; | ||
2634 | asm volatile("mrc p14, 0, %0, c4, c1, 0" : "=r" (val)); | ||
2635 | return val; | ||
2636 | } | ||
2637 | |||
2638 | static void | ||
2639 | xscale2pmu_write_int_enable(u32 val) | ||
2640 | { | ||
2641 | asm volatile("mcr p14, 0, %0, c4, c1, 0" : : "r" (val)); | ||
2642 | } | ||
2643 | |||
2644 | static inline int | ||
2645 | xscale2_pmnc_counter_has_overflowed(unsigned long of_flags, | ||
2646 | enum xscale_counters counter) | ||
2647 | { | ||
2648 | int ret = 0; | ||
2649 | |||
2650 | switch (counter) { | ||
2651 | case XSCALE_CYCLE_COUNTER: | ||
2652 | ret = of_flags & XSCALE2_CCOUNT_OVERFLOW; | ||
2653 | break; | ||
2654 | case XSCALE_COUNTER0: | ||
2655 | ret = of_flags & XSCALE2_COUNT0_OVERFLOW; | ||
2656 | break; | ||
2657 | case XSCALE_COUNTER1: | ||
2658 | ret = of_flags & XSCALE2_COUNT1_OVERFLOW; | ||
2659 | break; | ||
2660 | case XSCALE_COUNTER2: | ||
2661 | ret = of_flags & XSCALE2_COUNT2_OVERFLOW; | ||
2662 | break; | ||
2663 | case XSCALE_COUNTER3: | ||
2664 | ret = of_flags & XSCALE2_COUNT3_OVERFLOW; | ||
2665 | break; | ||
2666 | default: | ||
2667 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
2668 | } | ||
2669 | |||
2670 | return ret; | ||
2671 | } | ||
2672 | |||
2673 | static irqreturn_t | ||
2674 | xscale2pmu_handle_irq(int irq_num, void *dev) | ||
2675 | { | ||
2676 | unsigned long pmnc, of_flags; | ||
2677 | struct perf_sample_data data; | ||
2678 | struct cpu_hw_events *cpuc; | ||
2679 | struct pt_regs *regs; | ||
2680 | int idx; | ||
2681 | |||
2682 | /* Disable the PMU. */ | ||
2683 | pmnc = xscale2pmu_read_pmnc(); | ||
2684 | xscale2pmu_write_pmnc(pmnc & ~XSCALE_PMU_ENABLE); | ||
2685 | |||
2686 | /* Check the overflow flag register. */ | ||
2687 | of_flags = xscale2pmu_read_overflow_flags(); | ||
2688 | if (!(of_flags & XSCALE2_OVERFLOWED_MASK)) | ||
2689 | return IRQ_NONE; | ||
2690 | |||
2691 | /* Clear the overflow bits. */ | ||
2692 | xscale2pmu_write_overflow_flags(of_flags); | ||
2693 | |||
2694 | regs = get_irq_regs(); | ||
2695 | |||
2696 | perf_sample_data_init(&data, 0); | ||
2697 | |||
2698 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
2699 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
2700 | struct perf_event *event = cpuc->events[idx]; | ||
2701 | struct hw_perf_event *hwc; | ||
2702 | |||
2703 | if (!test_bit(idx, cpuc->active_mask)) | ||
2704 | continue; | ||
2705 | |||
2706 | if (!xscale2_pmnc_counter_has_overflowed(pmnc, idx)) | ||
2707 | continue; | ||
2708 | |||
2709 | hwc = &event->hw; | ||
2710 | armpmu_event_update(event, hwc, idx); | ||
2711 | data.period = event->hw.last_period; | ||
2712 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
2713 | continue; | ||
2714 | |||
2715 | if (perf_event_overflow(event, 0, &data, regs)) | ||
2716 | armpmu->disable(hwc, idx); | ||
2717 | } | ||
2718 | |||
2719 | perf_event_do_pending(); | ||
2720 | |||
2721 | /* | ||
2722 | * Re-enable the PMU. | ||
2723 | */ | ||
2724 | pmnc = xscale2pmu_read_pmnc() | XSCALE_PMU_ENABLE; | ||
2725 | xscale2pmu_write_pmnc(pmnc); | ||
2726 | |||
2727 | return IRQ_HANDLED; | ||
2728 | } | ||
2729 | |||
2730 | static void | ||
2731 | xscale2pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
2732 | { | ||
2733 | unsigned long flags, ien, evtsel; | ||
2734 | |||
2735 | ien = xscale2pmu_read_int_enable(); | ||
2736 | evtsel = xscale2pmu_read_event_select(); | ||
2737 | |||
2738 | switch (idx) { | ||
2739 | case XSCALE_CYCLE_COUNTER: | ||
2740 | ien |= XSCALE2_CCOUNT_INT_EN; | ||
2741 | break; | ||
2742 | case XSCALE_COUNTER0: | ||
2743 | ien |= XSCALE2_COUNT0_INT_EN; | ||
2744 | evtsel &= ~XSCALE2_COUNT0_EVT_MASK; | ||
2745 | evtsel |= hwc->config_base << XSCALE2_COUNT0_EVT_SHFT; | ||
2746 | break; | ||
2747 | case XSCALE_COUNTER1: | ||
2748 | ien |= XSCALE2_COUNT1_INT_EN; | ||
2749 | evtsel &= ~XSCALE2_COUNT1_EVT_MASK; | ||
2750 | evtsel |= hwc->config_base << XSCALE2_COUNT1_EVT_SHFT; | ||
2751 | break; | ||
2752 | case XSCALE_COUNTER2: | ||
2753 | ien |= XSCALE2_COUNT2_INT_EN; | ||
2754 | evtsel &= ~XSCALE2_COUNT2_EVT_MASK; | ||
2755 | evtsel |= hwc->config_base << XSCALE2_COUNT2_EVT_SHFT; | ||
2756 | break; | ||
2757 | case XSCALE_COUNTER3: | ||
2758 | ien |= XSCALE2_COUNT3_INT_EN; | ||
2759 | evtsel &= ~XSCALE2_COUNT3_EVT_MASK; | ||
2760 | evtsel |= hwc->config_base << XSCALE2_COUNT3_EVT_SHFT; | ||
2761 | break; | ||
2762 | default: | ||
2763 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
2764 | return; | ||
2765 | } | ||
2766 | |||
2767 | spin_lock_irqsave(&pmu_lock, flags); | ||
2768 | xscale2pmu_write_event_select(evtsel); | ||
2769 | xscale2pmu_write_int_enable(ien); | ||
2770 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2771 | } | ||
2772 | |||
2773 | static void | ||
2774 | xscale2pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
2775 | { | ||
2776 | unsigned long flags, ien, evtsel; | ||
2777 | |||
2778 | ien = xscale2pmu_read_int_enable(); | ||
2779 | evtsel = xscale2pmu_read_event_select(); | ||
2780 | |||
2781 | switch (idx) { | ||
2782 | case XSCALE_CYCLE_COUNTER: | ||
2783 | ien &= ~XSCALE2_CCOUNT_INT_EN; | ||
2784 | break; | ||
2785 | case XSCALE_COUNTER0: | ||
2786 | ien &= ~XSCALE2_COUNT0_INT_EN; | ||
2787 | evtsel &= ~XSCALE2_COUNT0_EVT_MASK; | ||
2788 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT0_EVT_SHFT; | ||
2789 | break; | ||
2790 | case XSCALE_COUNTER1: | ||
2791 | ien &= ~XSCALE2_COUNT1_INT_EN; | ||
2792 | evtsel &= ~XSCALE2_COUNT1_EVT_MASK; | ||
2793 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT1_EVT_SHFT; | ||
2794 | break; | ||
2795 | case XSCALE_COUNTER2: | ||
2796 | ien &= ~XSCALE2_COUNT2_INT_EN; | ||
2797 | evtsel &= ~XSCALE2_COUNT2_EVT_MASK; | ||
2798 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT2_EVT_SHFT; | ||
2799 | break; | ||
2800 | case XSCALE_COUNTER3: | ||
2801 | ien &= ~XSCALE2_COUNT3_INT_EN; | ||
2802 | evtsel &= ~XSCALE2_COUNT3_EVT_MASK; | ||
2803 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT3_EVT_SHFT; | ||
2804 | break; | ||
2805 | default: | ||
2806 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
2807 | return; | ||
2808 | } | ||
2809 | |||
2810 | spin_lock_irqsave(&pmu_lock, flags); | ||
2811 | xscale2pmu_write_event_select(evtsel); | ||
2812 | xscale2pmu_write_int_enable(ien); | ||
2813 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2814 | } | ||
2815 | |||
2816 | static int | ||
2817 | xscale2pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
2818 | struct hw_perf_event *event) | ||
2819 | { | ||
2820 | int idx = xscale1pmu_get_event_idx(cpuc, event); | ||
2821 | if (idx >= 0) | ||
2822 | goto out; | ||
2823 | |||
2824 | if (!test_and_set_bit(XSCALE_COUNTER3, cpuc->used_mask)) | ||
2825 | idx = XSCALE_COUNTER3; | ||
2826 | else if (!test_and_set_bit(XSCALE_COUNTER2, cpuc->used_mask)) | ||
2827 | idx = XSCALE_COUNTER2; | ||
2828 | out: | ||
2829 | return idx; | ||
2830 | } | ||
2831 | |||
2832 | static void | ||
2833 | xscale2pmu_start(void) | ||
2834 | { | ||
2835 | unsigned long flags, val; | ||
2836 | |||
2837 | spin_lock_irqsave(&pmu_lock, flags); | ||
2838 | val = xscale2pmu_read_pmnc() & ~XSCALE_PMU_CNT64; | ||
2839 | val |= XSCALE_PMU_ENABLE; | ||
2840 | xscale2pmu_write_pmnc(val); | ||
2841 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2842 | } | ||
2843 | |||
2844 | static void | ||
2845 | xscale2pmu_stop(void) | ||
2846 | { | ||
2847 | unsigned long flags, val; | ||
2848 | |||
2849 | spin_lock_irqsave(&pmu_lock, flags); | ||
2850 | val = xscale2pmu_read_pmnc(); | ||
2851 | val &= ~XSCALE_PMU_ENABLE; | ||
2852 | xscale2pmu_write_pmnc(val); | ||
2853 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
2854 | } | ||
2855 | |||
2856 | static inline u32 | ||
2857 | xscale2pmu_read_counter(int counter) | ||
2858 | { | ||
2859 | u32 val = 0; | ||
2860 | |||
2861 | switch (counter) { | ||
2862 | case XSCALE_CYCLE_COUNTER: | ||
2863 | asm volatile("mrc p14, 0, %0, c1, c1, 0" : "=r" (val)); | ||
2864 | break; | ||
2865 | case XSCALE_COUNTER0: | ||
2866 | asm volatile("mrc p14, 0, %0, c0, c2, 0" : "=r" (val)); | ||
2867 | break; | ||
2868 | case XSCALE_COUNTER1: | ||
2869 | asm volatile("mrc p14, 0, %0, c1, c2, 0" : "=r" (val)); | ||
2870 | break; | ||
2871 | case XSCALE_COUNTER2: | ||
2872 | asm volatile("mrc p14, 0, %0, c2, c2, 0" : "=r" (val)); | ||
2873 | break; | ||
2874 | case XSCALE_COUNTER3: | ||
2875 | asm volatile("mrc p14, 0, %0, c3, c2, 0" : "=r" (val)); | ||
2876 | break; | ||
2877 | } | ||
2878 | |||
2879 | return val; | ||
2880 | } | ||
2881 | |||
2882 | static inline void | ||
2883 | xscale2pmu_write_counter(int counter, u32 val) | ||
2884 | { | ||
2885 | switch (counter) { | ||
2886 | case XSCALE_CYCLE_COUNTER: | ||
2887 | asm volatile("mcr p14, 0, %0, c1, c1, 0" : : "r" (val)); | ||
2888 | break; | ||
2889 | case XSCALE_COUNTER0: | ||
2890 | asm volatile("mcr p14, 0, %0, c0, c2, 0" : : "r" (val)); | ||
2891 | break; | ||
2892 | case XSCALE_COUNTER1: | ||
2893 | asm volatile("mcr p14, 0, %0, c1, c2, 0" : : "r" (val)); | ||
2894 | break; | ||
2895 | case XSCALE_COUNTER2: | ||
2896 | asm volatile("mcr p14, 0, %0, c2, c2, 0" : : "r" (val)); | ||
2897 | break; | ||
2898 | case XSCALE_COUNTER3: | ||
2899 | asm volatile("mcr p14, 0, %0, c3, c2, 0" : : "r" (val)); | ||
2900 | break; | ||
2901 | } | ||
2902 | } | ||
2903 | |||
2904 | static const struct arm_pmu xscale2pmu = { | ||
2905 | .id = ARM_PERF_PMU_ID_XSCALE2, | ||
2906 | .handle_irq = xscale2pmu_handle_irq, | ||
2907 | .enable = xscale2pmu_enable_event, | ||
2908 | .disable = xscale2pmu_disable_event, | ||
2909 | .event_map = xscalepmu_event_map, | ||
2910 | .raw_event = xscalepmu_raw_event, | ||
2911 | .read_counter = xscale2pmu_read_counter, | ||
2912 | .write_counter = xscale2pmu_write_counter, | ||
2913 | .get_event_idx = xscale2pmu_get_event_idx, | ||
2914 | .start = xscale2pmu_start, | ||
2915 | .stop = xscale2pmu_stop, | ||
2916 | .num_events = 5, | ||
2917 | .max_period = (1LLU << 32) - 1, | ||
2918 | }; | ||
2919 | |||
2082 | static int __init | 2920 | static int __init |
2083 | init_hw_perf_events(void) | 2921 | init_hw_perf_events(void) |
2084 | { | 2922 | { |
@@ -2086,7 +2924,7 @@ init_hw_perf_events(void) | |||
2086 | unsigned long implementor = (cpuid & 0xFF000000) >> 24; | 2924 | unsigned long implementor = (cpuid & 0xFF000000) >> 24; |
2087 | unsigned long part_number = (cpuid & 0xFFF0); | 2925 | unsigned long part_number = (cpuid & 0xFFF0); |
2088 | 2926 | ||
2089 | /* We only support ARM CPUs implemented by ARM at the moment. */ | 2927 | /* ARM Ltd CPUs. */ |
2090 | if (0x41 == implementor) { | 2928 | if (0x41 == implementor) { |
2091 | switch (part_number) { | 2929 | switch (part_number) { |
2092 | case 0xB360: /* ARM1136 */ | 2930 | case 0xB360: /* ARM1136 */ |
@@ -2105,7 +2943,7 @@ init_hw_perf_events(void) | |||
2105 | perf_max_events = armv6mpcore_pmu.num_events; | 2943 | perf_max_events = armv6mpcore_pmu.num_events; |
2106 | break; | 2944 | break; |
2107 | case 0xC080: /* Cortex-A8 */ | 2945 | case 0xC080: /* Cortex-A8 */ |
2108 | armv7pmu.name = ARMV7_PMU_CORTEX_A8_NAME; | 2946 | armv7pmu.id = ARM_PERF_PMU_ID_CA8; |
2109 | memcpy(armpmu_perf_cache_map, armv7_a8_perf_cache_map, | 2947 | memcpy(armpmu_perf_cache_map, armv7_a8_perf_cache_map, |
2110 | sizeof(armv7_a8_perf_cache_map)); | 2948 | sizeof(armv7_a8_perf_cache_map)); |
2111 | armv7pmu.event_map = armv7_a8_pmu_event_map; | 2949 | armv7pmu.event_map = armv7_a8_pmu_event_map; |
@@ -2117,7 +2955,7 @@ init_hw_perf_events(void) | |||
2117 | perf_max_events = armv7pmu.num_events; | 2955 | perf_max_events = armv7pmu.num_events; |
2118 | break; | 2956 | break; |
2119 | case 0xC090: /* Cortex-A9 */ | 2957 | case 0xC090: /* Cortex-A9 */ |
2120 | armv7pmu.name = ARMV7_PMU_CORTEX_A9_NAME; | 2958 | armv7pmu.id = ARM_PERF_PMU_ID_CA9; |
2121 | memcpy(armpmu_perf_cache_map, armv7_a9_perf_cache_map, | 2959 | memcpy(armpmu_perf_cache_map, armv7_a9_perf_cache_map, |
2122 | sizeof(armv7_a9_perf_cache_map)); | 2960 | sizeof(armv7_a9_perf_cache_map)); |
2123 | armv7pmu.event_map = armv7_a9_pmu_event_map; | 2961 | armv7pmu.event_map = armv7_a9_pmu_event_map; |
@@ -2128,15 +2966,33 @@ init_hw_perf_events(void) | |||
2128 | armv7pmu.num_events = armv7_reset_read_pmnc(); | 2966 | armv7pmu.num_events = armv7_reset_read_pmnc(); |
2129 | perf_max_events = armv7pmu.num_events; | 2967 | perf_max_events = armv7pmu.num_events; |
2130 | break; | 2968 | break; |
2131 | default: | 2969 | } |
2132 | pr_info("no hardware support available\n"); | 2970 | /* Intel CPUs [xscale]. */ |
2133 | perf_max_events = -1; | 2971 | } else if (0x69 == implementor) { |
2972 | part_number = (cpuid >> 13) & 0x7; | ||
2973 | switch (part_number) { | ||
2974 | case 1: | ||
2975 | armpmu = &xscale1pmu; | ||
2976 | memcpy(armpmu_perf_cache_map, xscale_perf_cache_map, | ||
2977 | sizeof(xscale_perf_cache_map)); | ||
2978 | perf_max_events = xscale1pmu.num_events; | ||
2979 | break; | ||
2980 | case 2: | ||
2981 | armpmu = &xscale2pmu; | ||
2982 | memcpy(armpmu_perf_cache_map, xscale_perf_cache_map, | ||
2983 | sizeof(xscale_perf_cache_map)); | ||
2984 | perf_max_events = xscale2pmu.num_events; | ||
2985 | break; | ||
2134 | } | 2986 | } |
2135 | } | 2987 | } |
2136 | 2988 | ||
2137 | if (armpmu) | 2989 | if (armpmu) { |
2138 | pr_info("enabled with %s PMU driver, %d counters available\n", | 2990 | pr_info("enabled with %s PMU driver, %d counters available\n", |
2139 | armpmu->name, armpmu->num_events); | 2991 | arm_pmu_names[armpmu->id], armpmu->num_events); |
2992 | } else { | ||
2993 | pr_info("no hardware support available\n"); | ||
2994 | perf_max_events = -1; | ||
2995 | } | ||
2140 | 2996 | ||
2141 | return 0; | 2997 | return 0; |
2142 | } | 2998 | } |
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c index a124312e343f..b8af96ea62e6 100644 --- a/arch/arm/kernel/pmu.c +++ b/arch/arm/kernel/pmu.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/arch/arm/kernel/pmu.c | 2 | * linux/arch/arm/kernel/pmu.c |
3 | * | 3 | * |
4 | * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles | 4 | * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles |
5 | * Copyright (C) 2010 ARM Ltd, Will Deacon | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * 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 | * it under the terms of the GNU General Public License version 2 as |
@@ -9,65 +10,78 @@ | |||
9 | * | 10 | * |
10 | */ | 11 | */ |
11 | 12 | ||
13 | #define pr_fmt(fmt) "PMU: " fmt | ||
14 | |||
12 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
13 | #include <linux/err.h> | 16 | #include <linux/err.h> |
14 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
15 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
16 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/platform_device.h> | ||
17 | 21 | ||
18 | #include <asm/pmu.h> | 22 | #include <asm/pmu.h> |
19 | 23 | ||
20 | /* | 24 | static volatile long pmu_lock; |
21 | * Define the IRQs for the system. We could use something like a platform | 25 | |
22 | * device but that seems fairly heavyweight for this. Also, the performance | 26 | static struct platform_device *pmu_devices[ARM_NUM_PMU_DEVICES]; |
23 | * counters can't be removed or hotplugged. | 27 | |
24 | * | 28 | static int __devinit pmu_device_probe(struct platform_device *pdev) |
25 | * Ordering is important: init_pmu() will use the ordering to set the affinity | 29 | { |
26 | * to the corresponding core. e.g. the first interrupt will go to cpu 0, the | 30 | |
27 | * second goes to cpu 1 etc. | 31 | if (pdev->id < 0 || pdev->id >= ARM_NUM_PMU_DEVICES) { |
28 | */ | 32 | pr_warning("received registration request for unknown " |
29 | static const int irqs[] = { | 33 | "device %d\n", pdev->id); |
30 | #if defined(CONFIG_ARCH_OMAP2) | 34 | return -EINVAL; |
31 | 3, | 35 | } |
32 | #elif defined(CONFIG_ARCH_BCMRING) | 36 | |
33 | IRQ_PMUIRQ, | 37 | if (pmu_devices[pdev->id]) |
34 | #elif defined(CONFIG_MACH_REALVIEW_EB) | 38 | pr_warning("registering new PMU device type %d overwrites " |
35 | IRQ_EB11MP_PMU_CPU0, | 39 | "previous registration!\n", pdev->id); |
36 | IRQ_EB11MP_PMU_CPU1, | 40 | else |
37 | IRQ_EB11MP_PMU_CPU2, | 41 | pr_info("registered new PMU device of type %d\n", |
38 | IRQ_EB11MP_PMU_CPU3, | 42 | pdev->id); |
39 | #elif defined(CONFIG_ARCH_OMAP3) | ||
40 | INT_34XX_BENCH_MPU_EMUL, | ||
41 | #elif defined(CONFIG_ARCH_IOP32X) | ||
42 | IRQ_IOP32X_CORE_PMU, | ||
43 | #elif defined(CONFIG_ARCH_IOP33X) | ||
44 | IRQ_IOP33X_CORE_PMU, | ||
45 | #elif defined(CONFIG_ARCH_PXA) | ||
46 | IRQ_PMU, | ||
47 | #endif | ||
48 | }; | ||
49 | 43 | ||
50 | static const struct pmu_irqs pmu_irqs = { | 44 | pmu_devices[pdev->id] = pdev; |
51 | .irqs = irqs, | 45 | return 0; |
52 | .num_irqs = ARRAY_SIZE(irqs), | 46 | } |
47 | |||
48 | static struct platform_driver pmu_driver = { | ||
49 | .driver = { | ||
50 | .name = "arm-pmu", | ||
51 | }, | ||
52 | .probe = pmu_device_probe, | ||
53 | }; | 53 | }; |
54 | 54 | ||
55 | static volatile long pmu_lock; | 55 | static int __init register_pmu_driver(void) |
56 | { | ||
57 | return platform_driver_register(&pmu_driver); | ||
58 | } | ||
59 | device_initcall(register_pmu_driver); | ||
56 | 60 | ||
57 | const struct pmu_irqs * | 61 | struct platform_device * |
58 | reserve_pmu(void) | 62 | reserve_pmu(enum arm_pmu_type device) |
59 | { | 63 | { |
60 | return test_and_set_bit_lock(0, &pmu_lock) ? ERR_PTR(-EBUSY) : | 64 | struct platform_device *pdev; |
61 | &pmu_irqs; | 65 | |
66 | if (test_and_set_bit_lock(device, &pmu_lock)) { | ||
67 | pdev = ERR_PTR(-EBUSY); | ||
68 | } else if (pmu_devices[device] == NULL) { | ||
69 | clear_bit_unlock(device, &pmu_lock); | ||
70 | pdev = ERR_PTR(-ENODEV); | ||
71 | } else { | ||
72 | pdev = pmu_devices[device]; | ||
73 | } | ||
74 | |||
75 | return pdev; | ||
62 | } | 76 | } |
63 | EXPORT_SYMBOL_GPL(reserve_pmu); | 77 | EXPORT_SYMBOL_GPL(reserve_pmu); |
64 | 78 | ||
65 | int | 79 | int |
66 | release_pmu(const struct pmu_irqs *irqs) | 80 | release_pmu(struct platform_device *pdev) |
67 | { | 81 | { |
68 | if (WARN_ON(irqs != &pmu_irqs)) | 82 | if (WARN_ON(pdev != pmu_devices[pdev->id])) |
69 | return -EINVAL; | 83 | return -EINVAL; |
70 | clear_bit_unlock(0, &pmu_lock); | 84 | clear_bit_unlock(pdev->id, &pmu_lock); |
71 | return 0; | 85 | return 0; |
72 | } | 86 | } |
73 | EXPORT_SYMBOL_GPL(release_pmu); | 87 | EXPORT_SYMBOL_GPL(release_pmu); |
@@ -87,17 +101,42 @@ set_irq_affinity(int irq, | |||
87 | #endif | 101 | #endif |
88 | } | 102 | } |
89 | 103 | ||
90 | int | 104 | static int |
91 | init_pmu(void) | 105 | init_cpu_pmu(void) |
92 | { | 106 | { |
93 | int i, err = 0; | 107 | int i, err = 0; |
108 | struct platform_device *pdev = pmu_devices[ARM_PMU_DEVICE_CPU]; | ||
109 | |||
110 | if (!pdev) { | ||
111 | err = -ENODEV; | ||
112 | goto out; | ||
113 | } | ||
94 | 114 | ||
95 | for (i = 0; i < pmu_irqs.num_irqs; ++i) { | 115 | for (i = 0; i < pdev->num_resources; ++i) { |
96 | err = set_irq_affinity(pmu_irqs.irqs[i], i); | 116 | err = set_irq_affinity(platform_get_irq(pdev, i), i); |
97 | if (err) | 117 | if (err) |
98 | break; | 118 | break; |
99 | } | 119 | } |
100 | 120 | ||
121 | out: | ||
122 | return err; | ||
123 | } | ||
124 | |||
125 | int | ||
126 | init_pmu(enum arm_pmu_type device) | ||
127 | { | ||
128 | int err = 0; | ||
129 | |||
130 | switch (device) { | ||
131 | case ARM_PMU_DEVICE_CPU: | ||
132 | err = init_cpu_pmu(); | ||
133 | break; | ||
134 | default: | ||
135 | pr_warning("attempt to initialise unknown device %d\n", | ||
136 | device); | ||
137 | err = -EINVAL; | ||
138 | } | ||
139 | |||
101 | return err; | 140 | return err; |
102 | } | 141 | } |
103 | EXPORT_SYMBOL_GPL(init_pmu); | 142 | EXPORT_SYMBOL_GPL(init_pmu); |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index a01194e583ff..b8c3d0f689d9 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -168,7 +168,7 @@ int __cpu_disable(void) | |||
168 | struct task_struct *p; | 168 | struct task_struct *p; |
169 | int ret; | 169 | int ret; |
170 | 170 | ||
171 | ret = mach_cpu_disable(cpu); | 171 | ret = platform_cpu_disable(cpu); |
172 | if (ret) | 172 | if (ret) |
173 | return ret; | 173 | return ret; |
174 | 174 | ||
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 28753805d2d1..38c261f9951c 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
@@ -72,12 +72,15 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
72 | EXPORT_SYMBOL(profile_pc); | 72 | EXPORT_SYMBOL(profile_pc); |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | #ifndef CONFIG_GENERIC_TIME | 75 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET |
76 | static unsigned long dummy_gettimeoffset(void) | 76 | u32 arch_gettimeoffset(void) |
77 | { | 77 | { |
78 | if (system_timer->offset != NULL) | ||
79 | return system_timer->offset() * 1000; | ||
80 | |||
78 | return 0; | 81 | return 0; |
79 | } | 82 | } |
80 | #endif | 83 | #endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ |
81 | 84 | ||
82 | #ifdef CONFIG_LEDS_TIMER | 85 | #ifdef CONFIG_LEDS_TIMER |
83 | static inline void do_leds(void) | 86 | static inline void do_leds(void) |
@@ -93,63 +96,6 @@ static inline void do_leds(void) | |||
93 | #define do_leds() | 96 | #define do_leds() |
94 | #endif | 97 | #endif |
95 | 98 | ||
96 | #ifndef CONFIG_GENERIC_TIME | ||
97 | void do_gettimeofday(struct timeval *tv) | ||
98 | { | ||
99 | unsigned long flags; | ||
100 | unsigned long seq; | ||
101 | unsigned long usec, sec; | ||
102 | |||
103 | do { | ||
104 | seq = read_seqbegin_irqsave(&xtime_lock, flags); | ||
105 | usec = system_timer->offset(); | ||
106 | sec = xtime.tv_sec; | ||
107 | usec += xtime.tv_nsec / 1000; | ||
108 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); | ||
109 | |||
110 | /* usec may have gone up a lot: be safe */ | ||
111 | while (usec >= 1000000) { | ||
112 | usec -= 1000000; | ||
113 | sec++; | ||
114 | } | ||
115 | |||
116 | tv->tv_sec = sec; | ||
117 | tv->tv_usec = usec; | ||
118 | } | ||
119 | |||
120 | EXPORT_SYMBOL(do_gettimeofday); | ||
121 | |||
122 | int do_settimeofday(struct timespec *tv) | ||
123 | { | ||
124 | time_t wtm_sec, sec = tv->tv_sec; | ||
125 | long wtm_nsec, nsec = tv->tv_nsec; | ||
126 | |||
127 | if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) | ||
128 | return -EINVAL; | ||
129 | |||
130 | write_seqlock_irq(&xtime_lock); | ||
131 | /* | ||
132 | * This is revolting. We need to set "xtime" correctly. However, the | ||
133 | * value in this location is the value at the most recent update of | ||
134 | * wall time. Discover what correction gettimeofday() would have | ||
135 | * done, and then undo it! | ||
136 | */ | ||
137 | nsec -= system_timer->offset() * NSEC_PER_USEC; | ||
138 | |||
139 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); | ||
140 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); | ||
141 | |||
142 | set_normalized_timespec(&xtime, sec, nsec); | ||
143 | set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); | ||
144 | |||
145 | ntp_clear(); | ||
146 | write_sequnlock_irq(&xtime_lock); | ||
147 | clock_was_set(); | ||
148 | return 0; | ||
149 | } | ||
150 | |||
151 | EXPORT_SYMBOL(do_settimeofday); | ||
152 | #endif /* !CONFIG_GENERIC_TIME */ | ||
153 | 99 | ||
154 | #ifndef CONFIG_GENERIC_CLOCKEVENTS | 100 | #ifndef CONFIG_GENERIC_CLOCKEVENTS |
155 | /* | 101 | /* |
@@ -214,10 +160,6 @@ device_initcall(timer_init_sysfs); | |||
214 | 160 | ||
215 | void __init time_init(void) | 161 | void __init time_init(void) |
216 | { | 162 | { |
217 | #ifndef CONFIG_GENERIC_TIME | ||
218 | if (system_timer->offset == NULL) | ||
219 | system_timer->offset = dummy_gettimeoffset; | ||
220 | #endif | ||
221 | system_timer->init(); | 163 | system_timer->init(); |
222 | } | 164 | } |
223 | 165 | ||
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 2db43a5ddd9b..841eaf8f27e2 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -23,14 +23,12 @@ choice | |||
23 | config ARCH_AT91RM9200 | 23 | config ARCH_AT91RM9200 |
24 | bool "AT91RM9200" | 24 | bool "AT91RM9200" |
25 | select CPU_ARM920T | 25 | select CPU_ARM920T |
26 | select GENERIC_TIME | ||
27 | select GENERIC_CLOCKEVENTS | 26 | select GENERIC_CLOCKEVENTS |
28 | select HAVE_AT91_USART3 | 27 | select HAVE_AT91_USART3 |
29 | 28 | ||
30 | config ARCH_AT91SAM9260 | 29 | config ARCH_AT91SAM9260 |
31 | bool "AT91SAM9260 or AT91SAM9XE" | 30 | bool "AT91SAM9260 or AT91SAM9XE" |
32 | select CPU_ARM926T | 31 | select CPU_ARM926T |
33 | select GENERIC_TIME | ||
34 | select GENERIC_CLOCKEVENTS | 32 | select GENERIC_CLOCKEVENTS |
35 | select HAVE_AT91_USART3 | 33 | select HAVE_AT91_USART3 |
36 | select HAVE_AT91_USART4 | 34 | select HAVE_AT91_USART4 |
@@ -39,28 +37,24 @@ config ARCH_AT91SAM9260 | |||
39 | config ARCH_AT91SAM9261 | 37 | config ARCH_AT91SAM9261 |
40 | bool "AT91SAM9261" | 38 | bool "AT91SAM9261" |
41 | select CPU_ARM926T | 39 | select CPU_ARM926T |
42 | select GENERIC_TIME | ||
43 | select GENERIC_CLOCKEVENTS | 40 | select GENERIC_CLOCKEVENTS |
44 | select HAVE_FB_ATMEL | 41 | select HAVE_FB_ATMEL |
45 | 42 | ||
46 | config ARCH_AT91SAM9G10 | 43 | config ARCH_AT91SAM9G10 |
47 | bool "AT91SAM9G10" | 44 | bool "AT91SAM9G10" |
48 | select CPU_ARM926T | 45 | select CPU_ARM926T |
49 | select GENERIC_TIME | ||
50 | select GENERIC_CLOCKEVENTS | 46 | select GENERIC_CLOCKEVENTS |
51 | select HAVE_FB_ATMEL | 47 | select HAVE_FB_ATMEL |
52 | 48 | ||
53 | config ARCH_AT91SAM9263 | 49 | config ARCH_AT91SAM9263 |
54 | bool "AT91SAM9263" | 50 | bool "AT91SAM9263" |
55 | select CPU_ARM926T | 51 | select CPU_ARM926T |
56 | select GENERIC_TIME | ||
57 | select GENERIC_CLOCKEVENTS | 52 | select GENERIC_CLOCKEVENTS |
58 | select HAVE_FB_ATMEL | 53 | select HAVE_FB_ATMEL |
59 | 54 | ||
60 | config ARCH_AT91SAM9RL | 55 | config ARCH_AT91SAM9RL |
61 | bool "AT91SAM9RL" | 56 | bool "AT91SAM9RL" |
62 | select CPU_ARM926T | 57 | select CPU_ARM926T |
63 | select GENERIC_TIME | ||
64 | select GENERIC_CLOCKEVENTS | 58 | select GENERIC_CLOCKEVENTS |
65 | select HAVE_AT91_USART3 | 59 | select HAVE_AT91_USART3 |
66 | select HAVE_FB_ATMEL | 60 | select HAVE_FB_ATMEL |
@@ -68,7 +62,6 @@ config ARCH_AT91SAM9RL | |||
68 | config ARCH_AT91SAM9G20 | 62 | config ARCH_AT91SAM9G20 |
69 | bool "AT91SAM9G20" | 63 | bool "AT91SAM9G20" |
70 | select CPU_ARM926T | 64 | select CPU_ARM926T |
71 | select GENERIC_TIME | ||
72 | select GENERIC_CLOCKEVENTS | 65 | select GENERIC_CLOCKEVENTS |
73 | select HAVE_AT91_USART3 | 66 | select HAVE_AT91_USART3 |
74 | select HAVE_AT91_USART4 | 67 | select HAVE_AT91_USART4 |
@@ -77,7 +70,6 @@ config ARCH_AT91SAM9G20 | |||
77 | config ARCH_AT91SAM9G45 | 70 | config ARCH_AT91SAM9G45 |
78 | bool "AT91SAM9G45" | 71 | bool "AT91SAM9G45" |
79 | select CPU_ARM926T | 72 | select CPU_ARM926T |
80 | select GENERIC_TIME | ||
81 | select GENERIC_CLOCKEVENTS | 73 | select GENERIC_CLOCKEVENTS |
82 | select HAVE_AT91_USART3 | 74 | select HAVE_AT91_USART3 |
83 | select HAVE_FB_ATMEL | 75 | select HAVE_FB_ATMEL |
@@ -85,18 +77,17 @@ config ARCH_AT91SAM9G45 | |||
85 | config ARCH_AT91CAP9 | 77 | config ARCH_AT91CAP9 |
86 | bool "AT91CAP9" | 78 | bool "AT91CAP9" |
87 | select CPU_ARM926T | 79 | select CPU_ARM926T |
88 | select GENERIC_TIME | ||
89 | select GENERIC_CLOCKEVENTS | 80 | select GENERIC_CLOCKEVENTS |
90 | select HAVE_FB_ATMEL | 81 | select HAVE_FB_ATMEL |
91 | 82 | ||
92 | config ARCH_AT572D940HF | 83 | config ARCH_AT572D940HF |
93 | bool "AT572D940HF" | 84 | bool "AT572D940HF" |
94 | select CPU_ARM926T | 85 | select CPU_ARM926T |
95 | select GENERIC_TIME | ||
96 | select GENERIC_CLOCKEVENTS | 86 | select GENERIC_CLOCKEVENTS |
97 | 87 | ||
98 | config ARCH_AT91X40 | 88 | config ARCH_AT91X40 |
99 | bool "AT91x40" | 89 | bool "AT91x40" |
90 | select ARCH_USES_GETTIMEOFFSET | ||
100 | 91 | ||
101 | endchoice | 92 | endchoice |
102 | 93 | ||
@@ -360,6 +351,19 @@ config MACH_CPU9G20 | |||
360 | Select this if you are using a Eukrea Electromatique's | 351 | Select this if you are using a Eukrea Electromatique's |
361 | CPU9G20 Board <http://www.eukrea.com/> | 352 | CPU9G20 Board <http://www.eukrea.com/> |
362 | 353 | ||
354 | config MACH_PORTUXG20 | ||
355 | bool "taskit PortuxG20" | ||
356 | help | ||
357 | Select this if you are using taskit's PortuxG20. | ||
358 | <http://www.taskit.de/en/> | ||
359 | |||
360 | config MACH_STAMP9G20 | ||
361 | bool "taskit Stamp9G20 CPU module" | ||
362 | help | ||
363 | Select this if you are using taskit's Stamp9G20 CPU module on its | ||
364 | evaluation board. | ||
365 | <http://www.taskit.de/en/> | ||
366 | |||
363 | endif | 367 | endif |
364 | 368 | ||
365 | # ---------------------------------------------------------- | 369 | # ---------------------------------------------------------- |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index d4004557532a..c1f821e58222 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -63,6 +63,8 @@ obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o | |||
63 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o | 63 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o |
64 | obj-$(CONFIG_MACH_AT91SAM9G20EK_2MMC) += board-sam9g20ek-2slot-mmc.o | 64 | obj-$(CONFIG_MACH_AT91SAM9G20EK_2MMC) += board-sam9g20ek-2slot-mmc.o |
65 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o | 65 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o |
66 | obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o | ||
67 | obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o | ||
66 | 68 | ||
67 | # AT91SAM9G45 board-specific support | 69 | # AT91SAM9G45 board-specific support |
68 | obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o | 70 | obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o |
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c new file mode 100644 index 000000000000..87958274290f --- /dev/null +++ b/arch/arm/mach-at91/board-stamp9g20.c | |||
@@ -0,0 +1,315 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de> | ||
3 | * taskit GmbH | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
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 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/mm.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/gpio.h> | ||
23 | #include <linux/w1-gpio.h> | ||
24 | |||
25 | #include <asm/mach-types.h> | ||
26 | #include <asm/mach/arch.h> | ||
27 | |||
28 | #include <mach/board.h> | ||
29 | #include <mach/at91sam9_smc.h> | ||
30 | |||
31 | #include "sam9_smc.h" | ||
32 | #include "generic.h" | ||
33 | |||
34 | |||
35 | static void __init portuxg20_map_io(void) | ||
36 | { | ||
37 | /* Initialize processor: 18.432 MHz crystal */ | ||
38 | at91sam9260_initialize(18432000); | ||
39 | |||
40 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
41 | at91_register_uart(0, 0, 0); | ||
42 | |||
43 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
44 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
45 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ||
46 | | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
47 | |||
48 | /* USART1 on ttyS2. (Rx, Tx, CTS, RTS) */ | ||
49 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
50 | |||
51 | /* USART2 on ttyS3. (Rx, Tx, CTS, RTS) */ | ||
52 | at91_register_uart(AT91SAM9260_ID_US2, 3, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
53 | |||
54 | /* USART4 on ttyS5. (Rx, Tx only) */ | ||
55 | at91_register_uart(AT91SAM9260_ID_US4, 5, 0); | ||
56 | |||
57 | /* USART5 on ttyS6. (Rx, Tx only) */ | ||
58 | at91_register_uart(AT91SAM9260_ID_US5, 6, 0); | ||
59 | |||
60 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
61 | at91_set_serial_console(0); | ||
62 | } | ||
63 | |||
64 | static void __init stamp9g20_map_io(void) | ||
65 | { | ||
66 | /* Initialize processor: 18.432 MHz crystal */ | ||
67 | at91sam9260_initialize(18432000); | ||
68 | |||
69 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
70 | at91_register_uart(0, 0, 0); | ||
71 | |||
72 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
73 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
74 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ||
75 | | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
76 | |||
77 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
78 | at91_set_serial_console(0); | ||
79 | } | ||
80 | |||
81 | static void __init init_irq(void) | ||
82 | { | ||
83 | at91sam9260_init_interrupts(NULL); | ||
84 | } | ||
85 | |||
86 | |||
87 | /* | ||
88 | * NAND flash | ||
89 | */ | ||
90 | static struct atmel_nand_data __initdata nand_data = { | ||
91 | .ale = 21, | ||
92 | .cle = 22, | ||
93 | .rdy_pin = AT91_PIN_PC13, | ||
94 | .enable_pin = AT91_PIN_PC14, | ||
95 | .bus_width_16 = 0, | ||
96 | }; | ||
97 | |||
98 | static struct sam9_smc_config __initdata nand_smc_config = { | ||
99 | .ncs_read_setup = 0, | ||
100 | .nrd_setup = 2, | ||
101 | .ncs_write_setup = 0, | ||
102 | .nwe_setup = 2, | ||
103 | |||
104 | .ncs_read_pulse = 4, | ||
105 | .nrd_pulse = 4, | ||
106 | .ncs_write_pulse = 4, | ||
107 | .nwe_pulse = 4, | ||
108 | |||
109 | .read_cycle = 7, | ||
110 | .write_cycle = 7, | ||
111 | |||
112 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, | ||
113 | .tdf_cycles = 3, | ||
114 | }; | ||
115 | |||
116 | static void __init add_device_nand(void) | ||
117 | { | ||
118 | /* configure chip-select 3 (NAND) */ | ||
119 | sam9_smc_configure(3, &nand_smc_config); | ||
120 | |||
121 | at91_add_device_nand(&nand_data); | ||
122 | } | ||
123 | |||
124 | |||
125 | /* | ||
126 | * MCI (SD/MMC) | ||
127 | * det_pin, wp_pin and vcc_pin are not connected | ||
128 | */ | ||
129 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
130 | static struct mci_platform_data __initdata mmc_data = { | ||
131 | .slot[0] = { | ||
132 | .bus_width = 4, | ||
133 | }, | ||
134 | }; | ||
135 | #else | ||
136 | static struct at91_mmc_data __initdata mmc_data = { | ||
137 | .slot_b = 0, | ||
138 | .wire4 = 1, | ||
139 | }; | ||
140 | #endif | ||
141 | |||
142 | |||
143 | /* | ||
144 | * USB Host port | ||
145 | */ | ||
146 | static struct at91_usbh_data __initdata usbh_data = { | ||
147 | .ports = 2, | ||
148 | }; | ||
149 | |||
150 | |||
151 | /* | ||
152 | * USB Device port | ||
153 | */ | ||
154 | static struct at91_udc_data __initdata portuxg20_udc_data = { | ||
155 | .vbus_pin = AT91_PIN_PC7, | ||
156 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
157 | }; | ||
158 | |||
159 | static struct at91_udc_data __initdata stamp9g20_udc_data = { | ||
160 | .vbus_pin = AT91_PIN_PA22, | ||
161 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
162 | }; | ||
163 | |||
164 | |||
165 | /* | ||
166 | * MACB Ethernet device | ||
167 | */ | ||
168 | static struct at91_eth_data __initdata macb_data = { | ||
169 | .phy_irq_pin = AT91_PIN_PA28, | ||
170 | .is_rmii = 1, | ||
171 | }; | ||
172 | |||
173 | |||
174 | /* | ||
175 | * LEDs | ||
176 | */ | ||
177 | static struct gpio_led portuxg20_leds[] = { | ||
178 | { | ||
179 | .name = "LED2", | ||
180 | .gpio = AT91_PIN_PC5, | ||
181 | .default_trigger = "none", | ||
182 | }, { | ||
183 | .name = "LED3", | ||
184 | .gpio = AT91_PIN_PC4, | ||
185 | .default_trigger = "none", | ||
186 | }, { | ||
187 | .name = "LED4", | ||
188 | .gpio = AT91_PIN_PC10, | ||
189 | .default_trigger = "heartbeat", | ||
190 | } | ||
191 | }; | ||
192 | |||
193 | static struct gpio_led stamp9g20_leds[] = { | ||
194 | { | ||
195 | .name = "D8", | ||
196 | .gpio = AT91_PIN_PB18, | ||
197 | .active_low = 1, | ||
198 | .default_trigger = "none", | ||
199 | }, { | ||
200 | .name = "D9", | ||
201 | .gpio = AT91_PIN_PB19, | ||
202 | .active_low = 1, | ||
203 | .default_trigger = "none", | ||
204 | }, { | ||
205 | .name = "D10", | ||
206 | .gpio = AT91_PIN_PB20, | ||
207 | .active_low = 1, | ||
208 | .default_trigger = "heartbeat", | ||
209 | } | ||
210 | }; | ||
211 | |||
212 | |||
213 | /* | ||
214 | * SPI devices | ||
215 | */ | ||
216 | static struct spi_board_info portuxg20_spi_devices[] = { | ||
217 | { | ||
218 | .modalias = "spidev", | ||
219 | .chip_select = 0, | ||
220 | .max_speed_hz = 1 * 1000 * 1000, | ||
221 | .bus_num = 0, | ||
222 | }, { | ||
223 | .modalias = "spidev", | ||
224 | .chip_select = 0, | ||
225 | .max_speed_hz = 1 * 1000 * 1000, | ||
226 | .bus_num = 1, | ||
227 | }, | ||
228 | }; | ||
229 | |||
230 | |||
231 | /* | ||
232 | * Dallas 1-Wire | ||
233 | */ | ||
234 | static struct w1_gpio_platform_data w1_gpio_pdata = { | ||
235 | .pin = AT91_PIN_PA29, | ||
236 | .is_open_drain = 1, | ||
237 | }; | ||
238 | |||
239 | static struct platform_device w1_device = { | ||
240 | .name = "w1-gpio", | ||
241 | .id = -1, | ||
242 | .dev.platform_data = &w1_gpio_pdata, | ||
243 | }; | ||
244 | |||
245 | void add_w1(void) | ||
246 | { | ||
247 | at91_set_GPIO_periph(w1_gpio_pdata.pin, 1); | ||
248 | at91_set_multi_drive(w1_gpio_pdata.pin, 1); | ||
249 | platform_device_register(&w1_device); | ||
250 | } | ||
251 | |||
252 | |||
253 | static void __init generic_board_init(void) | ||
254 | { | ||
255 | /* Serial */ | ||
256 | at91_add_device_serial(); | ||
257 | /* NAND */ | ||
258 | add_device_nand(); | ||
259 | /* MMC */ | ||
260 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
261 | at91_add_device_mci(0, &mmc_data); | ||
262 | #else | ||
263 | at91_add_device_mmc(0, &mmc_data); | ||
264 | #endif | ||
265 | /* USB Host */ | ||
266 | at91_add_device_usbh(&usbh_data); | ||
267 | /* Ethernet */ | ||
268 | at91_add_device_eth(&macb_data); | ||
269 | /* I2C */ | ||
270 | at91_add_device_i2c(NULL, 0); | ||
271 | /* W1 */ | ||
272 | add_w1(); | ||
273 | } | ||
274 | |||
275 | static void __init portuxg20_board_init(void) | ||
276 | { | ||
277 | generic_board_init(); | ||
278 | /* SPI */ | ||
279 | at91_add_device_spi(portuxg20_spi_devices, ARRAY_SIZE(portuxg20_spi_devices)); | ||
280 | /* USB Device */ | ||
281 | at91_add_device_udc(&portuxg20_udc_data); | ||
282 | /* LEDs */ | ||
283 | at91_gpio_leds(portuxg20_leds, ARRAY_SIZE(portuxg20_leds)); | ||
284 | } | ||
285 | |||
286 | static void __init stamp9g20_board_init(void) | ||
287 | { | ||
288 | generic_board_init(); | ||
289 | /* USB Device */ | ||
290 | at91_add_device_udc(&stamp9g20_udc_data); | ||
291 | /* LEDs */ | ||
292 | at91_gpio_leds(stamp9g20_leds, ARRAY_SIZE(stamp9g20_leds)); | ||
293 | } | ||
294 | |||
295 | MACHINE_START(PORTUXG20, "taskit PortuxG20") | ||
296 | /* Maintainer: taskit GmbH */ | ||
297 | .phys_io = AT91_BASE_SYS, | ||
298 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
299 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
300 | .timer = &at91sam926x_timer, | ||
301 | .map_io = portuxg20_map_io, | ||
302 | .init_irq = init_irq, | ||
303 | .init_machine = portuxg20_board_init, | ||
304 | MACHINE_END | ||
305 | |||
306 | MACHINE_START(STAMP9G20, "taskit Stamp9G20") | ||
307 | /* Maintainer: taskit GmbH */ | ||
308 | .phys_io = AT91_BASE_SYS, | ||
309 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
310 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
311 | .timer = &at91sam926x_timer, | ||
312 | .map_io = stamp9g20_map_io, | ||
313 | .init_irq = init_irq, | ||
314 | .init_machine = stamp9g20_board_init, | ||
315 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index ceaec6c16eb2..df2ed848c9f8 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/usb/atmel_usba_udc.h> | 39 | #include <linux/usb/atmel_usba_udc.h> |
40 | #include <linux/atmel-mci.h> | 40 | #include <linux/atmel-mci.h> |
41 | #include <sound/atmel-ac97c.h> | 41 | #include <sound/atmel-ac97c.h> |
42 | #include <linux/serial.h> | ||
42 | 43 | ||
43 | /* USB Device */ | 44 | /* USB Device */ |
44 | struct at91_udc_data { | 45 | struct at91_udc_data { |
@@ -143,9 +144,10 @@ extern struct platform_device *atmel_default_console_device; | |||
143 | extern void __init __deprecated at91_init_serial(struct at91_uart_config *config); | 144 | extern void __init __deprecated at91_init_serial(struct at91_uart_config *config); |
144 | 145 | ||
145 | struct atmel_uart_data { | 146 | struct atmel_uart_data { |
146 | short use_dma_tx; /* use transmit DMA? */ | 147 | short use_dma_tx; /* use transmit DMA? */ |
147 | short use_dma_rx; /* use receive DMA? */ | 148 | short use_dma_rx; /* use receive DMA? */ |
148 | void __iomem *regs; /* virtual base address, if any */ | 149 | void __iomem *regs; /* virt. base address, if any */ |
150 | struct serial_rs485 rs485; /* rs485 settings */ | ||
149 | }; | 151 | }; |
150 | extern void __init at91_add_device_serial(void); | 152 | extern void __init at91_add_device_serial(void); |
151 | 153 | ||
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h index 5a0650101d45..833659d1200a 100644 --- a/arch/arm/mach-at91/include/mach/cpu.h +++ b/arch/arm/mach-at91/include/mach/cpu.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #define ARCH_ID_AT91SAM9260 0x019803a0 | 21 | #define ARCH_ID_AT91SAM9260 0x019803a0 |
22 | #define ARCH_ID_AT91SAM9261 0x019703a0 | 22 | #define ARCH_ID_AT91SAM9261 0x019703a0 |
23 | #define ARCH_ID_AT91SAM9263 0x019607a0 | 23 | #define ARCH_ID_AT91SAM9263 0x019607a0 |
24 | #define ARCH_ID_AT91SAM9G10 0x819903a0 | 24 | #define ARCH_ID_AT91SAM9G10 0x019903a0 |
25 | #define ARCH_ID_AT91SAM9G20 0x019905a0 | 25 | #define ARCH_ID_AT91SAM9G20 0x019905a0 |
26 | #define ARCH_ID_AT91SAM9RL64 0x019b03a0 | 26 | #define ARCH_ID_AT91SAM9RL64 0x019b03a0 |
27 | #define ARCH_ID_AT91SAM9G45 0x819b05a0 | 27 | #define ARCH_ID_AT91SAM9G45 0x819b05a0 |
@@ -108,7 +108,7 @@ static inline unsigned long at91cap9_rev_identify(void) | |||
108 | #endif | 108 | #endif |
109 | 109 | ||
110 | #ifdef CONFIG_ARCH_AT91SAM9G10 | 110 | #ifdef CONFIG_ARCH_AT91SAM9G10 |
111 | #define cpu_is_at91sam9g10() (at91_cpu_identify() == ARCH_ID_AT91SAM9G10) | 111 | #define cpu_is_at91sam9g10() ((at91_cpu_identify() & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) |
112 | #else | 112 | #else |
113 | #define cpu_is_at91sam9g10() (0) | 113 | #define cpu_is_at91sam9g10() (0) |
114 | #endif | 114 | #endif |
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h index 5268af3933c2..c80e090b3670 100644 --- a/arch/arm/mach-at91/include/mach/system.h +++ b/arch/arm/mach-at91/include/mach/system.h | |||
@@ -24,21 +24,24 @@ | |||
24 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
25 | #include <mach/at91_st.h> | 25 | #include <mach/at91_st.h> |
26 | #include <mach/at91_dbgu.h> | 26 | #include <mach/at91_dbgu.h> |
27 | #include <mach/at91_pmc.h> | ||
27 | 28 | ||
28 | static inline void arch_idle(void) | 29 | static inline void arch_idle(void) |
29 | { | 30 | { |
31 | #ifndef CONFIG_DEBUG_KERNEL | ||
30 | /* | 32 | /* |
31 | * Disable the processor clock. The processor will be automatically | 33 | * Disable the processor clock. The processor will be automatically |
32 | * re-enabled by an interrupt or by a reset. | 34 | * re-enabled by an interrupt or by a reset. |
33 | */ | 35 | */ |
34 | // at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | 36 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); |
35 | 37 | #else | |
36 | /* | 38 | /* |
37 | * Set the processor (CP15) into 'Wait for Interrupt' mode. | 39 | * Set the processor (CP15) into 'Wait for Interrupt' mode. |
38 | * Unlike disabling the processor clock via the PMC (above) | 40 | * Unlike disabling the processor clock via the PMC (above) |
39 | * this allows the processor to be woken via JTAG. | 41 | * this allows the processor to be woken via JTAG. |
40 | */ | 42 | */ |
41 | cpu_do_idle(); | 43 | cpu_do_idle(); |
44 | #endif | ||
42 | } | 45 | } |
43 | 46 | ||
44 | void (*at91_arch_reset)(void); | 47 | void (*at91_arch_reset)(void); |
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c index 53dd2a9eecf9..2f139196d63d 100644 --- a/arch/arm/mach-bcmring/arch.c +++ b/arch/arm/mach-bcmring/arch.c | |||
@@ -29,6 +29,7 @@ | |||
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> | ||
32 | 33 | ||
33 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
34 | #include <mach/dma.h> | 35 | #include <mach/dma.h> |
@@ -85,8 +86,23 @@ static struct platform_device nand_device = { | |||
85 | .num_resources = ARRAY_SIZE(nand_resource), | 86 | .num_resources = ARRAY_SIZE(nand_resource), |
86 | }; | 87 | }; |
87 | 88 | ||
89 | static struct resource pmu_resource = { | ||
90 | .start = IRQ_PMUIRQ, | ||
91 | .end = IRQ_PMUIRQ, | ||
92 | .flags = IORESOURCE_IRQ, | ||
93 | }; | ||
94 | |||
95 | static struct platform_device pmu_device = { | ||
96 | .name = "arm-pmu", | ||
97 | .id = ARM_PMU_DEVICE_CPU, | ||
98 | .resource = &pmu_resource, | ||
99 | .num_resources = 1, | ||
100 | }; | ||
101 | |||
102 | |||
88 | static struct platform_device *devices[] __initdata = { | 103 | static struct platform_device *devices[] __initdata = { |
89 | &nand_device, | 104 | &nand_device, |
105 | &pmu_device, | ||
90 | }; | 106 | }; |
91 | 107 | ||
92 | /**************************************************************************** | 108 | /**************************************************************************** |
diff --git a/arch/arm/mach-clps711x/mm.c b/arch/arm/mach-clps711x/mm.c index a7b4591205a3..986592176767 100644 --- a/arch/arm/mach-clps711x/mm.c +++ b/arch/arm/mach-clps711x/mm.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/bootmem.h> | ||
26 | 25 | ||
27 | #include <asm/sizes.h> | 26 | #include <asm/sizes.h> |
28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig new file mode 100644 index 000000000000..9ebfcc46feb1 --- /dev/null +++ b/arch/arm/mach-cns3xxx/Kconfig | |||
@@ -0,0 +1,12 @@ | |||
1 | menu "CNS3XXX platform type" | ||
2 | depends on ARCH_CNS3XXX | ||
3 | |||
4 | config MACH_CNS3420VB | ||
5 | bool "Support for CNS3420 Validation Board" | ||
6 | help | ||
7 | Include support for the Cavium Networks CNS3420 MPCore Platform | ||
8 | Baseboard. | ||
9 | This is a platform with an on-board ARM11 MPCore and has support | ||
10 | for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, etc. | ||
11 | |||
12 | endmenu | ||
diff --git a/arch/arm/mach-cns3xxx/Makefile b/arch/arm/mach-cns3xxx/Makefile new file mode 100644 index 000000000000..427507a2d696 --- /dev/null +++ b/arch/arm/mach-cns3xxx/Makefile | |||
@@ -0,0 +1,2 @@ | |||
1 | obj-$(CONFIG_ARCH_CNS3XXX) += core.o pm.o | ||
2 | obj-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o | ||
diff --git a/arch/arm/mach-cns3xxx/Makefile.boot b/arch/arm/mach-cns3xxx/Makefile.boot new file mode 100644 index 000000000000..777012865220 --- /dev/null +++ b/arch/arm/mach-cns3xxx/Makefile.boot | |||
@@ -0,0 +1,3 @@ | |||
1 | zreladdr-y := 0x00008000 | ||
2 | params_phys-y := 0x00000100 | ||
3 | initrd_phys-y := 0x00C00000 | ||
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c new file mode 100644 index 000000000000..2e30c8288740 --- /dev/null +++ b/arch/arm/mach-cns3xxx/cns3420vb.c | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | * Cavium Networks CNS3420 Validation Board | ||
3 | * | ||
4 | * Copyright 2000 Deep Blue Solutions Ltd | ||
5 | * Copyright 2008 ARM Limited | ||
6 | * Copyright 2008 Cavium Networks | ||
7 | * Scott Shu | ||
8 | * Copyright 2010 MontaVista Software, LLC. | ||
9 | * Anton Vorontsov <avorontsov@mvista.com> | ||
10 | * | ||
11 | * This file 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/init.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/compiler.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <linux/serial_core.h> | ||
21 | #include <linux/serial_8250.h> | ||
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/mtd/mtd.h> | ||
24 | #include <linux/mtd/physmap.h> | ||
25 | #include <linux/mtd/partitions.h> | ||
26 | #include <asm/setup.h> | ||
27 | #include <asm/mach-types.h> | ||
28 | #include <asm/mach/arch.h> | ||
29 | #include <asm/mach/map.h> | ||
30 | #include <asm/mach/time.h> | ||
31 | #include <mach/hardware.h> | ||
32 | #include <mach/cns3xxx.h> | ||
33 | #include <mach/irqs.h> | ||
34 | #include "core.h" | ||
35 | |||
36 | /* | ||
37 | * NOR Flash | ||
38 | */ | ||
39 | static struct mtd_partition cns3420_nor_partitions[] = { | ||
40 | { | ||
41 | .name = "uboot", | ||
42 | .size = 0x00040000, | ||
43 | .offset = 0, | ||
44 | .mask_flags = MTD_WRITEABLE, | ||
45 | }, { | ||
46 | .name = "kernel", | ||
47 | .size = 0x004C0000, | ||
48 | .offset = MTDPART_OFS_APPEND, | ||
49 | }, { | ||
50 | .name = "filesystem", | ||
51 | .size = 0x7000000, | ||
52 | .offset = MTDPART_OFS_APPEND, | ||
53 | }, { | ||
54 | .name = "filesystem2", | ||
55 | .size = 0x0AE0000, | ||
56 | .offset = MTDPART_OFS_APPEND, | ||
57 | }, { | ||
58 | .name = "ubootenv", | ||
59 | .size = MTDPART_SIZ_FULL, | ||
60 | .offset = MTDPART_OFS_APPEND, | ||
61 | }, | ||
62 | }; | ||
63 | |||
64 | static struct physmap_flash_data cns3420_nor_pdata = { | ||
65 | .width = 2, | ||
66 | .parts = cns3420_nor_partitions, | ||
67 | .nr_parts = ARRAY_SIZE(cns3420_nor_partitions), | ||
68 | }; | ||
69 | |||
70 | static struct resource cns3420_nor_res = { | ||
71 | .start = CNS3XXX_FLASH_BASE, | ||
72 | .end = CNS3XXX_FLASH_BASE + SZ_128M - 1, | ||
73 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT, | ||
74 | }; | ||
75 | |||
76 | static struct platform_device cns3420_nor_pdev = { | ||
77 | .name = "physmap-flash", | ||
78 | .id = 0, | ||
79 | .resource = &cns3420_nor_res, | ||
80 | .num_resources = 1, | ||
81 | .dev = { | ||
82 | .platform_data = &cns3420_nor_pdata, | ||
83 | }, | ||
84 | }; | ||
85 | |||
86 | /* | ||
87 | * UART | ||
88 | */ | ||
89 | static void __init cns3420_early_serial_setup(void) | ||
90 | { | ||
91 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
92 | static struct uart_port cns3420_serial_port = { | ||
93 | .membase = (void __iomem *)CNS3XXX_UART0_BASE_VIRT, | ||
94 | .mapbase = CNS3XXX_UART0_BASE, | ||
95 | .irq = IRQ_CNS3XXX_UART0, | ||
96 | .iotype = UPIO_MEM, | ||
97 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
98 | .regshift = 2, | ||
99 | .uartclk = 24000000, | ||
100 | .line = 0, | ||
101 | .type = PORT_16550A, | ||
102 | .fifosize = 16, | ||
103 | }; | ||
104 | |||
105 | early_serial_setup(&cns3420_serial_port); | ||
106 | #endif | ||
107 | } | ||
108 | |||
109 | /* | ||
110 | * Initialization | ||
111 | */ | ||
112 | static struct platform_device *cns3420_pdevs[] __initdata = { | ||
113 | &cns3420_nor_pdev, | ||
114 | }; | ||
115 | |||
116 | static void __init cns3420_init(void) | ||
117 | { | ||
118 | platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs)); | ||
119 | |||
120 | pm_power_off = cns3xxx_power_off; | ||
121 | } | ||
122 | |||
123 | static struct map_desc cns3420_io_desc[] __initdata = { | ||
124 | { | ||
125 | .virtual = CNS3XXX_UART0_BASE_VIRT, | ||
126 | .pfn = __phys_to_pfn(CNS3XXX_UART0_BASE), | ||
127 | .length = SZ_4K, | ||
128 | .type = MT_DEVICE, | ||
129 | }, | ||
130 | }; | ||
131 | |||
132 | static void __init cns3420_map_io(void) | ||
133 | { | ||
134 | cns3xxx_map_io(); | ||
135 | iotable_init(cns3420_io_desc, ARRAY_SIZE(cns3420_io_desc)); | ||
136 | |||
137 | cns3420_early_serial_setup(); | ||
138 | } | ||
139 | |||
140 | MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board") | ||
141 | .phys_io = CNS3XXX_UART0_BASE, | ||
142 | .io_pg_offst = (CNS3XXX_UART0_BASE_VIRT >> 18) & 0xfffc, | ||
143 | .boot_params = 0x00000100, | ||
144 | .map_io = cns3420_map_io, | ||
145 | .init_irq = cns3xxx_init_irq, | ||
146 | .timer = &cns3xxx_timer, | ||
147 | .init_machine = cns3420_init, | ||
148 | MACHINE_END | ||
diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c new file mode 100644 index 000000000000..9ca4d581016f --- /dev/null +++ b/arch/arm/mach-cns3xxx/core.c | |||
@@ -0,0 +1,249 @@ | |||
1 | /* | ||
2 | * Copyright 1999 - 2003 ARM Limited | ||
3 | * Copyright 2000 Deep Blue Solutions Ltd | ||
4 | * Copyright 2008 Cavium Networks | ||
5 | * | ||
6 | * This file is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License, Version 2, as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/interrupt.h> | ||
13 | #include <linux/clockchips.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <asm/mach/map.h> | ||
16 | #include <asm/mach/time.h> | ||
17 | #include <asm/mach/irq.h> | ||
18 | #include <asm/hardware/gic.h> | ||
19 | #include <mach/cns3xxx.h> | ||
20 | #include "core.h" | ||
21 | |||
22 | static struct map_desc cns3xxx_io_desc[] __initdata = { | ||
23 | { | ||
24 | .virtual = CNS3XXX_TC11MP_TWD_BASE_VIRT, | ||
25 | .pfn = __phys_to_pfn(CNS3XXX_TC11MP_TWD_BASE), | ||
26 | .length = SZ_4K, | ||
27 | .type = MT_DEVICE, | ||
28 | }, { | ||
29 | .virtual = CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT, | ||
30 | .pfn = __phys_to_pfn(CNS3XXX_TC11MP_GIC_CPU_BASE), | ||
31 | .length = SZ_4K, | ||
32 | .type = MT_DEVICE, | ||
33 | }, { | ||
34 | .virtual = CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT, | ||
35 | .pfn = __phys_to_pfn(CNS3XXX_TC11MP_GIC_DIST_BASE), | ||
36 | .length = SZ_4K, | ||
37 | .type = MT_DEVICE, | ||
38 | }, { | ||
39 | .virtual = CNS3XXX_TIMER1_2_3_BASE_VIRT, | ||
40 | .pfn = __phys_to_pfn(CNS3XXX_TIMER1_2_3_BASE), | ||
41 | .length = SZ_4K, | ||
42 | .type = MT_DEVICE, | ||
43 | }, { | ||
44 | .virtual = CNS3XXX_GPIOA_BASE_VIRT, | ||
45 | .pfn = __phys_to_pfn(CNS3XXX_GPIOA_BASE), | ||
46 | .length = SZ_4K, | ||
47 | .type = MT_DEVICE, | ||
48 | }, { | ||
49 | .virtual = CNS3XXX_GPIOB_BASE_VIRT, | ||
50 | .pfn = __phys_to_pfn(CNS3XXX_GPIOB_BASE), | ||
51 | .length = SZ_4K, | ||
52 | .type = MT_DEVICE, | ||
53 | }, { | ||
54 | .virtual = CNS3XXX_MISC_BASE_VIRT, | ||
55 | .pfn = __phys_to_pfn(CNS3XXX_MISC_BASE), | ||
56 | .length = SZ_4K, | ||
57 | .type = MT_DEVICE, | ||
58 | }, { | ||
59 | .virtual = CNS3XXX_PM_BASE_VIRT, | ||
60 | .pfn = __phys_to_pfn(CNS3XXX_PM_BASE), | ||
61 | .length = SZ_4K, | ||
62 | .type = MT_DEVICE, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | void __init cns3xxx_map_io(void) | ||
67 | { | ||
68 | iotable_init(cns3xxx_io_desc, ARRAY_SIZE(cns3xxx_io_desc)); | ||
69 | } | ||
70 | |||
71 | /* used by entry-macro.S */ | ||
72 | void __iomem *gic_cpu_base_addr; | ||
73 | |||
74 | void __init cns3xxx_init_irq(void) | ||
75 | { | ||
76 | gic_cpu_base_addr = __io(CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT); | ||
77 | gic_dist_init(0, __io(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT), 29); | ||
78 | gic_cpu_init(0, gic_cpu_base_addr); | ||
79 | } | ||
80 | |||
81 | void cns3xxx_power_off(void) | ||
82 | { | ||
83 | u32 __iomem *pm_base = __io(CNS3XXX_PM_BASE_VIRT); | ||
84 | u32 clkctrl; | ||
85 | |||
86 | printk(KERN_INFO "powering system down...\n"); | ||
87 | |||
88 | clkctrl = readl(pm_base + PM_SYS_CLK_CTRL_OFFSET); | ||
89 | clkctrl &= 0xfffff1ff; | ||
90 | clkctrl |= (0x5 << 9); /* Hibernate */ | ||
91 | writel(clkctrl, pm_base + PM_SYS_CLK_CTRL_OFFSET); | ||
92 | |||
93 | } | ||
94 | |||
95 | /* | ||
96 | * Timer | ||
97 | */ | ||
98 | static void __iomem *cns3xxx_tmr1; | ||
99 | |||
100 | static void cns3xxx_timer_set_mode(enum clock_event_mode mode, | ||
101 | struct clock_event_device *clk) | ||
102 | { | ||
103 | unsigned long ctrl = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
104 | int pclk = cns3xxx_cpu_clock() / 8; | ||
105 | int reload; | ||
106 | |||
107 | switch (mode) { | ||
108 | case CLOCK_EVT_MODE_PERIODIC: | ||
109 | reload = pclk * 20 / (3 * HZ) * 0x25000; | ||
110 | writel(reload, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); | ||
111 | ctrl |= (1 << 0) | (1 << 2) | (1 << 9); | ||
112 | break; | ||
113 | case CLOCK_EVT_MODE_ONESHOT: | ||
114 | /* period set, and timer enabled in 'next_event' hook */ | ||
115 | ctrl |= (1 << 2) | (1 << 9); | ||
116 | break; | ||
117 | case CLOCK_EVT_MODE_UNUSED: | ||
118 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
119 | default: | ||
120 | ctrl = 0; | ||
121 | } | ||
122 | |||
123 | writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
124 | } | ||
125 | |||
126 | static int cns3xxx_timer_set_next_event(unsigned long evt, | ||
127 | struct clock_event_device *unused) | ||
128 | { | ||
129 | unsigned long ctrl = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
130 | |||
131 | writel(evt, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); | ||
132 | writel(ctrl | (1 << 0), cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
133 | |||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | static struct clock_event_device cns3xxx_tmr1_clockevent = { | ||
138 | .name = "cns3xxx timer1", | ||
139 | .shift = 8, | ||
140 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
141 | .set_mode = cns3xxx_timer_set_mode, | ||
142 | .set_next_event = cns3xxx_timer_set_next_event, | ||
143 | .rating = 350, | ||
144 | .cpumask = cpu_all_mask, | ||
145 | }; | ||
146 | |||
147 | static void __init cns3xxx_clockevents_init(unsigned int timer_irq) | ||
148 | { | ||
149 | cns3xxx_tmr1_clockevent.irq = timer_irq; | ||
150 | cns3xxx_tmr1_clockevent.mult = | ||
151 | div_sc((cns3xxx_cpu_clock() >> 3) * 1000000, NSEC_PER_SEC, | ||
152 | cns3xxx_tmr1_clockevent.shift); | ||
153 | cns3xxx_tmr1_clockevent.max_delta_ns = | ||
154 | clockevent_delta2ns(0xffffffff, &cns3xxx_tmr1_clockevent); | ||
155 | cns3xxx_tmr1_clockevent.min_delta_ns = | ||
156 | clockevent_delta2ns(0xf, &cns3xxx_tmr1_clockevent); | ||
157 | |||
158 | clockevents_register_device(&cns3xxx_tmr1_clockevent); | ||
159 | } | ||
160 | |||
161 | /* | ||
162 | * IRQ handler for the timer | ||
163 | */ | ||
164 | static irqreturn_t cns3xxx_timer_interrupt(int irq, void *dev_id) | ||
165 | { | ||
166 | struct clock_event_device *evt = &cns3xxx_tmr1_clockevent; | ||
167 | u32 __iomem *stat = cns3xxx_tmr1 + TIMER1_2_INTERRUPT_STATUS_OFFSET; | ||
168 | u32 val; | ||
169 | |||
170 | /* Clear the interrupt */ | ||
171 | val = readl(stat); | ||
172 | writel(val & ~(1 << 2), stat); | ||
173 | |||
174 | evt->event_handler(evt); | ||
175 | |||
176 | return IRQ_HANDLED; | ||
177 | } | ||
178 | |||
179 | static struct irqaction cns3xxx_timer_irq = { | ||
180 | .name = "timer", | ||
181 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
182 | .handler = cns3xxx_timer_interrupt, | ||
183 | }; | ||
184 | |||
185 | /* | ||
186 | * Set up the clock source and clock events devices | ||
187 | */ | ||
188 | static void __init __cns3xxx_timer_init(unsigned int timer_irq) | ||
189 | { | ||
190 | u32 val; | ||
191 | u32 irq_mask; | ||
192 | |||
193 | /* | ||
194 | * Initialise to a known state (all timers off) | ||
195 | */ | ||
196 | |||
197 | /* disable timer1 and timer2 */ | ||
198 | writel(0, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
199 | /* stop free running timer3 */ | ||
200 | writel(0, cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET); | ||
201 | |||
202 | /* timer1 */ | ||
203 | writel(0x5C800, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET); | ||
204 | writel(0x5C800, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); | ||
205 | |||
206 | writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V1_OFFSET); | ||
207 | writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V2_OFFSET); | ||
208 | |||
209 | /* mask irq, non-mask timer1 overflow */ | ||
210 | irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET); | ||
211 | irq_mask &= ~(1 << 2); | ||
212 | irq_mask |= 0x03; | ||
213 | writel(irq_mask, cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET); | ||
214 | |||
215 | /* down counter */ | ||
216 | val = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
217 | val |= (1 << 9); | ||
218 | writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
219 | |||
220 | /* timer2 */ | ||
221 | writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V1_OFFSET); | ||
222 | writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V2_OFFSET); | ||
223 | |||
224 | /* mask irq */ | ||
225 | irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET); | ||
226 | irq_mask |= ((1 << 3) | (1 << 4) | (1 << 5)); | ||
227 | writel(irq_mask, cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET); | ||
228 | |||
229 | /* down counter */ | ||
230 | val = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
231 | val |= (1 << 10); | ||
232 | writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); | ||
233 | |||
234 | /* Make irqs happen for the system timer */ | ||
235 | setup_irq(timer_irq, &cns3xxx_timer_irq); | ||
236 | |||
237 | cns3xxx_clockevents_init(timer_irq); | ||
238 | } | ||
239 | |||
240 | static void __init cns3xxx_timer_init(void) | ||
241 | { | ||
242 | cns3xxx_tmr1 = __io(CNS3XXX_TIMER1_2_3_BASE_VIRT); | ||
243 | |||
244 | __cns3xxx_timer_init(IRQ_CNS3XXX_TIMER0); | ||
245 | } | ||
246 | |||
247 | struct sys_timer cns3xxx_timer = { | ||
248 | .init = cns3xxx_timer_init, | ||
249 | }; | ||
diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h new file mode 100644 index 000000000000..6b33ec11346e --- /dev/null +++ b/arch/arm/mach-cns3xxx/core.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright 2000 Deep Blue Solutions Ltd | ||
3 | * Copyright 2004 ARM Limited | ||
4 | * Copyright 2008 Cavium Networks | ||
5 | * | ||
6 | * This file 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 __CNS3XXX_CORE_H | ||
12 | #define __CNS3XXX_CORE_H | ||
13 | |||
14 | extern void __iomem *gic_cpu_base_addr; | ||
15 | extern struct sys_timer cns3xxx_timer; | ||
16 | |||
17 | void __init cns3xxx_map_io(void); | ||
18 | void __init cns3xxx_init_irq(void); | ||
19 | void cns3xxx_power_off(void); | ||
20 | void cns3xxx_pwr_power_up(unsigned int block); | ||
21 | void cns3xxx_pwr_power_down(unsigned int block); | ||
22 | |||
23 | #endif /* __CNS3XXX_CORE_H */ | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h b/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h new file mode 100644 index 000000000000..8a2f5a21d4ee --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h | |||
@@ -0,0 +1,635 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Cavium Networks | ||
3 | * | ||
4 | * This file is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License, Version 2, as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __MACH_BOARD_CNS3XXXH | ||
10 | #define __MACH_BOARD_CNS3XXXH | ||
11 | |||
12 | /* | ||
13 | * Memory map | ||
14 | */ | ||
15 | #define CNS3XXX_FLASH_BASE 0x10000000 /* Flash/SRAM Memory Bank 0 */ | ||
16 | #define CNS3XXX_FLASH_SIZE SZ_256M | ||
17 | |||
18 | #define CNS3XXX_DDR2SDRAM_BASE 0x20000000 /* DDR2 SDRAM Memory */ | ||
19 | |||
20 | #define CNS3XXX_SPI_FLASH_BASE 0x60000000 /* SPI Serial Flash Memory */ | ||
21 | |||
22 | #define CNS3XXX_SWITCH_BASE 0x70000000 /* Switch and HNAT Control */ | ||
23 | #define CNS3XXX_SWITCH_BASE_VIRT 0xFFF00000 | ||
24 | |||
25 | #define CNS3XXX_PPE_BASE 0x70001000 /* HANT */ | ||
26 | #define CNS3XXX_PPE_BASE_VIRT 0xFFF50000 | ||
27 | |||
28 | #define CNS3XXX_EMBEDDED_SRAM_BASE 0x70002000 /* HANT Embedded SRAM */ | ||
29 | #define CNS3XXX_EMBEDDED_SRAM_BASE_VIRT 0xFFF60000 | ||
30 | |||
31 | #define CNS3XXX_SSP_BASE 0x71000000 /* Synchronous Serial Port - SPI/PCM/I2C */ | ||
32 | #define CNS3XXX_SSP_BASE_VIRT 0xFFF01000 | ||
33 | |||
34 | #define CNS3XXX_DMC_BASE 0x72000000 /* DMC Control (DDR2 SDRAM) */ | ||
35 | #define CNS3XXX_DMC_BASE_VIRT 0xFFF02000 | ||
36 | |||
37 | #define CNS3XXX_SMC_BASE 0x73000000 /* SMC Control */ | ||
38 | #define CNS3XXX_SMC_BASE_VIRT 0xFFF03000 | ||
39 | |||
40 | #define SMC_MEMC_STATUS_OFFSET 0x000 | ||
41 | #define SMC_MEMIF_CFG_OFFSET 0x004 | ||
42 | #define SMC_MEMC_CFG_SET_OFFSET 0x008 | ||
43 | #define SMC_MEMC_CFG_CLR_OFFSET 0x00C | ||
44 | #define SMC_DIRECT_CMD_OFFSET 0x010 | ||
45 | #define SMC_SET_CYCLES_OFFSET 0x014 | ||
46 | #define SMC_SET_OPMODE_OFFSET 0x018 | ||
47 | #define SMC_REFRESH_PERIOD_0_OFFSET 0x020 | ||
48 | #define SMC_REFRESH_PERIOD_1_OFFSET 0x024 | ||
49 | #define SMC_SRAM_CYCLES0_0_OFFSET 0x100 | ||
50 | #define SMC_NAND_CYCLES0_0_OFFSET 0x100 | ||
51 | #define SMC_OPMODE0_0_OFFSET 0x104 | ||
52 | #define SMC_SRAM_CYCLES0_1_OFFSET 0x120 | ||
53 | #define SMC_NAND_CYCLES0_1_OFFSET 0x120 | ||
54 | #define SMC_OPMODE0_1_OFFSET 0x124 | ||
55 | #define SMC_USER_STATUS_OFFSET 0x200 | ||
56 | #define SMC_USER_CONFIG_OFFSET 0x204 | ||
57 | #define SMC_ECC_STATUS_OFFSET 0x300 | ||
58 | #define SMC_ECC_MEMCFG_OFFSET 0x304 | ||
59 | #define SMC_ECC_MEMCOMMAND1_OFFSET 0x308 | ||
60 | #define SMC_ECC_MEMCOMMAND2_OFFSET 0x30C | ||
61 | #define SMC_ECC_ADDR0_OFFSET 0x310 | ||
62 | #define SMC_ECC_ADDR1_OFFSET 0x314 | ||
63 | #define SMC_ECC_VALUE0_OFFSET 0x318 | ||
64 | #define SMC_ECC_VALUE1_OFFSET 0x31C | ||
65 | #define SMC_ECC_VALUE2_OFFSET 0x320 | ||
66 | #define SMC_ECC_VALUE3_OFFSET 0x324 | ||
67 | #define SMC_PERIPH_ID_0_OFFSET 0xFE0 | ||
68 | #define SMC_PERIPH_ID_1_OFFSET 0xFE4 | ||
69 | #define SMC_PERIPH_ID_2_OFFSET 0xFE8 | ||
70 | #define SMC_PERIPH_ID_3_OFFSET 0xFEC | ||
71 | #define SMC_PCELL_ID_0_OFFSET 0xFF0 | ||
72 | #define SMC_PCELL_ID_1_OFFSET 0xFF4 | ||
73 | #define SMC_PCELL_ID_2_OFFSET 0xFF8 | ||
74 | #define SMC_PCELL_ID_3_OFFSET 0xFFC | ||
75 | |||
76 | #define CNS3XXX_GPIOA_BASE 0x74000000 /* GPIO port A */ | ||
77 | #define CNS3XXX_GPIOA_BASE_VIRT 0xFFF04000 | ||
78 | |||
79 | #define CNS3XXX_GPIOB_BASE 0x74800000 /* GPIO port B */ | ||
80 | #define CNS3XXX_GPIOB_BASE_VIRT 0xFFF05000 | ||
81 | |||
82 | #define CNS3XXX_RTC_BASE 0x75000000 /* Real Time Clock */ | ||
83 | #define CNS3XXX_RTC_BASE_VIRT 0xFFF06000 | ||
84 | |||
85 | #define RTC_SEC_OFFSET 0x00 | ||
86 | #define RTC_MIN_OFFSET 0x04 | ||
87 | #define RTC_HOUR_OFFSET 0x08 | ||
88 | #define RTC_DAY_OFFSET 0x0C | ||
89 | #define RTC_SEC_ALM_OFFSET 0x10 | ||
90 | #define RTC_MIN_ALM_OFFSET 0x14 | ||
91 | #define RTC_HOUR_ALM_OFFSET 0x18 | ||
92 | #define RTC_REC_OFFSET 0x1C | ||
93 | #define RTC_CTRL_OFFSET 0x20 | ||
94 | #define RTC_INTR_STS_OFFSET 0x34 | ||
95 | |||
96 | #define CNS3XXX_MISC_BASE 0x76000000 /* Misc Control */ | ||
97 | #define CNS3XXX_MISC_BASE_VIRT 0xFFF07000 /* Misc Control */ | ||
98 | |||
99 | #define CNS3XXX_PM_BASE 0x77000000 /* Power Management Control */ | ||
100 | #define CNS3XXX_PM_BASE_VIRT 0xFFF08000 | ||
101 | |||
102 | #define PM_CLK_GATE_OFFSET 0x00 | ||
103 | #define PM_SOFT_RST_OFFSET 0x04 | ||
104 | #define PM_HS_CFG_OFFSET 0x08 | ||
105 | #define PM_CACTIVE_STA_OFFSET 0x0C | ||
106 | #define PM_PWR_STA_OFFSET 0x10 | ||
107 | #define PM_SYS_CLK_CTRL_OFFSET 0x14 | ||
108 | #define PM_PLL_LCD_I2S_CTRL_OFFSET 0x18 | ||
109 | #define PM_PLL_HM_PD_OFFSET 0x1C | ||
110 | |||
111 | #define CNS3XXX_UART0_BASE 0x78000000 /* UART 0 */ | ||
112 | #define CNS3XXX_UART0_BASE_VIRT 0xFFF09000 | ||
113 | |||
114 | #define CNS3XXX_UART1_BASE 0x78400000 /* UART 1 */ | ||
115 | #define CNS3XXX_UART1_BASE_VIRT 0xFFF0A000 | ||
116 | |||
117 | #define CNS3XXX_UART2_BASE 0x78800000 /* UART 2 */ | ||
118 | #define CNS3XXX_UART2_BASE_VIRT 0xFFF0B000 | ||
119 | |||
120 | #define CNS3XXX_DMAC_BASE 0x79000000 /* Generic DMA Control */ | ||
121 | #define CNS3XXX_DMAC_BASE_VIRT 0xFFF0D000 | ||
122 | |||
123 | #define CNS3XXX_CORESIGHT_BASE 0x7A000000 /* CoreSight */ | ||
124 | #define CNS3XXX_CORESIGHT_BASE_VIRT 0xFFF0E000 | ||
125 | |||
126 | #define CNS3XXX_CRYPTO_BASE 0x7B000000 /* Crypto */ | ||
127 | #define CNS3XXX_CRYPTO_BASE_VIRT 0xFFF0F000 | ||
128 | |||
129 | #define CNS3XXX_I2S_BASE 0x7C000000 /* I2S */ | ||
130 | #define CNS3XXX_I2S_BASE_VIRT 0xFFF10000 | ||
131 | |||
132 | #define CNS3XXX_TIMER1_2_3_BASE 0x7C800000 /* Timer */ | ||
133 | #define CNS3XXX_TIMER1_2_3_BASE_VIRT 0xFFF10800 | ||
134 | |||
135 | #define TIMER1_COUNTER_OFFSET 0x00 | ||
136 | #define TIMER1_AUTO_RELOAD_OFFSET 0x04 | ||
137 | #define TIMER1_MATCH_V1_OFFSET 0x08 | ||
138 | #define TIMER1_MATCH_V2_OFFSET 0x0C | ||
139 | |||
140 | #define TIMER2_COUNTER_OFFSET 0x10 | ||
141 | #define TIMER2_AUTO_RELOAD_OFFSET 0x14 | ||
142 | #define TIMER2_MATCH_V1_OFFSET 0x18 | ||
143 | #define TIMER2_MATCH_V2_OFFSET 0x1C | ||
144 | |||
145 | #define TIMER1_2_CONTROL_OFFSET 0x30 | ||
146 | #define TIMER1_2_INTERRUPT_STATUS_OFFSET 0x34 | ||
147 | #define TIMER1_2_INTERRUPT_MASK_OFFSET 0x38 | ||
148 | |||
149 | #define TIMER_FREERUN_OFFSET 0x40 | ||
150 | #define TIMER_FREERUN_CONTROL_OFFSET 0x44 | ||
151 | |||
152 | #define CNS3XXX_HCIE_BASE 0x7D000000 /* HCIE Control */ | ||
153 | #define CNS3XXX_HCIE_BASE_VIRT 0xFFF30000 | ||
154 | |||
155 | #define CNS3XXX_RAID_BASE 0x7E000000 /* RAID Control */ | ||
156 | #define CNS3XXX_RAID_BASE_VIRT 0xFFF12000 | ||
157 | |||
158 | #define CNS3XXX_AXI_IXC_BASE 0x7F000000 /* AXI IXC */ | ||
159 | #define CNS3XXX_AXI_IXC_BASE_VIRT 0xFFF13000 | ||
160 | |||
161 | #define CNS3XXX_CLCD_BASE 0x80000000 /* LCD Control */ | ||
162 | #define CNS3XXX_CLCD_BASE_VIRT 0xFFF14000 | ||
163 | |||
164 | #define CNS3XXX_USBOTG_BASE 0x81000000 /* USB OTG Control */ | ||
165 | #define CNS3XXX_USBOTG_BASE_VIRT 0xFFF15000 | ||
166 | |||
167 | #define CNS3XXX_USB_BASE 0x82000000 /* USB Host Control */ | ||
168 | #define CNS3XXX_USB_BASE_VIRT 0xFFF16000 | ||
169 | |||
170 | #define CNS3XXX_SATA2_BASE 0x83000000 /* SATA */ | ||
171 | #define CNS3XXX_SATA2_SIZE SZ_16M | ||
172 | #define CNS3XXX_SATA2_BASE_VIRT 0xFFF17000 | ||
173 | |||
174 | #define CNS3XXX_CAMERA_BASE 0x84000000 /* Camera Interface */ | ||
175 | #define CNS3XXX_CAMERA_BASE_VIRT 0xFFF18000 | ||
176 | |||
177 | #define CNS3XXX_SDIO_BASE 0x85000000 /* SDIO */ | ||
178 | #define CNS3XXX_SDIO_BASE_VIRT 0xFFF19000 | ||
179 | |||
180 | #define CNS3XXX_I2S_TDM_BASE 0x86000000 /* I2S TDM */ | ||
181 | #define CNS3XXX_I2S_TDM_BASE_VIRT 0xFFF1A000 | ||
182 | |||
183 | #define CNS3XXX_2DG_BASE 0x87000000 /* 2D Graphic Control */ | ||
184 | #define CNS3XXX_2DG_BASE_VIRT 0xFFF1B000 | ||
185 | |||
186 | #define CNS3XXX_USB_OHCI_BASE 0x88000000 /* USB OHCI */ | ||
187 | #define CNS3XXX_USB_OHCI_BASE_VIRT 0xFFF1C000 | ||
188 | |||
189 | #define CNS3XXX_L2C_BASE 0x92000000 /* L2 Cache Control */ | ||
190 | #define CNS3XXX_L2C_BASE_VIRT 0xFFF27000 | ||
191 | |||
192 | #define CNS3XXX_PCIE0_MEM_BASE 0xA0000000 /* PCIe Port 0 IO/Memory Space */ | ||
193 | #define CNS3XXX_PCIE0_MEM_BASE_VIRT 0xE0000000 | ||
194 | |||
195 | #define CNS3XXX_PCIE0_HOST_BASE 0xAB000000 /* PCIe Port 0 RC Base */ | ||
196 | #define CNS3XXX_PCIE0_HOST_BASE_VIRT 0xE1000000 | ||
197 | |||
198 | #define CNS3XXX_PCIE0_IO_BASE 0xAC000000 /* PCIe Port 0 */ | ||
199 | #define CNS3XXX_PCIE0_IO_BASE_VIRT 0xE2000000 | ||
200 | |||
201 | #define CNS3XXX_PCIE0_CFG0_BASE 0xAD000000 /* PCIe Port 0 CFG Type 0 */ | ||
202 | #define CNS3XXX_PCIE0_CFG0_BASE_VIRT 0xE3000000 | ||
203 | |||
204 | #define CNS3XXX_PCIE0_CFG1_BASE 0xAE000000 /* PCIe Port 0 CFG Type 1 */ | ||
205 | #define CNS3XXX_PCIE0_CFG1_BASE_VIRT 0xE4000000 | ||
206 | |||
207 | #define CNS3XXX_PCIE0_MSG_BASE 0xAF000000 /* PCIe Port 0 Message Space */ | ||
208 | #define CNS3XXX_PCIE0_MSG_BASE_VIRT 0xE5000000 | ||
209 | |||
210 | #define CNS3XXX_PCIE1_MEM_BASE 0xB0000000 /* PCIe Port 1 IO/Memory Space */ | ||
211 | #define CNS3XXX_PCIE1_MEM_BASE_VIRT 0xE8000000 | ||
212 | |||
213 | #define CNS3XXX_PCIE1_HOST_BASE 0xBB000000 /* PCIe Port 1 RC Base */ | ||
214 | #define CNS3XXX_PCIE1_HOST_BASE_VIRT 0xE9000000 | ||
215 | |||
216 | #define CNS3XXX_PCIE1_IO_BASE 0xBC000000 /* PCIe Port 1 */ | ||
217 | #define CNS3XXX_PCIE1_IO_BASE_VIRT 0xEA000000 | ||
218 | |||
219 | #define CNS3XXX_PCIE1_CFG0_BASE 0xBD000000 /* PCIe Port 1 CFG Type 0 */ | ||
220 | #define CNS3XXX_PCIE1_CFG0_BASE_VIRT 0xEB000000 | ||
221 | |||
222 | #define CNS3XXX_PCIE1_CFG1_BASE 0xBE000000 /* PCIe Port 1 CFG Type 1 */ | ||
223 | #define CNS3XXX_PCIE1_CFG1_BASE_VIRT 0xEC000000 | ||
224 | |||
225 | #define CNS3XXX_PCIE1_MSG_BASE 0xBF000000 /* PCIe Port 1 Message Space */ | ||
226 | #define CNS3XXX_PCIE1_MSG_BASE_VIRT 0xED000000 | ||
227 | |||
228 | /* | ||
229 | * Testchip peripheral and fpga gic regions | ||
230 | */ | ||
231 | #define CNS3XXX_TC11MP_SCU_BASE 0x90000000 /* IRQ, Test chip */ | ||
232 | #define CNS3XXX_TC11MP_SCU_BASE_VIRT 0xFF000000 | ||
233 | |||
234 | #define CNS3XXX_TC11MP_GIC_CPU_BASE 0x90000100 /* Test chip interrupt controller CPU interface */ | ||
235 | #define CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT 0xFF000100 | ||
236 | |||
237 | #define CNS3XXX_TC11MP_TWD_BASE 0x90000600 | ||
238 | #define CNS3XXX_TC11MP_TWD_BASE_VIRT 0xFF000600 | ||
239 | |||
240 | #define CNS3XXX_TC11MP_GIC_DIST_BASE 0x90001000 /* Test chip interrupt controller distributor */ | ||
241 | #define CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT 0xFF001000 | ||
242 | |||
243 | #define CNS3XXX_TC11MP_L220_BASE 0x92002000 /* L220 registers */ | ||
244 | #define CNS3XXX_TC11MP_L220_BASE_VIRT 0xFF002000 | ||
245 | |||
246 | /* | ||
247 | * Misc block | ||
248 | */ | ||
249 | #define MISC_MEM_MAP(offs) (void __iomem *)(CNS3XXX_MISC_BASE_VIRT + (offs)) | ||
250 | #define MISC_MEM_MAP_VALUE(offset) (*((volatile unsigned int *)(CNS3XXX_MISC_BASE_VIRT + (offset)))) | ||
251 | |||
252 | #define MISC_MEMORY_REMAP_REG MISC_MEM_MAP_VALUE(0x00) | ||
253 | #define MISC_CHIP_CONFIG_REG MISC_MEM_MAP_VALUE(0x04) | ||
254 | #define MISC_DEBUG_PROBE_DATA_REG MISC_MEM_MAP_VALUE(0x08) | ||
255 | #define MISC_DEBUG_PROBE_SELECTION_REG MISC_MEM_MAP_VALUE(0x0C) | ||
256 | #define MISC_IO_PIN_FUNC_SELECTION_REG MISC_MEM_MAP_VALUE(0x10) | ||
257 | #define MISC_GPIOA_PIN_ENABLE_REG MISC_MEM_MAP_VALUE(0x14) | ||
258 | #define MISC_GPIOB_PIN_ENABLE_REG MISC_MEM_MAP_VALUE(0x18) | ||
259 | #define MISC_IO_PAD_DRIVE_STRENGTH_CTRL_A MISC_MEM_MAP_VALUE(0x1C) | ||
260 | #define MISC_IO_PAD_DRIVE_STRENGTH_CTRL_B MISC_MEM_MAP_VALUE(0x20) | ||
261 | #define MISC_GPIOA_15_0_PULL_CTRL_REG MISC_MEM_MAP_VALUE(0x24) | ||
262 | #define MISC_GPIOA_16_31_PULL_CTRL_REG MISC_MEM_MAP_VALUE(0x28) | ||
263 | #define MISC_GPIOB_15_0_PULL_CTRL_REG MISC_MEM_MAP_VALUE(0x2C) | ||
264 | #define MISC_GPIOB_16_31_PULL_CTRL_REG MISC_MEM_MAP_VALUE(0x30) | ||
265 | #define MISC_IO_PULL_CTRL_REG MISC_MEM_MAP_VALUE(0x34) | ||
266 | #define MISC_E_FUSE_31_0_REG MISC_MEM_MAP_VALUE(0x40) | ||
267 | #define MISC_E_FUSE_63_32_REG MISC_MEM_MAP_VALUE(0x44) | ||
268 | #define MISC_E_FUSE_95_64_REG MISC_MEM_MAP_VALUE(0x48) | ||
269 | #define MISC_E_FUSE_127_96_REG MISC_MEM_MAP_VALUE(0x4C) | ||
270 | #define MISC_SOFTWARE_TEST_1_REG MISC_MEM_MAP_VALUE(0x50) | ||
271 | #define MISC_SOFTWARE_TEST_2_REG MISC_MEM_MAP_VALUE(0x54) | ||
272 | |||
273 | #define MISC_SATA_POWER_MODE MISC_MEM_MAP_VALUE(0x310) | ||
274 | |||
275 | #define MISC_USB_CFG_REG MISC_MEM_MAP_VALUE(0x800) | ||
276 | #define MISC_USB_STS_REG MISC_MEM_MAP_VALUE(0x804) | ||
277 | #define MISC_USBPHY00_CFG_REG MISC_MEM_MAP_VALUE(0x808) | ||
278 | #define MISC_USBPHY01_CFG_REG MISC_MEM_MAP_VALUE(0x80c) | ||
279 | #define MISC_USBPHY10_CFG_REG MISC_MEM_MAP_VALUE(0x810) | ||
280 | #define MISC_USBPHY11_CFG_REG MISC_MEM_MAP_VALUE(0x814) | ||
281 | |||
282 | #define MISC_PCIEPHY_CMCTL(x) MISC_MEM_MAP(0x900 + (x) * 0x004) | ||
283 | #define MISC_PCIEPHY_CTL(x) MISC_MEM_MAP(0x940 + (x) * 0x100) | ||
284 | #define MISC_PCIE_AXIS_AWMISC(x) MISC_MEM_MAP(0x944 + (x) * 0x100) | ||
285 | #define MISC_PCIE_AXIS_ARMISC(x) MISC_MEM_MAP(0x948 + (x) * 0x100) | ||
286 | #define MISC_PCIE_AXIS_RMISC(x) MISC_MEM_MAP(0x94C + (x) * 0x100) | ||
287 | #define MISC_PCIE_AXIS_BMISC(x) MISC_MEM_MAP(0x950 + (x) * 0x100) | ||
288 | #define MISC_PCIE_AXIM_RMISC(x) MISC_MEM_MAP(0x954 + (x) * 0x100) | ||
289 | #define MISC_PCIE_AXIM_BMISC(x) MISC_MEM_MAP(0x958 + (x) * 0x100) | ||
290 | #define MISC_PCIE_CTRL(x) MISC_MEM_MAP(0x95C + (x) * 0x100) | ||
291 | #define MISC_PCIE_PM_DEBUG(x) MISC_MEM_MAP(0x960 + (x) * 0x100) | ||
292 | #define MISC_PCIE_RFC_DEBUG(x) MISC_MEM_MAP(0x964 + (x) * 0x100) | ||
293 | #define MISC_PCIE_CXPL_DEBUGL(x) MISC_MEM_MAP(0x968 + (x) * 0x100) | ||
294 | #define MISC_PCIE_CXPL_DEBUGH(x) MISC_MEM_MAP(0x96C + (x) * 0x100) | ||
295 | #define MISC_PCIE_DIAG_DEBUGH(x) MISC_MEM_MAP(0x970 + (x) * 0x100) | ||
296 | #define MISC_PCIE_W1CLR(x) MISC_MEM_MAP(0x974 + (x) * 0x100) | ||
297 | #define MISC_PCIE_INT_MASK(x) MISC_MEM_MAP(0x978 + (x) * 0x100) | ||
298 | #define MISC_PCIE_INT_STATUS(x) MISC_MEM_MAP(0x97C + (x) * 0x100) | ||
299 | |||
300 | /* | ||
301 | * Power management and clock control | ||
302 | */ | ||
303 | #define PMU_REG_VALUE(offset) (*((volatile unsigned int *)(CNS3XXX_PM_BASE_VIRT + (offset)))) | ||
304 | |||
305 | #define PM_CLK_GATE_REG PMU_REG_VALUE(0x000) | ||
306 | #define PM_SOFT_RST_REG PMU_REG_VALUE(0x004) | ||
307 | #define PM_HS_CFG_REG PMU_REG_VALUE(0x008) | ||
308 | #define PM_CACTIVE_STA_REG PMU_REG_VALUE(0x00C) | ||
309 | #define PM_PWR_STA_REG PMU_REG_VALUE(0x010) | ||
310 | #define PM_CLK_CTRL_REG PMU_REG_VALUE(0x014) | ||
311 | #define PM_PLL_LCD_I2S_CTRL_REG PMU_REG_VALUE(0x018) | ||
312 | #define PM_PLL_HM_PD_CTRL_REG PMU_REG_VALUE(0x01C) | ||
313 | #define PM_REGULAT_CTRL_REG PMU_REG_VALUE(0x020) | ||
314 | #define PM_WDT_CTRL_REG PMU_REG_VALUE(0x024) | ||
315 | #define PM_WU_CTRL0_REG PMU_REG_VALUE(0x028) | ||
316 | #define PM_WU_CTRL1_REG PMU_REG_VALUE(0x02C) | ||
317 | #define PM_CSR_REG PMU_REG_VALUE(0x030) | ||
318 | |||
319 | /* PM_CLK_GATE_REG */ | ||
320 | #define PM_CLK_GATE_REG_OFFSET_SDIO (25) | ||
321 | #define PM_CLK_GATE_REG_OFFSET_GPU (24) | ||
322 | #define PM_CLK_GATE_REG_OFFSET_CIM (23) | ||
323 | #define PM_CLK_GATE_REG_OFFSET_LCDC (22) | ||
324 | #define PM_CLK_GATE_REG_OFFSET_I2S (21) | ||
325 | #define PM_CLK_GATE_REG_OFFSET_RAID (20) | ||
326 | #define PM_CLK_GATE_REG_OFFSET_SATA (19) | ||
327 | #define PM_CLK_GATE_REG_OFFSET_PCIE(x) (17 + (x)) | ||
328 | #define PM_CLK_GATE_REG_OFFSET_USB_HOST (16) | ||
329 | #define PM_CLK_GATE_REG_OFFSET_USB_OTG (15) | ||
330 | #define PM_CLK_GATE_REG_OFFSET_TIMER (14) | ||
331 | #define PM_CLK_GATE_REG_OFFSET_CRYPTO (13) | ||
332 | #define PM_CLK_GATE_REG_OFFSET_HCIE (12) | ||
333 | #define PM_CLK_GATE_REG_OFFSET_SWITCH (11) | ||
334 | #define PM_CLK_GATE_REG_OFFSET_GPIO (10) | ||
335 | #define PM_CLK_GATE_REG_OFFSET_UART3 (9) | ||
336 | #define PM_CLK_GATE_REG_OFFSET_UART2 (8) | ||
337 | #define PM_CLK_GATE_REG_OFFSET_UART1 (7) | ||
338 | #define PM_CLK_GATE_REG_OFFSET_RTC (5) | ||
339 | #define PM_CLK_GATE_REG_OFFSET_GDMA (4) | ||
340 | #define PM_CLK_GATE_REG_OFFSET_SPI_PCM_I2C (3) | ||
341 | #define PM_CLK_GATE_REG_OFFSET_SMC_NFI (1) | ||
342 | #define PM_CLK_GATE_REG_MASK (0x03FFFFBA) | ||
343 | |||
344 | /* PM_SOFT_RST_REG */ | ||
345 | #define PM_SOFT_RST_REG_OFFST_WARM_RST_FLAG (31) | ||
346 | #define PM_SOFT_RST_REG_OFFST_CPU1 (29) | ||
347 | #define PM_SOFT_RST_REG_OFFST_CPU0 (28) | ||
348 | #define PM_SOFT_RST_REG_OFFST_SDIO (25) | ||
349 | #define PM_SOFT_RST_REG_OFFST_GPU (24) | ||
350 | #define PM_SOFT_RST_REG_OFFST_CIM (23) | ||
351 | #define PM_SOFT_RST_REG_OFFST_LCDC (22) | ||
352 | #define PM_SOFT_RST_REG_OFFST_I2S (21) | ||
353 | #define PM_SOFT_RST_REG_OFFST_RAID (20) | ||
354 | #define PM_SOFT_RST_REG_OFFST_SATA (19) | ||
355 | #define PM_SOFT_RST_REG_OFFST_PCIE(x) (17 + (x)) | ||
356 | #define PM_SOFT_RST_REG_OFFST_USB_HOST (16) | ||
357 | #define PM_SOFT_RST_REG_OFFST_USB_OTG (15) | ||
358 | #define PM_SOFT_RST_REG_OFFST_TIMER (14) | ||
359 | #define PM_SOFT_RST_REG_OFFST_CRYPTO (13) | ||
360 | #define PM_SOFT_RST_REG_OFFST_HCIE (12) | ||
361 | #define PM_SOFT_RST_REG_OFFST_SWITCH (11) | ||
362 | #define PM_SOFT_RST_REG_OFFST_GPIO (10) | ||
363 | #define PM_SOFT_RST_REG_OFFST_UART3 (9) | ||
364 | #define PM_SOFT_RST_REG_OFFST_UART2 (8) | ||
365 | #define PM_SOFT_RST_REG_OFFST_UART1 (7) | ||
366 | #define PM_SOFT_RST_REG_OFFST_RTC (5) | ||
367 | #define PM_SOFT_RST_REG_OFFST_GDMA (4) | ||
368 | #define PM_SOFT_RST_REG_OFFST_SPI_PCM_I2C (3) | ||
369 | #define PM_SOFT_RST_REG_OFFST_DMC (2) | ||
370 | #define PM_SOFT_RST_REG_OFFST_SMC_NFI (1) | ||
371 | #define PM_SOFT_RST_REG_OFFST_GLOBAL (0) | ||
372 | #define PM_SOFT_RST_REG_MASK (0xF3FFFFBF) | ||
373 | |||
374 | /* PMHS_CFG_REG */ | ||
375 | #define PM_HS_CFG_REG_OFFSET_SDIO (25) | ||
376 | #define PM_HS_CFG_REG_OFFSET_GPU (24) | ||
377 | #define PM_HS_CFG_REG_OFFSET_CIM (23) | ||
378 | #define PM_HS_CFG_REG_OFFSET_LCDC (22) | ||
379 | #define PM_HS_CFG_REG_OFFSET_I2S (21) | ||
380 | #define PM_HS_CFG_REG_OFFSET_RAID (20) | ||
381 | #define PM_HS_CFG_REG_OFFSET_SATA (19) | ||
382 | #define PM_HS_CFG_REG_OFFSET_PCIE1 (18) | ||
383 | #define PM_HS_CFG_REG_OFFSET_PCIE0 (17) | ||
384 | #define PM_HS_CFG_REG_OFFSET_USB_HOST (16) | ||
385 | #define PM_HS_CFG_REG_OFFSET_USB_OTG (15) | ||
386 | #define PM_HS_CFG_REG_OFFSET_TIMER (14) | ||
387 | #define PM_HS_CFG_REG_OFFSET_CRYPTO (13) | ||
388 | #define PM_HS_CFG_REG_OFFSET_HCIE (12) | ||
389 | #define PM_HS_CFG_REG_OFFSET_SWITCH (11) | ||
390 | #define PM_HS_CFG_REG_OFFSET_GPIO (10) | ||
391 | #define PM_HS_CFG_REG_OFFSET_UART3 (9) | ||
392 | #define PM_HS_CFG_REG_OFFSET_UART2 (8) | ||
393 | #define PM_HS_CFG_REG_OFFSET_UART1 (7) | ||
394 | #define PM_HS_CFG_REG_OFFSET_RTC (5) | ||
395 | #define PM_HS_CFG_REG_OFFSET_GDMA (4) | ||
396 | #define PM_HS_CFG_REG_OFFSET_SPI_PCM_I2S (3) | ||
397 | #define PM_HS_CFG_REG_OFFSET_DMC (2) | ||
398 | #define PM_HS_CFG_REG_OFFSET_SMC_NFI (1) | ||
399 | #define PM_HS_CFG_REG_MASK (0x03FFFFBE) | ||
400 | #define PM_HS_CFG_REG_MASK_SUPPORT (0x01100806) | ||
401 | |||
402 | /* PM_CACTIVE_STA_REG */ | ||
403 | #define PM_CACTIVE_STA_REG_OFFSET_SDIO (25) | ||
404 | #define PM_CACTIVE_STA_REG_OFFSET_GPU (24) | ||
405 | #define PM_CACTIVE_STA_REG_OFFSET_CIM (23) | ||
406 | #define PM_CACTIVE_STA_REG_OFFSET_LCDC (22) | ||
407 | #define PM_CACTIVE_STA_REG_OFFSET_I2S (21) | ||
408 | #define PM_CACTIVE_STA_REG_OFFSET_RAID (20) | ||
409 | #define PM_CACTIVE_STA_REG_OFFSET_SATA (19) | ||
410 | #define PM_CACTIVE_STA_REG_OFFSET_PCIE1 (18) | ||
411 | #define PM_CACTIVE_STA_REG_OFFSET_PCIE0 (17) | ||
412 | #define PM_CACTIVE_STA_REG_OFFSET_USB_HOST (16) | ||
413 | #define PM_CACTIVE_STA_REG_OFFSET_USB_OTG (15) | ||
414 | #define PM_CACTIVE_STA_REG_OFFSET_TIMER (14) | ||
415 | #define PM_CACTIVE_STA_REG_OFFSET_CRYPTO (13) | ||
416 | #define PM_CACTIVE_STA_REG_OFFSET_HCIE (12) | ||
417 | #define PM_CACTIVE_STA_REG_OFFSET_SWITCH (11) | ||
418 | #define PM_CACTIVE_STA_REG_OFFSET_GPIO (10) | ||
419 | #define PM_CACTIVE_STA_REG_OFFSET_UART3 (9) | ||
420 | #define PM_CACTIVE_STA_REG_OFFSET_UART2 (8) | ||
421 | #define PM_CACTIVE_STA_REG_OFFSET_UART1 (7) | ||
422 | #define PM_CACTIVE_STA_REG_OFFSET_RTC (5) | ||
423 | #define PM_CACTIVE_STA_REG_OFFSET_GDMA (4) | ||
424 | #define PM_CACTIVE_STA_REG_OFFSET_SPI_PCM_I2S (3) | ||
425 | #define PM_CACTIVE_STA_REG_OFFSET_DMC (2) | ||
426 | #define PM_CACTIVE_STA_REG_OFFSET_SMC_NFI (1) | ||
427 | #define PM_CACTIVE_STA_REG_MASK (0x03FFFFBE) | ||
428 | |||
429 | /* PM_PWR_STA_REG */ | ||
430 | #define PM_PWR_STA_REG_REG_OFFSET_SDIO (25) | ||
431 | #define PM_PWR_STA_REG_REG_OFFSET_GPU (24) | ||
432 | #define PM_PWR_STA_REG_REG_OFFSET_CIM (23) | ||
433 | #define PM_PWR_STA_REG_REG_OFFSET_LCDC (22) | ||
434 | #define PM_PWR_STA_REG_REG_OFFSET_I2S (21) | ||
435 | #define PM_PWR_STA_REG_REG_OFFSET_RAID (20) | ||
436 | #define PM_PWR_STA_REG_REG_OFFSET_SATA (19) | ||
437 | #define PM_PWR_STA_REG_REG_OFFSET_PCIE1 (18) | ||
438 | #define PM_PWR_STA_REG_REG_OFFSET_PCIE0 (17) | ||
439 | #define PM_PWR_STA_REG_REG_OFFSET_USB_HOST (16) | ||
440 | #define PM_PWR_STA_REG_REG_OFFSET_USB_OTG (15) | ||
441 | #define PM_PWR_STA_REG_REG_OFFSET_TIMER (14) | ||
442 | #define PM_PWR_STA_REG_REG_OFFSET_CRYPTO (13) | ||
443 | #define PM_PWR_STA_REG_REG_OFFSET_HCIE (12) | ||
444 | #define PM_PWR_STA_REG_REG_OFFSET_SWITCH (11) | ||
445 | #define PM_PWR_STA_REG_REG_OFFSET_GPIO (10) | ||
446 | #define PM_PWR_STA_REG_REG_OFFSET_UART3 (9) | ||
447 | #define PM_PWR_STA_REG_REG_OFFSET_UART2 (8) | ||
448 | #define PM_PWR_STA_REG_REG_OFFSET_UART1 (7) | ||
449 | #define PM_PWR_STA_REG_REG_OFFSET_RTC (5) | ||
450 | #define PM_PWR_STA_REG_REG_OFFSET_GDMA (4) | ||
451 | #define PM_PWR_STA_REG_REG_OFFSET_SPI_PCM_I2S (3) | ||
452 | #define PM_PWR_STA_REG_REG_OFFSET_DMC (2) | ||
453 | #define PM_PWR_STA_REG_REG_OFFSET_SMC_NFI (1) | ||
454 | #define PM_PWR_STA_REG_REG_MASK (0x03FFFFBE) | ||
455 | |||
456 | /* PM_CLK_CTRL_REG */ | ||
457 | #define PM_CLK_CTRL_REG_OFFSET_I2S_MCLK (31) | ||
458 | #define PM_CLK_CTRL_REG_OFFSET_DDR2_CHG_EN (30) | ||
459 | #define PM_CLK_CTRL_REG_OFFSET_PCIE_REF1_EN (29) | ||
460 | #define PM_CLK_CTRL_REG_OFFSET_PCIE_REF0_EN (28) | ||
461 | #define PM_CLK_CTRL_REG_OFFSET_TIMER_SIM_MODE (27) | ||
462 | #define PM_CLK_CTRL_REG_OFFSET_I2SCLK_DIV (24) | ||
463 | #define PM_CLK_CTRL_REG_OFFSET_I2SCLK_SEL (22) | ||
464 | #define PM_CLK_CTRL_REG_OFFSET_CLKOUT_DIV (20) | ||
465 | #define PM_CLK_CTRL_REG_OFFSET_CLKOUT_SEL (16) | ||
466 | #define PM_CLK_CTRL_REG_OFFSET_MDC_DIV (14) | ||
467 | #define PM_CLK_CTRL_REG_OFFSET_CRYPTO_CLK_SEL (12) | ||
468 | #define PM_CLK_CTRL_REG_OFFSET_CPU_PWR_MODE (9) | ||
469 | #define PM_CLK_CTRL_REG_OFFSET_PLL_DDR2_SEL (7) | ||
470 | #define PM_CLK_CTRL_REG_OFFSET_DIV_IMMEDIATE (6) | ||
471 | #define PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV (4) | ||
472 | #define PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL (0) | ||
473 | |||
474 | #define PM_CPU_CLK_DIV(DIV) { \ | ||
475 | PM_CLK_CTRL_REG &= ~((0x3) << PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV); \ | ||
476 | PM_CLK_CTRL_REG |= (((DIV)&0x3) << PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV); \ | ||
477 | } | ||
478 | |||
479 | #define PM_PLL_CPU_SEL(CPU) { \ | ||
480 | PM_CLK_CTRL_REG &= ~((0xF) << PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL); \ | ||
481 | PM_CLK_CTRL_REG |= (((CPU)&0xF) << PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL); \ | ||
482 | } | ||
483 | |||
484 | /* PM_PLL_LCD_I2S_CTRL_REG */ | ||
485 | #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_MCLK_SMC_DIV (22) | ||
486 | #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_R_SEL (17) | ||
487 | #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_P (11) | ||
488 | #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_M (3) | ||
489 | #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_S (0) | ||
490 | |||
491 | /* PM_PLL_HM_PD_CTRL_REG */ | ||
492 | #define PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY1 (11) | ||
493 | #define PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY0 (10) | ||
494 | #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_I2SCD (6) | ||
495 | #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_I2S (5) | ||
496 | #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_LCD (4) | ||
497 | #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB (3) | ||
498 | #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_RGMII (2) | ||
499 | #define PM_PLL_HM_PD_CTRL_REG_MASK (0x00000C7C) | ||
500 | |||
501 | /* PM_WDT_CTRL_REG */ | ||
502 | #define PM_WDT_CTRL_REG_OFFSET_RESET_CPU_ONLY (0) | ||
503 | |||
504 | /* PM_CSR_REG - Clock Scaling Register*/ | ||
505 | #define PM_CSR_REG_OFFSET_CSR_EN (30) | ||
506 | #define PM_CSR_REG_OFFSET_CSR_NUM (0) | ||
507 | |||
508 | #define CNS3XXX_PWR_CLK_EN(BLOCK) (0x1<<PM_CLK_GATE_REG_OFFSET_##BLOCK) | ||
509 | |||
510 | /* Software reset*/ | ||
511 | #define CNS3XXX_PWR_SOFTWARE_RST(BLOCK) (0x1<<PM_SOFT_RST_REG_OFFST_##BLOCK) | ||
512 | |||
513 | /* | ||
514 | * CNS3XXX support several power saving mode as following, | ||
515 | * DFS, IDLE, HALT, DOZE, SLEEP, Hibernate | ||
516 | */ | ||
517 | #define CNS3XXX_PWR_CPU_MODE_DFS (0) | ||
518 | #define CNS3XXX_PWR_CPU_MODE_IDLE (1) | ||
519 | #define CNS3XXX_PWR_CPU_MODE_HALT (2) | ||
520 | #define CNS3XXX_PWR_CPU_MODE_DOZE (3) | ||
521 | #define CNS3XXX_PWR_CPU_MODE_SLEEP (4) | ||
522 | #define CNS3XXX_PWR_CPU_MODE_HIBERNATE (5) | ||
523 | |||
524 | #define CNS3XXX_PWR_PLL(BLOCK) (0x1<<PM_PLL_HM_PD_CTRL_REG_OFFSET_##BLOCK) | ||
525 | #define CNS3XXX_PWR_PLL_ALL PM_PLL_HM_PD_CTRL_REG_MASK | ||
526 | |||
527 | /* Change CPU frequency and divider */ | ||
528 | #define CNS3XXX_PWR_PLL_CPU_300MHZ (0) | ||
529 | #define CNS3XXX_PWR_PLL_CPU_333MHZ (1) | ||
530 | #define CNS3XXX_PWR_PLL_CPU_366MHZ (2) | ||
531 | #define CNS3XXX_PWR_PLL_CPU_400MHZ (3) | ||
532 | #define CNS3XXX_PWR_PLL_CPU_433MHZ (4) | ||
533 | #define CNS3XXX_PWR_PLL_CPU_466MHZ (5) | ||
534 | #define CNS3XXX_PWR_PLL_CPU_500MHZ (6) | ||
535 | #define CNS3XXX_PWR_PLL_CPU_533MHZ (7) | ||
536 | #define CNS3XXX_PWR_PLL_CPU_566MHZ (8) | ||
537 | #define CNS3XXX_PWR_PLL_CPU_600MHZ (9) | ||
538 | #define CNS3XXX_PWR_PLL_CPU_633MHZ (10) | ||
539 | #define CNS3XXX_PWR_PLL_CPU_666MHZ (11) | ||
540 | #define CNS3XXX_PWR_PLL_CPU_700MHZ (12) | ||
541 | |||
542 | #define CNS3XXX_PWR_CPU_CLK_DIV_BY1 (0) | ||
543 | #define CNS3XXX_PWR_CPU_CLK_DIV_BY2 (1) | ||
544 | #define CNS3XXX_PWR_CPU_CLK_DIV_BY4 (2) | ||
545 | |||
546 | /* Change DDR2 frequency */ | ||
547 | #define CNS3XXX_PWR_PLL_DDR2_200MHZ (0) | ||
548 | #define CNS3XXX_PWR_PLL_DDR2_266MHZ (1) | ||
549 | #define CNS3XXX_PWR_PLL_DDR2_333MHZ (2) | ||
550 | #define CNS3XXX_PWR_PLL_DDR2_400MHZ (3) | ||
551 | |||
552 | void cns3xxx_pwr_soft_rst(unsigned int block); | ||
553 | void cns3xxx_pwr_clk_en(unsigned int block); | ||
554 | int cns3xxx_cpu_clock(void); | ||
555 | |||
556 | /* | ||
557 | * ARM11 MPCore interrupt sources (primary GIC) | ||
558 | */ | ||
559 | #define IRQ_CNS3XXX_PMU (IRQ_TC11MP_GIC_START + 0) | ||
560 | #define IRQ_CNS3XXX_SDIO (IRQ_TC11MP_GIC_START + 1) | ||
561 | #define IRQ_CNS3XXX_L2CC (IRQ_TC11MP_GIC_START + 2) | ||
562 | #define IRQ_CNS3XXX_RTC (IRQ_TC11MP_GIC_START + 3) | ||
563 | #define IRQ_CNS3XXX_I2S (IRQ_TC11MP_GIC_START + 4) | ||
564 | #define IRQ_CNS3XXX_PCM (IRQ_TC11MP_GIC_START + 5) | ||
565 | #define IRQ_CNS3XXX_SPI (IRQ_TC11MP_GIC_START + 6) | ||
566 | #define IRQ_CNS3XXX_I2C (IRQ_TC11MP_GIC_START + 7) | ||
567 | #define IRQ_CNS3XXX_CIM (IRQ_TC11MP_GIC_START + 8) | ||
568 | #define IRQ_CNS3XXX_GPU (IRQ_TC11MP_GIC_START + 9) | ||
569 | #define IRQ_CNS3XXX_LCD (IRQ_TC11MP_GIC_START + 10) | ||
570 | #define IRQ_CNS3XXX_GPIOA (IRQ_TC11MP_GIC_START + 11) | ||
571 | #define IRQ_CNS3XXX_GPIOB (IRQ_TC11MP_GIC_START + 12) | ||
572 | #define IRQ_CNS3XXX_UART0 (IRQ_TC11MP_GIC_START + 13) | ||
573 | #define IRQ_CNS3XXX_UART1 (IRQ_TC11MP_GIC_START + 14) | ||
574 | #define IRQ_CNS3XXX_UART2 (IRQ_TC11MP_GIC_START + 15) | ||
575 | #define IRQ_CNS3XXX_ARM11 (IRQ_TC11MP_GIC_START + 16) | ||
576 | |||
577 | #define IRQ_CNS3XXX_SW_STATUS (IRQ_TC11MP_GIC_START + 17) | ||
578 | #define IRQ_CNS3XXX_SW_R0TXC (IRQ_TC11MP_GIC_START + 18) | ||
579 | #define IRQ_CNS3XXX_SW_R0RXC (IRQ_TC11MP_GIC_START + 19) | ||
580 | #define IRQ_CNS3XXX_SW_R0QE (IRQ_TC11MP_GIC_START + 20) | ||
581 | #define IRQ_CNS3XXX_SW_R0QF (IRQ_TC11MP_GIC_START + 21) | ||
582 | #define IRQ_CNS3XXX_SW_R1TXC (IRQ_TC11MP_GIC_START + 22) | ||
583 | #define IRQ_CNS3XXX_SW_R1RXC (IRQ_TC11MP_GIC_START + 23) | ||
584 | #define IRQ_CNS3XXX_SW_R1QE (IRQ_TC11MP_GIC_START + 24) | ||
585 | #define IRQ_CNS3XXX_SW_R1QF (IRQ_TC11MP_GIC_START + 25) | ||
586 | #define IRQ_CNS3XXX_SW_PPE (IRQ_TC11MP_GIC_START + 26) | ||
587 | |||
588 | #define IRQ_CNS3XXX_CRYPTO (IRQ_TC11MP_GIC_START + 27) | ||
589 | #define IRQ_CNS3XXX_HCIE (IRQ_TC11MP_GIC_START + 28) | ||
590 | #define IRQ_CNS3XXX_PCIE0_DEVICE (IRQ_TC11MP_GIC_START + 29) | ||
591 | #define IRQ_CNS3XXX_PCIE1_DEVICE (IRQ_TC11MP_GIC_START + 30) | ||
592 | #define IRQ_CNS3XXX_USB_OTG (IRQ_TC11MP_GIC_START + 31) | ||
593 | #define IRQ_CNS3XXX_USB_EHCI (IRQ_TC11MP_GIC_START + 32) | ||
594 | #define IRQ_CNS3XXX_SATA (IRQ_TC11MP_GIC_START + 33) | ||
595 | #define IRQ_CNS3XXX_RAID (IRQ_TC11MP_GIC_START + 34) | ||
596 | #define IRQ_CNS3XXX_SMC (IRQ_TC11MP_GIC_START + 35) | ||
597 | |||
598 | #define IRQ_CNS3XXX_DMAC_ABORT (IRQ_TC11MP_GIC_START + 36) | ||
599 | #define IRQ_CNS3XXX_DMAC0 (IRQ_TC11MP_GIC_START + 37) | ||
600 | #define IRQ_CNS3XXX_DMAC1 (IRQ_TC11MP_GIC_START + 38) | ||
601 | #define IRQ_CNS3XXX_DMAC2 (IRQ_TC11MP_GIC_START + 39) | ||
602 | #define IRQ_CNS3XXX_DMAC3 (IRQ_TC11MP_GIC_START + 40) | ||
603 | #define IRQ_CNS3XXX_DMAC4 (IRQ_TC11MP_GIC_START + 41) | ||
604 | #define IRQ_CNS3XXX_DMAC5 (IRQ_TC11MP_GIC_START + 42) | ||
605 | #define IRQ_CNS3XXX_DMAC6 (IRQ_TC11MP_GIC_START + 43) | ||
606 | #define IRQ_CNS3XXX_DMAC7 (IRQ_TC11MP_GIC_START + 44) | ||
607 | #define IRQ_CNS3XXX_DMAC8 (IRQ_TC11MP_GIC_START + 45) | ||
608 | #define IRQ_CNS3XXX_DMAC9 (IRQ_TC11MP_GIC_START + 46) | ||
609 | #define IRQ_CNS3XXX_DMAC10 (IRQ_TC11MP_GIC_START + 47) | ||
610 | #define IRQ_CNS3XXX_DMAC11 (IRQ_TC11MP_GIC_START + 48) | ||
611 | #define IRQ_CNS3XXX_DMAC12 (IRQ_TC11MP_GIC_START + 49) | ||
612 | #define IRQ_CNS3XXX_DMAC13 (IRQ_TC11MP_GIC_START + 50) | ||
613 | #define IRQ_CNS3XXX_DMAC14 (IRQ_TC11MP_GIC_START + 51) | ||
614 | #define IRQ_CNS3XXX_DMAC15 (IRQ_TC11MP_GIC_START + 52) | ||
615 | #define IRQ_CNS3XXX_DMAC16 (IRQ_TC11MP_GIC_START + 53) | ||
616 | #define IRQ_CNS3XXX_DMAC17 (IRQ_TC11MP_GIC_START + 54) | ||
617 | |||
618 | #define IRQ_CNS3XXX_PCIE0_RC (IRQ_TC11MP_GIC_START + 55) | ||
619 | #define IRQ_CNS3XXX_PCIE1_RC (IRQ_TC11MP_GIC_START + 56) | ||
620 | #define IRQ_CNS3XXX_TIMER0 (IRQ_TC11MP_GIC_START + 57) | ||
621 | #define IRQ_CNS3XXX_TIMER1 (IRQ_TC11MP_GIC_START + 58) | ||
622 | #define IRQ_CNS3XXX_USB_OHCI (IRQ_TC11MP_GIC_START + 59) | ||
623 | #define IRQ_CNS3XXX_TIMER2 (IRQ_TC11MP_GIC_START + 60) | ||
624 | #define IRQ_CNS3XXX_EXTERNAL_PIN0 (IRQ_TC11MP_GIC_START + 61) | ||
625 | #define IRQ_CNS3XXX_EXTERNAL_PIN1 (IRQ_TC11MP_GIC_START + 62) | ||
626 | #define IRQ_CNS3XXX_EXTERNAL_PIN2 (IRQ_TC11MP_GIC_START + 63) | ||
627 | |||
628 | #define NR_IRQS_CNS3XXX (IRQ_TC11MP_GIC_START + 64) | ||
629 | |||
630 | #if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_CNS3XXX) | ||
631 | #undef NR_IRQS | ||
632 | #define NR_IRQS NR_IRQS_CNS3XXX | ||
633 | #endif | ||
634 | |||
635 | #endif /* __MACH_BOARD_CNS3XXX_H */ | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/debug-macro.S b/arch/arm/mach-cns3xxx/include/mach/debug-macro.S new file mode 100644 index 000000000000..d16ce7eb00e9 --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/debug-macro.S | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Debugging macro include header | ||
3 | * | ||
4 | * Copyright 1994-1999 Russell King | ||
5 | * Copyright 2008 Cavium Networks | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This file 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 | .macro addruart,rx | ||
14 | mrc p15, 0, \rx, c1, c0 | ||
15 | tst \rx, #1 @ MMU enabled? | ||
16 | moveq \rx, #0x10000000 | ||
17 | movne \rx, #0xf0000000 @ virtual base | ||
18 | orr \rx, \rx, #0x00009000 | ||
19 | .endm | ||
20 | |||
21 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S new file mode 100644 index 000000000000..5e1c5545680f --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * Low-level IRQ helper macros for Cavium Networks platforms | ||
3 | * | ||
4 | * Copyright 2008 Cavium Networks | ||
5 | * | ||
6 | * This file is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License, Version 2, as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <mach/hardware.h> | ||
12 | #include <asm/hardware/gic.h> | ||
13 | |||
14 | .macro disable_fiq | ||
15 | .endm | ||
16 | |||
17 | .macro get_irqnr_preamble, base, tmp | ||
18 | ldr \base, =gic_cpu_base_addr | ||
19 | ldr \base, [\base] | ||
20 | .endm | ||
21 | |||
22 | .macro arch_ret_to_user, tmp1, tmp2 | ||
23 | .endm | ||
24 | |||
25 | /* | ||
26 | * The interrupt numbering scheme is defined in the | ||
27 | * interrupt controller spec. To wit: | ||
28 | * | ||
29 | * Interrupts 0-15 are IPI | ||
30 | * 16-28 are reserved | ||
31 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
32 | * 32-1020 are global | ||
33 | * 1021-1022 are reserved | ||
34 | * 1023 is "spurious" (no interrupt) | ||
35 | * | ||
36 | * For now, we ignore all local interrupts so only return an interrupt if it's | ||
37 | * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. | ||
38 | * | ||
39 | * A simple read from the controller will tell us the number of the highest | ||
40 | * priority enabled interrupt. We then just need to check whether it is in the | ||
41 | * valid range for an IRQ (30-1020 inclusive). | ||
42 | */ | ||
43 | |||
44 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
45 | |||
46 | ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ | ||
47 | |||
48 | ldr \tmp, =1021 | ||
49 | |||
50 | bic \irqnr, \irqstat, #0x1c00 | ||
51 | |||
52 | cmp \irqnr, #29 | ||
53 | cmpcc \irqnr, \irqnr | ||
54 | cmpne \irqnr, \tmp | ||
55 | cmpcs \irqnr, \irqnr | ||
56 | |||
57 | .endm | ||
58 | |||
59 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
60 | * register) is preserved from the macro above. | ||
61 | * If there is an IPI, we immediately signal end of interrupt on the | ||
62 | * controller, since this requires the original irqstat value which | ||
63 | * we won't easily be able to recreate later. | ||
64 | */ | ||
65 | |||
66 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
67 | bic \irqnr, \irqstat, #0x1c00 | ||
68 | cmp \irqnr, #16 | ||
69 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
70 | cmpcs \irqnr, \irqnr | ||
71 | .endm | ||
72 | |||
73 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
74 | |||
75 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
76 | bic \irqnr, \irqstat, #0x1c00 | ||
77 | mov \tmp, #0 | ||
78 | cmp \irqnr, #29 | ||
79 | moveq \tmp, #1 | ||
80 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
81 | cmp \tmp, #0 | ||
82 | .endm | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/hardware.h b/arch/arm/mach-cns3xxx/include/mach/hardware.h new file mode 100644 index 000000000000..57e09836f9d7 --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/hardware.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * This file contains the hardware definitions of the Cavium Networks boards. | ||
3 | * | ||
4 | * Copyright 2003 ARM Limited. | ||
5 | * Copyright 2008 Cavium Networks | ||
6 | * | ||
7 | * This file is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License, Version 2, as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __MACH_HARDWARE_H | ||
13 | #define __MACH_HARDWARE_H | ||
14 | |||
15 | #include <asm/sizes.h> | ||
16 | |||
17 | /* macro to get at IO space when running virtually */ | ||
18 | #define PCIBIOS_MIN_IO 0x00000000 | ||
19 | #define PCIBIOS_MIN_MEM 0x00000000 | ||
20 | #define pcibios_assign_all_busses() 1 | ||
21 | |||
22 | #endif | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/io.h b/arch/arm/mach-cns3xxx/include/mach/io.h new file mode 100644 index 000000000000..33b6fc1ece7c --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/io.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Cavium Networks | ||
3 | * Copyright 2003 ARM Limited | ||
4 | * | ||
5 | * This file is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License, Version 2, as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | #ifndef __MACH_IO_H | ||
10 | #define __MACH_IO_H | ||
11 | |||
12 | #define IO_SPACE_LIMIT 0xffffffff | ||
13 | |||
14 | #define __io(a) __typesafe_io(a) | ||
15 | #define __mem_pci(a) (a) | ||
16 | |||
17 | #endif | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/irqs.h b/arch/arm/mach-cns3xxx/include/mach/irqs.h new file mode 100644 index 000000000000..2ab96f8085c8 --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/irqs.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright 2000 Deep Blue Solutions Ltd. | ||
3 | * Copyright 2003 ARM Limited | ||
4 | * Copyright 2008 Cavium Networks | ||
5 | * | ||
6 | * This file 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 __MACH_IRQS_H | ||
12 | #define __MACH_IRQS_H | ||
13 | |||
14 | #define IRQ_LOCALTIMER 29 | ||
15 | #define IRQ_LOCALWDOG 30 | ||
16 | #define IRQ_TC11MP_GIC_START 32 | ||
17 | |||
18 | #include <mach/cns3xxx.h> | ||
19 | |||
20 | #ifndef NR_IRQS | ||
21 | #error "NR_IRQS not defined by the board-specific files" | ||
22 | #endif | ||
23 | |||
24 | #endif | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/memory.h b/arch/arm/mach-cns3xxx/include/mach/memory.h new file mode 100644 index 000000000000..3b6b769b7a27 --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/memory.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Copyright 2003 ARM Limited | ||
3 | * Copyright 2008 Cavium Networks | ||
4 | * | ||
5 | * This file is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License, Version 2, as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __MACH_MEMORY_H | ||
11 | #define __MACH_MEMORY_H | ||
12 | |||
13 | /* | ||
14 | * Physical DRAM offset. | ||
15 | */ | ||
16 | #define PHYS_OFFSET UL(0x00000000) | ||
17 | |||
18 | #define __phys_to_bus(x) ((x) + PHYS_OFFSET) | ||
19 | #define __bus_to_phys(x) ((x) - PHYS_OFFSET) | ||
20 | |||
21 | #define __virt_to_bus(v) __phys_to_bus(__virt_to_phys(v)) | ||
22 | #define __bus_to_virt(b) __phys_to_virt(__bus_to_phys(b)) | ||
23 | #define __pfn_to_bus(p) __phys_to_bus(__pfn_to_phys(p)) | ||
24 | #define __bus_to_pfn(b) __phys_to_pfn(__bus_to_phys(b)) | ||
25 | |||
26 | #endif | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/system.h b/arch/arm/mach-cns3xxx/include/mach/system.h new file mode 100644 index 000000000000..58bb03ae3cf4 --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/system.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright 2000 Deep Blue Solutions Ltd | ||
3 | * Copyright 2003 ARM Limited | ||
4 | * Copyright 2008 Cavium Networks | ||
5 | * | ||
6 | * This file 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 __MACH_SYSTEM_H | ||
12 | #define __MACH_SYSTEM_H | ||
13 | |||
14 | #include <linux/io.h> | ||
15 | #include <asm/proc-fns.h> | ||
16 | #include <mach/hardware.h> | ||
17 | |||
18 | static inline void arch_idle(void) | ||
19 | { | ||
20 | /* | ||
21 | * This should do all the clock switching | ||
22 | * and wait for interrupt tricks | ||
23 | */ | ||
24 | cpu_do_idle(); | ||
25 | } | ||
26 | |||
27 | void arch_reset(char mode, const char *cmd); | ||
28 | |||
29 | #endif | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/timex.h b/arch/arm/mach-cns3xxx/include/mach/timex.h new file mode 100644 index 000000000000..1fd04217cacb --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/timex.h | |||
@@ -0,0 +1,12 @@ | |||
1 | /* | ||
2 | * Cavium Networks architecture timex specifications | ||
3 | * | ||
4 | * Copyright 2003 ARM Limited | ||
5 | * Copyright 2008 Cavium Networks | ||
6 | * | ||
7 | * This file 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 | #define CLOCK_TICK_RATE (50000000 / 16) | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h new file mode 100644 index 000000000000..de8ead9b91f7 --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * Copyright 2003 ARM Limited | ||
3 | * Copyright 2008 Cavium Networks | ||
4 | * | ||
5 | * This file is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License, Version 2, as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #include <asm/mach-types.h> | ||
11 | #include <mach/hardware.h> | ||
12 | #include <mach/cns3xxx.h> | ||
13 | |||
14 | #define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) | ||
15 | #define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c)) | ||
16 | #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) | ||
17 | #define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18)) | ||
18 | |||
19 | /* | ||
20 | * Return the UART base address | ||
21 | */ | ||
22 | static inline unsigned long get_uart_base(void) | ||
23 | { | ||
24 | if (machine_is_cns3420vb()) | ||
25 | return CNS3XXX_UART0_BASE; | ||
26 | else | ||
27 | return 0; | ||
28 | } | ||
29 | |||
30 | /* | ||
31 | * This does not append a newline | ||
32 | */ | ||
33 | static inline void putc(int c) | ||
34 | { | ||
35 | unsigned long base = get_uart_base(); | ||
36 | |||
37 | while (AMBA_UART_FR(base) & (1 << 5)) | ||
38 | barrier(); | ||
39 | |||
40 | AMBA_UART_DR(base) = c; | ||
41 | } | ||
42 | |||
43 | static inline void flush(void) | ||
44 | { | ||
45 | unsigned long base = get_uart_base(); | ||
46 | |||
47 | while (AMBA_UART_FR(base) & (1 << 3)) | ||
48 | barrier(); | ||
49 | } | ||
50 | |||
51 | /* | ||
52 | * nothing to do | ||
53 | */ | ||
54 | #define arch_decomp_setup() | ||
55 | #define arch_decomp_wdog() | ||
diff --git a/arch/arm/mach-cns3xxx/include/mach/vmalloc.h b/arch/arm/mach-cns3xxx/include/mach/vmalloc.h new file mode 100644 index 000000000000..4d381ec05278 --- /dev/null +++ b/arch/arm/mach-cns3xxx/include/mach/vmalloc.h | |||
@@ -0,0 +1,11 @@ | |||
1 | /* | ||
2 | * Copyright 2000 Russell King. | ||
3 | * Copyright 2003 ARM Limited | ||
4 | * Copyright 2008 Cavium Networks | ||
5 | * | ||
6 | * This file 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 | #define VMALLOC_END 0xd8000000 | ||
diff --git a/arch/arm/mach-cns3xxx/pm.c b/arch/arm/mach-cns3xxx/pm.c new file mode 100644 index 000000000000..725e1a4fc231 --- /dev/null +++ b/arch/arm/mach-cns3xxx/pm.c | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Cavium Networks | ||
3 | * | ||
4 | * This file is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License, Version 2, as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/delay.h> | ||
10 | #include <mach/system.h> | ||
11 | #include <mach/cns3xxx.h> | ||
12 | |||
13 | void cns3xxx_pwr_clk_en(unsigned int block) | ||
14 | { | ||
15 | PM_CLK_GATE_REG |= (block & PM_CLK_GATE_REG_MASK); | ||
16 | } | ||
17 | |||
18 | void cns3xxx_pwr_power_up(unsigned int block) | ||
19 | { | ||
20 | PM_PLL_HM_PD_CTRL_REG &= ~(block & CNS3XXX_PWR_PLL_ALL); | ||
21 | |||
22 | /* Wait for 300us for the PLL output clock locked. */ | ||
23 | udelay(300); | ||
24 | }; | ||
25 | |||
26 | void cns3xxx_pwr_power_down(unsigned int block) | ||
27 | { | ||
28 | /* write '1' to power down */ | ||
29 | PM_PLL_HM_PD_CTRL_REG |= (block & CNS3XXX_PWR_PLL_ALL); | ||
30 | }; | ||
31 | |||
32 | static void cns3xxx_pwr_soft_rst_force(unsigned int block) | ||
33 | { | ||
34 | /* | ||
35 | * bit 0, 28, 29 => program low to reset, | ||
36 | * the other else program low and then high | ||
37 | */ | ||
38 | if (block & 0x30000001) { | ||
39 | PM_SOFT_RST_REG &= ~(block & PM_SOFT_RST_REG_MASK); | ||
40 | } else { | ||
41 | PM_SOFT_RST_REG &= ~(block & PM_SOFT_RST_REG_MASK); | ||
42 | PM_SOFT_RST_REG |= (block & PM_SOFT_RST_REG_MASK); | ||
43 | } | ||
44 | } | ||
45 | |||
46 | void cns3xxx_pwr_soft_rst(unsigned int block) | ||
47 | { | ||
48 | static unsigned int soft_reset; | ||
49 | |||
50 | if (soft_reset & block) { | ||
51 | /* SPI/I2C/GPIO use the same block, reset once. */ | ||
52 | return; | ||
53 | } else { | ||
54 | soft_reset |= block; | ||
55 | } | ||
56 | cns3xxx_pwr_soft_rst_force(block); | ||
57 | } | ||
58 | |||
59 | void arch_reset(char mode, const char *cmd) | ||
60 | { | ||
61 | /* | ||
62 | * To reset, we hit the on-board reset register | ||
63 | * in the system FPGA. | ||
64 | */ | ||
65 | cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(GLOBAL)); | ||
66 | } | ||
67 | |||
68 | /* | ||
69 | * cns3xxx_cpu_clock - return CPU/L2 clock | ||
70 | * aclk: cpu clock/2 | ||
71 | * hclk: cpu clock/4 | ||
72 | * pclk: cpu clock/8 | ||
73 | */ | ||
74 | int cns3xxx_cpu_clock(void) | ||
75 | { | ||
76 | int cpu; | ||
77 | int cpu_sel; | ||
78 | int div_sel; | ||
79 | |||
80 | cpu_sel = (PM_CLK_CTRL_REG >> PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL) & 0xf; | ||
81 | div_sel = (PM_CLK_CTRL_REG >> PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV) & 0x3; | ||
82 | |||
83 | cpu = (300 + ((cpu_sel / 3) * 100) + ((cpu_sel % 3) * 33)) >> div_sel; | ||
84 | |||
85 | return cpu; | ||
86 | } | ||
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c index caf6d5154aec..3a1a855bfdca 100644 --- a/arch/arm/mach-ep93xx/adssphere.c +++ b/arch/arm/mach-ep93xx/adssphere.c | |||
@@ -41,7 +41,7 @@ static struct platform_device adssphere_flash = { | |||
41 | .resource = &adssphere_flash_resource, | 41 | .resource = &adssphere_flash_resource, |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static struct ep93xx_eth_data adssphere_eth_data = { | 44 | static struct ep93xx_eth_data __initdata adssphere_eth_data = { |
45 | .phy_id = 1, | 45 | .phy_id = 1, |
46 | }; | 46 | }; |
47 | 47 | ||
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 5f80092b6ace..e29bdef9b2e2 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
@@ -96,6 +96,10 @@ static struct clk clk_keypad = { | |||
96 | .enable_mask = EP93XX_SYSCON_KEYTCHCLKDIV_KEN, | 96 | .enable_mask = EP93XX_SYSCON_KEYTCHCLKDIV_KEN, |
97 | .set_rate = set_keytchclk_rate, | 97 | .set_rate = set_keytchclk_rate, |
98 | }; | 98 | }; |
99 | static struct clk clk_spi = { | ||
100 | .parent = &clk_xtali, | ||
101 | .rate = EP93XX_EXT_CLK_RATE, | ||
102 | }; | ||
99 | static struct clk clk_pwm = { | 103 | static struct clk clk_pwm = { |
100 | .parent = &clk_xtali, | 104 | .parent = &clk_xtali, |
101 | .rate = EP93XX_EXT_CLK_RATE, | 105 | .rate = EP93XX_EXT_CLK_RATE, |
@@ -186,6 +190,7 @@ static struct clk_lookup clocks[] = { | |||
186 | INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), | 190 | INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), |
187 | INIT_CK("ep93xx-keypad", NULL, &clk_keypad), | 191 | INIT_CK("ep93xx-keypad", NULL, &clk_keypad), |
188 | INIT_CK("ep93xx-fb", NULL, &clk_video), | 192 | INIT_CK("ep93xx-fb", NULL, &clk_video), |
193 | INIT_CK("ep93xx-spi.0", NULL, &clk_spi), | ||
189 | INIT_CK(NULL, "pwm_clk", &clk_pwm), | 194 | INIT_CK(NULL, "pwm_clk", &clk_pwm), |
190 | INIT_CK(NULL, "m2p0", &clk_m2p0), | 195 | INIT_CK(NULL, "m2p0", &clk_m2p0), |
191 | INIT_CK(NULL, "m2p1", &clk_m2p1), | 196 | INIT_CK(NULL, "m2p1", &clk_m2p1), |
@@ -473,6 +478,14 @@ static int __init ep93xx_clock_init(void) | |||
473 | /* Initialize the pll2 derived clocks */ | 478 | /* Initialize the pll2 derived clocks */ |
474 | clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); | 479 | clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); |
475 | 480 | ||
481 | /* | ||
482 | * EP93xx SSP clock rate was doubled in version E2. For more information | ||
483 | * see: | ||
484 | * http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf | ||
485 | */ | ||
486 | if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2) | ||
487 | clk_spi.rate /= 2; | ||
488 | |||
476 | pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n", | 489 | pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n", |
477 | clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); | 490 | clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); |
478 | pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", | 491 | pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", |
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 90fb591cbffa..9092677f63eb 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -31,10 +31,12 @@ | |||
31 | #include <linux/amba/serial.h> | 31 | #include <linux/amba/serial.h> |
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <linux/i2c-gpio.h> | 33 | #include <linux/i2c-gpio.h> |
34 | #include <linux/spi/spi.h> | ||
34 | 35 | ||
35 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
36 | #include <mach/fb.h> | 37 | #include <mach/fb.h> |
37 | #include <mach/ep93xx_keypad.h> | 38 | #include <mach/ep93xx_keypad.h> |
39 | #include <mach/ep93xx_spi.h> | ||
38 | 40 | ||
39 | #include <asm/mach/map.h> | 41 | #include <asm/mach/map.h> |
40 | #include <asm/mach/time.h> | 42 | #include <asm/mach/time.h> |
@@ -222,6 +224,20 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits) | |||
222 | } | 224 | } |
223 | EXPORT_SYMBOL(ep93xx_devcfg_set_clear); | 225 | EXPORT_SYMBOL(ep93xx_devcfg_set_clear); |
224 | 226 | ||
227 | /** | ||
228 | * ep93xx_chip_revision() - returns the EP93xx chip revision | ||
229 | * | ||
230 | * See <mach/platform.h> for more information. | ||
231 | */ | ||
232 | unsigned int ep93xx_chip_revision(void) | ||
233 | { | ||
234 | unsigned int v; | ||
235 | |||
236 | v = __raw_readl(EP93XX_SYSCON_SYSCFG); | ||
237 | v &= EP93XX_SYSCON_SYSCFG_REV_MASK; | ||
238 | v >>= EP93XX_SYSCON_SYSCFG_REV_SHIFT; | ||
239 | return v; | ||
240 | } | ||
225 | 241 | ||
226 | /************************************************************************* | 242 | /************************************************************************* |
227 | * EP93xx peripheral handling | 243 | * EP93xx peripheral handling |
@@ -330,6 +346,10 @@ static struct platform_device ep93xx_ohci_device = { | |||
330 | .resource = ep93xx_ohci_resources, | 346 | .resource = ep93xx_ohci_resources, |
331 | }; | 347 | }; |
332 | 348 | ||
349 | |||
350 | /************************************************************************* | ||
351 | * EP93xx ethernet peripheral handling | ||
352 | *************************************************************************/ | ||
333 | static struct ep93xx_eth_data ep93xx_eth_data; | 353 | static struct ep93xx_eth_data ep93xx_eth_data; |
334 | 354 | ||
335 | static struct resource ep93xx_eth_resource[] = { | 355 | static struct resource ep93xx_eth_resource[] = { |
@@ -354,6 +374,12 @@ static struct platform_device ep93xx_eth_device = { | |||
354 | .resource = ep93xx_eth_resource, | 374 | .resource = ep93xx_eth_resource, |
355 | }; | 375 | }; |
356 | 376 | ||
377 | /** | ||
378 | * ep93xx_register_eth - Register the built-in ethernet platform device. | ||
379 | * @data: platform specific ethernet configuration (__initdata) | ||
380 | * @copy_addr: flag indicating that the MAC address should be copied | ||
381 | * from the IndAd registers (as programmed by the bootloader) | ||
382 | */ | ||
357 | void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) | 383 | void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) |
358 | { | 384 | { |
359 | if (copy_addr) | 385 | if (copy_addr) |
@@ -370,11 +396,19 @@ void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) | |||
370 | static struct i2c_gpio_platform_data ep93xx_i2c_data; | 396 | static struct i2c_gpio_platform_data ep93xx_i2c_data; |
371 | 397 | ||
372 | static struct platform_device ep93xx_i2c_device = { | 398 | static struct platform_device ep93xx_i2c_device = { |
373 | .name = "i2c-gpio", | 399 | .name = "i2c-gpio", |
374 | .id = 0, | 400 | .id = 0, |
375 | .dev.platform_data = &ep93xx_i2c_data, | 401 | .dev = { |
402 | .platform_data = &ep93xx_i2c_data, | ||
403 | }, | ||
376 | }; | 404 | }; |
377 | 405 | ||
406 | /** | ||
407 | * ep93xx_register_i2c - Register the i2c platform device. | ||
408 | * @data: platform specific i2c-gpio configuration (__initdata) | ||
409 | * @devices: platform specific i2c bus device information (__initdata) | ||
410 | * @num: the number of devices on the i2c bus | ||
411 | */ | ||
378 | void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | 412 | void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, |
379 | struct i2c_board_info *devices, int num) | 413 | struct i2c_board_info *devices, int num) |
380 | { | 414 | { |
@@ -398,17 +432,67 @@ void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | |||
398 | platform_device_register(&ep93xx_i2c_device); | 432 | platform_device_register(&ep93xx_i2c_device); |
399 | } | 433 | } |
400 | 434 | ||
435 | /************************************************************************* | ||
436 | * EP93xx SPI peripheral handling | ||
437 | *************************************************************************/ | ||
438 | static struct ep93xx_spi_info ep93xx_spi_master_data; | ||
439 | |||
440 | static struct resource ep93xx_spi_resources[] = { | ||
441 | { | ||
442 | .start = EP93XX_SPI_PHYS_BASE, | ||
443 | .end = EP93XX_SPI_PHYS_BASE + 0x18 - 1, | ||
444 | .flags = IORESOURCE_MEM, | ||
445 | }, | ||
446 | { | ||
447 | .start = IRQ_EP93XX_SSP, | ||
448 | .end = IRQ_EP93XX_SSP, | ||
449 | .flags = IORESOURCE_IRQ, | ||
450 | }, | ||
451 | }; | ||
452 | |||
453 | static struct platform_device ep93xx_spi_device = { | ||
454 | .name = "ep93xx-spi", | ||
455 | .id = 0, | ||
456 | .dev = { | ||
457 | .platform_data = &ep93xx_spi_master_data, | ||
458 | }, | ||
459 | .num_resources = ARRAY_SIZE(ep93xx_spi_resources), | ||
460 | .resource = ep93xx_spi_resources, | ||
461 | }; | ||
462 | |||
463 | /** | ||
464 | * ep93xx_register_spi() - registers spi platform device | ||
465 | * @info: ep93xx board specific spi master info (__initdata) | ||
466 | * @devices: SPI devices to register (__initdata) | ||
467 | * @num: number of SPI devices to register | ||
468 | * | ||
469 | * This function registers platform device for the EP93xx SPI controller and | ||
470 | * also makes sure that SPI pins are muxed so that I2S is not using those pins. | ||
471 | */ | ||
472 | void __init ep93xx_register_spi(struct ep93xx_spi_info *info, | ||
473 | struct spi_board_info *devices, int num) | ||
474 | { | ||
475 | /* | ||
476 | * When SPI is used, we need to make sure that I2S is muxed off from | ||
477 | * SPI pins. | ||
478 | */ | ||
479 | ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2SONSSP); | ||
480 | |||
481 | ep93xx_spi_master_data = *info; | ||
482 | spi_register_board_info(devices, num); | ||
483 | platform_device_register(&ep93xx_spi_device); | ||
484 | } | ||
401 | 485 | ||
402 | /************************************************************************* | 486 | /************************************************************************* |
403 | * EP93xx LEDs | 487 | * EP93xx LEDs |
404 | *************************************************************************/ | 488 | *************************************************************************/ |
405 | static struct gpio_led ep93xx_led_pins[] = { | 489 | static struct gpio_led ep93xx_led_pins[] = { |
406 | { | 490 | { |
407 | .name = "platform:grled", | 491 | .name = "platform:grled", |
408 | .gpio = EP93XX_GPIO_LINE_GRLED, | 492 | .gpio = EP93XX_GPIO_LINE_GRLED, |
409 | }, { | 493 | }, { |
410 | .name = "platform:rdled", | 494 | .name = "platform:rdled", |
411 | .gpio = EP93XX_GPIO_LINE_RDLED, | 495 | .gpio = EP93XX_GPIO_LINE_RDLED, |
412 | }, | 496 | }, |
413 | }; | 497 | }; |
414 | 498 | ||
@@ -528,7 +612,7 @@ static struct platform_device ep93xx_fb_device = { | |||
528 | .name = "ep93xx-fb", | 612 | .name = "ep93xx-fb", |
529 | .id = -1, | 613 | .id = -1, |
530 | .dev = { | 614 | .dev = { |
531 | .platform_data = &ep93xxfb_data, | 615 | .platform_data = &ep93xxfb_data, |
532 | .coherent_dma_mask = DMA_BIT_MASK(32), | 616 | .coherent_dma_mask = DMA_BIT_MASK(32), |
533 | .dma_mask = &ep93xx_fb_device.dev.coherent_dma_mask, | 617 | .dma_mask = &ep93xx_fb_device.dev.coherent_dma_mask, |
534 | }, | 618 | }, |
@@ -536,6 +620,10 @@ static struct platform_device ep93xx_fb_device = { | |||
536 | .resource = ep93xx_fb_resource, | 620 | .resource = ep93xx_fb_resource, |
537 | }; | 621 | }; |
538 | 622 | ||
623 | /** | ||
624 | * ep93xx_register_fb - Register the framebuffer platform device. | ||
625 | * @data: platform specific framebuffer configuration (__initdata) | ||
626 | */ | ||
539 | void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) | 627 | void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) |
540 | { | 628 | { |
541 | ep93xxfb_data = *data; | 629 | ep93xxfb_data = *data; |
@@ -546,6 +634,8 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) | |||
546 | /************************************************************************* | 634 | /************************************************************************* |
547 | * EP93xx matrix keypad peripheral handling | 635 | * EP93xx matrix keypad peripheral handling |
548 | *************************************************************************/ | 636 | *************************************************************************/ |
637 | static struct ep93xx_keypad_platform_data ep93xx_keypad_data; | ||
638 | |||
549 | static struct resource ep93xx_keypad_resource[] = { | 639 | static struct resource ep93xx_keypad_resource[] = { |
550 | { | 640 | { |
551 | .start = EP93XX_KEY_MATRIX_PHYS_BASE, | 641 | .start = EP93XX_KEY_MATRIX_PHYS_BASE, |
@@ -559,15 +649,22 @@ static struct resource ep93xx_keypad_resource[] = { | |||
559 | }; | 649 | }; |
560 | 650 | ||
561 | static struct platform_device ep93xx_keypad_device = { | 651 | static struct platform_device ep93xx_keypad_device = { |
562 | .name = "ep93xx-keypad", | 652 | .name = "ep93xx-keypad", |
563 | .id = -1, | 653 | .id = -1, |
564 | .num_resources = ARRAY_SIZE(ep93xx_keypad_resource), | 654 | .dev = { |
565 | .resource = ep93xx_keypad_resource, | 655 | .platform_data = &ep93xx_keypad_data, |
656 | }, | ||
657 | .num_resources = ARRAY_SIZE(ep93xx_keypad_resource), | ||
658 | .resource = ep93xx_keypad_resource, | ||
566 | }; | 659 | }; |
567 | 660 | ||
661 | /** | ||
662 | * ep93xx_register_keypad - Register the keypad platform device. | ||
663 | * @data: platform specific keypad configuration (__initdata) | ||
664 | */ | ||
568 | void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data) | 665 | void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data) |
569 | { | 666 | { |
570 | ep93xx_keypad_device.dev.platform_data = data; | 667 | ep93xx_keypad_data = *data; |
571 | platform_device_register(&ep93xx_keypad_device); | 668 | platform_device_register(&ep93xx_keypad_device); |
572 | } | 669 | } |
573 | 670 | ||
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c index d22d67ac8b99..3884182cd362 100644 --- a/arch/arm/mach-ep93xx/edb93xx.c +++ b/arch/arm/mach-ep93xx/edb93xx.c | |||
@@ -74,7 +74,7 @@ static void __init edb93xx_register_flash(void) | |||
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | static struct ep93xx_eth_data edb93xx_eth_data = { | 77 | static struct ep93xx_eth_data __initdata edb93xx_eth_data = { |
78 | .phy_id = 1, | 78 | .phy_id = 1, |
79 | }; | 79 | }; |
80 | 80 | ||
@@ -82,7 +82,7 @@ static struct ep93xx_eth_data edb93xx_eth_data = { | |||
82 | /************************************************************************* | 82 | /************************************************************************* |
83 | * EDB93xx i2c peripheral handling | 83 | * EDB93xx i2c peripheral handling |
84 | *************************************************************************/ | 84 | *************************************************************************/ |
85 | static struct i2c_gpio_platform_data edb93xx_i2c_gpio_data = { | 85 | static struct i2c_gpio_platform_data __initdata edb93xx_i2c_gpio_data = { |
86 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | 86 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, |
87 | .sda_is_open_drain = 0, | 87 | .sda_is_open_drain = 0, |
88 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | 88 | .scl_pin = EP93XX_GPIO_LINE_EECLK, |
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c index 3da7ca816d19..a809618e9f05 100644 --- a/arch/arm/mach-ep93xx/gesbc9312.c +++ b/arch/arm/mach-ep93xx/gesbc9312.c | |||
@@ -41,7 +41,7 @@ static struct platform_device gesbc9312_flash = { | |||
41 | .resource = &gesbc9312_flash_resource, | 41 | .resource = &gesbc9312_flash_resource, |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static struct ep93xx_eth_data gesbc9312_eth_data = { | 44 | static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { |
45 | .phy_id = 1, | 45 | .phy_id = 1, |
46 | }; | 46 | }; |
47 | 47 | ||
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h index 93e2ecc79ceb..b1e096f0c2d2 100644 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | |||
@@ -106,6 +106,7 @@ | |||
106 | 106 | ||
107 | #define EP93XX_AAC_BASE EP93XX_APB_IOMEM(0x00080000) | 107 | #define EP93XX_AAC_BASE EP93XX_APB_IOMEM(0x00080000) |
108 | 108 | ||
109 | #define EP93XX_SPI_PHYS_BASE EP93XX_APB_PHYS(0x000a0000) | ||
109 | #define EP93XX_SPI_BASE EP93XX_APB_IOMEM(0x000a0000) | 110 | #define EP93XX_SPI_BASE EP93XX_APB_IOMEM(0x000a0000) |
110 | 111 | ||
111 | #define EP93XX_IRDA_BASE EP93XX_APB_IOMEM(0x000b0000) | 112 | #define EP93XX_IRDA_BASE EP93XX_APB_IOMEM(0x000b0000) |
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index c6dc14dbca18..9a4413dd44bb 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h | |||
@@ -6,9 +6,11 @@ | |||
6 | 6 | ||
7 | struct i2c_gpio_platform_data; | 7 | struct i2c_gpio_platform_data; |
8 | struct i2c_board_info; | 8 | struct i2c_board_info; |
9 | struct spi_board_info; | ||
9 | struct platform_device; | 10 | struct platform_device; |
10 | struct ep93xxfb_mach_info; | 11 | struct ep93xxfb_mach_info; |
11 | struct ep93xx_keypad_platform_data; | 12 | struct ep93xx_keypad_platform_data; |
13 | struct ep93xx_spi_info; | ||
12 | 14 | ||
13 | struct ep93xx_eth_data | 15 | struct ep93xx_eth_data |
14 | { | 16 | { |
@@ -33,9 +35,19 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits) | |||
33 | ep93xx_devcfg_set_clear(0x00, bits); | 35 | ep93xx_devcfg_set_clear(0x00, bits); |
34 | } | 36 | } |
35 | 37 | ||
38 | #define EP93XX_CHIP_REV_D0 3 | ||
39 | #define EP93XX_CHIP_REV_D1 4 | ||
40 | #define EP93XX_CHIP_REV_E0 5 | ||
41 | #define EP93XX_CHIP_REV_E1 6 | ||
42 | #define EP93XX_CHIP_REV_E2 7 | ||
43 | |||
44 | unsigned int ep93xx_chip_revision(void); | ||
45 | |||
36 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); | 46 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); |
37 | void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | 47 | void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, |
38 | struct i2c_board_info *devices, int num); | 48 | struct i2c_board_info *devices, int num); |
49 | void ep93xx_register_spi(struct ep93xx_spi_info *info, | ||
50 | struct spi_board_info *devices, int num); | ||
39 | void ep93xx_register_fb(struct ep93xxfb_mach_info *data); | 51 | void ep93xx_register_fb(struct ep93xxfb_mach_info *data); |
40 | void ep93xx_register_pwm(int pwm0, int pwm1); | 52 | void ep93xx_register_pwm(int pwm0, int pwm1); |
41 | int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); | 53 | int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); |
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c index c33360e82868..1cc911b4efa6 100644 --- a/arch/arm/mach-ep93xx/micro9.c +++ b/arch/arm/mach-ep93xx/micro9.c | |||
@@ -80,7 +80,7 @@ static void __init micro9_register_flash(void) | |||
80 | /************************************************************************* | 80 | /************************************************************************* |
81 | * Micro9 Ethernet | 81 | * Micro9 Ethernet |
82 | *************************************************************************/ | 82 | *************************************************************************/ |
83 | static struct ep93xx_eth_data micro9_eth_data = { | 83 | static struct ep93xx_eth_data __initdata micro9_eth_data = { |
84 | .phy_id = 0x1f, | 84 | .phy_id = 0x1f, |
85 | }; | 85 | }; |
86 | 86 | ||
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c index cd93990f1b99..388aec95f60e 100644 --- a/arch/arm/mach-ep93xx/simone.c +++ b/arch/arm/mach-ep93xx/simone.c | |||
@@ -49,17 +49,17 @@ static struct platform_device simone_flash = { | |||
49 | }, | 49 | }, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | static struct ep93xx_eth_data simone_eth_data = { | 52 | static struct ep93xx_eth_data __initdata simone_eth_data = { |
53 | .phy_id = 1, | 53 | .phy_id = 1, |
54 | }; | 54 | }; |
55 | 55 | ||
56 | static struct ep93xxfb_mach_info simone_fb_info = { | 56 | static struct ep93xxfb_mach_info __initdata simone_fb_info = { |
57 | .num_modes = EP93XXFB_USE_MODEDB, | 57 | .num_modes = EP93XXFB_USE_MODEDB, |
58 | .bpp = 16, | 58 | .bpp = 16, |
59 | .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, | 59 | .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, |
60 | }; | 60 | }; |
61 | 61 | ||
62 | static struct i2c_gpio_platform_data simone_i2c_gpio_data = { | 62 | static struct i2c_gpio_platform_data __initdata simone_i2c_gpio_data = { |
63 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | 63 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, |
64 | .sda_is_open_drain = 0, | 64 | .sda_is_open_drain = 0, |
65 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | 65 | .scl_pin = EP93XX_GPIO_LINE_EECLK, |
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c index 51134b0382ca..38deaee40397 100644 --- a/arch/arm/mach-ep93xx/snappercl15.c +++ b/arch/arm/mach-ep93xx/snappercl15.c | |||
@@ -125,11 +125,11 @@ static struct platform_device snappercl15_nand_device = { | |||
125 | .num_resources = ARRAY_SIZE(snappercl15_nand_resource), | 125 | .num_resources = ARRAY_SIZE(snappercl15_nand_resource), |
126 | }; | 126 | }; |
127 | 127 | ||
128 | static struct ep93xx_eth_data snappercl15_eth_data = { | 128 | static struct ep93xx_eth_data __initdata snappercl15_eth_data = { |
129 | .phy_id = 1, | 129 | .phy_id = 1, |
130 | }; | 130 | }; |
131 | 131 | ||
132 | static struct i2c_gpio_platform_data snappercl15_i2c_gpio_data = { | 132 | static struct i2c_gpio_platform_data __initdata snappercl15_i2c_gpio_data = { |
133 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | 133 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, |
134 | .sda_is_open_drain = 0, | 134 | .sda_is_open_drain = 0, |
135 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | 135 | .scl_pin = EP93XX_GPIO_LINE_EECLK, |
@@ -145,7 +145,7 @@ static struct i2c_board_info __initdata snappercl15_i2c_data[] = { | |||
145 | }, | 145 | }, |
146 | }; | 146 | }; |
147 | 147 | ||
148 | static struct ep93xxfb_mach_info snappercl15_fb_info = { | 148 | static struct ep93xxfb_mach_info __initdata snappercl15_fb_info = { |
149 | .num_modes = EP93XXFB_USE_MODEDB, | 149 | .num_modes = EP93XXFB_USE_MODEDB, |
150 | .bpp = 16, | 150 | .bpp = 16, |
151 | }; | 151 | }; |
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index fac1ec7a60fb..9553031900b0 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c | |||
@@ -186,7 +186,7 @@ static struct platform_device ts72xx_wdt_device = { | |||
186 | .resource = ts72xx_wdt_resources, | 186 | .resource = ts72xx_wdt_resources, |
187 | }; | 187 | }; |
188 | 188 | ||
189 | static struct ep93xx_eth_data ts72xx_eth_data = { | 189 | static struct ep93xx_eth_data __initdata ts72xx_eth_data = { |
190 | .phy_id = 1, | 190 | .phy_id = 1, |
191 | }; | 191 | }; |
192 | 192 | ||
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index df97d16390e3..27db275b367c 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig | |||
@@ -11,6 +11,7 @@ config ARCH_INTEGRATOR_AP | |||
11 | config ARCH_INTEGRATOR_CP | 11 | config ARCH_INTEGRATOR_CP |
12 | bool "Support Integrator/CP platform" | 12 | bool "Support Integrator/CP platform" |
13 | select ARCH_CINTEGRATOR | 13 | select ARCH_CINTEGRATOR |
14 | select ARM_TIMER_SP804 | ||
14 | help | 15 | help |
15 | Include support for the ARM(R) Integrator CP platform. | 16 | Include support for the ARM(R) Integrator CP platform. |
16 | 17 | ||
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile index 6a5ef8d30b10..ebeef966e1f5 100644 --- a/arch/arm/mach-integrator/Makefile +++ b/arch/arm/mach-integrator/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | # Object file lists. | 5 | # Object file lists. |
6 | 6 | ||
7 | obj-y := clock.o core.o lm.o | 7 | obj-y := core.o lm.o |
8 | obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o | 8 | obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o |
9 | obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o | 9 | obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o |
10 | 10 | ||
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h deleted file mode 100644 index 609c49de3d47..000000000000 --- a/arch/arm/mach-integrator/common.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | extern void integrator_time_init(unsigned long, unsigned int); | ||
2 | extern unsigned long integrator_gettimeoffset(void); | ||
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 8b390e36ba69..b02cfc06e0ae 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c | |||
@@ -24,15 +24,13 @@ | |||
24 | #include <asm/clkdev.h> | 24 | #include <asm/clkdev.h> |
25 | #include <mach/clkdev.h> | 25 | #include <mach/clkdev.h> |
26 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
27 | #include <mach/platform.h> | ||
27 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
28 | #include <asm/hardware/arm_timer.h> | ||
29 | #include <mach/cm.h> | 29 | #include <mach/cm.h> |
30 | #include <asm/system.h> | 30 | #include <asm/system.h> |
31 | #include <asm/leds.h> | 31 | #include <asm/leds.h> |
32 | #include <asm/mach/time.h> | 32 | #include <asm/mach/time.h> |
33 | 33 | ||
34 | #include "common.h" | ||
35 | |||
36 | static struct amba_pl010_data integrator_uart_data; | 34 | static struct amba_pl010_data integrator_uart_data; |
37 | 35 | ||
38 | static struct amba_device rtc_device = { | 36 | static struct amba_device rtc_device = { |
@@ -163,8 +161,8 @@ arch_initcall(integrator_init); | |||
163 | * UART0 7 6 | 161 | * UART0 7 6 |
164 | * UART1 5 4 | 162 | * UART1 5 4 |
165 | */ | 163 | */ |
166 | #define SC_CTRLC (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLC_OFFSET) | 164 | #define SC_CTRLC IO_ADDRESS(INTEGRATOR_SC_CTRLC) |
167 | #define SC_CTRLS (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLS_OFFSET) | 165 | #define SC_CTRLS IO_ADDRESS(INTEGRATOR_SC_CTRLS) |
168 | 166 | ||
169 | static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) | 167 | static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) |
170 | { | 168 | { |
@@ -196,7 +194,7 @@ static struct amba_pl010_data integrator_uart_data = { | |||
196 | .set_mctrl = integrator_uart_set_mctrl, | 194 | .set_mctrl = integrator_uart_set_mctrl, |
197 | }; | 195 | }; |
198 | 196 | ||
199 | #define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET | 197 | #define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_CTRL) |
200 | 198 | ||
201 | static DEFINE_SPINLOCK(cm_lock); | 199 | static DEFINE_SPINLOCK(cm_lock); |
202 | 200 | ||
@@ -217,120 +215,3 @@ void cm_control(u32 mask, u32 set) | |||
217 | } | 215 | } |
218 | 216 | ||
219 | EXPORT_SYMBOL(cm_control); | 217 | EXPORT_SYMBOL(cm_control); |
220 | |||
221 | /* | ||
222 | * Where is the timer (VA)? | ||
223 | */ | ||
224 | #define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000) | ||
225 | #define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100) | ||
226 | #define TIMER2_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000200) | ||
227 | #define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) | ||
228 | |||
229 | /* | ||
230 | * How long is the timer interval? | ||
231 | */ | ||
232 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
233 | #if TIMER_INTERVAL >= 0x100000 | ||
234 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
235 | #elif TIMER_INTERVAL >= 0x10000 | ||
236 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
237 | #else | ||
238 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
239 | #endif | ||
240 | |||
241 | static unsigned long timer_reload; | ||
242 | |||
243 | /* | ||
244 | * Returns number of ms since last clock interrupt. Note that interrupts | ||
245 | * will have been disabled by do_gettimeoffset() | ||
246 | */ | ||
247 | unsigned long integrator_gettimeoffset(void) | ||
248 | { | ||
249 | unsigned long ticks1, ticks2, status; | ||
250 | |||
251 | /* | ||
252 | * Get the current number of ticks. Note that there is a race | ||
253 | * condition between us reading the timer and checking for | ||
254 | * an interrupt. We get around this by ensuring that the | ||
255 | * counter has not reloaded between our two reads. | ||
256 | */ | ||
257 | ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff; | ||
258 | do { | ||
259 | ticks1 = ticks2; | ||
260 | status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS); | ||
261 | ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff; | ||
262 | } while (ticks2 > ticks1); | ||
263 | |||
264 | /* | ||
265 | * Number of ticks since last interrupt. | ||
266 | */ | ||
267 | ticks1 = timer_reload - ticks2; | ||
268 | |||
269 | /* | ||
270 | * Interrupt pending? If so, we've reloaded once already. | ||
271 | */ | ||
272 | if (status & (1 << IRQ_TIMERINT1)) | ||
273 | ticks1 += timer_reload; | ||
274 | |||
275 | /* | ||
276 | * Convert the ticks to usecs | ||
277 | */ | ||
278 | return TICKS2USECS(ticks1); | ||
279 | } | ||
280 | |||
281 | /* | ||
282 | * IRQ handler for the timer | ||
283 | */ | ||
284 | static irqreturn_t | ||
285 | integrator_timer_interrupt(int irq, void *dev_id) | ||
286 | { | ||
287 | /* | ||
288 | * clear the interrupt | ||
289 | */ | ||
290 | writel(1, TIMER1_VA_BASE + TIMER_INTCLR); | ||
291 | |||
292 | timer_tick(); | ||
293 | |||
294 | return IRQ_HANDLED; | ||
295 | } | ||
296 | |||
297 | static struct irqaction integrator_timer_irq = { | ||
298 | .name = "Integrator Timer Tick", | ||
299 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
300 | .handler = integrator_timer_interrupt, | ||
301 | }; | ||
302 | |||
303 | /* | ||
304 | * Set up timer interrupt, and return the current time in seconds. | ||
305 | */ | ||
306 | void __init integrator_time_init(unsigned long reload, unsigned int ctrl) | ||
307 | { | ||
308 | unsigned int timer_ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC; | ||
309 | |||
310 | timer_reload = reload; | ||
311 | timer_ctrl |= ctrl; | ||
312 | |||
313 | if (timer_reload > 0x100000) { | ||
314 | timer_reload >>= 8; | ||
315 | timer_ctrl |= TIMER_CTRL_DIV256; | ||
316 | } else if (timer_reload > 0x010000) { | ||
317 | timer_reload >>= 4; | ||
318 | timer_ctrl |= TIMER_CTRL_DIV16; | ||
319 | } | ||
320 | |||
321 | /* | ||
322 | * Initialise to a known state (all timers off) | ||
323 | */ | ||
324 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); | ||
325 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); | ||
326 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | ||
327 | |||
328 | writel(timer_reload, TIMER1_VA_BASE + TIMER_LOAD); | ||
329 | writel(timer_reload, TIMER1_VA_BASE + TIMER_VALUE); | ||
330 | writel(timer_ctrl, TIMER1_VA_BASE + TIMER_CTRL); | ||
331 | |||
332 | /* | ||
333 | * Make irqs happen for the system timer | ||
334 | */ | ||
335 | setup_irq(IRQ_TIMERINT1, &integrator_timer_irq); | ||
336 | } | ||
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c index f77f20255045..a3fbcb3adc29 100644 --- a/arch/arm/mach-integrator/cpu.c +++ b/arch/arm/mach-integrator/cpu.c | |||
@@ -19,32 +19,39 @@ | |||
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | 20 | ||
21 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
22 | #include <mach/platform.h> | ||
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
23 | #include <asm/hardware/icst525.h> | 24 | #include <asm/hardware/icst.h> |
24 | 25 | ||
25 | static struct cpufreq_driver integrator_driver; | 26 | static struct cpufreq_driver integrator_driver; |
26 | 27 | ||
27 | #define CM_ID (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_ID_OFFSET) | 28 | #define CM_ID IO_ADDRESS(INTEGRATOR_HDR_ID) |
28 | #define CM_OSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_OSC_OFFSET) | 29 | #define CM_OSC IO_ADDRESS(INTEGRATOR_HDR_OSC) |
29 | #define CM_STAT (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_STAT_OFFSET) | 30 | #define CM_STAT IO_ADDRESS(INTEGRATOR_HDR_STAT) |
30 | #define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) | 31 | #define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) |
31 | 32 | ||
32 | static const struct icst525_params lclk_params = { | 33 | static const struct icst_params lclk_params = { |
33 | .ref = 24000, | 34 | .ref = 24000000, |
34 | .vco_max = 320000, | 35 | .vco_max = ICST525_VCO_MAX_5V, |
36 | .vco_min = ICST525_VCO_MIN, | ||
35 | .vd_min = 8, | 37 | .vd_min = 8, |
36 | .vd_max = 132, | 38 | .vd_max = 132, |
37 | .rd_min = 24, | 39 | .rd_min = 24, |
38 | .rd_max = 24, | 40 | .rd_max = 24, |
41 | .s2div = icst525_s2div, | ||
42 | .idx2s = icst525_idx2s, | ||
39 | }; | 43 | }; |
40 | 44 | ||
41 | static const struct icst525_params cclk_params = { | 45 | static const struct icst_params cclk_params = { |
42 | .ref = 24000, | 46 | .ref = 24000000, |
43 | .vco_max = 320000, | 47 | .vco_max = ICST525_VCO_MAX_5V, |
48 | .vco_min = ICST525_VCO_MIN, | ||
44 | .vd_min = 12, | 49 | .vd_min = 12, |
45 | .vd_max = 160, | 50 | .vd_max = 160, |
46 | .rd_min = 24, | 51 | .rd_min = 24, |
47 | .rd_max = 24, | 52 | .rd_max = 24, |
53 | .s2div = icst525_s2div, | ||
54 | .idx2s = icst525_idx2s, | ||
48 | }; | 55 | }; |
49 | 56 | ||
50 | /* | 57 | /* |
@@ -52,17 +59,17 @@ static const struct icst525_params cclk_params = { | |||
52 | */ | 59 | */ |
53 | static int integrator_verify_policy(struct cpufreq_policy *policy) | 60 | static int integrator_verify_policy(struct cpufreq_policy *policy) |
54 | { | 61 | { |
55 | struct icst525_vco vco; | 62 | struct icst_vco vco; |
56 | 63 | ||
57 | cpufreq_verify_within_limits(policy, | 64 | cpufreq_verify_within_limits(policy, |
58 | policy->cpuinfo.min_freq, | 65 | policy->cpuinfo.min_freq, |
59 | policy->cpuinfo.max_freq); | 66 | policy->cpuinfo.max_freq); |
60 | 67 | ||
61 | vco = icst525_khz_to_vco(&cclk_params, policy->max); | 68 | vco = icst_hz_to_vco(&cclk_params, policy->max * 1000); |
62 | policy->max = icst525_khz(&cclk_params, vco); | 69 | policy->max = icst_hz(&cclk_params, vco) / 1000; |
63 | 70 | ||
64 | vco = icst525_khz_to_vco(&cclk_params, policy->min); | 71 | vco = icst_hz_to_vco(&cclk_params, policy->min * 1000); |
65 | policy->min = icst525_khz(&cclk_params, vco); | 72 | policy->min = icst_hz(&cclk_params, vco) / 1000; |
66 | 73 | ||
67 | cpufreq_verify_within_limits(policy, | 74 | cpufreq_verify_within_limits(policy, |
68 | policy->cpuinfo.min_freq, | 75 | policy->cpuinfo.min_freq, |
@@ -78,7 +85,7 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
78 | { | 85 | { |
79 | cpumask_t cpus_allowed; | 86 | cpumask_t cpus_allowed; |
80 | int cpu = policy->cpu; | 87 | int cpu = policy->cpu; |
81 | struct icst525_vco vco; | 88 | struct icst_vco vco; |
82 | struct cpufreq_freqs freqs; | 89 | struct cpufreq_freqs freqs; |
83 | u_int cm_osc; | 90 | u_int cm_osc; |
84 | 91 | ||
@@ -104,17 +111,17 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
104 | } | 111 | } |
105 | vco.v = cm_osc & 255; | 112 | vco.v = cm_osc & 255; |
106 | vco.r = 22; | 113 | vco.r = 22; |
107 | freqs.old = icst525_khz(&cclk_params, vco); | 114 | freqs.old = icst_hz(&cclk_params, vco) / 1000; |
108 | 115 | ||
109 | /* icst525_khz_to_vco rounds down -- so we need the next | 116 | /* icst_hz_to_vco rounds down -- so we need the next |
110 | * larger freq in case of CPUFREQ_RELATION_L. | 117 | * larger freq in case of CPUFREQ_RELATION_L. |
111 | */ | 118 | */ |
112 | if (relation == CPUFREQ_RELATION_L) | 119 | if (relation == CPUFREQ_RELATION_L) |
113 | target_freq += 999; | 120 | target_freq += 999; |
114 | if (target_freq > policy->max) | 121 | if (target_freq > policy->max) |
115 | target_freq = policy->max; | 122 | target_freq = policy->max; |
116 | vco = icst525_khz_to_vco(&cclk_params, target_freq); | 123 | vco = icst_hz_to_vco(&cclk_params, target_freq * 1000); |
117 | freqs.new = icst525_khz(&cclk_params, vco); | 124 | freqs.new = icst_hz(&cclk_params, vco) / 1000; |
118 | 125 | ||
119 | freqs.cpu = policy->cpu; | 126 | freqs.cpu = policy->cpu; |
120 | 127 | ||
@@ -154,7 +161,7 @@ static unsigned int integrator_get(unsigned int cpu) | |||
154 | cpumask_t cpus_allowed; | 161 | cpumask_t cpus_allowed; |
155 | unsigned int current_freq; | 162 | unsigned int current_freq; |
156 | u_int cm_osc; | 163 | u_int cm_osc; |
157 | struct icst525_vco vco; | 164 | struct icst_vco vco; |
158 | 165 | ||
159 | cpus_allowed = current->cpus_allowed; | 166 | cpus_allowed = current->cpus_allowed; |
160 | 167 | ||
@@ -172,7 +179,7 @@ static unsigned int integrator_get(unsigned int cpu) | |||
172 | vco.v = cm_osc & 255; | 179 | vco.v = cm_osc & 255; |
173 | vco.r = 22; | 180 | vco.r = 22; |
174 | 181 | ||
175 | current_freq = icst525_khz(&cclk_params, vco); /* current freq */ | 182 | current_freq = icst_hz(&cclk_params, vco) / 1000; /* current freq */ |
176 | 183 | ||
177 | set_cpus_allowed(current, cpus_allowed); | 184 | set_cpus_allowed(current, cpus_allowed); |
178 | 185 | ||
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 41b10725cef7..fd684bf205e5 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #include <asm/clkdev.h> | 26 | #include <asm/clkdev.h> |
27 | #include <mach/clkdev.h> | 27 | #include <mach/clkdev.h> |
28 | #include <asm/hardware/icst525.h> | 28 | #include <asm/hardware/icst.h> |
29 | #include <mach/lm.h> | 29 | #include <mach/lm.h> |
30 | #include <mach/impd1.h> | 30 | #include <mach/impd1.h> |
31 | #include <asm/sizes.h> | 31 | #include <asm/sizes.h> |
@@ -41,32 +41,25 @@ struct impd1_module { | |||
41 | struct clk_lookup *clks[3]; | 41 | struct clk_lookup *clks[3]; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static const struct icst525_params impd1_vco_params = { | 44 | static const struct icst_params impd1_vco_params = { |
45 | .ref = 24000, /* 24 MHz */ | 45 | .ref = 24000000, /* 24 MHz */ |
46 | .vco_max = 200000, /* 200 MHz */ | 46 | .vco_max = ICST525_VCO_MAX_3V, |
47 | .vco_min = ICST525_VCO_MIN, | ||
47 | .vd_min = 12, | 48 | .vd_min = 12, |
48 | .vd_max = 519, | 49 | .vd_max = 519, |
49 | .rd_min = 3, | 50 | .rd_min = 3, |
50 | .rd_max = 120, | 51 | .rd_max = 120, |
52 | .s2div = icst525_s2div, | ||
53 | .idx2s = icst525_idx2s, | ||
51 | }; | 54 | }; |
52 | 55 | ||
53 | static void impd1_setvco(struct clk *clk, struct icst525_vco vco) | 56 | static void impd1_setvco(struct clk *clk, struct icst_vco vco) |
54 | { | 57 | { |
55 | struct impd1_module *impd1 = clk->data; | 58 | struct impd1_module *impd1 = clk->data; |
56 | int vconr = clk - impd1->vcos; | 59 | u32 val = vco.v | (vco.r << 9) | (vco.s << 16); |
57 | u32 val; | ||
58 | |||
59 | val = vco.v | (vco.r << 9) | (vco.s << 16); | ||
60 | 60 | ||
61 | writel(0xa05f, impd1->base + IMPD1_LOCK); | 61 | writel(0xa05f, impd1->base + IMPD1_LOCK); |
62 | switch (vconr) { | 62 | writel(val, clk->vcoreg); |
63 | case 0: | ||
64 | writel(val, impd1->base + IMPD1_OSC1); | ||
65 | break; | ||
66 | case 1: | ||
67 | writel(val, impd1->base + IMPD1_OSC2); | ||
68 | break; | ||
69 | } | ||
70 | writel(0, impd1->base + IMPD1_LOCK); | 63 | writel(0, impd1->base + IMPD1_LOCK); |
71 | 64 | ||
72 | #ifdef DEBUG | 65 | #ifdef DEBUG |
@@ -74,11 +67,17 @@ static void impd1_setvco(struct clk *clk, struct icst525_vco vco) | |||
74 | vco.r = (val >> 9) & 0x7f; | 67 | vco.r = (val >> 9) & 0x7f; |
75 | vco.s = (val >> 16) & 7; | 68 | vco.s = (val >> 16) & 7; |
76 | 69 | ||
77 | pr_debug("IM-PD1: VCO%d clock is %ld kHz\n", | 70 | pr_debug("IM-PD1: VCO%d clock is %ld Hz\n", |
78 | vconr, icst525_khz(&impd1_vco_params, vco)); | 71 | vconr, icst525_hz(&impd1_vco_params, vco)); |
79 | #endif | 72 | #endif |
80 | } | 73 | } |
81 | 74 | ||
75 | static const struct clk_ops impd1_clk_ops = { | ||
76 | .round = icst_clk_round, | ||
77 | .set = icst_clk_set, | ||
78 | .setvco = impd1_setvco, | ||
79 | }; | ||
80 | |||
82 | void impd1_tweak_control(struct device *dev, u32 mask, u32 val) | 81 | void impd1_tweak_control(struct device *dev, u32 mask, u32 val) |
83 | { | 82 | { |
84 | struct impd1_module *impd1 = dev_get_drvdata(dev); | 83 | struct impd1_module *impd1 = dev_get_drvdata(dev); |
@@ -374,11 +373,13 @@ static int impd1_probe(struct lm_device *dev) | |||
374 | (unsigned long)dev->resource.start); | 373 | (unsigned long)dev->resource.start); |
375 | 374 | ||
376 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { | 375 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { |
376 | impd1->vcos[i].ops = &impd1_clk_ops, | ||
377 | impd1->vcos[i].owner = THIS_MODULE, | 377 | impd1->vcos[i].owner = THIS_MODULE, |
378 | impd1->vcos[i].params = &impd1_vco_params, | 378 | impd1->vcos[i].params = &impd1_vco_params, |
379 | impd1->vcos[i].data = impd1, | 379 | impd1->vcos[i].data = impd1; |
380 | impd1->vcos[i].setvco = impd1_setvco; | ||
381 | } | 380 | } |
381 | impd1->vcos[0].vcoreg = impd1->base + IMPD1_OSC1; | ||
382 | impd1->vcos[1].vcoreg = impd1->base + IMPD1_OSC2; | ||
382 | 383 | ||
383 | impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", | 384 | impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", |
384 | dev->id); | 385 | dev->id); |
diff --git a/arch/arm/mach-integrator/include/mach/clkdev.h b/arch/arm/mach-integrator/include/mach/clkdev.h index 9293e410832a..bfe07679faec 100644 --- a/arch/arm/mach-integrator/include/mach/clkdev.h +++ b/arch/arm/mach-integrator/include/mach/clkdev.h | |||
@@ -2,14 +2,15 @@ | |||
2 | #define __ASM_MACH_CLKDEV_H | 2 | #define __ASM_MACH_CLKDEV_H |
3 | 3 | ||
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <asm/hardware/icst525.h> | 5 | #include <plat/clock.h> |
6 | 6 | ||
7 | struct clk { | 7 | struct clk { |
8 | unsigned long rate; | 8 | unsigned long rate; |
9 | const struct clk_ops *ops; | ||
9 | struct module *owner; | 10 | struct module *owner; |
10 | const struct icst525_params *params; | 11 | const struct icst_params *params; |
12 | void __iomem *vcoreg; | ||
11 | void *data; | 13 | void *data; |
12 | void (*setvco)(struct clk *, struct icst525_vco vco); | ||
13 | }; | 14 | }; |
14 | 15 | ||
15 | static inline int __clk_get(struct clk *clk) | 16 | static inline int __clk_get(struct clk *clk) |
diff --git a/arch/arm/mach-integrator/include/mach/entry-macro.S b/arch/arm/mach-integrator/include/mach/entry-macro.S index 7649c57acb53..3d029c9f3ef6 100644 --- a/arch/arm/mach-integrator/include/mach/entry-macro.S +++ b/arch/arm/mach-integrator/include/mach/entry-macro.S | |||
@@ -8,6 +8,7 @@ | |||
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | 9 | */ |
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | #include <mach/platform.h> | ||
11 | #include <mach/irqs.h> | 12 | #include <mach/irqs.h> |
12 | 13 | ||
13 | .macro disable_fiq | 14 | .macro disable_fiq |
diff --git a/arch/arm/mach-integrator/include/mach/hardware.h b/arch/arm/mach-integrator/include/mach/hardware.h index d795642fad22..8e26360ce9a3 100644 --- a/arch/arm/mach-integrator/include/mach/hardware.h +++ b/arch/arm/mach-integrator/include/mach/hardware.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #define __ASM_ARCH_HARDWARE_H | 23 | #define __ASM_ARCH_HARDWARE_H |
24 | 24 | ||
25 | #include <asm/sizes.h> | 25 | #include <asm/sizes.h> |
26 | #include <mach/platform.h> | ||
27 | 26 | ||
28 | /* | 27 | /* |
29 | * Where in virtual memory the IO devices (timers, system controllers | 28 | * Where in virtual memory the IO devices (timers, system controllers |
@@ -36,17 +35,19 @@ | |||
36 | #define PCIO_BASE PCI_IO_VADDR | 35 | #define PCIO_BASE PCI_IO_VADDR |
37 | #define PCIMEM_BASE PCI_MEMORY_VADDR | 36 | #define PCIMEM_BASE PCI_MEMORY_VADDR |
38 | 37 | ||
39 | #ifdef CONFIG_MMU | ||
40 | /* macro to get at IO space when running virtually */ | ||
41 | #define IO_ADDRESS(x) (((x) >> 4) + IO_BASE) | ||
42 | #else | ||
43 | #define IO_ADDRESS(x) (x) | ||
44 | #endif | ||
45 | |||
46 | #define pcibios_assign_all_busses() 1 | 38 | #define pcibios_assign_all_busses() 1 |
47 | 39 | ||
48 | #define PCIBIOS_MIN_IO 0x6000 | 40 | #define PCIBIOS_MIN_IO 0x6000 |
49 | #define PCIBIOS_MIN_MEM 0x00100000 | 41 | #define PCIBIOS_MIN_MEM 0x00100000 |
50 | 42 | ||
43 | /* macro to get at IO space when running virtually */ | ||
44 | #ifdef CONFIG_MMU | ||
45 | #define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE) | ||
46 | #else | ||
47 | #define IO_ADDRESS(x) (x) | ||
48 | #endif | ||
49 | |||
50 | #define __io_address(n) ((void __iomem *)IO_ADDRESS(n)) | ||
51 | |||
51 | #endif | 52 | #endif |
52 | 53 | ||
diff --git a/arch/arm/mach-integrator/include/mach/platform.h b/arch/arm/mach-integrator/include/mach/platform.h index e00a2624f269..5e6ea5cfea6e 100644 --- a/arch/arm/mach-integrator/include/mach/platform.h +++ b/arch/arm/mach-integrator/include/mach/platform.h | |||
@@ -23,9 +23,6 @@ | |||
23 | * | 23 | * |
24 | * Integrator address map | 24 | * Integrator address map |
25 | * | 25 | * |
26 | * NOTE: This is a multi-hosted header file for use with uHAL and | ||
27 | * supported debuggers. | ||
28 | * | ||
29 | * ***********************************************************************/ | 26 | * ***********************************************************************/ |
30 | 27 | ||
31 | #ifndef __address_h | 28 | #ifndef __address_h |
@@ -290,12 +287,14 @@ | |||
290 | #define INTEGRATOR_DBG_LEDS (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET) | 287 | #define INTEGRATOR_DBG_LEDS (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET) |
291 | #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) | 288 | #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) |
292 | 289 | ||
290 | #define INTEGRATOR_AP_GPIO_BASE 0x1B000000 /* GPIO */ | ||
293 | 291 | ||
294 | #if defined(CONFIG_ARCH_INTEGRATOR_AP) | 292 | #define INTEGRATOR_CP_MMC_BASE 0x1C000000 /* MMC */ |
295 | #define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */ | 293 | #define INTEGRATOR_CP_AACI_BASE 0x1D000000 /* AACI */ |
296 | #elif defined(CONFIG_ARCH_INTEGRATOR_CP) | 294 | #define INTEGRATOR_CP_ETH_BASE 0xC8000000 /* Ethernet */ |
297 | #define INTEGRATOR_GPIO_BASE 0xC9000000 /* GPIO */ | 295 | #define INTEGRATOR_CP_GPIO_BASE 0xC9000000 /* GPIO */ |
298 | #endif | 296 | #define INTEGRATOR_CP_SIC_BASE 0xCA000000 /* SIC */ |
297 | #define INTEGRATOR_CP_CTL_BASE 0xCB000000 /* CP system control */ | ||
299 | 298 | ||
300 | /* ------------------------------------------------------------------------ | 299 | /* ------------------------------------------------------------------------ |
301 | * KMI keyboard/mouse definitions | 300 | * KMI keyboard/mouse definitions |
@@ -328,20 +327,6 @@ | |||
328 | */ | 327 | */ |
329 | #define PHYS_PCI_V3_BASE 0x62000000 | 328 | #define PHYS_PCI_V3_BASE 0x62000000 |
330 | 329 | ||
331 | #define PCI_DRAMSIZE INTEGRATOR_SSRAM_SIZE | ||
332 | |||
333 | /* 'export' these to UHAL */ | ||
334 | #define UHAL_PCI_IO PCI_IO_BASE | ||
335 | #define UHAL_PCI_MEM PCI_MEM_BASE | ||
336 | #define UHAL_PCI_ALLOC_IO_BASE 0x00004000 | ||
337 | #define UHAL_PCI_ALLOC_MEM_BASE PCI_MEM_BASE | ||
338 | #define UHAL_PCI_MAX_SLOT 20 | ||
339 | |||
340 | /* ======================================================================== | ||
341 | * Start of uHAL definitions | ||
342 | * ======================================================================== | ||
343 | */ | ||
344 | |||
345 | /* ------------------------------------------------------------------------ | 330 | /* ------------------------------------------------------------------------ |
346 | * Integrator Interrupt Controllers | 331 | * Integrator Interrupt Controllers |
347 | * ------------------------------------------------------------------------ | 332 | * ------------------------------------------------------------------------ |
@@ -389,7 +374,7 @@ | |||
389 | */ | 374 | */ |
390 | 375 | ||
391 | /* ------------------------------------------------------------------------ | 376 | /* ------------------------------------------------------------------------ |
392 | * LED's - The header LED is not accessible via the uHAL API | 377 | * LED's |
393 | * ------------------------------------------------------------------------ | 378 | * ------------------------------------------------------------------------ |
394 | * | 379 | * |
395 | */ | 380 | */ |
@@ -402,34 +387,18 @@ | |||
402 | #define LED_BANK INTEGRATOR_DBG_LEDS | 387 | #define LED_BANK INTEGRATOR_DBG_LEDS |
403 | 388 | ||
404 | /* | 389 | /* |
405 | * Memory definitions - run uHAL out of SSRAM. | ||
406 | * | ||
407 | */ | ||
408 | #define uHAL_MEMORY_SIZE INTEGRATOR_SSRAM_SIZE | ||
409 | |||
410 | /* | ||
411 | * Clean base - dummy | ||
412 | * | ||
413 | */ | ||
414 | #define CLEAN_BASE INTEGRATOR_BOOT_ROM_HI | ||
415 | |||
416 | /* | ||
417 | * Timer definitions | 390 | * Timer definitions |
418 | * | 391 | * |
419 | * Only use timer 1 & 2 | 392 | * Only use timer 1 & 2 |
420 | * (both run at 24MHz and will need the clock divider set to 16). | 393 | * (both run at 24MHz and will need the clock divider set to 16). |
421 | * | 394 | * |
422 | * Timer 0 runs at bus frequency and therefore could vary and currently | 395 | * Timer 0 runs at bus frequency |
423 | * uHAL can't handle that. | ||
424 | * | ||
425 | */ | 396 | */ |
426 | 397 | ||
427 | #define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE | 398 | #define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE |
428 | #define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100) | 399 | #define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100) |
429 | #define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200) | 400 | #define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200) |
430 | 401 | ||
431 | #define MAX_TIMER 2 | ||
432 | #define MAX_PERIOD 699050 | ||
433 | #define TICKS_PER_uSEC 24 | 402 | #define TICKS_PER_uSEC 24 |
434 | 403 | ||
435 | /* | 404 | /* |
@@ -437,14 +406,9 @@ | |||
437 | * | 406 | * |
438 | */ | 407 | */ |
439 | #define mSEC_1 1000 | 408 | #define mSEC_1 1000 |
440 | #define mSEC_5 (mSEC_1 * 5) | ||
441 | #define mSEC_10 (mSEC_1 * 10) | 409 | #define mSEC_10 (mSEC_1 * 10) |
442 | #define mSEC_25 (mSEC_1 * 25) | ||
443 | #define SEC_1 (mSEC_1 * 1000) | ||
444 | 410 | ||
445 | #define INTEGRATOR_CSR_BASE 0x10000000 | 411 | #define INTEGRATOR_CSR_BASE 0x10000000 |
446 | #define INTEGRATOR_CSR_SIZE 0x10000000 | 412 | #define INTEGRATOR_CSR_SIZE 0x10000000 |
447 | 413 | ||
448 | #endif | 414 | #endif |
449 | |||
450 | /* END */ | ||
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 8138a7e24562..227cf4d05088 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -27,9 +27,14 @@ | |||
27 | #include <linux/sysdev.h> | 27 | #include <linux/sysdev.h> |
28 | #include <linux/amba/bus.h> | 28 | #include <linux/amba/bus.h> |
29 | #include <linux/amba/kmi.h> | 29 | #include <linux/amba/kmi.h> |
30 | #include <linux/clocksource.h> | ||
31 | #include <linux/clockchips.h> | ||
32 | #include <linux/interrupt.h> | ||
30 | #include <linux/io.h> | 33 | #include <linux/io.h> |
31 | 34 | ||
32 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
36 | #include <mach/platform.h> | ||
37 | #include <asm/hardware/arm_timer.h> | ||
33 | #include <asm/irq.h> | 38 | #include <asm/irq.h> |
34 | #include <asm/setup.h> | 39 | #include <asm/setup.h> |
35 | #include <asm/param.h> /* HZ */ | 40 | #include <asm/param.h> /* HZ */ |
@@ -43,8 +48,6 @@ | |||
43 | #include <asm/mach/map.h> | 48 | #include <asm/mach/map.h> |
44 | #include <asm/mach/time.h> | 49 | #include <asm/mach/time.h> |
45 | 50 | ||
46 | #include "common.h" | ||
47 | |||
48 | /* | 51 | /* |
49 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx | 52 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx |
50 | * is the (PA >> 12). | 53 | * is the (PA >> 12). |
@@ -55,7 +58,7 @@ | |||
55 | #define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) | 58 | #define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) |
56 | #define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE) | 59 | #define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE) |
57 | #define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE) | 60 | #define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE) |
58 | #define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_IC_OFFSET | 61 | #define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_IC) |
59 | 62 | ||
60 | /* | 63 | /* |
61 | * Logical Physical | 64 | * Logical Physical |
@@ -117,8 +120,8 @@ static struct map_desc ap_io_desc[] __initdata = { | |||
117 | .length = SZ_4K, | 120 | .length = SZ_4K, |
118 | .type = MT_DEVICE | 121 | .type = MT_DEVICE |
119 | }, { | 122 | }, { |
120 | .virtual = IO_ADDRESS(INTEGRATOR_GPIO_BASE), | 123 | .virtual = IO_ADDRESS(INTEGRATOR_AP_GPIO_BASE), |
121 | .pfn = __phys_to_pfn(INTEGRATOR_GPIO_BASE), | 124 | .pfn = __phys_to_pfn(INTEGRATOR_AP_GPIO_BASE), |
122 | .length = SZ_4K, | 125 | .length = SZ_4K, |
123 | .type = MT_DEVICE | 126 | .type = MT_DEVICE |
124 | }, { | 127 | }, { |
@@ -334,14 +337,163 @@ static void __init ap_init(void) | |||
334 | } | 337 | } |
335 | } | 338 | } |
336 | 339 | ||
340 | /* | ||
341 | * Where is the timer (VA)? | ||
342 | */ | ||
343 | #define TIMER0_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER0_BASE) | ||
344 | #define TIMER1_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER1_BASE) | ||
345 | #define TIMER2_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER2_BASE) | ||
346 | |||
347 | /* | ||
348 | * How long is the timer interval? | ||
349 | */ | ||
350 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
351 | #if TIMER_INTERVAL >= 0x100000 | ||
352 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
353 | #elif TIMER_INTERVAL >= 0x10000 | ||
354 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
355 | #else | ||
356 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
357 | #endif | ||
358 | |||
359 | static unsigned long timer_reload; | ||
360 | |||
361 | static void __iomem * const clksrc_base = (void __iomem *)TIMER2_VA_BASE; | ||
362 | |||
363 | static cycle_t timersp_read(struct clocksource *cs) | ||
364 | { | ||
365 | return ~(readl(clksrc_base + TIMER_VALUE) & 0xffff); | ||
366 | } | ||
367 | |||
368 | static struct clocksource clocksource_timersp = { | ||
369 | .name = "timer2", | ||
370 | .rating = 200, | ||
371 | .read = timersp_read, | ||
372 | .mask = CLOCKSOURCE_MASK(16), | ||
373 | .shift = 16, | ||
374 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
375 | }; | ||
376 | |||
377 | static void integrator_clocksource_init(u32 khz) | ||
378 | { | ||
379 | struct clocksource *cs = &clocksource_timersp; | ||
380 | void __iomem *base = clksrc_base; | ||
381 | u32 ctrl = TIMER_CTRL_ENABLE; | ||
382 | |||
383 | if (khz >= 1500) { | ||
384 | khz /= 16; | ||
385 | ctrl = TIMER_CTRL_DIV16; | ||
386 | } | ||
387 | |||
388 | writel(ctrl, base + TIMER_CTRL); | ||
389 | writel(0xffff, base + TIMER_LOAD); | ||
390 | |||
391 | cs->mult = clocksource_khz2mult(khz, cs->shift); | ||
392 | clocksource_register(cs); | ||
393 | } | ||
394 | |||
395 | static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; | ||
396 | |||
397 | /* | ||
398 | * IRQ handler for the timer | ||
399 | */ | ||
400 | static irqreturn_t integrator_timer_interrupt(int irq, void *dev_id) | ||
401 | { | ||
402 | struct clock_event_device *evt = dev_id; | ||
403 | |||
404 | /* clear the interrupt */ | ||
405 | writel(1, clkevt_base + TIMER_INTCLR); | ||
406 | |||
407 | evt->event_handler(evt); | ||
408 | |||
409 | return IRQ_HANDLED; | ||
410 | } | ||
411 | |||
412 | static void clkevt_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) | ||
413 | { | ||
414 | u32 ctrl = readl(clkevt_base + TIMER_CTRL) & ~TIMER_CTRL_ENABLE; | ||
415 | |||
416 | BUG_ON(mode == CLOCK_EVT_MODE_ONESHOT); | ||
417 | |||
418 | if (mode == CLOCK_EVT_MODE_PERIODIC) { | ||
419 | writel(ctrl, clkevt_base + TIMER_CTRL); | ||
420 | writel(timer_reload, clkevt_base + TIMER_LOAD); | ||
421 | ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE; | ||
422 | } | ||
423 | |||
424 | writel(ctrl, clkevt_base + TIMER_CTRL); | ||
425 | } | ||
426 | |||
427 | static int clkevt_set_next_event(unsigned long next, struct clock_event_device *evt) | ||
428 | { | ||
429 | unsigned long ctrl = readl(clkevt_base + TIMER_CTRL); | ||
430 | |||
431 | writel(ctrl & ~TIMER_CTRL_ENABLE, clkevt_base + TIMER_CTRL); | ||
432 | writel(next, clkevt_base + TIMER_LOAD); | ||
433 | writel(ctrl | TIMER_CTRL_ENABLE, clkevt_base + TIMER_CTRL); | ||
434 | |||
435 | return 0; | ||
436 | } | ||
437 | |||
438 | static struct clock_event_device integrator_clockevent = { | ||
439 | .name = "timer1", | ||
440 | .shift = 34, | ||
441 | .features = CLOCK_EVT_FEAT_PERIODIC, | ||
442 | .set_mode = clkevt_set_mode, | ||
443 | .set_next_event = clkevt_set_next_event, | ||
444 | .rating = 300, | ||
445 | .cpumask = cpu_all_mask, | ||
446 | }; | ||
447 | |||
448 | static struct irqaction integrator_timer_irq = { | ||
449 | .name = "timer", | ||
450 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
451 | .handler = integrator_timer_interrupt, | ||
452 | .dev_id = &integrator_clockevent, | ||
453 | }; | ||
454 | |||
455 | static void integrator_clockevent_init(u32 khz) | ||
456 | { | ||
457 | struct clock_event_device *evt = &integrator_clockevent; | ||
458 | unsigned int ctrl = 0; | ||
459 | |||
460 | if (khz * 1000 > 0x100000 * HZ) { | ||
461 | khz /= 256; | ||
462 | ctrl |= TIMER_CTRL_DIV256; | ||
463 | } else if (khz * 1000 > 0x10000 * HZ) { | ||
464 | khz /= 16; | ||
465 | ctrl |= TIMER_CTRL_DIV16; | ||
466 | } | ||
467 | |||
468 | timer_reload = khz * 1000 / HZ; | ||
469 | writel(ctrl, clkevt_base + TIMER_CTRL); | ||
470 | |||
471 | evt->irq = IRQ_TIMERINT1; | ||
472 | evt->mult = div_sc(khz, NSEC_PER_MSEC, evt->shift); | ||
473 | evt->max_delta_ns = clockevent_delta2ns(0xffff, evt); | ||
474 | evt->min_delta_ns = clockevent_delta2ns(0xf, evt); | ||
475 | |||
476 | setup_irq(IRQ_TIMERINT1, &integrator_timer_irq); | ||
477 | clockevents_register_device(evt); | ||
478 | } | ||
479 | |||
480 | /* | ||
481 | * Set up timer(s). | ||
482 | */ | ||
337 | static void __init ap_init_timer(void) | 483 | static void __init ap_init_timer(void) |
338 | { | 484 | { |
339 | integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, 0); | 485 | u32 khz = TICKS_PER_uSEC * 1000; |
486 | |||
487 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); | ||
488 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); | ||
489 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | ||
490 | |||
491 | integrator_clocksource_init(khz); | ||
492 | integrator_clockevent_init(khz); | ||
340 | } | 493 | } |
341 | 494 | ||
342 | static struct sys_timer ap_timer = { | 495 | static struct sys_timer ap_timer = { |
343 | .init = ap_init_timer, | 496 | .init = ap_init_timer, |
344 | .offset = integrator_gettimeoffset, | ||
345 | }; | 497 | }; |
346 | 498 | ||
347 | MACHINE_START(INTEGRATOR, "ARM-Integrator") | 499 | MACHINE_START(INTEGRATOR, "ARM-Integrator") |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 15e6cc5a352f..cde57b2b83b5 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -25,10 +25,12 @@ | |||
25 | #include <asm/clkdev.h> | 25 | #include <asm/clkdev.h> |
26 | #include <mach/clkdev.h> | 26 | #include <mach/clkdev.h> |
27 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
28 | #include <mach/platform.h> | ||
28 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
29 | #include <asm/setup.h> | 30 | #include <asm/setup.h> |
30 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
31 | #include <asm/hardware/icst525.h> | 32 | #include <asm/hardware/arm_timer.h> |
33 | #include <asm/hardware/icst.h> | ||
32 | 34 | ||
33 | #include <mach/cm.h> | 35 | #include <mach/cm.h> |
34 | #include <mach/lm.h> | 36 | #include <mach/lm.h> |
@@ -39,24 +41,20 @@ | |||
39 | #include <asm/mach/map.h> | 41 | #include <asm/mach/map.h> |
40 | #include <asm/mach/time.h> | 42 | #include <asm/mach/time.h> |
41 | 43 | ||
42 | #include "common.h" | 44 | #include <plat/timer-sp.h> |
43 | |||
44 | #define INTCP_PA_MMC_BASE 0x1c000000 | ||
45 | #define INTCP_PA_AACI_BASE 0x1d000000 | ||
46 | 45 | ||
47 | #define INTCP_PA_FLASH_BASE 0x24000000 | 46 | #define INTCP_PA_FLASH_BASE 0x24000000 |
48 | #define INTCP_FLASH_SIZE SZ_32M | 47 | #define INTCP_FLASH_SIZE SZ_32M |
49 | 48 | ||
50 | #define INTCP_PA_CLCD_BASE 0xc0000000 | 49 | #define INTCP_PA_CLCD_BASE 0xc0000000 |
51 | 50 | ||
52 | #define INTCP_VA_CIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + 0x40 | 51 | #define INTCP_VA_CIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x40) |
53 | #define INTCP_VA_PIC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) | 52 | #define INTCP_VA_PIC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) |
54 | #define INTCP_VA_SIC_BASE IO_ADDRESS(0xca000000) | 53 | #define INTCP_VA_SIC_BASE IO_ADDRESS(INTEGRATOR_CP_SIC_BASE) |
55 | 54 | ||
56 | #define INTCP_PA_ETH_BASE 0xc8000000 | ||
57 | #define INTCP_ETH_SIZE 0x10 | 55 | #define INTCP_ETH_SIZE 0x10 |
58 | 56 | ||
59 | #define INTCP_VA_CTRL_BASE IO_ADDRESS(0xcb000000) | 57 | #define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE) |
60 | #define INTCP_FLASHPROG 0x04 | 58 | #define INTCP_FLASHPROG 0x04 |
61 | #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) | 59 | #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) |
62 | #define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) | 60 | #define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) |
@@ -71,7 +69,9 @@ | |||
71 | * f1600000 16000000 UART 0 | 69 | * f1600000 16000000 UART 0 |
72 | * f1700000 17000000 UART 1 | 70 | * f1700000 17000000 UART 1 |
73 | * f1a00000 1a000000 Debug LEDs | 71 | * f1a00000 1a000000 Debug LEDs |
74 | * f1b00000 1b000000 GPIO | 72 | * fc900000 c9000000 GPIO |
73 | * fca00000 ca000000 SIC | ||
74 | * fcb00000 cb000000 CP system control | ||
75 | */ | 75 | */ |
76 | 76 | ||
77 | static struct map_desc intcp_io_desc[] __initdata = { | 77 | static struct map_desc intcp_io_desc[] __initdata = { |
@@ -116,18 +116,18 @@ static struct map_desc intcp_io_desc[] __initdata = { | |||
116 | .length = SZ_4K, | 116 | .length = SZ_4K, |
117 | .type = MT_DEVICE | 117 | .type = MT_DEVICE |
118 | }, { | 118 | }, { |
119 | .virtual = IO_ADDRESS(INTEGRATOR_GPIO_BASE), | 119 | .virtual = IO_ADDRESS(INTEGRATOR_CP_GPIO_BASE), |
120 | .pfn = __phys_to_pfn(INTEGRATOR_GPIO_BASE), | 120 | .pfn = __phys_to_pfn(INTEGRATOR_CP_GPIO_BASE), |
121 | .length = SZ_4K, | 121 | .length = SZ_4K, |
122 | .type = MT_DEVICE | 122 | .type = MT_DEVICE |
123 | }, { | 123 | }, { |
124 | .virtual = IO_ADDRESS(0xca000000), | 124 | .virtual = IO_ADDRESS(INTEGRATOR_CP_SIC_BASE), |
125 | .pfn = __phys_to_pfn(0xca000000), | 125 | .pfn = __phys_to_pfn(INTEGRATOR_CP_SIC_BASE), |
126 | .length = SZ_4K, | 126 | .length = SZ_4K, |
127 | .type = MT_DEVICE | 127 | .type = MT_DEVICE |
128 | }, { | 128 | }, { |
129 | .virtual = IO_ADDRESS(0xcb000000), | 129 | .virtual = IO_ADDRESS(INTEGRATOR_CP_CTL_BASE), |
130 | .pfn = __phys_to_pfn(0xcb000000), | 130 | .pfn = __phys_to_pfn(INTEGRATOR_CP_CTL_BASE), |
131 | .length = SZ_4K, | 131 | .length = SZ_4K, |
132 | .type = MT_DEVICE | 132 | .type = MT_DEVICE |
133 | } | 133 | } |
@@ -266,33 +266,43 @@ static void __init intcp_init_irq(void) | |||
266 | /* | 266 | /* |
267 | * Clock handling | 267 | * Clock handling |
268 | */ | 268 | */ |
269 | #define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) | 269 | #define CM_LOCK (__io_address(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) |
270 | #define CM_AUXOSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+0x1c) | 270 | #define CM_AUXOSC (__io_address(INTEGRATOR_HDR_BASE)+0x1c) |
271 | 271 | ||
272 | static const struct icst525_params cp_auxvco_params = { | 272 | static const struct icst_params cp_auxvco_params = { |
273 | .ref = 24000, | 273 | .ref = 24000000, |
274 | .vco_max = 320000, | 274 | .vco_max = ICST525_VCO_MAX_5V, |
275 | .vco_min = ICST525_VCO_MIN, | ||
275 | .vd_min = 8, | 276 | .vd_min = 8, |
276 | .vd_max = 263, | 277 | .vd_max = 263, |
277 | .rd_min = 3, | 278 | .rd_min = 3, |
278 | .rd_max = 65, | 279 | .rd_max = 65, |
280 | .s2div = icst525_s2div, | ||
281 | .idx2s = icst525_idx2s, | ||
279 | }; | 282 | }; |
280 | 283 | ||
281 | static void cp_auxvco_set(struct clk *clk, struct icst525_vco vco) | 284 | static void cp_auxvco_set(struct clk *clk, struct icst_vco vco) |
282 | { | 285 | { |
283 | u32 val; | 286 | u32 val; |
284 | 287 | ||
285 | val = readl(CM_AUXOSC) & ~0x7ffff; | 288 | val = readl(clk->vcoreg) & ~0x7ffff; |
286 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 289 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
287 | 290 | ||
288 | writel(0xa05f, CM_LOCK); | 291 | writel(0xa05f, CM_LOCK); |
289 | writel(val, CM_AUXOSC); | 292 | writel(val, clk->vcoreg); |
290 | writel(0, CM_LOCK); | 293 | writel(0, CM_LOCK); |
291 | } | 294 | } |
292 | 295 | ||
296 | static const struct clk_ops cp_auxclk_ops = { | ||
297 | .round = icst_clk_round, | ||
298 | .set = icst_clk_set, | ||
299 | .setvco = cp_auxvco_set, | ||
300 | }; | ||
301 | |||
293 | static struct clk cp_auxclk = { | 302 | static struct clk cp_auxclk = { |
303 | .ops = &cp_auxclk_ops, | ||
294 | .params = &cp_auxvco_params, | 304 | .params = &cp_auxvco_params, |
295 | .setvco = cp_auxvco_set, | 305 | .vcoreg = CM_AUXOSC, |
296 | }; | 306 | }; |
297 | 307 | ||
298 | static struct clk_lookup cp_lookups[] = { | 308 | static struct clk_lookup cp_lookups[] = { |
@@ -363,8 +373,8 @@ static struct platform_device intcp_flash_device = { | |||
363 | 373 | ||
364 | static struct resource smc91x_resources[] = { | 374 | static struct resource smc91x_resources[] = { |
365 | [0] = { | 375 | [0] = { |
366 | .start = INTCP_PA_ETH_BASE, | 376 | .start = INTEGRATOR_CP_ETH_BASE, |
367 | .end = INTCP_PA_ETH_BASE + INTCP_ETH_SIZE - 1, | 377 | .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1, |
368 | .flags = IORESOURCE_MEM, | 378 | .flags = IORESOURCE_MEM, |
369 | }, | 379 | }, |
370 | [1] = { | 380 | [1] = { |
@@ -394,8 +404,8 @@ static struct platform_device *intcp_devs[] __initdata = { | |||
394 | */ | 404 | */ |
395 | static unsigned int mmc_status(struct device *dev) | 405 | static unsigned int mmc_status(struct device *dev) |
396 | { | 406 | { |
397 | unsigned int status = readl(IO_ADDRESS(0xca000000) + 4); | 407 | unsigned int status = readl(IO_ADDRESS(0xca000000 + 4)); |
398 | writel(8, IO_ADDRESS(0xcb000000) + 8); | 408 | writel(8, IO_ADDRESS(INTEGRATOR_CP_CTL_BASE + 8)); |
399 | 409 | ||
400 | return status & 8; | 410 | return status & 8; |
401 | } | 411 | } |
@@ -413,8 +423,8 @@ static struct amba_device mmc_device = { | |||
413 | .platform_data = &mmc_data, | 423 | .platform_data = &mmc_data, |
414 | }, | 424 | }, |
415 | .res = { | 425 | .res = { |
416 | .start = INTCP_PA_MMC_BASE, | 426 | .start = INTEGRATOR_CP_MMC_BASE, |
417 | .end = INTCP_PA_MMC_BASE + SZ_4K - 1, | 427 | .end = INTEGRATOR_CP_MMC_BASE + SZ_4K - 1, |
418 | .flags = IORESOURCE_MEM, | 428 | .flags = IORESOURCE_MEM, |
419 | }, | 429 | }, |
420 | .irq = { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }, | 430 | .irq = { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }, |
@@ -426,8 +436,8 @@ static struct amba_device aaci_device = { | |||
426 | .init_name = "mb:1d", | 436 | .init_name = "mb:1d", |
427 | }, | 437 | }, |
428 | .res = { | 438 | .res = { |
429 | .start = INTCP_PA_AACI_BASE, | 439 | .start = INTEGRATOR_CP_AACI_BASE, |
430 | .end = INTCP_PA_AACI_BASE + SZ_4K - 1, | 440 | .end = INTEGRATOR_CP_AACI_BASE + SZ_4K - 1, |
431 | .flags = IORESOURCE_MEM, | 441 | .flags = IORESOURCE_MEM, |
432 | }, | 442 | }, |
433 | .irq = { IRQ_CP_AACIINT, NO_IRQ }, | 443 | .irq = { IRQ_CP_AACIINT, NO_IRQ }, |
@@ -567,16 +577,22 @@ static void __init intcp_init(void) | |||
567 | } | 577 | } |
568 | } | 578 | } |
569 | 579 | ||
570 | #define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */ | 580 | #define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE) |
581 | #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE) | ||
582 | #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE) | ||
571 | 583 | ||
572 | static void __init intcp_timer_init(void) | 584 | static void __init intcp_timer_init(void) |
573 | { | 585 | { |
574 | integrator_time_init(1000000 / HZ, TIMER_CTRL_IE); | 586 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); |
587 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); | ||
588 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | ||
589 | |||
590 | sp804_clocksource_init(TIMER2_VA_BASE); | ||
591 | sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1); | ||
575 | } | 592 | } |
576 | 593 | ||
577 | static struct sys_timer cp_timer = { | 594 | static struct sys_timer cp_timer = { |
578 | .init = intcp_timer_init, | 595 | .init = intcp_timer_init, |
579 | .offset = integrator_gettimeoffset, | ||
580 | }; | 596 | }; |
581 | 597 | ||
582 | MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") | 598 | MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") |
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c index 8dcc823f4135..28be186adb89 100644 --- a/arch/arm/mach-integrator/leds.c +++ b/arch/arm/mach-integrator/leds.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
28 | 28 | ||
29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
30 | #include <mach/platform.h> | ||
30 | #include <asm/leds.h> | 31 | #include <asm/leds.h> |
31 | #include <asm/system.h> | 32 | #include <asm/system.h> |
32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index ffbd349363af..9cef0590d5aa 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | 30 | ||
31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
32 | #include <mach/platform.h> | ||
32 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
33 | #include <asm/signal.h> | 34 | #include <asm/signal.h> |
34 | #include <asm/system.h> | 35 | #include <asm/system.h> |
@@ -389,9 +390,9 @@ static int __init pci_v3_setup_resources(struct resource **resource) | |||
389 | * means I can't get additional information on the reason for the pm2fb | 390 | * means I can't get additional information on the reason for the pm2fb |
390 | * problems. I suppose I'll just have to mind-meld with the machine. ;) | 391 | * problems. I suppose I'll just have to mind-meld with the machine. ;) |
391 | */ | 392 | */ |
392 | #define SC_PCI (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_PCIENABLE_OFFSET) | 393 | #define SC_PCI IO_ADDRESS(INTEGRATOR_SC_PCIENABLE) |
393 | #define SC_LBFADDR (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x20) | 394 | #define SC_LBFADDR IO_ADDRESS(INTEGRATOR_SC_BASE + 0x20) |
394 | #define SC_LBFCODE (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x24) | 395 | #define SC_LBFCODE IO_ADDRESS(INTEGRATOR_SC_BASE + 0x24) |
395 | 396 | ||
396 | static int | 397 | static int |
397 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | 398 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) |
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c index 5d99039286eb..f108a31afc2b 100644 --- a/arch/arm/mach-iop32x/n2100.c +++ b/arch/arm/mach-iop32x/n2100.c | |||
@@ -176,7 +176,7 @@ static struct plat_serial8250_port n2100_serial_port[] = { | |||
176 | .mapbase = N2100_UART, | 176 | .mapbase = N2100_UART, |
177 | .membase = (char *)N2100_UART, | 177 | .membase = (char *)N2100_UART, |
178 | .irq = 0, | 178 | .irq = 0, |
179 | .flags = UPF_SKIP_TEST, | 179 | .flags = UPF_SKIP_TEST | UPF_AUTO_IRQ | UPF_SHARE_IRQ, |
180 | .iotype = UPIO_MEM, | 180 | .iotype = UPIO_MEM, |
181 | .regshift = 0, | 181 | .regshift = 0, |
182 | .uartclk = 1843200, | 182 | .uartclk = 1843200, |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 71728d36d501..0bce09799d18 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/tty.h> | 21 | #include <linux/tty.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/serial_core.h> | 23 | #include <linux/serial_core.h> |
24 | #include <linux/bootmem.h> | ||
25 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
26 | #include <linux/bitops.h> | 25 | #include <linux/bitops.h> |
27 | #include <linux/time.h> | 26 | #include <linux/time.h> |
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 17879a876be6..29b2163b1fe3 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -38,6 +38,12 @@ config MACH_ESATA_SHEEVAPLUG | |||
38 | Say 'Y' here if you want your kernel to support the | 38 | Say 'Y' here if you want your kernel to support the |
39 | Marvell eSATA SheevaPlug Reference Board. | 39 | Marvell eSATA SheevaPlug Reference Board. |
40 | 40 | ||
41 | config MACH_GURUPLUG | ||
42 | bool "Marvell GuruPlug Reference Board" | ||
43 | help | ||
44 | Say 'Y' here if you want your kernel to support the | ||
45 | Marvell GuruPlug Reference Board. | ||
46 | |||
41 | config MACH_TS219 | 47 | config MACH_TS219 |
42 | bool "QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS" | 48 | bool "QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS" |
43 | help | 49 | help |
@@ -81,6 +87,18 @@ config MACH_INETSPACE_V2 | |||
81 | Say 'Y' here if you want your kernel to support the | 87 | Say 'Y' here if you want your kernel to support the |
82 | LaCie Internet Space v2 NAS. | 88 | LaCie Internet Space v2 NAS. |
83 | 89 | ||
90 | config MACH_NET2BIG_V2 | ||
91 | bool "LaCie 2Big Network v2 NAS Board" | ||
92 | help | ||
93 | Say 'Y' here if you want your kernel to support the | ||
94 | LaCie 2Big Network v2 NAS. | ||
95 | |||
96 | config MACH_NET5BIG_V2 | ||
97 | bool "LaCie 5Big Network v2 NAS Board" | ||
98 | help | ||
99 | Say 'Y' here if you want your kernel to support the | ||
100 | LaCie 5Big Network v2 NAS. | ||
101 | |||
84 | endmenu | 102 | endmenu |
85 | 103 | ||
86 | endif | 104 | endif |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index a5530e36ba3e..c0cd5d362002 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -6,10 +6,13 @@ obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o | |||
6 | obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o | 6 | obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o |
7 | obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o | 7 | obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o |
8 | obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o | 8 | obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o |
9 | obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o | ||
9 | obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o | 10 | obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o |
10 | obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o | 11 | obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o |
11 | obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o | 12 | obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o |
12 | obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o | 13 | obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o |
13 | obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o | 14 | obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o |
15 | obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o | ||
16 | obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o | ||
14 | 17 | ||
15 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 18 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c new file mode 100644 index 000000000000..54d07c89d4ff --- /dev/null +++ b/arch/arm/mach-kirkwood/guruplug-setup.c | |||
@@ -0,0 +1,131 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/guruplug-setup.c | ||
3 | * | ||
4 | * Marvell GuruPlug Reference Board Setup | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/mtd/partitions.h> | ||
15 | #include <linux/ata_platform.h> | ||
16 | #include <linux/mv643xx_eth.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/leds.h> | ||
19 | #include <asm/mach-types.h> | ||
20 | #include <asm/mach/arch.h> | ||
21 | #include <mach/kirkwood.h> | ||
22 | #include <plat/mvsdio.h> | ||
23 | #include "common.h" | ||
24 | #include "mpp.h" | ||
25 | |||
26 | static struct mtd_partition guruplug_nand_parts[] = { | ||
27 | { | ||
28 | .name = "u-boot", | ||
29 | .offset = 0, | ||
30 | .size = SZ_1M | ||
31 | }, { | ||
32 | .name = "uImage", | ||
33 | .offset = MTDPART_OFS_NXTBLK, | ||
34 | .size = SZ_4M | ||
35 | }, { | ||
36 | .name = "root", | ||
37 | .offset = MTDPART_OFS_NXTBLK, | ||
38 | .size = MTDPART_SIZ_FULL | ||
39 | }, | ||
40 | }; | ||
41 | |||
42 | static struct mv643xx_eth_platform_data guruplug_ge00_data = { | ||
43 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
44 | }; | ||
45 | |||
46 | static struct mv643xx_eth_platform_data guruplug_ge01_data = { | ||
47 | .phy_addr = MV643XX_ETH_PHY_ADDR(1), | ||
48 | }; | ||
49 | |||
50 | static struct mv_sata_platform_data guruplug_sata_data = { | ||
51 | .n_ports = 1, | ||
52 | }; | ||
53 | |||
54 | static struct mvsdio_platform_data guruplug_mvsdio_data = { | ||
55 | /* unfortunately the CD signal has not been connected */ | ||
56 | }; | ||
57 | |||
58 | static struct gpio_led guruplug_led_pins[] = { | ||
59 | { | ||
60 | .name = "guruplug:red:health", | ||
61 | .gpio = 46, | ||
62 | .active_low = 1, | ||
63 | }, | ||
64 | { | ||
65 | .name = "guruplug:green:health", | ||
66 | .gpio = 47, | ||
67 | .active_low = 1, | ||
68 | }, | ||
69 | { | ||
70 | .name = "guruplug:red:wmode", | ||
71 | .gpio = 48, | ||
72 | .active_low = 1, | ||
73 | }, | ||
74 | { | ||
75 | .name = "guruplug:green:wmode", | ||
76 | .gpio = 49, | ||
77 | .active_low = 1, | ||
78 | }, | ||
79 | }; | ||
80 | |||
81 | static struct gpio_led_platform_data guruplug_led_data = { | ||
82 | .leds = guruplug_led_pins, | ||
83 | .num_leds = ARRAY_SIZE(guruplug_led_pins), | ||
84 | }; | ||
85 | |||
86 | static struct platform_device guruplug_leds = { | ||
87 | .name = "leds-gpio", | ||
88 | .id = -1, | ||
89 | .dev = { | ||
90 | .platform_data = &guruplug_led_data, | ||
91 | } | ||
92 | }; | ||
93 | |||
94 | static unsigned int guruplug_mpp_config[] __initdata = { | ||
95 | MPP46_GPIO, /* M_RLED */ | ||
96 | MPP47_GPIO, /* M_GLED */ | ||
97 | MPP48_GPIO, /* B_RLED */ | ||
98 | MPP49_GPIO, /* B_GLED */ | ||
99 | 0 | ||
100 | }; | ||
101 | |||
102 | static void __init guruplug_init(void) | ||
103 | { | ||
104 | /* | ||
105 | * Basic setup. Needs to be called early. | ||
106 | */ | ||
107 | kirkwood_init(); | ||
108 | kirkwood_mpp_conf(guruplug_mpp_config); | ||
109 | |||
110 | kirkwood_uart0_init(); | ||
111 | kirkwood_nand_init(ARRAY_AND_SIZE(guruplug_nand_parts), 25); | ||
112 | |||
113 | kirkwood_ehci_init(); | ||
114 | kirkwood_ge00_init(&guruplug_ge00_data); | ||
115 | kirkwood_ge01_init(&guruplug_ge01_data); | ||
116 | kirkwood_sata_init(&guruplug_sata_data); | ||
117 | kirkwood_sdio_init(&guruplug_mvsdio_data); | ||
118 | |||
119 | platform_device_register(&guruplug_leds); | ||
120 | } | ||
121 | |||
122 | MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board") | ||
123 | /* Maintainer: Siddarth Gore <gores@marvell.com> */ | ||
124 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
125 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
126 | .boot_params = 0x00000100, | ||
127 | .init_machine = guruplug_init, | ||
128 | .map_io = kirkwood_map_io, | ||
129 | .init_irq = kirkwood_init_irq, | ||
130 | .timer = &kirkwood_timer, | ||
131 | MACHINE_END | ||
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c new file mode 100644 index 000000000000..8a2bb0228e4f --- /dev/null +++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c | |||
@@ -0,0 +1,415 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/netxbig_v2-setup.c | ||
3 | * | ||
4 | * LaCie 2Big and 5Big Network v2 board setup | ||
5 | * | ||
6 | * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | ||
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, | ||
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 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/mtd/physmap.h> | ||
27 | #include <linux/spi/flash.h> | ||
28 | #include <linux/spi/spi.h> | ||
29 | #include <linux/ata_platform.h> | ||
30 | #include <linux/mv643xx_eth.h> | ||
31 | #include <linux/i2c.h> | ||
32 | #include <linux/i2c/at24.h> | ||
33 | #include <linux/input.h> | ||
34 | #include <linux/gpio.h> | ||
35 | #include <linux/gpio_keys.h> | ||
36 | #include <linux/leds.h> | ||
37 | #include <asm/mach-types.h> | ||
38 | #include <asm/mach/arch.h> | ||
39 | #include <asm/mach/time.h> | ||
40 | #include <mach/kirkwood.h> | ||
41 | #include <plat/time.h> | ||
42 | #include "common.h" | ||
43 | #include "mpp.h" | ||
44 | |||
45 | /***************************************************************************** | ||
46 | * 512KB SPI Flash on Boot Device (MACRONIX MX25L4005) | ||
47 | ****************************************************************************/ | ||
48 | |||
49 | static struct mtd_partition netxbig_v2_flash_parts[] = { | ||
50 | { | ||
51 | .name = "u-boot", | ||
52 | .size = MTDPART_SIZ_FULL, | ||
53 | .offset = 0, | ||
54 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static const struct flash_platform_data netxbig_v2_flash = { | ||
59 | .type = "mx25l4005a", | ||
60 | .name = "spi_flash", | ||
61 | .parts = netxbig_v2_flash_parts, | ||
62 | .nr_parts = ARRAY_SIZE(netxbig_v2_flash_parts), | ||
63 | }; | ||
64 | |||
65 | static struct spi_board_info __initdata netxbig_v2_spi_slave_info[] = { | ||
66 | { | ||
67 | .modalias = "m25p80", | ||
68 | .platform_data = &netxbig_v2_flash, | ||
69 | .irq = -1, | ||
70 | .max_speed_hz = 20000000, | ||
71 | .bus_num = 0, | ||
72 | .chip_select = 0, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | /***************************************************************************** | ||
77 | * Ethernet | ||
78 | ****************************************************************************/ | ||
79 | |||
80 | static struct mv643xx_eth_platform_data netxbig_v2_ge00_data = { | ||
81 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
82 | }; | ||
83 | |||
84 | static struct mv643xx_eth_platform_data netxbig_v2_ge01_data = { | ||
85 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
86 | }; | ||
87 | |||
88 | /***************************************************************************** | ||
89 | * I2C devices | ||
90 | ****************************************************************************/ | ||
91 | |||
92 | static struct at24_platform_data at24c04 = { | ||
93 | .byte_len = SZ_4K / 8, | ||
94 | .page_size = 16, | ||
95 | }; | ||
96 | |||
97 | /* | ||
98 | * i2c addr | chip | description | ||
99 | * 0x50 | HT24LC04 | eeprom (512B) | ||
100 | */ | ||
101 | |||
102 | static struct i2c_board_info __initdata netxbig_v2_i2c_info[] = { | ||
103 | { | ||
104 | I2C_BOARD_INFO("24c04", 0x50), | ||
105 | .platform_data = &at24c04, | ||
106 | } | ||
107 | }; | ||
108 | |||
109 | /***************************************************************************** | ||
110 | * SATA | ||
111 | ****************************************************************************/ | ||
112 | |||
113 | static struct mv_sata_platform_data netxbig_v2_sata_data = { | ||
114 | .n_ports = 2, | ||
115 | }; | ||
116 | |||
117 | static int __initdata netxbig_v2_gpio_hdd_power[] = { 16, 17, 41, 42, 43 }; | ||
118 | |||
119 | static void __init netxbig_v2_sata_power_init(void) | ||
120 | { | ||
121 | int i; | ||
122 | int err; | ||
123 | int hdd_nb; | ||
124 | |||
125 | if (machine_is_net2big_v2()) | ||
126 | hdd_nb = 2; | ||
127 | else | ||
128 | hdd_nb = 5; | ||
129 | |||
130 | /* Power up all hard disks. */ | ||
131 | for (i = 0; i < hdd_nb; i++) { | ||
132 | err = gpio_request(netxbig_v2_gpio_hdd_power[i], NULL); | ||
133 | if (err == 0) { | ||
134 | err = gpio_direction_output( | ||
135 | netxbig_v2_gpio_hdd_power[i], 1); | ||
136 | /* Free the HDD power GPIOs. This allow user-space to | ||
137 | * configure them via the gpiolib sysfs interface. */ | ||
138 | gpio_free(netxbig_v2_gpio_hdd_power[i]); | ||
139 | } | ||
140 | if (err) | ||
141 | pr_err("netxbig_v2: failed to power up HDD%d\n", i + 1); | ||
142 | } | ||
143 | } | ||
144 | |||
145 | /***************************************************************************** | ||
146 | * GPIO keys | ||
147 | ****************************************************************************/ | ||
148 | |||
149 | #define NETXBIG_V2_GPIO_SWITCH_POWER_ON 13 | ||
150 | #define NETXBIG_V2_GPIO_SWITCH_POWER_OFF 15 | ||
151 | #define NETXBIG_V2_GPIO_FUNC_BUTTON 34 | ||
152 | |||
153 | #define NETXBIG_V2_SWITCH_POWER_ON 0x1 | ||
154 | #define NETXBIG_V2_SWITCH_POWER_OFF 0x2 | ||
155 | |||
156 | static struct gpio_keys_button netxbig_v2_buttons[] = { | ||
157 | [0] = { | ||
158 | .type = EV_SW, | ||
159 | .code = NETXBIG_V2_SWITCH_POWER_ON, | ||
160 | .gpio = NETXBIG_V2_GPIO_SWITCH_POWER_ON, | ||
161 | .desc = "Back power switch (on|auto)", | ||
162 | .active_low = 1, | ||
163 | }, | ||
164 | [1] = { | ||
165 | .type = EV_SW, | ||
166 | .code = NETXBIG_V2_SWITCH_POWER_OFF, | ||
167 | .gpio = NETXBIG_V2_GPIO_SWITCH_POWER_OFF, | ||
168 | .desc = "Back power switch (auto|off)", | ||
169 | .active_low = 1, | ||
170 | }, | ||
171 | [2] = { | ||
172 | .code = KEY_OPTION, | ||
173 | .gpio = NETXBIG_V2_GPIO_FUNC_BUTTON, | ||
174 | .desc = "Function button", | ||
175 | .active_low = 1, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct gpio_keys_platform_data netxbig_v2_button_data = { | ||
180 | .buttons = netxbig_v2_buttons, | ||
181 | .nbuttons = ARRAY_SIZE(netxbig_v2_buttons), | ||
182 | }; | ||
183 | |||
184 | static struct platform_device netxbig_v2_gpio_buttons = { | ||
185 | .name = "gpio-keys", | ||
186 | .id = -1, | ||
187 | .dev = { | ||
188 | .platform_data = &netxbig_v2_button_data, | ||
189 | }, | ||
190 | }; | ||
191 | |||
192 | /***************************************************************************** | ||
193 | * GPIO LEDs | ||
194 | ****************************************************************************/ | ||
195 | |||
196 | /* | ||
197 | * The LEDs are controlled by a CPLD and can be configured through a GPIO | ||
198 | * extension bus: | ||
199 | * | ||
200 | * - address register : bit [0-2] -> GPIO [47-49] | ||
201 | * - data register : bit [0-2] -> GPIO [44-46] | ||
202 | * - enable register : GPIO 29 | ||
203 | * | ||
204 | * Address register selection: | ||
205 | * | ||
206 | * addr | register | ||
207 | * ---------------------------- | ||
208 | * 0 | front LED | ||
209 | * 1 | front LED brightness | ||
210 | * 2 | HDD LED brightness | ||
211 | * 3 | HDD1 LED | ||
212 | * 4 | HDD2 LED | ||
213 | * 5 | HDD3 LED | ||
214 | * 6 | HDD4 LED | ||
215 | * 7 | HDD5 LED | ||
216 | * | ||
217 | * Data register configuration: | ||
218 | * | ||
219 | * data | LED brightness | ||
220 | * ------------------------------------------------- | ||
221 | * 0 | min (off) | ||
222 | * - | - | ||
223 | * 7 | max | ||
224 | * | ||
225 | * data | front LED mode | ||
226 | * ------------------------------------------------- | ||
227 | * 0 | fix off | ||
228 | * 1 | fix blue on | ||
229 | * 2 | fix red on | ||
230 | * 3 | blink blue on=1 sec and blue off=1 sec | ||
231 | * 4 | blink red on=1 sec and red off=1 sec | ||
232 | * 5 | blink blue on=2.5 sec and red on=0.5 sec | ||
233 | * 6 | blink blue on=1 sec and red on=1 sec | ||
234 | * 7 | blink blue on=0.5 sec and blue off=2.5 sec | ||
235 | * | ||
236 | * data | HDD LED mode | ||
237 | * ------------------------------------------------- | ||
238 | * 0 | fix blue on | ||
239 | * 1 | SATA activity blink | ||
240 | * 2 | fix red on | ||
241 | * 3 | blink blue on=1 sec and blue off=1 sec | ||
242 | * 4 | blink red on=1 sec and red off=1 sec | ||
243 | * 5 | blink blue on=2.5 sec and red on=0.5 sec | ||
244 | * 6 | blink blue on=1 sec and red on=1 sec | ||
245 | * 7 | blink blue on=0.5 sec and blue off=2.5 sec | ||
246 | */ | ||
247 | |||
248 | /***************************************************************************** | ||
249 | * Timer | ||
250 | ****************************************************************************/ | ||
251 | |||
252 | static void netxbig_v2_timer_init(void) | ||
253 | { | ||
254 | kirkwood_tclk = 166666667; | ||
255 | orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | ||
256 | } | ||
257 | |||
258 | struct sys_timer netxbig_v2_timer = { | ||
259 | .init = netxbig_v2_timer_init, | ||
260 | }; | ||
261 | |||
262 | /***************************************************************************** | ||
263 | * General Setup | ||
264 | ****************************************************************************/ | ||
265 | |||
266 | static unsigned int net2big_v2_mpp_config[] __initdata = { | ||
267 | MPP0_SPI_SCn, | ||
268 | MPP1_SPI_MOSI, | ||
269 | MPP2_SPI_SCK, | ||
270 | MPP3_SPI_MISO, | ||
271 | MPP6_SYSRST_OUTn, | ||
272 | MPP7_GPO, /* Request power-off */ | ||
273 | MPP8_TW_SDA, | ||
274 | MPP9_TW_SCK, | ||
275 | MPP10_UART0_TXD, | ||
276 | MPP11_UART0_RXD, | ||
277 | MPP13_GPIO, /* Rear power switch (on|auto) */ | ||
278 | MPP14_GPIO, /* USB fuse alarm */ | ||
279 | MPP15_GPIO, /* Rear power switch (auto|off) */ | ||
280 | MPP16_GPIO, /* SATA HDD1 power */ | ||
281 | MPP17_GPIO, /* SATA HDD2 power */ | ||
282 | MPP20_SATA1_ACTn, | ||
283 | MPP21_SATA0_ACTn, | ||
284 | MPP24_GPIO, /* USB mode select */ | ||
285 | MPP26_GPIO, /* USB device vbus */ | ||
286 | MPP28_GPIO, /* USB enable host vbus */ | ||
287 | MPP29_GPIO, /* CPLD extension ALE */ | ||
288 | MPP34_GPIO, /* Rear Push button */ | ||
289 | MPP35_GPIO, /* Inhibit switch power-off */ | ||
290 | MPP36_GPIO, /* SATA HDD1 presence */ | ||
291 | MPP37_GPIO, /* SATA HDD2 presence */ | ||
292 | MPP40_GPIO, /* eSATA presence */ | ||
293 | MPP44_GPIO, /* CPLD extension (data 0) */ | ||
294 | MPP45_GPIO, /* CPLD extension (data 1) */ | ||
295 | MPP46_GPIO, /* CPLD extension (data 2) */ | ||
296 | MPP47_GPIO, /* CPLD extension (addr 0) */ | ||
297 | MPP48_GPIO, /* CPLD extension (addr 1) */ | ||
298 | MPP49_GPIO, /* CPLD extension (addr 2) */ | ||
299 | 0 | ||
300 | }; | ||
301 | |||
302 | static unsigned int net5big_v2_mpp_config[] __initdata = { | ||
303 | MPP0_SPI_SCn, | ||
304 | MPP1_SPI_MOSI, | ||
305 | MPP2_SPI_SCK, | ||
306 | MPP3_SPI_MISO, | ||
307 | MPP6_SYSRST_OUTn, | ||
308 | MPP7_GPO, /* Request power-off */ | ||
309 | MPP8_TW_SDA, | ||
310 | MPP9_TW_SCK, | ||
311 | MPP10_UART0_TXD, | ||
312 | MPP11_UART0_RXD, | ||
313 | MPP13_GPIO, /* Rear power switch (on|auto) */ | ||
314 | MPP14_GPIO, /* USB fuse alarm */ | ||
315 | MPP15_GPIO, /* Rear power switch (auto|off) */ | ||
316 | MPP16_GPIO, /* SATA HDD1 power */ | ||
317 | MPP17_GPIO, /* SATA HDD2 power */ | ||
318 | MPP20_GE1_0, | ||
319 | MPP21_GE1_1, | ||
320 | MPP22_GE1_2, | ||
321 | MPP23_GE1_3, | ||
322 | MPP24_GE1_4, | ||
323 | MPP25_GE1_5, | ||
324 | MPP26_GE1_6, | ||
325 | MPP27_GE1_7, | ||
326 | MPP28_GPIO, /* USB enable host vbus */ | ||
327 | MPP29_GPIO, /* CPLD extension ALE */ | ||
328 | MPP30_GE1_10, | ||
329 | MPP31_GE1_11, | ||
330 | MPP32_GE1_12, | ||
331 | MPP33_GE1_13, | ||
332 | MPP34_GPIO, /* Rear Push button */ | ||
333 | MPP35_GPIO, /* Inhibit switch power-off */ | ||
334 | MPP36_GPIO, /* SATA HDD1 presence */ | ||
335 | MPP37_GPIO, /* SATA HDD2 presence */ | ||
336 | MPP38_GPIO, /* SATA HDD3 presence */ | ||
337 | MPP39_GPIO, /* SATA HDD4 presence */ | ||
338 | MPP40_GPIO, /* SATA HDD5 presence */ | ||
339 | MPP41_GPIO, /* SATA HDD3 power */ | ||
340 | MPP42_GPIO, /* SATA HDD4 power */ | ||
341 | MPP43_GPIO, /* SATA HDD5 power */ | ||
342 | MPP44_GPIO, /* CPLD extension (data 0) */ | ||
343 | MPP45_GPIO, /* CPLD extension (data 1) */ | ||
344 | MPP46_GPIO, /* CPLD extension (data 2) */ | ||
345 | MPP47_GPIO, /* CPLD extension (addr 0) */ | ||
346 | MPP48_GPIO, /* CPLD extension (addr 1) */ | ||
347 | MPP49_GPIO, /* CPLD extension (addr 2) */ | ||
348 | 0 | ||
349 | }; | ||
350 | |||
351 | #define NETXBIG_V2_GPIO_POWER_OFF 7 | ||
352 | |||
353 | static void netxbig_v2_power_off(void) | ||
354 | { | ||
355 | gpio_set_value(NETXBIG_V2_GPIO_POWER_OFF, 1); | ||
356 | } | ||
357 | |||
358 | static void __init netxbig_v2_init(void) | ||
359 | { | ||
360 | /* | ||
361 | * Basic setup. Needs to be called early. | ||
362 | */ | ||
363 | kirkwood_init(); | ||
364 | if (machine_is_net2big_v2()) | ||
365 | kirkwood_mpp_conf(net2big_v2_mpp_config); | ||
366 | else | ||
367 | kirkwood_mpp_conf(net5big_v2_mpp_config); | ||
368 | |||
369 | netxbig_v2_sata_power_init(); | ||
370 | |||
371 | kirkwood_ehci_init(); | ||
372 | kirkwood_ge00_init(&netxbig_v2_ge00_data); | ||
373 | if (machine_is_net5big_v2()) | ||
374 | kirkwood_ge01_init(&netxbig_v2_ge01_data); | ||
375 | kirkwood_sata_init(&netxbig_v2_sata_data); | ||
376 | kirkwood_uart0_init(); | ||
377 | spi_register_board_info(netxbig_v2_spi_slave_info, | ||
378 | ARRAY_SIZE(netxbig_v2_spi_slave_info)); | ||
379 | kirkwood_spi_init(); | ||
380 | kirkwood_i2c_init(); | ||
381 | i2c_register_board_info(0, netxbig_v2_i2c_info, | ||
382 | ARRAY_SIZE(netxbig_v2_i2c_info)); | ||
383 | |||
384 | platform_device_register(&netxbig_v2_gpio_buttons); | ||
385 | |||
386 | if (gpio_request(NETXBIG_V2_GPIO_POWER_OFF, "power-off") == 0 && | ||
387 | gpio_direction_output(NETXBIG_V2_GPIO_POWER_OFF, 0) == 0) | ||
388 | pm_power_off = netxbig_v2_power_off; | ||
389 | else | ||
390 | pr_err("netxbig_v2: failed to configure power-off GPIO\n"); | ||
391 | } | ||
392 | |||
393 | #ifdef CONFIG_MACH_NET2BIG_V2 | ||
394 | MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2") | ||
395 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
396 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
397 | .boot_params = 0x00000100, | ||
398 | .init_machine = netxbig_v2_init, | ||
399 | .map_io = kirkwood_map_io, | ||
400 | .init_irq = kirkwood_init_irq, | ||
401 | .timer = &netxbig_v2_timer, | ||
402 | MACHINE_END | ||
403 | #endif | ||
404 | |||
405 | #ifdef CONFIG_MACH_NET5BIG_V2 | ||
406 | MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2") | ||
407 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
408 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
409 | .boot_params = 0x00000100, | ||
410 | .init_machine = netxbig_v2_init, | ||
411 | .map_io = kirkwood_map_io, | ||
412 | .init_irq = kirkwood_init_irq, | ||
413 | .timer = &netxbig_v2_timer, | ||
414 | MACHINE_END | ||
415 | #endif | ||
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c index a2d307ec0420..244655d323ea 100644 --- a/arch/arm/mach-mmp/aspenite.c +++ b/arch/arm/mach-mmp/aspenite.c | |||
@@ -59,6 +59,13 @@ static unsigned long common_pin_config[] __initdata = { | |||
59 | /* UART1 */ | 59 | /* UART1 */ |
60 | GPIO107_UART1_RXD, | 60 | GPIO107_UART1_RXD, |
61 | GPIO108_UART1_TXD, | 61 | GPIO108_UART1_TXD, |
62 | |||
63 | /* SSP1 */ | ||
64 | GPIO113_I2S_MCLK, | ||
65 | GPIO114_I2S_FRM, | ||
66 | GPIO115_I2S_BCLK, | ||
67 | GPIO116_I2S_RXD, | ||
68 | GPIO117_I2S_TXD, | ||
62 | }; | 69 | }; |
63 | 70 | ||
64 | static struct smc91x_platdata smc91x_info = { | 71 | static struct smc91x_platdata smc91x_info = { |
@@ -123,12 +130,18 @@ static struct pxa3xx_nand_platform_data aspenite_nand_info = { | |||
123 | .nr_parts = ARRAY_SIZE(aspenite_nand_partitions), | 130 | .nr_parts = ARRAY_SIZE(aspenite_nand_partitions), |
124 | }; | 131 | }; |
125 | 132 | ||
133 | static struct i2c_board_info aspenite_i2c_info[] __initdata = { | ||
134 | { I2C_BOARD_INFO("wm8753", 0x1b), }, | ||
135 | }; | ||
136 | |||
126 | static void __init common_init(void) | 137 | static void __init common_init(void) |
127 | { | 138 | { |
128 | mfp_config(ARRAY_AND_SIZE(common_pin_config)); | 139 | mfp_config(ARRAY_AND_SIZE(common_pin_config)); |
129 | 140 | ||
130 | /* on-chip devices */ | 141 | /* on-chip devices */ |
131 | pxa168_add_uart(1); | 142 | pxa168_add_uart(1); |
143 | pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info)); | ||
144 | pxa168_add_ssp(1); | ||
132 | pxa168_add_nand(&aspenite_nand_info); | 145 | pxa168_add_nand(&aspenite_nand_info); |
133 | 146 | ||
134 | /* off-chip devices */ | 147 | /* off-chip devices */ |
diff --git a/arch/arm/mach-mmp/include/mach/gpio.h b/arch/arm/mach-mmp/include/mach/gpio.h index ab26d13295c4..ee8b02ed8011 100644 --- a/arch/arm/mach-mmp/include/mach/gpio.h +++ b/arch/arm/mach-mmp/include/mach/gpio.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) | 10 | #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) |
11 | #define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x)))) | 11 | #define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x)))) |
12 | 12 | ||
13 | #define NR_BUILTIN_GPIO (128) | 13 | #define NR_BUILTIN_GPIO (192) |
14 | 14 | ||
15 | #define gpio_to_bank(gpio) ((gpio) >> 5) | 15 | #define gpio_to_bank(gpio) ((gpio) >> 5) |
16 | #define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio)) | 16 | #define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio)) |
diff --git a/arch/arm/mach-mmp/include/mach/irqs.h b/arch/arm/mach-mmp/include/mach/irqs.h index 02701196ea03..b379cdec4d38 100644 --- a/arch/arm/mach-mmp/include/mach/irqs.h +++ b/arch/arm/mach-mmp/include/mach/irqs.h | |||
@@ -5,10 +5,10 @@ | |||
5 | * Interrupt numbers for PXA168 | 5 | * Interrupt numbers for PXA168 |
6 | */ | 6 | */ |
7 | #define IRQ_PXA168_NONE (-1) | 7 | #define IRQ_PXA168_NONE (-1) |
8 | #define IRQ_PXA168_SSP3 0 | 8 | #define IRQ_PXA168_SSP4 0 |
9 | #define IRQ_PXA168_SSP2 1 | 9 | #define IRQ_PXA168_SSP3 1 |
10 | #define IRQ_PXA168_SSP1 2 | 10 | #define IRQ_PXA168_SSP2 2 |
11 | #define IRQ_PXA168_SSP0 3 | 11 | #define IRQ_PXA168_SSP1 3 |
12 | #define IRQ_PXA168_PMIC_INT 4 | 12 | #define IRQ_PXA168_PMIC_INT 4 |
13 | #define IRQ_PXA168_RTC_INT 5 | 13 | #define IRQ_PXA168_RTC_INT 5 |
14 | #define IRQ_PXA168_RTC_ALARM 6 | 14 | #define IRQ_PXA168_RTC_ALARM 6 |
@@ -20,7 +20,7 @@ | |||
20 | #define IRQ_PXA168_TIMER2 14 | 20 | #define IRQ_PXA168_TIMER2 14 |
21 | #define IRQ_PXA168_TIMER3 15 | 21 | #define IRQ_PXA168_TIMER3 15 |
22 | #define IRQ_PXA168_CMU 16 | 22 | #define IRQ_PXA168_CMU 16 |
23 | #define IRQ_PXA168_SSP4 17 | 23 | #define IRQ_PXA168_SSP5 17 |
24 | #define IRQ_PXA168_MSP_WAKEUP 19 | 24 | #define IRQ_PXA168_MSP_WAKEUP 19 |
25 | #define IRQ_PXA168_CF_WAKEUP 20 | 25 | #define IRQ_PXA168_CF_WAKEUP 20 |
26 | #define IRQ_PXA168_XD_WAKEUP 21 | 26 | #define IRQ_PXA168_XD_WAKEUP 21 |
diff --git a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h index 9f9f8143e272..761c2dacc079 100644 --- a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h | |||
@@ -9,6 +9,175 @@ | |||
9 | #define MFP_DRIVE_FAST (0x8 << 13) | 9 | #define MFP_DRIVE_FAST (0x8 << 13) |
10 | 10 | ||
11 | /* GPIO */ | 11 | /* GPIO */ |
12 | #define GPIO0_GPIO0 MFP_CFG(GPIO0, AF0) | ||
13 | #define GPIO1_GPIO1 MFP_CFG(GPIO1, AF0) | ||
14 | #define GPIO2_GPIO2 MFP_CFG(GPIO2, AF0) | ||
15 | #define GPIO3_GPIO3 MFP_CFG(GPIO3, AF0) | ||
16 | #define GPIO4_GPIO4 MFP_CFG(GPIO4, AF0) | ||
17 | #define GPIO5_GPIO5 MFP_CFG(GPIO5, AF0) | ||
18 | #define GPIO6_GPIO6 MFP_CFG(GPIO6, AF0) | ||
19 | #define GPIO7_GPIO7 MFP_CFG(GPIO7, AF0) | ||
20 | #define GPIO8_GPIO8 MFP_CFG(GPIO8, AF0) | ||
21 | #define GPIO9_GPIO9 MFP_CFG(GPIO9, AF0) | ||
22 | #define GPIO10_GPIO10 MFP_CFG(GPIO10, AF0) | ||
23 | #define GPIO11_GPIO11 MFP_CFG(GPIO11, AF0) | ||
24 | #define GPIO12_GPIO12 MFP_CFG(GPIO12, AF0) | ||
25 | #define GPIO13_GPIO13 MFP_CFG(GPIO13, AF0) | ||
26 | #define GPIO14_GPIO14 MFP_CFG(GPIO14, AF0) | ||
27 | #define GPIO15_GPIO15 MFP_CFG(GPIO15, AF0) | ||
28 | #define GPIO16_GPIO16 MFP_CFG(GPIO16, AF0) | ||
29 | #define GPIO17_GPIO17 MFP_CFG(GPIO17, AF0) | ||
30 | #define GPIO18_GPIO18 MFP_CFG(GPIO18, AF0) | ||
31 | #define GPIO19_GPIO19 MFP_CFG(GPIO19, AF0) | ||
32 | #define GPIO20_GPIO20 MFP_CFG(GPIO20, AF0) | ||
33 | #define GPIO21_GPIO21 MFP_CFG(GPIO21, AF0) | ||
34 | #define GPIO22_GPIO22 MFP_CFG(GPIO22, AF0) | ||
35 | #define GPIO23_GPIO23 MFP_CFG(GPIO23, AF0) | ||
36 | #define GPIO24_GPIO24 MFP_CFG(GPIO24, AF0) | ||
37 | #define GPIO25_GPIO25 MFP_CFG(GPIO25, AF0) | ||
38 | #define GPIO26_GPIO26 MFP_CFG(GPIO26, AF0) | ||
39 | #define GPIO27_GPIO27 MFP_CFG(GPIO27, AF0) | ||
40 | #define GPIO28_GPIO28 MFP_CFG(GPIO28, AF0) | ||
41 | #define GPIO29_GPIO29 MFP_CFG(GPIO29, AF0) | ||
42 | #define GPIO30_GPIO30 MFP_CFG(GPIO30, AF0) | ||
43 | #define GPIO31_GPIO31 MFP_CFG(GPIO31, AF0) | ||
44 | #define GPIO32_GPIO32 MFP_CFG(GPIO32, AF0) | ||
45 | #define GPIO33_GPIO33 MFP_CFG(GPIO33, AF0) | ||
46 | #define GPIO34_GPIO34 MFP_CFG(GPIO34, AF0) | ||
47 | #define GPIO35_GPIO35 MFP_CFG(GPIO35, AF0) | ||
48 | #define GPIO36_GPIO36 MFP_CFG(GPIO36, AF0) | ||
49 | #define GPIO37_GPIO37 MFP_CFG(GPIO37, AF0) | ||
50 | #define GPIO38_GPIO38 MFP_CFG(GPIO38, AF0) | ||
51 | #define GPIO39_GPIO39 MFP_CFG(GPIO39, AF0) | ||
52 | #define GPIO40_GPIO40 MFP_CFG(GPIO40, AF0) | ||
53 | #define GPIO41_GPIO41 MFP_CFG(GPIO41, AF0) | ||
54 | #define GPIO42_GPIO42 MFP_CFG(GPIO42, AF0) | ||
55 | #define GPIO43_GPIO43 MFP_CFG(GPIO43, AF0) | ||
56 | #define GPIO44_GPIO44 MFP_CFG(GPIO44, AF0) | ||
57 | #define GPIO45_GPIO45 MFP_CFG(GPIO45, AF0) | ||
58 | #define GPIO46_GPIO46 MFP_CFG(GPIO46, AF0) | ||
59 | #define GPIO47_GPIO47 MFP_CFG(GPIO47, AF0) | ||
60 | #define GPIO48_GPIO48 MFP_CFG(GPIO48, AF0) | ||
61 | #define GPIO49_GPIO49 MFP_CFG(GPIO49, AF0) | ||
62 | #define GPIO50_GPIO50 MFP_CFG(GPIO50, AF0) | ||
63 | #define GPIO51_GPIO51 MFP_CFG(GPIO51, AF0) | ||
64 | #define GPIO52_GPIO52 MFP_CFG(GPIO52, AF0) | ||
65 | #define GPIO53_GPIO53 MFP_CFG(GPIO53, AF0) | ||
66 | #define GPIO54_GPIO54 MFP_CFG(GPIO54, AF0) | ||
67 | #define GPIO55_GPIO55 MFP_CFG(GPIO55, AF0) | ||
68 | #define GPIO56_GPIO56 MFP_CFG(GPIO56, AF0) | ||
69 | #define GPIO57_GPIO57 MFP_CFG(GPIO57, AF0) | ||
70 | #define GPIO58_GPIO58 MFP_CFG(GPIO58, AF0) | ||
71 | #define GPIO59_GPIO59 MFP_CFG(GPIO59, AF0) | ||
72 | #define GPIO60_GPIO60 MFP_CFG(GPIO60, AF0) | ||
73 | #define GPIO61_GPIO61 MFP_CFG(GPIO61, AF0) | ||
74 | #define GPIO62_GPIO62 MFP_CFG(GPIO62, AF0) | ||
75 | #define GPIO63_GPIO63 MFP_CFG(GPIO63, AF0) | ||
76 | #define GPIO64_GPIO64 MFP_CFG(GPIO64, AF0) | ||
77 | #define GPIO65_GPIO65 MFP_CFG(GPIO65, AF0) | ||
78 | #define GPIO66_GPIO66 MFP_CFG(GPIO66, AF0) | ||
79 | #define GPIO67_GPIO67 MFP_CFG(GPIO67, AF0) | ||
80 | #define GPIO68_GPIO68 MFP_CFG(GPIO68, AF0) | ||
81 | #define GPIO69_GPIO69 MFP_CFG(GPIO69, AF0) | ||
82 | #define GPIO70_GPIO70 MFP_CFG(GPIO70, AF0) | ||
83 | #define GPIO71_GPIO71 MFP_CFG(GPIO71, AF0) | ||
84 | #define GPIO72_GPIO72 MFP_CFG(GPIO72, AF0) | ||
85 | #define GPIO73_GPIO73 MFP_CFG(GPIO73, AF0) | ||
86 | #define GPIO74_GPIO74 MFP_CFG(GPIO74, AF0) | ||
87 | #define GPIO75_GPIO75 MFP_CFG(GPIO75, AF0) | ||
88 | #define GPIO76_GPIO76 MFP_CFG(GPIO76, AF0) | ||
89 | #define GPIO77_GPIO77 MFP_CFG(GPIO77, AF0) | ||
90 | #define GPIO78_GPIO78 MFP_CFG(GPIO78, AF0) | ||
91 | #define GPIO79_GPIO79 MFP_CFG(GPIO79, AF0) | ||
92 | #define GPIO80_GPIO80 MFP_CFG(GPIO80, AF0) | ||
93 | #define GPIO81_GPIO81 MFP_CFG(GPIO81, AF0) | ||
94 | #define GPIO82_GPIO82 MFP_CFG(GPIO82, AF0) | ||
95 | #define GPIO83_GPIO83 MFP_CFG(GPIO83, AF0) | ||
96 | #define GPIO84_GPIO84 MFP_CFG(GPIO84, AF0) | ||
97 | #define GPIO85_GPIO85 MFP_CFG(GPIO85, AF0) | ||
98 | #define GPIO86_GPIO86 MFP_CFG(GPIO86, AF0) | ||
99 | #define GPIO87_GPIO87 MFP_CFG(GPIO87, AF0) | ||
100 | #define GPIO88_GPIO88 MFP_CFG(GPIO88, AF0) | ||
101 | #define GPIO89_GPIO89 MFP_CFG(GPIO89, AF0) | ||
102 | #define GPIO90_GPIO90 MFP_CFG(GPIO90, AF0) | ||
103 | #define GPIO91_GPIO91 MFP_CFG(GPIO91, AF0) | ||
104 | #define GPIO92_GPIO92 MFP_CFG(GPIO92, AF0) | ||
105 | #define GPIO93_GPIO93 MFP_CFG(GPIO93, AF0) | ||
106 | #define GPIO94_GPIO94 MFP_CFG(GPIO94, AF0) | ||
107 | #define GPIO95_GPIO95 MFP_CFG(GPIO95, AF0) | ||
108 | #define GPIO96_GPIO96 MFP_CFG(GPIO96, AF0) | ||
109 | #define GPIO97_GPIO97 MFP_CFG(GPIO97, AF0) | ||
110 | #define GPIO98_GPIO98 MFP_CFG(GPIO98, AF0) | ||
111 | #define GPIO99_GPIO99 MFP_CFG(GPIO99, AF0) | ||
112 | #define GPIO100_GPIO100 MFP_CFG(GPIO100, AF0) | ||
113 | #define GPIO101_GPIO101 MFP_CFG(GPIO101, AF0) | ||
114 | #define GPIO102_GPIO102 MFP_CFG(GPIO102, AF1) | ||
115 | #define GPIO103_GPIO103 MFP_CFG(GPIO103, AF1) | ||
116 | #define GPIO104_GPIO104 MFP_CFG(GPIO104, AF1) | ||
117 | #define GPIO105_GPIO105 MFP_CFG(GPIO105, AF1) | ||
118 | #define GPIO106_GPIO106 MFP_CFG(GPIO106, AF1) | ||
119 | #define GPIO107_GPIO107 MFP_CFG(GPIO107, AF1) | ||
120 | #define GPIO108_GPIO108 MFP_CFG(GPIO108, AF1) | ||
121 | #define GPIO109_GPIO109 MFP_CFG(GPIO109, AF1) | ||
122 | #define GPIO110_GPIO110 MFP_CFG(GPIO110, AF1) | ||
123 | #define GPIO111_GPIO111 MFP_CFG(GPIO111, AF1) | ||
124 | #define GPIO112_GPIO112 MFP_CFG(GPIO112, AF1) | ||
125 | #define GPIO113_GPIO113 MFP_CFG(GPIO113, AF1) | ||
126 | #define GPIO114_GPIO114 MFP_CFG(GPIO114, AF0) | ||
127 | #define GPIO115_GPIO115 MFP_CFG(GPIO115, AF0) | ||
128 | #define GPIO116_GPIO116 MFP_CFG(GPIO116, AF0) | ||
129 | #define GPIO117_GPIO117 MFP_CFG(GPIO117, AF0) | ||
130 | #define GPIO118_GPIO118 MFP_CFG(GPIO118, AF0) | ||
131 | #define GPIO119_GPIO119 MFP_CFG(GPIO119, AF0) | ||
132 | #define GPIO120_GPIO120 MFP_CFG(GPIO120, AF0) | ||
133 | #define GPIO121_GPIO121 MFP_CFG(GPIO121, AF0) | ||
134 | #define GPIO122_GPIO122 MFP_CFG(GPIO122, AF0) | ||
135 | #define GPIO123_GPIO123 MFP_CFG(GPIO123, AF0) | ||
136 | #define GPIO124_GPIO124 MFP_CFG(GPIO124, AF0) | ||
137 | #define GPIO125_GPIO125 MFP_CFG(GPIO125, AF0) | ||
138 | #define GPIO126_GPIO126 MFP_CFG(GPIO126, AF0) | ||
139 | #define GPIO127_GPIO127 MFP_CFG(GPIO127, AF0) | ||
140 | #define GPIO128_GPIO128 MFP_CFG(GPIO128, AF0) | ||
141 | #define GPIO129_GPIO129 MFP_CFG(GPIO129, AF0) | ||
142 | #define GPIO130_GPIO130 MFP_CFG(GPIO130, AF0) | ||
143 | #define GPIO131_GPIO131 MFP_CFG(GPIO131, AF0) | ||
144 | #define GPIO132_GPIO132 MFP_CFG(GPIO132, AF0) | ||
145 | #define GPIO133_GPIO133 MFP_CFG(GPIO133, AF0) | ||
146 | #define GPIO134_GPIO134 MFP_CFG(GPIO134, AF0) | ||
147 | #define GPIO135_GPIO135 MFP_CFG(GPIO135, AF0) | ||
148 | #define GPIO136_GPIO136 MFP_CFG(GPIO136, AF0) | ||
149 | #define GPIO137_GPIO137 MFP_CFG(GPIO137, AF0) | ||
150 | #define GPIO138_GPIO138 MFP_CFG(GPIO138, AF0) | ||
151 | #define GPIO139_GPIO139 MFP_CFG(GPIO139, AF0) | ||
152 | #define GPIO140_GPIO140 MFP_CFG(GPIO140, AF0) | ||
153 | #define GPIO141_GPIO141 MFP_CFG(GPIO141, AF0) | ||
154 | #define GPIO142_GPIO142 MFP_CFG(GPIO142, AF1) | ||
155 | #define GPIO143_GPIO143 MFP_CFG(GPIO143, AF1) | ||
156 | #define GPIO144_GPIO144 MFP_CFG(GPIO144, AF1) | ||
157 | #define GPIO145_GPIO145 MFP_CFG(GPIO145, AF1) | ||
158 | #define GPIO146_GPIO146 MFP_CFG(GPIO146, AF1) | ||
159 | #define GPIO147_GPIO147 MFP_CFG(GPIO147, AF1) | ||
160 | #define GPIO148_GPIO148 MFP_CFG(GPIO148, AF1) | ||
161 | #define GPIO149_GPIO149 MFP_CFG(GPIO149, AF1) | ||
162 | #define GPIO150_GPIO150 MFP_CFG(GPIO150, AF1) | ||
163 | #define GPIO151_GPIO151 MFP_CFG(GPIO151, AF1) | ||
164 | #define GPIO152_GPIO152 MFP_CFG(GPIO152, AF1) | ||
165 | #define GPIO153_GPIO153 MFP_CFG(GPIO153, AF1) | ||
166 | #define GPIO154_GPIO154 MFP_CFG(GPIO154, AF1) | ||
167 | #define GPIO155_GPIO155 MFP_CFG(GPIO155, AF1) | ||
168 | #define GPIO156_GPIO156 MFP_CFG(GPIO156, AF1) | ||
169 | #define GPIO157_GPIO157 MFP_CFG(GPIO157, AF1) | ||
170 | #define GPIO158_GPIO158 MFP_CFG(GPIO158, AF1) | ||
171 | #define GPIO159_GPIO159 MFP_CFG(GPIO159, AF1) | ||
172 | #define GPIO160_GPIO160 MFP_CFG(GPIO160, AF1) | ||
173 | #define GPIO161_GPIO161 MFP_CFG(GPIO161, AF1) | ||
174 | #define GPIO162_GPIO162 MFP_CFG(GPIO162, AF1) | ||
175 | #define GPIO163_GPIO163 MFP_CFG(GPIO163, AF1) | ||
176 | #define GPIO164_GPIO164 MFP_CFG(GPIO164, AF1) | ||
177 | #define GPIO165_GPIO165 MFP_CFG(GPIO165, AF1) | ||
178 | #define GPIO166_GPIO166 MFP_CFG(GPIO166, AF1) | ||
179 | #define GPIO167_GPIO167 MFP_CFG(GPIO167, AF1) | ||
180 | #define GPIO168_GPIO168 MFP_CFG(GPIO168, AF1) | ||
12 | 181 | ||
13 | /* DFI */ | 182 | /* DFI */ |
14 | #define GPIO108_DFI_D15 MFP_CFG(GPIO108, AF0) | 183 | #define GPIO108_DFI_D15 MFP_CFG(GPIO108, AF0) |
@@ -47,7 +216,6 @@ | |||
47 | 216 | ||
48 | /* Ethernet */ | 217 | /* Ethernet */ |
49 | #define GPIO155_SM_ADVMUX MFP_CFG(GPIO155, AF2) | 218 | #define GPIO155_SM_ADVMUX MFP_CFG(GPIO155, AF2) |
50 | #define GPIO155_GPIO155 MFP_CFG(GPIO155, AF1) | ||
51 | 219 | ||
52 | /* UART1 */ | 220 | /* UART1 */ |
53 | #define GPIO45_UART1_RXD MFP_CFG(GPIO45, AF1) | 221 | #define GPIO45_UART1_RXD MFP_CFG(GPIO45, AF1) |
@@ -159,6 +327,8 @@ | |||
159 | #define GPIO44_TWSI2_SDA MFP_CFG_DRV(GPIO44, AF1, SLOW) | 327 | #define GPIO44_TWSI2_SDA MFP_CFG_DRV(GPIO44, AF1, SLOW) |
160 | #define GPIO71_TWSI3_SCL MFP_CFG_DRV(GPIO71, AF1, SLOW) | 328 | #define GPIO71_TWSI3_SCL MFP_CFG_DRV(GPIO71, AF1, SLOW) |
161 | #define GPIO72_TWSI3_SDA MFP_CFG_DRV(GPIO72, AF1, SLOW) | 329 | #define GPIO72_TWSI3_SDA MFP_CFG_DRV(GPIO72, AF1, SLOW) |
330 | #define TWSI4_SCL MFP_CFG_DRV(TWSI4_SCL, AF0, SLOW) | ||
331 | #define TWSI4_SDA MFP_CFG_DRV(TWSI4_SDA, AF0, SLOW) | ||
162 | #define GPIO99_TWSI5_SCL MFP_CFG_DRV(GPIO99, AF4, SLOW) | 332 | #define GPIO99_TWSI5_SCL MFP_CFG_DRV(GPIO99, AF4, SLOW) |
163 | #define GPIO100_TWSI5_SDA MFP_CFG_DRV(GPIO100, AF4, SLOW) | 333 | #define GPIO100_TWSI5_SDA MFP_CFG_DRV(GPIO100, AF4, SLOW) |
164 | #define GPIO97_TWSI6_SCL MFP_CFG_DRV(GPIO97, AF2, SLOW) | 334 | #define GPIO97_TWSI6_SCL MFP_CFG_DRV(GPIO97, AF2, SLOW) |
@@ -218,21 +388,6 @@ | |||
218 | #define GPIO69_CAM_MCLK MFP_CFG_DRV(GPIO69, AF1, FAST) | 388 | #define GPIO69_CAM_MCLK MFP_CFG_DRV(GPIO69, AF1, FAST) |
219 | #define GPIO70_CAM_PCLK MFP_CFG_DRV(GPIO70, AF1, FAST) | 389 | #define GPIO70_CAM_PCLK MFP_CFG_DRV(GPIO70, AF1, FAST) |
220 | 390 | ||
221 | /* Wifi */ | ||
222 | #define GPIO45_GPIO45 MFP_CFG(GPIO45, AF0) | ||
223 | #define GPIO46_GPIO46 MFP_CFG(GPIO46, AF0) | ||
224 | #define GPIO21_GPIO21 MFP_CFG(GPIO21, AF0) | ||
225 | #define GPIO22_GPIO22 MFP_CFG(GPIO22, AF0) | ||
226 | #define GPIO55_GPIO55 MFP_CFG(GPIO55, AF0) | ||
227 | #define GPIO56_GPIO56 MFP_CFG(GPIO56, AF0) | ||
228 | #define GPIO57_GPIO57 MFP_CFG(GPIO57, AF0) | ||
229 | #define GPIO58_GPIO58 MFP_CFG(GPIO58, AF0) | ||
230 | |||
231 | /* Codec*/ | ||
232 | #define GPIO23_GPIO23 MFP_CFG(GPIO23, AF0) | ||
233 | |||
234 | #define GPIO101_GPIO101 MFP_CFG(GPIO101, AF0) | ||
235 | |||
236 | /* PMIC */ | 391 | /* PMIC */ |
237 | #define PMIC_PMIC_INT MFP_CFG(PMIC_INT, AF0) | 392 | #define PMIC_PMIC_INT MFP_CFG(PMIC_INT, AF0) |
238 | 393 | ||
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h index 459f3be9cfb2..fec220bd5046 100644 --- a/arch/arm/mach-mmp/include/mach/mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mmp2.h | |||
@@ -39,17 +39,17 @@ static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data, | |||
39 | int ret; | 39 | int ret; |
40 | 40 | ||
41 | switch (id) { | 41 | switch (id) { |
42 | case 0: d = &mmp2_device_twsi1; break; | 42 | case 1: d = &mmp2_device_twsi1; break; |
43 | case 1: d = &mmp2_device_twsi2; break; | 43 | case 2: d = &mmp2_device_twsi2; break; |
44 | case 2: d = &mmp2_device_twsi3; break; | 44 | case 3: d = &mmp2_device_twsi3; break; |
45 | case 3: d = &mmp2_device_twsi4; break; | 45 | case 4: d = &mmp2_device_twsi4; break; |
46 | case 4: d = &mmp2_device_twsi5; break; | 46 | case 5: d = &mmp2_device_twsi5; break; |
47 | case 5: d = &mmp2_device_twsi6; break; | 47 | case 6: d = &mmp2_device_twsi6; break; |
48 | default: | 48 | default: |
49 | return -EINVAL; | 49 | return -EINVAL; |
50 | } | 50 | } |
51 | 51 | ||
52 | ret = i2c_register_board_info(id, info, size); | 52 | ret = i2c_register_board_info(id - 1, info, size); |
53 | if (ret) | 53 | if (ret) |
54 | return ret; | 54 | return ret; |
55 | 55 | ||
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h index 3ad612cbdf09..3b2bd5d5eb05 100644 --- a/arch/arm/mach-mmp/include/mach/pxa168.h +++ b/arch/arm/mach-mmp/include/mach/pxa168.h | |||
@@ -14,6 +14,11 @@ extern struct pxa_device_desc pxa168_device_pwm1; | |||
14 | extern struct pxa_device_desc pxa168_device_pwm2; | 14 | extern struct pxa_device_desc pxa168_device_pwm2; |
15 | extern struct pxa_device_desc pxa168_device_pwm3; | 15 | extern struct pxa_device_desc pxa168_device_pwm3; |
16 | extern struct pxa_device_desc pxa168_device_pwm4; | 16 | extern struct pxa_device_desc pxa168_device_pwm4; |
17 | extern struct pxa_device_desc pxa168_device_ssp1; | ||
18 | extern struct pxa_device_desc pxa168_device_ssp2; | ||
19 | extern struct pxa_device_desc pxa168_device_ssp3; | ||
20 | extern struct pxa_device_desc pxa168_device_ssp4; | ||
21 | extern struct pxa_device_desc pxa168_device_ssp5; | ||
17 | extern struct pxa_device_desc pxa168_device_nand; | 22 | extern struct pxa_device_desc pxa168_device_nand; |
18 | 23 | ||
19 | static inline int pxa168_add_uart(int id) | 24 | static inline int pxa168_add_uart(int id) |
@@ -67,6 +72,22 @@ static inline int pxa168_add_pwm(int id) | |||
67 | return pxa_register_device(d, NULL, 0); | 72 | return pxa_register_device(d, NULL, 0); |
68 | } | 73 | } |
69 | 74 | ||
75 | static inline int pxa168_add_ssp(int id) | ||
76 | { | ||
77 | struct pxa_device_desc *d = NULL; | ||
78 | |||
79 | switch (id) { | ||
80 | case 1: d = &pxa168_device_ssp1; break; | ||
81 | case 2: d = &pxa168_device_ssp2; break; | ||
82 | case 3: d = &pxa168_device_ssp3; break; | ||
83 | case 4: d = &pxa168_device_ssp4; break; | ||
84 | case 5: d = &pxa168_device_ssp5; break; | ||
85 | default: | ||
86 | return -EINVAL; | ||
87 | } | ||
88 | return pxa_register_device(d, NULL, 0); | ||
89 | } | ||
90 | |||
70 | static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info) | 91 | static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info) |
71 | { | 92 | { |
72 | return pxa_register_device(&pxa168_device_nand, info, sizeof(*info)); | 93 | return pxa_register_device(&pxa168_device_nand, info, sizeof(*info)); |
diff --git a/arch/arm/mach-mmp/include/mach/regs-apbc.h b/arch/arm/mach-mmp/include/mach/regs-apbc.h index 712af03fd1af..1a96585336ba 100644 --- a/arch/arm/mach-mmp/include/mach/regs-apbc.h +++ b/arch/arm/mach-mmp/include/mach/regs-apbc.h | |||
@@ -26,8 +26,6 @@ | |||
26 | #define APBC_PXA168_PWM2 APBC_REG(0x010) | 26 | #define APBC_PXA168_PWM2 APBC_REG(0x010) |
27 | #define APBC_PXA168_PWM3 APBC_REG(0x014) | 27 | #define APBC_PXA168_PWM3 APBC_REG(0x014) |
28 | #define APBC_PXA168_PWM4 APBC_REG(0x018) | 28 | #define APBC_PXA168_PWM4 APBC_REG(0x018) |
29 | #define APBC_PXA168_SSP1 APBC_REG(0x01c) | ||
30 | #define APBC_PXA168_SSP2 APBC_REG(0x020) | ||
31 | #define APBC_PXA168_RTC APBC_REG(0x028) | 29 | #define APBC_PXA168_RTC APBC_REG(0x028) |
32 | #define APBC_PXA168_TWSI0 APBC_REG(0x02c) | 30 | #define APBC_PXA168_TWSI0 APBC_REG(0x02c) |
33 | #define APBC_PXA168_KPC APBC_REG(0x030) | 31 | #define APBC_PXA168_KPC APBC_REG(0x030) |
@@ -35,14 +33,16 @@ | |||
35 | #define APBC_PXA168_AIB APBC_REG(0x03c) | 33 | #define APBC_PXA168_AIB APBC_REG(0x03c) |
36 | #define APBC_PXA168_SW_JTAG APBC_REG(0x040) | 34 | #define APBC_PXA168_SW_JTAG APBC_REG(0x040) |
37 | #define APBC_PXA168_ONEWIRE APBC_REG(0x048) | 35 | #define APBC_PXA168_ONEWIRE APBC_REG(0x048) |
38 | #define APBC_PXA168_SSP3 APBC_REG(0x04c) | ||
39 | #define APBC_PXA168_ASFAR APBC_REG(0x050) | 36 | #define APBC_PXA168_ASFAR APBC_REG(0x050) |
40 | #define APBC_PXA168_ASSAR APBC_REG(0x054) | 37 | #define APBC_PXA168_ASSAR APBC_REG(0x054) |
41 | #define APBC_PXA168_SSP4 APBC_REG(0x058) | ||
42 | #define APBC_PXA168_SSP5 APBC_REG(0x05c) | ||
43 | #define APBC_PXA168_TWSI1 APBC_REG(0x06c) | 38 | #define APBC_PXA168_TWSI1 APBC_REG(0x06c) |
44 | #define APBC_PXA168_UART3 APBC_REG(0x070) | 39 | #define APBC_PXA168_UART3 APBC_REG(0x070) |
45 | #define APBC_PXA168_AC97 APBC_REG(0x084) | 40 | #define APBC_PXA168_AC97 APBC_REG(0x084) |
41 | #define APBC_PXA168_SSP1 APBC_REG(0x81c) | ||
42 | #define APBC_PXA168_SSP2 APBC_REG(0x820) | ||
43 | #define APBC_PXA168_SSP3 APBC_REG(0x84c) | ||
44 | #define APBC_PXA168_SSP4 APBC_REG(0x858) | ||
45 | #define APBC_PXA168_SSP5 APBC_REG(0x85c) | ||
46 | 46 | ||
47 | /* | 47 | /* |
48 | * APB Clock register offsets for PXA910 | 48 | * APB Clock register offsets for PXA910 |
diff --git a/arch/arm/mach-mmp/include/mach/regs-smc.h b/arch/arm/mach-mmp/include/mach/regs-smc.h new file mode 100644 index 000000000000..e484d40d71bd --- /dev/null +++ b/arch/arm/mach-mmp/include/mach/regs-smc.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/include/mach/regs-smc.h | ||
3 | * | ||
4 | * Static Memory Controller Registers | ||
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_MACH_REGS_SMC_H | ||
12 | #define __ASM_MACH_REGS_SMC_H | ||
13 | |||
14 | #include <mach/addr-map.h> | ||
15 | |||
16 | #define SMC_VIRT_BASE (AXI_VIRT_BASE + 0x83800) | ||
17 | #define SMC_REG(x) (SMC_VIRT_BASE + (x)) | ||
18 | |||
19 | #define SMC_MSC0 SMC_REG(0x0020) | ||
20 | #define SMC_MSC1 SMC_REG(0x0024) | ||
21 | #define SMC_SXCNFG0 SMC_REG(0x0030) | ||
22 | #define SMC_SXCNFG1 SMC_REG(0x0034) | ||
23 | #define SMC_MEMCLKCFG SMC_REG(0x0068) | ||
24 | #define SMC_CSDFICFG0 SMC_REG(0x0090) | ||
25 | #define SMC_CSDFICFG1 SMC_REG(0x0094) | ||
26 | #define SMC_CLK_RET_DEL SMC_REG(0x00b0) | ||
27 | #define SMC_ADV_RET_DEL SMC_REG(0x00b4) | ||
28 | #define SMC_CSADRMAP0 SMC_REG(0x00c0) | ||
29 | #define SMC_CSADRMAP1 SMC_REG(0x00c4) | ||
30 | #define SMC_WE_AP0 SMC_REG(0x00e0) | ||
31 | #define SMC_WE_AP1 SMC_REG(0x00e4) | ||
32 | #define SMC_OE_AP0 SMC_REG(0x00f0) | ||
33 | #define SMC_OE_AP1 SMC_REG(0x00f4) | ||
34 | #define SMC_ADV_AP0 SMC_REG(0x0100) | ||
35 | #define SMC_ADV_AP1 SMC_REG(0x0104) | ||
36 | |||
37 | #endif /* __ASM_MACH_REGS_SMC_H */ | ||
diff --git a/arch/arm/mach-mmp/include/mach/timex.h b/arch/arm/mach-mmp/include/mach/timex.h index 6cebbd0ca8f4..70c9f1d88c02 100644 --- a/arch/arm/mach-mmp/include/mach/timex.h +++ b/arch/arm/mach-mmp/include/mach/timex.h | |||
@@ -6,4 +6,8 @@ | |||
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifdef CONFIG_CPU_MMP2 | ||
10 | #define CLOCK_TICK_RATE 6500000 | ||
11 | #else | ||
9 | #define CLOCK_TICK_RATE 3250000 | 12 | #define CLOCK_TICK_RATE 3250000 |
13 | #endif | ||
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c index cfd4d66ef800..d77dd41d60e1 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c | |||
@@ -15,12 +15,16 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
18 | #include <linux/regulator/machine.h> | ||
19 | #include <linux/regulator/max8649.h> | ||
20 | #include <linux/mfd/max8925.h> | ||
18 | 21 | ||
19 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
20 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
21 | #include <mach/addr-map.h> | 24 | #include <mach/addr-map.h> |
22 | #include <mach/mfp-mmp2.h> | 25 | #include <mach/mfp-mmp2.h> |
23 | #include <mach/mmp2.h> | 26 | #include <mach/mmp2.h> |
27 | #include <mach/irqs.h> | ||
24 | 28 | ||
25 | #include "common.h" | 29 | #include "common.h" |
26 | 30 | ||
@@ -58,6 +62,63 @@ static unsigned long jasper_pin_config[] __initdata = { | |||
58 | GPIO149_ND_CLE, | 62 | GPIO149_ND_CLE, |
59 | GPIO112_ND_RDY0, | 63 | GPIO112_ND_RDY0, |
60 | GPIO160_ND_RDY1, | 64 | GPIO160_ND_RDY1, |
65 | |||
66 | /* PMIC */ | ||
67 | PMIC_PMIC_INT | MFP_LPM_EDGE_FALL, | ||
68 | }; | ||
69 | |||
70 | static struct regulator_consumer_supply max8649_supply[] = { | ||
71 | REGULATOR_SUPPLY("vcc_core", NULL), | ||
72 | }; | ||
73 | |||
74 | static struct regulator_init_data max8649_init_data = { | ||
75 | .constraints = { | ||
76 | .name = "vcc_core range", | ||
77 | .min_uV = 1150000, | ||
78 | .max_uV = 1280000, | ||
79 | .always_on = 1, | ||
80 | .boot_on = 1, | ||
81 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
82 | }, | ||
83 | .num_consumer_supplies = 1, | ||
84 | .consumer_supplies = &max8649_supply[0], | ||
85 | }; | ||
86 | |||
87 | static struct max8649_platform_data jasper_max8649_info = { | ||
88 | .mode = 2, /* VID1 = 1, VID0 = 0 */ | ||
89 | .extclk = 0, | ||
90 | .ramp_timing = MAX8649_RAMP_32MV, | ||
91 | .regulator = &max8649_init_data, | ||
92 | }; | ||
93 | |||
94 | static struct max8925_backlight_pdata jasper_backlight_data = { | ||
95 | .dual_string = 0, | ||
96 | }; | ||
97 | |||
98 | static struct max8925_power_pdata jasper_power_data = { | ||
99 | .batt_detect = 0, /* can't detect battery by ID pin */ | ||
100 | .topoff_threshold = MAX8925_TOPOFF_THR_10PER, | ||
101 | .fast_charge = MAX8925_FCHG_1000MA, | ||
102 | }; | ||
103 | |||
104 | static struct max8925_platform_data jasper_max8925_info = { | ||
105 | .backlight = &jasper_backlight_data, | ||
106 | .power = &jasper_power_data, | ||
107 | .irq_base = IRQ_BOARD_START, | ||
108 | }; | ||
109 | |||
110 | static struct i2c_board_info jasper_twsi1_info[] = { | ||
111 | [0] = { | ||
112 | .type = "max8649", | ||
113 | .addr = 0x60, | ||
114 | .platform_data = &jasper_max8649_info, | ||
115 | }, | ||
116 | [1] = { | ||
117 | .type = "max8925", | ||
118 | .addr = 0x3c, | ||
119 | .irq = IRQ_MMP2_PMIC, | ||
120 | .platform_data = &jasper_max8925_info, | ||
121 | }, | ||
61 | }; | 122 | }; |
62 | 123 | ||
63 | static void __init jasper_init(void) | 124 | static void __init jasper_init(void) |
@@ -67,6 +128,9 @@ static void __init jasper_init(void) | |||
67 | /* on-chip devices */ | 128 | /* on-chip devices */ |
68 | mmp2_add_uart(1); | 129 | mmp2_add_uart(1); |
69 | mmp2_add_uart(3); | 130 | mmp2_add_uart(3); |
131 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); | ||
132 | |||
133 | regulator_has_full_constraints(); | ||
70 | } | 134 | } |
71 | 135 | ||
72 | MACHINE_START(MARVELL_JASPER, "Jasper Development Platform") | 136 | MACHINE_START(MARVELL_JASPER, "Jasper Development Platform") |
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index 72eb9daeea99..7f5eb059bb01 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c | |||
@@ -15,11 +15,14 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | 17 | ||
18 | #include <asm/hardware/cache-tauros2.h> | ||
19 | |||
18 | #include <mach/addr-map.h> | 20 | #include <mach/addr-map.h> |
19 | #include <mach/regs-apbc.h> | 21 | #include <mach/regs-apbc.h> |
20 | #include <mach/regs-apmu.h> | 22 | #include <mach/regs-apmu.h> |
21 | #include <mach/cputype.h> | 23 | #include <mach/cputype.h> |
22 | #include <mach/irqs.h> | 24 | #include <mach/irqs.h> |
25 | #include <mach/dma.h> | ||
23 | #include <mach/mfp.h> | 26 | #include <mach/mfp.h> |
24 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
25 | #include <mach/devices.h> | 28 | #include <mach/devices.h> |
@@ -32,7 +35,50 @@ | |||
32 | #define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x9c) | 35 | #define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x9c) |
33 | 36 | ||
34 | static struct mfp_addr_map mmp2_addr_map[] __initdata = { | 37 | static struct mfp_addr_map mmp2_addr_map[] __initdata = { |
38 | |||
39 | MFP_ADDR_X(GPIO0, GPIO58, 0x54), | ||
40 | MFP_ADDR_X(GPIO59, GPIO73, 0x280), | ||
41 | MFP_ADDR_X(GPIO74, GPIO101, 0x170), | ||
42 | |||
43 | MFP_ADDR(GPIO102, 0x0), | ||
44 | MFP_ADDR(GPIO103, 0x4), | ||
45 | MFP_ADDR(GPIO104, 0x1fc), | ||
46 | MFP_ADDR(GPIO105, 0x1f8), | ||
47 | MFP_ADDR(GPIO106, 0x1f4), | ||
48 | MFP_ADDR(GPIO107, 0x1f0), | ||
49 | MFP_ADDR(GPIO108, 0x21c), | ||
50 | MFP_ADDR(GPIO109, 0x218), | ||
51 | MFP_ADDR(GPIO110, 0x214), | ||
52 | MFP_ADDR(GPIO111, 0x200), | ||
53 | MFP_ADDR(GPIO112, 0x244), | ||
54 | MFP_ADDR(GPIO113, 0x25c), | ||
55 | MFP_ADDR(GPIO114, 0x164), | ||
56 | MFP_ADDR_X(GPIO115, GPIO122, 0x260), | ||
57 | |||
58 | MFP_ADDR(GPIO123, 0x148), | ||
59 | MFP_ADDR_X(GPIO124, GPIO141, 0xc), | ||
60 | |||
61 | MFP_ADDR(GPIO142, 0x8), | ||
62 | MFP_ADDR_X(GPIO143, GPIO151, 0x220), | ||
63 | MFP_ADDR_X(GPIO152, GPIO153, 0x248), | ||
64 | MFP_ADDR_X(GPIO154, GPIO155, 0x254), | ||
65 | MFP_ADDR_X(GPIO156, GPIO159, 0x14c), | ||
66 | |||
67 | MFP_ADDR(GPIO160, 0x250), | ||
68 | MFP_ADDR(GPIO161, 0x210), | ||
69 | MFP_ADDR(GPIO162, 0x20c), | ||
70 | MFP_ADDR(GPIO163, 0x208), | ||
71 | MFP_ADDR(GPIO164, 0x204), | ||
72 | MFP_ADDR(GPIO165, 0x1ec), | ||
73 | MFP_ADDR(GPIO166, 0x1e8), | ||
74 | MFP_ADDR(GPIO167, 0x1e4), | ||
75 | MFP_ADDR(GPIO168, 0x1e0), | ||
76 | |||
77 | MFP_ADDR_X(TWSI1_SCL, TWSI1_SDA, 0x140), | ||
78 | MFP_ADDR_X(TWSI4_SCL, TWSI4_SDA, 0x2bc), | ||
79 | |||
35 | MFP_ADDR(PMIC_INT, 0x2c4), | 80 | MFP_ADDR(PMIC_INT, 0x2c4), |
81 | MFP_ADDR(CLK_REQ, 0x160), | ||
36 | 82 | ||
37 | MFP_ADDR_END, | 83 | MFP_ADDR_END, |
38 | }; | 84 | }; |
@@ -99,9 +145,13 @@ static struct clk_lookup mmp2_clkregs[] = { | |||
99 | static int __init mmp2_init(void) | 145 | static int __init mmp2_init(void) |
100 | { | 146 | { |
101 | if (cpu_is_mmp2()) { | 147 | if (cpu_is_mmp2()) { |
148 | #ifdef CONFIG_CACHE_TAUROS2 | ||
149 | tauros2_init(); | ||
150 | #endif | ||
102 | mfp_init_base(MFPR_VIRT_BASE); | 151 | mfp_init_base(MFPR_VIRT_BASE); |
103 | mfp_init_addr(mmp2_addr_map); | 152 | mfp_init_addr(mmp2_addr_map); |
104 | clks_register(ARRAY_AND_SIZE(mmp2_clkregs)); | 153 | pxa_init_dma(IRQ_MMP2_DMA_RIQ, 16); |
154 | clkdev_add_table(ARRAY_AND_SIZE(mmp2_clkregs)); | ||
105 | } | 155 | } |
106 | 156 | ||
107 | return 0; | 157 | return 0; |
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 1873c821df90..652ae660634c 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -72,6 +72,11 @@ static APBC_CLK(pwm1, PXA168_PWM1, 1, 13000000); | |||
72 | static APBC_CLK(pwm2, PXA168_PWM2, 1, 13000000); | 72 | static APBC_CLK(pwm2, PXA168_PWM2, 1, 13000000); |
73 | static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000); | 73 | static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000); |
74 | static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000); | 74 | static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000); |
75 | static APBC_CLK(ssp1, PXA168_SSP1, 4, 0); | ||
76 | static APBC_CLK(ssp2, PXA168_SSP2, 4, 0); | ||
77 | static APBC_CLK(ssp3, PXA168_SSP3, 4, 0); | ||
78 | static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); | ||
79 | static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); | ||
75 | 80 | ||
76 | static APMU_CLK(nand, NAND, 0x01db, 208000000); | 81 | static APMU_CLK(nand, NAND, 0x01db, 208000000); |
77 | 82 | ||
@@ -85,6 +90,11 @@ static struct clk_lookup pxa168_clkregs[] = { | |||
85 | INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL), | 90 | INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL), |
86 | INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL), | 91 | INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL), |
87 | INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL), | 92 | INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL), |
93 | INIT_CLKREG(&clk_ssp1, "pxa168-ssp.0", NULL), | ||
94 | INIT_CLKREG(&clk_ssp2, "pxa168-ssp.1", NULL), | ||
95 | INIT_CLKREG(&clk_ssp3, "pxa168-ssp.2", NULL), | ||
96 | INIT_CLKREG(&clk_ssp4, "pxa168-ssp.3", NULL), | ||
97 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), | ||
88 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 98 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
89 | }; | 99 | }; |
90 | 100 | ||
@@ -132,3 +142,8 @@ PXA168_DEVICE(pwm2, "pxa168-pwm", 1, NONE, 0xd401a400, 0x10); | |||
132 | PXA168_DEVICE(pwm3, "pxa168-pwm", 2, NONE, 0xd401a800, 0x10); | 142 | PXA168_DEVICE(pwm3, "pxa168-pwm", 2, NONE, 0xd401a800, 0x10); |
133 | PXA168_DEVICE(pwm4, "pxa168-pwm", 3, NONE, 0xd401ac00, 0x10); | 143 | PXA168_DEVICE(pwm4, "pxa168-pwm", 3, NONE, 0xd401ac00, 0x10); |
134 | PXA168_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); | 144 | PXA168_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); |
145 | PXA168_DEVICE(ssp1, "pxa168-ssp", 0, SSP1, 0xd401b000, 0x40, 52, 53); | ||
146 | PXA168_DEVICE(ssp2, "pxa168-ssp", 1, SSP2, 0xd401c000, 0x40, 54, 55); | ||
147 | PXA168_DEVICE(ssp3, "pxa168-ssp", 2, SSP3, 0xd401f000, 0x40, 56, 57); | ||
148 | PXA168_DEVICE(ssp4, "pxa168-ssp", 3, SSP4, 0xd4020000, 0x40, 58, 59); | ||
149 | PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61); | ||
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig index f780086befd7..b9fd5c528e5b 100644 --- a/arch/arm/mach-msm/Kconfig +++ b/arch/arm/mach-msm/Kconfig | |||
@@ -29,12 +29,14 @@ endchoice | |||
29 | 29 | ||
30 | config MACH_HALIBUT | 30 | config MACH_HALIBUT |
31 | depends on ARCH_MSM | 31 | depends on ARCH_MSM |
32 | select CPU_V6 | ||
32 | default y | 33 | default y |
33 | bool "Halibut Board (QCT SURF7201A)" | 34 | bool "Halibut Board (QCT SURF7201A)" |
34 | help | 35 | help |
35 | Support for the Qualcomm SURF7201A eval board. | 36 | Support for the Qualcomm SURF7201A eval board. |
36 | 37 | ||
37 | config MACH_TROUT | 38 | config MACH_TROUT |
39 | select CPU_V6 | ||
38 | default y | 40 | default y |
39 | bool "HTC Dream (aka trout)" | 41 | bool "HTC Dream (aka trout)" |
40 | help | 42 | help |
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig index 3c5e0f522e9c..71f3ea623974 100644 --- a/arch/arm/mach-nomadik/Kconfig +++ b/arch/arm/mach-nomadik/Kconfig | |||
@@ -6,6 +6,7 @@ config MACH_NOMADIK_8815NHK | |||
6 | bool "ST 8815 Nomadik Hardware Kit (evaluation board)" | 6 | bool "ST 8815 Nomadik Hardware Kit (evaluation board)" |
7 | select NOMADIK_8815 | 7 | select NOMADIK_8815 |
8 | select HAS_MTU | 8 | select HAS_MTU |
9 | select NOMADIK_GPIO | ||
9 | 10 | ||
10 | endmenu | 11 | endmenu |
11 | 12 | ||
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile index 36f67fb207d2..a6bbd1a7b4e7 100644 --- a/arch/arm/mach-nomadik/Makefile +++ b/arch/arm/mach-nomadik/Makefile | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | # Object file lists. | 8 | # Object file lists. |
9 | 9 | ||
10 | obj-y += clock.o gpio.o | 10 | obj-y += clock.o |
11 | 11 | ||
12 | # Cpu revision | 12 | # Cpu revision |
13 | obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o | 13 | obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o |
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index ab3712c86d2b..841d459ad59d 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <mach/setup.h> | 32 | #include <mach/setup.h> |
33 | #include <mach/nand.h> | 33 | #include <mach/nand.h> |
34 | #include <mach/fsmc.h> | 34 | #include <mach/fsmc.h> |
35 | #include "clock.h" | ||
36 | 35 | ||
37 | /* Initial value for SRC control register: all timers use MXTAL/8 source */ | 36 | /* Initial value for SRC control register: all timers use MXTAL/8 source */ |
38 | #define SRC_CR_INIT_MASK 0x00007fff | 37 | #define SRC_CR_INIT_MASK 0x00007fff |
@@ -202,11 +201,6 @@ static struct amba_device *amba_devs[] __initdata = { | |||
202 | &uart1_device, | 201 | &uart1_device, |
203 | }; | 202 | }; |
204 | 203 | ||
205 | /* We have a fixed clock alone, by now */ | ||
206 | static struct clk nhk8815_clk_48 = { | ||
207 | .rate = 48*1000*1000, | ||
208 | }; | ||
209 | |||
210 | static struct resource nhk8815_eth_resources[] = { | 204 | static struct resource nhk8815_eth_resources[] = { |
211 | { | 205 | { |
212 | .name = "smc91x-regs", | 206 | .name = "smc91x-regs", |
@@ -276,10 +270,8 @@ static void __init nhk8815_platform_init(void) | |||
276 | platform_add_devices(nhk8815_platform_devices, | 270 | platform_add_devices(nhk8815_platform_devices, |
277 | ARRAY_SIZE(nhk8815_platform_devices)); | 271 | ARRAY_SIZE(nhk8815_platform_devices)); |
278 | 272 | ||
279 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 273 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
280 | nmdk_clk_create(&nhk8815_clk_48, amba_devs[i]->dev.init_name); | ||
281 | amba_device_register(amba_devs[i], &iomem_resource); | 274 | amba_device_register(amba_devs[i], &iomem_resource); |
282 | } | ||
283 | } | 275 | } |
284 | 276 | ||
285 | MACHINE_START(NOMADIK, "NHK8815") | 277 | MACHINE_START(NOMADIK, "NHK8815") |
diff --git a/arch/arm/mach-nomadik/clock.c b/arch/arm/mach-nomadik/clock.c index 9f92502a0083..60f5bee09f2e 100644 --- a/arch/arm/mach-nomadik/clock.c +++ b/arch/arm/mach-nomadik/clock.c | |||
@@ -32,14 +32,36 @@ void clk_disable(struct clk *clk) | |||
32 | } | 32 | } |
33 | EXPORT_SYMBOL(clk_disable); | 33 | EXPORT_SYMBOL(clk_disable); |
34 | 34 | ||
35 | /* Create a clock structure with the given name */ | 35 | /* We have a fixed clock alone, for now */ |
36 | int nmdk_clk_create(struct clk *clk, const char *dev_id) | 36 | static struct clk clk_48 = { |
37 | { | 37 | .rate = 48 * 1000 * 1000, |
38 | struct clk_lookup *clkdev; | 38 | }; |
39 | |||
40 | /* | ||
41 | * Catch-all default clock to satisfy drivers using the clk API. We don't | ||
42 | * model the actual hardware clocks yet. | ||
43 | */ | ||
44 | static struct clk clk_default; | ||
39 | 45 | ||
40 | clkdev = clkdev_alloc(clk, NULL, dev_id); | 46 | #define CLK(_clk, dev) \ |
41 | if (!clkdev) | 47 | { \ |
42 | return -ENOMEM; | 48 | .clk = _clk, \ |
43 | clkdev_add(clkdev); | 49 | .dev_id = dev, \ |
50 | } | ||
51 | |||
52 | static struct clk_lookup lookups[] = { | ||
53 | CLK(&clk_48, "uart0"), | ||
54 | CLK(&clk_48, "uart1"), | ||
55 | CLK(&clk_default, "gpio.0"), | ||
56 | CLK(&clk_default, "gpio.1"), | ||
57 | CLK(&clk_default, "gpio.2"), | ||
58 | CLK(&clk_default, "gpio.3"), | ||
59 | }; | ||
60 | |||
61 | static int __init clk_init(void) | ||
62 | { | ||
63 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
44 | return 0; | 64 | return 0; |
45 | } | 65 | } |
66 | |||
67 | arch_initcall(clk_init); | ||
diff --git a/arch/arm/mach-nomadik/clock.h b/arch/arm/mach-nomadik/clock.h index 235faec7f627..5563985a2cc7 100644 --- a/arch/arm/mach-nomadik/clock.h +++ b/arch/arm/mach-nomadik/clock.h | |||
@@ -11,4 +11,3 @@ | |||
11 | struct clk { | 11 | struct clk { |
12 | unsigned long rate; | 12 | unsigned long rate; |
13 | }; | 13 | }; |
14 | extern int nmdk_clk_create(struct clk *clk, const char *dev_id); | ||
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c index 9bf33b30a025..91c3c901b469 100644 --- a/arch/arm/mach-nomadik/cpu-8815.c +++ b/arch/arm/mach-nomadik/cpu-8815.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
22 | #include <linux/amba/bus.h> | 22 | #include <linux/amba/bus.h> |
23 | #include <linux/platform_device.h> | ||
23 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
24 | 25 | ||
25 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
@@ -30,60 +31,66 @@ | |||
30 | #include <asm/cacheflush.h> | 31 | #include <asm/cacheflush.h> |
31 | #include <asm/hardware/cache-l2x0.h> | 32 | #include <asm/hardware/cache-l2x0.h> |
32 | 33 | ||
34 | #define __MEM_4K_RESOURCE(x) \ | ||
35 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | ||
36 | |||
33 | /* The 8815 has 4 GPIO blocks, let's register them immediately */ | 37 | /* The 8815 has 4 GPIO blocks, let's register them immediately */ |
38 | |||
39 | #define GPIO_RESOURCE(block) \ | ||
40 | { \ | ||
41 | .start = NOMADIK_GPIO##block##_BASE, \ | ||
42 | .end = NOMADIK_GPIO##block##_BASE + SZ_4K - 1, \ | ||
43 | .flags = IORESOURCE_MEM, \ | ||
44 | }, \ | ||
45 | { \ | ||
46 | .start = IRQ_GPIO##block, \ | ||
47 | .end = IRQ_GPIO##block, \ | ||
48 | .flags = IORESOURCE_IRQ, \ | ||
49 | } | ||
50 | |||
51 | #define GPIO_DEVICE(block) \ | ||
52 | { \ | ||
53 | .name = "gpio", \ | ||
54 | .id = block, \ | ||
55 | .num_resources = 2, \ | ||
56 | .resource = &cpu8815_gpio_resources[block * 2], \ | ||
57 | .dev = { \ | ||
58 | .platform_data = &cpu8815_gpio[block], \ | ||
59 | }, \ | ||
60 | } | ||
61 | |||
34 | static struct nmk_gpio_platform_data cpu8815_gpio[] = { | 62 | static struct nmk_gpio_platform_data cpu8815_gpio[] = { |
35 | { | 63 | { |
36 | .name = "GPIO-0-31", | 64 | .name = "GPIO-0-31", |
37 | .first_gpio = 0, | 65 | .first_gpio = 0, |
38 | .first_irq = NOMADIK_GPIO_TO_IRQ(0), | 66 | .first_irq = NOMADIK_GPIO_TO_IRQ(0), |
39 | .parent_irq = IRQ_GPIO0, | ||
40 | }, { | 67 | }, { |
41 | .name = "GPIO-32-63", | 68 | .name = "GPIO-32-63", |
42 | .first_gpio = 32, | 69 | .first_gpio = 32, |
43 | .first_irq = NOMADIK_GPIO_TO_IRQ(32), | 70 | .first_irq = NOMADIK_GPIO_TO_IRQ(32), |
44 | .parent_irq = IRQ_GPIO1, | ||
45 | }, { | 71 | }, { |
46 | .name = "GPIO-64-95", | 72 | .name = "GPIO-64-95", |
47 | .first_gpio = 64, | 73 | .first_gpio = 64, |
48 | .first_irq = NOMADIK_GPIO_TO_IRQ(64), | 74 | .first_irq = NOMADIK_GPIO_TO_IRQ(64), |
49 | .parent_irq = IRQ_GPIO2, | ||
50 | }, { | 75 | }, { |
51 | .name = "GPIO-96-127", /* 124..127 not routed to pin */ | 76 | .name = "GPIO-96-127", /* 124..127 not routed to pin */ |
52 | .first_gpio = 96, | 77 | .first_gpio = 96, |
53 | .first_irq = NOMADIK_GPIO_TO_IRQ(96), | 78 | .first_irq = NOMADIK_GPIO_TO_IRQ(96), |
54 | .parent_irq = IRQ_GPIO3, | ||
55 | } | 79 | } |
56 | }; | 80 | }; |
57 | 81 | ||
58 | #define __MEM_4K_RESOURCE(x) \ | 82 | static struct resource cpu8815_gpio_resources[] = { |
59 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | 83 | GPIO_RESOURCE(0), |
84 | GPIO_RESOURCE(1), | ||
85 | GPIO_RESOURCE(2), | ||
86 | GPIO_RESOURCE(3), | ||
87 | }; | ||
60 | 88 | ||
61 | static struct amba_device cpu8815_amba_gpio[] = { | 89 | static struct platform_device cpu8815_platform_gpio[] = { |
62 | { | 90 | GPIO_DEVICE(0), |
63 | .dev = { | 91 | GPIO_DEVICE(1), |
64 | .init_name = "gpio0", | 92 | GPIO_DEVICE(2), |
65 | .platform_data = cpu8815_gpio + 0, | 93 | GPIO_DEVICE(3), |
66 | }, | ||
67 | __MEM_4K_RESOURCE(NOMADIK_GPIO0_BASE), | ||
68 | }, { | ||
69 | .dev = { | ||
70 | .init_name = "gpio1", | ||
71 | .platform_data = cpu8815_gpio + 1, | ||
72 | }, | ||
73 | __MEM_4K_RESOURCE(NOMADIK_GPIO1_BASE), | ||
74 | }, { | ||
75 | .dev = { | ||
76 | .init_name = "gpio2", | ||
77 | .platform_data = cpu8815_gpio + 2, | ||
78 | }, | ||
79 | __MEM_4K_RESOURCE(NOMADIK_GPIO2_BASE), | ||
80 | }, { | ||
81 | .dev = { | ||
82 | .init_name = "gpio3", | ||
83 | .platform_data = cpu8815_gpio + 3, | ||
84 | }, | ||
85 | __MEM_4K_RESOURCE(NOMADIK_GPIO3_BASE), | ||
86 | }, | ||
87 | }; | 94 | }; |
88 | 95 | ||
89 | static struct amba_device cpu8815_amba_rng = { | 96 | static struct amba_device cpu8815_amba_rng = { |
@@ -93,11 +100,14 @@ static struct amba_device cpu8815_amba_rng = { | |||
93 | __MEM_4K_RESOURCE(NOMADIK_RNG_BASE), | 100 | __MEM_4K_RESOURCE(NOMADIK_RNG_BASE), |
94 | }; | 101 | }; |
95 | 102 | ||
103 | static struct platform_device *platform_devs[] __initdata = { | ||
104 | cpu8815_platform_gpio + 0, | ||
105 | cpu8815_platform_gpio + 1, | ||
106 | cpu8815_platform_gpio + 2, | ||
107 | cpu8815_platform_gpio + 3, | ||
108 | }; | ||
109 | |||
96 | static struct amba_device *amba_devs[] __initdata = { | 110 | static struct amba_device *amba_devs[] __initdata = { |
97 | cpu8815_amba_gpio + 0, | ||
98 | cpu8815_amba_gpio + 1, | ||
99 | cpu8815_amba_gpio + 2, | ||
100 | cpu8815_amba_gpio + 3, | ||
101 | &cpu8815_amba_rng | 111 | &cpu8815_amba_rng |
102 | }; | 112 | }; |
103 | 113 | ||
@@ -105,6 +115,7 @@ static int __init cpu8815_init(void) | |||
105 | { | 115 | { |
106 | int i; | 116 | int i; |
107 | 117 | ||
118 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | ||
108 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | 119 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
109 | amba_device_register(amba_devs[i], &iomem_resource); | 120 | amba_device_register(amba_devs[i], &iomem_resource); |
110 | return 0; | 121 | return 0; |
diff --git a/arch/arm/mach-nomadik/include/mach/gpio.h b/arch/arm/mach-nomadik/include/mach/gpio.h index 61577c9f9a7d..7a81a0420343 100644 --- a/arch/arm/mach-nomadik/include/mach/gpio.h +++ b/arch/arm/mach-nomadik/include/mach/gpio.h | |||
@@ -1,71 +1,6 @@ | |||
1 | /* | ||
2 | * Structures and registers for GPIO access in the Nomadik SoC | ||
3 | * | ||
4 | * Copyright (C) 2008 STMicroelectronics | ||
5 | * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> | ||
6 | * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> | ||
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 | #ifndef __ASM_ARCH_GPIO_H | 1 | #ifndef __ASM_ARCH_GPIO_H |
13 | #define __ASM_ARCH_GPIO_H | 2 | #define __ASM_ARCH_GPIO_H |
14 | 3 | ||
15 | #include <asm-generic/gpio.h> | 4 | #include <plat/gpio.h> |
16 | |||
17 | /* | ||
18 | * These currently cause a function call to happen, they may be optimized | ||
19 | * if needed by adding cpu-specific defines to identify blocks | ||
20 | * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc) | ||
21 | */ | ||
22 | #define gpio_get_value __gpio_get_value | ||
23 | #define gpio_set_value __gpio_set_value | ||
24 | #define gpio_cansleep __gpio_cansleep | ||
25 | #define gpio_to_irq __gpio_to_irq | ||
26 | |||
27 | /* | ||
28 | * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving | ||
29 | * the "gpio" namespace for generic and cross-machine functions | ||
30 | */ | ||
31 | |||
32 | /* Register in the logic block */ | ||
33 | #define NMK_GPIO_DAT 0x00 | ||
34 | #define NMK_GPIO_DATS 0x04 | ||
35 | #define NMK_GPIO_DATC 0x08 | ||
36 | #define NMK_GPIO_PDIS 0x0c | ||
37 | #define NMK_GPIO_DIR 0x10 | ||
38 | #define NMK_GPIO_DIRS 0x14 | ||
39 | #define NMK_GPIO_DIRC 0x18 | ||
40 | #define NMK_GPIO_SLPC 0x1c | ||
41 | #define NMK_GPIO_AFSLA 0x20 | ||
42 | #define NMK_GPIO_AFSLB 0x24 | ||
43 | |||
44 | #define NMK_GPIO_RIMSC 0x40 | ||
45 | #define NMK_GPIO_FIMSC 0x44 | ||
46 | #define NMK_GPIO_IS 0x48 | ||
47 | #define NMK_GPIO_IC 0x4c | ||
48 | #define NMK_GPIO_RWIMSC 0x50 | ||
49 | #define NMK_GPIO_FWIMSC 0x54 | ||
50 | #define NMK_GPIO_WKS 0x58 | ||
51 | |||
52 | /* Alternate functions: function C is set in hw by setting both A and B */ | ||
53 | #define NMK_GPIO_ALT_GPIO 0 | ||
54 | #define NMK_GPIO_ALT_A 1 | ||
55 | #define NMK_GPIO_ALT_B 2 | ||
56 | #define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) | ||
57 | |||
58 | extern int nmk_gpio_set_mode(int gpio, int gpio_mode); | ||
59 | extern int nmk_gpio_get_mode(int gpio); | ||
60 | |||
61 | /* | ||
62 | * Platform data to register a block: only the initial gpio/irq number. | ||
63 | */ | ||
64 | struct nmk_gpio_platform_data { | ||
65 | char *name; | ||
66 | int first_gpio; | ||
67 | int first_irq; | ||
68 | int parent_irq; | ||
69 | }; | ||
70 | 5 | ||
71 | #endif /* __ASM_ARCH_GPIO_H */ | 6 | #endif /* __ASM_ARCH_GPIO_H */ |
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c index e36639f66150..8e313b4b99a9 100644 --- a/arch/arm/mach-omap1/board-htcherald.c +++ b/arch/arm/mach-omap1/board-htcherald.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | #include <linux/input.h> | 30 | #include <linux/input.h> |
31 | #include <linux/bootmem.h> | ||
32 | #include <linux/io.h> | 31 | #include <linux/io.h> |
33 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
34 | 33 | ||
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2271b9bd1f50..12154d10e536 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -17,8 +17,10 @@ | |||
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | 18 | ||
19 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
20 | #include <mach/irqs.h> | ||
20 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
21 | #include <asm/mach/map.h> | 22 | #include <asm/mach/map.h> |
23 | #include <asm/pmu.h> | ||
22 | 24 | ||
23 | #include <plat/control.h> | 25 | #include <plat/control.h> |
24 | #include <plat/tc.h> | 26 | #include <plat/tc.h> |
@@ -453,6 +455,37 @@ static void omap_init_mcspi(void) | |||
453 | static inline void omap_init_mcspi(void) {} | 455 | static inline void omap_init_mcspi(void) {} |
454 | #endif | 456 | #endif |
455 | 457 | ||
458 | static struct resource omap2_pmu_resource = { | ||
459 | .start = 3, | ||
460 | .end = 3, | ||
461 | .flags = IORESOURCE_IRQ, | ||
462 | }; | ||
463 | |||
464 | static struct resource omap3_pmu_resource = { | ||
465 | .start = INT_34XX_BENCH_MPU_EMUL, | ||
466 | .end = INT_34XX_BENCH_MPU_EMUL, | ||
467 | .flags = IORESOURCE_IRQ, | ||
468 | }; | ||
469 | |||
470 | static struct platform_device omap_pmu_device = { | ||
471 | .name = "arm-pmu", | ||
472 | .id = ARM_PMU_DEVICE_CPU, | ||
473 | .num_resources = 1, | ||
474 | }; | ||
475 | |||
476 | static void omap_init_pmu(void) | ||
477 | { | ||
478 | if (cpu_is_omap24xx()) | ||
479 | omap_pmu_device.resource = &omap2_pmu_resource; | ||
480 | else if (cpu_is_omap34xx()) | ||
481 | omap_pmu_device.resource = &omap3_pmu_resource; | ||
482 | else | ||
483 | return; | ||
484 | |||
485 | platform_device_register(&omap_pmu_device); | ||
486 | } | ||
487 | |||
488 | |||
456 | #ifdef CONFIG_OMAP_SHA1_MD5 | 489 | #ifdef CONFIG_OMAP_SHA1_MD5 |
457 | static struct resource sha1_md5_resources[] = { | 490 | static struct resource sha1_md5_resources[] = { |
458 | { | 491 | { |
@@ -797,6 +830,7 @@ static int __init omap2_init_devices(void) | |||
797 | omap_init_camera(); | 830 | omap_init_camera(); |
798 | omap_init_mbox(); | 831 | omap_init_mbox(); |
799 | omap_init_mcspi(); | 832 | omap_init_mcspi(); |
833 | omap_init_pmu(); | ||
800 | omap_hdq_init(); | 834 | omap_hdq_init(); |
801 | omap_init_sti(); | 835 | omap_init_sti(); |
802 | omap_init_sha1_md5(); | 836 | omap_init_sha1_md5(); |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e436dcb19795..2c12e8cd7183 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <linux/err.h> | 43 | #include <linux/err.h> |
44 | #include <linux/list.h> | 44 | #include <linux/list.h> |
45 | #include <linux/mutex.h> | 45 | #include <linux/mutex.h> |
46 | #include <linux/bootmem.h> | ||
47 | 46 | ||
48 | #include <plat/common.h> | 47 | #include <plat/common.h> |
49 | #include <plat/cpu.h> | 48 | #include <plat/cpu.h> |
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index 421b82f7c63d..685f34a9634b 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c | |||
@@ -439,6 +439,7 @@ static void __init dns323_init(void) | |||
439 | */ | 439 | */ |
440 | if (dns323_dev_id() == MV88F5181_DEV_ID) { | 440 | if (dns323_dev_id() == MV88F5181_DEV_ID) { |
441 | dns323_leds[0].active_low = 1; | 441 | dns323_leds[0].active_low = 1; |
442 | gpio_request(DNS323_GPIO_LED_POWER1, "Power Led Enable"); | ||
442 | gpio_direction_output(DNS323_GPIO_LED_POWER1, 0); | 443 | gpio_direction_output(DNS323_GPIO_LED_POWER1, 0); |
443 | } | 444 | } |
444 | 445 | ||
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 5b6ee46fa7f6..3b51741a4810 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -19,7 +19,6 @@ config MACH_MAINSTONE | |||
19 | config MACH_ZYLONITE | 19 | config MACH_ZYLONITE |
20 | bool | 20 | bool |
21 | select PXA3xx | 21 | select PXA3xx |
22 | select PXA_SSP | ||
23 | select HAVE_PWM | 22 | select HAVE_PWM |
24 | select PXA_HAVE_BOARD_IRQS | 23 | select PXA_HAVE_BOARD_IRQS |
25 | 24 | ||
@@ -39,7 +38,6 @@ config MACH_LITTLETON | |||
39 | select PXA3xx | 38 | select PXA3xx |
40 | select CPU_PXA300 | 39 | select CPU_PXA300 |
41 | select CPU_PXA310 | 40 | select CPU_PXA310 |
42 | select PXA_SSP | ||
43 | 41 | ||
44 | config MACH_TAVOREVB | 42 | config MACH_TAVOREVB |
45 | bool "PXA930 Evaluation Board (aka TavorEVB)" | 43 | bool "PXA930 Evaluation Board (aka TavorEVB)" |
@@ -98,7 +96,6 @@ config MACH_ARMCORE | |||
98 | select PXA27x | 96 | select PXA27x |
99 | select IWMMXT | 97 | select IWMMXT |
100 | select PXA25x | 98 | select PXA25x |
101 | select PXA_SSP | ||
102 | 99 | ||
103 | config MACH_EM_X270 | 100 | config MACH_EM_X270 |
104 | bool "CompuLab EM-x270 platform" | 101 | bool "CompuLab EM-x270 platform" |
@@ -161,7 +158,6 @@ config MACH_XCEP | |||
161 | select MTD_CFI | 158 | select MTD_CFI |
162 | select MTD_CHAR | 159 | select MTD_CHAR |
163 | select SMC91X | 160 | select SMC91X |
164 | select PXA_SSP | ||
165 | help | 161 | help |
166 | PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash. | 162 | PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash. |
167 | Tuned for usage in Libera instruments for particle accelerators. | 163 | Tuned for usage in Libera instruments for particle accelerators. |
@@ -180,7 +176,6 @@ config MACH_TRIZEPS4WL | |||
180 | depends on TRIZEPS_PXA | 176 | depends on TRIZEPS_PXA |
181 | select TRIZEPS_PCMCIA | 177 | select TRIZEPS_PCMCIA |
182 | select PXA27x | 178 | select PXA27x |
183 | select PXA_SSP | ||
184 | 179 | ||
185 | choice | 180 | choice |
186 | prompt "Select base board for Trizeps module" | 181 | prompt "Select base board for Trizeps module" |
@@ -217,7 +212,6 @@ config MACH_PCM027 | |||
217 | bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" | 212 | bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" |
218 | select PXA27x | 213 | select PXA27x |
219 | select IWMMXT | 214 | select IWMMXT |
220 | select PXA_SSP | ||
221 | select PXA_HAVE_BOARD_IRQS | 215 | select PXA_HAVE_BOARD_IRQS |
222 | 216 | ||
223 | config MACH_PCM990_BASEBOARD | 217 | config MACH_PCM990_BASEBOARD |
@@ -255,13 +249,19 @@ config MACH_COLIBRI320 | |||
255 | select PXA3xx | 249 | select PXA3xx |
256 | select CPU_PXA320 | 250 | select CPU_PXA320 |
257 | 251 | ||
252 | config MACH_VPAC270 | ||
253 | bool "Voipac PXA270" | ||
254 | select PXA27x | ||
255 | select HAVE_PATA_PLATFORM | ||
256 | help | ||
257 | PXA270 based Single Board Computer. | ||
258 | |||
258 | comment "End-user Products (sorted by vendor name)" | 259 | comment "End-user Products (sorted by vendor name)" |
259 | 260 | ||
260 | config MACH_H4700 | 261 | config MACH_H4700 |
261 | bool "HP iPAQ hx4700" | 262 | bool "HP iPAQ hx4700" |
262 | select PXA27x | 263 | select PXA27x |
263 | select IWMMXT | 264 | select IWMMXT |
264 | select PXA_SSP | ||
265 | select HAVE_PWM | 265 | select HAVE_PWM |
266 | select PXA_HAVE_BOARD_IRQS | 266 | select PXA_HAVE_BOARD_IRQS |
267 | 267 | ||
@@ -277,7 +277,6 @@ config MACH_MAGICIAN | |||
277 | bool "Enable HTC Magician Support" | 277 | bool "Enable HTC Magician Support" |
278 | select PXA27x | 278 | select PXA27x |
279 | select IWMMXT | 279 | select IWMMXT |
280 | select PXA_SSP | ||
281 | select HAVE_PWM | 280 | select HAVE_PWM |
282 | select PXA_HAVE_BOARD_IRQS | 281 | select PXA_HAVE_BOARD_IRQS |
283 | 282 | ||
@@ -431,13 +430,11 @@ config MACH_RAUMFELD_CONNECTOR | |||
431 | bool "Raumfeld Connector" | 430 | bool "Raumfeld Connector" |
432 | select PXA3xx | 431 | select PXA3xx |
433 | select CPU_PXA300 | 432 | select CPU_PXA300 |
434 | select PXA_SSP | ||
435 | 433 | ||
436 | config MACH_RAUMFELD_SPEAKER | 434 | config MACH_RAUMFELD_SPEAKER |
437 | bool "Raumfeld Speaker" | 435 | bool "Raumfeld Speaker" |
438 | select PXA3xx | 436 | select PXA3xx |
439 | select CPU_PXA300 | 437 | select CPU_PXA300 |
440 | select PXA_SSP | ||
441 | 438 | ||
442 | config PXA_SHARPSL | 439 | config PXA_SHARPSL |
443 | bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models" | 440 | bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models" |
@@ -461,21 +458,11 @@ config SHARPSL_PM_MAX1111 | |||
461 | select HWMON | 458 | select HWMON |
462 | select SENSORS_MAX1111 | 459 | select SENSORS_MAX1111 |
463 | 460 | ||
464 | config CORGI_SSP_DEPRECATED | ||
465 | bool | ||
466 | select PXA_SSP | ||
467 | select PXA_SSP_LEGACY | ||
468 | help | ||
469 | This option will include corgi_ssp.c and corgi_lcd.c | ||
470 | that corgi_ts.c and other legacy drivers (corgi_bl.c | ||
471 | and sharpsl_pm.c) may depend on. | ||
472 | |||
473 | config MACH_POODLE | 461 | config MACH_POODLE |
474 | bool "Enable Sharp SL-5600 (Poodle) Support" | 462 | bool "Enable Sharp SL-5600 (Poodle) Support" |
475 | depends on PXA_SHARPSL | 463 | depends on PXA_SHARPSL |
476 | select PXA25x | 464 | select PXA25x |
477 | select SHARP_LOCOMO | 465 | select SHARP_LOCOMO |
478 | select PXA_SSP | ||
479 | select PXA_HAVE_BOARD_IRQS | 466 | select PXA_HAVE_BOARD_IRQS |
480 | 467 | ||
481 | config MACH_CORGI | 468 | config MACH_CORGI |
@@ -581,6 +568,12 @@ config MACH_E800 | |||
581 | Say Y here if you intend to run this kernel on a Toshiba | 568 | Say Y here if you intend to run this kernel on a Toshiba |
582 | e800 family PDA. | 569 | e800 family PDA. |
583 | 570 | ||
571 | config MACH_ZIPIT2 | ||
572 | bool "Zipit Z2 Handheld" | ||
573 | select PXA27x | ||
574 | select HAVE_PWM | ||
575 | select PXA_HAVE_BOARD_IRQS | ||
576 | |||
584 | endmenu | 577 | endmenu |
585 | 578 | ||
586 | config PXA25x | 579 | config PXA25x |
@@ -645,28 +638,16 @@ config CPU_PXA950 | |||
645 | 638 | ||
646 | config PXA_SHARP_C7xx | 639 | config PXA_SHARP_C7xx |
647 | bool | 640 | bool |
648 | select PXA_SSP | ||
649 | select SHARPSL_PM | 641 | select SHARPSL_PM |
650 | help | 642 | help |
651 | Enable support for all Sharp C7xx models | 643 | Enable support for all Sharp C7xx models |
652 | 644 | ||
653 | config PXA_SHARP_Cxx00 | 645 | config PXA_SHARP_Cxx00 |
654 | bool | 646 | bool |
655 | select PXA_SSP | ||
656 | select SHARPSL_PM | 647 | select SHARPSL_PM |
657 | help | 648 | help |
658 | Enable common support for Sharp Cxx00 models | 649 | Enable common support for Sharp Cxx00 models |
659 | 650 | ||
660 | config PXA_SSP | ||
661 | tristate | ||
662 | help | ||
663 | Enable support for PXA2xx SSP ports | ||
664 | |||
665 | config PXA_SSP_LEGACY | ||
666 | bool | ||
667 | help | ||
668 | Support of legacy SSP API | ||
669 | |||
670 | config TOSA_BT | 651 | config TOSA_BT |
671 | tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" | 652 | tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" |
672 | depends on MACH_TOSA | 653 | depends on MACH_TOSA |
@@ -675,6 +656,18 @@ config TOSA_BT | |||
675 | This is a simple driver that is able to control | 656 | This is a simple driver that is able to control |
676 | the state of built in bluetooth chip on tosa. | 657 | the state of built in bluetooth chip on tosa. |
677 | 658 | ||
659 | config TOSA_USE_EXT_KEYCODES | ||
660 | bool "Tosa keyboard: use extended keycodes" | ||
661 | depends on MACH_TOSA | ||
662 | default n | ||
663 | help | ||
664 | Say Y here to enable the tosa keyboard driver to generate extended | ||
665 | (>= 127) keycodes. Be aware, that they can't be correctly interpreted | ||
666 | by either console keyboard driver or by Kdrive keybd driver. | ||
667 | |||
668 | Say Y only if you know, what you are doing! | ||
669 | |||
670 | |||
678 | config PXA_HAVE_BOARD_IRQS | 671 | config PXA_HAVE_BOARD_IRQS |
679 | bool | 672 | bool |
680 | 673 | ||
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 86bc87b7f2dd..b8f1f4bc7ca7 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -14,7 +14,6 @@ obj-$(CONFIG_PXA3xx) += cpufreq-pxa3xx.o | |||
14 | endif | 14 | endif |
15 | 15 | ||
16 | # Generic drivers that other drivers may depend upon | 16 | # Generic drivers that other drivers may depend upon |
17 | obj-$(CONFIG_PXA_SSP) += ssp.o | ||
18 | 17 | ||
19 | # SoC-specific code | 18 | # SoC-specific code |
20 | obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o | 19 | obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o |
@@ -62,6 +61,7 @@ obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o | |||
62 | obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o | 61 | obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o |
63 | obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o | 62 | obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o |
64 | obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o | 63 | obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o |
64 | obj-$(CONFIG_MACH_VPAC270) += vpac270.o | ||
65 | 65 | ||
66 | # End-user Products | 66 | # End-user Products |
67 | obj-$(CONFIG_MACH_H4700) += hx4700.o | 67 | obj-$(CONFIG_MACH_H4700) += hx4700.o |
@@ -80,7 +80,6 @@ obj-$(CONFIG_MACH_PALMLD) += palmld.o | |||
80 | obj-$(CONFIG_PALM_TREO) += palmtreo.o | 80 | obj-$(CONFIG_PALM_TREO) += palmtreo.o |
81 | obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o | 81 | obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o |
82 | obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o | 82 | obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o |
83 | obj-$(CONFIG_CORGI_SSP_DEPRECATED) += corgi_ssp.o corgi_lcd.o | ||
84 | obj-$(CONFIG_MACH_POODLE) += poodle.o | 83 | obj-$(CONFIG_MACH_POODLE) += poodle.o |
85 | obj-$(CONFIG_MACH_TOSA) += tosa.o | 84 | obj-$(CONFIG_MACH_TOSA) += tosa.o |
86 | obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o | 85 | obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o |
@@ -94,6 +93,7 @@ obj-$(CONFIG_MACH_E800) += e800.o | |||
94 | obj-$(CONFIG_MACH_RAUMFELD_RC) += raumfeld.o | 93 | obj-$(CONFIG_MACH_RAUMFELD_RC) += raumfeld.o |
95 | obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR) += raumfeld.o | 94 | obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR) += raumfeld.o |
96 | obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o | 95 | obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o |
96 | obj-$(CONFIG_MACH_ZIPIT2) += z2.o | ||
97 | 97 | ||
98 | # Support for blinky lights | 98 | # Support for blinky lights |
99 | led-y := leds.o | 99 | led-y := leds.o |
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index d37cfa132a65..fdda6be6c391 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -30,6 +30,9 @@ | |||
30 | #include <linux/i2c/pca953x.h> | 30 | #include <linux/i2c/pca953x.h> |
31 | 31 | ||
32 | #include <linux/mfd/da903x.h> | 32 | #include <linux/mfd/da903x.h> |
33 | #include <linux/regulator/machine.h> | ||
34 | #include <linux/power_supply.h> | ||
35 | #include <linux/apm-emulation.h> | ||
33 | 36 | ||
34 | #include <linux/spi/spi.h> | 37 | #include <linux/spi/spi.h> |
35 | #include <linux/spi/spi_gpio.h> | 38 | #include <linux/spi/spi_gpio.h> |
@@ -430,7 +433,7 @@ static inline void cm_x300_init_nand(void) {} | |||
430 | 433 | ||
431 | #if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE) | 434 | #if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE) |
432 | static struct pxamci_platform_data cm_x300_mci_platform_data = { | 435 | static struct pxamci_platform_data cm_x300_mci_platform_data = { |
433 | .detect_delay = 20, | 436 | .detect_delay_ms = 200, |
434 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 437 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
435 | .gpio_card_detect = GPIO82_MMC_IRQ, | 438 | .gpio_card_detect = GPIO82_MMC_IRQ, |
436 | .gpio_card_ro = GPIO85_MMC_WP, | 439 | .gpio_card_ro = GPIO85_MMC_WP, |
@@ -451,7 +454,7 @@ static void cm_x300_mci2_exit(struct device *dev, void *data) | |||
451 | } | 454 | } |
452 | 455 | ||
453 | static struct pxamci_platform_data cm_x300_mci2_platform_data = { | 456 | static struct pxamci_platform_data cm_x300_mci2_platform_data = { |
454 | .detect_delay = 20, | 457 | .detect_delay_ms = 200, |
455 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 458 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
456 | .init = cm_x300_mci2_init, | 459 | .init = cm_x300_mci2_init, |
457 | .exit = cm_x300_mci2_exit, | 460 | .exit = cm_x300_mci2_exit, |
@@ -584,12 +587,87 @@ static void __init cm_x300_init_rtc(void) | |||
584 | static inline void cm_x300_init_rtc(void) {} | 587 | static inline void cm_x300_init_rtc(void) {} |
585 | #endif | 588 | #endif |
586 | 589 | ||
590 | /* Battery */ | ||
591 | struct power_supply_info cm_x300_psy_info = { | ||
592 | .name = "battery", | ||
593 | .technology = POWER_SUPPLY_TECHNOLOGY_LIPO, | ||
594 | .voltage_max_design = 4200000, | ||
595 | .voltage_min_design = 3000000, | ||
596 | .use_for_apm = 1, | ||
597 | }; | ||
598 | |||
599 | static void cm_x300_battery_low(void) | ||
600 | { | ||
601 | #if defined(CONFIG_APM_EMULATION) | ||
602 | apm_queue_event(APM_LOW_BATTERY); | ||
603 | #endif | ||
604 | } | ||
605 | |||
606 | static void cm_x300_battery_critical(void) | ||
607 | { | ||
608 | #if defined(CONFIG_APM_EMULATION) | ||
609 | apm_queue_event(APM_CRITICAL_SUSPEND); | ||
610 | #endif | ||
611 | } | ||
612 | |||
613 | struct da9030_battery_info cm_x300_battery_info = { | ||
614 | .battery_info = &cm_x300_psy_info, | ||
615 | |||
616 | .charge_milliamp = 1000, | ||
617 | .charge_millivolt = 4200, | ||
618 | |||
619 | .vbat_low = 3600, | ||
620 | .vbat_crit = 3400, | ||
621 | .vbat_charge_start = 4100, | ||
622 | .vbat_charge_stop = 4200, | ||
623 | .vbat_charge_restart = 4000, | ||
624 | |||
625 | .vcharge_min = 3200, | ||
626 | .vcharge_max = 5500, | ||
627 | |||
628 | .tbat_low = 197, | ||
629 | .tbat_high = 78, | ||
630 | .tbat_restart = 100, | ||
631 | |||
632 | .batmon_interval = 0, | ||
633 | |||
634 | .battery_low = cm_x300_battery_low, | ||
635 | .battery_critical = cm_x300_battery_critical, | ||
636 | }; | ||
637 | |||
638 | static struct regulator_consumer_supply buck2_consumers[] = { | ||
639 | { | ||
640 | .dev = NULL, | ||
641 | .supply = "vcc_core", | ||
642 | }, | ||
643 | }; | ||
644 | |||
645 | static struct regulator_init_data buck2_data = { | ||
646 | .constraints = { | ||
647 | .min_uV = 1375000, | ||
648 | .max_uV = 1375000, | ||
649 | .state_mem = { | ||
650 | .enabled = 0, | ||
651 | }, | ||
652 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
653 | .apply_uV = 1, | ||
654 | }, | ||
655 | .num_consumer_supplies = ARRAY_SIZE(buck2_consumers), | ||
656 | .consumer_supplies = buck2_consumers, | ||
657 | }; | ||
658 | |||
587 | /* DA9030 */ | 659 | /* DA9030 */ |
588 | struct da903x_subdev_info cm_x300_da9030_subdevs[] = { | 660 | struct da903x_subdev_info cm_x300_da9030_subdevs[] = { |
589 | { | 661 | { |
590 | .name = "da903x-backlight", | 662 | .name = "da903x-battery", |
591 | .id = DA9030_ID_WLED, | 663 | .id = DA9030_ID_BAT, |
592 | } | 664 | .platform_data = &cm_x300_battery_info, |
665 | }, | ||
666 | { | ||
667 | .name = "da903x-regulator", | ||
668 | .id = DA9030_ID_BUCK2, | ||
669 | .platform_data = &buck2_data, | ||
670 | }, | ||
593 | }; | 671 | }; |
594 | 672 | ||
595 | static struct da903x_platform_data cm_x300_da9030_info = { | 673 | static struct da903x_platform_data cm_x300_da9030_info = { |
@@ -599,7 +677,7 @@ static struct da903x_platform_data cm_x300_da9030_info = { | |||
599 | 677 | ||
600 | static struct i2c_board_info cm_x300_pmic_info = { | 678 | static struct i2c_board_info cm_x300_pmic_info = { |
601 | I2C_BOARD_INFO("da9030", 0x49), | 679 | I2C_BOARD_INFO("da9030", 0x49), |
602 | .irq = IRQ_GPIO(0), | 680 | .irq = IRQ_WAKEUP0, |
603 | .platform_data = &cm_x300_da9030_info, | 681 | .platform_data = &cm_x300_da9030_info, |
604 | }; | 682 | }; |
605 | 683 | ||
@@ -689,13 +767,13 @@ static void __init cm_x300_init(void) | |||
689 | static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, | 767 | static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, |
690 | char **cmdline, struct meminfo *mi) | 768 | char **cmdline, struct meminfo *mi) |
691 | { | 769 | { |
692 | mi->nr_banks = 2; | 770 | /* Make sure that mi->bank[0].start = PHYS_ADDR */ |
693 | mi->bank[0].start = 0xa0000000; | 771 | for (; tags->hdr.size; tags = tag_next(tags)) |
694 | mi->bank[0].node = 0; | 772 | if (tags->hdr.tag == ATAG_MEM && |
695 | mi->bank[0].size = (64*1024*1024); | 773 | tags->u.mem.start == 0x80000000) { |
696 | mi->bank[1].start = 0xc0000000; | 774 | tags->u.mem.start = 0xa0000000; |
697 | mi->bank[1].node = 0; | 775 | break; |
698 | mi->bank[1].size = (64*1024*1024); | 776 | } |
699 | } | 777 | } |
700 | 778 | ||
701 | MACHINE_START(CM_X300, "CM-X300 module") | 779 | MACHINE_START(CM_X300, "CM-X300 module") |
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c index e6c0a2287eb8..199afa2ae303 100644 --- a/arch/arm/mach-pxa/colibri-pxa3xx.c +++ b/arch/arm/mach-pxa/colibri-pxa3xx.c | |||
@@ -96,7 +96,7 @@ static void colibri_pxa3xx_mci_exit(struct device *dev, void *data) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = { | 98 | static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = { |
99 | .detect_delay = 20, | 99 | .detect_delay_ms = 200, |
100 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 100 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
101 | .init = colibri_pxa3xx_mci_init, | 101 | .init = colibri_pxa3xx_mci_init, |
102 | .exit = colibri_pxa3xx_mci_exit, | 102 | .exit = colibri_pxa3xx_mci_exit, |
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index da3156d8690b..3d1dcb9ac08f 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -106,18 +106,18 @@ static unsigned long corgi_pin_config[] __initdata = { | |||
106 | GPIO8_MMC_CS0, | 106 | GPIO8_MMC_CS0, |
107 | 107 | ||
108 | /* GPIO Matrix Keypad */ | 108 | /* GPIO Matrix Keypad */ |
109 | GPIO66_GPIO, /* column 0 */ | 109 | GPIO66_GPIO | MFP_LPM_DRIVE_HIGH, /* column 0 */ |
110 | GPIO67_GPIO, /* column 1 */ | 110 | GPIO67_GPIO | MFP_LPM_DRIVE_HIGH, /* column 1 */ |
111 | GPIO68_GPIO, /* column 2 */ | 111 | GPIO68_GPIO | MFP_LPM_DRIVE_HIGH, /* column 2 */ |
112 | GPIO69_GPIO, /* column 3 */ | 112 | GPIO69_GPIO | MFP_LPM_DRIVE_HIGH, /* column 3 */ |
113 | GPIO70_GPIO, /* column 4 */ | 113 | GPIO70_GPIO | MFP_LPM_DRIVE_HIGH, /* column 4 */ |
114 | GPIO71_GPIO, /* column 5 */ | 114 | GPIO71_GPIO | MFP_LPM_DRIVE_HIGH, /* column 5 */ |
115 | GPIO72_GPIO, /* column 6 */ | 115 | GPIO72_GPIO | MFP_LPM_DRIVE_HIGH, /* column 6 */ |
116 | GPIO73_GPIO, /* column 7 */ | 116 | GPIO73_GPIO | MFP_LPM_DRIVE_HIGH, /* column 7 */ |
117 | GPIO74_GPIO, /* column 8 */ | 117 | GPIO74_GPIO | MFP_LPM_DRIVE_HIGH, /* column 8 */ |
118 | GPIO75_GPIO, /* column 9 */ | 118 | GPIO75_GPIO | MFP_LPM_DRIVE_HIGH, /* column 9 */ |
119 | GPIO76_GPIO, /* column 10 */ | 119 | GPIO76_GPIO | MFP_LPM_DRIVE_HIGH, /* column 10 */ |
120 | GPIO77_GPIO, /* column 11 */ | 120 | GPIO77_GPIO | MFP_LPM_DRIVE_HIGH, /* column 11 */ |
121 | GPIO58_GPIO, /* row 0 */ | 121 | GPIO58_GPIO, /* row 0 */ |
122 | GPIO59_GPIO, /* row 1 */ | 122 | GPIO59_GPIO, /* row 1 */ |
123 | GPIO60_GPIO, /* row 2 */ | 123 | GPIO60_GPIO, /* row 2 */ |
@@ -128,13 +128,20 @@ static unsigned long corgi_pin_config[] __initdata = { | |||
128 | GPIO65_GPIO, /* row 7 */ | 128 | GPIO65_GPIO, /* row 7 */ |
129 | 129 | ||
130 | /* GPIO */ | 130 | /* GPIO */ |
131 | GPIO9_GPIO, /* CORGI_GPIO_nSD_DETECT */ | 131 | GPIO9_GPIO, /* CORGI_GPIO_nSD_DETECT */ |
132 | GPIO7_GPIO, /* CORGI_GPIO_nSD_WP */ | 132 | GPIO7_GPIO, /* CORGI_GPIO_nSD_WP */ |
133 | GPIO33_GPIO, /* CORGI_GPIO_SD_PWR */ | 133 | GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH, /* CORGI_GPIO_MAIN_BAT_{LOW,COVER} */ |
134 | GPIO22_GPIO, /* CORGI_GPIO_IR_ON */ | 134 | GPIO13_GPIO | MFP_LPM_KEEP_OUTPUT, /* CORGI_GPIO_LED_ORANGE */ |
135 | GPIO44_GPIO, /* CORGI_GPIO_HSYNC */ | 135 | GPIO21_GPIO, /* CORGI_GPIO_ADC_TEMP */ |
136 | 136 | GPIO22_GPIO, /* CORGI_GPIO_IR_ON */ | |
137 | GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, | 137 | GPIO33_GPIO, /* CORGI_GPIO_SD_PWR */ |
138 | GPIO38_GPIO | MFP_LPM_KEEP_OUTPUT, /* CORGI_GPIO_CHRG_ON */ | ||
139 | GPIO43_GPIO | MFP_LPM_KEEP_OUTPUT, /* CORGI_GPIO_CHRG_UKN */ | ||
140 | GPIO44_GPIO, /* CORGI_GPIO_HSYNC */ | ||
141 | |||
142 | GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, /* CORGI_GPIO_KEY_INT */ | ||
143 | GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, /* CORGI_GPIO_AC_IN */ | ||
144 | GPIO3_GPIO | WAKEUP_ON_EDGE_BOTH, /* CORGI_GPIO_WAKEUP */ | ||
138 | }; | 145 | }; |
139 | 146 | ||
140 | /* | 147 | /* |
@@ -437,6 +444,7 @@ static struct platform_device corgiled_device = { | |||
437 | * to give the card a chance to fully insert/eject. | 444 | * to give the card a chance to fully insert/eject. |
438 | */ | 445 | */ |
439 | static struct pxamci_platform_data corgi_mci_platform_data = { | 446 | static struct pxamci_platform_data corgi_mci_platform_data = { |
447 | .detect_delay_ms = 250, | ||
440 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 448 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
441 | .gpio_card_detect = -1, | 449 | .gpio_card_detect = -1, |
442 | .gpio_card_ro = CORGI_GPIO_nSD_WP, | 450 | .gpio_card_ro = CORGI_GPIO_nSD_WP, |
@@ -672,6 +680,15 @@ static void __init corgi_init(void) | |||
672 | 680 | ||
673 | pxa2xx_mfp_config(ARRAY_AND_SIZE(corgi_pin_config)); | 681 | pxa2xx_mfp_config(ARRAY_AND_SIZE(corgi_pin_config)); |
674 | 682 | ||
683 | /* allow wakeup from various GPIOs */ | ||
684 | gpio_set_wake(CORGI_GPIO_KEY_INT, 1); | ||
685 | gpio_set_wake(CORGI_GPIO_WAKEUP, 1); | ||
686 | gpio_set_wake(CORGI_GPIO_AC_IN, 1); | ||
687 | gpio_set_wake(CORGI_GPIO_CHRG_FULL, 1); | ||
688 | |||
689 | if (!machine_is_corgi()) | ||
690 | gpio_set_wake(CORGI_GPIO_MAIN_BAT_LOW, 1); | ||
691 | |||
675 | pxa_set_ffuart_info(NULL); | 692 | pxa_set_ffuart_info(NULL); |
676 | pxa_set_btuart_info(NULL); | 693 | pxa_set_btuart_info(NULL); |
677 | pxa_set_stuart_info(NULL); | 694 | pxa_set_stuart_info(NULL); |
@@ -679,7 +696,6 @@ static void __init corgi_init(void) | |||
679 | corgi_init_spi(); | 696 | corgi_init_spi(); |
680 | 697 | ||
681 | pxa_set_udc_info(&udc_info); | 698 | pxa_set_udc_info(&udc_info); |
682 | corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250); | ||
683 | pxa_set_mci_info(&corgi_mci_platform_data); | 699 | pxa_set_mci_info(&corgi_mci_platform_data); |
684 | pxa_set_ficp_info(&corgi_ficp_platform_data); | 700 | pxa_set_ficp_info(&corgi_ficp_platform_data); |
685 | pxa_set_i2c_info(NULL); | 701 | pxa_set_i2c_info(NULL); |
diff --git a/arch/arm/mach-pxa/corgi_lcd.c b/arch/arm/mach-pxa/corgi_lcd.c deleted file mode 100644 index d9b96319d498..000000000000 --- a/arch/arm/mach-pxa/corgi_lcd.c +++ /dev/null | |||
@@ -1,288 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/corgi_lcd.c | ||
3 | * | ||
4 | * Corgi/Spitz LCD Specific Code | ||
5 | * | ||
6 | * Copyright (C) 2005 Richard Purdie | ||
7 | * | ||
8 | * Connectivity: | ||
9 | * Corgi - LCD to ATI Imageon w100 (Wallaby) | ||
10 | * Spitz - LCD to PXA Framebuffer | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include <linux/delay.h> | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/module.h> | ||
22 | #include <linux/string.h> | ||
23 | #include <mach/corgi.h> | ||
24 | #include <mach/hardware.h> | ||
25 | #include <mach/sharpsl.h> | ||
26 | #include <mach/spitz.h> | ||
27 | #include <asm/hardware/scoop.h> | ||
28 | #include <asm/mach/sharpsl_param.h> | ||
29 | #include "generic.h" | ||
30 | |||
31 | /* Register Addresses */ | ||
32 | #define RESCTL_ADRS 0x00 | ||
33 | #define PHACTRL_ADRS 0x01 | ||
34 | #define DUTYCTRL_ADRS 0x02 | ||
35 | #define POWERREG0_ADRS 0x03 | ||
36 | #define POWERREG1_ADRS 0x04 | ||
37 | #define GPOR3_ADRS 0x05 | ||
38 | #define PICTRL_ADRS 0x06 | ||
39 | #define POLCTRL_ADRS 0x07 | ||
40 | |||
41 | /* Register Bit Definitions */ | ||
42 | #define RESCTL_QVGA 0x01 | ||
43 | #define RESCTL_VGA 0x00 | ||
44 | |||
45 | #define POWER1_VW_ON 0x01 /* VW Supply FET ON */ | ||
46 | #define POWER1_GVSS_ON 0x02 /* GVSS(-8V) Power Supply ON */ | ||
47 | #define POWER1_VDD_ON 0x04 /* VDD(8V),SVSS(-4V) Power Supply ON */ | ||
48 | |||
49 | #define POWER1_VW_OFF 0x00 /* VW Supply FET OFF */ | ||
50 | #define POWER1_GVSS_OFF 0x00 /* GVSS(-8V) Power Supply OFF */ | ||
51 | #define POWER1_VDD_OFF 0x00 /* VDD(8V),SVSS(-4V) Power Supply OFF */ | ||
52 | |||
53 | #define POWER0_COM_DCLK 0x01 /* COM Voltage DC Bias DAC Serial Data Clock */ | ||
54 | #define POWER0_COM_DOUT 0x02 /* COM Voltage DC Bias DAC Serial Data Out */ | ||
55 | #define POWER0_DAC_ON 0x04 /* DAC Power Supply ON */ | ||
56 | #define POWER0_COM_ON 0x08 /* COM Power Supply ON */ | ||
57 | #define POWER0_VCC5_ON 0x10 /* VCC5 Power Supply ON */ | ||
58 | |||
59 | #define POWER0_DAC_OFF 0x00 /* DAC Power Supply OFF */ | ||
60 | #define POWER0_COM_OFF 0x00 /* COM Power Supply OFF */ | ||
61 | #define POWER0_VCC5_OFF 0x00 /* VCC5 Power Supply OFF */ | ||
62 | |||
63 | #define PICTRL_INIT_STATE 0x01 | ||
64 | #define PICTRL_INIOFF 0x02 | ||
65 | #define PICTRL_POWER_DOWN 0x04 | ||
66 | #define PICTRL_COM_SIGNAL_OFF 0x08 | ||
67 | #define PICTRL_DAC_SIGNAL_OFF 0x10 | ||
68 | |||
69 | #define POLCTRL_SYNC_POL_FALL 0x01 | ||
70 | #define POLCTRL_EN_POL_FALL 0x02 | ||
71 | #define POLCTRL_DATA_POL_FALL 0x04 | ||
72 | #define POLCTRL_SYNC_ACT_H 0x08 | ||
73 | #define POLCTRL_EN_ACT_L 0x10 | ||
74 | |||
75 | #define POLCTRL_SYNC_POL_RISE 0x00 | ||
76 | #define POLCTRL_EN_POL_RISE 0x00 | ||
77 | #define POLCTRL_DATA_POL_RISE 0x00 | ||
78 | #define POLCTRL_SYNC_ACT_L 0x00 | ||
79 | #define POLCTRL_EN_ACT_H 0x00 | ||
80 | |||
81 | #define PHACTRL_PHASE_MANUAL 0x01 | ||
82 | #define DEFAULT_PHAD_QVGA (9) | ||
83 | #define DEFAULT_COMADJ (125) | ||
84 | |||
85 | /* | ||
86 | * This is only a psuedo I2C interface. We can't use the standard kernel | ||
87 | * routines as the interface is write only. We just assume the data is acked... | ||
88 | */ | ||
89 | static void lcdtg_ssp_i2c_send(u8 data) | ||
90 | { | ||
91 | corgi_ssp_lcdtg_send(POWERREG0_ADRS, data); | ||
92 | udelay(10); | ||
93 | } | ||
94 | |||
95 | static void lcdtg_i2c_send_bit(u8 data) | ||
96 | { | ||
97 | lcdtg_ssp_i2c_send(data); | ||
98 | lcdtg_ssp_i2c_send(data | POWER0_COM_DCLK); | ||
99 | lcdtg_ssp_i2c_send(data); | ||
100 | } | ||
101 | |||
102 | static void lcdtg_i2c_send_start(u8 base) | ||
103 | { | ||
104 | lcdtg_ssp_i2c_send(base | POWER0_COM_DCLK | POWER0_COM_DOUT); | ||
105 | lcdtg_ssp_i2c_send(base | POWER0_COM_DCLK); | ||
106 | lcdtg_ssp_i2c_send(base); | ||
107 | } | ||
108 | |||
109 | static void lcdtg_i2c_send_stop(u8 base) | ||
110 | { | ||
111 | lcdtg_ssp_i2c_send(base); | ||
112 | lcdtg_ssp_i2c_send(base | POWER0_COM_DCLK); | ||
113 | lcdtg_ssp_i2c_send(base | POWER0_COM_DCLK | POWER0_COM_DOUT); | ||
114 | } | ||
115 | |||
116 | static void lcdtg_i2c_send_byte(u8 base, u8 data) | ||
117 | { | ||
118 | int i; | ||
119 | for (i = 0; i < 8; i++) { | ||
120 | if (data & 0x80) | ||
121 | lcdtg_i2c_send_bit(base | POWER0_COM_DOUT); | ||
122 | else | ||
123 | lcdtg_i2c_send_bit(base); | ||
124 | data <<= 1; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | static void lcdtg_i2c_wait_ack(u8 base) | ||
129 | { | ||
130 | lcdtg_i2c_send_bit(base); | ||
131 | } | ||
132 | |||
133 | static void lcdtg_set_common_voltage(u8 base_data, u8 data) | ||
134 | { | ||
135 | /* Set Common Voltage to M62332FP via I2C */ | ||
136 | lcdtg_i2c_send_start(base_data); | ||
137 | lcdtg_i2c_send_byte(base_data, 0x9c); | ||
138 | lcdtg_i2c_wait_ack(base_data); | ||
139 | lcdtg_i2c_send_byte(base_data, 0x00); | ||
140 | lcdtg_i2c_wait_ack(base_data); | ||
141 | lcdtg_i2c_send_byte(base_data, data); | ||
142 | lcdtg_i2c_wait_ack(base_data); | ||
143 | lcdtg_i2c_send_stop(base_data); | ||
144 | } | ||
145 | |||
146 | /* Set Phase Adjust */ | ||
147 | static void lcdtg_set_phadadj(int mode) | ||
148 | { | ||
149 | int adj; | ||
150 | switch(mode) { | ||
151 | case 480: | ||
152 | case 640: | ||
153 | /* Setting for VGA */ | ||
154 | adj = sharpsl_param.phadadj; | ||
155 | if (adj < 0) { | ||
156 | adj = PHACTRL_PHASE_MANUAL; | ||
157 | } else { | ||
158 | adj = ((adj & 0x0f) << 1) | PHACTRL_PHASE_MANUAL; | ||
159 | } | ||
160 | break; | ||
161 | case 240: | ||
162 | case 320: | ||
163 | default: | ||
164 | /* Setting for QVGA */ | ||
165 | adj = (DEFAULT_PHAD_QVGA << 1) | PHACTRL_PHASE_MANUAL; | ||
166 | break; | ||
167 | } | ||
168 | |||
169 | corgi_ssp_lcdtg_send(PHACTRL_ADRS, adj); | ||
170 | } | ||
171 | |||
172 | static int lcd_inited; | ||
173 | |||
174 | void corgi_lcdtg_hw_init(int mode) | ||
175 | { | ||
176 | if (!lcd_inited) { | ||
177 | int comadj; | ||
178 | |||
179 | /* Initialize Internal Logic & Port */ | ||
180 | corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_POWER_DOWN | PICTRL_INIOFF | PICTRL_INIT_STATE | ||
181 | | PICTRL_COM_SIGNAL_OFF | PICTRL_DAC_SIGNAL_OFF); | ||
182 | |||
183 | corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_COM_DCLK | POWER0_COM_DOUT | POWER0_DAC_OFF | ||
184 | | POWER0_COM_OFF | POWER0_VCC5_OFF); | ||
185 | |||
186 | corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF); | ||
187 | |||
188 | /* VDD(+8V), SVSS(-4V) ON */ | ||
189 | corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_ON); | ||
190 | mdelay(3); | ||
191 | |||
192 | /* DAC ON */ | ||
193 | corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_COM_DCLK | POWER0_COM_DOUT | POWER0_DAC_ON | ||
194 | | POWER0_COM_OFF | POWER0_VCC5_OFF); | ||
195 | |||
196 | /* INIB = H, INI = L */ | ||
197 | /* PICTL[0] = H , PICTL[1] = PICTL[2] = PICTL[4] = L */ | ||
198 | corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_INIT_STATE | PICTRL_COM_SIGNAL_OFF); | ||
199 | |||
200 | /* Set Common Voltage */ | ||
201 | comadj = sharpsl_param.comadj; | ||
202 | if (comadj < 0) | ||
203 | comadj = DEFAULT_COMADJ; | ||
204 | lcdtg_set_common_voltage((POWER0_DAC_ON | POWER0_COM_OFF | POWER0_VCC5_OFF), comadj); | ||
205 | |||
206 | /* VCC5 ON, DAC ON */ | ||
207 | corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_COM_DCLK | POWER0_COM_DOUT | POWER0_DAC_ON | | ||
208 | POWER0_COM_OFF | POWER0_VCC5_ON); | ||
209 | |||
210 | /* GVSS(-8V) ON, VDD ON */ | ||
211 | corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_ON | POWER1_VDD_ON); | ||
212 | mdelay(2); | ||
213 | |||
214 | /* COM SIGNAL ON (PICTL[3] = L) */ | ||
215 | corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_INIT_STATE); | ||
216 | |||
217 | /* COM ON, DAC ON, VCC5_ON */ | ||
218 | corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_COM_DCLK | POWER0_COM_DOUT | POWER0_DAC_ON | ||
219 | | POWER0_COM_ON | POWER0_VCC5_ON); | ||
220 | |||
221 | /* VW ON, GVSS ON, VDD ON */ | ||
222 | corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_ON | POWER1_GVSS_ON | POWER1_VDD_ON); | ||
223 | |||
224 | /* Signals output enable */ | ||
225 | corgi_ssp_lcdtg_send(PICTRL_ADRS, 0); | ||
226 | |||
227 | /* Set Phase Adjust */ | ||
228 | lcdtg_set_phadadj(mode); | ||
229 | |||
230 | /* Initialize for Input Signals from ATI */ | ||
231 | corgi_ssp_lcdtg_send(POLCTRL_ADRS, POLCTRL_SYNC_POL_RISE | POLCTRL_EN_POL_RISE | ||
232 | | POLCTRL_DATA_POL_RISE | POLCTRL_SYNC_ACT_L | POLCTRL_EN_ACT_H); | ||
233 | udelay(1000); | ||
234 | |||
235 | lcd_inited=1; | ||
236 | } else { | ||
237 | lcdtg_set_phadadj(mode); | ||
238 | } | ||
239 | |||
240 | switch(mode) { | ||
241 | case 480: | ||
242 | case 640: | ||
243 | /* Set Lcd Resolution (VGA) */ | ||
244 | corgi_ssp_lcdtg_send(RESCTL_ADRS, RESCTL_VGA); | ||
245 | break; | ||
246 | case 240: | ||
247 | case 320: | ||
248 | default: | ||
249 | /* Set Lcd Resolution (QVGA) */ | ||
250 | corgi_ssp_lcdtg_send(RESCTL_ADRS, RESCTL_QVGA); | ||
251 | break; | ||
252 | } | ||
253 | } | ||
254 | |||
255 | void corgi_lcdtg_suspend(void) | ||
256 | { | ||
257 | /* 60Hz x 2 frame = 16.7msec x 2 = 33.4 msec */ | ||
258 | mdelay(34); | ||
259 | |||
260 | /* (1)VW OFF */ | ||
261 | corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_ON | POWER1_VDD_ON); | ||
262 | |||
263 | /* (2)COM OFF */ | ||
264 | corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_COM_SIGNAL_OFF); | ||
265 | corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_DAC_ON | POWER0_COM_OFF | POWER0_VCC5_ON); | ||
266 | |||
267 | /* (3)Set Common Voltage Bias 0V */ | ||
268 | lcdtg_set_common_voltage(POWER0_DAC_ON | POWER0_COM_OFF | POWER0_VCC5_ON, 0); | ||
269 | |||
270 | /* (4)GVSS OFF */ | ||
271 | corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_ON); | ||
272 | |||
273 | /* (5)VCC5 OFF */ | ||
274 | corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_DAC_ON | POWER0_COM_OFF | POWER0_VCC5_OFF); | ||
275 | |||
276 | /* (6)Set PDWN, INIOFF, DACOFF */ | ||
277 | corgi_ssp_lcdtg_send(PICTRL_ADRS, PICTRL_INIOFF | PICTRL_DAC_SIGNAL_OFF | | ||
278 | PICTRL_POWER_DOWN | PICTRL_COM_SIGNAL_OFF); | ||
279 | |||
280 | /* (7)DAC OFF */ | ||
281 | corgi_ssp_lcdtg_send(POWERREG0_ADRS, POWER0_DAC_OFF | POWER0_COM_OFF | POWER0_VCC5_OFF); | ||
282 | |||
283 | /* (8)VDD OFF */ | ||
284 | corgi_ssp_lcdtg_send(POWERREG1_ADRS, POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF); | ||
285 | |||
286 | lcd_inited = 0; | ||
287 | } | ||
288 | |||
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c index d4a0733e905b..3f1dc74ac048 100644 --- a/arch/arm/mach-pxa/corgi_pm.c +++ b/arch/arm/mach-pxa/corgi_pm.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/gpio.h> | ||
17 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
18 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
19 | #include <linux/apm-emulation.h> | 20 | #include <linux/apm-emulation.h> |
@@ -25,7 +26,8 @@ | |||
25 | #include <mach/sharpsl.h> | 26 | #include <mach/sharpsl.h> |
26 | #include <mach/corgi.h> | 27 | #include <mach/corgi.h> |
27 | #include <mach/pxa2xx-regs.h> | 28 | #include <mach/pxa2xx-regs.h> |
28 | #include <mach/pxa2xx-gpio.h> | 29 | |
30 | #include "generic.h" | ||
29 | #include "sharpsl.h" | 31 | #include "sharpsl.h" |
30 | 32 | ||
31 | #define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ | 33 | #define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ |
@@ -35,87 +37,46 @@ | |||
35 | #define SHARPSL_FATAL_ACIN_VOLT 182 /* 3.45V */ | 37 | #define SHARPSL_FATAL_ACIN_VOLT 182 /* 3.45V */ |
36 | #define SHARPSL_FATAL_NOACIN_VOLT 170 /* 3.40V */ | 38 | #define SHARPSL_FATAL_NOACIN_VOLT 170 /* 3.40V */ |
37 | 39 | ||
40 | static struct gpio charger_gpios[] = { | ||
41 | { CORGI_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" }, | ||
42 | { CORGI_GPIO_CHRG_ON, GPIOF_OUT_INIT_LOW, "Charger On" }, | ||
43 | { CORGI_GPIO_CHRG_UKN, GPIOF_OUT_INIT_LOW, "Charger Unknown" }, | ||
44 | { CORGI_GPIO_KEY_INT, GPIOF_IN, "Key Interrupt" }, | ||
45 | }; | ||
46 | |||
38 | static void corgi_charger_init(void) | 47 | static void corgi_charger_init(void) |
39 | { | 48 | { |
40 | pxa_gpio_mode(CORGI_GPIO_ADC_TEMP_ON | GPIO_OUT); | 49 | gpio_request_array(ARRAY_AND_SIZE(charger_gpios)); |
41 | pxa_gpio_mode(CORGI_GPIO_CHRG_ON | GPIO_OUT); | ||
42 | pxa_gpio_mode(CORGI_GPIO_CHRG_UKN | GPIO_OUT); | ||
43 | pxa_gpio_mode(CORGI_GPIO_KEY_INT | GPIO_IN); | ||
44 | } | 50 | } |
45 | 51 | ||
46 | static void corgi_measure_temp(int on) | 52 | static void corgi_measure_temp(int on) |
47 | { | 53 | { |
48 | if (on) | 54 | gpio_set_value(CORGI_GPIO_ADC_TEMP_ON, on); |
49 | GPSR(CORGI_GPIO_ADC_TEMP_ON) = GPIO_bit(CORGI_GPIO_ADC_TEMP_ON); | ||
50 | else | ||
51 | GPCR(CORGI_GPIO_ADC_TEMP_ON) = GPIO_bit(CORGI_GPIO_ADC_TEMP_ON); | ||
52 | } | 55 | } |
53 | 56 | ||
54 | static void corgi_charge(int on) | 57 | static void corgi_charge(int on) |
55 | { | 58 | { |
56 | if (on) { | 59 | if (on) { |
57 | if (machine_is_corgi() && (sharpsl_pm.flags & SHARPSL_SUSPENDED)) { | 60 | if (machine_is_corgi() && (sharpsl_pm.flags & SHARPSL_SUSPENDED)) { |
58 | GPCR(CORGI_GPIO_CHRG_ON) = GPIO_bit(CORGI_GPIO_CHRG_ON); | 61 | gpio_set_value(CORGI_GPIO_CHRG_ON, 0); |
59 | GPSR(CORGI_GPIO_CHRG_UKN) = GPIO_bit(CORGI_GPIO_CHRG_UKN); | 62 | gpio_set_value(CORGI_GPIO_CHRG_UKN, 1); |
60 | } else { | 63 | } else { |
61 | GPSR(CORGI_GPIO_CHRG_ON) = GPIO_bit(CORGI_GPIO_CHRG_ON); | 64 | gpio_set_value(CORGI_GPIO_CHRG_ON, 1); |
62 | GPCR(CORGI_GPIO_CHRG_UKN) = GPIO_bit(CORGI_GPIO_CHRG_UKN); | 65 | gpio_set_value(CORGI_GPIO_CHRG_UKN, 0); |
63 | } | 66 | } |
64 | } else { | 67 | } else { |
65 | GPCR(CORGI_GPIO_CHRG_ON) = GPIO_bit(CORGI_GPIO_CHRG_ON); | 68 | gpio_set_value(CORGI_GPIO_CHRG_ON, 0); |
66 | GPCR(CORGI_GPIO_CHRG_UKN) = GPIO_bit(CORGI_GPIO_CHRG_UKN); | 69 | gpio_set_value(CORGI_GPIO_CHRG_UKN, 0); |
67 | } | 70 | } |
68 | } | 71 | } |
69 | 72 | ||
70 | static void corgi_discharge(int on) | 73 | static void corgi_discharge(int on) |
71 | { | 74 | { |
72 | if (on) | 75 | gpio_set_value(CORGI_GPIO_DISCHARGE_ON, on); |
73 | GPSR(CORGI_GPIO_DISCHARGE_ON) = GPIO_bit(CORGI_GPIO_DISCHARGE_ON); | ||
74 | else | ||
75 | GPCR(CORGI_GPIO_DISCHARGE_ON) = GPIO_bit(CORGI_GPIO_DISCHARGE_ON); | ||
76 | } | 76 | } |
77 | 77 | ||
78 | static void corgi_presuspend(void) | 78 | static void corgi_presuspend(void) |
79 | { | 79 | { |
80 | int i; | ||
81 | unsigned long wakeup_mask; | ||
82 | |||
83 | /* charging , so CHARGE_ON bit is HIGH during OFF. */ | ||
84 | if (READ_GPIO_BIT(CORGI_GPIO_CHRG_ON)) | ||
85 | PGSR1 |= GPIO_bit(CORGI_GPIO_CHRG_ON); | ||
86 | else | ||
87 | PGSR1 &= ~GPIO_bit(CORGI_GPIO_CHRG_ON); | ||
88 | |||
89 | if (READ_GPIO_BIT(CORGI_GPIO_LED_ORANGE)) | ||
90 | PGSR0 |= GPIO_bit(CORGI_GPIO_LED_ORANGE); | ||
91 | else | ||
92 | PGSR0 &= ~GPIO_bit(CORGI_GPIO_LED_ORANGE); | ||
93 | |||
94 | if (READ_GPIO_BIT(CORGI_GPIO_CHRG_UKN)) | ||
95 | PGSR1 |= GPIO_bit(CORGI_GPIO_CHRG_UKN); | ||
96 | else | ||
97 | PGSR1 &= ~GPIO_bit(CORGI_GPIO_CHRG_UKN); | ||
98 | |||
99 | /* Resume on keyboard power key */ | ||
100 | PGSR2 = (PGSR2 & ~CORGI_GPIO_ALL_STROBE_BIT) | CORGI_GPIO_STROBE_BIT(0); | ||
101 | |||
102 | wakeup_mask = GPIO_bit(CORGI_GPIO_KEY_INT) | GPIO_bit(CORGI_GPIO_WAKEUP) | GPIO_bit(CORGI_GPIO_AC_IN) | GPIO_bit(CORGI_GPIO_CHRG_FULL); | ||
103 | |||
104 | if (!machine_is_corgi()) | ||
105 | wakeup_mask |= GPIO_bit(CORGI_GPIO_MAIN_BAT_LOW); | ||
106 | |||
107 | PWER = wakeup_mask | PWER_RTC; | ||
108 | PRER = wakeup_mask; | ||
109 | PFER = wakeup_mask; | ||
110 | |||
111 | for (i = 0; i <=15; i++) { | ||
112 | if (PRER & PFER & GPIO_bit(i)) { | ||
113 | if (GPLR0 & GPIO_bit(i) ) | ||
114 | PRER &= ~GPIO_bit(i); | ||
115 | else | ||
116 | PFER &= ~GPIO_bit(i); | ||
117 | } | ||
118 | } | ||
119 | } | 80 | } |
120 | 81 | ||
121 | static void corgi_postsuspend(void) | 82 | static void corgi_postsuspend(void) |
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c deleted file mode 100644 index 9347254f8bcf..000000000000 --- a/arch/arm/mach-pxa/corgi_ssp.c +++ /dev/null | |||
@@ -1,274 +0,0 @@ | |||
1 | /* | ||
2 | * SSP control code for Sharp Corgi devices | ||
3 | * | ||
4 | * Copyright (c) 2004-2005 Richard Purdie | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/sched.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <mach/hardware.h> | ||
19 | #include <asm/mach-types.h> | ||
20 | |||
21 | #include <mach/ssp.h> | ||
22 | #include <mach/pxa2xx-gpio.h> | ||
23 | #include <mach/regs-ssp.h> | ||
24 | #include "sharpsl.h" | ||
25 | |||
26 | static DEFINE_SPINLOCK(corgi_ssp_lock); | ||
27 | static struct ssp_dev corgi_ssp_dev; | ||
28 | static struct ssp_state corgi_ssp_state; | ||
29 | static struct corgissp_machinfo *ssp_machinfo; | ||
30 | |||
31 | /* | ||
32 | * There are three devices connected to the SSP interface: | ||
33 | * 1. A touchscreen controller (TI ADS7846 compatible) | ||
34 | * 2. An LCD controller (with some Backlight functionality) | ||
35 | * 3. A battery monitoring IC (Maxim MAX1111) | ||
36 | * | ||
37 | * Each device uses a different speed/mode of communication. | ||
38 | * | ||
39 | * The touchscreen is very sensitive and the most frequently used | ||
40 | * so the port is left configured for this. | ||
41 | * | ||
42 | * Devices are selected using Chip Selects on GPIOs. | ||
43 | */ | ||
44 | |||
45 | /* | ||
46 | * ADS7846 Routines | ||
47 | */ | ||
48 | unsigned long corgi_ssp_ads7846_putget(ulong data) | ||
49 | { | ||
50 | unsigned long flag; | ||
51 | u32 ret = 0; | ||
52 | |||
53 | spin_lock_irqsave(&corgi_ssp_lock, flag); | ||
54 | if (ssp_machinfo->cs_ads7846 >= 0) | ||
55 | GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); | ||
56 | |||
57 | ssp_write_word(&corgi_ssp_dev,data); | ||
58 | ssp_read_word(&corgi_ssp_dev, &ret); | ||
59 | |||
60 | if (ssp_machinfo->cs_ads7846 >= 0) | ||
61 | GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); | ||
62 | spin_unlock_irqrestore(&corgi_ssp_lock, flag); | ||
63 | |||
64 | return ret; | ||
65 | } | ||
66 | |||
67 | /* | ||
68 | * NOTE: These functions should always be called in interrupt context | ||
69 | * and use the _lock and _unlock functions. They are very time sensitive. | ||
70 | */ | ||
71 | void corgi_ssp_ads7846_lock(void) | ||
72 | { | ||
73 | spin_lock(&corgi_ssp_lock); | ||
74 | if (ssp_machinfo->cs_ads7846 >= 0) | ||
75 | GPCR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); | ||
76 | } | ||
77 | |||
78 | void corgi_ssp_ads7846_unlock(void) | ||
79 | { | ||
80 | if (ssp_machinfo->cs_ads7846 >= 0) | ||
81 | GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); | ||
82 | spin_unlock(&corgi_ssp_lock); | ||
83 | } | ||
84 | |||
85 | void corgi_ssp_ads7846_put(ulong data) | ||
86 | { | ||
87 | ssp_write_word(&corgi_ssp_dev,data); | ||
88 | } | ||
89 | |||
90 | unsigned long corgi_ssp_ads7846_get(void) | ||
91 | { | ||
92 | u32 ret = 0; | ||
93 | ssp_read_word(&corgi_ssp_dev, &ret); | ||
94 | return ret; | ||
95 | } | ||
96 | |||
97 | EXPORT_SYMBOL(corgi_ssp_ads7846_putget); | ||
98 | EXPORT_SYMBOL(corgi_ssp_ads7846_lock); | ||
99 | EXPORT_SYMBOL(corgi_ssp_ads7846_unlock); | ||
100 | EXPORT_SYMBOL(corgi_ssp_ads7846_put); | ||
101 | EXPORT_SYMBOL(corgi_ssp_ads7846_get); | ||
102 | |||
103 | |||
104 | /* | ||
105 | * LCD/Backlight Routines | ||
106 | */ | ||
107 | unsigned long corgi_ssp_dac_put(ulong data) | ||
108 | { | ||
109 | unsigned long flag, sscr1 = SSCR1_SPH; | ||
110 | u32 tmp; | ||
111 | |||
112 | spin_lock_irqsave(&corgi_ssp_lock, flag); | ||
113 | |||
114 | if (machine_is_spitz() || machine_is_akita() || machine_is_borzoi()) | ||
115 | sscr1 = 0; | ||
116 | |||
117 | ssp_disable(&corgi_ssp_dev); | ||
118 | ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), sscr1, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_lcdcon)); | ||
119 | ssp_enable(&corgi_ssp_dev); | ||
120 | |||
121 | if (ssp_machinfo->cs_lcdcon >= 0) | ||
122 | GPCR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); | ||
123 | ssp_write_word(&corgi_ssp_dev,data); | ||
124 | /* Read null data back from device to prevent SSP overflow */ | ||
125 | ssp_read_word(&corgi_ssp_dev, &tmp); | ||
126 | if (ssp_machinfo->cs_lcdcon >= 0) | ||
127 | GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); | ||
128 | |||
129 | ssp_disable(&corgi_ssp_dev); | ||
130 | ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846)); | ||
131 | ssp_enable(&corgi_ssp_dev); | ||
132 | |||
133 | spin_unlock_irqrestore(&corgi_ssp_lock, flag); | ||
134 | |||
135 | return 0; | ||
136 | } | ||
137 | |||
138 | void corgi_ssp_lcdtg_send(u8 adrs, u8 data) | ||
139 | { | ||
140 | corgi_ssp_dac_put(((adrs & 0x07) << 5) | (data & 0x1f)); | ||
141 | } | ||
142 | |||
143 | void corgi_ssp_blduty_set(int duty) | ||
144 | { | ||
145 | corgi_ssp_lcdtg_send(0x02,duty); | ||
146 | } | ||
147 | |||
148 | EXPORT_SYMBOL(corgi_ssp_lcdtg_send); | ||
149 | EXPORT_SYMBOL(corgi_ssp_blduty_set); | ||
150 | |||
151 | /* | ||
152 | * Max1111 Routines | ||
153 | */ | ||
154 | int corgi_ssp_max1111_get(ulong data) | ||
155 | { | ||
156 | unsigned long flag; | ||
157 | long voltage = 0, voltage1 = 0, voltage2 = 0; | ||
158 | |||
159 | spin_lock_irqsave(&corgi_ssp_lock, flag); | ||
160 | if (ssp_machinfo->cs_max1111 >= 0) | ||
161 | GPCR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); | ||
162 | ssp_disable(&corgi_ssp_dev); | ||
163 | ssp_config(&corgi_ssp_dev, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_max1111)); | ||
164 | ssp_enable(&corgi_ssp_dev); | ||
165 | |||
166 | udelay(1); | ||
167 | |||
168 | /* TB1/RB1 */ | ||
169 | ssp_write_word(&corgi_ssp_dev,data); | ||
170 | ssp_read_word(&corgi_ssp_dev, (u32*)&voltage1); /* null read */ | ||
171 | |||
172 | /* TB12/RB2 */ | ||
173 | ssp_write_word(&corgi_ssp_dev,0); | ||
174 | ssp_read_word(&corgi_ssp_dev, (u32*)&voltage1); | ||
175 | |||
176 | /* TB13/RB3*/ | ||
177 | ssp_write_word(&corgi_ssp_dev,0); | ||
178 | ssp_read_word(&corgi_ssp_dev, (u32*)&voltage2); | ||
179 | |||
180 | ssp_disable(&corgi_ssp_dev); | ||
181 | ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846)); | ||
182 | ssp_enable(&corgi_ssp_dev); | ||
183 | if (ssp_machinfo->cs_max1111 >= 0) | ||
184 | GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); | ||
185 | spin_unlock_irqrestore(&corgi_ssp_lock, flag); | ||
186 | |||
187 | if (voltage1 & 0xc0 || voltage2 & 0x3f) | ||
188 | voltage = -1; | ||
189 | else | ||
190 | voltage = ((voltage1 << 2) & 0xfc) | ((voltage2 >> 6) & 0x03); | ||
191 | |||
192 | return voltage; | ||
193 | } | ||
194 | |||
195 | EXPORT_SYMBOL(corgi_ssp_max1111_get); | ||
196 | |||
197 | /* | ||
198 | * Support Routines | ||
199 | */ | ||
200 | |||
201 | void __init corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo) | ||
202 | { | ||
203 | ssp_machinfo = machinfo; | ||
204 | } | ||
205 | |||
206 | static int __devinit corgi_ssp_probe(struct platform_device *dev) | ||
207 | { | ||
208 | int ret; | ||
209 | |||
210 | /* Chip Select - Disable All */ | ||
211 | if (ssp_machinfo->cs_lcdcon >= 0) | ||
212 | pxa_gpio_mode(ssp_machinfo->cs_lcdcon | GPIO_OUT | GPIO_DFLT_HIGH); | ||
213 | if (ssp_machinfo->cs_max1111 >= 0) | ||
214 | pxa_gpio_mode(ssp_machinfo->cs_max1111 | GPIO_OUT | GPIO_DFLT_HIGH); | ||
215 | if (ssp_machinfo->cs_ads7846 >= 0) | ||
216 | pxa_gpio_mode(ssp_machinfo->cs_ads7846 | GPIO_OUT | GPIO_DFLT_HIGH); | ||
217 | |||
218 | ret = ssp_init(&corgi_ssp_dev, ssp_machinfo->port, 0); | ||
219 | |||
220 | if (ret) | ||
221 | printk(KERN_ERR "Unable to register SSP handler!\n"); | ||
222 | else { | ||
223 | ssp_disable(&corgi_ssp_dev); | ||
224 | ssp_config(&corgi_ssp_dev, (SSCR0_National | (SSCR0_DSS & 0x0b )), 0, 0, SSCR0_SerClkDiv(ssp_machinfo->clk_ads7846)); | ||
225 | ssp_enable(&corgi_ssp_dev); | ||
226 | } | ||
227 | |||
228 | return ret; | ||
229 | } | ||
230 | |||
231 | static int corgi_ssp_remove(struct platform_device *dev) | ||
232 | { | ||
233 | ssp_exit(&corgi_ssp_dev); | ||
234 | return 0; | ||
235 | } | ||
236 | |||
237 | static int corgi_ssp_suspend(struct platform_device *dev, pm_message_t state) | ||
238 | { | ||
239 | ssp_flush(&corgi_ssp_dev); | ||
240 | ssp_save_state(&corgi_ssp_dev,&corgi_ssp_state); | ||
241 | |||
242 | return 0; | ||
243 | } | ||
244 | |||
245 | static int corgi_ssp_resume(struct platform_device *dev) | ||
246 | { | ||
247 | if (ssp_machinfo->cs_lcdcon >= 0) | ||
248 | GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon); /* High - Disable LCD Control/Timing Gen */ | ||
249 | if (ssp_machinfo->cs_max1111 >= 0) | ||
250 | GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/ | ||
251 | if (ssp_machinfo->cs_ads7846 >= 0) | ||
252 | GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); /* High - Disable ADS7846*/ | ||
253 | ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state); | ||
254 | ssp_enable(&corgi_ssp_dev); | ||
255 | |||
256 | return 0; | ||
257 | } | ||
258 | |||
259 | static struct platform_driver corgissp_driver = { | ||
260 | .probe = corgi_ssp_probe, | ||
261 | .remove = corgi_ssp_remove, | ||
262 | .suspend = corgi_ssp_suspend, | ||
263 | .resume = corgi_ssp_resume, | ||
264 | .driver = { | ||
265 | .name = "corgi-ssp", | ||
266 | }, | ||
267 | }; | ||
268 | |||
269 | int __init corgi_ssp_init(void) | ||
270 | { | ||
271 | return platform_driver_register(&corgissp_driver); | ||
272 | } | ||
273 | |||
274 | arch_initcall(corgi_ssp_init); | ||
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c index 88575b87bd33..91fd4fea6a54 100644 --- a/arch/arm/mach-pxa/csb726.c +++ b/arch/arm/mach-pxa/csb726.c | |||
@@ -125,18 +125,9 @@ static unsigned long csb726_pin_config[] = { | |||
125 | GPIO118_I2C_SDA, | 125 | GPIO118_I2C_SDA, |
126 | }; | 126 | }; |
127 | 127 | ||
128 | static struct pxamci_platform_data csb726_mci_data; | ||
129 | |||
130 | static int csb726_mci_init(struct device *dev, | ||
131 | irq_handler_t detect, void *data) | ||
132 | { | ||
133 | csb726_mci_data.detect_delay = msecs_to_jiffies(500); | ||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | static struct pxamci_platform_data csb726_mci = { | 128 | static struct pxamci_platform_data csb726_mci = { |
129 | .detect_delay_ms = 500, | ||
138 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 130 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
139 | .init = csb726_mci_init, | ||
140 | /* FIXME setpower */ | 131 | /* FIXME setpower */ |
141 | .gpio_card_detect = CSB726_GPIO_MMC_DETECT, | 132 | .gpio_card_detect = CSB726_GPIO_MMC_DETECT, |
142 | .gpio_card_ro = CSB726_GPIO_MMC_RO, | 133 | .gpio_card_ro = CSB726_GPIO_MMC_RO, |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index aab04f33e49b..0517c17978f3 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -626,6 +626,7 @@ static int em_x270_mci_get_ro(struct device *dev) | |||
626 | } | 626 | } |
627 | 627 | ||
628 | static struct pxamci_platform_data em_x270_mci_platform_data = { | 628 | static struct pxamci_platform_data em_x270_mci_platform_data = { |
629 | .detect_delay_ms = 250, | ||
629 | .ocr_mask = MMC_VDD_20_21|MMC_VDD_21_22|MMC_VDD_22_23| | 630 | .ocr_mask = MMC_VDD_20_21|MMC_VDD_21_22|MMC_VDD_22_23| |
630 | MMC_VDD_24_25|MMC_VDD_25_26|MMC_VDD_26_27| | 631 | MMC_VDD_24_25|MMC_VDD_25_26|MMC_VDD_26_27| |
631 | MMC_VDD_27_28|MMC_VDD_28_29|MMC_VDD_29_30| | 632 | MMC_VDD_27_28|MMC_VDD_28_29|MMC_VDD_29_30| |
@@ -643,7 +644,6 @@ static void __init em_x270_init_mmc(void) | |||
643 | if (machine_is_em_x270()) | 644 | if (machine_is_em_x270()) |
644 | em_x270_mci_platform_data.get_ro = em_x270_mci_get_ro; | 645 | em_x270_mci_platform_data.get_ro = em_x270_mci_get_ro; |
645 | 646 | ||
646 | em_x270_mci_platform_data.detect_delay = msecs_to_jiffies(250); | ||
647 | pxa_set_mci_info(&em_x270_mci_platform_data); | 647 | pxa_set_mci_info(&em_x270_mci_platform_data); |
648 | } | 648 | } |
649 | #else | 649 | #else |
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index 3126a35aa002..baabb3ce088e 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | #include <mach/reset.h> | 29 | #include <mach/reset.h> |
30 | #include <mach/gpio.h> | 30 | #include <mach/gpio.h> |
31 | #include <mach/pxa2xx-gpio.h> | ||
32 | 31 | ||
33 | #include "generic.h" | 32 | #include "generic.h" |
34 | 33 | ||
@@ -128,33 +127,3 @@ void __init pxa_map_io(void) | |||
128 | iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); | 127 | iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); |
129 | get_clk_frequency_khz(1); | 128 | get_clk_frequency_khz(1); |
130 | } | 129 | } |
131 | |||
132 | /* | ||
133 | * Configure pins for GPIO or other functions | ||
134 | */ | ||
135 | int pxa_gpio_mode(int gpio_mode) | ||
136 | { | ||
137 | unsigned long flags; | ||
138 | int gpio = gpio_mode & GPIO_MD_MASK_NR; | ||
139 | int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8; | ||
140 | int gafr; | ||
141 | |||
142 | if (gpio > pxa_last_gpio) | ||
143 | return -EINVAL; | ||
144 | |||
145 | local_irq_save(flags); | ||
146 | if (gpio_mode & GPIO_DFLT_LOW) | ||
147 | GPCR(gpio) = GPIO_bit(gpio); | ||
148 | else if (gpio_mode & GPIO_DFLT_HIGH) | ||
149 | GPSR(gpio) = GPIO_bit(gpio); | ||
150 | if (gpio_mode & GPIO_MD_MASK_DIR) | ||
151 | GPDR(gpio) |= GPIO_bit(gpio); | ||
152 | else | ||
153 | GPDR(gpio) &= ~GPIO_bit(gpio); | ||
154 | gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2)); | ||
155 | GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2)); | ||
156 | local_irq_restore(flags); | ||
157 | |||
158 | return 0; | ||
159 | } | ||
160 | EXPORT_SYMBOL(pxa_gpio_mode); | ||
diff --git a/arch/arm/mach-pxa/include/mach/corgi.h b/arch/arm/mach-pxa/include/mach/corgi.h index 7239281788de..585970ef08ce 100644 --- a/arch/arm/mach-pxa/include/mach/corgi.h +++ b/arch/arm/mach-pxa/include/mach/corgi.h | |||
@@ -113,7 +113,6 @@ | |||
113 | * Shared data structures | 113 | * Shared data structures |
114 | */ | 114 | */ |
115 | extern struct platform_device corgiscoop_device; | 115 | extern struct platform_device corgiscoop_device; |
116 | extern struct platform_device corgissp_device; | ||
117 | 116 | ||
118 | #endif /* __ASM_ARCH_CORGI_H */ | 117 | #endif /* __ASM_ARCH_CORGI_H */ |
119 | 118 | ||
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h index 658b28ed129b..c54cef25895c 100644 --- a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h +++ b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h | |||
@@ -25,6 +25,8 @@ | |||
25 | #define MFP_DIR(x) (((x) >> 23) & 0x1) | 25 | #define MFP_DIR(x) (((x) >> 23) & 0x1) |
26 | 26 | ||
27 | #define MFP_LPM_CAN_WAKEUP (0x1 << 24) | 27 | #define MFP_LPM_CAN_WAKEUP (0x1 << 24) |
28 | #define MFP_LPM_KEEP_OUTPUT (0x1 << 25) | ||
29 | |||
28 | #define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE) | 30 | #define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE) |
29 | #define WAKEUP_ON_EDGE_FALL (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL) | 31 | #define WAKEUP_ON_EDGE_FALL (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL) |
30 | #define WAKEUP_ON_EDGE_BOTH (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH) | 32 | #define WAKEUP_ON_EDGE_BOTH (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH) |
diff --git a/arch/arm/mach-pxa/include/mach/mmc.h b/arch/arm/mach-pxa/include/mach/mmc.h index 02a69dc2ee63..9eb515bb799d 100644 --- a/arch/arm/mach-pxa/include/mach/mmc.h +++ b/arch/arm/mach-pxa/include/mach/mmc.h | |||
@@ -9,7 +9,7 @@ struct mmc_host; | |||
9 | 9 | ||
10 | struct pxamci_platform_data { | 10 | struct pxamci_platform_data { |
11 | unsigned int ocr_mask; /* available voltages */ | 11 | unsigned int ocr_mask; /* available voltages */ |
12 | unsigned long detect_delay; /* delay in jiffies before detecting cards after interrupt */ | 12 | unsigned long detect_delay_ms; /* delay in millisecond before detecting cards after interrupt */ |
13 | int (*init)(struct device *, irq_handler_t , void *); | 13 | int (*init)(struct device *, irq_handler_t , void *); |
14 | int (*get_ro)(struct device *); | 14 | int (*get_ro)(struct device *); |
15 | void (*setpower)(struct device *, unsigned int); | 15 | void (*setpower)(struct device *, unsigned int); |
diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-gpio.h b/arch/arm/mach-pxa/include/mach/pxa2xx-gpio.h deleted file mode 100644 index 1209c44aa6f1..000000000000 --- a/arch/arm/mach-pxa/include/mach/pxa2xx-gpio.h +++ /dev/null | |||
@@ -1,375 +0,0 @@ | |||
1 | #ifndef __ASM_ARCH_PXA2XX_GPIO_H | ||
2 | #define __ASM_ARCH_PXA2XX_GPIO_H | ||
3 | |||
4 | #warning Please use mfp-pxa2[57]x.h instead of pxa2xx-gpio.h | ||
5 | |||
6 | #include <mach/gpio.h> | ||
7 | |||
8 | /* GPIO alternate function assignments */ | ||
9 | |||
10 | #define GPIO1_RST 1 /* reset */ | ||
11 | #define GPIO6_MMCCLK 6 /* MMC Clock */ | ||
12 | #define GPIO7_48MHz 7 /* 48 MHz clock output */ | ||
13 | #define GPIO8_MMCCS0 8 /* MMC Chip Select 0 */ | ||
14 | #define GPIO9_MMCCS1 9 /* MMC Chip Select 1 */ | ||
15 | #define GPIO10_RTCCLK 10 /* real time clock (1 Hz) */ | ||
16 | #define GPIO11_3_6MHz 11 /* 3.6 MHz oscillator out */ | ||
17 | #define GPIO12_32KHz 12 /* 32 kHz out */ | ||
18 | #define GPIO12_CIF_DD_7 12 /* Camera data pin 7 */ | ||
19 | #define GPIO13_MBGNT 13 /* memory controller grant */ | ||
20 | #define GPIO14_MBREQ 14 /* alternate bus master request */ | ||
21 | #define GPIO15_nCS_1 15 /* chip select 1 */ | ||
22 | #define GPIO16_PWM0 16 /* PWM0 output */ | ||
23 | #define GPIO17_PWM1 17 /* PWM1 output */ | ||
24 | #define GPIO17_CIF_DD_6 17 /* Camera data pin 6 */ | ||
25 | #define GPIO18_RDY 18 /* Ext. Bus Ready */ | ||
26 | #define GPIO19_DREQ1 19 /* External DMA Request */ | ||
27 | #define GPIO20_DREQ0 20 /* External DMA Request */ | ||
28 | #define GPIO23_SCLK 23 /* SSP clock */ | ||
29 | #define GPIO23_CIF_MCLK 23 /* Camera Master Clock */ | ||
30 | #define GPIO24_SFRM 24 /* SSP Frame */ | ||
31 | #define GPIO24_CIF_FV 24 /* Camera frame start signal */ | ||
32 | #define GPIO25_STXD 25 /* SSP transmit */ | ||
33 | #define GPIO25_CIF_LV 25 /* Camera line start signal */ | ||
34 | #define GPIO26_SRXD 26 /* SSP receive */ | ||
35 | #define GPIO26_CIF_PCLK 26 /* Camera Pixel Clock */ | ||
36 | #define GPIO27_SEXTCLK 27 /* SSP ext_clk */ | ||
37 | #define GPIO27_CIF_DD_0 27 /* Camera data pin 0 */ | ||
38 | #define GPIO28_BITCLK 28 /* AC97/I2S bit_clk */ | ||
39 | #define GPIO29_SDATA_IN 29 /* AC97 Sdata_in0 / I2S Sdata_in */ | ||
40 | #define GPIO30_SDATA_OUT 30 /* AC97/I2S Sdata_out */ | ||
41 | #define GPIO31_SYNC 31 /* AC97/I2S sync */ | ||
42 | #define GPIO32_SDATA_IN1 32 /* AC97 Sdata_in1 */ | ||
43 | #define GPIO32_SYSCLK 32 /* I2S System Clock */ | ||
44 | #define GPIO32_MMCCLK 32 /* MMC Clock (PXA270) */ | ||
45 | #define GPIO33_nCS_5 33 /* chip select 5 */ | ||
46 | #define GPIO34_FFRXD 34 /* FFUART receive */ | ||
47 | #define GPIO34_MMCCS0 34 /* MMC Chip Select 0 */ | ||
48 | #define GPIO35_FFCTS 35 /* FFUART Clear to send */ | ||
49 | #define GPIO36_FFDCD 36 /* FFUART Data carrier detect */ | ||
50 | #define GPIO37_FFDSR 37 /* FFUART data set ready */ | ||
51 | #define GPIO38_FFRI 38 /* FFUART Ring Indicator */ | ||
52 | #define GPIO39_MMCCS1 39 /* MMC Chip Select 1 */ | ||
53 | #define GPIO39_FFTXD 39 /* FFUART transmit data */ | ||
54 | #define GPIO40_FFDTR 40 /* FFUART data terminal Ready */ | ||
55 | #define GPIO41_FFRTS 41 /* FFUART request to send */ | ||
56 | #define GPIO42_BTRXD 42 /* BTUART receive data */ | ||
57 | #define GPIO42_HWRXD 42 /* HWUART receive data */ | ||
58 | #define GPIO42_CIF_MCLK 42 /* Camera Master Clock */ | ||
59 | #define GPIO43_BTTXD 43 /* BTUART transmit data */ | ||
60 | #define GPIO43_HWTXD 43 /* HWUART transmit data */ | ||
61 | #define GPIO43_CIF_FV 43 /* Camera frame start signal */ | ||
62 | #define GPIO44_BTCTS 44 /* BTUART clear to send */ | ||
63 | #define GPIO44_HWCTS 44 /* HWUART clear to send */ | ||
64 | #define GPIO44_CIF_LV 44 /* Camera line start signal */ | ||
65 | #define GPIO45_BTRTS 45 /* BTUART request to send */ | ||
66 | #define GPIO45_HWRTS 45 /* HWUART request to send */ | ||
67 | #define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */ | ||
68 | #define GPIO45_CIF_PCLK 45 /* Camera Pixel Clock */ | ||
69 | #define GPIO46_ICPRXD 46 /* ICP receive data */ | ||
70 | #define GPIO46_STRXD 46 /* STD_UART receive data */ | ||
71 | #define GPIO47_ICPTXD 47 /* ICP transmit data */ | ||
72 | #define GPIO47_STTXD 47 /* STD_UART transmit data */ | ||
73 | #define GPIO47_CIF_DD_0 47 /* Camera data pin 0 */ | ||
74 | #define GPIO48_nPOE 48 /* Output Enable for Card Space */ | ||
75 | #define GPIO48_CIF_DD_5 48 /* Camera data pin 5 */ | ||
76 | #define GPIO49_nPWE 49 /* Write Enable for Card Space */ | ||
77 | #define GPIO50_nPIOR 50 /* I/O Read for Card Space */ | ||
78 | #define GPIO50_CIF_DD_3 50 /* Camera data pin 3 */ | ||
79 | #define GPIO51_nPIOW 51 /* I/O Write for Card Space */ | ||
80 | #define GPIO51_CIF_DD_2 51 /* Camera data pin 2 */ | ||
81 | #define GPIO52_nPCE_1 52 /* Card Enable for Card Space */ | ||
82 | #define GPIO52_CIF_DD_4 52 /* Camera data pin 4 */ | ||
83 | #define GPIO53_nPCE_2 53 /* Card Enable for Card Space */ | ||
84 | #define GPIO53_MMCCLK 53 /* MMC Clock */ | ||
85 | #define GPIO53_CIF_MCLK 53 /* Camera Master Clock */ | ||
86 | #define GPIO54_MMCCLK 54 /* MMC Clock */ | ||
87 | #define GPIO54_pSKTSEL 54 /* Socket Select for Card Space */ | ||
88 | #define GPIO54_nPCE_2 54 /* Card Enable for Card Space (PXA27x) */ | ||
89 | #define GPIO54_CIF_PCLK 54 /* Camera Pixel Clock */ | ||
90 | #define GPIO55_nPREG 55 /* Card Address bit 26 */ | ||
91 | #define GPIO55_CIF_DD_1 55 /* Camera data pin 1 */ | ||
92 | #define GPIO56_nPWAIT 56 /* Wait signal for Card Space */ | ||
93 | #define GPIO57_nIOIS16 57 /* Bus Width select for I/O Card Space */ | ||
94 | #define GPIO58_LDD_0 58 /* LCD data pin 0 */ | ||
95 | #define GPIO59_LDD_1 59 /* LCD data pin 1 */ | ||
96 | #define GPIO60_LDD_2 60 /* LCD data pin 2 */ | ||
97 | #define GPIO61_LDD_3 61 /* LCD data pin 3 */ | ||
98 | #define GPIO62_LDD_4 62 /* LCD data pin 4 */ | ||
99 | #define GPIO63_LDD_5 63 /* LCD data pin 5 */ | ||
100 | #define GPIO64_LDD_6 64 /* LCD data pin 6 */ | ||
101 | #define GPIO65_LDD_7 65 /* LCD data pin 7 */ | ||
102 | #define GPIO66_LDD_8 66 /* LCD data pin 8 */ | ||
103 | #define GPIO66_MBREQ 66 /* alternate bus master req */ | ||
104 | #define GPIO67_LDD_9 67 /* LCD data pin 9 */ | ||
105 | #define GPIO67_MMCCS0 67 /* MMC Chip Select 0 */ | ||
106 | #define GPIO68_LDD_10 68 /* LCD data pin 10 */ | ||
107 | #define GPIO68_MMCCS1 68 /* MMC Chip Select 1 */ | ||
108 | #define GPIO69_LDD_11 69 /* LCD data pin 11 */ | ||
109 | #define GPIO69_MMCCLK 69 /* MMC_CLK */ | ||
110 | #define GPIO70_LDD_12 70 /* LCD data pin 12 */ | ||
111 | #define GPIO70_RTCCLK 70 /* Real Time clock (1 Hz) */ | ||
112 | #define GPIO71_LDD_13 71 /* LCD data pin 13 */ | ||
113 | #define GPIO71_3_6MHz 71 /* 3.6 MHz Oscillator clock */ | ||
114 | #define GPIO72_LDD_14 72 /* LCD data pin 14 */ | ||
115 | #define GPIO72_32kHz 72 /* 32 kHz clock */ | ||
116 | #define GPIO73_LDD_15 73 /* LCD data pin 15 */ | ||
117 | #define GPIO73_MBGNT 73 /* Memory controller grant */ | ||
118 | #define GPIO74_LCD_FCLK 74 /* LCD Frame clock */ | ||
119 | #define GPIO75_LCD_LCLK 75 /* LCD line clock */ | ||
120 | #define GPIO76_LCD_PCLK 76 /* LCD Pixel clock */ | ||
121 | #define GPIO77_LCD_ACBIAS 77 /* LCD AC Bias */ | ||
122 | #define GPIO78_nCS_2 78 /* chip select 2 */ | ||
123 | #define GPIO79_nCS_3 79 /* chip select 3 */ | ||
124 | #define GPIO80_nCS_4 80 /* chip select 4 */ | ||
125 | #define GPIO81_NSCLK 81 /* NSSP clock */ | ||
126 | #define GPIO81_CIF_DD_0 81 /* Camera data pin 0 */ | ||
127 | #define GPIO82_NSFRM 82 /* NSSP Frame */ | ||
128 | #define GPIO82_CIF_DD_5 82 /* Camera data pin 5 */ | ||
129 | #define GPIO83_NSTXD 83 /* NSSP transmit */ | ||
130 | #define GPIO83_CIF_DD_4 83 /* Camera data pin 4 */ | ||
131 | #define GPIO84_NSRXD 84 /* NSSP receive */ | ||
132 | #define GPIO84_CIF_FV 84 /* Camera frame start signal */ | ||
133 | #define GPIO85_nPCE_1 85 /* Card Enable for Card Space (PXA27x) */ | ||
134 | #define GPIO85_CIF_LV 85 /* Camera line start signal */ | ||
135 | #define GPIO90_CIF_DD_4 90 /* Camera data pin 4 */ | ||
136 | #define GPIO91_CIF_DD_5 91 /* Camera data pin 5 */ | ||
137 | #define GPIO92_MMCDAT0 92 /* MMC DAT0 (PXA27x) */ | ||
138 | #define GPIO93_CIF_DD_6 93 /* Camera data pin 6 */ | ||
139 | #define GPIO94_CIF_DD_5 94 /* Camera data pin 5 */ | ||
140 | #define GPIO95_CIF_DD_4 95 /* Camera data pin 4 */ | ||
141 | #define GPIO96_FFRXD 96 /* FFUART recieve */ | ||
142 | #define GPIO98_FFRTS 98 /* FFUART request to send */ | ||
143 | #define GPIO98_CIF_DD_0 98 /* Camera data pin 0 */ | ||
144 | #define GPIO99_FFTXD 99 /* FFUART transmit data */ | ||
145 | #define GPIO100_FFCTS 100 /* FFUART Clear to send */ | ||
146 | #define GPIO102_nPCE_1 102 /* PCMCIA (PXA27x) */ | ||
147 | #define GPIO103_CIF_DD_3 103 /* Camera data pin 3 */ | ||
148 | #define GPIO104_CIF_DD_2 104 /* Camera data pin 2 */ | ||
149 | #define GPIO105_CIF_DD_1 105 /* Camera data pin 1 */ | ||
150 | #define GPIO106_CIF_DD_9 106 /* Camera data pin 9 */ | ||
151 | #define GPIO107_CIF_DD_8 107 /* Camera data pin 8 */ | ||
152 | #define GPIO108_CIF_DD_7 108 /* Camera data pin 7 */ | ||
153 | #define GPIO109_MMCDAT1 109 /* MMC DAT1 (PXA27x) */ | ||
154 | #define GPIO110_MMCDAT2 110 /* MMC DAT2 (PXA27x) */ | ||
155 | #define GPIO110_MMCCS0 110 /* MMC Chip Select 0 (PXA27x) */ | ||
156 | #define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */ | ||
157 | #define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */ | ||
158 | #define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */ | ||
159 | #define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */ | ||
160 | #define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */ | ||
161 | #define GPIO114_CIF_DD_1 114 /* Camera data pin 1 */ | ||
162 | #define GPIO115_CIF_DD_3 115 /* Camera data pin 3 */ | ||
163 | #define GPIO116_CIF_DD_2 116 /* Camera data pin 2 */ | ||
164 | |||
165 | /* GPIO alternate function mode & direction */ | ||
166 | |||
167 | #define GPIO_IN 0x000 | ||
168 | #define GPIO_OUT 0x080 | ||
169 | #define GPIO_ALT_FN_1_IN 0x100 | ||
170 | #define GPIO_ALT_FN_1_OUT 0x180 | ||
171 | #define GPIO_ALT_FN_2_IN 0x200 | ||
172 | #define GPIO_ALT_FN_2_OUT 0x280 | ||
173 | #define GPIO_ALT_FN_3_IN 0x300 | ||
174 | #define GPIO_ALT_FN_3_OUT 0x380 | ||
175 | #define GPIO_MD_MASK_NR 0x07f | ||
176 | #define GPIO_MD_MASK_DIR 0x080 | ||
177 | #define GPIO_MD_MASK_FN 0x300 | ||
178 | #define GPIO_DFLT_LOW 0x400 | ||
179 | #define GPIO_DFLT_HIGH 0x800 | ||
180 | |||
181 | #define GPIO1_RTS_MD ( 1 | GPIO_ALT_FN_1_IN) | ||
182 | #define GPIO6_MMCCLK_MD ( 6 | GPIO_ALT_FN_1_OUT) | ||
183 | #define GPIO7_48MHz_MD ( 7 | GPIO_ALT_FN_1_OUT) | ||
184 | #define GPIO8_MMCCS0_MD ( 8 | GPIO_ALT_FN_1_OUT) | ||
185 | #define GPIO9_MMCCS1_MD ( 9 | GPIO_ALT_FN_1_OUT) | ||
186 | #define GPIO10_RTCCLK_MD (10 | GPIO_ALT_FN_1_OUT) | ||
187 | #define GPIO11_3_6MHz_MD (11 | GPIO_ALT_FN_1_OUT) | ||
188 | #define GPIO12_32KHz_MD (12 | GPIO_ALT_FN_1_OUT) | ||
189 | #define GPIO12_CIF_DD_7_MD (12 | GPIO_ALT_FN_2_IN) | ||
190 | #define GPIO13_MBGNT_MD (13 | GPIO_ALT_FN_2_OUT) | ||
191 | #define GPIO14_MBREQ_MD (14 | GPIO_ALT_FN_1_IN) | ||
192 | #define GPIO15_nCS_1_MD (15 | GPIO_ALT_FN_2_OUT) | ||
193 | #define GPIO16_PWM0_MD (16 | GPIO_ALT_FN_2_OUT) | ||
194 | #define GPIO17_PWM1_MD (17 | GPIO_ALT_FN_2_OUT) | ||
195 | #define GPIO17_CIF_DD_6_MD (17 | GPIO_ALT_FN_2_IN) | ||
196 | #define GPIO18_RDY_MD (18 | GPIO_ALT_FN_1_IN) | ||
197 | #define GPIO19_DREQ1_MD (19 | GPIO_ALT_FN_1_IN) | ||
198 | #define GPIO20_DREQ0_MD (20 | GPIO_ALT_FN_1_IN) | ||
199 | #define GPIO23_CIF_MCLK_MD (23 | GPIO_ALT_FN_1_OUT) | ||
200 | #define GPIO23_SCLK_MD (23 | GPIO_ALT_FN_2_OUT) | ||
201 | #define GPIO24_CIF_FV_MD (24 | GPIO_ALT_FN_1_OUT) | ||
202 | #define GPIO24_SFRM_MD (24 | GPIO_ALT_FN_2_OUT) | ||
203 | #define GPIO25_CIF_LV_MD (25 | GPIO_ALT_FN_1_OUT) | ||
204 | #define GPIO25_STXD_MD (25 | GPIO_ALT_FN_2_OUT) | ||
205 | #define GPIO26_SRXD_MD (26 | GPIO_ALT_FN_1_IN) | ||
206 | #define GPIO26_CIF_PCLK_MD (26 | GPIO_ALT_FN_2_IN) | ||
207 | #define GPIO27_SEXTCLK_MD (27 | GPIO_ALT_FN_1_IN) | ||
208 | #define GPIO27_CIF_DD_0_MD (27 | GPIO_ALT_FN_3_IN) | ||
209 | #define GPIO28_BITCLK_AC97_MD (28 | GPIO_ALT_FN_1_IN) | ||
210 | #define GPIO28_BITCLK_IN_I2S_MD (28 | GPIO_ALT_FN_2_IN) | ||
211 | #define GPIO28_BITCLK_OUT_I2S_MD (28 | GPIO_ALT_FN_1_OUT) | ||
212 | #define GPIO29_SDATA_IN_AC97_MD (29 | GPIO_ALT_FN_1_IN) | ||
213 | #define GPIO29_SDATA_IN_I2S_MD (29 | GPIO_ALT_FN_2_IN) | ||
214 | #define GPIO30_SDATA_OUT_AC97_MD (30 | GPIO_ALT_FN_2_OUT) | ||
215 | #define GPIO30_SDATA_OUT_I2S_MD (30 | GPIO_ALT_FN_1_OUT) | ||
216 | #define GPIO31_SYNC_I2S_MD (31 | GPIO_ALT_FN_1_OUT) | ||
217 | #define GPIO31_SYNC_AC97_MD (31 | GPIO_ALT_FN_2_OUT) | ||
218 | #define GPIO32_SDATA_IN1_AC97_MD (32 | GPIO_ALT_FN_1_IN) | ||
219 | #define GPIO32_SYSCLK_I2S_MD (32 | GPIO_ALT_FN_1_OUT) | ||
220 | #define GPIO32_MMCCLK_MD (32 | GPIO_ALT_FN_2_OUT) | ||
221 | #define GPIO33_nCS_5_MD (33 | GPIO_ALT_FN_2_OUT) | ||
222 | #define GPIO34_FFRXD_MD (34 | GPIO_ALT_FN_1_IN) | ||
223 | #define GPIO34_MMCCS0_MD (34 | GPIO_ALT_FN_2_OUT) | ||
224 | #define GPIO35_FFCTS_MD (35 | GPIO_ALT_FN_1_IN) | ||
225 | #define GPIO35_KP_MKOUT6_MD (35 | GPIO_ALT_FN_2_OUT) | ||
226 | #define GPIO36_FFDCD_MD (36 | GPIO_ALT_FN_1_IN) | ||
227 | #define GPIO37_FFDSR_MD (37 | GPIO_ALT_FN_1_IN) | ||
228 | #define GPIO38_FFRI_MD (38 | GPIO_ALT_FN_1_IN) | ||
229 | #define GPIO39_MMCCS1_MD (39 | GPIO_ALT_FN_1_OUT) | ||
230 | #define GPIO39_FFTXD_MD (39 | GPIO_ALT_FN_2_OUT) | ||
231 | #define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT) | ||
232 | #define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT) | ||
233 | #define GPIO41_KP_MKOUT7_MD (41 | GPIO_ALT_FN_1_OUT) | ||
234 | #define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN) | ||
235 | #define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN) | ||
236 | #define GPIO42_CIF_MCLK_MD (42 | GPIO_ALT_FN_3_OUT) | ||
237 | #define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT) | ||
238 | #define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT) | ||
239 | #define GPIO43_CIF_FV_MD (43 | GPIO_ALT_FN_3_OUT) | ||
240 | #define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN) | ||
241 | #define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN) | ||
242 | #define GPIO44_CIF_LV_MD (44 | GPIO_ALT_FN_3_OUT) | ||
243 | #define GPIO45_CIF_PCLK_MD (45 | GPIO_ALT_FN_3_IN) | ||
244 | #define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT) | ||
245 | #define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT) | ||
246 | #define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT) | ||
247 | #define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN) | ||
248 | #define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN) | ||
249 | #define GPIO47_CIF_DD_0_MD (47 | GPIO_ALT_FN_1_IN) | ||
250 | #define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT) | ||
251 | #define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT) | ||
252 | #define GPIO48_CIF_DD_5_MD (48 | GPIO_ALT_FN_1_IN) | ||
253 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) | ||
254 | #define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT) | ||
255 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) | ||
256 | #define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN) | ||
257 | #define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT) | ||
258 | #define GPIO50_CIF_DD_3_MD (50 | GPIO_ALT_FN_1_IN) | ||
259 | #define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT) | ||
260 | #define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN) | ||
261 | #define GPIO50_CIF_DD_3_MD (50 | GPIO_ALT_FN_1_IN) | ||
262 | #define GPIO51_CIF_DD_2_MD (51 | GPIO_ALT_FN_1_IN) | ||
263 | #define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT) | ||
264 | #define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT) | ||
265 | #define GPIO51_CIF_DD_2_MD (51 | GPIO_ALT_FN_1_IN) | ||
266 | #define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT) | ||
267 | #define GPIO52_CIF_DD_4_MD (52 | GPIO_ALT_FN_1_IN) | ||
268 | #define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT) | ||
269 | #define GPIO53_MMCCLK_MD (53 | GPIO_ALT_FN_1_OUT) | ||
270 | #define GPIO53_CIF_MCLK_MD (53 | GPIO_ALT_FN_2_OUT) | ||
271 | #define GPIO54_MMCCLK_MD (54 | GPIO_ALT_FN_1_OUT) | ||
272 | #define GPIO54_nPCE_2_MD (54 | GPIO_ALT_FN_2_OUT) | ||
273 | #define GPIO54_pSKTSEL_MD (54 | GPIO_ALT_FN_2_OUT) | ||
274 | #define GPIO54_CIF_PCLK_MD (54 | GPIO_ALT_FN_3_IN) | ||
275 | #define GPIO55_nPREG_MD (55 | GPIO_ALT_FN_2_OUT) | ||
276 | #define GPIO55_CIF_DD_1_MD (55 | GPIO_ALT_FN_1_IN) | ||
277 | #define GPIO56_nPWAIT_MD (56 | GPIO_ALT_FN_1_IN) | ||
278 | #define GPIO57_nIOIS16_MD (57 | GPIO_ALT_FN_1_IN) | ||
279 | #define GPIO58_LDD_0_MD (58 | GPIO_ALT_FN_2_OUT) | ||
280 | #define GPIO59_LDD_1_MD (59 | GPIO_ALT_FN_2_OUT) | ||
281 | #define GPIO60_LDD_2_MD (60 | GPIO_ALT_FN_2_OUT) | ||
282 | #define GPIO61_LDD_3_MD (61 | GPIO_ALT_FN_2_OUT) | ||
283 | #define GPIO62_LDD_4_MD (62 | GPIO_ALT_FN_2_OUT) | ||
284 | #define GPIO63_LDD_5_MD (63 | GPIO_ALT_FN_2_OUT) | ||
285 | #define GPIO64_LDD_6_MD (64 | GPIO_ALT_FN_2_OUT) | ||
286 | #define GPIO65_LDD_7_MD (65 | GPIO_ALT_FN_2_OUT) | ||
287 | #define GPIO66_LDD_8_MD (66 | GPIO_ALT_FN_2_OUT) | ||
288 | #define GPIO66_MBREQ_MD (66 | GPIO_ALT_FN_1_IN) | ||
289 | #define GPIO67_LDD_9_MD (67 | GPIO_ALT_FN_2_OUT) | ||
290 | #define GPIO67_MMCCS0_MD (67 | GPIO_ALT_FN_1_OUT) | ||
291 | #define GPIO68_LDD_10_MD (68 | GPIO_ALT_FN_2_OUT) | ||
292 | #define GPIO68_MMCCS1_MD (68 | GPIO_ALT_FN_1_OUT) | ||
293 | #define GPIO69_LDD_11_MD (69 | GPIO_ALT_FN_2_OUT) | ||
294 | #define GPIO69_MMCCLK_MD (69 | GPIO_ALT_FN_1_OUT) | ||
295 | #define GPIO70_LDD_12_MD (70 | GPIO_ALT_FN_2_OUT) | ||
296 | #define GPIO70_RTCCLK_MD (70 | GPIO_ALT_FN_1_OUT) | ||
297 | #define GPIO71_LDD_13_MD (71 | GPIO_ALT_FN_2_OUT) | ||
298 | #define GPIO71_3_6MHz_MD (71 | GPIO_ALT_FN_1_OUT) | ||
299 | #define GPIO72_LDD_14_MD (72 | GPIO_ALT_FN_2_OUT) | ||
300 | #define GPIO72_32kHz_MD (72 | GPIO_ALT_FN_1_OUT) | ||
301 | #define GPIO73_LDD_15_MD (73 | GPIO_ALT_FN_2_OUT) | ||
302 | #define GPIO73_MBGNT_MD (73 | GPIO_ALT_FN_1_OUT) | ||
303 | #define GPIO74_LCD_FCLK_MD (74 | GPIO_ALT_FN_2_OUT) | ||
304 | #define GPIO75_LCD_LCLK_MD (75 | GPIO_ALT_FN_2_OUT) | ||
305 | #define GPIO76_LCD_PCLK_MD (76 | GPIO_ALT_FN_2_OUT) | ||
306 | #define GPIO77_LCD_ACBIAS_MD (77 | GPIO_ALT_FN_2_OUT) | ||
307 | #define GPIO78_nCS_2_MD (78 | GPIO_ALT_FN_2_OUT) | ||
308 | #define GPIO78_nPCE_2_MD (78 | GPIO_ALT_FN_1_OUT) | ||
309 | #define GPIO79_nCS_3_MD (79 | GPIO_ALT_FN_2_OUT) | ||
310 | #define GPIO79_pSKTSEL_MD (79 | GPIO_ALT_FN_1_OUT) | ||
311 | #define GPIO80_nCS_4_MD (80 | GPIO_ALT_FN_2_OUT) | ||
312 | #define GPIO81_NSSP_CLK_OUT (81 | GPIO_ALT_FN_1_OUT) | ||
313 | #define GPIO81_NSSP_CLK_IN (81 | GPIO_ALT_FN_1_IN) | ||
314 | #define GPIO81_CIF_DD_0_MD (81 | GPIO_ALT_FN_2_IN) | ||
315 | #define GPIO82_NSSP_FRM_OUT (82 | GPIO_ALT_FN_1_OUT) | ||
316 | #define GPIO82_NSSP_FRM_IN (82 | GPIO_ALT_FN_1_IN) | ||
317 | #define GPIO82_CIF_DD_5_MD (82 | GPIO_ALT_FN_3_IN) | ||
318 | #define GPIO83_NSSP_TX (83 | GPIO_ALT_FN_1_OUT) | ||
319 | #define GPIO83_NSSP_RX (83 | GPIO_ALT_FN_2_IN) | ||
320 | #define GPIO83_CIF_DD_4_MD (83 | GPIO_ALT_FN_3_IN) | ||
321 | #define GPIO84_NSSP_TX (84 | GPIO_ALT_FN_1_OUT) | ||
322 | #define GPIO84_NSSP_RX (84 | GPIO_ALT_FN_2_IN) | ||
323 | #define GPIO84_CIF_FV_MD (84 | GPIO_ALT_FN_3_IN) | ||
324 | #define GPIO85_nPCE_1_MD (85 | GPIO_ALT_FN_1_OUT) | ||
325 | #define GPIO85_CIF_LV_MD (85 | GPIO_ALT_FN_3_IN) | ||
326 | #define GPIO86_nPCE_1_MD (86 | GPIO_ALT_FN_1_OUT) | ||
327 | #define GPIO88_USBH1_PWR_MD (88 | GPIO_ALT_FN_1_IN) | ||
328 | #define GPIO89_USBH1_PEN_MD (89 | GPIO_ALT_FN_2_OUT) | ||
329 | #define GPIO90_CIF_DD_4_MD (90 | GPIO_ALT_FN_3_IN) | ||
330 | #define GPIO91_CIF_DD_5_MD (91 | GPIO_ALT_FN_3_IN) | ||
331 | #define GPIO92_MMCDAT0_MD (92 | GPIO_ALT_FN_1_OUT) | ||
332 | #define GPIO93_CIF_DD_6_MD (93 | GPIO_ALT_FN_2_IN) | ||
333 | #define GPIO94_CIF_DD_5_MD (94 | GPIO_ALT_FN_2_IN) | ||
334 | #define GPIO95_CIF_DD_4_MD (95 | GPIO_ALT_FN_2_IN) | ||
335 | #define GPIO95_KP_MKIN6_MD (95 | GPIO_ALT_FN_3_IN) | ||
336 | #define GPIO96_KP_DKIN3_MD (96 | GPIO_ALT_FN_1_IN) | ||
337 | #define GPIO96_FFRXD_MD (96 | GPIO_ALT_FN_3_IN) | ||
338 | #define GPIO97_KP_MKIN3_MD (97 | GPIO_ALT_FN_3_IN) | ||
339 | #define GPIO98_CIF_DD_0_MD (98 | GPIO_ALT_FN_2_IN) | ||
340 | #define GPIO98_FFRTS_MD (98 | GPIO_ALT_FN_3_OUT) | ||
341 | #define GPIO99_FFTXD_MD (99 | GPIO_ALT_FN_3_OUT) | ||
342 | #define GPIO100_KP_MKIN0_MD (100 | GPIO_ALT_FN_1_IN) | ||
343 | #define GPIO101_KP_MKIN1_MD (101 | GPIO_ALT_FN_1_IN) | ||
344 | #define GPIO102_nPCE_1_MD (102 | GPIO_ALT_FN_1_OUT) | ||
345 | #define GPIO102_KP_MKIN2_MD (102 | GPIO_ALT_FN_1_IN) | ||
346 | #define GPIO103_CIF_DD_3_MD (103 | GPIO_ALT_FN_1_IN) | ||
347 | #define GPIO103_KP_MKOUT0_MD (103 | GPIO_ALT_FN_2_OUT) | ||
348 | #define GPIO104_CIF_DD_2_MD (104 | GPIO_ALT_FN_1_IN) | ||
349 | #define GPIO104_pSKTSEL_MD (104 | GPIO_ALT_FN_1_OUT) | ||
350 | #define GPIO104_KP_MKOUT1_MD (104 | GPIO_ALT_FN_2_OUT) | ||
351 | #define GPIO105_CIF_DD_1_MD (105 | GPIO_ALT_FN_1_IN) | ||
352 | #define GPIO105_KP_MKOUT2_MD (105 | GPIO_ALT_FN_2_OUT) | ||
353 | #define GPIO106_CIF_DD_9_MD (106 | GPIO_ALT_FN_1_IN) | ||
354 | #define GPIO106_KP_MKOUT3_MD (106 | GPIO_ALT_FN_2_OUT) | ||
355 | #define GPIO107_CIF_DD_8_MD (107 | GPIO_ALT_FN_1_IN) | ||
356 | #define GPIO107_KP_MKOUT4_MD (107 | GPIO_ALT_FN_2_OUT) | ||
357 | #define GPIO108_CIF_DD_7_MD (108 | GPIO_ALT_FN_1_IN) | ||
358 | #define GPIO108_KP_MKOUT5_MD (108 | GPIO_ALT_FN_2_OUT) | ||
359 | #define GPIO109_MMCDAT1_MD (109 | GPIO_ALT_FN_1_OUT) | ||
360 | #define GPIO110_MMCDAT2_MD (110 | GPIO_ALT_FN_1_OUT) | ||
361 | #define GPIO110_MMCCS0_MD (110 | GPIO_ALT_FN_1_OUT) | ||
362 | #define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT) | ||
363 | #define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT) | ||
364 | #define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT) | ||
365 | #define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT) | ||
366 | #define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT) | ||
367 | #define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_IN) | ||
368 | #define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN) | ||
369 | |||
370 | /* | ||
371 | * Handy routine to set GPIO alternate functions | ||
372 | */ | ||
373 | extern int pxa_gpio_mode( int gpio_mode ); | ||
374 | |||
375 | #endif /* __ASM_ARCH_PXA2XX_GPIO_H */ | ||
diff --git a/arch/arm/mach-pxa/include/mach/ssp.h b/arch/arm/mach-pxa/include/mach/ssp.h deleted file mode 100644 index be1be5b6db51..000000000000 --- a/arch/arm/mach-pxa/include/mach/ssp.h +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | /* | ||
2 | * ssp.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Russell King, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This driver supports the following PXA CPU/SSP ports:- | ||
11 | * | ||
12 | * PXA250 SSP | ||
13 | * PXA255 SSP, NSSP | ||
14 | * PXA26x SSP, NSSP, ASSP | ||
15 | * PXA27x SSP1, SSP2, SSP3 | ||
16 | * PXA3xx SSP1, SSP2, SSP3, SSP4 | ||
17 | */ | ||
18 | |||
19 | #ifndef __ASM_ARCH_SSP_H | ||
20 | #define __ASM_ARCH_SSP_H | ||
21 | |||
22 | #include <linux/list.h> | ||
23 | #include <linux/io.h> | ||
24 | |||
25 | enum pxa_ssp_type { | ||
26 | SSP_UNDEFINED = 0, | ||
27 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | ||
28 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | ||
29 | PXA27x_SSP, | ||
30 | }; | ||
31 | |||
32 | struct ssp_device { | ||
33 | struct platform_device *pdev; | ||
34 | struct list_head node; | ||
35 | |||
36 | struct clk *clk; | ||
37 | void __iomem *mmio_base; | ||
38 | unsigned long phys_base; | ||
39 | |||
40 | const char *label; | ||
41 | int port_id; | ||
42 | int type; | ||
43 | int use_count; | ||
44 | int irq; | ||
45 | int drcmr_rx; | ||
46 | int drcmr_tx; | ||
47 | }; | ||
48 | |||
49 | #ifdef CONFIG_PXA_SSP_LEGACY | ||
50 | /* | ||
51 | * SSP initialisation flags | ||
52 | */ | ||
53 | #define SSP_NO_IRQ 0x1 /* don't register an irq handler in SSP driver */ | ||
54 | |||
55 | struct ssp_state { | ||
56 | u32 cr0; | ||
57 | u32 cr1; | ||
58 | u32 to; | ||
59 | u32 psp; | ||
60 | }; | ||
61 | |||
62 | struct ssp_dev { | ||
63 | struct ssp_device *ssp; | ||
64 | u32 port; | ||
65 | u32 mode; | ||
66 | u32 flags; | ||
67 | u32 psp_flags; | ||
68 | u32 speed; | ||
69 | int irq; | ||
70 | }; | ||
71 | |||
72 | int ssp_write_word(struct ssp_dev *dev, u32 data); | ||
73 | int ssp_read_word(struct ssp_dev *dev, u32 *data); | ||
74 | int ssp_flush(struct ssp_dev *dev); | ||
75 | void ssp_enable(struct ssp_dev *dev); | ||
76 | void ssp_disable(struct ssp_dev *dev); | ||
77 | void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp); | ||
78 | void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp); | ||
79 | int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags); | ||
80 | int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); | ||
81 | void ssp_exit(struct ssp_dev *dev); | ||
82 | #endif /* CONFIG_PXA_SSP_LEGACY */ | ||
83 | |||
84 | /** | ||
85 | * ssp_write_reg - Write to a SSP register | ||
86 | * | ||
87 | * @dev: SSP device to access | ||
88 | * @reg: Register to write to | ||
89 | * @val: Value to be written. | ||
90 | */ | ||
91 | static inline void ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val) | ||
92 | { | ||
93 | __raw_writel(val, dev->mmio_base + reg); | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * ssp_read_reg - Read from a SSP register | ||
98 | * | ||
99 | * @dev: SSP device to access | ||
100 | * @reg: Register to read from | ||
101 | */ | ||
102 | static inline u32 ssp_read_reg(struct ssp_device *dev, u32 reg) | ||
103 | { | ||
104 | return __raw_readl(dev->mmio_base + reg); | ||
105 | } | ||
106 | |||
107 | struct ssp_device *ssp_request(int port, const char *label); | ||
108 | void ssp_free(struct ssp_device *); | ||
109 | #endif /* __ASM_ARCH_SSP_H */ | ||
diff --git a/arch/arm/mach-pxa/include/mach/tosa.h b/arch/arm/mach-pxa/include/mach/tosa.h index 4df2d38507dc..1bbd1f2e4beb 100644 --- a/arch/arm/mach-pxa/include/mach/tosa.h +++ b/arch/arm/mach-pxa/include/mach/tosa.h | |||
@@ -167,7 +167,7 @@ | |||
167 | 167 | ||
168 | #define TOSA_KEY_SYNC KEY_102ND /* ??? */ | 168 | #define TOSA_KEY_SYNC KEY_102ND /* ??? */ |
169 | 169 | ||
170 | #ifndef CONFIG_KEYBOARD_TOSA_USE_EXT_KEYCODES | 170 | #ifndef CONFIG_TOSA_USE_EXT_KEYCODES |
171 | #define TOSA_KEY_RECORD KEY_YEN | 171 | #define TOSA_KEY_RECORD KEY_YEN |
172 | #define TOSA_KEY_ADDRESSBOOK KEY_KATAKANA | 172 | #define TOSA_KEY_ADDRESSBOOK KEY_KATAKANA |
173 | #define TOSA_KEY_CANCEL KEY_ESC | 173 | #define TOSA_KEY_CANCEL KEY_ESC |
diff --git a/arch/arm/mach-pxa/include/mach/vpac270.h b/arch/arm/mach-pxa/include/mach/vpac270.h new file mode 100644 index 000000000000..7bfa3dd0fd5e --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/vpac270.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * GPIOs and interrupts for Voipac PXA270 | ||
3 | * | ||
4 | * Copyright (C) 2010 | ||
5 | * Marek Vasut <marek.vasut@gmail.com> | ||
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 | #ifndef _INCLUDE_VPAC270_H_ | ||
14 | #define _INCLUDE_VPAC270_H_ | ||
15 | |||
16 | #define GPIO1_VPAC270_USER_BTN 1 | ||
17 | |||
18 | #define GPIO15_VPAC270_LED_ORANGE 15 | ||
19 | |||
20 | #define GPIO81_VPAC270_BKL_ON 81 | ||
21 | #define GPIO83_VPAC270_NL_ON 83 | ||
22 | |||
23 | #define GPIO52_VPAC270_SD_READONLY 52 | ||
24 | #define GPIO53_VPAC270_SD_DETECT_N 53 | ||
25 | |||
26 | #define GPIO84_VPAC270_PCMCIA_CD 84 | ||
27 | #define GPIO35_VPAC270_PCMCIA_RDY 35 | ||
28 | #define GPIO107_VPAC270_PCMCIA_PPEN 107 | ||
29 | #define GPIO11_VPAC270_PCMCIA_RESET 11 | ||
30 | #define GPIO17_VPAC270_CF_CD 17 | ||
31 | #define GPIO12_VPAC270_CF_RDY 12 | ||
32 | #define GPIO16_VPAC270_CF_RESET 16 | ||
33 | |||
34 | #define GPIO41_VPAC270_UDC_DETECT 41 | ||
35 | |||
36 | #define GPIO114_VPAC270_ETH_IRQ 114 | ||
37 | |||
38 | #define GPIO36_VPAC270_IDE_IRQ 36 | ||
39 | |||
40 | #define GPIO113_VPAC270_TS_IRQ 113 | ||
41 | |||
42 | #endif | ||
diff --git a/arch/arm/mach-pxa/include/mach/z2.h b/arch/arm/mach-pxa/include/mach/z2.h new file mode 100644 index 000000000000..8835c16bc82f --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/z2.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pxa/include/mach/z2.h | ||
3 | * | ||
4 | * Author: Ken McGuire | ||
5 | * Created: Feb 6, 2009 | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef ASM_ARCH_ZIPIT2_H | ||
13 | #define ASM_ARCH_ZIPIT2_H | ||
14 | |||
15 | /* LEDs */ | ||
16 | #define GPIO10_ZIPITZ2_LED_WIFI 10 | ||
17 | #define GPIO85_ZIPITZ2_LED_CHARGED 85 | ||
18 | #define GPIO83_ZIPITZ2_LED_CHARGING 83 | ||
19 | |||
20 | /* SD/MMC */ | ||
21 | #define GPIO96_ZIPITZ2_SD_DETECT 96 | ||
22 | |||
23 | /* GPIO Buttons */ | ||
24 | #define GPIO1_ZIPITZ2_POWER_BUTTON 1 | ||
25 | #define GPIO98_ZIPITZ2_LID_BUTTON 98 | ||
26 | |||
27 | /* Libertas GSPI8686 WiFi */ | ||
28 | #define GPIO14_ZIPITZ2_WIFI_RESET 14 | ||
29 | #define GPIO15_ZIPITZ2_WIFI_POWER 15 | ||
30 | #define GPIO24_ZIPITZ2_WIFI_CS 24 | ||
31 | #define GPIO36_ZIPITZ2_WIFI_IRQ 36 | ||
32 | |||
33 | /* LCD */ | ||
34 | #define GPIO19_ZIPITZ2_LCD_RESET 19 | ||
35 | #define GPIO88_ZIPITZ2_LCD_CS 88 | ||
36 | |||
37 | /* MISC GPIOs */ | ||
38 | #define GPIO0_ZIPITZ2_AC_DETECT 0 | ||
39 | #define GPIO37_ZIPITZ2_HEADSET_DETECT 37 | ||
40 | |||
41 | #endif | ||
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index fa527b258d61..9b9046185b00 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c | |||
@@ -41,7 +41,6 @@ | |||
41 | 41 | ||
42 | #include <mach/pxa300.h> | 42 | #include <mach/pxa300.h> |
43 | #include <mach/pxafb.h> | 43 | #include <mach/pxafb.h> |
44 | #include <mach/ssp.h> | ||
45 | #include <mach/mmc.h> | 44 | #include <mach/mmc.h> |
46 | #include <mach/pxa2xx_spi.h> | 45 | #include <mach/pxa2xx_spi.h> |
47 | #include <mach/pxa27x_keypad.h> | 46 | #include <mach/pxa27x_keypad.h> |
@@ -272,7 +271,7 @@ static inline void littleton_init_keypad(void) {} | |||
272 | 271 | ||
273 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 272 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
274 | static struct pxamci_platform_data littleton_mci_platform_data = { | 273 | static struct pxamci_platform_data littleton_mci_platform_data = { |
275 | .detect_delay = 20, | 274 | .detect_delay_ms = 200, |
276 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 275 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
277 | .gpio_card_detect = GPIO_MMC1_CARD_DETECT, | 276 | .gpio_card_detect = GPIO_MMC1_CARD_DETECT, |
278 | .gpio_card_ro = -1, | 277 | .gpio_card_ro = -1, |
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 63d65a2a0387..330c3282856e 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -478,7 +478,7 @@ static void lubbock_mci_exit(struct device *dev, void *data) | |||
478 | 478 | ||
479 | static struct pxamci_platform_data lubbock_mci_platform_data = { | 479 | static struct pxamci_platform_data lubbock_mci_platform_data = { |
480 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 480 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
481 | .detect_delay = 1, | 481 | .detect_delay_ms = 10, |
482 | .init = lubbock_mci_init, | 482 | .init = lubbock_mci_init, |
483 | .get_ro = lubbock_mci_get_ro, | 483 | .get_ro = lubbock_mci_get_ro, |
484 | .exit = lubbock_mci_exit, | 484 | .exit = lubbock_mci_exit, |
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c index cf6b720c055f..1d1419b73457 100644 --- a/arch/arm/mach-pxa/mfp-pxa2xx.c +++ b/arch/arm/mach-pxa/mfp-pxa2xx.c | |||
@@ -81,6 +81,7 @@ static int __mfp_config_gpio(unsigned gpio, unsigned long c) | |||
81 | PGSR(bank) &= ~mask; | 81 | PGSR(bank) &= ~mask; |
82 | is_out = 1; | 82 | is_out = 1; |
83 | break; | 83 | break; |
84 | case MFP_LPM_INPUT: | ||
84 | case MFP_LPM_DEFAULT: | 85 | case MFP_LPM_DEFAULT: |
85 | break; | 86 | break; |
86 | default: | 87 | default: |
@@ -178,8 +179,17 @@ int gpio_set_wake(unsigned int gpio, unsigned int on) | |||
178 | if (!d->valid) | 179 | if (!d->valid) |
179 | return -EINVAL; | 180 | return -EINVAL; |
180 | 181 | ||
181 | if (d->keypad_gpio) | 182 | /* Allow keypad GPIOs to wakeup system when |
182 | return -EINVAL; | 183 | * configured as generic GPIOs. |
184 | */ | ||
185 | if (d->keypad_gpio && (MFP_AF(d->config) == 0) && | ||
186 | (d->config & MFP_LPM_CAN_WAKEUP)) { | ||
187 | if (on) | ||
188 | PKWR |= d->mask; | ||
189 | else | ||
190 | PKWR &= ~d->mask; | ||
191 | return 0; | ||
192 | } | ||
183 | 193 | ||
184 | mux_taken = (PWER & d->mux_mask) & (~d->mask); | 194 | mux_taken = (PWER & d->mux_mask) & (~d->mask); |
185 | if (on && mux_taken) | 195 | if (on && mux_taken) |
@@ -239,21 +249,25 @@ static int pxa27x_pkwr_gpio[] = { | |||
239 | int keypad_set_wake(unsigned int on) | 249 | int keypad_set_wake(unsigned int on) |
240 | { | 250 | { |
241 | unsigned int i, gpio, mask = 0; | 251 | unsigned int i, gpio, mask = 0; |
242 | 252 | struct gpio_desc *d; | |
243 | if (!on) { | ||
244 | PKWR = 0; | ||
245 | return 0; | ||
246 | } | ||
247 | 253 | ||
248 | for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) { | 254 | for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) { |
249 | 255 | ||
250 | gpio = pxa27x_pkwr_gpio[i]; | 256 | gpio = pxa27x_pkwr_gpio[i]; |
257 | d = &gpio_desc[gpio]; | ||
251 | 258 | ||
252 | if (gpio_desc[gpio].config & MFP_LPM_CAN_WAKEUP) | 259 | /* skip if configured as generic GPIO */ |
260 | if (MFP_AF(d->config) == 0) | ||
261 | continue; | ||
262 | |||
263 | if (d->config & MFP_LPM_CAN_WAKEUP) | ||
253 | mask |= gpio_desc[gpio].mask; | 264 | mask |= gpio_desc[gpio].mask; |
254 | } | 265 | } |
255 | 266 | ||
256 | PKWR = mask; | 267 | if (on) |
268 | PKWR |= mask; | ||
269 | else | ||
270 | PKWR &= ~mask; | ||
257 | return 0; | 271 | return 0; |
258 | } | 272 | } |
259 | 273 | ||
@@ -328,6 +342,17 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state) | |||
328 | { | 342 | { |
329 | int i; | 343 | int i; |
330 | 344 | ||
345 | /* set corresponding PGSR bit of those marked MFP_LPM_KEEP_OUTPUT */ | ||
346 | for (i = 0; i < pxa_last_gpio; i++) { | ||
347 | if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) && | ||
348 | (GPDR(i) & GPIO_bit(i))) { | ||
349 | if (GPLR(i) & GPIO_bit(i)) | ||
350 | PGSR(i) |= GPIO_bit(i); | ||
351 | else | ||
352 | PGSR(i) &= ~GPIO_bit(i); | ||
353 | } | ||
354 | } | ||
355 | |||
331 | for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) { | 356 | for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) { |
332 | 357 | ||
333 | saved_gafr[0][i] = GAFR_L(i); | 358 | saved_gafr[0][i] = GAFR_L(i); |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 7a50ed8fce94..d60db87dde08 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -426,6 +426,7 @@ struct gpio_vbus_mach_info gpio_vbus_data = { | |||
426 | * to give the card a chance to fully insert/eject. | 426 | * to give the card a chance to fully insert/eject. |
427 | */ | 427 | */ |
428 | static struct pxamci_platform_data mioa701_mci_info = { | 428 | static struct pxamci_platform_data mioa701_mci_info = { |
429 | .detect_delay_ms = 250, | ||
429 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 430 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
430 | .gpio_card_detect = GPIO15_SDIO_INSERT, | 431 | .gpio_card_detect = GPIO15_SDIO_INSERT, |
431 | .gpio_card_ro = GPIO78_SDIO_RO, | 432 | .gpio_card_ro = GPIO78_SDIO_RO, |
@@ -791,7 +792,6 @@ static void __init mioa701_machine_init(void) | |||
791 | mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); | 792 | mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); |
792 | bootstrap_init(); | 793 | bootstrap_init(); |
793 | set_pxa_fb_info(&mioa701_pxafb_info); | 794 | set_pxa_fb_info(&mioa701_pxafb_info); |
794 | mioa701_mci_info.detect_delay = msecs_to_jiffies(250); | ||
795 | pxa_set_mci_info(&mioa701_mci_info); | 795 | pxa_set_mci_info(&mioa701_mci_info); |
796 | pxa_set_keypad_info(&mioa701_keypad_info); | 796 | pxa_set_keypad_info(&mioa701_keypad_info); |
797 | wm97xx_bat_set_pdata(&mioa701_battery_data); | 797 | wm97xx_bat_set_pdata(&mioa701_battery_data); |
diff --git a/arch/arm/mach-pxa/mxm8x10.c b/arch/arm/mach-pxa/mxm8x10.c index 8c9c6f0d56bb..462167ac05f9 100644 --- a/arch/arm/mach-pxa/mxm8x10.c +++ b/arch/arm/mach-pxa/mxm8x10.c | |||
@@ -325,7 +325,7 @@ static mfp_cfg_t mfp_cfg[] __initdata = { | |||
325 | #if defined(CONFIG_MMC) | 325 | #if defined(CONFIG_MMC) |
326 | static struct pxamci_platform_data mxm_8x10_mci_platform_data = { | 326 | static struct pxamci_platform_data mxm_8x10_mci_platform_data = { |
327 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 327 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
328 | .detect_delay = 1, | 328 | .detect_delay_ms = 10, |
329 | .gpio_card_detect = MXM_8X10_SD_nCD, | 329 | .gpio_card_detect = MXM_8X10_SD_nCD, |
330 | .gpio_card_ro = MXM_8X10_SD_WP, | 330 | .gpio_card_ro = MXM_8X10_SD_WP, |
331 | .gpio_power = -1 | 331 | .gpio_power = -1 |
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index f70c75b38769..1963819dba98 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c | |||
@@ -168,7 +168,7 @@ static struct pxamci_platform_data palmld_mci_platform_data = { | |||
168 | .gpio_card_detect = GPIO_NR_PALMLD_SD_DETECT_N, | 168 | .gpio_card_detect = GPIO_NR_PALMLD_SD_DETECT_N, |
169 | .gpio_card_ro = GPIO_NR_PALMLD_SD_READONLY, | 169 | .gpio_card_ro = GPIO_NR_PALMLD_SD_READONLY, |
170 | .gpio_power = GPIO_NR_PALMLD_SD_POWER, | 170 | .gpio_power = GPIO_NR_PALMLD_SD_POWER, |
171 | .detect_delay = 20, | 171 | .detect_delay_ms = 200, |
172 | }; | 172 | }; |
173 | 173 | ||
174 | /****************************************************************************** | 174 | /****************************************************************************** |
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index d902a813aae3..5305a3993e69 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c | |||
@@ -110,7 +110,7 @@ static struct pxamci_platform_data palmt5_mci_platform_data = { | |||
110 | .gpio_card_detect = GPIO_NR_PALMT5_SD_DETECT_N, | 110 | .gpio_card_detect = GPIO_NR_PALMT5_SD_DETECT_N, |
111 | .gpio_card_ro = GPIO_NR_PALMT5_SD_READONLY, | 111 | .gpio_card_ro = GPIO_NR_PALMT5_SD_READONLY, |
112 | .gpio_power = GPIO_NR_PALMT5_SD_POWER, | 112 | .gpio_power = GPIO_NR_PALMT5_SD_POWER, |
113 | .detect_delay = 20, | 113 | .detect_delay_ms = 200, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | /****************************************************************************** | 116 | /****************************************************************************** |
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c index 717d7a638675..033b567e50bb 100644 --- a/arch/arm/mach-pxa/palmtc.c +++ b/arch/arm/mach-pxa/palmtc.c | |||
@@ -121,7 +121,7 @@ static struct pxamci_platform_data palmtc_mci_platform_data = { | |||
121 | .gpio_power = GPIO_NR_PALMTC_SD_POWER, | 121 | .gpio_power = GPIO_NR_PALMTC_SD_POWER, |
122 | .gpio_card_ro = GPIO_NR_PALMTC_SD_READONLY, | 122 | .gpio_card_ro = GPIO_NR_PALMTC_SD_READONLY, |
123 | .gpio_card_detect = GPIO_NR_PALMTC_SD_DETECT_N, | 123 | .gpio_card_detect = GPIO_NR_PALMTC_SD_DETECT_N, |
124 | .detect_delay = 20, | 124 | .detect_delay_ms = 200, |
125 | }; | 125 | }; |
126 | 126 | ||
127 | /****************************************************************************** | 127 | /****************************************************************************** |
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index 007b58c11f8d..ecc1a401598e 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c | |||
@@ -170,7 +170,7 @@ static struct pxamci_platform_data palmtx_mci_platform_data = { | |||
170 | .gpio_card_detect = GPIO_NR_PALMTX_SD_DETECT_N, | 170 | .gpio_card_detect = GPIO_NR_PALMTX_SD_DETECT_N, |
171 | .gpio_card_ro = GPIO_NR_PALMTX_SD_READONLY, | 171 | .gpio_card_ro = GPIO_NR_PALMTX_SD_READONLY, |
172 | .gpio_power = GPIO_NR_PALMTX_SD_POWER, | 172 | .gpio_power = GPIO_NR_PALMTX_SD_POWER, |
173 | .detect_delay = 20, | 173 | .detect_delay_ms = 200, |
174 | }; | 174 | }; |
175 | 175 | ||
176 | /****************************************************************************** | 176 | /****************************************************************************** |
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index 9d0ecea1760c..f56ae1008759 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c | |||
@@ -326,7 +326,7 @@ static void pcm990_mci_exit(struct device *dev, void *data) | |||
326 | #define MSECS_PER_JIFFY (1000/HZ) | 326 | #define MSECS_PER_JIFFY (1000/HZ) |
327 | 327 | ||
328 | static struct pxamci_platform_data pcm990_mci_platform_data = { | 328 | static struct pxamci_platform_data pcm990_mci_platform_data = { |
329 | .detect_delay = 250 / MSECS_PER_JIFFY, | 329 | .detect_delay_ms = 250, |
330 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 330 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
331 | .init = pcm990_mci_init, | 331 | .init = pcm990_mci_init, |
332 | .setpower = pcm990_mci_setpower, | 332 | .setpower = pcm990_mci_setpower, |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index d58a52415d75..f4abdaafdac4 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -40,13 +40,12 @@ | |||
40 | #include <mach/pxa25x.h> | 40 | #include <mach/pxa25x.h> |
41 | #include <mach/mmc.h> | 41 | #include <mach/mmc.h> |
42 | #include <mach/udc.h> | 42 | #include <mach/udc.h> |
43 | #include <plat/i2c.h> | ||
44 | #include <mach/irda.h> | 43 | #include <mach/irda.h> |
45 | #include <mach/poodle.h> | 44 | #include <mach/poodle.h> |
46 | #include <mach/pxafb.h> | 45 | #include <mach/pxafb.h> |
47 | #include <mach/sharpsl.h> | 46 | #include <mach/sharpsl.h> |
48 | #include <mach/ssp.h> | ||
49 | #include <mach/pxa2xx_spi.h> | 47 | #include <mach/pxa2xx_spi.h> |
48 | #include <plat/i2c.h> | ||
50 | 49 | ||
51 | #include <asm/hardware/scoop.h> | 50 | #include <asm/hardware/scoop.h> |
52 | #include <asm/hardware/locomo.h> | 51 | #include <asm/hardware/locomo.h> |
@@ -277,6 +276,7 @@ static void poodle_mci_exit(struct device *dev, void *data) | |||
277 | } | 276 | } |
278 | 277 | ||
279 | static struct pxamci_platform_data poodle_mci_platform_data = { | 278 | static struct pxamci_platform_data poodle_mci_platform_data = { |
279 | .detect_delay_ms = 250, | ||
280 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 280 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
281 | .init = poodle_mci_init, | 281 | .init = poodle_mci_init, |
282 | .setpower = poodle_mci_setpower, | 282 | .setpower = poodle_mci_setpower, |
@@ -450,7 +450,6 @@ static void __init poodle_init(void) | |||
450 | set_pxa_fb_parent(&poodle_locomo_device.dev); | 450 | set_pxa_fb_parent(&poodle_locomo_device.dev); |
451 | set_pxa_fb_info(&poodle_fb_info); | 451 | set_pxa_fb_info(&poodle_fb_info); |
452 | pxa_set_udc_info(&udc_info); | 452 | pxa_set_udc_info(&udc_info); |
453 | poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250); | ||
454 | pxa_set_mci_info(&poodle_mci_platform_data); | 453 | pxa_set_mci_info(&poodle_mci_platform_data); |
455 | pxa_set_ficp_info(&poodle_ficp_platform_data); | 454 | pxa_set_ficp_info(&poodle_ficp_platform_data); |
456 | pxa_set_i2c_info(NULL); | 455 | pxa_set_i2c_info(NULL); |
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 4d7c03e72504..f544e58e1536 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <mach/ohci.h> | 29 | #include <mach/ohci.h> |
30 | #include <mach/pm.h> | 30 | #include <mach/pm.h> |
31 | #include <mach/dma.h> | 31 | #include <mach/dma.h> |
32 | #include <mach/ssp.h> | ||
33 | #include <mach/regs-intc.h> | 32 | #include <mach/regs-intc.h> |
34 | #include <plat/i2c.h> | 33 | #include <plat/i2c.h> |
35 | 34 | ||
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index d12667bd9ebe..d4b61b3f08f3 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c | |||
@@ -714,7 +714,7 @@ static void raumfeld_mci_exit(struct device *dev, void *data) | |||
714 | static struct pxamci_platform_data raumfeld_mci_platform_data = { | 714 | static struct pxamci_platform_data raumfeld_mci_platform_data = { |
715 | .init = raumfeld_mci_init, | 715 | .init = raumfeld_mci_init, |
716 | .exit = raumfeld_mci_exit, | 716 | .exit = raumfeld_mci_exit, |
717 | .detect_delay = 20, | 717 | .detect_delay_ms = 200, |
718 | .gpio_card_detect = -1, | 718 | .gpio_card_detect = -1, |
719 | .gpio_card_ro = -1, | 719 | .gpio_card_ro = -1, |
720 | .gpio_power = -1, | 720 | .gpio_power = -1, |
diff --git a/arch/arm/mach-pxa/sharpsl.h b/arch/arm/mach-pxa/sharpsl.h index 1439785d3979..0cc1203c5bef 100644 --- a/arch/arm/mach-pxa/sharpsl.h +++ b/arch/arm/mach-pxa/sharpsl.h | |||
@@ -10,29 +10,6 @@ | |||
10 | #include <mach/sharpsl_pm.h> | 10 | #include <mach/sharpsl_pm.h> |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * SharpSL SSP Driver | ||
14 | */ | ||
15 | struct corgissp_machinfo { | ||
16 | int port; | ||
17 | int cs_lcdcon; | ||
18 | int cs_ads7846; | ||
19 | int cs_max1111; | ||
20 | int clk_lcdcon; | ||
21 | int clk_ads7846; | ||
22 | int clk_max1111; | ||
23 | }; | ||
24 | |||
25 | void corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo); | ||
26 | |||
27 | |||
28 | /* | ||
29 | * SharpSL/Corgi LCD Driver | ||
30 | */ | ||
31 | void corgi_lcdtg_suspend(void); | ||
32 | void corgi_lcdtg_hw_init(int mode); | ||
33 | |||
34 | |||
35 | /* | ||
36 | * SharpSL Battery/PM Driver | 13 | * SharpSL Battery/PM Driver |
37 | */ | 14 | */ |
38 | #define READ_GPIO_BIT(x) (GPLR(x) & GPIO_bit(x)) | 15 | #define READ_GPIO_BIT(x) (GPLR(x) & GPIO_bit(x)) |
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index 463d874bb867..cb4767251f3c 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
29 | #include <mach/pm.h> | 29 | #include <mach/pm.h> |
30 | #include <mach/pxa2xx-regs.h> | 30 | #include <mach/pxa2xx-regs.h> |
31 | #include <mach/pxa2xx-gpio.h> | ||
32 | #include <mach/regs-rtc.h> | 31 | #include <mach/regs-rtc.h> |
33 | #include <mach/sharpsl.h> | 32 | #include <mach/sharpsl.h> |
34 | #include <mach/sharpsl_pm.h> | 33 | #include <mach/sharpsl_pm.h> |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 01bdd7500df4..4d2413ed0ffa 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -86,6 +86,7 @@ static unsigned long spitz_pin_config[] __initdata = { | |||
86 | 86 | ||
87 | /* GPIOs */ | 87 | /* GPIOs */ |
88 | GPIO9_GPIO, /* SPITZ_GPIO_nSD_DETECT */ | 88 | GPIO9_GPIO, /* SPITZ_GPIO_nSD_DETECT */ |
89 | GPIO16_GPIO, /* SPITZ_GPIO_SYNC */ | ||
89 | GPIO81_GPIO, /* SPITZ_GPIO_nSD_WP */ | 90 | GPIO81_GPIO, /* SPITZ_GPIO_nSD_WP */ |
90 | GPIO41_GPIO, /* SPITZ_GPIO_USB_CONNECT */ | 91 | GPIO41_GPIO, /* SPITZ_GPIO_USB_CONNECT */ |
91 | GPIO37_GPIO, /* SPITZ_GPIO_USB_HOST */ | 92 | GPIO37_GPIO, /* SPITZ_GPIO_USB_HOST */ |
@@ -119,7 +120,8 @@ static unsigned long spitz_pin_config[] __initdata = { | |||
119 | GPIO117_I2C_SCL, | 120 | GPIO117_I2C_SCL, |
120 | GPIO118_I2C_SDA, | 121 | GPIO118_I2C_SDA, |
121 | 122 | ||
122 | GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, | 123 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, /* SPITZ_GPIO_KEY_INT */ |
124 | GPIO1_GPIO | WAKEUP_ON_EDGE_FALL, /* SPITZ_GPIO_RESET */ | ||
123 | }; | 125 | }; |
124 | 126 | ||
125 | /* | 127 | /* |
@@ -537,6 +539,7 @@ static void spitz_mci_setpower(struct device *dev, unsigned int vdd) | |||
537 | } | 539 | } |
538 | 540 | ||
539 | static struct pxamci_platform_data spitz_mci_platform_data = { | 541 | static struct pxamci_platform_data spitz_mci_platform_data = { |
542 | .detect_delay_ms = 250, | ||
540 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 543 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
541 | .setpower = spitz_mci_setpower, | 544 | .setpower = spitz_mci_setpower, |
542 | .gpio_card_detect = SPITZ_GPIO_nSD_DETECT, | 545 | .gpio_card_detect = SPITZ_GPIO_nSD_DETECT, |
@@ -757,7 +760,6 @@ static void __init common_init(void) | |||
757 | spitz_init_spi(); | 760 | spitz_init_spi(); |
758 | 761 | ||
759 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 762 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
760 | spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250); | ||
761 | pxa_set_mci_info(&spitz_mci_platform_data); | 763 | pxa_set_mci_info(&spitz_mci_platform_data); |
762 | pxa_set_ohci_info(&spitz_ohci_platform_data); | 764 | pxa_set_ohci_info(&spitz_ohci_platform_data); |
763 | pxa_set_ficp_info(&spitz_ficp_platform_data); | 765 | pxa_set_ficp_info(&spitz_ficp_platform_data); |
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index fc5a70c40358..4209ddf6da61 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c | |||
@@ -24,9 +24,10 @@ | |||
24 | 24 | ||
25 | #include <mach/sharpsl.h> | 25 | #include <mach/sharpsl.h> |
26 | #include <mach/spitz.h> | 26 | #include <mach/spitz.h> |
27 | #include <mach/pxa2xx-regs.h> | 27 | #include <mach/pxa27x.h> |
28 | #include <mach/pxa2xx-gpio.h> | 28 | |
29 | #include "sharpsl.h" | 29 | #include "sharpsl.h" |
30 | #include "generic.h" | ||
30 | 31 | ||
31 | #define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ | 32 | #define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ |
32 | #define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */ | 33 | #define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */ |
@@ -37,10 +38,17 @@ | |||
37 | 38 | ||
38 | static int spitz_last_ac_status; | 39 | static int spitz_last_ac_status; |
39 | 40 | ||
41 | static struct gpio spitz_charger_gpios[] = { | ||
42 | { SPITZ_GPIO_KEY_INT, GPIOF_IN, "Keyboard Interrupt" }, | ||
43 | { SPITZ_GPIO_SYNC, GPIOF_IN, "Sync" }, | ||
44 | { SPITZ_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" }, | ||
45 | { SPITZ_GPIO_JK_B, GPIOF_OUT_INIT_LOW, "JK B" }, | ||
46 | { SPITZ_GPIO_CHRG_ON, GPIOF_OUT_INIT_LOW, "Charger On" }, | ||
47 | }; | ||
48 | |||
40 | static void spitz_charger_init(void) | 49 | static void spitz_charger_init(void) |
41 | { | 50 | { |
42 | pxa_gpio_mode(SPITZ_GPIO_KEY_INT | GPIO_IN); | 51 | gpio_request_array(ARRAY_AND_SIZE(spitz_charger_gpios)); |
43 | pxa_gpio_mode(SPITZ_GPIO_SYNC | GPIO_IN); | ||
44 | } | 52 | } |
45 | 53 | ||
46 | static void spitz_measure_temp(int on) | 54 | static void spitz_measure_temp(int on) |
@@ -76,6 +84,11 @@ static void spitz_discharge1(int on) | |||
76 | gpio_set_value(SPITZ_GPIO_LED_GREEN, on); | 84 | gpio_set_value(SPITZ_GPIO_LED_GREEN, on); |
77 | } | 85 | } |
78 | 86 | ||
87 | static unsigned long gpio18_config[] = { | ||
88 | GPIO18_RDY, | ||
89 | GPIO18_GPIO, | ||
90 | }; | ||
91 | |||
79 | static void spitz_presuspend(void) | 92 | static void spitz_presuspend(void) |
80 | { | 93 | { |
81 | spitz_last_ac_status = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); | 94 | spitz_last_ac_status = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); |
@@ -97,7 +110,9 @@ static void spitz_presuspend(void) | |||
97 | PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; | 110 | PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; |
98 | PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); | 111 | PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); |
99 | 112 | ||
100 | pxa_gpio_mode(GPIO18_RDY|GPIO_OUT | GPIO_DFLT_HIGH); | 113 | pxa2xx_mfp_config(&gpio18_config[0], 1); |
114 | gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown"); | ||
115 | gpio_free(18); | ||
101 | 116 | ||
102 | PRER = GPIO_bit(SPITZ_GPIO_KEY_INT); | 117 | PRER = GPIO_bit(SPITZ_GPIO_KEY_INT); |
103 | PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); | 118 | PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); |
@@ -114,8 +129,7 @@ static void spitz_presuspend(void) | |||
114 | 129 | ||
115 | static void spitz_postsuspend(void) | 130 | static void spitz_postsuspend(void) |
116 | { | 131 | { |
117 | pxa_gpio_mode(GPIO18_RDY_MD); | 132 | pxa2xx_mfp_config(&gpio18_config[1], 1); |
118 | pxa_gpio_mode(10 | GPIO_IN); | ||
119 | } | 133 | } |
120 | 134 | ||
121 | static int spitz_should_wakeup(unsigned int resume_on_alarm) | 135 | static int spitz_should_wakeup(unsigned int resume_on_alarm) |
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c deleted file mode 100644 index a81d6dbf662d..000000000000 --- a/arch/arm/mach-pxa/ssp.c +++ /dev/null | |||
@@ -1,510 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/ssp.c | ||
3 | * | ||
4 | * based on linux/arch/arm/mach-sa1100/ssp.c by Russell King | ||
5 | * | ||
6 | * Copyright (C) 2003 Russell King. | ||
7 | * Copyright (C) 2003 Wolfson Microelectronics PLC | ||
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 | * PXA2xx SSP driver. This provides the generic core for simple | ||
14 | * IO-based SSP applications and allows easy port setup for DMA access. | ||
15 | * | ||
16 | * Author: Liam Girdwood <liam.girdwood@wolfsonmicro.com> | ||
17 | */ | ||
18 | |||
19 | #include <linux/module.h> | ||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/sched.h> | ||
22 | #include <linux/slab.h> | ||
23 | #include <linux/errno.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | #include <linux/ioport.h> | ||
26 | #include <linux/init.h> | ||
27 | #include <linux/mutex.h> | ||
28 | #include <linux/clk.h> | ||
29 | #include <linux/err.h> | ||
30 | #include <linux/platform_device.h> | ||
31 | #include <linux/io.h> | ||
32 | |||
33 | #include <asm/irq.h> | ||
34 | #include <mach/hardware.h> | ||
35 | #include <mach/ssp.h> | ||
36 | #include <mach/regs-ssp.h> | ||
37 | |||
38 | #ifdef CONFIG_PXA_SSP_LEGACY | ||
39 | |||
40 | #define TIMEOUT 100000 | ||
41 | |||
42 | static irqreturn_t ssp_interrupt(int irq, void *dev_id) | ||
43 | { | ||
44 | struct ssp_dev *dev = dev_id; | ||
45 | struct ssp_device *ssp = dev->ssp; | ||
46 | unsigned int status; | ||
47 | |||
48 | status = __raw_readl(ssp->mmio_base + SSSR); | ||
49 | __raw_writel(status, ssp->mmio_base + SSSR); | ||
50 | |||
51 | if (status & SSSR_ROR) | ||
52 | printk(KERN_WARNING "SSP(%d): receiver overrun\n", dev->port); | ||
53 | |||
54 | if (status & SSSR_TUR) | ||
55 | printk(KERN_WARNING "SSP(%d): transmitter underrun\n", dev->port); | ||
56 | |||
57 | if (status & SSSR_BCE) | ||
58 | printk(KERN_WARNING "SSP(%d): bit count error\n", dev->port); | ||
59 | |||
60 | return IRQ_HANDLED; | ||
61 | } | ||
62 | |||
63 | /** | ||
64 | * ssp_write_word - write a word to the SSP port | ||
65 | * @data: 32-bit, MSB justified data to write. | ||
66 | * | ||
67 | * Wait for a free entry in the SSP transmit FIFO, and write a data | ||
68 | * word to the SSP port. | ||
69 | * | ||
70 | * The caller is expected to perform the necessary locking. | ||
71 | * | ||
72 | * Returns: | ||
73 | * %-ETIMEDOUT timeout occurred | ||
74 | * 0 success | ||
75 | */ | ||
76 | int ssp_write_word(struct ssp_dev *dev, u32 data) | ||
77 | { | ||
78 | struct ssp_device *ssp = dev->ssp; | ||
79 | int timeout = TIMEOUT; | ||
80 | |||
81 | while (!(__raw_readl(ssp->mmio_base + SSSR) & SSSR_TNF)) { | ||
82 | if (!--timeout) | ||
83 | return -ETIMEDOUT; | ||
84 | cpu_relax(); | ||
85 | } | ||
86 | |||
87 | __raw_writel(data, ssp->mmio_base + SSDR); | ||
88 | |||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | /** | ||
93 | * ssp_read_word - read a word from the SSP port | ||
94 | * | ||
95 | * Wait for a data word in the SSP receive FIFO, and return the | ||
96 | * received data. Data is LSB justified. | ||
97 | * | ||
98 | * Note: Currently, if data is not expected to be received, this | ||
99 | * function will wait for ever. | ||
100 | * | ||
101 | * The caller is expected to perform the necessary locking. | ||
102 | * | ||
103 | * Returns: | ||
104 | * %-ETIMEDOUT timeout occurred | ||
105 | * 32-bit data success | ||
106 | */ | ||
107 | int ssp_read_word(struct ssp_dev *dev, u32 *data) | ||
108 | { | ||
109 | struct ssp_device *ssp = dev->ssp; | ||
110 | int timeout = TIMEOUT; | ||
111 | |||
112 | while (!(__raw_readl(ssp->mmio_base + SSSR) & SSSR_RNE)) { | ||
113 | if (!--timeout) | ||
114 | return -ETIMEDOUT; | ||
115 | cpu_relax(); | ||
116 | } | ||
117 | |||
118 | *data = __raw_readl(ssp->mmio_base + SSDR); | ||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * ssp_flush - flush the transmit and receive FIFOs | ||
124 | * | ||
125 | * Wait for the SSP to idle, and ensure that the receive FIFO | ||
126 | * is empty. | ||
127 | * | ||
128 | * The caller is expected to perform the necessary locking. | ||
129 | */ | ||
130 | int ssp_flush(struct ssp_dev *dev) | ||
131 | { | ||
132 | struct ssp_device *ssp = dev->ssp; | ||
133 | int timeout = TIMEOUT * 2; | ||
134 | |||
135 | /* ensure TX FIFO is empty instead of not full */ | ||
136 | if (cpu_is_pxa3xx()) { | ||
137 | while (__raw_readl(ssp->mmio_base + SSSR) & 0xf00) { | ||
138 | if (!--timeout) | ||
139 | return -ETIMEDOUT; | ||
140 | cpu_relax(); | ||
141 | } | ||
142 | timeout = TIMEOUT * 2; | ||
143 | } | ||
144 | |||
145 | do { | ||
146 | while (__raw_readl(ssp->mmio_base + SSSR) & SSSR_RNE) { | ||
147 | if (!--timeout) | ||
148 | return -ETIMEDOUT; | ||
149 | (void)__raw_readl(ssp->mmio_base + SSDR); | ||
150 | } | ||
151 | if (!--timeout) | ||
152 | return -ETIMEDOUT; | ||
153 | } while (__raw_readl(ssp->mmio_base + SSSR) & SSSR_BSY); | ||
154 | |||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | /** | ||
159 | * ssp_enable - enable the SSP port | ||
160 | * | ||
161 | * Turn on the SSP port. | ||
162 | */ | ||
163 | void ssp_enable(struct ssp_dev *dev) | ||
164 | { | ||
165 | struct ssp_device *ssp = dev->ssp; | ||
166 | uint32_t sscr0; | ||
167 | |||
168 | sscr0 = __raw_readl(ssp->mmio_base + SSCR0); | ||
169 | sscr0 |= SSCR0_SSE; | ||
170 | __raw_writel(sscr0, ssp->mmio_base + SSCR0); | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * ssp_disable - shut down the SSP port | ||
175 | * | ||
176 | * Turn off the SSP port, optionally powering it down. | ||
177 | */ | ||
178 | void ssp_disable(struct ssp_dev *dev) | ||
179 | { | ||
180 | struct ssp_device *ssp = dev->ssp; | ||
181 | uint32_t sscr0; | ||
182 | |||
183 | sscr0 = __raw_readl(ssp->mmio_base + SSCR0); | ||
184 | sscr0 &= ~SSCR0_SSE; | ||
185 | __raw_writel(sscr0, ssp->mmio_base + SSCR0); | ||
186 | } | ||
187 | |||
188 | /** | ||
189 | * ssp_save_state - save the SSP configuration | ||
190 | * @ssp: pointer to structure to save SSP configuration | ||
191 | * | ||
192 | * Save the configured SSP state for suspend. | ||
193 | */ | ||
194 | void ssp_save_state(struct ssp_dev *dev, struct ssp_state *state) | ||
195 | { | ||
196 | struct ssp_device *ssp = dev->ssp; | ||
197 | |||
198 | state->cr0 = __raw_readl(ssp->mmio_base + SSCR0); | ||
199 | state->cr1 = __raw_readl(ssp->mmio_base + SSCR1); | ||
200 | state->to = __raw_readl(ssp->mmio_base + SSTO); | ||
201 | state->psp = __raw_readl(ssp->mmio_base + SSPSP); | ||
202 | |||
203 | ssp_disable(dev); | ||
204 | } | ||
205 | |||
206 | /** | ||
207 | * ssp_restore_state - restore a previously saved SSP configuration | ||
208 | * @ssp: pointer to configuration saved by ssp_save_state | ||
209 | * | ||
210 | * Restore the SSP configuration saved previously by ssp_save_state. | ||
211 | */ | ||
212 | void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *state) | ||
213 | { | ||
214 | struct ssp_device *ssp = dev->ssp; | ||
215 | uint32_t sssr = SSSR_ROR | SSSR_TUR | SSSR_BCE; | ||
216 | |||
217 | __raw_writel(sssr, ssp->mmio_base + SSSR); | ||
218 | |||
219 | __raw_writel(state->cr0 & ~SSCR0_SSE, ssp->mmio_base + SSCR0); | ||
220 | __raw_writel(state->cr1, ssp->mmio_base + SSCR1); | ||
221 | __raw_writel(state->to, ssp->mmio_base + SSTO); | ||
222 | __raw_writel(state->psp, ssp->mmio_base + SSPSP); | ||
223 | __raw_writel(state->cr0, ssp->mmio_base + SSCR0); | ||
224 | } | ||
225 | |||
226 | /** | ||
227 | * ssp_config - configure SSP port settings | ||
228 | * @mode: port operating mode | ||
229 | * @flags: port config flags | ||
230 | * @psp_flags: port PSP config flags | ||
231 | * @speed: port speed | ||
232 | * | ||
233 | * Port MUST be disabled by ssp_disable before making any config changes. | ||
234 | */ | ||
235 | int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed) | ||
236 | { | ||
237 | struct ssp_device *ssp = dev->ssp; | ||
238 | |||
239 | dev->mode = mode; | ||
240 | dev->flags = flags; | ||
241 | dev->psp_flags = psp_flags; | ||
242 | dev->speed = speed; | ||
243 | |||
244 | /* set up port type, speed, port settings */ | ||
245 | __raw_writel((dev->speed | dev->mode), ssp->mmio_base + SSCR0); | ||
246 | __raw_writel(dev->flags, ssp->mmio_base + SSCR1); | ||
247 | __raw_writel(dev->psp_flags, ssp->mmio_base + SSPSP); | ||
248 | |||
249 | return 0; | ||
250 | } | ||
251 | |||
252 | /** | ||
253 | * ssp_init - setup the SSP port | ||
254 | * | ||
255 | * initialise and claim resources for the SSP port. | ||
256 | * | ||
257 | * Returns: | ||
258 | * %-ENODEV if the SSP port is unavailable | ||
259 | * %-EBUSY if the resources are already in use | ||
260 | * %0 on success | ||
261 | */ | ||
262 | int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags) | ||
263 | { | ||
264 | struct ssp_device *ssp; | ||
265 | int ret; | ||
266 | |||
267 | ssp = ssp_request(port, "SSP"); | ||
268 | if (ssp == NULL) | ||
269 | return -ENODEV; | ||
270 | |||
271 | dev->ssp = ssp; | ||
272 | dev->port = port; | ||
273 | |||
274 | /* do we need to get irq */ | ||
275 | if (!(init_flags & SSP_NO_IRQ)) { | ||
276 | ret = request_irq(ssp->irq, ssp_interrupt, | ||
277 | 0, "SSP", dev); | ||
278 | if (ret) | ||
279 | goto out_region; | ||
280 | dev->irq = ssp->irq; | ||
281 | } else | ||
282 | dev->irq = NO_IRQ; | ||
283 | |||
284 | /* turn on SSP port clock */ | ||
285 | clk_enable(ssp->clk); | ||
286 | return 0; | ||
287 | |||
288 | out_region: | ||
289 | ssp_free(ssp); | ||
290 | return ret; | ||
291 | } | ||
292 | |||
293 | /** | ||
294 | * ssp_exit - undo the effects of ssp_init | ||
295 | * | ||
296 | * release and free resources for the SSP port. | ||
297 | */ | ||
298 | void ssp_exit(struct ssp_dev *dev) | ||
299 | { | ||
300 | struct ssp_device *ssp = dev->ssp; | ||
301 | |||
302 | ssp_disable(dev); | ||
303 | if (dev->irq != NO_IRQ) | ||
304 | free_irq(dev->irq, dev); | ||
305 | clk_disable(ssp->clk); | ||
306 | ssp_free(ssp); | ||
307 | } | ||
308 | #endif /* CONFIG_PXA_SSP_LEGACY */ | ||
309 | |||
310 | static DEFINE_MUTEX(ssp_lock); | ||
311 | static LIST_HEAD(ssp_list); | ||
312 | |||
313 | struct ssp_device *ssp_request(int port, const char *label) | ||
314 | { | ||
315 | struct ssp_device *ssp = NULL; | ||
316 | |||
317 | mutex_lock(&ssp_lock); | ||
318 | |||
319 | list_for_each_entry(ssp, &ssp_list, node) { | ||
320 | if (ssp->port_id == port && ssp->use_count == 0) { | ||
321 | ssp->use_count++; | ||
322 | ssp->label = label; | ||
323 | break; | ||
324 | } | ||
325 | } | ||
326 | |||
327 | mutex_unlock(&ssp_lock); | ||
328 | |||
329 | if (&ssp->node == &ssp_list) | ||
330 | return NULL; | ||
331 | |||
332 | return ssp; | ||
333 | } | ||
334 | EXPORT_SYMBOL(ssp_request); | ||
335 | |||
336 | void ssp_free(struct ssp_device *ssp) | ||
337 | { | ||
338 | mutex_lock(&ssp_lock); | ||
339 | if (ssp->use_count) { | ||
340 | ssp->use_count--; | ||
341 | ssp->label = NULL; | ||
342 | } else | ||
343 | dev_err(&ssp->pdev->dev, "device already free\n"); | ||
344 | mutex_unlock(&ssp_lock); | ||
345 | } | ||
346 | EXPORT_SYMBOL(ssp_free); | ||
347 | |||
348 | static int __devinit ssp_probe(struct platform_device *pdev) | ||
349 | { | ||
350 | const struct platform_device_id *id = platform_get_device_id(pdev); | ||
351 | struct resource *res; | ||
352 | struct ssp_device *ssp; | ||
353 | int ret = 0; | ||
354 | |||
355 | ssp = kzalloc(sizeof(struct ssp_device), GFP_KERNEL); | ||
356 | if (ssp == NULL) { | ||
357 | dev_err(&pdev->dev, "failed to allocate memory"); | ||
358 | return -ENOMEM; | ||
359 | } | ||
360 | ssp->pdev = pdev; | ||
361 | |||
362 | ssp->clk = clk_get(&pdev->dev, NULL); | ||
363 | if (IS_ERR(ssp->clk)) { | ||
364 | ret = PTR_ERR(ssp->clk); | ||
365 | goto err_free; | ||
366 | } | ||
367 | |||
368 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
369 | if (res == NULL) { | ||
370 | dev_err(&pdev->dev, "no memory resource defined\n"); | ||
371 | ret = -ENODEV; | ||
372 | goto err_free_clk; | ||
373 | } | ||
374 | |||
375 | res = request_mem_region(res->start, res->end - res->start + 1, | ||
376 | pdev->name); | ||
377 | if (res == NULL) { | ||
378 | dev_err(&pdev->dev, "failed to request memory resource\n"); | ||
379 | ret = -EBUSY; | ||
380 | goto err_free_clk; | ||
381 | } | ||
382 | |||
383 | ssp->phys_base = res->start; | ||
384 | |||
385 | ssp->mmio_base = ioremap(res->start, res->end - res->start + 1); | ||
386 | if (ssp->mmio_base == NULL) { | ||
387 | dev_err(&pdev->dev, "failed to ioremap() registers\n"); | ||
388 | ret = -ENODEV; | ||
389 | goto err_free_mem; | ||
390 | } | ||
391 | |||
392 | ssp->irq = platform_get_irq(pdev, 0); | ||
393 | if (ssp->irq < 0) { | ||
394 | dev_err(&pdev->dev, "no IRQ resource defined\n"); | ||
395 | ret = -ENODEV; | ||
396 | goto err_free_io; | ||
397 | } | ||
398 | |||
399 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | ||
400 | if (res == NULL) { | ||
401 | dev_err(&pdev->dev, "no SSP RX DRCMR defined\n"); | ||
402 | ret = -ENODEV; | ||
403 | goto err_free_io; | ||
404 | } | ||
405 | ssp->drcmr_rx = res->start; | ||
406 | |||
407 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); | ||
408 | if (res == NULL) { | ||
409 | dev_err(&pdev->dev, "no SSP TX DRCMR defined\n"); | ||
410 | ret = -ENODEV; | ||
411 | goto err_free_io; | ||
412 | } | ||
413 | ssp->drcmr_tx = res->start; | ||
414 | |||
415 | /* PXA2xx/3xx SSP ports starts from 1 and the internal pdev->id | ||
416 | * starts from 0, do a translation here | ||
417 | */ | ||
418 | ssp->port_id = pdev->id + 1; | ||
419 | ssp->use_count = 0; | ||
420 | ssp->type = (int)id->driver_data; | ||
421 | |||
422 | mutex_lock(&ssp_lock); | ||
423 | list_add(&ssp->node, &ssp_list); | ||
424 | mutex_unlock(&ssp_lock); | ||
425 | |||
426 | platform_set_drvdata(pdev, ssp); | ||
427 | return 0; | ||
428 | |||
429 | err_free_io: | ||
430 | iounmap(ssp->mmio_base); | ||
431 | err_free_mem: | ||
432 | release_mem_region(res->start, res->end - res->start + 1); | ||
433 | err_free_clk: | ||
434 | clk_put(ssp->clk); | ||
435 | err_free: | ||
436 | kfree(ssp); | ||
437 | return ret; | ||
438 | } | ||
439 | |||
440 | static int __devexit ssp_remove(struct platform_device *pdev) | ||
441 | { | ||
442 | struct resource *res; | ||
443 | struct ssp_device *ssp; | ||
444 | |||
445 | ssp = platform_get_drvdata(pdev); | ||
446 | if (ssp == NULL) | ||
447 | return -ENODEV; | ||
448 | |||
449 | iounmap(ssp->mmio_base); | ||
450 | |||
451 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
452 | release_mem_region(res->start, res->end - res->start + 1); | ||
453 | |||
454 | clk_put(ssp->clk); | ||
455 | |||
456 | mutex_lock(&ssp_lock); | ||
457 | list_del(&ssp->node); | ||
458 | mutex_unlock(&ssp_lock); | ||
459 | |||
460 | kfree(ssp); | ||
461 | return 0; | ||
462 | } | ||
463 | |||
464 | static const struct platform_device_id ssp_id_table[] = { | ||
465 | { "pxa25x-ssp", PXA25x_SSP }, | ||
466 | { "pxa25x-nssp", PXA25x_NSSP }, | ||
467 | { "pxa27x-ssp", PXA27x_SSP }, | ||
468 | { }, | ||
469 | }; | ||
470 | |||
471 | static struct platform_driver ssp_driver = { | ||
472 | .probe = ssp_probe, | ||
473 | .remove = __devexit_p(ssp_remove), | ||
474 | .driver = { | ||
475 | .owner = THIS_MODULE, | ||
476 | .name = "pxa2xx-ssp", | ||
477 | }, | ||
478 | .id_table = ssp_id_table, | ||
479 | }; | ||
480 | |||
481 | static int __init pxa_ssp_init(void) | ||
482 | { | ||
483 | return platform_driver_register(&ssp_driver); | ||
484 | } | ||
485 | |||
486 | static void __exit pxa_ssp_exit(void) | ||
487 | { | ||
488 | platform_driver_unregister(&ssp_driver); | ||
489 | } | ||
490 | |||
491 | arch_initcall(pxa_ssp_init); | ||
492 | module_exit(pxa_ssp_exit); | ||
493 | |||
494 | #ifdef CONFIG_PXA_SSP_LEGACY | ||
495 | EXPORT_SYMBOL(ssp_write_word); | ||
496 | EXPORT_SYMBOL(ssp_read_word); | ||
497 | EXPORT_SYMBOL(ssp_flush); | ||
498 | EXPORT_SYMBOL(ssp_enable); | ||
499 | EXPORT_SYMBOL(ssp_disable); | ||
500 | EXPORT_SYMBOL(ssp_save_state); | ||
501 | EXPORT_SYMBOL(ssp_restore_state); | ||
502 | EXPORT_SYMBOL(ssp_init); | ||
503 | EXPORT_SYMBOL(ssp_exit); | ||
504 | EXPORT_SYMBOL(ssp_config); | ||
505 | #endif | ||
506 | |||
507 | MODULE_DESCRIPTION("PXA SSP driver"); | ||
508 | MODULE_AUTHOR("Liam Girdwood"); | ||
509 | MODULE_LICENSE("GPL"); | ||
510 | |||
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index 2041eb1d90ba..af40d2a12d37 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c | |||
@@ -464,8 +464,6 @@ static struct platform_device smc91x_device = { | |||
464 | 464 | ||
465 | 465 | ||
466 | 466 | ||
467 | static struct pxamci_platform_data stargate2_mci_platform_data; | ||
468 | |||
469 | /* | 467 | /* |
470 | * The card detect interrupt isn't debounced so we delay it by 250ms | 468 | * The card detect interrupt isn't debounced so we delay it by 250ms |
471 | * to give the card a chance to fully insert / eject. | 469 | * to give the card a chance to fully insert / eject. |
@@ -489,8 +487,6 @@ static int stargate2_mci_init(struct device *dev, | |||
489 | goto free_power_en; | 487 | goto free_power_en; |
490 | } | 488 | } |
491 | gpio_direction_input(SG2_GPIO_nSD_DETECT); | 489 | gpio_direction_input(SG2_GPIO_nSD_DETECT); |
492 | /* Delay to allow for full insertion */ | ||
493 | stargate2_mci_platform_data.detect_delay = msecs_to_jiffies(250); | ||
494 | 490 | ||
495 | err = request_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT), | 491 | err = request_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT), |
496 | stargate2_detect_int, | 492 | stargate2_detect_int, |
@@ -529,6 +525,7 @@ static void stargate2_mci_exit(struct device *dev, void *data) | |||
529 | } | 525 | } |
530 | 526 | ||
531 | static struct pxamci_platform_data stargate2_mci_platform_data = { | 527 | static struct pxamci_platform_data stargate2_mci_platform_data = { |
528 | .detect_delay_ms = 250, | ||
532 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 529 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
533 | .init = stargate2_mci_init, | 530 | .init = stargate2_mci_init, |
534 | .setpower = stargate2_mci_setpower, | 531 | .setpower = stargate2_mci_setpower, |
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index ad552791c4ce..7512b822c6ca 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -275,6 +275,7 @@ static void tosa_mci_exit(struct device *dev, void *data) | |||
275 | } | 275 | } |
276 | 276 | ||
277 | static struct pxamci_platform_data tosa_mci_platform_data = { | 277 | static struct pxamci_platform_data tosa_mci_platform_data = { |
278 | .detect_delay_ms = 250, | ||
278 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 279 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
279 | .init = tosa_mci_init, | 280 | .init = tosa_mci_init, |
280 | .exit = tosa_mci_exit, | 281 | .exit = tosa_mci_exit, |
@@ -926,7 +927,6 @@ static void __init tosa_init(void) | |||
926 | dummy = gpiochip_reserve(TOSA_SCOOP_JC_GPIO_BASE, 12); | 927 | dummy = gpiochip_reserve(TOSA_SCOOP_JC_GPIO_BASE, 12); |
927 | dummy = gpiochip_reserve(TOSA_TC6393XB_GPIO_BASE, 16); | 928 | dummy = gpiochip_reserve(TOSA_TC6393XB_GPIO_BASE, 16); |
928 | 929 | ||
929 | tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250); | ||
930 | pxa_set_mci_info(&tosa_mci_platform_data); | 930 | pxa_set_mci_info(&tosa_mci_platform_data); |
931 | pxa_set_udc_info(&udc_info); | 931 | pxa_set_udc_info(&udc_info); |
932 | pxa_set_ficp_info(&tosa_ficp_platform_data); | 932 | pxa_set_ficp_info(&tosa_ficp_platform_data); |
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index 797f2544d0ce..69689112eae7 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c | |||
@@ -349,7 +349,7 @@ static void trizeps4_mci_exit(struct device *dev, void *data) | |||
349 | 349 | ||
350 | static struct pxamci_platform_data trizeps4_mci_platform_data = { | 350 | static struct pxamci_platform_data trizeps4_mci_platform_data = { |
351 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 351 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
352 | .detect_delay = 1, | 352 | .detect_delay_ms= 10, |
353 | .init = trizeps4_mci_init, | 353 | .init = trizeps4_mci_init, |
354 | .exit = trizeps4_mci_exit, | 354 | .exit = trizeps4_mci_exit, |
355 | .get_ro = NULL, /* write-protection not supported */ | 355 | .get_ro = NULL, /* write-protection not supported */ |
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c new file mode 100644 index 000000000000..9884fa978f16 --- /dev/null +++ b/arch/arm/mach-pxa/vpac270.c | |||
@@ -0,0 +1,615 @@ | |||
1 | /* | ||
2 | * Hardware definitions for Voipac PXA270 | ||
3 | * | ||
4 | * Copyright (C) 2010 | ||
5 | * Marek Vasut <marek.vasut@gmail.com> | ||
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/platform_device.h> | ||
14 | #include <linux/delay.h> | ||
15 | #include <linux/irq.h> | ||
16 | #include <linux/gpio_keys.h> | ||
17 | #include <linux/input.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include <linux/sysdev.h> | ||
20 | #include <linux/usb/gpio_vbus.h> | ||
21 | #include <linux/mtd/mtd.h> | ||
22 | #include <linux/mtd/partitions.h> | ||
23 | #include <linux/mtd/physmap.h> | ||
24 | #include <linux/mtd/onenand.h> | ||
25 | #include <linux/dm9000.h> | ||
26 | #include <linux/ucb1400.h> | ||
27 | #include <linux/ata_platform.h> | ||
28 | |||
29 | #include <asm/mach-types.h> | ||
30 | #include <asm/mach/arch.h> | ||
31 | |||
32 | #include <mach/pxa27x.h> | ||
33 | #include <mach/audio.h> | ||
34 | #include <mach/vpac270.h> | ||
35 | #include <mach/mmc.h> | ||
36 | #include <mach/pxafb.h> | ||
37 | #include <mach/ohci.h> | ||
38 | #include <mach/pxa27x-udc.h> | ||
39 | #include <mach/udc.h> | ||
40 | |||
41 | #include <plat/i2c.h> | ||
42 | |||
43 | #include "generic.h" | ||
44 | #include "devices.h" | ||
45 | |||
46 | /****************************************************************************** | ||
47 | * Pin configuration | ||
48 | ******************************************************************************/ | ||
49 | static unsigned long vpac270_pin_config[] __initdata = { | ||
50 | /* MMC */ | ||
51 | GPIO32_MMC_CLK, | ||
52 | GPIO92_MMC_DAT_0, | ||
53 | GPIO109_MMC_DAT_1, | ||
54 | GPIO110_MMC_DAT_2, | ||
55 | GPIO111_MMC_DAT_3, | ||
56 | GPIO112_MMC_CMD, | ||
57 | GPIO53_GPIO, /* SD detect */ | ||
58 | GPIO52_GPIO, /* SD r/o switch */ | ||
59 | |||
60 | /* GPIO KEYS */ | ||
61 | GPIO1_GPIO, /* USER BTN */ | ||
62 | |||
63 | /* LEDs */ | ||
64 | GPIO15_GPIO, /* orange led */ | ||
65 | |||
66 | /* FFUART */ | ||
67 | GPIO34_FFUART_RXD, | ||
68 | GPIO39_FFUART_TXD, | ||
69 | GPIO27_FFUART_RTS, | ||
70 | GPIO100_FFUART_CTS, | ||
71 | GPIO33_FFUART_DSR, | ||
72 | GPIO40_FFUART_DTR, | ||
73 | GPIO10_FFUART_DCD, | ||
74 | GPIO38_FFUART_RI, | ||
75 | |||
76 | /* LCD */ | ||
77 | GPIO58_LCD_LDD_0, | ||
78 | GPIO59_LCD_LDD_1, | ||
79 | GPIO60_LCD_LDD_2, | ||
80 | GPIO61_LCD_LDD_3, | ||
81 | GPIO62_LCD_LDD_4, | ||
82 | GPIO63_LCD_LDD_5, | ||
83 | GPIO64_LCD_LDD_6, | ||
84 | GPIO65_LCD_LDD_7, | ||
85 | GPIO66_LCD_LDD_8, | ||
86 | GPIO67_LCD_LDD_9, | ||
87 | GPIO68_LCD_LDD_10, | ||
88 | GPIO69_LCD_LDD_11, | ||
89 | GPIO70_LCD_LDD_12, | ||
90 | GPIO71_LCD_LDD_13, | ||
91 | GPIO72_LCD_LDD_14, | ||
92 | GPIO73_LCD_LDD_15, | ||
93 | GPIO86_LCD_LDD_16, | ||
94 | GPIO87_LCD_LDD_17, | ||
95 | GPIO74_LCD_FCLK, | ||
96 | GPIO75_LCD_LCLK, | ||
97 | GPIO76_LCD_PCLK, | ||
98 | GPIO77_LCD_BIAS, | ||
99 | |||
100 | /* PCMCIA */ | ||
101 | GPIO48_nPOE, | ||
102 | GPIO49_nPWE, | ||
103 | GPIO50_nPIOR, | ||
104 | GPIO51_nPIOW, | ||
105 | GPIO85_nPCE_1, | ||
106 | GPIO54_nPCE_2, | ||
107 | GPIO55_nPREG, | ||
108 | GPIO57_nIOIS16, | ||
109 | GPIO56_nPWAIT, | ||
110 | GPIO104_PSKTSEL, | ||
111 | GPIO84_GPIO, /* PCMCIA CD */ | ||
112 | GPIO35_GPIO, /* PCMCIA RDY */ | ||
113 | GPIO107_GPIO, /* PCMCIA PPEN */ | ||
114 | GPIO11_GPIO, /* PCMCIA RESET */ | ||
115 | GPIO17_GPIO, /* CF CD */ | ||
116 | GPIO12_GPIO, /* CF RDY */ | ||
117 | GPIO16_GPIO, /* CF RESET */ | ||
118 | |||
119 | /* UHC */ | ||
120 | GPIO88_USBH1_PWR, | ||
121 | GPIO89_USBH1_PEN, | ||
122 | GPIO119_USBH2_PWR, | ||
123 | GPIO120_USBH2_PEN, | ||
124 | |||
125 | /* UDC */ | ||
126 | GPIO41_GPIO, | ||
127 | |||
128 | /* Ethernet */ | ||
129 | GPIO114_GPIO, /* IRQ */ | ||
130 | |||
131 | /* AC97 */ | ||
132 | GPIO28_AC97_BITCLK, | ||
133 | GPIO29_AC97_SDATA_IN_0, | ||
134 | GPIO30_AC97_SDATA_OUT, | ||
135 | GPIO31_AC97_SYNC, | ||
136 | GPIO95_AC97_nRESET, | ||
137 | GPIO98_AC97_SYSCLK, | ||
138 | GPIO113_GPIO, /* TS IRQ */ | ||
139 | |||
140 | /* I2C */ | ||
141 | GPIO117_I2C_SCL, | ||
142 | GPIO118_I2C_SDA, | ||
143 | |||
144 | /* IDE */ | ||
145 | GPIO36_GPIO, /* IDE IRQ */ | ||
146 | GPIO80_DREQ_1, | ||
147 | }; | ||
148 | |||
149 | /****************************************************************************** | ||
150 | * NOR Flash | ||
151 | ******************************************************************************/ | ||
152 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | ||
153 | static struct mtd_partition vpac270_nor_partitions[] = { | ||
154 | { | ||
155 | .name = "Flash", | ||
156 | .offset = 0x00000000, | ||
157 | .size = MTDPART_SIZ_FULL, | ||
158 | } | ||
159 | }; | ||
160 | |||
161 | static struct physmap_flash_data vpac270_flash_data[] = { | ||
162 | { | ||
163 | .width = 2, /* bankwidth in bytes */ | ||
164 | .parts = vpac270_nor_partitions, | ||
165 | .nr_parts = ARRAY_SIZE(vpac270_nor_partitions) | ||
166 | } | ||
167 | }; | ||
168 | |||
169 | static struct resource vpac270_flash_resource = { | ||
170 | .start = PXA_CS0_PHYS, | ||
171 | .end = PXA_CS0_PHYS + SZ_64M - 1, | ||
172 | .flags = IORESOURCE_MEM, | ||
173 | }; | ||
174 | |||
175 | static struct platform_device vpac270_flash = { | ||
176 | .name = "physmap-flash", | ||
177 | .id = 0, | ||
178 | .resource = &vpac270_flash_resource, | ||
179 | .num_resources = 1, | ||
180 | .dev = { | ||
181 | .platform_data = vpac270_flash_data, | ||
182 | }, | ||
183 | }; | ||
184 | static void __init vpac270_nor_init(void) | ||
185 | { | ||
186 | platform_device_register(&vpac270_flash); | ||
187 | } | ||
188 | #else | ||
189 | static inline void vpac270_nor_init(void) {} | ||
190 | #endif | ||
191 | |||
192 | /****************************************************************************** | ||
193 | * OneNAND Flash | ||
194 | ******************************************************************************/ | ||
195 | #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE) | ||
196 | static struct mtd_partition vpac270_onenand_partitions[] = { | ||
197 | { | ||
198 | .name = "Flash", | ||
199 | .offset = 0x00000000, | ||
200 | .size = MTDPART_SIZ_FULL, | ||
201 | } | ||
202 | }; | ||
203 | |||
204 | static struct onenand_platform_data vpac270_onenand_info = { | ||
205 | .parts = vpac270_onenand_partitions, | ||
206 | .nr_parts = ARRAY_SIZE(vpac270_onenand_partitions), | ||
207 | }; | ||
208 | |||
209 | static struct resource vpac270_onenand_resources[] = { | ||
210 | [0] = { | ||
211 | .start = PXA_CS0_PHYS, | ||
212 | .end = PXA_CS0_PHYS + SZ_1M, | ||
213 | .flags = IORESOURCE_MEM, | ||
214 | }, | ||
215 | }; | ||
216 | |||
217 | static struct platform_device vpac270_onenand = { | ||
218 | .name = "onenand-flash", | ||
219 | .id = -1, | ||
220 | .resource = vpac270_onenand_resources, | ||
221 | .num_resources = ARRAY_SIZE(vpac270_onenand_resources), | ||
222 | .dev = { | ||
223 | .platform_data = &vpac270_onenand_info, | ||
224 | }, | ||
225 | }; | ||
226 | |||
227 | static void __init vpac270_onenand_init(void) | ||
228 | { | ||
229 | platform_device_register(&vpac270_onenand); | ||
230 | } | ||
231 | #else | ||
232 | static void __init vpac270_onenand_init(void) {} | ||
233 | #endif | ||
234 | |||
235 | /****************************************************************************** | ||
236 | * SD/MMC card controller | ||
237 | ******************************************************************************/ | ||
238 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
239 | static struct pxamci_platform_data vpac270_mci_platform_data = { | ||
240 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
241 | .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N, | ||
242 | .gpio_card_ro = GPIO52_VPAC270_SD_READONLY, | ||
243 | .detect_delay_ms = 200, | ||
244 | }; | ||
245 | |||
246 | static void __init vpac270_mmc_init(void) | ||
247 | { | ||
248 | pxa_set_mci_info(&vpac270_mci_platform_data); | ||
249 | } | ||
250 | #else | ||
251 | static inline void vpac270_mmc_init(void) {} | ||
252 | #endif | ||
253 | |||
254 | /****************************************************************************** | ||
255 | * GPIO keys | ||
256 | ******************************************************************************/ | ||
257 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
258 | static struct gpio_keys_button vpac270_pxa_buttons[] = { | ||
259 | {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"}, | ||
260 | }; | ||
261 | |||
262 | static struct gpio_keys_platform_data vpac270_pxa_keys_data = { | ||
263 | .buttons = vpac270_pxa_buttons, | ||
264 | .nbuttons = ARRAY_SIZE(vpac270_pxa_buttons), | ||
265 | }; | ||
266 | |||
267 | static struct platform_device vpac270_pxa_keys = { | ||
268 | .name = "gpio-keys", | ||
269 | .id = -1, | ||
270 | .dev = { | ||
271 | .platform_data = &vpac270_pxa_keys_data, | ||
272 | }, | ||
273 | }; | ||
274 | |||
275 | static void __init vpac270_keys_init(void) | ||
276 | { | ||
277 | platform_device_register(&vpac270_pxa_keys); | ||
278 | } | ||
279 | #else | ||
280 | static inline void vpac270_keys_init(void) {} | ||
281 | #endif | ||
282 | |||
283 | /****************************************************************************** | ||
284 | * LED | ||
285 | ******************************************************************************/ | ||
286 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | ||
287 | struct gpio_led vpac270_gpio_leds[] = { | ||
288 | { | ||
289 | .name = "vpac270:orange:user", | ||
290 | .default_trigger = "none", | ||
291 | .gpio = GPIO15_VPAC270_LED_ORANGE, | ||
292 | .active_low = 1, | ||
293 | } | ||
294 | }; | ||
295 | |||
296 | static struct gpio_led_platform_data vpac270_gpio_led_info = { | ||
297 | .leds = vpac270_gpio_leds, | ||
298 | .num_leds = ARRAY_SIZE(vpac270_gpio_leds), | ||
299 | }; | ||
300 | |||
301 | static struct platform_device vpac270_leds = { | ||
302 | .name = "leds-gpio", | ||
303 | .id = -1, | ||
304 | .dev = { | ||
305 | .platform_data = &vpac270_gpio_led_info, | ||
306 | } | ||
307 | }; | ||
308 | |||
309 | static void __init vpac270_leds_init(void) | ||
310 | { | ||
311 | platform_device_register(&vpac270_leds); | ||
312 | } | ||
313 | #else | ||
314 | static inline void vpac270_leds_init(void) {} | ||
315 | #endif | ||
316 | |||
317 | /****************************************************************************** | ||
318 | * USB Host | ||
319 | ******************************************************************************/ | ||
320 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
321 | static int vpac270_ohci_init(struct device *dev) | ||
322 | { | ||
323 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; | ||
324 | return 0; | ||
325 | } | ||
326 | |||
327 | static struct pxaohci_platform_data vpac270_ohci_info = { | ||
328 | .port_mode = PMM_PERPORT_MODE, | ||
329 | .flags = ENABLE_PORT1 | ENABLE_PORT2 | | ||
330 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | ||
331 | .init = vpac270_ohci_init, | ||
332 | }; | ||
333 | |||
334 | static void __init vpac270_uhc_init(void) | ||
335 | { | ||
336 | pxa_set_ohci_info(&vpac270_ohci_info); | ||
337 | } | ||
338 | #else | ||
339 | static inline void vpac270_uhc_init(void) {} | ||
340 | #endif | ||
341 | |||
342 | /****************************************************************************** | ||
343 | * USB Gadget | ||
344 | ******************************************************************************/ | ||
345 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) | ||
346 | static struct gpio_vbus_mach_info vpac270_gpio_vbus_info = { | ||
347 | .gpio_vbus = GPIO41_VPAC270_UDC_DETECT, | ||
348 | .gpio_pullup = -1, | ||
349 | }; | ||
350 | |||
351 | static struct platform_device vpac270_gpio_vbus = { | ||
352 | .name = "gpio-vbus", | ||
353 | .id = -1, | ||
354 | .dev = { | ||
355 | .platform_data = &vpac270_gpio_vbus_info, | ||
356 | }, | ||
357 | }; | ||
358 | |||
359 | static void vpac270_udc_command(int cmd) | ||
360 | { | ||
361 | if (cmd == PXA2XX_UDC_CMD_CONNECT) | ||
362 | UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE; | ||
363 | else if (cmd == PXA2XX_UDC_CMD_DISCONNECT) | ||
364 | UP2OCR = UP2OCR_HXOE; | ||
365 | } | ||
366 | |||
367 | static struct pxa2xx_udc_mach_info vpac270_udc_info __initdata = { | ||
368 | .udc_command = vpac270_udc_command, | ||
369 | .gpio_pullup = -1, | ||
370 | }; | ||
371 | |||
372 | static void __init vpac270_udc_init(void) | ||
373 | { | ||
374 | pxa_set_udc_info(&vpac270_udc_info); | ||
375 | platform_device_register(&vpac270_gpio_vbus); | ||
376 | } | ||
377 | #else | ||
378 | static inline void vpac270_udc_init(void) {} | ||
379 | #endif | ||
380 | |||
381 | /****************************************************************************** | ||
382 | * Ethernet | ||
383 | ******************************************************************************/ | ||
384 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) | ||
385 | static struct resource vpac270_dm9000_resources[] = { | ||
386 | [0] = { | ||
387 | .start = PXA_CS2_PHYS + 0x300, | ||
388 | .end = PXA_CS2_PHYS + 0x303, | ||
389 | .flags = IORESOURCE_MEM, | ||
390 | }, | ||
391 | [1] = { | ||
392 | .start = PXA_CS2_PHYS + 0x304, | ||
393 | .end = PXA_CS2_PHYS + 0x343, | ||
394 | .flags = IORESOURCE_MEM, | ||
395 | }, | ||
396 | [2] = { | ||
397 | .start = IRQ_GPIO(GPIO114_VPAC270_ETH_IRQ), | ||
398 | .end = IRQ_GPIO(GPIO114_VPAC270_ETH_IRQ), | ||
399 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | ||
400 | }, | ||
401 | }; | ||
402 | |||
403 | static struct dm9000_plat_data vpac270_dm9000_platdata = { | ||
404 | .flags = DM9000_PLATF_32BITONLY, | ||
405 | }; | ||
406 | |||
407 | static struct platform_device vpac270_dm9000_device = { | ||
408 | .name = "dm9000", | ||
409 | .id = -1, | ||
410 | .num_resources = ARRAY_SIZE(vpac270_dm9000_resources), | ||
411 | .resource = vpac270_dm9000_resources, | ||
412 | .dev = { | ||
413 | .platform_data = &vpac270_dm9000_platdata, | ||
414 | } | ||
415 | }; | ||
416 | |||
417 | static void __init vpac270_eth_init(void) | ||
418 | { | ||
419 | platform_device_register(&vpac270_dm9000_device); | ||
420 | } | ||
421 | #else | ||
422 | static inline void vpac270_eth_init(void) {} | ||
423 | #endif | ||
424 | |||
425 | /****************************************************************************** | ||
426 | * Audio and Touchscreen | ||
427 | ******************************************************************************/ | ||
428 | #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \ | ||
429 | defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE) | ||
430 | static pxa2xx_audio_ops_t vpac270_ac97_pdata = { | ||
431 | .reset_gpio = 95, | ||
432 | }; | ||
433 | |||
434 | static struct ucb1400_pdata vpac270_ucb1400_pdata = { | ||
435 | .irq = IRQ_GPIO(GPIO113_VPAC270_TS_IRQ), | ||
436 | }; | ||
437 | |||
438 | static struct platform_device vpac270_ucb1400_device = { | ||
439 | .name = "ucb1400_core", | ||
440 | .id = -1, | ||
441 | .dev = { | ||
442 | .platform_data = &vpac270_ucb1400_pdata, | ||
443 | }, | ||
444 | }; | ||
445 | |||
446 | static void __init vpac270_ts_init(void) | ||
447 | { | ||
448 | pxa_set_ac97_info(&vpac270_ac97_pdata); | ||
449 | platform_device_register(&vpac270_ucb1400_device); | ||
450 | } | ||
451 | #else | ||
452 | static inline void vpac270_ts_init(void) {} | ||
453 | #endif | ||
454 | |||
455 | /****************************************************************************** | ||
456 | * RTC | ||
457 | ******************************************************************************/ | ||
458 | #if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE) | ||
459 | static struct i2c_board_info __initdata vpac270_i2c_devs[] = { | ||
460 | { | ||
461 | I2C_BOARD_INFO("ds1339", 0x68), | ||
462 | }, | ||
463 | }; | ||
464 | |||
465 | static void __init vpac270_rtc_init(void) | ||
466 | { | ||
467 | pxa_set_i2c_info(NULL); | ||
468 | i2c_register_board_info(0, ARRAY_AND_SIZE(vpac270_i2c_devs)); | ||
469 | } | ||
470 | #else | ||
471 | static inline void vpac270_rtc_init(void) {} | ||
472 | #endif | ||
473 | |||
474 | /****************************************************************************** | ||
475 | * Framebuffer | ||
476 | ******************************************************************************/ | ||
477 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
478 | static struct pxafb_mode_info vpac270_lcd_modes[] = { | ||
479 | { | ||
480 | .pixclock = 57692, | ||
481 | .xres = 640, | ||
482 | .yres = 480, | ||
483 | .bpp = 32, | ||
484 | .depth = 18, | ||
485 | |||
486 | .left_margin = 144, | ||
487 | .right_margin = 32, | ||
488 | .upper_margin = 13, | ||
489 | .lower_margin = 30, | ||
490 | |||
491 | .hsync_len = 32, | ||
492 | .vsync_len = 2, | ||
493 | |||
494 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
495 | }, | ||
496 | }; | ||
497 | |||
498 | static struct pxafb_mach_info vpac270_lcd_screen = { | ||
499 | .modes = vpac270_lcd_modes, | ||
500 | .num_modes = ARRAY_SIZE(vpac270_lcd_modes), | ||
501 | .lcd_conn = LCD_COLOR_TFT_18BPP, | ||
502 | }; | ||
503 | |||
504 | static void vpac270_lcd_power(int on, struct fb_var_screeninfo *info) | ||
505 | { | ||
506 | gpio_set_value(GPIO81_VPAC270_BKL_ON, on); | ||
507 | } | ||
508 | |||
509 | static void __init vpac270_lcd_init(void) | ||
510 | { | ||
511 | int ret; | ||
512 | |||
513 | ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON"); | ||
514 | if (ret) { | ||
515 | pr_err("Requesting BKL-ON GPIO failed!\n"); | ||
516 | goto err; | ||
517 | } | ||
518 | |||
519 | ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1); | ||
520 | if (ret) { | ||
521 | pr_err("Setting BKL-ON GPIO direction failed!\n"); | ||
522 | goto err2; | ||
523 | } | ||
524 | |||
525 | vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power; | ||
526 | set_pxa_fb_info(&vpac270_lcd_screen); | ||
527 | return; | ||
528 | |||
529 | err2: | ||
530 | gpio_free(GPIO81_VPAC270_BKL_ON); | ||
531 | err: | ||
532 | return; | ||
533 | } | ||
534 | #else | ||
535 | static inline void vpac270_lcd_init(void) {} | ||
536 | #endif | ||
537 | |||
538 | /****************************************************************************** | ||
539 | * PATA IDE | ||
540 | ******************************************************************************/ | ||
541 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
542 | static struct pata_platform_info vpac270_pata_pdata = { | ||
543 | .ioport_shift = 1, | ||
544 | .irq_flags = IRQF_TRIGGER_RISING, | ||
545 | }; | ||
546 | |||
547 | static struct resource vpac270_ide_resources[] = { | ||
548 | [0] = { /* I/O Base address */ | ||
549 | .start = PXA_CS3_PHYS + 0x120, | ||
550 | .end = PXA_CS3_PHYS + 0x13f, | ||
551 | .flags = IORESOURCE_MEM | ||
552 | }, | ||
553 | [1] = { /* CTL Base address */ | ||
554 | .start = PXA_CS3_PHYS + 0x15c, | ||
555 | .end = PXA_CS3_PHYS + 0x15f, | ||
556 | .flags = IORESOURCE_MEM | ||
557 | }, | ||
558 | [2] = { /* IDE IRQ pin */ | ||
559 | .start = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ), | ||
560 | .end = gpio_to_irq(GPIO36_VPAC270_IDE_IRQ), | ||
561 | .flags = IORESOURCE_IRQ | ||
562 | } | ||
563 | }; | ||
564 | |||
565 | static struct platform_device vpac270_ide_device = { | ||
566 | .name = "pata_platform", | ||
567 | .num_resources = ARRAY_SIZE(vpac270_ide_resources), | ||
568 | .resource = vpac270_ide_resources, | ||
569 | .dev = { | ||
570 | .platform_data = &vpac270_pata_pdata, | ||
571 | } | ||
572 | }; | ||
573 | |||
574 | static void __init vpac270_ide_init(void) | ||
575 | { | ||
576 | platform_device_register(&vpac270_ide_device); | ||
577 | } | ||
578 | #else | ||
579 | static inline void vpac270_ide_init(void) {} | ||
580 | #endif | ||
581 | |||
582 | /****************************************************************************** | ||
583 | * Machine init | ||
584 | ******************************************************************************/ | ||
585 | static void __init vpac270_init(void) | ||
586 | { | ||
587 | pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config)); | ||
588 | |||
589 | pxa_set_ffuart_info(NULL); | ||
590 | pxa_set_btuart_info(NULL); | ||
591 | pxa_set_stuart_info(NULL); | ||
592 | |||
593 | vpac270_lcd_init(); | ||
594 | vpac270_mmc_init(); | ||
595 | vpac270_nor_init(); | ||
596 | vpac270_onenand_init(); | ||
597 | vpac270_leds_init(); | ||
598 | vpac270_keys_init(); | ||
599 | vpac270_uhc_init(); | ||
600 | vpac270_udc_init(); | ||
601 | vpac270_eth_init(); | ||
602 | vpac270_ts_init(); | ||
603 | vpac270_rtc_init(); | ||
604 | vpac270_ide_init(); | ||
605 | } | ||
606 | |||
607 | MACHINE_START(VPAC270, "Voipac PXA270") | ||
608 | .phys_io = 0x40000000, | ||
609 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
610 | .boot_params = 0xa0000100, | ||
611 | .map_io = pxa_map_io, | ||
612 | .init_irq = pxa27x_init_irq, | ||
613 | .timer = &pxa_timer, | ||
614 | .init_machine = vpac270_init | ||
615 | MACHINE_END | ||
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c new file mode 100644 index 000000000000..f5d1ae3db3a4 --- /dev/null +++ b/arch/arm/mach-pxa/z2.c | |||
@@ -0,0 +1,609 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/z2.c | ||
3 | * | ||
4 | * Support for the Zipit Z2 Handheld device. | ||
5 | * | ||
6 | * Author: Ken McGuire | ||
7 | * Created: Jan 25, 2009 | ||
8 | * Based on mainstone.c as modified for the Zipit Z2. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mtd/mtd.h> | ||
17 | #include <linux/mtd/partitions.h> | ||
18 | #include <linux/pwm_backlight.h> | ||
19 | #include <linux/dma-mapping.h> | ||
20 | #include <linux/spi/spi.h> | ||
21 | #include <linux/spi/libertas_spi.h> | ||
22 | #include <linux/spi/lms283gf05.h> | ||
23 | #include <linux/power_supply.h> | ||
24 | #include <linux/mtd/physmap.h> | ||
25 | #include <linux/gpio.h> | ||
26 | #include <linux/gpio_keys.h> | ||
27 | #include <linux/delay.h> | ||
28 | |||
29 | #include <asm/mach-types.h> | ||
30 | #include <asm/mach/arch.h> | ||
31 | |||
32 | #include <mach/pxa27x.h> | ||
33 | #include <mach/mfp-pxa27x.h> | ||
34 | #include <mach/z2.h> | ||
35 | #include <mach/pxafb.h> | ||
36 | #include <mach/mmc.h> | ||
37 | #include <mach/pxa27x_keypad.h> | ||
38 | #include <mach/pxa2xx_spi.h> | ||
39 | |||
40 | #include <plat/i2c.h> | ||
41 | |||
42 | #include "generic.h" | ||
43 | #include "devices.h" | ||
44 | |||
45 | /****************************************************************************** | ||
46 | * Pin configuration | ||
47 | ******************************************************************************/ | ||
48 | static unsigned long z2_pin_config[] = { | ||
49 | |||
50 | /* LCD - 16bpp Active TFT */ | ||
51 | GPIO58_LCD_LDD_0, | ||
52 | GPIO59_LCD_LDD_1, | ||
53 | GPIO60_LCD_LDD_2, | ||
54 | GPIO61_LCD_LDD_3, | ||
55 | GPIO62_LCD_LDD_4, | ||
56 | GPIO63_LCD_LDD_5, | ||
57 | GPIO64_LCD_LDD_6, | ||
58 | GPIO65_LCD_LDD_7, | ||
59 | GPIO66_LCD_LDD_8, | ||
60 | GPIO67_LCD_LDD_9, | ||
61 | GPIO68_LCD_LDD_10, | ||
62 | GPIO69_LCD_LDD_11, | ||
63 | GPIO70_LCD_LDD_12, | ||
64 | GPIO71_LCD_LDD_13, | ||
65 | GPIO72_LCD_LDD_14, | ||
66 | GPIO73_LCD_LDD_15, | ||
67 | GPIO74_LCD_FCLK, | ||
68 | GPIO75_LCD_LCLK, | ||
69 | GPIO76_LCD_PCLK, | ||
70 | GPIO77_LCD_BIAS, | ||
71 | GPIO19_GPIO, /* LCD reset */ | ||
72 | GPIO88_GPIO, /* LCD chipselect */ | ||
73 | |||
74 | /* PWM */ | ||
75 | GPIO115_PWM1_OUT, /* Keypad Backlight */ | ||
76 | GPIO11_PWM2_OUT, /* LCD Backlight */ | ||
77 | |||
78 | /* MMC */ | ||
79 | GPIO32_MMC_CLK, | ||
80 | GPIO112_MMC_CMD, | ||
81 | GPIO92_MMC_DAT_0, | ||
82 | GPIO109_MMC_DAT_1, | ||
83 | GPIO110_MMC_DAT_2, | ||
84 | GPIO111_MMC_DAT_3, | ||
85 | GPIO96_GPIO, /* SD detect */ | ||
86 | |||
87 | /* STUART */ | ||
88 | GPIO46_STUART_RXD, | ||
89 | GPIO47_STUART_TXD, | ||
90 | |||
91 | /* Keypad */ | ||
92 | GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, | ||
93 | GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, | ||
94 | GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, | ||
95 | GPIO34_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, | ||
96 | GPIO38_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, | ||
97 | GPIO16_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, | ||
98 | GPIO17_KP_MKIN_6 | WAKEUP_ON_LEVEL_HIGH, | ||
99 | GPIO103_KP_MKOUT_0, | ||
100 | GPIO104_KP_MKOUT_1, | ||
101 | GPIO105_KP_MKOUT_2, | ||
102 | GPIO106_KP_MKOUT_3, | ||
103 | GPIO107_KP_MKOUT_4, | ||
104 | GPIO108_KP_MKOUT_5, | ||
105 | GPIO35_KP_MKOUT_6, | ||
106 | GPIO41_KP_MKOUT_7, | ||
107 | |||
108 | /* I2C */ | ||
109 | GPIO117_I2C_SCL, | ||
110 | GPIO118_I2C_SDA, | ||
111 | |||
112 | /* SSP1 */ | ||
113 | GPIO23_SSP1_SCLK, /* SSP1_SCK */ | ||
114 | GPIO25_SSP1_TXD, /* SSP1_TXD */ | ||
115 | GPIO26_SSP1_RXD, /* SSP1_RXD */ | ||
116 | |||
117 | /* SSP2 */ | ||
118 | GPIO22_SSP2_SCLK, /* SSP2_SCK */ | ||
119 | GPIO13_SSP2_TXD, /* SSP2_TXD */ | ||
120 | GPIO40_SSP2_RXD, /* SSP2_RXD */ | ||
121 | |||
122 | /* LEDs */ | ||
123 | GPIO10_GPIO, /* WiFi LED */ | ||
124 | GPIO83_GPIO, /* Charging LED */ | ||
125 | GPIO85_GPIO, /* Charged LED */ | ||
126 | |||
127 | /* I2S */ | ||
128 | GPIO28_I2S_BITCLK_OUT, | ||
129 | GPIO29_I2S_SDATA_IN, | ||
130 | GPIO30_I2S_SDATA_OUT, | ||
131 | GPIO31_I2S_SYNC, | ||
132 | GPIO113_I2S_SYSCLK, | ||
133 | |||
134 | /* MISC */ | ||
135 | GPIO0_GPIO, /* AC power detect */ | ||
136 | GPIO1_GPIO, /* Power button */ | ||
137 | GPIO37_GPIO, /* Headphone detect */ | ||
138 | GPIO98_GPIO, /* Lid switch */ | ||
139 | GPIO14_GPIO, /* WiFi Reset */ | ||
140 | GPIO15_GPIO, /* WiFi Power */ | ||
141 | GPIO24_GPIO, /* WiFi CS */ | ||
142 | GPIO36_GPIO, /* WiFi IRQ */ | ||
143 | GPIO88_GPIO, /* LCD CS */ | ||
144 | }; | ||
145 | |||
146 | /****************************************************************************** | ||
147 | * NOR Flash | ||
148 | ******************************************************************************/ | ||
149 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | ||
150 | static struct resource z2_flash_resource = { | ||
151 | .start = PXA_CS0_PHYS, | ||
152 | .end = PXA_CS0_PHYS + SZ_8M - 1, | ||
153 | .flags = IORESOURCE_MEM, | ||
154 | }; | ||
155 | |||
156 | static struct mtd_partition z2_flash_parts[] = { | ||
157 | { | ||
158 | .name = "U-Boot Bootloader", | ||
159 | .offset = 0x0, | ||
160 | .size = 0x20000, | ||
161 | }, | ||
162 | { | ||
163 | .name = "Linux Kernel", | ||
164 | .offset = 0x20000, | ||
165 | .size = 0x220000, | ||
166 | }, | ||
167 | { | ||
168 | .name = "Filesystem", | ||
169 | .offset = 0x240000, | ||
170 | .size = 0x5b0000, | ||
171 | }, | ||
172 | { | ||
173 | .name = "U-Boot Environment", | ||
174 | .offset = 0x7f0000, | ||
175 | .size = MTDPART_SIZ_FULL, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct physmap_flash_data z2_flash_data = { | ||
180 | .width = 2, | ||
181 | .parts = z2_flash_parts, | ||
182 | .nr_parts = ARRAY_SIZE(z2_flash_parts), | ||
183 | }; | ||
184 | |||
185 | static struct platform_device z2_flash = { | ||
186 | .name = "physmap-flash", | ||
187 | .id = -1, | ||
188 | .resource = &z2_flash_resource, | ||
189 | .num_resources = 1, | ||
190 | .dev = { | ||
191 | .platform_data = &z2_flash_data, | ||
192 | }, | ||
193 | }; | ||
194 | |||
195 | static void __init z2_nor_init(void) | ||
196 | { | ||
197 | platform_device_register(&z2_flash); | ||
198 | } | ||
199 | #else | ||
200 | static inline void z2_nor_init(void) {} | ||
201 | #endif | ||
202 | |||
203 | /****************************************************************************** | ||
204 | * Backlight | ||
205 | ******************************************************************************/ | ||
206 | #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) | ||
207 | static struct platform_pwm_backlight_data z2_backlight_data[] = { | ||
208 | [0] = { | ||
209 | /* Keypad Backlight */ | ||
210 | .pwm_id = 1, | ||
211 | .max_brightness = 1023, | ||
212 | .dft_brightness = 512, | ||
213 | .pwm_period_ns = 1260320, | ||
214 | }, | ||
215 | [1] = { | ||
216 | /* LCD Backlight */ | ||
217 | .pwm_id = 2, | ||
218 | .max_brightness = 1023, | ||
219 | .dft_brightness = 512, | ||
220 | .pwm_period_ns = 1260320, | ||
221 | }, | ||
222 | }; | ||
223 | |||
224 | static struct platform_device z2_backlight_devices[2] = { | ||
225 | { | ||
226 | .name = "pwm-backlight", | ||
227 | .id = 0, | ||
228 | .dev = { | ||
229 | .platform_data = &z2_backlight_data[1], | ||
230 | }, | ||
231 | }, | ||
232 | { | ||
233 | .name = "pwm-backlight", | ||
234 | .id = 1, | ||
235 | .dev = { | ||
236 | .platform_data = &z2_backlight_data[0], | ||
237 | }, | ||
238 | }, | ||
239 | }; | ||
240 | static void __init z2_pwm_init(void) | ||
241 | { | ||
242 | platform_device_register(&z2_backlight_devices[0]); | ||
243 | platform_device_register(&z2_backlight_devices[1]); | ||
244 | } | ||
245 | #else | ||
246 | static inline void z2_pwm_init(void) {} | ||
247 | #endif | ||
248 | |||
249 | /****************************************************************************** | ||
250 | * Framebuffer | ||
251 | ******************************************************************************/ | ||
252 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
253 | static struct pxafb_mode_info z2_lcd_modes[] = { | ||
254 | { | ||
255 | .pixclock = 192000, | ||
256 | .xres = 240, | ||
257 | .yres = 320, | ||
258 | .bpp = 16, | ||
259 | |||
260 | .left_margin = 4, | ||
261 | .right_margin = 8, | ||
262 | .upper_margin = 4, | ||
263 | .lower_margin = 8, | ||
264 | |||
265 | .hsync_len = 4, | ||
266 | .vsync_len = 4, | ||
267 | }, | ||
268 | }; | ||
269 | |||
270 | static struct pxafb_mach_info z2_lcd_screen = { | ||
271 | .modes = z2_lcd_modes, | ||
272 | .num_modes = ARRAY_SIZE(z2_lcd_modes), | ||
273 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_BIAS_ACTIVE_LOW | | ||
274 | LCD_ALTERNATE_MAPPING, | ||
275 | }; | ||
276 | |||
277 | static void __init z2_lcd_init(void) | ||
278 | { | ||
279 | set_pxa_fb_info(&z2_lcd_screen); | ||
280 | } | ||
281 | #else | ||
282 | static inline void z2_lcd_init(void) {} | ||
283 | #endif | ||
284 | |||
285 | /****************************************************************************** | ||
286 | * SD/MMC card controller | ||
287 | ******************************************************************************/ | ||
288 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
289 | static struct pxamci_platform_data z2_mci_platform_data = { | ||
290 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
291 | .gpio_card_detect = GPIO96_ZIPITZ2_SD_DETECT, | ||
292 | .gpio_power = -1, | ||
293 | .gpio_card_ro = -1, | ||
294 | .detect_delay_ms = 200, | ||
295 | }; | ||
296 | |||
297 | static void __init z2_mmc_init(void) | ||
298 | { | ||
299 | pxa_set_mci_info(&z2_mci_platform_data); | ||
300 | } | ||
301 | #else | ||
302 | static inline void z2_mmc_init(void) {} | ||
303 | #endif | ||
304 | |||
305 | /****************************************************************************** | ||
306 | * LEDs | ||
307 | ******************************************************************************/ | ||
308 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | ||
309 | struct gpio_led z2_gpio_leds[] = { | ||
310 | { | ||
311 | .name = "z2:green:wifi", | ||
312 | .default_trigger = "none", | ||
313 | .gpio = GPIO10_ZIPITZ2_LED_WIFI, | ||
314 | .active_low = 1, | ||
315 | }, { | ||
316 | .name = "z2:green:charged", | ||
317 | .default_trigger = "none", | ||
318 | .gpio = GPIO85_ZIPITZ2_LED_CHARGED, | ||
319 | .active_low = 1, | ||
320 | }, { | ||
321 | .name = "z2:amber:charging", | ||
322 | .default_trigger = "none", | ||
323 | .gpio = GPIO83_ZIPITZ2_LED_CHARGING, | ||
324 | .active_low = 1, | ||
325 | }, | ||
326 | }; | ||
327 | |||
328 | static struct gpio_led_platform_data z2_gpio_led_info = { | ||
329 | .leds = z2_gpio_leds, | ||
330 | .num_leds = ARRAY_SIZE(z2_gpio_leds), | ||
331 | }; | ||
332 | |||
333 | static struct platform_device z2_leds = { | ||
334 | .name = "leds-gpio", | ||
335 | .id = -1, | ||
336 | .dev = { | ||
337 | .platform_data = &z2_gpio_led_info, | ||
338 | } | ||
339 | }; | ||
340 | |||
341 | static void __init z2_leds_init(void) | ||
342 | { | ||
343 | platform_device_register(&z2_leds); | ||
344 | } | ||
345 | #else | ||
346 | static inline void z2_leds_init(void) {} | ||
347 | #endif | ||
348 | |||
349 | /****************************************************************************** | ||
350 | * GPIO keyboard | ||
351 | ******************************************************************************/ | ||
352 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) | ||
353 | static unsigned int z2_matrix_keys[] = { | ||
354 | KEY(0, 0, KEY_OPTION), | ||
355 | KEY(1, 0, KEY_UP), | ||
356 | KEY(2, 0, KEY_DOWN), | ||
357 | KEY(3, 0, KEY_LEFT), | ||
358 | KEY(4, 0, KEY_RIGHT), | ||
359 | KEY(5, 0, KEY_END), | ||
360 | KEY(6, 0, KEY_KPPLUS), | ||
361 | |||
362 | KEY(0, 1, KEY_HOME), | ||
363 | KEY(1, 1, KEY_Q), | ||
364 | KEY(2, 1, KEY_I), | ||
365 | KEY(3, 1, KEY_G), | ||
366 | KEY(4, 1, KEY_X), | ||
367 | KEY(5, 1, KEY_ENTER), | ||
368 | KEY(6, 1, KEY_KPMINUS), | ||
369 | |||
370 | KEY(0, 2, KEY_PAGEUP), | ||
371 | KEY(1, 2, KEY_W), | ||
372 | KEY(2, 2, KEY_O), | ||
373 | KEY(3, 2, KEY_H), | ||
374 | KEY(4, 2, KEY_C), | ||
375 | KEY(5, 2, KEY_LEFTALT), | ||
376 | |||
377 | KEY(0, 3, KEY_PAGEDOWN), | ||
378 | KEY(1, 3, KEY_E), | ||
379 | KEY(2, 3, KEY_P), | ||
380 | KEY(3, 3, KEY_J), | ||
381 | KEY(4, 3, KEY_V), | ||
382 | KEY(5, 3, KEY_LEFTSHIFT), | ||
383 | |||
384 | KEY(0, 4, KEY_ESC), | ||
385 | KEY(1, 4, KEY_R), | ||
386 | KEY(2, 4, KEY_A), | ||
387 | KEY(3, 4, KEY_K), | ||
388 | KEY(4, 4, KEY_B), | ||
389 | KEY(5, 4, KEY_LEFTCTRL), | ||
390 | |||
391 | KEY(0, 5, KEY_TAB), | ||
392 | KEY(1, 5, KEY_T), | ||
393 | KEY(2, 5, KEY_S), | ||
394 | KEY(3, 5, KEY_L), | ||
395 | KEY(4, 5, KEY_N), | ||
396 | KEY(5, 5, KEY_SPACE), | ||
397 | |||
398 | KEY(0, 6, KEY_STOPCD), | ||
399 | KEY(1, 6, KEY_Y), | ||
400 | KEY(2, 6, KEY_D), | ||
401 | KEY(3, 6, KEY_BACKSPACE), | ||
402 | KEY(4, 6, KEY_M), | ||
403 | KEY(5, 6, KEY_COMMA), | ||
404 | |||
405 | KEY(0, 7, KEY_PLAYCD), | ||
406 | KEY(1, 7, KEY_U), | ||
407 | KEY(2, 7, KEY_F), | ||
408 | KEY(3, 7, KEY_Z), | ||
409 | KEY(4, 7, KEY_SEMICOLON), | ||
410 | KEY(5, 7, KEY_DOT), | ||
411 | }; | ||
412 | |||
413 | static struct pxa27x_keypad_platform_data z2_keypad_platform_data = { | ||
414 | .matrix_key_rows = 7, | ||
415 | .matrix_key_cols = 8, | ||
416 | .matrix_key_map = z2_matrix_keys, | ||
417 | .matrix_key_map_size = ARRAY_SIZE(z2_matrix_keys), | ||
418 | |||
419 | .debounce_interval = 30, | ||
420 | }; | ||
421 | |||
422 | static void __init z2_mkp_init(void) | ||
423 | { | ||
424 | pxa_set_keypad_info(&z2_keypad_platform_data); | ||
425 | } | ||
426 | #else | ||
427 | static inline void z2_mkp_init(void) {} | ||
428 | #endif | ||
429 | |||
430 | /****************************************************************************** | ||
431 | * GPIO keys | ||
432 | ******************************************************************************/ | ||
433 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
434 | static struct gpio_keys_button z2_pxa_buttons[] = { | ||
435 | {KEY_POWER, GPIO1_ZIPITZ2_POWER_BUTTON, 0, "Power Button" }, | ||
436 | {KEY_CLOSE, GPIO98_ZIPITZ2_LID_BUTTON, 0, "Lid Button" }, | ||
437 | }; | ||
438 | |||
439 | static struct gpio_keys_platform_data z2_pxa_keys_data = { | ||
440 | .buttons = z2_pxa_buttons, | ||
441 | .nbuttons = ARRAY_SIZE(z2_pxa_buttons), | ||
442 | }; | ||
443 | |||
444 | static struct platform_device z2_pxa_keys = { | ||
445 | .name = "gpio-keys", | ||
446 | .id = -1, | ||
447 | .dev = { | ||
448 | .platform_data = &z2_pxa_keys_data, | ||
449 | }, | ||
450 | }; | ||
451 | |||
452 | static void __init z2_keys_init(void) | ||
453 | { | ||
454 | platform_device_register(&z2_pxa_keys); | ||
455 | } | ||
456 | #else | ||
457 | static inline void z2_keys_init(void) {} | ||
458 | #endif | ||
459 | |||
460 | /****************************************************************************** | ||
461 | * SSP Devices - WiFi and LCD control | ||
462 | ******************************************************************************/ | ||
463 | #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) | ||
464 | /* WiFi */ | ||
465 | static int z2_lbs_spi_setup(struct spi_device *spi) | ||
466 | { | ||
467 | int ret = 0; | ||
468 | |||
469 | ret = gpio_request(GPIO15_ZIPITZ2_WIFI_POWER, "WiFi Power"); | ||
470 | if (ret) | ||
471 | goto err; | ||
472 | |||
473 | ret = gpio_direction_output(GPIO15_ZIPITZ2_WIFI_POWER, 1); | ||
474 | if (ret) | ||
475 | goto err2; | ||
476 | |||
477 | ret = gpio_request(GPIO14_ZIPITZ2_WIFI_RESET, "WiFi Reset"); | ||
478 | if (ret) | ||
479 | goto err2; | ||
480 | |||
481 | ret = gpio_direction_output(GPIO14_ZIPITZ2_WIFI_RESET, 0); | ||
482 | if (ret) | ||
483 | goto err3; | ||
484 | |||
485 | /* Reset the card */ | ||
486 | mdelay(180); | ||
487 | gpio_set_value(GPIO14_ZIPITZ2_WIFI_RESET, 1); | ||
488 | mdelay(20); | ||
489 | |||
490 | spi->bits_per_word = 16; | ||
491 | spi->mode = SPI_MODE_2, | ||
492 | |||
493 | spi_setup(spi); | ||
494 | |||
495 | return 0; | ||
496 | |||
497 | err3: | ||
498 | gpio_free(GPIO14_ZIPITZ2_WIFI_RESET); | ||
499 | err2: | ||
500 | gpio_free(GPIO15_ZIPITZ2_WIFI_POWER); | ||
501 | err: | ||
502 | return ret; | ||
503 | }; | ||
504 | |||
505 | static int z2_lbs_spi_teardown(struct spi_device *spi) | ||
506 | { | ||
507 | gpio_set_value(GPIO14_ZIPITZ2_WIFI_RESET, 0); | ||
508 | gpio_set_value(GPIO15_ZIPITZ2_WIFI_POWER, 0); | ||
509 | gpio_free(GPIO14_ZIPITZ2_WIFI_RESET); | ||
510 | gpio_free(GPIO15_ZIPITZ2_WIFI_POWER); | ||
511 | return 0; | ||
512 | |||
513 | }; | ||
514 | |||
515 | static struct pxa2xx_spi_chip z2_lbs_chip_info = { | ||
516 | .rx_threshold = 8, | ||
517 | .tx_threshold = 8, | ||
518 | .timeout = 1000, | ||
519 | .gpio_cs = GPIO24_ZIPITZ2_WIFI_CS, | ||
520 | }; | ||
521 | |||
522 | static struct libertas_spi_platform_data z2_lbs_pdata = { | ||
523 | .use_dummy_writes = 1, | ||
524 | .setup = z2_lbs_spi_setup, | ||
525 | .teardown = z2_lbs_spi_teardown, | ||
526 | }; | ||
527 | |||
528 | /* LCD */ | ||
529 | static struct pxa2xx_spi_chip lms283_chip_info = { | ||
530 | .rx_threshold = 1, | ||
531 | .tx_threshold = 1, | ||
532 | .timeout = 64, | ||
533 | .gpio_cs = GPIO88_ZIPITZ2_LCD_CS, | ||
534 | }; | ||
535 | |||
536 | static const struct lms283gf05_pdata lms283_pdata = { | ||
537 | .reset_gpio = GPIO19_ZIPITZ2_LCD_RESET, | ||
538 | }; | ||
539 | |||
540 | static struct spi_board_info spi_board_info[] __initdata = { | ||
541 | { | ||
542 | .modalias = "libertas_spi", | ||
543 | .platform_data = &z2_lbs_pdata, | ||
544 | .controller_data = &z2_lbs_chip_info, | ||
545 | .irq = gpio_to_irq(GPIO36_ZIPITZ2_WIFI_IRQ), | ||
546 | .max_speed_hz = 13000000, | ||
547 | .bus_num = 1, | ||
548 | .chip_select = 0, | ||
549 | }, | ||
550 | { | ||
551 | .modalias = "lms283gf05", | ||
552 | .controller_data = &lms283_chip_info, | ||
553 | .platform_data = &lms283_pdata, | ||
554 | .max_speed_hz = 400000, | ||
555 | .bus_num = 2, | ||
556 | .chip_select = 0, | ||
557 | }, | ||
558 | }; | ||
559 | |||
560 | static struct pxa2xx_spi_master pxa_ssp1_master_info = { | ||
561 | .clock_enable = CKEN_SSP, | ||
562 | .num_chipselect = 1, | ||
563 | .enable_dma = 1, | ||
564 | }; | ||
565 | |||
566 | static struct pxa2xx_spi_master pxa_ssp2_master_info = { | ||
567 | .clock_enable = CKEN_SSP2, | ||
568 | .num_chipselect = 1, | ||
569 | }; | ||
570 | |||
571 | static void __init z2_spi_init(void) | ||
572 | { | ||
573 | pxa2xx_set_spi_info(1, &pxa_ssp1_master_info); | ||
574 | pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); | ||
575 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); | ||
576 | } | ||
577 | #else | ||
578 | static inline void z2_spi_init(void) {} | ||
579 | #endif | ||
580 | |||
581 | /****************************************************************************** | ||
582 | * Machine init | ||
583 | ******************************************************************************/ | ||
584 | static void __init z2_init(void) | ||
585 | { | ||
586 | pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config)); | ||
587 | |||
588 | z2_lcd_init(); | ||
589 | z2_mmc_init(); | ||
590 | z2_mkp_init(); | ||
591 | |||
592 | pxa_set_i2c_info(NULL); | ||
593 | |||
594 | z2_spi_init(); | ||
595 | z2_nor_init(); | ||
596 | z2_pwm_init(); | ||
597 | z2_leds_init(); | ||
598 | z2_keys_init(); | ||
599 | } | ||
600 | |||
601 | MACHINE_START(ZIPIT2, "Zipit Z2") | ||
602 | .phys_io = 0x40000000, | ||
603 | .boot_params = 0xa0000100, | ||
604 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
605 | .map_io = pxa_map_io, | ||
606 | .init_irq = pxa27x_init_irq, | ||
607 | .timer = &pxa_timer, | ||
608 | .init_machine = z2_init, | ||
609 | MACHINE_END | ||
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index 39896d883584..3680f6a90623 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
@@ -644,7 +644,7 @@ static struct pxafb_mach_info zeus_fb_info = { | |||
644 | 644 | ||
645 | static struct pxamci_platform_data zeus_mci_platform_data = { | 645 | static struct pxamci_platform_data zeus_mci_platform_data = { |
646 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 646 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
647 | .detect_delay = HZ/4, | 647 | .detect_delay_ms = 250, |
648 | .gpio_card_detect = ZEUS_MMC_CD_GPIO, | 648 | .gpio_card_detect = ZEUS_MMC_CD_GPIO, |
649 | .gpio_card_ro = ZEUS_MMC_WP_GPIO, | 649 | .gpio_card_ro = ZEUS_MMC_WP_GPIO, |
650 | .gpio_card_ro_invert = 1, | 650 | .gpio_card_ro_invert = 1, |
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 2b4043c04d0c..c479cbecf784 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -218,7 +218,7 @@ static inline void zylonite_init_lcd(void) {} | |||
218 | 218 | ||
219 | #if defined(CONFIG_MMC) | 219 | #if defined(CONFIG_MMC) |
220 | static struct pxamci_platform_data zylonite_mci_platform_data = { | 220 | static struct pxamci_platform_data zylonite_mci_platform_data = { |
221 | .detect_delay = 20, | 221 | .detect_delay_ms= 200, |
222 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 222 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
223 | .gpio_card_detect = EXT_GPIO(0), | 223 | .gpio_card_detect = EXT_GPIO(0), |
224 | .gpio_card_ro = EXT_GPIO(2), | 224 | .gpio_card_ro = EXT_GPIO(2), |
@@ -226,7 +226,7 @@ static struct pxamci_platform_data zylonite_mci_platform_data = { | |||
226 | }; | 226 | }; |
227 | 227 | ||
228 | static struct pxamci_platform_data zylonite_mci2_platform_data = { | 228 | static struct pxamci_platform_data zylonite_mci2_platform_data = { |
229 | .detect_delay = 20, | 229 | .detect_delay_ms= 200, |
230 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 230 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
231 | .gpio_card_detect = EXT_GPIO(1), | 231 | .gpio_card_detect = EXT_GPIO(1), |
232 | .gpio_card_ro = EXT_GPIO(3), | 232 | .gpio_card_ro = EXT_GPIO(3), |
@@ -234,7 +234,7 @@ static struct pxamci_platform_data zylonite_mci2_platform_data = { | |||
234 | }; | 234 | }; |
235 | 235 | ||
236 | static struct pxamci_platform_data zylonite_mci3_platform_data = { | 236 | static struct pxamci_platform_data zylonite_mci3_platform_data = { |
237 | .detect_delay = 20, | 237 | .detect_delay_ms= 200, |
238 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 238 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
239 | .gpio_card_detect = EXT_GPIO(30), | 239 | .gpio_card_detect = EXT_GPIO(30), |
240 | .gpio_card_ro = EXT_GPIO(31), | 240 | .gpio_card_ro = EXT_GPIO(31), |
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile index e704edb733c0..a01b76b7c956 100644 --- a/arch/arm/mach-realview/Makefile +++ b/arch/arm/mach-realview/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := core.o clock.o | 5 | obj-y := core.o |
6 | obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o | 6 | obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o |
7 | obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o | 7 | obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o |
8 | obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o | 8 | obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o |
diff --git a/arch/arm/mach-realview/clock.c b/arch/arm/mach-realview/clock.c deleted file mode 100644 index a7043115de72..000000000000 --- a/arch/arm/mach-realview/clock.c +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-realview/clock.c | ||
3 | * | ||
4 | * Copyright (C) 2004 ARM Limited. | ||
5 | * Written by Deep Blue Solutions Limited. | ||
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 | #include <linux/module.h> | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/device.h> | ||
14 | #include <linux/list.h> | ||
15 | #include <linux/errno.h> | ||
16 | #include <linux/err.h> | ||
17 | #include <linux/string.h> | ||
18 | #include <linux/clk.h> | ||
19 | #include <linux/mutex.h> | ||
20 | |||
21 | #include <asm/hardware/icst307.h> | ||
22 | |||
23 | #include "clock.h" | ||
24 | |||
25 | int clk_enable(struct clk *clk) | ||
26 | { | ||
27 | return 0; | ||
28 | } | ||
29 | EXPORT_SYMBOL(clk_enable); | ||
30 | |||
31 | void clk_disable(struct clk *clk) | ||
32 | { | ||
33 | } | ||
34 | EXPORT_SYMBOL(clk_disable); | ||
35 | |||
36 | unsigned long clk_get_rate(struct clk *clk) | ||
37 | { | ||
38 | return clk->rate; | ||
39 | } | ||
40 | EXPORT_SYMBOL(clk_get_rate); | ||
41 | |||
42 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
43 | { | ||
44 | struct icst307_vco vco; | ||
45 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
46 | return icst307_khz(clk->params, vco) * 1000; | ||
47 | } | ||
48 | EXPORT_SYMBOL(clk_round_rate); | ||
49 | |||
50 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
51 | { | ||
52 | int ret = -EIO; | ||
53 | |||
54 | if (clk->setvco) { | ||
55 | struct icst307_vco vco; | ||
56 | |||
57 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
58 | clk->rate = icst307_khz(clk->params, vco) * 1000; | ||
59 | clk->setvco(clk, vco); | ||
60 | ret = 0; | ||
61 | } | ||
62 | return ret; | ||
63 | } | ||
64 | EXPORT_SYMBOL(clk_set_rate); | ||
diff --git a/arch/arm/mach-realview/clock.h b/arch/arm/mach-realview/clock.h deleted file mode 100644 index ebbb0f06b600..000000000000 --- a/arch/arm/mach-realview/clock.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-realview/clock.h | ||
3 | * | ||
4 | * Copyright (C) 2004 ARM Limited. | ||
5 | * Written by Deep Blue Solutions Limited. | ||
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 | struct module; | ||
12 | struct icst307_params; | ||
13 | |||
14 | struct clk { | ||
15 | unsigned long rate; | ||
16 | const struct icst307_params *params; | ||
17 | void *data; | ||
18 | void (*setvco)(struct clk *, struct icst307_vco vco); | ||
19 | }; | ||
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index d5a95738f85b..595be19f8ad5 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -25,8 +25,6 @@ | |||
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/amba/bus.h> | 26 | #include <linux/amba/bus.h> |
27 | #include <linux/amba/clcd.h> | 27 | #include <linux/amba/clcd.h> |
28 | #include <linux/clocksource.h> | ||
29 | #include <linux/clockchips.h> | ||
30 | #include <linux/io.h> | 28 | #include <linux/io.h> |
31 | #include <linux/smsc911x.h> | 29 | #include <linux/smsc911x.h> |
32 | #include <linux/ata_platform.h> | 30 | #include <linux/ata_platform.h> |
@@ -40,7 +38,7 @@ | |||
40 | #include <asm/leds.h> | 38 | #include <asm/leds.h> |
41 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
42 | #include <asm/hardware/arm_timer.h> | 40 | #include <asm/hardware/arm_timer.h> |
43 | #include <asm/hardware/icst307.h> | 41 | #include <asm/hardware/icst.h> |
44 | 42 | ||
45 | #include <asm/mach/arch.h> | 43 | #include <asm/mach/arch.h> |
46 | #include <asm/mach/flash.h> | 44 | #include <asm/mach/flash.h> |
@@ -49,13 +47,12 @@ | |||
49 | 47 | ||
50 | #include <asm/hardware/gic.h> | 48 | #include <asm/hardware/gic.h> |
51 | 49 | ||
50 | #include <mach/clkdev.h> | ||
52 | #include <mach/platform.h> | 51 | #include <mach/platform.h> |
53 | #include <mach/irqs.h> | 52 | #include <mach/irqs.h> |
53 | #include <plat/timer-sp.h> | ||
54 | 54 | ||
55 | #include "core.h" | 55 | #include "core.h" |
56 | #include "clock.h" | ||
57 | |||
58 | #define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) | ||
59 | 56 | ||
60 | /* used by entry-macro.S and platsmp.c */ | 57 | /* used by entry-macro.S and platsmp.c */ |
61 | void __iomem *gic_cpu_base_addr; | 58 | void __iomem *gic_cpu_base_addr; |
@@ -79,20 +76,6 @@ void __init realview_adjust_zones(int node, unsigned long *size, | |||
79 | } | 76 | } |
80 | #endif | 77 | #endif |
81 | 78 | ||
82 | /* | ||
83 | * This is the RealView sched_clock implementation. This has | ||
84 | * a resolution of 41.7ns, and a maximum value of about 179s. | ||
85 | */ | ||
86 | unsigned long long sched_clock(void) | ||
87 | { | ||
88 | unsigned long long v; | ||
89 | |||
90 | v = (unsigned long long)readl(REALVIEW_REFCOUNTER) * 125; | ||
91 | do_div(v, 3); | ||
92 | |||
93 | return v; | ||
94 | } | ||
95 | |||
96 | 79 | ||
97 | #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) | 80 | #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) |
98 | 81 | ||
@@ -274,37 +257,40 @@ struct mmci_platform_data realview_mmc1_plat_data = { | |||
274 | /* | 257 | /* |
275 | * Clock handling | 258 | * Clock handling |
276 | */ | 259 | */ |
277 | static const struct icst307_params realview_oscvco_params = { | 260 | static const struct icst_params realview_oscvco_params = { |
278 | .ref = 24000, | 261 | .ref = 24000000, |
279 | .vco_max = 200000, | 262 | .vco_max = ICST307_VCO_MAX, |
263 | .vco_min = ICST307_VCO_MIN, | ||
280 | .vd_min = 4 + 8, | 264 | .vd_min = 4 + 8, |
281 | .vd_max = 511 + 8, | 265 | .vd_max = 511 + 8, |
282 | .rd_min = 1 + 2, | 266 | .rd_min = 1 + 2, |
283 | .rd_max = 127 + 2, | 267 | .rd_max = 127 + 2, |
268 | .s2div = icst307_s2div, | ||
269 | .idx2s = icst307_idx2s, | ||
284 | }; | 270 | }; |
285 | 271 | ||
286 | static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco) | 272 | static void realview_oscvco_set(struct clk *clk, struct icst_vco vco) |
287 | { | 273 | { |
288 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; | 274 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; |
289 | void __iomem *sys_osc; | ||
290 | u32 val; | 275 | u32 val; |
291 | 276 | ||
292 | if (machine_is_realview_pb1176()) | 277 | val = readl(clk->vcoreg) & ~0x7ffff; |
293 | sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; | ||
294 | else | ||
295 | sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; | ||
296 | |||
297 | val = readl(sys_osc) & ~0x7ffff; | ||
298 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 278 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
299 | 279 | ||
300 | writel(0xa05f, sys_lock); | 280 | writel(0xa05f, sys_lock); |
301 | writel(val, sys_osc); | 281 | writel(val, clk->vcoreg); |
302 | writel(0, sys_lock); | 282 | writel(0, sys_lock); |
303 | } | 283 | } |
304 | 284 | ||
285 | static const struct clk_ops oscvco_clk_ops = { | ||
286 | .round = icst_clk_round, | ||
287 | .set = icst_clk_set, | ||
288 | .setvco = realview_oscvco_set, | ||
289 | }; | ||
290 | |||
305 | static struct clk oscvco_clk = { | 291 | static struct clk oscvco_clk = { |
292 | .ops = &oscvco_clk_ops, | ||
306 | .params = &realview_oscvco_params, | 293 | .params = &realview_oscvco_params, |
307 | .setvco = realview_oscvco_set, | ||
308 | }; | 294 | }; |
309 | 295 | ||
310 | /* | 296 | /* |
@@ -347,7 +333,13 @@ static struct clk_lookup lookups[] = { | |||
347 | 333 | ||
348 | static int __init clk_init(void) | 334 | static int __init clk_init(void) |
349 | { | 335 | { |
336 | if (machine_is_realview_pb1176()) | ||
337 | oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; | ||
338 | else | ||
339 | oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; | ||
340 | |||
350 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 341 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
342 | |||
351 | return 0; | 343 | return 0; |
352 | } | 344 | } |
353 | arch_initcall(clk_init); | 345 | arch_initcall(clk_init); |
@@ -644,133 +636,6 @@ void __iomem *timer2_va_base; | |||
644 | void __iomem *timer3_va_base; | 636 | void __iomem *timer3_va_base; |
645 | 637 | ||
646 | /* | 638 | /* |
647 | * How long is the timer interval? | ||
648 | */ | ||
649 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
650 | #if TIMER_INTERVAL >= 0x100000 | ||
651 | #define TIMER_RELOAD (TIMER_INTERVAL >> 8) | ||
652 | #define TIMER_DIVISOR (TIMER_CTRL_DIV256) | ||
653 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
654 | #elif TIMER_INTERVAL >= 0x10000 | ||
655 | #define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */ | ||
656 | #define TIMER_DIVISOR (TIMER_CTRL_DIV16) | ||
657 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
658 | #else | ||
659 | #define TIMER_RELOAD (TIMER_INTERVAL) | ||
660 | #define TIMER_DIVISOR (TIMER_CTRL_DIV1) | ||
661 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
662 | #endif | ||
663 | |||
664 | static void timer_set_mode(enum clock_event_mode mode, | ||
665 | struct clock_event_device *clk) | ||
666 | { | ||
667 | unsigned long ctrl; | ||
668 | |||
669 | switch(mode) { | ||
670 | case CLOCK_EVT_MODE_PERIODIC: | ||
671 | writel(TIMER_RELOAD, timer0_va_base + TIMER_LOAD); | ||
672 | |||
673 | ctrl = TIMER_CTRL_PERIODIC; | ||
674 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE; | ||
675 | break; | ||
676 | case CLOCK_EVT_MODE_ONESHOT: | ||
677 | /* period set, and timer enabled in 'next_event' hook */ | ||
678 | ctrl = TIMER_CTRL_ONESHOT; | ||
679 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE; | ||
680 | break; | ||
681 | case CLOCK_EVT_MODE_UNUSED: | ||
682 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
683 | default: | ||
684 | ctrl = 0; | ||
685 | } | ||
686 | |||
687 | writel(ctrl, timer0_va_base + TIMER_CTRL); | ||
688 | } | ||
689 | |||
690 | static int timer_set_next_event(unsigned long evt, | ||
691 | struct clock_event_device *unused) | ||
692 | { | ||
693 | unsigned long ctrl = readl(timer0_va_base + TIMER_CTRL); | ||
694 | |||
695 | writel(evt, timer0_va_base + TIMER_LOAD); | ||
696 | writel(ctrl | TIMER_CTRL_ENABLE, timer0_va_base + TIMER_CTRL); | ||
697 | |||
698 | return 0; | ||
699 | } | ||
700 | |||
701 | static struct clock_event_device timer0_clockevent = { | ||
702 | .name = "timer0", | ||
703 | .shift = 32, | ||
704 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
705 | .set_mode = timer_set_mode, | ||
706 | .set_next_event = timer_set_next_event, | ||
707 | .rating = 300, | ||
708 | .cpumask = cpu_all_mask, | ||
709 | }; | ||
710 | |||
711 | static void __init realview_clockevents_init(unsigned int timer_irq) | ||
712 | { | ||
713 | timer0_clockevent.irq = timer_irq; | ||
714 | timer0_clockevent.mult = | ||
715 | div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift); | ||
716 | timer0_clockevent.max_delta_ns = | ||
717 | clockevent_delta2ns(0xffffffff, &timer0_clockevent); | ||
718 | timer0_clockevent.min_delta_ns = | ||
719 | clockevent_delta2ns(0xf, &timer0_clockevent); | ||
720 | |||
721 | clockevents_register_device(&timer0_clockevent); | ||
722 | } | ||
723 | |||
724 | /* | ||
725 | * IRQ handler for the timer | ||
726 | */ | ||
727 | static irqreturn_t realview_timer_interrupt(int irq, void *dev_id) | ||
728 | { | ||
729 | struct clock_event_device *evt = &timer0_clockevent; | ||
730 | |||
731 | /* clear the interrupt */ | ||
732 | writel(1, timer0_va_base + TIMER_INTCLR); | ||
733 | |||
734 | evt->event_handler(evt); | ||
735 | |||
736 | return IRQ_HANDLED; | ||
737 | } | ||
738 | |||
739 | static struct irqaction realview_timer_irq = { | ||
740 | .name = "RealView Timer Tick", | ||
741 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
742 | .handler = realview_timer_interrupt, | ||
743 | }; | ||
744 | |||
745 | static cycle_t realview_get_cycles(struct clocksource *cs) | ||
746 | { | ||
747 | return ~readl(timer3_va_base + TIMER_VALUE); | ||
748 | } | ||
749 | |||
750 | static struct clocksource clocksource_realview = { | ||
751 | .name = "timer3", | ||
752 | .rating = 200, | ||
753 | .read = realview_get_cycles, | ||
754 | .mask = CLOCKSOURCE_MASK(32), | ||
755 | .shift = 20, | ||
756 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
757 | }; | ||
758 | |||
759 | static void __init realview_clocksource_init(void) | ||
760 | { | ||
761 | /* setup timer 0 as free-running clocksource */ | ||
762 | writel(0, timer3_va_base + TIMER_CTRL); | ||
763 | writel(0xffffffff, timer3_va_base + TIMER_LOAD); | ||
764 | writel(0xffffffff, timer3_va_base + TIMER_VALUE); | ||
765 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | ||
766 | timer3_va_base + TIMER_CTRL); | ||
767 | |||
768 | clocksource_realview.mult = | ||
769 | clocksource_khz2mult(1000, clocksource_realview.shift); | ||
770 | clocksource_register(&clocksource_realview); | ||
771 | } | ||
772 | |||
773 | /* | ||
774 | * Set up the clock source and clock events devices | 639 | * Set up the clock source and clock events devices |
775 | */ | 640 | */ |
776 | void __init realview_timer_init(unsigned int timer_irq) | 641 | void __init realview_timer_init(unsigned int timer_irq) |
@@ -797,13 +662,8 @@ void __init realview_timer_init(unsigned int timer_irq) | |||
797 | writel(0, timer2_va_base + TIMER_CTRL); | 662 | writel(0, timer2_va_base + TIMER_CTRL); |
798 | writel(0, timer3_va_base + TIMER_CTRL); | 663 | writel(0, timer3_va_base + TIMER_CTRL); |
799 | 664 | ||
800 | /* | 665 | sp804_clocksource_init(timer3_va_base); |
801 | * Make irqs happen for the system timer | 666 | sp804_clockevents_init(timer0_va_base, timer_irq); |
802 | */ | ||
803 | setup_irq(timer_irq, &realview_timer_irq); | ||
804 | |||
805 | realview_clocksource_init(); | ||
806 | realview_clockevents_init(timer_irq); | ||
807 | } | 667 | } |
808 | 668 | ||
809 | /* | 669 | /* |
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c index be048e3e8799..f95521a5e5ce 100644 --- a/arch/arm/mach-realview/hotplug.c +++ b/arch/arm/mach-realview/hotplug.c | |||
@@ -131,7 +131,7 @@ void platform_cpu_die(unsigned int cpu) | |||
131 | cpu_leave_lowpower(); | 131 | cpu_leave_lowpower(); |
132 | } | 132 | } |
133 | 133 | ||
134 | int mach_cpu_disable(unsigned int cpu) | 134 | int platform_cpu_disable(unsigned int cpu) |
135 | { | 135 | { |
136 | /* | 136 | /* |
137 | * we don't allow CPU 0 to be shutdown (it is still too special | 137 | * we don't allow CPU 0 to be shutdown (it is still too special |
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h index 04b37a89801c..e58d0771b64e 100644 --- a/arch/arm/mach-realview/include/mach/clkdev.h +++ b/arch/arm/mach-realview/include/mach/clkdev.h | |||
@@ -1,6 +1,15 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | 1 | #ifndef __ASM_MACH_CLKDEV_H |
2 | #define __ASM_MACH_CLKDEV_H | 2 | #define __ASM_MACH_CLKDEV_H |
3 | 3 | ||
4 | #include <plat/clock.h> | ||
5 | |||
6 | struct clk { | ||
7 | unsigned long rate; | ||
8 | const struct clk_ops *ops; | ||
9 | const struct icst_params *params; | ||
10 | void __iomem *vcoreg; | ||
11 | }; | ||
12 | |||
4 | #define __clk_get(clk) ({ 1; }) | 13 | #define __clk_get(clk) ({ 1; }) |
5 | #define __clk_put(clk) do { } while (0) | 14 | #define __clk_put(clk) do { } while (0) |
6 | 15 | ||
diff --git a/arch/arm/mach-realview/include/mach/irqs-pb1176.h b/arch/arm/mach-realview/include/mach/irqs-pb1176.h index 2410d4f8ddd3..830055bb8628 100644 --- a/arch/arm/mach-realview/include/mach/irqs-pb1176.h +++ b/arch/arm/mach-realview/include/mach/irqs-pb1176.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */ | 31 | #define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */ |
32 | #define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */ | 32 | #define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */ |
33 | #define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */ | 33 | #define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */ |
34 | #define IRQ_DC1176_CORE_PMU (IRQ_DC1176_GIC_START + 7) /* Core PMU interrupt */ | ||
34 | #define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */ | 35 | #define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */ |
35 | #define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */ | 36 | #define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */ |
36 | #define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */ | 37 | #define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */ |
diff --git a/arch/arm/mach-realview/include/mach/irqs-pba8.h b/arch/arm/mach-realview/include/mach/irqs-pba8.h index 86792a9f2ab6..4a88a4edb651 100644 --- a/arch/arm/mach-realview/include/mach/irqs-pba8.h +++ b/arch/arm/mach-realview/include/mach/irqs-pba8.h | |||
@@ -23,12 +23,6 @@ | |||
23 | 23 | ||
24 | #define IRQ_PBA8_GIC_START 32 | 24 | #define IRQ_PBA8_GIC_START 32 |
25 | 25 | ||
26 | /* L220 | ||
27 | #define IRQ_PBA8_L220_EVENT (IRQ_PBA8_GIC_START + 29) | ||
28 | #define IRQ_PBA8_L220_SLAVE (IRQ_PBA8_GIC_START + 30) | ||
29 | #define IRQ_PBA8_L220_DECODE (IRQ_PBA8_GIC_START + 31) | ||
30 | */ | ||
31 | |||
32 | /* | 26 | /* |
33 | * PB-A8 on-board gic irq sources | 27 | * PB-A8 on-board gic irq sources |
34 | */ | 28 | */ |
@@ -65,6 +59,8 @@ | |||
65 | #define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */ | 59 | #define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */ |
66 | #define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */ | 60 | #define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */ |
67 | 61 | ||
62 | #define IRQ_PBA8_PMU (IRQ_PBA8_GIC_START + 47) /* Cortex-A8 PMU */ | ||
63 | |||
68 | /* ... */ | 64 | /* ... */ |
69 | #define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50) | 65 | #define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50) |
70 | #define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51) | 66 | #define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51) |
diff --git a/arch/arm/mach-realview/include/mach/irqs-pbx.h b/arch/arm/mach-realview/include/mach/irqs-pbx.h index deaad4302b17..206a3001f46b 100644 --- a/arch/arm/mach-realview/include/mach/irqs-pbx.h +++ b/arch/arm/mach-realview/include/mach/irqs-pbx.h | |||
@@ -22,12 +22,6 @@ | |||
22 | 22 | ||
23 | #define IRQ_PBX_GIC_START 32 | 23 | #define IRQ_PBX_GIC_START 32 |
24 | 24 | ||
25 | /* L220 | ||
26 | #define IRQ_PBX_L220_EVENT (IRQ_PBX_GIC_START + 29) | ||
27 | #define IRQ_PBX_L220_SLAVE (IRQ_PBX_GIC_START + 30) | ||
28 | #define IRQ_PBX_L220_DECODE (IRQ_PBX_GIC_START + 31) | ||
29 | */ | ||
30 | |||
31 | /* | 25 | /* |
32 | * PBX on-board gic irq sources | 26 | * PBX on-board gic irq sources |
33 | */ | 27 | */ |
@@ -77,10 +71,10 @@ | |||
77 | #define IRQ_PBX_TIMER4_5 (IRQ_PBX_GIC_START + 41) /* Timer 0/1 (default timer) */ | 71 | #define IRQ_PBX_TIMER4_5 (IRQ_PBX_GIC_START + 41) /* Timer 0/1 (default timer) */ |
78 | #define IRQ_PBX_TIMER6_7 (IRQ_PBX_GIC_START + 42) /* Timer 2/3 */ | 72 | #define IRQ_PBX_TIMER6_7 (IRQ_PBX_GIC_START + 42) /* Timer 2/3 */ |
79 | /* ... */ | 73 | /* ... */ |
80 | #define IRQ_PBX_PMU_CPU3 (IRQ_PBX_GIC_START + 44) /* CPU PMU Interrupts */ | 74 | #define IRQ_PBX_PMU_CPU0 (IRQ_PBX_GIC_START + 44) /* CPU PMU Interrupts */ |
81 | #define IRQ_PBX_PMU_CPU2 (IRQ_PBX_GIC_START + 45) | 75 | #define IRQ_PBX_PMU_CPU1 (IRQ_PBX_GIC_START + 45) |
82 | #define IRQ_PBX_PMU_CPU1 (IRQ_PBX_GIC_START + 46) | 76 | #define IRQ_PBX_PMU_CPU2 (IRQ_PBX_GIC_START + 46) |
83 | #define IRQ_PBX_PMU_CPU0 (IRQ_PBX_GIC_START + 47) | 77 | #define IRQ_PBX_PMU_CPU3 (IRQ_PBX_GIC_START + 47) |
84 | 78 | ||
85 | /* ... */ | 79 | /* ... */ |
86 | #define IRQ_PBX_PCI0 (IRQ_PBX_GIC_START + 50) | 80 | #define IRQ_PBX_PCI0 (IRQ_PBX_GIC_START + 50) |
diff --git a/arch/arm/mach-realview/include/mach/platform.h b/arch/arm/mach-realview/include/mach/platform.h index 86c0c4435a46..1b77a27badaf 100644 --- a/arch/arm/mach-realview/include/mach/platform.h +++ b/arch/arm/mach-realview/include/mach/platform.h | |||
@@ -231,12 +231,6 @@ | |||
231 | #define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */ | 231 | #define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */ |
232 | #define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ | 232 | #define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ |
233 | 233 | ||
234 | /* | ||
235 | * Clean base - dummy | ||
236 | * | ||
237 | */ | ||
238 | #define CLEAN_BASE REALVIEW_BOOT_ROM_HI | ||
239 | |||
240 | /* | 234 | /* |
241 | * System controller bit assignment | 235 | * System controller bit assignment |
242 | */ | 236 | */ |
@@ -249,20 +243,6 @@ | |||
249 | #define REALVIEW_TIMER4_EnSel 21 | 243 | #define REALVIEW_TIMER4_EnSel 21 |
250 | 244 | ||
251 | 245 | ||
252 | #define MAX_TIMER 2 | ||
253 | #define MAX_PERIOD 699050 | ||
254 | #define TICKS_PER_uSEC 1 | ||
255 | |||
256 | /* | ||
257 | * These are useconds NOT ticks. | ||
258 | * | ||
259 | */ | ||
260 | #define mSEC_1 1000 | ||
261 | #define mSEC_5 (mSEC_1 * 5) | ||
262 | #define mSEC_10 (mSEC_1 * 10) | ||
263 | #define mSEC_25 (mSEC_1 * 25) | ||
264 | #define SEC_1 (mSEC_1 * 1000) | ||
265 | |||
266 | #define REALVIEW_CSR_BASE 0x10000000 | 246 | #define REALVIEW_CSR_BASE 0x10000000 |
267 | #define REALVIEW_CSR_SIZE 0x10000000 | 247 | #define REALVIEW_CSR_SIZE 0x10000000 |
268 | 248 | ||
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 7d857d300558..422ccd70d5f5 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -31,8 +31,8 @@ | |||
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> | ||
34 | #include <asm/hardware/gic.h> | 35 | #include <asm/hardware/gic.h> |
35 | #include <asm/hardware/icst307.h> | ||
36 | #include <asm/hardware/cache-l2x0.h> | 36 | #include <asm/hardware/cache-l2x0.h> |
37 | #include <asm/localtimer.h> | 37 | #include <asm/localtimer.h> |
38 | 38 | ||
@@ -44,7 +44,6 @@ | |||
44 | #include <mach/irqs.h> | 44 | #include <mach/irqs.h> |
45 | 45 | ||
46 | #include "core.h" | 46 | #include "core.h" |
47 | #include "clock.h" | ||
48 | 47 | ||
49 | static struct map_desc realview_eb_io_desc[] __initdata = { | 48 | static struct map_desc realview_eb_io_desc[] __initdata = { |
50 | { | 49 | { |
@@ -294,6 +293,36 @@ static struct resource realview_eb_isp1761_resources[] = { | |||
294 | }, | 293 | }, |
295 | }; | 294 | }; |
296 | 295 | ||
296 | static struct resource pmu_resources[] = { | ||
297 | [0] = { | ||
298 | .start = IRQ_EB11MP_PMU_CPU0, | ||
299 | .end = IRQ_EB11MP_PMU_CPU0, | ||
300 | .flags = IORESOURCE_IRQ, | ||
301 | }, | ||
302 | [1] = { | ||
303 | .start = IRQ_EB11MP_PMU_CPU1, | ||
304 | .end = IRQ_EB11MP_PMU_CPU1, | ||
305 | .flags = IORESOURCE_IRQ, | ||
306 | }, | ||
307 | [2] = { | ||
308 | .start = IRQ_EB11MP_PMU_CPU2, | ||
309 | .end = IRQ_EB11MP_PMU_CPU2, | ||
310 | .flags = IORESOURCE_IRQ, | ||
311 | }, | ||
312 | [3] = { | ||
313 | .start = IRQ_EB11MP_PMU_CPU3, | ||
314 | .end = IRQ_EB11MP_PMU_CPU3, | ||
315 | .flags = IORESOURCE_IRQ, | ||
316 | }, | ||
317 | }; | ||
318 | |||
319 | static struct platform_device pmu_device = { | ||
320 | .name = "arm-pmu", | ||
321 | .id = ARM_PMU_DEVICE_CPU, | ||
322 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
323 | .resource = pmu_resources, | ||
324 | }; | ||
325 | |||
297 | static void __init gic_init_irq(void) | 326 | static void __init gic_init_irq(void) |
298 | { | 327 | { |
299 | if (core_tile_eb11mp() || core_tile_a9mp()) { | 328 | if (core_tile_eb11mp() || core_tile_a9mp()) { |
@@ -407,6 +436,7 @@ static void __init realview_eb_init(void) | |||
407 | * Bits: .... ...0 0111 1001 0000 .... .... .... */ | 436 | * Bits: .... ...0 0111 1001 0000 .... .... .... */ |
408 | l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff); | 437 | l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff); |
409 | #endif | 438 | #endif |
439 | platform_device_register(&pmu_device); | ||
410 | } | 440 | } |
411 | 441 | ||
412 | realview_flash_register(&realview_eb_flash_resource, 1); | 442 | realview_flash_register(&realview_eb_flash_resource, 1); |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index 44392e51dd50..96568ebfa2bb 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -31,8 +31,8 @@ | |||
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> | ||
34 | #include <asm/hardware/gic.h> | 35 | #include <asm/hardware/gic.h> |
35 | #include <asm/hardware/icst307.h> | ||
36 | #include <asm/hardware/cache-l2x0.h> | 36 | #include <asm/hardware/cache-l2x0.h> |
37 | 37 | ||
38 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
@@ -44,7 +44,6 @@ | |||
44 | #include <mach/irqs.h> | 44 | #include <mach/irqs.h> |
45 | 45 | ||
46 | #include "core.h" | 46 | #include "core.h" |
47 | #include "clock.h" | ||
48 | 47 | ||
49 | static struct map_desc realview_pb1176_io_desc[] __initdata = { | 48 | static struct map_desc realview_pb1176_io_desc[] __initdata = { |
50 | { | 49 | { |
@@ -263,6 +262,19 @@ static struct resource realview_pb1176_isp1761_resources[] = { | |||
263 | }, | 262 | }, |
264 | }; | 263 | }; |
265 | 264 | ||
265 | static struct resource pmu_resource = { | ||
266 | .start = IRQ_DC1176_CORE_PMU, | ||
267 | .end = IRQ_DC1176_CORE_PMU, | ||
268 | .flags = IORESOURCE_IRQ, | ||
269 | }; | ||
270 | |||
271 | static struct platform_device pmu_device = { | ||
272 | .name = "arm-pmu", | ||
273 | .id = ARM_PMU_DEVICE_CPU, | ||
274 | .num_resources = 1, | ||
275 | .resource = &pmu_resource, | ||
276 | }; | ||
277 | |||
266 | static void __init gic_init_irq(void) | 278 | static void __init gic_init_irq(void) |
267 | { | 279 | { |
268 | /* ARM1176 DevChip GIC, primary */ | 280 | /* ARM1176 DevChip GIC, primary */ |
@@ -324,6 +336,7 @@ static void __init realview_pb1176_init(void) | |||
324 | realview_eth_register(NULL, realview_pb1176_smsc911x_resources); | 336 | realview_eth_register(NULL, realview_pb1176_smsc911x_resources); |
325 | platform_device_register(&realview_i2c_device); | 337 | platform_device_register(&realview_i2c_device); |
326 | realview_usb_register(realview_pb1176_isp1761_resources); | 338 | realview_usb_register(realview_pb1176_isp1761_resources); |
339 | platform_device_register(&pmu_device); | ||
327 | 340 | ||
328 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 341 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
329 | struct amba_device *d = amba_devs[i]; | 342 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 3e02731af959..7fbefbbebaf0 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -31,8 +31,8 @@ | |||
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> | ||
34 | #include <asm/hardware/gic.h> | 35 | #include <asm/hardware/gic.h> |
35 | #include <asm/hardware/icst307.h> | ||
36 | #include <asm/hardware/cache-l2x0.h> | 36 | #include <asm/hardware/cache-l2x0.h> |
37 | #include <asm/localtimer.h> | 37 | #include <asm/localtimer.h> |
38 | 38 | ||
@@ -45,7 +45,6 @@ | |||
45 | #include <mach/irqs.h> | 45 | #include <mach/irqs.h> |
46 | 46 | ||
47 | #include "core.h" | 47 | #include "core.h" |
48 | #include "clock.h" | ||
49 | 48 | ||
50 | static struct map_desc realview_pb11mp_io_desc[] __initdata = { | 49 | static struct map_desc realview_pb11mp_io_desc[] __initdata = { |
51 | { | 50 | { |
@@ -260,6 +259,36 @@ static struct resource realview_pb11mp_isp1761_resources[] = { | |||
260 | }, | 259 | }, |
261 | }; | 260 | }; |
262 | 261 | ||
262 | static struct resource pmu_resources[] = { | ||
263 | [0] = { | ||
264 | .start = IRQ_TC11MP_PMU_CPU0, | ||
265 | .end = IRQ_TC11MP_PMU_CPU0, | ||
266 | .flags = IORESOURCE_IRQ, | ||
267 | }, | ||
268 | [1] = { | ||
269 | .start = IRQ_TC11MP_PMU_CPU1, | ||
270 | .end = IRQ_TC11MP_PMU_CPU1, | ||
271 | .flags = IORESOURCE_IRQ, | ||
272 | }, | ||
273 | [2] = { | ||
274 | .start = IRQ_TC11MP_PMU_CPU2, | ||
275 | .end = IRQ_TC11MP_PMU_CPU2, | ||
276 | .flags = IORESOURCE_IRQ, | ||
277 | }, | ||
278 | [3] = { | ||
279 | .start = IRQ_TC11MP_PMU_CPU3, | ||
280 | .end = IRQ_TC11MP_PMU_CPU3, | ||
281 | .flags = IORESOURCE_IRQ, | ||
282 | }, | ||
283 | }; | ||
284 | |||
285 | static struct platform_device pmu_device = { | ||
286 | .name = "arm-pmu", | ||
287 | .id = ARM_PMU_DEVICE_CPU, | ||
288 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
289 | .resource = pmu_resources, | ||
290 | }; | ||
291 | |||
263 | static void __init gic_init_irq(void) | 292 | static void __init gic_init_irq(void) |
264 | { | 293 | { |
265 | unsigned int pldctrl; | 294 | unsigned int pldctrl; |
@@ -329,6 +358,7 @@ static void __init realview_pb11mp_init(void) | |||
329 | platform_device_register(&realview_i2c_device); | 358 | platform_device_register(&realview_i2c_device); |
330 | platform_device_register(&realview_cf_device); | 359 | platform_device_register(&realview_cf_device); |
331 | realview_usb_register(realview_pb11mp_isp1761_resources); | 360 | realview_usb_register(realview_pb11mp_isp1761_resources); |
361 | platform_device_register(&pmu_device); | ||
332 | 362 | ||
333 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 363 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
334 | struct amba_device *d = amba_devs[i]; | 364 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index fe4e25c4201a..d3c113b3dfce 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -30,8 +30,8 @@ | |||
30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
31 | #include <asm/leds.h> | 31 | #include <asm/leds.h> |
32 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
33 | #include <asm/pmu.h> | ||
33 | #include <asm/hardware/gic.h> | 34 | #include <asm/hardware/gic.h> |
34 | #include <asm/hardware/icst307.h> | ||
35 | 35 | ||
36 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
37 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
@@ -42,7 +42,6 @@ | |||
42 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
43 | 43 | ||
44 | #include "core.h" | 44 | #include "core.h" |
45 | #include "clock.h" | ||
46 | 45 | ||
47 | static struct map_desc realview_pba8_io_desc[] __initdata = { | 46 | static struct map_desc realview_pba8_io_desc[] __initdata = { |
48 | { | 47 | { |
@@ -250,6 +249,19 @@ static struct resource realview_pba8_isp1761_resources[] = { | |||
250 | }, | 249 | }, |
251 | }; | 250 | }; |
252 | 251 | ||
252 | static struct resource pmu_resource = { | ||
253 | .start = IRQ_PBA8_PMU, | ||
254 | .end = IRQ_PBA8_PMU, | ||
255 | .flags = IORESOURCE_IRQ, | ||
256 | }; | ||
257 | |||
258 | static struct platform_device pmu_device = { | ||
259 | .name = "arm-pmu", | ||
260 | .id = ARM_PMU_DEVICE_CPU, | ||
261 | .num_resources = 1, | ||
262 | .resource = &pmu_resource, | ||
263 | }; | ||
264 | |||
253 | static void __init gic_init_irq(void) | 265 | static void __init gic_init_irq(void) |
254 | { | 266 | { |
255 | /* ARM PB-A8 on-board GIC */ | 267 | /* ARM PB-A8 on-board GIC */ |
@@ -296,6 +308,7 @@ static void __init realview_pba8_init(void) | |||
296 | platform_device_register(&realview_i2c_device); | 308 | platform_device_register(&realview_i2c_device); |
297 | platform_device_register(&realview_cf_device); | 309 | platform_device_register(&realview_cf_device); |
298 | realview_usb_register(realview_pba8_isp1761_resources); | 310 | realview_usb_register(realview_pba8_isp1761_resources); |
311 | platform_device_register(&pmu_device); | ||
299 | 312 | ||
300 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 313 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
301 | struct amba_device *d = amba_devs[i]; | 314 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index d94857eb0690..a235ba30996b 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
30 | #include <asm/leds.h> | 30 | #include <asm/leds.h> |
31 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
32 | #include <asm/pmu.h> | ||
32 | #include <asm/smp_twd.h> | 33 | #include <asm/smp_twd.h> |
33 | #include <asm/hardware/gic.h> | 34 | #include <asm/hardware/gic.h> |
34 | #include <asm/hardware/cache-l2x0.h> | 35 | #include <asm/hardware/cache-l2x0.h> |
@@ -270,6 +271,36 @@ static struct resource realview_pbx_isp1761_resources[] = { | |||
270 | }, | 271 | }, |
271 | }; | 272 | }; |
272 | 273 | ||
274 | static struct resource pmu_resources[] = { | ||
275 | [0] = { | ||
276 | .start = IRQ_PBX_PMU_CPU0, | ||
277 | .end = IRQ_PBX_PMU_CPU0, | ||
278 | .flags = IORESOURCE_IRQ, | ||
279 | }, | ||
280 | [1] = { | ||
281 | .start = IRQ_PBX_PMU_CPU1, | ||
282 | .end = IRQ_PBX_PMU_CPU1, | ||
283 | .flags = IORESOURCE_IRQ, | ||
284 | }, | ||
285 | [2] = { | ||
286 | .start = IRQ_PBX_PMU_CPU2, | ||
287 | .end = IRQ_PBX_PMU_CPU2, | ||
288 | .flags = IORESOURCE_IRQ, | ||
289 | }, | ||
290 | [3] = { | ||
291 | .start = IRQ_PBX_PMU_CPU3, | ||
292 | .end = IRQ_PBX_PMU_CPU3, | ||
293 | .flags = IORESOURCE_IRQ, | ||
294 | }, | ||
295 | }; | ||
296 | |||
297 | static struct platform_device pmu_device = { | ||
298 | .name = "arm-pmu", | ||
299 | .id = ARM_PMU_DEVICE_CPU, | ||
300 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
301 | .resource = pmu_resources, | ||
302 | }; | ||
303 | |||
273 | static void __init gic_init_irq(void) | 304 | static void __init gic_init_irq(void) |
274 | { | 305 | { |
275 | /* ARM PBX on-board GIC */ | 306 | /* ARM PBX on-board GIC */ |
@@ -354,6 +385,7 @@ static void __init realview_pbx_init(void) | |||
354 | /* 16KB way size, 8-way associativity, parity disabled | 385 | /* 16KB way size, 8-way associativity, parity disabled |
355 | * Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */ | 386 | * Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */ |
356 | l2x0_init(l2x0_base, 0x02520000, 0xc0000fff); | 387 | l2x0_init(l2x0_base, 0x02520000, 0xc0000fff); |
388 | platform_device_register(&pmu_device); | ||
357 | } | 389 | } |
358 | #endif | 390 | #endif |
359 | 391 | ||
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig index 554731868b07..9e5e96f12d86 100644 --- a/arch/arm/mach-s3c2410/Kconfig +++ b/arch/arm/mach-s3c2410/Kconfig | |||
@@ -6,6 +6,7 @@ config CPU_S3C2410 | |||
6 | bool | 6 | bool |
7 | depends on ARCH_S3C2410 | 7 | depends on ARCH_S3C2410 |
8 | select CPU_ARM920T | 8 | select CPU_ARM920T |
9 | select S3C_GPIO_PULL_UP | ||
9 | select S3C2410_CLOCK | 10 | select S3C2410_CLOCK |
10 | select S3C2410_GPIO | 11 | select S3C2410_GPIO |
11 | select CPU_LLSERIAL_S3C2410 | 12 | select CPU_LLSERIAL_S3C2410 |
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c index a3f3c7b1ca38..8cdeb14af592 100644 --- a/arch/arm/mach-s3c2410/h1940-bluetooth.c +++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c | |||
@@ -33,14 +33,15 @@ static void h1940bt_enable(int on) | |||
33 | h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); | 33 | h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); |
34 | /* Reset the chip */ | 34 | /* Reset the chip */ |
35 | mdelay(10); | 35 | mdelay(10); |
36 | s3c2410_gpio_setpin(S3C2410_GPH(1), 1); | 36 | |
37 | gpio_set_value(S3C2410_GPH(1), 1); | ||
37 | mdelay(10); | 38 | mdelay(10); |
38 | s3c2410_gpio_setpin(S3C2410_GPH(1), 0); | 39 | gpio_set_value(S3C2410_GPH(1), 0); |
39 | } | 40 | } |
40 | else { | 41 | else { |
41 | s3c2410_gpio_setpin(S3C2410_GPH(1), 1); | 42 | gpio_set_value(S3C2410_GPH(1), 1); |
42 | mdelay(10); | 43 | mdelay(10); |
43 | s3c2410_gpio_setpin(S3C2410_GPH(1), 0); | 44 | gpio_set_value(S3C2410_GPH(1), 0); |
44 | mdelay(10); | 45 | mdelay(10); |
45 | h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); | 46 | h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); |
46 | } | 47 | } |
@@ -61,15 +62,21 @@ static int __devinit h1940bt_probe(struct platform_device *pdev) | |||
61 | struct rfkill *rfk; | 62 | struct rfkill *rfk; |
62 | int ret = 0; | 63 | int ret = 0; |
63 | 64 | ||
65 | ret = gpio_request(S3C2410_GPH(1), dev_name(&pdev->dev)); | ||
66 | if (ret) { | ||
67 | dev_err(&pdev->dev, "could not get GPH1\n");\ | ||
68 | return ret; | ||
69 | } | ||
70 | |||
64 | /* Configures BT serial port GPIOs */ | 71 | /* Configures BT serial port GPIOs */ |
65 | s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); | 72 | s3c_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); |
66 | s3c2410_gpio_pullup(S3C2410_GPH(0), 1); | 73 | s3c_gpio_cfgpull(S3C2410_GPH(0), S3C_GPIO_PULL_NONE); |
67 | s3c2410_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); | 74 | s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); |
68 | s3c2410_gpio_pullup(S3C2410_GPH(1), 1); | 75 | s3c_gpio_cfgpull(S3C2410_GPH(1), S3C_GPIO_PULL_NONE); |
69 | s3c2410_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); | 76 | s3c_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); |
70 | s3c2410_gpio_pullup(S3C2410_GPH(2), 1); | 77 | s3c_gpio_cfgpull(S3C2410_GPH(2), S3C_GPIO_PULL_NONE); |
71 | s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); | 78 | s3c_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); |
72 | s3c2410_gpio_pullup(S3C2410_GPH(3), 1); | 79 | s3c_gpio_cfgpull(S3C2410_GPH(3), S3C_GPIO_PULL_NONE); |
73 | 80 | ||
74 | 81 | ||
75 | rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, | 82 | rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, |
@@ -100,6 +107,7 @@ static int h1940bt_remove(struct platform_device *pdev) | |||
100 | struct rfkill *rfk = platform_get_drvdata(pdev); | 107 | struct rfkill *rfk = platform_get_drvdata(pdev); |
101 | 108 | ||
102 | platform_set_drvdata(pdev, NULL); | 109 | platform_set_drvdata(pdev, NULL); |
110 | gpio_free(S3C2410_GPH(1)); | ||
103 | 111 | ||
104 | if (rfk) { | 112 | if (rfk) { |
105 | rfkill_unregister(rfk); | 113 | rfkill_unregister(rfk); |
diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c2410/include/mach/dma.h index 08ac5f96c012..cf68136cc668 100644 --- a/arch/arm/mach-s3c2410/include/mach/dma.h +++ b/arch/arm/mach-s3c2410/include/mach/dma.h | |||
@@ -54,7 +54,7 @@ enum dma_ch { | |||
54 | #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ | 54 | #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ |
55 | 55 | ||
56 | /* we have 4 dma channels */ | 56 | /* we have 4 dma channels */ |
57 | #ifndef CONFIG_CPU_S3C2443 | 57 | #if !defined(CONFIG_CPU_S3C2443) && !defined(CONFIG_CPU_S3C2416) |
58 | #define S3C_DMA_CHANNELS (4) | 58 | #define S3C_DMA_CHANNELS (4) |
59 | #else | 59 | #else |
60 | #define S3C_DMA_CHANNELS (6) | 60 | #define S3C_DMA_CHANNELS (6) |
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h index 035a493952db..f453c4f2cb8e 100644 --- a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h +++ b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h | |||
@@ -10,14 +10,28 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef __MACH_GPIO_FNS_H | ||
14 | #define __MACH_GPIO_FNS_H __FILE__ | ||
15 | |||
13 | /* These functions are in the to-be-removed category and it is strongly | 16 | /* These functions are in the to-be-removed category and it is strongly |
14 | * encouraged not to use these in new code. They will be marked deprecated | 17 | * encouraged not to use these in new code. They will be marked deprecated |
15 | * very soon. | 18 | * very soon. |
16 | * | 19 | * |
17 | * Most of the functionality can be either replaced by the gpiocfg calls | 20 | * Most of the functionality can be either replaced by the gpiocfg calls |
18 | * for the s3c platform or by the generic GPIOlib API. | 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. | ||
19 | */ | 25 | */ |
20 | 26 | ||
27 | #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 | |||
21 | /* external functions for GPIO support | 35 | /* external functions for GPIO support |
22 | * | 36 | * |
23 | * These allow various different clients to access the same GPIO | 37 | * These allow various different clients to access the same GPIO |
@@ -25,17 +39,6 @@ | |||
25 | * GPIO register, then it is safe to ioremap/__raw_{read|write} to it. | 39 | * GPIO register, then it is safe to ioremap/__raw_{read|write} to it. |
26 | */ | 40 | */ |
27 | 41 | ||
28 | /* s3c2410_gpio_cfgpin | ||
29 | * | ||
30 | * set the configuration of the given pin to the value passed. | ||
31 | * | ||
32 | * eg: | ||
33 | * s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0); | ||
34 | * s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1); | ||
35 | */ | ||
36 | |||
37 | extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); | ||
38 | |||
39 | extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); | 42 | extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); |
40 | 43 | ||
41 | /* s3c2410_gpio_getirq | 44 | /* s3c2410_gpio_getirq |
@@ -73,6 +76,14 @@ extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, | |||
73 | 76 | ||
74 | /* s3c2410_gpio_pullup | 77 | /* s3c2410_gpio_pullup |
75 | * | 78 | * |
79 | * This call should be replaced with s3c_gpio_setpull(). | ||
80 | * | ||
81 | * As a note, there is currently no distinction between pull-up and pull-down | ||
82 | * in the s3c24xx series devices with only an on/off configuration. | ||
83 | */ | ||
84 | |||
85 | /* s3c2410_gpio_pullup | ||
86 | * | ||
76 | * configure the pull-up control on the given pin | 87 | * configure the pull-up control on the given pin |
77 | * | 88 | * |
78 | * to = 1 => disable the pull-up | 89 | * to = 1 => disable the pull-up |
@@ -86,18 +97,8 @@ extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, | |||
86 | 97 | ||
87 | extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); | 98 | extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); |
88 | 99 | ||
89 | /* s3c2410_gpio_getpull | ||
90 | * | ||
91 | * Read the state of the pull-up on a given pin | ||
92 | * | ||
93 | * return: | ||
94 | * < 0 => error code | ||
95 | * 0 => enabled | ||
96 | * 1 => disabled | ||
97 | */ | ||
98 | |||
99 | extern int s3c2410_gpio_getpull(unsigned int pin); | ||
100 | |||
101 | extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); | 100 | extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); |
102 | 101 | ||
103 | extern unsigned int s3c2410_gpio_getpin(unsigned int pin); | 102 | extern unsigned int s3c2410_gpio_getpin(unsigned int pin); |
103 | |||
104 | #endif /* __MACH_GPIO_FNS_H */ | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h index 2edbb9c88ab3..f3182ff847cb 100644 --- a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h +++ b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h | |||
@@ -34,6 +34,10 @@ | |||
34 | #define S3C2410_GPIO_F_NR (32) | 34 | #define S3C2410_GPIO_F_NR (32) |
35 | #define S3C2410_GPIO_G_NR (32) | 35 | #define S3C2410_GPIO_G_NR (32) |
36 | #define S3C2410_GPIO_H_NR (32) | 36 | #define S3C2410_GPIO_H_NR (32) |
37 | #define S3C2410_GPIO_J_NR (32) /* technically 16. */ | ||
38 | #define S3C2410_GPIO_K_NR (32) /* technically 16. */ | ||
39 | #define S3C2410_GPIO_L_NR (32) /* technically 15. */ | ||
40 | #define S3C2410_GPIO_M_NR (32) /* technically 2. */ | ||
37 | 41 | ||
38 | #if CONFIG_S3C_GPIO_SPACE != 0 | 42 | #if CONFIG_S3C_GPIO_SPACE != 0 |
39 | #error CONFIG_S3C_GPIO_SPACE cannot be zero at the moment | 43 | #error CONFIG_S3C_GPIO_SPACE cannot be zero at the moment |
@@ -53,6 +57,10 @@ enum s3c_gpio_number { | |||
53 | S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E), | 57 | S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E), |
54 | S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F), | 58 | S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F), |
55 | S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G), | 59 | S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G), |
60 | S3C2410_GPIO_J_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_H), | ||
61 | S3C2410_GPIO_K_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_J), | ||
62 | S3C2410_GPIO_L_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_K), | ||
63 | S3C2410_GPIO_M_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_L), | ||
56 | }; | 64 | }; |
57 | 65 | ||
58 | #endif /* __ASSEMBLY__ */ | 66 | #endif /* __ASSEMBLY__ */ |
@@ -67,6 +75,10 @@ enum s3c_gpio_number { | |||
67 | #define S3C2410_GPF(_nr) (S3C2410_GPIO_F_START + (_nr)) | 75 | #define S3C2410_GPF(_nr) (S3C2410_GPIO_F_START + (_nr)) |
68 | #define S3C2410_GPG(_nr) (S3C2410_GPIO_G_START + (_nr)) | 76 | #define S3C2410_GPG(_nr) (S3C2410_GPIO_G_START + (_nr)) |
69 | #define S3C2410_GPH(_nr) (S3C2410_GPIO_H_START + (_nr)) | 77 | #define S3C2410_GPH(_nr) (S3C2410_GPIO_H_START + (_nr)) |
78 | #define S3C2410_GPJ(_nr) (S3C2410_GPIO_J_START + (_nr)) | ||
79 | #define S3C2410_GPK(_nr) (S3C2410_GPIO_K_START + (_nr)) | ||
80 | #define S3C2410_GPL(_nr) (S3C2410_GPIO_L_START + (_nr)) | ||
81 | #define S3C2410_GPM(_nr) (S3C2410_GPIO_M_START + (_nr)) | ||
70 | 82 | ||
71 | /* compatibility until drivers can be modified */ | 83 | /* compatibility until drivers can be modified */ |
72 | 84 | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h index 6c12c6312ad8..877c15e1b154 100644 --- a/arch/arm/mach-s3c2410/include/mach/irqs.h +++ b/arch/arm/mach-s3c2410/include/mach/irqs.h | |||
@@ -115,6 +115,26 @@ | |||
115 | #define IRQ_S3C2412_SDI S3C2410_IRQSUB(13) | 115 | #define IRQ_S3C2412_SDI S3C2410_IRQSUB(13) |
116 | #define IRQ_S3C2412_CF S3C2410_IRQSUB(14) | 116 | #define IRQ_S3C2412_CF S3C2410_IRQSUB(14) |
117 | 117 | ||
118 | |||
119 | #define IRQ_S3C2416_EINT8t15 S3C2410_IRQ(5) | ||
120 | #define IRQ_S3C2416_DMA S3C2410_IRQ(17) | ||
121 | #define IRQ_S3C2416_UART3 S3C2410_IRQ(18) | ||
122 | #define IRQ_S3C2416_SDI1 S3C2410_IRQ(20) | ||
123 | #define IRQ_S3C2416_SDI0 S3C2410_IRQ(21) | ||
124 | |||
125 | #define IRQ_S3C2416_LCD2 S3C2410_IRQSUB(15) | ||
126 | #define IRQ_S3C2416_LCD3 S3C2410_IRQSUB(16) | ||
127 | #define IRQ_S3C2416_LCD4 S3C2410_IRQSUB(17) | ||
128 | #define IRQ_S3C2416_DMA0 S3C2410_IRQSUB(18) | ||
129 | #define IRQ_S3C2416_DMA1 S3C2410_IRQSUB(19) | ||
130 | #define IRQ_S3C2416_DMA2 S3C2410_IRQSUB(20) | ||
131 | #define IRQ_S3C2416_DMA3 S3C2410_IRQSUB(21) | ||
132 | #define IRQ_S3C2416_DMA4 S3C2410_IRQSUB(22) | ||
133 | #define IRQ_S3C2416_DMA5 S3C2410_IRQSUB(23) | ||
134 | #define IRQ_S32416_WDT S3C2410_IRQSUB(27) | ||
135 | #define IRQ_S32416_AC97 S3C2410_IRQSUB(28) | ||
136 | |||
137 | |||
118 | /* extra irqs for s3c2440 */ | 138 | /* extra irqs for s3c2440 */ |
119 | 139 | ||
120 | #define IRQ_S3C2440_CAM_C S3C2410_IRQSUB(11) /* S3C2443 too */ | 140 | #define IRQ_S3C2440_CAM_C S3C2410_IRQSUB(11) /* S3C2443 too */ |
@@ -130,7 +150,10 @@ | |||
130 | #define IRQ_S3C2443_HSMMC S3C2410_IRQ(20) /* IRQ_SDI */ | 150 | #define IRQ_S3C2443_HSMMC S3C2410_IRQ(20) /* IRQ_SDI */ |
131 | #define IRQ_S3C2443_NAND S3C2410_IRQ(24) /* reserved */ | 151 | #define IRQ_S3C2443_NAND S3C2410_IRQ(24) /* reserved */ |
132 | 152 | ||
153 | #define IRQ_S3C2416_HSMMC0 S3C2410_IRQ(21) /* S3C2416/S3C2450 */ | ||
154 | |||
133 | #define IRQ_HSMMC0 IRQ_S3C2443_HSMMC | 155 | #define IRQ_HSMMC0 IRQ_S3C2443_HSMMC |
156 | #define IRQ_HSMMC1 IRQ_S3C2416_HSMMC0 | ||
134 | 157 | ||
135 | #define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) | 158 | #define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) |
136 | #define IRQ_S3C2443_LCD2 S3C2410_IRQSUB(15) | 159 | #define IRQ_S3C2443_LCD2 S3C2410_IRQSUB(15) |
@@ -152,7 +175,7 @@ | |||
152 | #define IRQ_S3C2443_WDT S3C2410_IRQSUB(27) | 175 | #define IRQ_S3C2443_WDT S3C2410_IRQSUB(27) |
153 | #define IRQ_S3C2443_AC97 S3C2410_IRQSUB(28) | 176 | #define IRQ_S3C2443_AC97 S3C2410_IRQSUB(28) |
154 | 177 | ||
155 | #ifdef CONFIG_CPU_S3C2443 | 178 | #if defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416) |
156 | #define NR_IRQS (IRQ_S3C2443_AC97+1) | 179 | #define NR_IRQS (IRQ_S3C2443_AC97+1) |
157 | #else | 180 | #else |
158 | #define NR_IRQS (IRQ_S3C2440_AC97+1) | 181 | #define NR_IRQS (IRQ_S3C2440_AC97+1) |
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h index b049e61460b6..f07d68066d7e 100644 --- a/arch/arm/mach-s3c2410/include/mach/map.h +++ b/arch/arm/mach-s3c2410/include/mach/map.h | |||
@@ -63,9 +63,9 @@ | |||
63 | #define S3C2440_PA_AC97 (0x5B000000) | 63 | #define S3C2440_PA_AC97 (0x5B000000) |
64 | #define S3C2440_SZ_AC97 SZ_1M | 64 | #define S3C2440_SZ_AC97 SZ_1M |
65 | 65 | ||
66 | /* S3C2443 High-speed SD/MMC */ | 66 | /* S3C2443/S3C2416 High-speed SD/MMC */ |
67 | #define S3C2443_PA_HSMMC (0x4A800000) | 67 | #define S3C2443_PA_HSMMC (0x4A800000) |
68 | #define S3C2443_SZ_HSMMC (256) | 68 | #define S3C2416_PA_HSMMC0 (0x4AC00000) |
69 | 69 | ||
70 | /* S3C2412 memory and IO controls */ | 70 | /* S3C2412 memory and IO controls */ |
71 | #define S3C2412_PA_SSMC (0x4F000000) | 71 | #define S3C2412_PA_SSMC (0x4F000000) |
@@ -110,6 +110,7 @@ | |||
110 | #define S3C_PA_UART S3C24XX_PA_UART | 110 | #define S3C_PA_UART S3C24XX_PA_UART |
111 | #define S3C_PA_USBHOST S3C2410_PA_USBHOST | 111 | #define S3C_PA_USBHOST S3C2410_PA_USBHOST |
112 | #define S3C_PA_HSMMC0 S3C2443_PA_HSMMC | 112 | #define S3C_PA_HSMMC0 S3C2443_PA_HSMMC |
113 | #define S3C_PA_HSMMC1 S3C2416_PA_HSMMC0 | ||
113 | #define S3C_PA_NAND S3C24XX_PA_NAND | 114 | #define S3C_PA_NAND S3C24XX_PA_NAND |
114 | 115 | ||
115 | #endif /* __ASM_ARCH_MAP_H */ | 116 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-clock.h index 9a0d169be137..3415b60082d7 100644 --- a/arch/arm/mach-s3c2410/include/mach/regs-clock.h +++ b/arch/arm/mach-s3c2410/include/mach/regs-clock.h | |||
@@ -161,4 +161,6 @@ | |||
161 | 161 | ||
162 | #endif /* CONFIG_CPU_S3C2412 | CONFIG_CPU_S3C2413 */ | 162 | #endif /* CONFIG_CPU_S3C2412 | CONFIG_CPU_S3C2413 */ |
163 | 163 | ||
164 | #define S3C2416_CLKDIV2 S3C2410_CLKREG(0x28) | ||
165 | |||
164 | #endif /* __ASM_ARM_REGS_CLOCK */ | 166 | #endif /* __ASM_ARM_REGS_CLOCK */ |
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-dsc.h b/arch/arm/mach-s3c2410/include/mach/regs-dsc.h index 3c3853cd3cf7..98fd4a05587c 100644 --- a/arch/arm/mach-s3c2410/include/mach/regs-dsc.h +++ b/arch/arm/mach-s3c2410/include/mach/regs-dsc.h | |||
@@ -19,6 +19,42 @@ | |||
19 | #define S3C2412_DSC1 S3C2410_GPIOREG(0xe0) | 19 | #define S3C2412_DSC1 S3C2410_GPIOREG(0xe0) |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #if defined(CONFIG_CPU_S3C2416) | ||
23 | #define S3C2416_DSC0 S3C2410_GPIOREG(0xc0) | ||
24 | #define S3C2416_DSC1 S3C2410_GPIOREG(0xc4) | ||
25 | #define S3C2416_DSC2 S3C2410_GPIOREG(0xc8) | ||
26 | #define S3C2416_DSC3 S3C2410_GPIOREG(0x110) | ||
27 | |||
28 | #define S3C2416_SELECT_DSC0 (0 << 30) | ||
29 | #define S3C2416_SELECT_DSC1 (1 << 30) | ||
30 | #define S3C2416_SELECT_DSC2 (2 << 30) | ||
31 | #define S3C2416_SELECT_DSC3 (3 << 30) | ||
32 | |||
33 | #define S3C2416_DSC_GETSHIFT(x) (x & 30) | ||
34 | |||
35 | #define S3C2416_DSC0_CF (S3C2416_SELECT_DSC0 | 28) | ||
36 | #define S3C2416_DSC0_CF_5mA (0 << 28) | ||
37 | #define S3C2416_DSC0_CF_10mA (1 << 28) | ||
38 | #define S3C2416_DSC0_CF_15mA (2 << 28) | ||
39 | #define S3C2416_DSC0_CF_21mA (3 << 28) | ||
40 | #define S3C2416_DSC0_CF_MASK (3 << 28) | ||
41 | |||
42 | #define S3C2416_DSC0_nRBE (S3C2416_SELECT_DSC0 | 26) | ||
43 | #define S3C2416_DSC0_nRBE_5mA (0 << 26) | ||
44 | #define S3C2416_DSC0_nRBE_10mA (1 << 26) | ||
45 | #define S3C2416_DSC0_nRBE_15mA (2 << 26) | ||
46 | #define S3C2416_DSC0_nRBE_21mA (3 << 26) | ||
47 | #define S3C2416_DSC0_nRBE_MASK (3 << 26) | ||
48 | |||
49 | #define S3C2416_DSC0_nROE (S3C2416_SELECT_DSC0 | 24) | ||
50 | #define S3C2416_DSC0_nROE_5mA (0 << 24) | ||
51 | #define S3C2416_DSC0_nROE_10mA (1 << 24) | ||
52 | #define S3C2416_DSC0_nROE_15mA (2 << 24) | ||
53 | #define S3C2416_DSC0_nROE_21mA (3 << 24) | ||
54 | #define S3C2416_DSC0_nROE_MASK (3 << 24) | ||
55 | |||
56 | #endif | ||
57 | |||
22 | #if defined(CONFIG_CPU_S3C244X) | 58 | #if defined(CONFIG_CPU_S3C244X) |
23 | 59 | ||
24 | #define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) | 60 | #define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) |
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h index fd672f330bf2..a6384239eddf 100644 --- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h +++ b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h | |||
@@ -610,35 +610,73 @@ | |||
610 | #define S3C2410_GPHUP S3C2410_GPIOREG(0x78) | 610 | #define S3C2410_GPHUP S3C2410_GPIOREG(0x78) |
611 | 611 | ||
612 | #define S3C2410_GPH0_nCTS0 (0x02 << 0) | 612 | #define S3C2410_GPH0_nCTS0 (0x02 << 0) |
613 | #define S3C2416_GPH0_TXD0 (0x02 << 0) | ||
613 | 614 | ||
614 | #define S3C2410_GPH1_nRTS0 (0x02 << 2) | 615 | #define S3C2410_GPH1_nRTS0 (0x02 << 2) |
616 | #define S3C2416_GPH1_RXD0 (0x02 << 2) | ||
615 | 617 | ||
616 | #define S3C2410_GPH2_TXD0 (0x02 << 4) | 618 | #define S3C2410_GPH2_TXD0 (0x02 << 4) |
619 | #define S3C2416_GPH2_TXD1 (0x02 << 4) | ||
617 | 620 | ||
618 | #define S3C2410_GPH3_RXD0 (0x02 << 6) | 621 | #define S3C2410_GPH3_RXD0 (0x02 << 6) |
622 | #define S3C2416_GPH3_RXD1 (0x02 << 6) | ||
619 | 623 | ||
620 | #define S3C2410_GPH4_TXD1 (0x02 << 8) | 624 | #define S3C2410_GPH4_TXD1 (0x02 << 8) |
625 | #define S3C2416_GPH4_TXD2 (0x02 << 8) | ||
621 | 626 | ||
622 | #define S3C2410_GPH5_RXD1 (0x02 << 10) | 627 | #define S3C2410_GPH5_RXD1 (0x02 << 10) |
628 | #define S3C2416_GPH5_RXD2 (0x02 << 10) | ||
623 | 629 | ||
624 | #define S3C2410_GPH6_TXD2 (0x02 << 12) | 630 | #define S3C2410_GPH6_TXD2 (0x02 << 12) |
631 | #define S3C2416_GPH6_TXD3 (0x02 << 12) | ||
625 | #define S3C2410_GPH6_nRTS1 (0x03 << 12) | 632 | #define S3C2410_GPH6_nRTS1 (0x03 << 12) |
633 | #define S3C2416_GPH6_nRTS2 (0x03 << 12) | ||
626 | 634 | ||
627 | #define S3C2410_GPH7_RXD2 (0x02 << 14) | 635 | #define S3C2410_GPH7_RXD2 (0x02 << 14) |
636 | #define S3C2416_GPH7_RXD3 (0x02 << 14) | ||
628 | #define S3C2410_GPH7_nCTS1 (0x03 << 14) | 637 | #define S3C2410_GPH7_nCTS1 (0x03 << 14) |
638 | #define S3C2416_GPH7_nCTS2 (0x03 << 14) | ||
629 | 639 | ||
630 | #define S3C2410_GPH8_UCLK (0x02 << 16) | 640 | #define S3C2410_GPH8_UCLK (0x02 << 16) |
641 | #define S3C2416_GPH8_nCTS0 (0x02 << 16) | ||
631 | 642 | ||
632 | #define S3C2410_GPH9_CLKOUT0 (0x02 << 18) | 643 | #define S3C2410_GPH9_CLKOUT0 (0x02 << 18) |
633 | #define S3C2442_GPH9_nSPICS0 (0x03 << 18) | 644 | #define S3C2442_GPH9_nSPICS0 (0x03 << 18) |
645 | #define S3C2416_GPH9_nRTS0 (0x02 << 18) | ||
634 | 646 | ||
635 | #define S3C2410_GPH10_CLKOUT1 (0x02 << 20) | 647 | #define S3C2410_GPH10_CLKOUT1 (0x02 << 20) |
648 | #define S3C2416_GPH10_nCTS1 (0x02 << 20) | ||
649 | |||
650 | #define S3C2416_GPH11_nRTS1 (0x02 << 22) | ||
651 | |||
652 | #define S3C2416_GPH12_EXTUARTCLK (0x02 << 24) | ||
653 | |||
654 | #define S3C2416_GPH13_CLKOUT0 (0x02 << 26) | ||
655 | |||
656 | #define S3C2416_GPH14_CLKOUT1 (0x02 << 28) | ||
636 | 657 | ||
637 | /* The S3C2412 and S3C2413 move the GPJ register set to after | 658 | /* The S3C2412 and S3C2413 move the GPJ register set to after |
638 | * GPH, which means all registers after 0x80 are now offset by 0x10 | 659 | * GPH, which means all registers after 0x80 are now offset by 0x10 |
639 | * for the 2412/2413 from the 2410/2440/2442 | 660 | * for the 2412/2413 from the 2410/2440/2442 |
640 | */ | 661 | */ |
641 | 662 | ||
663 | /* S3C2443 and above */ | ||
664 | #define S3C2440_GPJCON S3C2410_GPIOREG(0xD0) | ||
665 | #define S3C2440_GPJDAT S3C2410_GPIOREG(0xD4) | ||
666 | #define S3C2440_GPJUP S3C2410_GPIOREG(0xD8) | ||
667 | |||
668 | #define S3C2443_GPKCON S3C2410_GPIOREG(0xE0) | ||
669 | #define S3C2443_GPKDAT S3C2410_GPIOREG(0xE4) | ||
670 | #define S3C2443_GPKUP S3C2410_GPIOREG(0xE8) | ||
671 | |||
672 | #define S3C2443_GPLCON S3C2410_GPIOREG(0xF0) | ||
673 | #define S3C2443_GPLDAT S3C2410_GPIOREG(0xF4) | ||
674 | #define S3C2443_GPLUP S3C2410_GPIOREG(0xF8) | ||
675 | |||
676 | #define S3C2443_GPMCON S3C2410_GPIOREG(0x100) | ||
677 | #define S3C2443_GPMDAT S3C2410_GPIOREG(0x104) | ||
678 | #define S3C2443_GPMUP S3C2410_GPIOREG(0x108) | ||
679 | |||
642 | /* miscellaneous control */ | 680 | /* miscellaneous control */ |
643 | #define S3C2400_MISCCR S3C2410_GPIOREG(0x54) | 681 | #define S3C2400_MISCCR S3C2410_GPIOREG(0x54) |
644 | #define S3C2410_MISCCR S3C2410_GPIOREG(0x80) | 682 | #define S3C2410_MISCCR S3C2410_GPIOREG(0x80) |
@@ -686,6 +724,7 @@ | |||
686 | #define S3C2412_MISCCR_CLK1_CLKsrc (0<<8) | 724 | #define S3C2412_MISCCR_CLK1_CLKsrc (0<<8) |
687 | 725 | ||
688 | #define S3C2410_MISCCR_USBSUSPND0 (1<<12) | 726 | #define S3C2410_MISCCR_USBSUSPND0 (1<<12) |
727 | #define S3C2416_MISCCR_SEL_SUSPND (1<<12) | ||
689 | #define S3C2410_MISCCR_USBSUSPND1 (1<<13) | 728 | #define S3C2410_MISCCR_USBSUSPND1 (1<<13) |
690 | 729 | ||
691 | #define S3C2410_MISCCR_nRSTCON (1<<16) | 730 | #define S3C2410_MISCCR_nRSTCON (1<<16) |
@@ -695,6 +734,9 @@ | |||
695 | #define S3C2410_MISCCR_nEN_SCLKE (1<<19) /* not 2412 */ | 734 | #define S3C2410_MISCCR_nEN_SCLKE (1<<19) /* not 2412 */ |
696 | #define S3C2410_MISCCR_SDSLEEP (7<<17) | 735 | #define S3C2410_MISCCR_SDSLEEP (7<<17) |
697 | 736 | ||
737 | #define S3C2416_MISCCR_FLT_I2C (1<<24) | ||
738 | #define S3C2416_MISCCR_HSSPI_EN2 (1<<31) | ||
739 | |||
698 | /* external interrupt control... */ | 740 | /* external interrupt control... */ |
699 | /* S3C2410_EXTINT0 -> irq sense control for EINT0..EINT7 | 741 | /* S3C2410_EXTINT0 -> irq sense control for EINT0..EINT7 |
700 | * S3C2410_EXTINT1 -> irq sense control for EINT8..EINT15 | 742 | * S3C2410_EXTINT1 -> irq sense control for EINT8..EINT15 |
@@ -762,8 +804,11 @@ | |||
762 | #define S3C2410_GSTATUS1_IDMASK (0xffff0000) | 804 | #define S3C2410_GSTATUS1_IDMASK (0xffff0000) |
763 | #define S3C2410_GSTATUS1_2410 (0x32410000) | 805 | #define S3C2410_GSTATUS1_2410 (0x32410000) |
764 | #define S3C2410_GSTATUS1_2412 (0x32412001) | 806 | #define S3C2410_GSTATUS1_2412 (0x32412001) |
807 | #define S3C2410_GSTATUS1_2416 (0x32416003) | ||
765 | #define S3C2410_GSTATUS1_2440 (0x32440000) | 808 | #define S3C2410_GSTATUS1_2440 (0x32440000) |
766 | #define S3C2410_GSTATUS1_2442 (0x32440aaa) | 809 | #define S3C2410_GSTATUS1_2442 (0x32440aaa) |
810 | /* some 2416 CPUs report this value also */ | ||
811 | #define S3C2410_GSTATUS1_2450 (0x32450003) | ||
767 | 812 | ||
768 | #define S3C2410_GSTATUS2_WTRESET (1<<2) | 813 | #define S3C2410_GSTATUS2_WTRESET (1<<2) |
769 | #define S3C2410_GSTATUS2_OFFRESET (1<<1) | 814 | #define S3C2410_GSTATUS2_OFFRESET (1<<1) |
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpioj.h b/arch/arm/mach-s3c2410/include/mach/regs-gpioj.h index 1202ca5e99f6..19575e061114 100644 --- a/arch/arm/mach-s3c2410/include/mach/regs-gpioj.h +++ b/arch/arm/mach-s3c2410/include/mach/regs-gpioj.h | |||
@@ -22,85 +22,49 @@ | |||
22 | * pull up works like all other ports. | 22 | * pull up works like all other ports. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #define S3C2440_GPIO_BANKJ (416) | ||
26 | |||
27 | #define S3C2440_GPJCON S3C2410_GPIOREG(0xd0) | ||
28 | #define S3C2440_GPJDAT S3C2410_GPIOREG(0xd4) | ||
29 | #define S3C2440_GPJUP S3C2410_GPIOREG(0xd8) | ||
30 | |||
31 | #define S3C2413_GPJCON S3C2410_GPIOREG(0x80) | 25 | #define S3C2413_GPJCON S3C2410_GPIOREG(0x80) |
32 | #define S3C2413_GPJDAT S3C2410_GPIOREG(0x84) | 26 | #define S3C2413_GPJDAT S3C2410_GPIOREG(0x84) |
33 | #define S3C2413_GPJUP S3C2410_GPIOREG(0x88) | 27 | #define S3C2413_GPJUP S3C2410_GPIOREG(0x88) |
34 | #define S3C2413_GPJSLPCON S3C2410_GPIOREG(0x8C) | 28 | #define S3C2413_GPJSLPCON S3C2410_GPIOREG(0x8C) |
35 | 29 | ||
36 | #define S3C2440_GPJ0 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 0) | ||
37 | #define S3C2440_GPJ0_INP (0x00 << 0) | ||
38 | #define S3C2440_GPJ0_OUTP (0x01 << 0) | 30 | #define S3C2440_GPJ0_OUTP (0x01 << 0) |
39 | #define S3C2440_GPJ0_CAMDATA0 (0x02 << 0) | 31 | #define S3C2440_GPJ0_CAMDATA0 (0x02 << 0) |
40 | 32 | ||
41 | #define S3C2440_GPJ1 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 1) | ||
42 | #define S3C2440_GPJ1_INP (0x00 << 2) | ||
43 | #define S3C2440_GPJ1_OUTP (0x01 << 2) | 33 | #define S3C2440_GPJ1_OUTP (0x01 << 2) |
44 | #define S3C2440_GPJ1_CAMDATA1 (0x02 << 2) | 34 | #define S3C2440_GPJ1_CAMDATA1 (0x02 << 2) |
45 | 35 | ||
46 | #define S3C2440_GPJ2 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 2) | ||
47 | #define S3C2440_GPJ2_INP (0x00 << 4) | ||
48 | #define S3C2440_GPJ2_OUTP (0x01 << 4) | 36 | #define S3C2440_GPJ2_OUTP (0x01 << 4) |
49 | #define S3C2440_GPJ2_CAMDATA2 (0x02 << 4) | 37 | #define S3C2440_GPJ2_CAMDATA2 (0x02 << 4) |
50 | 38 | ||
51 | #define S3C2440_GPJ3 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 3) | ||
52 | #define S3C2440_GPJ3_INP (0x00 << 6) | ||
53 | #define S3C2440_GPJ3_OUTP (0x01 << 6) | 39 | #define S3C2440_GPJ3_OUTP (0x01 << 6) |
54 | #define S3C2440_GPJ3_CAMDATA3 (0x02 << 6) | 40 | #define S3C2440_GPJ3_CAMDATA3 (0x02 << 6) |
55 | 41 | ||
56 | #define S3C2440_GPJ4 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 4) | ||
57 | #define S3C2440_GPJ4_INP (0x00 << 8) | ||
58 | #define S3C2440_GPJ4_OUTP (0x01 << 8) | 42 | #define S3C2440_GPJ4_OUTP (0x01 << 8) |
59 | #define S3C2440_GPJ4_CAMDATA4 (0x02 << 8) | 43 | #define S3C2440_GPJ4_CAMDATA4 (0x02 << 8) |
60 | 44 | ||
61 | #define S3C2440_GPJ5 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 5) | ||
62 | #define S3C2440_GPJ5_INP (0x00 << 10) | ||
63 | #define S3C2440_GPJ5_OUTP (0x01 << 10) | 45 | #define S3C2440_GPJ5_OUTP (0x01 << 10) |
64 | #define S3C2440_GPJ5_CAMDATA5 (0x02 << 10) | 46 | #define S3C2440_GPJ5_CAMDATA5 (0x02 << 10) |
65 | 47 | ||
66 | #define S3C2440_GPJ6 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 6) | ||
67 | #define S3C2440_GPJ6_INP (0x00 << 12) | ||
68 | #define S3C2440_GPJ6_OUTP (0x01 << 12) | 48 | #define S3C2440_GPJ6_OUTP (0x01 << 12) |
69 | #define S3C2440_GPJ6_CAMDATA6 (0x02 << 12) | 49 | #define S3C2440_GPJ6_CAMDATA6 (0x02 << 12) |
70 | 50 | ||
71 | #define S3C2440_GPJ7 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 7) | ||
72 | #define S3C2440_GPJ7_INP (0x00 << 14) | ||
73 | #define S3C2440_GPJ7_OUTP (0x01 << 14) | 51 | #define S3C2440_GPJ7_OUTP (0x01 << 14) |
74 | #define S3C2440_GPJ7_CAMDATA7 (0x02 << 14) | 52 | #define S3C2440_GPJ7_CAMDATA7 (0x02 << 14) |
75 | 53 | ||
76 | #define S3C2440_GPJ8 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 8) | ||
77 | #define S3C2440_GPJ8_INP (0x00 << 16) | ||
78 | #define S3C2440_GPJ8_OUTP (0x01 << 16) | 54 | #define S3C2440_GPJ8_OUTP (0x01 << 16) |
79 | #define S3C2440_GPJ8_CAMPCLK (0x02 << 16) | 55 | #define S3C2440_GPJ8_CAMPCLK (0x02 << 16) |
80 | 56 | ||
81 | #define S3C2440_GPJ9 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 9) | ||
82 | #define S3C2440_GPJ9_INP (0x00 << 18) | ||
83 | #define S3C2440_GPJ9_OUTP (0x01 << 18) | 57 | #define S3C2440_GPJ9_OUTP (0x01 << 18) |
84 | #define S3C2440_GPJ9_CAMVSYNC (0x02 << 18) | 58 | #define S3C2440_GPJ9_CAMVSYNC (0x02 << 18) |
85 | 59 | ||
86 | #define S3C2440_GPJ10 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 10) | ||
87 | #define S3C2440_GPJ10_INP (0x00 << 20) | ||
88 | #define S3C2440_GPJ10_OUTP (0x01 << 20) | 60 | #define S3C2440_GPJ10_OUTP (0x01 << 20) |
89 | #define S3C2440_GPJ10_CAMHREF (0x02 << 20) | 61 | #define S3C2440_GPJ10_CAMHREF (0x02 << 20) |
90 | 62 | ||
91 | #define S3C2440_GPJ11 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 11) | ||
92 | #define S3C2440_GPJ11_INP (0x00 << 22) | ||
93 | #define S3C2440_GPJ11_OUTP (0x01 << 22) | 63 | #define S3C2440_GPJ11_OUTP (0x01 << 22) |
94 | #define S3C2440_GPJ11_CAMCLKOUT (0x02 << 22) | 64 | #define S3C2440_GPJ11_CAMCLKOUT (0x02 << 22) |
95 | 65 | ||
96 | #define S3C2440_GPJ12 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 12) | ||
97 | #define S3C2440_GPJ12_INP (0x00 << 24) | ||
98 | #define S3C2440_GPJ12_OUTP (0x01 << 24) | 66 | #define S3C2440_GPJ12_OUTP (0x01 << 24) |
99 | #define S3C2440_GPJ12_CAMRESET (0x02 << 24) | 67 | #define S3C2440_GPJ12_CAMRESET (0x02 << 24) |
100 | 68 | ||
101 | #define S3C2443_GPJ13 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 13) | ||
102 | #define S3C2443_GPJ14 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 14) | ||
103 | #define S3C2443_GPJ15 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 15) | ||
104 | |||
105 | #endif /* __ASM_ARCH_REGS_GPIOJ_H */ | 69 | #endif /* __ASM_ARCH_REGS_GPIOJ_H */ |
106 | 70 | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-irq.h b/arch/arm/mach-s3c2410/include/mach/regs-irq.h index de86ee8812bd..0f07ba30b1fb 100644 --- a/arch/arm/mach-s3c2410/include/mach/regs-irq.h +++ b/arch/arm/mach-s3c2410/include/mach/regs-irq.h | |||
@@ -27,6 +27,16 @@ | |||
27 | #define S3C2410_SUBSRCPND S3C2410_IRQREG(0x018) | 27 | #define S3C2410_SUBSRCPND S3C2410_IRQREG(0x018) |
28 | #define S3C2410_INTSUBMSK S3C2410_IRQREG(0x01C) | 28 | #define S3C2410_INTSUBMSK S3C2410_IRQREG(0x01C) |
29 | 29 | ||
30 | #define S3C2416_PRIORITY_MODE1 S3C2410_IRQREG(0x030) | ||
31 | #define S3C2416_PRIORITY_UPDATE1 S3C2410_IRQREG(0x034) | ||
32 | #define S3C2416_SRCPND2 S3C2410_IRQREG(0x040) | ||
33 | #define S3C2416_INTMOD2 S3C2410_IRQREG(0x044) | ||
34 | #define S3C2416_INTMSK2 S3C2410_IRQREG(0x048) | ||
35 | #define S3C2416_INTPND2 S3C2410_IRQREG(0x050) | ||
36 | #define S3C2416_INTOFFSET2 S3C2410_IRQREG(0x054) | ||
37 | #define S3C2416_PRIORITY_MODE2 S3C2410_IRQREG(0x070) | ||
38 | #define S3C2416_PRIORITY_UPDATE2 S3C2410_IRQREG(0x074) | ||
39 | |||
30 | /* mask: 0=enable, 1=disable | 40 | /* mask: 0=enable, 1=disable |
31 | * 1 bit EINT, 4=EINT4, 23=EINT23 | 41 | * 1 bit EINT, 4=EINT4, 23=EINT23 |
32 | * EINT0,1,2,3 are not handled here. | 42 | * EINT0,1,2,3 are not handled here. |
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2416-mem.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2416-mem.h new file mode 100644 index 000000000000..2f31b74974af --- /dev/null +++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2416-mem.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/regs-s3c2416-mem.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>, | ||
4 | * as part of OpenInkpot project | ||
5 | * Copyright (c) 2009 Promwad Innovation Company | ||
6 | * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
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 | * S3C2416 memory register definitions | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASM_ARM_REGS_S3C2416_MEM | ||
16 | #define __ASM_ARM_REGS_S3C2416_MEM | ||
17 | |||
18 | #ifndef S3C2416_MEMREG | ||
19 | #define S3C2416_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x)) | ||
20 | #endif | ||
21 | |||
22 | #define S3C2416_BANKCFG S3C2416_MEMREG(0x00) | ||
23 | #define S3C2416_BANKCON1 S3C2416_MEMREG(0x04) | ||
24 | #define S3C2416_BANKCON2 S3C2416_MEMREG(0x08) | ||
25 | #define S3C2416_BANKCON3 S3C2416_MEMREG(0x0C) | ||
26 | |||
27 | #define S3C2416_REFRESH S3C2416_MEMREG(0x10) | ||
28 | #define S3C2416_TIMEOUT S3C2416_MEMREG(0x14) | ||
29 | |||
30 | #endif /* __ASM_ARM_REGS_S3C2416_MEM */ | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2416.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2416.h new file mode 100644 index 000000000000..e443167efb87 --- /dev/null +++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2416.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/regs-s3c2416.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>, | ||
4 | * as part of OpenInkpot project | ||
5 | * Copyright (c) 2009 Promwad Innovation Company | ||
6 | * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
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 | * S3C2416 specific register definitions | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASM_ARCH_REGS_S3C2416_H | ||
16 | #define __ASM_ARCH_REGS_S3C2416_H "s3c2416" | ||
17 | |||
18 | #define S3C2416_SWRST (S3C24XX_VA_CLKPWR + 0x44) | ||
19 | #define S3C2416_SWRST_RESET (0x533C2416) | ||
20 | |||
21 | /* see regs-power.h for the other registers in the power block. */ | ||
22 | |||
23 | #endif /* __ASM_ARCH_REGS_S3C2416_H */ | ||
24 | |||
diff --git a/arch/arm/mach-s3c2410/include/mach/uncompress.h b/arch/arm/mach-s3c2410/include/mach/uncompress.h index 72f756c5e504..8b283f847daa 100644 --- a/arch/arm/mach-s3c2410/include/mach/uncompress.h +++ b/arch/arm/mach-s3c2410/include/mach/uncompress.h | |||
@@ -40,7 +40,9 @@ static void arch_detect_cpu(void) | |||
40 | cpuid &= S3C2410_GSTATUS1_IDMASK; | 40 | cpuid &= S3C2410_GSTATUS1_IDMASK; |
41 | 41 | ||
42 | if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 || | 42 | if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 || |
43 | cpuid == S3C2410_GSTATUS1_2442) { | 43 | cpuid == S3C2410_GSTATUS1_2442 || |
44 | cpuid == S3C2410_GSTATUS1_2416 || | ||
45 | cpuid == S3C2410_GSTATUS1_2450) { | ||
44 | fifo_mask = S3C2440_UFSTAT_TXMASK; | 46 | fifo_mask = S3C2440_UFSTAT_TXMASK; |
45 | fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; | 47 | fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; |
46 | } else { | 48 | } else { |
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c index 7047317ed7f4..34fc05a4244b 100644 --- a/arch/arm/mach-s3c2410/mach-amlm5900.c +++ b/arch/arm/mach-s3c2410/mach-amlm5900.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include <plat/iic.h> | 56 | #include <plat/iic.h> |
57 | #include <plat/devs.h> | 57 | #include <plat/devs.h> |
58 | #include <plat/cpu.h> | 58 | #include <plat/cpu.h> |
59 | #include <plat/gpio-cfg.h> | ||
59 | 60 | ||
60 | #ifdef CONFIG_MTD_PARTITIONS | 61 | #ifdef CONFIG_MTD_PARTITIONS |
61 | 62 | ||
@@ -225,8 +226,8 @@ static void amlm5900_init_pm(void) | |||
225 | } else { | 226 | } else { |
226 | enable_irq_wake(IRQ_EINT9); | 227 | enable_irq_wake(IRQ_EINT9); |
227 | /* configure the suspend/resume status pin */ | 228 | /* configure the suspend/resume status pin */ |
228 | s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); | 229 | s3c_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); |
229 | s3c2410_gpio_pullup(S3C2410_GPF(2), 0); | 230 | s3c_gpio_setpull(S3C2410_GPF(2), S3C_GPIO_PULL_UP); |
230 | } | 231 | } |
231 | } | 232 | } |
232 | static void __init amlm5900_init(void) | 233 | static void __init amlm5900_init(void) |
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c index 02b1b6220cba..b061ddcf3067 100644 --- a/arch/arm/mach-s3c2410/mach-bast.c +++ b/arch/arm/mach-s3c2410/mach-bast.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <plat/devs.h> | 61 | #include <plat/devs.h> |
62 | #include <plat/cpu.h> | 62 | #include <plat/cpu.h> |
63 | #include <plat/cpu-freq.h> | 63 | #include <plat/cpu-freq.h> |
64 | #include <plat/gpio-cfg.h> | ||
64 | #include <plat/audio-simtec.h> | 65 | #include <plat/audio-simtec.h> |
65 | 66 | ||
66 | #include "usb-simtec.h" | 67 | #include "usb-simtec.h" |
@@ -216,15 +217,13 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = { | |||
216 | static int bast_pm_suspend(struct sys_device *sd, pm_message_t state) | 217 | static int bast_pm_suspend(struct sys_device *sd, pm_message_t state) |
217 | { | 218 | { |
218 | /* ensure that an nRESET is not generated on resume. */ | 219 | /* ensure that an nRESET is not generated on resume. */ |
219 | s3c2410_gpio_setpin(S3C2410_GPA(21), 1); | 220 | gpio_direction_output(S3C2410_GPA(21), 1); |
220 | s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT); | ||
221 | |||
222 | return 0; | 221 | return 0; |
223 | } | 222 | } |
224 | 223 | ||
225 | static int bast_pm_resume(struct sys_device *sd) | 224 | static int bast_pm_resume(struct sys_device *sd) |
226 | { | 225 | { |
227 | s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); | 226 | s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); |
228 | return 0; | 227 | return 0; |
229 | } | 228 | } |
230 | 229 | ||
@@ -658,6 +657,8 @@ static void __init bast_init(void) | |||
658 | nor_simtec_init(); | 657 | nor_simtec_init(); |
659 | simtec_audio_add(NULL, true, &bast_audio); | 658 | simtec_audio_add(NULL, true, &bast_audio); |
660 | 659 | ||
660 | WARN_ON(gpio_request(S3C2410_GPA(21), "bast nreset")); | ||
661 | |||
661 | s3c_cpufreq_setboard(&bast_cpufreq); | 662 | s3c_cpufreq_setboard(&bast_cpufreq); |
662 | } | 663 | } |
663 | 664 | ||
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index fbedd0760941..9531b4c41deb 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <plat/udc.h> | 50 | #include <plat/udc.h> |
51 | #include <plat/iic.h> | 51 | #include <plat/iic.h> |
52 | 52 | ||
53 | #include <plat/gpio-cfg.h> | ||
53 | #include <plat/clock.h> | 54 | #include <plat/clock.h> |
54 | #include <plat/devs.h> | 55 | #include <plat/devs.h> |
55 | #include <plat/cpu.h> | 56 | #include <plat/cpu.h> |
@@ -207,16 +208,16 @@ static int h1940_backlight_init(struct device *dev) | |||
207 | { | 208 | { |
208 | gpio_request(S3C2410_GPB(0), "Backlight"); | 209 | gpio_request(S3C2410_GPB(0), "Backlight"); |
209 | 210 | ||
210 | s3c2410_gpio_setpin(S3C2410_GPB(0), 0); | 211 | gpio_direction_output(S3C2410_GPB(0), 0); |
211 | s3c2410_gpio_pullup(S3C2410_GPB(0), 0); | 212 | s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_NONE); |
212 | s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0); | 213 | s3c_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0); |
213 | 214 | ||
214 | return 0; | 215 | return 0; |
215 | } | 216 | } |
216 | 217 | ||
217 | static void h1940_backlight_exit(struct device *dev) | 218 | static void h1940_backlight_exit(struct device *dev) |
218 | { | 219 | { |
219 | s3c2410_gpio_cfgpin(S3C2410_GPB(0), 1/*S3C2410_GPB0_OUTP*/); | 220 | gpio_direction_output(S3C2410_GPB(0), 1); |
220 | } | 221 | } |
221 | 222 | ||
222 | static struct platform_pwm_backlight_data backlight_data = { | 223 | static struct platform_pwm_backlight_data backlight_data = { |
@@ -245,18 +246,18 @@ static void h1940_lcd_power_set(struct plat_lcd_data *pd, | |||
245 | 246 | ||
246 | if (!power) { | 247 | if (!power) { |
247 | /* set to 3ec */ | 248 | /* set to 3ec */ |
248 | s3c2410_gpio_setpin(S3C2410_GPC(0), 0); | 249 | gpio_direction_output(S3C2410_GPC(0), 0); |
249 | /* wait for 3ac */ | 250 | /* wait for 3ac */ |
250 | do { | 251 | do { |
251 | value = s3c2410_gpio_getpin(S3C2410_GPC(6)); | 252 | value = gpio_get_value(S3C2410_GPC(6)); |
252 | } while (value); | 253 | } while (value); |
253 | /* set to 38c */ | 254 | /* set to 38c */ |
254 | s3c2410_gpio_setpin(S3C2410_GPC(5), 0); | 255 | gpio_direction_output(S3C2410_GPC(5), 0); |
255 | } else { | 256 | } else { |
256 | /* Set to 3ac */ | 257 | /* Set to 3ac */ |
257 | s3c2410_gpio_setpin(S3C2410_GPC(5), 1); | 258 | gpio_direction_output(S3C2410_GPC(5), 1); |
258 | /* Set to 3ad */ | 259 | /* Set to 3ad */ |
259 | s3c2410_gpio_setpin(S3C2410_GPC(0), 1); | 260 | gpio_direction_output(S3C2410_GPC(0), 1); |
260 | } | 261 | } |
261 | } | 262 | } |
262 | 263 | ||
@@ -332,6 +333,7 @@ static void __init h1940_init(void) | |||
332 | gpio_request(S3C2410_GPC(5), "LCD power"); | 333 | gpio_request(S3C2410_GPC(5), "LCD power"); |
333 | gpio_request(S3C2410_GPC(6), "LCD power"); | 334 | gpio_request(S3C2410_GPC(6), "LCD power"); |
334 | 335 | ||
336 | gpio_direction_input(S3C2410_GPC(6)); | ||
335 | 337 | ||
336 | platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); | 338 | platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); |
337 | } | 339 | } |
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c index 684710f88142..75a9fd37a467 100644 --- a/arch/arm/mach-s3c2410/mach-n30.c +++ b/arch/arm/mach-s3c2410/mach-n30.c | |||
@@ -86,10 +86,10 @@ static void n30_udc_pullup(enum s3c2410_udc_cmd_e cmd) | |||
86 | { | 86 | { |
87 | switch (cmd) { | 87 | switch (cmd) { |
88 | case S3C2410_UDC_P_ENABLE : | 88 | case S3C2410_UDC_P_ENABLE : |
89 | s3c2410_gpio_setpin(S3C2410_GPB(3), 1); | 89 | gpio_set_value(S3C2410_GPB(3), 1); |
90 | break; | 90 | break; |
91 | case S3C2410_UDC_P_DISABLE : | 91 | case S3C2410_UDC_P_DISABLE : |
92 | s3c2410_gpio_setpin(S3C2410_GPB(3), 0); | 92 | gpio_set_value(S3C2410_GPB(3), 0); |
93 | break; | 93 | break; |
94 | case S3C2410_UDC_P_RESET : | 94 | case S3C2410_UDC_P_RESET : |
95 | break; | 95 | break; |
@@ -536,6 +536,9 @@ static void __init n30_init(void) | |||
536 | 536 | ||
537 | platform_add_devices(n35_devices, ARRAY_SIZE(n35_devices)); | 537 | platform_add_devices(n35_devices, ARRAY_SIZE(n35_devices)); |
538 | } | 538 | } |
539 | |||
540 | WARN_ON(gpio_request(S3C2410_GPB(3), "udc pup")); | ||
541 | gpio_direction_output(S3C2410_GPB(3), 0); | ||
539 | } | 542 | } |
540 | 543 | ||
541 | MACHINE_START(N30, "Acer-N30") | 544 | MACHINE_START(N30, "Acer-N30") |
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c index 92a4ec375d82..d0e87b6e2e0f 100644 --- a/arch/arm/mach-s3c2410/mach-qt2410.c +++ b/arch/arm/mach-s3c2410/mach-qt2410.c | |||
@@ -58,6 +58,7 @@ | |||
58 | #include <plat/iic.h> | 58 | #include <plat/iic.h> |
59 | 59 | ||
60 | #include <plat/common-smdk.h> | 60 | #include <plat/common-smdk.h> |
61 | #include <plat/gpio-cfg.h> | ||
61 | #include <plat/devs.h> | 62 | #include <plat/devs.h> |
62 | #include <plat/cpu.h> | 63 | #include <plat/cpu.h> |
63 | #include <plat/pm.h> | 64 | #include <plat/pm.h> |
@@ -219,10 +220,10 @@ static void spi_gpio_cs(struct s3c2410_spigpio_info *spi, int cs) | |||
219 | { | 220 | { |
220 | switch (cs) { | 221 | switch (cs) { |
221 | case BITBANG_CS_ACTIVE: | 222 | case BITBANG_CS_ACTIVE: |
222 | s3c2410_gpio_setpin(S3C2410_GPB(5), 0); | 223 | gpio_set_value(S3C2410_GPB(5), 0); |
223 | break; | 224 | break; |
224 | case BITBANG_CS_INACTIVE: | 225 | case BITBANG_CS_INACTIVE: |
225 | s3c2410_gpio_setpin(S3C2410_GPB(5), 1); | 226 | gpio_set_value(S3C2410_GPB(5), 1); |
226 | break; | 227 | break; |
227 | } | 228 | } |
228 | } | 229 | } |
@@ -347,13 +348,14 @@ static void __init qt2410_machine_init(void) | |||
347 | } | 348 | } |
348 | s3c24xx_fb_set_platdata(&qt2410_fb_info); | 349 | s3c24xx_fb_set_platdata(&qt2410_fb_info); |
349 | 350 | ||
350 | s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPIO_OUTPUT); | 351 | s3c_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPIO_OUTPUT); |
351 | s3c2410_gpio_setpin(S3C2410_GPB(0), 1); | 352 | s3c2410_gpio_setpin(S3C2410_GPB(0), 1); |
352 | 353 | ||
353 | s3c24xx_udc_set_platdata(&qt2410_udc_cfg); | 354 | s3c24xx_udc_set_platdata(&qt2410_udc_cfg); |
354 | s3c_i2c0_set_platdata(NULL); | 355 | s3c_i2c0_set_platdata(NULL); |
355 | 356 | ||
356 | s3c2410_gpio_cfgpin(S3C2410_GPB(5), S3C2410_GPIO_OUTPUT); | 357 | WARN_ON(gpio_request(S3C2410_GPB(5), "spi cs")); |
358 | gpio_direction_output(S3C2410_GPB(5), 1); | ||
357 | 359 | ||
358 | platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); | 360 | platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); |
359 | s3c_pm_init(); | 361 | s3c_pm_init(); |
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c index 9051f0d31123..d540d79dd264 100644 --- a/arch/arm/mach-s3c2410/mach-vr1000.c +++ b/arch/arm/mach-s3c2410/mach-vr1000.c | |||
@@ -357,8 +357,7 @@ static struct clk *vr1000_clocks[] __initdata = { | |||
357 | 357 | ||
358 | static void vr1000_power_off(void) | 358 | static void vr1000_power_off(void) |
359 | { | 359 | { |
360 | s3c2410_gpio_cfgpin(S3C2410_GPB(9), S3C2410_GPIO_OUTPUT); | 360 | gpio_direction_output(S3C2410_GPB(9), 1); |
361 | s3c2410_gpio_setpin(S3C2410_GPB(9), 1); | ||
362 | } | 361 | } |
363 | 362 | ||
364 | static void __init vr1000_map_io(void) | 363 | static void __init vr1000_map_io(void) |
@@ -395,6 +394,8 @@ static void __init vr1000_init(void) | |||
395 | 394 | ||
396 | nor_simtec_init(); | 395 | nor_simtec_init(); |
397 | simtec_audio_add(NULL, true, NULL); | 396 | simtec_audio_add(NULL, true, NULL); |
397 | |||
398 | WARN_ON(gpio_request(S3C2410_GPB(9), "power off")); | ||
398 | } | 399 | } |
399 | 400 | ||
400 | MACHINE_START(VR1000, "Thorcom-VR1000") | 401 | MACHINE_START(VR1000, "Thorcom-VR1000") |
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c index 91ba42f688ac..adc90a3c5890 100644 --- a/arch/arm/mach-s3c2410/s3c2410.c +++ b/arch/arm/mach-s3c2410/s3c2410.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/gpio.h> | ||
19 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
20 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
21 | #include <linux/serial_core.h> | 22 | #include <linux/serial_core.h> |
@@ -40,6 +41,10 @@ | |||
40 | #include <plat/clock.h> | 41 | #include <plat/clock.h> |
41 | #include <plat/pll.h> | 42 | #include <plat/pll.h> |
42 | 43 | ||
44 | #include <plat/gpio-core.h> | ||
45 | #include <plat/gpio-cfg.h> | ||
46 | #include <plat/gpio-cfg-helpers.h> | ||
47 | |||
43 | /* Initial IO mappings */ | 48 | /* Initial IO mappings */ |
44 | 49 | ||
45 | static struct map_desc s3c2410_iodesc[] __initdata = { | 50 | static struct map_desc s3c2410_iodesc[] __initdata = { |
@@ -65,6 +70,9 @@ void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no) | |||
65 | 70 | ||
66 | void __init s3c2410_map_io(void) | 71 | void __init s3c2410_map_io(void) |
67 | { | 72 | { |
73 | s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up; | ||
74 | s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up; | ||
75 | |||
68 | iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc)); | 76 | iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc)); |
69 | } | 77 | } |
70 | 78 | ||
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig index 9a8c0657ae50..cef6a65637bd 100644 --- a/arch/arm/mach-s3c2412/Kconfig +++ b/arch/arm/mach-s3c2412/Kconfig | |||
@@ -16,7 +16,8 @@ config CPU_S3C2412 | |||
16 | config CPU_S3C2412_ONLY | 16 | config CPU_S3C2412_ONLY |
17 | bool | 17 | bool |
18 | depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \ | 18 | depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \ |
19 | !CPU_S3C2440 && !CPU_S3C2442 && !CPU_S3C2443 && CPU_S3C2412 | 19 | !CPU_2416 && !CPU_S3C2440 && !CPU_S3C2442 && \ |
20 | !CPU_S3C2443 && CPU_S3C2412 | ||
20 | default y if CPU_S3C2412 | 21 | default y if CPU_S3C2412 |
21 | 22 | ||
22 | config S3C2412_DMA | 23 | config S3C2412_DMA |
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c index 14f4798291aa..43160183571a 100644 --- a/arch/arm/mach-s3c2412/mach-jive.c +++ b/arch/arm/mach-s3c2412/mach-jive.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <linux/mtd/nand_ecc.h> | 48 | #include <linux/mtd/nand_ecc.h> |
49 | #include <linux/mtd/partitions.h> | 49 | #include <linux/mtd/partitions.h> |
50 | 50 | ||
51 | #include <plat/gpio-cfg.h> | ||
51 | #include <plat/clock.h> | 52 | #include <plat/clock.h> |
52 | #include <plat/devs.h> | 53 | #include <plat/devs.h> |
53 | #include <plat/cpu.h> | 54 | #include <plat/cpu.h> |
@@ -357,8 +358,7 @@ static void jive_lcm_reset(unsigned int set) | |||
357 | { | 358 | { |
358 | printk(KERN_DEBUG "%s(%d)\n", __func__, set); | 359 | printk(KERN_DEBUG "%s(%d)\n", __func__, set); |
359 | 360 | ||
360 | s3c2410_gpio_setpin(S3C2410_GPG(13), set); | 361 | gpio_set_value(S3C2410_GPG(13), set); |
361 | s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_OUTPUT); | ||
362 | } | 362 | } |
363 | 363 | ||
364 | #undef LCD_UPPER_MARGIN | 364 | #undef LCD_UPPER_MARGIN |
@@ -391,7 +391,7 @@ static struct ili9320_platdata jive_lcm_config = { | |||
391 | 391 | ||
392 | static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs) | 392 | static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs) |
393 | { | 393 | { |
394 | s3c2410_gpio_setpin(S3C2410_GPB(7), cs ? 0 : 1); | 394 | gpio_set_value(S3C2410_GPB(7), cs ? 0 : 1); |
395 | } | 395 | } |
396 | 396 | ||
397 | static struct s3c2410_spigpio_info jive_lcd_spi = { | 397 | static struct s3c2410_spigpio_info jive_lcd_spi = { |
@@ -413,7 +413,7 @@ static struct platform_device jive_device_lcdspi = { | |||
413 | 413 | ||
414 | static void jive_wm8750_chipselect(struct s3c2410_spigpio_info *spi, int cs) | 414 | static void jive_wm8750_chipselect(struct s3c2410_spigpio_info *spi, int cs) |
415 | { | 415 | { |
416 | s3c2410_gpio_setpin(S3C2410_GPH(10), cs ? 0 : 1); | 416 | gpio_set_value(S3C2410_GPH(10), cs ? 0 : 1); |
417 | } | 417 | } |
418 | 418 | ||
419 | static struct s3c2410_spigpio_info jive_wm8750_spi = { | 419 | static struct s3c2410_spigpio_info jive_wm8750_spi = { |
@@ -531,7 +531,7 @@ static void jive_power_off(void) | |||
531 | printk(KERN_INFO "powering system down...\n"); | 531 | printk(KERN_INFO "powering system down...\n"); |
532 | 532 | ||
533 | s3c2410_gpio_setpin(S3C2410_GPC(5), 1); | 533 | s3c2410_gpio_setpin(S3C2410_GPC(5), 1); |
534 | s3c2410_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT); | 534 | s3c_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT); |
535 | } | 535 | } |
536 | 536 | ||
537 | static void __init jive_machine_init(void) | 537 | static void __init jive_machine_init(void) |
@@ -636,22 +636,22 @@ static void __init jive_machine_init(void) | |||
636 | 636 | ||
637 | /* initialise the spi */ | 637 | /* initialise the spi */ |
638 | 638 | ||
639 | s3c2410_gpio_setpin(S3C2410_GPG(13), 0); | 639 | gpio_request(S3C2410_GPG(13), "lcm reset"); |
640 | s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_OUTPUT); | 640 | gpio_direction_output(S3C2410_GPG(13), 0); |
641 | 641 | ||
642 | s3c2410_gpio_setpin(S3C2410_GPB(7), 1); | 642 | gpio_request(S3C2410_GPB(7), "jive spi"); |
643 | s3c2410_gpio_cfgpin(S3C2410_GPB(7), S3C2410_GPIO_OUTPUT); | 643 | gpio_direction_output(S3C2410_GPB(7), 1); |
644 | 644 | ||
645 | s3c2410_gpio_setpin(S3C2410_GPB(6), 0); | 645 | s3c2410_gpio_setpin(S3C2410_GPB(6), 0); |
646 | s3c2410_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT); | 646 | s3c_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT); |
647 | 647 | ||
648 | s3c2410_gpio_setpin(S3C2410_GPG(8), 1); | 648 | s3c2410_gpio_setpin(S3C2410_GPG(8), 1); |
649 | s3c2410_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT); | 649 | s3c_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT); |
650 | 650 | ||
651 | /* initialise the WM8750 spi */ | 651 | /* initialise the WM8750 spi */ |
652 | 652 | ||
653 | s3c2410_gpio_setpin(S3C2410_GPH(10), 1); | 653 | gpio_request(S3C2410_GPH(10), "jive wm8750 spi"); |
654 | s3c2410_gpio_cfgpin(S3C2410_GPH(10), S3C2410_GPIO_OUTPUT); | 654 | gpio_direction_output(S3C2410_GPH(10), 1); |
655 | 655 | ||
656 | /* Turn off suspend on both USB ports, and switch the | 656 | /* Turn off suspend on both USB ports, and switch the |
657 | * selectable USB port to USB device mode. */ | 657 | * selectable USB port to USB device mode. */ |
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c index 0392065af1af..faddb36ed23b 100644 --- a/arch/arm/mach-s3c2412/mach-smdk2413.c +++ b/arch/arm/mach-s3c2412/mach-smdk2413.c | |||
@@ -85,10 +85,10 @@ static void smdk2413_udc_pullup(enum s3c2410_udc_cmd_e cmd) | |||
85 | switch (cmd) | 85 | switch (cmd) |
86 | { | 86 | { |
87 | case S3C2410_UDC_P_ENABLE : | 87 | case S3C2410_UDC_P_ENABLE : |
88 | s3c2410_gpio_setpin(S3C2410_GPF(2), 1); | 88 | gpio_set_value(S3C2410_GPF(2), 1); |
89 | break; | 89 | break; |
90 | case S3C2410_UDC_P_DISABLE : | 90 | case S3C2410_UDC_P_DISABLE : |
91 | s3c2410_gpio_setpin(S3C2410_GPF(2), 0); | 91 | gpio_set_value(S3C2410_GPF(2), 0); |
92 | break; | 92 | break; |
93 | case S3C2410_UDC_P_RESET : | 93 | case S3C2410_UDC_P_RESET : |
94 | break; | 94 | break; |
@@ -134,8 +134,8 @@ static void __init smdk2413_machine_init(void) | |||
134 | { /* Turn off suspend on both USB ports, and switch the | 134 | { /* Turn off suspend on both USB ports, and switch the |
135 | * selectable USB port to USB device mode. */ | 135 | * selectable USB port to USB device mode. */ |
136 | 136 | ||
137 | s3c2410_gpio_setpin(S3C2410_GPF(2), 0); | 137 | WARN_ON(gpio_request(S3C2410_GPF(2), "udc pull")); |
138 | s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); | 138 | gpio_direction_output(S3C2410_GPF(2), 0); |
139 | 139 | ||
140 | s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | | 140 | s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | |
141 | S3C2410_MISCCR_USBSUSPND0 | | 141 | S3C2410_MISCCR_USBSUSPND0 | |
diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig new file mode 100644 index 000000000000..29103a6047de --- /dev/null +++ b/arch/arm/mach-s3c2416/Kconfig | |||
@@ -0,0 +1,38 @@ | |||
1 | # arch/arm/mach-s3c2416/Kconfig | ||
2 | # | ||
3 | # Copyright 2009 Yauhen Kharuzhy <jekhor@gmail.com> | ||
4 | # | ||
5 | # Licensed under GPLv2 | ||
6 | |||
7 | # note, this also supports the S3C2450 which is so similar it has the same | ||
8 | # ID code as the S3C2416. | ||
9 | |||
10 | config CPU_S3C2416 | ||
11 | bool | ||
12 | depends on ARCH_S3C2410 | ||
13 | select CPU_ARM926T | ||
14 | select S3C2416_DMA if S3C2410_DMA | ||
15 | select CPU_LLSERIAL_S3C2440 | ||
16 | select S3C_GPIO_PULL_UPDOWN | ||
17 | select SAMSUNG_CLKSRC | ||
18 | select S3C2443_CLOCK | ||
19 | help | ||
20 | Support for the S3C2416 SoC from the S3C24XX line | ||
21 | |||
22 | config S3C2416_DMA | ||
23 | bool | ||
24 | depends on CPU_S3C2416 | ||
25 | help | ||
26 | Internal config node for S3C2416 DMA support | ||
27 | |||
28 | menu "S3C2416 Machines" | ||
29 | |||
30 | config MACH_SMDK2416 | ||
31 | bool "SMDK2416" | ||
32 | select CPU_S3C2416 | ||
33 | select S3C_DEV_HSMMC | ||
34 | select S3C_DEV_HSMMC1 | ||
35 | help | ||
36 | Say Y here if you are using an SMDK2416 | ||
37 | |||
38 | endmenu | ||
diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile new file mode 100644 index 000000000000..6c12c7bf40ad --- /dev/null +++ b/arch/arm/mach-s3c2416/Makefile | |||
@@ -0,0 +1,19 @@ | |||
1 | # arch/arm/mach-s3c2416/Makefile | ||
2 | # | ||
3 | # Copyright 2009 Yauhen Kharuzhy <jekhor@gmail.com> | ||
4 | # | ||
5 | # Licensed under GPLv2 | ||
6 | |||
7 | obj-y := | ||
8 | obj-m := | ||
9 | obj-n := | ||
10 | obj- := | ||
11 | |||
12 | obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock.o | ||
13 | obj-$(CONFIG_CPU_S3C2416) += irq.o | ||
14 | |||
15 | #obj-$(CONFIG_S3C2416_DMA) += dma.o | ||
16 | |||
17 | # Machine support | ||
18 | |||
19 | obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o | ||
diff --git a/arch/arm/mach-s3c2416/clock.c b/arch/arm/mach-s3c2416/clock.c new file mode 100644 index 000000000000..7ccf5a2a2bfc --- /dev/null +++ b/arch/arm/mach-s3c2416/clock.c | |||
@@ -0,0 +1,135 @@ | |||
1 | /* linux/arch/arm/mach-s3c2416/clock.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Simtec Electronics | ||
4 | * Copyright (c) 2010 Ben Dooks <ben-linux@fluff.org> | ||
5 | * | ||
6 | * S3C2416 Clock control support | ||
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 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/clk.h> | ||
16 | |||
17 | #include <plat/s3c2416.h> | ||
18 | #include <plat/s3c2443.h> | ||
19 | #include <plat/clock.h> | ||
20 | #include <plat/clock-clksrc.h> | ||
21 | #include <plat/cpu.h> | ||
22 | |||
23 | #include <plat/cpu-freq.h> | ||
24 | #include <plat/pll6553x.h> | ||
25 | #include <plat/pll.h> | ||
26 | |||
27 | #include <asm/mach/map.h> | ||
28 | |||
29 | #include <mach/regs-clock.h> | ||
30 | #include <mach/regs-s3c2443-clock.h> | ||
31 | |||
32 | static unsigned int armdiv[8] = { | ||
33 | [0] = 1, | ||
34 | [1] = 2, | ||
35 | [2] = 3, | ||
36 | [3] = 4, | ||
37 | [5] = 6, | ||
38 | [7] = 8, | ||
39 | }; | ||
40 | |||
41 | /* ID to hardware numbering, 0 is HSMMC1, 1 is HSMMC0 */ | ||
42 | static struct clksrc_clk hsmmc_div[] = { | ||
43 | [0] = { | ||
44 | .clk = { | ||
45 | .name = "hsmmc-div", | ||
46 | .id = 1, | ||
47 | .parent = &clk_esysclk.clk, | ||
48 | }, | ||
49 | .reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6 }, | ||
50 | }, | ||
51 | [1] = { | ||
52 | .clk = { | ||
53 | .name = "hsmmc-div", | ||
54 | .id = 0, | ||
55 | .parent = &clk_esysclk.clk, | ||
56 | }, | ||
57 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static struct clksrc_clk hsmmc_mux[] = { | ||
62 | [0] = { | ||
63 | .clk = { | ||
64 | .id = 1, | ||
65 | .name = "hsmmc-if", | ||
66 | .ctrlbit = (1 << 6), | ||
67 | .enable = s3c2443_clkcon_enable_s, | ||
68 | }, | ||
69 | .sources = &(struct clksrc_sources) { | ||
70 | .nr_sources = 2, | ||
71 | .sources = (struct clk *[]) { | ||
72 | [0] = &hsmmc_div[0].clk, | ||
73 | [1] = NULL, /* to fix */ | ||
74 | }, | ||
75 | }, | ||
76 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 16 }, | ||
77 | }, | ||
78 | [1] = { | ||
79 | .clk = { | ||
80 | .id = 0, | ||
81 | .name = "hsmmc-if", | ||
82 | .ctrlbit = (1 << 12), | ||
83 | .enable = s3c2443_clkcon_enable_s, | ||
84 | }, | ||
85 | .sources = &(struct clksrc_sources) { | ||
86 | .nr_sources = 2, | ||
87 | .sources = (struct clk *[]) { | ||
88 | [0] = &hsmmc_div[1].clk, | ||
89 | [1] = NULL, /* to fix */ | ||
90 | }, | ||
91 | }, | ||
92 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 17 }, | ||
93 | }, | ||
94 | }; | ||
95 | |||
96 | |||
97 | static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0) | ||
98 | { | ||
99 | clkcon0 &= 7 << S3C2443_CLKDIV0_ARMDIV_SHIFT; | ||
100 | |||
101 | return armdiv[clkcon0 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]; | ||
102 | } | ||
103 | |||
104 | void __init_or_cpufreq s3c2416_setup_clocks(void) | ||
105 | { | ||
106 | s3c2443_common_setup_clocks(s3c2416_get_pll, s3c2416_fclk_div); | ||
107 | } | ||
108 | |||
109 | |||
110 | static struct clksrc_clk *clksrcs[] __initdata = { | ||
111 | &hsmmc_div[0], | ||
112 | &hsmmc_div[1], | ||
113 | &hsmmc_mux[0], | ||
114 | &hsmmc_mux[1], | ||
115 | }; | ||
116 | |||
117 | void __init s3c2416_init_clocks(int xtal) | ||
118 | { | ||
119 | u32 epllcon = __raw_readl(S3C2443_EPLLCON); | ||
120 | u32 epllcon1 = __raw_readl(S3C2443_EPLLCON+4); | ||
121 | int ptr; | ||
122 | |||
123 | /* s3c2416 EPLL compatible with s3c64xx */ | ||
124 | clk_epll.rate = s3c_get_pll6553x(xtal, epllcon, epllcon1); | ||
125 | |||
126 | clk_epll.parent = &clk_epllref.clk; | ||
127 | |||
128 | s3c2443_common_init_clocks(xtal, s3c2416_get_pll, s3c2416_fclk_div); | ||
129 | |||
130 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) | ||
131 | s3c_register_clksrc(clksrcs[ptr], 1); | ||
132 | |||
133 | s3c_pwmclk_init(); | ||
134 | |||
135 | } | ||
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c new file mode 100644 index 000000000000..89f521d59d06 --- /dev/null +++ b/arch/arm/mach-s3c2416/irq.c | |||
@@ -0,0 +1,254 @@ | |||
1 | /* linux/arch/arm/mach-s3c2416/irq.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>, | ||
4 | * as part of OpenInkpot project | ||
5 | * Copyright (c) 2009 Promwad Innovation Company | ||
6 | * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
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, | ||
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 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #include <linux/init.h> | ||
25 | #include <linux/module.h> | ||
26 | #include <linux/interrupt.h> | ||
27 | #include <linux/ioport.h> | ||
28 | #include <linux/sysdev.h> | ||
29 | #include <linux/io.h> | ||
30 | |||
31 | #include <mach/hardware.h> | ||
32 | #include <asm/irq.h> | ||
33 | |||
34 | #include <asm/mach/irq.h> | ||
35 | |||
36 | #include <mach/regs-irq.h> | ||
37 | #include <mach/regs-gpio.h> | ||
38 | |||
39 | #include <plat/cpu.h> | ||
40 | #include <plat/pm.h> | ||
41 | #include <plat/irq.h> | ||
42 | |||
43 | #define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1) | ||
44 | |||
45 | static inline void s3c2416_irq_demux(unsigned int irq, unsigned int len) | ||
46 | { | ||
47 | unsigned int subsrc, submsk; | ||
48 | unsigned int end; | ||
49 | |||
50 | /* read the current pending interrupts, and the mask | ||
51 | * for what it is available */ | ||
52 | |||
53 | subsrc = __raw_readl(S3C2410_SUBSRCPND); | ||
54 | submsk = __raw_readl(S3C2410_INTSUBMSK); | ||
55 | |||
56 | subsrc &= ~submsk; | ||
57 | subsrc >>= (irq - S3C2410_IRQSUB(0)); | ||
58 | subsrc &= (1 << len)-1; | ||
59 | |||
60 | end = len + irq; | ||
61 | |||
62 | for (; irq < end && subsrc; irq++) { | ||
63 | if (subsrc & 1) | ||
64 | generic_handle_irq(irq); | ||
65 | |||
66 | subsrc >>= 1; | ||
67 | } | ||
68 | } | ||
69 | |||
70 | /* WDT/AC97 sub interrupts */ | ||
71 | |||
72 | static void s3c2416_irq_demux_wdtac97(unsigned int irq, struct irq_desc *desc) | ||
73 | { | ||
74 | s3c2416_irq_demux(IRQ_S3C2443_WDT, 4); | ||
75 | } | ||
76 | |||
77 | #define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0)) | ||
78 | #define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97) | ||
79 | |||
80 | static void s3c2416_irq_wdtac97_mask(unsigned int irqno) | ||
81 | { | ||
82 | s3c_irqsub_mask(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); | ||
83 | } | ||
84 | |||
85 | static void s3c2416_irq_wdtac97_unmask(unsigned int irqno) | ||
86 | { | ||
87 | s3c_irqsub_unmask(irqno, INTMSK_WDTAC97); | ||
88 | } | ||
89 | |||
90 | static void s3c2416_irq_wdtac97_ack(unsigned int irqno) | ||
91 | { | ||
92 | s3c_irqsub_maskack(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); | ||
93 | } | ||
94 | |||
95 | static struct irq_chip s3c2416_irq_wdtac97 = { | ||
96 | .mask = s3c2416_irq_wdtac97_mask, | ||
97 | .unmask = s3c2416_irq_wdtac97_unmask, | ||
98 | .ack = s3c2416_irq_wdtac97_ack, | ||
99 | }; | ||
100 | |||
101 | |||
102 | /* LCD sub interrupts */ | ||
103 | |||
104 | static void s3c2416_irq_demux_lcd(unsigned int irq, struct irq_desc *desc) | ||
105 | { | ||
106 | s3c2416_irq_demux(IRQ_S3C2443_LCD1, 4); | ||
107 | } | ||
108 | |||
109 | #define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0)) | ||
110 | #define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4) | ||
111 | |||
112 | static void s3c2416_irq_lcd_mask(unsigned int irqno) | ||
113 | { | ||
114 | s3c_irqsub_mask(irqno, INTMSK_LCD, SUBMSK_LCD); | ||
115 | } | ||
116 | |||
117 | static void s3c2416_irq_lcd_unmask(unsigned int irqno) | ||
118 | { | ||
119 | s3c_irqsub_unmask(irqno, INTMSK_LCD); | ||
120 | } | ||
121 | |||
122 | static void s3c2416_irq_lcd_ack(unsigned int irqno) | ||
123 | { | ||
124 | s3c_irqsub_maskack(irqno, INTMSK_LCD, SUBMSK_LCD); | ||
125 | } | ||
126 | |||
127 | static struct irq_chip s3c2416_irq_lcd = { | ||
128 | .mask = s3c2416_irq_lcd_mask, | ||
129 | .unmask = s3c2416_irq_lcd_unmask, | ||
130 | .ack = s3c2416_irq_lcd_ack, | ||
131 | }; | ||
132 | |||
133 | |||
134 | /* DMA sub interrupts */ | ||
135 | |||
136 | static void s3c2416_irq_demux_dma(unsigned int irq, struct irq_desc *desc) | ||
137 | { | ||
138 | s3c2416_irq_demux(IRQ_S3C2443_DMA0, 6); | ||
139 | } | ||
140 | |||
141 | #define INTMSK_DMA (1UL << (IRQ_S3C2443_DMA - IRQ_EINT0)) | ||
142 | #define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5) | ||
143 | |||
144 | |||
145 | static void s3c2416_irq_dma_mask(unsigned int irqno) | ||
146 | { | ||
147 | s3c_irqsub_mask(irqno, INTMSK_DMA, SUBMSK_DMA); | ||
148 | } | ||
149 | |||
150 | static void s3c2416_irq_dma_unmask(unsigned int irqno) | ||
151 | { | ||
152 | s3c_irqsub_unmask(irqno, INTMSK_DMA); | ||
153 | } | ||
154 | |||
155 | static void s3c2416_irq_dma_ack(unsigned int irqno) | ||
156 | { | ||
157 | s3c_irqsub_maskack(irqno, INTMSK_DMA, SUBMSK_DMA); | ||
158 | } | ||
159 | |||
160 | static struct irq_chip s3c2416_irq_dma = { | ||
161 | .mask = s3c2416_irq_dma_mask, | ||
162 | .unmask = s3c2416_irq_dma_unmask, | ||
163 | .ack = s3c2416_irq_dma_ack, | ||
164 | }; | ||
165 | |||
166 | |||
167 | /* UART3 sub interrupts */ | ||
168 | |||
169 | static void s3c2416_irq_demux_uart3(unsigned int irq, struct irq_desc *desc) | ||
170 | { | ||
171 | s3c2416_irq_demux(IRQ_S3C2443_UART3, 3); | ||
172 | } | ||
173 | |||
174 | #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) | ||
175 | #define SUBMSK_UART3 (0xf << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) | ||
176 | |||
177 | |||
178 | static void s3c2416_irq_uart3_mask(unsigned int irqno) | ||
179 | { | ||
180 | s3c_irqsub_mask(irqno, INTMSK_UART3, SUBMSK_UART3); | ||
181 | } | ||
182 | |||
183 | static void s3c2416_irq_uart3_unmask(unsigned int irqno) | ||
184 | { | ||
185 | s3c_irqsub_unmask(irqno, INTMSK_UART3); | ||
186 | } | ||
187 | |||
188 | static void s3c2416_irq_uart3_ack(unsigned int irqno) | ||
189 | { | ||
190 | s3c_irqsub_maskack(irqno, INTMSK_UART3, SUBMSK_UART3); | ||
191 | } | ||
192 | |||
193 | static struct irq_chip s3c2416_irq_uart3 = { | ||
194 | .mask = s3c2416_irq_uart3_mask, | ||
195 | .unmask = s3c2416_irq_uart3_unmask, | ||
196 | .ack = s3c2416_irq_uart3_ack, | ||
197 | }; | ||
198 | |||
199 | |||
200 | /* IRQ initialisation code */ | ||
201 | |||
202 | static int __init s3c2416_add_sub(unsigned int base, | ||
203 | void (*demux)(unsigned int, | ||
204 | struct irq_desc *), | ||
205 | struct irq_chip *chip, | ||
206 | unsigned int start, unsigned int end) | ||
207 | { | ||
208 | unsigned int irqno; | ||
209 | |||
210 | set_irq_chip(base, &s3c_irq_level_chip); | ||
211 | set_irq_handler(base, handle_level_irq); | ||
212 | set_irq_chained_handler(base, demux); | ||
213 | |||
214 | for (irqno = start; irqno <= end; irqno++) { | ||
215 | set_irq_chip(irqno, chip); | ||
216 | set_irq_handler(irqno, handle_level_irq); | ||
217 | set_irq_flags(irqno, IRQF_VALID); | ||
218 | } | ||
219 | |||
220 | return 0; | ||
221 | } | ||
222 | |||
223 | static int __init s3c2416_irq_add(struct sys_device *sysdev) | ||
224 | { | ||
225 | printk(KERN_INFO "S3C2416: IRQ Support\n"); | ||
226 | |||
227 | s3c2416_add_sub(IRQ_LCD, s3c2416_irq_demux_lcd, &s3c2416_irq_lcd, | ||
228 | IRQ_S3C2443_LCD2, IRQ_S3C2443_LCD4); | ||
229 | |||
230 | s3c2416_add_sub(IRQ_S3C2443_DMA, s3c2416_irq_demux_dma, | ||
231 | &s3c2416_irq_dma, IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5); | ||
232 | |||
233 | s3c2416_add_sub(IRQ_S3C2443_UART3, s3c2416_irq_demux_uart3, | ||
234 | &s3c2416_irq_uart3, | ||
235 | IRQ_S3C2443_RX3, IRQ_S3C2443_ERR3); | ||
236 | |||
237 | s3c2416_add_sub(IRQ_WDT, s3c2416_irq_demux_wdtac97, | ||
238 | &s3c2416_irq_wdtac97, | ||
239 | IRQ_S3C2443_WDT, IRQ_S3C2443_AC97); | ||
240 | |||
241 | return 0; | ||
242 | } | ||
243 | |||
244 | static struct sysdev_driver s3c2416_irq_driver = { | ||
245 | .add = s3c2416_irq_add, | ||
246 | }; | ||
247 | |||
248 | static int __init s3c2416_irq_init(void) | ||
249 | { | ||
250 | return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_irq_driver); | ||
251 | } | ||
252 | |||
253 | arch_initcall(s3c2416_irq_init); | ||
254 | |||
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c new file mode 100644 index 000000000000..99d24c44f30f --- /dev/null +++ b/arch/arm/mach-s3c2416/mach-smdk2416.c | |||
@@ -0,0 +1,150 @@ | |||
1 | /* linux/arch/arm/mach-s3c2416/mach-hanlin_v3c.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>, | ||
4 | * as part of OpenInkpot project | ||
5 | * Copyright (c) 2009 Promwad Innovation Company | ||
6 | * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
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 | #include <linux/kernel.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/timer.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/serial_core.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/mtd/partitions.h> | ||
24 | #include <linux/gpio.h> | ||
25 | |||
26 | #include <asm/mach/arch.h> | ||
27 | #include <asm/mach/map.h> | ||
28 | #include <asm/mach/irq.h> | ||
29 | |||
30 | #include <mach/hardware.h> | ||
31 | #include <asm/irq.h> | ||
32 | #include <asm/mach-types.h> | ||
33 | |||
34 | #include <plat/regs-serial.h> | ||
35 | #include <mach/regs-gpio.h> | ||
36 | #include <mach/regs-lcd.h> | ||
37 | |||
38 | #include <mach/idle.h> | ||
39 | #include <mach/fb.h> | ||
40 | #include <mach/leds-gpio.h> | ||
41 | #include <plat/iic.h> | ||
42 | |||
43 | #include <plat/s3c2416.h> | ||
44 | #include <plat/clock.h> | ||
45 | #include <plat/devs.h> | ||
46 | #include <plat/cpu.h> | ||
47 | #include <plat/nand.h> | ||
48 | |||
49 | #include <plat/common-smdk.h> | ||
50 | |||
51 | static struct map_desc smdk2416_iodesc[] __initdata = { | ||
52 | /* ISA IO Space map (memory space selected by A24) */ | ||
53 | |||
54 | { | ||
55 | .virtual = (u32)S3C24XX_VA_ISA_WORD, | ||
56 | .pfn = __phys_to_pfn(S3C2410_CS2), | ||
57 | .length = 0x10000, | ||
58 | .type = MT_DEVICE, | ||
59 | }, { | ||
60 | .virtual = (u32)S3C24XX_VA_ISA_WORD + 0x10000, | ||
61 | .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)), | ||
62 | .length = SZ_4M, | ||
63 | .type = MT_DEVICE, | ||
64 | }, { | ||
65 | .virtual = (u32)S3C24XX_VA_ISA_BYTE, | ||
66 | .pfn = __phys_to_pfn(S3C2410_CS2), | ||
67 | .length = 0x10000, | ||
68 | .type = MT_DEVICE, | ||
69 | }, { | ||
70 | .virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000, | ||
71 | .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)), | ||
72 | .length = SZ_4M, | ||
73 | .type = MT_DEVICE, | ||
74 | } | ||
75 | }; | ||
76 | |||
77 | #define UCON (S3C2410_UCON_DEFAULT | \ | ||
78 | S3C2440_UCON_PCLK | \ | ||
79 | S3C2443_UCON_RXERR_IRQEN) | ||
80 | |||
81 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE) | ||
82 | |||
83 | #define UFCON (S3C2410_UFCON_RXTRIG8 | \ | ||
84 | S3C2410_UFCON_FIFOMODE | \ | ||
85 | S3C2440_UFCON_TXTRIG16) | ||
86 | |||
87 | static struct s3c2410_uartcfg smdk2416_uartcfgs[] __initdata = { | ||
88 | [0] = { | ||
89 | .hwport = 0, | ||
90 | .flags = 0, | ||
91 | .ucon = UCON, | ||
92 | .ulcon = ULCON, | ||
93 | .ufcon = UFCON, | ||
94 | }, | ||
95 | [1] = { | ||
96 | .hwport = 1, | ||
97 | .flags = 0, | ||
98 | .ucon = UCON, | ||
99 | .ulcon = ULCON, | ||
100 | .ufcon = UFCON, | ||
101 | }, | ||
102 | /* IR port */ | ||
103 | [2] = { | ||
104 | .hwport = 2, | ||
105 | .flags = 0, | ||
106 | .ucon = UCON, | ||
107 | .ulcon = ULCON | 0x50, | ||
108 | .ufcon = UFCON, | ||
109 | } | ||
110 | }; | ||
111 | |||
112 | static struct platform_device *smdk2416_devices[] __initdata = { | ||
113 | &s3c_device_wdt, | ||
114 | &s3c_device_ohci, | ||
115 | &s3c_device_i2c0, | ||
116 | &s3c_device_hsmmc0, | ||
117 | &s3c_device_hsmmc1, | ||
118 | }; | ||
119 | |||
120 | static void __init smdk2416_map_io(void) | ||
121 | { | ||
122 | |||
123 | s3c24xx_init_io(smdk2416_iodesc, ARRAY_SIZE(smdk2416_iodesc)); | ||
124 | s3c24xx_init_clocks(12000000); | ||
125 | s3c24xx_init_uarts(smdk2416_uartcfgs, ARRAY_SIZE(smdk2416_uartcfgs)); | ||
126 | |||
127 | } | ||
128 | |||
129 | static void __init smdk2416_machine_init(void) | ||
130 | { | ||
131 | s3c_i2c0_set_platdata(NULL); | ||
132 | |||
133 | gpio_request(S3C2410_GPB(4), "USBHost Power"); | ||
134 | gpio_direction_output(S3C2410_GPB(4), 1); | ||
135 | |||
136 | platform_add_devices(smdk2416_devices, ARRAY_SIZE(smdk2416_devices)); | ||
137 | smdk_machine_init(); | ||
138 | } | ||
139 | |||
140 | MACHINE_START(SMDK2416, "SMDK2416") | ||
141 | /* Maintainer: Yauhen Kharuzhy <jekhor@gmail.com> */ | ||
142 | .phys_io = S3C2410_PA_UART, | ||
143 | .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, | ||
144 | .boot_params = S3C2410_SDRAM_PA + 0x100, | ||
145 | |||
146 | .init_irq = s3c24xx_init_irq, | ||
147 | .map_io = smdk2416_map_io, | ||
148 | .init_machine = smdk2416_machine_init, | ||
149 | .timer = &s3c24xx_timer, | ||
150 | MACHINE_END | ||
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c new file mode 100644 index 000000000000..3bff05745d0b --- /dev/null +++ b/arch/arm/mach-s3c2416/s3c2416.c | |||
@@ -0,0 +1,128 @@ | |||
1 | /* linux/arch/arm/mach-s3c2416/s3c2416.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com>, | ||
4 | * as part of OpenInkpot project | ||
5 | * Copyright (c) 2009 Promwad Innovation Company | ||
6 | * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
7 | * | ||
8 | * Samsung S3C2416 Mobile CPU support | ||
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/kernel.h> | ||
26 | #include <linux/types.h> | ||
27 | #include <linux/interrupt.h> | ||
28 | #include <linux/list.h> | ||
29 | #include <linux/timer.h> | ||
30 | #include <linux/init.h> | ||
31 | #include <linux/gpio.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/serial_core.h> | ||
34 | #include <linux/sysdev.h> | ||
35 | #include <linux/clk.h> | ||
36 | #include <linux/io.h> | ||
37 | |||
38 | #include <asm/mach/arch.h> | ||
39 | #include <asm/mach/map.h> | ||
40 | #include <asm/mach/irq.h> | ||
41 | |||
42 | #include <mach/hardware.h> | ||
43 | #include <asm/proc-fns.h> | ||
44 | #include <asm/irq.h> | ||
45 | |||
46 | #include <mach/reset.h> | ||
47 | #include <mach/idle.h> | ||
48 | #include <mach/regs-s3c2443-clock.h> | ||
49 | |||
50 | #include <plat/gpio-core.h> | ||
51 | #include <plat/gpio-cfg.h> | ||
52 | #include <plat/gpio-cfg-helpers.h> | ||
53 | #include <plat/s3c2416.h> | ||
54 | #include <plat/devs.h> | ||
55 | #include <plat/cpu.h> | ||
56 | |||
57 | #include <plat/iic-core.h> | ||
58 | |||
59 | static struct map_desc s3c2416_iodesc[] __initdata = { | ||
60 | IODESC_ENT(WATCHDOG), | ||
61 | IODESC_ENT(CLKPWR), | ||
62 | IODESC_ENT(TIMER), | ||
63 | }; | ||
64 | |||
65 | struct sysdev_class s3c2416_sysclass = { | ||
66 | .name = "s3c2416-core", | ||
67 | }; | ||
68 | |||
69 | static struct sys_device s3c2416_sysdev = { | ||
70 | .cls = &s3c2416_sysclass, | ||
71 | }; | ||
72 | |||
73 | static void s3c2416_hard_reset(void) | ||
74 | { | ||
75 | __raw_writel(S3C2443_SWRST_RESET, S3C2443_SWRST); | ||
76 | } | ||
77 | |||
78 | int __init s3c2416_init(void) | ||
79 | { | ||
80 | printk(KERN_INFO "S3C2416: Initializing architecture\n"); | ||
81 | |||
82 | s3c24xx_reset_hook = s3c2416_hard_reset; | ||
83 | /* s3c24xx_idle = s3c2416_idle; */ | ||
84 | |||
85 | /* change WDT IRQ number */ | ||
86 | s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT; | ||
87 | s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT; | ||
88 | |||
89 | /* the i2c devices are directly compatible with s3c2440 */ | ||
90 | s3c_i2c0_setname("s3c2440-i2c"); | ||
91 | s3c_i2c1_setname("s3c2440-i2c"); | ||
92 | |||
93 | return sysdev_register(&s3c2416_sysdev); | ||
94 | } | ||
95 | |||
96 | void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no) | ||
97 | { | ||
98 | s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no); | ||
99 | |||
100 | s3c_device_nand.name = "s3c2416-nand"; | ||
101 | } | ||
102 | |||
103 | /* s3c2416_map_io | ||
104 | * | ||
105 | * register the standard cpu IO areas, and any passed in from the | ||
106 | * machine specific initialisation. | ||
107 | */ | ||
108 | |||
109 | void __init s3c2416_map_io(void) | ||
110 | { | ||
111 | s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown; | ||
112 | s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown; | ||
113 | |||
114 | iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); | ||
115 | } | ||
116 | |||
117 | /* need to register class before we actually register the device, and | ||
118 | * we also need to ensure that it has been initialised before any of the | ||
119 | * drivers even try to use it (even if not on an s3c2416 based system) | ||
120 | * as a driver which may support both 2443 and 2440 may try and use it. | ||
121 | */ | ||
122 | |||
123 | static int __init s3c2416_core_init(void) | ||
124 | { | ||
125 | return sysdev_class_register(&s3c2416_sysclass); | ||
126 | } | ||
127 | |||
128 | core_initcall(s3c2416_core_init); | ||
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index 7f465265cf04..9d102b912091 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig | |||
@@ -6,6 +6,7 @@ config CPU_S3C2440 | |||
6 | bool | 6 | bool |
7 | depends on ARCH_S3C2410 | 7 | depends on ARCH_S3C2410 |
8 | select CPU_ARM920T | 8 | select CPU_ARM920T |
9 | select S3C_GPIO_PULL_UP | ||
9 | select S3C2410_CLOCK | 10 | select S3C2410_CLOCK |
10 | select S3C2410_PM if PM | 11 | select S3C2410_PM if PM |
11 | select S3C2410_GPIO | 12 | select S3C2410_GPIO |
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c index 571b17683d96..a76bcda210ad 100644 --- a/arch/arm/mach-s3c2440/mach-mini2440.c +++ b/arch/arm/mach-s3c2440/mach-mini2440.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <linux/mtd/nand_ecc.h> | 53 | #include <linux/mtd/nand_ecc.h> |
54 | #include <linux/mtd/partitions.h> | 54 | #include <linux/mtd/partitions.h> |
55 | 55 | ||
56 | #include <plat/gpio-cfg.h> | ||
56 | #include <plat/clock.h> | 57 | #include <plat/clock.h> |
57 | #include <plat/devs.h> | 58 | #include <plat/devs.h> |
58 | #include <plat/cpu.h> | 59 | #include <plat/cpu.h> |
@@ -102,10 +103,10 @@ static void mini2440_udc_pullup(enum s3c2410_udc_cmd_e cmd) | |||
102 | 103 | ||
103 | switch (cmd) { | 104 | switch (cmd) { |
104 | case S3C2410_UDC_P_ENABLE : | 105 | case S3C2410_UDC_P_ENABLE : |
105 | s3c2410_gpio_setpin(S3C2410_GPC(5), 1); | 106 | gpio_set_value(S3C2410_GPC(5), 1); |
106 | break; | 107 | break; |
107 | case S3C2410_UDC_P_DISABLE : | 108 | case S3C2410_UDC_P_DISABLE : |
108 | s3c2410_gpio_setpin(S3C2410_GPC(5), 0); | 109 | gpio_set_value(S3C2410_GPC(5), 0); |
109 | break; | 110 | break; |
110 | case S3C2410_UDC_P_RESET : | 111 | case S3C2410_UDC_P_RESET : |
111 | break; | 112 | break; |
@@ -632,25 +633,25 @@ static void __init mini2440_init(void) | |||
632 | mini2440_parse_features(&features, mini2440_features_str); | 633 | mini2440_parse_features(&features, mini2440_features_str); |
633 | 634 | ||
634 | /* turn LCD on */ | 635 | /* turn LCD on */ |
635 | s3c2410_gpio_cfgpin(S3C2410_GPC(0), S3C2410_GPC0_LEND); | 636 | s3c_gpio_cfgpin(S3C2410_GPC(0), S3C2410_GPC0_LEND); |
636 | 637 | ||
637 | /* Turn the backlight early on */ | 638 | /* Turn the backlight early on */ |
638 | s3c2410_gpio_setpin(S3C2410_GPG(4), 1); | 639 | WARN_ON(gpio_request(S3C2410_GPG(4), "backlight")); |
639 | s3c2410_gpio_cfgpin(S3C2410_GPG(4), S3C2410_GPIO_OUTPUT); | 640 | gpio_direction_output(S3C2410_GPG(4), 1); |
640 | 641 | ||
641 | /* remove pullup on optional PWM backlight -- unused on 3.5 and 7"s */ | 642 | /* remove pullup on optional PWM backlight -- unused on 3.5 and 7"s */ |
642 | s3c2410_gpio_pullup(S3C2410_GPB(1), 0); | 643 | s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP); |
643 | s3c2410_gpio_setpin(S3C2410_GPB(1), 0); | 644 | s3c2410_gpio_setpin(S3C2410_GPB(1), 0); |
644 | s3c2410_gpio_cfgpin(S3C2410_GPB(1), S3C2410_GPIO_INPUT); | 645 | s3c_gpio_cfgpin(S3C2410_GPB(1), S3C2410_GPIO_INPUT); |
645 | 646 | ||
646 | /* Make sure the D+ pullup pin is output */ | 647 | /* Make sure the D+ pullup pin is output */ |
647 | s3c2410_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT); | 648 | WARN_ON(gpio_request(S3C2410_GPC(5), "udc pup")); |
649 | gpio_direction_output(S3C2410_GPC(5), 0); | ||
648 | 650 | ||
649 | /* mark the key as input, without pullups (there is one on the board) */ | 651 | /* mark the key as input, without pullups (there is one on the board) */ |
650 | for (i = 0; i < ARRAY_SIZE(mini2440_buttons); i++) { | 652 | for (i = 0; i < ARRAY_SIZE(mini2440_buttons); i++) { |
651 | s3c2410_gpio_pullup(mini2440_buttons[i].gpio, 0); | 653 | s3c_gpio_setpull(mini2440_buttons[i].gpio, S3C_GPIO_PULL_UP); |
652 | s3c2410_gpio_cfgpin(mini2440_buttons[i].gpio, | 654 | s3c_gpio_cfgpin(mini2440_buttons[i].gpio, S3C2410_GPIO_INPUT); |
653 | S3C2410_GPIO_INPUT); | ||
654 | } | 655 | } |
655 | if (features.lcd_index != -1) { | 656 | if (features.lcd_index != -1) { |
656 | int li; | 657 | int li; |
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c index 342041593f22..3ff62de45fde 100644 --- a/arch/arm/mach-s3c2440/mach-nexcoder.c +++ b/arch/arm/mach-s3c2440/mach-nexcoder.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <plat/regs-serial.h> | 40 | #include <plat/regs-serial.h> |
41 | #include <plat/iic.h> | 41 | #include <plat/iic.h> |
42 | 42 | ||
43 | #include <plat/gpio-cfg.h> | ||
43 | #include <plat/s3c2410.h> | 44 | #include <plat/s3c2410.h> |
44 | #include <plat/s3c244x.h> | 45 | #include <plat/s3c244x.h> |
45 | #include <plat/clock.h> | 46 | #include <plat/clock.h> |
@@ -122,15 +123,15 @@ static void __init nexcoder_sensorboard_init(void) | |||
122 | { | 123 | { |
123 | // Initialize SCCB bus | 124 | // Initialize SCCB bus |
124 | s3c2410_gpio_setpin(S3C2410_GPE(14), 1); // IICSCL | 125 | s3c2410_gpio_setpin(S3C2410_GPE(14), 1); // IICSCL |
125 | s3c2410_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPIO_OUTPUT); | 126 | s3c_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPIO_OUTPUT); |
126 | s3c2410_gpio_setpin(S3C2410_GPE(15), 1); // IICSDA | 127 | s3c2410_gpio_setpin(S3C2410_GPE(15), 1); // IICSDA |
127 | s3c2410_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPIO_OUTPUT); | 128 | s3c_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPIO_OUTPUT); |
128 | 129 | ||
129 | // Power up the sensor board | 130 | // Power up the sensor board |
130 | s3c2410_gpio_setpin(S3C2410_GPF(1), 1); | 131 | s3c2410_gpio_setpin(S3C2410_GPF(1), 1); |
131 | s3c2410_gpio_cfgpin(S3C2410_GPF(1), S3C2410_GPIO_OUTPUT); // CAM_GPIO7 => nLDO_PWRDN | 132 | s3c_gpio_cfgpin(S3C2410_GPF(1), S3C2410_GPIO_OUTPUT); // CAM_GPIO7 => nLDO_PWRDN |
132 | s3c2410_gpio_setpin(S3C2410_GPF(2), 0); | 133 | s3c2410_gpio_setpin(S3C2410_GPF(2), 0); |
133 | s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); // CAM_GPIO6 => CAM_PWRDN | 134 | s3c_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); // CAM_GPIO6 => CAM_PWRDN |
134 | } | 135 | } |
135 | 136 | ||
136 | static void __init nexcoder_map_io(void) | 137 | static void __init nexcoder_map_io(void) |
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c index f35371db33f5..319458da71a0 100644 --- a/arch/arm/mach-s3c2440/mach-osiris.c +++ b/arch/arm/mach-s3c2440/mach-osiris.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/mtd/nand_ecc.h> | 49 | #include <linux/mtd/nand_ecc.h> |
50 | #include <linux/mtd/partitions.h> | 50 | #include <linux/mtd/partitions.h> |
51 | 51 | ||
52 | #include <plat/gpio-cfg.h> | ||
52 | #include <plat/clock.h> | 53 | #include <plat/clock.h> |
53 | #include <plat/devs.h> | 54 | #include <plat/devs.h> |
54 | #include <plat/cpu.h> | 55 | #include <plat/cpu.h> |
@@ -298,7 +299,7 @@ static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) | |||
298 | 299 | ||
299 | /* ensure that an nRESET is not generated on resume. */ | 300 | /* ensure that an nRESET is not generated on resume. */ |
300 | s3c2410_gpio_setpin(S3C2410_GPA(21), 1); | 301 | s3c2410_gpio_setpin(S3C2410_GPA(21), 1); |
301 | s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT); | 302 | s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT); |
302 | 303 | ||
303 | return 0; | 304 | return 0; |
304 | } | 305 | } |
@@ -310,7 +311,7 @@ static int osiris_pm_resume(struct sys_device *sd) | |||
310 | 311 | ||
311 | __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0); | 312 | __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0); |
312 | 313 | ||
313 | s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); | 314 | s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); |
314 | 315 | ||
315 | return 0; | 316 | return 0; |
316 | } | 317 | } |
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c index 2b68f7ea45ae..d50f3ae6173d 100644 --- a/arch/arm/mach-s3c2440/s3c2440.c +++ b/arch/arm/mach-s3c2440/s3c2440.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/serial_core.h> | 20 | #include <linux/serial_core.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
22 | #include <linux/gpio.h> | ||
22 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
24 | 25 | ||
@@ -33,6 +34,10 @@ | |||
33 | #include <plat/cpu.h> | 34 | #include <plat/cpu.h> |
34 | #include <plat/s3c244x.h> | 35 | #include <plat/s3c244x.h> |
35 | 36 | ||
37 | #include <plat/gpio-core.h> | ||
38 | #include <plat/gpio-cfg.h> | ||
39 | #include <plat/gpio-cfg-helpers.h> | ||
40 | |||
36 | static struct sys_device s3c2440_sysdev = { | 41 | static struct sys_device s3c2440_sysdev = { |
37 | .cls = &s3c2440_sysclass, | 42 | .cls = &s3c2440_sysclass, |
38 | }; | 43 | }; |
@@ -41,6 +46,9 @@ int __init s3c2440_init(void) | |||
41 | { | 46 | { |
42 | printk("S3C2440: Initialising architecture\n"); | 47 | printk("S3C2440: Initialising architecture\n"); |
43 | 48 | ||
49 | s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up; | ||
50 | s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up; | ||
51 | |||
44 | /* change irq for watchdog */ | 52 | /* change irq for watchdog */ |
45 | 53 | ||
46 | s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; | 54 | s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; |
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig index 698140af247c..4fef723126fa 100644 --- a/arch/arm/mach-s3c2443/Kconfig +++ b/arch/arm/mach-s3c2443/Kconfig | |||
@@ -8,6 +8,7 @@ config CPU_S3C2443 | |||
8 | select S3C2443_DMA if S3C2410_DMA | 8 | select S3C2443_DMA if S3C2410_DMA |
9 | select CPU_LLSERIAL_S3C2440 | 9 | select CPU_LLSERIAL_S3C2440 |
10 | select SAMSUNG_CLKSRC | 10 | select SAMSUNG_CLKSRC |
11 | select S3C2443_CLOCK | ||
11 | help | 12 | help |
12 | Support for the S3C2443 SoC from the S3C24XX line | 13 | Support for the S3C2443 SoC from the S3C24XX line |
13 | 14 | ||
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c index 62cd4eaee01b..83b1aa63d778 100644 --- a/arch/arm/mach-s3c2443/clock.c +++ b/arch/arm/mach-s3c2443/clock.c | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | |||
24 | #include <linux/module.h> | 25 | #include <linux/module.h> |
25 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
26 | #include <linux/list.h> | 27 | #include <linux/list.h> |
@@ -54,111 +55,13 @@ | |||
54 | * set the correct muxing at initialisation | 55 | * set the correct muxing at initialisation |
55 | */ | 56 | */ |
56 | 57 | ||
57 | static int s3c2443_gate(void __iomem *reg, struct clk *clk, int enable) | ||
58 | { | ||
59 | u32 ctrlbit = clk->ctrlbit; | ||
60 | u32 con = __raw_readl(reg); | ||
61 | |||
62 | if (enable) | ||
63 | con |= ctrlbit; | ||
64 | else | ||
65 | con &= ~ctrlbit; | ||
66 | |||
67 | __raw_writel(con, reg); | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static int s3c2443_clkcon_enable_h(struct clk *clk, int enable) | ||
72 | { | ||
73 | return s3c2443_gate(S3C2443_HCLKCON, clk, enable); | ||
74 | } | ||
75 | |||
76 | static int s3c2443_clkcon_enable_p(struct clk *clk, int enable) | ||
77 | { | ||
78 | return s3c2443_gate(S3C2443_PCLKCON, clk, enable); | ||
79 | } | ||
80 | |||
81 | static int s3c2443_clkcon_enable_s(struct clk *clk, int enable) | ||
82 | { | ||
83 | return s3c2443_gate(S3C2443_SCLKCON, clk, enable); | ||
84 | } | ||
85 | |||
86 | /* clock selections */ | 58 | /* clock selections */ |
87 | 59 | ||
88 | /* mpllref is a direct descendant of clk_xtal by default, but it is not | ||
89 | * elided as the EPLL can be either sourced by the XTAL or EXTCLK and as | ||
90 | * such directly equating the two source clocks is impossible. | ||
91 | */ | ||
92 | static struct clk clk_mpllref = { | ||
93 | .name = "mpllref", | ||
94 | .parent = &clk_xtal, | ||
95 | .id = -1, | ||
96 | }; | ||
97 | |||
98 | static struct clk clk_i2s_ext = { | 60 | static struct clk clk_i2s_ext = { |
99 | .name = "i2s-ext", | 61 | .name = "i2s-ext", |
100 | .id = -1, | 62 | .id = -1, |
101 | }; | 63 | }; |
102 | 64 | ||
103 | static struct clk *clk_epllref_sources[] = { | ||
104 | [0] = &clk_mpllref, | ||
105 | [1] = &clk_mpllref, | ||
106 | [2] = &clk_xtal, | ||
107 | [3] = &clk_ext, | ||
108 | }; | ||
109 | |||
110 | static struct clksrc_clk clk_epllref = { | ||
111 | .clk = { | ||
112 | .name = "epllref", | ||
113 | .id = -1, | ||
114 | }, | ||
115 | .sources = &(struct clksrc_sources) { | ||
116 | .sources = clk_epllref_sources, | ||
117 | .nr_sources = ARRAY_SIZE(clk_epllref_sources), | ||
118 | }, | ||
119 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 7 }, | ||
120 | }; | ||
121 | |||
122 | static unsigned long s3c2443_getrate_mdivclk(struct clk *clk) | ||
123 | { | ||
124 | unsigned long parent_rate = clk_get_rate(clk->parent); | ||
125 | unsigned long div = __raw_readl(S3C2443_CLKDIV0); | ||
126 | |||
127 | div &= S3C2443_CLKDIV0_EXTDIV_MASK; | ||
128 | div >>= (S3C2443_CLKDIV0_EXTDIV_SHIFT-1); /* x2 */ | ||
129 | |||
130 | return parent_rate / (div + 1); | ||
131 | } | ||
132 | |||
133 | static struct clk clk_mdivclk = { | ||
134 | .name = "mdivclk", | ||
135 | .parent = &clk_mpllref, | ||
136 | .id = -1, | ||
137 | .ops = &(struct clk_ops) { | ||
138 | .get_rate = s3c2443_getrate_mdivclk, | ||
139 | }, | ||
140 | }; | ||
141 | |||
142 | static struct clk *clk_msysclk_sources[] = { | ||
143 | [0] = &clk_mpllref, | ||
144 | [1] = &clk_mpll, | ||
145 | [2] = &clk_mdivclk, | ||
146 | [3] = &clk_mpllref, | ||
147 | }; | ||
148 | |||
149 | static struct clksrc_clk clk_msysclk = { | ||
150 | .clk = { | ||
151 | .name = "msysclk", | ||
152 | .parent = &clk_xtal, | ||
153 | .id = -1, | ||
154 | }, | ||
155 | .sources = &(struct clksrc_sources) { | ||
156 | .sources = clk_msysclk_sources, | ||
157 | .nr_sources = ARRAY_SIZE(clk_msysclk_sources), | ||
158 | }, | ||
159 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 3 }, | ||
160 | }; | ||
161 | |||
162 | /* armdiv | 65 | /* armdiv |
163 | * | 66 | * |
164 | * this clock is sourced from msysclk and can have a number of | 67 | * this clock is sourced from msysclk and can have a number of |
@@ -266,44 +169,6 @@ static struct clksrc_clk clk_arm = { | |||
266 | .reg_src = { .reg = S3C2443_CLKDIV0, .size = 1, .shift = 13 }, | 169 | .reg_src = { .reg = S3C2443_CLKDIV0, .size = 1, .shift = 13 }, |
267 | }; | 170 | }; |
268 | 171 | ||
269 | /* esysclk | ||
270 | * | ||
271 | * this is sourced from either the EPLL or the EPLLref clock | ||
272 | */ | ||
273 | |||
274 | static struct clk *clk_sysclk_sources[] = { | ||
275 | [0] = &clk_epllref.clk, | ||
276 | [1] = &clk_epll, | ||
277 | }; | ||
278 | |||
279 | static struct clksrc_clk clk_esysclk = { | ||
280 | .clk = { | ||
281 | .name = "esysclk", | ||
282 | .parent = &clk_epll, | ||
283 | .id = -1, | ||
284 | }, | ||
285 | .sources = &(struct clksrc_sources) { | ||
286 | .sources = clk_sysclk_sources, | ||
287 | .nr_sources = ARRAY_SIZE(clk_sysclk_sources), | ||
288 | }, | ||
289 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 6 }, | ||
290 | }; | ||
291 | |||
292 | /* uartclk | ||
293 | * | ||
294 | * UART baud-rate clock sourced from esysclk via a divisor | ||
295 | */ | ||
296 | |||
297 | static struct clksrc_clk clk_uart = { | ||
298 | .clk = { | ||
299 | .name = "uartclk", | ||
300 | .id = -1, | ||
301 | .parent = &clk_esysclk.clk, | ||
302 | }, | ||
303 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 }, | ||
304 | }; | ||
305 | |||
306 | |||
307 | /* hsspi | 172 | /* hsspi |
308 | * | 173 | * |
309 | * high-speed spi clock, sourced from esysclk | 174 | * high-speed spi clock, sourced from esysclk |
@@ -320,21 +185,6 @@ static struct clksrc_clk clk_hsspi = { | |||
320 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 4 }, | 185 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 4 }, |
321 | }; | 186 | }; |
322 | 187 | ||
323 | /* usbhost | ||
324 | * | ||
325 | * usb host bus-clock, usually 48MHz to provide USB bus clock timing | ||
326 | */ | ||
327 | |||
328 | static struct clksrc_clk clk_usb_bus_host = { | ||
329 | .clk = { | ||
330 | .name = "usb-bus-host-parent", | ||
331 | .id = -1, | ||
332 | .parent = &clk_esysclk.clk, | ||
333 | .ctrlbit = S3C2443_SCLKCON_USBHOST, | ||
334 | .enable = s3c2443_clkcon_enable_s, | ||
335 | }, | ||
336 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 4 }, | ||
337 | }; | ||
338 | 188 | ||
339 | /* clk_hsmcc_div | 189 | /* clk_hsmcc_div |
340 | * | 190 | * |
@@ -433,89 +283,16 @@ static struct clksrc_clk clk_i2s = { | |||
433 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 14 }, | 283 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 14 }, |
434 | }; | 284 | }; |
435 | 285 | ||
436 | /* cam-if | ||
437 | * | ||
438 | * camera interface bus-clock, divided down from esysclk | ||
439 | */ | ||
440 | |||
441 | static struct clksrc_clk clk_cam = { | ||
442 | .clk = { | ||
443 | .name = "camif-upll", /* same as 2440 name */ | ||
444 | .id = -1, | ||
445 | .parent = &clk_esysclk.clk, | ||
446 | .ctrlbit = S3C2443_SCLKCON_CAMCLK, | ||
447 | .enable = s3c2443_clkcon_enable_s, | ||
448 | }, | ||
449 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 26 }, | ||
450 | }; | ||
451 | |||
452 | /* display-if | ||
453 | * | ||
454 | * display interface clock, divided from esysclk | ||
455 | */ | ||
456 | |||
457 | static struct clksrc_clk clk_display = { | ||
458 | .clk = { | ||
459 | .name = "display-if", | ||
460 | .id = -1, | ||
461 | .parent = &clk_esysclk.clk, | ||
462 | .ctrlbit = S3C2443_SCLKCON_DISPCLK, | ||
463 | .enable = s3c2443_clkcon_enable_s, | ||
464 | }, | ||
465 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 8, .shift = 16 }, | ||
466 | }; | ||
467 | |||
468 | /* prediv | ||
469 | * | ||
470 | * this divides the msysclk down to pass to h/p/etc. | ||
471 | */ | ||
472 | |||
473 | static unsigned long s3c2443_prediv_getrate(struct clk *clk) | ||
474 | { | ||
475 | unsigned long rate = clk_get_rate(clk->parent); | ||
476 | unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0); | ||
477 | |||
478 | clkdiv0 &= S3C2443_CLKDIV0_PREDIV_MASK; | ||
479 | clkdiv0 >>= S3C2443_CLKDIV0_PREDIV_SHIFT; | ||
480 | |||
481 | return rate / (clkdiv0 + 1); | ||
482 | } | ||
483 | |||
484 | static struct clk clk_prediv = { | ||
485 | .name = "prediv", | ||
486 | .id = -1, | ||
487 | .parent = &clk_msysclk.clk, | ||
488 | .ops = &(struct clk_ops) { | ||
489 | .get_rate = s3c2443_prediv_getrate, | ||
490 | }, | ||
491 | }; | ||
492 | |||
493 | /* standard clock definitions */ | 286 | /* standard clock definitions */ |
494 | 287 | ||
495 | static struct clk init_clocks_disable[] = { | 288 | static struct clk init_clocks_off[] = { |
496 | { | 289 | { |
497 | .name = "nand", | ||
498 | .id = -1, | ||
499 | .parent = &clk_h, | ||
500 | }, { | ||
501 | .name = "sdi", | 290 | .name = "sdi", |
502 | .id = -1, | 291 | .id = -1, |
503 | .parent = &clk_p, | 292 | .parent = &clk_p, |
504 | .enable = s3c2443_clkcon_enable_p, | 293 | .enable = s3c2443_clkcon_enable_p, |
505 | .ctrlbit = S3C2443_PCLKCON_SDI, | 294 | .ctrlbit = S3C2443_PCLKCON_SDI, |
506 | }, { | 295 | }, { |
507 | .name = "adc", | ||
508 | .id = -1, | ||
509 | .parent = &clk_p, | ||
510 | .enable = s3c2443_clkcon_enable_p, | ||
511 | .ctrlbit = S3C2443_PCLKCON_ADC, | ||
512 | }, { | ||
513 | .name = "i2c", | ||
514 | .id = -1, | ||
515 | .parent = &clk_p, | ||
516 | .enable = s3c2443_clkcon_enable_p, | ||
517 | .ctrlbit = S3C2443_PCLKCON_IIC, | ||
518 | }, { | ||
519 | .name = "iis", | 296 | .name = "iis", |
520 | .id = -1, | 297 | .id = -1, |
521 | .parent = &clk_p, | 298 | .parent = &clk_p, |
@@ -537,179 +314,12 @@ static struct clk init_clocks_disable[] = { | |||
537 | }; | 314 | }; |
538 | 315 | ||
539 | static struct clk init_clocks[] = { | 316 | static struct clk init_clocks[] = { |
540 | { | ||
541 | .name = "dma", | ||
542 | .id = 0, | ||
543 | .parent = &clk_h, | ||
544 | .enable = s3c2443_clkcon_enable_h, | ||
545 | .ctrlbit = S3C2443_HCLKCON_DMA0, | ||
546 | }, { | ||
547 | .name = "dma", | ||
548 | .id = 1, | ||
549 | .parent = &clk_h, | ||
550 | .enable = s3c2443_clkcon_enable_h, | ||
551 | .ctrlbit = S3C2443_HCLKCON_DMA1, | ||
552 | }, { | ||
553 | .name = "dma", | ||
554 | .id = 2, | ||
555 | .parent = &clk_h, | ||
556 | .enable = s3c2443_clkcon_enable_h, | ||
557 | .ctrlbit = S3C2443_HCLKCON_DMA2, | ||
558 | }, { | ||
559 | .name = "dma", | ||
560 | .id = 3, | ||
561 | .parent = &clk_h, | ||
562 | .enable = s3c2443_clkcon_enable_h, | ||
563 | .ctrlbit = S3C2443_HCLKCON_DMA3, | ||
564 | }, { | ||
565 | .name = "dma", | ||
566 | .id = 4, | ||
567 | .parent = &clk_h, | ||
568 | .enable = s3c2443_clkcon_enable_h, | ||
569 | .ctrlbit = S3C2443_HCLKCON_DMA4, | ||
570 | }, { | ||
571 | .name = "dma", | ||
572 | .id = 5, | ||
573 | .parent = &clk_h, | ||
574 | .enable = s3c2443_clkcon_enable_h, | ||
575 | .ctrlbit = S3C2443_HCLKCON_DMA5, | ||
576 | }, { | ||
577 | .name = "lcd", | ||
578 | .id = -1, | ||
579 | .parent = &clk_h, | ||
580 | .enable = s3c2443_clkcon_enable_h, | ||
581 | .ctrlbit = S3C2443_HCLKCON_LCDC, | ||
582 | }, { | ||
583 | .name = "gpio", | ||
584 | .id = -1, | ||
585 | .parent = &clk_p, | ||
586 | .enable = s3c2443_clkcon_enable_p, | ||
587 | .ctrlbit = S3C2443_PCLKCON_GPIO, | ||
588 | }, { | ||
589 | .name = "usb-host", | ||
590 | .id = -1, | ||
591 | .parent = &clk_h, | ||
592 | .enable = s3c2443_clkcon_enable_h, | ||
593 | .ctrlbit = S3C2443_HCLKCON_USBH, | ||
594 | }, { | ||
595 | .name = "usb-device", | ||
596 | .id = -1, | ||
597 | .parent = &clk_h, | ||
598 | .enable = s3c2443_clkcon_enable_h, | ||
599 | .ctrlbit = S3C2443_HCLKCON_USBD, | ||
600 | }, { | ||
601 | .name = "hsmmc", | ||
602 | .id = -1, | ||
603 | .parent = &clk_h, | ||
604 | .enable = s3c2443_clkcon_enable_h, | ||
605 | .ctrlbit = S3C2443_HCLKCON_HSMMC, | ||
606 | }, { | ||
607 | .name = "cfc", | ||
608 | .id = -1, | ||
609 | .parent = &clk_h, | ||
610 | .enable = s3c2443_clkcon_enable_h, | ||
611 | .ctrlbit = S3C2443_HCLKCON_CFC, | ||
612 | }, { | ||
613 | .name = "ssmc", | ||
614 | .id = -1, | ||
615 | .parent = &clk_h, | ||
616 | .enable = s3c2443_clkcon_enable_h, | ||
617 | .ctrlbit = S3C2443_HCLKCON_SSMC, | ||
618 | }, { | ||
619 | .name = "timers", | ||
620 | .id = -1, | ||
621 | .parent = &clk_p, | ||
622 | .enable = s3c2443_clkcon_enable_p, | ||
623 | .ctrlbit = S3C2443_PCLKCON_PWMT, | ||
624 | }, { | ||
625 | .name = "uart", | ||
626 | .id = 0, | ||
627 | .parent = &clk_p, | ||
628 | .enable = s3c2443_clkcon_enable_p, | ||
629 | .ctrlbit = S3C2443_PCLKCON_UART0, | ||
630 | }, { | ||
631 | .name = "uart", | ||
632 | .id = 1, | ||
633 | .parent = &clk_p, | ||
634 | .enable = s3c2443_clkcon_enable_p, | ||
635 | .ctrlbit = S3C2443_PCLKCON_UART1, | ||
636 | }, { | ||
637 | .name = "uart", | ||
638 | .id = 2, | ||
639 | .parent = &clk_p, | ||
640 | .enable = s3c2443_clkcon_enable_p, | ||
641 | .ctrlbit = S3C2443_PCLKCON_UART2, | ||
642 | }, { | ||
643 | .name = "uart", | ||
644 | .id = 3, | ||
645 | .parent = &clk_p, | ||
646 | .enable = s3c2443_clkcon_enable_p, | ||
647 | .ctrlbit = S3C2443_PCLKCON_UART3, | ||
648 | }, { | ||
649 | .name = "rtc", | ||
650 | .id = -1, | ||
651 | .parent = &clk_p, | ||
652 | .enable = s3c2443_clkcon_enable_p, | ||
653 | .ctrlbit = S3C2443_PCLKCON_RTC, | ||
654 | }, { | ||
655 | .name = "watchdog", | ||
656 | .id = -1, | ||
657 | .parent = &clk_p, | ||
658 | .ctrlbit = S3C2443_PCLKCON_WDT, | ||
659 | }, { | ||
660 | .name = "usb-bus-host", | ||
661 | .id = -1, | ||
662 | .parent = &clk_usb_bus_host.clk, | ||
663 | }, { | ||
664 | .name = "ac97", | ||
665 | .id = -1, | ||
666 | .parent = &clk_p, | ||
667 | .ctrlbit = S3C2443_PCLKCON_AC97, | ||
668 | } | ||
669 | }; | ||
670 | |||
671 | /* clocks to add where we need to check their parentage */ | ||
672 | |||
673 | static struct clksrc_clk __initdata *init_list[] = { | ||
674 | &clk_epllref, /* should be first */ | ||
675 | &clk_esysclk, | ||
676 | &clk_msysclk, | ||
677 | &clk_arm, | ||
678 | &clk_i2s_eplldiv, | ||
679 | &clk_i2s, | ||
680 | &clk_cam, | ||
681 | &clk_uart, | ||
682 | &clk_display, | ||
683 | &clk_hsmmc_div, | ||
684 | &clk_usb_bus_host, | ||
685 | }; | 317 | }; |
686 | 318 | ||
687 | static void __init s3c2443_clk_initparents(void) | ||
688 | { | ||
689 | int ptr; | ||
690 | |||
691 | for (ptr = 0; ptr < ARRAY_SIZE(init_list); ptr++) | ||
692 | s3c_set_clksrc(init_list[ptr], true); | ||
693 | } | ||
694 | |||
695 | static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0) | ||
696 | { | ||
697 | clkcon0 &= S3C2443_CLKDIV0_HCLKDIV_MASK; | ||
698 | |||
699 | return clkcon0 + 1; | ||
700 | } | ||
701 | |||
702 | /* clocks to add straight away */ | 319 | /* clocks to add straight away */ |
703 | 320 | ||
704 | static struct clksrc_clk *clksrcs[] __initdata = { | 321 | static struct clksrc_clk *clksrcs[] __initdata = { |
705 | &clk_usb_bus_host, | ||
706 | &clk_epllref, | ||
707 | &clk_esysclk, | ||
708 | &clk_msysclk, | ||
709 | &clk_arm, | 322 | &clk_arm, |
710 | &clk_uart, | ||
711 | &clk_display, | ||
712 | &clk_cam, | ||
713 | &clk_i2s_eplldiv, | 323 | &clk_i2s_eplldiv, |
714 | &clk_i2s, | 324 | &clk_i2s, |
715 | &clk_hsspi, | 325 | &clk_hsspi, |
@@ -717,92 +327,32 @@ static struct clksrc_clk *clksrcs[] __initdata = { | |||
717 | }; | 327 | }; |
718 | 328 | ||
719 | static struct clk *clks[] __initdata = { | 329 | static struct clk *clks[] __initdata = { |
720 | &clk_ext, | ||
721 | &clk_epll, | ||
722 | &clk_usb_bus, | ||
723 | &clk_mpllref, | ||
724 | &clk_hsmmc, | 330 | &clk_hsmmc, |
725 | &clk_armdiv, | 331 | &clk_armdiv, |
726 | &clk_prediv, | ||
727 | }; | 332 | }; |
728 | 333 | ||
729 | void __init_or_cpufreq s3c2443_setup_clocks(void) | 334 | void __init_or_cpufreq s3c2443_setup_clocks(void) |
730 | { | 335 | { |
731 | unsigned long mpllcon = __raw_readl(S3C2443_MPLLCON); | 336 | s3c2443_common_setup_clocks(s3c2443_get_mpll, s3c2443_fclk_div); |
732 | unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0); | ||
733 | struct clk *xtal_clk; | ||
734 | unsigned long xtal; | ||
735 | unsigned long pll; | ||
736 | unsigned long fclk; | ||
737 | unsigned long hclk; | ||
738 | unsigned long pclk; | ||
739 | |||
740 | xtal_clk = clk_get(NULL, "xtal"); | ||
741 | xtal = clk_get_rate(xtal_clk); | ||
742 | clk_put(xtal_clk); | ||
743 | |||
744 | pll = s3c2443_get_mpll(mpllcon, xtal); | ||
745 | clk_msysclk.clk.rate = pll; | ||
746 | |||
747 | fclk = pll / s3c2443_fclk_div(clkdiv0); | ||
748 | hclk = s3c2443_prediv_getrate(&clk_prediv); | ||
749 | hclk /= s3c2443_get_hdiv(clkdiv0); | ||
750 | pclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 2 : 1); | ||
751 | |||
752 | s3c24xx_setup_clocks(fclk, hclk, pclk); | ||
753 | |||
754 | printk("S3C2443: mpll %s %ld.%03ld MHz, cpu %ld.%03ld MHz, mem %ld.%03ld MHz, pclk %ld.%03ld MHz\n", | ||
755 | (mpllcon & S3C2443_PLLCON_OFF) ? "off":"on", | ||
756 | print_mhz(pll), print_mhz(fclk), | ||
757 | print_mhz(hclk), print_mhz(pclk)); | ||
758 | |||
759 | s3c24xx_setup_clocks(fclk, hclk, pclk); | ||
760 | } | 337 | } |
761 | 338 | ||
762 | void __init s3c2443_init_clocks(int xtal) | 339 | void __init s3c2443_init_clocks(int xtal) |
763 | { | 340 | { |
764 | struct clk *clkp; | ||
765 | unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); | 341 | unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); |
766 | int ret; | ||
767 | int ptr; | 342 | int ptr; |
768 | 343 | ||
769 | /* s3c2443 parents h and p clocks from prediv */ | 344 | clk_epll.rate = s3c2443_get_epll(epllcon, xtal); |
770 | clk_h.parent = &clk_prediv; | 345 | clk_epll.parent = &clk_epllref.clk; |
771 | clk_p.parent = &clk_prediv; | 346 | |
347 | s3c2443_common_init_clocks(xtal, s3c2443_get_mpll, s3c2443_fclk_div); | ||
772 | 348 | ||
773 | s3c24xx_register_baseclocks(xtal); | ||
774 | s3c2443_setup_clocks(); | 349 | s3c2443_setup_clocks(); |
775 | s3c2443_clk_initparents(); | ||
776 | |||
777 | for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) { | ||
778 | clkp = clks[ptr]; | ||
779 | 350 | ||
780 | ret = s3c24xx_register_clock(clkp); | 351 | s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); |
781 | if (ret < 0) { | ||
782 | printk(KERN_ERR "Failed to register clock %s (%d)\n", | ||
783 | clkp->name, ret); | ||
784 | } | ||
785 | } | ||
786 | 352 | ||
787 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) | 353 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) |
788 | s3c_register_clksrc(clksrcs[ptr], 1); | 354 | s3c_register_clksrc(clksrcs[ptr], 1); |
789 | 355 | ||
790 | clk_epll.rate = s3c2443_get_epll(epllcon, xtal); | ||
791 | clk_epll.parent = &clk_epllref.clk; | ||
792 | clk_usb_bus.parent = &clk_usb_bus_host.clk; | ||
793 | |||
794 | /* ensure usb bus clock is within correct rate of 48MHz */ | ||
795 | |||
796 | if (clk_get_rate(&clk_usb_bus_host.clk) != (48 * 1000 * 1000)) { | ||
797 | printk(KERN_INFO "Warning: USB host bus not at 48MHz\n"); | ||
798 | clk_set_rate(&clk_usb_bus_host.clk, 48*1000*1000); | ||
799 | } | ||
800 | |||
801 | printk("S3C2443: epll %s %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n", | ||
802 | (epllcon & S3C2443_PLLCON_OFF) ? "off":"on", | ||
803 | print_mhz(clk_get_rate(&clk_epll)), | ||
804 | print_mhz(clk_get_rate(&clk_usb_bus))); | ||
805 | |||
806 | /* register clocks from clock array */ | 356 | /* register clocks from clock array */ |
807 | 357 | ||
808 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 358 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
@@ -819,17 +369,8 @@ void __init s3c2443_init_clocks(int xtal) | |||
819 | 369 | ||
820 | /* install (and disable) the clocks we do not need immediately */ | 370 | /* install (and disable) the clocks we do not need immediately */ |
821 | 371 | ||
822 | clkp = init_clocks_disable; | 372 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
823 | for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { | 373 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
824 | |||
825 | ret = s3c24xx_register_clock(clkp); | ||
826 | if (ret < 0) { | ||
827 | printk(KERN_ERR "Failed to register clock %s (%d)\n", | ||
828 | clkp->name, ret); | ||
829 | } | ||
830 | |||
831 | (clkp->enable)(clkp, 0); | ||
832 | } | ||
833 | 374 | ||
834 | s3c_pwmclk_init(); | 375 | s3c_pwmclk_init(); |
835 | } | 376 | } |
diff --git a/arch/arm/mach-s3c64xx/gpiolib.c b/arch/arm/mach-s3c64xx/gpiolib.c index 66e6794481d2..60c929a3cab6 100644 --- a/arch/arm/mach-s3c64xx/gpiolib.c +++ b/arch/arm/mach-s3c64xx/gpiolib.c | |||
@@ -51,6 +51,7 @@ | |||
51 | 51 | ||
52 | static struct s3c_gpio_cfg gpio_4bit_cfg_noint = { | 52 | static struct s3c_gpio_cfg gpio_4bit_cfg_noint = { |
53 | .set_config = s3c_gpio_setcfg_s3c64xx_4bit, | 53 | .set_config = s3c_gpio_setcfg_s3c64xx_4bit, |
54 | .get_config = s3c_gpio_getcfg_s3c64xx_4bit, | ||
54 | .set_pull = s3c_gpio_setpull_updown, | 55 | .set_pull = s3c_gpio_setpull_updown, |
55 | .get_pull = s3c_gpio_getpull_updown, | 56 | .get_pull = s3c_gpio_getpull_updown, |
56 | }; | 57 | }; |
@@ -58,12 +59,14 @@ static struct s3c_gpio_cfg gpio_4bit_cfg_noint = { | |||
58 | static struct s3c_gpio_cfg gpio_4bit_cfg_eint0111 = { | 59 | static struct s3c_gpio_cfg gpio_4bit_cfg_eint0111 = { |
59 | .cfg_eint = 7, | 60 | .cfg_eint = 7, |
60 | .set_config = s3c_gpio_setcfg_s3c64xx_4bit, | 61 | .set_config = s3c_gpio_setcfg_s3c64xx_4bit, |
62 | .get_config = s3c_gpio_getcfg_s3c64xx_4bit, | ||
61 | .set_pull = s3c_gpio_setpull_updown, | 63 | .set_pull = s3c_gpio_setpull_updown, |
62 | .get_pull = s3c_gpio_getpull_updown, | 64 | .get_pull = s3c_gpio_getpull_updown, |
63 | }; | 65 | }; |
64 | 66 | ||
65 | static struct s3c_gpio_cfg gpio_4bit_cfg_eint0011 = { | 67 | static struct s3c_gpio_cfg gpio_4bit_cfg_eint0011 = { |
66 | .cfg_eint = 3, | 68 | .cfg_eint = 3, |
69 | .get_config = s3c_gpio_getcfg_s3c64xx_4bit, | ||
67 | .set_config = s3c_gpio_setcfg_s3c64xx_4bit, | 70 | .set_config = s3c_gpio_setcfg_s3c64xx_4bit, |
68 | .set_pull = s3c_gpio_setpull_updown, | 71 | .set_pull = s3c_gpio_setpull_updown, |
69 | .get_pull = s3c_gpio_getpull_updown, | 72 | .get_pull = s3c_gpio_getpull_updown, |
@@ -171,6 +174,7 @@ static struct s3c_gpio_chip gpio_4bit2[] = { | |||
171 | 174 | ||
172 | static struct s3c_gpio_cfg gpio_2bit_cfg_noint = { | 175 | static struct s3c_gpio_cfg gpio_2bit_cfg_noint = { |
173 | .set_config = s3c_gpio_setcfg_s3c24xx, | 176 | .set_config = s3c_gpio_setcfg_s3c24xx, |
177 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
174 | .set_pull = s3c_gpio_setpull_updown, | 178 | .set_pull = s3c_gpio_setpull_updown, |
175 | .get_pull = s3c_gpio_getpull_updown, | 179 | .get_pull = s3c_gpio_getpull_updown, |
176 | }; | 180 | }; |
@@ -178,6 +182,7 @@ static struct s3c_gpio_cfg gpio_2bit_cfg_noint = { | |||
178 | static struct s3c_gpio_cfg gpio_2bit_cfg_eint10 = { | 182 | static struct s3c_gpio_cfg gpio_2bit_cfg_eint10 = { |
179 | .cfg_eint = 2, | 183 | .cfg_eint = 2, |
180 | .set_config = s3c_gpio_setcfg_s3c24xx, | 184 | .set_config = s3c_gpio_setcfg_s3c24xx, |
185 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
181 | .set_pull = s3c_gpio_setpull_updown, | 186 | .set_pull = s3c_gpio_setpull_updown, |
182 | .get_pull = s3c_gpio_getpull_updown, | 187 | .get_pull = s3c_gpio_getpull_updown, |
183 | }; | 188 | }; |
@@ -185,6 +190,7 @@ static struct s3c_gpio_cfg gpio_2bit_cfg_eint10 = { | |||
185 | static struct s3c_gpio_cfg gpio_2bit_cfg_eint11 = { | 190 | static struct s3c_gpio_cfg gpio_2bit_cfg_eint11 = { |
186 | .cfg_eint = 3, | 191 | .cfg_eint = 3, |
187 | .set_config = s3c_gpio_setcfg_s3c24xx, | 192 | .set_config = s3c_gpio_setcfg_s3c24xx, |
193 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
188 | .set_pull = s3c_gpio_setpull_updown, | 194 | .set_pull = s3c_gpio_setpull_updown, |
189 | .get_pull = s3c_gpio_getpull_updown, | 195 | .get_pull = s3c_gpio_getpull_updown, |
190 | }; | 196 | }; |
diff --git a/arch/arm/mach-s3c64xx/include/mach/pll.h b/arch/arm/mach-s3c64xx/include/mach/pll.h index 90bbd72fdc4e..5ef0bb698ee0 100644 --- a/arch/arm/mach-s3c64xx/include/mach/pll.h +++ b/arch/arm/mach-s3c64xx/include/mach/pll.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define S3C6400_PLL_SDIV_SHIFT (0) | 20 | #define S3C6400_PLL_SDIV_SHIFT (0) |
21 | 21 | ||
22 | #include <asm/div64.h> | 22 | #include <asm/div64.h> |
23 | #include <plat/pll6553x.h> | ||
23 | 24 | ||
24 | static inline unsigned long s3c6400_get_pll(unsigned long baseclk, | 25 | static inline unsigned long s3c6400_get_pll(unsigned long baseclk, |
25 | u32 pllcon) | 26 | u32 pllcon) |
@@ -37,38 +38,8 @@ static inline unsigned long s3c6400_get_pll(unsigned long baseclk, | |||
37 | return (unsigned long)fvco; | 38 | return (unsigned long)fvco; |
38 | } | 39 | } |
39 | 40 | ||
40 | #define S3C6400_EPLL_MDIV_MASK ((1 << (23-16)) - 1) | ||
41 | #define S3C6400_EPLL_PDIV_MASK ((1 << (13-8)) - 1) | ||
42 | #define S3C6400_EPLL_SDIV_MASK ((1 << (2-0)) - 1) | ||
43 | #define S3C6400_EPLL_MDIV_SHIFT (16) | ||
44 | #define S3C6400_EPLL_PDIV_SHIFT (8) | ||
45 | #define S3C6400_EPLL_SDIV_SHIFT (0) | ||
46 | #define S3C6400_EPLL_KDIV_MASK (0xffff) | ||
47 | |||
48 | static inline unsigned long s3c6400_get_epll(unsigned long baseclk) | 41 | static inline unsigned long s3c6400_get_epll(unsigned long baseclk) |
49 | { | 42 | { |
50 | unsigned long result; | 43 | return s3c_get_pll6553x(baseclk, __raw_readl(S3C_EPLL_CON0), |
51 | u32 epll0 = __raw_readl(S3C_EPLL_CON0); | 44 | __raw_readl(S3C_EPLL_CON1)); |
52 | u32 epll1 = __raw_readl(S3C_EPLL_CON1); | ||
53 | u32 mdiv, pdiv, sdiv, kdiv; | ||
54 | u64 tmp; | ||
55 | |||
56 | mdiv = (epll0 >> S3C6400_EPLL_MDIV_SHIFT) & S3C6400_EPLL_MDIV_MASK; | ||
57 | pdiv = (epll0 >> S3C6400_EPLL_PDIV_SHIFT) & S3C6400_EPLL_PDIV_MASK; | ||
58 | sdiv = (epll0 >> S3C6400_EPLL_SDIV_SHIFT) & S3C6400_EPLL_SDIV_MASK; | ||
59 | kdiv = epll1 & S3C6400_EPLL_KDIV_MASK; | ||
60 | |||
61 | /* We need to multiple baseclk by mdiv (the integer part) and kdiv | ||
62 | * which is in 2^16ths, so shift mdiv up (does not overflow) and | ||
63 | * add kdiv before multiplying. The use of tmp is to avoid any | ||
64 | * overflows before shifting bac down into result when multipling | ||
65 | * by the mdiv and kdiv pair. | ||
66 | */ | ||
67 | |||
68 | tmp = baseclk; | ||
69 | tmp *= (mdiv << 16) + kdiv; | ||
70 | do_div(tmp, (pdiv << sdiv)); | ||
71 | result = tmp >> 16; | ||
72 | |||
73 | return result; | ||
74 | } | 45 | } |
diff --git a/arch/arm/mach-s5p6440/gpio.c b/arch/arm/mach-s5p6440/gpio.c index b0ea741177ad..262dc75d5bea 100644 --- a/arch/arm/mach-s5p6440/gpio.c +++ b/arch/arm/mach-s5p6440/gpio.c | |||
@@ -161,12 +161,15 @@ static struct s3c_gpio_cfg s5p6440_gpio_cfgs[] = { | |||
161 | }, { | 161 | }, { |
162 | .cfg_eint = 0, | 162 | .cfg_eint = 0, |
163 | .set_config = s3c_gpio_setcfg_s3c24xx, | 163 | .set_config = s3c_gpio_setcfg_s3c24xx, |
164 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
164 | }, { | 165 | }, { |
165 | .cfg_eint = 2, | 166 | .cfg_eint = 2, |
166 | .set_config = s3c_gpio_setcfg_s3c24xx, | 167 | .set_config = s3c_gpio_setcfg_s3c24xx, |
168 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
167 | }, { | 169 | }, { |
168 | .cfg_eint = 3, | 170 | .cfg_eint = 3, |
169 | .set_config = s3c_gpio_setcfg_s3c24xx, | 171 | .set_config = s3c_gpio_setcfg_s3c24xx, |
172 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
170 | }, | 173 | }, |
171 | }; | 174 | }; |
172 | 175 | ||
@@ -279,6 +282,8 @@ void __init s5p6440_gpiolib_set_cfg(struct s3c_gpio_cfg *chipcfg, int nr_chips) | |||
279 | for (; nr_chips > 0; nr_chips--, chipcfg++) { | 282 | for (; nr_chips > 0; nr_chips--, chipcfg++) { |
280 | if (!chipcfg->set_config) | 283 | if (!chipcfg->set_config) |
281 | chipcfg->set_config = s3c_gpio_setcfg_s3c64xx_4bit; | 284 | chipcfg->set_config = s3c_gpio_setcfg_s3c64xx_4bit; |
285 | if (!chipcfg->get_config) | ||
286 | chipcfg->get_config = s3c_gpio_getcfg_s3c64xx_4bit; | ||
282 | if (!chipcfg->set_pull) | 287 | if (!chipcfg->set_pull) |
283 | chipcfg->set_pull = s3c_gpio_setpull_updown; | 288 | chipcfg->set_pull = s3c_gpio_setpull_updown; |
284 | if (!chipcfg->get_pull) | 289 | if (!chipcfg->get_pull) |
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index aeceb9b92aeb..f2b88c5fe142 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -7,7 +7,6 @@ config ARCH_SH7367 | |||
7 | select CPU_V6 | 7 | select CPU_V6 |
8 | select HAVE_CLK | 8 | select HAVE_CLK |
9 | select COMMON_CLKDEV | 9 | select COMMON_CLKDEV |
10 | select GENERIC_TIME | ||
11 | select GENERIC_CLOCKEVENTS | 10 | select GENERIC_CLOCKEVENTS |
12 | 11 | ||
13 | config ARCH_SH7377 | 12 | config ARCH_SH7377 |
@@ -15,7 +14,6 @@ config ARCH_SH7377 | |||
15 | select CPU_V7 | 14 | select CPU_V7 |
16 | select HAVE_CLK | 15 | select HAVE_CLK |
17 | select COMMON_CLKDEV | 16 | select COMMON_CLKDEV |
18 | select GENERIC_TIME | ||
19 | select GENERIC_CLOCKEVENTS | 17 | select GENERIC_CLOCKEVENTS |
20 | 18 | ||
21 | config ARCH_SH7372 | 19 | config ARCH_SH7372 |
@@ -23,7 +21,6 @@ config ARCH_SH7372 | |||
23 | select CPU_V7 | 21 | select CPU_V7 |
24 | select HAVE_CLK | 22 | select HAVE_CLK |
25 | select COMMON_CLKDEV | 23 | select COMMON_CLKDEV |
26 | select GENERIC_TIME | ||
27 | select GENERIC_CLOCKEVENTS | 24 | select GENERIC_CLOCKEVENTS |
28 | 25 | ||
29 | comment "SH-Mobile Board Type" | 26 | comment "SH-Mobile Board Type" |
diff --git a/arch/arm/mach-spear3xx/Kconfig b/arch/arm/mach-spear3xx/Kconfig new file mode 100644 index 000000000000..20d1317cc486 --- /dev/null +++ b/arch/arm/mach-spear3xx/Kconfig | |||
@@ -0,0 +1,33 @@ | |||
1 | # | ||
2 | # SPEAr3XX Machine configuration file | ||
3 | # | ||
4 | |||
5 | if ARCH_SPEAR3XX | ||
6 | |||
7 | choice | ||
8 | prompt "SPEAr3XX Family" | ||
9 | default MACH_SPEAR300 | ||
10 | |||
11 | config MACH_SPEAR300 | ||
12 | bool "SPEAr300" | ||
13 | help | ||
14 | Supports ST SPEAr300 Machine | ||
15 | |||
16 | config MACH_SPEAR310 | ||
17 | bool "SPEAr310" | ||
18 | help | ||
19 | Supports ST SPEAr310 Machine | ||
20 | |||
21 | config MACH_SPEAR320 | ||
22 | bool "SPEAr320" | ||
23 | help | ||
24 | Supports ST SPEAr320 Machine | ||
25 | |||
26 | endchoice | ||
27 | |||
28 | # Adding SPEAr3XX machine specific configuration files | ||
29 | source "arch/arm/mach-spear3xx/Kconfig300" | ||
30 | source "arch/arm/mach-spear3xx/Kconfig310" | ||
31 | source "arch/arm/mach-spear3xx/Kconfig320" | ||
32 | |||
33 | endif #ARCH_SPEAR3XX | ||
diff --git a/arch/arm/mach-spear3xx/Kconfig300 b/arch/arm/mach-spear3xx/Kconfig300 new file mode 100644 index 000000000000..c519a05b4ab4 --- /dev/null +++ b/arch/arm/mach-spear3xx/Kconfig300 | |||
@@ -0,0 +1,17 @@ | |||
1 | # | ||
2 | # SPEAr300 machine configuration file | ||
3 | # | ||
4 | |||
5 | if MACH_SPEAR300 | ||
6 | |||
7 | choice | ||
8 | prompt "SPEAr300 Boards" | ||
9 | default BOARD_SPEAR300_EVB | ||
10 | |||
11 | config BOARD_SPEAR300_EVB | ||
12 | bool "SPEAr300 Evaluation Board" | ||
13 | help | ||
14 | Supports ST SPEAr300 Evaluation Board | ||
15 | endchoice | ||
16 | |||
17 | endif #MACH_SPEAR300 | ||
diff --git a/arch/arm/mach-spear3xx/Kconfig310 b/arch/arm/mach-spear3xx/Kconfig310 new file mode 100644 index 000000000000..60e7442d75bd --- /dev/null +++ b/arch/arm/mach-spear3xx/Kconfig310 | |||
@@ -0,0 +1,17 @@ | |||
1 | # | ||
2 | # SPEAr310 machine configuration file | ||
3 | # | ||
4 | |||
5 | if MACH_SPEAR310 | ||
6 | |||
7 | choice | ||
8 | prompt "SPEAr310 Boards" | ||
9 | default BOARD_SPEAR310_EVB | ||
10 | |||
11 | config BOARD_SPEAR310_EVB | ||
12 | bool "SPEAr310 Evaluation Board" | ||
13 | help | ||
14 | Supports ST SPEAr310 Evaluation Board | ||
15 | endchoice | ||
16 | |||
17 | endif #MACH_SPEAR310 | ||
diff --git a/arch/arm/mach-spear3xx/Kconfig320 b/arch/arm/mach-spear3xx/Kconfig320 new file mode 100644 index 000000000000..1c1d438399b8 --- /dev/null +++ b/arch/arm/mach-spear3xx/Kconfig320 | |||
@@ -0,0 +1,17 @@ | |||
1 | # | ||
2 | # SPEAr320 machine configuration file | ||
3 | # | ||
4 | |||
5 | if MACH_SPEAR320 | ||
6 | |||
7 | choice | ||
8 | prompt "SPEAr320 Boards" | ||
9 | default BOARD_SPEAR320_EVB | ||
10 | |||
11 | config BOARD_SPEAR320_EVB | ||
12 | bool "SPEAr320 Evaluation Board" | ||
13 | help | ||
14 | Supports ST SPEAr320 Evaluation Board | ||
15 | endchoice | ||
16 | |||
17 | endif #MACH_SPEAR320 | ||
diff --git a/arch/arm/mach-spear3xx/Makefile b/arch/arm/mach-spear3xx/Makefile new file mode 100644 index 000000000000..b24862489704 --- /dev/null +++ b/arch/arm/mach-spear3xx/Makefile | |||
@@ -0,0 +1,26 @@ | |||
1 | # | ||
2 | # Makefile for SPEAr3XX machine series | ||
3 | # | ||
4 | |||
5 | # common files | ||
6 | obj-y += spear3xx.o clock.o | ||
7 | |||
8 | # spear300 specific files | ||
9 | obj-$(CONFIG_MACH_SPEAR300) += spear300.o | ||
10 | |||
11 | # spear300 boards files | ||
12 | obj-$(CONFIG_BOARD_SPEAR300_EVB) += spear300_evb.o | ||
13 | |||
14 | |||
15 | # spear310 specific files | ||
16 | obj-$(CONFIG_MACH_SPEAR310) += spear310.o | ||
17 | |||
18 | # spear310 boards files | ||
19 | obj-$(CONFIG_BOARD_SPEAR310_EVB) += spear310_evb.o | ||
20 | |||
21 | |||
22 | # spear320 specific files | ||
23 | obj-$(CONFIG_MACH_SPEAR320) += spear320.o | ||
24 | |||
25 | # spear320 boards files | ||
26 | obj-$(CONFIG_BOARD_SPEAR320_EVB) += spear320_evb.o | ||
diff --git a/arch/arm/mach-spear3xx/Makefile.boot b/arch/arm/mach-spear3xx/Makefile.boot new file mode 100644 index 000000000000..7a1f3c0eadb8 --- /dev/null +++ b/arch/arm/mach-spear3xx/Makefile.boot | |||
@@ -0,0 +1,3 @@ | |||
1 | zreladdr-y := 0x00008000 | ||
2 | params_phys-y := 0x00000100 | ||
3 | initrd_phys-y := 0x00800000 | ||
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c new file mode 100644 index 000000000000..39f6ccf22294 --- /dev/null +++ b/arch/arm/mach-spear3xx/clock.c | |||
@@ -0,0 +1,389 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/clock.c | ||
3 | * | ||
4 | * SPEAr3xx machines clock framework source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <mach/misc_regs.h> | ||
17 | #include <plat/clock.h> | ||
18 | |||
19 | /* root clks */ | ||
20 | /* 32 KHz oscillator clock */ | ||
21 | static struct clk osc_32k_clk = { | ||
22 | .flags = ALWAYS_ENABLED, | ||
23 | .rate = 32000, | ||
24 | }; | ||
25 | |||
26 | /* 24 MHz oscillator clock */ | ||
27 | static struct clk osc_24m_clk = { | ||
28 | .flags = ALWAYS_ENABLED, | ||
29 | .rate = 24000000, | ||
30 | }; | ||
31 | |||
32 | /* clock derived from 32 KHz osc clk */ | ||
33 | /* rtc clock */ | ||
34 | static struct clk rtc_clk = { | ||
35 | .pclk = &osc_32k_clk, | ||
36 | .en_reg = PERIP1_CLK_ENB, | ||
37 | .en_reg_bit = RTC_CLK_ENB, | ||
38 | .recalc = &follow_parent, | ||
39 | }; | ||
40 | |||
41 | /* clock derived from 24 MHz osc clk */ | ||
42 | /* pll1 configuration structure */ | ||
43 | static struct pll_clk_config pll1_config = { | ||
44 | .mode_reg = PLL1_CTR, | ||
45 | .cfg_reg = PLL1_FRQ, | ||
46 | }; | ||
47 | |||
48 | /* PLL1 clock */ | ||
49 | static struct clk pll1_clk = { | ||
50 | .pclk = &osc_24m_clk, | ||
51 | .en_reg = PLL1_CTR, | ||
52 | .en_reg_bit = PLL_ENABLE, | ||
53 | .recalc = &pll1_clk_recalc, | ||
54 | .private_data = &pll1_config, | ||
55 | }; | ||
56 | |||
57 | /* PLL3 48 MHz clock */ | ||
58 | static struct clk pll3_48m_clk = { | ||
59 | .flags = ALWAYS_ENABLED, | ||
60 | .pclk = &osc_24m_clk, | ||
61 | .rate = 48000000, | ||
62 | }; | ||
63 | |||
64 | /* watch dog timer clock */ | ||
65 | static struct clk wdt_clk = { | ||
66 | .flags = ALWAYS_ENABLED, | ||
67 | .pclk = &osc_24m_clk, | ||
68 | .recalc = &follow_parent, | ||
69 | }; | ||
70 | |||
71 | /* clock derived from pll1 clk */ | ||
72 | /* cpu clock */ | ||
73 | static struct clk cpu_clk = { | ||
74 | .flags = ALWAYS_ENABLED, | ||
75 | .pclk = &pll1_clk, | ||
76 | .recalc = &follow_parent, | ||
77 | }; | ||
78 | |||
79 | /* ahb configuration structure */ | ||
80 | static struct bus_clk_config ahb_config = { | ||
81 | .reg = CORE_CLK_CFG, | ||
82 | .mask = PLL_HCLK_RATIO_MASK, | ||
83 | .shift = PLL_HCLK_RATIO_SHIFT, | ||
84 | }; | ||
85 | |||
86 | /* ahb clock */ | ||
87 | static struct clk ahb_clk = { | ||
88 | .flags = ALWAYS_ENABLED, | ||
89 | .pclk = &pll1_clk, | ||
90 | .recalc = &bus_clk_recalc, | ||
91 | .private_data = &ahb_config, | ||
92 | }; | ||
93 | |||
94 | /* uart configurations */ | ||
95 | static struct aux_clk_config uart_config = { | ||
96 | .synth_reg = UART_CLK_SYNT, | ||
97 | }; | ||
98 | |||
99 | /* uart parents */ | ||
100 | static struct pclk_info uart_pclk_info[] = { | ||
101 | { | ||
102 | .pclk = &pll1_clk, | ||
103 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
104 | .scalable = 1, | ||
105 | }, { | ||
106 | .pclk = &pll3_48m_clk, | ||
107 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
108 | .scalable = 0, | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | /* uart parent select structure */ | ||
113 | static struct pclk_sel uart_pclk_sel = { | ||
114 | .pclk_info = uart_pclk_info, | ||
115 | .pclk_count = ARRAY_SIZE(uart_pclk_info), | ||
116 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
117 | .pclk_sel_mask = UART_CLK_MASK, | ||
118 | }; | ||
119 | |||
120 | /* uart clock */ | ||
121 | static struct clk uart_clk = { | ||
122 | .en_reg = PERIP1_CLK_ENB, | ||
123 | .en_reg_bit = UART_CLK_ENB, | ||
124 | .pclk_sel = &uart_pclk_sel, | ||
125 | .pclk_sel_shift = UART_CLK_SHIFT, | ||
126 | .recalc = &aux_clk_recalc, | ||
127 | .private_data = &uart_config, | ||
128 | }; | ||
129 | |||
130 | /* firda configurations */ | ||
131 | static struct aux_clk_config firda_config = { | ||
132 | .synth_reg = FIRDA_CLK_SYNT, | ||
133 | }; | ||
134 | |||
135 | /* firda parents */ | ||
136 | static struct pclk_info firda_pclk_info[] = { | ||
137 | { | ||
138 | .pclk = &pll1_clk, | ||
139 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
140 | .scalable = 1, | ||
141 | }, { | ||
142 | .pclk = &pll3_48m_clk, | ||
143 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
144 | .scalable = 0, | ||
145 | }, | ||
146 | }; | ||
147 | |||
148 | /* firda parent select structure */ | ||
149 | static struct pclk_sel firda_pclk_sel = { | ||
150 | .pclk_info = firda_pclk_info, | ||
151 | .pclk_count = ARRAY_SIZE(firda_pclk_info), | ||
152 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
153 | .pclk_sel_mask = FIRDA_CLK_MASK, | ||
154 | }; | ||
155 | |||
156 | /* firda clock */ | ||
157 | static struct clk firda_clk = { | ||
158 | .en_reg = PERIP1_CLK_ENB, | ||
159 | .en_reg_bit = FIRDA_CLK_ENB, | ||
160 | .pclk_sel = &firda_pclk_sel, | ||
161 | .pclk_sel_shift = FIRDA_CLK_SHIFT, | ||
162 | .recalc = &aux_clk_recalc, | ||
163 | .private_data = &firda_config, | ||
164 | }; | ||
165 | |||
166 | /* gpt parents */ | ||
167 | static struct pclk_info gpt_pclk_info[] = { | ||
168 | { | ||
169 | .pclk = &pll1_clk, | ||
170 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
171 | .scalable = 1, | ||
172 | }, { | ||
173 | .pclk = &pll3_48m_clk, | ||
174 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
175 | .scalable = 0, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | /* gpt parent select structure */ | ||
180 | static struct pclk_sel gpt_pclk_sel = { | ||
181 | .pclk_info = gpt_pclk_info, | ||
182 | .pclk_count = ARRAY_SIZE(gpt_pclk_info), | ||
183 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
184 | .pclk_sel_mask = GPT_CLK_MASK, | ||
185 | }; | ||
186 | |||
187 | /* gpt0 configurations */ | ||
188 | static struct aux_clk_config gpt0_config = { | ||
189 | .synth_reg = PRSC1_CLK_CFG, | ||
190 | }; | ||
191 | |||
192 | /* gpt0 timer clock */ | ||
193 | static struct clk gpt0_clk = { | ||
194 | .flags = ALWAYS_ENABLED, | ||
195 | .pclk_sel = &gpt_pclk_sel, | ||
196 | .pclk_sel_shift = GPT0_CLK_SHIFT, | ||
197 | .recalc = &gpt_clk_recalc, | ||
198 | .private_data = &gpt0_config, | ||
199 | }; | ||
200 | |||
201 | /* gpt1 configurations */ | ||
202 | static struct aux_clk_config gpt1_config = { | ||
203 | .synth_reg = PRSC2_CLK_CFG, | ||
204 | }; | ||
205 | |||
206 | /* gpt1 timer clock */ | ||
207 | static struct clk gpt1_clk = { | ||
208 | .en_reg = PERIP1_CLK_ENB, | ||
209 | .en_reg_bit = GPT1_CLK_ENB, | ||
210 | .pclk_sel = &gpt_pclk_sel, | ||
211 | .pclk_sel_shift = GPT1_CLK_SHIFT, | ||
212 | .recalc = &gpt_clk_recalc, | ||
213 | .private_data = &gpt1_config, | ||
214 | }; | ||
215 | |||
216 | /* gpt2 configurations */ | ||
217 | static struct aux_clk_config gpt2_config = { | ||
218 | .synth_reg = PRSC3_CLK_CFG, | ||
219 | }; | ||
220 | |||
221 | /* gpt2 timer clock */ | ||
222 | static struct clk gpt2_clk = { | ||
223 | .en_reg = PERIP1_CLK_ENB, | ||
224 | .en_reg_bit = GPT2_CLK_ENB, | ||
225 | .pclk_sel = &gpt_pclk_sel, | ||
226 | .pclk_sel_shift = GPT2_CLK_SHIFT, | ||
227 | .recalc = &gpt_clk_recalc, | ||
228 | .private_data = &gpt2_config, | ||
229 | }; | ||
230 | |||
231 | /* clock derived from pll3 clk */ | ||
232 | /* usbh clock */ | ||
233 | static struct clk usbh_clk = { | ||
234 | .pclk = &pll3_48m_clk, | ||
235 | .en_reg = PERIP1_CLK_ENB, | ||
236 | .en_reg_bit = USBH_CLK_ENB, | ||
237 | .recalc = &follow_parent, | ||
238 | }; | ||
239 | |||
240 | /* usbd clock */ | ||
241 | static struct clk usbd_clk = { | ||
242 | .pclk = &pll3_48m_clk, | ||
243 | .en_reg = PERIP1_CLK_ENB, | ||
244 | .en_reg_bit = USBD_CLK_ENB, | ||
245 | .recalc = &follow_parent, | ||
246 | }; | ||
247 | |||
248 | /* clcd clock */ | ||
249 | static struct clk clcd_clk = { | ||
250 | .flags = ALWAYS_ENABLED, | ||
251 | .pclk = &pll3_48m_clk, | ||
252 | .recalc = &follow_parent, | ||
253 | }; | ||
254 | |||
255 | /* clock derived from ahb clk */ | ||
256 | /* apb configuration structure */ | ||
257 | static struct bus_clk_config apb_config = { | ||
258 | .reg = CORE_CLK_CFG, | ||
259 | .mask = HCLK_PCLK_RATIO_MASK, | ||
260 | .shift = HCLK_PCLK_RATIO_SHIFT, | ||
261 | }; | ||
262 | |||
263 | /* apb clock */ | ||
264 | static struct clk apb_clk = { | ||
265 | .flags = ALWAYS_ENABLED, | ||
266 | .pclk = &ahb_clk, | ||
267 | .recalc = &bus_clk_recalc, | ||
268 | .private_data = &apb_config, | ||
269 | }; | ||
270 | |||
271 | /* i2c clock */ | ||
272 | static struct clk i2c_clk = { | ||
273 | .pclk = &ahb_clk, | ||
274 | .en_reg = PERIP1_CLK_ENB, | ||
275 | .en_reg_bit = I2C_CLK_ENB, | ||
276 | .recalc = &follow_parent, | ||
277 | }; | ||
278 | |||
279 | /* dma clock */ | ||
280 | static struct clk dma_clk = { | ||
281 | .pclk = &ahb_clk, | ||
282 | .en_reg = PERIP1_CLK_ENB, | ||
283 | .en_reg_bit = DMA_CLK_ENB, | ||
284 | .recalc = &follow_parent, | ||
285 | }; | ||
286 | |||
287 | /* jpeg clock */ | ||
288 | static struct clk jpeg_clk = { | ||
289 | .pclk = &ahb_clk, | ||
290 | .en_reg = PERIP1_CLK_ENB, | ||
291 | .en_reg_bit = JPEG_CLK_ENB, | ||
292 | .recalc = &follow_parent, | ||
293 | }; | ||
294 | |||
295 | /* gmac clock */ | ||
296 | static struct clk gmac_clk = { | ||
297 | .pclk = &ahb_clk, | ||
298 | .en_reg = PERIP1_CLK_ENB, | ||
299 | .en_reg_bit = GMAC_CLK_ENB, | ||
300 | .recalc = &follow_parent, | ||
301 | }; | ||
302 | |||
303 | /* smi clock */ | ||
304 | static struct clk smi_clk = { | ||
305 | .pclk = &ahb_clk, | ||
306 | .en_reg = PERIP1_CLK_ENB, | ||
307 | .en_reg_bit = SMI_CLK_ENB, | ||
308 | .recalc = &follow_parent, | ||
309 | }; | ||
310 | |||
311 | /* c3 clock */ | ||
312 | static struct clk c3_clk = { | ||
313 | .pclk = &ahb_clk, | ||
314 | .en_reg = PERIP1_CLK_ENB, | ||
315 | .en_reg_bit = C3_CLK_ENB, | ||
316 | .recalc = &follow_parent, | ||
317 | }; | ||
318 | |||
319 | /* clock derived from apb clk */ | ||
320 | /* adc clock */ | ||
321 | static struct clk adc_clk = { | ||
322 | .pclk = &apb_clk, | ||
323 | .en_reg = PERIP1_CLK_ENB, | ||
324 | .en_reg_bit = ADC_CLK_ENB, | ||
325 | .recalc = &follow_parent, | ||
326 | }; | ||
327 | |||
328 | /* ssp clock */ | ||
329 | static struct clk ssp_clk = { | ||
330 | .pclk = &apb_clk, | ||
331 | .en_reg = PERIP1_CLK_ENB, | ||
332 | .en_reg_bit = SSP_CLK_ENB, | ||
333 | .recalc = &follow_parent, | ||
334 | }; | ||
335 | |||
336 | /* gpio clock */ | ||
337 | static struct clk gpio_clk = { | ||
338 | .pclk = &apb_clk, | ||
339 | .en_reg = PERIP1_CLK_ENB, | ||
340 | .en_reg_bit = GPIO_CLK_ENB, | ||
341 | .recalc = &follow_parent, | ||
342 | }; | ||
343 | |||
344 | /* array of all spear 3xx clock lookups */ | ||
345 | static struct clk_lookup spear_clk_lookups[] = { | ||
346 | /* root clks */ | ||
347 | { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, | ||
348 | { .con_id = "osc_24m_clk", .clk = &osc_24m_clk}, | ||
349 | /* clock derived from 32 KHz osc clk */ | ||
350 | { .dev_id = "rtc", .clk = &rtc_clk}, | ||
351 | /* clock derived from 24 MHz osc clk */ | ||
352 | { .con_id = "pll1_clk", .clk = &pll1_clk}, | ||
353 | { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk}, | ||
354 | { .dev_id = "wdt", .clk = &wdt_clk}, | ||
355 | /* clock derived from pll1 clk */ | ||
356 | { .con_id = "cpu_clk", .clk = &cpu_clk}, | ||
357 | { .con_id = "ahb_clk", .clk = &ahb_clk}, | ||
358 | { .dev_id = "uart", .clk = &uart_clk}, | ||
359 | { .dev_id = "firda", .clk = &firda_clk}, | ||
360 | { .dev_id = "gpt0", .clk = &gpt0_clk}, | ||
361 | { .dev_id = "gpt1", .clk = &gpt1_clk}, | ||
362 | { .dev_id = "gpt2", .clk = &gpt2_clk}, | ||
363 | /* clock derived from pll3 clk */ | ||
364 | { .dev_id = "usbh", .clk = &usbh_clk}, | ||
365 | { .dev_id = "usbd", .clk = &usbd_clk}, | ||
366 | { .dev_id = "clcd", .clk = &clcd_clk}, | ||
367 | /* clock derived from ahb clk */ | ||
368 | { .con_id = "apb_clk", .clk = &apb_clk}, | ||
369 | { .dev_id = "i2c", .clk = &i2c_clk}, | ||
370 | { .dev_id = "dma", .clk = &dma_clk}, | ||
371 | { .dev_id = "jpeg", .clk = &jpeg_clk}, | ||
372 | { .dev_id = "gmac", .clk = &gmac_clk}, | ||
373 | { .dev_id = "smi", .clk = &smi_clk}, | ||
374 | { .dev_id = "c3", .clk = &c3_clk}, | ||
375 | /* clock derived from apb clk */ | ||
376 | { .dev_id = "adc", .clk = &adc_clk}, | ||
377 | { .dev_id = "ssp", .clk = &ssp_clk}, | ||
378 | { .dev_id = "gpio", .clk = &gpio_clk}, | ||
379 | }; | ||
380 | |||
381 | void __init clk_init(void) | ||
382 | { | ||
383 | int i; | ||
384 | |||
385 | for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) | ||
386 | clk_register(&spear_clk_lookups[i]); | ||
387 | |||
388 | recalc_root_clocks(); | ||
389 | } | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/clkdev.h b/arch/arm/mach-spear3xx/include/mach/clkdev.h new file mode 100644 index 000000000000..a3d07339d9f1 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/clkdev.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/clkdev.h | ||
3 | * | ||
4 | * Clock Dev framework definitions for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_CLKDEV_H | ||
15 | #define __MACH_CLKDEV_H | ||
16 | |||
17 | #include <plat/clkdev.h> | ||
18 | |||
19 | #endif /* __MACH_CLKDEV_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/debug-macro.S b/arch/arm/mach-spear3xx/include/mach/debug-macro.S new file mode 100644 index 000000000000..590519f10d6e --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/debug-macro.S | |||
@@ -0,0 +1,14 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/debug-macro.S | ||
3 | * | ||
4 | * Debugging macro include header spear3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <plat/debug-macro.S> | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/entry-macro.S b/arch/arm/mach-spear3xx/include/mach/entry-macro.S new file mode 100644 index 000000000000..947625d6b48d --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/entry-macro.S | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <mach/hardware.h> | ||
15 | #include <mach/spear.h> | ||
16 | #include <asm/hardware/vic.h> | ||
17 | |||
18 | .macro disable_fiq | ||
19 | .endm | ||
20 | |||
21 | .macro get_irqnr_preamble, base, tmp | ||
22 | .endm | ||
23 | |||
24 | .macro arch_ret_to_user, tmp1, tmp2 | ||
25 | .endm | ||
26 | |||
27 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
28 | ldr \base, =VA_SPEAR3XX_ML1_VIC_BASE | ||
29 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status | ||
30 | teq \irqstat, #0 | ||
31 | beq 1001f @ this will set/reset | ||
32 | @ zero register | ||
33 | /* | ||
34 | * Following code will find bit position of least significang | ||
35 | * bit set in irqstat, using following equation | ||
36 | * least significant bit set in n = (n & ~(n-1)) | ||
37 | */ | ||
38 | sub \tmp, \irqstat, #1 @ tmp = irqstat - 1 | ||
39 | mvn \tmp, \tmp @ tmp = ~tmp | ||
40 | and \irqstat, \irqstat, \tmp @ irqstat &= tmp | ||
41 | /* Now, irqstat is = bit no. of 1st bit set in vic irq status */ | ||
42 | clz \tmp, \irqstat @ tmp = leading zeros | ||
43 | rsb \irqnr, \tmp, #0x1F @ irqnr = 32 - tmp - 1 | ||
44 | |||
45 | 1001: /* EQ will be set if no irqs pending */ | ||
46 | .endm | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h new file mode 100644 index 000000000000..af7e02c909a3 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/generic.h | |||
@@ -0,0 +1,205 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/generic.h | ||
3 | * | ||
4 | * SPEAr3XX machine family generic header file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_GENERIC_H | ||
15 | #define __MACH_GENERIC_H | ||
16 | |||
17 | #include <asm/mach/time.h> | ||
18 | #include <asm/mach/map.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/amba/bus.h> | ||
22 | #include <plat/padmux.h> | ||
23 | |||
24 | /* spear3xx declarations */ | ||
25 | /* | ||
26 | * Each GPT has 2 timer channels | ||
27 | * Following GPT channels will be used as clock source and clockevent | ||
28 | */ | ||
29 | #define SPEAR_GPT0_BASE SPEAR3XX_ML1_TMR_BASE | ||
30 | #define SPEAR_GPT0_CHAN0_IRQ IRQ_CPU_GPT1_1 | ||
31 | #define SPEAR_GPT0_CHAN1_IRQ IRQ_CPU_GPT1_2 | ||
32 | |||
33 | /* Add spear3xx family device structure declarations here */ | ||
34 | extern struct amba_device gpio_device; | ||
35 | extern struct amba_device uart_device; | ||
36 | extern struct sys_timer spear_sys_timer; | ||
37 | |||
38 | /* Add spear3xx family function declarations here */ | ||
39 | void __init clk_init(void); | ||
40 | void __init spear3xx_map_io(void); | ||
41 | void __init spear3xx_init_irq(void); | ||
42 | void __init spear3xx_init(void); | ||
43 | void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size); | ||
44 | |||
45 | /* pad mux declarations */ | ||
46 | #define PMX_FIRDA_MASK (1 << 14) | ||
47 | #define PMX_I2C_MASK (1 << 13) | ||
48 | #define PMX_SSP_CS_MASK (1 << 12) | ||
49 | #define PMX_SSP_MASK (1 << 11) | ||
50 | #define PMX_MII_MASK (1 << 10) | ||
51 | #define PMX_GPIO_PIN0_MASK (1 << 9) | ||
52 | #define PMX_GPIO_PIN1_MASK (1 << 8) | ||
53 | #define PMX_GPIO_PIN2_MASK (1 << 7) | ||
54 | #define PMX_GPIO_PIN3_MASK (1 << 6) | ||
55 | #define PMX_GPIO_PIN4_MASK (1 << 5) | ||
56 | #define PMX_GPIO_PIN5_MASK (1 << 4) | ||
57 | #define PMX_UART0_MODEM_MASK (1 << 3) | ||
58 | #define PMX_UART0_MASK (1 << 2) | ||
59 | #define PMX_TIMER_3_4_MASK (1 << 1) | ||
60 | #define PMX_TIMER_1_2_MASK (1 << 0) | ||
61 | |||
62 | /* pad mux devices */ | ||
63 | extern struct pmx_dev pmx_firda; | ||
64 | extern struct pmx_dev pmx_i2c; | ||
65 | extern struct pmx_dev pmx_ssp_cs; | ||
66 | extern struct pmx_dev pmx_ssp; | ||
67 | extern struct pmx_dev pmx_mii; | ||
68 | extern struct pmx_dev pmx_gpio_pin0; | ||
69 | extern struct pmx_dev pmx_gpio_pin1; | ||
70 | extern struct pmx_dev pmx_gpio_pin2; | ||
71 | extern struct pmx_dev pmx_gpio_pin3; | ||
72 | extern struct pmx_dev pmx_gpio_pin4; | ||
73 | extern struct pmx_dev pmx_gpio_pin5; | ||
74 | extern struct pmx_dev pmx_uart0_modem; | ||
75 | extern struct pmx_dev pmx_uart0; | ||
76 | extern struct pmx_dev pmx_timer_3_4; | ||
77 | extern struct pmx_dev pmx_timer_1_2; | ||
78 | |||
79 | #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) | ||
80 | /* padmux plgpio devices */ | ||
81 | extern struct pmx_dev pmx_plgpio_0_1; | ||
82 | extern struct pmx_dev pmx_plgpio_2_3; | ||
83 | extern struct pmx_dev pmx_plgpio_4_5; | ||
84 | extern struct pmx_dev pmx_plgpio_6_9; | ||
85 | extern struct pmx_dev pmx_plgpio_10_27; | ||
86 | extern struct pmx_dev pmx_plgpio_28; | ||
87 | extern struct pmx_dev pmx_plgpio_29; | ||
88 | extern struct pmx_dev pmx_plgpio_30; | ||
89 | extern struct pmx_dev pmx_plgpio_31; | ||
90 | extern struct pmx_dev pmx_plgpio_32; | ||
91 | extern struct pmx_dev pmx_plgpio_33; | ||
92 | extern struct pmx_dev pmx_plgpio_34_36; | ||
93 | extern struct pmx_dev pmx_plgpio_37_42; | ||
94 | extern struct pmx_dev pmx_plgpio_43_44_47_48; | ||
95 | extern struct pmx_dev pmx_plgpio_45_46_49_50; | ||
96 | #endif | ||
97 | |||
98 | extern struct pmx_driver pmx_driver; | ||
99 | |||
100 | /* spear300 declarations */ | ||
101 | #ifdef CONFIG_MACH_SPEAR300 | ||
102 | /* Add spear300 machine device structure declarations here */ | ||
103 | extern struct amba_device gpio1_device; | ||
104 | |||
105 | /* pad mux modes */ | ||
106 | extern struct pmx_mode nand_mode; | ||
107 | extern struct pmx_mode nor_mode; | ||
108 | extern struct pmx_mode photo_frame_mode; | ||
109 | extern struct pmx_mode lend_ip_phone_mode; | ||
110 | extern struct pmx_mode hend_ip_phone_mode; | ||
111 | extern struct pmx_mode lend_wifi_phone_mode; | ||
112 | extern struct pmx_mode hend_wifi_phone_mode; | ||
113 | extern struct pmx_mode ata_pabx_wi2s_mode; | ||
114 | extern struct pmx_mode ata_pabx_i2s_mode; | ||
115 | extern struct pmx_mode caml_lcdw_mode; | ||
116 | extern struct pmx_mode camu_lcd_mode; | ||
117 | extern struct pmx_mode camu_wlcd_mode; | ||
118 | extern struct pmx_mode caml_lcd_mode; | ||
119 | |||
120 | /* pad mux devices */ | ||
121 | extern struct pmx_dev pmx_fsmc_2_chips; | ||
122 | extern struct pmx_dev pmx_fsmc_4_chips; | ||
123 | extern struct pmx_dev pmx_keyboard; | ||
124 | extern struct pmx_dev pmx_clcd; | ||
125 | extern struct pmx_dev pmx_telecom_gpio; | ||
126 | extern struct pmx_dev pmx_telecom_tdm; | ||
127 | extern struct pmx_dev pmx_telecom_spi_cs_i2c_clk; | ||
128 | extern struct pmx_dev pmx_telecom_camera; | ||
129 | extern struct pmx_dev pmx_telecom_dac; | ||
130 | extern struct pmx_dev pmx_telecom_i2s; | ||
131 | extern struct pmx_dev pmx_telecom_boot_pins; | ||
132 | extern struct pmx_dev pmx_telecom_sdio_4bit; | ||
133 | extern struct pmx_dev pmx_telecom_sdio_8bit; | ||
134 | extern struct pmx_dev pmx_gpio1; | ||
135 | |||
136 | void spear300_pmx_init(void); | ||
137 | |||
138 | /* Add spear300 machine function declarations here */ | ||
139 | void __init spear300_init(void); | ||
140 | |||
141 | #endif /* CONFIG_MACH_SPEAR300 */ | ||
142 | |||
143 | /* spear310 declarations */ | ||
144 | #ifdef CONFIG_MACH_SPEAR310 | ||
145 | /* Add spear310 machine device structure declarations here */ | ||
146 | |||
147 | /* pad mux devices */ | ||
148 | extern struct pmx_dev pmx_emi_cs_0_1_4_5; | ||
149 | extern struct pmx_dev pmx_emi_cs_2_3; | ||
150 | extern struct pmx_dev pmx_uart1; | ||
151 | extern struct pmx_dev pmx_uart2; | ||
152 | extern struct pmx_dev pmx_uart3_4_5; | ||
153 | extern struct pmx_dev pmx_fsmc; | ||
154 | extern struct pmx_dev pmx_rs485_0_1; | ||
155 | extern struct pmx_dev pmx_tdm0; | ||
156 | |||
157 | void spear310_pmx_init(void); | ||
158 | |||
159 | /* Add spear310 machine function declarations here */ | ||
160 | void __init spear310_init(void); | ||
161 | |||
162 | #endif /* CONFIG_MACH_SPEAR310 */ | ||
163 | |||
164 | /* spear320 declarations */ | ||
165 | #ifdef CONFIG_MACH_SPEAR320 | ||
166 | /* Add spear320 machine device structure declarations here */ | ||
167 | |||
168 | /* pad mux modes */ | ||
169 | extern struct pmx_mode auto_net_smii_mode; | ||
170 | extern struct pmx_mode auto_net_mii_mode; | ||
171 | extern struct pmx_mode auto_exp_mode; | ||
172 | extern struct pmx_mode small_printers_mode; | ||
173 | |||
174 | /* pad mux devices */ | ||
175 | extern struct pmx_dev pmx_clcd; | ||
176 | extern struct pmx_dev pmx_emi; | ||
177 | extern struct pmx_dev pmx_fsmc; | ||
178 | extern struct pmx_dev pmx_spp; | ||
179 | extern struct pmx_dev pmx_sdio; | ||
180 | extern struct pmx_dev pmx_i2s; | ||
181 | extern struct pmx_dev pmx_uart1; | ||
182 | extern struct pmx_dev pmx_uart1_modem; | ||
183 | extern struct pmx_dev pmx_uart2; | ||
184 | extern struct pmx_dev pmx_touchscreen; | ||
185 | extern struct pmx_dev pmx_can; | ||
186 | extern struct pmx_dev pmx_sdio_led; | ||
187 | extern struct pmx_dev pmx_pwm0; | ||
188 | extern struct pmx_dev pmx_pwm1; | ||
189 | extern struct pmx_dev pmx_pwm2; | ||
190 | extern struct pmx_dev pmx_pwm3; | ||
191 | extern struct pmx_dev pmx_ssp1; | ||
192 | extern struct pmx_dev pmx_ssp2; | ||
193 | extern struct pmx_dev pmx_mii1; | ||
194 | extern struct pmx_dev pmx_smii0; | ||
195 | extern struct pmx_dev pmx_smii1; | ||
196 | extern struct pmx_dev pmx_i2c1; | ||
197 | |||
198 | void spear320_pmx_init(void); | ||
199 | |||
200 | /* Add spear320 machine function declarations here */ | ||
201 | void __init spear320_init(void); | ||
202 | |||
203 | #endif /* CONFIG_MACH_SPEAR320 */ | ||
204 | |||
205 | #endif /* __MACH_GENERIC_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/gpio.h b/arch/arm/mach-spear3xx/include/mach/gpio.h new file mode 100644 index 000000000000..451b2081bfc9 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/gpio.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/gpio.h | ||
3 | * | ||
4 | * GPIO macros for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_GPIO_H | ||
15 | #define __MACH_GPIO_H | ||
16 | |||
17 | #include <plat/gpio.h> | ||
18 | |||
19 | #endif /* __MACH_GPIO_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/hardware.h b/arch/arm/mach-spear3xx/include/mach/hardware.h new file mode 100644 index 000000000000..4a86e6a3c444 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/hardware.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/hardware.h | ||
3 | * | ||
4 | * Hardware definitions for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_HARDWARE_H | ||
15 | #define __MACH_HARDWARE_H | ||
16 | |||
17 | /* Vitual to physical translation of statically mapped space */ | ||
18 | #define IO_ADDRESS(x) (x | 0xF0000000) | ||
19 | |||
20 | #endif /* __MACH_HARDWARE_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/io.h b/arch/arm/mach-spear3xx/include/mach/io.h new file mode 100644 index 000000000000..30cff8a1f6b5 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/io.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/io.h | ||
3 | * | ||
4 | * IO definitions for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_IO_H | ||
15 | #define __MACH_IO_H | ||
16 | |||
17 | #include <plat/io.h> | ||
18 | |||
19 | #endif /* __MACH_IO_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/irqs.h b/arch/arm/mach-spear3xx/include/mach/irqs.h new file mode 100644 index 000000000000..7f940b818473 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/irqs.h | |||
@@ -0,0 +1,152 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/irqs.h | ||
3 | * | ||
4 | * IRQ helper macros for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_IRQS_H | ||
15 | #define __MACH_IRQS_H | ||
16 | |||
17 | /* SPEAr3xx IRQ definitions */ | ||
18 | #define IRQ_HW_ACCEL_MOD_0 0 | ||
19 | #define IRQ_INTRCOMM_RAS_ARM 1 | ||
20 | #define IRQ_CPU_GPT1_1 2 | ||
21 | #define IRQ_CPU_GPT1_2 3 | ||
22 | #define IRQ_BASIC_GPT1_1 4 | ||
23 | #define IRQ_BASIC_GPT1_2 5 | ||
24 | #define IRQ_BASIC_GPT2_1 6 | ||
25 | #define IRQ_BASIC_GPT2_2 7 | ||
26 | #define IRQ_BASIC_DMA 8 | ||
27 | #define IRQ_BASIC_SMI 9 | ||
28 | #define IRQ_BASIC_RTC 10 | ||
29 | #define IRQ_BASIC_GPIO 11 | ||
30 | #define IRQ_BASIC_WDT 12 | ||
31 | #define IRQ_DDR_CONTROLLER 13 | ||
32 | #define IRQ_SYS_ERROR 14 | ||
33 | #define IRQ_WAKEUP_RCV 15 | ||
34 | #define IRQ_JPEG 16 | ||
35 | #define IRQ_IRDA 17 | ||
36 | #define IRQ_ADC 18 | ||
37 | #define IRQ_UART 19 | ||
38 | #define IRQ_SSP 20 | ||
39 | #define IRQ_I2C 21 | ||
40 | #define IRQ_MAC_1 22 | ||
41 | #define IRQ_MAC_2 23 | ||
42 | #define IRQ_USB_DEV 24 | ||
43 | #define IRQ_USB_H_OHCI_0 25 | ||
44 | #define IRQ_USB_H_EHCI_0 26 | ||
45 | #define IRQ_USB_H_EHCI_1 IRQ_USB_H_EHCI_0 | ||
46 | #define IRQ_USB_H_OHCI_1 27 | ||
47 | #define IRQ_GEN_RAS_1 28 | ||
48 | #define IRQ_GEN_RAS_2 29 | ||
49 | #define IRQ_GEN_RAS_3 30 | ||
50 | #define IRQ_HW_ACCEL_MOD_1 31 | ||
51 | #define IRQ_VIC_END 32 | ||
52 | |||
53 | #define VIRQ_START IRQ_VIC_END | ||
54 | |||
55 | /* SPEAr300 Virtual irq definitions */ | ||
56 | #ifdef CONFIG_MACH_SPEAR300 | ||
57 | /* IRQs sharing IRQ_GEN_RAS_1 */ | ||
58 | #define VIRQ_IT_PERS_S (VIRQ_START + 0) | ||
59 | #define VIRQ_IT_CHANGE_S (VIRQ_START + 1) | ||
60 | #define VIRQ_I2S (VIRQ_START + 2) | ||
61 | #define VIRQ_TDM (VIRQ_START + 3) | ||
62 | #define VIRQ_CAMERA_L (VIRQ_START + 4) | ||
63 | #define VIRQ_CAMERA_F (VIRQ_START + 5) | ||
64 | #define VIRQ_CAMERA_V (VIRQ_START + 6) | ||
65 | #define VIRQ_KEYBOARD (VIRQ_START + 7) | ||
66 | #define VIRQ_GPIO1 (VIRQ_START + 8) | ||
67 | |||
68 | /* IRQs sharing IRQ_GEN_RAS_3 */ | ||
69 | #define IRQ_CLCD IRQ_GEN_RAS_3 | ||
70 | |||
71 | /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ | ||
72 | #define IRQ_SDIO IRQ_INTRCOMM_RAS_ARM | ||
73 | |||
74 | /* GPIO pins virtual irqs */ | ||
75 | #define SPEAR_GPIO_INT_BASE (VIRQ_START + 9) | ||
76 | #define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO_INT_BASE + 8) | ||
77 | #define SPEAR_GPIO_INT_END (SPEAR_GPIO1_INT_BASE + 8) | ||
78 | |||
79 | /* SPEAr310 Virtual irq definitions */ | ||
80 | #elif defined(CONFIG_MACH_SPEAR310) | ||
81 | /* IRQs sharing IRQ_GEN_RAS_1 */ | ||
82 | #define VIRQ_SMII0 (VIRQ_START + 0) | ||
83 | #define VIRQ_SMII1 (VIRQ_START + 1) | ||
84 | #define VIRQ_SMII2 (VIRQ_START + 2) | ||
85 | #define VIRQ_SMII3 (VIRQ_START + 3) | ||
86 | #define VIRQ_WAKEUP_SMII0 (VIRQ_START + 4) | ||
87 | #define VIRQ_WAKEUP_SMII1 (VIRQ_START + 5) | ||
88 | #define VIRQ_WAKEUP_SMII2 (VIRQ_START + 6) | ||
89 | #define VIRQ_WAKEUP_SMII3 (VIRQ_START + 7) | ||
90 | |||
91 | /* IRQs sharing IRQ_GEN_RAS_2 */ | ||
92 | #define VIRQ_UART1 (VIRQ_START + 8) | ||
93 | #define VIRQ_UART2 (VIRQ_START + 9) | ||
94 | #define VIRQ_UART3 (VIRQ_START + 10) | ||
95 | #define VIRQ_UART4 (VIRQ_START + 11) | ||
96 | #define VIRQ_UART5 (VIRQ_START + 12) | ||
97 | |||
98 | /* IRQs sharing IRQ_GEN_RAS_3 */ | ||
99 | #define VIRQ_EMI (VIRQ_START + 13) | ||
100 | #define VIRQ_PLGPIO (VIRQ_START + 14) | ||
101 | |||
102 | /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ | ||
103 | #define VIRQ_TDM_HDLC (VIRQ_START + 15) | ||
104 | #define VIRQ_RS485_0 (VIRQ_START + 16) | ||
105 | #define VIRQ_RS485_1 (VIRQ_START + 17) | ||
106 | |||
107 | /* GPIO pins virtual irqs */ | ||
108 | #define SPEAR_GPIO_INT_BASE (VIRQ_START + 18) | ||
109 | |||
110 | /* SPEAr320 Virtual irq definitions */ | ||
111 | #else | ||
112 | /* IRQs sharing IRQ_GEN_RAS_1 */ | ||
113 | #define VIRQ_EMI (VIRQ_START + 0) | ||
114 | #define VIRQ_CLCD (VIRQ_START + 1) | ||
115 | #define VIRQ_SPP (VIRQ_START + 2) | ||
116 | |||
117 | /* IRQs sharing IRQ_GEN_RAS_2 */ | ||
118 | #define IRQ_SDIO IRQ_GEN_RAS_2 | ||
119 | |||
120 | /* IRQs sharing IRQ_GEN_RAS_3 */ | ||
121 | #define VIRQ_PLGPIO (VIRQ_START + 3) | ||
122 | #define VIRQ_I2S_PLAY (VIRQ_START + 4) | ||
123 | #define VIRQ_I2S_REC (VIRQ_START + 5) | ||
124 | |||
125 | /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ | ||
126 | #define VIRQ_CANU (VIRQ_START + 6) | ||
127 | #define VIRQ_CANL (VIRQ_START + 7) | ||
128 | #define VIRQ_UART1 (VIRQ_START + 8) | ||
129 | #define VIRQ_UART2 (VIRQ_START + 9) | ||
130 | #define VIRQ_SSP1 (VIRQ_START + 10) | ||
131 | #define VIRQ_SSP2 (VIRQ_START + 11) | ||
132 | #define VIRQ_SMII0 (VIRQ_START + 12) | ||
133 | #define VIRQ_MII1_SMII1 (VIRQ_START + 13) | ||
134 | #define VIRQ_WAKEUP_SMII0 (VIRQ_START + 14) | ||
135 | #define VIRQ_WAKEUP_MII1_SMII1 (VIRQ_START + 15) | ||
136 | #define VIRQ_I2C (VIRQ_START + 16) | ||
137 | |||
138 | /* GPIO pins virtual irqs */ | ||
139 | #define SPEAR_GPIO_INT_BASE (VIRQ_START + 17) | ||
140 | |||
141 | #endif | ||
142 | |||
143 | /* PLGPIO Virtual IRQs */ | ||
144 | #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) | ||
145 | #define SPEAR_PLGPIO_INT_BASE (SPEAR_GPIO_INT_BASE + 8) | ||
146 | #define SPEAR_GPIO_INT_END (SPEAR_PLGPIO_INT_BASE + 102) | ||
147 | #endif | ||
148 | |||
149 | #define VIRQ_END SPEAR_GPIO_INT_END | ||
150 | #define NR_IRQS VIRQ_END | ||
151 | |||
152 | #endif /* __MACH_IRQS_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/memory.h b/arch/arm/mach-spear3xx/include/mach/memory.h new file mode 100644 index 000000000000..51735221ea19 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/memory.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/memory.h | ||
3 | * | ||
4 | * Memory map for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_MEMORY_H | ||
15 | #define __MACH_MEMORY_H | ||
16 | |||
17 | #include <plat/memory.h> | ||
18 | |||
19 | #endif /* __MACH_MEMORY_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/misc_regs.h b/arch/arm/mach-spear3xx/include/mach/misc_regs.h new file mode 100644 index 000000000000..38d767a1aba0 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/misc_regs.h | |||
@@ -0,0 +1,163 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/misc_regs.h | ||
3 | * | ||
4 | * Miscellaneous registers definitions for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_MISC_REGS_H | ||
15 | #define __MACH_MISC_REGS_H | ||
16 | |||
17 | #include <mach/spear.h> | ||
18 | |||
19 | #define MISC_BASE VA_SPEAR3XX_ICM3_MISC_REG_BASE | ||
20 | |||
21 | #define SOC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x000)) | ||
22 | #define DIAG_CFG_CTR ((unsigned int *)(MISC_BASE + 0x004)) | ||
23 | #define PLL1_CTR ((unsigned int *)(MISC_BASE + 0x008)) | ||
24 | #define PLL1_FRQ ((unsigned int *)(MISC_BASE + 0x00C)) | ||
25 | #define PLL1_MOD ((unsigned int *)(MISC_BASE + 0x010)) | ||
26 | #define PLL2_CTR ((unsigned int *)(MISC_BASE + 0x014)) | ||
27 | /* PLL_CTR register masks */ | ||
28 | #define PLL_ENABLE 2 | ||
29 | #define PLL_MODE_SHIFT 4 | ||
30 | #define PLL_MODE_MASK 0x3 | ||
31 | #define PLL_MODE_NORMAL 0 | ||
32 | #define PLL_MODE_FRACTION 1 | ||
33 | #define PLL_MODE_DITH_DSB 2 | ||
34 | #define PLL_MODE_DITH_SSB 3 | ||
35 | |||
36 | #define PLL2_FRQ ((unsigned int *)(MISC_BASE + 0x018)) | ||
37 | /* PLL FRQ register masks */ | ||
38 | #define PLL_DIV_N_SHIFT 0 | ||
39 | #define PLL_DIV_N_MASK 0xFF | ||
40 | #define PLL_DIV_P_SHIFT 8 | ||
41 | #define PLL_DIV_P_MASK 0x7 | ||
42 | #define PLL_NORM_FDBK_M_SHIFT 24 | ||
43 | #define PLL_NORM_FDBK_M_MASK 0xFF | ||
44 | #define PLL_DITH_FDBK_M_SHIFT 16 | ||
45 | #define PLL_DITH_FDBK_M_MASK 0xFFFF | ||
46 | |||
47 | #define PLL2_MOD ((unsigned int *)(MISC_BASE + 0x01C)) | ||
48 | #define PLL_CLK_CFG ((unsigned int *)(MISC_BASE + 0x020)) | ||
49 | #define CORE_CLK_CFG ((unsigned int *)(MISC_BASE + 0x024)) | ||
50 | /* CORE CLK CFG register masks */ | ||
51 | #define PLL_HCLK_RATIO_SHIFT 10 | ||
52 | #define PLL_HCLK_RATIO_MASK 0x3 | ||
53 | #define HCLK_PCLK_RATIO_SHIFT 8 | ||
54 | #define HCLK_PCLK_RATIO_MASK 0x3 | ||
55 | |||
56 | #define PERIP_CLK_CFG ((unsigned int *)(MISC_BASE + 0x028)) | ||
57 | /* PERIP_CLK_CFG register masks */ | ||
58 | #define UART_CLK_SHIFT 4 | ||
59 | #define UART_CLK_MASK 0x1 | ||
60 | #define FIRDA_CLK_SHIFT 5 | ||
61 | #define FIRDA_CLK_MASK 0x3 | ||
62 | #define GPT0_CLK_SHIFT 8 | ||
63 | #define GPT1_CLK_SHIFT 11 | ||
64 | #define GPT2_CLK_SHIFT 12 | ||
65 | #define GPT_CLK_MASK 0x1 | ||
66 | #define AUX_CLK_PLL3_MASK 0 | ||
67 | #define AUX_CLK_PLL1_MASK 1 | ||
68 | |||
69 | #define PERIP1_CLK_ENB ((unsigned int *)(MISC_BASE + 0x02C)) | ||
70 | /* PERIP1_CLK_ENB register masks */ | ||
71 | #define UART_CLK_ENB 3 | ||
72 | #define SSP_CLK_ENB 5 | ||
73 | #define I2C_CLK_ENB 7 | ||
74 | #define JPEG_CLK_ENB 8 | ||
75 | #define FIRDA_CLK_ENB 10 | ||
76 | #define GPT1_CLK_ENB 11 | ||
77 | #define GPT2_CLK_ENB 12 | ||
78 | #define ADC_CLK_ENB 15 | ||
79 | #define RTC_CLK_ENB 17 | ||
80 | #define GPIO_CLK_ENB 18 | ||
81 | #define DMA_CLK_ENB 19 | ||
82 | #define SMI_CLK_ENB 21 | ||
83 | #define GMAC_CLK_ENB 23 | ||
84 | #define USBD_CLK_ENB 24 | ||
85 | #define USBH_CLK_ENB 25 | ||
86 | #define C3_CLK_ENB 31 | ||
87 | |||
88 | #define SOC_CORE_ID ((unsigned int *)(MISC_BASE + 0x030)) | ||
89 | #define RAS_CLK_ENB ((unsigned int *)(MISC_BASE + 0x034)) | ||
90 | #define PERIP1_SOF_RST ((unsigned int *)(MISC_BASE + 0x038)) | ||
91 | /* PERIP1_SOF_RST register masks */ | ||
92 | #define JPEG_SOF_RST 8 | ||
93 | |||
94 | #define SOC_USER_ID ((unsigned int *)(MISC_BASE + 0x03C)) | ||
95 | #define RAS_SOF_RST ((unsigned int *)(MISC_BASE + 0x040)) | ||
96 | #define PRSC1_CLK_CFG ((unsigned int *)(MISC_BASE + 0x044)) | ||
97 | #define PRSC2_CLK_CFG ((unsigned int *)(MISC_BASE + 0x048)) | ||
98 | #define PRSC3_CLK_CFG ((unsigned int *)(MISC_BASE + 0x04C)) | ||
99 | /* gpt synthesizer register masks */ | ||
100 | #define GPT_MSCALE_SHIFT 0 | ||
101 | #define GPT_MSCALE_MASK 0xFFF | ||
102 | #define GPT_NSCALE_SHIFT 12 | ||
103 | #define GPT_NSCALE_MASK 0xF | ||
104 | |||
105 | #define AMEM_CLK_CFG ((unsigned int *)(MISC_BASE + 0x050)) | ||
106 | #define EXPI_CLK_CFG ((unsigned int *)(MISC_BASE + 0x054)) | ||
107 | #define CLCD_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x05C)) | ||
108 | #define FIRDA_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x060)) | ||
109 | #define UART_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x064)) | ||
110 | #define GMAC_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x068)) | ||
111 | #define RAS1_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x06C)) | ||
112 | #define RAS2_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x070)) | ||
113 | #define RAS3_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x074)) | ||
114 | #define RAS4_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x078)) | ||
115 | /* aux clk synthesiser register masks for irda to ras4 */ | ||
116 | #define AUX_EQ_SEL_SHIFT 30 | ||
117 | #define AUX_EQ_SEL_MASK 1 | ||
118 | #define AUX_EQ1_SEL 0 | ||
119 | #define AUX_EQ2_SEL 1 | ||
120 | #define AUX_XSCALE_SHIFT 16 | ||
121 | #define AUX_XSCALE_MASK 0xFFF | ||
122 | #define AUX_YSCALE_SHIFT 0 | ||
123 | #define AUX_YSCALE_MASK 0xFFF | ||
124 | |||
125 | #define ICM1_ARB_CFG ((unsigned int *)(MISC_BASE + 0x07C)) | ||
126 | #define ICM2_ARB_CFG ((unsigned int *)(MISC_BASE + 0x080)) | ||
127 | #define ICM3_ARB_CFG ((unsigned int *)(MISC_BASE + 0x084)) | ||
128 | #define ICM4_ARB_CFG ((unsigned int *)(MISC_BASE + 0x088)) | ||
129 | #define ICM5_ARB_CFG ((unsigned int *)(MISC_BASE + 0x08C)) | ||
130 | #define ICM6_ARB_CFG ((unsigned int *)(MISC_BASE + 0x090)) | ||
131 | #define ICM7_ARB_CFG ((unsigned int *)(MISC_BASE + 0x094)) | ||
132 | #define ICM8_ARB_CFG ((unsigned int *)(MISC_BASE + 0x098)) | ||
133 | #define ICM9_ARB_CFG ((unsigned int *)(MISC_BASE + 0x09C)) | ||
134 | #define DMA_CHN_CFG ((unsigned int *)(MISC_BASE + 0x0A0)) | ||
135 | #define USB2_PHY_CFG ((unsigned int *)(MISC_BASE + 0x0A4)) | ||
136 | #define GMAC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0A8)) | ||
137 | #define EXPI_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0AC)) | ||
138 | #define PRC1_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C0)) | ||
139 | #define PRC2_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C4)) | ||
140 | #define PRC3_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C8)) | ||
141 | #define PRC4_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0CC)) | ||
142 | #define PRC1_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D0)) | ||
143 | #define PRC2_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D4)) | ||
144 | #define PRC3_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D8)) | ||
145 | #define PRC4_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0DC)) | ||
146 | #define PWRDOWN_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0E0)) | ||
147 | #define COMPSSTL_1V8_CFG ((unsigned int *)(MISC_BASE + 0x0E4)) | ||
148 | #define COMPSSTL_2V5_CFG ((unsigned int *)(MISC_BASE + 0x0E8)) | ||
149 | #define COMPCOR_3V3_CFG ((unsigned int *)(MISC_BASE + 0x0EC)) | ||
150 | #define SSTLPAD_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F0)) | ||
151 | #define BIST1_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F4)) | ||
152 | #define BIST2_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F8)) | ||
153 | #define BIST3_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0FC)) | ||
154 | #define BIST4_CFG_CTR ((unsigned int *)(MISC_BASE + 0x100)) | ||
155 | #define BIST5_CFG_CTR ((unsigned int *)(MISC_BASE + 0x104)) | ||
156 | #define BIST1_STS_RES ((unsigned int *)(MISC_BASE + 0x108)) | ||
157 | #define BIST2_STS_RES ((unsigned int *)(MISC_BASE + 0x10C)) | ||
158 | #define BIST3_STS_RES ((unsigned int *)(MISC_BASE + 0x110)) | ||
159 | #define BIST4_STS_RES ((unsigned int *)(MISC_BASE + 0x114)) | ||
160 | #define BIST5_STS_RES ((unsigned int *)(MISC_BASE + 0x118)) | ||
161 | #define SYSERR_CFG_CTR ((unsigned int *)(MISC_BASE + 0x11C)) | ||
162 | |||
163 | #endif /* __MACH_MISC_REGS_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/spear.h b/arch/arm/mach-spear3xx/include/mach/spear.h new file mode 100644 index 000000000000..dcca8568a486 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/spear.h | |||
@@ -0,0 +1,144 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/spear.h | ||
3 | * | ||
4 | * SPEAr3xx Machine family specific definition | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_SPEAR3XX_H | ||
15 | #define __MACH_SPEAR3XX_H | ||
16 | |||
17 | #include <mach/hardware.h> | ||
18 | #include <mach/spear300.h> | ||
19 | #include <mach/spear310.h> | ||
20 | #include <mach/spear320.h> | ||
21 | |||
22 | #define SPEAR3XX_ML_SDRAM_BASE 0x00000000 | ||
23 | #define SPEAR3XX_ML_SDRAM_SIZE 0x40000000 | ||
24 | |||
25 | #define SPEAR3XX_ICM9_BASE 0xC0000000 | ||
26 | #define SPEAR3XX_ICM9_SIZE 0x10000000 | ||
27 | |||
28 | /* ICM1 - Low speed connection */ | ||
29 | #define SPEAR3XX_ICM1_2_BASE 0xD0000000 | ||
30 | #define SPEAR3XX_ICM1_2_SIZE 0x10000000 | ||
31 | |||
32 | #define SPEAR3XX_ICM1_UART_BASE 0xD0000000 | ||
33 | #define VA_SPEAR3XX_ICM1_UART_BASE IO_ADDRESS(SPEAR3XX_ICM1_UART_BASE) | ||
34 | #define SPEAR3XX_ICM1_UART_SIZE 0x00080000 | ||
35 | |||
36 | #define SPEAR3XX_ICM1_ADC_BASE 0xD0080000 | ||
37 | #define SPEAR3XX_ICM1_ADC_SIZE 0x00080000 | ||
38 | |||
39 | #define SPEAR3XX_ICM1_SSP_BASE 0xD0100000 | ||
40 | #define SPEAR3XX_ICM1_SSP_SIZE 0x00080000 | ||
41 | |||
42 | #define SPEAR3XX_ICM1_I2C_BASE 0xD0180000 | ||
43 | #define SPEAR3XX_ICM1_I2C_SIZE 0x00080000 | ||
44 | |||
45 | #define SPEAR3XX_ICM1_JPEG_BASE 0xD0800000 | ||
46 | #define SPEAR3XX_ICM1_JPEG_SIZE 0x00800000 | ||
47 | |||
48 | #define SPEAR3XX_ICM1_IRDA_BASE 0xD1000000 | ||
49 | #define SPEAR3XX_ICM1_IRDA_SIZE 0x00080000 | ||
50 | |||
51 | #define SPEAR3XX_ICM1_SRAM_BASE 0xD2800000 | ||
52 | #define SPEAR3XX_ICM1_SRAM_SIZE 0x05800000 | ||
53 | |||
54 | /* ICM2 - Application Subsystem */ | ||
55 | #define SPEAR3XX_ICM2_HWACCEL0_BASE 0xD8800000 | ||
56 | #define SPEAR3XX_ICM2_HWACCEL0_SIZE 0x00800000 | ||
57 | |||
58 | #define SPEAR3XX_ICM2_HWACCEL1_BASE 0xD9000000 | ||
59 | #define SPEAR3XX_ICM2_HWACCEL1_SIZE 0x00800000 | ||
60 | |||
61 | /* ICM4 - High Speed Connection */ | ||
62 | #define SPEAR3XX_ICM4_BASE 0xE0000000 | ||
63 | #define SPEAR3XX_ICM4_SIZE 0x08000000 | ||
64 | |||
65 | #define SPEAR3XX_ICM4_MII_BASE 0xE0800000 | ||
66 | #define SPEAR3XX_ICM4_MII_SIZE 0x00800000 | ||
67 | |||
68 | #define SPEAR3XX_ICM4_USBD_FIFO_BASE 0xE1000000 | ||
69 | #define SPEAR3XX_ICM4_USBD_FIFO_SIZE 0x00100000 | ||
70 | |||
71 | #define SPEAR3XX_ICM4_USBD_CSR_BASE 0xE1100000 | ||
72 | #define SPEAR3XX_ICM4_USBD_CSR_SIZE 0x00100000 | ||
73 | |||
74 | #define SPEAR3XX_ICM4_USBD_PLDT_BASE 0xE1200000 | ||
75 | #define SPEAR3XX_ICM4_USBD_PLDT_SIZE 0x00100000 | ||
76 | |||
77 | #define SPEAR3XX_ICM4_USB_EHCI0_1_BASE 0xE1800000 | ||
78 | #define SPEAR3XX_ICM4_USB_EHCI0_1_SIZE 0x00100000 | ||
79 | |||
80 | #define SPEAR3XX_ICM4_USB_OHCI0_BASE 0xE1900000 | ||
81 | #define SPEAR3XX_ICM4_USB_OHCI0_SIZE 0x00100000 | ||
82 | |||
83 | #define SPEAR3XX_ICM4_USB_OHCI1_BASE 0xE2100000 | ||
84 | #define SPEAR3XX_ICM4_USB_OHCI1_SIZE 0x00100000 | ||
85 | |||
86 | #define SPEAR3XX_ICM4_USB_ARB_BASE 0xE2800000 | ||
87 | #define SPEAR3XX_ICM4_USB_ARB_SIZE 0x00010000 | ||
88 | |||
89 | /* ML1 - Multi Layer CPU Subsystem */ | ||
90 | #define SPEAR3XX_ICM3_ML1_2_BASE 0xF0000000 | ||
91 | #define SPEAR3XX_ICM3_ML1_2_SIZE 0x0F000000 | ||
92 | |||
93 | #define SPEAR3XX_ML1_TMR_BASE 0xF0000000 | ||
94 | #define SPEAR3XX_ML1_TMR_SIZE 0x00100000 | ||
95 | |||
96 | #define SPEAR3XX_ML1_VIC_BASE 0xF1100000 | ||
97 | #define VA_SPEAR3XX_ML1_VIC_BASE IO_ADDRESS(SPEAR3XX_ML1_VIC_BASE) | ||
98 | #define SPEAR3XX_ML1_VIC_SIZE 0x00100000 | ||
99 | |||
100 | /* ICM3 - Basic Subsystem */ | ||
101 | #define SPEAR3XX_ICM3_SMEM_BASE 0xF8000000 | ||
102 | #define SPEAR3XX_ICM3_SMEM_SIZE 0x04000000 | ||
103 | |||
104 | #define SPEAR3XX_ICM3_SMI_CTRL_BASE 0xFC000000 | ||
105 | #define SPEAR3XX_ICM3_SMI_CTRL_SIZE 0x00200000 | ||
106 | |||
107 | #define SPEAR3XX_ICM3_DMA_BASE 0xFC400000 | ||
108 | #define SPEAR3XX_ICM3_DMA_SIZE 0x00200000 | ||
109 | |||
110 | #define SPEAR3XX_ICM3_SDRAM_CTRL_BASE 0xFC600000 | ||
111 | #define SPEAR3XX_ICM3_SDRAM_CTRL_SIZE 0x00200000 | ||
112 | |||
113 | #define SPEAR3XX_ICM3_TMR0_BASE 0xFC800000 | ||
114 | #define SPEAR3XX_ICM3_TMR0_SIZE 0x00080000 | ||
115 | |||
116 | #define SPEAR3XX_ICM3_WDT_BASE 0xFC880000 | ||
117 | #define SPEAR3XX_ICM3_WDT_SIZE 0x00080000 | ||
118 | |||
119 | #define SPEAR3XX_ICM3_RTC_BASE 0xFC900000 | ||
120 | #define SPEAR3XX_ICM3_RTC_SIZE 0x00080000 | ||
121 | |||
122 | #define SPEAR3XX_ICM3_GPIO_BASE 0xFC980000 | ||
123 | #define SPEAR3XX_ICM3_GPIO_SIZE 0x00080000 | ||
124 | |||
125 | #define SPEAR3XX_ICM3_SYS_CTRL_BASE 0xFCA00000 | ||
126 | #define VA_SPEAR3XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR3XX_ICM3_SYS_CTRL_BASE) | ||
127 | #define SPEAR3XX_ICM3_SYS_CTRL_SIZE 0x00080000 | ||
128 | |||
129 | #define SPEAR3XX_ICM3_MISC_REG_BASE 0xFCA80000 | ||
130 | #define VA_SPEAR3XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR3XX_ICM3_MISC_REG_BASE) | ||
131 | #define SPEAR3XX_ICM3_MISC_REG_SIZE 0x00080000 | ||
132 | |||
133 | #define SPEAR3XX_ICM3_TMR1_BASE 0xFCB00000 | ||
134 | #define SPEAR3XX_ICM3_TMR1_SIZE 0x00080000 | ||
135 | |||
136 | /* Debug uart for linux, will be used for debug and uncompress messages */ | ||
137 | #define SPEAR_DBG_UART_BASE SPEAR3XX_ICM1_UART_BASE | ||
138 | #define VA_SPEAR_DBG_UART_BASE VA_SPEAR3XX_ICM1_UART_BASE | ||
139 | |||
140 | /* Sysctl base for spear platform */ | ||
141 | #define SPEAR_SYS_CTRL_BASE SPEAR3XX_ICM3_SYS_CTRL_BASE | ||
142 | #define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR3XX_ICM3_SYS_CTRL_BASE | ||
143 | |||
144 | #endif /* __MACH_SPEAR3XX_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/spear300.h b/arch/arm/mach-spear3xx/include/mach/spear300.h new file mode 100644 index 000000000000..ccaa76522ee2 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/spear300.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/spear300.h | ||
3 | * | ||
4 | * SPEAr300 Machine specific definition | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifdef CONFIG_MACH_SPEAR300 | ||
15 | |||
16 | #ifndef __MACH_SPEAR300_H | ||
17 | #define __MACH_SPEAR300_H | ||
18 | |||
19 | /* Base address of various IPs */ | ||
20 | #define SPEAR300_TELECOM_BASE 0x50000000 | ||
21 | #define SPEAR300_TELECOM_SIZE 0x10000000 | ||
22 | |||
23 | /* Interrupt registers offsets and masks */ | ||
24 | #define SPEAR300_TELECOM_REG_SIZE 0x00010000 | ||
25 | #define INT_ENB_MASK_REG 0x54 | ||
26 | #define INT_STS_MASK_REG 0x58 | ||
27 | #define IT_PERS_S_IRQ_MASK (1 << 0) | ||
28 | #define IT_CHANGE_S_IRQ_MASK (1 << 1) | ||
29 | #define I2S_IRQ_MASK (1 << 2) | ||
30 | #define TDM_IRQ_MASK (1 << 3) | ||
31 | #define CAMERA_L_IRQ_MASK (1 << 4) | ||
32 | #define CAMERA_F_IRQ_MASK (1 << 5) | ||
33 | #define CAMERA_V_IRQ_MASK (1 << 6) | ||
34 | #define KEYBOARD_IRQ_MASK (1 << 7) | ||
35 | #define GPIO1_IRQ_MASK (1 << 8) | ||
36 | |||
37 | #define SHIRQ_RAS1_MASK 0x1FF | ||
38 | |||
39 | #define SPEAR300_CLCD_BASE 0x60000000 | ||
40 | #define SPEAR300_CLCD_SIZE 0x10000000 | ||
41 | |||
42 | #define SPEAR300_SDIO_BASE 0x70000000 | ||
43 | #define SPEAR300_SDIO_SIZE 0x10000000 | ||
44 | |||
45 | #define SPEAR300_NAND_0_BASE 0x80000000 | ||
46 | #define SPEAR300_NAND_0_SIZE 0x04000000 | ||
47 | |||
48 | #define SPEAR300_NAND_1_BASE 0x84000000 | ||
49 | #define SPEAR300_NAND_1_SIZE 0x04000000 | ||
50 | |||
51 | #define SPEAR300_NAND_2_BASE 0x88000000 | ||
52 | #define SPEAR300_NAND_2_SIZE 0x04000000 | ||
53 | |||
54 | #define SPEAR300_NAND_3_BASE 0x8c000000 | ||
55 | #define SPEAR300_NAND_3_SIZE 0x04000000 | ||
56 | |||
57 | #define SPEAR300_NOR_0_BASE 0x90000000 | ||
58 | #define SPEAR300_NOR_0_SIZE 0x01000000 | ||
59 | |||
60 | #define SPEAR300_NOR_1_BASE 0x91000000 | ||
61 | #define SPEAR300_NOR_1_SIZE 0x01000000 | ||
62 | |||
63 | #define SPEAR300_NOR_2_BASE 0x92000000 | ||
64 | #define SPEAR300_NOR_2_SIZE 0x01000000 | ||
65 | |||
66 | #define SPEAR300_NOR_3_BASE 0x93000000 | ||
67 | #define SPEAR300_NOR_3_SIZE 0x01000000 | ||
68 | |||
69 | #define SPEAR300_FSMC_BASE 0x94000000 | ||
70 | #define SPEAR300_FSMC_SIZE 0x05000000 | ||
71 | |||
72 | #define SPEAR300_SOC_CONFIG_BASE 0x99000000 | ||
73 | #define SPEAR300_SOC_CONFIG_SIZE 0x00000008 | ||
74 | |||
75 | #define SPEAR300_KEYBOARD_BASE 0xA0000000 | ||
76 | #define SPEAR300_KEYBOARD_SIZE 0x09000000 | ||
77 | |||
78 | #define SPEAR300_GPIO_BASE 0xA9000000 | ||
79 | #define SPEAR300_GPIO_SIZE 0x07000000 | ||
80 | |||
81 | #endif /* __MACH_SPEAR300_H */ | ||
82 | |||
83 | #endif /* CONFIG_MACH_SPEAR300 */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/spear310.h b/arch/arm/mach-spear3xx/include/mach/spear310.h new file mode 100644 index 000000000000..b27bb8af3309 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/spear310.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/spear310.h | ||
3 | * | ||
4 | * SPEAr310 Machine specific definition | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifdef CONFIG_MACH_SPEAR310 | ||
15 | |||
16 | #ifndef __MACH_SPEAR310_H | ||
17 | #define __MACH_SPEAR310_H | ||
18 | |||
19 | #define SPEAR310_NAND_BASE 0x40000000 | ||
20 | #define SPEAR310_NAND_SIZE 0x04000000 | ||
21 | |||
22 | #define SPEAR310_FSMC_BASE 0x44000000 | ||
23 | #define SPEAR310_FSMC_SIZE 0x01000000 | ||
24 | |||
25 | #define SPEAR310_UART1_BASE 0xB2000000 | ||
26 | #define SPEAR310_UART2_BASE 0xB2080000 | ||
27 | #define SPEAR310_UART3_BASE 0xB2100000 | ||
28 | #define SPEAR310_UART4_BASE 0xB2180000 | ||
29 | #define SPEAR310_UART5_BASE 0xB2200000 | ||
30 | #define SPEAR310_UART_SIZE 0x00080000 | ||
31 | |||
32 | #define SPEAR310_HDLC_BASE 0xB2800000 | ||
33 | #define SPEAR310_HDLC_SIZE 0x00800000 | ||
34 | |||
35 | #define SPEAR310_RS485_0_BASE 0xB3000000 | ||
36 | #define SPEAR310_RS485_0_SIZE 0x00800000 | ||
37 | |||
38 | #define SPEAR310_RS485_1_BASE 0xB3800000 | ||
39 | #define SPEAR310_RS485_1_SIZE 0x00800000 | ||
40 | |||
41 | #define SPEAR310_SOC_CONFIG_BASE 0xB4000000 | ||
42 | #define SPEAR310_SOC_CONFIG_SIZE 0x00000070 | ||
43 | /* Interrupt registers offsets and masks */ | ||
44 | #define INT_STS_MASK_REG 0x04 | ||
45 | #define SMII0_IRQ_MASK (1 << 0) | ||
46 | #define SMII1_IRQ_MASK (1 << 1) | ||
47 | #define SMII2_IRQ_MASK (1 << 2) | ||
48 | #define SMII3_IRQ_MASK (1 << 3) | ||
49 | #define WAKEUP_SMII0_IRQ_MASK (1 << 4) | ||
50 | #define WAKEUP_SMII1_IRQ_MASK (1 << 5) | ||
51 | #define WAKEUP_SMII2_IRQ_MASK (1 << 6) | ||
52 | #define WAKEUP_SMII3_IRQ_MASK (1 << 7) | ||
53 | #define UART1_IRQ_MASK (1 << 8) | ||
54 | #define UART2_IRQ_MASK (1 << 9) | ||
55 | #define UART3_IRQ_MASK (1 << 10) | ||
56 | #define UART4_IRQ_MASK (1 << 11) | ||
57 | #define UART5_IRQ_MASK (1 << 12) | ||
58 | #define EMI_IRQ_MASK (1 << 13) | ||
59 | #define TDM_HDLC_IRQ_MASK (1 << 14) | ||
60 | #define RS485_0_IRQ_MASK (1 << 15) | ||
61 | #define RS485_1_IRQ_MASK (1 << 16) | ||
62 | |||
63 | #define SHIRQ_RAS1_MASK 0x000FF | ||
64 | #define SHIRQ_RAS2_MASK 0x01F00 | ||
65 | #define SHIRQ_RAS3_MASK 0x02000 | ||
66 | #define SHIRQ_INTRCOMM_RAS_MASK 0x1C000 | ||
67 | |||
68 | #endif /* __MACH_SPEAR310_H */ | ||
69 | |||
70 | #endif /* CONFIG_MACH_SPEAR310 */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/spear320.h b/arch/arm/mach-spear3xx/include/mach/spear320.h new file mode 100644 index 000000000000..cacf17a958cd --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/spear320.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/spear320.h | ||
3 | * | ||
4 | * SPEAr320 Machine specific definition | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifdef CONFIG_MACH_SPEAR320 | ||
15 | |||
16 | #ifndef __MACH_SPEAR320_H | ||
17 | #define __MACH_SPEAR320_H | ||
18 | |||
19 | #define SPEAR320_EMI_CTRL_BASE 0x40000000 | ||
20 | #define SPEAR320_EMI_CTRL_SIZE 0x08000000 | ||
21 | |||
22 | #define SPEAR320_FSMC_BASE 0x4C000000 | ||
23 | #define SPEAR320_FSMC_SIZE 0x01000000 | ||
24 | |||
25 | #define SPEAR320_I2S_BASE 0x60000000 | ||
26 | #define SPEAR320_I2S_SIZE 0x10000000 | ||
27 | |||
28 | #define SPEAR320_SDIO_BASE 0x70000000 | ||
29 | #define SPEAR320_SDIO_SIZE 0x10000000 | ||
30 | |||
31 | #define SPEAR320_CLCD_BASE 0x90000000 | ||
32 | #define SPEAR320_CLCD_SIZE 0x10000000 | ||
33 | |||
34 | #define SPEAR320_PAR_PORT_BASE 0xA0000000 | ||
35 | #define SPEAR320_PAR_PORT_SIZE 0x01000000 | ||
36 | |||
37 | #define SPEAR320_CAN0_BASE 0xA1000000 | ||
38 | #define SPEAR320_CAN0_SIZE 0x01000000 | ||
39 | |||
40 | #define SPEAR320_CAN1_BASE 0xA2000000 | ||
41 | #define SPEAR320_CAN1_SIZE 0x01000000 | ||
42 | |||
43 | #define SPEAR320_UART1_BASE 0xA3000000 | ||
44 | #define SPEAR320_UART2_BASE 0xA4000000 | ||
45 | #define SPEAR320_UART_SIZE 0x01000000 | ||
46 | |||
47 | #define SPEAR320_SSP0_BASE 0xA5000000 | ||
48 | #define SPEAR320_SSP0_SIZE 0x01000000 | ||
49 | |||
50 | #define SPEAR320_SSP1_BASE 0xA6000000 | ||
51 | #define SPEAR320_SSP1_SIZE 0x01000000 | ||
52 | |||
53 | #define SPEAR320_I2C_BASE 0xA7000000 | ||
54 | #define SPEAR320_I2C_SIZE 0x01000000 | ||
55 | |||
56 | #define SPEAR320_PWM_BASE 0xA8000000 | ||
57 | #define SPEAR320_PWM_SIZE 0x01000000 | ||
58 | |||
59 | #define SPEAR320_SMII0_BASE 0xAA000000 | ||
60 | #define SPEAR320_SMII0_SIZE 0x01000000 | ||
61 | |||
62 | #define SPEAR320_SMII1_BASE 0xAB000000 | ||
63 | #define SPEAR320_SMII1_SIZE 0x01000000 | ||
64 | |||
65 | #define SPEAR320_SOC_CONFIG_BASE 0xB4000000 | ||
66 | #define SPEAR320_SOC_CONFIG_SIZE 0x00000070 | ||
67 | /* Interrupt registers offsets and masks */ | ||
68 | #define INT_STS_MASK_REG 0x04 | ||
69 | #define INT_CLR_MASK_REG 0x04 | ||
70 | #define INT_ENB_MASK_REG 0x08 | ||
71 | #define GPIO_IRQ_MASK (1 << 0) | ||
72 | #define I2S_PLAY_IRQ_MASK (1 << 1) | ||
73 | #define I2S_REC_IRQ_MASK (1 << 2) | ||
74 | #define EMI_IRQ_MASK (1 << 7) | ||
75 | #define CLCD_IRQ_MASK (1 << 8) | ||
76 | #define SPP_IRQ_MASK (1 << 9) | ||
77 | #define SDIO_IRQ_MASK (1 << 10) | ||
78 | #define CAN_U_IRQ_MASK (1 << 11) | ||
79 | #define CAN_L_IRQ_MASK (1 << 12) | ||
80 | #define UART1_IRQ_MASK (1 << 13) | ||
81 | #define UART2_IRQ_MASK (1 << 14) | ||
82 | #define SSP1_IRQ_MASK (1 << 15) | ||
83 | #define SSP2_IRQ_MASK (1 << 16) | ||
84 | #define SMII0_IRQ_MASK (1 << 17) | ||
85 | #define MII1_SMII1_IRQ_MASK (1 << 18) | ||
86 | #define WAKEUP_SMII0_IRQ_MASK (1 << 19) | ||
87 | #define WAKEUP_MII1_SMII1_IRQ_MASK (1 << 20) | ||
88 | #define I2C1_IRQ_MASK (1 << 21) | ||
89 | |||
90 | #define SHIRQ_RAS1_MASK 0x000380 | ||
91 | #define SHIRQ_RAS3_MASK 0x000007 | ||
92 | #define SHIRQ_INTRCOMM_RAS_MASK 0x3FF800 | ||
93 | |||
94 | #endif /* __MACH_SPEAR320_H */ | ||
95 | |||
96 | #endif /* CONFIG_MACH_SPEAR320 */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/system.h b/arch/arm/mach-spear3xx/include/mach/system.h new file mode 100644 index 000000000000..92cee6335c90 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/system.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/system.h | ||
3 | * | ||
4 | * SPEAr3xx Machine family specific architecture functions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_SYSTEM_H | ||
15 | #define __MACH_SYSTEM_H | ||
16 | |||
17 | #include <plat/system.h> | ||
18 | |||
19 | #endif /* __MACH_SYSTEM_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/timex.h b/arch/arm/mach-spear3xx/include/mach/timex.h new file mode 100644 index 000000000000..a38cc9de876f --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/timex.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/timex.h | ||
3 | * | ||
4 | * SPEAr3XX machine family specific timex definitions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_TIMEX_H | ||
15 | #define __MACH_TIMEX_H | ||
16 | |||
17 | #include <plat/timex.h> | ||
18 | |||
19 | #endif /* __MACH_TIMEX_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/uncompress.h b/arch/arm/mach-spear3xx/include/mach/uncompress.h new file mode 100644 index 000000000000..53ba8bbc0dfa --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/uncompress.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/uncompress.h | ||
3 | * | ||
4 | * Serial port stubs for kernel decompress status messages | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_UNCOMPRESS_H | ||
15 | #define __MACH_UNCOMPRESS_H | ||
16 | |||
17 | #include <plat/uncompress.h> | ||
18 | |||
19 | #endif /* __MACH_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/vmalloc.h b/arch/arm/mach-spear3xx/include/mach/vmalloc.h new file mode 100644 index 000000000000..df977b3c9a63 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/vmalloc.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/include/mach/vmalloc.h | ||
3 | * | ||
4 | * Defining Vmalloc area for SPEAr3xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_VMALLOC_H | ||
15 | #define __MACH_VMALLOC_H | ||
16 | |||
17 | #include <plat/vmalloc.h> | ||
18 | |||
19 | #endif /* __MACH_VMALLOC_H */ | ||
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c new file mode 100644 index 000000000000..3560f8c1e723 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear300.c | |||
@@ -0,0 +1,468 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/spear300.c | ||
3 | * | ||
4 | * SPEAr300 machine source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/amba/pl061.h> | ||
16 | #include <linux/ptrace.h> | ||
17 | #include <asm/irq.h> | ||
18 | #include <mach/generic.h> | ||
19 | #include <mach/spear.h> | ||
20 | #include <plat/shirq.h> | ||
21 | |||
22 | /* pad multiplexing support */ | ||
23 | /* muxing registers */ | ||
24 | #define PAD_MUX_CONFIG_REG 0x00 | ||
25 | #define MODE_CONFIG_REG 0x04 | ||
26 | |||
27 | /* modes */ | ||
28 | #define NAND_MODE (1 << 0) | ||
29 | #define NOR_MODE (1 << 1) | ||
30 | #define PHOTO_FRAME_MODE (1 << 2) | ||
31 | #define LEND_IP_PHONE_MODE (1 << 3) | ||
32 | #define HEND_IP_PHONE_MODE (1 << 4) | ||
33 | #define LEND_WIFI_PHONE_MODE (1 << 5) | ||
34 | #define HEND_WIFI_PHONE_MODE (1 << 6) | ||
35 | #define ATA_PABX_WI2S_MODE (1 << 7) | ||
36 | #define ATA_PABX_I2S_MODE (1 << 8) | ||
37 | #define CAML_LCDW_MODE (1 << 9) | ||
38 | #define CAMU_LCD_MODE (1 << 10) | ||
39 | #define CAMU_WLCD_MODE (1 << 11) | ||
40 | #define CAML_LCD_MODE (1 << 12) | ||
41 | #define ALL_MODES 0x1FFF | ||
42 | |||
43 | struct pmx_mode nand_mode = { | ||
44 | .id = NAND_MODE, | ||
45 | .name = "nand mode", | ||
46 | .mask = 0x00, | ||
47 | }; | ||
48 | |||
49 | struct pmx_mode nor_mode = { | ||
50 | .id = NOR_MODE, | ||
51 | .name = "nor mode", | ||
52 | .mask = 0x01, | ||
53 | }; | ||
54 | |||
55 | struct pmx_mode photo_frame_mode = { | ||
56 | .id = PHOTO_FRAME_MODE, | ||
57 | .name = "photo frame mode", | ||
58 | .mask = 0x02, | ||
59 | }; | ||
60 | |||
61 | struct pmx_mode lend_ip_phone_mode = { | ||
62 | .id = LEND_IP_PHONE_MODE, | ||
63 | .name = "lend ip phone mode", | ||
64 | .mask = 0x03, | ||
65 | }; | ||
66 | |||
67 | struct pmx_mode hend_ip_phone_mode = { | ||
68 | .id = HEND_IP_PHONE_MODE, | ||
69 | .name = "hend ip phone mode", | ||
70 | .mask = 0x04, | ||
71 | }; | ||
72 | |||
73 | struct pmx_mode lend_wifi_phone_mode = { | ||
74 | .id = LEND_WIFI_PHONE_MODE, | ||
75 | .name = "lend wifi phone mode", | ||
76 | .mask = 0x05, | ||
77 | }; | ||
78 | |||
79 | struct pmx_mode hend_wifi_phone_mode = { | ||
80 | .id = HEND_WIFI_PHONE_MODE, | ||
81 | .name = "hend wifi phone mode", | ||
82 | .mask = 0x06, | ||
83 | }; | ||
84 | |||
85 | struct pmx_mode ata_pabx_wi2s_mode = { | ||
86 | .id = ATA_PABX_WI2S_MODE, | ||
87 | .name = "ata pabx wi2s mode", | ||
88 | .mask = 0x07, | ||
89 | }; | ||
90 | |||
91 | struct pmx_mode ata_pabx_i2s_mode = { | ||
92 | .id = ATA_PABX_I2S_MODE, | ||
93 | .name = "ata pabx i2s mode", | ||
94 | .mask = 0x08, | ||
95 | }; | ||
96 | |||
97 | struct pmx_mode caml_lcdw_mode = { | ||
98 | .id = CAML_LCDW_MODE, | ||
99 | .name = "caml lcdw mode", | ||
100 | .mask = 0x0C, | ||
101 | }; | ||
102 | |||
103 | struct pmx_mode camu_lcd_mode = { | ||
104 | .id = CAMU_LCD_MODE, | ||
105 | .name = "camu lcd mode", | ||
106 | .mask = 0x0D, | ||
107 | }; | ||
108 | |||
109 | struct pmx_mode camu_wlcd_mode = { | ||
110 | .id = CAMU_WLCD_MODE, | ||
111 | .name = "camu wlcd mode", | ||
112 | .mask = 0x0E, | ||
113 | }; | ||
114 | |||
115 | struct pmx_mode caml_lcd_mode = { | ||
116 | .id = CAML_LCD_MODE, | ||
117 | .name = "caml lcd mode", | ||
118 | .mask = 0x0F, | ||
119 | }; | ||
120 | |||
121 | /* devices */ | ||
122 | struct pmx_dev_mode pmx_fsmc_2_chips_modes[] = { | ||
123 | { | ||
124 | .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE | | ||
125 | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE, | ||
126 | .mask = PMX_FIRDA_MASK, | ||
127 | }, | ||
128 | }; | ||
129 | |||
130 | struct pmx_dev pmx_fsmc_2_chips = { | ||
131 | .name = "fsmc_2_chips", | ||
132 | .modes = pmx_fsmc_2_chips_modes, | ||
133 | .mode_count = ARRAY_SIZE(pmx_fsmc_2_chips_modes), | ||
134 | .enb_on_reset = 1, | ||
135 | }; | ||
136 | |||
137 | struct pmx_dev_mode pmx_fsmc_4_chips_modes[] = { | ||
138 | { | ||
139 | .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE | | ||
140 | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE, | ||
141 | .mask = PMX_FIRDA_MASK | PMX_UART0_MASK, | ||
142 | }, | ||
143 | }; | ||
144 | |||
145 | struct pmx_dev pmx_fsmc_4_chips = { | ||
146 | .name = "fsmc_4_chips", | ||
147 | .modes = pmx_fsmc_4_chips_modes, | ||
148 | .mode_count = ARRAY_SIZE(pmx_fsmc_4_chips_modes), | ||
149 | .enb_on_reset = 1, | ||
150 | }; | ||
151 | |||
152 | struct pmx_dev_mode pmx_keyboard_modes[] = { | ||
153 | { | ||
154 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | | ||
155 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | | ||
156 | CAML_LCDW_MODE | CAMU_LCD_MODE | CAMU_WLCD_MODE | | ||
157 | CAML_LCD_MODE, | ||
158 | .mask = 0x0, | ||
159 | }, | ||
160 | }; | ||
161 | |||
162 | struct pmx_dev pmx_keyboard = { | ||
163 | .name = "keyboard", | ||
164 | .modes = pmx_keyboard_modes, | ||
165 | .mode_count = ARRAY_SIZE(pmx_keyboard_modes), | ||
166 | .enb_on_reset = 1, | ||
167 | }; | ||
168 | |||
169 | struct pmx_dev_mode pmx_clcd_modes[] = { | ||
170 | { | ||
171 | .ids = PHOTO_FRAME_MODE, | ||
172 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK , | ||
173 | }, { | ||
174 | .ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE | | ||
175 | CAMU_LCD_MODE | CAML_LCD_MODE, | ||
176 | .mask = PMX_TIMER_3_4_MASK, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | struct pmx_dev pmx_clcd = { | ||
181 | .name = "clcd", | ||
182 | .modes = pmx_clcd_modes, | ||
183 | .mode_count = ARRAY_SIZE(pmx_clcd_modes), | ||
184 | .enb_on_reset = 1, | ||
185 | }; | ||
186 | |||
187 | struct pmx_dev_mode pmx_telecom_gpio_modes[] = { | ||
188 | { | ||
189 | .ids = PHOTO_FRAME_MODE | CAMU_LCD_MODE | CAML_LCD_MODE, | ||
190 | .mask = PMX_MII_MASK, | ||
191 | }, { | ||
192 | .ids = LEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE, | ||
193 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, | ||
194 | }, { | ||
195 | .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_WLCD_MODE, | ||
196 | .mask = PMX_MII_MASK | PMX_TIMER_3_4_MASK, | ||
197 | }, { | ||
198 | .ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE, | ||
199 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK, | ||
200 | }, { | ||
201 | .ids = ATA_PABX_WI2S_MODE, | ||
202 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | ||
203 | | PMX_UART0_MODEM_MASK, | ||
204 | }, | ||
205 | }; | ||
206 | |||
207 | struct pmx_dev pmx_telecom_gpio = { | ||
208 | .name = "telecom_gpio", | ||
209 | .modes = pmx_telecom_gpio_modes, | ||
210 | .mode_count = ARRAY_SIZE(pmx_telecom_gpio_modes), | ||
211 | .enb_on_reset = 1, | ||
212 | }; | ||
213 | |||
214 | struct pmx_dev_mode pmx_telecom_tdm_modes[] = { | ||
215 | { | ||
216 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | | ||
217 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | ||
218 | | HEND_WIFI_PHONE_MODE | ATA_PABX_WI2S_MODE | ||
219 | | ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | ||
220 | | CAMU_WLCD_MODE | CAML_LCD_MODE, | ||
221 | .mask = PMX_UART0_MODEM_MASK | PMX_SSP_CS_MASK, | ||
222 | }, | ||
223 | }; | ||
224 | |||
225 | struct pmx_dev pmx_telecom_tdm = { | ||
226 | .name = "telecom_tdm", | ||
227 | .modes = pmx_telecom_tdm_modes, | ||
228 | .mode_count = ARRAY_SIZE(pmx_telecom_tdm_modes), | ||
229 | .enb_on_reset = 1, | ||
230 | }; | ||
231 | |||
232 | struct pmx_dev_mode pmx_telecom_spi_cs_i2c_clk_modes[] = { | ||
233 | { | ||
234 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | | ||
235 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | ||
236 | | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE | | ||
237 | CAML_LCDW_MODE | CAML_LCD_MODE, | ||
238 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, | ||
239 | }, | ||
240 | }; | ||
241 | |||
242 | struct pmx_dev pmx_telecom_spi_cs_i2c_clk = { | ||
243 | .name = "telecom_spi_cs_i2c_clk", | ||
244 | .modes = pmx_telecom_spi_cs_i2c_clk_modes, | ||
245 | .mode_count = ARRAY_SIZE(pmx_telecom_spi_cs_i2c_clk_modes), | ||
246 | .enb_on_reset = 1, | ||
247 | }; | ||
248 | |||
249 | struct pmx_dev_mode pmx_telecom_camera_modes[] = { | ||
250 | { | ||
251 | .ids = CAML_LCDW_MODE | CAML_LCD_MODE, | ||
252 | .mask = PMX_MII_MASK, | ||
253 | }, { | ||
254 | .ids = CAMU_LCD_MODE | CAMU_WLCD_MODE, | ||
255 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | PMX_MII_MASK, | ||
256 | }, | ||
257 | }; | ||
258 | |||
259 | struct pmx_dev pmx_telecom_camera = { | ||
260 | .name = "telecom_camera", | ||
261 | .modes = pmx_telecom_camera_modes, | ||
262 | .mode_count = ARRAY_SIZE(pmx_telecom_camera_modes), | ||
263 | .enb_on_reset = 1, | ||
264 | }; | ||
265 | |||
266 | struct pmx_dev_mode pmx_telecom_dac_modes[] = { | ||
267 | { | ||
268 | .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | ||
269 | | CAMU_WLCD_MODE | CAML_LCD_MODE, | ||
270 | .mask = PMX_TIMER_1_2_MASK, | ||
271 | }, | ||
272 | }; | ||
273 | |||
274 | struct pmx_dev pmx_telecom_dac = { | ||
275 | .name = "telecom_dac", | ||
276 | .modes = pmx_telecom_dac_modes, | ||
277 | .mode_count = ARRAY_SIZE(pmx_telecom_dac_modes), | ||
278 | .enb_on_reset = 1, | ||
279 | }; | ||
280 | |||
281 | struct pmx_dev_mode pmx_telecom_i2s_modes[] = { | ||
282 | { | ||
283 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | ||
284 | | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | | ||
285 | ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | ||
286 | | CAMU_WLCD_MODE | CAML_LCD_MODE, | ||
287 | .mask = PMX_UART0_MODEM_MASK, | ||
288 | }, | ||
289 | }; | ||
290 | |||
291 | struct pmx_dev pmx_telecom_i2s = { | ||
292 | .name = "telecom_i2s", | ||
293 | .modes = pmx_telecom_i2s_modes, | ||
294 | .mode_count = ARRAY_SIZE(pmx_telecom_i2s_modes), | ||
295 | .enb_on_reset = 1, | ||
296 | }; | ||
297 | |||
298 | struct pmx_dev_mode pmx_telecom_boot_pins_modes[] = { | ||
299 | { | ||
300 | .ids = NAND_MODE | NOR_MODE, | ||
301 | .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK | | ||
302 | PMX_TIMER_3_4_MASK, | ||
303 | }, | ||
304 | }; | ||
305 | |||
306 | struct pmx_dev pmx_telecom_boot_pins = { | ||
307 | .name = "telecom_boot_pins", | ||
308 | .modes = pmx_telecom_boot_pins_modes, | ||
309 | .mode_count = ARRAY_SIZE(pmx_telecom_boot_pins_modes), | ||
310 | .enb_on_reset = 1, | ||
311 | }; | ||
312 | |||
313 | struct pmx_dev_mode pmx_telecom_sdio_4bit_modes[] = { | ||
314 | { | ||
315 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | | ||
316 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | | ||
317 | HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | | ||
318 | CAMU_WLCD_MODE | CAML_LCD_MODE | ATA_PABX_WI2S_MODE | | ||
319 | ATA_PABX_I2S_MODE, | ||
320 | .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK | | ||
321 | PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | | ||
322 | PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK, | ||
323 | }, | ||
324 | }; | ||
325 | |||
326 | struct pmx_dev pmx_telecom_sdio_4bit = { | ||
327 | .name = "telecom_sdio_4bit", | ||
328 | .modes = pmx_telecom_sdio_4bit_modes, | ||
329 | .mode_count = ARRAY_SIZE(pmx_telecom_sdio_4bit_modes), | ||
330 | .enb_on_reset = 1, | ||
331 | }; | ||
332 | |||
333 | struct pmx_dev_mode pmx_telecom_sdio_8bit_modes[] = { | ||
334 | { | ||
335 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | | ||
336 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | | ||
337 | HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | | ||
338 | CAMU_WLCD_MODE | CAML_LCD_MODE, | ||
339 | .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK | | ||
340 | PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | | ||
341 | PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK | PMX_MII_MASK, | ||
342 | }, | ||
343 | }; | ||
344 | |||
345 | struct pmx_dev pmx_telecom_sdio_8bit = { | ||
346 | .name = "telecom_sdio_8bit", | ||
347 | .modes = pmx_telecom_sdio_8bit_modes, | ||
348 | .mode_count = ARRAY_SIZE(pmx_telecom_sdio_8bit_modes), | ||
349 | .enb_on_reset = 1, | ||
350 | }; | ||
351 | |||
352 | struct pmx_dev_mode pmx_gpio1_modes[] = { | ||
353 | { | ||
354 | .ids = PHOTO_FRAME_MODE, | ||
355 | .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK | | ||
356 | PMX_TIMER_3_4_MASK, | ||
357 | }, | ||
358 | }; | ||
359 | |||
360 | struct pmx_dev pmx_gpio1 = { | ||
361 | .name = "arm gpio1", | ||
362 | .modes = pmx_gpio1_modes, | ||
363 | .mode_count = ARRAY_SIZE(pmx_gpio1_modes), | ||
364 | .enb_on_reset = 1, | ||
365 | }; | ||
366 | |||
367 | /* pmx driver structure */ | ||
368 | struct pmx_driver pmx_driver = { | ||
369 | .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x0000000f}, | ||
370 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, | ||
371 | }; | ||
372 | |||
373 | /* Add spear300 specific devices here */ | ||
374 | /* arm gpio1 device registeration */ | ||
375 | static struct pl061_platform_data gpio1_plat_data = { | ||
376 | .gpio_base = 8, | ||
377 | .irq_base = SPEAR_GPIO1_INT_BASE, | ||
378 | }; | ||
379 | |||
380 | struct amba_device gpio1_device = { | ||
381 | .dev = { | ||
382 | .init_name = "gpio1", | ||
383 | .platform_data = &gpio1_plat_data, | ||
384 | }, | ||
385 | .res = { | ||
386 | .start = SPEAR300_GPIO_BASE, | ||
387 | .end = SPEAR300_GPIO_BASE + SPEAR300_GPIO_SIZE - 1, | ||
388 | .flags = IORESOURCE_MEM, | ||
389 | }, | ||
390 | .irq = {VIRQ_GPIO1, NO_IRQ}, | ||
391 | }; | ||
392 | |||
393 | /* spear3xx shared irq */ | ||
394 | struct shirq_dev_config shirq_ras1_config[] = { | ||
395 | { | ||
396 | .virq = VIRQ_IT_PERS_S, | ||
397 | .enb_mask = IT_PERS_S_IRQ_MASK, | ||
398 | .status_mask = IT_PERS_S_IRQ_MASK, | ||
399 | }, { | ||
400 | .virq = VIRQ_IT_CHANGE_S, | ||
401 | .enb_mask = IT_CHANGE_S_IRQ_MASK, | ||
402 | .status_mask = IT_CHANGE_S_IRQ_MASK, | ||
403 | }, { | ||
404 | .virq = VIRQ_I2S, | ||
405 | .enb_mask = I2S_IRQ_MASK, | ||
406 | .status_mask = I2S_IRQ_MASK, | ||
407 | }, { | ||
408 | .virq = VIRQ_TDM, | ||
409 | .enb_mask = TDM_IRQ_MASK, | ||
410 | .status_mask = TDM_IRQ_MASK, | ||
411 | }, { | ||
412 | .virq = VIRQ_CAMERA_L, | ||
413 | .enb_mask = CAMERA_L_IRQ_MASK, | ||
414 | .status_mask = CAMERA_L_IRQ_MASK, | ||
415 | }, { | ||
416 | .virq = VIRQ_CAMERA_F, | ||
417 | .enb_mask = CAMERA_F_IRQ_MASK, | ||
418 | .status_mask = CAMERA_F_IRQ_MASK, | ||
419 | }, { | ||
420 | .virq = VIRQ_CAMERA_V, | ||
421 | .enb_mask = CAMERA_V_IRQ_MASK, | ||
422 | .status_mask = CAMERA_V_IRQ_MASK, | ||
423 | }, { | ||
424 | .virq = VIRQ_KEYBOARD, | ||
425 | .enb_mask = KEYBOARD_IRQ_MASK, | ||
426 | .status_mask = KEYBOARD_IRQ_MASK, | ||
427 | }, { | ||
428 | .virq = VIRQ_GPIO1, | ||
429 | .enb_mask = GPIO1_IRQ_MASK, | ||
430 | .status_mask = GPIO1_IRQ_MASK, | ||
431 | }, | ||
432 | }; | ||
433 | |||
434 | struct spear_shirq shirq_ras1 = { | ||
435 | .irq = IRQ_GEN_RAS_1, | ||
436 | .dev_config = shirq_ras1_config, | ||
437 | .dev_count = ARRAY_SIZE(shirq_ras1_config), | ||
438 | .regs = { | ||
439 | .enb_reg = INT_ENB_MASK_REG, | ||
440 | .status_reg = INT_STS_MASK_REG, | ||
441 | .status_reg_mask = SHIRQ_RAS1_MASK, | ||
442 | .clear_reg = -1, | ||
443 | }, | ||
444 | }; | ||
445 | |||
446 | /* spear300 routines */ | ||
447 | void __init spear300_init(void) | ||
448 | { | ||
449 | int ret = 0; | ||
450 | |||
451 | /* call spear3xx family common init function */ | ||
452 | spear3xx_init(); | ||
453 | |||
454 | /* shared irq registeration */ | ||
455 | shirq_ras1.regs.base = | ||
456 | ioremap(SPEAR300_TELECOM_BASE, SPEAR300_TELECOM_REG_SIZE); | ||
457 | if (shirq_ras1.regs.base) { | ||
458 | ret = spear_shirq_register(&shirq_ras1); | ||
459 | if (ret) | ||
460 | printk(KERN_ERR "Error registering Shared IRQ\n"); | ||
461 | } | ||
462 | } | ||
463 | |||
464 | void spear300_pmx_init(void) | ||
465 | { | ||
466 | spear_pmx_init(&pmx_driver, SPEAR300_SOC_CONFIG_BASE, | ||
467 | SPEAR300_SOC_CONFIG_SIZE); | ||
468 | } | ||
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c new file mode 100644 index 000000000000..bb21db152a23 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear300_evb.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/spear300_evb.c | ||
3 | * | ||
4 | * SPEAr300 evaluation board source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <asm/mach/arch.h> | ||
15 | #include <asm/mach-types.h> | ||
16 | #include <mach/generic.h> | ||
17 | #include <mach/spear.h> | ||
18 | |||
19 | /* padmux devices to enable */ | ||
20 | static struct pmx_dev *pmx_devs[] = { | ||
21 | /* spear3xx specific devices */ | ||
22 | &pmx_i2c, | ||
23 | &pmx_ssp_cs, | ||
24 | &pmx_ssp, | ||
25 | &pmx_mii, | ||
26 | &pmx_uart0, | ||
27 | |||
28 | /* spear300 specific devices */ | ||
29 | &pmx_fsmc_2_chips, | ||
30 | &pmx_clcd, | ||
31 | &pmx_telecom_sdio_4bit, | ||
32 | &pmx_gpio1, | ||
33 | }; | ||
34 | |||
35 | static struct amba_device *amba_devs[] __initdata = { | ||
36 | /* spear3xx specific devices */ | ||
37 | &gpio_device, | ||
38 | &uart_device, | ||
39 | |||
40 | /* spear300 specific devices */ | ||
41 | &gpio1_device, | ||
42 | }; | ||
43 | |||
44 | static struct platform_device *plat_devs[] __initdata = { | ||
45 | /* spear3xx specific devices */ | ||
46 | |||
47 | /* spear300 specific devices */ | ||
48 | }; | ||
49 | |||
50 | static void __init spear300_evb_init(void) | ||
51 | { | ||
52 | unsigned int i; | ||
53 | |||
54 | /* call spear300 machine init function */ | ||
55 | spear300_init(); | ||
56 | |||
57 | /* padmux initialization */ | ||
58 | pmx_driver.mode = &photo_frame_mode; | ||
59 | pmx_driver.devs = pmx_devs; | ||
60 | pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); | ||
61 | spear300_pmx_init(); | ||
62 | |||
63 | /* Add Platform Devices */ | ||
64 | platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); | ||
65 | |||
66 | /* Add Amba Devices */ | ||
67 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
68 | amba_device_register(amba_devs[i], &iomem_resource); | ||
69 | } | ||
70 | |||
71 | MACHINE_START(SPEAR300, "ST-SPEAR300-EVB") | ||
72 | .boot_params = 0x00000100, | ||
73 | .map_io = spear3xx_map_io, | ||
74 | .init_irq = spear3xx_init_irq, | ||
75 | .timer = &spear_sys_timer, | ||
76 | .init_machine = spear300_evb_init, | ||
77 | MACHINE_END | ||
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c new file mode 100644 index 000000000000..96a1ab824bac --- /dev/null +++ b/arch/arm/mach-spear3xx/spear310.c | |||
@@ -0,0 +1,302 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/spear310.c | ||
3 | * | ||
4 | * SPEAr310 machine source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/ptrace.h> | ||
15 | #include <asm/irq.h> | ||
16 | #include <mach/generic.h> | ||
17 | #include <mach/spear.h> | ||
18 | #include <plat/shirq.h> | ||
19 | |||
20 | /* pad multiplexing support */ | ||
21 | /* muxing registers */ | ||
22 | #define PAD_MUX_CONFIG_REG 0x08 | ||
23 | |||
24 | /* devices */ | ||
25 | struct pmx_dev_mode pmx_emi_cs_0_1_4_5_modes[] = { | ||
26 | { | ||
27 | .ids = 0x00, | ||
28 | .mask = PMX_TIMER_3_4_MASK, | ||
29 | }, | ||
30 | }; | ||
31 | |||
32 | struct pmx_dev pmx_emi_cs_0_1_4_5 = { | ||
33 | .name = "emi_cs_0_1_4_5", | ||
34 | .modes = pmx_emi_cs_0_1_4_5_modes, | ||
35 | .mode_count = ARRAY_SIZE(pmx_emi_cs_0_1_4_5_modes), | ||
36 | .enb_on_reset = 1, | ||
37 | }; | ||
38 | |||
39 | struct pmx_dev_mode pmx_emi_cs_2_3_modes[] = { | ||
40 | { | ||
41 | .ids = 0x00, | ||
42 | .mask = PMX_TIMER_1_2_MASK, | ||
43 | }, | ||
44 | }; | ||
45 | |||
46 | struct pmx_dev pmx_emi_cs_2_3 = { | ||
47 | .name = "emi_cs_2_3", | ||
48 | .modes = pmx_emi_cs_2_3_modes, | ||
49 | .mode_count = ARRAY_SIZE(pmx_emi_cs_2_3_modes), | ||
50 | .enb_on_reset = 1, | ||
51 | }; | ||
52 | |||
53 | struct pmx_dev_mode pmx_uart1_modes[] = { | ||
54 | { | ||
55 | .ids = 0x00, | ||
56 | .mask = PMX_FIRDA_MASK, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | struct pmx_dev pmx_uart1 = { | ||
61 | .name = "uart1", | ||
62 | .modes = pmx_uart1_modes, | ||
63 | .mode_count = ARRAY_SIZE(pmx_uart1_modes), | ||
64 | .enb_on_reset = 1, | ||
65 | }; | ||
66 | |||
67 | struct pmx_dev_mode pmx_uart2_modes[] = { | ||
68 | { | ||
69 | .ids = 0x00, | ||
70 | .mask = PMX_TIMER_1_2_MASK, | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | struct pmx_dev pmx_uart2 = { | ||
75 | .name = "uart2", | ||
76 | .modes = pmx_uart2_modes, | ||
77 | .mode_count = ARRAY_SIZE(pmx_uart2_modes), | ||
78 | .enb_on_reset = 1, | ||
79 | }; | ||
80 | |||
81 | struct pmx_dev_mode pmx_uart3_4_5_modes[] = { | ||
82 | { | ||
83 | .ids = 0x00, | ||
84 | .mask = PMX_UART0_MODEM_MASK, | ||
85 | }, | ||
86 | }; | ||
87 | |||
88 | struct pmx_dev pmx_uart3_4_5 = { | ||
89 | .name = "uart3_4_5", | ||
90 | .modes = pmx_uart3_4_5_modes, | ||
91 | .mode_count = ARRAY_SIZE(pmx_uart3_4_5_modes), | ||
92 | .enb_on_reset = 1, | ||
93 | }; | ||
94 | |||
95 | struct pmx_dev_mode pmx_fsmc_modes[] = { | ||
96 | { | ||
97 | .ids = 0x00, | ||
98 | .mask = PMX_SSP_CS_MASK, | ||
99 | }, | ||
100 | }; | ||
101 | |||
102 | struct pmx_dev pmx_fsmc = { | ||
103 | .name = "fsmc", | ||
104 | .modes = pmx_fsmc_modes, | ||
105 | .mode_count = ARRAY_SIZE(pmx_fsmc_modes), | ||
106 | .enb_on_reset = 1, | ||
107 | }; | ||
108 | |||
109 | struct pmx_dev_mode pmx_rs485_0_1_modes[] = { | ||
110 | { | ||
111 | .ids = 0x00, | ||
112 | .mask = PMX_MII_MASK, | ||
113 | }, | ||
114 | }; | ||
115 | |||
116 | struct pmx_dev pmx_rs485_0_1 = { | ||
117 | .name = "rs485_0_1", | ||
118 | .modes = pmx_rs485_0_1_modes, | ||
119 | .mode_count = ARRAY_SIZE(pmx_rs485_0_1_modes), | ||
120 | .enb_on_reset = 1, | ||
121 | }; | ||
122 | |||
123 | struct pmx_dev_mode pmx_tdm0_modes[] = { | ||
124 | { | ||
125 | .ids = 0x00, | ||
126 | .mask = PMX_MII_MASK, | ||
127 | }, | ||
128 | }; | ||
129 | |||
130 | struct pmx_dev pmx_tdm0 = { | ||
131 | .name = "tdm0", | ||
132 | .modes = pmx_tdm0_modes, | ||
133 | .mode_count = ARRAY_SIZE(pmx_tdm0_modes), | ||
134 | .enb_on_reset = 1, | ||
135 | }; | ||
136 | |||
137 | /* pmx driver structure */ | ||
138 | struct pmx_driver pmx_driver = { | ||
139 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, | ||
140 | }; | ||
141 | |||
142 | /* Add spear310 specific devices here */ | ||
143 | |||
144 | /* spear3xx shared irq */ | ||
145 | struct shirq_dev_config shirq_ras1_config[] = { | ||
146 | { | ||
147 | .virq = VIRQ_SMII0, | ||
148 | .status_mask = SMII0_IRQ_MASK, | ||
149 | }, { | ||
150 | .virq = VIRQ_SMII1, | ||
151 | .status_mask = SMII1_IRQ_MASK, | ||
152 | }, { | ||
153 | .virq = VIRQ_SMII2, | ||
154 | .status_mask = SMII2_IRQ_MASK, | ||
155 | }, { | ||
156 | .virq = VIRQ_SMII3, | ||
157 | .status_mask = SMII3_IRQ_MASK, | ||
158 | }, { | ||
159 | .virq = VIRQ_WAKEUP_SMII0, | ||
160 | .status_mask = WAKEUP_SMII0_IRQ_MASK, | ||
161 | }, { | ||
162 | .virq = VIRQ_WAKEUP_SMII1, | ||
163 | .status_mask = WAKEUP_SMII1_IRQ_MASK, | ||
164 | }, { | ||
165 | .virq = VIRQ_WAKEUP_SMII2, | ||
166 | .status_mask = WAKEUP_SMII2_IRQ_MASK, | ||
167 | }, { | ||
168 | .virq = VIRQ_WAKEUP_SMII3, | ||
169 | .status_mask = WAKEUP_SMII3_IRQ_MASK, | ||
170 | }, | ||
171 | }; | ||
172 | |||
173 | struct spear_shirq shirq_ras1 = { | ||
174 | .irq = IRQ_GEN_RAS_1, | ||
175 | .dev_config = shirq_ras1_config, | ||
176 | .dev_count = ARRAY_SIZE(shirq_ras1_config), | ||
177 | .regs = { | ||
178 | .enb_reg = -1, | ||
179 | .status_reg = INT_STS_MASK_REG, | ||
180 | .status_reg_mask = SHIRQ_RAS1_MASK, | ||
181 | .clear_reg = -1, | ||
182 | }, | ||
183 | }; | ||
184 | |||
185 | struct shirq_dev_config shirq_ras2_config[] = { | ||
186 | { | ||
187 | .virq = VIRQ_UART1, | ||
188 | .status_mask = UART1_IRQ_MASK, | ||
189 | }, { | ||
190 | .virq = VIRQ_UART2, | ||
191 | .status_mask = UART2_IRQ_MASK, | ||
192 | }, { | ||
193 | .virq = VIRQ_UART3, | ||
194 | .status_mask = UART3_IRQ_MASK, | ||
195 | }, { | ||
196 | .virq = VIRQ_UART4, | ||
197 | .status_mask = UART4_IRQ_MASK, | ||
198 | }, { | ||
199 | .virq = VIRQ_UART5, | ||
200 | .status_mask = UART5_IRQ_MASK, | ||
201 | }, | ||
202 | }; | ||
203 | |||
204 | struct spear_shirq shirq_ras2 = { | ||
205 | .irq = IRQ_GEN_RAS_2, | ||
206 | .dev_config = shirq_ras2_config, | ||
207 | .dev_count = ARRAY_SIZE(shirq_ras2_config), | ||
208 | .regs = { | ||
209 | .enb_reg = -1, | ||
210 | .status_reg = INT_STS_MASK_REG, | ||
211 | .status_reg_mask = SHIRQ_RAS2_MASK, | ||
212 | .clear_reg = -1, | ||
213 | }, | ||
214 | }; | ||
215 | |||
216 | struct shirq_dev_config shirq_ras3_config[] = { | ||
217 | { | ||
218 | .virq = VIRQ_EMI, | ||
219 | .status_mask = EMI_IRQ_MASK, | ||
220 | }, | ||
221 | }; | ||
222 | |||
223 | struct spear_shirq shirq_ras3 = { | ||
224 | .irq = IRQ_GEN_RAS_3, | ||
225 | .dev_config = shirq_ras3_config, | ||
226 | .dev_count = ARRAY_SIZE(shirq_ras3_config), | ||
227 | .regs = { | ||
228 | .enb_reg = -1, | ||
229 | .status_reg = INT_STS_MASK_REG, | ||
230 | .status_reg_mask = SHIRQ_RAS3_MASK, | ||
231 | .clear_reg = -1, | ||
232 | }, | ||
233 | }; | ||
234 | |||
235 | struct shirq_dev_config shirq_intrcomm_ras_config[] = { | ||
236 | { | ||
237 | .virq = VIRQ_TDM_HDLC, | ||
238 | .status_mask = TDM_HDLC_IRQ_MASK, | ||
239 | }, { | ||
240 | .virq = VIRQ_RS485_0, | ||
241 | .status_mask = RS485_0_IRQ_MASK, | ||
242 | }, { | ||
243 | .virq = VIRQ_RS485_1, | ||
244 | .status_mask = RS485_1_IRQ_MASK, | ||
245 | }, | ||
246 | }; | ||
247 | |||
248 | struct spear_shirq shirq_intrcomm_ras = { | ||
249 | .irq = IRQ_INTRCOMM_RAS_ARM, | ||
250 | .dev_config = shirq_intrcomm_ras_config, | ||
251 | .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config), | ||
252 | .regs = { | ||
253 | .enb_reg = -1, | ||
254 | .status_reg = INT_STS_MASK_REG, | ||
255 | .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK, | ||
256 | .clear_reg = -1, | ||
257 | }, | ||
258 | }; | ||
259 | |||
260 | /* spear310 routines */ | ||
261 | void __init spear310_init(void) | ||
262 | { | ||
263 | void __iomem *base; | ||
264 | int ret = 0; | ||
265 | |||
266 | /* call spear3xx family common init function */ | ||
267 | spear3xx_init(); | ||
268 | |||
269 | /* shared irq registeration */ | ||
270 | base = ioremap(SPEAR310_SOC_CONFIG_BASE, SPEAR310_SOC_CONFIG_SIZE); | ||
271 | if (base) { | ||
272 | /* shirq 1 */ | ||
273 | shirq_ras1.regs.base = base; | ||
274 | ret = spear_shirq_register(&shirq_ras1); | ||
275 | if (ret) | ||
276 | printk(KERN_ERR "Error registering Shared IRQ 1\n"); | ||
277 | |||
278 | /* shirq 2 */ | ||
279 | shirq_ras2.regs.base = base; | ||
280 | ret = spear_shirq_register(&shirq_ras2); | ||
281 | if (ret) | ||
282 | printk(KERN_ERR "Error registering Shared IRQ 2\n"); | ||
283 | |||
284 | /* shirq 3 */ | ||
285 | shirq_ras3.regs.base = base; | ||
286 | ret = spear_shirq_register(&shirq_ras3); | ||
287 | if (ret) | ||
288 | printk(KERN_ERR "Error registering Shared IRQ 3\n"); | ||
289 | |||
290 | /* shirq 4 */ | ||
291 | shirq_intrcomm_ras.regs.base = base; | ||
292 | ret = spear_shirq_register(&shirq_intrcomm_ras); | ||
293 | if (ret) | ||
294 | printk(KERN_ERR "Error registering Shared IRQ 4\n"); | ||
295 | } | ||
296 | } | ||
297 | |||
298 | void spear310_pmx_init(void) | ||
299 | { | ||
300 | spear_pmx_init(&pmx_driver, SPEAR310_SOC_CONFIG_BASE, | ||
301 | SPEAR310_SOC_CONFIG_SIZE); | ||
302 | } | ||
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c new file mode 100644 index 000000000000..7facf6643199 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear310_evb.c | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/spear310_evb.c | ||
3 | * | ||
4 | * SPEAr310 evaluation board source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <asm/mach/arch.h> | ||
15 | #include <asm/mach-types.h> | ||
16 | #include <mach/generic.h> | ||
17 | #include <mach/spear.h> | ||
18 | |||
19 | /* padmux devices to enable */ | ||
20 | static struct pmx_dev *pmx_devs[] = { | ||
21 | /* spear3xx specific devices */ | ||
22 | &pmx_i2c, | ||
23 | &pmx_ssp, | ||
24 | &pmx_gpio_pin0, | ||
25 | &pmx_gpio_pin1, | ||
26 | &pmx_gpio_pin2, | ||
27 | &pmx_gpio_pin3, | ||
28 | &pmx_gpio_pin4, | ||
29 | &pmx_gpio_pin5, | ||
30 | &pmx_uart0, | ||
31 | |||
32 | /* spear310 specific devices */ | ||
33 | &pmx_emi_cs_0_1_4_5, | ||
34 | &pmx_emi_cs_2_3, | ||
35 | &pmx_uart1, | ||
36 | &pmx_uart2, | ||
37 | &pmx_uart3_4_5, | ||
38 | &pmx_fsmc, | ||
39 | &pmx_rs485_0_1, | ||
40 | &pmx_tdm0, | ||
41 | }; | ||
42 | |||
43 | static struct amba_device *amba_devs[] __initdata = { | ||
44 | /* spear3xx specific devices */ | ||
45 | &gpio_device, | ||
46 | &uart_device, | ||
47 | |||
48 | /* spear310 specific devices */ | ||
49 | }; | ||
50 | |||
51 | static struct platform_device *plat_devs[] __initdata = { | ||
52 | /* spear3xx specific devices */ | ||
53 | |||
54 | /* spear310 specific devices */ | ||
55 | }; | ||
56 | |||
57 | static void __init spear310_evb_init(void) | ||
58 | { | ||
59 | unsigned int i; | ||
60 | |||
61 | /* call spear310 machine init function */ | ||
62 | spear310_init(); | ||
63 | |||
64 | /* padmux initialization */ | ||
65 | pmx_driver.mode = NULL; | ||
66 | pmx_driver.devs = pmx_devs; | ||
67 | pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); | ||
68 | spear310_pmx_init(); | ||
69 | |||
70 | /* Add Platform Devices */ | ||
71 | platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); | ||
72 | |||
73 | /* Add Amba Devices */ | ||
74 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
75 | amba_device_register(amba_devs[i], &iomem_resource); | ||
76 | } | ||
77 | |||
78 | MACHINE_START(SPEAR310, "ST-SPEAR310-EVB") | ||
79 | .boot_params = 0x00000100, | ||
80 | .map_io = spear3xx_map_io, | ||
81 | .init_irq = spear3xx_init_irq, | ||
82 | .timer = &spear_sys_timer, | ||
83 | .init_machine = spear310_evb_init, | ||
84 | MACHINE_END | ||
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c new file mode 100644 index 000000000000..6a1219549369 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear320.c | |||
@@ -0,0 +1,549 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/spear320.c | ||
3 | * | ||
4 | * SPEAr320 machine source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/ptrace.h> | ||
15 | #include <asm/irq.h> | ||
16 | #include <mach/generic.h> | ||
17 | #include <mach/spear.h> | ||
18 | #include <plat/shirq.h> | ||
19 | |||
20 | /* pad multiplexing support */ | ||
21 | /* muxing registers */ | ||
22 | #define PAD_MUX_CONFIG_REG 0x0C | ||
23 | #define MODE_CONFIG_REG 0x10 | ||
24 | |||
25 | /* modes */ | ||
26 | #define AUTO_NET_SMII_MODE (1 << 0) | ||
27 | #define AUTO_NET_MII_MODE (1 << 1) | ||
28 | #define AUTO_EXP_MODE (1 << 2) | ||
29 | #define SMALL_PRINTERS_MODE (1 << 3) | ||
30 | #define ALL_MODES 0xF | ||
31 | |||
32 | struct pmx_mode auto_net_smii_mode = { | ||
33 | .id = AUTO_NET_SMII_MODE, | ||
34 | .name = "Automation Networking SMII Mode", | ||
35 | .mask = 0x00, | ||
36 | }; | ||
37 | |||
38 | struct pmx_mode auto_net_mii_mode = { | ||
39 | .id = AUTO_NET_MII_MODE, | ||
40 | .name = "Automation Networking MII Mode", | ||
41 | .mask = 0x01, | ||
42 | }; | ||
43 | |||
44 | struct pmx_mode auto_exp_mode = { | ||
45 | .id = AUTO_EXP_MODE, | ||
46 | .name = "Automation Expanded Mode", | ||
47 | .mask = 0x02, | ||
48 | }; | ||
49 | |||
50 | struct pmx_mode small_printers_mode = { | ||
51 | .id = SMALL_PRINTERS_MODE, | ||
52 | .name = "Small Printers Mode", | ||
53 | .mask = 0x03, | ||
54 | }; | ||
55 | |||
56 | /* devices */ | ||
57 | struct pmx_dev_mode pmx_clcd_modes[] = { | ||
58 | { | ||
59 | .ids = AUTO_NET_SMII_MODE, | ||
60 | .mask = 0x0, | ||
61 | }, | ||
62 | }; | ||
63 | |||
64 | struct pmx_dev pmx_clcd = { | ||
65 | .name = "clcd", | ||
66 | .modes = pmx_clcd_modes, | ||
67 | .mode_count = ARRAY_SIZE(pmx_clcd_modes), | ||
68 | .enb_on_reset = 1, | ||
69 | }; | ||
70 | |||
71 | struct pmx_dev_mode pmx_emi_modes[] = { | ||
72 | { | ||
73 | .ids = AUTO_EXP_MODE, | ||
74 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, | ||
75 | }, | ||
76 | }; | ||
77 | |||
78 | struct pmx_dev pmx_emi = { | ||
79 | .name = "emi", | ||
80 | .modes = pmx_emi_modes, | ||
81 | .mode_count = ARRAY_SIZE(pmx_emi_modes), | ||
82 | .enb_on_reset = 1, | ||
83 | }; | ||
84 | |||
85 | struct pmx_dev_mode pmx_fsmc_modes[] = { | ||
86 | { | ||
87 | .ids = ALL_MODES, | ||
88 | .mask = 0x0, | ||
89 | }, | ||
90 | }; | ||
91 | |||
92 | struct pmx_dev pmx_fsmc = { | ||
93 | .name = "fsmc", | ||
94 | .modes = pmx_fsmc_modes, | ||
95 | .mode_count = ARRAY_SIZE(pmx_fsmc_modes), | ||
96 | .enb_on_reset = 1, | ||
97 | }; | ||
98 | |||
99 | struct pmx_dev_mode pmx_spp_modes[] = { | ||
100 | { | ||
101 | .ids = SMALL_PRINTERS_MODE, | ||
102 | .mask = 0x0, | ||
103 | }, | ||
104 | }; | ||
105 | |||
106 | struct pmx_dev pmx_spp = { | ||
107 | .name = "spp", | ||
108 | .modes = pmx_spp_modes, | ||
109 | .mode_count = ARRAY_SIZE(pmx_spp_modes), | ||
110 | .enb_on_reset = 1, | ||
111 | }; | ||
112 | |||
113 | struct pmx_dev_mode pmx_sdio_modes[] = { | ||
114 | { | ||
115 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | | ||
116 | SMALL_PRINTERS_MODE, | ||
117 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | struct pmx_dev pmx_sdio = { | ||
122 | .name = "sdio", | ||
123 | .modes = pmx_sdio_modes, | ||
124 | .mode_count = ARRAY_SIZE(pmx_sdio_modes), | ||
125 | .enb_on_reset = 1, | ||
126 | }; | ||
127 | |||
128 | struct pmx_dev_mode pmx_i2s_modes[] = { | ||
129 | { | ||
130 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
131 | .mask = PMX_UART0_MODEM_MASK, | ||
132 | }, | ||
133 | }; | ||
134 | |||
135 | struct pmx_dev pmx_i2s = { | ||
136 | .name = "i2s", | ||
137 | .modes = pmx_i2s_modes, | ||
138 | .mode_count = ARRAY_SIZE(pmx_i2s_modes), | ||
139 | .enb_on_reset = 1, | ||
140 | }; | ||
141 | |||
142 | struct pmx_dev_mode pmx_uart1_modes[] = { | ||
143 | { | ||
144 | .ids = ALL_MODES, | ||
145 | .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK, | ||
146 | }, | ||
147 | }; | ||
148 | |||
149 | struct pmx_dev pmx_uart1 = { | ||
150 | .name = "uart1", | ||
151 | .modes = pmx_uart1_modes, | ||
152 | .mode_count = ARRAY_SIZE(pmx_uart1_modes), | ||
153 | .enb_on_reset = 1, | ||
154 | }; | ||
155 | |||
156 | struct pmx_dev_mode pmx_uart1_modem_modes[] = { | ||
157 | { | ||
158 | .ids = AUTO_EXP_MODE, | ||
159 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | | ||
160 | PMX_SSP_CS_MASK, | ||
161 | }, { | ||
162 | .ids = SMALL_PRINTERS_MODE, | ||
163 | .mask = PMX_GPIO_PIN3_MASK | PMX_GPIO_PIN4_MASK | | ||
164 | PMX_GPIO_PIN5_MASK | PMX_SSP_CS_MASK, | ||
165 | }, | ||
166 | }; | ||
167 | |||
168 | struct pmx_dev pmx_uart1_modem = { | ||
169 | .name = "uart1_modem", | ||
170 | .modes = pmx_uart1_modem_modes, | ||
171 | .mode_count = ARRAY_SIZE(pmx_uart1_modem_modes), | ||
172 | .enb_on_reset = 1, | ||
173 | }; | ||
174 | |||
175 | struct pmx_dev_mode pmx_uart2_modes[] = { | ||
176 | { | ||
177 | .ids = ALL_MODES, | ||
178 | .mask = PMX_FIRDA_MASK, | ||
179 | }, | ||
180 | }; | ||
181 | |||
182 | struct pmx_dev pmx_uart2 = { | ||
183 | .name = "uart2", | ||
184 | .modes = pmx_uart2_modes, | ||
185 | .mode_count = ARRAY_SIZE(pmx_uart2_modes), | ||
186 | .enb_on_reset = 1, | ||
187 | }; | ||
188 | |||
189 | struct pmx_dev_mode pmx_touchscreen_modes[] = { | ||
190 | { | ||
191 | .ids = AUTO_NET_SMII_MODE, | ||
192 | .mask = PMX_SSP_CS_MASK, | ||
193 | }, | ||
194 | }; | ||
195 | |||
196 | struct pmx_dev pmx_touchscreen = { | ||
197 | .name = "touchscreen", | ||
198 | .modes = pmx_touchscreen_modes, | ||
199 | .mode_count = ARRAY_SIZE(pmx_touchscreen_modes), | ||
200 | .enb_on_reset = 1, | ||
201 | }; | ||
202 | |||
203 | struct pmx_dev_mode pmx_can_modes[] = { | ||
204 | { | ||
205 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE, | ||
206 | .mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | | ||
207 | PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK, | ||
208 | }, | ||
209 | }; | ||
210 | |||
211 | struct pmx_dev pmx_can = { | ||
212 | .name = "can", | ||
213 | .modes = pmx_can_modes, | ||
214 | .mode_count = ARRAY_SIZE(pmx_can_modes), | ||
215 | .enb_on_reset = 1, | ||
216 | }; | ||
217 | |||
218 | struct pmx_dev_mode pmx_sdio_led_modes[] = { | ||
219 | { | ||
220 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
221 | .mask = PMX_SSP_CS_MASK, | ||
222 | }, | ||
223 | }; | ||
224 | |||
225 | struct pmx_dev pmx_sdio_led = { | ||
226 | .name = "sdio_led", | ||
227 | .modes = pmx_sdio_led_modes, | ||
228 | .mode_count = ARRAY_SIZE(pmx_sdio_led_modes), | ||
229 | .enb_on_reset = 1, | ||
230 | }; | ||
231 | |||
232 | struct pmx_dev_mode pmx_pwm0_modes[] = { | ||
233 | { | ||
234 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
235 | .mask = PMX_UART0_MODEM_MASK, | ||
236 | }, { | ||
237 | .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE, | ||
238 | .mask = PMX_MII_MASK, | ||
239 | }, | ||
240 | }; | ||
241 | |||
242 | struct pmx_dev pmx_pwm0 = { | ||
243 | .name = "pwm0", | ||
244 | .modes = pmx_pwm0_modes, | ||
245 | .mode_count = ARRAY_SIZE(pmx_pwm0_modes), | ||
246 | .enb_on_reset = 1, | ||
247 | }; | ||
248 | |||
249 | struct pmx_dev_mode pmx_pwm1_modes[] = { | ||
250 | { | ||
251 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
252 | .mask = PMX_UART0_MODEM_MASK, | ||
253 | }, { | ||
254 | .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE, | ||
255 | .mask = PMX_MII_MASK, | ||
256 | }, | ||
257 | }; | ||
258 | |||
259 | struct pmx_dev pmx_pwm1 = { | ||
260 | .name = "pwm1", | ||
261 | .modes = pmx_pwm1_modes, | ||
262 | .mode_count = ARRAY_SIZE(pmx_pwm1_modes), | ||
263 | .enb_on_reset = 1, | ||
264 | }; | ||
265 | |||
266 | struct pmx_dev_mode pmx_pwm2_modes[] = { | ||
267 | { | ||
268 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
269 | .mask = PMX_SSP_CS_MASK, | ||
270 | }, { | ||
271 | .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE, | ||
272 | .mask = PMX_MII_MASK, | ||
273 | }, | ||
274 | }; | ||
275 | |||
276 | struct pmx_dev pmx_pwm2 = { | ||
277 | .name = "pwm2", | ||
278 | .modes = pmx_pwm2_modes, | ||
279 | .mode_count = ARRAY_SIZE(pmx_pwm2_modes), | ||
280 | .enb_on_reset = 1, | ||
281 | }; | ||
282 | |||
283 | struct pmx_dev_mode pmx_pwm3_modes[] = { | ||
284 | { | ||
285 | .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE, | ||
286 | .mask = PMX_MII_MASK, | ||
287 | }, | ||
288 | }; | ||
289 | |||
290 | struct pmx_dev pmx_pwm3 = { | ||
291 | .name = "pwm3", | ||
292 | .modes = pmx_pwm3_modes, | ||
293 | .mode_count = ARRAY_SIZE(pmx_pwm3_modes), | ||
294 | .enb_on_reset = 1, | ||
295 | }; | ||
296 | |||
297 | struct pmx_dev_mode pmx_ssp1_modes[] = { | ||
298 | { | ||
299 | .ids = SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE, | ||
300 | .mask = PMX_MII_MASK, | ||
301 | }, | ||
302 | }; | ||
303 | |||
304 | struct pmx_dev pmx_ssp1 = { | ||
305 | .name = "ssp1", | ||
306 | .modes = pmx_ssp1_modes, | ||
307 | .mode_count = ARRAY_SIZE(pmx_ssp1_modes), | ||
308 | .enb_on_reset = 1, | ||
309 | }; | ||
310 | |||
311 | struct pmx_dev_mode pmx_ssp2_modes[] = { | ||
312 | { | ||
313 | .ids = AUTO_NET_SMII_MODE, | ||
314 | .mask = PMX_MII_MASK, | ||
315 | }, | ||
316 | }; | ||
317 | |||
318 | struct pmx_dev pmx_ssp2 = { | ||
319 | .name = "ssp2", | ||
320 | .modes = pmx_ssp2_modes, | ||
321 | .mode_count = ARRAY_SIZE(pmx_ssp2_modes), | ||
322 | .enb_on_reset = 1, | ||
323 | }; | ||
324 | |||
325 | struct pmx_dev_mode pmx_mii1_modes[] = { | ||
326 | { | ||
327 | .ids = AUTO_NET_MII_MODE, | ||
328 | .mask = 0x0, | ||
329 | }, | ||
330 | }; | ||
331 | |||
332 | struct pmx_dev pmx_mii1 = { | ||
333 | .name = "mii1", | ||
334 | .modes = pmx_mii1_modes, | ||
335 | .mode_count = ARRAY_SIZE(pmx_mii1_modes), | ||
336 | .enb_on_reset = 1, | ||
337 | }; | ||
338 | |||
339 | struct pmx_dev_mode pmx_smii0_modes[] = { | ||
340 | { | ||
341 | .ids = AUTO_NET_SMII_MODE | AUTO_EXP_MODE | SMALL_PRINTERS_MODE, | ||
342 | .mask = PMX_MII_MASK, | ||
343 | }, | ||
344 | }; | ||
345 | |||
346 | struct pmx_dev pmx_smii0 = { | ||
347 | .name = "smii0", | ||
348 | .modes = pmx_smii0_modes, | ||
349 | .mode_count = ARRAY_SIZE(pmx_smii0_modes), | ||
350 | .enb_on_reset = 1, | ||
351 | }; | ||
352 | |||
353 | struct pmx_dev_mode pmx_smii1_modes[] = { | ||
354 | { | ||
355 | .ids = AUTO_NET_SMII_MODE | SMALL_PRINTERS_MODE, | ||
356 | .mask = PMX_MII_MASK, | ||
357 | }, | ||
358 | }; | ||
359 | |||
360 | struct pmx_dev pmx_smii1 = { | ||
361 | .name = "smii1", | ||
362 | .modes = pmx_smii1_modes, | ||
363 | .mode_count = ARRAY_SIZE(pmx_smii1_modes), | ||
364 | .enb_on_reset = 1, | ||
365 | }; | ||
366 | |||
367 | struct pmx_dev_mode pmx_i2c1_modes[] = { | ||
368 | { | ||
369 | .ids = AUTO_EXP_MODE, | ||
370 | .mask = 0x0, | ||
371 | }, | ||
372 | }; | ||
373 | |||
374 | struct pmx_dev pmx_i2c1 = { | ||
375 | .name = "i2c1", | ||
376 | .modes = pmx_i2c1_modes, | ||
377 | .mode_count = ARRAY_SIZE(pmx_i2c1_modes), | ||
378 | .enb_on_reset = 1, | ||
379 | }; | ||
380 | |||
381 | /* pmx driver structure */ | ||
382 | struct pmx_driver pmx_driver = { | ||
383 | .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x00000007}, | ||
384 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, | ||
385 | }; | ||
386 | |||
387 | /* Add spear320 specific devices here */ | ||
388 | |||
389 | /* spear3xx shared irq */ | ||
390 | struct shirq_dev_config shirq_ras1_config[] = { | ||
391 | { | ||
392 | .virq = VIRQ_EMI, | ||
393 | .status_mask = EMI_IRQ_MASK, | ||
394 | .clear_mask = EMI_IRQ_MASK, | ||
395 | }, { | ||
396 | .virq = VIRQ_CLCD, | ||
397 | .status_mask = CLCD_IRQ_MASK, | ||
398 | .clear_mask = CLCD_IRQ_MASK, | ||
399 | }, { | ||
400 | .virq = VIRQ_SPP, | ||
401 | .status_mask = SPP_IRQ_MASK, | ||
402 | .clear_mask = SPP_IRQ_MASK, | ||
403 | }, | ||
404 | }; | ||
405 | |||
406 | struct spear_shirq shirq_ras1 = { | ||
407 | .irq = IRQ_GEN_RAS_1, | ||
408 | .dev_config = shirq_ras1_config, | ||
409 | .dev_count = ARRAY_SIZE(shirq_ras1_config), | ||
410 | .regs = { | ||
411 | .enb_reg = -1, | ||
412 | .status_reg = INT_STS_MASK_REG, | ||
413 | .status_reg_mask = SHIRQ_RAS1_MASK, | ||
414 | .clear_reg = INT_CLR_MASK_REG, | ||
415 | .reset_to_clear = 1, | ||
416 | }, | ||
417 | }; | ||
418 | |||
419 | struct shirq_dev_config shirq_ras3_config[] = { | ||
420 | { | ||
421 | .virq = VIRQ_PLGPIO, | ||
422 | .enb_mask = GPIO_IRQ_MASK, | ||
423 | .status_mask = GPIO_IRQ_MASK, | ||
424 | .clear_mask = GPIO_IRQ_MASK, | ||
425 | }, { | ||
426 | .virq = VIRQ_I2S_PLAY, | ||
427 | .enb_mask = I2S_PLAY_IRQ_MASK, | ||
428 | .status_mask = I2S_PLAY_IRQ_MASK, | ||
429 | .clear_mask = I2S_PLAY_IRQ_MASK, | ||
430 | }, { | ||
431 | .virq = VIRQ_I2S_REC, | ||
432 | .enb_mask = I2S_REC_IRQ_MASK, | ||
433 | .status_mask = I2S_REC_IRQ_MASK, | ||
434 | .clear_mask = I2S_REC_IRQ_MASK, | ||
435 | }, | ||
436 | }; | ||
437 | |||
438 | struct spear_shirq shirq_ras3 = { | ||
439 | .irq = IRQ_GEN_RAS_3, | ||
440 | .dev_config = shirq_ras3_config, | ||
441 | .dev_count = ARRAY_SIZE(shirq_ras3_config), | ||
442 | .regs = { | ||
443 | .enb_reg = INT_ENB_MASK_REG, | ||
444 | .reset_to_enb = 1, | ||
445 | .status_reg = INT_STS_MASK_REG, | ||
446 | .status_reg_mask = SHIRQ_RAS3_MASK, | ||
447 | .clear_reg = INT_CLR_MASK_REG, | ||
448 | .reset_to_clear = 1, | ||
449 | }, | ||
450 | }; | ||
451 | |||
452 | struct shirq_dev_config shirq_intrcomm_ras_config[] = { | ||
453 | { | ||
454 | .virq = VIRQ_CANU, | ||
455 | .status_mask = CAN_U_IRQ_MASK, | ||
456 | .clear_mask = CAN_U_IRQ_MASK, | ||
457 | }, { | ||
458 | .virq = VIRQ_CANL, | ||
459 | .status_mask = CAN_L_IRQ_MASK, | ||
460 | .clear_mask = CAN_L_IRQ_MASK, | ||
461 | }, { | ||
462 | .virq = VIRQ_UART1, | ||
463 | .status_mask = UART1_IRQ_MASK, | ||
464 | .clear_mask = UART1_IRQ_MASK, | ||
465 | }, { | ||
466 | .virq = VIRQ_UART2, | ||
467 | .status_mask = UART2_IRQ_MASK, | ||
468 | .clear_mask = UART2_IRQ_MASK, | ||
469 | }, { | ||
470 | .virq = VIRQ_SSP1, | ||
471 | .status_mask = SSP1_IRQ_MASK, | ||
472 | .clear_mask = SSP1_IRQ_MASK, | ||
473 | }, { | ||
474 | .virq = VIRQ_SSP2, | ||
475 | .status_mask = SSP2_IRQ_MASK, | ||
476 | .clear_mask = SSP2_IRQ_MASK, | ||
477 | }, { | ||
478 | .virq = VIRQ_SMII0, | ||
479 | .status_mask = SMII0_IRQ_MASK, | ||
480 | .clear_mask = SMII0_IRQ_MASK, | ||
481 | }, { | ||
482 | .virq = VIRQ_MII1_SMII1, | ||
483 | .status_mask = MII1_SMII1_IRQ_MASK, | ||
484 | .clear_mask = MII1_SMII1_IRQ_MASK, | ||
485 | }, { | ||
486 | .virq = VIRQ_WAKEUP_SMII0, | ||
487 | .status_mask = WAKEUP_SMII0_IRQ_MASK, | ||
488 | .clear_mask = WAKEUP_SMII0_IRQ_MASK, | ||
489 | }, { | ||
490 | .virq = VIRQ_WAKEUP_MII1_SMII1, | ||
491 | .status_mask = WAKEUP_MII1_SMII1_IRQ_MASK, | ||
492 | .clear_mask = WAKEUP_MII1_SMII1_IRQ_MASK, | ||
493 | }, { | ||
494 | .virq = VIRQ_I2C, | ||
495 | .status_mask = I2C1_IRQ_MASK, | ||
496 | .clear_mask = I2C1_IRQ_MASK, | ||
497 | }, | ||
498 | }; | ||
499 | |||
500 | struct spear_shirq shirq_intrcomm_ras = { | ||
501 | .irq = IRQ_INTRCOMM_RAS_ARM, | ||
502 | .dev_config = shirq_intrcomm_ras_config, | ||
503 | .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config), | ||
504 | .regs = { | ||
505 | .enb_reg = -1, | ||
506 | .status_reg = INT_STS_MASK_REG, | ||
507 | .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK, | ||
508 | .clear_reg = INT_CLR_MASK_REG, | ||
509 | .reset_to_clear = 1, | ||
510 | }, | ||
511 | }; | ||
512 | |||
513 | /* spear320 routines */ | ||
514 | void __init spear320_init(void) | ||
515 | { | ||
516 | void __iomem *base; | ||
517 | int ret = 0; | ||
518 | |||
519 | /* call spear3xx family common init function */ | ||
520 | spear3xx_init(); | ||
521 | |||
522 | /* shared irq registeration */ | ||
523 | base = ioremap(SPEAR320_SOC_CONFIG_BASE, SPEAR320_SOC_CONFIG_SIZE); | ||
524 | if (base) { | ||
525 | /* shirq 1 */ | ||
526 | shirq_ras1.regs.base = base; | ||
527 | ret = spear_shirq_register(&shirq_ras1); | ||
528 | if (ret) | ||
529 | printk(KERN_ERR "Error registering Shared IRQ 1\n"); | ||
530 | |||
531 | /* shirq 3 */ | ||
532 | shirq_ras3.regs.base = base; | ||
533 | ret = spear_shirq_register(&shirq_ras3); | ||
534 | if (ret) | ||
535 | printk(KERN_ERR "Error registering Shared IRQ 3\n"); | ||
536 | |||
537 | /* shirq 4 */ | ||
538 | shirq_intrcomm_ras.regs.base = base; | ||
539 | ret = spear_shirq_register(&shirq_intrcomm_ras); | ||
540 | if (ret) | ||
541 | printk(KERN_ERR "Error registering Shared IRQ 4\n"); | ||
542 | } | ||
543 | } | ||
544 | |||
545 | void spear320_pmx_init(void) | ||
546 | { | ||
547 | spear_pmx_init(&pmx_driver, SPEAR320_SOC_CONFIG_BASE, | ||
548 | SPEAR320_SOC_CONFIG_SIZE); | ||
549 | } | ||
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c new file mode 100644 index 000000000000..62ac685a4135 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear320_evb.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/spear320_evb.c | ||
3 | * | ||
4 | * SPEAr320 evaluation board source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <asm/mach/arch.h> | ||
15 | #include <asm/mach-types.h> | ||
16 | #include <mach/generic.h> | ||
17 | #include <mach/spear.h> | ||
18 | |||
19 | /* padmux devices to enable */ | ||
20 | static struct pmx_dev *pmx_devs[] = { | ||
21 | /* spear3xx specific devices */ | ||
22 | &pmx_i2c, | ||
23 | &pmx_ssp, | ||
24 | &pmx_mii, | ||
25 | &pmx_uart0, | ||
26 | |||
27 | /* spear320 specific devices */ | ||
28 | &pmx_fsmc, | ||
29 | &pmx_sdio, | ||
30 | &pmx_i2s, | ||
31 | &pmx_uart1, | ||
32 | &pmx_uart2, | ||
33 | &pmx_can, | ||
34 | &pmx_pwm0, | ||
35 | &pmx_pwm1, | ||
36 | &pmx_pwm2, | ||
37 | &pmx_mii1, | ||
38 | }; | ||
39 | |||
40 | static struct amba_device *amba_devs[] __initdata = { | ||
41 | /* spear3xx specific devices */ | ||
42 | &gpio_device, | ||
43 | &uart_device, | ||
44 | |||
45 | /* spear320 specific devices */ | ||
46 | }; | ||
47 | |||
48 | static struct platform_device *plat_devs[] __initdata = { | ||
49 | /* spear3xx specific devices */ | ||
50 | |||
51 | /* spear320 specific devices */ | ||
52 | }; | ||
53 | |||
54 | static void __init spear320_evb_init(void) | ||
55 | { | ||
56 | unsigned int i; | ||
57 | |||
58 | /* call spear320 machine init function */ | ||
59 | spear320_init(); | ||
60 | |||
61 | /* padmux initialization */ | ||
62 | pmx_driver.mode = &auto_net_mii_mode; | ||
63 | pmx_driver.devs = pmx_devs; | ||
64 | pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); | ||
65 | spear320_pmx_init(); | ||
66 | |||
67 | /* Add Platform Devices */ | ||
68 | platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); | ||
69 | |||
70 | /* Add Amba Devices */ | ||
71 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
72 | amba_device_register(amba_devs[i], &iomem_resource); | ||
73 | } | ||
74 | |||
75 | MACHINE_START(SPEAR320, "ST-SPEAR320-EVB") | ||
76 | .boot_params = 0x00000100, | ||
77 | .map_io = spear3xx_map_io, | ||
78 | .init_irq = spear3xx_init_irq, | ||
79 | .timer = &spear_sys_timer, | ||
80 | .init_machine = spear320_evb_init, | ||
81 | MACHINE_END | ||
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c new file mode 100644 index 000000000000..e87313aeae20 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear3xx.c | |||
@@ -0,0 +1,548 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear3xx/spear3xx.c | ||
3 | * | ||
4 | * SPEAr3XX machines common source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/amba/pl061.h> | ||
16 | #include <linux/ptrace.h> | ||
17 | #include <linux/io.h> | ||
18 | #include <asm/hardware/vic.h> | ||
19 | #include <asm/irq.h> | ||
20 | #include <asm/mach/arch.h> | ||
21 | #include <mach/generic.h> | ||
22 | #include <mach/spear.h> | ||
23 | |||
24 | /* Add spear3xx machines common devices here */ | ||
25 | /* gpio device registeration */ | ||
26 | static struct pl061_platform_data gpio_plat_data = { | ||
27 | .gpio_base = 0, | ||
28 | .irq_base = SPEAR_GPIO_INT_BASE, | ||
29 | }; | ||
30 | |||
31 | struct amba_device gpio_device = { | ||
32 | .dev = { | ||
33 | .init_name = "gpio", | ||
34 | .platform_data = &gpio_plat_data, | ||
35 | }, | ||
36 | .res = { | ||
37 | .start = SPEAR3XX_ICM3_GPIO_BASE, | ||
38 | .end = SPEAR3XX_ICM3_GPIO_BASE + SPEAR3XX_ICM3_GPIO_SIZE - 1, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }, | ||
41 | .irq = {IRQ_BASIC_GPIO, NO_IRQ}, | ||
42 | }; | ||
43 | |||
44 | /* uart device registeration */ | ||
45 | struct amba_device uart_device = { | ||
46 | .dev = { | ||
47 | .init_name = "uart", | ||
48 | }, | ||
49 | .res = { | ||
50 | .start = SPEAR3XX_ICM1_UART_BASE, | ||
51 | .end = SPEAR3XX_ICM1_UART_BASE + SPEAR3XX_ICM1_UART_SIZE - 1, | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, | ||
54 | .irq = {IRQ_UART, NO_IRQ}, | ||
55 | }; | ||
56 | |||
57 | /* Do spear3xx familiy common initialization part here */ | ||
58 | void __init spear3xx_init(void) | ||
59 | { | ||
60 | /* nothing to do for now */ | ||
61 | } | ||
62 | |||
63 | /* This will initialize vic */ | ||
64 | void __init spear3xx_init_irq(void) | ||
65 | { | ||
66 | vic_init((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE, 0, ~0, 0); | ||
67 | } | ||
68 | |||
69 | /* Following will create static virtual/physical mappings */ | ||
70 | struct map_desc spear3xx_io_desc[] __initdata = { | ||
71 | { | ||
72 | .virtual = VA_SPEAR3XX_ICM1_UART_BASE, | ||
73 | .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE), | ||
74 | .length = SPEAR3XX_ICM1_UART_SIZE, | ||
75 | .type = MT_DEVICE | ||
76 | }, { | ||
77 | .virtual = VA_SPEAR3XX_ML1_VIC_BASE, | ||
78 | .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE), | ||
79 | .length = SPEAR3XX_ML1_VIC_SIZE, | ||
80 | .type = MT_DEVICE | ||
81 | }, { | ||
82 | .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE, | ||
83 | .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE), | ||
84 | .length = SPEAR3XX_ICM3_SYS_CTRL_SIZE, | ||
85 | .type = MT_DEVICE | ||
86 | }, { | ||
87 | .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE, | ||
88 | .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE), | ||
89 | .length = SPEAR3XX_ICM3_MISC_REG_SIZE, | ||
90 | .type = MT_DEVICE | ||
91 | }, | ||
92 | }; | ||
93 | |||
94 | /* This will create static memory mapping for selected devices */ | ||
95 | void __init spear3xx_map_io(void) | ||
96 | { | ||
97 | iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc)); | ||
98 | |||
99 | /* This will initialize clock framework */ | ||
100 | clk_init(); | ||
101 | } | ||
102 | |||
103 | /* pad multiplexing support */ | ||
104 | /* devices */ | ||
105 | struct pmx_dev_mode pmx_firda_modes[] = { | ||
106 | { | ||
107 | .ids = 0xffffffff, | ||
108 | .mask = PMX_FIRDA_MASK, | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | struct pmx_dev pmx_firda = { | ||
113 | .name = "firda", | ||
114 | .modes = pmx_firda_modes, | ||
115 | .mode_count = ARRAY_SIZE(pmx_firda_modes), | ||
116 | .enb_on_reset = 0, | ||
117 | }; | ||
118 | |||
119 | struct pmx_dev_mode pmx_i2c_modes[] = { | ||
120 | { | ||
121 | .ids = 0xffffffff, | ||
122 | .mask = PMX_I2C_MASK, | ||
123 | }, | ||
124 | }; | ||
125 | |||
126 | struct pmx_dev pmx_i2c = { | ||
127 | .name = "i2c", | ||
128 | .modes = pmx_i2c_modes, | ||
129 | .mode_count = ARRAY_SIZE(pmx_i2c_modes), | ||
130 | .enb_on_reset = 0, | ||
131 | }; | ||
132 | |||
133 | struct pmx_dev_mode pmx_ssp_cs_modes[] = { | ||
134 | { | ||
135 | .ids = 0xffffffff, | ||
136 | .mask = PMX_SSP_CS_MASK, | ||
137 | }, | ||
138 | }; | ||
139 | |||
140 | struct pmx_dev pmx_ssp_cs = { | ||
141 | .name = "ssp_chip_selects", | ||
142 | .modes = pmx_ssp_cs_modes, | ||
143 | .mode_count = ARRAY_SIZE(pmx_ssp_cs_modes), | ||
144 | .enb_on_reset = 0, | ||
145 | }; | ||
146 | |||
147 | struct pmx_dev_mode pmx_ssp_modes[] = { | ||
148 | { | ||
149 | .ids = 0xffffffff, | ||
150 | .mask = PMX_SSP_MASK, | ||
151 | }, | ||
152 | }; | ||
153 | |||
154 | struct pmx_dev pmx_ssp = { | ||
155 | .name = "ssp", | ||
156 | .modes = pmx_ssp_modes, | ||
157 | .mode_count = ARRAY_SIZE(pmx_ssp_modes), | ||
158 | .enb_on_reset = 0, | ||
159 | }; | ||
160 | |||
161 | struct pmx_dev_mode pmx_mii_modes[] = { | ||
162 | { | ||
163 | .ids = 0xffffffff, | ||
164 | .mask = PMX_MII_MASK, | ||
165 | }, | ||
166 | }; | ||
167 | |||
168 | struct pmx_dev pmx_mii = { | ||
169 | .name = "mii", | ||
170 | .modes = pmx_mii_modes, | ||
171 | .mode_count = ARRAY_SIZE(pmx_mii_modes), | ||
172 | .enb_on_reset = 0, | ||
173 | }; | ||
174 | |||
175 | struct pmx_dev_mode pmx_gpio_pin0_modes[] = { | ||
176 | { | ||
177 | .ids = 0xffffffff, | ||
178 | .mask = PMX_GPIO_PIN0_MASK, | ||
179 | }, | ||
180 | }; | ||
181 | |||
182 | struct pmx_dev pmx_gpio_pin0 = { | ||
183 | .name = "gpio_pin0", | ||
184 | .modes = pmx_gpio_pin0_modes, | ||
185 | .mode_count = ARRAY_SIZE(pmx_gpio_pin0_modes), | ||
186 | .enb_on_reset = 0, | ||
187 | }; | ||
188 | |||
189 | struct pmx_dev_mode pmx_gpio_pin1_modes[] = { | ||
190 | { | ||
191 | .ids = 0xffffffff, | ||
192 | .mask = PMX_GPIO_PIN1_MASK, | ||
193 | }, | ||
194 | }; | ||
195 | |||
196 | struct pmx_dev pmx_gpio_pin1 = { | ||
197 | .name = "gpio_pin1", | ||
198 | .modes = pmx_gpio_pin1_modes, | ||
199 | .mode_count = ARRAY_SIZE(pmx_gpio_pin1_modes), | ||
200 | .enb_on_reset = 0, | ||
201 | }; | ||
202 | |||
203 | struct pmx_dev_mode pmx_gpio_pin2_modes[] = { | ||
204 | { | ||
205 | .ids = 0xffffffff, | ||
206 | .mask = PMX_GPIO_PIN2_MASK, | ||
207 | }, | ||
208 | }; | ||
209 | |||
210 | struct pmx_dev pmx_gpio_pin2 = { | ||
211 | .name = "gpio_pin2", | ||
212 | .modes = pmx_gpio_pin2_modes, | ||
213 | .mode_count = ARRAY_SIZE(pmx_gpio_pin2_modes), | ||
214 | .enb_on_reset = 0, | ||
215 | }; | ||
216 | |||
217 | struct pmx_dev_mode pmx_gpio_pin3_modes[] = { | ||
218 | { | ||
219 | .ids = 0xffffffff, | ||
220 | .mask = PMX_GPIO_PIN3_MASK, | ||
221 | }, | ||
222 | }; | ||
223 | |||
224 | struct pmx_dev pmx_gpio_pin3 = { | ||
225 | .name = "gpio_pin3", | ||
226 | .modes = pmx_gpio_pin3_modes, | ||
227 | .mode_count = ARRAY_SIZE(pmx_gpio_pin3_modes), | ||
228 | .enb_on_reset = 0, | ||
229 | }; | ||
230 | |||
231 | struct pmx_dev_mode pmx_gpio_pin4_modes[] = { | ||
232 | { | ||
233 | .ids = 0xffffffff, | ||
234 | .mask = PMX_GPIO_PIN4_MASK, | ||
235 | }, | ||
236 | }; | ||
237 | |||
238 | struct pmx_dev pmx_gpio_pin4 = { | ||
239 | .name = "gpio_pin4", | ||
240 | .modes = pmx_gpio_pin4_modes, | ||
241 | .mode_count = ARRAY_SIZE(pmx_gpio_pin4_modes), | ||
242 | .enb_on_reset = 0, | ||
243 | }; | ||
244 | |||
245 | struct pmx_dev_mode pmx_gpio_pin5_modes[] = { | ||
246 | { | ||
247 | .ids = 0xffffffff, | ||
248 | .mask = PMX_GPIO_PIN5_MASK, | ||
249 | }, | ||
250 | }; | ||
251 | |||
252 | struct pmx_dev pmx_gpio_pin5 = { | ||
253 | .name = "gpio_pin5", | ||
254 | .modes = pmx_gpio_pin5_modes, | ||
255 | .mode_count = ARRAY_SIZE(pmx_gpio_pin5_modes), | ||
256 | .enb_on_reset = 0, | ||
257 | }; | ||
258 | |||
259 | struct pmx_dev_mode pmx_uart0_modem_modes[] = { | ||
260 | { | ||
261 | .ids = 0xffffffff, | ||
262 | .mask = PMX_UART0_MODEM_MASK, | ||
263 | }, | ||
264 | }; | ||
265 | |||
266 | struct pmx_dev pmx_uart0_modem = { | ||
267 | .name = "uart0_modem", | ||
268 | .modes = pmx_uart0_modem_modes, | ||
269 | .mode_count = ARRAY_SIZE(pmx_uart0_modem_modes), | ||
270 | .enb_on_reset = 0, | ||
271 | }; | ||
272 | |||
273 | struct pmx_dev_mode pmx_uart0_modes[] = { | ||
274 | { | ||
275 | .ids = 0xffffffff, | ||
276 | .mask = PMX_UART0_MASK, | ||
277 | }, | ||
278 | }; | ||
279 | |||
280 | struct pmx_dev pmx_uart0 = { | ||
281 | .name = "uart0", | ||
282 | .modes = pmx_uart0_modes, | ||
283 | .mode_count = ARRAY_SIZE(pmx_uart0_modes), | ||
284 | .enb_on_reset = 0, | ||
285 | }; | ||
286 | |||
287 | struct pmx_dev_mode pmx_timer_3_4_modes[] = { | ||
288 | { | ||
289 | .ids = 0xffffffff, | ||
290 | .mask = PMX_TIMER_3_4_MASK, | ||
291 | }, | ||
292 | }; | ||
293 | |||
294 | struct pmx_dev pmx_timer_3_4 = { | ||
295 | .name = "timer_3_4", | ||
296 | .modes = pmx_timer_3_4_modes, | ||
297 | .mode_count = ARRAY_SIZE(pmx_timer_3_4_modes), | ||
298 | .enb_on_reset = 0, | ||
299 | }; | ||
300 | |||
301 | struct pmx_dev_mode pmx_timer_1_2_modes[] = { | ||
302 | { | ||
303 | .ids = 0xffffffff, | ||
304 | .mask = PMX_TIMER_1_2_MASK, | ||
305 | }, | ||
306 | }; | ||
307 | |||
308 | struct pmx_dev pmx_timer_1_2 = { | ||
309 | .name = "timer_1_2", | ||
310 | .modes = pmx_timer_1_2_modes, | ||
311 | .mode_count = ARRAY_SIZE(pmx_timer_1_2_modes), | ||
312 | .enb_on_reset = 0, | ||
313 | }; | ||
314 | |||
315 | #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) | ||
316 | /* plgpios devices */ | ||
317 | struct pmx_dev_mode pmx_plgpio_0_1_modes[] = { | ||
318 | { | ||
319 | .ids = 0x00, | ||
320 | .mask = PMX_FIRDA_MASK, | ||
321 | }, | ||
322 | }; | ||
323 | |||
324 | struct pmx_dev pmx_plgpio_0_1 = { | ||
325 | .name = "plgpio 0 and 1", | ||
326 | .modes = pmx_plgpio_0_1_modes, | ||
327 | .mode_count = ARRAY_SIZE(pmx_plgpio_0_1_modes), | ||
328 | .enb_on_reset = 1, | ||
329 | }; | ||
330 | |||
331 | struct pmx_dev_mode pmx_plgpio_2_3_modes[] = { | ||
332 | { | ||
333 | .ids = 0x00, | ||
334 | .mask = PMX_UART0_MASK, | ||
335 | }, | ||
336 | }; | ||
337 | |||
338 | struct pmx_dev pmx_plgpio_2_3 = { | ||
339 | .name = "plgpio 2 and 3", | ||
340 | .modes = pmx_plgpio_2_3_modes, | ||
341 | .mode_count = ARRAY_SIZE(pmx_plgpio_2_3_modes), | ||
342 | .enb_on_reset = 1, | ||
343 | }; | ||
344 | |||
345 | struct pmx_dev_mode pmx_plgpio_4_5_modes[] = { | ||
346 | { | ||
347 | .ids = 0x00, | ||
348 | .mask = PMX_I2C_MASK, | ||
349 | }, | ||
350 | }; | ||
351 | |||
352 | struct pmx_dev pmx_plgpio_4_5 = { | ||
353 | .name = "plgpio 4 and 5", | ||
354 | .modes = pmx_plgpio_4_5_modes, | ||
355 | .mode_count = ARRAY_SIZE(pmx_plgpio_4_5_modes), | ||
356 | .enb_on_reset = 1, | ||
357 | }; | ||
358 | |||
359 | struct pmx_dev_mode pmx_plgpio_6_9_modes[] = { | ||
360 | { | ||
361 | .ids = 0x00, | ||
362 | .mask = PMX_SSP_MASK, | ||
363 | }, | ||
364 | }; | ||
365 | |||
366 | struct pmx_dev pmx_plgpio_6_9 = { | ||
367 | .name = "plgpio 6 to 9", | ||
368 | .modes = pmx_plgpio_6_9_modes, | ||
369 | .mode_count = ARRAY_SIZE(pmx_plgpio_6_9_modes), | ||
370 | .enb_on_reset = 1, | ||
371 | }; | ||
372 | |||
373 | struct pmx_dev_mode pmx_plgpio_10_27_modes[] = { | ||
374 | { | ||
375 | .ids = 0x00, | ||
376 | .mask = PMX_MII_MASK, | ||
377 | }, | ||
378 | }; | ||
379 | |||
380 | struct pmx_dev pmx_plgpio_10_27 = { | ||
381 | .name = "plgpio 10 to 27", | ||
382 | .modes = pmx_plgpio_10_27_modes, | ||
383 | .mode_count = ARRAY_SIZE(pmx_plgpio_10_27_modes), | ||
384 | .enb_on_reset = 1, | ||
385 | }; | ||
386 | |||
387 | struct pmx_dev_mode pmx_plgpio_28_modes[] = { | ||
388 | { | ||
389 | .ids = 0x00, | ||
390 | .mask = PMX_GPIO_PIN0_MASK, | ||
391 | }, | ||
392 | }; | ||
393 | |||
394 | struct pmx_dev pmx_plgpio_28 = { | ||
395 | .name = "plgpio 28", | ||
396 | .modes = pmx_plgpio_28_modes, | ||
397 | .mode_count = ARRAY_SIZE(pmx_plgpio_28_modes), | ||
398 | .enb_on_reset = 1, | ||
399 | }; | ||
400 | |||
401 | struct pmx_dev_mode pmx_plgpio_29_modes[] = { | ||
402 | { | ||
403 | .ids = 0x00, | ||
404 | .mask = PMX_GPIO_PIN1_MASK, | ||
405 | }, | ||
406 | }; | ||
407 | |||
408 | struct pmx_dev pmx_plgpio_29 = { | ||
409 | .name = "plgpio 29", | ||
410 | .modes = pmx_plgpio_29_modes, | ||
411 | .mode_count = ARRAY_SIZE(pmx_plgpio_29_modes), | ||
412 | .enb_on_reset = 1, | ||
413 | }; | ||
414 | |||
415 | struct pmx_dev_mode pmx_plgpio_30_modes[] = { | ||
416 | { | ||
417 | .ids = 0x00, | ||
418 | .mask = PMX_GPIO_PIN2_MASK, | ||
419 | }, | ||
420 | }; | ||
421 | |||
422 | struct pmx_dev pmx_plgpio_30 = { | ||
423 | .name = "plgpio 30", | ||
424 | .modes = pmx_plgpio_30_modes, | ||
425 | .mode_count = ARRAY_SIZE(pmx_plgpio_30_modes), | ||
426 | .enb_on_reset = 1, | ||
427 | }; | ||
428 | |||
429 | struct pmx_dev_mode pmx_plgpio_31_modes[] = { | ||
430 | { | ||
431 | .ids = 0x00, | ||
432 | .mask = PMX_GPIO_PIN3_MASK, | ||
433 | }, | ||
434 | }; | ||
435 | |||
436 | struct pmx_dev pmx_plgpio_31 = { | ||
437 | .name = "plgpio 31", | ||
438 | .modes = pmx_plgpio_31_modes, | ||
439 | .mode_count = ARRAY_SIZE(pmx_plgpio_31_modes), | ||
440 | .enb_on_reset = 1, | ||
441 | }; | ||
442 | |||
443 | struct pmx_dev_mode pmx_plgpio_32_modes[] = { | ||
444 | { | ||
445 | .ids = 0x00, | ||
446 | .mask = PMX_GPIO_PIN4_MASK, | ||
447 | }, | ||
448 | }; | ||
449 | |||
450 | struct pmx_dev pmx_plgpio_32 = { | ||
451 | .name = "plgpio 32", | ||
452 | .modes = pmx_plgpio_32_modes, | ||
453 | .mode_count = ARRAY_SIZE(pmx_plgpio_32_modes), | ||
454 | .enb_on_reset = 1, | ||
455 | }; | ||
456 | |||
457 | struct pmx_dev_mode pmx_plgpio_33_modes[] = { | ||
458 | { | ||
459 | .ids = 0x00, | ||
460 | .mask = PMX_GPIO_PIN5_MASK, | ||
461 | }, | ||
462 | }; | ||
463 | |||
464 | struct pmx_dev pmx_plgpio_33 = { | ||
465 | .name = "plgpio 33", | ||
466 | .modes = pmx_plgpio_33_modes, | ||
467 | .mode_count = ARRAY_SIZE(pmx_plgpio_33_modes), | ||
468 | .enb_on_reset = 1, | ||
469 | }; | ||
470 | |||
471 | struct pmx_dev_mode pmx_plgpio_34_36_modes[] = { | ||
472 | { | ||
473 | .ids = 0x00, | ||
474 | .mask = PMX_SSP_CS_MASK, | ||
475 | }, | ||
476 | }; | ||
477 | |||
478 | struct pmx_dev pmx_plgpio_34_36 = { | ||
479 | .name = "plgpio 34 to 36", | ||
480 | .modes = pmx_plgpio_34_36_modes, | ||
481 | .mode_count = ARRAY_SIZE(pmx_plgpio_34_36_modes), | ||
482 | .enb_on_reset = 1, | ||
483 | }; | ||
484 | |||
485 | struct pmx_dev_mode pmx_plgpio_37_42_modes[] = { | ||
486 | { | ||
487 | .ids = 0x00, | ||
488 | .mask = PMX_UART0_MODEM_MASK, | ||
489 | }, | ||
490 | }; | ||
491 | |||
492 | struct pmx_dev pmx_plgpio_37_42 = { | ||
493 | .name = "plgpio 37 to 42", | ||
494 | .modes = pmx_plgpio_37_42_modes, | ||
495 | .mode_count = ARRAY_SIZE(pmx_plgpio_37_42_modes), | ||
496 | .enb_on_reset = 1, | ||
497 | }; | ||
498 | |||
499 | struct pmx_dev_mode pmx_plgpio_43_44_47_48_modes[] = { | ||
500 | { | ||
501 | .ids = 0x00, | ||
502 | .mask = PMX_TIMER_1_2_MASK, | ||
503 | }, | ||
504 | }; | ||
505 | |||
506 | struct pmx_dev pmx_plgpio_43_44_47_48 = { | ||
507 | .name = "plgpio 43, 44, 47 and 48", | ||
508 | .modes = pmx_plgpio_43_44_47_48_modes, | ||
509 | .mode_count = ARRAY_SIZE(pmx_plgpio_43_44_47_48_modes), | ||
510 | .enb_on_reset = 1, | ||
511 | }; | ||
512 | |||
513 | struct pmx_dev_mode pmx_plgpio_45_46_49_50_modes[] = { | ||
514 | { | ||
515 | .ids = 0x00, | ||
516 | .mask = PMX_TIMER_3_4_MASK, | ||
517 | }, | ||
518 | }; | ||
519 | |||
520 | struct pmx_dev pmx_plgpio_45_46_49_50 = { | ||
521 | .name = "plgpio 45, 46, 49 and 50", | ||
522 | .modes = pmx_plgpio_45_46_49_50_modes, | ||
523 | .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes), | ||
524 | .enb_on_reset = 1, | ||
525 | }; | ||
526 | |||
527 | #endif | ||
528 | |||
529 | /* spear padmux initialization function */ | ||
530 | void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size) | ||
531 | { | ||
532 | int ret = 0; | ||
533 | |||
534 | /* pad mux initialization */ | ||
535 | pmx_driver->base = ioremap(base, size); | ||
536 | if (!pmx_driver->base) { | ||
537 | ret = -ENOMEM; | ||
538 | goto pmx_fail; | ||
539 | } | ||
540 | |||
541 | ret = pmx_register(pmx_driver); | ||
542 | iounmap(pmx_driver->base); | ||
543 | |||
544 | pmx_fail: | ||
545 | if (ret) | ||
546 | printk(KERN_ERR "padmux: registeration failed. err no: %d\n", | ||
547 | ret); | ||
548 | } | ||
diff --git a/arch/arm/mach-spear6xx/Kconfig b/arch/arm/mach-spear6xx/Kconfig new file mode 100644 index 000000000000..bddba034f862 --- /dev/null +++ b/arch/arm/mach-spear6xx/Kconfig | |||
@@ -0,0 +1,20 @@ | |||
1 | # | ||
2 | # SPEAr6XX Machine configuration file | ||
3 | # | ||
4 | |||
5 | if ARCH_SPEAR6XX | ||
6 | |||
7 | choice | ||
8 | prompt "SPEAr6XX Family" | ||
9 | default MACH_SPEAR600 | ||
10 | |||
11 | config MACH_SPEAR600 | ||
12 | bool "SPEAr600" | ||
13 | help | ||
14 | Supports ST SPEAr600 Machine | ||
15 | endchoice | ||
16 | |||
17 | # Adding SPEAr6XX machine specific configuration files | ||
18 | source "arch/arm/mach-spear6xx/Kconfig600" | ||
19 | |||
20 | endif #ARCH_SPEAR6XX | ||
diff --git a/arch/arm/mach-spear6xx/Kconfig600 b/arch/arm/mach-spear6xx/Kconfig600 new file mode 100644 index 000000000000..9e19f65eb78e --- /dev/null +++ b/arch/arm/mach-spear6xx/Kconfig600 | |||
@@ -0,0 +1,17 @@ | |||
1 | # | ||
2 | # SPEAr600 machine configuration file | ||
3 | # | ||
4 | |||
5 | if MACH_SPEAR600 | ||
6 | |||
7 | choice | ||
8 | prompt "SPEAr600 Boards" | ||
9 | default BOARD_SPEAR600_EVB | ||
10 | |||
11 | config BOARD_SPEAR600_EVB | ||
12 | bool "SPEAr600 Evaluation Board" | ||
13 | help | ||
14 | Supports ST SPEAr600 Evaluation Board | ||
15 | endchoice | ||
16 | |||
17 | endif #MACH_SPEAR600 | ||
diff --git a/arch/arm/mach-spear6xx/Makefile b/arch/arm/mach-spear6xx/Makefile new file mode 100644 index 000000000000..cc1a4d82d459 --- /dev/null +++ b/arch/arm/mach-spear6xx/Makefile | |||
@@ -0,0 +1,12 @@ | |||
1 | # | ||
2 | # Makefile for SPEAr6XX machine series | ||
3 | # | ||
4 | |||
5 | # common files | ||
6 | obj-y += clock.o spear6xx.o | ||
7 | |||
8 | # spear600 specific files | ||
9 | obj-$(CONFIG_MACH_SPEAR600) += spear600.o | ||
10 | |||
11 | # spear600 boards files | ||
12 | obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o | ||
diff --git a/arch/arm/mach-spear6xx/Makefile.boot b/arch/arm/mach-spear6xx/Makefile.boot new file mode 100644 index 000000000000..7a1f3c0eadb8 --- /dev/null +++ b/arch/arm/mach-spear6xx/Makefile.boot | |||
@@ -0,0 +1,3 @@ | |||
1 | zreladdr-y := 0x00008000 | ||
2 | params_phys-y := 0x00000100 | ||
3 | initrd_phys-y := 0x00800000 | ||
diff --git a/arch/arm/mach-spear6xx/clock.c b/arch/arm/mach-spear6xx/clock.c new file mode 100644 index 000000000000..13e27c769685 --- /dev/null +++ b/arch/arm/mach-spear6xx/clock.c | |||
@@ -0,0 +1,483 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/clock.c | ||
3 | * | ||
4 | * SPEAr6xx machines clock framework source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <mach/misc_regs.h> | ||
17 | #include <plat/clock.h> | ||
18 | |||
19 | /* root clks */ | ||
20 | /* 32 KHz oscillator clock */ | ||
21 | static struct clk osc_32k_clk = { | ||
22 | .flags = ALWAYS_ENABLED, | ||
23 | .rate = 32000, | ||
24 | }; | ||
25 | |||
26 | /* 30 MHz oscillator clock */ | ||
27 | static struct clk osc_30m_clk = { | ||
28 | .flags = ALWAYS_ENABLED, | ||
29 | .rate = 30000000, | ||
30 | }; | ||
31 | |||
32 | /* clock derived from 32 KHz osc clk */ | ||
33 | /* rtc clock */ | ||
34 | static struct clk rtc_clk = { | ||
35 | .pclk = &osc_32k_clk, | ||
36 | .en_reg = PERIP1_CLK_ENB, | ||
37 | .en_reg_bit = RTC_CLK_ENB, | ||
38 | .recalc = &follow_parent, | ||
39 | }; | ||
40 | |||
41 | /* clock derived from 30 MHz osc clk */ | ||
42 | /* pll1 configuration structure */ | ||
43 | static struct pll_clk_config pll1_config = { | ||
44 | .mode_reg = PLL1_CTR, | ||
45 | .cfg_reg = PLL1_FRQ, | ||
46 | }; | ||
47 | |||
48 | /* PLL1 clock */ | ||
49 | static struct clk pll1_clk = { | ||
50 | .pclk = &osc_30m_clk, | ||
51 | .en_reg = PLL1_CTR, | ||
52 | .en_reg_bit = PLL_ENABLE, | ||
53 | .recalc = &pll1_clk_recalc, | ||
54 | .private_data = &pll1_config, | ||
55 | }; | ||
56 | |||
57 | /* PLL3 48 MHz clock */ | ||
58 | static struct clk pll3_48m_clk = { | ||
59 | .flags = ALWAYS_ENABLED, | ||
60 | .pclk = &osc_30m_clk, | ||
61 | .rate = 48000000, | ||
62 | }; | ||
63 | |||
64 | /* watch dog timer clock */ | ||
65 | static struct clk wdt_clk = { | ||
66 | .flags = ALWAYS_ENABLED, | ||
67 | .pclk = &osc_30m_clk, | ||
68 | .recalc = &follow_parent, | ||
69 | }; | ||
70 | |||
71 | /* clock derived from pll1 clk */ | ||
72 | /* cpu clock */ | ||
73 | static struct clk cpu_clk = { | ||
74 | .flags = ALWAYS_ENABLED, | ||
75 | .pclk = &pll1_clk, | ||
76 | .recalc = &follow_parent, | ||
77 | }; | ||
78 | |||
79 | /* ahb configuration structure */ | ||
80 | static struct bus_clk_config ahb_config = { | ||
81 | .reg = CORE_CLK_CFG, | ||
82 | .mask = PLL_HCLK_RATIO_MASK, | ||
83 | .shift = PLL_HCLK_RATIO_SHIFT, | ||
84 | }; | ||
85 | |||
86 | /* ahb clock */ | ||
87 | static struct clk ahb_clk = { | ||
88 | .flags = ALWAYS_ENABLED, | ||
89 | .pclk = &pll1_clk, | ||
90 | .recalc = &bus_clk_recalc, | ||
91 | .private_data = &ahb_config, | ||
92 | }; | ||
93 | |||
94 | /* uart parents */ | ||
95 | static struct pclk_info uart_pclk_info[] = { | ||
96 | { | ||
97 | .pclk = &pll1_clk, | ||
98 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
99 | .scalable = 1, | ||
100 | }, { | ||
101 | .pclk = &pll3_48m_clk, | ||
102 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
103 | .scalable = 0, | ||
104 | }, | ||
105 | }; | ||
106 | |||
107 | /* uart parent select structure */ | ||
108 | static struct pclk_sel uart_pclk_sel = { | ||
109 | .pclk_info = uart_pclk_info, | ||
110 | .pclk_count = ARRAY_SIZE(uart_pclk_info), | ||
111 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
112 | .pclk_sel_mask = UART_CLK_MASK, | ||
113 | }; | ||
114 | |||
115 | /* uart configurations */ | ||
116 | static struct aux_clk_config uart_config = { | ||
117 | .synth_reg = UART_CLK_SYNT, | ||
118 | }; | ||
119 | |||
120 | /* uart0 clock */ | ||
121 | static struct clk uart0_clk = { | ||
122 | .en_reg = PERIP1_CLK_ENB, | ||
123 | .en_reg_bit = UART0_CLK_ENB, | ||
124 | .pclk_sel = &uart_pclk_sel, | ||
125 | .pclk_sel_shift = UART_CLK_SHIFT, | ||
126 | .recalc = &aux_clk_recalc, | ||
127 | .private_data = &uart_config, | ||
128 | }; | ||
129 | |||
130 | /* uart1 clock */ | ||
131 | static struct clk uart1_clk = { | ||
132 | .en_reg = PERIP1_CLK_ENB, | ||
133 | .en_reg_bit = UART1_CLK_ENB, | ||
134 | .pclk_sel = &uart_pclk_sel, | ||
135 | .pclk_sel_shift = UART_CLK_SHIFT, | ||
136 | .recalc = &aux_clk_recalc, | ||
137 | .private_data = &uart_config, | ||
138 | }; | ||
139 | |||
140 | /* firda configurations */ | ||
141 | static struct aux_clk_config firda_config = { | ||
142 | .synth_reg = FIRDA_CLK_SYNT, | ||
143 | }; | ||
144 | |||
145 | /* firda parents */ | ||
146 | static struct pclk_info firda_pclk_info[] = { | ||
147 | { | ||
148 | .pclk = &pll1_clk, | ||
149 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
150 | .scalable = 1, | ||
151 | }, { | ||
152 | .pclk = &pll3_48m_clk, | ||
153 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
154 | .scalable = 0, | ||
155 | }, | ||
156 | }; | ||
157 | |||
158 | /* firda parent select structure */ | ||
159 | static struct pclk_sel firda_pclk_sel = { | ||
160 | .pclk_info = firda_pclk_info, | ||
161 | .pclk_count = ARRAY_SIZE(firda_pclk_info), | ||
162 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
163 | .pclk_sel_mask = FIRDA_CLK_MASK, | ||
164 | }; | ||
165 | |||
166 | /* firda clock */ | ||
167 | static struct clk firda_clk = { | ||
168 | .en_reg = PERIP1_CLK_ENB, | ||
169 | .en_reg_bit = FIRDA_CLK_ENB, | ||
170 | .pclk_sel = &firda_pclk_sel, | ||
171 | .pclk_sel_shift = FIRDA_CLK_SHIFT, | ||
172 | .recalc = &aux_clk_recalc, | ||
173 | .private_data = &firda_config, | ||
174 | }; | ||
175 | |||
176 | /* clcd configurations */ | ||
177 | static struct aux_clk_config clcd_config = { | ||
178 | .synth_reg = CLCD_CLK_SYNT, | ||
179 | }; | ||
180 | |||
181 | /* clcd parents */ | ||
182 | static struct pclk_info clcd_pclk_info[] = { | ||
183 | { | ||
184 | .pclk = &pll1_clk, | ||
185 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
186 | .scalable = 1, | ||
187 | }, { | ||
188 | .pclk = &pll3_48m_clk, | ||
189 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
190 | .scalable = 0, | ||
191 | }, | ||
192 | }; | ||
193 | |||
194 | /* clcd parent select structure */ | ||
195 | static struct pclk_sel clcd_pclk_sel = { | ||
196 | .pclk_info = clcd_pclk_info, | ||
197 | .pclk_count = ARRAY_SIZE(clcd_pclk_info), | ||
198 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
199 | .pclk_sel_mask = CLCD_CLK_MASK, | ||
200 | }; | ||
201 | |||
202 | /* clcd clock */ | ||
203 | static struct clk clcd_clk = { | ||
204 | .en_reg = PERIP1_CLK_ENB, | ||
205 | .en_reg_bit = CLCD_CLK_ENB, | ||
206 | .pclk_sel = &clcd_pclk_sel, | ||
207 | .pclk_sel_shift = CLCD_CLK_SHIFT, | ||
208 | .recalc = &aux_clk_recalc, | ||
209 | .private_data = &clcd_config, | ||
210 | }; | ||
211 | |||
212 | /* gpt parents */ | ||
213 | static struct pclk_info gpt_pclk_info[] = { | ||
214 | { | ||
215 | .pclk = &pll1_clk, | ||
216 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
217 | .scalable = 1, | ||
218 | }, { | ||
219 | .pclk = &pll3_48m_clk, | ||
220 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
221 | .scalable = 0, | ||
222 | }, | ||
223 | }; | ||
224 | |||
225 | /* gpt parent select structure */ | ||
226 | static struct pclk_sel gpt_pclk_sel = { | ||
227 | .pclk_info = gpt_pclk_info, | ||
228 | .pclk_count = ARRAY_SIZE(gpt_pclk_info), | ||
229 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
230 | .pclk_sel_mask = GPT_CLK_MASK, | ||
231 | }; | ||
232 | |||
233 | /* gpt0_1 configurations */ | ||
234 | static struct aux_clk_config gpt0_1_config = { | ||
235 | .synth_reg = PRSC1_CLK_CFG, | ||
236 | }; | ||
237 | |||
238 | /* gpt0 ARM1 subsystem timer clock */ | ||
239 | static struct clk gpt0_clk = { | ||
240 | .flags = ALWAYS_ENABLED, | ||
241 | .pclk_sel = &gpt_pclk_sel, | ||
242 | .pclk_sel_shift = GPT0_CLK_SHIFT, | ||
243 | .recalc = &gpt_clk_recalc, | ||
244 | .private_data = &gpt0_1_config, | ||
245 | }; | ||
246 | |||
247 | /* gpt1 timer clock */ | ||
248 | static struct clk gpt1_clk = { | ||
249 | .flags = ALWAYS_ENABLED, | ||
250 | .pclk_sel = &gpt_pclk_sel, | ||
251 | .pclk_sel_shift = GPT1_CLK_SHIFT, | ||
252 | .recalc = &gpt_clk_recalc, | ||
253 | .private_data = &gpt0_1_config, | ||
254 | }; | ||
255 | |||
256 | /* gpt2 configurations */ | ||
257 | static struct aux_clk_config gpt2_config = { | ||
258 | .synth_reg = PRSC2_CLK_CFG, | ||
259 | }; | ||
260 | |||
261 | /* gpt2 timer clock */ | ||
262 | static struct clk gpt2_clk = { | ||
263 | .en_reg = PERIP1_CLK_ENB, | ||
264 | .en_reg_bit = GPT2_CLK_ENB, | ||
265 | .pclk_sel = &gpt_pclk_sel, | ||
266 | .pclk_sel_shift = GPT2_CLK_SHIFT, | ||
267 | .recalc = &gpt_clk_recalc, | ||
268 | .private_data = &gpt2_config, | ||
269 | }; | ||
270 | |||
271 | /* gpt3 configurations */ | ||
272 | static struct aux_clk_config gpt3_config = { | ||
273 | .synth_reg = PRSC3_CLK_CFG, | ||
274 | }; | ||
275 | |||
276 | /* gpt3 timer clock */ | ||
277 | static struct clk gpt3_clk = { | ||
278 | .en_reg = PERIP1_CLK_ENB, | ||
279 | .en_reg_bit = GPT3_CLK_ENB, | ||
280 | .pclk_sel = &gpt_pclk_sel, | ||
281 | .pclk_sel_shift = GPT3_CLK_SHIFT, | ||
282 | .recalc = &gpt_clk_recalc, | ||
283 | .private_data = &gpt3_config, | ||
284 | }; | ||
285 | |||
286 | /* clock derived from pll3 clk */ | ||
287 | /* usbh0 clock */ | ||
288 | static struct clk usbh0_clk = { | ||
289 | .pclk = &pll3_48m_clk, | ||
290 | .en_reg = PERIP1_CLK_ENB, | ||
291 | .en_reg_bit = USBH0_CLK_ENB, | ||
292 | .recalc = &follow_parent, | ||
293 | }; | ||
294 | |||
295 | /* usbh1 clock */ | ||
296 | static struct clk usbh1_clk = { | ||
297 | .pclk = &pll3_48m_clk, | ||
298 | .en_reg = PERIP1_CLK_ENB, | ||
299 | .en_reg_bit = USBH1_CLK_ENB, | ||
300 | .recalc = &follow_parent, | ||
301 | }; | ||
302 | |||
303 | /* usbd clock */ | ||
304 | static struct clk usbd_clk = { | ||
305 | .pclk = &pll3_48m_clk, | ||
306 | .en_reg = PERIP1_CLK_ENB, | ||
307 | .en_reg_bit = USBD_CLK_ENB, | ||
308 | .recalc = &follow_parent, | ||
309 | }; | ||
310 | |||
311 | /* clock derived from ahb clk */ | ||
312 | /* apb configuration structure */ | ||
313 | static struct bus_clk_config apb_config = { | ||
314 | .reg = CORE_CLK_CFG, | ||
315 | .mask = HCLK_PCLK_RATIO_MASK, | ||
316 | .shift = HCLK_PCLK_RATIO_SHIFT, | ||
317 | }; | ||
318 | |||
319 | /* apb clock */ | ||
320 | static struct clk apb_clk = { | ||
321 | .flags = ALWAYS_ENABLED, | ||
322 | .pclk = &ahb_clk, | ||
323 | .recalc = &bus_clk_recalc, | ||
324 | .private_data = &apb_config, | ||
325 | }; | ||
326 | |||
327 | /* i2c clock */ | ||
328 | static struct clk i2c_clk = { | ||
329 | .pclk = &ahb_clk, | ||
330 | .en_reg = PERIP1_CLK_ENB, | ||
331 | .en_reg_bit = I2C_CLK_ENB, | ||
332 | .recalc = &follow_parent, | ||
333 | }; | ||
334 | |||
335 | /* dma clock */ | ||
336 | static struct clk dma_clk = { | ||
337 | .pclk = &ahb_clk, | ||
338 | .en_reg = PERIP1_CLK_ENB, | ||
339 | .en_reg_bit = DMA_CLK_ENB, | ||
340 | .recalc = &follow_parent, | ||
341 | }; | ||
342 | |||
343 | /* jpeg clock */ | ||
344 | static struct clk jpeg_clk = { | ||
345 | .pclk = &ahb_clk, | ||
346 | .en_reg = PERIP1_CLK_ENB, | ||
347 | .en_reg_bit = JPEG_CLK_ENB, | ||
348 | .recalc = &follow_parent, | ||
349 | }; | ||
350 | |||
351 | /* gmac clock */ | ||
352 | static struct clk gmac_clk = { | ||
353 | .pclk = &ahb_clk, | ||
354 | .en_reg = PERIP1_CLK_ENB, | ||
355 | .en_reg_bit = GMAC_CLK_ENB, | ||
356 | .recalc = &follow_parent, | ||
357 | }; | ||
358 | |||
359 | /* smi clock */ | ||
360 | static struct clk smi_clk = { | ||
361 | .pclk = &ahb_clk, | ||
362 | .en_reg = PERIP1_CLK_ENB, | ||
363 | .en_reg_bit = SMI_CLK_ENB, | ||
364 | .recalc = &follow_parent, | ||
365 | }; | ||
366 | |||
367 | /* fsmc clock */ | ||
368 | static struct clk fsmc_clk = { | ||
369 | .pclk = &ahb_clk, | ||
370 | .en_reg = PERIP1_CLK_ENB, | ||
371 | .en_reg_bit = FSMC_CLK_ENB, | ||
372 | .recalc = &follow_parent, | ||
373 | }; | ||
374 | |||
375 | /* clock derived from apb clk */ | ||
376 | /* adc clock */ | ||
377 | static struct clk adc_clk = { | ||
378 | .pclk = &apb_clk, | ||
379 | .en_reg = PERIP1_CLK_ENB, | ||
380 | .en_reg_bit = ADC_CLK_ENB, | ||
381 | .recalc = &follow_parent, | ||
382 | }; | ||
383 | |||
384 | /* ssp0 clock */ | ||
385 | static struct clk ssp0_clk = { | ||
386 | .pclk = &apb_clk, | ||
387 | .en_reg = PERIP1_CLK_ENB, | ||
388 | .en_reg_bit = SSP0_CLK_ENB, | ||
389 | .recalc = &follow_parent, | ||
390 | }; | ||
391 | |||
392 | /* ssp1 clock */ | ||
393 | static struct clk ssp1_clk = { | ||
394 | .pclk = &apb_clk, | ||
395 | .en_reg = PERIP1_CLK_ENB, | ||
396 | .en_reg_bit = SSP1_CLK_ENB, | ||
397 | .recalc = &follow_parent, | ||
398 | }; | ||
399 | |||
400 | /* ssp2 clock */ | ||
401 | static struct clk ssp2_clk = { | ||
402 | .pclk = &apb_clk, | ||
403 | .en_reg = PERIP1_CLK_ENB, | ||
404 | .en_reg_bit = SSP2_CLK_ENB, | ||
405 | .recalc = &follow_parent, | ||
406 | }; | ||
407 | |||
408 | /* gpio0 ARM subsystem clock */ | ||
409 | static struct clk gpio0_clk = { | ||
410 | .flags = ALWAYS_ENABLED, | ||
411 | .pclk = &apb_clk, | ||
412 | .recalc = &follow_parent, | ||
413 | }; | ||
414 | |||
415 | /* gpio1 clock */ | ||
416 | static struct clk gpio1_clk = { | ||
417 | .pclk = &apb_clk, | ||
418 | .en_reg = PERIP1_CLK_ENB, | ||
419 | .en_reg_bit = GPIO1_CLK_ENB, | ||
420 | .recalc = &follow_parent, | ||
421 | }; | ||
422 | |||
423 | /* gpio2 clock */ | ||
424 | static struct clk gpio2_clk = { | ||
425 | .pclk = &apb_clk, | ||
426 | .en_reg = PERIP1_CLK_ENB, | ||
427 | .en_reg_bit = GPIO2_CLK_ENB, | ||
428 | .recalc = &follow_parent, | ||
429 | }; | ||
430 | |||
431 | /* array of all spear 6xx clock lookups */ | ||
432 | static struct clk_lookup spear_clk_lookups[] = { | ||
433 | /* root clks */ | ||
434 | { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, | ||
435 | { .con_id = "osc_30m_clk", .clk = &osc_30m_clk}, | ||
436 | /* clock derived from 32 KHz os clk */ | ||
437 | { .dev_id = "rtc", .clk = &rtc_clk}, | ||
438 | /* clock derived from 30 MHz os clk */ | ||
439 | { .con_id = "pll1_clk", .clk = &pll1_clk}, | ||
440 | { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk}, | ||
441 | { .dev_id = "wdt", .clk = &wdt_clk}, | ||
442 | /* clock derived from pll1 clk */ | ||
443 | { .con_id = "cpu_clk", .clk = &cpu_clk}, | ||
444 | { .con_id = "ahb_clk", .clk = &ahb_clk}, | ||
445 | { .dev_id = "uart0", .clk = &uart0_clk}, | ||
446 | { .dev_id = "uart1", .clk = &uart1_clk}, | ||
447 | { .dev_id = "firda", .clk = &firda_clk}, | ||
448 | { .dev_id = "clcd", .clk = &clcd_clk}, | ||
449 | { .dev_id = "gpt0", .clk = &gpt0_clk}, | ||
450 | { .dev_id = "gpt1", .clk = &gpt1_clk}, | ||
451 | { .dev_id = "gpt2", .clk = &gpt2_clk}, | ||
452 | { .dev_id = "gpt3", .clk = &gpt3_clk}, | ||
453 | /* clock derived from pll3 clk */ | ||
454 | { .dev_id = "usbh0", .clk = &usbh0_clk}, | ||
455 | { .dev_id = "usbh1", .clk = &usbh1_clk}, | ||
456 | { .dev_id = "usbd", .clk = &usbd_clk}, | ||
457 | /* clock derived from ahb clk */ | ||
458 | { .con_id = "apb_clk", .clk = &apb_clk}, | ||
459 | { .dev_id = "i2c", .clk = &i2c_clk}, | ||
460 | { .dev_id = "dma", .clk = &dma_clk}, | ||
461 | { .dev_id = "jpeg", .clk = &jpeg_clk}, | ||
462 | { .dev_id = "gmac", .clk = &gmac_clk}, | ||
463 | { .dev_id = "smi", .clk = &smi_clk}, | ||
464 | { .dev_id = "fsmc", .clk = &fsmc_clk}, | ||
465 | /* clock derived from apb clk */ | ||
466 | { .dev_id = "adc", .clk = &adc_clk}, | ||
467 | { .dev_id = "ssp0", .clk = &ssp0_clk}, | ||
468 | { .dev_id = "ssp1", .clk = &ssp1_clk}, | ||
469 | { .dev_id = "ssp2", .clk = &ssp2_clk}, | ||
470 | { .dev_id = "gpio0", .clk = &gpio0_clk}, | ||
471 | { .dev_id = "gpio1", .clk = &gpio1_clk}, | ||
472 | { .dev_id = "gpio2", .clk = &gpio2_clk}, | ||
473 | }; | ||
474 | |||
475 | void __init clk_init(void) | ||
476 | { | ||
477 | int i; | ||
478 | |||
479 | for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) | ||
480 | clk_register(&spear_clk_lookups[i]); | ||
481 | |||
482 | recalc_root_clocks(); | ||
483 | } | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/clkdev.h b/arch/arm/mach-spear6xx/include/mach/clkdev.h new file mode 100644 index 000000000000..05676bf440d3 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/clkdev.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/clkdev.h | ||
3 | * | ||
4 | * Clock Dev framework definitions for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_CLKDEV_H | ||
15 | #define __MACH_CLKDEV_H | ||
16 | |||
17 | #include <plat/clkdev.h> | ||
18 | |||
19 | #endif /* __MACH_CLKDEV_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/debug-macro.S b/arch/arm/mach-spear6xx/include/mach/debug-macro.S new file mode 100644 index 000000000000..0f3ea39edd96 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/debug-macro.S | |||
@@ -0,0 +1,14 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/debug-macro.S | ||
3 | * | ||
4 | * Debugging macro include header for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <plat/debug-macro.S> | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/entry-macro.S b/arch/arm/mach-spear6xx/include/mach/entry-macro.S new file mode 100644 index 000000000000..9eaecaeafcf0 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/entry-macro.S | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <mach/hardware.h> | ||
15 | #include <mach/spear.h> | ||
16 | #include <asm/hardware/vic.h> | ||
17 | |||
18 | .macro disable_fiq | ||
19 | .endm | ||
20 | |||
21 | .macro get_irqnr_preamble, base, tmp | ||
22 | .endm | ||
23 | |||
24 | .macro arch_ret_to_user, tmp1, tmp2 | ||
25 | .endm | ||
26 | |||
27 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
28 | ldr \base, =VA_SPEAR6XX_CPU_VIC_PRI_BASE | ||
29 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status | ||
30 | mov \irqnr, #0 | ||
31 | teq \irqstat, #0 | ||
32 | bne 1001f | ||
33 | ldr \base, =VA_SPEAR6XX_CPU_VIC_SEC_BASE | ||
34 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status | ||
35 | teq \irqstat, #0 | ||
36 | beq 1002f @ this will set/reset | ||
37 | @ zero register | ||
38 | mov \irqnr, #32 | ||
39 | 1001: | ||
40 | /* | ||
41 | * Following code will find bit position of least significang | ||
42 | * bit set in irqstat, using following equation | ||
43 | * least significant bit set in n = (n & ~(n-1)) | ||
44 | */ | ||
45 | sub \tmp, \irqstat, #1 @ tmp = irqstat - 1 | ||
46 | mvn \tmp, \tmp @ tmp = ~tmp | ||
47 | and \irqstat, \irqstat, \tmp @ irqstat &= tmp | ||
48 | /* Now, irqstat is = bit no. of 1st bit set in vic irq status */ | ||
49 | clz \tmp, \irqstat @ tmp = leading zeros | ||
50 | |||
51 | rsb \tmp, \tmp, #0x1F @ tmp = 32 - tmp - 1 | ||
52 | add \irqnr, \irqnr, \tmp | ||
53 | |||
54 | 1002: /* EQ will be set if no irqs pending */ | ||
55 | .endm | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/generic.h b/arch/arm/mach-spear6xx/include/mach/generic.h new file mode 100644 index 000000000000..16205a538756 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/generic.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/generic.h | ||
3 | * | ||
4 | * SPEAr6XX machine family specific generic header file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_GENERIC_H | ||
15 | #define __MACH_GENERIC_H | ||
16 | |||
17 | #include <asm/mach/time.h> | ||
18 | #include <asm/mach/map.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/amba/bus.h> | ||
22 | |||
23 | /* | ||
24 | * Each GPT has 2 timer channels | ||
25 | * Following GPT channels will be used as clock source and clockevent | ||
26 | */ | ||
27 | #define SPEAR_GPT0_BASE SPEAR6XX_CPU_TMR_BASE | ||
28 | #define SPEAR_GPT0_CHAN0_IRQ IRQ_CPU_GPT1_1 | ||
29 | #define SPEAR_GPT0_CHAN1_IRQ IRQ_CPU_GPT1_2 | ||
30 | |||
31 | /* Add spear6xx family device structure declarations here */ | ||
32 | extern struct amba_device gpio_device[]; | ||
33 | extern struct amba_device uart_device[]; | ||
34 | extern struct sys_timer spear_sys_timer; | ||
35 | |||
36 | /* Add spear6xx family function declarations here */ | ||
37 | void __init spear6xx_map_io(void); | ||
38 | void __init spear6xx_init_irq(void); | ||
39 | void __init spear6xx_init(void); | ||
40 | void __init spear600_init(void); | ||
41 | void __init clk_init(void); | ||
42 | |||
43 | /* Add spear600 machine device structure declarations here */ | ||
44 | |||
45 | #endif /* __MACH_GENERIC_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/gpio.h b/arch/arm/mach-spear6xx/include/mach/gpio.h new file mode 100644 index 000000000000..3a789dbb69f7 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/gpio.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/gpio.h | ||
3 | * | ||
4 | * GPIO macros for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_GPIO_H | ||
15 | #define __MACH_GPIO_H | ||
16 | |||
17 | #include <plat/gpio.h> | ||
18 | |||
19 | #endif /* __MACH_GPIO_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/hardware.h b/arch/arm/mach-spear6xx/include/mach/hardware.h new file mode 100644 index 000000000000..7545116deca9 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/hardware.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/hardware.h | ||
3 | * | ||
4 | * Hardware definitions for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_HARDWARE_H | ||
15 | #define __MACH_HARDWARE_H | ||
16 | |||
17 | /* Vitual to physical translation of statically mapped space */ | ||
18 | #define IO_ADDRESS(x) (x | 0xF0000000) | ||
19 | |||
20 | #endif /* __MACH_HARDWARE_H */ | ||
21 | |||
diff --git a/arch/arm/mach-spear6xx/include/mach/io.h b/arch/arm/mach-spear6xx/include/mach/io.h new file mode 100644 index 000000000000..fb7c106cea94 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/io.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/io.h | ||
3 | * | ||
4 | * IO definitions for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_IO_H | ||
15 | #define __MACH_IO_H | ||
16 | |||
17 | #include <plat/io.h> | ||
18 | |||
19 | #endif /* __MACH_IO_H */ | ||
20 | |||
diff --git a/arch/arm/mach-spear6xx/include/mach/irqs.h b/arch/arm/mach-spear6xx/include/mach/irqs.h new file mode 100644 index 000000000000..8f214b03d75d --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/irqs.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/irqs.h | ||
3 | * | ||
4 | * IRQ helper macros for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_IRQS_H | ||
15 | #define __MACH_IRQS_H | ||
16 | |||
17 | /* IRQ definitions */ | ||
18 | /* VIC 1 */ | ||
19 | #define IRQ_INTRCOMM_SW_IRQ 0 | ||
20 | #define IRQ_INTRCOMM_CPU_1 1 | ||
21 | #define IRQ_INTRCOMM_CPU_2 2 | ||
22 | #define IRQ_INTRCOMM_RAS2A11_1 3 | ||
23 | #define IRQ_INTRCOMM_RAS2A11_2 4 | ||
24 | #define IRQ_INTRCOMM_RAS2A12_1 5 | ||
25 | #define IRQ_INTRCOMM_RAS2A12_2 6 | ||
26 | #define IRQ_GEN_RAS_0 7 | ||
27 | #define IRQ_GEN_RAS_1 8 | ||
28 | #define IRQ_GEN_RAS_2 9 | ||
29 | #define IRQ_GEN_RAS_3 10 | ||
30 | #define IRQ_GEN_RAS_4 11 | ||
31 | #define IRQ_GEN_RAS_5 12 | ||
32 | #define IRQ_GEN_RAS_6 13 | ||
33 | #define IRQ_GEN_RAS_7 14 | ||
34 | #define IRQ_GEN_RAS_8 15 | ||
35 | #define IRQ_CPU_GPT1_1 16 | ||
36 | #define IRQ_CPU_GPT1_2 17 | ||
37 | #define IRQ_LOCAL_GPIO 18 | ||
38 | #define IRQ_PLL_UNLOCK 19 | ||
39 | #define IRQ_JPEG 20 | ||
40 | #define IRQ_FSMC 21 | ||
41 | #define IRQ_IRDA 22 | ||
42 | #define IRQ_RESERVED 23 | ||
43 | #define IRQ_UART_0 24 | ||
44 | #define IRQ_UART_1 25 | ||
45 | #define IRQ_SSP_1 26 | ||
46 | #define IRQ_SSP_2 27 | ||
47 | #define IRQ_I2C 28 | ||
48 | #define IRQ_GEN_RAS_9 29 | ||
49 | #define IRQ_GEN_RAS_10 30 | ||
50 | #define IRQ_GEN_RAS_11 31 | ||
51 | |||
52 | /* VIC 2 */ | ||
53 | #define IRQ_APPL_GPT1_1 32 | ||
54 | #define IRQ_APPL_GPT1_2 33 | ||
55 | #define IRQ_APPL_GPT2_1 34 | ||
56 | #define IRQ_APPL_GPT2_2 35 | ||
57 | #define IRQ_APPL_GPIO 36 | ||
58 | #define IRQ_APPL_SSP 37 | ||
59 | #define IRQ_APPL_ADC 38 | ||
60 | #define IRQ_APPL_RESERVED 39 | ||
61 | #define IRQ_AHB_EXP_MASTER 40 | ||
62 | #define IRQ_DDR_CONTROLLER 41 | ||
63 | #define IRQ_BASIC_DMA 42 | ||
64 | #define IRQ_BASIC_RESERVED1 43 | ||
65 | #define IRQ_BASIC_SMI 44 | ||
66 | #define IRQ_BASIC_CLCD 45 | ||
67 | #define IRQ_EXP_AHB_1 46 | ||
68 | #define IRQ_EXP_AHB_2 47 | ||
69 | #define IRQ_BASIC_GPT1_1 48 | ||
70 | #define IRQ_BASIC_GPT1_2 49 | ||
71 | #define IRQ_BASIC_RTC 50 | ||
72 | #define IRQ_BASIC_GPIO 51 | ||
73 | #define IRQ_BASIC_WDT 52 | ||
74 | #define IRQ_BASIC_RESERVED 53 | ||
75 | #define IRQ_AHB_EXP_SLAVE 54 | ||
76 | #define IRQ_GMAC_1 55 | ||
77 | #define IRQ_GMAC_2 56 | ||
78 | #define IRQ_USB_DEV 57 | ||
79 | #define IRQ_USB_H_OHCI_0 58 | ||
80 | #define IRQ_USB_H_EHCI_0 59 | ||
81 | #define IRQ_USB_H_OHCI_1 60 | ||
82 | #define IRQ_USB_H_EHCI_1 61 | ||
83 | #define IRQ_EXP_AHB_3 62 | ||
84 | #define IRQ_EXP_AHB_4 63 | ||
85 | |||
86 | #define IRQ_VIC_END 64 | ||
87 | |||
88 | /* GPIO pins virtual irqs */ | ||
89 | #define SPEAR_GPIO_INT_BASE IRQ_VIC_END | ||
90 | #define SPEAR_GPIO0_INT_BASE SPEAR_GPIO_INT_BASE | ||
91 | #define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO0_INT_BASE + 8) | ||
92 | #define SPEAR_GPIO2_INT_BASE (SPEAR_GPIO1_INT_BASE + 8) | ||
93 | #define SPEAR_GPIO_INT_END (SPEAR_GPIO2_INT_BASE + 8) | ||
94 | #define VIRTUAL_IRQS (SPEAR_GPIO_INT_END - IRQ_VIC_END) | ||
95 | #define NR_IRQS (IRQ_VIC_END + VIRTUAL_IRQS) | ||
96 | |||
97 | #endif /* __MACH_IRQS_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/memory.h b/arch/arm/mach-spear6xx/include/mach/memory.h new file mode 100644 index 000000000000..781f088fc228 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/memory.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/memory.h | ||
3 | * | ||
4 | * Memory map for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_MEMORY_H | ||
15 | #define __MACH_MEMORY_H | ||
16 | |||
17 | #include <plat/memory.h> | ||
18 | |||
19 | #endif /* __MACH_MEMORY_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/misc_regs.h b/arch/arm/mach-spear6xx/include/mach/misc_regs.h new file mode 100644 index 000000000000..03908036b0d0 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/misc_regs.h | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/misc_regs.h | ||
3 | * | ||
4 | * Miscellaneous registers definitions for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_MISC_REGS_H | ||
15 | #define __MACH_MISC_REGS_H | ||
16 | |||
17 | #include <mach/spear.h> | ||
18 | |||
19 | #define MISC_BASE VA_SPEAR6XX_ICM3_MISC_REG_BASE | ||
20 | |||
21 | #define SOC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x000)) | ||
22 | #define DIAG_CFG_CTR ((unsigned int *)(MISC_BASE + 0x004)) | ||
23 | #define PLL1_CTR ((unsigned int *)(MISC_BASE + 0x008)) | ||
24 | #define PLL1_FRQ ((unsigned int *)(MISC_BASE + 0x00C)) | ||
25 | #define PLL1_MOD ((unsigned int *)(MISC_BASE + 0x010)) | ||
26 | #define PLL2_CTR ((unsigned int *)(MISC_BASE + 0x014)) | ||
27 | /* PLL_CTR register masks */ | ||
28 | #define PLL_ENABLE 2 | ||
29 | #define PLL_MODE_SHIFT 4 | ||
30 | #define PLL_MODE_MASK 0x3 | ||
31 | #define PLL_MODE_NORMAL 0 | ||
32 | #define PLL_MODE_FRACTION 1 | ||
33 | #define PLL_MODE_DITH_DSB 2 | ||
34 | #define PLL_MODE_DITH_SSB 3 | ||
35 | |||
36 | #define PLL2_FRQ ((unsigned int *)(MISC_BASE + 0x018)) | ||
37 | /* PLL FRQ register masks */ | ||
38 | #define PLL_DIV_N_SHIFT 0 | ||
39 | #define PLL_DIV_N_MASK 0xFF | ||
40 | #define PLL_DIV_P_SHIFT 8 | ||
41 | #define PLL_DIV_P_MASK 0x7 | ||
42 | #define PLL_NORM_FDBK_M_SHIFT 24 | ||
43 | #define PLL_NORM_FDBK_M_MASK 0xFF | ||
44 | #define PLL_DITH_FDBK_M_SHIFT 16 | ||
45 | #define PLL_DITH_FDBK_M_MASK 0xFFFF | ||
46 | |||
47 | #define PLL2_MOD ((unsigned int *)(MISC_BASE + 0x01C)) | ||
48 | #define PLL_CLK_CFG ((unsigned int *)(MISC_BASE + 0x020)) | ||
49 | #define CORE_CLK_CFG ((unsigned int *)(MISC_BASE + 0x024)) | ||
50 | /* CORE CLK CFG register masks */ | ||
51 | #define PLL_HCLK_RATIO_SHIFT 10 | ||
52 | #define PLL_HCLK_RATIO_MASK 0x3 | ||
53 | #define HCLK_PCLK_RATIO_SHIFT 8 | ||
54 | #define HCLK_PCLK_RATIO_MASK 0x3 | ||
55 | |||
56 | #define PERIP_CLK_CFG ((unsigned int *)(MISC_BASE + 0x028)) | ||
57 | /* PERIP_CLK_CFG register masks */ | ||
58 | #define CLCD_CLK_SHIFT 2 | ||
59 | #define CLCD_CLK_MASK 0x3 | ||
60 | #define UART_CLK_SHIFT 4 | ||
61 | #define UART_CLK_MASK 0x1 | ||
62 | #define FIRDA_CLK_SHIFT 5 | ||
63 | #define FIRDA_CLK_MASK 0x3 | ||
64 | #define GPT0_CLK_SHIFT 8 | ||
65 | #define GPT1_CLK_SHIFT 10 | ||
66 | #define GPT2_CLK_SHIFT 11 | ||
67 | #define GPT3_CLK_SHIFT 12 | ||
68 | #define GPT_CLK_MASK 0x1 | ||
69 | #define AUX_CLK_PLL3_MASK 0 | ||
70 | #define AUX_CLK_PLL1_MASK 1 | ||
71 | |||
72 | #define PERIP1_CLK_ENB ((unsigned int *)(MISC_BASE + 0x02C)) | ||
73 | /* PERIP1_CLK_ENB register masks */ | ||
74 | #define UART0_CLK_ENB 3 | ||
75 | #define UART1_CLK_ENB 4 | ||
76 | #define SSP0_CLK_ENB 5 | ||
77 | #define SSP1_CLK_ENB 6 | ||
78 | #define I2C_CLK_ENB 7 | ||
79 | #define JPEG_CLK_ENB 8 | ||
80 | #define FSMC_CLK_ENB 9 | ||
81 | #define FIRDA_CLK_ENB 10 | ||
82 | #define GPT2_CLK_ENB 11 | ||
83 | #define GPT3_CLK_ENB 12 | ||
84 | #define GPIO2_CLK_ENB 13 | ||
85 | #define SSP2_CLK_ENB 14 | ||
86 | #define ADC_CLK_ENB 15 | ||
87 | #define GPT1_CLK_ENB 11 | ||
88 | #define RTC_CLK_ENB 17 | ||
89 | #define GPIO1_CLK_ENB 18 | ||
90 | #define DMA_CLK_ENB 19 | ||
91 | #define SMI_CLK_ENB 21 | ||
92 | #define CLCD_CLK_ENB 22 | ||
93 | #define GMAC_CLK_ENB 23 | ||
94 | #define USBD_CLK_ENB 24 | ||
95 | #define USBH0_CLK_ENB 25 | ||
96 | #define USBH1_CLK_ENB 26 | ||
97 | |||
98 | #define SOC_CORE_ID ((unsigned int *)(MISC_BASE + 0x030)) | ||
99 | #define RAS_CLK_ENB ((unsigned int *)(MISC_BASE + 0x034)) | ||
100 | #define PERIP1_SOF_RST ((unsigned int *)(MISC_BASE + 0x038)) | ||
101 | /* PERIP1_SOF_RST register masks */ | ||
102 | #define JPEG_SOF_RST 8 | ||
103 | |||
104 | #define SOC_USER_ID ((unsigned int *)(MISC_BASE + 0x03C)) | ||
105 | #define RAS_SOF_RST ((unsigned int *)(MISC_BASE + 0x040)) | ||
106 | #define PRSC1_CLK_CFG ((unsigned int *)(MISC_BASE + 0x044)) | ||
107 | #define PRSC2_CLK_CFG ((unsigned int *)(MISC_BASE + 0x048)) | ||
108 | #define PRSC3_CLK_CFG ((unsigned int *)(MISC_BASE + 0x04C)) | ||
109 | /* gpt synthesizer register masks */ | ||
110 | #define GPT_MSCALE_SHIFT 0 | ||
111 | #define GPT_MSCALE_MASK 0xFFF | ||
112 | #define GPT_NSCALE_SHIFT 12 | ||
113 | #define GPT_NSCALE_MASK 0xF | ||
114 | |||
115 | #define AMEM_CLK_CFG ((unsigned int *)(MISC_BASE + 0x050)) | ||
116 | #define EXPI_CLK_CFG ((unsigned int *)(MISC_BASE + 0x054)) | ||
117 | #define CLCD_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x05C)) | ||
118 | #define FIRDA_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x060)) | ||
119 | #define UART_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x064)) | ||
120 | #define GMAC_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x068)) | ||
121 | #define RAS1_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x06C)) | ||
122 | #define RAS2_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x070)) | ||
123 | #define RAS3_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x074)) | ||
124 | #define RAS4_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x078)) | ||
125 | /* aux clk synthesiser register masks for irda to ras4 */ | ||
126 | #define AUX_EQ_SEL_SHIFT 30 | ||
127 | #define AUX_EQ_SEL_MASK 1 | ||
128 | #define AUX_EQ1_SEL 0 | ||
129 | #define AUX_EQ2_SEL 1 | ||
130 | #define AUX_XSCALE_SHIFT 16 | ||
131 | #define AUX_XSCALE_MASK 0xFFF | ||
132 | #define AUX_YSCALE_SHIFT 0 | ||
133 | #define AUX_YSCALE_MASK 0xFFF | ||
134 | |||
135 | #define ICM1_ARB_CFG ((unsigned int *)(MISC_BASE + 0x07C)) | ||
136 | #define ICM2_ARB_CFG ((unsigned int *)(MISC_BASE + 0x080)) | ||
137 | #define ICM3_ARB_CFG ((unsigned int *)(MISC_BASE + 0x084)) | ||
138 | #define ICM4_ARB_CFG ((unsigned int *)(MISC_BASE + 0x088)) | ||
139 | #define ICM5_ARB_CFG ((unsigned int *)(MISC_BASE + 0x08C)) | ||
140 | #define ICM6_ARB_CFG ((unsigned int *)(MISC_BASE + 0x090)) | ||
141 | #define ICM7_ARB_CFG ((unsigned int *)(MISC_BASE + 0x094)) | ||
142 | #define ICM8_ARB_CFG ((unsigned int *)(MISC_BASE + 0x098)) | ||
143 | #define ICM9_ARB_CFG ((unsigned int *)(MISC_BASE + 0x09C)) | ||
144 | #define DMA_CHN_CFG ((unsigned int *)(MISC_BASE + 0x0A0)) | ||
145 | #define USB2_PHY_CFG ((unsigned int *)(MISC_BASE + 0x0A4)) | ||
146 | #define GMAC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0A8)) | ||
147 | #define EXPI_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0AC)) | ||
148 | #define PRC1_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C0)) | ||
149 | #define PRC2_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C4)) | ||
150 | #define PRC3_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C8)) | ||
151 | #define PRC4_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0CC)) | ||
152 | #define PRC1_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D0)) | ||
153 | #define PRC2_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D4)) | ||
154 | #define PRC3_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D8)) | ||
155 | #define PRC4_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0DC)) | ||
156 | #define PWRDOWN_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0E0)) | ||
157 | #define COMPSSTL_1V8_CFG ((unsigned int *)(MISC_BASE + 0x0E4)) | ||
158 | #define COMPSSTL_2V5_CFG ((unsigned int *)(MISC_BASE + 0x0E8)) | ||
159 | #define COMPCOR_3V3_CFG ((unsigned int *)(MISC_BASE + 0x0EC)) | ||
160 | #define SSTLPAD_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F0)) | ||
161 | #define BIST1_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F4)) | ||
162 | #define BIST2_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F8)) | ||
163 | #define BIST3_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0FC)) | ||
164 | #define BIST4_CFG_CTR ((unsigned int *)(MISC_BASE + 0x100)) | ||
165 | #define BIST5_CFG_CTR ((unsigned int *)(MISC_BASE + 0x104)) | ||
166 | #define BIST1_STS_RES ((unsigned int *)(MISC_BASE + 0x108)) | ||
167 | #define BIST2_STS_RES ((unsigned int *)(MISC_BASE + 0x10C)) | ||
168 | #define BIST3_STS_RES ((unsigned int *)(MISC_BASE + 0x110)) | ||
169 | #define BIST4_STS_RES ((unsigned int *)(MISC_BASE + 0x114)) | ||
170 | #define BIST5_STS_RES ((unsigned int *)(MISC_BASE + 0x118)) | ||
171 | #define SYSERR_CFG_CTR ((unsigned int *)(MISC_BASE + 0x11C)) | ||
172 | |||
173 | #endif /* __MACH_MISC_REGS_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/spear.h b/arch/arm/mach-spear6xx/include/mach/spear.h new file mode 100644 index 000000000000..a835f5b6b182 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/spear.h | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/spear.h | ||
3 | * | ||
4 | * SPEAr6xx Machine family specific definition | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_SPEAR6XX_H | ||
15 | #define __MACH_SPEAR6XX_H | ||
16 | |||
17 | #include <mach/hardware.h> | ||
18 | #include <mach/spear600.h> | ||
19 | |||
20 | #define SPEAR6XX_ML_SDRAM_BASE 0x00000000 | ||
21 | #define SPEAR6XX_ML_SDRAM_SIZE 0x40000000 | ||
22 | |||
23 | /* ICM1 - Low speed connection */ | ||
24 | #define SPEAR6XX_ICM1_BASE 0xD0000000 | ||
25 | #define SPEAR6XX_ICM1_SIZE 0x08000000 | ||
26 | |||
27 | #define SPEAR6XX_ICM1_UART0_BASE 0xD0000000 | ||
28 | #define VA_SPEAR6XX_ICM1_UART0_BASE IO_ADDRESS(SPEAR6XX_ICM1_UART0_BASE) | ||
29 | #define SPEAR6XX_ICM1_UART0_SIZE 0x00080000 | ||
30 | |||
31 | #define SPEAR6XX_ICM1_UART1_BASE 0xD0080000 | ||
32 | #define SPEAR6XX_ICM1_UART1_SIZE 0x00080000 | ||
33 | |||
34 | #define SPEAR6XX_ICM1_SSP0_BASE 0xD0100000 | ||
35 | #define SPEAR6XX_ICM1_SSP0_SIZE 0x00080000 | ||
36 | |||
37 | #define SPEAR6XX_ICM1_SSP1_BASE 0xD0180000 | ||
38 | #define SPEAR6XX_ICM1_SSP1_SIZE 0x00080000 | ||
39 | |||
40 | #define SPEAR6XX_ICM1_I2C_BASE 0xD0200000 | ||
41 | #define SPEAR6XX_ICM1_I2C_SIZE 0x00080000 | ||
42 | |||
43 | #define SPEAR6XX_ICM1_JPEG_BASE 0xD0800000 | ||
44 | #define SPEAR6XX_ICM1_JPEG_SIZE 0x00800000 | ||
45 | |||
46 | #define SPEAR6XX_ICM1_IRDA_BASE 0xD1000000 | ||
47 | #define SPEAR6XX_ICM1_IRDA_SIZE 0x00800000 | ||
48 | |||
49 | #define SPEAR6XX_ICM1_FSMC_BASE 0xD1800000 | ||
50 | #define SPEAR6XX_ICM1_FSMC_SIZE 0x00800000 | ||
51 | |||
52 | #define SPEAR6XX_ICM1_NAND_BASE 0xD2000000 | ||
53 | #define SPEAR6XX_ICM1_NAND_SIZE 0x00800000 | ||
54 | |||
55 | #define SPEAR6XX_ICM1_SRAM_BASE 0xD2800000 | ||
56 | #define SPEAR6XX_ICM1_SRAM_SIZE 0x00800000 | ||
57 | |||
58 | /* ICM2 - Application Subsystem */ | ||
59 | #define SPEAR6XX_ICM2_BASE 0xD8000000 | ||
60 | #define SPEAR6XX_ICM2_SIZE 0x08000000 | ||
61 | |||
62 | #define SPEAR6XX_ICM2_TMR0_BASE 0xD8000000 | ||
63 | #define SPEAR6XX_ICM2_TMR0_SIZE 0x00080000 | ||
64 | |||
65 | #define SPEAR6XX_ICM2_TMR1_BASE 0xD8080000 | ||
66 | #define SPEAR6XX_ICM2_TMR1_SIZE 0x00080000 | ||
67 | |||
68 | #define SPEAR6XX_ICM2_GPIO_BASE 0xD8100000 | ||
69 | #define SPEAR6XX_ICM2_GPIO_SIZE 0x00080000 | ||
70 | |||
71 | #define SPEAR6XX_ICM2_SPI2_BASE 0xD8180000 | ||
72 | #define SPEAR6XX_ICM2_SPI2_SIZE 0x00080000 | ||
73 | |||
74 | #define SPEAR6XX_ICM2_ADC_BASE 0xD8200000 | ||
75 | #define SPEAR6XX_ICM2_ADC_SIZE 0x00080000 | ||
76 | |||
77 | /* ML-1, 2 - Multi Layer CPU Subsystem */ | ||
78 | #define SPEAR6XX_ML_CPU_BASE 0xF0000000 | ||
79 | #define SPEAR6XX_ML_CPU_SIZE 0x08000000 | ||
80 | |||
81 | #define SPEAR6XX_CPU_TMR_BASE 0xF0000000 | ||
82 | #define SPEAR6XX_CPU_TMR_SIZE 0x00100000 | ||
83 | |||
84 | #define SPEAR6XX_CPU_GPIO_BASE 0xF0100000 | ||
85 | #define SPEAR6XX_CPU_GPIO_SIZE 0x00100000 | ||
86 | |||
87 | #define SPEAR6XX_CPU_VIC_SEC_BASE 0xF1000000 | ||
88 | #define VA_SPEAR6XX_CPU_VIC_SEC_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_SEC_BASE) | ||
89 | #define SPEAR6XX_CPU_VIC_SEC_SIZE 0x00100000 | ||
90 | |||
91 | #define SPEAR6XX_CPU_VIC_PRI_BASE 0xF1100000 | ||
92 | #define VA_SPEAR6XX_CPU_VIC_PRI_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_PRI_BASE) | ||
93 | #define SPEAR6XX_CPU_VIC_PRI_SIZE 0x00100000 | ||
94 | |||
95 | /* ICM3 - Basic Subsystem */ | ||
96 | #define SPEAR6XX_ICM3_BASE 0xF8000000 | ||
97 | #define SPEAR6XX_ICM3_SIZE 0x08000000 | ||
98 | |||
99 | #define SPEAR6XX_ICM3_SMEM_BASE 0xF8000000 | ||
100 | #define SPEAR6XX_ICM3_SMEM_SIZE 0x04000000 | ||
101 | |||
102 | #define SPEAR6XX_ICM3_SMI_CTRL_BASE 0xFC000000 | ||
103 | #define SPEAR6XX_ICM3_SMI_CTRL_SIZE 0x00200000 | ||
104 | |||
105 | #define SPEAR6XX_ICM3_CLCD_BASE 0xFC200000 | ||
106 | #define SPEAR6XX_ICM3_CLCD_SIZE 0x00200000 | ||
107 | |||
108 | #define SPEAR6XX_ICM3_DMA_BASE 0xFC400000 | ||
109 | #define SPEAR6XX_ICM3_DMA_SIZE 0x00200000 | ||
110 | |||
111 | #define SPEAR6XX_ICM3_SDRAM_CTRL_BASE 0xFC600000 | ||
112 | #define SPEAR6XX_ICM3_SDRAM_CTRL_SIZE 0x00200000 | ||
113 | |||
114 | #define SPEAR6XX_ICM3_TMR_BASE 0xFC800000 | ||
115 | #define SPEAR6XX_ICM3_TMR_SIZE 0x00080000 | ||
116 | |||
117 | #define SPEAR6XX_ICM3_WDT_BASE 0xFC880000 | ||
118 | #define SPEAR6XX_ICM3_WDT_SIZE 0x00080000 | ||
119 | |||
120 | #define SPEAR6XX_ICM3_RTC_BASE 0xFC900000 | ||
121 | #define SPEAR6XX_ICM3_RTC_SIZE 0x00080000 | ||
122 | |||
123 | #define SPEAR6XX_ICM3_GPIO_BASE 0xFC980000 | ||
124 | #define SPEAR6XX_ICM3_GPIO_SIZE 0x00080000 | ||
125 | |||
126 | #define SPEAR6XX_ICM3_SYS_CTRL_BASE 0xFCA00000 | ||
127 | #define VA_SPEAR6XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR6XX_ICM3_SYS_CTRL_BASE) | ||
128 | #define SPEAR6XX_ICM3_SYS_CTRL_SIZE 0x00080000 | ||
129 | |||
130 | #define SPEAR6XX_ICM3_MISC_REG_BASE 0xFCA80000 | ||
131 | #define VA_SPEAR6XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR6XX_ICM3_MISC_REG_BASE) | ||
132 | #define SPEAR6XX_ICM3_MISC_REG_SIZE 0x00080000 | ||
133 | |||
134 | /* ICM4 - High Speed Connection */ | ||
135 | #define SPEAR6XX_ICM4_BASE 0xE0000000 | ||
136 | #define SPEAR6XX_ICM4_SIZE 0x08000000 | ||
137 | |||
138 | #define SPEAR6XX_ICM4_GMAC_BASE 0xE0800000 | ||
139 | #define SPEAR6XX_ICM4_GMAC_SIZE 0x00800000 | ||
140 | |||
141 | #define SPEAR6XX_ICM4_USBD_FIFO_BASE 0xE1000000 | ||
142 | #define SPEAR6XX_ICM4_USBD_FIFO_SIZE 0x00100000 | ||
143 | |||
144 | #define SPEAR6XX_ICM4_USBD_CSR_BASE 0xE1100000 | ||
145 | #define SPEAR6XX_ICM4_USBD_CSR_SIZE 0x00100000 | ||
146 | |||
147 | #define SPEAR6XX_ICM4_USBD_PLDT_BASE 0xE1200000 | ||
148 | #define SPEAR6XX_ICM4_USBD_PLDT_SIZE 0x00100000 | ||
149 | |||
150 | #define SPEAR6XX_ICM4_USB_EHCI0_BASE 0xE1800000 | ||
151 | #define SPEAR6XX_ICM4_USB_EHCI0_SIZE 0x00100000 | ||
152 | |||
153 | #define SPEAR6XX_ICM4_USB_OHCI0_BASE 0xE1900000 | ||
154 | #define SPEAR6XX_ICM4_USB_OHCI0_SIZE 0x00100000 | ||
155 | |||
156 | #define SPEAR6XX_ICM4_USB_EHCI1_BASE 0xE2000000 | ||
157 | #define SPEAR6XX_ICM4_USB_EHCI1_SIZE 0x00100000 | ||
158 | |||
159 | #define SPEAR6XX_ICM4_USB_OHCI1_BASE 0xE2100000 | ||
160 | #define SPEAR6XX_ICM4_USB_OHCI1_SIZE 0x00100000 | ||
161 | |||
162 | #define SPEAR6XX_ICM4_USB_ARB_BASE 0xE2800000 | ||
163 | #define SPEAR6XX_ICM4_USB_ARB_SIZE 0x00010000 | ||
164 | |||
165 | /* Debug uart for linux, will be used for debug and uncompress messages */ | ||
166 | #define SPEAR_DBG_UART_BASE SPEAR6XX_ICM1_UART0_BASE | ||
167 | #define VA_SPEAR_DBG_UART_BASE VA_SPEAR6XX_ICM1_UART0_BASE | ||
168 | |||
169 | /* Sysctl base for spear platform */ | ||
170 | #define SPEAR_SYS_CTRL_BASE SPEAR6XX_ICM3_SYS_CTRL_BASE | ||
171 | #define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR6XX_ICM3_SYS_CTRL_BASE | ||
172 | |||
173 | #endif /* __MACH_SPEAR6XX_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/spear600.h b/arch/arm/mach-spear6xx/include/mach/spear600.h new file mode 100644 index 000000000000..c068cc50b0fb --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/spear600.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear66xx/include/mach/spear600.h | ||
3 | * | ||
4 | * SPEAr600 Machine specific definition | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifdef CONFIG_MACH_SPEAR600 | ||
15 | |||
16 | #ifndef __MACH_SPEAR600_H | ||
17 | #define __MACH_SPEAR600_H | ||
18 | |||
19 | #endif /* __MACH_SPEAR600_H */ | ||
20 | |||
21 | #endif /* CONFIG_MACH_SPEAR600 */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/system.h b/arch/arm/mach-spear6xx/include/mach/system.h new file mode 100644 index 000000000000..0b1d2be81cfb --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/system.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/system.h | ||
3 | * | ||
4 | * SPEAr6xx Machine family specific architecture functions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_SYSTEM_H | ||
15 | #define __MACH_SYSTEM_H | ||
16 | |||
17 | #include <plat/system.h> | ||
18 | |||
19 | #endif /* __MACH_SYSTEM_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/timex.h b/arch/arm/mach-spear6xx/include/mach/timex.h new file mode 100644 index 000000000000..ac1c5b005695 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/timex.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/timex.h | ||
3 | * | ||
4 | * SPEAr6XX machine family specific timex definitions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_TIMEX_H | ||
15 | #define __MACH_TIMEX_H | ||
16 | |||
17 | #include <plat/timex.h> | ||
18 | |||
19 | #endif /* __MACH_TIMEX_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/uncompress.h b/arch/arm/mach-spear6xx/include/mach/uncompress.h new file mode 100644 index 000000000000..77f0765e21e1 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/uncompress.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/uncompress.h | ||
3 | * | ||
4 | * Serial port stubs for kernel decompress status messages | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_UNCOMPRESS_H | ||
15 | #define __MACH_UNCOMPRESS_H | ||
16 | |||
17 | #include <plat/uncompress.h> | ||
18 | |||
19 | #endif /* __MACH_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/vmalloc.h b/arch/arm/mach-spear6xx/include/mach/vmalloc.h new file mode 100644 index 000000000000..4a0b56cb2a91 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/vmalloc.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/include/mach/vmalloc.h | ||
3 | * | ||
4 | * Defining Vmalloc area for SPEAr6xx machine family | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MACH_VMALLOC_H | ||
15 | #define __MACH_VMALLOC_H | ||
16 | |||
17 | #include <plat/vmalloc.h> | ||
18 | |||
19 | #endif /* __MACH_VMALLOC_H */ | ||
diff --git a/arch/arm/mach-spear6xx/spear600.c b/arch/arm/mach-spear6xx/spear600.c new file mode 100644 index 000000000000..5c484c433dc1 --- /dev/null +++ b/arch/arm/mach-spear6xx/spear600.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/spear600.c | ||
3 | * | ||
4 | * SPEAr600 machine source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/ptrace.h> | ||
15 | #include <asm/irq.h> | ||
16 | #include <mach/generic.h> | ||
17 | #include <mach/spear.h> | ||
18 | |||
19 | /* Add spear600 specific devices here */ | ||
20 | |||
21 | void __init spear600_init(void) | ||
22 | { | ||
23 | /* call spear6xx family common init function */ | ||
24 | spear6xx_init(); | ||
25 | } | ||
diff --git a/arch/arm/mach-spear6xx/spear600_evb.c b/arch/arm/mach-spear6xx/spear600_evb.c new file mode 100644 index 000000000000..daff8d04f7b6 --- /dev/null +++ b/arch/arm/mach-spear6xx/spear600_evb.c | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/spear600_evb.c | ||
3 | * | ||
4 | * SPEAr600 evaluation board source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <asm/mach/arch.h> | ||
15 | #include <asm/mach-types.h> | ||
16 | #include <mach/generic.h> | ||
17 | #include <mach/spear.h> | ||
18 | |||
19 | static struct amba_device *amba_devs[] __initdata = { | ||
20 | &gpio_device[0], | ||
21 | &gpio_device[1], | ||
22 | &gpio_device[2], | ||
23 | &uart_device[0], | ||
24 | &uart_device[1], | ||
25 | }; | ||
26 | |||
27 | static struct platform_device *plat_devs[] __initdata = { | ||
28 | }; | ||
29 | |||
30 | static void __init spear600_evb_init(void) | ||
31 | { | ||
32 | unsigned int i; | ||
33 | |||
34 | /* call spear600 machine init function */ | ||
35 | spear600_init(); | ||
36 | |||
37 | /* Add Platform Devices */ | ||
38 | platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); | ||
39 | |||
40 | /* Add Amba Devices */ | ||
41 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
42 | amba_device_register(amba_devs[i], &iomem_resource); | ||
43 | } | ||
44 | |||
45 | MACHINE_START(SPEAR600, "ST-SPEAR600-EVB") | ||
46 | .boot_params = 0x00000100, | ||
47 | .map_io = spear6xx_map_io, | ||
48 | .init_irq = spear6xx_init_irq, | ||
49 | .timer = &spear_sys_timer, | ||
50 | .init_machine = spear600_evb_init, | ||
51 | MACHINE_END | ||
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c new file mode 100644 index 000000000000..b67e571d4bf7 --- /dev/null +++ b/arch/arm/mach-spear6xx/spear6xx.c | |||
@@ -0,0 +1,158 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-spear6xx/spear6xx.c | ||
3 | * | ||
4 | * SPEAr6XX machines common source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/amba/pl061.h> | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/ptrace.h> | ||
18 | #include <linux/io.h> | ||
19 | #include <asm/hardware/vic.h> | ||
20 | #include <asm/irq.h> | ||
21 | #include <asm/mach/arch.h> | ||
22 | #include <mach/irqs.h> | ||
23 | #include <mach/generic.h> | ||
24 | #include <mach/spear.h> | ||
25 | |||
26 | /* Add spear6xx machines common devices here */ | ||
27 | /* uart device registeration */ | ||
28 | struct amba_device uart_device[] = { | ||
29 | { | ||
30 | .dev = { | ||
31 | .init_name = "uart0", | ||
32 | }, | ||
33 | .res = { | ||
34 | .start = SPEAR6XX_ICM1_UART0_BASE, | ||
35 | .end = SPEAR6XX_ICM1_UART0_BASE + | ||
36 | SPEAR6XX_ICM1_UART0_SIZE - 1, | ||
37 | .flags = IORESOURCE_MEM, | ||
38 | }, | ||
39 | .irq = {IRQ_UART_0, NO_IRQ}, | ||
40 | }, { | ||
41 | .dev = { | ||
42 | .init_name = "uart1", | ||
43 | }, | ||
44 | .res = { | ||
45 | .start = SPEAR6XX_ICM1_UART1_BASE, | ||
46 | .end = SPEAR6XX_ICM1_UART1_BASE + | ||
47 | SPEAR6XX_ICM1_UART1_SIZE - 1, | ||
48 | .flags = IORESOURCE_MEM, | ||
49 | }, | ||
50 | .irq = {IRQ_UART_1, NO_IRQ}, | ||
51 | } | ||
52 | }; | ||
53 | |||
54 | /* gpio device registeration */ | ||
55 | static struct pl061_platform_data gpio_plat_data[] = { | ||
56 | { | ||
57 | .gpio_base = 0, | ||
58 | .irq_base = SPEAR_GPIO0_INT_BASE, | ||
59 | }, { | ||
60 | .gpio_base = 8, | ||
61 | .irq_base = SPEAR_GPIO1_INT_BASE, | ||
62 | }, { | ||
63 | .gpio_base = 16, | ||
64 | .irq_base = SPEAR_GPIO2_INT_BASE, | ||
65 | }, | ||
66 | }; | ||
67 | |||
68 | struct amba_device gpio_device[] = { | ||
69 | { | ||
70 | .dev = { | ||
71 | .init_name = "gpio0", | ||
72 | .platform_data = &gpio_plat_data[0], | ||
73 | }, | ||
74 | .res = { | ||
75 | .start = SPEAR6XX_CPU_GPIO_BASE, | ||
76 | .end = SPEAR6XX_CPU_GPIO_BASE + | ||
77 | SPEAR6XX_CPU_GPIO_SIZE - 1, | ||
78 | .flags = IORESOURCE_MEM, | ||
79 | }, | ||
80 | .irq = {IRQ_LOCAL_GPIO, NO_IRQ}, | ||
81 | }, { | ||
82 | .dev = { | ||
83 | .init_name = "gpio1", | ||
84 | .platform_data = &gpio_plat_data[1], | ||
85 | }, | ||
86 | .res = { | ||
87 | .start = SPEAR6XX_ICM3_GPIO_BASE, | ||
88 | .end = SPEAR6XX_ICM3_GPIO_BASE + | ||
89 | SPEAR6XX_ICM3_GPIO_SIZE - 1, | ||
90 | .flags = IORESOURCE_MEM, | ||
91 | }, | ||
92 | .irq = {IRQ_BASIC_GPIO, NO_IRQ}, | ||
93 | }, { | ||
94 | .dev = { | ||
95 | .init_name = "gpio2", | ||
96 | .platform_data = &gpio_plat_data[2], | ||
97 | }, | ||
98 | .res = { | ||
99 | .start = SPEAR6XX_ICM2_GPIO_BASE, | ||
100 | .end = SPEAR6XX_ICM2_GPIO_BASE + | ||
101 | SPEAR6XX_ICM2_GPIO_SIZE - 1, | ||
102 | .flags = IORESOURCE_MEM, | ||
103 | }, | ||
104 | .irq = {IRQ_APPL_GPIO, NO_IRQ}, | ||
105 | } | ||
106 | }; | ||
107 | |||
108 | /* This will add devices, and do machine specific tasks */ | ||
109 | void __init spear6xx_init(void) | ||
110 | { | ||
111 | /* nothing to do for now */ | ||
112 | } | ||
113 | |||
114 | /* This will initialize vic */ | ||
115 | void __init spear6xx_init_irq(void) | ||
116 | { | ||
117 | vic_init((void __iomem *)VA_SPEAR6XX_CPU_VIC_PRI_BASE, 0, ~0, 0); | ||
118 | vic_init((void __iomem *)VA_SPEAR6XX_CPU_VIC_SEC_BASE, 32, ~0, 0); | ||
119 | } | ||
120 | |||
121 | /* Following will create static virtual/physical mappings */ | ||
122 | static struct map_desc spear6xx_io_desc[] __initdata = { | ||
123 | { | ||
124 | .virtual = VA_SPEAR6XX_ICM1_UART0_BASE, | ||
125 | .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE), | ||
126 | .length = SPEAR6XX_ICM1_UART0_SIZE, | ||
127 | .type = MT_DEVICE | ||
128 | }, { | ||
129 | .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE, | ||
130 | .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE), | ||
131 | .length = SPEAR6XX_CPU_VIC_PRI_SIZE, | ||
132 | .type = MT_DEVICE | ||
133 | }, { | ||
134 | .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE, | ||
135 | .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE), | ||
136 | .length = SPEAR6XX_CPU_VIC_SEC_SIZE, | ||
137 | .type = MT_DEVICE | ||
138 | }, { | ||
139 | .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE, | ||
140 | .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE), | ||
141 | .length = SPEAR6XX_ICM3_MISC_REG_BASE, | ||
142 | .type = MT_DEVICE | ||
143 | }, { | ||
144 | .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE, | ||
145 | .pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE), | ||
146 | .length = SPEAR6XX_ICM3_MISC_REG_SIZE, | ||
147 | .type = MT_DEVICE | ||
148 | }, | ||
149 | }; | ||
150 | |||
151 | /* This will create static memory mapping for selected devices */ | ||
152 | void __init spear6xx_map_io(void) | ||
153 | { | ||
154 | iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); | ||
155 | |||
156 | /* This will initialize clock framework */ | ||
157 | clk_init(); | ||
158 | } | ||
diff --git a/arch/arm/mach-u300/mmc.c b/arch/arm/mach-u300/mmc.c index 77fbb1e0e528..88506d030596 100644 --- a/arch/arm/mach-u300/mmc.c +++ b/arch/arm/mach-u300/mmc.c | |||
@@ -102,11 +102,12 @@ int __devinit mmc_init(struct amba_device *adev) | |||
102 | * we have a regulator we can control instead. | 102 | * we have a regulator we can control instead. |
103 | */ | 103 | */ |
104 | /* Nominally 2.85V on our platform */ | 104 | /* Nominally 2.85V on our platform */ |
105 | mmci_card->mmc0_plat_data.f_max = 24000000; | ||
105 | mmci_card->mmc0_plat_data.status = mmc_status; | 106 | mmci_card->mmc0_plat_data.status = mmc_status; |
106 | mmci_card->mmc0_plat_data.gpio_wp = -1; | 107 | mmci_card->mmc0_plat_data.gpio_wp = -1; |
107 | mmci_card->mmc0_plat_data.gpio_cd = -1; | 108 | mmci_card->mmc0_plat_data.gpio_cd = -1; |
108 | mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED | | 109 | mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED | |
109 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA; | 110 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; |
110 | 111 | ||
111 | mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; | 112 | mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; |
112 | 113 | ||
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 03625d744857..6625e5bbf4d6 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig | |||
@@ -1,15 +1,42 @@ | |||
1 | menu "ST-Ericsson platform type" | 1 | if ARCH_U8500 |
2 | depends on ARCH_U8500 | ||
3 | 2 | ||
4 | comment "ST-Ericsson Multicore Mobile Platforms" | 3 | config UX500_SOC_COMMON |
5 | 4 | bool | |
6 | config MACH_U8500_MOP | ||
7 | bool "U8500 Early Development platform" | ||
8 | default y | 5 | default y |
9 | select ARM_GIC | 6 | select ARM_GIC |
10 | select HAS_MTU | 7 | select HAS_MTU |
8 | select NOMADIK_GPIO | ||
9 | |||
10 | config UX500_SOC_DB8500 | ||
11 | bool | ||
12 | |||
13 | config UX500_SOC_DB5500 | ||
14 | bool | ||
15 | |||
16 | choice | ||
17 | prompt "Ux500 target platform" | ||
18 | default MACH_U8500_MOP | ||
19 | |||
20 | config MACH_U8500_MOP | ||
21 | bool "U8500 Development platform" | ||
22 | select UX500_SOC_DB8500 | ||
11 | help | 23 | help |
12 | Include support for mop500 development platform | 24 | Include support for mop500 development platform |
13 | based on U8500 architecture. The platform is based | 25 | based on U8500 architecture. The platform is based |
14 | on early drop silicon version of 8500. | 26 | on early drop silicon version of 8500. |
15 | endmenu | 27 | |
28 | config MACH_U5500 | ||
29 | bool "U5500 Development platform" | ||
30 | select UX500_SOC_DB5500 | ||
31 | help | ||
32 | Include support for the U5500 development platform. | ||
33 | endchoice | ||
34 | |||
35 | config UX500_DEBUG_UART | ||
36 | int "Ux500 UART to use for low-level debug" | ||
37 | default 2 | ||
38 | help | ||
39 | Choose the UART on which kernel low-level debug messages should be | ||
40 | output. | ||
41 | |||
42 | endif | ||
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile index 95e6e24c0042..c7bc4199e3a8 100644 --- a/arch/arm/mach-ux500/Makefile +++ b/arch/arm/mach-ux500/Makefile | |||
@@ -2,7 +2,9 @@ | |||
2 | # Makefile for the linux kernel, U8500 machine. | 2 | # Makefile for the linux kernel, U8500 machine. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := clock.o | 5 | obj-y := clock.o cpu.o devices.o |
6 | obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o | 6 | obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o devices-db5500.o |
7 | obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o | ||
7 | obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o | 8 | obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o |
9 | obj-$(CONFIG_MACH_U5500) += board-u5500.o | ||
8 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o | 10 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 803aec1d6728..072196c57263 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -17,37 +17,14 @@ | |||
17 | #include <linux/amba/pl022.h> | 17 | #include <linux/amba/pl022.h> |
18 | #include <linux/spi/spi.h> | 18 | #include <linux/spi/spi.h> |
19 | 19 | ||
20 | #include <asm/localtimer.h> | ||
21 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
22 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
23 | 22 | ||
24 | #include <plat/mtu.h> | ||
25 | #include <plat/i2c.h> | 23 | #include <plat/i2c.h> |
26 | 24 | ||
27 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
28 | #include <mach/setup.h> | 26 | #include <mach/setup.h> |
29 | 27 | #include <mach/devices.h> | |
30 | #define __MEM_4K_RESOURCE(x) \ | ||
31 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | ||
32 | |||
33 | /* These are active devices on this board */ | ||
34 | static struct amba_device uart0_device = { | ||
35 | .dev = { .init_name = "uart0" }, | ||
36 | __MEM_4K_RESOURCE(U8500_UART0_BASE), | ||
37 | .irq = {IRQ_UART0, NO_IRQ}, | ||
38 | }; | ||
39 | |||
40 | static struct amba_device uart1_device = { | ||
41 | .dev = { .init_name = "uart1" }, | ||
42 | __MEM_4K_RESOURCE(U8500_UART1_BASE), | ||
43 | .irq = {IRQ_UART1, NO_IRQ}, | ||
44 | }; | ||
45 | |||
46 | static struct amba_device uart2_device = { | ||
47 | .dev = { .init_name = "uart2" }, | ||
48 | __MEM_4K_RESOURCE(U8500_UART2_BASE), | ||
49 | .irq = {IRQ_UART2, NO_IRQ}, | ||
50 | }; | ||
51 | 28 | ||
52 | static void ab4500_spi_cs_control(u32 command) | 29 | static void ab4500_spi_cs_control(u32 command) |
53 | { | 30 | { |
@@ -93,55 +70,8 @@ static struct pl022_ssp_controller ssp0_platform_data = { | |||
93 | .num_chipselect = 5, | 70 | .num_chipselect = 5, |
94 | }; | 71 | }; |
95 | 72 | ||
96 | static struct amba_device pl022_device = { | ||
97 | .dev = { | ||
98 | .coherent_dma_mask = ~0, | ||
99 | .init_name = "pl022", | ||
100 | .platform_data = &ssp0_platform_data, | ||
101 | }, | ||
102 | .res = { | ||
103 | .start = U8500_SSP0_BASE, | ||
104 | .end = U8500_SSP0_BASE + SZ_4K - 1, | ||
105 | .flags = IORESOURCE_MEM, | ||
106 | }, | ||
107 | .irq = {IRQ_SSP0, NO_IRQ }, | ||
108 | /* ST-Ericsson modified id */ | ||
109 | .periphid = SSP_PER_ID, | ||
110 | }; | ||
111 | |||
112 | static struct amba_device pl031_device = { | ||
113 | .dev = { | ||
114 | .init_name = "pl031", | ||
115 | }, | ||
116 | .res = { | ||
117 | .start = U8500_RTC_BASE, | ||
118 | .end = U8500_RTC_BASE + SZ_4K - 1, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, | ||
121 | .irq = {IRQ_RTC_RTT, NO_IRQ}, | ||
122 | }; | ||
123 | |||
124 | #define U8500_I2C_RESOURCES(id, size) \ | ||
125 | static struct resource u8500_i2c_resources_##id[] = { \ | ||
126 | [0] = { \ | ||
127 | .start = U8500_I2C##id##_BASE, \ | ||
128 | .end = U8500_I2C##id##_BASE + size - 1, \ | ||
129 | .flags = IORESOURCE_MEM, \ | ||
130 | }, \ | ||
131 | [1] = { \ | ||
132 | .start = IRQ_I2C##id, \ | ||
133 | .end = IRQ_I2C##id, \ | ||
134 | .flags = IORESOURCE_IRQ \ | ||
135 | } \ | ||
136 | } | ||
137 | |||
138 | U8500_I2C_RESOURCES(0, SZ_4K); | ||
139 | U8500_I2C_RESOURCES(1, SZ_4K); | ||
140 | U8500_I2C_RESOURCES(2, SZ_4K); | ||
141 | U8500_I2C_RESOURCES(3, SZ_4K); | ||
142 | |||
143 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ | 73 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ |
144 | static struct nmk_i2c_controller u8500_i2c_##id = { \ | 74 | static struct nmk_i2c_controller u8500_i2c##id##_data = { \ |
145 | /* \ | 75 | /* \ |
146 | * slave data setup time, which is \ | 76 | * slave data setup time, which is \ |
147 | * 250 ns,100ns,10ns which is 14,6,2 \ | 77 | * 250 ns,100ns,10ns which is 14,6,2 \ |
@@ -169,58 +99,32 @@ U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | |||
169 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | 99 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); |
170 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | 100 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); |
171 | 101 | ||
172 | #define U8500_I2C_PDEVICE(cid) \ | ||
173 | static struct platform_device i2c_controller##cid = { \ | ||
174 | .name = "nmk-i2c", \ | ||
175 | .id = cid, \ | ||
176 | .num_resources = 2, \ | ||
177 | .resource = u8500_i2c_resources_##cid, \ | ||
178 | .dev = { \ | ||
179 | .platform_data = &u8500_i2c_##cid \ | ||
180 | } \ | ||
181 | } | ||
182 | |||
183 | U8500_I2C_PDEVICE(0); | ||
184 | U8500_I2C_PDEVICE(1); | ||
185 | U8500_I2C_PDEVICE(2); | ||
186 | U8500_I2C_PDEVICE(3); | ||
187 | |||
188 | static struct amba_device *amba_devs[] __initdata = { | 102 | static struct amba_device *amba_devs[] __initdata = { |
189 | &uart0_device, | 103 | &ux500_uart0_device, |
190 | &uart1_device, | 104 | &ux500_uart1_device, |
191 | &uart2_device, | 105 | &ux500_uart2_device, |
192 | &pl022_device, | 106 | &u8500_ssp0_device, |
193 | &pl031_device, | ||
194 | }; | 107 | }; |
195 | 108 | ||
196 | /* add any platform devices here - TODO */ | 109 | /* add any platform devices here - TODO */ |
197 | static struct platform_device *platform_devs[] __initdata = { | 110 | static struct platform_device *platform_devs[] __initdata = { |
198 | &i2c_controller0, | 111 | &u8500_i2c0_device, |
199 | &i2c_controller1, | 112 | &ux500_i2c1_device, |
200 | &i2c_controller2, | 113 | &ux500_i2c2_device, |
201 | &i2c_controller3, | 114 | &ux500_i2c3_device, |
202 | }; | ||
203 | |||
204 | static void __init u8500_timer_init(void) | ||
205 | { | ||
206 | #ifdef CONFIG_LOCAL_TIMERS | ||
207 | /* Setup the local timer base */ | ||
208 | twd_base = __io_address(U8500_TWD_BASE); | ||
209 | #endif | ||
210 | /* Setup the MTU base */ | ||
211 | mtu_base = __io_address(U8500_MTU0_BASE); | ||
212 | |||
213 | nmdk_timer_init(); | ||
214 | } | ||
215 | |||
216 | static struct sys_timer u8500_timer = { | ||
217 | .init = u8500_timer_init, | ||
218 | }; | 115 | }; |
219 | 116 | ||
220 | static void __init u8500_init_machine(void) | 117 | static void __init u8500_init_machine(void) |
221 | { | 118 | { |
222 | int i; | 119 | int i; |
223 | 120 | ||
121 | u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data; | ||
122 | ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data; | ||
123 | ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data; | ||
124 | ux500_i2c3_device.dev.platform_data = &u8500_i2c3_data; | ||
125 | |||
126 | u8500_ssp0_device.dev.platform_data = &ssp0_platform_data; | ||
127 | |||
224 | /* Register the active AMBA devices on this board */ | 128 | /* Register the active AMBA devices on this board */ |
225 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | 129 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
226 | amba_device_register(amba_devs[i], &iomem_resource); | 130 | amba_device_register(amba_devs[i], &iomem_resource); |
@@ -239,8 +143,8 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform") | |||
239 | .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc, | 143 | .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc, |
240 | .boot_params = 0x100, | 144 | .boot_params = 0x100, |
241 | .map_io = u8500_map_io, | 145 | .map_io = u8500_map_io, |
242 | .init_irq = u8500_init_irq, | 146 | .init_irq = ux500_init_irq, |
243 | /* we re-use nomadik timer here */ | 147 | /* we re-use nomadik timer here */ |
244 | .timer = &u8500_timer, | 148 | .timer = &ux500_timer, |
245 | .init_machine = u8500_init_machine, | 149 | .init_machine = u8500_init_machine, |
246 | MACHINE_END | 150 | MACHINE_END |
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c new file mode 100644 index 000000000000..4430e69cf538 --- /dev/null +++ b/arch/arm/mach-ux500/board-u5500.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <linux/init.h> | ||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/amba/bus.h> | ||
11 | #include <linux/gpio.h> | ||
12 | |||
13 | #include <asm/mach/arch.h> | ||
14 | #include <asm/mach-types.h> | ||
15 | |||
16 | #include <mach/hardware.h> | ||
17 | #include <mach/devices.h> | ||
18 | #include <mach/setup.h> | ||
19 | |||
20 | static struct amba_device *amba_board_devs[] __initdata = { | ||
21 | &ux500_uart0_device, | ||
22 | &ux500_uart1_device, | ||
23 | &ux500_uart2_device, | ||
24 | }; | ||
25 | |||
26 | static void __init u5500_init_machine(void) | ||
27 | { | ||
28 | u5500_init_devices(); | ||
29 | |||
30 | amba_add_devices(amba_board_devs, ARRAY_SIZE(amba_board_devs)); | ||
31 | } | ||
32 | |||
33 | MACHINE_START(U8500, "ST-Ericsson U5500 Platform") | ||
34 | .phys_io = UX500_UART0_BASE, | ||
35 | .io_pg_offst = (IO_ADDRESS(UX500_UART0_BASE) >> 18) & 0xfffc, | ||
36 | .boot_params = 0x00000100, | ||
37 | .map_io = u5500_map_io, | ||
38 | .init_irq = ux500_init_irq, | ||
39 | .timer = &ux500_timer, | ||
40 | .init_machine = u5500_init_machine, | ||
41 | MACHINE_END | ||
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c index 8359a73d0041..1b2c9890e8b4 100644 --- a/arch/arm/mach-ux500/clock.c +++ b/arch/arm/mach-ux500/clock.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2009 ST-Ericsson | 2 | * Copyright (C) 2009 ST-Ericsson |
3 | * heavily based on realview platform | 3 | * Copyright (C) 2009 STMicroelectronics |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License version 2 as | 6 | * it under the terms of the GNU General Public License version 2 as |
@@ -12,33 +12,130 @@ | |||
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/mutex.h> | 15 | #include <linux/io.h> |
16 | 16 | ||
17 | #include <asm/clkdev.h> | 17 | #include <asm/clkdev.h> |
18 | 18 | ||
19 | /* currently the clk structure | 19 | #include <mach/hardware.h> |
20 | * just supports rate. This would | 20 | #include "clock.h" |
21 | * be extended as and when new devices are | 21 | |
22 | * added - TODO | 22 | #define PRCC_PCKEN 0x00 |
23 | */ | 23 | #define PRCC_PCKDIS 0x04 |
24 | struct clk { | 24 | #define PRCC_KCKEN 0x08 |
25 | unsigned long rate; | 25 | #define PRCC_KCKDIS 0x0C |
26 | }; | 26 | |
27 | #define PRCM_YYCLKEN0_MGT_SET 0x510 | ||
28 | #define PRCM_YYCLKEN1_MGT_SET 0x514 | ||
29 | #define PRCM_YYCLKEN0_MGT_CLR 0x518 | ||
30 | #define PRCM_YYCLKEN1_MGT_CLR 0x51C | ||
31 | #define PRCM_YYCLKEN0_MGT_VAL 0x520 | ||
32 | #define PRCM_YYCLKEN1_MGT_VAL 0x524 | ||
33 | |||
34 | #define PRCM_SVAMMDSPCLK_MGT 0x008 | ||
35 | #define PRCM_SIAMMDSPCLK_MGT 0x00C | ||
36 | #define PRCM_SGACLK_MGT 0x014 | ||
37 | #define PRCM_UARTCLK_MGT 0x018 | ||
38 | #define PRCM_MSP02CLK_MGT 0x01C | ||
39 | #define PRCM_MSP1CLK_MGT 0x288 | ||
40 | #define PRCM_I2CCLK_MGT 0x020 | ||
41 | #define PRCM_SDMMCCLK_MGT 0x024 | ||
42 | #define PRCM_SLIMCLK_MGT 0x028 | ||
43 | #define PRCM_PER1CLK_MGT 0x02C | ||
44 | #define PRCM_PER2CLK_MGT 0x030 | ||
45 | #define PRCM_PER3CLK_MGT 0x034 | ||
46 | #define PRCM_PER5CLK_MGT 0x038 | ||
47 | #define PRCM_PER6CLK_MGT 0x03C | ||
48 | #define PRCM_PER7CLK_MGT 0x040 | ||
49 | #define PRCM_LCDCLK_MGT 0x044 | ||
50 | #define PRCM_BMLCLK_MGT 0x04C | ||
51 | #define PRCM_HSITXCLK_MGT 0x050 | ||
52 | #define PRCM_HSIRXCLK_MGT 0x054 | ||
53 | #define PRCM_HDMICLK_MGT 0x058 | ||
54 | #define PRCM_APEATCLK_MGT 0x05C | ||
55 | #define PRCM_APETRACECLK_MGT 0x060 | ||
56 | #define PRCM_MCDECLK_MGT 0x064 | ||
57 | #define PRCM_IPI2CCLK_MGT 0x068 | ||
58 | #define PRCM_DSIALTCLK_MGT 0x06C | ||
59 | #define PRCM_DMACLK_MGT 0x074 | ||
60 | #define PRCM_B2R2CLK_MGT 0x078 | ||
61 | #define PRCM_TVCLK_MGT 0x07C | ||
62 | #define PRCM_UNIPROCLK_MGT 0x278 | ||
63 | #define PRCM_SSPCLK_MGT 0x280 | ||
64 | #define PRCM_RNGCLK_MGT 0x284 | ||
65 | #define PRCM_UICCCLK_MGT 0x27C | ||
66 | |||
67 | #define PRCM_MGT_ENABLE (1 << 8) | ||
68 | |||
69 | static DEFINE_SPINLOCK(clocks_lock); | ||
70 | |||
71 | static void __clk_enable(struct clk *clk) | ||
72 | { | ||
73 | if (clk->enabled++ == 0) { | ||
74 | if (clk->parent_cluster) | ||
75 | __clk_enable(clk->parent_cluster); | ||
76 | |||
77 | if (clk->parent_periph) | ||
78 | __clk_enable(clk->parent_periph); | ||
79 | |||
80 | if (clk->ops && clk->ops->enable) | ||
81 | clk->ops->enable(clk); | ||
82 | } | ||
83 | } | ||
27 | 84 | ||
28 | int clk_enable(struct clk *clk) | 85 | int clk_enable(struct clk *clk) |
29 | { | 86 | { |
87 | unsigned long flags; | ||
88 | |||
89 | spin_lock_irqsave(&clocks_lock, flags); | ||
90 | __clk_enable(clk); | ||
91 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
92 | |||
30 | return 0; | 93 | return 0; |
31 | } | 94 | } |
32 | EXPORT_SYMBOL(clk_enable); | 95 | EXPORT_SYMBOL(clk_enable); |
33 | 96 | ||
97 | static void __clk_disable(struct clk *clk) | ||
98 | { | ||
99 | if (--clk->enabled == 0) { | ||
100 | if (clk->ops && clk->ops->disable) | ||
101 | clk->ops->disable(clk); | ||
102 | |||
103 | if (clk->parent_periph) | ||
104 | __clk_disable(clk->parent_periph); | ||
105 | |||
106 | if (clk->parent_cluster) | ||
107 | __clk_disable(clk->parent_cluster); | ||
108 | } | ||
109 | } | ||
110 | |||
34 | void clk_disable(struct clk *clk) | 111 | void clk_disable(struct clk *clk) |
35 | { | 112 | { |
113 | unsigned long flags; | ||
114 | |||
115 | WARN_ON(!clk->enabled); | ||
116 | |||
117 | spin_lock_irqsave(&clocks_lock, flags); | ||
118 | __clk_disable(clk); | ||
119 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
36 | } | 120 | } |
37 | EXPORT_SYMBOL(clk_disable); | 121 | EXPORT_SYMBOL(clk_disable); |
38 | 122 | ||
39 | unsigned long clk_get_rate(struct clk *clk) | 123 | unsigned long clk_get_rate(struct clk *clk) |
40 | { | 124 | { |
41 | return clk->rate; | 125 | unsigned long rate; |
126 | |||
127 | if (clk->ops && clk->ops->get_rate) | ||
128 | return clk->ops->get_rate(clk); | ||
129 | |||
130 | rate = clk->rate; | ||
131 | if (!rate) { | ||
132 | if (clk->parent_periph) | ||
133 | rate = clk_get_rate(clk->parent_periph); | ||
134 | else if (clk->parent_cluster) | ||
135 | rate = clk_get_rate(clk->parent_cluster); | ||
136 | } | ||
137 | |||
138 | return rate; | ||
42 | } | 139 | } |
43 | EXPORT_SYMBOL(clk_get_rate); | 140 | EXPORT_SYMBOL(clk_get_rate); |
44 | 141 | ||
@@ -56,37 +153,373 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
56 | } | 153 | } |
57 | EXPORT_SYMBOL(clk_set_rate); | 154 | EXPORT_SYMBOL(clk_set_rate); |
58 | 155 | ||
59 | /* ssp clock */ | 156 | static void clk_prcmu_enable(struct clk *clk) |
60 | static struct clk ssp_clk = { | 157 | { |
61 | .rate = 48000000, | 158 | void __iomem *cg_set_reg = __io_address(U8500_PRCMU_BASE) |
159 | + PRCM_YYCLKEN0_MGT_SET + clk->prcmu_cg_off; | ||
160 | |||
161 | writel(1 << clk->prcmu_cg_bit, cg_set_reg); | ||
162 | } | ||
163 | |||
164 | static void clk_prcmu_disable(struct clk *clk) | ||
165 | { | ||
166 | void __iomem *cg_clr_reg = __io_address(U8500_PRCMU_BASE) | ||
167 | + PRCM_YYCLKEN0_MGT_CLR + clk->prcmu_cg_off; | ||
168 | |||
169 | writel(1 << clk->prcmu_cg_bit, cg_clr_reg); | ||
170 | } | ||
171 | |||
172 | /* ED doesn't have the combined set/clr registers */ | ||
173 | static void clk_prcmu_ed_enable(struct clk *clk) | ||
174 | { | ||
175 | void __iomem *addr = __io_address(U8500_PRCMU_BASE) | ||
176 | + clk->prcmu_cg_mgt; | ||
177 | |||
178 | writel(readl(addr) | PRCM_MGT_ENABLE, addr); | ||
179 | } | ||
180 | |||
181 | static void clk_prcmu_ed_disable(struct clk *clk) | ||
182 | { | ||
183 | void __iomem *addr = __io_address(U8500_PRCMU_BASE) | ||
184 | + clk->prcmu_cg_mgt; | ||
185 | |||
186 | writel(readl(addr) & ~PRCM_MGT_ENABLE, addr); | ||
187 | } | ||
188 | |||
189 | static struct clkops clk_prcmu_ops = { | ||
190 | .enable = clk_prcmu_enable, | ||
191 | .disable = clk_prcmu_disable, | ||
62 | }; | 192 | }; |
63 | 193 | ||
64 | /* fixed clock */ | 194 | static unsigned int clkrst_base[] = { |
65 | static struct clk f38_clk = { | 195 | [1] = U8500_CLKRST1_BASE, |
66 | .rate = 38400000, | 196 | [2] = U8500_CLKRST2_BASE, |
197 | [3] = U8500_CLKRST3_BASE, | ||
198 | [5] = U8500_CLKRST5_BASE, | ||
199 | [6] = U8500_CLKRST6_BASE, | ||
200 | [7] = U8500_CLKRST7_BASE_ED, | ||
67 | }; | 201 | }; |
68 | 202 | ||
69 | static struct clk_lookup lookups[] = { | 203 | static void clk_prcc_enable(struct clk *clk) |
70 | { | 204 | { |
71 | /* UART0 */ | 205 | void __iomem *addr = __io_address(clkrst_base[clk->cluster]); |
72 | .dev_id = "uart0", | 206 | |
73 | .clk = &f38_clk, | 207 | if (clk->prcc_kernel != -1) |
74 | }, { /* UART1 */ | 208 | writel(1 << clk->prcc_kernel, addr + PRCC_KCKEN); |
75 | .dev_id = "uart1", | 209 | |
76 | .clk = &f38_clk, | 210 | if (clk->prcc_bus != -1) |
77 | }, { /* UART2 */ | 211 | writel(1 << clk->prcc_bus, addr + PRCC_PCKEN); |
78 | .dev_id = "uart2", | 212 | } |
79 | .clk = &f38_clk, | 213 | |
80 | }, { /* SSP */ | 214 | static void clk_prcc_disable(struct clk *clk) |
81 | .dev_id = "pl022", | 215 | { |
82 | .clk = &ssp_clk, | 216 | void __iomem *addr = __io_address(clkrst_base[clk->cluster]); |
83 | } | 217 | |
218 | if (clk->prcc_bus != -1) | ||
219 | writel(1 << clk->prcc_bus, addr + PRCC_PCKDIS); | ||
220 | |||
221 | if (clk->prcc_kernel != -1) | ||
222 | writel(1 << clk->prcc_kernel, addr + PRCC_KCKDIS); | ||
223 | } | ||
224 | |||
225 | static struct clkops clk_prcc_ops = { | ||
226 | .enable = clk_prcc_enable, | ||
227 | .disable = clk_prcc_disable, | ||
228 | }; | ||
229 | |||
230 | static struct clk clk_32khz = { | ||
231 | .rate = 32000, | ||
232 | }; | ||
233 | |||
234 | /* | ||
235 | * PRCMU level clock gating | ||
236 | */ | ||
237 | |||
238 | /* Bank 0 */ | ||
239 | static DEFINE_PRCMU_CLK(svaclk, 0x0, 2, SVAMMDSPCLK); | ||
240 | static DEFINE_PRCMU_CLK(siaclk, 0x0, 3, SIAMMDSPCLK); | ||
241 | static DEFINE_PRCMU_CLK(sgaclk, 0x0, 4, SGACLK); | ||
242 | static DEFINE_PRCMU_CLK_RATE(uartclk, 0x0, 5, UARTCLK, 38400000); | ||
243 | static DEFINE_PRCMU_CLK(msp02clk, 0x0, 6, MSP02CLK); | ||
244 | static DEFINE_PRCMU_CLK(msp1clk, 0x0, 7, MSP1CLK); /* v1 */ | ||
245 | static DEFINE_PRCMU_CLK_RATE(i2cclk, 0x0, 8, I2CCLK, 48000000); | ||
246 | static DEFINE_PRCMU_CLK_RATE(sdmmcclk, 0x0, 9, SDMMCCLK, 50000000); | ||
247 | static DEFINE_PRCMU_CLK(slimclk, 0x0, 10, SLIMCLK); | ||
248 | static DEFINE_PRCMU_CLK(per1clk, 0x0, 11, PER1CLK); | ||
249 | static DEFINE_PRCMU_CLK(per2clk, 0x0, 12, PER2CLK); | ||
250 | static DEFINE_PRCMU_CLK(per3clk, 0x0, 13, PER3CLK); | ||
251 | static DEFINE_PRCMU_CLK(per5clk, 0x0, 14, PER5CLK); | ||
252 | static DEFINE_PRCMU_CLK_RATE(per6clk, 0x0, 15, PER6CLK, 133330000); | ||
253 | static DEFINE_PRCMU_CLK_RATE(per7clk, 0x0, 16, PER7CLK, 100000000); | ||
254 | static DEFINE_PRCMU_CLK(lcdclk, 0x0, 17, LCDCLK); | ||
255 | static DEFINE_PRCMU_CLK(bmlclk, 0x0, 18, BMLCLK); | ||
256 | static DEFINE_PRCMU_CLK(hsitxclk, 0x0, 19, HSITXCLK); | ||
257 | static DEFINE_PRCMU_CLK(hsirxclk, 0x0, 20, HSIRXCLK); | ||
258 | static DEFINE_PRCMU_CLK(hdmiclk, 0x0, 21, HDMICLK); | ||
259 | static DEFINE_PRCMU_CLK(apeatclk, 0x0, 22, APEATCLK); | ||
260 | static DEFINE_PRCMU_CLK(apetraceclk, 0x0, 23, APETRACECLK); | ||
261 | static DEFINE_PRCMU_CLK(mcdeclk, 0x0, 24, MCDECLK); | ||
262 | static DEFINE_PRCMU_CLK(ipi2clk, 0x0, 25, IPI2CCLK); | ||
263 | static DEFINE_PRCMU_CLK(dsialtclk, 0x0, 26, DSIALTCLK); /* v1 */ | ||
264 | static DEFINE_PRCMU_CLK(dmaclk, 0x0, 27, DMACLK); | ||
265 | static DEFINE_PRCMU_CLK(b2r2clk, 0x0, 28, B2R2CLK); | ||
266 | static DEFINE_PRCMU_CLK(tvclk, 0x0, 29, TVCLK); | ||
267 | static DEFINE_PRCMU_CLK(uniproclk, 0x0, 30, UNIPROCLK); /* v1 */ | ||
268 | static DEFINE_PRCMU_CLK_RATE(sspclk, 0x0, 31, SSPCLK, 48000000); /* v1 */ | ||
269 | |||
270 | /* Bank 1 */ | ||
271 | static DEFINE_PRCMU_CLK(rngclk, 0x4, 0, RNGCLK); /* v1 */ | ||
272 | static DEFINE_PRCMU_CLK(uiccclk, 0x4, 1, UICCCLK); /* v1 */ | ||
273 | |||
274 | /* | ||
275 | * PRCC level clock gating | ||
276 | * Format: per#, clk, PCKEN bit, KCKEN bit, parent | ||
277 | */ | ||
278 | |||
279 | /* Peripheral Cluster #1 */ | ||
280 | static DEFINE_PRCC_CLK(1, i2c4, 10, 9, &clk_i2cclk); | ||
281 | static DEFINE_PRCC_CLK(1, gpio0, 9, -1, NULL); | ||
282 | static DEFINE_PRCC_CLK(1, slimbus0, 8, 8, &clk_slimclk); | ||
283 | static DEFINE_PRCC_CLK(1, spi3_ed, 7, 7, NULL); | ||
284 | static DEFINE_PRCC_CLK(1, spi3_v1, 7, -1, NULL); | ||
285 | static DEFINE_PRCC_CLK(1, i2c2, 6, 6, &clk_i2cclk); | ||
286 | static DEFINE_PRCC_CLK(1, sdi0, 5, 5, &clk_sdmmcclk); | ||
287 | static DEFINE_PRCC_CLK(1, msp1_ed, 4, 4, &clk_msp02clk); | ||
288 | static DEFINE_PRCC_CLK(1, msp1_v1, 4, 4, &clk_msp1clk); | ||
289 | static DEFINE_PRCC_CLK(1, msp0, 3, 3, &clk_msp02clk); | ||
290 | static DEFINE_PRCC_CLK(1, i2c1, 2, 2, &clk_i2cclk); | ||
291 | static DEFINE_PRCC_CLK(1, uart1, 1, 1, &clk_uartclk); | ||
292 | static DEFINE_PRCC_CLK(1, uart0, 0, 0, &clk_uartclk); | ||
293 | |||
294 | /* Peripheral Cluster #2 */ | ||
295 | |||
296 | static DEFINE_PRCC_CLK(2, gpio1_ed, 12, -1, NULL); | ||
297 | static DEFINE_PRCC_CLK(2, ssitx_ed, 11, -1, NULL); | ||
298 | static DEFINE_PRCC_CLK(2, ssirx_ed, 10, -1, NULL); | ||
299 | static DEFINE_PRCC_CLK(2, spi0_ed, 9, -1, NULL); | ||
300 | static DEFINE_PRCC_CLK(2, sdi3_ed, 8, 6, &clk_sdmmcclk); | ||
301 | static DEFINE_PRCC_CLK(2, sdi1_ed, 7, 5, &clk_sdmmcclk); | ||
302 | static DEFINE_PRCC_CLK(2, msp2_ed, 6, 4, &clk_msp02clk); | ||
303 | static DEFINE_PRCC_CLK(2, sdi4_ed, 4, 2, &clk_sdmmcclk); | ||
304 | static DEFINE_PRCC_CLK(2, pwl_ed, 3, 1, NULL); | ||
305 | static DEFINE_PRCC_CLK(2, spi1_ed, 2, -1, NULL); | ||
306 | static DEFINE_PRCC_CLK(2, spi2_ed, 1, -1, NULL); | ||
307 | static DEFINE_PRCC_CLK(2, i2c3_ed, 0, 0, &clk_i2cclk); | ||
308 | |||
309 | static DEFINE_PRCC_CLK(2, gpio1_v1, 11, -1, NULL); | ||
310 | static DEFINE_PRCC_CLK(2, ssitx_v1, 10, 7, NULL); | ||
311 | static DEFINE_PRCC_CLK(2, ssirx_v1, 9, 6, NULL); | ||
312 | static DEFINE_PRCC_CLK(2, spi0_v1, 8, -1, NULL); | ||
313 | static DEFINE_PRCC_CLK(2, sdi3_v1, 7, 5, &clk_sdmmcclk); | ||
314 | static DEFINE_PRCC_CLK(2, sdi1_v1, 6, 4, &clk_sdmmcclk); | ||
315 | static DEFINE_PRCC_CLK(2, msp2_v1, 5, 3, &clk_msp02clk); | ||
316 | static DEFINE_PRCC_CLK(2, sdi4_v1, 4, 2, &clk_sdmmcclk); | ||
317 | static DEFINE_PRCC_CLK(2, pwl_v1, 3, 1, NULL); | ||
318 | static DEFINE_PRCC_CLK(2, spi1_v1, 2, -1, NULL); | ||
319 | static DEFINE_PRCC_CLK(2, spi2_v1, 1, -1, NULL); | ||
320 | static DEFINE_PRCC_CLK(2, i2c3_v1, 0, 0, &clk_i2cclk); | ||
321 | |||
322 | /* Peripheral Cluster #3 */ | ||
323 | static DEFINE_PRCC_CLK(3, gpio2, 8, -1, NULL); | ||
324 | static DEFINE_PRCC_CLK(3, sdi5, 7, 7, &clk_sdmmcclk); | ||
325 | static DEFINE_PRCC_CLK(3, uart2, 6, 6, &clk_uartclk); | ||
326 | static DEFINE_PRCC_CLK(3, ske, 5, 5, &clk_32khz); | ||
327 | static DEFINE_PRCC_CLK(3, sdi2, 4, 4, &clk_sdmmcclk); | ||
328 | static DEFINE_PRCC_CLK(3, i2c0, 3, 3, &clk_i2cclk); | ||
329 | static DEFINE_PRCC_CLK(3, ssp1_ed, 2, 2, &clk_i2cclk); | ||
330 | static DEFINE_PRCC_CLK(3, ssp0_ed, 1, 1, &clk_i2cclk); | ||
331 | static DEFINE_PRCC_CLK(3, ssp1_v1, 2, 2, &clk_sspclk); | ||
332 | static DEFINE_PRCC_CLK(3, ssp0_v1, 1, 1, &clk_sspclk); | ||
333 | static DEFINE_PRCC_CLK(3, fsmc, 0, -1, NULL); | ||
334 | |||
335 | /* Peripheral Cluster #4 is in the always on domain */ | ||
336 | |||
337 | /* Peripheral Cluster #5 */ | ||
338 | static DEFINE_PRCC_CLK(5, gpio3, 1, -1, NULL); | ||
339 | static DEFINE_PRCC_CLK(5, usb_ed, 0, 0, &clk_i2cclk); | ||
340 | static DEFINE_PRCC_CLK(5, usb_v1, 0, 0, NULL); | ||
341 | |||
342 | /* Peripheral Cluster #6 */ | ||
343 | |||
344 | static DEFINE_PRCC_CLK(6, mtu1_v1, 8, -1, NULL); | ||
345 | static DEFINE_PRCC_CLK(6, mtu0_v1, 7, -1, NULL); | ||
346 | static DEFINE_PRCC_CLK(6, cfgreg_v1, 6, 6, NULL); | ||
347 | static DEFINE_PRCC_CLK(6, dmc_ed, 6, 6, NULL); | ||
348 | static DEFINE_PRCC_CLK(6, hash1, 5, -1, NULL); | ||
349 | static DEFINE_PRCC_CLK(6, unipro_v1, 4, 1, &clk_uniproclk); | ||
350 | static DEFINE_PRCC_CLK(6, cryp1_ed, 4, -1, NULL); | ||
351 | static DEFINE_PRCC_CLK(6, pka, 3, -1, NULL); | ||
352 | static DEFINE_PRCC_CLK(6, hash0, 2, -1, NULL); | ||
353 | static DEFINE_PRCC_CLK(6, cryp0, 1, -1, NULL); | ||
354 | static DEFINE_PRCC_CLK(6, rng_ed, 0, 0, &clk_i2cclk); | ||
355 | static DEFINE_PRCC_CLK(6, rng_v1, 0, 0, &clk_rngclk); | ||
356 | |||
357 | /* Peripheral Cluster #7 */ | ||
358 | |||
359 | static DEFINE_PRCC_CLK(7, tzpc0_ed, 4, -1, NULL); | ||
360 | static DEFINE_PRCC_CLK(7, mtu1_ed, 3, -1, NULL); | ||
361 | static DEFINE_PRCC_CLK(7, mtu0_ed, 2, -1, NULL); | ||
362 | static DEFINE_PRCC_CLK(7, wdg_ed, 1, -1, NULL); | ||
363 | static DEFINE_PRCC_CLK(7, cfgreg_ed, 0, -1, NULL); | ||
364 | |||
365 | static struct clk_lookup u8500_common_clks[] = { | ||
366 | /* Peripheral Cluster #1 */ | ||
367 | CLK(gpio0, "gpio.0", NULL), | ||
368 | CLK(gpio0, "gpio.1", NULL), | ||
369 | CLK(slimbus0, "slimbus0", NULL), | ||
370 | CLK(i2c2, "nmk-i2c.2", NULL), | ||
371 | CLK(sdi0, "sdi0", NULL), | ||
372 | CLK(msp0, "msp0", NULL), | ||
373 | CLK(i2c1, "nmk-i2c.1", NULL), | ||
374 | CLK(uart1, "uart1", NULL), | ||
375 | CLK(uart0, "uart0", NULL), | ||
376 | |||
377 | /* Peripheral Cluster #3 */ | ||
378 | CLK(gpio2, "gpio.2", NULL), | ||
379 | CLK(gpio2, "gpio.3", NULL), | ||
380 | CLK(gpio2, "gpio.4", NULL), | ||
381 | CLK(gpio2, "gpio.5", NULL), | ||
382 | CLK(sdi5, "sdi5", NULL), | ||
383 | CLK(uart2, "uart2", NULL), | ||
384 | CLK(ske, "ske", NULL), | ||
385 | CLK(sdi2, "sdi2", NULL), | ||
386 | CLK(i2c0, "nmk-i2c.0", NULL), | ||
387 | CLK(fsmc, "fsmc", NULL), | ||
388 | |||
389 | /* Peripheral Cluster #5 */ | ||
390 | CLK(gpio3, "gpio.8", NULL), | ||
391 | |||
392 | /* Peripheral Cluster #6 */ | ||
393 | CLK(hash1, "hash1", NULL), | ||
394 | CLK(pka, "pka", NULL), | ||
395 | CLK(hash0, "hash0", NULL), | ||
396 | CLK(cryp0, "cryp0", NULL), | ||
397 | |||
398 | /* PRCMU level clock gating */ | ||
399 | |||
400 | /* Bank 0 */ | ||
401 | CLK(svaclk, "sva", NULL), | ||
402 | CLK(siaclk, "sia", NULL), | ||
403 | CLK(sgaclk, "sga", NULL), | ||
404 | CLK(slimclk, "slim", NULL), | ||
405 | CLK(lcdclk, "lcd", NULL), | ||
406 | CLK(bmlclk, "bml", NULL), | ||
407 | CLK(hsitxclk, "stm-hsi.0", NULL), | ||
408 | CLK(hsirxclk, "stm-hsi.1", NULL), | ||
409 | CLK(hdmiclk, "hdmi", NULL), | ||
410 | CLK(apeatclk, "apeat", NULL), | ||
411 | CLK(apetraceclk, "apetrace", NULL), | ||
412 | CLK(mcdeclk, "mcde", NULL), | ||
413 | CLK(ipi2clk, "ipi2", NULL), | ||
414 | CLK(dmaclk, "dma40", NULL), | ||
415 | CLK(b2r2clk, "b2r2", NULL), | ||
416 | CLK(tvclk, "tv", NULL), | ||
417 | }; | ||
418 | |||
419 | static struct clk_lookup u8500_ed_clks[] = { | ||
420 | /* Peripheral Cluster #1 */ | ||
421 | CLK(spi3_ed, "spi3", NULL), | ||
422 | CLK(msp1_ed, "msp1", NULL), | ||
423 | |||
424 | /* Peripheral Cluster #2 */ | ||
425 | CLK(gpio1_ed, "gpio.6", NULL), | ||
426 | CLK(gpio1_ed, "gpio.7", NULL), | ||
427 | CLK(ssitx_ed, "ssitx", NULL), | ||
428 | CLK(ssirx_ed, "ssirx", NULL), | ||
429 | CLK(spi0_ed, "spi0", NULL), | ||
430 | CLK(sdi3_ed, "sdi3", NULL), | ||
431 | CLK(sdi1_ed, "sdi1", NULL), | ||
432 | CLK(msp2_ed, "msp2", NULL), | ||
433 | CLK(sdi4_ed, "sdi4", NULL), | ||
434 | CLK(pwl_ed, "pwl", NULL), | ||
435 | CLK(spi1_ed, "spi1", NULL), | ||
436 | CLK(spi2_ed, "spi2", NULL), | ||
437 | CLK(i2c3_ed, "nmk-i2c.3", NULL), | ||
438 | |||
439 | /* Peripheral Cluster #3 */ | ||
440 | CLK(ssp1_ed, "ssp1", NULL), | ||
441 | CLK(ssp0_ed, "ssp0", NULL), | ||
442 | |||
443 | /* Peripheral Cluster #5 */ | ||
444 | CLK(usb_ed, "musb_hdrc.0", "usb"), | ||
445 | |||
446 | /* Peripheral Cluster #6 */ | ||
447 | CLK(dmc_ed, "dmc", NULL), | ||
448 | CLK(cryp1_ed, "cryp1", NULL), | ||
449 | CLK(rng_ed, "rng", NULL), | ||
450 | |||
451 | /* Peripheral Cluster #7 */ | ||
452 | CLK(tzpc0_ed, "tzpc0", NULL), | ||
453 | CLK(mtu1_ed, "mtu1", NULL), | ||
454 | CLK(mtu0_ed, "mtu0", NULL), | ||
455 | CLK(wdg_ed, "wdg", NULL), | ||
456 | CLK(cfgreg_ed, "cfgreg", NULL), | ||
457 | }; | ||
458 | |||
459 | static struct clk_lookup u8500_v1_clks[] = { | ||
460 | /* Peripheral Cluster #1 */ | ||
461 | CLK(i2c4, "nmk-i2c.4", NULL), | ||
462 | CLK(spi3_v1, "spi3", NULL), | ||
463 | CLK(msp1_v1, "msp1", NULL), | ||
464 | |||
465 | /* Peripheral Cluster #2 */ | ||
466 | CLK(gpio1_v1, "gpio.6", NULL), | ||
467 | CLK(gpio1_v1, "gpio.7", NULL), | ||
468 | CLK(ssitx_v1, "ssitx", NULL), | ||
469 | CLK(ssirx_v1, "ssirx", NULL), | ||
470 | CLK(spi0_v1, "spi0", NULL), | ||
471 | CLK(sdi3_v1, "sdi3", NULL), | ||
472 | CLK(sdi1_v1, "sdi1", NULL), | ||
473 | CLK(msp2_v1, "msp2", NULL), | ||
474 | CLK(sdi4_v1, "sdi4", NULL), | ||
475 | CLK(pwl_v1, "pwl", NULL), | ||
476 | CLK(spi1_v1, "spi1", NULL), | ||
477 | CLK(spi2_v1, "spi2", NULL), | ||
478 | CLK(i2c3_v1, "nmk-i2c.3", NULL), | ||
479 | |||
480 | /* Peripheral Cluster #3 */ | ||
481 | CLK(ssp1_v1, "ssp1", NULL), | ||
482 | CLK(ssp0_v1, "ssp0", NULL), | ||
483 | |||
484 | /* Peripheral Cluster #5 */ | ||
485 | CLK(usb_v1, "musb_hdrc.0", "usb"), | ||
486 | |||
487 | /* Peripheral Cluster #6 */ | ||
488 | CLK(mtu1_v1, "mtu1", NULL), | ||
489 | CLK(mtu0_v1, "mtu0", NULL), | ||
490 | CLK(cfgreg_v1, "cfgreg", NULL), | ||
491 | CLK(hash1, "hash1", NULL), | ||
492 | CLK(unipro_v1, "unipro", NULL), | ||
493 | CLK(rng_v1, "rng", NULL), | ||
494 | |||
495 | /* PRCMU level clock gating */ | ||
496 | |||
497 | /* Bank 0 */ | ||
498 | CLK(uniproclk, "uniproclk", NULL), | ||
499 | CLK(dsialtclk, "dsialt", NULL), | ||
500 | |||
501 | /* Bank 1 */ | ||
502 | CLK(rngclk, "rng", NULL), | ||
503 | CLK(uiccclk, "uicc", NULL), | ||
84 | }; | 504 | }; |
85 | 505 | ||
86 | static int __init clk_init(void) | 506 | static int __init clk_init(void) |
87 | { | 507 | { |
88 | /* register the clock lookups */ | 508 | if (cpu_is_u8500ed()) { |
89 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 509 | clk_prcmu_ops.enable = clk_prcmu_ed_enable; |
510 | clk_prcmu_ops.disable = clk_prcmu_ed_disable; | ||
511 | } else if (cpu_is_u5500()) { | ||
512 | /* Clock tree for U5500 not implemented yet */ | ||
513 | clk_prcc_ops.enable = clk_prcc_ops.disable = NULL; | ||
514 | clk_prcmu_ops.enable = clk_prcmu_ops.disable = NULL; | ||
515 | } | ||
516 | |||
517 | clkdev_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks)); | ||
518 | if (cpu_is_u8500ed()) | ||
519 | clkdev_add_table(u8500_ed_clks, ARRAY_SIZE(u8500_ed_clks)); | ||
520 | else | ||
521 | clkdev_add_table(u8500_v1_clks, ARRAY_SIZE(u8500_v1_clks)); | ||
522 | |||
90 | return 0; | 523 | return 0; |
91 | } | 524 | } |
92 | arch_initcall(clk_init); | 525 | arch_initcall(clk_init); |
diff --git a/arch/arm/mach-ux500/clock.h b/arch/arm/mach-ux500/clock.h new file mode 100644 index 000000000000..e4f99b65026f --- /dev/null +++ b/arch/arm/mach-ux500/clock.h | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 ST-Ericsson | ||
3 | * Copyright (C) 2009 STMicroelectronics | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | /** | ||
11 | * struct clkops - ux500 clock operations | ||
12 | * @enable: function to enable the clock | ||
13 | * @disable: function to disable the clock | ||
14 | * @get_rate: function to get the current clock rate | ||
15 | * | ||
16 | * This structure contains function pointers to functions that will be used to | ||
17 | * control the clock. All of these functions are optional. If get_rate is | ||
18 | * NULL, the rate in the struct clk will be used. | ||
19 | */ | ||
20 | struct clkops { | ||
21 | void (*enable) (struct clk *); | ||
22 | void (*disable) (struct clk *); | ||
23 | unsigned long (*get_rate) (struct clk *); | ||
24 | }; | ||
25 | |||
26 | /** | ||
27 | * struct clk - ux500 clock structure | ||
28 | * @ops: pointer to clkops struct used to control this clock | ||
29 | * @name: name, for debugging | ||
30 | * @enabled: refcount. positive if enabled, zero if disabled | ||
31 | * @rate: fixed rate for clocks which don't implement | ||
32 | * ops->getrate | ||
33 | * @prcmu_cg_off: address offset of the combined enable/disable register | ||
34 | * (used on u8500v1) | ||
35 | * @prcmu_cg_bit: bit in the combined enable/disable register (used on | ||
36 | * u8500v1) | ||
37 | * @prcmu_cg_mgt: address of the enable/disable register (used on | ||
38 | * u8500ed) | ||
39 | * @cluster: peripheral cluster number | ||
40 | * @prcc_bus: bit for the bus clock in the peripheral's CLKRST | ||
41 | * @prcc_kernel: bit for the kernel clock in the peripheral's CLKRST. | ||
42 | * -1 if no kernel clock exists. | ||
43 | * @parent_cluster: pointer to parent's cluster clk struct | ||
44 | * @parent_periph: pointer to parent's peripheral clk struct | ||
45 | * | ||
46 | * Peripherals are organised into clusters, and each cluster has an associated | ||
47 | * bus clock. Some peripherals also have a parent peripheral clock. | ||
48 | * | ||
49 | * In order to enable a clock for a peripheral, we need to enable: | ||
50 | * (1) the parent cluster (bus) clock at the PRCMU level | ||
51 | * (2) the parent peripheral clock (if any) at the PRCMU level | ||
52 | * (3) the peripheral's bus & kernel clock at the PRCC level | ||
53 | * | ||
54 | * (1) and (2) are handled by defining clk structs (DEFINE_PRCMU_CLK) for each | ||
55 | * of the cluster and peripheral clocks, and hooking these as the parents of | ||
56 | * the individual peripheral clocks. | ||
57 | * | ||
58 | * (3) is handled by specifying the bits in the PRCC control registers required | ||
59 | * to enable these clocks and modifying them in the ->enable and | ||
60 | * ->disable callbacks of the peripheral clocks (DEFINE_PRCC_CLK). | ||
61 | * | ||
62 | * This structure describes both the PRCMU-level clocks and PRCC-level clocks. | ||
63 | * The prcmu_* fields are only used for the PRCMU clocks, and the cluster, | ||
64 | * prcc, and parent pointers are only used for the PRCC-level clocks. | ||
65 | */ | ||
66 | struct clk { | ||
67 | const struct clkops *ops; | ||
68 | const char *name; | ||
69 | unsigned int enabled; | ||
70 | |||
71 | unsigned long rate; | ||
72 | struct list_head list; | ||
73 | |||
74 | /* These three are only for PRCMU clks */ | ||
75 | |||
76 | unsigned int prcmu_cg_off; | ||
77 | unsigned int prcmu_cg_bit; | ||
78 | unsigned int prcmu_cg_mgt; | ||
79 | |||
80 | /* The rest are only for PRCC clks */ | ||
81 | |||
82 | int cluster; | ||
83 | unsigned int prcc_bus; | ||
84 | unsigned int prcc_kernel; | ||
85 | |||
86 | struct clk *parent_cluster; | ||
87 | struct clk *parent_periph; | ||
88 | }; | ||
89 | |||
90 | #define DEFINE_PRCMU_CLK(_name, _cg_off, _cg_bit, _reg) \ | ||
91 | struct clk clk_##_name = { \ | ||
92 | .name = #_name, \ | ||
93 | .ops = &clk_prcmu_ops, \ | ||
94 | .prcmu_cg_off = _cg_off, \ | ||
95 | .prcmu_cg_bit = _cg_bit, \ | ||
96 | .prcmu_cg_mgt = PRCM_##_reg##_MGT \ | ||
97 | } | ||
98 | |||
99 | #define DEFINE_PRCMU_CLK_RATE(_name, _cg_off, _cg_bit, _reg, _rate) \ | ||
100 | struct clk clk_##_name = { \ | ||
101 | .name = #_name, \ | ||
102 | .ops = &clk_prcmu_ops, \ | ||
103 | .prcmu_cg_off = _cg_off, \ | ||
104 | .prcmu_cg_bit = _cg_bit, \ | ||
105 | .rate = _rate, \ | ||
106 | .prcmu_cg_mgt = PRCM_##_reg##_MGT \ | ||
107 | } | ||
108 | |||
109 | #define DEFINE_PRCC_CLK(_pclust, _name, _bus_en, _kernel_en, _kernclk) \ | ||
110 | struct clk clk_##_name = { \ | ||
111 | .name = #_name, \ | ||
112 | .ops = &clk_prcc_ops, \ | ||
113 | .cluster = _pclust, \ | ||
114 | .prcc_bus = _bus_en, \ | ||
115 | .prcc_kernel = _kernel_en, \ | ||
116 | .parent_cluster = &clk_per##_pclust##clk, \ | ||
117 | .parent_periph = _kernclk \ | ||
118 | } | ||
119 | |||
120 | #define CLK(_clk, _devname, _conname) \ | ||
121 | { \ | ||
122 | .clk = &clk_##_clk, \ | ||
123 | .dev_id = _devname, \ | ||
124 | .con_id = _conname, \ | ||
125 | } | ||
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c new file mode 100644 index 000000000000..6a3ac4539f16 --- /dev/null +++ b/arch/arm/mach-ux500/cpu-db5500.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <linux/platform_device.h> | ||
9 | #include <linux/amba/bus.h> | ||
10 | #include <linux/io.h> | ||
11 | |||
12 | #include <asm/mach/map.h> | ||
13 | |||
14 | #include <mach/hardware.h> | ||
15 | #include <mach/devices.h> | ||
16 | #include <mach/setup.h> | ||
17 | |||
18 | static struct map_desc u5500_io_desc[] __initdata = { | ||
19 | __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K), | ||
20 | __IO_DEV_DESC(U5500_GPIO1_BASE, SZ_4K), | ||
21 | __IO_DEV_DESC(U5500_GPIO2_BASE, SZ_4K), | ||
22 | __IO_DEV_DESC(U5500_GPIO3_BASE, SZ_4K), | ||
23 | __IO_DEV_DESC(U5500_GPIO4_BASE, SZ_4K), | ||
24 | }; | ||
25 | |||
26 | static struct platform_device *u5500_platform_devs[] __initdata = { | ||
27 | &u5500_gpio_devs[0], | ||
28 | &u5500_gpio_devs[1], | ||
29 | &u5500_gpio_devs[2], | ||
30 | &u5500_gpio_devs[3], | ||
31 | &u5500_gpio_devs[4], | ||
32 | &u5500_gpio_devs[5], | ||
33 | &u5500_gpio_devs[6], | ||
34 | &u5500_gpio_devs[7], | ||
35 | }; | ||
36 | |||
37 | void __init u5500_map_io(void) | ||
38 | { | ||
39 | ux500_map_io(); | ||
40 | |||
41 | iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc)); | ||
42 | } | ||
43 | |||
44 | void __init u5500_init_devices(void) | ||
45 | { | ||
46 | ux500_init_devices(); | ||
47 | |||
48 | platform_add_devices(u5500_platform_devs, | ||
49 | ARRAY_SIZE(u5500_platform_devs)); | ||
50 | } | ||
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 397bc1f9ed94..d04299f3b6b5 100644 --- a/arch/arm/mach-ux500/cpu-u8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -13,44 +13,55 @@ | |||
13 | #include <linux/device.h> | 13 | #include <linux/device.h> |
14 | #include <linux/amba/bus.h> | 14 | #include <linux/amba/bus.h> |
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <linux/gpio.h> | ||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/io.h> | ||
17 | 19 | ||
18 | #include <asm/hardware/gic.h> | ||
19 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
20 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
22 | #include <mach/setup.h> | ||
23 | #include <mach/devices.h> | ||
21 | 24 | ||
22 | /* add any platform devices here - TODO */ | ||
23 | static struct platform_device *platform_devs[] __initdata = { | 25 | static struct platform_device *platform_devs[] __initdata = { |
24 | /* yet to be added, add i2c0, gpio.. */ | 26 | &u8500_gpio_devs[0], |
27 | &u8500_gpio_devs[1], | ||
28 | &u8500_gpio_devs[2], | ||
29 | &u8500_gpio_devs[3], | ||
30 | &u8500_gpio_devs[4], | ||
31 | &u8500_gpio_devs[5], | ||
32 | &u8500_gpio_devs[6], | ||
33 | &u8500_gpio_devs[7], | ||
34 | &u8500_gpio_devs[8], | ||
25 | }; | 35 | }; |
26 | 36 | ||
27 | #define __IO_DEV_DESC(x, sz) { \ | ||
28 | .virtual = IO_ADDRESS(x), \ | ||
29 | .pfn = __phys_to_pfn(x), \ | ||
30 | .length = sz, \ | ||
31 | .type = MT_DEVICE, \ | ||
32 | } | ||
33 | |||
34 | /* minimum static i/o mapping required to boot U8500 platforms */ | 37 | /* minimum static i/o mapping required to boot U8500 platforms */ |
35 | static struct map_desc u8500_io_desc[] __initdata = { | 38 | static struct map_desc u8500_io_desc[] __initdata = { |
36 | __IO_DEV_DESC(U8500_UART2_BASE, SZ_4K), | 39 | __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K), |
37 | __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K), | 40 | __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K), |
38 | __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K), | 41 | __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K), |
42 | __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K), | ||
43 | __IO_DEV_DESC(U8500_GPIO3_BASE, SZ_4K), | ||
44 | }; | ||
45 | |||
46 | static struct map_desc u8500ed_io_desc[] __initdata = { | ||
47 | __IO_DEV_DESC(U8500_MTU0_BASE_ED, SZ_4K), | ||
48 | __IO_DEV_DESC(U8500_CLKRST7_BASE_ED, SZ_8K), | ||
49 | }; | ||
50 | |||
51 | static struct map_desc u8500v1_io_desc[] __initdata = { | ||
39 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), | 52 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), |
40 | __IO_DEV_DESC(U8500_TWD_BASE, SZ_4K), | ||
41 | __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K), | ||
42 | __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K), | ||
43 | }; | 53 | }; |
44 | 54 | ||
45 | void __init u8500_map_io(void) | 55 | void __init u8500_map_io(void) |
46 | { | 56 | { |
57 | ux500_map_io(); | ||
58 | |||
47 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); | 59 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); |
48 | } | ||
49 | 60 | ||
50 | void __init u8500_init_irq(void) | 61 | if (cpu_is_u8500ed()) |
51 | { | 62 | iotable_init(u8500ed_io_desc, ARRAY_SIZE(u8500ed_io_desc)); |
52 | gic_dist_init(0, __io_address(U8500_GIC_DIST_BASE), 29); | 63 | else |
53 | gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE)); | 64 | iotable_init(u8500v1_io_desc, ARRAY_SIZE(u8500v1_io_desc)); |
54 | } | 65 | } |
55 | 66 | ||
56 | /* | 67 | /* |
@@ -58,6 +69,8 @@ void __init u8500_init_irq(void) | |||
58 | */ | 69 | */ |
59 | void __init u8500_init_devices(void) | 70 | void __init u8500_init_devices(void) |
60 | { | 71 | { |
72 | ux500_init_devices(); | ||
73 | |||
61 | /* Register the platform devices */ | 74 | /* Register the platform devices */ |
62 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | 75 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); |
63 | 76 | ||
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c new file mode 100644 index 000000000000..d81ad023963c --- /dev/null +++ b/arch/arm/mach-ux500/cpu.c | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <linux/platform_device.h> | ||
9 | #include <linux/amba/bus.h> | ||
10 | #include <linux/io.h> | ||
11 | #include <linux/clk.h> | ||
12 | |||
13 | #include <asm/hardware/cache-l2x0.h> | ||
14 | #include <asm/hardware/gic.h> | ||
15 | #include <asm/mach/map.h> | ||
16 | #include <asm/localtimer.h> | ||
17 | |||
18 | #include <plat/mtu.h> | ||
19 | #include <mach/hardware.h> | ||
20 | #include <mach/setup.h> | ||
21 | #include <mach/devices.h> | ||
22 | |||
23 | #include "clock.h" | ||
24 | |||
25 | static struct map_desc ux500_io_desc[] __initdata = { | ||
26 | __IO_DEV_DESC(UX500_UART0_BASE, SZ_4K), | ||
27 | __IO_DEV_DESC(UX500_UART2_BASE, SZ_4K), | ||
28 | |||
29 | __IO_DEV_DESC(UX500_GIC_CPU_BASE, SZ_4K), | ||
30 | __IO_DEV_DESC(UX500_GIC_DIST_BASE, SZ_4K), | ||
31 | __IO_DEV_DESC(UX500_L2CC_BASE, SZ_4K), | ||
32 | __IO_DEV_DESC(UX500_TWD_BASE, SZ_4K), | ||
33 | __IO_DEV_DESC(UX500_SCU_BASE, SZ_4K), | ||
34 | |||
35 | __IO_DEV_DESC(UX500_CLKRST1_BASE, SZ_4K), | ||
36 | __IO_DEV_DESC(UX500_CLKRST2_BASE, SZ_4K), | ||
37 | __IO_DEV_DESC(UX500_CLKRST3_BASE, SZ_4K), | ||
38 | __IO_DEV_DESC(UX500_CLKRST5_BASE, SZ_4K), | ||
39 | __IO_DEV_DESC(UX500_CLKRST6_BASE, SZ_4K), | ||
40 | |||
41 | __IO_DEV_DESC(UX500_MTU0_BASE, SZ_4K), | ||
42 | __IO_DEV_DESC(UX500_MTU1_BASE, SZ_4K), | ||
43 | |||
44 | __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K), | ||
45 | }; | ||
46 | |||
47 | static struct amba_device *ux500_amba_devs[] __initdata = { | ||
48 | &ux500_pl031_device, | ||
49 | }; | ||
50 | |||
51 | void __init ux500_map_io(void) | ||
52 | { | ||
53 | iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc)); | ||
54 | } | ||
55 | |||
56 | void __init ux500_init_devices(void) | ||
57 | { | ||
58 | amba_add_devices(ux500_amba_devs, ARRAY_SIZE(ux500_amba_devs)); | ||
59 | } | ||
60 | |||
61 | void __init ux500_init_irq(void) | ||
62 | { | ||
63 | gic_dist_init(0, __io_address(UX500_GIC_DIST_BASE), 29); | ||
64 | gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE)); | ||
65 | } | ||
66 | |||
67 | #ifdef CONFIG_CACHE_L2X0 | ||
68 | static int ux500_l2x0_init(void) | ||
69 | { | ||
70 | void __iomem *l2x0_base; | ||
71 | |||
72 | l2x0_base = __io_address(UX500_L2CC_BASE); | ||
73 | |||
74 | /* 64KB way size, 8 way associativity, force WA */ | ||
75 | l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff); | ||
76 | |||
77 | return 0; | ||
78 | } | ||
79 | early_initcall(ux500_l2x0_init); | ||
80 | #endif | ||
81 | |||
82 | static void __init ux500_timer_init(void) | ||
83 | { | ||
84 | #ifdef CONFIG_LOCAL_TIMERS | ||
85 | /* Setup the local timer base */ | ||
86 | twd_base = __io_address(UX500_TWD_BASE); | ||
87 | #endif | ||
88 | /* Setup the MTU base */ | ||
89 | if (cpu_is_u8500ed()) | ||
90 | mtu_base = __io_address(U8500_MTU0_BASE_ED); | ||
91 | else | ||
92 | mtu_base = __io_address(UX500_MTU0_BASE); | ||
93 | |||
94 | nmdk_timer_init(); | ||
95 | } | ||
96 | |||
97 | struct sys_timer ux500_timer = { | ||
98 | .init = ux500_timer_init, | ||
99 | }; | ||
diff --git a/arch/arm/mach-ux500/devices-db5500.c b/arch/arm/mach-ux500/devices-db5500.c new file mode 100644 index 000000000000..33e5b56bebb6 --- /dev/null +++ b/arch/arm/mach-ux500/devices-db5500.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <linux/platform_device.h> | ||
9 | #include <linux/interrupt.h> | ||
10 | #include <linux/gpio.h> | ||
11 | |||
12 | #include <mach/hardware.h> | ||
13 | #include <mach/devices.h> | ||
14 | |||
15 | static struct nmk_gpio_platform_data u5500_gpio_data[] = { | ||
16 | GPIO_DATA("GPIO-0-31", 0), | ||
17 | GPIO_DATA("GPIO-32-63", 32), /* 36..63 not routed to pin */ | ||
18 | GPIO_DATA("GPIO-64-95", 64), /* 83..95 not routed to pin */ | ||
19 | GPIO_DATA("GPIO-96-127", 96), /* 102..127 not routed to pin */ | ||
20 | GPIO_DATA("GPIO-128-159", 128), /* 149..159 not routed to pin */ | ||
21 | GPIO_DATA("GPIO-160-191", 160), | ||
22 | GPIO_DATA("GPIO-192-223", 192), | ||
23 | GPIO_DATA("GPIO-224-255", 224), /* 228..255 not routed to pin */ | ||
24 | }; | ||
25 | |||
26 | static struct resource u5500_gpio_resources[] = { | ||
27 | GPIO_RESOURCE(0), | ||
28 | GPIO_RESOURCE(1), | ||
29 | GPIO_RESOURCE(2), | ||
30 | GPIO_RESOURCE(3), | ||
31 | GPIO_RESOURCE(4), | ||
32 | GPIO_RESOURCE(5), | ||
33 | GPIO_RESOURCE(6), | ||
34 | GPIO_RESOURCE(7), | ||
35 | }; | ||
36 | |||
37 | struct platform_device u5500_gpio_devs[] = { | ||
38 | GPIO_DEVICE(0), | ||
39 | GPIO_DEVICE(1), | ||
40 | GPIO_DEVICE(2), | ||
41 | GPIO_DEVICE(3), | ||
42 | GPIO_DEVICE(4), | ||
43 | GPIO_DEVICE(5), | ||
44 | GPIO_DEVICE(6), | ||
45 | GPIO_DEVICE(7), | ||
46 | }; | ||
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c new file mode 100644 index 000000000000..20334236afce --- /dev/null +++ b/arch/arm/mach-ux500/devices-db8500.c | |||
@@ -0,0 +1,107 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/io.h> | ||
12 | #include <linux/gpio.h> | ||
13 | #include <linux/amba/bus.h> | ||
14 | |||
15 | #include <mach/hardware.h> | ||
16 | #include <mach/setup.h> | ||
17 | |||
18 | static struct nmk_gpio_platform_data u8500_gpio_data[] = { | ||
19 | GPIO_DATA("GPIO-0-31", 0), | ||
20 | GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */ | ||
21 | GPIO_DATA("GPIO-64-95", 64), | ||
22 | GPIO_DATA("GPIO-96-127", 96), /* 98..127 not routed to pin */ | ||
23 | GPIO_DATA("GPIO-128-159", 128), | ||
24 | GPIO_DATA("GPIO-160-191", 160), /* 172..191 not routed to pin */ | ||
25 | GPIO_DATA("GPIO-192-223", 192), | ||
26 | GPIO_DATA("GPIO-224-255", 224), /* 231..255 not routed to pin */ | ||
27 | GPIO_DATA("GPIO-256-288", 256), /* 268..288 not routed to pin */ | ||
28 | }; | ||
29 | |||
30 | static struct resource u8500_gpio_resources[] = { | ||
31 | GPIO_RESOURCE(0), | ||
32 | GPIO_RESOURCE(1), | ||
33 | GPIO_RESOURCE(2), | ||
34 | GPIO_RESOURCE(3), | ||
35 | GPIO_RESOURCE(4), | ||
36 | GPIO_RESOURCE(5), | ||
37 | GPIO_RESOURCE(6), | ||
38 | GPIO_RESOURCE(7), | ||
39 | GPIO_RESOURCE(8), | ||
40 | }; | ||
41 | |||
42 | struct platform_device u8500_gpio_devs[] = { | ||
43 | GPIO_DEVICE(0), | ||
44 | GPIO_DEVICE(1), | ||
45 | GPIO_DEVICE(2), | ||
46 | GPIO_DEVICE(3), | ||
47 | GPIO_DEVICE(4), | ||
48 | GPIO_DEVICE(5), | ||
49 | GPIO_DEVICE(6), | ||
50 | GPIO_DEVICE(7), | ||
51 | GPIO_DEVICE(8), | ||
52 | }; | ||
53 | |||
54 | struct amba_device u8500_ssp0_device = { | ||
55 | .dev = { | ||
56 | .coherent_dma_mask = ~0, | ||
57 | .init_name = "ssp0", | ||
58 | }, | ||
59 | .res = { | ||
60 | .start = U8500_SSP0_BASE, | ||
61 | .end = U8500_SSP0_BASE + SZ_4K - 1, | ||
62 | .flags = IORESOURCE_MEM, | ||
63 | }, | ||
64 | .irq = {IRQ_SSP0, NO_IRQ }, | ||
65 | /* ST-Ericsson modified id */ | ||
66 | .periphid = SSP_PER_ID, | ||
67 | }; | ||
68 | |||
69 | static struct resource u8500_i2c0_resources[] = { | ||
70 | [0] = { | ||
71 | .start = U8500_I2C0_BASE, | ||
72 | .end = U8500_I2C0_BASE + SZ_4K - 1, | ||
73 | .flags = IORESOURCE_MEM, | ||
74 | }, | ||
75 | [1] = { | ||
76 | .start = IRQ_I2C0, | ||
77 | .end = IRQ_I2C0, | ||
78 | .flags = IORESOURCE_IRQ, | ||
79 | } | ||
80 | }; | ||
81 | |||
82 | struct platform_device u8500_i2c0_device = { | ||
83 | .name = "nmk-i2c", | ||
84 | .id = 0, | ||
85 | .resource = u8500_i2c0_resources, | ||
86 | .num_resources = ARRAY_SIZE(u8500_i2c0_resources), | ||
87 | }; | ||
88 | |||
89 | static struct resource u8500_i2c4_resources[] = { | ||
90 | [0] = { | ||
91 | .start = U8500_I2C4_BASE, | ||
92 | .end = U8500_I2C4_BASE + SZ_4K - 1, | ||
93 | .flags = IORESOURCE_MEM, | ||
94 | }, | ||
95 | [1] = { | ||
96 | .start = IRQ_I2C4, | ||
97 | .end = IRQ_I2C4, | ||
98 | .flags = IORESOURCE_IRQ, | ||
99 | } | ||
100 | }; | ||
101 | |||
102 | struct platform_device u8500_i2c4_device = { | ||
103 | .name = "nmk-i2c", | ||
104 | .id = 4, | ||
105 | .resource = u8500_i2c4_resources, | ||
106 | .num_resources = ARRAY_SIZE(u8500_i2c4_resources), | ||
107 | }; | ||
diff --git a/arch/arm/mach-ux500/devices.c b/arch/arm/mach-ux500/devices.c new file mode 100644 index 000000000000..8a268893cb7f --- /dev/null +++ b/arch/arm/mach-ux500/devices.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/io.h> | ||
12 | #include <linux/amba/bus.h> | ||
13 | |||
14 | #include <mach/hardware.h> | ||
15 | #include <mach/setup.h> | ||
16 | |||
17 | #define __MEM_4K_RESOURCE(x) \ | ||
18 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | ||
19 | |||
20 | struct amba_device ux500_pl031_device = { | ||
21 | .dev = { | ||
22 | .init_name = "pl031", | ||
23 | }, | ||
24 | .res = { | ||
25 | .start = UX500_RTC_BASE, | ||
26 | .end = UX500_RTC_BASE + SZ_4K - 1, | ||
27 | .flags = IORESOURCE_MEM, | ||
28 | }, | ||
29 | .irq = {IRQ_RTC_RTT, NO_IRQ}, | ||
30 | }; | ||
31 | |||
32 | struct amba_device ux500_uart0_device = { | ||
33 | .dev = { .init_name = "uart0" }, | ||
34 | __MEM_4K_RESOURCE(UX500_UART0_BASE), | ||
35 | .irq = {IRQ_UART0, NO_IRQ}, | ||
36 | }; | ||
37 | |||
38 | struct amba_device ux500_uart1_device = { | ||
39 | .dev = { .init_name = "uart1" }, | ||
40 | __MEM_4K_RESOURCE(UX500_UART1_BASE), | ||
41 | .irq = {IRQ_UART1, NO_IRQ}, | ||
42 | }; | ||
43 | |||
44 | struct amba_device ux500_uart2_device = { | ||
45 | .dev = { .init_name = "uart2" }, | ||
46 | __MEM_4K_RESOURCE(UX500_UART2_BASE), | ||
47 | .irq = {IRQ_UART2, NO_IRQ}, | ||
48 | }; | ||
49 | |||
50 | #define UX500_I2C_RESOURCES(id, size) \ | ||
51 | static struct resource ux500_i2c##id##_resources[] = { \ | ||
52 | [0] = { \ | ||
53 | .start = UX500_I2C##id##_BASE, \ | ||
54 | .end = UX500_I2C##id##_BASE + size - 1, \ | ||
55 | .flags = IORESOURCE_MEM, \ | ||
56 | }, \ | ||
57 | [1] = { \ | ||
58 | .start = IRQ_I2C##id, \ | ||
59 | .end = IRQ_I2C##id, \ | ||
60 | .flags = IORESOURCE_IRQ \ | ||
61 | } \ | ||
62 | } | ||
63 | |||
64 | UX500_I2C_RESOURCES(1, SZ_4K); | ||
65 | UX500_I2C_RESOURCES(2, SZ_4K); | ||
66 | UX500_I2C_RESOURCES(3, SZ_4K); | ||
67 | |||
68 | #define UX500_I2C_PDEVICE(cid) \ | ||
69 | struct platform_device ux500_i2c##cid##_device = { \ | ||
70 | .name = "nmk-i2c", \ | ||
71 | .id = cid, \ | ||
72 | .num_resources = 2, \ | ||
73 | .resource = ux500_i2c##cid##_resources, \ | ||
74 | } | ||
75 | |||
76 | UX500_I2C_PDEVICE(1); | ||
77 | UX500_I2C_PDEVICE(2); | ||
78 | UX500_I2C_PDEVICE(3); | ||
79 | |||
80 | void __init amba_add_devices(struct amba_device *devs[], int num) | ||
81 | { | ||
82 | int i; | ||
83 | |||
84 | for (i = 0; i < num; i++) { | ||
85 | struct amba_device *d = devs[i]; | ||
86 | amba_device_register(d, &iomem_resource); | ||
87 | } | ||
88 | } | ||
diff --git a/arch/arm/mach-ux500/include/mach/db5500-regs.h b/arch/arm/mach-ux500/include/mach/db5500-regs.h new file mode 100644 index 000000000000..545c80fc8024 --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/db5500-regs.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License terms: GNU General Public License (GPL) version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __MACH_DB5500_REGS_H | ||
8 | #define __MACH_DB5500_REGS_H | ||
9 | |||
10 | #define U5500_PER1_BASE 0xA0020000 | ||
11 | #define U5500_PER2_BASE 0xA0010000 | ||
12 | #define U5500_PER3_BASE 0x80140000 | ||
13 | #define U5500_PER4_BASE 0x80150000 | ||
14 | #define U5500_PER5_BASE 0x80100000 | ||
15 | #define U5500_PER6_BASE 0x80120000 | ||
16 | |||
17 | #define U5500_GIC_DIST_BASE 0xA0411000 | ||
18 | #define U5500_GIC_CPU_BASE 0xA0410100 | ||
19 | #define U5500_DMA_BASE 0x90030000 | ||
20 | #define U5500_MCDE_BASE 0xA0400000 | ||
21 | #define U5500_MODEM_BASE 0xB0000000 | ||
22 | #define U5500_L2CC_BASE 0xA0412000 | ||
23 | #define U5500_SCU_BASE 0xA0410000 | ||
24 | #define U5500_DSI1_BASE 0xA0401000 | ||
25 | #define U5500_DSI2_BASE 0xA0402000 | ||
26 | #define U5500_SIA_BASE 0xA0100000 | ||
27 | #define U5500_SVA_BASE 0x80200000 | ||
28 | #define U5500_HSEM_BASE 0xA0000000 | ||
29 | #define U5500_NAND0_BASE 0x60000000 | ||
30 | #define U5500_NAND1_BASE 0x70000000 | ||
31 | #define U5500_TWD_BASE 0xa0410600 | ||
32 | #define U5500_B2R2_BASE 0xa0200000 | ||
33 | |||
34 | #define U5500_FSMC_BASE (U5500_PER1_BASE + 0x0000) | ||
35 | #define U5500_SDI0_BASE (U5500_PER1_BASE + 0x1000) | ||
36 | #define U5500_SDI2_BASE (U5500_PER1_BASE + 0x2000) | ||
37 | #define U5500_UART0_BASE (U5500_PER1_BASE + 0x3000) | ||
38 | #define U5500_I2C1_BASE (U5500_PER1_BASE + 0x4000) | ||
39 | #define U5500_MSP0_BASE (U5500_PER1_BASE + 0x5000) | ||
40 | #define U5500_GPIO0_BASE (U5500_PER1_BASE + 0xE000) | ||
41 | #define U5500_CLKRST1_BASE (U5500_PER1_BASE + 0xF000) | ||
42 | |||
43 | #define U5500_USBOTG_BASE (U5500_PER2_BASE + 0x0000) | ||
44 | #define U5500_GPIO1_BASE (U5500_PER2_BASE + 0xE000) | ||
45 | #define U5500_CLKRST2_BASE (U5500_PER2_BASE + 0xF000) | ||
46 | |||
47 | #define U5500_KEYPAD_BASE (U5500_PER3_BASE + 0x0000) | ||
48 | #define U5500_PWM_BASE (U5500_PER3_BASE + 0x1000) | ||
49 | #define U5500_GPIO3_BASE (U5500_PER3_BASE + 0xE000) | ||
50 | #define U5500_CLKRST3_BASE (U5500_PER3_BASE + 0xF000) | ||
51 | |||
52 | #define U5500_BACKUPRAM0_BASE (U5500_PER4_BASE + 0x0000) | ||
53 | #define U5500_BACKUPRAM1_BASE (U5500_PER4_BASE + 0x1000) | ||
54 | #define U5500_RTT0_BASE (U5500_PER4_BASE + 0x2000) | ||
55 | #define U5500_RTT1_BASE (U5500_PER4_BASE + 0x3000) | ||
56 | #define U5500_RTC_BASE (U5500_PER4_BASE + 0x4000) | ||
57 | #define U5500_SCR_BASE (U5500_PER4_BASE + 0x5000) | ||
58 | #define U5500_DMC_BASE (U5500_PER4_BASE + 0x6000) | ||
59 | #define U5500_PRCMU_BASE (U5500_PER4_BASE + 0x7000) | ||
60 | #define U5500_MSP1_BASE (U5500_PER4_BASE + 0x9000) | ||
61 | #define U5500_GPIO2_BASE (U5500_PER4_BASE + 0xA000) | ||
62 | #define U5500_CDETECT_BASE (U5500_PER4_BASE + 0xF000) | ||
63 | |||
64 | #define U5500_SPI0_BASE (U5500_PER5_BASE + 0x0000) | ||
65 | #define U5500_SPI1_BASE (U5500_PER5_BASE + 0x1000) | ||
66 | #define U5500_SPI2_BASE (U5500_PER5_BASE + 0x2000) | ||
67 | #define U5500_SPI3_BASE (U5500_PER5_BASE + 0x3000) | ||
68 | #define U5500_UART1_BASE (U5500_PER5_BASE + 0x4000) | ||
69 | #define U5500_UART2_BASE (U5500_PER5_BASE + 0x5000) | ||
70 | #define U5500_UART3_BASE (U5500_PER5_BASE + 0x6000) | ||
71 | #define U5500_SDI1_BASE (U5500_PER5_BASE + 0x7000) | ||
72 | #define U5500_SDI3_BASE (U5500_PER5_BASE + 0x8000) | ||
73 | #define U5500_SDI4_BASE (U5500_PER5_BASE + 0x9000) | ||
74 | #define U5500_I2C2_BASE (U5500_PER5_BASE + 0xA000) | ||
75 | #define U5500_I2C3_BASE (U5500_PER5_BASE + 0xB000) | ||
76 | #define U5500_MSP2_BASE (U5500_PER5_BASE + 0xC000) | ||
77 | #define U5500_IRDA_BASE (U5500_PER5_BASE + 0xD000) | ||
78 | #define U5500_IRRC_BASE (U5500_PER5_BASE + 0x10000) | ||
79 | #define U5500_GPIO4_BASE (U5500_PER5_BASE + 0x1E000) | ||
80 | #define U5500_CLKRST5_BASE (U5500_PER5_BASE + 0x1F000) | ||
81 | |||
82 | #define U5500_RNG_BASE (U5500_PER6_BASE + 0x0000) | ||
83 | #define U5500_HASH0_BASE (U5500_PER6_BASE + 0x1000) | ||
84 | #define U5500_HASH1_BASE (U5500_PER6_BASE + 0x2000) | ||
85 | #define U5500_PKA_BASE (U5500_PER6_BASE + 0x4000) | ||
86 | #define U5500_PKAM_BASE (U5500_PER6_BASE + 0x5000) | ||
87 | #define U5500_MTU0_BASE (U5500_PER6_BASE + 0x6000) | ||
88 | #define U5500_MTU1_BASE (U5500_PER6_BASE + 0x7000) | ||
89 | #define U5500_CR_BASE (U5500_PER6_BASE + 0x8000) | ||
90 | #define U5500_CRYP0_BASE (U5500_PER6_BASE + 0xA000) | ||
91 | #define U5500_CRYP1_BASE (U5500_PER6_BASE + 0xB000) | ||
92 | #define U5500_CLKRST6_BASE (U5500_PER6_BASE + 0xF000) | ||
93 | |||
94 | #define U5500_GPIOBANK0_BASE U5500_GPIO0_BASE | ||
95 | #define U5500_GPIOBANK1_BASE (U5500_GPIO0_BASE + 0x80) | ||
96 | #define U5500_GPIOBANK2_BASE U5500_GPIO1_BASE | ||
97 | #define U5500_GPIOBANK3_BASE U5500_GPIO2_BASE | ||
98 | #define U5500_GPIOBANK4_BASE U5500_GPIO3_BASE | ||
99 | #define U5500_GPIOBANK5_BASE U5500_GPIO4_BASE | ||
100 | #define U5500_GPIOBANK6_BASE (U5500_GPIO4_BASE + 0x80) | ||
101 | #define U5500_GPIOBANK7_BASE (U5500_GPIO4_BASE + 0x100) | ||
102 | |||
103 | #endif | ||
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/include/mach/db8500-regs.h new file mode 100644 index 000000000000..9169e1e382a3 --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/db8500-regs.h | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License terms: GNU General Public License (GPL) version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __MACH_DB8500_REGS_H | ||
8 | #define __MACH_DB8500_REGS_H | ||
9 | |||
10 | #define U8500_PER3_BASE 0x80000000 | ||
11 | #define U8500_STM_BASE 0x80100000 | ||
12 | #define U8500_STM_REG_BASE (U8500_STM_BASE + 0xF000) | ||
13 | #define U8500_PER2_BASE 0x80110000 | ||
14 | #define U8500_PER1_BASE 0x80120000 | ||
15 | #define U8500_B2R2_BASE 0x80130000 | ||
16 | #define U8500_HSEM_BASE 0x80140000 | ||
17 | #define U8500_PER4_BASE 0x80150000 | ||
18 | #define U8500_ICN_BASE 0x81000000 | ||
19 | |||
20 | #define U8500_BOOT_ROM_BASE 0x90000000 | ||
21 | /* ASIC ID is at 0xff4 offset within this region */ | ||
22 | #define U8500_ASIC_ID_BASE 0x9001F000 | ||
23 | |||
24 | #define U8500_PER6_BASE 0xa03c0000 | ||
25 | #define U8500_PER5_BASE 0xa03e0000 | ||
26 | #define U8500_PER7_BASE_ED 0xa03d0000 | ||
27 | |||
28 | #define U8500_SVA_BASE 0xa0100000 | ||
29 | #define U8500_SIA_BASE 0xa0200000 | ||
30 | |||
31 | #define U8500_SGA_BASE 0xa0300000 | ||
32 | #define U8500_MCDE_BASE 0xa0350000 | ||
33 | #define U8500_DMA_BASE_ED 0xa0362000 | ||
34 | #define U8500_DMA_BASE 0x801C0000 /* v1 */ | ||
35 | |||
36 | #define U8500_SBAG_BASE 0xa0390000 | ||
37 | |||
38 | #define U8500_SCU_BASE 0xa0410000 | ||
39 | #define U8500_GIC_CPU_BASE 0xa0410100 | ||
40 | #define U8500_TWD_BASE 0xa0410600 | ||
41 | #define U8500_GIC_DIST_BASE 0xa0411000 | ||
42 | #define U8500_L2CC_BASE 0xa0412000 | ||
43 | |||
44 | #define U8500_MODEM_I2C 0xb7e02000 | ||
45 | |||
46 | #define U8500_GPIO0_BASE (U8500_PER1_BASE + 0xE000) | ||
47 | #define U8500_GPIO1_BASE (U8500_PER3_BASE + 0xE000) | ||
48 | #define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xE000) | ||
49 | #define U8500_GPIO3_BASE (U8500_PER5_BASE + 0x1E000) | ||
50 | |||
51 | /* per7 base addressess */ | ||
52 | #define U8500_CR_BASE_ED (U8500_PER7_BASE_ED + 0x8000) | ||
53 | #define U8500_MTU0_BASE_ED (U8500_PER7_BASE_ED + 0xa000) | ||
54 | #define U8500_MTU1_BASE_ED (U8500_PER7_BASE_ED + 0xb000) | ||
55 | #define U8500_TZPC0_BASE_ED (U8500_PER7_BASE_ED + 0xc000) | ||
56 | #define U8500_CLKRST7_BASE_ED (U8500_PER7_BASE_ED + 0xf000) | ||
57 | |||
58 | #define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000) | ||
59 | #define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000) | ||
60 | |||
61 | /* per6 base addressess */ | ||
62 | #define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000) | ||
63 | #define U8500_PKA_BASE (U8500_PER6_BASE + 0x1000) | ||
64 | #define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000) | ||
65 | #define U8500_MTU0_BASE (U8500_PER6_BASE + 0x6000) /* v1 */ | ||
66 | #define U8500_MTU1_BASE (U8500_PER6_BASE + 0x7000) /* v1 */ | ||
67 | #define U8500_CR_BASE (U8500_PER6_BASE + 0x8000) /* v1 */ | ||
68 | #define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000) | ||
69 | #define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000) | ||
70 | #define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000) | ||
71 | |||
72 | /* per5 base addressess */ | ||
73 | #define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000) | ||
74 | #define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000) | ||
75 | |||
76 | /* per4 base addressess */ | ||
77 | #define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x00000) | ||
78 | #define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x01000) | ||
79 | #define U8500_RTT0_BASE (U8500_PER4_BASE + 0x02000) | ||
80 | #define U8500_RTT1_BASE (U8500_PER4_BASE + 0x03000) | ||
81 | #define U8500_RTC_BASE (U8500_PER4_BASE + 0x04000) | ||
82 | #define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) | ||
83 | #define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) | ||
84 | #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) | ||
85 | #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x0f000) | ||
86 | |||
87 | /* per3 base addresses */ | ||
88 | #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) | ||
89 | #define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000) | ||
90 | #define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000) | ||
91 | #define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000) | ||
92 | #define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000) | ||
93 | #define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000) | ||
94 | #define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000) | ||
95 | #define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000) | ||
96 | #define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000) | ||
97 | |||
98 | /* per2 base addressess */ | ||
99 | #define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000) | ||
100 | #define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000) | ||
101 | #define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000) | ||
102 | #define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000) | ||
103 | #define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000) | ||
104 | #define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000) | ||
105 | #define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000) | ||
106 | #define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000) | ||
107 | #define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000) | ||
108 | #define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000) | ||
109 | #define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000) | ||
110 | #define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000) | ||
111 | |||
112 | /* per1 base addresses */ | ||
113 | #define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000) | ||
114 | #define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000) | ||
115 | #define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000) | ||
116 | #define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000) | ||
117 | #define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000) | ||
118 | #define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000) | ||
119 | #define U8500_I2C4_BASE (U8500_PER1_BASE + 0xa000) | ||
120 | #define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xb000) | ||
121 | #define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000) | ||
122 | |||
123 | #define U8500_SHRM_GOP_INTERRUPT_BASE 0xB7C00040 | ||
124 | |||
125 | #define U8500_GPIOBANK0_BASE U8500_GPIO0_BASE | ||
126 | #define U8500_GPIOBANK1_BASE (U8500_GPIO0_BASE + 0x80) | ||
127 | #define U8500_GPIOBANK2_BASE U8500_GPIO1_BASE | ||
128 | #define U8500_GPIOBANK3_BASE (U8500_GPIO1_BASE + 0x80) | ||
129 | #define U8500_GPIOBANK4_BASE (U8500_GPIO1_BASE + 0x100) | ||
130 | #define U8500_GPIOBANK5_BASE (U8500_GPIO1_BASE + 0x180) | ||
131 | #define U8500_GPIOBANK6_BASE U8500_GPIO2_BASE | ||
132 | #define U8500_GPIOBANK7_BASE (U8500_GPIO2_BASE + 0x80) | ||
133 | #define U8500_GPIOBANK8_BASE U8500_GPIO3_BASE | ||
134 | |||
135 | #endif | ||
diff --git a/arch/arm/mach-ux500/include/mach/debug-macro.S b/arch/arm/mach-ux500/include/mach/debug-macro.S index 09cbfda8aee5..c5203b7ea552 100644 --- a/arch/arm/mach-ux500/include/mach/debug-macro.S +++ b/arch/arm/mach-ux500/include/mach/debug-macro.S | |||
@@ -10,11 +10,19 @@ | |||
10 | */ | 10 | */ |
11 | #include <mach/hardware.h> | 11 | #include <mach/hardware.h> |
12 | 12 | ||
13 | #if CONFIG_UX500_DEBUG_UART > 2 | ||
14 | #error Invalid Ux500 debug UART | ||
15 | #endif | ||
16 | |||
17 | #define __UX500_UART(n) UX500_UART##n##_BASE | ||
18 | #define UX500_UART(n) __UX500_UART(n) | ||
19 | #define UART_BASE UX500_UART(CONFIG_UX500_DEBUG_UART) | ||
20 | |||
13 | .macro addruart, rx, tmp | 21 | .macro addruart, rx, tmp |
14 | mrc p15, 0, \rx, c1, c0 | 22 | mrc p15, 0, \rx, c1, c0 |
15 | tst \rx, #1 @ MMU enabled? | 23 | tst \rx, #1 @ MMU enabled? |
16 | ldreq \rx, =U8500_UART2_BASE @ no, physical address | 24 | ldreq \rx, =UART_BASE @ no, physical address |
17 | ldrne \rx, =IO_ADDRESS(U8500_UART2_BASE) @ yes, virtual address | 25 | ldrne \rx, =IO_ADDRESS(UART_BASE) @ yes, virtual address |
18 | .endm | 26 | .endm |
19 | 27 | ||
20 | #include <asm/hardware/debug-pl01x.S> | 28 | #include <asm/hardware/debug-pl01x.S> |
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h new file mode 100644 index 000000000000..0422af00a56e --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/devices.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License terms: GNU General Public License (GPL) version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __ASM_ARCH_DEVICES_H__ | ||
8 | #define __ASM_ARCH_DEVICES_H__ | ||
9 | |||
10 | struct platform_device; | ||
11 | struct amba_device; | ||
12 | |||
13 | extern struct platform_device u5500_gpio_devs[]; | ||
14 | extern struct platform_device u8500_gpio_devs[]; | ||
15 | |||
16 | extern struct amba_device ux500_pl031_device; | ||
17 | extern struct amba_device u8500_ssp0_device; | ||
18 | extern struct amba_device ux500_uart0_device; | ||
19 | extern struct amba_device ux500_uart1_device; | ||
20 | extern struct amba_device ux500_uart2_device; | ||
21 | |||
22 | extern struct platform_device ux500_i2c1_device; | ||
23 | extern struct platform_device ux500_i2c2_device; | ||
24 | extern struct platform_device ux500_i2c3_device; | ||
25 | |||
26 | extern struct platform_device u8500_i2c0_device; | ||
27 | extern struct platform_device u8500_i2c4_device; | ||
28 | |||
29 | #endif | ||
diff --git a/arch/arm/mach-ux500/include/mach/entry-macro.S b/arch/arm/mach-ux500/include/mach/entry-macro.S index eece3301fef7..60ea88db8283 100644 --- a/arch/arm/mach-ux500/include/mach/entry-macro.S +++ b/arch/arm/mach-ux500/include/mach/entry-macro.S | |||
@@ -17,7 +17,7 @@ | |||
17 | .endm | 17 | .endm |
18 | 18 | ||
19 | .macro get_irqnr_preamble, base, tmp | 19 | .macro get_irqnr_preamble, base, tmp |
20 | ldr \base, =IO_ADDRESS(U8500_GIC_CPU_BASE) | 20 | ldr \base, =IO_ADDRESS(UX500_GIC_CPU_BASE) |
21 | .endm | 21 | .endm |
22 | 22 | ||
23 | .macro arch_ret_to_user, tmp1, tmp2 | 23 | .macro arch_ret_to_user, tmp1, tmp2 |
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h new file mode 100644 index 000000000000..d548a622e7d2 --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/gpio.h | |||
@@ -0,0 +1,50 @@ | |||
1 | #ifndef __ASM_ARCH_GPIO_H | ||
2 | #define __ASM_ARCH_GPIO_H | ||
3 | |||
4 | /* | ||
5 | * 288 (#267 is the highest one actually hooked up) onchip GPIOs, plus enough | ||
6 | * room for a couple of GPIO expanders. | ||
7 | */ | ||
8 | #define ARCH_NR_GPIOS 350 | ||
9 | |||
10 | #include <plat/gpio.h> | ||
11 | |||
12 | #define __GPIO_RESOURCE(soc, block) \ | ||
13 | { \ | ||
14 | .start = soc##_GPIOBANK##block##_BASE, \ | ||
15 | .end = soc##_GPIOBANK##block##_BASE + 127, \ | ||
16 | .flags = IORESOURCE_MEM, \ | ||
17 | }, \ | ||
18 | { \ | ||
19 | .start = IRQ_GPIO##block, \ | ||
20 | .end = IRQ_GPIO##block, \ | ||
21 | .flags = IORESOURCE_IRQ, \ | ||
22 | } | ||
23 | |||
24 | #define __GPIO_DEVICE(soc, block) \ | ||
25 | { \ | ||
26 | .name = "gpio", \ | ||
27 | .id = block, \ | ||
28 | .num_resources = 2, \ | ||
29 | .resource = &soc##_gpio_resources[block * 2], \ | ||
30 | .dev = { \ | ||
31 | .platform_data = &soc##_gpio_data[block], \ | ||
32 | }, \ | ||
33 | } | ||
34 | |||
35 | #define GPIO_DATA(_name, first) \ | ||
36 | { \ | ||
37 | .name = _name, \ | ||
38 | .first_gpio = first, \ | ||
39 | .first_irq = NOMADIK_GPIO_TO_IRQ(first), \ | ||
40 | } | ||
41 | |||
42 | #ifdef CONFIG_UX500_SOC_DB8500 | ||
43 | #define GPIO_RESOURCE(block) __GPIO_RESOURCE(U8500, block) | ||
44 | #define GPIO_DEVICE(block) __GPIO_DEVICE(u8500, block) | ||
45 | #elif defined(CONFIG_UX500_SOC_DB5500) | ||
46 | #define GPIO_RESOURCE(block) __GPIO_RESOURCE(U5500, block) | ||
47 | #define GPIO_DEVICE(block) __GPIO_DEVICE(u5500, block) | ||
48 | #endif | ||
49 | |||
50 | #endif /* __ASM_ARCH_GPIO_H */ | ||
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h index 04ea836969b3..8656379a8309 100644 --- a/arch/arm/mach-ux500/include/mach/hardware.h +++ b/arch/arm/mach-ux500/include/mach/hardware.h | |||
@@ -23,109 +23,106 @@ | |||
23 | 23 | ||
24 | /* typesafe io address */ | 24 | /* typesafe io address */ |
25 | #define __io_address(n) __io(IO_ADDRESS(n)) | 25 | #define __io_address(n) __io(IO_ADDRESS(n)) |
26 | /* used by some plat-nomadik code */ | ||
27 | #define io_p2v(n) __io_address(n) | ||
26 | 28 | ||
27 | /* | 29 | #include <mach/db8500-regs.h> |
28 | * Base address definitions for U8500 Onchip IPs. All the | 30 | #include <mach/db5500-regs.h> |
29 | * peripherals are contained in a single 1 Mbyte region, with | 31 | |
30 | * AHB peripherals at the bottom and APB peripherals at the | 32 | #ifdef CONFIG_UX500_SOC_DB8500 |
31 | * top of the region. PER stands for PERIPHERAL region which | 33 | #define UX500(periph) U8500_##periph##_BASE |
32 | * itself divided into sub regions. | 34 | #elif defined(CONFIG_UX500_SOC_DB5500) |
33 | */ | 35 | #define UX500(periph) U5500_##periph##_BASE |
34 | #define U8500_PER3_BASE 0x80000000 | 36 | #endif |
35 | #define U8500_PER2_BASE 0x80110000 | 37 | |
36 | #define U8500_PER1_BASE 0x80120000 | 38 | #define UX500_BACKUPRAM0_BASE UX500(BACKUPRAM0) |
37 | #define U8500_PER4_BASE 0x80150000 | 39 | #define UX500_BACKUPRAM1_BASE UX500(BACKUPRAM1) |
38 | 40 | #define UX500_B2R2_BASE UX500(B2R2) | |
39 | #define U8500_PER6_BASE 0xa03c0000 | 41 | |
40 | #define U8500_PER5_BASE 0xa03e0000 | 42 | #define UX500_CLKRST1_BASE UX500(CLKRST1) |
41 | #define U8500_PER7_BASE 0xa03d0000 | 43 | #define UX500_CLKRST2_BASE UX500(CLKRST2) |
42 | 44 | #define UX500_CLKRST3_BASE UX500(CLKRST3) | |
43 | #define U8500_SVA_BASE 0xa0100000 | 45 | #define UX500_CLKRST5_BASE UX500(CLKRST5) |
44 | #define U8500_SIA_BASE 0xa0200000 | 46 | #define UX500_CLKRST6_BASE UX500(CLKRST6) |
45 | 47 | ||
46 | #define U8500_SGA_BASE 0xa0300000 | 48 | #define UX500_DMA_BASE UX500(DMA) |
47 | #define U8500_MCDE_BASE 0xa0350000 | 49 | #define UX500_FSMC_BASE UX500(FSMC) |
48 | #define U8500_DMA_BASE 0xa0362000 | 50 | |
49 | 51 | #define UX500_GIC_CPU_BASE UX500(GIC_CPU) | |
50 | #define U8500_SCU_BASE 0xa0410000 | 52 | #define UX500_GIC_DIST_BASE UX500(GIC_DIST) |
51 | #define U8500_GIC_CPU_BASE 0xa0410100 | 53 | |
52 | #define U8500_TWD_BASE 0xa0410600 | 54 | #define UX500_I2C1_BASE UX500(I2C1) |
53 | #define U8500_GIC_DIST_BASE 0xa0411000 | 55 | #define UX500_I2C2_BASE UX500(I2C2) |
54 | #define U8500_L2CC_BASE 0xa0412000 | 56 | #define UX500_I2C3_BASE UX500(I2C3) |
55 | 57 | ||
56 | #define U8500_TWD_SIZE 0x100 | 58 | #define UX500_L2CC_BASE UX500(L2CC) |
57 | 59 | #define UX500_MCDE_BASE UX500(MCDE) | |
58 | /* per7 base addressess */ | 60 | #define UX500_MTU0_BASE UX500(MTU0) |
59 | #define U8500_CR_BASE (U8500_PER7_BASE + 0x8000) | 61 | #define UX500_MTU1_BASE UX500(MTU1) |
60 | #define U8500_MTU0_BASE (U8500_PER7_BASE + 0xa000) | 62 | #define UX500_PRCMU_BASE UX500(PRCMU) |
61 | #define U8500_MTU1_BASE (U8500_PER7_BASE + 0xb000) | 63 | |
62 | #define U8500_TZPC0_BASE (U8500_PER7_BASE + 0xc000) | 64 | #define UX500_RNG_BASE UX500(RNG) |
63 | #define U8500_CLKRST7_BASE (U8500_PER7_BASE + 0xf000) | 65 | #define UX500_RTC_BASE UX500(RTC) |
64 | 66 | ||
65 | /* per6 base addressess */ | 67 | #define UX500_SCU_BASE UX500(SCU) |
66 | #define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000) | 68 | |
67 | #define U8500_PKA_BASE (U8500_PER6_BASE + 0x1000) | 69 | #define UX500_SDI0_BASE UX500(SDI0) |
68 | #define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000) | 70 | #define UX500_SDI1_BASE UX500(SDI1) |
69 | #define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000) | 71 | #define UX500_SDI2_BASE UX500(SDI2) |
70 | #define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000) | 72 | #define UX500_SDI3_BASE UX500(SDI3) |
71 | #define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000) | 73 | #define UX500_SDI4_BASE UX500(SDI4) |
72 | 74 | ||
73 | /* per5 base addressess */ | 75 | #define UX500_SPI0_BASE UX500(SPI0) |
74 | #define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000) | 76 | #define UX500_SPI1_BASE UX500(SPI1) |
75 | #define U8500_GPIO5_BASE (U8500_PER5_BASE + 0x1e000) | 77 | #define UX500_SPI2_BASE UX500(SPI2) |
76 | #define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000) | 78 | #define UX500_SPI3_BASE UX500(SPI3) |
77 | 79 | ||
78 | /* per4 base addressess */ | 80 | #define UX500_SIA_BASE UX500(SIA) |
79 | #define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x0000) | 81 | #define UX500_SVA_BASE UX500(SVA) |
80 | #define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x1000) | 82 | |
81 | #define U8500_RTT0_BASE (U8500_PER4_BASE + 0x2000) | 83 | #define UX500_TWD_BASE UX500(TWD) |
82 | #define U8500_RTT1_BASE (U8500_PER4_BASE + 0x3000) | 84 | |
83 | #define U8500_RTC_BASE (U8500_PER4_BASE + 0x4000) | 85 | #define UX500_UART0_BASE UX500(UART0) |
84 | #define U8500_SCR_BASE (U8500_PER4_BASE + 0x5000) | 86 | #define UX500_UART1_BASE UX500(UART1) |
85 | #define U8500_DMC_BASE (U8500_PER4_BASE + 0x6000) | 87 | #define UX500_UART2_BASE UX500(UART2) |
86 | #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x7000) | 88 | |
87 | 89 | #define UX500_USBOTG_BASE UX500(USBOTG) | |
88 | /* per3 base addressess */ | ||
89 | #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) | ||
90 | #define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000) | ||
91 | #define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000) | ||
92 | #define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000) | ||
93 | #define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000) | ||
94 | #define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000) | ||
95 | #define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000) | ||
96 | #define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000) | ||
97 | #define U8500_GPIO3_BASE (U8500_PER3_BASE + 0xe000) | ||
98 | #define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000) | ||
99 | |||
100 | /* per2 base addressess */ | ||
101 | #define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000) | ||
102 | #define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000) | ||
103 | #define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000) | ||
104 | #define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000) | ||
105 | #define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000) | ||
106 | #define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000) | ||
107 | #define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000) | ||
108 | #define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000) | ||
109 | #define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000) | ||
110 | #define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000) | ||
111 | #define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000) | ||
112 | #define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xe000) | ||
113 | #define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000) | ||
114 | |||
115 | /* per1 base addresses */ | ||
116 | #define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000) | ||
117 | #define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000) | ||
118 | #define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000) | ||
119 | #define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000) | ||
120 | #define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000) | ||
121 | #define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000) | ||
122 | #define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000) | ||
123 | #define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000) | ||
124 | #define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xa000) | ||
125 | #define U8500_GPIO1_BASE (U8500_PER1_BASE + 0xe000) | ||
126 | #define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000) | ||
127 | 90 | ||
128 | /* ST-Ericsson modified pl022 id */ | 91 | /* ST-Ericsson modified pl022 id */ |
129 | #define SSP_PER_ID 0x01080022 | 92 | #define SSP_PER_ID 0x01080022 |
130 | 93 | ||
94 | #ifndef __ASSEMBLY__ | ||
95 | |||
96 | #include <asm/cputype.h> | ||
97 | |||
98 | static inline bool cpu_is_u8500(void) | ||
99 | { | ||
100 | #ifdef CONFIG_UX500_SOC_DB8500 | ||
101 | return 1; | ||
102 | #else | ||
103 | return 0; | ||
104 | #endif | ||
105 | } | ||
106 | |||
107 | static inline bool cpu_is_u8500ed(void) | ||
108 | { | ||
109 | return cpu_is_u8500() && (read_cpuid_id() & 15) == 0; | ||
110 | } | ||
111 | |||
112 | static inline bool cpu_is_u8500v1(void) | ||
113 | { | ||
114 | return cpu_is_u8500() && (read_cpuid_id() & 15) == 1; | ||
115 | } | ||
116 | |||
117 | static inline bool cpu_is_u5500(void) | ||
118 | { | ||
119 | #ifdef CONFIG_UX500_SOC_DB5500 | ||
120 | return 1; | ||
121 | #else | ||
122 | return 0; | ||
123 | #endif | ||
124 | } | ||
125 | |||
126 | #endif | ||
127 | |||
131 | #endif /* __MACH_HARDWARE_H */ | 128 | #endif /* __MACH_HARDWARE_H */ |
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h index 394b5dd2200f..7970684b1d09 100644 --- a/arch/arm/mach-ux500/include/mach/irqs.h +++ b/arch/arm/mach-ux500/include/mach/irqs.h | |||
@@ -42,6 +42,7 @@ | |||
42 | #define IRQ_AB4500 (IRQ_SHPI_START + 40) | 42 | #define IRQ_AB4500 (IRQ_SHPI_START + 40) |
43 | #define IRQ_DISP (IRQ_SHPI_START + 48) | 43 | #define IRQ_DISP (IRQ_SHPI_START + 48) |
44 | #define IRQ_SiPI3 (IRQ_SHPI_START + 49) | 44 | #define IRQ_SiPI3 (IRQ_SHPI_START + 49) |
45 | #define IRQ_I2C4 (IRQ_SHPI_START + 51) | ||
45 | #define IRQ_SSP1 (IRQ_SHPI_START + 52) | 46 | #define IRQ_SSP1 (IRQ_SHPI_START + 52) |
46 | #define IRQ_I2C2 (IRQ_SHPI_START + 55) | 47 | #define IRQ_I2C2 (IRQ_SHPI_START + 55) |
47 | #define IRQ_SDMMC0 (IRQ_SHPI_START + 60) | 48 | #define IRQ_SDMMC0 (IRQ_SHPI_START + 60) |
@@ -66,6 +67,12 @@ | |||
66 | /* There are 128 shared peripheral interrupts assigned to | 67 | /* There are 128 shared peripheral interrupts assigned to |
67 | * INTID[160:32]. The first 32 interrupts are reserved. | 68 | * INTID[160:32]. The first 32 interrupts are reserved. |
68 | */ | 69 | */ |
69 | #define NR_IRQS 161 | 70 | #define U8500_SOC_NR_IRQS 161 |
71 | |||
72 | /* After chip-specific IRQ numbers we have the GPIO ones */ | ||
73 | #define NOMADIK_NR_GPIO 288 | ||
74 | #define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + U8500_SOC_NR_IRQS) | ||
75 | #define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - U8500_SOC_NR_IRQS) | ||
76 | #define NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) | ||
70 | 77 | ||
71 | #endif /*ASM_ARCH_IRQS_H*/ | 78 | #endif /*ASM_ARCH_IRQS_H*/ |
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h index cf0ce1687f24..e978dbd9e210 100644 --- a/arch/arm/mach-ux500/include/mach/setup.h +++ b/arch/arm/mach-ux500/include/mach/setup.h | |||
@@ -14,10 +14,28 @@ | |||
14 | #include <asm/mach/time.h> | 14 | #include <asm/mach/time.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | 16 | ||
17 | extern void u8500_map_io(void); | 17 | extern void __init ux500_map_io(void); |
18 | extern void u8500_init_devices(void); | 18 | extern void __init u5500_map_io(void); |
19 | extern void u8500_init_irq(void); | 19 | extern void __init u8500_map_io(void); |
20 | |||
21 | extern void __init ux500_init_devices(void); | ||
22 | extern void __init u5500_init_devices(void); | ||
23 | extern void __init u8500_init_devices(void); | ||
24 | |||
25 | extern void __init ux500_init_irq(void); | ||
20 | /* We re-use nomadik_timer for this platform */ | 26 | /* We re-use nomadik_timer for this platform */ |
21 | extern void nmdk_timer_init(void); | 27 | extern void nmdk_timer_init(void); |
22 | 28 | ||
29 | extern void __init amba_add_devices(struct amba_device *devs[], int num); | ||
30 | |||
31 | struct sys_timer; | ||
32 | extern struct sys_timer ux500_timer; | ||
33 | |||
34 | #define __IO_DEV_DESC(x, sz) { \ | ||
35 | .virtual = IO_ADDRESS(x), \ | ||
36 | .pfn = __phys_to_pfn(x), \ | ||
37 | .length = sz, \ | ||
38 | .type = MT_DEVICE, \ | ||
39 | } | ||
40 | |||
23 | #endif /* __ASM_ARCH_SETUP_H */ | 41 | #endif /* __ASM_ARCH_SETUP_H */ |
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index 8dfe7ca245d8..438ef16aec90 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c | |||
@@ -30,7 +30,7 @@ volatile int __cpuinitdata pen_release = -1; | |||
30 | 30 | ||
31 | static unsigned int __init get_core_count(void) | 31 | static unsigned int __init get_core_count(void) |
32 | { | 32 | { |
33 | return scu_get_core_count(__io_address(U8500_SCU_BASE)); | 33 | return scu_get_core_count(__io_address(UX500_SCU_BASE)); |
34 | } | 34 | } |
35 | 35 | ||
36 | static DEFINE_SPINLOCK(boot_lock); | 36 | static DEFINE_SPINLOCK(boot_lock); |
@@ -44,7 +44,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
44 | * core (e.g. timer irq), then they will not have been enabled | 44 | * core (e.g. timer irq), then they will not have been enabled |
45 | * for us: do so | 45 | * for us: do so |
46 | */ | 46 | */ |
47 | gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE)); | 47 | gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE)); |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * let the primary processor know we're out of the | 50 | * let the primary processor know we're out of the |
@@ -75,7 +75,8 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
75 | * that it has been released by resetting pen_release. | 75 | * that it has been released by resetting pen_release. |
76 | */ | 76 | */ |
77 | pen_release = cpu; | 77 | pen_release = cpu; |
78 | flush_cache_all(); | 78 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); |
79 | outer_clean_range(__pa(&pen_release), __pa(&pen_release) + 1); | ||
79 | 80 | ||
80 | timeout = jiffies + (1 * HZ); | 81 | timeout = jiffies + (1 * HZ); |
81 | while (time_before(jiffies, timeout)) { | 82 | while (time_before(jiffies, timeout)) { |
@@ -105,12 +106,12 @@ static void __init wakeup_secondary(void) | |||
105 | */ | 106 | */ |
106 | #define U8500_CPU1_JUMPADDR_OFFSET 0x1FF4 | 107 | #define U8500_CPU1_JUMPADDR_OFFSET 0x1FF4 |
107 | __raw_writel(virt_to_phys(u8500_secondary_startup), | 108 | __raw_writel(virt_to_phys(u8500_secondary_startup), |
108 | (void __iomem *)IO_ADDRESS(U8500_BACKUPRAM0_BASE) + | 109 | __io_address(UX500_BACKUPRAM0_BASE) + |
109 | U8500_CPU1_JUMPADDR_OFFSET); | 110 | U8500_CPU1_JUMPADDR_OFFSET); |
110 | 111 | ||
111 | #define U8500_CPU1_WAKEMAGIC_OFFSET 0x1FF0 | 112 | #define U8500_CPU1_WAKEMAGIC_OFFSET 0x1FF0 |
112 | __raw_writel(0xA1FEED01, | 113 | __raw_writel(0xA1FEED01, |
113 | (void __iomem *)IO_ADDRESS(U8500_BACKUPRAM0_BASE) + | 114 | __io_address(UX500_BACKUPRAM0_BASE) + |
114 | U8500_CPU1_WAKEMAGIC_OFFSET); | 115 | U8500_CPU1_WAKEMAGIC_OFFSET); |
115 | 116 | ||
116 | /* make sure write buffer is drained */ | 117 | /* make sure write buffer is drained */ |
@@ -171,7 +172,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
171 | * boot CPU, but only if we have more than one CPU. | 172 | * boot CPU, but only if we have more than one CPU. |
172 | */ | 173 | */ |
173 | percpu_timer_setup(); | 174 | percpu_timer_setup(); |
174 | scu_enable(__io_address(U8500_SCU_BASE)); | 175 | scu_enable(__io_address(UX500_SCU_BASE)); |
175 | wakeup_secondary(); | 176 | wakeup_secondary(); |
176 | } | 177 | } |
177 | } | 178 | } |
diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile index ba81e70ed813..97cf4d831b0c 100644 --- a/arch/arm/mach-versatile/Makefile +++ b/arch/arm/mach-versatile/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := core.o clock.o | 5 | obj-y := core.o |
6 | obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o | 6 | obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o |
7 | obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o | 7 | obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o |
8 | obj-$(CONFIG_PCI) += pci.o | 8 | obj-$(CONFIG_PCI) += pci.o |
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c deleted file mode 100644 index c50a44ea7ee6..000000000000 --- a/arch/arm/mach-versatile/clock.c +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-versatile/clock.c | ||
3 | * | ||
4 | * Copyright (C) 2004 ARM Limited. | ||
5 | * Written by Deep Blue Solutions Limited. | ||
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 | #include <linux/module.h> | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/device.h> | ||
14 | #include <linux/list.h> | ||
15 | #include <linux/errno.h> | ||
16 | #include <linux/err.h> | ||
17 | #include <linux/string.h> | ||
18 | #include <linux/clk.h> | ||
19 | #include <linux/mutex.h> | ||
20 | |||
21 | #include <asm/clkdev.h> | ||
22 | #include <asm/hardware/icst307.h> | ||
23 | |||
24 | #include "clock.h" | ||
25 | |||
26 | int clk_enable(struct clk *clk) | ||
27 | { | ||
28 | return 0; | ||
29 | } | ||
30 | EXPORT_SYMBOL(clk_enable); | ||
31 | |||
32 | void clk_disable(struct clk *clk) | ||
33 | { | ||
34 | } | ||
35 | EXPORT_SYMBOL(clk_disable); | ||
36 | |||
37 | unsigned long clk_get_rate(struct clk *clk) | ||
38 | { | ||
39 | return clk->rate; | ||
40 | } | ||
41 | EXPORT_SYMBOL(clk_get_rate); | ||
42 | |||
43 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
44 | { | ||
45 | struct icst307_vco vco; | ||
46 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
47 | return icst307_khz(clk->params, vco) * 1000; | ||
48 | } | ||
49 | EXPORT_SYMBOL(clk_round_rate); | ||
50 | |||
51 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
52 | { | ||
53 | int ret = -EIO; | ||
54 | |||
55 | if (clk->setvco) { | ||
56 | struct icst307_vco vco; | ||
57 | |||
58 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
59 | clk->rate = icst307_khz(clk->params, vco) * 1000; | ||
60 | clk->setvco(clk, vco); | ||
61 | ret = 0; | ||
62 | } | ||
63 | return ret; | ||
64 | } | ||
65 | EXPORT_SYMBOL(clk_set_rate); | ||
diff --git a/arch/arm/mach-versatile/clock.h b/arch/arm/mach-versatile/clock.h deleted file mode 100644 index 03468fdc3e58..000000000000 --- a/arch/arm/mach-versatile/clock.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-versatile/clock.h | ||
3 | * | ||
4 | * Copyright (C) 2004 ARM Limited. | ||
5 | * Written by Deep Blue Solutions Limited. | ||
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 | struct module; | ||
12 | struct icst307_params; | ||
13 | |||
14 | struct clk { | ||
15 | unsigned long rate; | ||
16 | const struct icst307_params *params; | ||
17 | u32 oscoff; | ||
18 | void *data; | ||
19 | void (*setvco)(struct clk *, struct icst307_vco vco); | ||
20 | }; | ||
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 3b1a4ee01815..3dff8641b03f 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -28,19 +28,15 @@ | |||
28 | #include <linux/amba/clcd.h> | 28 | #include <linux/amba/clcd.h> |
29 | #include <linux/amba/pl061.h> | 29 | #include <linux/amba/pl061.h> |
30 | #include <linux/amba/mmci.h> | 30 | #include <linux/amba/mmci.h> |
31 | #include <linux/clocksource.h> | ||
32 | #include <linux/clockchips.h> | ||
33 | #include <linux/cnt32_to_63.h> | ||
34 | #include <linux/io.h> | 31 | #include <linux/io.h> |
35 | #include <linux/gfp.h> | 32 | #include <linux/gfp.h> |
36 | 33 | ||
37 | #include <asm/clkdev.h> | 34 | #include <asm/clkdev.h> |
38 | #include <asm/system.h> | 35 | #include <asm/system.h> |
39 | #include <mach/hardware.h> | ||
40 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
41 | #include <asm/leds.h> | 37 | #include <asm/leds.h> |
42 | #include <asm/hardware/arm_timer.h> | 38 | #include <asm/hardware/arm_timer.h> |
43 | #include <asm/hardware/icst307.h> | 39 | #include <asm/hardware/icst.h> |
44 | #include <asm/hardware/vic.h> | 40 | #include <asm/hardware/vic.h> |
45 | #include <asm/mach-types.h> | 41 | #include <asm/mach-types.h> |
46 | 42 | ||
@@ -49,9 +45,12 @@ | |||
49 | #include <asm/mach/irq.h> | 45 | #include <asm/mach/irq.h> |
50 | #include <asm/mach/time.h> | 46 | #include <asm/mach/time.h> |
51 | #include <asm/mach/map.h> | 47 | #include <asm/mach/map.h> |
48 | #include <mach/clkdev.h> | ||
49 | #include <mach/hardware.h> | ||
50 | #include <mach/platform.h> | ||
51 | #include <plat/timer-sp.h> | ||
52 | 52 | ||
53 | #include "core.h" | 53 | #include "core.h" |
54 | #include "clock.h" | ||
55 | 54 | ||
56 | /* | 55 | /* |
57 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx | 56 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx |
@@ -59,7 +58,6 @@ | |||
59 | * | 58 | * |
60 | * Setup a VA for the Versatile Vectored Interrupt Controller. | 59 | * Setup a VA for the Versatile Vectored Interrupt Controller. |
61 | */ | 60 | */ |
62 | #define __io_address(n) __io(IO_ADDRESS(n)) | ||
63 | #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) | 61 | #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) |
64 | #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) | 62 | #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) |
65 | 63 | ||
@@ -229,27 +227,6 @@ void __init versatile_map_io(void) | |||
229 | iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); | 227 | iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); |
230 | } | 228 | } |
231 | 229 | ||
232 | #define VERSATILE_REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET) | ||
233 | |||
234 | /* | ||
235 | * This is the Versatile sched_clock implementation. This has | ||
236 | * a resolution of 41.7ns, and a maximum value of about 35583 days. | ||
237 | * | ||
238 | * The return value is guaranteed to be monotonic in that range as | ||
239 | * long as there is always less than 89 seconds between successive | ||
240 | * calls to this function. | ||
241 | */ | ||
242 | unsigned long long sched_clock(void) | ||
243 | { | ||
244 | unsigned long long v = cnt32_to_63(readl(VERSATILE_REFCOUNTER)); | ||
245 | |||
246 | /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */ | ||
247 | v *= 125<<1; | ||
248 | do_div(v, 3<<1); | ||
249 | |||
250 | return v; | ||
251 | } | ||
252 | |||
253 | 230 | ||
254 | #define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) | 231 | #define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) |
255 | 232 | ||
@@ -380,33 +357,40 @@ static struct mmci_platform_data mmc0_plat_data = { | |||
380 | /* | 357 | /* |
381 | * Clock handling | 358 | * Clock handling |
382 | */ | 359 | */ |
383 | static const struct icst307_params versatile_oscvco_params = { | 360 | static const struct icst_params versatile_oscvco_params = { |
384 | .ref = 24000, | 361 | .ref = 24000000, |
385 | .vco_max = 200000, | 362 | .vco_max = ICST307_VCO_MAX, |
363 | .vco_min = ICST307_VCO_MIN, | ||
386 | .vd_min = 4 + 8, | 364 | .vd_min = 4 + 8, |
387 | .vd_max = 511 + 8, | 365 | .vd_max = 511 + 8, |
388 | .rd_min = 1 + 2, | 366 | .rd_min = 1 + 2, |
389 | .rd_max = 127 + 2, | 367 | .rd_max = 127 + 2, |
368 | .s2div = icst307_s2div, | ||
369 | .idx2s = icst307_idx2s, | ||
390 | }; | 370 | }; |
391 | 371 | ||
392 | static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) | 372 | static void versatile_oscvco_set(struct clk *clk, struct icst_vco vco) |
393 | { | 373 | { |
394 | void __iomem *sys = __io_address(VERSATILE_SYS_BASE); | 374 | void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; |
395 | void __iomem *sys_lock = sys + VERSATILE_SYS_LOCK_OFFSET; | ||
396 | u32 val; | 375 | u32 val; |
397 | 376 | ||
398 | val = readl(sys + clk->oscoff) & ~0x7ffff; | 377 | val = readl(clk->vcoreg) & ~0x7ffff; |
399 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 378 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
400 | 379 | ||
401 | writel(0xa05f, sys_lock); | 380 | writel(0xa05f, sys_lock); |
402 | writel(val, sys + clk->oscoff); | 381 | writel(val, clk->vcoreg); |
403 | writel(0, sys_lock); | 382 | writel(0, sys_lock); |
404 | } | 383 | } |
405 | 384 | ||
385 | static const struct clk_ops osc4_clk_ops = { | ||
386 | .round = icst_clk_round, | ||
387 | .set = icst_clk_set, | ||
388 | .setvco = versatile_oscvco_set, | ||
389 | }; | ||
390 | |||
406 | static struct clk osc4_clk = { | 391 | static struct clk osc4_clk = { |
392 | .ops = &osc4_clk_ops, | ||
407 | .params = &versatile_oscvco_params, | 393 | .params = &versatile_oscvco_params, |
408 | .oscoff = VERSATILE_SYS_OSCCLCD_OFFSET, | ||
409 | .setvco = versatile_oscvco_set, | ||
410 | }; | 394 | }; |
411 | 395 | ||
412 | /* | 396 | /* |
@@ -852,6 +836,8 @@ void __init versatile_init(void) | |||
852 | { | 836 | { |
853 | int i; | 837 | int i; |
854 | 838 | ||
839 | osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET; | ||
840 | |||
855 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 841 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
856 | 842 | ||
857 | platform_device_register(&versatile_flash_device); | 843 | platform_device_register(&versatile_flash_device); |
@@ -875,120 +861,6 @@ void __init versatile_init(void) | |||
875 | #define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20) | 861 | #define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20) |
876 | #define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE) | 862 | #define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE) |
877 | #define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20) | 863 | #define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20) |
878 | #define VA_IC_BASE __io_address(VERSATILE_VIC_BASE) | ||
879 | |||
880 | /* | ||
881 | * How long is the timer interval? | ||
882 | */ | ||
883 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
884 | #if TIMER_INTERVAL >= 0x100000 | ||
885 | #define TIMER_RELOAD (TIMER_INTERVAL >> 8) | ||
886 | #define TIMER_DIVISOR (TIMER_CTRL_DIV256) | ||
887 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
888 | #elif TIMER_INTERVAL >= 0x10000 | ||
889 | #define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */ | ||
890 | #define TIMER_DIVISOR (TIMER_CTRL_DIV16) | ||
891 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
892 | #else | ||
893 | #define TIMER_RELOAD (TIMER_INTERVAL) | ||
894 | #define TIMER_DIVISOR (TIMER_CTRL_DIV1) | ||
895 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
896 | #endif | ||
897 | |||
898 | static void timer_set_mode(enum clock_event_mode mode, | ||
899 | struct clock_event_device *clk) | ||
900 | { | ||
901 | unsigned long ctrl; | ||
902 | |||
903 | switch(mode) { | ||
904 | case CLOCK_EVT_MODE_PERIODIC: | ||
905 | writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD); | ||
906 | |||
907 | ctrl = TIMER_CTRL_PERIODIC; | ||
908 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE; | ||
909 | break; | ||
910 | case CLOCK_EVT_MODE_ONESHOT: | ||
911 | /* period set, and timer enabled in 'next_event' hook */ | ||
912 | ctrl = TIMER_CTRL_ONESHOT; | ||
913 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE; | ||
914 | break; | ||
915 | case CLOCK_EVT_MODE_UNUSED: | ||
916 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
917 | default: | ||
918 | ctrl = 0; | ||
919 | } | ||
920 | |||
921 | writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL); | ||
922 | } | ||
923 | |||
924 | static int timer_set_next_event(unsigned long evt, | ||
925 | struct clock_event_device *unused) | ||
926 | { | ||
927 | unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL); | ||
928 | |||
929 | writel(evt, TIMER0_VA_BASE + TIMER_LOAD); | ||
930 | writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL); | ||
931 | |||
932 | return 0; | ||
933 | } | ||
934 | |||
935 | static struct clock_event_device timer0_clockevent = { | ||
936 | .name = "timer0", | ||
937 | .shift = 32, | ||
938 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
939 | .set_mode = timer_set_mode, | ||
940 | .set_next_event = timer_set_next_event, | ||
941 | }; | ||
942 | |||
943 | /* | ||
944 | * IRQ handler for the timer | ||
945 | */ | ||
946 | static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id) | ||
947 | { | ||
948 | struct clock_event_device *evt = &timer0_clockevent; | ||
949 | |||
950 | writel(1, TIMER0_VA_BASE + TIMER_INTCLR); | ||
951 | |||
952 | evt->event_handler(evt); | ||
953 | |||
954 | return IRQ_HANDLED; | ||
955 | } | ||
956 | |||
957 | static struct irqaction versatile_timer_irq = { | ||
958 | .name = "Versatile Timer Tick", | ||
959 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
960 | .handler = versatile_timer_interrupt, | ||
961 | }; | ||
962 | |||
963 | static cycle_t versatile_get_cycles(struct clocksource *cs) | ||
964 | { | ||
965 | return ~readl(TIMER3_VA_BASE + TIMER_VALUE); | ||
966 | } | ||
967 | |||
968 | static struct clocksource clocksource_versatile = { | ||
969 | .name = "timer3", | ||
970 | .rating = 200, | ||
971 | .read = versatile_get_cycles, | ||
972 | .mask = CLOCKSOURCE_MASK(32), | ||
973 | .shift = 20, | ||
974 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
975 | }; | ||
976 | |||
977 | static int __init versatile_clocksource_init(void) | ||
978 | { | ||
979 | /* setup timer3 as free-running clocksource */ | ||
980 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); | ||
981 | writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD); | ||
982 | writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE); | ||
983 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | ||
984 | TIMER3_VA_BASE + TIMER_CTRL); | ||
985 | |||
986 | clocksource_versatile.mult = | ||
987 | clocksource_khz2mult(1000, clocksource_versatile.shift); | ||
988 | clocksource_register(&clocksource_versatile); | ||
989 | |||
990 | return 0; | ||
991 | } | ||
992 | 864 | ||
993 | /* | 865 | /* |
994 | * Set up timer interrupt, and return the current time in seconds. | 866 | * Set up timer interrupt, and return the current time in seconds. |
@@ -1017,22 +889,8 @@ static void __init versatile_timer_init(void) | |||
1017 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | 889 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); |
1018 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); | 890 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); |
1019 | 891 | ||
1020 | /* | 892 | sp804_clocksource_init(TIMER3_VA_BASE); |
1021 | * Make irqs happen for the system timer | 893 | sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1); |
1022 | */ | ||
1023 | setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq); | ||
1024 | |||
1025 | versatile_clocksource_init(); | ||
1026 | |||
1027 | timer0_clockevent.mult = | ||
1028 | div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift); | ||
1029 | timer0_clockevent.max_delta_ns = | ||
1030 | clockevent_delta2ns(0xffffffff, &timer0_clockevent); | ||
1031 | timer0_clockevent.min_delta_ns = | ||
1032 | clockevent_delta2ns(0xf, &timer0_clockevent); | ||
1033 | |||
1034 | timer0_clockevent.cpumask = cpumask_of(0); | ||
1035 | clockevents_register_device(&timer0_clockevent); | ||
1036 | } | 894 | } |
1037 | 895 | ||
1038 | struct sys_timer versatile_timer = { | 896 | struct sys_timer versatile_timer = { |
diff --git a/arch/arm/mach-versatile/include/mach/clkdev.h b/arch/arm/mach-versatile/include/mach/clkdev.h index 04b37a89801c..e58d0771b64e 100644 --- a/arch/arm/mach-versatile/include/mach/clkdev.h +++ b/arch/arm/mach-versatile/include/mach/clkdev.h | |||
@@ -1,6 +1,15 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | 1 | #ifndef __ASM_MACH_CLKDEV_H |
2 | #define __ASM_MACH_CLKDEV_H | 2 | #define __ASM_MACH_CLKDEV_H |
3 | 3 | ||
4 | #include <plat/clock.h> | ||
5 | |||
6 | struct clk { | ||
7 | unsigned long rate; | ||
8 | const struct clk_ops *ops; | ||
9 | const struct icst_params *params; | ||
10 | void __iomem *vcoreg; | ||
11 | }; | ||
12 | |||
4 | #define __clk_get(clk) ({ 1; }) | 13 | #define __clk_get(clk) ({ 1; }) |
5 | #define __clk_put(clk) do { } while (0) | 14 | #define __clk_put(clk) do { } while (0) |
6 | 15 | ||
diff --git a/arch/arm/mach-versatile/include/mach/entry-macro.S b/arch/arm/mach-versatile/include/mach/entry-macro.S index 8c8020980585..e6f7c1663160 100644 --- a/arch/arm/mach-versatile/include/mach/entry-macro.S +++ b/arch/arm/mach-versatile/include/mach/entry-macro.S | |||
@@ -8,6 +8,7 @@ | |||
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | 9 | */ |
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | #include <mach/platform.h> | ||
11 | #include <asm/hardware/vic.h> | 12 | #include <asm/hardware/vic.h> |
12 | 13 | ||
13 | .macro disable_fiq | 14 | .macro disable_fiq |
diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h index 7aa906c93154..4f8f99aac938 100644 --- a/arch/arm/mach-versatile/include/mach/hardware.h +++ b/arch/arm/mach-versatile/include/mach/hardware.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #define __ASM_ARCH_HARDWARE_H | 23 | #define __ASM_ARCH_HARDWARE_H |
24 | 24 | ||
25 | #include <asm/sizes.h> | 25 | #include <asm/sizes.h> |
26 | #include <mach/platform.h> | ||
27 | 26 | ||
28 | /* | 27 | /* |
29 | * PCI space virtual addresses | 28 | * PCI space virtual addresses |
@@ -49,4 +48,6 @@ | |||
49 | /* macro to get at IO space when running virtually */ | 48 | /* macro to get at IO space when running virtually */ |
50 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) | 49 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) |
51 | 50 | ||
51 | #define __io_address(n) __io(IO_ADDRESS(n)) | ||
52 | |||
52 | #endif | 53 | #endif |
diff --git a/arch/arm/mach-versatile/include/mach/platform.h b/arch/arm/mach-versatile/include/mach/platform.h index 83207395191a..ec087407b163 100644 --- a/arch/arm/mach-versatile/include/mach/platform.h +++ b/arch/arm/mach-versatile/include/mach/platform.h | |||
@@ -205,7 +205,7 @@ | |||
205 | #define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */ | 205 | #define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */ |
206 | #define VERSATILE_DMAC_BASE 0x10130000 /* DMA controller */ | 206 | #define VERSATILE_DMAC_BASE 0x10130000 /* DMA controller */ |
207 | #define VERSATILE_VIC_BASE 0x10140000 /* Vectored interrupt controller */ | 207 | #define VERSATILE_VIC_BASE 0x10140000 /* Vectored interrupt controller */ |
208 | #define VERSATILE_PERIPH_BASE 0x10150000 /* off-chip peripherals alias from */ | 208 | #define VERSATILE_PERIPH_BASE 0x10150000 /* off-chip peripherals alias from */ |
209 | /* 0x10000000 - 0x100FFFFF */ | 209 | /* 0x10000000 - 0x100FFFFF */ |
210 | #define VERSATILE_AHBM_BASE 0x101D0000 /* AHB monitor */ | 210 | #define VERSATILE_AHBM_BASE 0x101D0000 /* AHB monitor */ |
211 | #define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */ | 211 | #define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */ |
@@ -213,7 +213,7 @@ | |||
213 | #define VERSATILE_TIMER0_1_BASE 0x101E2000 /* Timer 0 and 1 */ | 213 | #define VERSATILE_TIMER0_1_BASE 0x101E2000 /* Timer 0 and 1 */ |
214 | #define VERSATILE_TIMER2_3_BASE 0x101E3000 /* Timer 2 and 3 */ | 214 | #define VERSATILE_TIMER2_3_BASE 0x101E3000 /* Timer 2 and 3 */ |
215 | #define VERSATILE_GPIO0_BASE 0x101E4000 /* GPIO port 0 */ | 215 | #define VERSATILE_GPIO0_BASE 0x101E4000 /* GPIO port 0 */ |
216 | #define VERSATILE_GPIO1_BASE 0x101E5000 /* GPIO port 1 */ | 216 | #define VERSATILE_GPIO1_BASE 0x101E5000 /* GPIO port 1 */ |
217 | #define VERSATILE_GPIO2_BASE 0x101E6000 /* GPIO port 2 */ | 217 | #define VERSATILE_GPIO2_BASE 0x101E6000 /* GPIO port 2 */ |
218 | #define VERSATILE_GPIO3_BASE 0x101E7000 /* GPIO port 3 */ | 218 | #define VERSATILE_GPIO3_BASE 0x101E7000 /* GPIO port 3 */ |
219 | #define VERSATILE_RTC_BASE 0x101E8000 /* Real Time Clock */ | 219 | #define VERSATILE_RTC_BASE 0x101E8000 /* Real Time Clock */ |
@@ -379,12 +379,6 @@ | |||
379 | #define SIC_INT_PCI3 30 | 379 | #define SIC_INT_PCI3 30 |
380 | 380 | ||
381 | 381 | ||
382 | /* | ||
383 | * Clean base - dummy | ||
384 | * | ||
385 | */ | ||
386 | #define CLEAN_BASE VERSATILE_BOOT_ROM_HI | ||
387 | |||
388 | /* | 382 | /* |
389 | * System controller bit assignment | 383 | * System controller bit assignment |
390 | */ | 384 | */ |
@@ -397,20 +391,6 @@ | |||
397 | #define VERSATILE_TIMER4_EnSel 21 | 391 | #define VERSATILE_TIMER4_EnSel 21 |
398 | 392 | ||
399 | 393 | ||
400 | #define MAX_TIMER 2 | ||
401 | #define MAX_PERIOD 699050 | ||
402 | #define TICKS_PER_uSEC 1 | ||
403 | |||
404 | /* | ||
405 | * These are useconds NOT ticks. | ||
406 | * | ||
407 | */ | ||
408 | #define mSEC_1 1000 | ||
409 | #define mSEC_5 (mSEC_1 * 5) | ||
410 | #define mSEC_10 (mSEC_1 * 10) | ||
411 | #define mSEC_25 (mSEC_1 * 25) | ||
412 | #define SEC_1 (mSEC_1 * 1000) | ||
413 | |||
414 | #define VERSATILE_CSR_BASE 0x10000000 | 394 | #define VERSATILE_CSR_BASE 0x10000000 |
415 | #define VERSATILE_CSR_SIZE 0x10000000 | 395 | #define VERSATILE_CSR_SIZE 0x10000000 |
416 | 396 | ||
@@ -432,5 +412,3 @@ | |||
432 | #endif | 412 | #endif |
433 | 413 | ||
434 | #endif | 414 | #endif |
435 | |||
436 | /* END */ | ||
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig new file mode 100644 index 000000000000..3f19b660a165 --- /dev/null +++ b/arch/arm/mach-vexpress/Kconfig | |||
@@ -0,0 +1,9 @@ | |||
1 | menu "Versatile Express platform type" | ||
2 | depends on ARCH_VEXPRESS | ||
3 | |||
4 | config ARCH_VEXPRESS_CA9X4 | ||
5 | bool "Versatile Express Cortex-A9x4 tile" | ||
6 | select CPU_V7 | ||
7 | select ARM_GIC | ||
8 | |||
9 | endmenu | ||
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile new file mode 100644 index 000000000000..1b71b77ade22 --- /dev/null +++ b/arch/arm/mach-vexpress/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # | ||
2 | # Makefile for the linux kernel. | ||
3 | # | ||
4 | |||
5 | obj-y := v2m.o | ||
6 | obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o | ||
7 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | ||
8 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o | ||
diff --git a/arch/arm/mach-vexpress/Makefile.boot b/arch/arm/mach-vexpress/Makefile.boot new file mode 100644 index 000000000000..07c2d9c457ec --- /dev/null +++ b/arch/arm/mach-vexpress/Makefile.boot | |||
@@ -0,0 +1,3 @@ | |||
1 | zreladdr-y := 0x60008000 | ||
2 | params_phys-y := 0x60000100 | ||
3 | initrd_phys-y := 0x60800000 | ||
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h new file mode 100644 index 000000000000..57dd95ce41f9 --- /dev/null +++ b/arch/arm/mach-vexpress/core.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #define __MMIO_P2V(x) (((x) & 0xfffff) | (((x) & 0x0f000000) >> 4) | 0xf8000000) | ||
2 | #define MMIO_P2V(x) ((void __iomem *)__MMIO_P2V(x)) | ||
3 | |||
4 | #define AMBA_DEVICE(name,busid,base,plat) \ | ||
5 | struct amba_device name##_device = { \ | ||
6 | .dev = { \ | ||
7 | .coherent_dma_mask = ~0UL, \ | ||
8 | .init_name = busid, \ | ||
9 | .platform_data = plat, \ | ||
10 | }, \ | ||
11 | .res = { \ | ||
12 | .start = base, \ | ||
13 | .end = base + SZ_4K - 1, \ | ||
14 | .flags = IORESOURCE_MEM, \ | ||
15 | }, \ | ||
16 | .dma_mask = ~0UL, \ | ||
17 | .irq = IRQ_##base, \ | ||
18 | /* .dma = DMA_##base,*/ \ | ||
19 | } | ||
20 | |||
21 | struct map_desc; | ||
22 | |||
23 | void v2m_map_io(struct map_desc *tile, size_t num); | ||
24 | extern struct sys_timer v2m_timer; | ||
25 | |||
26 | extern void __iomem *gic_cpu_base_addr; | ||
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c new file mode 100644 index 000000000000..e6f73030d5f0 --- /dev/null +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
@@ -0,0 +1,249 @@ | |||
1 | /* | ||
2 | * Versatile Express Core Tile Cortex A9x4 Support | ||
3 | */ | ||
4 | #include <linux/init.h> | ||
5 | #include <linux/device.h> | ||
6 | #include <linux/dma-mapping.h> | ||
7 | #include <linux/platform_device.h> | ||
8 | #include <linux/amba/bus.h> | ||
9 | #include <linux/amba/clcd.h> | ||
10 | |||
11 | #include <asm/clkdev.h> | ||
12 | #include <asm/hardware/arm_timer.h> | ||
13 | #include <asm/hardware/cache-l2x0.h> | ||
14 | #include <asm/hardware/gic.h> | ||
15 | #include <asm/mach-types.h> | ||
16 | #include <asm/pmu.h> | ||
17 | |||
18 | #include <mach/clkdev.h> | ||
19 | #include <mach/ct-ca9x4.h> | ||
20 | |||
21 | #include <plat/timer-sp.h> | ||
22 | |||
23 | #include <asm/mach/arch.h> | ||
24 | #include <asm/mach/map.h> | ||
25 | #include <asm/mach/time.h> | ||
26 | |||
27 | #include "core.h" | ||
28 | |||
29 | #include <mach/motherboard.h> | ||
30 | |||
31 | #define V2M_PA_CS7 0x10000000 | ||
32 | |||
33 | static struct map_desc ct_ca9x4_io_desc[] __initdata = { | ||
34 | { | ||
35 | .virtual = __MMIO_P2V(CT_CA9X4_MPIC), | ||
36 | .pfn = __phys_to_pfn(CT_CA9X4_MPIC), | ||
37 | .length = SZ_16K, | ||
38 | .type = MT_DEVICE, | ||
39 | }, { | ||
40 | .virtual = __MMIO_P2V(CT_CA9X4_SP804_TIMER), | ||
41 | .pfn = __phys_to_pfn(CT_CA9X4_SP804_TIMER), | ||
42 | .length = SZ_4K, | ||
43 | .type = MT_DEVICE, | ||
44 | }, { | ||
45 | .virtual = __MMIO_P2V(CT_CA9X4_L2CC), | ||
46 | .pfn = __phys_to_pfn(CT_CA9X4_L2CC), | ||
47 | .length = SZ_4K, | ||
48 | .type = MT_DEVICE, | ||
49 | }, | ||
50 | }; | ||
51 | |||
52 | static void __init ct_ca9x4_map_io(void) | ||
53 | { | ||
54 | v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); | ||
55 | } | ||
56 | |||
57 | void __iomem *gic_cpu_base_addr; | ||
58 | |||
59 | static void __init ct_ca9x4_init_irq(void) | ||
60 | { | ||
61 | gic_cpu_base_addr = MMIO_P2V(A9_MPCORE_GIC_CPU); | ||
62 | gic_dist_init(0, MMIO_P2V(A9_MPCORE_GIC_DIST), 29); | ||
63 | gic_cpu_init(0, gic_cpu_base_addr); | ||
64 | } | ||
65 | |||
66 | #if 0 | ||
67 | static void ct_ca9x4_timer_init(void) | ||
68 | { | ||
69 | writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL); | ||
70 | writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL); | ||
71 | |||
72 | sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1)); | ||
73 | sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0); | ||
74 | } | ||
75 | |||
76 | static struct sys_timer ct_ca9x4_timer = { | ||
77 | .init = ct_ca9x4_timer_init, | ||
78 | }; | ||
79 | #endif | ||
80 | |||
81 | static struct clcd_panel xvga_panel = { | ||
82 | .mode = { | ||
83 | .name = "XVGA", | ||
84 | .refresh = 60, | ||
85 | .xres = 1024, | ||
86 | .yres = 768, | ||
87 | .pixclock = 15384, | ||
88 | .left_margin = 168, | ||
89 | .right_margin = 8, | ||
90 | .upper_margin = 29, | ||
91 | .lower_margin = 3, | ||
92 | .hsync_len = 144, | ||
93 | .vsync_len = 6, | ||
94 | .sync = 0, | ||
95 | .vmode = FB_VMODE_NONINTERLACED, | ||
96 | }, | ||
97 | .width = -1, | ||
98 | .height = -1, | ||
99 | .tim2 = TIM2_BCD | TIM2_IPC, | ||
100 | .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1), | ||
101 | .bpp = 16, | ||
102 | }; | ||
103 | |||
104 | static void ct_ca9x4_clcd_enable(struct clcd_fb *fb) | ||
105 | { | ||
106 | v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0); | ||
107 | v2m_cfg_write(SYS_CFG_DVIMODE | SYS_CFG_SITE_DB1, 2); | ||
108 | } | ||
109 | |||
110 | static int ct_ca9x4_clcd_setup(struct clcd_fb *fb) | ||
111 | { | ||
112 | unsigned long framesize = 1024 * 768 * 2; | ||
113 | dma_addr_t dma; | ||
114 | |||
115 | fb->panel = &xvga_panel; | ||
116 | |||
117 | fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, | ||
118 | &dma, GFP_KERNEL); | ||
119 | if (!fb->fb.screen_base) { | ||
120 | printk(KERN_ERR "CLCD: unable to map frame buffer\n"); | ||
121 | return -ENOMEM; | ||
122 | } | ||
123 | fb->fb.fix.smem_start = dma; | ||
124 | fb->fb.fix.smem_len = framesize; | ||
125 | |||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | static int ct_ca9x4_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) | ||
130 | { | ||
131 | return dma_mmap_writecombine(&fb->dev->dev, vma, fb->fb.screen_base, | ||
132 | fb->fb.fix.smem_start, fb->fb.fix.smem_len); | ||
133 | } | ||
134 | |||
135 | static void ct_ca9x4_clcd_remove(struct clcd_fb *fb) | ||
136 | { | ||
137 | dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len, | ||
138 | fb->fb.screen_base, fb->fb.fix.smem_start); | ||
139 | } | ||
140 | |||
141 | static struct clcd_board ct_ca9x4_clcd_data = { | ||
142 | .name = "CT-CA9X4", | ||
143 | .check = clcdfb_check, | ||
144 | .decode = clcdfb_decode, | ||
145 | .enable = ct_ca9x4_clcd_enable, | ||
146 | .setup = ct_ca9x4_clcd_setup, | ||
147 | .mmap = ct_ca9x4_clcd_mmap, | ||
148 | .remove = ct_ca9x4_clcd_remove, | ||
149 | }; | ||
150 | |||
151 | static AMBA_DEVICE(clcd, "ct:clcd", CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data); | ||
152 | static AMBA_DEVICE(dmc, "ct:dmc", CT_CA9X4_DMC, NULL); | ||
153 | static AMBA_DEVICE(smc, "ct:smc", CT_CA9X4_SMC, NULL); | ||
154 | static AMBA_DEVICE(gpio, "ct:gpio", CT_CA9X4_GPIO, NULL); | ||
155 | |||
156 | static struct amba_device *ct_ca9x4_amba_devs[] __initdata = { | ||
157 | &clcd_device, | ||
158 | &dmc_device, | ||
159 | &smc_device, | ||
160 | &gpio_device, | ||
161 | }; | ||
162 | |||
163 | |||
164 | static long ct_round(struct clk *clk, unsigned long rate) | ||
165 | { | ||
166 | return rate; | ||
167 | } | ||
168 | |||
169 | static int ct_set(struct clk *clk, unsigned long rate) | ||
170 | { | ||
171 | return v2m_cfg_write(SYS_CFG_OSC | SYS_CFG_SITE_DB1 | 1, rate); | ||
172 | } | ||
173 | |||
174 | static const struct clk_ops osc1_clk_ops = { | ||
175 | .round = ct_round, | ||
176 | .set = ct_set, | ||
177 | }; | ||
178 | |||
179 | static struct clk osc1_clk = { | ||
180 | .ops = &osc1_clk_ops, | ||
181 | .rate = 24000000, | ||
182 | }; | ||
183 | |||
184 | static struct clk_lookup lookups[] = { | ||
185 | { /* CLCD */ | ||
186 | .dev_id = "ct:clcd", | ||
187 | .clk = &osc1_clk, | ||
188 | }, | ||
189 | }; | ||
190 | |||
191 | static struct resource pmu_resources[] = { | ||
192 | [0] = { | ||
193 | .start = IRQ_CT_CA9X4_PMU_CPU0, | ||
194 | .end = IRQ_CT_CA9X4_PMU_CPU0, | ||
195 | .flags = IORESOURCE_IRQ, | ||
196 | }, | ||
197 | [1] = { | ||
198 | .start = IRQ_CT_CA9X4_PMU_CPU1, | ||
199 | .end = IRQ_CT_CA9X4_PMU_CPU1, | ||
200 | .flags = IORESOURCE_IRQ, | ||
201 | }, | ||
202 | [2] = { | ||
203 | .start = IRQ_CT_CA9X4_PMU_CPU2, | ||
204 | .end = IRQ_CT_CA9X4_PMU_CPU2, | ||
205 | .flags = IORESOURCE_IRQ, | ||
206 | }, | ||
207 | [3] = { | ||
208 | .start = IRQ_CT_CA9X4_PMU_CPU3, | ||
209 | .end = IRQ_CT_CA9X4_PMU_CPU3, | ||
210 | .flags = IORESOURCE_IRQ, | ||
211 | }, | ||
212 | }; | ||
213 | |||
214 | static struct platform_device pmu_device = { | ||
215 | .name = "arm-pmu", | ||
216 | .id = ARM_PMU_DEVICE_CPU, | ||
217 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
218 | .resource = pmu_resources, | ||
219 | }; | ||
220 | |||
221 | static void ct_ca9x4_init(void) | ||
222 | { | ||
223 | int i; | ||
224 | |||
225 | #ifdef CONFIG_CACHE_L2X0 | ||
226 | l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff); | ||
227 | #endif | ||
228 | |||
229 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
230 | |||
231 | for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++) | ||
232 | amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource); | ||
233 | |||
234 | platform_device_register(&pmu_device); | ||
235 | } | ||
236 | |||
237 | MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4") | ||
238 | .phys_io = V2M_UART0, | ||
239 | .io_pg_offst = (__MMIO_P2V(V2M_UART0) >> 18) & 0xfffc, | ||
240 | .boot_params = PHYS_OFFSET + 0x00000100, | ||
241 | .map_io = ct_ca9x4_map_io, | ||
242 | .init_irq = ct_ca9x4_init_irq, | ||
243 | #if 0 | ||
244 | .timer = &ct_ca9x4_timer, | ||
245 | #else | ||
246 | .timer = &v2m_timer, | ||
247 | #endif | ||
248 | .init_machine = ct_ca9x4_init, | ||
249 | MACHINE_END | ||
diff --git a/arch/arm/mach-vexpress/headsmp.S b/arch/arm/mach-vexpress/headsmp.S new file mode 100644 index 000000000000..8a78ff68e1ee --- /dev/null +++ b/arch/arm/mach-vexpress/headsmp.S | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-vexpress/headsmp.S | ||
3 | * | ||
4 | * Copyright (c) 2003 ARM Limited | ||
5 | * All Rights Reserved | ||
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 | #include <linux/linkage.h> | ||
12 | #include <linux/init.h> | ||
13 | |||
14 | __INIT | ||
15 | |||
16 | /* | ||
17 | * Versatile Express specific entry point for secondary CPUs. This | ||
18 | * provides a "holding pen" into which all secondary cores are held | ||
19 | * until we're ready for them to initialise. | ||
20 | */ | ||
21 | ENTRY(vexpress_secondary_startup) | ||
22 | mrc p15, 0, r0, c0, c0, 5 | ||
23 | and r0, r0, #15 | ||
24 | adr r4, 1f | ||
25 | ldmia r4, {r5, r6} | ||
26 | sub r4, r4, r5 | ||
27 | add r6, r6, r4 | ||
28 | pen: ldr r7, [r6] | ||
29 | cmp r7, r0 | ||
30 | bne pen | ||
31 | |||
32 | /* | ||
33 | * we've been released from the holding pen: secondary_stack | ||
34 | * should now contain the SVC stack for this core | ||
35 | */ | ||
36 | b secondary_startup | ||
37 | |||
38 | 1: .long . | ||
39 | .long pen_release | ||
diff --git a/arch/arm/mach-vexpress/include/mach/clkdev.h b/arch/arm/mach-vexpress/include/mach/clkdev.h new file mode 100644 index 000000000000..3f8307d73cad --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/clkdev.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | ||
2 | #define __ASM_MACH_CLKDEV_H | ||
3 | |||
4 | #include <plat/clock.h> | ||
5 | |||
6 | struct clk { | ||
7 | const struct clk_ops *ops; | ||
8 | unsigned long rate; | ||
9 | const struct icst_params *params; | ||
10 | }; | ||
11 | |||
12 | #define __clk_get(clk) ({ 1; }) | ||
13 | #define __clk_put(clk) do { } while (0) | ||
14 | |||
15 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h new file mode 100644 index 000000000000..8650f04136ef --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef __MACH_CT_CA9X4_H | ||
2 | #define __MACH_CT_CA9X4_H | ||
3 | |||
4 | /* | ||
5 | * Physical base addresses | ||
6 | */ | ||
7 | #define CT_CA9X4_CLCDC (0x10020000) | ||
8 | #define CT_CA9X4_AXIRAM (0x10060000) | ||
9 | #define CT_CA9X4_DMC (0x100e0000) | ||
10 | #define CT_CA9X4_SMC (0x100e1000) | ||
11 | #define CT_CA9X4_SCC (0x100e2000) | ||
12 | #define CT_CA9X4_SP804_TIMER (0x100e4000) | ||
13 | #define CT_CA9X4_SP805_WDT (0x100e5000) | ||
14 | #define CT_CA9X4_TZPC (0x100e6000) | ||
15 | #define CT_CA9X4_GPIO (0x100e8000) | ||
16 | #define CT_CA9X4_FASTAXI (0x100e9000) | ||
17 | #define CT_CA9X4_SLOWAXI (0x100ea000) | ||
18 | #define CT_CA9X4_TZASC (0x100ec000) | ||
19 | #define CT_CA9X4_CORESIGHT (0x10200000) | ||
20 | #define CT_CA9X4_MPIC (0x1e000000) | ||
21 | #define CT_CA9X4_SYSTIMER (0x1e004000) | ||
22 | #define CT_CA9X4_SYSWDT (0x1e007000) | ||
23 | #define CT_CA9X4_L2CC (0x1e00a000) | ||
24 | |||
25 | #define CT_CA9X4_TIMER0 (CT_CA9X4_SP804_TIMER + 0x000) | ||
26 | #define CT_CA9X4_TIMER1 (CT_CA9X4_SP804_TIMER + 0x020) | ||
27 | |||
28 | #define A9_MPCORE_SCU (CT_CA9X4_MPIC + 0x0000) | ||
29 | #define A9_MPCORE_GIC_CPU (CT_CA9X4_MPIC + 0x0100) | ||
30 | #define A9_MPCORE_GIT (CT_CA9X4_MPIC + 0x0200) | ||
31 | #define A9_MPCORE_GIC_DIST (CT_CA9X4_MPIC + 0x1000) | ||
32 | |||
33 | /* | ||
34 | * Interrupts. Those in {} are for AMBA devices | ||
35 | */ | ||
36 | #define IRQ_CT_CA9X4_CLCDC { 76 } | ||
37 | #define IRQ_CT_CA9X4_DMC { -1 } | ||
38 | #define IRQ_CT_CA9X4_SMC { 77, 78 } | ||
39 | #define IRQ_CT_CA9X4_TIMER0 80 | ||
40 | #define IRQ_CT_CA9X4_TIMER1 81 | ||
41 | #define IRQ_CT_CA9X4_GPIO { 82 } | ||
42 | #define IRQ_CT_CA9X4_PMU_CPU0 92 | ||
43 | #define IRQ_CT_CA9X4_PMU_CPU1 93 | ||
44 | #define IRQ_CT_CA9X4_PMU_CPU2 94 | ||
45 | #define IRQ_CT_CA9X4_PMU_CPU3 95 | ||
46 | |||
47 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/debug-macro.S b/arch/arm/mach-vexpress/include/mach/debug-macro.S new file mode 100644 index 000000000000..5167e2aceeba --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/debug-macro.S | |||
@@ -0,0 +1,23 @@ | |||
1 | /* arch/arm/mach-realview/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 | #define DEBUG_LL_UART_OFFSET 0x00009000 | ||
14 | |||
15 | .macro addruart,rx,tmp | ||
16 | mrc p15, 0, \rx, c1, c0 | ||
17 | tst \rx, #1 @ MMU enabled? | ||
18 | moveq \rx, #0x10000000 | ||
19 | movne \rx, #0xf8000000 @ virtual base | ||
20 | orr \rx, \rx, #DEBUG_LL_UART_OFFSET | ||
21 | .endm | ||
22 | |||
23 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/mach-vexpress/include/mach/entry-macro.S b/arch/arm/mach-vexpress/include/mach/entry-macro.S new file mode 100644 index 000000000000..20e9fb514f0a --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/entry-macro.S | |||
@@ -0,0 +1,67 @@ | |||
1 | #include <asm/hardware/gic.h> | ||
2 | |||
3 | .macro disable_fiq | ||
4 | .endm | ||
5 | |||
6 | .macro get_irqnr_preamble, base, tmp | ||
7 | ldr \base, =gic_cpu_base_addr | ||
8 | ldr \base, [\base] | ||
9 | .endm | ||
10 | |||
11 | .macro arch_ret_to_user, tmp1, tmp2 | ||
12 | .endm | ||
13 | |||
14 | /* | ||
15 | * The interrupt numbering scheme is defined in the | ||
16 | * interrupt controller spec. To wit: | ||
17 | * | ||
18 | * Interrupts 0-15 are IPI | ||
19 | * 16-28 are reserved | ||
20 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
21 | * 32-1020 are global | ||
22 | * 1021-1022 are reserved | ||
23 | * 1023 is "spurious" (no interrupt) | ||
24 | * | ||
25 | * For now, we ignore all local interrupts so only return an interrupt if it's | ||
26 | * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. | ||
27 | * | ||
28 | * A simple read from the controller will tell us the number of the highest | ||
29 | * priority enabled interrupt. We then just need to check whether it is in the | ||
30 | * valid range for an IRQ (30-1020 inclusive). | ||
31 | */ | ||
32 | |||
33 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
34 | ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ | ||
35 | ldr \tmp, =1021 | ||
36 | bic \irqnr, \irqstat, #0x1c00 | ||
37 | cmp \irqnr, #29 | ||
38 | cmpcc \irqnr, \irqnr | ||
39 | cmpne \irqnr, \tmp | ||
40 | cmpcs \irqnr, \irqnr | ||
41 | .endm | ||
42 | |||
43 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
44 | * register) is preserved from the macro above. | ||
45 | * If there is an IPI, we immediately signal end of interrupt on the | ||
46 | * controller, since this requires the original irqstat value which | ||
47 | * we won't easily be able to recreate later. | ||
48 | */ | ||
49 | |||
50 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
51 | bic \irqnr, \irqstat, #0x1c00 | ||
52 | cmp \irqnr, #16 | ||
53 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
54 | cmpcs \irqnr, \irqnr | ||
55 | .endm | ||
56 | |||
57 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
58 | |||
59 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
60 | bic \irqnr, \irqstat, #0x1c00 | ||
61 | mov \tmp, #0 | ||
62 | cmp \irqnr, #29 | ||
63 | moveq \tmp, #1 | ||
64 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
65 | cmp \tmp, #0 | ||
66 | .endm | ||
67 | |||
diff --git a/arch/arm/mach-vexpress/include/mach/hardware.h b/arch/arm/mach-vexpress/include/mach/hardware.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/hardware.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/arm/mach-vexpress/include/mach/io.h b/arch/arm/mach-vexpress/include/mach/io.h new file mode 100644 index 000000000000..748bb524ee71 --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/io.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vexpress/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 IO_SPACE_LIMIT 0xffffffff | ||
24 | |||
25 | #define __io(a) __typesafe_io(a) | ||
26 | #define __mem_pci(a) (a) | ||
27 | |||
28 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/irqs.h b/arch/arm/mach-vexpress/include/mach/irqs.h new file mode 100644 index 000000000000..7054cbfc9de5 --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/irqs.h | |||
@@ -0,0 +1,4 @@ | |||
1 | #define IRQ_LOCALTIMER 29 | ||
2 | #define IRQ_LOCALWDOG 30 | ||
3 | |||
4 | #define NR_IRQS 128 | ||
diff --git a/arch/arm/mach-vexpress/include/mach/memory.h b/arch/arm/mach-vexpress/include/mach/memory.h new file mode 100644 index 000000000000..be28232ae639 --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/memory.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vexpress/include/mach/memory.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_ARCH_MEMORY_H | ||
21 | #define __ASM_ARCH_MEMORY_H | ||
22 | |||
23 | #define PHYS_OFFSET UL(0x60000000) | ||
24 | |||
25 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/motherboard.h b/arch/arm/mach-vexpress/include/mach/motherboard.h new file mode 100644 index 000000000000..98a8ded055bf --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/motherboard.h | |||
@@ -0,0 +1,121 @@ | |||
1 | #ifndef __MACH_MOTHERBOARD_H | ||
2 | #define __MACH_MOTHERBOARD_H | ||
3 | |||
4 | /* | ||
5 | * Physical addresses, offset from V2M_PA_CS0-3 | ||
6 | */ | ||
7 | #define V2M_NOR0 (V2M_PA_CS0) | ||
8 | #define V2M_NOR1 (V2M_PA_CS1) | ||
9 | #define V2M_SRAM (V2M_PA_CS2) | ||
10 | #define V2M_VIDEO_SRAM (V2M_PA_CS3 + 0x00000000) | ||
11 | #define V2M_LAN9118 (V2M_PA_CS3 + 0x02000000) | ||
12 | #define V2M_ISP1761 (V2M_PA_CS3 + 0x03000000) | ||
13 | |||
14 | /* | ||
15 | * Physical addresses, offset from V2M_PA_CS7 | ||
16 | */ | ||
17 | #define V2M_SYSREGS (V2M_PA_CS7 + 0x00000000) | ||
18 | #define V2M_SYSCTL (V2M_PA_CS7 + 0x00001000) | ||
19 | #define V2M_SERIAL_BUS_PCI (V2M_PA_CS7 + 0x00002000) | ||
20 | |||
21 | #define V2M_AACI (V2M_PA_CS7 + 0x00004000) | ||
22 | #define V2M_MMCI (V2M_PA_CS7 + 0x00005000) | ||
23 | #define V2M_KMI0 (V2M_PA_CS7 + 0x00006000) | ||
24 | #define V2M_KMI1 (V2M_PA_CS7 + 0x00007000) | ||
25 | |||
26 | #define V2M_UART0 (V2M_PA_CS7 + 0x00009000) | ||
27 | #define V2M_UART1 (V2M_PA_CS7 + 0x0000a000) | ||
28 | #define V2M_UART2 (V2M_PA_CS7 + 0x0000b000) | ||
29 | #define V2M_UART3 (V2M_PA_CS7 + 0x0000c000) | ||
30 | |||
31 | #define V2M_WDT (V2M_PA_CS7 + 0x0000f000) | ||
32 | |||
33 | #define V2M_TIMER01 (V2M_PA_CS7 + 0x00011000) | ||
34 | #define V2M_TIMER23 (V2M_PA_CS7 + 0x00012000) | ||
35 | |||
36 | #define V2M_SERIAL_BUS_DVI (V2M_PA_CS7 + 0x00016000) | ||
37 | #define V2M_RTC (V2M_PA_CS7 + 0x00017000) | ||
38 | |||
39 | #define V2M_CF (V2M_PA_CS7 + 0x0001a000) | ||
40 | #define V2M_CLCD (V2M_PA_CS7 + 0x0001f000) | ||
41 | |||
42 | #define V2M_SYS_ID (V2M_SYSREGS + 0x000) | ||
43 | #define V2M_SYS_SW (V2M_SYSREGS + 0x004) | ||
44 | #define V2M_SYS_LED (V2M_SYSREGS + 0x008) | ||
45 | #define V2M_SYS_100HZ (V2M_SYSREGS + 0x024) | ||
46 | #define V2M_SYS_FLAGS (V2M_SYSREGS + 0x030) | ||
47 | #define V2M_SYS_FLAGSSET (V2M_SYSREGS + 0x030) | ||
48 | #define V2M_SYS_FLAGSCLR (V2M_SYSREGS + 0x034) | ||
49 | #define V2M_SYS_NVFLAGS (V2M_SYSREGS + 0x038) | ||
50 | #define V2M_SYS_NVFLAGSSET (V2M_SYSREGS + 0x038) | ||
51 | #define V2M_SYS_NVFLAGSCLR (V2M_SYSREGS + 0x03c) | ||
52 | #define V2M_SYS_MCI (V2M_SYSREGS + 0x048) | ||
53 | #define V2M_SYS_FLASH (V2M_SYSREGS + 0x03c) | ||
54 | #define V2M_SYS_CFGSW (V2M_SYSREGS + 0x058) | ||
55 | #define V2M_SYS_24MHZ (V2M_SYSREGS + 0x05c) | ||
56 | #define V2M_SYS_MISC (V2M_SYSREGS + 0x060) | ||
57 | #define V2M_SYS_DMA (V2M_SYSREGS + 0x064) | ||
58 | #define V2M_SYS_PROCID0 (V2M_SYSREGS + 0x084) | ||
59 | #define V2M_SYS_PROCID1 (V2M_SYSREGS + 0x088) | ||
60 | #define V2M_SYS_CFGDATA (V2M_SYSREGS + 0x0a0) | ||
61 | #define V2M_SYS_CFGCTRL (V2M_SYSREGS + 0x0a4) | ||
62 | #define V2M_SYS_CFGSTAT (V2M_SYSREGS + 0x0a8) | ||
63 | |||
64 | #define V2M_TIMER0 (V2M_TIMER01 + 0x000) | ||
65 | #define V2M_TIMER1 (V2M_TIMER01 + 0x020) | ||
66 | |||
67 | #define V2M_TIMER2 (V2M_TIMER23 + 0x000) | ||
68 | #define V2M_TIMER3 (V2M_TIMER23 + 0x020) | ||
69 | |||
70 | |||
71 | /* | ||
72 | * Interrupts. Those in {} are for AMBA devices | ||
73 | */ | ||
74 | #define IRQ_V2M_WDT { (32 + 0) } | ||
75 | #define IRQ_V2M_TIMER0 (32 + 2) | ||
76 | #define IRQ_V2M_TIMER1 (32 + 2) | ||
77 | #define IRQ_V2M_TIMER2 (32 + 3) | ||
78 | #define IRQ_V2M_TIMER3 (32 + 3) | ||
79 | #define IRQ_V2M_RTC { (32 + 4) } | ||
80 | #define IRQ_V2M_UART0 { (32 + 5) } | ||
81 | #define IRQ_V2M_UART1 { (32 + 6) } | ||
82 | #define IRQ_V2M_UART2 { (32 + 7) } | ||
83 | #define IRQ_V2M_UART3 { (32 + 8) } | ||
84 | #define IRQ_V2M_MMCI { (32 + 9), (32 + 10) } | ||
85 | #define IRQ_V2M_AACI { (32 + 11) } | ||
86 | #define IRQ_V2M_KMI0 { (32 + 12) } | ||
87 | #define IRQ_V2M_KMI1 { (32 + 13) } | ||
88 | #define IRQ_V2M_CLCD { (32 + 14) } | ||
89 | #define IRQ_V2M_LAN9118 (32 + 15) | ||
90 | #define IRQ_V2M_ISP1761 (32 + 16) | ||
91 | #define IRQ_V2M_PCIE (32 + 17) | ||
92 | |||
93 | |||
94 | /* | ||
95 | * Configuration | ||
96 | */ | ||
97 | #define SYS_CFG_START (1 << 31) | ||
98 | #define SYS_CFG_WRITE (1 << 30) | ||
99 | #define SYS_CFG_OSC (1 << 20) | ||
100 | #define SYS_CFG_VOLT (2 << 20) | ||
101 | #define SYS_CFG_AMP (3 << 20) | ||
102 | #define SYS_CFG_TEMP (4 << 20) | ||
103 | #define SYS_CFG_RESET (5 << 20) | ||
104 | #define SYS_CFG_SCC (6 << 20) | ||
105 | #define SYS_CFG_MUXFPGA (7 << 20) | ||
106 | #define SYS_CFG_SHUTDOWN (8 << 20) | ||
107 | #define SYS_CFG_REBOOT (9 << 20) | ||
108 | #define SYS_CFG_DVIMODE (11 << 20) | ||
109 | #define SYS_CFG_POWER (12 << 20) | ||
110 | #define SYS_CFG_SITE_MB (0 << 16) | ||
111 | #define SYS_CFG_SITE_DB1 (1 << 16) | ||
112 | #define SYS_CFG_SITE_DB2 (2 << 16) | ||
113 | #define SYS_CFG_STACK(n) ((n) << 12) | ||
114 | |||
115 | #define SYS_CFG_ERR (1 << 1) | ||
116 | #define SYS_CFG_COMPLETE (1 << 0) | ||
117 | |||
118 | int v2m_cfg_write(u32 devfn, u32 data); | ||
119 | int v2m_cfg_read(u32 devfn, u32 *data); | ||
120 | |||
121 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/smp.h b/arch/arm/mach-vexpress/include/mach/smp.h new file mode 100644 index 000000000000..72a9621ed087 --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/smp.h | |||
@@ -0,0 +1,21 @@ | |||
1 | #ifndef __MACH_SMP_H | ||
2 | #define __MACH_SMP_H | ||
3 | |||
4 | #include <asm/hardware/gic.h> | ||
5 | |||
6 | #define hard_smp_processor_id() \ | ||
7 | ({ \ | ||
8 | unsigned int cpunum; \ | ||
9 | __asm__("mrc p15, 0, %0, c0, c0, 5" \ | ||
10 | : "=r" (cpunum)); \ | ||
11 | cpunum &= 0x0F; \ | ||
12 | }) | ||
13 | |||
14 | /* | ||
15 | * We use IRQ1 as the IPI | ||
16 | */ | ||
17 | static inline void smp_cross_call(const struct cpumask *mask) | ||
18 | { | ||
19 | gic_raise_softirq(mask, 1); | ||
20 | } | ||
21 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/system.h b/arch/arm/mach-vexpress/include/mach/system.h new file mode 100644 index 000000000000..899a4e628a4c --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/system.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vexpress/include/mach/system.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
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 | #ifndef __ASM_ARCH_SYSTEM_H | ||
22 | #define __ASM_ARCH_SYSTEM_H | ||
23 | |||
24 | static inline void arch_idle(void) | ||
25 | { | ||
26 | /* | ||
27 | * This should do all the clock switching | ||
28 | * and wait for interrupt tricks | ||
29 | */ | ||
30 | cpu_do_idle(); | ||
31 | } | ||
32 | |||
33 | static inline void arch_reset(char mode, const char *cmd) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/timex.h b/arch/arm/mach-vexpress/include/mach/timex.h new file mode 100644 index 000000000000..00029bacd43c --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/timex.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vexpress/include/mach/timex.h | ||
3 | * | ||
4 | * RealView architecture timex specifications | ||
5 | * | ||
6 | * Copyright (C) 2003 ARM Limited | ||
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, | ||
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 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #define CLOCK_TICK_RATE (50000000 / 16) | ||
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h new file mode 100644 index 000000000000..7972c5748d0e --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/uncompress.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vexpress/include/mach/uncompress.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 | #define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) | ||
21 | #define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c)) | ||
22 | #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) | ||
23 | #define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18)) | ||
24 | |||
25 | #define get_uart_base() (0x10000000 + 0x00009000) | ||
26 | |||
27 | /* | ||
28 | * This does not append a newline | ||
29 | */ | ||
30 | static inline void putc(int c) | ||
31 | { | ||
32 | unsigned long base = get_uart_base(); | ||
33 | |||
34 | while (AMBA_UART_FR(base) & (1 << 5)) | ||
35 | barrier(); | ||
36 | |||
37 | AMBA_UART_DR(base) = c; | ||
38 | } | ||
39 | |||
40 | static inline void flush(void) | ||
41 | { | ||
42 | unsigned long base = get_uart_base(); | ||
43 | |||
44 | while (AMBA_UART_FR(base) & (1 << 3)) | ||
45 | barrier(); | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * nothing to do | ||
50 | */ | ||
51 | #define arch_decomp_setup() | ||
52 | #define arch_decomp_wdog() | ||
diff --git a/arch/arm/mach-vexpress/include/mach/vmalloc.h b/arch/arm/mach-vexpress/include/mach/vmalloc.h new file mode 100644 index 000000000000..f43a36ef678b --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/vmalloc.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vexpress/include/mach/vmalloc.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
5 | * Copyright (C) 2000 Russell King. | ||
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 | #define VMALLOC_END 0xf8000000UL | ||
diff --git a/arch/arm/mach-vexpress/localtimer.c b/arch/arm/mach-vexpress/localtimer.c new file mode 100644 index 000000000000..c0e3a59a0bfc --- /dev/null +++ b/arch/arm/mach-vexpress/localtimer.c | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-vexpress/localtimer.c | ||
3 | * | ||
4 | * Copyright (C) 2002 ARM Ltd. | ||
5 | * All Rights Reserved | ||
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 | #include <linux/init.h> | ||
12 | #include <linux/smp.h> | ||
13 | #include <linux/clockchips.h> | ||
14 | |||
15 | #include <asm/smp_twd.h> | ||
16 | #include <asm/localtimer.h> | ||
17 | #include <mach/irqs.h> | ||
18 | |||
19 | /* | ||
20 | * Setup the local clock events for a CPU. | ||
21 | */ | ||
22 | void __cpuinit local_timer_setup(struct clock_event_device *evt) | ||
23 | { | ||
24 | evt->irq = IRQ_LOCALTIMER; | ||
25 | twd_timer_setup(evt); | ||
26 | } | ||
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c new file mode 100644 index 000000000000..670970699ba9 --- /dev/null +++ b/arch/arm/mach-vexpress/platsmp.c | |||
@@ -0,0 +1,190 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-vexpress/platsmp.c | ||
3 | * | ||
4 | * Copyright (C) 2002 ARM Ltd. | ||
5 | * All Rights Reserved | ||
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 | #include <linux/init.h> | ||
12 | #include <linux/errno.h> | ||
13 | #include <linux/delay.h> | ||
14 | #include <linux/device.h> | ||
15 | #include <linux/jiffies.h> | ||
16 | #include <linux/smp.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | #include <asm/cacheflush.h> | ||
20 | #include <asm/localtimer.h> | ||
21 | #include <asm/smp_scu.h> | ||
22 | #include <asm/unified.h> | ||
23 | |||
24 | #include <mach/ct-ca9x4.h> | ||
25 | #include <mach/motherboard.h> | ||
26 | #define V2M_PA_CS7 0x10000000 | ||
27 | |||
28 | #include "core.h" | ||
29 | |||
30 | extern void vexpress_secondary_startup(void); | ||
31 | |||
32 | /* | ||
33 | * control for which core is the next to come out of the secondary | ||
34 | * boot "holding pen" | ||
35 | */ | ||
36 | volatile int __cpuinitdata pen_release = -1; | ||
37 | |||
38 | static void __iomem *scu_base_addr(void) | ||
39 | { | ||
40 | return MMIO_P2V(A9_MPCORE_SCU); | ||
41 | } | ||
42 | |||
43 | static DEFINE_SPINLOCK(boot_lock); | ||
44 | |||
45 | void __cpuinit platform_secondary_init(unsigned int cpu) | ||
46 | { | ||
47 | trace_hardirqs_off(); | ||
48 | |||
49 | /* | ||
50 | * if any interrupts are already enabled for the primary | ||
51 | * core (e.g. timer irq), then they will not have been enabled | ||
52 | * for us: do so | ||
53 | */ | ||
54 | gic_cpu_init(0, gic_cpu_base_addr); | ||
55 | |||
56 | /* | ||
57 | * let the primary processor know we're out of the | ||
58 | * pen, then head off into the C entry point | ||
59 | */ | ||
60 | pen_release = -1; | ||
61 | smp_wmb(); | ||
62 | |||
63 | /* | ||
64 | * Synchronise with the boot thread. | ||
65 | */ | ||
66 | spin_lock(&boot_lock); | ||
67 | spin_unlock(&boot_lock); | ||
68 | } | ||
69 | |||
70 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
71 | { | ||
72 | unsigned long timeout; | ||
73 | |||
74 | /* | ||
75 | * Set synchronisation state between this boot processor | ||
76 | * and the secondary one | ||
77 | */ | ||
78 | spin_lock(&boot_lock); | ||
79 | |||
80 | /* | ||
81 | * This is really belt and braces; we hold unintended secondary | ||
82 | * CPUs in the holding pen until we're ready for them. However, | ||
83 | * since we haven't sent them a soft interrupt, they shouldn't | ||
84 | * be there. | ||
85 | */ | ||
86 | pen_release = cpu; | ||
87 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
88 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
89 | |||
90 | /* | ||
91 | * Send the secondary CPU a soft interrupt, thereby causing | ||
92 | * the boot monitor to read the system wide flags register, | ||
93 | * and branch to the address found there. | ||
94 | */ | ||
95 | smp_cross_call(cpumask_of(cpu)); | ||
96 | |||
97 | timeout = jiffies + (1 * HZ); | ||
98 | while (time_before(jiffies, timeout)) { | ||
99 | smp_rmb(); | ||
100 | if (pen_release == -1) | ||
101 | break; | ||
102 | |||
103 | udelay(10); | ||
104 | } | ||
105 | |||
106 | /* | ||
107 | * now the secondary core is starting up let it run its | ||
108 | * calibrations, then wait for it to finish | ||
109 | */ | ||
110 | spin_unlock(&boot_lock); | ||
111 | |||
112 | return pen_release != -1 ? -ENOSYS : 0; | ||
113 | } | ||
114 | |||
115 | /* | ||
116 | * Initialise the CPU possible map early - this describes the CPUs | ||
117 | * which may be present or become present in the system. | ||
118 | */ | ||
119 | void __init smp_init_cpus(void) | ||
120 | { | ||
121 | void __iomem *scu_base = scu_base_addr(); | ||
122 | unsigned int i, ncores; | ||
123 | |||
124 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; | ||
125 | |||
126 | /* sanity check */ | ||
127 | if (ncores == 0) { | ||
128 | printk(KERN_ERR | ||
129 | "vexpress: strange CM count of 0? Default to 1\n"); | ||
130 | |||
131 | ncores = 1; | ||
132 | } | ||
133 | |||
134 | if (ncores > NR_CPUS) { | ||
135 | printk(KERN_WARNING | ||
136 | "vexpress: no. of cores (%d) greater than configured " | ||
137 | "maximum of %d - clipping\n", | ||
138 | ncores, NR_CPUS); | ||
139 | ncores = NR_CPUS; | ||
140 | } | ||
141 | |||
142 | for (i = 0; i < ncores; i++) | ||
143 | set_cpu_possible(i, true); | ||
144 | } | ||
145 | |||
146 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
147 | { | ||
148 | unsigned int ncores = num_possible_cpus(); | ||
149 | unsigned int cpu = smp_processor_id(); | ||
150 | int i; | ||
151 | |||
152 | smp_store_cpu_info(cpu); | ||
153 | |||
154 | /* | ||
155 | * are we trying to boot more cores than exist? | ||
156 | */ | ||
157 | if (max_cpus > ncores) | ||
158 | max_cpus = ncores; | ||
159 | |||
160 | /* | ||
161 | * Initialise the present map, which describes the set of CPUs | ||
162 | * actually populated at the present time. | ||
163 | */ | ||
164 | for (i = 0; i < max_cpus; i++) | ||
165 | set_cpu_present(i, true); | ||
166 | |||
167 | /* | ||
168 | * Initialise the SCU if there are more than one CPU and let | ||
169 | * them know where to start. | ||
170 | */ | ||
171 | if (max_cpus > 1) { | ||
172 | /* | ||
173 | * Enable the local timer or broadcast device for the | ||
174 | * boot CPU, but only if we have more than one CPU. | ||
175 | */ | ||
176 | percpu_timer_setup(); | ||
177 | |||
178 | scu_enable(scu_base_addr()); | ||
179 | |||
180 | /* | ||
181 | * Write the address of secondary startup into the | ||
182 | * system-wide flags register. The boot monitor waits | ||
183 | * until it receives a soft interrupt, and then the | ||
184 | * secondary CPU branches to this address. | ||
185 | */ | ||
186 | writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR)); | ||
187 | writel(BSYM(virt_to_phys(vexpress_secondary_startup)), | ||
188 | MMIO_P2V(V2M_SYS_FLAGSSET)); | ||
189 | } | ||
190 | } | ||
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c new file mode 100644 index 000000000000..d250711b8c7a --- /dev/null +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -0,0 +1,361 @@ | |||
1 | /* | ||
2 | * Versatile Express V2M Motherboard Support | ||
3 | */ | ||
4 | #include <linux/device.h> | ||
5 | #include <linux/amba/bus.h> | ||
6 | #include <linux/amba/mmci.h> | ||
7 | #include <linux/io.h> | ||
8 | #include <linux/init.h> | ||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/smsc911x.h> | ||
11 | #include <linux/spinlock.h> | ||
12 | #include <linux/sysdev.h> | ||
13 | #include <linux/usb/isp1760.h> | ||
14 | |||
15 | #include <asm/clkdev.h> | ||
16 | #include <asm/sizes.h> | ||
17 | #include <asm/mach/flash.h> | ||
18 | #include <asm/mach/map.h> | ||
19 | #include <asm/mach/time.h> | ||
20 | #include <asm/hardware/arm_timer.h> | ||
21 | |||
22 | #include <mach/clkdev.h> | ||
23 | #include <mach/motherboard.h> | ||
24 | |||
25 | #include <plat/timer-sp.h> | ||
26 | |||
27 | #include "core.h" | ||
28 | |||
29 | #define V2M_PA_CS0 0x40000000 | ||
30 | #define V2M_PA_CS1 0x44000000 | ||
31 | #define V2M_PA_CS2 0x48000000 | ||
32 | #define V2M_PA_CS3 0x4c000000 | ||
33 | #define V2M_PA_CS7 0x10000000 | ||
34 | |||
35 | static struct map_desc v2m_io_desc[] __initdata = { | ||
36 | { | ||
37 | .virtual = __MMIO_P2V(V2M_PA_CS7), | ||
38 | .pfn = __phys_to_pfn(V2M_PA_CS7), | ||
39 | .length = SZ_128K, | ||
40 | .type = MT_DEVICE, | ||
41 | }, | ||
42 | }; | ||
43 | |||
44 | void __init v2m_map_io(struct map_desc *tile, size_t num) | ||
45 | { | ||
46 | iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); | ||
47 | iotable_init(tile, num); | ||
48 | } | ||
49 | |||
50 | |||
51 | static void v2m_timer_init(void) | ||
52 | { | ||
53 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); | ||
54 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); | ||
55 | |||
56 | sp804_clocksource_init(MMIO_P2V(V2M_TIMER1)); | ||
57 | sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0); | ||
58 | } | ||
59 | |||
60 | struct sys_timer v2m_timer = { | ||
61 | .init = v2m_timer_init, | ||
62 | }; | ||
63 | |||
64 | |||
65 | static DEFINE_SPINLOCK(v2m_cfg_lock); | ||
66 | |||
67 | int v2m_cfg_write(u32 devfn, u32 data) | ||
68 | { | ||
69 | /* Configuration interface broken? */ | ||
70 | u32 val; | ||
71 | |||
72 | printk("%s: writing %08x to %08x\n", __func__, data, devfn); | ||
73 | |||
74 | devfn |= SYS_CFG_START | SYS_CFG_WRITE; | ||
75 | |||
76 | spin_lock(&v2m_cfg_lock); | ||
77 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
78 | writel(val & ~SYS_CFG_COMPLETE, MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
79 | |||
80 | writel(data, MMIO_P2V(V2M_SYS_CFGDATA)); | ||
81 | writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL)); | ||
82 | |||
83 | do { | ||
84 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
85 | } while (val == 0); | ||
86 | spin_unlock(&v2m_cfg_lock); | ||
87 | |||
88 | return !!(val & SYS_CFG_ERR); | ||
89 | } | ||
90 | |||
91 | int v2m_cfg_read(u32 devfn, u32 *data) | ||
92 | { | ||
93 | u32 val; | ||
94 | |||
95 | devfn |= SYS_CFG_START; | ||
96 | |||
97 | spin_lock(&v2m_cfg_lock); | ||
98 | writel(0, MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
99 | writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL)); | ||
100 | |||
101 | mb(); | ||
102 | |||
103 | do { | ||
104 | cpu_relax(); | ||
105 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
106 | } while (val == 0); | ||
107 | |||
108 | *data = readl(MMIO_P2V(V2M_SYS_CFGDATA)); | ||
109 | spin_unlock(&v2m_cfg_lock); | ||
110 | |||
111 | return !!(val & SYS_CFG_ERR); | ||
112 | } | ||
113 | |||
114 | |||
115 | static struct resource v2m_pcie_i2c_resource = { | ||
116 | .start = V2M_SERIAL_BUS_PCI, | ||
117 | .end = V2M_SERIAL_BUS_PCI + SZ_4K - 1, | ||
118 | .flags = IORESOURCE_MEM, | ||
119 | }; | ||
120 | |||
121 | static struct platform_device v2m_pcie_i2c_device = { | ||
122 | .name = "versatile-i2c", | ||
123 | .id = 0, | ||
124 | .num_resources = 1, | ||
125 | .resource = &v2m_pcie_i2c_resource, | ||
126 | }; | ||
127 | |||
128 | static struct resource v2m_ddc_i2c_resource = { | ||
129 | .start = V2M_SERIAL_BUS_DVI, | ||
130 | .end = V2M_SERIAL_BUS_DVI + SZ_4K - 1, | ||
131 | .flags = IORESOURCE_MEM, | ||
132 | }; | ||
133 | |||
134 | static struct platform_device v2m_ddc_i2c_device = { | ||
135 | .name = "versatile-i2c", | ||
136 | .id = 1, | ||
137 | .num_resources = 1, | ||
138 | .resource = &v2m_ddc_i2c_resource, | ||
139 | }; | ||
140 | |||
141 | static struct resource v2m_eth_resources[] = { | ||
142 | { | ||
143 | .start = V2M_LAN9118, | ||
144 | .end = V2M_LAN9118 + SZ_64K - 1, | ||
145 | .flags = IORESOURCE_MEM, | ||
146 | }, { | ||
147 | .start = IRQ_V2M_LAN9118, | ||
148 | .end = IRQ_V2M_LAN9118, | ||
149 | .flags = IORESOURCE_IRQ, | ||
150 | }, | ||
151 | }; | ||
152 | |||
153 | static struct smsc911x_platform_config v2m_eth_config = { | ||
154 | .flags = SMSC911X_USE_32BIT, | ||
155 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, | ||
156 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
157 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
158 | }; | ||
159 | |||
160 | static struct platform_device v2m_eth_device = { | ||
161 | .name = "smsc911x", | ||
162 | .id = -1, | ||
163 | .resource = v2m_eth_resources, | ||
164 | .num_resources = ARRAY_SIZE(v2m_eth_resources), | ||
165 | .dev.platform_data = &v2m_eth_config, | ||
166 | }; | ||
167 | |||
168 | static struct resource v2m_usb_resources[] = { | ||
169 | { | ||
170 | .start = V2M_ISP1761, | ||
171 | .end = V2M_ISP1761 + SZ_128K - 1, | ||
172 | .flags = IORESOURCE_MEM, | ||
173 | }, { | ||
174 | .start = IRQ_V2M_ISP1761, | ||
175 | .end = IRQ_V2M_ISP1761, | ||
176 | .flags = IORESOURCE_IRQ, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | static struct isp1760_platform_data v2m_usb_config = { | ||
181 | .is_isp1761 = true, | ||
182 | .bus_width_16 = false, | ||
183 | .port1_otg = true, | ||
184 | .analog_oc = false, | ||
185 | .dack_polarity_high = false, | ||
186 | .dreq_polarity_high = false, | ||
187 | }; | ||
188 | |||
189 | static struct platform_device v2m_usb_device = { | ||
190 | .name = "isp1760", | ||
191 | .id = -1, | ||
192 | .resource = v2m_usb_resources, | ||
193 | .num_resources = ARRAY_SIZE(v2m_usb_resources), | ||
194 | .dev.platform_data = &v2m_usb_config, | ||
195 | }; | ||
196 | |||
197 | static int v2m_flash_init(void) | ||
198 | { | ||
199 | writel(0, MMIO_P2V(V2M_SYS_FLASH)); | ||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | static void v2m_flash_exit(void) | ||
204 | { | ||
205 | writel(0, MMIO_P2V(V2M_SYS_FLASH)); | ||
206 | } | ||
207 | |||
208 | static void v2m_flash_set_vpp(int on) | ||
209 | { | ||
210 | writel(on != 0, MMIO_P2V(V2M_SYS_FLASH)); | ||
211 | } | ||
212 | |||
213 | static struct flash_platform_data v2m_flash_data = { | ||
214 | .map_name = "cfi_probe", | ||
215 | .width = 4, | ||
216 | .init = v2m_flash_init, | ||
217 | .exit = v2m_flash_exit, | ||
218 | .set_vpp = v2m_flash_set_vpp, | ||
219 | }; | ||
220 | |||
221 | static struct resource v2m_flash_resources[] = { | ||
222 | { | ||
223 | .start = V2M_NOR0, | ||
224 | .end = V2M_NOR0 + SZ_64M - 1, | ||
225 | .flags = IORESOURCE_MEM, | ||
226 | }, { | ||
227 | .start = V2M_NOR1, | ||
228 | .end = V2M_NOR1 + SZ_64M - 1, | ||
229 | .flags = IORESOURCE_MEM, | ||
230 | }, | ||
231 | }; | ||
232 | |||
233 | static struct platform_device v2m_flash_device = { | ||
234 | .name = "armflash", | ||
235 | .id = -1, | ||
236 | .resource = v2m_flash_resources, | ||
237 | .num_resources = ARRAY_SIZE(v2m_flash_resources), | ||
238 | .dev.platform_data = &v2m_flash_data, | ||
239 | }; | ||
240 | |||
241 | |||
242 | static unsigned int v2m_mmci_status(struct device *dev) | ||
243 | { | ||
244 | return !(readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0)); | ||
245 | } | ||
246 | |||
247 | static struct mmci_platform_data v2m_mmci_data = { | ||
248 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | ||
249 | .status = v2m_mmci_status, | ||
250 | }; | ||
251 | |||
252 | static AMBA_DEVICE(aaci, "mb:aaci", V2M_AACI, NULL); | ||
253 | static AMBA_DEVICE(mmci, "mb:mmci", V2M_MMCI, &v2m_mmci_data); | ||
254 | static AMBA_DEVICE(kmi0, "mb:kmi0", V2M_KMI0, NULL); | ||
255 | static AMBA_DEVICE(kmi1, "mb:kmi1", V2M_KMI1, NULL); | ||
256 | static AMBA_DEVICE(uart0, "mb:uart0", V2M_UART0, NULL); | ||
257 | static AMBA_DEVICE(uart1, "mb:uart1", V2M_UART1, NULL); | ||
258 | static AMBA_DEVICE(uart2, "mb:uart2", V2M_UART2, NULL); | ||
259 | static AMBA_DEVICE(uart3, "mb:uart3", V2M_UART3, NULL); | ||
260 | static AMBA_DEVICE(wdt, "mb:wdt", V2M_WDT, NULL); | ||
261 | static AMBA_DEVICE(rtc, "mb:rtc", V2M_RTC, NULL); | ||
262 | |||
263 | static struct amba_device *v2m_amba_devs[] __initdata = { | ||
264 | &aaci_device, | ||
265 | &mmci_device, | ||
266 | &kmi0_device, | ||
267 | &kmi1_device, | ||
268 | &uart0_device, | ||
269 | &uart1_device, | ||
270 | &uart2_device, | ||
271 | &uart3_device, | ||
272 | &wdt_device, | ||
273 | &rtc_device, | ||
274 | }; | ||
275 | |||
276 | |||
277 | static long v2m_osc_round(struct clk *clk, unsigned long rate) | ||
278 | { | ||
279 | return rate; | ||
280 | } | ||
281 | |||
282 | static int v2m_osc1_set(struct clk *clk, unsigned long rate) | ||
283 | { | ||
284 | return v2m_cfg_write(SYS_CFG_OSC | SYS_CFG_SITE_MB | 1, rate); | ||
285 | } | ||
286 | |||
287 | static const struct clk_ops osc1_clk_ops = { | ||
288 | .round = v2m_osc_round, | ||
289 | .set = v2m_osc1_set, | ||
290 | }; | ||
291 | |||
292 | static struct clk osc1_clk = { | ||
293 | .ops = &osc1_clk_ops, | ||
294 | .rate = 24000000, | ||
295 | }; | ||
296 | |||
297 | static struct clk osc2_clk = { | ||
298 | .rate = 24000000, | ||
299 | }; | ||
300 | |||
301 | static struct clk_lookup v2m_lookups[] = { | ||
302 | { /* UART0 */ | ||
303 | .dev_id = "mb:uart0", | ||
304 | .clk = &osc2_clk, | ||
305 | }, { /* UART1 */ | ||
306 | .dev_id = "mb:uart1", | ||
307 | .clk = &osc2_clk, | ||
308 | }, { /* UART2 */ | ||
309 | .dev_id = "mb:uart2", | ||
310 | .clk = &osc2_clk, | ||
311 | }, { /* UART3 */ | ||
312 | .dev_id = "mb:uart3", | ||
313 | .clk = &osc2_clk, | ||
314 | }, { /* KMI0 */ | ||
315 | .dev_id = "mb:kmi0", | ||
316 | .clk = &osc2_clk, | ||
317 | }, { /* KMI1 */ | ||
318 | .dev_id = "mb:kmi1", | ||
319 | .clk = &osc2_clk, | ||
320 | }, { /* MMC0 */ | ||
321 | .dev_id = "mb:mmci", | ||
322 | .clk = &osc2_clk, | ||
323 | }, { /* CLCD */ | ||
324 | .dev_id = "mb:clcd", | ||
325 | .clk = &osc1_clk, | ||
326 | }, | ||
327 | }; | ||
328 | |||
329 | static void v2m_power_off(void) | ||
330 | { | ||
331 | if (v2m_cfg_write(SYS_CFG_SHUTDOWN | SYS_CFG_SITE_MB, 0)) | ||
332 | printk(KERN_EMERG "Unable to shutdown\n"); | ||
333 | } | ||
334 | |||
335 | static void v2m_restart(char str, const char *cmd) | ||
336 | { | ||
337 | if (v2m_cfg_write(SYS_CFG_REBOOT | SYS_CFG_SITE_MB, 0)) | ||
338 | printk(KERN_EMERG "Unable to reboot\n"); | ||
339 | } | ||
340 | |||
341 | static int __init v2m_init(void) | ||
342 | { | ||
343 | int i; | ||
344 | |||
345 | clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups)); | ||
346 | |||
347 | platform_device_register(&v2m_pcie_i2c_device); | ||
348 | platform_device_register(&v2m_ddc_i2c_device); | ||
349 | platform_device_register(&v2m_flash_device); | ||
350 | platform_device_register(&v2m_eth_device); | ||
351 | platform_device_register(&v2m_usb_device); | ||
352 | |||
353 | for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++) | ||
354 | amba_device_register(v2m_amba_devs[i], &iomem_resource); | ||
355 | |||
356 | pm_power_off = v2m_power_off; | ||
357 | arm_pm_restart = v2m_restart; | ||
358 | |||
359 | return 0; | ||
360 | } | ||
361 | arch_initcall(v2m_init); | ||
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 5bd7c89a6045..346ae14824a5 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -572,6 +572,8 @@ config CPU_TLB_V6 | |||
572 | config CPU_TLB_V7 | 572 | config CPU_TLB_V7 |
573 | bool | 573 | bool |
574 | 574 | ||
575 | config VERIFY_PERMISSION_FAULT | ||
576 | bool | ||
575 | endif | 577 | endif |
576 | 578 | ||
577 | config CPU_HAS_ASID | 579 | config CPU_HAS_ASID |
@@ -760,7 +762,8 @@ config CACHE_FEROCEON_L2_WRITETHROUGH | |||
760 | config CACHE_L2X0 | 762 | config CACHE_L2X0 |
761 | bool "Enable the L2x0 outer cache controller" | 763 | bool "Enable the L2x0 outer cache controller" |
762 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ | 764 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ |
763 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK || ARCH_OMAP4 | 765 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || \ |
766 | ARCH_NOMADIK || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 | ||
764 | default y | 767 | default y |
765 | select OUTER_CACHE | 768 | select OUTER_CACHE |
766 | select OUTER_CACHE_SYNC | 769 | select OUTER_CACHE_SYNC |
@@ -769,7 +772,7 @@ config CACHE_L2X0 | |||
769 | 772 | ||
770 | config CACHE_TAUROS2 | 773 | config CACHE_TAUROS2 |
771 | bool "Enable the Tauros2 L2 cache controller" | 774 | bool "Enable the Tauros2 L2 cache controller" |
772 | depends on ARCH_DOVE | 775 | depends on (ARCH_DOVE || ARCH_MMP) |
773 | default y | 776 | default y |
774 | select OUTER_CACHE | 777 | select OUTER_CACHE |
775 | help | 778 | help |
@@ -789,6 +792,25 @@ config ARM_L1_CACHE_SHIFT | |||
789 | default 6 if ARM_L1_CACHE_SHIFT_6 | 792 | default 6 if ARM_L1_CACHE_SHIFT_6 |
790 | default 5 | 793 | default 5 |
791 | 794 | ||
795 | config ARM_DMA_MEM_BUFFERABLE | ||
796 | bool "Use non-cacheable memory for DMA" if CPU_V6 && !CPU_V7 | ||
797 | default y if CPU_V6 || CPU_V7 | ||
798 | help | ||
799 | Historically, the kernel has used strongly ordered mappings to | ||
800 | provide DMA coherent memory. With the advent of ARMv7, mapping | ||
801 | memory with differing types results in unpredictable behaviour, | ||
802 | so on these CPUs, this option is forced on. | ||
803 | |||
804 | Multiple mappings with differing attributes is also unpredictable | ||
805 | on ARMv6 CPUs, but since they do not have aggressive speculative | ||
806 | prefetch, no harm appears to occur. | ||
807 | |||
808 | However, drivers may be missing the necessary barriers for ARMv6, | ||
809 | and therefore turning this on may result in unpredictable driver | ||
810 | behaviour. Therefore, we offer this as an option. | ||
811 | |||
812 | You are recommended say 'Y' here and debug any affected drivers. | ||
813 | |||
792 | config ARCH_HAS_BARRIERS | 814 | config ARCH_HAS_BARRIERS |
793 | bool | 815 | bool |
794 | help | 816 | help |
diff --git a/arch/arm/mm/abort-ev7.S b/arch/arm/mm/abort-ev7.S index 2e6dc040c654..ec88b157d3bb 100644 --- a/arch/arm/mm/abort-ev7.S +++ b/arch/arm/mm/abort-ev7.S | |||
@@ -29,5 +29,26 @@ ENTRY(v7_early_abort) | |||
29 | * V6 code adjusts the returned DFSR. | 29 | * V6 code adjusts the returned DFSR. |
30 | * New designs should not need to patch up faults. | 30 | * New designs should not need to patch up faults. |
31 | */ | 31 | */ |
32 | |||
33 | #if defined(CONFIG_VERIFY_PERMISSION_FAULT) | ||
34 | /* | ||
35 | * Detect erroneous permission failures and fix | ||
36 | */ | ||
37 | ldr r3, =0x40d @ On permission fault | ||
38 | and r3, r1, r3 | ||
39 | cmp r3, #0x0d | ||
40 | movne pc, lr | ||
41 | |||
42 | mcr p15, 0, r0, c7, c8, 0 @ Retranslate FAR | ||
43 | isb | ||
44 | mrc p15, 0, r2, c7, c4, 0 @ Read the PAR | ||
45 | and r3, r2, #0x7b @ On translation fault | ||
46 | cmp r3, #0x0b | ||
47 | movne pc, lr | ||
48 | bic r1, r1, #0xf @ Fix up FSR FS[5:0] | ||
49 | and r2, r2, #0x7e | ||
50 | orr r1, r1, r2, LSR #1 | ||
51 | #endif | ||
52 | |||
32 | mov pc, lr | 53 | mov pc, lr |
33 | ENDPROC(v7_early_abort) | 54 | ENDPROC(v7_early_abort) |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index a2ab51fa73e2..6f98c358989a 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
19 | #include <linux/proc_fs.h> | 19 | #include <linux/proc_fs.h> |
20 | #include <linux/seq_file.h> | ||
20 | #include <linux/init.h> | 21 | #include <linux/init.h> |
21 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
22 | #include <linux/uaccess.h> | 23 | #include <linux/uaccess.h> |
@@ -94,36 +95,29 @@ static const char *usermode_action[] = { | |||
94 | "signal+warn" | 95 | "signal+warn" |
95 | }; | 96 | }; |
96 | 97 | ||
97 | static int | 98 | static int alignment_proc_show(struct seq_file *m, void *v) |
98 | proc_alignment_read(char *page, char **start, off_t off, int count, int *eof, | ||
99 | void *data) | ||
100 | { | 99 | { |
101 | char *p = page; | 100 | seq_printf(m, "User:\t\t%lu\n", ai_user); |
102 | int len; | 101 | seq_printf(m, "System:\t\t%lu\n", ai_sys); |
103 | 102 | seq_printf(m, "Skipped:\t%lu\n", ai_skipped); | |
104 | p += sprintf(p, "User:\t\t%lu\n", ai_user); | 103 | seq_printf(m, "Half:\t\t%lu\n", ai_half); |
105 | p += sprintf(p, "System:\t\t%lu\n", ai_sys); | 104 | seq_printf(m, "Word:\t\t%lu\n", ai_word); |
106 | p += sprintf(p, "Skipped:\t%lu\n", ai_skipped); | ||
107 | p += sprintf(p, "Half:\t\t%lu\n", ai_half); | ||
108 | p += sprintf(p, "Word:\t\t%lu\n", ai_word); | ||
109 | if (cpu_architecture() >= CPU_ARCH_ARMv5TE) | 105 | if (cpu_architecture() >= CPU_ARCH_ARMv5TE) |
110 | p += sprintf(p, "DWord:\t\t%lu\n", ai_dword); | 106 | seq_printf(m, "DWord:\t\t%lu\n", ai_dword); |
111 | p += sprintf(p, "Multi:\t\t%lu\n", ai_multi); | 107 | seq_printf(m, "Multi:\t\t%lu\n", ai_multi); |
112 | p += sprintf(p, "User faults:\t%i (%s)\n", ai_usermode, | 108 | seq_printf(m, "User faults:\t%i (%s)\n", ai_usermode, |
113 | usermode_action[ai_usermode]); | 109 | usermode_action[ai_usermode]); |
114 | 110 | ||
115 | len = (p - page) - off; | 111 | return 0; |
116 | if (len < 0) | 112 | } |
117 | len = 0; | ||
118 | |||
119 | *eof = (len <= count) ? 1 : 0; | ||
120 | *start = page + off; | ||
121 | 113 | ||
122 | return len; | 114 | static int alignment_proc_open(struct inode *inode, struct file *file) |
115 | { | ||
116 | return single_open(file, alignment_proc_show, NULL); | ||
123 | } | 117 | } |
124 | 118 | ||
125 | static int proc_alignment_write(struct file *file, const char __user *buffer, | 119 | static ssize_t alignment_proc_write(struct file *file, const char __user *buffer, |
126 | unsigned long count, void *data) | 120 | size_t count, loff_t *pos) |
127 | { | 121 | { |
128 | char mode; | 122 | char mode; |
129 | 123 | ||
@@ -136,6 +130,13 @@ static int proc_alignment_write(struct file *file, const char __user *buffer, | |||
136 | return count; | 130 | return count; |
137 | } | 131 | } |
138 | 132 | ||
133 | static const struct file_operations alignment_proc_fops = { | ||
134 | .open = alignment_proc_open, | ||
135 | .read = seq_read, | ||
136 | .llseek = seq_lseek, | ||
137 | .release = single_release, | ||
138 | .write = alignment_proc_write, | ||
139 | }; | ||
139 | #endif /* CONFIG_PROC_FS */ | 140 | #endif /* CONFIG_PROC_FS */ |
140 | 141 | ||
141 | union offset_union { | 142 | union offset_union { |
@@ -901,12 +902,10 @@ static int __init alignment_init(void) | |||
901 | #ifdef CONFIG_PROC_FS | 902 | #ifdef CONFIG_PROC_FS |
902 | struct proc_dir_entry *res; | 903 | struct proc_dir_entry *res; |
903 | 904 | ||
904 | res = create_proc_entry("cpu/alignment", S_IWUSR | S_IRUGO, NULL); | 905 | res = proc_create("cpu/alignment", S_IWUSR | S_IRUGO, NULL, |
906 | &alignment_proc_fops); | ||
905 | if (!res) | 907 | if (!res) |
906 | return -ENOMEM; | 908 | return -ENOMEM; |
907 | |||
908 | res->read_proc = proc_alignment_read; | ||
909 | res->write_proc = proc_alignment_write; | ||
910 | #endif | 909 | #endif |
911 | 910 | ||
912 | /* | 911 | /* |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 21ad68ba22ba..9819869d2bc9 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | static void __iomem *l2x0_base; | 28 | static void __iomem *l2x0_base; |
29 | static DEFINE_SPINLOCK(l2x0_lock); | 29 | static DEFINE_SPINLOCK(l2x0_lock); |
30 | static uint32_t l2x0_way_mask; /* Bitmask of active ways */ | ||
30 | 31 | ||
31 | static inline void cache_wait(void __iomem *reg, unsigned long mask) | 32 | static inline void cache_wait(void __iomem *reg, unsigned long mask) |
32 | { | 33 | { |
@@ -108,8 +109,8 @@ static inline void l2x0_inv_all(void) | |||
108 | 109 | ||
109 | /* invalidate all ways */ | 110 | /* invalidate all ways */ |
110 | spin_lock_irqsave(&l2x0_lock, flags); | 111 | spin_lock_irqsave(&l2x0_lock, flags); |
111 | writel(0xff, l2x0_base + L2X0_INV_WAY); | 112 | writel(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); |
112 | cache_wait(l2x0_base + L2X0_INV_WAY, 0xff); | 113 | cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); |
113 | cache_sync(); | 114 | cache_sync(); |
114 | spin_unlock_irqrestore(&l2x0_lock, flags); | 115 | spin_unlock_irqrestore(&l2x0_lock, flags); |
115 | } | 116 | } |
@@ -208,9 +209,37 @@ static void l2x0_flush_range(unsigned long start, unsigned long end) | |||
208 | void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | 209 | void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) |
209 | { | 210 | { |
210 | __u32 aux; | 211 | __u32 aux; |
212 | __u32 cache_id; | ||
213 | int ways; | ||
214 | const char *type; | ||
211 | 215 | ||
212 | l2x0_base = base; | 216 | l2x0_base = base; |
213 | 217 | ||
218 | cache_id = readl(l2x0_base + L2X0_CACHE_ID); | ||
219 | aux = readl(l2x0_base + L2X0_AUX_CTRL); | ||
220 | |||
221 | /* Determine the number of ways */ | ||
222 | switch (cache_id & L2X0_CACHE_ID_PART_MASK) { | ||
223 | case L2X0_CACHE_ID_PART_L310: | ||
224 | if (aux & (1 << 16)) | ||
225 | ways = 16; | ||
226 | else | ||
227 | ways = 8; | ||
228 | type = "L310"; | ||
229 | break; | ||
230 | case L2X0_CACHE_ID_PART_L210: | ||
231 | ways = (aux >> 13) & 0xf; | ||
232 | type = "L210"; | ||
233 | break; | ||
234 | default: | ||
235 | /* Assume unknown chips have 8 ways */ | ||
236 | ways = 8; | ||
237 | type = "L2x0 series"; | ||
238 | break; | ||
239 | } | ||
240 | |||
241 | l2x0_way_mask = (1 << ways) - 1; | ||
242 | |||
214 | /* | 243 | /* |
215 | * Check if l2x0 controller is already enabled. | 244 | * Check if l2x0 controller is already enabled. |
216 | * If you are booting from non-secure mode | 245 | * If you are booting from non-secure mode |
@@ -219,8 +248,6 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
219 | if (!(readl(l2x0_base + L2X0_CTRL) & 1)) { | 248 | if (!(readl(l2x0_base + L2X0_CTRL) & 1)) { |
220 | 249 | ||
221 | /* l2x0 controller is disabled */ | 250 | /* l2x0 controller is disabled */ |
222 | |||
223 | aux = readl(l2x0_base + L2X0_AUX_CTRL); | ||
224 | aux &= aux_mask; | 251 | aux &= aux_mask; |
225 | aux |= aux_val; | 252 | aux |= aux_val; |
226 | writel(aux, l2x0_base + L2X0_AUX_CTRL); | 253 | writel(aux, l2x0_base + L2X0_AUX_CTRL); |
@@ -236,5 +263,7 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
236 | outer_cache.flush_range = l2x0_flush_range; | 263 | outer_cache.flush_range = l2x0_flush_range; |
237 | outer_cache.sync = l2x0_cache_sync; | 264 | outer_cache.sync = l2x0_cache_sync; |
238 | 265 | ||
239 | printk(KERN_INFO "L2X0 cache controller enabled\n"); | 266 | printk(KERN_INFO "%s cache controller enabled\n", type); |
267 | printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x\n", | ||
268 | ways, cache_id, aux); | ||
240 | } | 269 | } |
diff --git a/arch/arm/mm/copypage-fa.c b/arch/arm/mm/copypage-fa.c index b2a6008b0111..d2852e1635b1 100644 --- a/arch/arm/mm/copypage-fa.c +++ b/arch/arm/mm/copypage-fa.c | |||
@@ -40,7 +40,7 @@ fa_copy_user_page(void *kto, const void *kfrom) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | void fa_copy_user_highpage(struct page *to, struct page *from, | 42 | void fa_copy_user_highpage(struct page *to, struct page *from, |
43 | unsigned long vaddr) | 43 | unsigned long vaddr, struct vm_area_struct *vma) |
44 | { | 44 | { |
45 | void *kto, *kfrom; | 45 | void *kto, *kfrom; |
46 | 46 | ||
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c index 0d414c28eb2c..9b906dec1ca1 100644 --- a/arch/arm/mm/fault-armv.c +++ b/arch/arm/mm/fault-armv.c | |||
@@ -134,8 +134,6 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, | |||
134 | flush_dcache_mmap_unlock(mapping); | 134 | flush_dcache_mmap_unlock(mapping); |
135 | if (aliases) | 135 | if (aliases) |
136 | do_adjust_pte(vma, addr, pfn, ptep); | 136 | do_adjust_pte(vma, addr, pfn, ptep); |
137 | else | ||
138 | flush_cache_page(vma, addr, pfn); | ||
139 | } | 137 | } |
140 | 138 | ||
141 | /* | 139 | /* |
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 9d40c341e07e..92f5801f99c1 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
@@ -463,7 +463,12 @@ static struct fsr_info { | |||
463 | { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, | 463 | { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, |
464 | { do_bad, SIGKILL, 0, "terminal exception" }, | 464 | { do_bad, SIGKILL, 0, "terminal exception" }, |
465 | { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, | 465 | { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, |
466 | /* Do we need runtime check ? */ | ||
467 | #if __LINUX_ARM_ARCH__ < 6 | ||
466 | { do_bad, SIGBUS, 0, "external abort on linefetch" }, | 468 | { do_bad, SIGBUS, 0, "external abort on linefetch" }, |
469 | #else | ||
470 | { do_translation_fault, SIGSEGV, SEGV_MAPERR, "I-cache maintenance fault" }, | ||
471 | #endif | ||
467 | { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" }, | 472 | { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" }, |
468 | { do_bad, SIGBUS, 0, "external abort on linefetch" }, | 473 | { do_bad, SIGBUS, 0, "external abort on linefetch" }, |
469 | { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" }, | 474 | { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" }, |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0ed29bfeba1c..1ba6cf5a2c02 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/mman.h> | 15 | #include <linux/mman.h> |
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <linux/initrd.h> | 17 | #include <linux/initrd.h> |
18 | #include <linux/sort.h> | ||
19 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
20 | #include <linux/gfp.h> | 19 | #include <linux/gfp.h> |
21 | 20 | ||
@@ -224,20 +223,6 @@ static int __init check_initrd(struct meminfo *mi) | |||
224 | return initrd_node; | 223 | return initrd_node; |
225 | } | 224 | } |
226 | 225 | ||
227 | static inline void map_memory_bank(struct membank *bank) | ||
228 | { | ||
229 | #ifdef CONFIG_MMU | ||
230 | struct map_desc map; | ||
231 | |||
232 | map.pfn = bank_pfn_start(bank); | ||
233 | map.virtual = __phys_to_virt(bank_phys_start(bank)); | ||
234 | map.length = bank_phys_size(bank); | ||
235 | map.type = MT_MEMORY; | ||
236 | |||
237 | create_mapping(&map); | ||
238 | #endif | ||
239 | } | ||
240 | |||
241 | static void __init bootmem_init_node(int node, struct meminfo *mi, | 226 | static void __init bootmem_init_node(int node, struct meminfo *mi, |
242 | unsigned long start_pfn, unsigned long end_pfn) | 227 | unsigned long start_pfn, unsigned long end_pfn) |
243 | { | 228 | { |
@@ -247,16 +232,6 @@ static void __init bootmem_init_node(int node, struct meminfo *mi, | |||
247 | int i; | 232 | int i; |
248 | 233 | ||
249 | /* | 234 | /* |
250 | * Map the memory banks for this node. | ||
251 | */ | ||
252 | for_each_nodebank(i, mi, node) { | ||
253 | struct membank *bank = &mi->bank[i]; | ||
254 | |||
255 | if (!bank->highmem) | ||
256 | map_memory_bank(bank); | ||
257 | } | ||
258 | |||
259 | /* | ||
260 | * Allocate the bootmem bitmap page. | 235 | * Allocate the bootmem bitmap page. |
261 | */ | 236 | */ |
262 | boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn); | 237 | boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn); |
@@ -385,21 +360,12 @@ static void arm_memory_present(struct meminfo *mi, int node) | |||
385 | } | 360 | } |
386 | #endif | 361 | #endif |
387 | 362 | ||
388 | static int __init meminfo_cmp(const void *_a, const void *_b) | ||
389 | { | ||
390 | const struct membank *a = _a, *b = _b; | ||
391 | long cmp = bank_pfn_start(a) - bank_pfn_start(b); | ||
392 | return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; | ||
393 | } | ||
394 | |||
395 | void __init bootmem_init(void) | 363 | void __init bootmem_init(void) |
396 | { | 364 | { |
397 | struct meminfo *mi = &meminfo; | 365 | struct meminfo *mi = &meminfo; |
398 | unsigned long min, max_low, max_high; | 366 | unsigned long min, max_low, max_high; |
399 | int node, initrd_node; | 367 | int node, initrd_node; |
400 | 368 | ||
401 | sort(&mi->bank, mi->nr_banks, sizeof(mi->bank[0]), meminfo_cmp, NULL); | ||
402 | |||
403 | /* | 369 | /* |
404 | * Locate which node contains the ramdisk image, if any. | 370 | * Locate which node contains the ramdisk image, if any. |
405 | */ | 371 | */ |
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index a888363398f8..815d08eecbb0 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h | |||
@@ -28,10 +28,7 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page | |||
28 | 28 | ||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | struct map_desc; | ||
32 | struct meminfo; | ||
33 | struct pglist_data; | 31 | struct pglist_data; |
34 | 32 | ||
35 | void __init create_mapping(struct map_desc *md); | ||
36 | void __init bootmem_init(void); | 33 | void __init bootmem_init(void); |
37 | void reserve_node_zero(struct pglist_data *pgdat); | 34 | void reserve_node_zero(struct pglist_data *pgdat); |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 241c24a1c18f..e7113d0b8168 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/bootmem.h> | 14 | #include <linux/bootmem.h> |
15 | #include <linux/mman.h> | 15 | #include <linux/mman.h> |
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <linux/sort.h> | ||
17 | 18 | ||
18 | #include <asm/cputype.h> | 19 | #include <asm/cputype.h> |
19 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
@@ -603,7 +604,7 @@ static void __init create_36bit_mapping(struct map_desc *md, | |||
603 | * offsets, and we take full advantage of sections and | 604 | * offsets, and we take full advantage of sections and |
604 | * supersections. | 605 | * supersections. |
605 | */ | 606 | */ |
606 | void __init create_mapping(struct map_desc *md) | 607 | static void __init create_mapping(struct map_desc *md) |
607 | { | 608 | { |
608 | unsigned long phys, addr, length, end; | 609 | unsigned long phys, addr, length, end; |
609 | const struct mem_type *type; | 610 | const struct mem_type *type; |
@@ -1017,6 +1018,39 @@ static void __init kmap_init(void) | |||
1017 | #endif | 1018 | #endif |
1018 | } | 1019 | } |
1019 | 1020 | ||
1021 | static inline void map_memory_bank(struct membank *bank) | ||
1022 | { | ||
1023 | struct map_desc map; | ||
1024 | |||
1025 | map.pfn = bank_pfn_start(bank); | ||
1026 | map.virtual = __phys_to_virt(bank_phys_start(bank)); | ||
1027 | map.length = bank_phys_size(bank); | ||
1028 | map.type = MT_MEMORY; | ||
1029 | |||
1030 | create_mapping(&map); | ||
1031 | } | ||
1032 | |||
1033 | static void __init map_lowmem(void) | ||
1034 | { | ||
1035 | struct meminfo *mi = &meminfo; | ||
1036 | int i; | ||
1037 | |||
1038 | /* Map all the lowmem memory banks. */ | ||
1039 | for (i = 0; i < mi->nr_banks; i++) { | ||
1040 | struct membank *bank = &mi->bank[i]; | ||
1041 | |||
1042 | if (!bank->highmem) | ||
1043 | map_memory_bank(bank); | ||
1044 | } | ||
1045 | } | ||
1046 | |||
1047 | static int __init meminfo_cmp(const void *_a, const void *_b) | ||
1048 | { | ||
1049 | const struct membank *a = _a, *b = _b; | ||
1050 | long cmp = bank_pfn_start(a) - bank_pfn_start(b); | ||
1051 | return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; | ||
1052 | } | ||
1053 | |||
1020 | /* | 1054 | /* |
1021 | * paging_init() sets up the page tables, initialises the zone memory | 1055 | * paging_init() sets up the page tables, initialises the zone memory |
1022 | * maps, and sets up the zero page, bad page and bad page tables. | 1056 | * maps, and sets up the zero page, bad page and bad page tables. |
@@ -1025,9 +1059,12 @@ void __init paging_init(struct machine_desc *mdesc) | |||
1025 | { | 1059 | { |
1026 | void *zero_page; | 1060 | void *zero_page; |
1027 | 1061 | ||
1062 | sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL); | ||
1063 | |||
1028 | build_mem_type_table(); | 1064 | build_mem_type_table(); |
1029 | sanity_check_meminfo(); | 1065 | sanity_check_meminfo(); |
1030 | prepare_page_table(); | 1066 | prepare_page_table(); |
1067 | map_lowmem(); | ||
1031 | bootmem_init(); | 1068 | bootmem_init(); |
1032 | devicemaps_init(mdesc); | 1069 | devicemaps_init(mdesc); |
1033 | kmap_init(); | 1070 | kmap_init(); |
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c index 4c0ab50f399a..cb7658e8acc5 100644 --- a/arch/arm/nwfpe/fpmodule.c +++ b/arch/arm/nwfpe/fpmodule.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "fpa11.h" | 24 | #include "fpa11.h" |
25 | 25 | ||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/moduleparam.h> | ||
27 | 28 | ||
28 | /* XXX */ | 29 | /* XXX */ |
29 | #include <linux/errno.h> | 30 | #include <linux/errno.h> |
@@ -134,13 +135,17 @@ a SIGFPE exception if necessary. If not the relevant bits in the | |||
134 | cumulative exceptions flag byte are set and we return. | 135 | cumulative exceptions flag byte are set and we return. |
135 | */ | 136 | */ |
136 | 137 | ||
138 | #ifdef CONFIG_DEBUG_USER | ||
139 | /* By default, ignore inexact errors as there are far too many of them to log */ | ||
140 | static int debug = ~BIT_IXC; | ||
141 | #endif | ||
142 | |||
137 | void float_raise(signed char flags) | 143 | void float_raise(signed char flags) |
138 | { | 144 | { |
139 | register unsigned int fpsr, cumulativeTraps; | 145 | register unsigned int fpsr, cumulativeTraps; |
140 | 146 | ||
141 | #ifdef CONFIG_DEBUG_USER | 147 | #ifdef CONFIG_DEBUG_USER |
142 | /* Ignore inexact errors as there are far too many of them to log */ | 148 | if (flags & debug) |
143 | if (flags & ~BIT_IXC) | ||
144 | printk(KERN_DEBUG | 149 | printk(KERN_DEBUG |
145 | "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", | 150 | "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", |
146 | current->comm, current->pid, flags, | 151 | current->comm, current->pid, flags, |
@@ -179,3 +184,7 @@ module_exit(fpe_exit); | |||
179 | MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>"); | 184 | MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>"); |
180 | MODULE_DESCRIPTION("NWFPE floating point emulator (" NWFPE_BITS " precision)"); | 185 | MODULE_DESCRIPTION("NWFPE floating point emulator (" NWFPE_BITS " precision)"); |
181 | MODULE_LICENSE("GPL"); | 186 | MODULE_LICENSE("GPL"); |
187 | |||
188 | #ifdef CONFIG_DEBUG_USER | ||
189 | module_param(debug, int, 0644); | ||
190 | #endif | ||
diff --git a/arch/arm/oprofile/Makefile b/arch/arm/oprofile/Makefile index 88e31f549f50..e666eafed152 100644 --- a/arch/arm/oprofile/Makefile +++ b/arch/arm/oprofile/Makefile | |||
@@ -6,9 +6,4 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ | |||
6 | oprofilefs.o oprofile_stats.o \ | 6 | oprofilefs.o oprofile_stats.o \ |
7 | timer_int.o ) | 7 | timer_int.o ) |
8 | 8 | ||
9 | oprofile-y := $(DRIVER_OBJS) common.o backtrace.o | 9 | oprofile-y := $(DRIVER_OBJS) common.o |
10 | oprofile-$(CONFIG_CPU_XSCALE) += op_model_xscale.o | ||
11 | oprofile-$(CONFIG_OPROFILE_ARM11_CORE) += op_model_arm11_core.o | ||
12 | oprofile-$(CONFIG_OPROFILE_ARMV6) += op_model_v6.o | ||
13 | oprofile-$(CONFIG_OPROFILE_MPCORE) += op_model_mpcore.o | ||
14 | oprofile-$(CONFIG_OPROFILE_ARMV7) += op_model_v7.o | ||
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c deleted file mode 100644 index d805a52b5032..000000000000 --- a/arch/arm/oprofile/backtrace.c +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | /* | ||
2 | * Arm specific backtracing code for oprofile | ||
3 | * | ||
4 | * Copyright 2005 Openedhand Ltd. | ||
5 | * | ||
6 | * Author: Richard Purdie <rpurdie@openedhand.com> | ||
7 | * | ||
8 | * Based on i386 oprofile backtrace code by John Levon, David Smith | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/oprofile.h> | ||
17 | #include <linux/sched.h> | ||
18 | #include <linux/mm.h> | ||
19 | #include <linux/uaccess.h> | ||
20 | #include <asm/ptrace.h> | ||
21 | #include <asm/stacktrace.h> | ||
22 | |||
23 | static int report_trace(struct stackframe *frame, void *d) | ||
24 | { | ||
25 | unsigned int *depth = d; | ||
26 | |||
27 | if (*depth) { | ||
28 | oprofile_add_trace(frame->pc); | ||
29 | (*depth)--; | ||
30 | } | ||
31 | |||
32 | return *depth == 0; | ||
33 | } | ||
34 | |||
35 | /* | ||
36 | * The registers we're interested in are at the end of the variable | ||
37 | * length saved register structure. The fp points at the end of this | ||
38 | * structure so the address of this struct is: | ||
39 | * (struct frame_tail *)(xxx->fp)-1 | ||
40 | */ | ||
41 | struct frame_tail { | ||
42 | struct frame_tail *fp; | ||
43 | unsigned long sp; | ||
44 | unsigned long lr; | ||
45 | } __attribute__((packed)); | ||
46 | |||
47 | static struct frame_tail* user_backtrace(struct frame_tail *tail) | ||
48 | { | ||
49 | struct frame_tail buftail[2]; | ||
50 | |||
51 | /* Also check accessibility of one struct frame_tail beyond */ | ||
52 | if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) | ||
53 | return NULL; | ||
54 | if (__copy_from_user_inatomic(buftail, tail, sizeof(buftail))) | ||
55 | return NULL; | ||
56 | |||
57 | oprofile_add_trace(buftail[0].lr); | ||
58 | |||
59 | /* frame pointers should strictly progress back up the stack | ||
60 | * (towards higher addresses) */ | ||
61 | if (tail >= buftail[0].fp) | ||
62 | return NULL; | ||
63 | |||
64 | return buftail[0].fp-1; | ||
65 | } | ||
66 | |||
67 | void arm_backtrace(struct pt_regs * const regs, unsigned int depth) | ||
68 | { | ||
69 | struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1; | ||
70 | |||
71 | if (!user_mode(regs)) { | ||
72 | struct stackframe frame; | ||
73 | frame.fp = regs->ARM_fp; | ||
74 | frame.sp = regs->ARM_sp; | ||
75 | frame.lr = regs->ARM_lr; | ||
76 | frame.pc = regs->ARM_pc; | ||
77 | walk_stackframe(&frame, report_trace, &depth); | ||
78 | return; | ||
79 | } | ||
80 | |||
81 | while (depth-- && tail && !((unsigned long) tail & 3)) | ||
82 | tail = user_backtrace(tail); | ||
83 | } | ||
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c index 3fcd752d6146..0691176899ff 100644 --- a/arch/arm/oprofile/common.c +++ b/arch/arm/oprofile/common.c | |||
@@ -2,32 +2,184 @@ | |||
2 | * @file common.c | 2 | * @file common.c |
3 | * | 3 | * |
4 | * @remark Copyright 2004 Oprofile Authors | 4 | * @remark Copyright 2004 Oprofile Authors |
5 | * @remark Copyright 2010 ARM Ltd. | ||
5 | * @remark Read the file COPYING | 6 | * @remark Read the file COPYING |
6 | * | 7 | * |
7 | * @author Zwane Mwaikambo | 8 | * @author Zwane Mwaikambo |
9 | * @author Will Deacon [move to perf] | ||
8 | */ | 10 | */ |
9 | 11 | ||
12 | #include <linux/cpumask.h> | ||
13 | #include <linux/err.h> | ||
14 | #include <linux/errno.h> | ||
10 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/mutex.h> | ||
11 | #include <linux/oprofile.h> | 17 | #include <linux/oprofile.h> |
12 | #include <linux/errno.h> | 18 | #include <linux/perf_event.h> |
19 | #include <linux/platform_device.h> | ||
13 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
14 | #include <linux/sysdev.h> | 21 | #include <asm/stacktrace.h> |
15 | #include <linux/mutex.h> | 22 | #include <linux/uaccess.h> |
16 | 23 | ||
17 | #include "op_counter.h" | 24 | #include <asm/perf_event.h> |
18 | #include "op_arm_model.h" | 25 | #include <asm/ptrace.h> |
26 | |||
27 | #ifdef CONFIG_HW_PERF_EVENTS | ||
28 | /* | ||
29 | * Per performance monitor configuration as set via oprofilefs. | ||
30 | */ | ||
31 | struct op_counter_config { | ||
32 | unsigned long count; | ||
33 | unsigned long enabled; | ||
34 | unsigned long event; | ||
35 | unsigned long unit_mask; | ||
36 | unsigned long kernel; | ||
37 | unsigned long user; | ||
38 | struct perf_event_attr attr; | ||
39 | }; | ||
19 | 40 | ||
20 | static struct op_arm_model_spec *op_arm_model; | ||
21 | static int op_arm_enabled; | 41 | static int op_arm_enabled; |
22 | static DEFINE_MUTEX(op_arm_mutex); | 42 | static DEFINE_MUTEX(op_arm_mutex); |
23 | 43 | ||
24 | struct op_counter_config *counter_config; | 44 | static struct op_counter_config *counter_config; |
45 | static struct perf_event **perf_events[nr_cpumask_bits]; | ||
46 | static int perf_num_counters; | ||
47 | |||
48 | /* | ||
49 | * Overflow callback for oprofile. | ||
50 | */ | ||
51 | static void op_overflow_handler(struct perf_event *event, int unused, | ||
52 | struct perf_sample_data *data, struct pt_regs *regs) | ||
53 | { | ||
54 | int id; | ||
55 | u32 cpu = smp_processor_id(); | ||
56 | |||
57 | for (id = 0; id < perf_num_counters; ++id) | ||
58 | if (perf_events[cpu][id] == event) | ||
59 | break; | ||
60 | |||
61 | if (id != perf_num_counters) | ||
62 | oprofile_add_sample(regs, id); | ||
63 | else | ||
64 | pr_warning("oprofile: ignoring spurious overflow " | ||
65 | "on cpu %u\n", cpu); | ||
66 | } | ||
67 | |||
68 | /* | ||
69 | * Called by op_arm_setup to create perf attributes to mirror the oprofile | ||
70 | * settings in counter_config. Attributes are created as `pinned' events and | ||
71 | * so are permanently scheduled on the PMU. | ||
72 | */ | ||
73 | static void op_perf_setup(void) | ||
74 | { | ||
75 | int i; | ||
76 | u32 size = sizeof(struct perf_event_attr); | ||
77 | struct perf_event_attr *attr; | ||
78 | |||
79 | for (i = 0; i < perf_num_counters; ++i) { | ||
80 | attr = &counter_config[i].attr; | ||
81 | memset(attr, 0, size); | ||
82 | attr->type = PERF_TYPE_RAW; | ||
83 | attr->size = size; | ||
84 | attr->config = counter_config[i].event; | ||
85 | attr->sample_period = counter_config[i].count; | ||
86 | attr->pinned = 1; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | static int op_create_counter(int cpu, int event) | ||
91 | { | ||
92 | int ret = 0; | ||
93 | struct perf_event *pevent; | ||
94 | |||
95 | if (!counter_config[event].enabled || (perf_events[cpu][event] != NULL)) | ||
96 | return ret; | ||
97 | |||
98 | pevent = perf_event_create_kernel_counter(&counter_config[event].attr, | ||
99 | cpu, -1, | ||
100 | op_overflow_handler); | ||
101 | |||
102 | if (IS_ERR(pevent)) { | ||
103 | ret = PTR_ERR(pevent); | ||
104 | } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) { | ||
105 | pr_warning("oprofile: failed to enable event %d " | ||
106 | "on CPU %d\n", event, cpu); | ||
107 | ret = -EBUSY; | ||
108 | } else { | ||
109 | perf_events[cpu][event] = pevent; | ||
110 | } | ||
111 | |||
112 | return ret; | ||
113 | } | ||
114 | |||
115 | static void op_destroy_counter(int cpu, int event) | ||
116 | { | ||
117 | struct perf_event *pevent = perf_events[cpu][event]; | ||
118 | |||
119 | if (pevent) { | ||
120 | perf_event_release_kernel(pevent); | ||
121 | perf_events[cpu][event] = NULL; | ||
122 | } | ||
123 | } | ||
124 | |||
125 | /* | ||
126 | * Called by op_arm_start to create active perf events based on the | ||
127 | * perviously configured attributes. | ||
128 | */ | ||
129 | static int op_perf_start(void) | ||
130 | { | ||
131 | int cpu, event, ret = 0; | ||
132 | |||
133 | for_each_online_cpu(cpu) { | ||
134 | for (event = 0; event < perf_num_counters; ++event) { | ||
135 | ret = op_create_counter(cpu, event); | ||
136 | if (ret) | ||
137 | goto out; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | out: | ||
142 | return ret; | ||
143 | } | ||
144 | |||
145 | /* | ||
146 | * Called by op_arm_stop at the end of a profiling run. | ||
147 | */ | ||
148 | static void op_perf_stop(void) | ||
149 | { | ||
150 | int cpu, event; | ||
151 | |||
152 | for_each_online_cpu(cpu) | ||
153 | for (event = 0; event < perf_num_counters; ++event) | ||
154 | op_destroy_counter(cpu, event); | ||
155 | } | ||
156 | |||
157 | |||
158 | static char *op_name_from_perf_id(enum arm_perf_pmu_ids id) | ||
159 | { | ||
160 | switch (id) { | ||
161 | case ARM_PERF_PMU_ID_XSCALE1: | ||
162 | return "arm/xscale1"; | ||
163 | case ARM_PERF_PMU_ID_XSCALE2: | ||
164 | return "arm/xscale2"; | ||
165 | case ARM_PERF_PMU_ID_V6: | ||
166 | return "arm/armv6"; | ||
167 | case ARM_PERF_PMU_ID_V6MP: | ||
168 | return "arm/mpcore"; | ||
169 | case ARM_PERF_PMU_ID_CA8: | ||
170 | return "arm/armv7"; | ||
171 | case ARM_PERF_PMU_ID_CA9: | ||
172 | return "arm/armv7-ca9"; | ||
173 | default: | ||
174 | return NULL; | ||
175 | } | ||
176 | } | ||
25 | 177 | ||
26 | static int op_arm_create_files(struct super_block *sb, struct dentry *root) | 178 | static int op_arm_create_files(struct super_block *sb, struct dentry *root) |
27 | { | 179 | { |
28 | unsigned int i; | 180 | unsigned int i; |
29 | 181 | ||
30 | for (i = 0; i < op_arm_model->num_counters; i++) { | 182 | for (i = 0; i < perf_num_counters; i++) { |
31 | struct dentry *dir; | 183 | struct dentry *dir; |
32 | char buf[4]; | 184 | char buf[4]; |
33 | 185 | ||
@@ -46,12 +198,10 @@ static int op_arm_create_files(struct super_block *sb, struct dentry *root) | |||
46 | 198 | ||
47 | static int op_arm_setup(void) | 199 | static int op_arm_setup(void) |
48 | { | 200 | { |
49 | int ret; | ||
50 | |||
51 | spin_lock(&oprofilefs_lock); | 201 | spin_lock(&oprofilefs_lock); |
52 | ret = op_arm_model->setup_ctrs(); | 202 | op_perf_setup(); |
53 | spin_unlock(&oprofilefs_lock); | 203 | spin_unlock(&oprofilefs_lock); |
54 | return ret; | 204 | return 0; |
55 | } | 205 | } |
56 | 206 | ||
57 | static int op_arm_start(void) | 207 | static int op_arm_start(void) |
@@ -60,8 +210,9 @@ static int op_arm_start(void) | |||
60 | 210 | ||
61 | mutex_lock(&op_arm_mutex); | 211 | mutex_lock(&op_arm_mutex); |
62 | if (!op_arm_enabled) { | 212 | if (!op_arm_enabled) { |
63 | ret = op_arm_model->start(); | 213 | ret = 0; |
64 | op_arm_enabled = !ret; | 214 | op_perf_start(); |
215 | op_arm_enabled = 1; | ||
65 | } | 216 | } |
66 | mutex_unlock(&op_arm_mutex); | 217 | mutex_unlock(&op_arm_mutex); |
67 | return ret; | 218 | return ret; |
@@ -71,113 +222,205 @@ static void op_arm_stop(void) | |||
71 | { | 222 | { |
72 | mutex_lock(&op_arm_mutex); | 223 | mutex_lock(&op_arm_mutex); |
73 | if (op_arm_enabled) | 224 | if (op_arm_enabled) |
74 | op_arm_model->stop(); | 225 | op_perf_stop(); |
75 | op_arm_enabled = 0; | 226 | op_arm_enabled = 0; |
76 | mutex_unlock(&op_arm_mutex); | 227 | mutex_unlock(&op_arm_mutex); |
77 | } | 228 | } |
78 | 229 | ||
79 | #ifdef CONFIG_PM | 230 | #ifdef CONFIG_PM |
80 | static int op_arm_suspend(struct sys_device *dev, pm_message_t state) | 231 | static int op_arm_suspend(struct platform_device *dev, pm_message_t state) |
81 | { | 232 | { |
82 | mutex_lock(&op_arm_mutex); | 233 | mutex_lock(&op_arm_mutex); |
83 | if (op_arm_enabled) | 234 | if (op_arm_enabled) |
84 | op_arm_model->stop(); | 235 | op_perf_stop(); |
85 | mutex_unlock(&op_arm_mutex); | 236 | mutex_unlock(&op_arm_mutex); |
86 | return 0; | 237 | return 0; |
87 | } | 238 | } |
88 | 239 | ||
89 | static int op_arm_resume(struct sys_device *dev) | 240 | static int op_arm_resume(struct platform_device *dev) |
90 | { | 241 | { |
91 | mutex_lock(&op_arm_mutex); | 242 | mutex_lock(&op_arm_mutex); |
92 | if (op_arm_enabled && op_arm_model->start()) | 243 | if (op_arm_enabled && op_perf_start()) |
93 | op_arm_enabled = 0; | 244 | op_arm_enabled = 0; |
94 | mutex_unlock(&op_arm_mutex); | 245 | mutex_unlock(&op_arm_mutex); |
95 | return 0; | 246 | return 0; |
96 | } | 247 | } |
97 | 248 | ||
98 | static struct sysdev_class oprofile_sysclass = { | 249 | static struct platform_driver oprofile_driver = { |
99 | .name = "oprofile", | 250 | .driver = { |
251 | .name = "arm-oprofile", | ||
252 | }, | ||
100 | .resume = op_arm_resume, | 253 | .resume = op_arm_resume, |
101 | .suspend = op_arm_suspend, | 254 | .suspend = op_arm_suspend, |
102 | }; | 255 | }; |
103 | 256 | ||
104 | static struct sys_device device_oprofile = { | 257 | static struct platform_device *oprofile_pdev; |
105 | .id = 0, | ||
106 | .cls = &oprofile_sysclass, | ||
107 | }; | ||
108 | 258 | ||
109 | static int __init init_driverfs(void) | 259 | static int __init init_driverfs(void) |
110 | { | 260 | { |
111 | int ret; | 261 | int ret; |
112 | 262 | ||
113 | if (!(ret = sysdev_class_register(&oprofile_sysclass))) | 263 | ret = platform_driver_register(&oprofile_driver); |
114 | ret = sysdev_register(&device_oprofile); | 264 | if (ret) |
265 | goto out; | ||
115 | 266 | ||
267 | oprofile_pdev = platform_device_register_simple( | ||
268 | oprofile_driver.driver.name, 0, NULL, 0); | ||
269 | if (IS_ERR(oprofile_pdev)) { | ||
270 | ret = PTR_ERR(oprofile_pdev); | ||
271 | platform_driver_unregister(&oprofile_driver); | ||
272 | } | ||
273 | |||
274 | out: | ||
116 | return ret; | 275 | return ret; |
117 | } | 276 | } |
118 | 277 | ||
119 | static void exit_driverfs(void) | 278 | static void exit_driverfs(void) |
120 | { | 279 | { |
121 | sysdev_unregister(&device_oprofile); | 280 | platform_device_unregister(oprofile_pdev); |
122 | sysdev_class_unregister(&oprofile_sysclass); | 281 | platform_driver_unregister(&oprofile_driver); |
123 | } | 282 | } |
124 | #else | 283 | #else |
125 | #define init_driverfs() do { } while (0) | 284 | static int __init init_driverfs(void) { return 0; } |
126 | #define exit_driverfs() do { } while (0) | 285 | #define exit_driverfs() do { } while (0) |
127 | #endif /* CONFIG_PM */ | 286 | #endif /* CONFIG_PM */ |
128 | 287 | ||
129 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 288 | static int report_trace(struct stackframe *frame, void *d) |
130 | { | 289 | { |
131 | struct op_arm_model_spec *spec = NULL; | 290 | unsigned int *depth = d; |
132 | int ret = -ENODEV; | ||
133 | 291 | ||
134 | ops->backtrace = arm_backtrace; | 292 | if (*depth) { |
293 | oprofile_add_trace(frame->pc); | ||
294 | (*depth)--; | ||
295 | } | ||
135 | 296 | ||
136 | #ifdef CONFIG_CPU_XSCALE | 297 | return *depth == 0; |
137 | spec = &op_xscale_spec; | 298 | } |
138 | #endif | ||
139 | 299 | ||
140 | #ifdef CONFIG_OPROFILE_ARMV6 | 300 | /* |
141 | spec = &op_armv6_spec; | 301 | * The registers we're interested in are at the end of the variable |
142 | #endif | 302 | * length saved register structure. The fp points at the end of this |
303 | * structure so the address of this struct is: | ||
304 | * (struct frame_tail *)(xxx->fp)-1 | ||
305 | */ | ||
306 | struct frame_tail { | ||
307 | struct frame_tail *fp; | ||
308 | unsigned long sp; | ||
309 | unsigned long lr; | ||
310 | } __attribute__((packed)); | ||
143 | 311 | ||
144 | #ifdef CONFIG_OPROFILE_MPCORE | 312 | static struct frame_tail* user_backtrace(struct frame_tail *tail) |
145 | spec = &op_mpcore_spec; | 313 | { |
146 | #endif | 314 | struct frame_tail buftail[2]; |
147 | 315 | ||
148 | #ifdef CONFIG_OPROFILE_ARMV7 | 316 | /* Also check accessibility of one struct frame_tail beyond */ |
149 | spec = &op_armv7_spec; | 317 | if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) |
150 | #endif | 318 | return NULL; |
319 | if (__copy_from_user_inatomic(buftail, tail, sizeof(buftail))) | ||
320 | return NULL; | ||
151 | 321 | ||
152 | if (spec) { | 322 | oprofile_add_trace(buftail[0].lr); |
153 | ret = spec->init(); | ||
154 | if (ret < 0) | ||
155 | return ret; | ||
156 | 323 | ||
157 | counter_config = kcalloc(spec->num_counters, sizeof(struct op_counter_config), | 324 | /* frame pointers should strictly progress back up the stack |
158 | GFP_KERNEL); | 325 | * (towards higher addresses) */ |
159 | if (!counter_config) | 326 | if (tail >= buftail[0].fp) |
160 | return -ENOMEM; | 327 | return NULL; |
161 | 328 | ||
162 | op_arm_model = spec; | 329 | return buftail[0].fp-1; |
163 | init_driverfs(); | 330 | } |
164 | ops->create_files = op_arm_create_files; | 331 | |
165 | ops->setup = op_arm_setup; | 332 | static void arm_backtrace(struct pt_regs * const regs, unsigned int depth) |
166 | ops->shutdown = op_arm_stop; | 333 | { |
167 | ops->start = op_arm_start; | 334 | struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1; |
168 | ops->stop = op_arm_stop; | 335 | |
169 | ops->cpu_type = op_arm_model->name; | 336 | if (!user_mode(regs)) { |
170 | printk(KERN_INFO "oprofile: using %s\n", spec->name); | 337 | struct stackframe frame; |
338 | frame.fp = regs->ARM_fp; | ||
339 | frame.sp = regs->ARM_sp; | ||
340 | frame.lr = regs->ARM_lr; | ||
341 | frame.pc = regs->ARM_pc; | ||
342 | walk_stackframe(&frame, report_trace, &depth); | ||
343 | return; | ||
171 | } | 344 | } |
172 | 345 | ||
346 | while (depth-- && tail && !((unsigned long) tail & 3)) | ||
347 | tail = user_backtrace(tail); | ||
348 | } | ||
349 | |||
350 | int __init oprofile_arch_init(struct oprofile_operations *ops) | ||
351 | { | ||
352 | int cpu, ret = 0; | ||
353 | |||
354 | perf_num_counters = armpmu_get_max_events(); | ||
355 | |||
356 | counter_config = kcalloc(perf_num_counters, | ||
357 | sizeof(struct op_counter_config), GFP_KERNEL); | ||
358 | |||
359 | if (!counter_config) { | ||
360 | pr_info("oprofile: failed to allocate %d " | ||
361 | "counters\n", perf_num_counters); | ||
362 | return -ENOMEM; | ||
363 | } | ||
364 | |||
365 | ret = init_driverfs(); | ||
366 | if (ret) { | ||
367 | kfree(counter_config); | ||
368 | return ret; | ||
369 | } | ||
370 | |||
371 | for_each_possible_cpu(cpu) { | ||
372 | perf_events[cpu] = kcalloc(perf_num_counters, | ||
373 | sizeof(struct perf_event *), GFP_KERNEL); | ||
374 | if (!perf_events[cpu]) { | ||
375 | pr_info("oprofile: failed to allocate %d perf events " | ||
376 | "for cpu %d\n", perf_num_counters, cpu); | ||
377 | while (--cpu >= 0) | ||
378 | kfree(perf_events[cpu]); | ||
379 | return -ENOMEM; | ||
380 | } | ||
381 | } | ||
382 | |||
383 | ops->backtrace = arm_backtrace; | ||
384 | ops->create_files = op_arm_create_files; | ||
385 | ops->setup = op_arm_setup; | ||
386 | ops->start = op_arm_start; | ||
387 | ops->stop = op_arm_stop; | ||
388 | ops->shutdown = op_arm_stop; | ||
389 | ops->cpu_type = op_name_from_perf_id(armpmu_get_pmu_id()); | ||
390 | |||
391 | if (!ops->cpu_type) | ||
392 | ret = -ENODEV; | ||
393 | else | ||
394 | pr_info("oprofile: using %s\n", ops->cpu_type); | ||
395 | |||
173 | return ret; | 396 | return ret; |
174 | } | 397 | } |
175 | 398 | ||
176 | void oprofile_arch_exit(void) | 399 | void oprofile_arch_exit(void) |
177 | { | 400 | { |
178 | if (op_arm_model) { | 401 | int cpu, id; |
402 | struct perf_event *event; | ||
403 | |||
404 | if (*perf_events) { | ||
179 | exit_driverfs(); | 405 | exit_driverfs(); |
180 | op_arm_model = NULL; | 406 | for_each_possible_cpu(cpu) { |
407 | for (id = 0; id < perf_num_counters; ++id) { | ||
408 | event = perf_events[cpu][id]; | ||
409 | if (event != NULL) | ||
410 | perf_event_release_kernel(event); | ||
411 | } | ||
412 | kfree(perf_events[cpu]); | ||
413 | } | ||
181 | } | 414 | } |
182 | kfree(counter_config); | 415 | |
416 | if (counter_config) | ||
417 | kfree(counter_config); | ||
418 | } | ||
419 | #else | ||
420 | int __init oprofile_arch_init(struct oprofile_operations *ops) | ||
421 | { | ||
422 | pr_info("oprofile: hardware counters not available\n"); | ||
423 | return -ENODEV; | ||
183 | } | 424 | } |
425 | void oprofile_arch_exit(void) {} | ||
426 | #endif /* CONFIG_HW_PERF_EVENTS */ | ||
diff --git a/arch/arm/oprofile/op_arm_model.h b/arch/arm/oprofile/op_arm_model.h deleted file mode 100644 index 8c4e4f6a1de3..000000000000 --- a/arch/arm/oprofile/op_arm_model.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /** | ||
2 | * @file op_arm_model.h | ||
3 | * interface to ARM machine specific operations | ||
4 | * | ||
5 | * @remark Copyright 2004 Oprofile Authors | ||
6 | * @remark Read the file COPYING | ||
7 | * | ||
8 | * @author Zwane Mwaikambo | ||
9 | */ | ||
10 | |||
11 | #ifndef OP_ARM_MODEL_H | ||
12 | #define OP_ARM_MODEL_H | ||
13 | |||
14 | struct op_arm_model_spec { | ||
15 | int (*init)(void); | ||
16 | unsigned int num_counters; | ||
17 | int (*setup_ctrs)(void); | ||
18 | int (*start)(void); | ||
19 | void (*stop)(void); | ||
20 | char *name; | ||
21 | }; | ||
22 | |||
23 | #ifdef CONFIG_CPU_XSCALE | ||
24 | extern struct op_arm_model_spec op_xscale_spec; | ||
25 | #endif | ||
26 | |||
27 | extern struct op_arm_model_spec op_armv6_spec; | ||
28 | extern struct op_arm_model_spec op_mpcore_spec; | ||
29 | extern struct op_arm_model_spec op_armv7_spec; | ||
30 | |||
31 | extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth); | ||
32 | |||
33 | extern int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec); | ||
34 | extern void op_arm_exit(void); | ||
35 | #endif /* OP_ARM_MODEL_H */ | ||
diff --git a/arch/arm/oprofile/op_counter.h b/arch/arm/oprofile/op_counter.h deleted file mode 100644 index ca942a63b52f..000000000000 --- a/arch/arm/oprofile/op_counter.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /** | ||
2 | * @file op_counter.h | ||
3 | * | ||
4 | * @remark Copyright 2004 Oprofile Authors | ||
5 | * @remark Read the file COPYING | ||
6 | * | ||
7 | * @author Zwane Mwaikambo | ||
8 | */ | ||
9 | |||
10 | #ifndef OP_COUNTER_H | ||
11 | #define OP_COUNTER_H | ||
12 | |||
13 | /* Per performance monitor configuration as set via | ||
14 | * oprofilefs. | ||
15 | */ | ||
16 | struct op_counter_config { | ||
17 | unsigned long count; | ||
18 | unsigned long enabled; | ||
19 | unsigned long event; | ||
20 | unsigned long unit_mask; | ||
21 | unsigned long kernel; | ||
22 | unsigned long user; | ||
23 | }; | ||
24 | |||
25 | extern struct op_counter_config *counter_config; | ||
26 | |||
27 | #endif /* OP_COUNTER_H */ | ||
diff --git a/arch/arm/oprofile/op_model_arm11_core.c b/arch/arm/oprofile/op_model_arm11_core.c deleted file mode 100644 index ef3e2653b90c..000000000000 --- a/arch/arm/oprofile/op_model_arm11_core.c +++ /dev/null | |||
@@ -1,162 +0,0 @@ | |||
1 | /** | ||
2 | * @file op_model_arm11_core.c | ||
3 | * ARM11 Event Monitor Driver | ||
4 | * @remark Copyright 2004 ARM SMP Development Team | ||
5 | */ | ||
6 | #include <linux/types.h> | ||
7 | #include <linux/errno.h> | ||
8 | #include <linux/oprofile.h> | ||
9 | #include <linux/interrupt.h> | ||
10 | #include <linux/irq.h> | ||
11 | #include <linux/smp.h> | ||
12 | |||
13 | #include "op_counter.h" | ||
14 | #include "op_arm_model.h" | ||
15 | #include "op_model_arm11_core.h" | ||
16 | |||
17 | /* | ||
18 | * ARM11 PMU support | ||
19 | */ | ||
20 | static inline void arm11_write_pmnc(u32 val) | ||
21 | { | ||
22 | /* upper 4bits and 7, 11 are write-as-0 */ | ||
23 | val &= 0x0ffff77f; | ||
24 | asm volatile("mcr p15, 0, %0, c15, c12, 0" : : "r" (val)); | ||
25 | } | ||
26 | |||
27 | static inline u32 arm11_read_pmnc(void) | ||
28 | { | ||
29 | u32 val; | ||
30 | asm volatile("mrc p15, 0, %0, c15, c12, 0" : "=r" (val)); | ||
31 | return val; | ||
32 | } | ||
33 | |||
34 | static void arm11_reset_counter(unsigned int cnt) | ||
35 | { | ||
36 | u32 val = -(u32)counter_config[CPU_COUNTER(smp_processor_id(), cnt)].count; | ||
37 | switch (cnt) { | ||
38 | case CCNT: | ||
39 | asm volatile("mcr p15, 0, %0, c15, c12, 1" : : "r" (val)); | ||
40 | break; | ||
41 | |||
42 | case PMN0: | ||
43 | asm volatile("mcr p15, 0, %0, c15, c12, 2" : : "r" (val)); | ||
44 | break; | ||
45 | |||
46 | case PMN1: | ||
47 | asm volatile("mcr p15, 0, %0, c15, c12, 3" : : "r" (val)); | ||
48 | break; | ||
49 | } | ||
50 | } | ||
51 | |||
52 | int arm11_setup_pmu(void) | ||
53 | { | ||
54 | unsigned int cnt; | ||
55 | u32 pmnc; | ||
56 | |||
57 | if (arm11_read_pmnc() & PMCR_E) { | ||
58 | printk(KERN_ERR "oprofile: CPU%u PMU still enabled when setup new event counter.\n", smp_processor_id()); | ||
59 | return -EBUSY; | ||
60 | } | ||
61 | |||
62 | /* initialize PMNC, reset overflow, D bit, C bit and P bit. */ | ||
63 | arm11_write_pmnc(PMCR_OFL_PMN0 | PMCR_OFL_PMN1 | PMCR_OFL_CCNT | | ||
64 | PMCR_C | PMCR_P); | ||
65 | |||
66 | for (pmnc = 0, cnt = PMN0; cnt <= CCNT; cnt++) { | ||
67 | unsigned long event; | ||
68 | |||
69 | if (!counter_config[CPU_COUNTER(smp_processor_id(), cnt)].enabled) | ||
70 | continue; | ||
71 | |||
72 | event = counter_config[CPU_COUNTER(smp_processor_id(), cnt)].event & 255; | ||
73 | |||
74 | /* | ||
75 | * Set event (if destined for PMNx counters) | ||
76 | */ | ||
77 | if (cnt == PMN0) { | ||
78 | pmnc |= event << 20; | ||
79 | } else if (cnt == PMN1) { | ||
80 | pmnc |= event << 12; | ||
81 | } | ||
82 | |||
83 | /* | ||
84 | * We don't need to set the event if it's a cycle count | ||
85 | * Enable interrupt for this counter | ||
86 | */ | ||
87 | pmnc |= PMCR_IEN_PMN0 << cnt; | ||
88 | arm11_reset_counter(cnt); | ||
89 | } | ||
90 | arm11_write_pmnc(pmnc); | ||
91 | |||
92 | return 0; | ||
93 | } | ||
94 | |||
95 | int arm11_start_pmu(void) | ||
96 | { | ||
97 | arm11_write_pmnc(arm11_read_pmnc() | PMCR_E); | ||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | int arm11_stop_pmu(void) | ||
102 | { | ||
103 | unsigned int cnt; | ||
104 | |||
105 | arm11_write_pmnc(arm11_read_pmnc() & ~PMCR_E); | ||
106 | |||
107 | for (cnt = PMN0; cnt <= CCNT; cnt++) | ||
108 | arm11_reset_counter(cnt); | ||
109 | |||
110 | return 0; | ||
111 | } | ||
112 | |||
113 | /* | ||
114 | * CPU counters' IRQ handler (one IRQ per CPU) | ||
115 | */ | ||
116 | static irqreturn_t arm11_pmu_interrupt(int irq, void *arg) | ||
117 | { | ||
118 | struct pt_regs *regs = get_irq_regs(); | ||
119 | unsigned int cnt; | ||
120 | u32 pmnc; | ||
121 | |||
122 | pmnc = arm11_read_pmnc(); | ||
123 | |||
124 | for (cnt = PMN0; cnt <= CCNT; cnt++) { | ||
125 | if ((pmnc & (PMCR_OFL_PMN0 << cnt)) && (pmnc & (PMCR_IEN_PMN0 << cnt))) { | ||
126 | arm11_reset_counter(cnt); | ||
127 | oprofile_add_sample(regs, CPU_COUNTER(smp_processor_id(), cnt)); | ||
128 | } | ||
129 | } | ||
130 | /* Clear counter flag(s) */ | ||
131 | arm11_write_pmnc(pmnc); | ||
132 | return IRQ_HANDLED; | ||
133 | } | ||
134 | |||
135 | int arm11_request_interrupts(const int *irqs, int nr) | ||
136 | { | ||
137 | unsigned int i; | ||
138 | int ret = 0; | ||
139 | |||
140 | for(i = 0; i < nr; i++) { | ||
141 | ret = request_irq(irqs[i], arm11_pmu_interrupt, IRQF_DISABLED, "CP15 PMU", NULL); | ||
142 | if (ret != 0) { | ||
143 | printk(KERN_ERR "oprofile: unable to request IRQ%u for MPCORE-EM\n", | ||
144 | irqs[i]); | ||
145 | break; | ||
146 | } | ||
147 | } | ||
148 | |||
149 | if (i != nr) | ||
150 | while (i-- != 0) | ||
151 | free_irq(irqs[i], NULL); | ||
152 | |||
153 | return ret; | ||
154 | } | ||
155 | |||
156 | void arm11_release_interrupts(const int *irqs, int nr) | ||
157 | { | ||
158 | unsigned int i; | ||
159 | |||
160 | for (i = 0; i < nr; i++) | ||
161 | free_irq(irqs[i], NULL); | ||
162 | } | ||
diff --git a/arch/arm/oprofile/op_model_arm11_core.h b/arch/arm/oprofile/op_model_arm11_core.h deleted file mode 100644 index 1902b99d9dfd..000000000000 --- a/arch/arm/oprofile/op_model_arm11_core.h +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | /** | ||
2 | * @file op_model_arm11_core.h | ||
3 | * ARM11 Event Monitor Driver | ||
4 | * @remark Copyright 2004 ARM SMP Development Team | ||
5 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
6 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
7 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
8 | * @remark Copyright 2004 Intel Corporation | ||
9 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
10 | * @remark Copyright 2004 Oprofile Authors | ||
11 | * | ||
12 | * @remark Read the file COPYING | ||
13 | * | ||
14 | * @author Zwane Mwaikambo | ||
15 | */ | ||
16 | #ifndef OP_MODEL_ARM11_CORE_H | ||
17 | #define OP_MODEL_ARM11_CORE_H | ||
18 | |||
19 | /* | ||
20 | * Per-CPU PMCR | ||
21 | */ | ||
22 | #define PMCR_E (1 << 0) /* Enable */ | ||
23 | #define PMCR_P (1 << 1) /* Count reset */ | ||
24 | #define PMCR_C (1 << 2) /* Cycle counter reset */ | ||
25 | #define PMCR_D (1 << 3) /* Cycle counter counts every 64th cpu cycle */ | ||
26 | #define PMCR_IEN_PMN0 (1 << 4) /* Interrupt enable count reg 0 */ | ||
27 | #define PMCR_IEN_PMN1 (1 << 5) /* Interrupt enable count reg 1 */ | ||
28 | #define PMCR_IEN_CCNT (1 << 6) /* Interrupt enable cycle counter */ | ||
29 | #define PMCR_OFL_PMN0 (1 << 8) /* Count reg 0 overflow */ | ||
30 | #define PMCR_OFL_PMN1 (1 << 9) /* Count reg 1 overflow */ | ||
31 | #define PMCR_OFL_CCNT (1 << 10) /* Cycle counter overflow */ | ||
32 | |||
33 | #define PMN0 0 | ||
34 | #define PMN1 1 | ||
35 | #define CCNT 2 | ||
36 | |||
37 | #define CPU_COUNTER(cpu, counter) ((cpu) * 3 + (counter)) | ||
38 | |||
39 | int arm11_setup_pmu(void); | ||
40 | int arm11_start_pmu(void); | ||
41 | int arm11_stop_pmu(void); | ||
42 | int arm11_request_interrupts(const int *, int); | ||
43 | void arm11_release_interrupts(const int *, int); | ||
44 | |||
45 | #endif | ||
diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c deleted file mode 100644 index f73ce875a395..000000000000 --- a/arch/arm/oprofile/op_model_mpcore.c +++ /dev/null | |||
@@ -1,306 +0,0 @@ | |||
1 | /** | ||
2 | * @file op_model_mpcore.c | ||
3 | * MPCORE Event Monitor Driver | ||
4 | * @remark Copyright 2004 ARM SMP Development Team | ||
5 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
6 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
7 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
8 | * @remark Copyright 2004 Intel Corporation | ||
9 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
10 | * @remark Copyright 2004 Oprofile Authors | ||
11 | * | ||
12 | * @remark Read the file COPYING | ||
13 | * | ||
14 | * @author Zwane Mwaikambo | ||
15 | * | ||
16 | * Counters: | ||
17 | * 0: PMN0 on CPU0, per-cpu configurable event counter | ||
18 | * 1: PMN1 on CPU0, per-cpu configurable event counter | ||
19 | * 2: CCNT on CPU0 | ||
20 | * 3: PMN0 on CPU1 | ||
21 | * 4: PMN1 on CPU1 | ||
22 | * 5: CCNT on CPU1 | ||
23 | * 6: PMN0 on CPU1 | ||
24 | * 7: PMN1 on CPU1 | ||
25 | * 8: CCNT on CPU1 | ||
26 | * 9: PMN0 on CPU1 | ||
27 | * 10: PMN1 on CPU1 | ||
28 | * 11: CCNT on CPU1 | ||
29 | * 12-19: configurable SCU event counters | ||
30 | */ | ||
31 | |||
32 | /* #define DEBUG */ | ||
33 | #include <linux/types.h> | ||
34 | #include <linux/errno.h> | ||
35 | #include <linux/err.h> | ||
36 | #include <linux/sched.h> | ||
37 | #include <linux/oprofile.h> | ||
38 | #include <linux/interrupt.h> | ||
39 | #include <linux/smp.h> | ||
40 | #include <linux/io.h> | ||
41 | |||
42 | #include <asm/irq.h> | ||
43 | #include <asm/mach/irq.h> | ||
44 | #include <mach/hardware.h> | ||
45 | #include <mach/board-eb.h> | ||
46 | #include <asm/system.h> | ||
47 | #include <asm/pmu.h> | ||
48 | |||
49 | #include "op_counter.h" | ||
50 | #include "op_arm_model.h" | ||
51 | #include "op_model_arm11_core.h" | ||
52 | #include "op_model_mpcore.h" | ||
53 | |||
54 | /* | ||
55 | * MPCore SCU event monitor support | ||
56 | */ | ||
57 | #define SCU_EVENTMONITORS_VA_BASE __io_address(REALVIEW_EB11MP_SCU_BASE + 0x10) | ||
58 | |||
59 | /* | ||
60 | * Bitmask of used SCU counters | ||
61 | */ | ||
62 | static unsigned int scu_em_used; | ||
63 | static const struct pmu_irqs *pmu_irqs; | ||
64 | |||
65 | /* | ||
66 | * 2 helper fns take a counter number from 0-7 (not the userspace-visible counter number) | ||
67 | */ | ||
68 | static inline void scu_reset_counter(struct eventmonitor __iomem *emc, unsigned int n) | ||
69 | { | ||
70 | writel(-(u32)counter_config[SCU_COUNTER(n)].count, &emc->MC[n]); | ||
71 | } | ||
72 | |||
73 | static inline void scu_set_event(struct eventmonitor __iomem *emc, unsigned int n, u32 event) | ||
74 | { | ||
75 | event &= 0xff; | ||
76 | writeb(event, &emc->MCEB[n]); | ||
77 | } | ||
78 | |||
79 | /* | ||
80 | * SCU counters' IRQ handler (one IRQ per counter => 2 IRQs per CPU) | ||
81 | */ | ||
82 | static irqreturn_t scu_em_interrupt(int irq, void *arg) | ||
83 | { | ||
84 | struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE; | ||
85 | unsigned int cnt; | ||
86 | |||
87 | cnt = irq - IRQ_EB11MP_PMU_SCU0; | ||
88 | oprofile_add_sample(get_irq_regs(), SCU_COUNTER(cnt)); | ||
89 | scu_reset_counter(emc, cnt); | ||
90 | |||
91 | /* Clear overflow flag for this counter */ | ||
92 | writel(1 << (cnt + 16), &emc->PMCR); | ||
93 | |||
94 | return IRQ_HANDLED; | ||
95 | } | ||
96 | |||
97 | /* Configure just the SCU counters that the user has requested */ | ||
98 | static void scu_setup(void) | ||
99 | { | ||
100 | struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE; | ||
101 | unsigned int i; | ||
102 | |||
103 | scu_em_used = 0; | ||
104 | |||
105 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
106 | if (counter_config[SCU_COUNTER(i)].enabled && | ||
107 | counter_config[SCU_COUNTER(i)].event) { | ||
108 | scu_set_event(emc, i, 0); /* disable counter for now */ | ||
109 | scu_em_used |= 1 << i; | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | |||
114 | static int scu_start(void) | ||
115 | { | ||
116 | struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE; | ||
117 | unsigned int temp, i; | ||
118 | unsigned long event; | ||
119 | int ret = 0; | ||
120 | |||
121 | /* | ||
122 | * request the SCU counter interrupts that we need | ||
123 | */ | ||
124 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
125 | if (scu_em_used & (1 << i)) { | ||
126 | ret = request_irq(IRQ_EB11MP_PMU_SCU0 + i, scu_em_interrupt, IRQF_DISABLED, "SCU PMU", NULL); | ||
127 | if (ret) { | ||
128 | printk(KERN_ERR "oprofile: unable to request IRQ%u for SCU Event Monitor\n", | ||
129 | IRQ_EB11MP_PMU_SCU0 + i); | ||
130 | goto err_free_scu; | ||
131 | } | ||
132 | } | ||
133 | } | ||
134 | |||
135 | /* | ||
136 | * clear overflow and enable interrupt for all used counters | ||
137 | */ | ||
138 | temp = readl(&emc->PMCR); | ||
139 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
140 | if (scu_em_used & (1 << i)) { | ||
141 | scu_reset_counter(emc, i); | ||
142 | event = counter_config[SCU_COUNTER(i)].event; | ||
143 | scu_set_event(emc, i, event); | ||
144 | |||
145 | /* clear overflow/interrupt */ | ||
146 | temp |= 1 << (i + 16); | ||
147 | /* enable interrupt*/ | ||
148 | temp |= 1 << (i + 8); | ||
149 | } | ||
150 | } | ||
151 | |||
152 | /* Enable all 8 counters */ | ||
153 | temp |= PMCR_E; | ||
154 | writel(temp, &emc->PMCR); | ||
155 | |||
156 | return 0; | ||
157 | |||
158 | err_free_scu: | ||
159 | while (i--) | ||
160 | free_irq(IRQ_EB11MP_PMU_SCU0 + i, NULL); | ||
161 | return ret; | ||
162 | } | ||
163 | |||
164 | static void scu_stop(void) | ||
165 | { | ||
166 | struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE; | ||
167 | unsigned int temp, i; | ||
168 | |||
169 | /* Disable counter interrupts */ | ||
170 | /* Don't disable all 8 counters (with the E bit) as they may be in use */ | ||
171 | temp = readl(&emc->PMCR); | ||
172 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
173 | if (scu_em_used & (1 << i)) | ||
174 | temp &= ~(1 << (i + 8)); | ||
175 | } | ||
176 | writel(temp, &emc->PMCR); | ||
177 | |||
178 | /* Free counter interrupts and reset counters */ | ||
179 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
180 | if (scu_em_used & (1 << i)) { | ||
181 | scu_reset_counter(emc, i); | ||
182 | free_irq(IRQ_EB11MP_PMU_SCU0 + i, NULL); | ||
183 | } | ||
184 | } | ||
185 | } | ||
186 | |||
187 | struct em_function_data { | ||
188 | int (*fn)(void); | ||
189 | int ret; | ||
190 | }; | ||
191 | |||
192 | static void em_func(void *data) | ||
193 | { | ||
194 | struct em_function_data *d = data; | ||
195 | int ret = d->fn(); | ||
196 | if (ret) | ||
197 | d->ret = ret; | ||
198 | } | ||
199 | |||
200 | static int em_call_function(int (*fn)(void)) | ||
201 | { | ||
202 | struct em_function_data data; | ||
203 | |||
204 | data.fn = fn; | ||
205 | data.ret = 0; | ||
206 | |||
207 | preempt_disable(); | ||
208 | smp_call_function(em_func, &data, 1); | ||
209 | em_func(&data); | ||
210 | preempt_enable(); | ||
211 | |||
212 | return data.ret; | ||
213 | } | ||
214 | |||
215 | /* | ||
216 | * Glue to stick the individual ARM11 PMUs and the SCU | ||
217 | * into the oprofile framework. | ||
218 | */ | ||
219 | static int em_setup_ctrs(void) | ||
220 | { | ||
221 | int ret; | ||
222 | |||
223 | /* Configure CPU counters by cross-calling to the other CPUs */ | ||
224 | ret = em_call_function(arm11_setup_pmu); | ||
225 | if (ret == 0) | ||
226 | scu_setup(); | ||
227 | |||
228 | return 0; | ||
229 | } | ||
230 | |||
231 | static int em_start(void) | ||
232 | { | ||
233 | int ret; | ||
234 | |||
235 | pmu_irqs = reserve_pmu(); | ||
236 | if (IS_ERR(pmu_irqs)) { | ||
237 | ret = PTR_ERR(pmu_irqs); | ||
238 | goto out; | ||
239 | } | ||
240 | |||
241 | ret = arm11_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
242 | if (ret == 0) { | ||
243 | em_call_function(arm11_start_pmu); | ||
244 | |||
245 | ret = scu_start(); | ||
246 | if (ret) { | ||
247 | arm11_release_interrupts(pmu_irqs->irqs, | ||
248 | pmu_irqs->num_irqs); | ||
249 | } else { | ||
250 | release_pmu(pmu_irqs); | ||
251 | pmu_irqs = NULL; | ||
252 | } | ||
253 | } | ||
254 | |||
255 | out: | ||
256 | return ret; | ||
257 | } | ||
258 | |||
259 | static void em_stop(void) | ||
260 | { | ||
261 | em_call_function(arm11_stop_pmu); | ||
262 | arm11_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
263 | scu_stop(); | ||
264 | release_pmu(pmu_irqs); | ||
265 | } | ||
266 | |||
267 | /* | ||
268 | * Why isn't there a function to route an IRQ to a specific CPU in | ||
269 | * genirq? | ||
270 | */ | ||
271 | static void em_route_irq(int irq, unsigned int cpu) | ||
272 | { | ||
273 | struct irq_desc *desc = irq_desc + irq; | ||
274 | const struct cpumask *mask = cpumask_of(cpu); | ||
275 | |||
276 | spin_lock_irq(&desc->lock); | ||
277 | cpumask_copy(desc->affinity, mask); | ||
278 | desc->chip->set_affinity(irq, mask); | ||
279 | spin_unlock_irq(&desc->lock); | ||
280 | } | ||
281 | |||
282 | static int em_setup(void) | ||
283 | { | ||
284 | /* | ||
285 | * Send SCU PMU interrupts to the "owner" CPU. | ||
286 | */ | ||
287 | em_route_irq(IRQ_EB11MP_PMU_SCU0, 0); | ||
288 | em_route_irq(IRQ_EB11MP_PMU_SCU1, 0); | ||
289 | em_route_irq(IRQ_EB11MP_PMU_SCU2, 1); | ||
290 | em_route_irq(IRQ_EB11MP_PMU_SCU3, 1); | ||
291 | em_route_irq(IRQ_EB11MP_PMU_SCU4, 2); | ||
292 | em_route_irq(IRQ_EB11MP_PMU_SCU5, 2); | ||
293 | em_route_irq(IRQ_EB11MP_PMU_SCU6, 3); | ||
294 | em_route_irq(IRQ_EB11MP_PMU_SCU7, 3); | ||
295 | |||
296 | return init_pmu(); | ||
297 | } | ||
298 | |||
299 | struct op_arm_model_spec op_mpcore_spec = { | ||
300 | .init = em_setup, | ||
301 | .num_counters = MPCORE_NUM_COUNTERS, | ||
302 | .setup_ctrs = em_setup_ctrs, | ||
303 | .start = em_start, | ||
304 | .stop = em_stop, | ||
305 | .name = "arm/mpcore", | ||
306 | }; | ||
diff --git a/arch/arm/oprofile/op_model_mpcore.h b/arch/arm/oprofile/op_model_mpcore.h deleted file mode 100644 index 73d811023688..000000000000 --- a/arch/arm/oprofile/op_model_mpcore.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /** | ||
2 | * @file op_model_mpcore.c | ||
3 | * MPCORE Event Monitor Driver | ||
4 | * @remark Copyright 2004 ARM SMP Development Team | ||
5 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
6 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
7 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
8 | * @remark Copyright 2004 Intel Corporation | ||
9 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
10 | * @remark Copyright 2004 Oprofile Authors | ||
11 | * | ||
12 | * @remark Read the file COPYING | ||
13 | * | ||
14 | * @author Zwane Mwaikambo | ||
15 | */ | ||
16 | #ifndef OP_MODEL_MPCORE_H | ||
17 | #define OP_MODEL_MPCORE_H | ||
18 | |||
19 | struct eventmonitor { | ||
20 | unsigned long PMCR; | ||
21 | unsigned char MCEB[8]; | ||
22 | unsigned long MC[8]; | ||
23 | }; | ||
24 | |||
25 | /* | ||
26 | * List of userspace counter numbers: note that the structure is important. | ||
27 | * The code relies on CPUn's counters being CPU0's counters + 3n | ||
28 | * and on CPU0's counters starting at 0 | ||
29 | */ | ||
30 | |||
31 | #define COUNTER_CPU0_PMN0 0 | ||
32 | #define COUNTER_CPU0_PMN1 1 | ||
33 | #define COUNTER_CPU0_CCNT 2 | ||
34 | |||
35 | #define COUNTER_CPU1_PMN0 3 | ||
36 | #define COUNTER_CPU1_PMN1 4 | ||
37 | #define COUNTER_CPU1_CCNT 5 | ||
38 | |||
39 | #define COUNTER_CPU2_PMN0 6 | ||
40 | #define COUNTER_CPU2_PMN1 7 | ||
41 | #define COUNTER_CPU2_CCNT 8 | ||
42 | |||
43 | #define COUNTER_CPU3_PMN0 9 | ||
44 | #define COUNTER_CPU3_PMN1 10 | ||
45 | #define COUNTER_CPU3_CCNT 11 | ||
46 | |||
47 | #define COUNTER_SCU_MN0 12 | ||
48 | #define COUNTER_SCU_MN1 13 | ||
49 | #define COUNTER_SCU_MN2 14 | ||
50 | #define COUNTER_SCU_MN3 15 | ||
51 | #define COUNTER_SCU_MN4 16 | ||
52 | #define COUNTER_SCU_MN5 17 | ||
53 | #define COUNTER_SCU_MN6 18 | ||
54 | #define COUNTER_SCU_MN7 19 | ||
55 | #define NUM_SCU_COUNTERS 8 | ||
56 | |||
57 | #define SCU_COUNTER(number) ((number) + COUNTER_SCU_MN0) | ||
58 | |||
59 | #define MPCORE_NUM_COUNTERS SCU_COUNTER(NUM_SCU_COUNTERS) | ||
60 | |||
61 | #endif | ||
diff --git a/arch/arm/oprofile/op_model_v6.c b/arch/arm/oprofile/op_model_v6.c deleted file mode 100644 index a22357a2fd08..000000000000 --- a/arch/arm/oprofile/op_model_v6.c +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | /** | ||
2 | * @file op_model_v6.c | ||
3 | * ARM11 Performance Monitor Driver | ||
4 | * | ||
5 | * Based on op_model_xscale.c | ||
6 | * | ||
7 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
8 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
9 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
10 | * @remark Copyright 2004 Intel Corporation | ||
11 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
12 | * @remark Copyright 2004 OProfile Authors | ||
13 | * | ||
14 | * @remark Read the file COPYING | ||
15 | * | ||
16 | * @author Tony Lindgren <tony@atomide.com> | ||
17 | */ | ||
18 | |||
19 | /* #define DEBUG */ | ||
20 | #include <linux/types.h> | ||
21 | #include <linux/errno.h> | ||
22 | #include <linux/err.h> | ||
23 | #include <linux/sched.h> | ||
24 | #include <linux/oprofile.h> | ||
25 | #include <linux/interrupt.h> | ||
26 | #include <asm/irq.h> | ||
27 | #include <asm/system.h> | ||
28 | #include <asm/pmu.h> | ||
29 | |||
30 | #include "op_counter.h" | ||
31 | #include "op_arm_model.h" | ||
32 | #include "op_model_arm11_core.h" | ||
33 | |||
34 | static const struct pmu_irqs *pmu_irqs; | ||
35 | |||
36 | static void armv6_pmu_stop(void) | ||
37 | { | ||
38 | arm11_stop_pmu(); | ||
39 | arm11_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
40 | release_pmu(pmu_irqs); | ||
41 | pmu_irqs = NULL; | ||
42 | } | ||
43 | |||
44 | static int armv6_pmu_start(void) | ||
45 | { | ||
46 | int ret; | ||
47 | |||
48 | pmu_irqs = reserve_pmu(); | ||
49 | if (IS_ERR(pmu_irqs)) { | ||
50 | ret = PTR_ERR(pmu_irqs); | ||
51 | goto out; | ||
52 | } | ||
53 | |||
54 | ret = arm11_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
55 | if (ret >= 0) { | ||
56 | ret = arm11_start_pmu(); | ||
57 | } else { | ||
58 | release_pmu(pmu_irqs); | ||
59 | pmu_irqs = NULL; | ||
60 | } | ||
61 | |||
62 | out: | ||
63 | return ret; | ||
64 | } | ||
65 | |||
66 | static int armv6_detect_pmu(void) | ||
67 | { | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | struct op_arm_model_spec op_armv6_spec = { | ||
72 | .init = armv6_detect_pmu, | ||
73 | .num_counters = 3, | ||
74 | .setup_ctrs = arm11_setup_pmu, | ||
75 | .start = armv6_pmu_start, | ||
76 | .stop = armv6_pmu_stop, | ||
77 | .name = "arm/armv6", | ||
78 | }; | ||
diff --git a/arch/arm/oprofile/op_model_v7.c b/arch/arm/oprofile/op_model_v7.c deleted file mode 100644 index 8642d0891ae1..000000000000 --- a/arch/arm/oprofile/op_model_v7.c +++ /dev/null | |||
@@ -1,415 +0,0 @@ | |||
1 | /** | ||
2 | * op_model_v7.c | ||
3 | * ARM V7 (Cortex A8) Event Monitor Driver | ||
4 | * | ||
5 | * Copyright 2008 Jean Pihet <jpihet@mvista.com> | ||
6 | * Copyright 2004 ARM SMP Development Team | ||
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/types.h> | ||
13 | #include <linux/errno.h> | ||
14 | #include <linux/err.h> | ||
15 | #include <linux/oprofile.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/irq.h> | ||
18 | #include <linux/smp.h> | ||
19 | |||
20 | #include <asm/pmu.h> | ||
21 | |||
22 | #include "op_counter.h" | ||
23 | #include "op_arm_model.h" | ||
24 | #include "op_model_v7.h" | ||
25 | |||
26 | /* #define DEBUG */ | ||
27 | |||
28 | |||
29 | /* | ||
30 | * ARM V7 PMNC support | ||
31 | */ | ||
32 | |||
33 | static u32 cnt_en[CNTMAX]; | ||
34 | |||
35 | static inline void armv7_pmnc_write(u32 val) | ||
36 | { | ||
37 | val &= PMNC_MASK; | ||
38 | asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r" (val)); | ||
39 | } | ||
40 | |||
41 | static inline u32 armv7_pmnc_read(void) | ||
42 | { | ||
43 | u32 val; | ||
44 | |||
45 | asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (val)); | ||
46 | return val; | ||
47 | } | ||
48 | |||
49 | static inline u32 armv7_pmnc_enable_counter(unsigned int cnt) | ||
50 | { | ||
51 | u32 val; | ||
52 | |||
53 | if (cnt >= CNTMAX) { | ||
54 | printk(KERN_ERR "oprofile: CPU%u enabling wrong PMNC counter" | ||
55 | " %d\n", smp_processor_id(), cnt); | ||
56 | return -1; | ||
57 | } | ||
58 | |||
59 | if (cnt == CCNT) | ||
60 | val = CNTENS_C; | ||
61 | else | ||
62 | val = (1 << (cnt - CNT0)); | ||
63 | |||
64 | val &= CNTENS_MASK; | ||
65 | asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r" (val)); | ||
66 | |||
67 | return cnt; | ||
68 | } | ||
69 | |||
70 | static inline u32 armv7_pmnc_disable_counter(unsigned int cnt) | ||
71 | { | ||
72 | u32 val; | ||
73 | |||
74 | if (cnt >= CNTMAX) { | ||
75 | printk(KERN_ERR "oprofile: CPU%u disabling wrong PMNC counter" | ||
76 | " %d\n", smp_processor_id(), cnt); | ||
77 | return -1; | ||
78 | } | ||
79 | |||
80 | if (cnt == CCNT) | ||
81 | val = CNTENC_C; | ||
82 | else | ||
83 | val = (1 << (cnt - CNT0)); | ||
84 | |||
85 | val &= CNTENC_MASK; | ||
86 | asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r" (val)); | ||
87 | |||
88 | return cnt; | ||
89 | } | ||
90 | |||
91 | static inline u32 armv7_pmnc_enable_intens(unsigned int cnt) | ||
92 | { | ||
93 | u32 val; | ||
94 | |||
95 | if (cnt >= CNTMAX) { | ||
96 | printk(KERN_ERR "oprofile: CPU%u enabling wrong PMNC counter" | ||
97 | " interrupt enable %d\n", smp_processor_id(), cnt); | ||
98 | return -1; | ||
99 | } | ||
100 | |||
101 | if (cnt == CCNT) | ||
102 | val = INTENS_C; | ||
103 | else | ||
104 | val = (1 << (cnt - CNT0)); | ||
105 | |||
106 | val &= INTENS_MASK; | ||
107 | asm volatile("mcr p15, 0, %0, c9, c14, 1" : : "r" (val)); | ||
108 | |||
109 | return cnt; | ||
110 | } | ||
111 | |||
112 | static inline u32 armv7_pmnc_getreset_flags(void) | ||
113 | { | ||
114 | u32 val; | ||
115 | |||
116 | /* Read */ | ||
117 | asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val)); | ||
118 | |||
119 | /* Write to clear flags */ | ||
120 | val &= FLAG_MASK; | ||
121 | asm volatile("mcr p15, 0, %0, c9, c12, 3" : : "r" (val)); | ||
122 | |||
123 | return val; | ||
124 | } | ||
125 | |||
126 | static inline int armv7_pmnc_select_counter(unsigned int cnt) | ||
127 | { | ||
128 | u32 val; | ||
129 | |||
130 | if ((cnt == CCNT) || (cnt >= CNTMAX)) { | ||
131 | printk(KERN_ERR "oprofile: CPU%u selecting wrong PMNC counteri" | ||
132 | " %d\n", smp_processor_id(), cnt); | ||
133 | return -1; | ||
134 | } | ||
135 | |||
136 | val = (cnt - CNT0) & SELECT_MASK; | ||
137 | asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r" (val)); | ||
138 | |||
139 | return cnt; | ||
140 | } | ||
141 | |||
142 | static inline void armv7_pmnc_write_evtsel(unsigned int cnt, u32 val) | ||
143 | { | ||
144 | if (armv7_pmnc_select_counter(cnt) == cnt) { | ||
145 | val &= EVTSEL_MASK; | ||
146 | asm volatile("mcr p15, 0, %0, c9, c13, 1" : : "r" (val)); | ||
147 | } | ||
148 | } | ||
149 | |||
150 | static void armv7_pmnc_reset_counter(unsigned int cnt) | ||
151 | { | ||
152 | u32 cpu_cnt = CPU_COUNTER(smp_processor_id(), cnt); | ||
153 | u32 val = -(u32)counter_config[cpu_cnt].count; | ||
154 | |||
155 | switch (cnt) { | ||
156 | case CCNT: | ||
157 | armv7_pmnc_disable_counter(cnt); | ||
158 | |||
159 | asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (val)); | ||
160 | |||
161 | if (cnt_en[cnt] != 0) | ||
162 | armv7_pmnc_enable_counter(cnt); | ||
163 | |||
164 | break; | ||
165 | |||
166 | case CNT0: | ||
167 | case CNT1: | ||
168 | case CNT2: | ||
169 | case CNT3: | ||
170 | armv7_pmnc_disable_counter(cnt); | ||
171 | |||
172 | if (armv7_pmnc_select_counter(cnt) == cnt) | ||
173 | asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r" (val)); | ||
174 | |||
175 | if (cnt_en[cnt] != 0) | ||
176 | armv7_pmnc_enable_counter(cnt); | ||
177 | |||
178 | break; | ||
179 | |||
180 | default: | ||
181 | printk(KERN_ERR "oprofile: CPU%u resetting wrong PMNC counter" | ||
182 | " %d\n", smp_processor_id(), cnt); | ||
183 | break; | ||
184 | } | ||
185 | } | ||
186 | |||
187 | int armv7_setup_pmnc(void) | ||
188 | { | ||
189 | unsigned int cnt; | ||
190 | |||
191 | if (armv7_pmnc_read() & PMNC_E) { | ||
192 | printk(KERN_ERR "oprofile: CPU%u PMNC still enabled when setup" | ||
193 | " new event counter.\n", smp_processor_id()); | ||
194 | return -EBUSY; | ||
195 | } | ||
196 | |||
197 | /* Initialize & Reset PMNC: C bit and P bit */ | ||
198 | armv7_pmnc_write(PMNC_P | PMNC_C); | ||
199 | |||
200 | |||
201 | for (cnt = CCNT; cnt < CNTMAX; cnt++) { | ||
202 | unsigned long event; | ||
203 | u32 cpu_cnt = CPU_COUNTER(smp_processor_id(), cnt); | ||
204 | |||
205 | /* | ||
206 | * Disable counter | ||
207 | */ | ||
208 | armv7_pmnc_disable_counter(cnt); | ||
209 | cnt_en[cnt] = 0; | ||
210 | |||
211 | if (!counter_config[cpu_cnt].enabled) | ||
212 | continue; | ||
213 | |||
214 | event = counter_config[cpu_cnt].event & 255; | ||
215 | |||
216 | /* | ||
217 | * Set event (if destined for PMNx counters) | ||
218 | * We don't need to set the event if it's a cycle count | ||
219 | */ | ||
220 | if (cnt != CCNT) | ||
221 | armv7_pmnc_write_evtsel(cnt, event); | ||
222 | |||
223 | /* | ||
224 | * Enable interrupt for this counter | ||
225 | */ | ||
226 | armv7_pmnc_enable_intens(cnt); | ||
227 | |||
228 | /* | ||
229 | * Reset counter | ||
230 | */ | ||
231 | armv7_pmnc_reset_counter(cnt); | ||
232 | |||
233 | /* | ||
234 | * Enable counter | ||
235 | */ | ||
236 | armv7_pmnc_enable_counter(cnt); | ||
237 | cnt_en[cnt] = 1; | ||
238 | } | ||
239 | |||
240 | return 0; | ||
241 | } | ||
242 | |||
243 | static inline void armv7_start_pmnc(void) | ||
244 | { | ||
245 | armv7_pmnc_write(armv7_pmnc_read() | PMNC_E); | ||
246 | } | ||
247 | |||
248 | static inline void armv7_stop_pmnc(void) | ||
249 | { | ||
250 | armv7_pmnc_write(armv7_pmnc_read() & ~PMNC_E); | ||
251 | } | ||
252 | |||
253 | /* | ||
254 | * CPU counters' IRQ handler (one IRQ per CPU) | ||
255 | */ | ||
256 | static irqreturn_t armv7_pmnc_interrupt(int irq, void *arg) | ||
257 | { | ||
258 | struct pt_regs *regs = get_irq_regs(); | ||
259 | unsigned int cnt; | ||
260 | u32 flags; | ||
261 | |||
262 | |||
263 | /* | ||
264 | * Stop IRQ generation | ||
265 | */ | ||
266 | armv7_stop_pmnc(); | ||
267 | |||
268 | /* | ||
269 | * Get and reset overflow status flags | ||
270 | */ | ||
271 | flags = armv7_pmnc_getreset_flags(); | ||
272 | |||
273 | /* | ||
274 | * Cycle counter | ||
275 | */ | ||
276 | if (flags & FLAG_C) { | ||
277 | u32 cpu_cnt = CPU_COUNTER(smp_processor_id(), CCNT); | ||
278 | armv7_pmnc_reset_counter(CCNT); | ||
279 | oprofile_add_sample(regs, cpu_cnt); | ||
280 | } | ||
281 | |||
282 | /* | ||
283 | * PMNC counters 0:3 | ||
284 | */ | ||
285 | for (cnt = CNT0; cnt < CNTMAX; cnt++) { | ||
286 | if (flags & (1 << (cnt - CNT0))) { | ||
287 | u32 cpu_cnt = CPU_COUNTER(smp_processor_id(), cnt); | ||
288 | armv7_pmnc_reset_counter(cnt); | ||
289 | oprofile_add_sample(regs, cpu_cnt); | ||
290 | } | ||
291 | } | ||
292 | |||
293 | /* | ||
294 | * Allow IRQ generation | ||
295 | */ | ||
296 | armv7_start_pmnc(); | ||
297 | |||
298 | return IRQ_HANDLED; | ||
299 | } | ||
300 | |||
301 | int armv7_request_interrupts(const int *irqs, int nr) | ||
302 | { | ||
303 | unsigned int i; | ||
304 | int ret = 0; | ||
305 | |||
306 | for (i = 0; i < nr; i++) { | ||
307 | ret = request_irq(irqs[i], armv7_pmnc_interrupt, | ||
308 | IRQF_DISABLED, "CP15 PMNC", NULL); | ||
309 | if (ret != 0) { | ||
310 | printk(KERN_ERR "oprofile: unable to request IRQ%u" | ||
311 | " for ARMv7\n", | ||
312 | irqs[i]); | ||
313 | break; | ||
314 | } | ||
315 | } | ||
316 | |||
317 | if (i != nr) | ||
318 | while (i-- != 0) | ||
319 | free_irq(irqs[i], NULL); | ||
320 | |||
321 | return ret; | ||
322 | } | ||
323 | |||
324 | void armv7_release_interrupts(const int *irqs, int nr) | ||
325 | { | ||
326 | unsigned int i; | ||
327 | |||
328 | for (i = 0; i < nr; i++) | ||
329 | free_irq(irqs[i], NULL); | ||
330 | } | ||
331 | |||
332 | #ifdef DEBUG | ||
333 | static void armv7_pmnc_dump_regs(void) | ||
334 | { | ||
335 | u32 val; | ||
336 | unsigned int cnt; | ||
337 | |||
338 | printk(KERN_INFO "PMNC registers dump:\n"); | ||
339 | |||
340 | asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (val)); | ||
341 | printk(KERN_INFO "PMNC =0x%08x\n", val); | ||
342 | |||
343 | asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r" (val)); | ||
344 | printk(KERN_INFO "CNTENS=0x%08x\n", val); | ||
345 | |||
346 | asm volatile("mrc p15, 0, %0, c9, c14, 1" : "=r" (val)); | ||
347 | printk(KERN_INFO "INTENS=0x%08x\n", val); | ||
348 | |||
349 | asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val)); | ||
350 | printk(KERN_INFO "FLAGS =0x%08x\n", val); | ||
351 | |||
352 | asm volatile("mrc p15, 0, %0, c9, c12, 5" : "=r" (val)); | ||
353 | printk(KERN_INFO "SELECT=0x%08x\n", val); | ||
354 | |||
355 | asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (val)); | ||
356 | printk(KERN_INFO "CCNT =0x%08x\n", val); | ||
357 | |||
358 | for (cnt = CNT0; cnt < CNTMAX; cnt++) { | ||
359 | armv7_pmnc_select_counter(cnt); | ||
360 | asm volatile("mrc p15, 0, %0, c9, c13, 2" : "=r" (val)); | ||
361 | printk(KERN_INFO "CNT[%d] count =0x%08x\n", cnt-CNT0, val); | ||
362 | asm volatile("mrc p15, 0, %0, c9, c13, 1" : "=r" (val)); | ||
363 | printk(KERN_INFO "CNT[%d] evtsel=0x%08x\n", cnt-CNT0, val); | ||
364 | } | ||
365 | } | ||
366 | #endif | ||
367 | |||
368 | static const struct pmu_irqs *pmu_irqs; | ||
369 | |||
370 | static void armv7_pmnc_stop(void) | ||
371 | { | ||
372 | #ifdef DEBUG | ||
373 | armv7_pmnc_dump_regs(); | ||
374 | #endif | ||
375 | armv7_stop_pmnc(); | ||
376 | armv7_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
377 | release_pmu(pmu_irqs); | ||
378 | pmu_irqs = NULL; | ||
379 | } | ||
380 | |||
381 | static int armv7_pmnc_start(void) | ||
382 | { | ||
383 | int ret; | ||
384 | |||
385 | pmu_irqs = reserve_pmu(); | ||
386 | if (IS_ERR(pmu_irqs)) | ||
387 | return PTR_ERR(pmu_irqs); | ||
388 | |||
389 | #ifdef DEBUG | ||
390 | armv7_pmnc_dump_regs(); | ||
391 | #endif | ||
392 | ret = armv7_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
393 | if (ret >= 0) { | ||
394 | armv7_start_pmnc(); | ||
395 | } else { | ||
396 | release_pmu(pmu_irqs); | ||
397 | pmu_irqs = NULL; | ||
398 | } | ||
399 | |||
400 | return ret; | ||
401 | } | ||
402 | |||
403 | static int armv7_detect_pmnc(void) | ||
404 | { | ||
405 | return 0; | ||
406 | } | ||
407 | |||
408 | struct op_arm_model_spec op_armv7_spec = { | ||
409 | .init = armv7_detect_pmnc, | ||
410 | .num_counters = 5, | ||
411 | .setup_ctrs = armv7_setup_pmnc, | ||
412 | .start = armv7_pmnc_start, | ||
413 | .stop = armv7_pmnc_stop, | ||
414 | .name = "arm/armv7", | ||
415 | }; | ||
diff --git a/arch/arm/oprofile/op_model_v7.h b/arch/arm/oprofile/op_model_v7.h deleted file mode 100644 index 9ca334b39c75..000000000000 --- a/arch/arm/oprofile/op_model_v7.h +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | /** | ||
2 | * op_model_v7.h | ||
3 | * ARM v7 (Cortex A8) Event Monitor Driver | ||
4 | * | ||
5 | * Copyright 2008 Jean Pihet <jpihet@mvista.com> | ||
6 | * Copyright 2004 ARM SMP Development Team | ||
7 | * Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
8 | * Copyright 2000-2004 MontaVista Software Inc | ||
9 | * Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
10 | * Copyright 2004 Intel Corporation | ||
11 | * Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
12 | * Copyright 2004 Oprofile Authors | ||
13 | * | ||
14 | * Read the file COPYING | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or modify | ||
17 | * it under the terms of the GNU General Public License version 2 as | ||
18 | * published by the Free Software Foundation. | ||
19 | */ | ||
20 | #ifndef OP_MODEL_V7_H | ||
21 | #define OP_MODEL_V7_H | ||
22 | |||
23 | /* | ||
24 | * Per-CPU PMNC: config reg | ||
25 | */ | ||
26 | #define PMNC_E (1 << 0) /* Enable all counters */ | ||
27 | #define PMNC_P (1 << 1) /* Reset all counters */ | ||
28 | #define PMNC_C (1 << 2) /* Cycle counter reset */ | ||
29 | #define PMNC_D (1 << 3) /* CCNT counts every 64th cpu cycle */ | ||
30 | #define PMNC_X (1 << 4) /* Export to ETM */ | ||
31 | #define PMNC_DP (1 << 5) /* Disable CCNT if non-invasive debug*/ | ||
32 | #define PMNC_MASK 0x3f /* Mask for writable bits */ | ||
33 | |||
34 | /* | ||
35 | * Available counters | ||
36 | */ | ||
37 | #define CCNT 0 | ||
38 | #define CNT0 1 | ||
39 | #define CNT1 2 | ||
40 | #define CNT2 3 | ||
41 | #define CNT3 4 | ||
42 | #define CNTMAX 5 | ||
43 | |||
44 | #define CPU_COUNTER(cpu, counter) ((cpu) * CNTMAX + (counter)) | ||
45 | |||
46 | /* | ||
47 | * CNTENS: counters enable reg | ||
48 | */ | ||
49 | #define CNTENS_P0 (1 << 0) | ||
50 | #define CNTENS_P1 (1 << 1) | ||
51 | #define CNTENS_P2 (1 << 2) | ||
52 | #define CNTENS_P3 (1 << 3) | ||
53 | #define CNTENS_C (1 << 31) | ||
54 | #define CNTENS_MASK 0x8000000f /* Mask for writable bits */ | ||
55 | |||
56 | /* | ||
57 | * CNTENC: counters disable reg | ||
58 | */ | ||
59 | #define CNTENC_P0 (1 << 0) | ||
60 | #define CNTENC_P1 (1 << 1) | ||
61 | #define CNTENC_P2 (1 << 2) | ||
62 | #define CNTENC_P3 (1 << 3) | ||
63 | #define CNTENC_C (1 << 31) | ||
64 | #define CNTENC_MASK 0x8000000f /* Mask for writable bits */ | ||
65 | |||
66 | /* | ||
67 | * INTENS: counters overflow interrupt enable reg | ||
68 | */ | ||
69 | #define INTENS_P0 (1 << 0) | ||
70 | #define INTENS_P1 (1 << 1) | ||
71 | #define INTENS_P2 (1 << 2) | ||
72 | #define INTENS_P3 (1 << 3) | ||
73 | #define INTENS_C (1 << 31) | ||
74 | #define INTENS_MASK 0x8000000f /* Mask for writable bits */ | ||
75 | |||
76 | /* | ||
77 | * EVTSEL: Event selection reg | ||
78 | */ | ||
79 | #define EVTSEL_MASK 0x7f /* Mask for writable bits */ | ||
80 | |||
81 | /* | ||
82 | * SELECT: Counter selection reg | ||
83 | */ | ||
84 | #define SELECT_MASK 0x1f /* Mask for writable bits */ | ||
85 | |||
86 | /* | ||
87 | * FLAG: counters overflow flag status reg | ||
88 | */ | ||
89 | #define FLAG_P0 (1 << 0) | ||
90 | #define FLAG_P1 (1 << 1) | ||
91 | #define FLAG_P2 (1 << 2) | ||
92 | #define FLAG_P3 (1 << 3) | ||
93 | #define FLAG_C (1 << 31) | ||
94 | #define FLAG_MASK 0x8000000f /* Mask for writable bits */ | ||
95 | |||
96 | |||
97 | int armv7_setup_pmu(void); | ||
98 | int armv7_start_pmu(void); | ||
99 | int armv7_stop_pmu(void); | ||
100 | int armv7_request_interrupts(const int *, int); | ||
101 | void armv7_release_interrupts(const int *, int); | ||
102 | |||
103 | #endif | ||
diff --git a/arch/arm/oprofile/op_model_xscale.c b/arch/arm/oprofile/op_model_xscale.c deleted file mode 100644 index 1d34a02048bd..000000000000 --- a/arch/arm/oprofile/op_model_xscale.c +++ /dev/null | |||
@@ -1,444 +0,0 @@ | |||
1 | /** | ||
2 | * @file op_model_xscale.c | ||
3 | * XScale Performance Monitor Driver | ||
4 | * | ||
5 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
6 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
7 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
8 | * @remark Copyright 2004 Intel Corporation | ||
9 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
10 | * @remark Copyright 2004 OProfile Authors | ||
11 | * | ||
12 | * @remark Read the file COPYING | ||
13 | * | ||
14 | * @author Zwane Mwaikambo | ||
15 | */ | ||
16 | |||
17 | /* #define DEBUG */ | ||
18 | #include <linux/types.h> | ||
19 | #include <linux/errno.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/sched.h> | ||
22 | #include <linux/oprofile.h> | ||
23 | #include <linux/interrupt.h> | ||
24 | #include <linux/irq.h> | ||
25 | |||
26 | #include <asm/cputype.h> | ||
27 | #include <asm/pmu.h> | ||
28 | |||
29 | #include "op_counter.h" | ||
30 | #include "op_arm_model.h" | ||
31 | |||
32 | #define PMU_ENABLE 0x001 /* Enable counters */ | ||
33 | #define PMN_RESET 0x002 /* Reset event counters */ | ||
34 | #define CCNT_RESET 0x004 /* Reset clock counter */ | ||
35 | #define PMU_RESET (CCNT_RESET | PMN_RESET) | ||
36 | #define PMU_CNT64 0x008 /* Make CCNT count every 64th cycle */ | ||
37 | |||
38 | /* | ||
39 | * Different types of events that can be counted by the XScale PMU | ||
40 | * as used by Oprofile userspace. Here primarily for documentation | ||
41 | * purposes. | ||
42 | */ | ||
43 | |||
44 | #define EVT_ICACHE_MISS 0x00 | ||
45 | #define EVT_ICACHE_NO_DELIVER 0x01 | ||
46 | #define EVT_DATA_STALL 0x02 | ||
47 | #define EVT_ITLB_MISS 0x03 | ||
48 | #define EVT_DTLB_MISS 0x04 | ||
49 | #define EVT_BRANCH 0x05 | ||
50 | #define EVT_BRANCH_MISS 0x06 | ||
51 | #define EVT_INSTRUCTION 0x07 | ||
52 | #define EVT_DCACHE_FULL_STALL 0x08 | ||
53 | #define EVT_DCACHE_FULL_STALL_CONTIG 0x09 | ||
54 | #define EVT_DCACHE_ACCESS 0x0A | ||
55 | #define EVT_DCACHE_MISS 0x0B | ||
56 | #define EVT_DCACE_WRITE_BACK 0x0C | ||
57 | #define EVT_PC_CHANGED 0x0D | ||
58 | #define EVT_BCU_REQUEST 0x10 | ||
59 | #define EVT_BCU_FULL 0x11 | ||
60 | #define EVT_BCU_DRAIN 0x12 | ||
61 | #define EVT_BCU_ECC_NO_ELOG 0x14 | ||
62 | #define EVT_BCU_1_BIT_ERR 0x15 | ||
63 | #define EVT_RMW 0x16 | ||
64 | /* EVT_CCNT is not hardware defined */ | ||
65 | #define EVT_CCNT 0xFE | ||
66 | #define EVT_UNUSED 0xFF | ||
67 | |||
68 | struct pmu_counter { | ||
69 | volatile unsigned long ovf; | ||
70 | unsigned long reset_counter; | ||
71 | }; | ||
72 | |||
73 | enum { CCNT, PMN0, PMN1, PMN2, PMN3, MAX_COUNTERS }; | ||
74 | |||
75 | static struct pmu_counter results[MAX_COUNTERS]; | ||
76 | |||
77 | /* | ||
78 | * There are two versions of the PMU in current XScale processors | ||
79 | * with differing register layouts and number of performance counters. | ||
80 | * e.g. IOP32x is xsc1 whilst IOP33x is xsc2. | ||
81 | * We detect which register layout to use in xscale_detect_pmu() | ||
82 | */ | ||
83 | enum { PMU_XSC1, PMU_XSC2 }; | ||
84 | |||
85 | struct pmu_type { | ||
86 | int id; | ||
87 | char *name; | ||
88 | int num_counters; | ||
89 | unsigned int int_enable; | ||
90 | unsigned int cnt_ovf[MAX_COUNTERS]; | ||
91 | unsigned int int_mask[MAX_COUNTERS]; | ||
92 | }; | ||
93 | |||
94 | static struct pmu_type pmu_parms[] = { | ||
95 | { | ||
96 | .id = PMU_XSC1, | ||
97 | .name = "arm/xscale1", | ||
98 | .num_counters = 3, | ||
99 | .int_mask = { [PMN0] = 0x10, [PMN1] = 0x20, | ||
100 | [CCNT] = 0x40 }, | ||
101 | .cnt_ovf = { [CCNT] = 0x400, [PMN0] = 0x100, | ||
102 | [PMN1] = 0x200}, | ||
103 | }, | ||
104 | { | ||
105 | .id = PMU_XSC2, | ||
106 | .name = "arm/xscale2", | ||
107 | .num_counters = 5, | ||
108 | .int_mask = { [CCNT] = 0x01, [PMN0] = 0x02, | ||
109 | [PMN1] = 0x04, [PMN2] = 0x08, | ||
110 | [PMN3] = 0x10 }, | ||
111 | .cnt_ovf = { [CCNT] = 0x01, [PMN0] = 0x02, | ||
112 | [PMN1] = 0x04, [PMN2] = 0x08, | ||
113 | [PMN3] = 0x10 }, | ||
114 | }, | ||
115 | }; | ||
116 | |||
117 | static struct pmu_type *pmu; | ||
118 | |||
119 | static void write_pmnc(u32 val) | ||
120 | { | ||
121 | if (pmu->id == PMU_XSC1) { | ||
122 | /* upper 4bits and 7, 11 are write-as-0 */ | ||
123 | val &= 0xffff77f; | ||
124 | __asm__ __volatile__ ("mcr p14, 0, %0, c0, c0, 0" : : "r" (val)); | ||
125 | } else { | ||
126 | /* bits 4-23 are write-as-0, 24-31 are write ignored */ | ||
127 | val &= 0xf; | ||
128 | __asm__ __volatile__ ("mcr p14, 0, %0, c0, c1, 0" : : "r" (val)); | ||
129 | } | ||
130 | } | ||
131 | |||
132 | static u32 read_pmnc(void) | ||
133 | { | ||
134 | u32 val; | ||
135 | |||
136 | if (pmu->id == PMU_XSC1) | ||
137 | __asm__ __volatile__ ("mrc p14, 0, %0, c0, c0, 0" : "=r" (val)); | ||
138 | else { | ||
139 | __asm__ __volatile__ ("mrc p14, 0, %0, c0, c1, 0" : "=r" (val)); | ||
140 | /* bits 1-2 and 4-23 are read-unpredictable */ | ||
141 | val &= 0xff000009; | ||
142 | } | ||
143 | |||
144 | return val; | ||
145 | } | ||
146 | |||
147 | static u32 __xsc1_read_counter(int counter) | ||
148 | { | ||
149 | u32 val = 0; | ||
150 | |||
151 | switch (counter) { | ||
152 | case CCNT: | ||
153 | __asm__ __volatile__ ("mrc p14, 0, %0, c1, c0, 0" : "=r" (val)); | ||
154 | break; | ||
155 | case PMN0: | ||
156 | __asm__ __volatile__ ("mrc p14, 0, %0, c2, c0, 0" : "=r" (val)); | ||
157 | break; | ||
158 | case PMN1: | ||
159 | __asm__ __volatile__ ("mrc p14, 0, %0, c3, c0, 0" : "=r" (val)); | ||
160 | break; | ||
161 | } | ||
162 | return val; | ||
163 | } | ||
164 | |||
165 | static u32 __xsc2_read_counter(int counter) | ||
166 | { | ||
167 | u32 val = 0; | ||
168 | |||
169 | switch (counter) { | ||
170 | case CCNT: | ||
171 | __asm__ __volatile__ ("mrc p14, 0, %0, c1, c1, 0" : "=r" (val)); | ||
172 | break; | ||
173 | case PMN0: | ||
174 | __asm__ __volatile__ ("mrc p14, 0, %0, c0, c2, 0" : "=r" (val)); | ||
175 | break; | ||
176 | case PMN1: | ||
177 | __asm__ __volatile__ ("mrc p14, 0, %0, c1, c2, 0" : "=r" (val)); | ||
178 | break; | ||
179 | case PMN2: | ||
180 | __asm__ __volatile__ ("mrc p14, 0, %0, c2, c2, 0" : "=r" (val)); | ||
181 | break; | ||
182 | case PMN3: | ||
183 | __asm__ __volatile__ ("mrc p14, 0, %0, c3, c2, 0" : "=r" (val)); | ||
184 | break; | ||
185 | } | ||
186 | return val; | ||
187 | } | ||
188 | |||
189 | static u32 read_counter(int counter) | ||
190 | { | ||
191 | u32 val; | ||
192 | |||
193 | if (pmu->id == PMU_XSC1) | ||
194 | val = __xsc1_read_counter(counter); | ||
195 | else | ||
196 | val = __xsc2_read_counter(counter); | ||
197 | |||
198 | return val; | ||
199 | } | ||
200 | |||
201 | static void __xsc1_write_counter(int counter, u32 val) | ||
202 | { | ||
203 | switch (counter) { | ||
204 | case CCNT: | ||
205 | __asm__ __volatile__ ("mcr p14, 0, %0, c1, c0, 0" : : "r" (val)); | ||
206 | break; | ||
207 | case PMN0: | ||
208 | __asm__ __volatile__ ("mcr p14, 0, %0, c2, c0, 0" : : "r" (val)); | ||
209 | break; | ||
210 | case PMN1: | ||
211 | __asm__ __volatile__ ("mcr p14, 0, %0, c3, c0, 0" : : "r" (val)); | ||
212 | break; | ||
213 | } | ||
214 | } | ||
215 | |||
216 | static void __xsc2_write_counter(int counter, u32 val) | ||
217 | { | ||
218 | switch (counter) { | ||
219 | case CCNT: | ||
220 | __asm__ __volatile__ ("mcr p14, 0, %0, c1, c1, 0" : : "r" (val)); | ||
221 | break; | ||
222 | case PMN0: | ||
223 | __asm__ __volatile__ ("mcr p14, 0, %0, c0, c2, 0" : : "r" (val)); | ||
224 | break; | ||
225 | case PMN1: | ||
226 | __asm__ __volatile__ ("mcr p14, 0, %0, c1, c2, 0" : : "r" (val)); | ||
227 | break; | ||
228 | case PMN2: | ||
229 | __asm__ __volatile__ ("mcr p14, 0, %0, c2, c2, 0" : : "r" (val)); | ||
230 | break; | ||
231 | case PMN3: | ||
232 | __asm__ __volatile__ ("mcr p14, 0, %0, c3, c2, 0" : : "r" (val)); | ||
233 | break; | ||
234 | } | ||
235 | } | ||
236 | |||
237 | static void write_counter(int counter, u32 val) | ||
238 | { | ||
239 | if (pmu->id == PMU_XSC1) | ||
240 | __xsc1_write_counter(counter, val); | ||
241 | else | ||
242 | __xsc2_write_counter(counter, val); | ||
243 | } | ||
244 | |||
245 | static int xscale_setup_ctrs(void) | ||
246 | { | ||
247 | u32 evtsel, pmnc; | ||
248 | int i; | ||
249 | |||
250 | for (i = CCNT; i < MAX_COUNTERS; i++) { | ||
251 | if (counter_config[i].enabled) | ||
252 | continue; | ||
253 | |||
254 | counter_config[i].event = EVT_UNUSED; | ||
255 | } | ||
256 | |||
257 | switch (pmu->id) { | ||
258 | case PMU_XSC1: | ||
259 | pmnc = (counter_config[PMN1].event << 20) | (counter_config[PMN0].event << 12); | ||
260 | pr_debug("xscale_setup_ctrs: pmnc: %#08x\n", pmnc); | ||
261 | write_pmnc(pmnc); | ||
262 | break; | ||
263 | |||
264 | case PMU_XSC2: | ||
265 | evtsel = counter_config[PMN0].event | (counter_config[PMN1].event << 8) | | ||
266 | (counter_config[PMN2].event << 16) | (counter_config[PMN3].event << 24); | ||
267 | |||
268 | pr_debug("xscale_setup_ctrs: evtsel %#08x\n", evtsel); | ||
269 | __asm__ __volatile__ ("mcr p14, 0, %0, c8, c1, 0" : : "r" (evtsel)); | ||
270 | break; | ||
271 | } | ||
272 | |||
273 | for (i = CCNT; i < MAX_COUNTERS; i++) { | ||
274 | if (counter_config[i].event == EVT_UNUSED) { | ||
275 | counter_config[i].event = 0; | ||
276 | pmu->int_enable &= ~pmu->int_mask[i]; | ||
277 | continue; | ||
278 | } | ||
279 | |||
280 | results[i].reset_counter = counter_config[i].count; | ||
281 | write_counter(i, -(u32)counter_config[i].count); | ||
282 | pmu->int_enable |= pmu->int_mask[i]; | ||
283 | pr_debug("xscale_setup_ctrs: counter%d %#08x from %#08lx\n", i, | ||
284 | read_counter(i), counter_config[i].count); | ||
285 | } | ||
286 | |||
287 | return 0; | ||
288 | } | ||
289 | |||
290 | static void inline __xsc1_check_ctrs(void) | ||
291 | { | ||
292 | int i; | ||
293 | u32 pmnc = read_pmnc(); | ||
294 | |||
295 | /* NOTE: there's an A stepping errata that states if an overflow */ | ||
296 | /* bit already exists and another occurs, the previous */ | ||
297 | /* Overflow bit gets cleared. There's no workaround. */ | ||
298 | /* Fixed in B stepping or later */ | ||
299 | |||
300 | /* Write the value back to clear the overflow flags. Overflow */ | ||
301 | /* flags remain in pmnc for use below */ | ||
302 | write_pmnc(pmnc & ~PMU_ENABLE); | ||
303 | |||
304 | for (i = CCNT; i <= PMN1; i++) { | ||
305 | if (!(pmu->int_mask[i] & pmu->int_enable)) | ||
306 | continue; | ||
307 | |||
308 | if (pmnc & pmu->cnt_ovf[i]) | ||
309 | results[i].ovf++; | ||
310 | } | ||
311 | } | ||
312 | |||
313 | static void inline __xsc2_check_ctrs(void) | ||
314 | { | ||
315 | int i; | ||
316 | u32 flag = 0, pmnc = read_pmnc(); | ||
317 | |||
318 | pmnc &= ~PMU_ENABLE; | ||
319 | write_pmnc(pmnc); | ||
320 | |||
321 | /* read overflow flag register */ | ||
322 | __asm__ __volatile__ ("mrc p14, 0, %0, c5, c1, 0" : "=r" (flag)); | ||
323 | |||
324 | for (i = CCNT; i <= PMN3; i++) { | ||
325 | if (!(pmu->int_mask[i] & pmu->int_enable)) | ||
326 | continue; | ||
327 | |||
328 | if (flag & pmu->cnt_ovf[i]) | ||
329 | results[i].ovf++; | ||
330 | } | ||
331 | |||
332 | /* writeback clears overflow bits */ | ||
333 | __asm__ __volatile__ ("mcr p14, 0, %0, c5, c1, 0" : : "r" (flag)); | ||
334 | } | ||
335 | |||
336 | static irqreturn_t xscale_pmu_interrupt(int irq, void *arg) | ||
337 | { | ||
338 | int i; | ||
339 | u32 pmnc; | ||
340 | |||
341 | if (pmu->id == PMU_XSC1) | ||
342 | __xsc1_check_ctrs(); | ||
343 | else | ||
344 | __xsc2_check_ctrs(); | ||
345 | |||
346 | for (i = CCNT; i < MAX_COUNTERS; i++) { | ||
347 | if (!results[i].ovf) | ||
348 | continue; | ||
349 | |||
350 | write_counter(i, -(u32)results[i].reset_counter); | ||
351 | oprofile_add_sample(get_irq_regs(), i); | ||
352 | results[i].ovf--; | ||
353 | } | ||
354 | |||
355 | pmnc = read_pmnc() | PMU_ENABLE; | ||
356 | write_pmnc(pmnc); | ||
357 | |||
358 | return IRQ_HANDLED; | ||
359 | } | ||
360 | |||
361 | static const struct pmu_irqs *pmu_irqs; | ||
362 | |||
363 | static void xscale_pmu_stop(void) | ||
364 | { | ||
365 | u32 pmnc = read_pmnc(); | ||
366 | |||
367 | pmnc &= ~PMU_ENABLE; | ||
368 | write_pmnc(pmnc); | ||
369 | |||
370 | free_irq(pmu_irqs->irqs[0], results); | ||
371 | release_pmu(pmu_irqs); | ||
372 | pmu_irqs = NULL; | ||
373 | } | ||
374 | |||
375 | static int xscale_pmu_start(void) | ||
376 | { | ||
377 | int ret; | ||
378 | u32 pmnc; | ||
379 | |||
380 | pmu_irqs = reserve_pmu(); | ||
381 | if (IS_ERR(pmu_irqs)) | ||
382 | return PTR_ERR(pmu_irqs); | ||
383 | |||
384 | pmnc = read_pmnc(); | ||
385 | |||
386 | ret = request_irq(pmu_irqs->irqs[0], xscale_pmu_interrupt, | ||
387 | IRQF_DISABLED, "XScale PMU", (void *)results); | ||
388 | |||
389 | if (ret < 0) { | ||
390 | printk(KERN_ERR "oprofile: unable to request IRQ%d for XScale PMU\n", | ||
391 | pmu_irqs->irqs[0]); | ||
392 | release_pmu(pmu_irqs); | ||
393 | pmu_irqs = NULL; | ||
394 | return ret; | ||
395 | } | ||
396 | |||
397 | if (pmu->id == PMU_XSC1) | ||
398 | pmnc |= pmu->int_enable; | ||
399 | else { | ||
400 | __asm__ __volatile__ ("mcr p14, 0, %0, c4, c1, 0" : : "r" (pmu->int_enable)); | ||
401 | pmnc &= ~PMU_CNT64; | ||
402 | } | ||
403 | |||
404 | pmnc |= PMU_ENABLE; | ||
405 | write_pmnc(pmnc); | ||
406 | pr_debug("xscale_pmu_start: pmnc: %#08x mask: %08x\n", pmnc, pmu->int_enable); | ||
407 | return 0; | ||
408 | } | ||
409 | |||
410 | static int xscale_detect_pmu(void) | ||
411 | { | ||
412 | int ret = 0; | ||
413 | u32 id; | ||
414 | |||
415 | id = (read_cpuid(CPUID_ID) >> 13) & 0x7; | ||
416 | |||
417 | switch (id) { | ||
418 | case 1: | ||
419 | pmu = &pmu_parms[PMU_XSC1]; | ||
420 | break; | ||
421 | case 2: | ||
422 | pmu = &pmu_parms[PMU_XSC2]; | ||
423 | break; | ||
424 | default: | ||
425 | ret = -ENODEV; | ||
426 | break; | ||
427 | } | ||
428 | |||
429 | if (!ret) { | ||
430 | op_xscale_spec.name = pmu->name; | ||
431 | op_xscale_spec.num_counters = pmu->num_counters; | ||
432 | pr_debug("xscale_detect_pmu: detected %s PMU\n", pmu->name); | ||
433 | } | ||
434 | |||
435 | return ret; | ||
436 | } | ||
437 | |||
438 | struct op_arm_model_spec op_xscale_spec = { | ||
439 | .init = xscale_detect_pmu, | ||
440 | .setup_ctrs = xscale_setup_ctrs, | ||
441 | .start = xscale_pmu_start, | ||
442 | .stop = xscale_pmu_stop, | ||
443 | }; | ||
444 | |||
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile index 36bff0325959..69b09c1cec8b 100644 --- a/arch/arm/plat-iop/Makefile +++ b/arch/arm/plat-iop/Makefile | |||
@@ -13,6 +13,7 @@ obj-$(CONFIG_ARCH_IOP32X) += time.o | |||
13 | obj-$(CONFIG_ARCH_IOP32X) += io.o | 13 | obj-$(CONFIG_ARCH_IOP32X) += io.o |
14 | obj-$(CONFIG_ARCH_IOP32X) += cp6.o | 14 | obj-$(CONFIG_ARCH_IOP32X) += cp6.o |
15 | obj-$(CONFIG_ARCH_IOP32X) += adma.o | 15 | obj-$(CONFIG_ARCH_IOP32X) += adma.o |
16 | obj-$(CONFIG_ARCH_IOP32X) += pmu.o | ||
16 | 17 | ||
17 | # IOP33X | 18 | # IOP33X |
18 | obj-$(CONFIG_ARCH_IOP33X) += gpio.o | 19 | obj-$(CONFIG_ARCH_IOP33X) += gpio.o |
@@ -23,6 +24,7 @@ obj-$(CONFIG_ARCH_IOP33X) += time.o | |||
23 | obj-$(CONFIG_ARCH_IOP33X) += io.o | 24 | obj-$(CONFIG_ARCH_IOP33X) += io.o |
24 | obj-$(CONFIG_ARCH_IOP33X) += cp6.o | 25 | obj-$(CONFIG_ARCH_IOP33X) += cp6.o |
25 | obj-$(CONFIG_ARCH_IOP33X) += adma.o | 26 | obj-$(CONFIG_ARCH_IOP33X) += adma.o |
27 | obj-$(CONFIG_ARCH_IOP33X) += pmu.o | ||
26 | 28 | ||
27 | # IOP13XX | 29 | # IOP13XX |
28 | obj-$(CONFIG_ARCH_IOP13XX) += cp6.o | 30 | obj-$(CONFIG_ARCH_IOP13XX) += cp6.o |
diff --git a/arch/arm/plat-iop/pmu.c b/arch/arm/plat-iop/pmu.c new file mode 100644 index 000000000000..a2024b8685a1 --- /dev/null +++ b/arch/arm/plat-iop/pmu.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * PMU IRQ registration for the iop3xx xscale PMU families. | ||
3 | * Copyright (C) 2010 Will Deacon, ARM Ltd. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/platform_device.h> | ||
12 | #include <asm/pmu.h> | ||
13 | #include <mach/irqs.h> | ||
14 | |||
15 | static struct resource pmu_resource = { | ||
16 | #ifdef CONFIG_ARCH_IOP32X | ||
17 | .start = IRQ_IOP32X_CORE_PMU, | ||
18 | .end = IRQ_IOP32X_CORE_PMU, | ||
19 | #endif | ||
20 | #ifdef CONFIG_ARCH_IOP33X | ||
21 | .start = IRQ_IOP33X_CORE_PMU, | ||
22 | .end = IRQ_IOP33X_CORE_PMU, | ||
23 | #endif | ||
24 | .flags = IORESOURCE_IRQ, | ||
25 | }; | ||
26 | |||
27 | static struct platform_device pmu_device = { | ||
28 | .name = "arm-pmu", | ||
29 | .id = ARM_PMU_DEVICE_CPU, | ||
30 | .resource = &pmu_resource, | ||
31 | .num_resources = 1, | ||
32 | }; | ||
33 | |||
34 | static int __init iop3xx_pmu_init(void) | ||
35 | { | ||
36 | platform_device_register(&pmu_device); | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | arch_initcall(iop3xx_pmu_init); | ||
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index 159daf583f85..5da3f97c537b 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig | |||
@@ -19,4 +19,9 @@ config HAS_MTU | |||
19 | to multiple interrupt generating programmable | 19 | to multiple interrupt generating programmable |
20 | 32-bit free running decrementing counters. | 20 | 32-bit free running decrementing counters. |
21 | 21 | ||
22 | config NOMADIK_GPIO | ||
23 | bool | ||
24 | help | ||
25 | Support for the Nomadik GPIO controller. | ||
26 | |||
22 | endif | 27 | endif |
diff --git a/arch/arm/plat-nomadik/Makefile b/arch/arm/plat-nomadik/Makefile index 37c7cdd0f8f0..c33547361bd7 100644 --- a/arch/arm/plat-nomadik/Makefile +++ b/arch/arm/plat-nomadik/Makefile | |||
@@ -3,3 +3,4 @@ | |||
3 | # Licensed under GPLv2 | 3 | # Licensed under GPLv2 |
4 | 4 | ||
5 | obj-$(CONFIG_HAS_MTU) += timer.o | 5 | obj-$(CONFIG_HAS_MTU) += timer.o |
6 | obj-$(CONFIG_NOMADIK_GPIO) += gpio.o | ||
diff --git a/arch/arm/mach-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c index 66b1c91ccc74..5a6ef252c38b 100644 --- a/arch/arm/mach-nomadik/gpio.c +++ b/arch/arm/plat-nomadik/gpio.c | |||
@@ -13,8 +13,10 @@ | |||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
16 | #include <linux/amba/bus.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/clk.h> | ||
19 | #include <linux/err.h> | ||
18 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
19 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
20 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
@@ -36,8 +38,9 @@ | |||
36 | struct nmk_gpio_chip { | 38 | struct nmk_gpio_chip { |
37 | struct gpio_chip chip; | 39 | struct gpio_chip chip; |
38 | void __iomem *addr; | 40 | void __iomem *addr; |
41 | struct clk *clk; | ||
39 | unsigned int parent_irq; | 42 | unsigned int parent_irq; |
40 | spinlock_t *lock; | 43 | spinlock_t lock; |
41 | /* Keep track of configured edges */ | 44 | /* Keep track of configured edges */ |
42 | u32 edge_rising; | 45 | u32 edge_rising; |
43 | u32 edge_falling; | 46 | u32 edge_falling; |
@@ -108,40 +111,37 @@ static void nmk_gpio_irq_ack(unsigned int irq) | |||
108 | writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); | 111 | writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); |
109 | } | 112 | } |
110 | 113 | ||
111 | static void nmk_gpio_irq_mask(unsigned int irq) | 114 | static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip, |
115 | int gpio, bool enable) | ||
112 | { | 116 | { |
113 | int gpio; | 117 | u32 bitmask = nmk_gpio_get_bitmask(gpio); |
114 | struct nmk_gpio_chip *nmk_chip; | 118 | u32 reg; |
115 | unsigned long flags; | ||
116 | u32 bitmask, reg; | ||
117 | |||
118 | gpio = NOMADIK_IRQ_TO_GPIO(irq); | ||
119 | nmk_chip = get_irq_chip_data(irq); | ||
120 | bitmask = nmk_gpio_get_bitmask(gpio); | ||
121 | if (!nmk_chip) | ||
122 | return; | ||
123 | 119 | ||
124 | /* we must individually clear the two edges */ | 120 | /* we must individually set/clear the two edges */ |
125 | spin_lock_irqsave(&nmk_chip->lock, flags); | ||
126 | if (nmk_chip->edge_rising & bitmask) { | 121 | if (nmk_chip->edge_rising & bitmask) { |
127 | reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC); | 122 | reg = readl(nmk_chip->addr + NMK_GPIO_RIMSC); |
128 | reg &= ~bitmask; | 123 | if (enable) |
129 | writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC); | 124 | reg |= bitmask; |
125 | else | ||
126 | reg &= ~bitmask; | ||
127 | writel(reg, nmk_chip->addr + NMK_GPIO_RIMSC); | ||
130 | } | 128 | } |
131 | if (nmk_chip->edge_falling & bitmask) { | 129 | if (nmk_chip->edge_falling & bitmask) { |
132 | reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC); | 130 | reg = readl(nmk_chip->addr + NMK_GPIO_FIMSC); |
133 | reg &= ~bitmask; | 131 | if (enable) |
134 | writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC); | 132 | reg |= bitmask; |
133 | else | ||
134 | reg &= ~bitmask; | ||
135 | writel(reg, nmk_chip->addr + NMK_GPIO_FIMSC); | ||
135 | } | 136 | } |
136 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 137 | } |
137 | }; | ||
138 | 138 | ||
139 | static void nmk_gpio_irq_unmask(unsigned int irq) | 139 | static void nmk_gpio_irq_modify(unsigned int irq, bool enable) |
140 | { | 140 | { |
141 | int gpio; | 141 | int gpio; |
142 | struct nmk_gpio_chip *nmk_chip; | 142 | struct nmk_gpio_chip *nmk_chip; |
143 | unsigned long flags; | 143 | unsigned long flags; |
144 | u32 bitmask, reg; | 144 | u32 bitmask; |
145 | 145 | ||
146 | gpio = NOMADIK_IRQ_TO_GPIO(irq); | 146 | gpio = NOMADIK_IRQ_TO_GPIO(irq); |
147 | nmk_chip = get_irq_chip_data(irq); | 147 | nmk_chip = get_irq_chip_data(irq); |
@@ -149,23 +149,24 @@ static void nmk_gpio_irq_unmask(unsigned int irq) | |||
149 | if (!nmk_chip) | 149 | if (!nmk_chip) |
150 | return; | 150 | return; |
151 | 151 | ||
152 | /* we must individually set the two edges */ | ||
153 | spin_lock_irqsave(&nmk_chip->lock, flags); | 152 | spin_lock_irqsave(&nmk_chip->lock, flags); |
154 | if (nmk_chip->edge_rising & bitmask) { | 153 | __nmk_gpio_irq_modify(nmk_chip, gpio, enable); |
155 | reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC); | ||
156 | reg |= bitmask; | ||
157 | writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC); | ||
158 | } | ||
159 | if (nmk_chip->edge_falling & bitmask) { | ||
160 | reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC); | ||
161 | reg |= bitmask; | ||
162 | writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC); | ||
163 | } | ||
164 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 154 | spin_unlock_irqrestore(&nmk_chip->lock, flags); |
165 | } | 155 | } |
166 | 156 | ||
157 | static void nmk_gpio_irq_mask(unsigned int irq) | ||
158 | { | ||
159 | nmk_gpio_irq_modify(irq, false); | ||
160 | }; | ||
161 | |||
162 | static void nmk_gpio_irq_unmask(unsigned int irq) | ||
163 | { | ||
164 | nmk_gpio_irq_modify(irq, true); | ||
165 | } | ||
166 | |||
167 | static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) | 167 | static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) |
168 | { | 168 | { |
169 | bool enabled = !(irq_to_desc(irq)->status & IRQ_DISABLED); | ||
169 | int gpio; | 170 | int gpio; |
170 | struct nmk_gpio_chip *nmk_chip; | 171 | struct nmk_gpio_chip *nmk_chip; |
171 | unsigned long flags; | 172 | unsigned long flags; |
@@ -184,19 +185,21 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) | |||
184 | 185 | ||
185 | spin_lock_irqsave(&nmk_chip->lock, flags); | 186 | spin_lock_irqsave(&nmk_chip->lock, flags); |
186 | 187 | ||
188 | if (enabled) | ||
189 | __nmk_gpio_irq_modify(nmk_chip, gpio, false); | ||
190 | |||
187 | nmk_chip->edge_rising &= ~bitmask; | 191 | nmk_chip->edge_rising &= ~bitmask; |
188 | if (type & IRQ_TYPE_EDGE_RISING) | 192 | if (type & IRQ_TYPE_EDGE_RISING) |
189 | nmk_chip->edge_rising |= bitmask; | 193 | nmk_chip->edge_rising |= bitmask; |
190 | writel(nmk_chip->edge_rising, nmk_chip->addr + NMK_GPIO_RIMSC); | ||
191 | 194 | ||
192 | nmk_chip->edge_falling &= ~bitmask; | 195 | nmk_chip->edge_falling &= ~bitmask; |
193 | if (type & IRQ_TYPE_EDGE_FALLING) | 196 | if (type & IRQ_TYPE_EDGE_FALLING) |
194 | nmk_chip->edge_falling |= bitmask; | 197 | nmk_chip->edge_falling |= bitmask; |
195 | writel(nmk_chip->edge_falling, nmk_chip->addr + NMK_GPIO_FIMSC); | ||
196 | 198 | ||
197 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 199 | if (enabled) |
200 | __nmk_gpio_irq_modify(nmk_chip, gpio, true); | ||
198 | 201 | ||
199 | nmk_gpio_irq_unmask(irq); | 202 | spin_unlock_irqrestore(&nmk_chip->lock, flags); |
200 | 203 | ||
201 | return 0; | 204 | return 0; |
202 | } | 205 | } |
@@ -212,21 +215,27 @@ static struct irq_chip nmk_gpio_irq_chip = { | |||
212 | static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 215 | static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) |
213 | { | 216 | { |
214 | struct nmk_gpio_chip *nmk_chip; | 217 | struct nmk_gpio_chip *nmk_chip; |
215 | struct irq_chip *host_chip; | 218 | struct irq_chip *host_chip = get_irq_chip(irq); |
216 | unsigned int gpio_irq; | 219 | unsigned int gpio_irq; |
217 | u32 pending; | 220 | u32 pending; |
218 | unsigned int first_irq; | 221 | unsigned int first_irq; |
219 | 222 | ||
223 | if (host_chip->mask_ack) | ||
224 | host_chip->mask_ack(irq); | ||
225 | else { | ||
226 | host_chip->mask(irq); | ||
227 | if (host_chip->ack) | ||
228 | host_chip->ack(irq); | ||
229 | } | ||
230 | |||
220 | nmk_chip = get_irq_data(irq); | 231 | nmk_chip = get_irq_data(irq); |
221 | first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); | 232 | first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); |
222 | while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) { | 233 | while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) { |
223 | gpio_irq = first_irq + __ffs(pending); | 234 | gpio_irq = first_irq + __ffs(pending); |
224 | generic_handle_irq(gpio_irq); | 235 | generic_handle_irq(gpio_irq); |
225 | } | 236 | } |
226 | if (0) {/* don't ack parent irq, as ack == disable */ | 237 | |
227 | host_chip = get_irq_chip(irq); | 238 | host_chip->unmask(irq); |
228 | host_chip->ack(irq); | ||
229 | } | ||
230 | } | 239 | } |
231 | 240 | ||
232 | static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) | 241 | static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) |
@@ -240,6 +249,7 @@ static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) | |||
240 | set_irq_handler(i, handle_edge_irq); | 249 | set_irq_handler(i, handle_edge_irq); |
241 | set_irq_flags(i, IRQF_VALID); | 250 | set_irq_flags(i, IRQF_VALID); |
242 | set_irq_chip_data(i, nmk_chip); | 251 | set_irq_chip_data(i, nmk_chip); |
252 | set_irq_type(i, IRQ_TYPE_EDGE_FALLING); | ||
243 | } | 253 | } |
244 | set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler); | 254 | set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler); |
245 | set_irq_data(nmk_chip->parent_irq, nmk_chip); | 255 | set_irq_data(nmk_chip->parent_irq, nmk_chip); |
@@ -298,30 +308,59 @@ static struct gpio_chip nmk_gpio_template = { | |||
298 | .can_sleep = 0, | 308 | .can_sleep = 0, |
299 | }; | 309 | }; |
300 | 310 | ||
301 | static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | 311 | static int __init nmk_gpio_probe(struct platform_device *dev) |
302 | { | 312 | { |
303 | struct nmk_gpio_platform_data *pdata; | 313 | struct nmk_gpio_platform_data *pdata = dev->dev.platform_data; |
304 | struct nmk_gpio_chip *nmk_chip; | 314 | struct nmk_gpio_chip *nmk_chip; |
305 | struct gpio_chip *chip; | 315 | struct gpio_chip *chip; |
316 | struct resource *res; | ||
317 | struct clk *clk; | ||
318 | int irq; | ||
306 | int ret; | 319 | int ret; |
307 | 320 | ||
308 | pdata = dev->dev.platform_data; | 321 | if (!pdata) |
309 | ret = amba_request_regions(dev, pdata->name); | 322 | return -ENODEV; |
310 | if (ret) | 323 | |
311 | return ret; | 324 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
325 | if (!res) { | ||
326 | ret = -ENOENT; | ||
327 | goto out; | ||
328 | } | ||
329 | |||
330 | irq = platform_get_irq(dev, 0); | ||
331 | if (irq < 0) { | ||
332 | ret = irq; | ||
333 | goto out; | ||
334 | } | ||
335 | |||
336 | if (request_mem_region(res->start, resource_size(res), | ||
337 | dev_name(&dev->dev)) == NULL) { | ||
338 | ret = -EBUSY; | ||
339 | goto out; | ||
340 | } | ||
341 | |||
342 | clk = clk_get(&dev->dev, NULL); | ||
343 | if (IS_ERR(clk)) { | ||
344 | ret = PTR_ERR(clk); | ||
345 | goto out_release; | ||
346 | } | ||
347 | |||
348 | clk_enable(clk); | ||
312 | 349 | ||
313 | nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); | 350 | nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); |
314 | if (!nmk_chip) { | 351 | if (!nmk_chip) { |
315 | ret = -ENOMEM; | 352 | ret = -ENOMEM; |
316 | goto out_amba; | 353 | goto out_clk; |
317 | } | 354 | } |
318 | /* | 355 | /* |
319 | * The virt address in nmk_chip->addr is in the nomadik register space, | 356 | * The virt address in nmk_chip->addr is in the nomadik register space, |
320 | * so we can simply convert the resource address, without remapping | 357 | * so we can simply convert the resource address, without remapping |
321 | */ | 358 | */ |
322 | nmk_chip->addr = io_p2v(dev->res.start); | 359 | nmk_chip->clk = clk; |
360 | nmk_chip->addr = io_p2v(res->start); | ||
323 | nmk_chip->chip = nmk_gpio_template; | 361 | nmk_chip->chip = nmk_gpio_template; |
324 | nmk_chip->parent_irq = pdata->parent_irq; | 362 | nmk_chip->parent_irq = irq; |
363 | spin_lock_init(&nmk_chip->lock); | ||
325 | 364 | ||
326 | chip = &nmk_chip->chip; | 365 | chip = &nmk_chip->chip; |
327 | chip->base = pdata->first_gpio; | 366 | chip->base = pdata->first_gpio; |
@@ -333,7 +372,7 @@ static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | |||
333 | if (ret) | 372 | if (ret) |
334 | goto out_free; | 373 | goto out_free; |
335 | 374 | ||
336 | amba_set_drvdata(dev, nmk_chip); | 375 | platform_set_drvdata(dev, nmk_chip); |
337 | 376 | ||
338 | nmk_gpio_init_irq(nmk_chip); | 377 | nmk_gpio_init_irq(nmk_chip); |
339 | 378 | ||
@@ -341,51 +380,50 @@ static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | |||
341 | nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr); | 380 | nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr); |
342 | return 0; | 381 | return 0; |
343 | 382 | ||
344 | out_free: | 383 | out_free: |
345 | kfree(nmk_chip); | 384 | kfree(nmk_chip); |
346 | out_amba: | 385 | out_clk: |
347 | amba_release_regions(dev); | 386 | clk_disable(clk); |
387 | clk_put(clk); | ||
388 | out_release: | ||
389 | release_mem_region(res->start, resource_size(res)); | ||
390 | out: | ||
348 | dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret, | 391 | dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret, |
349 | pdata->first_gpio, pdata->first_gpio+31); | 392 | pdata->first_gpio, pdata->first_gpio+31); |
350 | return ret; | 393 | return ret; |
351 | } | 394 | } |
352 | 395 | ||
353 | static int nmk_gpio_remove(struct amba_device *dev) | 396 | static int __exit nmk_gpio_remove(struct platform_device *dev) |
354 | { | 397 | { |
355 | struct nmk_gpio_chip *nmk_chip; | 398 | struct nmk_gpio_chip *nmk_chip; |
399 | struct resource *res; | ||
356 | 400 | ||
357 | nmk_chip = amba_get_drvdata(dev); | 401 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
402 | |||
403 | nmk_chip = platform_get_drvdata(dev); | ||
358 | gpiochip_remove(&nmk_chip->chip); | 404 | gpiochip_remove(&nmk_chip->chip); |
405 | clk_disable(nmk_chip->clk); | ||
406 | clk_put(nmk_chip->clk); | ||
359 | kfree(nmk_chip); | 407 | kfree(nmk_chip); |
360 | amba_release_regions(dev); | 408 | release_mem_region(res->start, resource_size(res)); |
361 | return 0; | 409 | return 0; |
362 | } | 410 | } |
363 | 411 | ||
364 | 412 | ||
365 | /* We have 0x1f080060 and 0x1f180060, accept both using the mask */ | 413 | static struct platform_driver nmk_gpio_driver = { |
366 | static struct amba_id nmk_gpio_ids[] = { | 414 | .driver = { |
367 | { | ||
368 | .id = 0x1f080060, | ||
369 | .mask = 0xffefffff, | ||
370 | }, | ||
371 | {0, 0}, | ||
372 | }; | ||
373 | |||
374 | static struct amba_driver nmk_gpio_driver = { | ||
375 | .drv = { | ||
376 | .owner = THIS_MODULE, | 415 | .owner = THIS_MODULE, |
377 | .name = "gpio", | 416 | .name = "gpio", |
378 | }, | 417 | }, |
379 | .probe = nmk_gpio_probe, | 418 | .probe = nmk_gpio_probe, |
380 | .remove = nmk_gpio_remove, | 419 | .remove = __exit_p(nmk_gpio_remove), |
381 | .suspend = NULL, /* to be done */ | 420 | .suspend = NULL, /* to be done */ |
382 | .resume = NULL, | 421 | .resume = NULL, |
383 | .id_table = nmk_gpio_ids, | ||
384 | }; | 422 | }; |
385 | 423 | ||
386 | static int __init nmk_gpio_init(void) | 424 | static int __init nmk_gpio_init(void) |
387 | { | 425 | { |
388 | return amba_driver_register(&nmk_gpio_driver); | 426 | return platform_driver_register(&nmk_gpio_driver); |
389 | } | 427 | } |
390 | 428 | ||
391 | arch_initcall(nmk_gpio_init); | 429 | arch_initcall(nmk_gpio_init); |
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h new file mode 100644 index 000000000000..4200811249ca --- /dev/null +++ b/arch/arm/plat-nomadik/include/plat/gpio.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * Structures and registers for GPIO access in the Nomadik SoC | ||
3 | * | ||
4 | * Copyright (C) 2008 STMicroelectronics | ||
5 | * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> | ||
6 | * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> | ||
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 | #ifndef __ASM_PLAT_GPIO_H | ||
13 | #define __ASM_PLAT_GPIO_H | ||
14 | |||
15 | #include <asm-generic/gpio.h> | ||
16 | |||
17 | /* | ||
18 | * These currently cause a function call to happen, they may be optimized | ||
19 | * if needed by adding cpu-specific defines to identify blocks | ||
20 | * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc) | ||
21 | */ | ||
22 | #define gpio_get_value __gpio_get_value | ||
23 | #define gpio_set_value __gpio_set_value | ||
24 | #define gpio_cansleep __gpio_cansleep | ||
25 | #define gpio_to_irq __gpio_to_irq | ||
26 | |||
27 | /* | ||
28 | * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving | ||
29 | * the "gpio" namespace for generic and cross-machine functions | ||
30 | */ | ||
31 | |||
32 | /* Register in the logic block */ | ||
33 | #define NMK_GPIO_DAT 0x00 | ||
34 | #define NMK_GPIO_DATS 0x04 | ||
35 | #define NMK_GPIO_DATC 0x08 | ||
36 | #define NMK_GPIO_PDIS 0x0c | ||
37 | #define NMK_GPIO_DIR 0x10 | ||
38 | #define NMK_GPIO_DIRS 0x14 | ||
39 | #define NMK_GPIO_DIRC 0x18 | ||
40 | #define NMK_GPIO_SLPC 0x1c | ||
41 | #define NMK_GPIO_AFSLA 0x20 | ||
42 | #define NMK_GPIO_AFSLB 0x24 | ||
43 | |||
44 | #define NMK_GPIO_RIMSC 0x40 | ||
45 | #define NMK_GPIO_FIMSC 0x44 | ||
46 | #define NMK_GPIO_IS 0x48 | ||
47 | #define NMK_GPIO_IC 0x4c | ||
48 | #define NMK_GPIO_RWIMSC 0x50 | ||
49 | #define NMK_GPIO_FWIMSC 0x54 | ||
50 | #define NMK_GPIO_WKS 0x58 | ||
51 | |||
52 | /* Alternate functions: function C is set in hw by setting both A and B */ | ||
53 | #define NMK_GPIO_ALT_GPIO 0 | ||
54 | #define NMK_GPIO_ALT_A 1 | ||
55 | #define NMK_GPIO_ALT_B 2 | ||
56 | #define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) | ||
57 | |||
58 | extern int nmk_gpio_set_mode(int gpio, int gpio_mode); | ||
59 | extern int nmk_gpio_get_mode(int gpio); | ||
60 | |||
61 | /* | ||
62 | * Platform data to register a block: only the initial gpio/irq number. | ||
63 | */ | ||
64 | struct nmk_gpio_platform_data { | ||
65 | char *name; | ||
66 | int first_gpio; | ||
67 | int first_irq; | ||
68 | }; | ||
69 | |||
70 | #endif /* __ASM_PLAT_GPIO_H */ | ||
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index fa7cb3a57cbf..0ff3798769ab 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * linux/arch/arm/mach-nomadik/timer.c | 2 | * linux/arch/arm/mach-nomadik/timer.c |
3 | * | 3 | * |
4 | * Copyright (C) 2008 STMicroelectronics | 4 | * Copyright (C) 2008 STMicroelectronics |
5 | * Copyright (C) 2009 Alessandro Rubini, somewhat based on at91sam926x | 5 | * Copyright (C) 2010 Alessandro Rubini |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 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 | 8 | * it under the terms of the GNU General Public License version 2, as |
@@ -18,123 +18,150 @@ | |||
18 | 18 | ||
19 | #include <plat/mtu.h> | 19 | #include <plat/mtu.h> |
20 | 20 | ||
21 | static u32 nmdk_count; /* accumulated count */ | 21 | void __iomem *mtu_base; /* ssigned by machine code */ |
22 | static u32 nmdk_cycle; /* write-once */ | ||
23 | |||
24 | /* setup by the platform code */ | ||
25 | void __iomem *mtu_base; | ||
26 | 22 | ||
27 | /* | 23 | /* |
28 | * clocksource: the MTU device is a decrementing counters, so we negate | 24 | * Kernel assumes that sched_clock can be called early |
29 | * the value being read. | 25 | * but the MTU may not yet be initialized. |
30 | */ | 26 | */ |
31 | static cycle_t nmdk_read_timer(struct clocksource *cs) | 27 | static cycle_t nmdk_read_timer_dummy(struct clocksource *cs) |
32 | { | 28 | { |
33 | u32 count = readl(mtu_base + MTU_VAL(0)); | 29 | return 0; |
34 | return nmdk_count + nmdk_cycle - count; | 30 | } |
35 | 31 | ||
32 | /* clocksource: MTU decrements, so we negate the value being read. */ | ||
33 | static cycle_t nmdk_read_timer(struct clocksource *cs) | ||
34 | { | ||
35 | return -readl(mtu_base + MTU_VAL(0)); | ||
36 | } | 36 | } |
37 | 37 | ||
38 | static struct clocksource nmdk_clksrc = { | 38 | static struct clocksource nmdk_clksrc = { |
39 | .name = "mtu_0", | 39 | .name = "mtu_0", |
40 | .rating = 120, | 40 | .rating = 200, |
41 | .read = nmdk_read_timer, | 41 | .read = nmdk_read_timer_dummy, |
42 | .mask = CLOCKSOURCE_MASK(32), | ||
42 | .shift = 20, | 43 | .shift = 20, |
43 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 44 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
44 | }; | 45 | }; |
45 | 46 | ||
46 | /* | 47 | /* |
47 | * Clockevent device: currently only periodic mode is supported | 48 | * Override the global weak sched_clock symbol with this |
49 | * local implementation which uses the clocksource to get some | ||
50 | * better resolution when scheduling the kernel. We accept that | ||
51 | * this wraps around for now, since it is just a relative time | ||
52 | * stamp. (Inspired by OMAP implementation.) | ||
48 | */ | 53 | */ |
54 | unsigned long long notrace sched_clock(void) | ||
55 | { | ||
56 | return clocksource_cyc2ns(nmdk_clksrc.read( | ||
57 | &nmdk_clksrc), | ||
58 | nmdk_clksrc.mult, | ||
59 | nmdk_clksrc.shift); | ||
60 | } | ||
61 | |||
62 | /* Clockevent device: use one-shot mode */ | ||
49 | static void nmdk_clkevt_mode(enum clock_event_mode mode, | 63 | static void nmdk_clkevt_mode(enum clock_event_mode mode, |
50 | struct clock_event_device *dev) | 64 | struct clock_event_device *dev) |
51 | { | 65 | { |
66 | u32 cr; | ||
67 | |||
52 | switch (mode) { | 68 | switch (mode) { |
53 | case CLOCK_EVT_MODE_PERIODIC: | 69 | case CLOCK_EVT_MODE_PERIODIC: |
54 | /* count current value? */ | 70 | pr_err("%s: periodic mode not supported\n", __func__); |
55 | writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC); | ||
56 | break; | 71 | break; |
57 | case CLOCK_EVT_MODE_ONESHOT: | 72 | case CLOCK_EVT_MODE_ONESHOT: |
58 | BUG(); /* Not supported, yet */ | 73 | /* Load highest value, enable device, enable interrupts */ |
59 | /* FALLTHROUGH */ | 74 | cr = readl(mtu_base + MTU_CR(1)); |
75 | writel(0, mtu_base + MTU_LR(1)); | ||
76 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1)); | ||
77 | writel(0x2, mtu_base + MTU_IMSC); | ||
78 | break; | ||
60 | case CLOCK_EVT_MODE_SHUTDOWN: | 79 | case CLOCK_EVT_MODE_SHUTDOWN: |
61 | case CLOCK_EVT_MODE_UNUSED: | 80 | case CLOCK_EVT_MODE_UNUSED: |
62 | writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC); | 81 | /* disable irq */ |
82 | writel(0, mtu_base + MTU_IMSC); | ||
63 | break; | 83 | break; |
64 | case CLOCK_EVT_MODE_RESUME: | 84 | case CLOCK_EVT_MODE_RESUME: |
65 | break; | 85 | break; |
66 | } | 86 | } |
67 | } | 87 | } |
68 | 88 | ||
89 | static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev) | ||
90 | { | ||
91 | /* writing the value has immediate effect */ | ||
92 | writel(evt, mtu_base + MTU_LR(1)); | ||
93 | return 0; | ||
94 | } | ||
95 | |||
69 | static struct clock_event_device nmdk_clkevt = { | 96 | static struct clock_event_device nmdk_clkevt = { |
70 | .name = "mtu_0", | 97 | .name = "mtu_1", |
71 | .features = CLOCK_EVT_FEAT_PERIODIC, | 98 | .features = CLOCK_EVT_FEAT_ONESHOT, |
72 | .shift = 32, | 99 | .shift = 32, |
73 | .rating = 100, | 100 | .rating = 200, |
74 | .set_mode = nmdk_clkevt_mode, | 101 | .set_mode = nmdk_clkevt_mode, |
102 | .set_next_event = nmdk_clkevt_next, | ||
75 | }; | 103 | }; |
76 | 104 | ||
77 | /* | 105 | /* |
78 | * IRQ Handler for the timer 0 of the MTU block. The irq is not shared | 106 | * IRQ Handler for timer 1 of the MTU block. |
79 | * as we are the only users of mtu0 by now. | ||
80 | */ | 107 | */ |
81 | static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id) | 108 | static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id) |
82 | { | 109 | { |
83 | /* ack: "interrupt clear register" */ | 110 | struct clock_event_device *evdev = dev_id; |
84 | writel(1 << 0, mtu_base + MTU_ICR); | ||
85 | |||
86 | /* we can't count lost ticks, unfortunately */ | ||
87 | nmdk_count += nmdk_cycle; | ||
88 | nmdk_clkevt.event_handler(&nmdk_clkevt); | ||
89 | 111 | ||
112 | writel(1 << 1, mtu_base + MTU_ICR); /* Interrupt clear reg */ | ||
113 | evdev->event_handler(evdev); | ||
90 | return IRQ_HANDLED; | 114 | return IRQ_HANDLED; |
91 | } | 115 | } |
92 | 116 | ||
93 | /* | ||
94 | * Set up timer interrupt, and return the current time in seconds. | ||
95 | */ | ||
96 | static struct irqaction nmdk_timer_irq = { | 117 | static struct irqaction nmdk_timer_irq = { |
97 | .name = "Nomadik Timer Tick", | 118 | .name = "Nomadik Timer Tick", |
98 | .flags = IRQF_DISABLED | IRQF_TIMER, | 119 | .flags = IRQF_DISABLED | IRQF_TIMER, |
99 | .handler = nmdk_timer_interrupt, | 120 | .handler = nmdk_timer_interrupt, |
121 | .dev_id = &nmdk_clkevt, | ||
100 | }; | 122 | }; |
101 | 123 | ||
102 | static void nmdk_timer_reset(void) | ||
103 | { | ||
104 | u32 cr; | ||
105 | |||
106 | writel(0, mtu_base + MTU_CR(0)); /* off */ | ||
107 | |||
108 | /* configure load and background-load, and fire it up */ | ||
109 | writel(nmdk_cycle, mtu_base + MTU_LR(0)); | ||
110 | writel(nmdk_cycle, mtu_base + MTU_BGLR(0)); | ||
111 | cr = MTU_CRn_PERIODIC | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS; | ||
112 | writel(cr, mtu_base + MTU_CR(0)); | ||
113 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); | ||
114 | } | ||
115 | |||
116 | void __init nmdk_timer_init(void) | 124 | void __init nmdk_timer_init(void) |
117 | { | 125 | { |
118 | unsigned long rate; | 126 | unsigned long rate; |
119 | int bits; | 127 | u32 cr = MTU_CRn_32BITS;; |
120 | 128 | ||
121 | rate = CLOCK_TICK_RATE; /* 2.4MHz */ | 129 | /* |
122 | nmdk_cycle = (rate + HZ/2) / HZ; | 130 | * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500: |
131 | * use a divide-by-16 counter if it's more than 16MHz | ||
132 | */ | ||
133 | rate = CLOCK_TICK_RATE; | ||
134 | if (rate > 16 << 20) { | ||
135 | rate /= 16; | ||
136 | cr |= MTU_CRn_PRESCALE_16; | ||
137 | } else { | ||
138 | cr |= MTU_CRn_PRESCALE_1; | ||
139 | } | ||
123 | 140 | ||
124 | /* Init the timer and register clocksource */ | 141 | /* Timer 0 is the free running clocksource */ |
125 | nmdk_timer_reset(); | 142 | writel(cr, mtu_base + MTU_CR(0)); |
143 | writel(0, mtu_base + MTU_LR(0)); | ||
144 | writel(0, mtu_base + MTU_BGLR(0)); | ||
145 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); | ||
126 | 146 | ||
127 | nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift); | 147 | nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift); |
128 | bits = 8*sizeof(nmdk_count); | 148 | /* Now the scheduling clock is ready */ |
129 | nmdk_clksrc.mask = CLOCKSOURCE_MASK(bits); | 149 | nmdk_clksrc.read = nmdk_read_timer; |
130 | 150 | ||
131 | if (clocksource_register(&nmdk_clksrc)) | 151 | if (clocksource_register(&nmdk_clksrc)) |
132 | printk(KERN_ERR "timer: failed to initialize clock " | 152 | pr_err("timer: failed to initialize clock source %s\n", |
133 | "source %s\n", nmdk_clksrc.name); | 153 | nmdk_clksrc.name); |
154 | |||
155 | /* Timer 1 is used for events, fix according to rate */ | ||
156 | writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */ | ||
157 | nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift); | ||
158 | nmdk_clkevt.max_delta_ns = | ||
159 | clockevent_delta2ns(0xffffffff, &nmdk_clkevt); | ||
160 | nmdk_clkevt.min_delta_ns = | ||
161 | clockevent_delta2ns(0x00000002, &nmdk_clkevt); | ||
162 | nmdk_clkevt.cpumask = cpumask_of(0); | ||
134 | 163 | ||
135 | /* Register irq and clockevents */ | 164 | /* Register irq and clockevents */ |
136 | setup_irq(IRQ_MTU0, &nmdk_timer_irq); | 165 | setup_irq(IRQ_MTU0, &nmdk_timer_irq); |
137 | nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift); | ||
138 | nmdk_clkevt.cpumask = cpumask_of(0); | ||
139 | clockevents_register_device(&nmdk_clkevt); | 166 | clockevents_register_device(&nmdk_clkevt); |
140 | } | 167 | } |
diff --git a/arch/arm/plat-pxa/Kconfig b/arch/arm/plat-pxa/Kconfig index b158e98038ed..da53395a17c6 100644 --- a/arch/arm/plat-pxa/Kconfig +++ b/arch/arm/plat-pxa/Kconfig | |||
@@ -1,3 +1,8 @@ | |||
1 | if PLAT_PXA | 1 | if PLAT_PXA |
2 | 2 | ||
3 | config PXA_SSP | ||
4 | tristate | ||
5 | help | ||
6 | Enable support for PXA2xx SSP ports | ||
7 | |||
3 | endif | 8 | endif |
diff --git a/arch/arm/plat-pxa/Makefile b/arch/arm/plat-pxa/Makefile index 0264bfb0ca4f..6187edfbcb77 100644 --- a/arch/arm/plat-pxa/Makefile +++ b/arch/arm/plat-pxa/Makefile | |||
@@ -2,10 +2,11 @@ | |||
2 | # Makefile for code common across different PXA processor families | 2 | # Makefile for code common across different PXA processor families |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := dma.o | 5 | obj-y := dma.o pmu.o |
6 | 6 | ||
7 | obj-$(CONFIG_GENERIC_GPIO) += gpio.o | 7 | obj-$(CONFIG_GENERIC_GPIO) += gpio.o |
8 | obj-$(CONFIG_PXA3xx) += mfp.o | 8 | obj-$(CONFIG_PXA3xx) += mfp.o |
9 | obj-$(CONFIG_ARCH_MMP) += mfp.o | 9 | obj-$(CONFIG_ARCH_MMP) += mfp.o |
10 | 10 | ||
11 | obj-$(CONFIG_HAVE_PWM) += pwm.o | 11 | obj-$(CONFIG_HAVE_PWM) += pwm.o |
12 | obj-$(CONFIG_PXA_SSP) += ssp.o | ||
diff --git a/arch/arm/plat-pxa/include/plat/mfp.h b/arch/arm/plat-pxa/include/plat/mfp.h index 857a6839071c..9e604c80618f 100644 --- a/arch/arm/plat-pxa/include/plat/mfp.h +++ b/arch/arm/plat-pxa/include/plat/mfp.h | |||
@@ -316,6 +316,13 @@ enum { | |||
316 | MFP_PIN_PMIC_INT, | 316 | MFP_PIN_PMIC_INT, |
317 | MFP_PIN_RDY, | 317 | MFP_PIN_RDY, |
318 | 318 | ||
319 | /* additional pins on MMP2 */ | ||
320 | MFP_PIN_TWSI1_SCL, | ||
321 | MFP_PIN_TWSI1_SDA, | ||
322 | MFP_PIN_TWSI4_SCL, | ||
323 | MFP_PIN_TWSI4_SDA, | ||
324 | MFP_PIN_CLK_REQ, | ||
325 | |||
319 | MFP_PIN_MAX, | 326 | MFP_PIN_MAX, |
320 | }; | 327 | }; |
321 | 328 | ||
diff --git a/arch/arm/mach-pxa/include/mach/regs-ssp.h b/arch/arm/plat-pxa/include/plat/ssp.h index 6a2ed35acd59..fe43150690ed 100644 --- a/arch/arm/mach-pxa/include/mach/regs-ssp.h +++ b/arch/arm/plat-pxa/include/plat/ssp.h | |||
@@ -1,5 +1,26 @@ | |||
1 | #ifndef __ASM_ARCH_REGS_SSP_H | 1 | /* |
2 | #define __ASM_ARCH_REGS_SSP_H | 2 | * ssp.h |
3 | * | ||
4 | * Copyright (C) 2003 Russell King, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This driver supports the following PXA CPU/SSP ports:- | ||
11 | * | ||
12 | * PXA250 SSP | ||
13 | * PXA255 SSP, NSSP | ||
14 | * PXA26x SSP, NSSP, ASSP | ||
15 | * PXA27x SSP1, SSP2, SSP3 | ||
16 | * PXA3xx SSP1, SSP2, SSP3, SSP4 | ||
17 | */ | ||
18 | |||
19 | #ifndef __ASM_ARCH_SSP_H | ||
20 | #define __ASM_ARCH_SSP_H | ||
21 | |||
22 | #include <linux/list.h> | ||
23 | #include <linux/io.h> | ||
3 | 24 | ||
4 | /* | 25 | /* |
5 | * SSP Serial Port Registers | 26 | * SSP Serial Port Registers |
@@ -19,10 +40,7 @@ | |||
19 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ | 40 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ |
20 | #define SSTSS (0x38) /* SSP Timeslot Status */ | 41 | #define SSTSS (0x38) /* SSP Timeslot Status */ |
21 | #define SSACD (0x3C) /* SSP Audio Clock Divider */ | 42 | #define SSACD (0x3C) /* SSP Audio Clock Divider */ |
22 | |||
23 | #if defined(CONFIG_PXA3xx) | ||
24 | #define SSACDD (0x40) /* SSP Audio Clock Dither Divider */ | 43 | #define SSACDD (0x40) /* SSP Audio Clock Dither Divider */ |
25 | #endif | ||
26 | 44 | ||
27 | /* Common PXA2xx bits first */ | 45 | /* Common PXA2xx bits first */ |
28 | #define SSCR0_DSS (0x0000000f) /* Data Size Select (mask) */ | 46 | #define SSCR0_DSS (0x0000000f) /* Data Size Select (mask) */ |
@@ -33,29 +51,19 @@ | |||
33 | #define SSCR0_National (0x2 << 4) /* National Microwire */ | 51 | #define SSCR0_National (0x2 << 4) /* National Microwire */ |
34 | #define SSCR0_ECS (1 << 6) /* External clock select */ | 52 | #define SSCR0_ECS (1 << 6) /* External clock select */ |
35 | #define SSCR0_SSE (1 << 7) /* Synchronous Serial Port Enable */ | 53 | #define SSCR0_SSE (1 << 7) /* Synchronous Serial Port Enable */ |
54 | #define SSCR0_SCR(x) ((x) << 8) /* Serial Clock Rate (mask) */ | ||
36 | 55 | ||
37 | #if defined(CONFIG_PXA25x) | 56 | /* PXA27x, PXA3xx */ |
38 | #define SSCR0_SCR (0x0000ff00) /* Serial Clock Rate (mask) */ | ||
39 | #define SSCR0_SerClkDiv(x) ((((x) - 2)/2) << 8) /* Divisor [2..512] */ | ||
40 | #elif defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
41 | #define SSCR0_SCR (0x000fff00) /* Serial Clock Rate (mask) */ | ||
42 | #define SSCR0_SerClkDiv(x) (((x) - 1) << 8) /* Divisor [1..4096] */ | ||
43 | #endif | ||
44 | |||
45 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
46 | #define SSCR0_EDSS (1 << 20) /* Extended data size select */ | 57 | #define SSCR0_EDSS (1 << 20) /* Extended data size select */ |
47 | #define SSCR0_NCS (1 << 21) /* Network clock select */ | 58 | #define SSCR0_NCS (1 << 21) /* Network clock select */ |
48 | #define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ | 59 | #define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ |
49 | #define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ | 60 | #define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ |
50 | #define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ | 61 | #define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ |
51 | #define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */ | 62 | #define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */ |
63 | #define SSCR0_FPCKE (1 << 29) /* FIFO packing enable */ | ||
52 | #define SSCR0_ACS (1 << 30) /* Audio clock select */ | 64 | #define SSCR0_ACS (1 << 30) /* Audio clock select */ |
53 | #define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ | 65 | #define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ |
54 | #endif | ||
55 | 66 | ||
56 | #if defined(CONFIG_PXA3xx) | ||
57 | #define SSCR0_FPCKE (1 << 29) /* FIFO packing enable */ | ||
58 | #endif | ||
59 | 67 | ||
60 | #define SSCR1_RIE (1 << 0) /* Receive FIFO Interrupt Enable */ | 68 | #define SSCR1_RIE (1 << 0) /* Receive FIFO Interrupt Enable */ |
61 | #define SSCR1_TIE (1 << 1) /* Transmit FIFO Interrupt Enable */ | 69 | #define SSCR1_TIE (1 << 1) /* Transmit FIFO Interrupt Enable */ |
@@ -75,10 +83,6 @@ | |||
75 | #define SSSR_RFS (1 << 6) /* Receive FIFO Service Request */ | 83 | #define SSSR_RFS (1 << 6) /* Receive FIFO Service Request */ |
76 | #define SSSR_ROR (1 << 7) /* Receive FIFO Overrun */ | 84 | #define SSSR_ROR (1 << 7) /* Receive FIFO Overrun */ |
77 | 85 | ||
78 | #define SSCR0_TIM (1 << 23) /* Transmit FIFO Under Run Interrupt Mask */ | ||
79 | #define SSCR0_RIM (1 << 22) /* Receive FIFO Over Run interrupt Mask */ | ||
80 | #define SSCR0_NCS (1 << 21) /* Network Clock Select */ | ||
81 | #define SSCR0_EDSS (1 << 20) /* Extended Data Size Select */ | ||
82 | 86 | ||
83 | /* extra bits in PXA255, PXA26x and PXA27x SSP ports */ | 87 | /* extra bits in PXA255, PXA26x and PXA27x SSP ports */ |
84 | #define SSCR0_TISSP (1 << 4) /* TI Sync Serial Protocol */ | 88 | #define SSCR0_TISSP (1 << 4) /* TI Sync Serial Protocol */ |
@@ -108,27 +112,75 @@ | |||
108 | #define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ | 112 | #define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ |
109 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ | 113 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ |
110 | 114 | ||
111 | #if defined(CONFIG_PXA3xx) | ||
112 | #define SSPSP_EDMYSTOP(x) ((x) << 28) /* Extended Dummy Stop */ | ||
113 | #define SSPSP_EDMYSTRT(x) ((x) << 26) /* Extended Dummy Start */ | ||
114 | #endif | ||
115 | 115 | ||
116 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ | ||
117 | #define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */ | ||
118 | #define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */ | ||
119 | #define SSPSP_SFRMDLY(x) ((x) << 9) /* Serial Frame Delay */ | ||
120 | #define SSPSP_DMYSTRT(x) ((x) << 7) /* Dummy Start */ | ||
121 | #define SSPSP_STRTDLY(x) ((x) << 4) /* Start Delay */ | ||
122 | #define SSPSP_ETDS (1 << 3) /* End of Transfer data State */ | ||
123 | #define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */ | ||
124 | #define SSPSP_SCMODE(x) ((x) << 0) /* Serial Bit Rate Clock Mode */ | 116 | #define SSPSP_SCMODE(x) ((x) << 0) /* Serial Bit Rate Clock Mode */ |
117 | #define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */ | ||
118 | #define SSPSP_ETDS (1 << 3) /* End of Transfer data State */ | ||
119 | #define SSPSP_STRTDLY(x) ((x) << 4) /* Start Delay */ | ||
120 | #define SSPSP_DMYSTRT(x) ((x) << 7) /* Dummy Start */ | ||
121 | #define SSPSP_SFRMDLY(x) ((x) << 9) /* Serial Frame Delay */ | ||
122 | #define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */ | ||
123 | #define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */ | ||
124 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ | ||
125 | |||
126 | /* PXA3xx */ | ||
127 | #define SSPSP_EDMYSTRT(x) ((x) << 26) /* Extended Dummy Start */ | ||
128 | #define SSPSP_EDMYSTOP(x) ((x) << 28) /* Extended Dummy Stop */ | ||
129 | #define SSPSP_TIMING_MASK (0x7f8001f0) | ||
125 | 130 | ||
126 | #define SSACD_SCDB (1 << 3) /* SSPSYSCLK Divider Bypass */ | 131 | #define SSACD_SCDB (1 << 3) /* SSPSYSCLK Divider Bypass */ |
127 | #define SSACD_ACPS(x) ((x) << 4) /* Audio clock PLL select */ | 132 | #define SSACD_ACPS(x) ((x) << 4) /* Audio clock PLL select */ |
128 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ | 133 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ |
129 | #if defined(CONFIG_PXA3xx) | ||
130 | #define SSACD_SCDX8 (1 << 7) /* SYSCLK division ratio select */ | 134 | #define SSACD_SCDX8 (1 << 7) /* SYSCLK division ratio select */ |
131 | #endif | ||
132 | |||
133 | 135 | ||
134 | #endif /* __ASM_ARCH_REGS_SSP_H */ | 136 | enum pxa_ssp_type { |
137 | SSP_UNDEFINED = 0, | ||
138 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | ||
139 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | ||
140 | PXA27x_SSP, | ||
141 | PXA168_SSP, | ||
142 | }; | ||
143 | |||
144 | struct ssp_device { | ||
145 | struct platform_device *pdev; | ||
146 | struct list_head node; | ||
147 | |||
148 | struct clk *clk; | ||
149 | void __iomem *mmio_base; | ||
150 | unsigned long phys_base; | ||
151 | |||
152 | const char *label; | ||
153 | int port_id; | ||
154 | int type; | ||
155 | int use_count; | ||
156 | int irq; | ||
157 | int drcmr_rx; | ||
158 | int drcmr_tx; | ||
159 | }; | ||
160 | |||
161 | /** | ||
162 | * pxa_ssp_write_reg - Write to a SSP register | ||
163 | * | ||
164 | * @dev: SSP device to access | ||
165 | * @reg: Register to write to | ||
166 | * @val: Value to be written. | ||
167 | */ | ||
168 | static inline void pxa_ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val) | ||
169 | { | ||
170 | __raw_writel(val, dev->mmio_base + reg); | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * pxa_ssp_read_reg - Read from a SSP register | ||
175 | * | ||
176 | * @dev: SSP device to access | ||
177 | * @reg: Register to read from | ||
178 | */ | ||
179 | static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg) | ||
180 | { | ||
181 | return __raw_readl(dev->mmio_base + reg); | ||
182 | } | ||
183 | |||
184 | struct ssp_device *pxa_ssp_request(int port, const char *label); | ||
185 | void pxa_ssp_free(struct ssp_device *); | ||
186 | #endif /* __ASM_ARCH_SSP_H */ | ||
diff --git a/arch/arm/plat-pxa/mfp.c b/arch/arm/plat-pxa/mfp.c index be58f9fe65b0..b77e018d36c1 100644 --- a/arch/arm/plat-pxa/mfp.c +++ b/arch/arm/plat-pxa/mfp.c | |||
@@ -110,6 +110,7 @@ static const unsigned long mfpr_lpm[] = { | |||
110 | MFPR_LPM_PULL_LOW, | 110 | MFPR_LPM_PULL_LOW, |
111 | MFPR_LPM_PULL_HIGH, | 111 | MFPR_LPM_PULL_HIGH, |
112 | MFPR_LPM_FLOAT, | 112 | MFPR_LPM_FLOAT, |
113 | MFPR_LPM_INPUT, | ||
113 | }; | 114 | }; |
114 | 115 | ||
115 | /* mapping of MFP_PULL_* definitions to MFPR_PULL_* register bits */ | 116 | /* mapping of MFP_PULL_* definitions to MFPR_PULL_* register bits */ |
diff --git a/arch/arm/plat-pxa/pmu.c b/arch/arm/plat-pxa/pmu.c new file mode 100644 index 000000000000..267ceb6feb2f --- /dev/null +++ b/arch/arm/plat-pxa/pmu.c | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * PMU IRQ registration for the PXA xscale PMU families. | ||
3 | * Copyright (C) 2010 Will Deacon, ARM Ltd. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/platform_device.h> | ||
12 | #include <asm/pmu.h> | ||
13 | #include <mach/irqs.h> | ||
14 | |||
15 | static struct resource pmu_resource = { | ||
16 | .start = IRQ_PMU, | ||
17 | .end = IRQ_PMU, | ||
18 | .flags = IORESOURCE_IRQ, | ||
19 | }; | ||
20 | |||
21 | static struct platform_device pmu_device = { | ||
22 | .name = "arm-pmu", | ||
23 | .id = ARM_PMU_DEVICE_CPU, | ||
24 | .resource = &pmu_resource, | ||
25 | .num_resources = 1, | ||
26 | }; | ||
27 | |||
28 | static int __init pxa_pmu_init(void) | ||
29 | { | ||
30 | platform_device_register(&pmu_device); | ||
31 | return 0; | ||
32 | } | ||
33 | arch_initcall(pxa_pmu_init); | ||
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c new file mode 100644 index 000000000000..c6357e554aba --- /dev/null +++ b/arch/arm/plat-pxa/ssp.c | |||
@@ -0,0 +1,224 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/ssp.c | ||
3 | * | ||
4 | * based on linux/arch/arm/mach-sa1100/ssp.c by Russell King | ||
5 | * | ||
6 | * Copyright (C) 2003 Russell King. | ||
7 | * Copyright (C) 2003 Wolfson Microelectronics PLC | ||
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 | * PXA2xx SSP driver. This provides the generic core for simple | ||
14 | * IO-based SSP applications and allows easy port setup for DMA access. | ||
15 | * | ||
16 | * Author: Liam Girdwood <liam.girdwood@wolfsonmicro.com> | ||
17 | */ | ||
18 | |||
19 | #include <linux/module.h> | ||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/sched.h> | ||
22 | #include <linux/slab.h> | ||
23 | #include <linux/errno.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | #include <linux/ioport.h> | ||
26 | #include <linux/init.h> | ||
27 | #include <linux/mutex.h> | ||
28 | #include <linux/clk.h> | ||
29 | #include <linux/err.h> | ||
30 | #include <linux/platform_device.h> | ||
31 | #include <linux/io.h> | ||
32 | |||
33 | #include <asm/irq.h> | ||
34 | #include <mach/hardware.h> | ||
35 | #include <plat/ssp.h> | ||
36 | |||
37 | static DEFINE_MUTEX(ssp_lock); | ||
38 | static LIST_HEAD(ssp_list); | ||
39 | |||
40 | struct ssp_device *pxa_ssp_request(int port, const char *label) | ||
41 | { | ||
42 | struct ssp_device *ssp = NULL; | ||
43 | |||
44 | mutex_lock(&ssp_lock); | ||
45 | |||
46 | list_for_each_entry(ssp, &ssp_list, node) { | ||
47 | if (ssp->port_id == port && ssp->use_count == 0) { | ||
48 | ssp->use_count++; | ||
49 | ssp->label = label; | ||
50 | break; | ||
51 | } | ||
52 | } | ||
53 | |||
54 | mutex_unlock(&ssp_lock); | ||
55 | |||
56 | if (&ssp->node == &ssp_list) | ||
57 | return NULL; | ||
58 | |||
59 | return ssp; | ||
60 | } | ||
61 | EXPORT_SYMBOL(pxa_ssp_request); | ||
62 | |||
63 | void pxa_ssp_free(struct ssp_device *ssp) | ||
64 | { | ||
65 | mutex_lock(&ssp_lock); | ||
66 | if (ssp->use_count) { | ||
67 | ssp->use_count--; | ||
68 | ssp->label = NULL; | ||
69 | } else | ||
70 | dev_err(&ssp->pdev->dev, "device already free\n"); | ||
71 | mutex_unlock(&ssp_lock); | ||
72 | } | ||
73 | EXPORT_SYMBOL(pxa_ssp_free); | ||
74 | |||
75 | static int __devinit pxa_ssp_probe(struct platform_device *pdev) | ||
76 | { | ||
77 | const struct platform_device_id *id = platform_get_device_id(pdev); | ||
78 | struct resource *res; | ||
79 | struct ssp_device *ssp; | ||
80 | int ret = 0; | ||
81 | |||
82 | ssp = kzalloc(sizeof(struct ssp_device), GFP_KERNEL); | ||
83 | if (ssp == NULL) { | ||
84 | dev_err(&pdev->dev, "failed to allocate memory"); | ||
85 | return -ENOMEM; | ||
86 | } | ||
87 | ssp->pdev = pdev; | ||
88 | |||
89 | ssp->clk = clk_get(&pdev->dev, NULL); | ||
90 | if (IS_ERR(ssp->clk)) { | ||
91 | ret = PTR_ERR(ssp->clk); | ||
92 | goto err_free; | ||
93 | } | ||
94 | |||
95 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | ||
96 | if (res == NULL) { | ||
97 | dev_err(&pdev->dev, "no SSP RX DRCMR defined\n"); | ||
98 | ret = -ENODEV; | ||
99 | goto err_free_clk; | ||
100 | } | ||
101 | ssp->drcmr_rx = res->start; | ||
102 | |||
103 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); | ||
104 | if (res == NULL) { | ||
105 | dev_err(&pdev->dev, "no SSP TX DRCMR defined\n"); | ||
106 | ret = -ENODEV; | ||
107 | goto err_free_clk; | ||
108 | } | ||
109 | ssp->drcmr_tx = res->start; | ||
110 | |||
111 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
112 | if (res == NULL) { | ||
113 | dev_err(&pdev->dev, "no memory resource defined\n"); | ||
114 | ret = -ENODEV; | ||
115 | goto err_free_clk; | ||
116 | } | ||
117 | |||
118 | res = request_mem_region(res->start, resource_size(res), | ||
119 | pdev->name); | ||
120 | if (res == NULL) { | ||
121 | dev_err(&pdev->dev, "failed to request memory resource\n"); | ||
122 | ret = -EBUSY; | ||
123 | goto err_free_clk; | ||
124 | } | ||
125 | |||
126 | ssp->phys_base = res->start; | ||
127 | |||
128 | ssp->mmio_base = ioremap(res->start, resource_size(res)); | ||
129 | if (ssp->mmio_base == NULL) { | ||
130 | dev_err(&pdev->dev, "failed to ioremap() registers\n"); | ||
131 | ret = -ENODEV; | ||
132 | goto err_free_mem; | ||
133 | } | ||
134 | |||
135 | ssp->irq = platform_get_irq(pdev, 0); | ||
136 | if (ssp->irq < 0) { | ||
137 | dev_err(&pdev->dev, "no IRQ resource defined\n"); | ||
138 | ret = -ENODEV; | ||
139 | goto err_free_io; | ||
140 | } | ||
141 | |||
142 | /* PXA2xx/3xx SSP ports starts from 1 and the internal pdev->id | ||
143 | * starts from 0, do a translation here | ||
144 | */ | ||
145 | ssp->port_id = pdev->id + 1; | ||
146 | ssp->use_count = 0; | ||
147 | ssp->type = (int)id->driver_data; | ||
148 | |||
149 | mutex_lock(&ssp_lock); | ||
150 | list_add(&ssp->node, &ssp_list); | ||
151 | mutex_unlock(&ssp_lock); | ||
152 | |||
153 | platform_set_drvdata(pdev, ssp); | ||
154 | return 0; | ||
155 | |||
156 | err_free_io: | ||
157 | iounmap(ssp->mmio_base); | ||
158 | err_free_mem: | ||
159 | release_mem_region(res->start, resource_size(res)); | ||
160 | err_free_clk: | ||
161 | clk_put(ssp->clk); | ||
162 | err_free: | ||
163 | kfree(ssp); | ||
164 | return ret; | ||
165 | } | ||
166 | |||
167 | static int __devexit pxa_ssp_remove(struct platform_device *pdev) | ||
168 | { | ||
169 | struct resource *res; | ||
170 | struct ssp_device *ssp; | ||
171 | |||
172 | ssp = platform_get_drvdata(pdev); | ||
173 | if (ssp == NULL) | ||
174 | return -ENODEV; | ||
175 | |||
176 | iounmap(ssp->mmio_base); | ||
177 | |||
178 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
179 | release_mem_region(res->start, resource_size(res)); | ||
180 | |||
181 | clk_put(ssp->clk); | ||
182 | |||
183 | mutex_lock(&ssp_lock); | ||
184 | list_del(&ssp->node); | ||
185 | mutex_unlock(&ssp_lock); | ||
186 | |||
187 | kfree(ssp); | ||
188 | return 0; | ||
189 | } | ||
190 | |||
191 | static const struct platform_device_id ssp_id_table[] = { | ||
192 | { "pxa25x-ssp", PXA25x_SSP }, | ||
193 | { "pxa25x-nssp", PXA25x_NSSP }, | ||
194 | { "pxa27x-ssp", PXA27x_SSP }, | ||
195 | { "pxa168-ssp", PXA168_SSP }, | ||
196 | { }, | ||
197 | }; | ||
198 | |||
199 | static struct platform_driver pxa_ssp_driver = { | ||
200 | .probe = pxa_ssp_probe, | ||
201 | .remove = __devexit_p(pxa_ssp_remove), | ||
202 | .driver = { | ||
203 | .owner = THIS_MODULE, | ||
204 | .name = "pxa2xx-ssp", | ||
205 | }, | ||
206 | .id_table = ssp_id_table, | ||
207 | }; | ||
208 | |||
209 | static int __init pxa_ssp_init(void) | ||
210 | { | ||
211 | return platform_driver_register(&pxa_ssp_driver); | ||
212 | } | ||
213 | |||
214 | static void __exit pxa_ssp_exit(void) | ||
215 | { | ||
216 | platform_driver_unregister(&pxa_ssp_driver); | ||
217 | } | ||
218 | |||
219 | arch_initcall(pxa_ssp_init); | ||
220 | module_exit(pxa_ssp_exit); | ||
221 | |||
222 | MODULE_DESCRIPTION("PXA SSP driver"); | ||
223 | MODULE_AUTHOR("Liam Girdwood"); | ||
224 | MODULE_LICENSE("GPL"); | ||
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig index 6e93ef8f3d43..3ce8f010b3c6 100644 --- a/arch/arm/plat-s3c24xx/Kconfig +++ b/arch/arm/plat-s3c24xx/Kconfig | |||
@@ -9,6 +9,7 @@ config PLAT_S3C24XX | |||
9 | select NO_IOPORT | 9 | select NO_IOPORT |
10 | select ARCH_REQUIRE_GPIOLIB | 10 | select ARCH_REQUIRE_GPIOLIB |
11 | select S3C_DEVICE_NAND | 11 | select S3C_DEVICE_NAND |
12 | select S3C_GPIO_CFG_S3C24XX | ||
12 | help | 13 | help |
13 | Base platform code for any Samsung S3C24XX device | 14 | Base platform code for any Samsung S3C24XX device |
14 | 15 | ||
@@ -44,6 +45,12 @@ config S3C2410_CLOCK | |||
44 | Clock code for the S3C2410, and similar processors which | 45 | Clock code for the S3C2410, and similar processors which |
45 | is currently includes the S3C2410, S3C2440, S3C2442. | 46 | is currently includes the S3C2410, S3C2440, S3C2442. |
46 | 47 | ||
48 | config S3C2443_CLOCK | ||
49 | bool | ||
50 | help | ||
51 | Clock code for the S3C2443 and similar processors, which includes | ||
52 | the S3C2416 and S3C2450. | ||
53 | |||
47 | config S3C24XX_DCLK | 54 | config S3C24XX_DCLK |
48 | bool | 55 | bool |
49 | help | 56 | help |
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile index c2237c41141f..44aea8868f89 100644 --- a/arch/arm/plat-s3c24xx/Makefile +++ b/arch/arm/plat-s3c24xx/Makefile | |||
@@ -30,6 +30,7 @@ obj-$(CONFIG_PM) += pm.o | |||
30 | obj-$(CONFIG_PM) += irq-pm.o | 30 | obj-$(CONFIG_PM) += irq-pm.o |
31 | obj-$(CONFIG_PM) += sleep.o | 31 | obj-$(CONFIG_PM) += sleep.o |
32 | obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o | 32 | obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o |
33 | obj-$(CONFIG_S3C2443_CLOCK) += s3c2443-clock.o | ||
33 | obj-$(CONFIG_S3C2410_DMA) += dma.o | 34 | obj-$(CONFIG_S3C2410_DMA) += dma.o |
34 | obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o | 35 | obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o |
35 | obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o | 36 | obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o |
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c index 9e0e20ad2e46..7b44d0c592b5 100644 --- a/arch/arm/plat-s3c24xx/common-smdk.c +++ b/arch/arm/plat-s3c24xx/common-smdk.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <plat/nand.h> | 42 | #include <plat/nand.h> |
43 | 43 | ||
44 | #include <plat/common-smdk.h> | 44 | #include <plat/common-smdk.h> |
45 | #include <plat/gpio-cfg.h> | ||
45 | #include <plat/devs.h> | 46 | #include <plat/devs.h> |
46 | #include <plat/pm.h> | 47 | #include <plat/pm.h> |
47 | 48 | ||
@@ -185,10 +186,10 @@ void __init smdk_machine_init(void) | |||
185 | { | 186 | { |
186 | /* Configure the LEDs (even if we have no LED support)*/ | 187 | /* Configure the LEDs (even if we have no LED support)*/ |
187 | 188 | ||
188 | s3c2410_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); | 189 | s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); |
189 | s3c2410_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); | 190 | s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); |
190 | s3c2410_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); | 191 | s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); |
191 | s3c2410_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); | 192 | s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); |
192 | 193 | ||
193 | s3c2410_gpio_setpin(S3C2410_GPF(4), 1); | 194 | s3c2410_gpio_setpin(S3C2410_GPF(4), 1); |
194 | s3c2410_gpio_setpin(S3C2410_GPF(5), 1); | 195 | s3c2410_gpio_setpin(S3C2410_GPF(5), 1); |
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c index 9ca64df35bf6..76d0858c3cbb 100644 --- a/arch/arm/plat-s3c24xx/cpu.c +++ b/arch/arm/plat-s3c24xx/cpu.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <plat/s3c2400.h> | 49 | #include <plat/s3c2400.h> |
50 | #include <plat/s3c2410.h> | 50 | #include <plat/s3c2410.h> |
51 | #include <plat/s3c2412.h> | 51 | #include <plat/s3c2412.h> |
52 | #include <plat/s3c2416.h> | ||
52 | #include <plat/s3c244x.h> | 53 | #include <plat/s3c244x.h> |
53 | #include <plat/s3c2443.h> | 54 | #include <plat/s3c2443.h> |
54 | 55 | ||
@@ -57,6 +58,7 @@ | |||
57 | static const char name_s3c2400[] = "S3C2400"; | 58 | static const char name_s3c2400[] = "S3C2400"; |
58 | static const char name_s3c2410[] = "S3C2410"; | 59 | static const char name_s3c2410[] = "S3C2410"; |
59 | static const char name_s3c2412[] = "S3C2412"; | 60 | static const char name_s3c2412[] = "S3C2412"; |
61 | static const char name_s3c2416[] = "S3C2416/S3C2450"; | ||
60 | static const char name_s3c2440[] = "S3C2440"; | 62 | static const char name_s3c2440[] = "S3C2440"; |
61 | static const char name_s3c2442[] = "S3C2442"; | 63 | static const char name_s3c2442[] = "S3C2442"; |
62 | static const char name_s3c2442b[] = "S3C2442B"; | 64 | static const char name_s3c2442b[] = "S3C2442B"; |
@@ -137,6 +139,15 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
137 | .init = s3c2412_init, | 139 | .init = s3c2412_init, |
138 | .name = name_s3c2412, | 140 | .name = name_s3c2412, |
139 | }, | 141 | }, |
142 | { /* a strange version of the s3c2416 */ | ||
143 | .idcode = 0x32450003, | ||
144 | .idmask = 0xffffffff, | ||
145 | .map_io = s3c2416_map_io, | ||
146 | .init_clocks = s3c2416_init_clocks, | ||
147 | .init_uarts = s3c2416_init_uarts, | ||
148 | .init = s3c2416_init, | ||
149 | .name = name_s3c2416, | ||
150 | }, | ||
140 | { | 151 | { |
141 | .idcode = 0x32443001, | 152 | .idcode = 0x32443001, |
142 | .idmask = 0xffffffff, | 153 | .idmask = 0xffffffff, |
@@ -170,6 +181,16 @@ static struct map_desc s3c_iodesc[] __initdata = { | |||
170 | 181 | ||
171 | static unsigned long s3c24xx_read_idcode_v5(void) | 182 | static unsigned long s3c24xx_read_idcode_v5(void) |
172 | { | 183 | { |
184 | #if defined(CONFIG_CPU_S3C2416) | ||
185 | /* s3c2416 is v5, with S3C24XX_GSTATUS1 instead of S3C2412_GSTATUS1 */ | ||
186 | |||
187 | u32 gs = __raw_readl(S3C24XX_GSTATUS1); | ||
188 | |||
189 | /* test for s3c2416 or similar device */ | ||
190 | if ((gs >> 16) == 0x3245) | ||
191 | return gs; | ||
192 | #endif | ||
193 | |||
173 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) | 194 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) |
174 | return __raw_readl(S3C2412_GSTATUS1); | 195 | return __raw_readl(S3C2412_GSTATUS1); |
175 | #else | 196 | #else |
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index 5467470badfd..45126d3aafc6 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/gpio.c | 1 | /* linux/arch/arm/plat-s3c24xx/gpio.c |
2 | * | 2 | * |
3 | * Copyright (c) 2004-2005 Simtec Electronics | 3 | * Copyright (c) 2004-2010 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
5 | * | 5 | * |
6 | * S3C24XX GPIO support | 6 | * S3C24XX GPIO support |
@@ -20,12 +20,12 @@ | |||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | |||
24 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
25 | #include <linux/init.h> | 24 | #include <linux/init.h> |
26 | #include <linux/module.h> | 25 | #include <linux/module.h> |
27 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
28 | #include <linux/ioport.h> | 27 | #include <linux/ioport.h> |
28 | #include <linux/gpio.h> | ||
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | 30 | ||
31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
@@ -34,123 +34,34 @@ | |||
34 | 34 | ||
35 | #include <mach/regs-gpio.h> | 35 | #include <mach/regs-gpio.h> |
36 | 36 | ||
37 | void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function) | 37 | /* gpiolib wrappers until these are totally eliminated */ |
38 | { | ||
39 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | ||
40 | unsigned long mask; | ||
41 | unsigned long con; | ||
42 | unsigned long flags; | ||
43 | |||
44 | if (pin < S3C2410_GPIO_BANKB) { | ||
45 | mask = 1 << S3C2410_GPIO_OFFSET(pin); | ||
46 | } else { | ||
47 | mask = 3 << S3C2410_GPIO_OFFSET(pin)*2; | ||
48 | } | ||
49 | |||
50 | switch (function) { | ||
51 | case S3C2410_GPIO_LEAVE: | ||
52 | mask = 0; | ||
53 | function = 0; | ||
54 | break; | ||
55 | |||
56 | case S3C2410_GPIO_INPUT: | ||
57 | case S3C2410_GPIO_OUTPUT: | ||
58 | case S3C2410_GPIO_SFN2: | ||
59 | case S3C2410_GPIO_SFN3: | ||
60 | if (pin < S3C2410_GPIO_BANKB) { | ||
61 | function -= 1; | ||
62 | function &= 1; | ||
63 | function <<= S3C2410_GPIO_OFFSET(pin); | ||
64 | } else { | ||
65 | function &= 3; | ||
66 | function <<= S3C2410_GPIO_OFFSET(pin)*2; | ||
67 | } | ||
68 | } | ||
69 | |||
70 | /* modify the specified register wwith IRQs off */ | ||
71 | |||
72 | local_irq_save(flags); | ||
73 | |||
74 | con = __raw_readl(base + 0x00); | ||
75 | con &= ~mask; | ||
76 | con |= function; | ||
77 | |||
78 | __raw_writel(con, base + 0x00); | ||
79 | |||
80 | local_irq_restore(flags); | ||
81 | } | ||
82 | |||
83 | EXPORT_SYMBOL(s3c2410_gpio_cfgpin); | ||
84 | |||
85 | unsigned int s3c2410_gpio_getcfg(unsigned int pin) | ||
86 | { | ||
87 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | ||
88 | unsigned long val = __raw_readl(base); | ||
89 | |||
90 | if (pin < S3C2410_GPIO_BANKB) { | ||
91 | val >>= S3C2410_GPIO_OFFSET(pin); | ||
92 | val &= 1; | ||
93 | val += 1; | ||
94 | } else { | ||
95 | val >>= S3C2410_GPIO_OFFSET(pin)*2; | ||
96 | val &= 3; | ||
97 | } | ||
98 | |||
99 | return val | S3C2410_GPIO_INPUT; | ||
100 | } | ||
101 | |||
102 | EXPORT_SYMBOL(s3c2410_gpio_getcfg); | ||
103 | 38 | ||
104 | void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) | 39 | void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) |
105 | { | 40 | { |
106 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | 41 | int ret; |
107 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | ||
108 | unsigned long flags; | ||
109 | unsigned long up; | ||
110 | 42 | ||
111 | if (pin < S3C2410_GPIO_BANKB) | 43 | WARN_ON(to); /* should be none of these left */ |
112 | return; | ||
113 | 44 | ||
114 | local_irq_save(flags); | 45 | if (!to) { |
115 | 46 | /* if pull is enabled, try first with up, and if that | |
116 | up = __raw_readl(base + 0x08); | 47 | * fails, try using down */ |
117 | up &= ~(1L << offs); | ||
118 | up |= to << offs; | ||
119 | __raw_writel(up, base + 0x08); | ||
120 | 48 | ||
121 | local_irq_restore(flags); | 49 | ret = s3c_gpio_setpull(pin, S3C_GPIO_PULL_UP); |
50 | if (ret) | ||
51 | s3c_gpio_setpull(pin, S3C_GPIO_PULL_DOWN); | ||
52 | } else { | ||
53 | s3c_gpio_setpull(pin, S3C_GPIO_PULL_NONE); | ||
54 | } | ||
122 | } | 55 | } |
123 | |||
124 | EXPORT_SYMBOL(s3c2410_gpio_pullup); | 56 | EXPORT_SYMBOL(s3c2410_gpio_pullup); |
125 | 57 | ||
126 | int s3c2410_gpio_getpull(unsigned int pin) | ||
127 | { | ||
128 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | ||
129 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | ||
130 | |||
131 | if (pin < S3C2410_GPIO_BANKB) | ||
132 | return -EINVAL; | ||
133 | |||
134 | return (__raw_readl(base + 0x08) & (1L << offs)) ? 1 : 0; | ||
135 | } | ||
136 | |||
137 | EXPORT_SYMBOL(s3c2410_gpio_getpull); | ||
138 | |||
139 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) | 58 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) |
140 | { | 59 | { |
141 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | 60 | /* do this via gpiolib until all users removed */ |
142 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | ||
143 | unsigned long flags; | ||
144 | unsigned long dat; | ||
145 | |||
146 | local_irq_save(flags); | ||
147 | 61 | ||
148 | dat = __raw_readl(base + 0x04); | 62 | gpio_request(pin, "temporary"); |
149 | dat &= ~(1 << offs); | 63 | gpio_set_value(pin, to); |
150 | dat |= to << offs; | 64 | gpio_free(pin); |
151 | __raw_writel(dat, base + 0x04); | ||
152 | |||
153 | local_irq_restore(flags); | ||
154 | } | 65 | } |
155 | 66 | ||
156 | EXPORT_SYMBOL(s3c2410_gpio_setpin); | 67 | EXPORT_SYMBOL(s3c2410_gpio_setpin); |
@@ -181,22 +92,3 @@ unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change) | |||
181 | } | 92 | } |
182 | 93 | ||
183 | EXPORT_SYMBOL(s3c2410_modify_misccr); | 94 | EXPORT_SYMBOL(s3c2410_modify_misccr); |
184 | |||
185 | int s3c2410_gpio_getirq(unsigned int pin) | ||
186 | { | ||
187 | if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15)) | ||
188 | return -EINVAL; /* not valid interrupts */ | ||
189 | |||
190 | if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7)) | ||
191 | return -EINVAL; /* not valid pin */ | ||
192 | |||
193 | if (pin < S3C2410_GPF(4)) | ||
194 | return (pin - S3C2410_GPF(0)) + IRQ_EINT0; | ||
195 | |||
196 | if (pin < S3C2410_GPG(0)) | ||
197 | return (pin - S3C2410_GPF(4)) + IRQ_EINT4; | ||
198 | |||
199 | return (pin - S3C2410_GPG(0)) + IRQ_EINT8; | ||
200 | } | ||
201 | |||
202 | EXPORT_SYMBOL(s3c2410_gpio_getirq); | ||
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c index 4f0f11a6a677..4c0896f2572d 100644 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ b/arch/arm/plat-s3c24xx/gpiolib.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/gpiolib.c | 1 | /* linux/arch/arm/plat-s3c24xx/gpiolib.c |
2 | * | 2 | * |
3 | * Copyright (c) 2008 Simtec Electronics | 3 | * Copyright (c) 2008-2010 Simtec Electronics |
4 | * http://armlinux.simtec.co.uk/ | 4 | * http://armlinux.simtec.co.uk/ |
5 | * Ben Dooks <ben@simtec.co.uk> | 5 | * Ben Dooks <ben@simtec.co.uk> |
6 | * | 6 | * |
@@ -21,6 +21,8 @@ | |||
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | 22 | ||
23 | #include <plat/gpio-core.h> | 23 | #include <plat/gpio-core.h> |
24 | #include <plat/gpio-cfg.h> | ||
25 | #include <plat/gpio-cfg-helpers.h> | ||
24 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
25 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
26 | #include <plat/pm.h> | 28 | #include <plat/pm.h> |
@@ -77,10 +79,21 @@ static int s3c24xx_gpiolib_bankg_toirq(struct gpio_chip *chip, unsigned offset) | |||
77 | return IRQ_EINT8 + offset; | 79 | return IRQ_EINT8 + offset; |
78 | } | 80 | } |
79 | 81 | ||
82 | static struct s3c_gpio_cfg s3c24xx_gpiocfg_banka = { | ||
83 | .set_config = s3c_gpio_setcfg_s3c24xx_a, | ||
84 | .get_config = s3c_gpio_getcfg_s3c24xx_a, | ||
85 | }; | ||
86 | |||
87 | struct s3c_gpio_cfg s3c24xx_gpiocfg_default = { | ||
88 | .set_config = s3c_gpio_setcfg_s3c24xx, | ||
89 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
90 | }; | ||
91 | |||
80 | struct s3c_gpio_chip s3c24xx_gpios[] = { | 92 | struct s3c_gpio_chip s3c24xx_gpios[] = { |
81 | [0] = { | 93 | [0] = { |
82 | .base = S3C2410_GPACON, | 94 | .base = S3C2410_GPACON, |
83 | .pm = __gpio_pm(&s3c_gpio_pm_1bit), | 95 | .pm = __gpio_pm(&s3c_gpio_pm_1bit), |
96 | .config = &s3c24xx_gpiocfg_banka, | ||
84 | .chip = { | 97 | .chip = { |
85 | .base = S3C2410_GPA(0), | 98 | .base = S3C2410_GPA(0), |
86 | .owner = THIS_MODULE, | 99 | .owner = THIS_MODULE, |
@@ -161,15 +174,58 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { | |||
161 | .ngpio = 11, | 174 | .ngpio = 11, |
162 | }, | 175 | }, |
163 | }, | 176 | }, |
177 | /* GPIOS for the S3C2443 and later devices. */ | ||
178 | { | ||
179 | .base = S3C2440_GPJCON, | ||
180 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
181 | .chip = { | ||
182 | .base = S3C2410_GPJ(0), | ||
183 | .owner = THIS_MODULE, | ||
184 | .label = "GPIOJ", | ||
185 | .ngpio = 16, | ||
186 | }, | ||
187 | }, { | ||
188 | .base = S3C2443_GPKCON, | ||
189 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
190 | .chip = { | ||
191 | .base = S3C2410_GPK(0), | ||
192 | .owner = THIS_MODULE, | ||
193 | .label = "GPIOK", | ||
194 | .ngpio = 16, | ||
195 | }, | ||
196 | }, { | ||
197 | .base = S3C2443_GPLCON, | ||
198 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
199 | .chip = { | ||
200 | .base = S3C2410_GPL(0), | ||
201 | .owner = THIS_MODULE, | ||
202 | .label = "GPIOL", | ||
203 | .ngpio = 15, | ||
204 | }, | ||
205 | }, { | ||
206 | .base = S3C2443_GPMCON, | ||
207 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
208 | .chip = { | ||
209 | .base = S3C2410_GPM(0), | ||
210 | .owner = THIS_MODULE, | ||
211 | .label = "GPIOM", | ||
212 | .ngpio = 2, | ||
213 | }, | ||
214 | }, | ||
164 | }; | 215 | }; |
165 | 216 | ||
217 | |||
166 | static __init int s3c24xx_gpiolib_init(void) | 218 | static __init int s3c24xx_gpiolib_init(void) |
167 | { | 219 | { |
168 | struct s3c_gpio_chip *chip = s3c24xx_gpios; | 220 | struct s3c_gpio_chip *chip = s3c24xx_gpios; |
169 | int gpn; | 221 | int gpn; |
170 | 222 | ||
171 | for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) | 223 | for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) { |
224 | if (!chip->config) | ||
225 | chip->config = &s3c24xx_gpiocfg_default; | ||
226 | |||
172 | s3c_gpiolib_add(chip); | 227 | s3c_gpiolib_add(chip); |
228 | } | ||
173 | 229 | ||
174 | return 0; | 230 | return 0; |
175 | } | 231 | } |
diff --git a/arch/arm/plat-s3c24xx/include/plat/pll.h b/arch/arm/plat-s3c24xx/include/plat/pll.h index 7ea8bffa7a9c..005729a1077a 100644 --- a/arch/arm/plat-s3c24xx/include/plat/pll.h +++ b/arch/arm/plat-s3c24xx/include/plat/pll.h | |||
@@ -35,3 +35,28 @@ s3c24xx_get_pll(unsigned int pllval, unsigned int baseclk) | |||
35 | 35 | ||
36 | return (unsigned int)fvco; | 36 | return (unsigned int)fvco; |
37 | } | 37 | } |
38 | |||
39 | #define S3C2416_PLL_M_SHIFT (14) | ||
40 | #define S3C2416_PLL_P_SHIFT (5) | ||
41 | #define S3C2416_PLL_S_MASK (7) | ||
42 | #define S3C2416_PLL_M_MASK ((1 << 10) - 1) | ||
43 | #define S3C2416_PLL_P_MASK (63) | ||
44 | |||
45 | static inline unsigned int | ||
46 | s3c2416_get_pll(unsigned int pllval, unsigned int baseclk) | ||
47 | { | ||
48 | unsigned int m, p, s; | ||
49 | uint64_t fvco; | ||
50 | |||
51 | m = pllval >> S3C2416_PLL_M_SHIFT; | ||
52 | p = pllval >> S3C2416_PLL_P_SHIFT; | ||
53 | |||
54 | s = pllval & S3C2416_PLL_S_MASK; | ||
55 | m &= S3C2416_PLL_M_MASK; | ||
56 | p &= S3C2416_PLL_P_MASK; | ||
57 | |||
58 | fvco = (uint64_t)baseclk * m; | ||
59 | do_div(fvco, (p << s)); | ||
60 | |||
61 | return (unsigned int)fvco; | ||
62 | } | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2416.h b/arch/arm/plat-s3c24xx/include/plat/s3c2416.h new file mode 100644 index 000000000000..dc3c0907d221 --- /dev/null +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2416.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2443.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com> | ||
4 | * | ||
5 | * Header file for s3c2416 cpu support | ||
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 | #ifdef CONFIG_CPU_S3C2416 | ||
13 | |||
14 | struct s3c2410_uartcfg; | ||
15 | |||
16 | extern int s3c2416_init(void); | ||
17 | |||
18 | extern void s3c2416_map_io(void); | ||
19 | |||
20 | extern void s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
21 | |||
22 | extern void s3c2416_init_clocks(int xtal); | ||
23 | |||
24 | extern int s3c2416_baseclk_add(void); | ||
25 | |||
26 | #else | ||
27 | #define s3c2416_init_clocks NULL | ||
28 | #define s3c2416_init_uarts NULL | ||
29 | #define s3c2416_map_io NULL | ||
30 | #define s3c2416_init NULL | ||
31 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h b/arch/arm/plat-s3c24xx/include/plat/s3c2443.h index 815b107ed890..a19715feb798 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2443.h | |||
@@ -30,3 +30,22 @@ extern int s3c2443_baseclk_add(void); | |||
30 | #define s3c2443_map_io NULL | 30 | #define s3c2443_map_io NULL |
31 | #define s3c2443_init NULL | 31 | #define s3c2443_init NULL |
32 | #endif | 32 | #endif |
33 | |||
34 | /* common code used by s3c2443 and others. | ||
35 | * note, not to be used outside of arch/arm/mach-s3c* */ | ||
36 | |||
37 | struct clk; /* some files don't need clk.h otherwise */ | ||
38 | |||
39 | typedef unsigned int (*pll_fn)(unsigned int reg, unsigned int base); | ||
40 | typedef unsigned int (*fdiv_fn)(unsigned long clkcon0); | ||
41 | |||
42 | extern void s3c2443_common_setup_clocks(pll_fn get_mpll, fdiv_fn fdiv); | ||
43 | extern void s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, fdiv_fn fdiv); | ||
44 | |||
45 | extern int s3c2443_clkcon_enable_h(struct clk *clk, int enable); | ||
46 | extern int s3c2443_clkcon_enable_p(struct clk *clk, int enable); | ||
47 | extern int s3c2443_clkcon_enable_s(struct clk *clk, int enable); | ||
48 | |||
49 | extern struct clksrc_clk clk_epllref; | ||
50 | extern struct clksrc_clk clk_esysclk; | ||
51 | extern struct clksrc_clk clk_msysclk; | ||
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c index 3620dd299095..60627e63a254 100644 --- a/arch/arm/plat-s3c24xx/pm.c +++ b/arch/arm/plat-s3c24xx/pm.c | |||
@@ -43,6 +43,7 @@ | |||
43 | 43 | ||
44 | #include <asm/mach/time.h> | 44 | #include <asm/mach/time.h> |
45 | 45 | ||
46 | #include <plat/gpio-cfg.h> | ||
46 | #include <plat/pm.h> | 47 | #include <plat/pm.h> |
47 | 48 | ||
48 | #define PFX "s3c24xx-pm: " | 49 | #define PFX "s3c24xx-pm: " |
@@ -90,22 +91,22 @@ static void s3c_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs) | |||
90 | { | 91 | { |
91 | unsigned long irqstate; | 92 | unsigned long irqstate; |
92 | unsigned long pinstate; | 93 | unsigned long pinstate; |
93 | int irq = s3c2410_gpio_getirq(pin); | 94 | int irq = gpio_to_irq(pin); |
94 | 95 | ||
95 | if (irqoffs < 4) | 96 | if (irqoffs < 4) |
96 | irqstate = s3c_irqwake_intmask & (1L<<irqoffs); | 97 | irqstate = s3c_irqwake_intmask & (1L<<irqoffs); |
97 | else | 98 | else |
98 | irqstate = s3c_irqwake_eintmask & (1L<<irqoffs); | 99 | irqstate = s3c_irqwake_eintmask & (1L<<irqoffs); |
99 | 100 | ||
100 | pinstate = s3c2410_gpio_getcfg(pin); | 101 | pinstate = s3c_gpio_getcfg(pin); |
101 | 102 | ||
102 | if (!irqstate) { | 103 | if (!irqstate) { |
103 | if (pinstate == S3C2410_GPIO_IRQ) | 104 | if (pinstate == S3C2410_GPIO_IRQ) |
104 | S3C_PMDBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin); | 105 | S3C_PMDBG("Leaving IRQ %d (pin %d) as is\n", irq, pin); |
105 | } else { | 106 | } else { |
106 | if (pinstate == S3C2410_GPIO_IRQ) { | 107 | if (pinstate == S3C2410_GPIO_IRQ) { |
107 | S3C_PMDBG("Disabling IRQ %d (pin %d)\n", irq, pin); | 108 | S3C_PMDBG("Disabling IRQ %d (pin %d)\n", irq, pin); |
108 | s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT); | 109 | s3c_gpio_cfgpin(pin, S3C2410_GPIO_INPUT); |
109 | } | 110 | } |
110 | } | 111 | } |
111 | } | 112 | } |
diff --git a/arch/arm/plat-s3c24xx/s3c2410-clock.c b/arch/arm/plat-s3c24xx/s3c2410-clock.c index b61bdb793734..9ecc5d913679 100644 --- a/arch/arm/plat-s3c24xx/s3c2410-clock.c +++ b/arch/arm/plat-s3c24xx/s3c2410-clock.c | |||
@@ -87,7 +87,7 @@ static int s3c2410_upll_enable(struct clk *clk, int enable) | |||
87 | 87 | ||
88 | /* standard clock definitions */ | 88 | /* standard clock definitions */ |
89 | 89 | ||
90 | static struct clk init_clocks_disable[] = { | 90 | static struct clk init_clocks_off[] = { |
91 | { | 91 | { |
92 | .name = "nand", | 92 | .name = "nand", |
93 | .id = -1, | 93 | .id = -1, |
@@ -249,17 +249,8 @@ int __init s3c2410_baseclk_add(void) | |||
249 | 249 | ||
250 | /* install (and disable) the clocks we do not need immediately */ | 250 | /* install (and disable) the clocks we do not need immediately */ |
251 | 251 | ||
252 | clkp = init_clocks_disable; | 252 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
253 | for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { | 253 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
254 | |||
255 | ret = s3c24xx_register_clock(clkp); | ||
256 | if (ret < 0) { | ||
257 | printk(KERN_ERR "Failed to register clock %s (%d)\n", | ||
258 | clkp->name, ret); | ||
259 | } | ||
260 | |||
261 | s3c2410_clkcon_enable(clkp, 0); | ||
262 | } | ||
263 | 254 | ||
264 | /* show the clock-slow value */ | 255 | /* show the clock-slow value */ |
265 | 256 | ||
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c new file mode 100644 index 000000000000..461f070eb62d --- /dev/null +++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c | |||
@@ -0,0 +1,472 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/s3c2443-clock.c | ||
2 | * | ||
3 | * Copyright (c) 2007, 2010 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2443 Clock control suport - common code | ||
7 | */ | ||
8 | |||
9 | #include <linux/init.h> | ||
10 | #include <linux/clk.h> | ||
11 | #include <linux/io.h> | ||
12 | |||
13 | #include <mach/regs-s3c2443-clock.h> | ||
14 | |||
15 | #include <plat/s3c2443.h> | ||
16 | #include <plat/clock.h> | ||
17 | #include <plat/clock-clksrc.h> | ||
18 | #include <plat/cpu.h> | ||
19 | |||
20 | #include <plat/cpu-freq.h> | ||
21 | |||
22 | |||
23 | static int s3c2443_gate(void __iomem *reg, struct clk *clk, int enable) | ||
24 | { | ||
25 | u32 ctrlbit = clk->ctrlbit; | ||
26 | u32 con = __raw_readl(reg); | ||
27 | |||
28 | if (enable) | ||
29 | con |= ctrlbit; | ||
30 | else | ||
31 | con &= ~ctrlbit; | ||
32 | |||
33 | __raw_writel(con, reg); | ||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | int s3c2443_clkcon_enable_h(struct clk *clk, int enable) | ||
38 | { | ||
39 | return s3c2443_gate(S3C2443_HCLKCON, clk, enable); | ||
40 | } | ||
41 | |||
42 | int s3c2443_clkcon_enable_p(struct clk *clk, int enable) | ||
43 | { | ||
44 | return s3c2443_gate(S3C2443_PCLKCON, clk, enable); | ||
45 | } | ||
46 | |||
47 | int s3c2443_clkcon_enable_s(struct clk *clk, int enable) | ||
48 | { | ||
49 | return s3c2443_gate(S3C2443_SCLKCON, clk, enable); | ||
50 | } | ||
51 | |||
52 | /* mpllref is a direct descendant of clk_xtal by default, but it is not | ||
53 | * elided as the EPLL can be either sourced by the XTAL or EXTCLK and as | ||
54 | * such directly equating the two source clocks is impossible. | ||
55 | */ | ||
56 | struct clk clk_mpllref = { | ||
57 | .name = "mpllref", | ||
58 | .parent = &clk_xtal, | ||
59 | .id = -1, | ||
60 | }; | ||
61 | |||
62 | static struct clk *clk_epllref_sources[] = { | ||
63 | [0] = &clk_mpllref, | ||
64 | [1] = &clk_mpllref, | ||
65 | [2] = &clk_xtal, | ||
66 | [3] = &clk_ext, | ||
67 | }; | ||
68 | |||
69 | struct clksrc_clk clk_epllref = { | ||
70 | .clk = { | ||
71 | .name = "epllref", | ||
72 | .id = -1, | ||
73 | }, | ||
74 | .sources = &(struct clksrc_sources) { | ||
75 | .sources = clk_epllref_sources, | ||
76 | .nr_sources = ARRAY_SIZE(clk_epllref_sources), | ||
77 | }, | ||
78 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 7 }, | ||
79 | }; | ||
80 | |||
81 | /* esysclk | ||
82 | * | ||
83 | * this is sourced from either the EPLL or the EPLLref clock | ||
84 | */ | ||
85 | |||
86 | static struct clk *clk_sysclk_sources[] = { | ||
87 | [0] = &clk_epllref.clk, | ||
88 | [1] = &clk_epll, | ||
89 | }; | ||
90 | |||
91 | struct clksrc_clk clk_esysclk = { | ||
92 | .clk = { | ||
93 | .name = "esysclk", | ||
94 | .parent = &clk_epll, | ||
95 | .id = -1, | ||
96 | }, | ||
97 | .sources = &(struct clksrc_sources) { | ||
98 | .sources = clk_sysclk_sources, | ||
99 | .nr_sources = ARRAY_SIZE(clk_sysclk_sources), | ||
100 | }, | ||
101 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 6 }, | ||
102 | }; | ||
103 | |||
104 | static unsigned long s3c2443_getrate_mdivclk(struct clk *clk) | ||
105 | { | ||
106 | unsigned long parent_rate = clk_get_rate(clk->parent); | ||
107 | unsigned long div = __raw_readl(S3C2443_CLKDIV0); | ||
108 | |||
109 | div &= S3C2443_CLKDIV0_EXTDIV_MASK; | ||
110 | div >>= (S3C2443_CLKDIV0_EXTDIV_SHIFT-1); /* x2 */ | ||
111 | |||
112 | return parent_rate / (div + 1); | ||
113 | } | ||
114 | |||
115 | static struct clk clk_mdivclk = { | ||
116 | .name = "mdivclk", | ||
117 | .parent = &clk_mpllref, | ||
118 | .id = -1, | ||
119 | .ops = &(struct clk_ops) { | ||
120 | .get_rate = s3c2443_getrate_mdivclk, | ||
121 | }, | ||
122 | }; | ||
123 | |||
124 | static struct clk *clk_msysclk_sources[] = { | ||
125 | [0] = &clk_mpllref, | ||
126 | [1] = &clk_mpll, | ||
127 | [2] = &clk_mdivclk, | ||
128 | [3] = &clk_mpllref, | ||
129 | }; | ||
130 | |||
131 | struct clksrc_clk clk_msysclk = { | ||
132 | .clk = { | ||
133 | .name = "msysclk", | ||
134 | .parent = &clk_xtal, | ||
135 | .id = -1, | ||
136 | }, | ||
137 | .sources = &(struct clksrc_sources) { | ||
138 | .sources = clk_msysclk_sources, | ||
139 | .nr_sources = ARRAY_SIZE(clk_msysclk_sources), | ||
140 | }, | ||
141 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 3 }, | ||
142 | }; | ||
143 | |||
144 | /* prediv | ||
145 | * | ||
146 | * this divides the msysclk down to pass to h/p/etc. | ||
147 | */ | ||
148 | |||
149 | static unsigned long s3c2443_prediv_getrate(struct clk *clk) | ||
150 | { | ||
151 | unsigned long rate = clk_get_rate(clk->parent); | ||
152 | unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0); | ||
153 | |||
154 | clkdiv0 &= S3C2443_CLKDIV0_PREDIV_MASK; | ||
155 | clkdiv0 >>= S3C2443_CLKDIV0_PREDIV_SHIFT; | ||
156 | |||
157 | return rate / (clkdiv0 + 1); | ||
158 | } | ||
159 | |||
160 | static struct clk clk_prediv = { | ||
161 | .name = "prediv", | ||
162 | .id = -1, | ||
163 | .parent = &clk_msysclk.clk, | ||
164 | .ops = &(struct clk_ops) { | ||
165 | .get_rate = s3c2443_prediv_getrate, | ||
166 | }, | ||
167 | }; | ||
168 | |||
169 | /* usbhost | ||
170 | * | ||
171 | * usb host bus-clock, usually 48MHz to provide USB bus clock timing | ||
172 | */ | ||
173 | |||
174 | static struct clksrc_clk clk_usb_bus_host = { | ||
175 | .clk = { | ||
176 | .name = "usb-bus-host-parent", | ||
177 | .id = -1, | ||
178 | .parent = &clk_esysclk.clk, | ||
179 | .ctrlbit = S3C2443_SCLKCON_USBHOST, | ||
180 | .enable = s3c2443_clkcon_enable_s, | ||
181 | }, | ||
182 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 4 }, | ||
183 | }; | ||
184 | |||
185 | /* common clksrc clocks */ | ||
186 | |||
187 | static struct clksrc_clk clksrc_clks[] = { | ||
188 | { | ||
189 | /* ART baud-rate clock sourced from esysclk via a divisor */ | ||
190 | .clk = { | ||
191 | .name = "uartclk", | ||
192 | .id = -1, | ||
193 | .parent = &clk_esysclk.clk, | ||
194 | }, | ||
195 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 }, | ||
196 | }, { | ||
197 | /* camera interface bus-clock, divided down from esysclk */ | ||
198 | .clk = { | ||
199 | .name = "camif-upll", /* same as 2440 name */ | ||
200 | .id = -1, | ||
201 | .parent = &clk_esysclk.clk, | ||
202 | .ctrlbit = S3C2443_SCLKCON_CAMCLK, | ||
203 | .enable = s3c2443_clkcon_enable_s, | ||
204 | }, | ||
205 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 26 }, | ||
206 | }, { | ||
207 | .clk = { | ||
208 | .name = "display-if", | ||
209 | .id = -1, | ||
210 | .parent = &clk_esysclk.clk, | ||
211 | .ctrlbit = S3C2443_SCLKCON_DISPCLK, | ||
212 | .enable = s3c2443_clkcon_enable_s, | ||
213 | }, | ||
214 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 8, .shift = 16 }, | ||
215 | }, | ||
216 | }; | ||
217 | |||
218 | |||
219 | static struct clk init_clocks_off[] = { | ||
220 | { | ||
221 | .name = "adc", | ||
222 | .id = -1, | ||
223 | .parent = &clk_p, | ||
224 | .enable = s3c2443_clkcon_enable_p, | ||
225 | .ctrlbit = S3C2443_PCLKCON_ADC, | ||
226 | }, { | ||
227 | .name = "i2c", | ||
228 | .id = -1, | ||
229 | .parent = &clk_p, | ||
230 | .enable = s3c2443_clkcon_enable_p, | ||
231 | .ctrlbit = S3C2443_PCLKCON_IIC, | ||
232 | } | ||
233 | }; | ||
234 | |||
235 | static struct clk init_clocks[] = { | ||
236 | { | ||
237 | .name = "dma", | ||
238 | .id = 0, | ||
239 | .parent = &clk_h, | ||
240 | .enable = s3c2443_clkcon_enable_h, | ||
241 | .ctrlbit = S3C2443_HCLKCON_DMA0, | ||
242 | }, { | ||
243 | .name = "dma", | ||
244 | .id = 1, | ||
245 | .parent = &clk_h, | ||
246 | .enable = s3c2443_clkcon_enable_h, | ||
247 | .ctrlbit = S3C2443_HCLKCON_DMA1, | ||
248 | }, { | ||
249 | .name = "dma", | ||
250 | .id = 2, | ||
251 | .parent = &clk_h, | ||
252 | .enable = s3c2443_clkcon_enable_h, | ||
253 | .ctrlbit = S3C2443_HCLKCON_DMA2, | ||
254 | }, { | ||
255 | .name = "dma", | ||
256 | .id = 3, | ||
257 | .parent = &clk_h, | ||
258 | .enable = s3c2443_clkcon_enable_h, | ||
259 | .ctrlbit = S3C2443_HCLKCON_DMA3, | ||
260 | }, { | ||
261 | .name = "dma", | ||
262 | .id = 4, | ||
263 | .parent = &clk_h, | ||
264 | .enable = s3c2443_clkcon_enable_h, | ||
265 | .ctrlbit = S3C2443_HCLKCON_DMA4, | ||
266 | }, { | ||
267 | .name = "dma", | ||
268 | .id = 5, | ||
269 | .parent = &clk_h, | ||
270 | .enable = s3c2443_clkcon_enable_h, | ||
271 | .ctrlbit = S3C2443_HCLKCON_DMA5, | ||
272 | }, { | ||
273 | .name = "hsmmc", | ||
274 | .id = 0, | ||
275 | .parent = &clk_h, | ||
276 | .enable = s3c2443_clkcon_enable_h, | ||
277 | .ctrlbit = S3C2443_HCLKCON_HSMMC, | ||
278 | }, { | ||
279 | .name = "gpio", | ||
280 | .id = -1, | ||
281 | .parent = &clk_p, | ||
282 | .enable = s3c2443_clkcon_enable_p, | ||
283 | .ctrlbit = S3C2443_PCLKCON_GPIO, | ||
284 | }, { | ||
285 | .name = "usb-host", | ||
286 | .id = -1, | ||
287 | .parent = &clk_h, | ||
288 | .enable = s3c2443_clkcon_enable_h, | ||
289 | .ctrlbit = S3C2443_HCLKCON_USBH, | ||
290 | }, { | ||
291 | .name = "usb-device", | ||
292 | .id = -1, | ||
293 | .parent = &clk_h, | ||
294 | .enable = s3c2443_clkcon_enable_h, | ||
295 | .ctrlbit = S3C2443_HCLKCON_USBD, | ||
296 | }, { | ||
297 | .name = "lcd", | ||
298 | .id = -1, | ||
299 | .parent = &clk_h, | ||
300 | .enable = s3c2443_clkcon_enable_h, | ||
301 | .ctrlbit = S3C2443_HCLKCON_LCDC, | ||
302 | |||
303 | }, { | ||
304 | .name = "timers", | ||
305 | .id = -1, | ||
306 | .parent = &clk_p, | ||
307 | .enable = s3c2443_clkcon_enable_p, | ||
308 | .ctrlbit = S3C2443_PCLKCON_PWMT, | ||
309 | }, { | ||
310 | .name = "cfc", | ||
311 | .id = -1, | ||
312 | .parent = &clk_h, | ||
313 | .enable = s3c2443_clkcon_enable_h, | ||
314 | .ctrlbit = S3C2443_HCLKCON_CFC, | ||
315 | }, { | ||
316 | .name = "ssmc", | ||
317 | .id = -1, | ||
318 | .parent = &clk_h, | ||
319 | .enable = s3c2443_clkcon_enable_h, | ||
320 | .ctrlbit = S3C2443_HCLKCON_SSMC, | ||
321 | }, { | ||
322 | .name = "uart", | ||
323 | .id = 0, | ||
324 | .parent = &clk_p, | ||
325 | .enable = s3c2443_clkcon_enable_p, | ||
326 | .ctrlbit = S3C2443_PCLKCON_UART0, | ||
327 | }, { | ||
328 | .name = "uart", | ||
329 | .id = 1, | ||
330 | .parent = &clk_p, | ||
331 | .enable = s3c2443_clkcon_enable_p, | ||
332 | .ctrlbit = S3C2443_PCLKCON_UART1, | ||
333 | }, { | ||
334 | .name = "uart", | ||
335 | .id = 2, | ||
336 | .parent = &clk_p, | ||
337 | .enable = s3c2443_clkcon_enable_p, | ||
338 | .ctrlbit = S3C2443_PCLKCON_UART2, | ||
339 | }, { | ||
340 | .name = "uart", | ||
341 | .id = 3, | ||
342 | .parent = &clk_p, | ||
343 | .enable = s3c2443_clkcon_enable_p, | ||
344 | .ctrlbit = S3C2443_PCLKCON_UART3, | ||
345 | }, { | ||
346 | .name = "rtc", | ||
347 | .id = -1, | ||
348 | .parent = &clk_p, | ||
349 | .enable = s3c2443_clkcon_enable_p, | ||
350 | .ctrlbit = S3C2443_PCLKCON_RTC, | ||
351 | }, { | ||
352 | .name = "watchdog", | ||
353 | .id = -1, | ||
354 | .parent = &clk_p, | ||
355 | .ctrlbit = S3C2443_PCLKCON_WDT, | ||
356 | }, { | ||
357 | .name = "ac97", | ||
358 | .id = -1, | ||
359 | .parent = &clk_p, | ||
360 | .ctrlbit = S3C2443_PCLKCON_AC97, | ||
361 | }, { | ||
362 | .name = "nand", | ||
363 | .id = -1, | ||
364 | .parent = &clk_h, | ||
365 | }, { | ||
366 | .name = "usb-bus-host", | ||
367 | .id = -1, | ||
368 | .parent = &clk_usb_bus_host.clk, | ||
369 | } | ||
370 | }; | ||
371 | |||
372 | static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0) | ||
373 | { | ||
374 | clkcon0 &= S3C2443_CLKDIV0_HCLKDIV_MASK; | ||
375 | |||
376 | return clkcon0 + 1; | ||
377 | } | ||
378 | |||
379 | /* EPLLCON compatible enough to get on/off information */ | ||
380 | |||
381 | void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll, | ||
382 | fdiv_fn get_fdiv) | ||
383 | { | ||
384 | unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); | ||
385 | unsigned long mpllcon = __raw_readl(S3C2443_MPLLCON); | ||
386 | unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0); | ||
387 | struct clk *xtal_clk; | ||
388 | unsigned long xtal; | ||
389 | unsigned long pll; | ||
390 | unsigned long fclk; | ||
391 | unsigned long hclk; | ||
392 | unsigned long pclk; | ||
393 | int ptr; | ||
394 | |||
395 | xtal_clk = clk_get(NULL, "xtal"); | ||
396 | xtal = clk_get_rate(xtal_clk); | ||
397 | clk_put(xtal_clk); | ||
398 | |||
399 | pll = get_mpll(mpllcon, xtal); | ||
400 | clk_msysclk.clk.rate = pll; | ||
401 | |||
402 | fclk = pll / get_fdiv(clkdiv0); | ||
403 | hclk = s3c2443_prediv_getrate(&clk_prediv); | ||
404 | hclk /= s3c2443_get_hdiv(clkdiv0); | ||
405 | pclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 2 : 1); | ||
406 | |||
407 | s3c24xx_setup_clocks(fclk, hclk, pclk); | ||
408 | |||
409 | printk("CPU: MPLL %s %ld.%03ld MHz, cpu %ld.%03ld MHz, mem %ld.%03ld MHz, pclk %ld.%03ld MHz\n", | ||
410 | (mpllcon & S3C2443_PLLCON_OFF) ? "off":"on", | ||
411 | print_mhz(pll), print_mhz(fclk), | ||
412 | print_mhz(hclk), print_mhz(pclk)); | ||
413 | |||
414 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_clks); ptr++) | ||
415 | s3c_set_clksrc(&clksrc_clks[ptr], true); | ||
416 | |||
417 | /* ensure usb bus clock is within correct rate of 48MHz */ | ||
418 | |||
419 | if (clk_get_rate(&clk_usb_bus_host.clk) != (48 * 1000 * 1000)) { | ||
420 | printk(KERN_INFO "Warning: USB host bus not at 48MHz\n"); | ||
421 | clk_set_rate(&clk_usb_bus_host.clk, 48*1000*1000); | ||
422 | } | ||
423 | |||
424 | printk("CPU: EPLL %s %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n", | ||
425 | (epllcon & S3C2443_PLLCON_OFF) ? "off":"on", | ||
426 | print_mhz(clk_get_rate(&clk_epll)), | ||
427 | print_mhz(clk_get_rate(&clk_usb_bus))); | ||
428 | } | ||
429 | |||
430 | static struct clk *clks[] __initdata = { | ||
431 | &clk_prediv, | ||
432 | &clk_mpllref, | ||
433 | &clk_mdivclk, | ||
434 | &clk_ext, | ||
435 | &clk_epll, | ||
436 | &clk_usb_bus, | ||
437 | }; | ||
438 | |||
439 | static struct clksrc_clk *clksrcs[] __initdata = { | ||
440 | &clk_usb_bus_host, | ||
441 | &clk_epllref, | ||
442 | &clk_esysclk, | ||
443 | &clk_msysclk, | ||
444 | }; | ||
445 | |||
446 | void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, | ||
447 | fdiv_fn get_fdiv) | ||
448 | { | ||
449 | int ptr; | ||
450 | |||
451 | /* s3c2443 parents h and p clocks from prediv */ | ||
452 | clk_h.parent = &clk_prediv; | ||
453 | clk_p.parent = &clk_prediv; | ||
454 | |||
455 | clk_usb_bus.parent = &clk_usb_bus_host.clk; | ||
456 | clk_epll.parent = &clk_epllref.clk; | ||
457 | |||
458 | s3c24xx_register_baseclocks(xtal); | ||
459 | s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); | ||
460 | |||
461 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) | ||
462 | s3c_register_clksrc(clksrcs[ptr], 1); | ||
463 | |||
464 | s3c_register_clksrc(clksrc_clks, ARRAY_SIZE(clksrc_clks)); | ||
465 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | ||
466 | |||
467 | /* See s3c2443/etc notes on disabling clocks at init time */ | ||
468 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | ||
469 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | ||
470 | |||
471 | s3c2443_common_setup_clocks(get_mpll, get_fdiv); | ||
472 | } | ||
diff --git a/arch/arm/plat-s3c24xx/setup-i2c.c b/arch/arm/plat-s3c24xx/setup-i2c.c index 71a6accf114e..9e90a7cbd1d6 100644 --- a/arch/arm/plat-s3c24xx/setup-i2c.c +++ b/arch/arm/plat-s3c24xx/setup-i2c.c | |||
@@ -15,12 +15,13 @@ | |||
15 | 15 | ||
16 | struct platform_device; | 16 | struct platform_device; |
17 | 17 | ||
18 | #include <plat/gpio-cfg.h> | ||
18 | #include <plat/iic.h> | 19 | #include <plat/iic.h> |
19 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
20 | #include <mach/regs-gpio.h> | 21 | #include <mach/regs-gpio.h> |
21 | 22 | ||
22 | void s3c_i2c0_cfg_gpio(struct platform_device *dev) | 23 | void s3c_i2c0_cfg_gpio(struct platform_device *dev) |
23 | { | 24 | { |
24 | s3c2410_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPE15_IICSDA); | 25 | s3c_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPE15_IICSDA); |
25 | s3c2410_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPE14_IICSCL); | 26 | s3c_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPE14_IICSCL); |
26 | } | 27 | } |
diff --git a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c index da7a61728c18..9793544a6ace 100644 --- a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c +++ b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c | |||
@@ -21,16 +21,16 @@ void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi, | |||
21 | int enable) | 21 | int enable) |
22 | { | 22 | { |
23 | if (enable) { | 23 | if (enable) { |
24 | s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPE13_SPICLK0); | 24 | s3c_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPE13_SPICLK0); |
25 | s3c2410_gpio_cfgpin(S3C2410_GPE(12), S3C2410_GPE12_SPIMOSI0); | 25 | s3c_gpio_cfgpin(S3C2410_GPE(12), S3C2410_GPE12_SPIMOSI0); |
26 | s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPE11_SPIMISO0); | 26 | s3c_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPE11_SPIMISO0); |
27 | s3c2410_gpio_pullup(S3C2410_GPE(11), 0); | 27 | s3c2410_gpio_pullup(S3C2410_GPE(11), 0); |
28 | s3c2410_gpio_pullup(S3C2410_GPE(13), 0); | 28 | s3c2410_gpio_pullup(S3C2410_GPE(13), 0); |
29 | } else { | 29 | } else { |
30 | s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT); | 30 | s3c_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT); |
31 | s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT); | 31 | s3c_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT); |
32 | s3c2410_gpio_pullup(S3C2410_GPE(11), 1); | 32 | s3c_gpio_cfgpull(S3C2410_GPE(11), S3C_GPIO_PULL_NONE); |
33 | s3c2410_gpio_pullup(S3C2410_GPE(12), 1); | 33 | s3c_gpio_cfgpull(S3C2410_GPE(12), S3C_GPIO_PULL_NONE); |
34 | s3c2410_gpio_pullup(S3C2410_GPE(13), 1); | 34 | s3c_gpio_cfgpull(S3C2410_GPE(13), S3C_GPIO_PULL_NONE); |
35 | } | 35 | } |
36 | } | 36 | } |
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c index 89fcf5308cf6..db9e9e477ec1 100644 --- a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c +++ b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c | |||
@@ -23,16 +23,16 @@ void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi, | |||
23 | 23 | ||
24 | printk(KERN_INFO "%s(%d)\n", __func__, enable); | 24 | printk(KERN_INFO "%s(%d)\n", __func__, enable); |
25 | if (enable) { | 25 | if (enable) { |
26 | s3c2410_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1); | 26 | s3c_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1); |
27 | s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1); | 27 | s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1); |
28 | s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1); | 28 | s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1); |
29 | s3c2410_gpio_pullup(S3C2410_GPD(10), 0); | 29 | s3c2410_gpio_pullup(S3C2410_GPD(10), 0); |
30 | s3c2410_gpio_pullup(S3C2410_GPD(9), 0); | 30 | s3c2410_gpio_pullup(S3C2410_GPD(9), 0); |
31 | } else { | 31 | } else { |
32 | s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); | 32 | s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); |
33 | s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); | 33 | s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); |
34 | s3c2410_gpio_pullup(S3C2410_GPD(10), 1); | 34 | s3c_gpio_cfgpull(S3C2410_GPD(10), S3C_GPIO_PULL_NONE); |
35 | s3c2410_gpio_pullup(S3C2410_GPD(9), 1); | 35 | s3c_gpio_cfgpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE); |
36 | s3c2410_gpio_pullup(S3C2410_GPD(8), 1); | 36 | s3c_gpio_cfgpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE); |
37 | } | 37 | } |
38 | } | 38 | } |
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c index 86b9edc67413..8ea663a438bb 100644 --- a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c +++ b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c | |||
@@ -21,16 +21,16 @@ void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi, | |||
21 | int enable) | 21 | int enable) |
22 | { | 22 | { |
23 | if (enable) { | 23 | if (enable) { |
24 | s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1); | 24 | s3c_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1); |
25 | s3c2410_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1); | 25 | s3c_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1); |
26 | s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1); | 26 | s3c_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1); |
27 | s3c2410_gpio_pullup(S3C2410_GPG(5), 0); | 27 | s3c2410_gpio_pullup(S3C2410_GPG(5), 0); |
28 | s3c2410_gpio_pullup(S3C2410_GPG(6), 0); | 28 | s3c2410_gpio_pullup(S3C2410_GPG(6), 0); |
29 | } else { | 29 | } else { |
30 | s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT); | 30 | s3c_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT); |
31 | s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT); | 31 | s3c_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT); |
32 | s3c2410_gpio_pullup(S3C2410_GPG(5), 1); | 32 | s3c_gpio_cfgpull(S3C2410_GPG(5), S3C_GPIO_PULL_NONE); |
33 | s3c2410_gpio_pullup(S3C2410_GPG(6), 1); | 33 | s3c_gpio_cfgpull(S3C2410_GPG(6), S3C_GPIO_PULL_NONE); |
34 | s3c2410_gpio_pullup(S3C2410_GPG(7), 1); | 34 | s3c_gpio_cfgpull(S3C2410_GPG(7), S3C_GPIO_PULL_NONE); |
35 | } | 35 | } |
36 | } | 36 | } |
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 1b25c9d8c403..8bf79f3efdfb 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c | |||
@@ -376,6 +376,21 @@ void __init s3c_register_clocks(struct clk *clkp, int nr_clks) | |||
376 | } | 376 | } |
377 | } | 377 | } |
378 | 378 | ||
379 | /** | ||
380 | * s3c_disable_clocks() - disable an array of clocks | ||
381 | * @clkp: Pointer to the first clock in the array. | ||
382 | * @nr_clks: Number of clocks to register. | ||
383 | * | ||
384 | * for internal use only at initialisation time. disable the clocks in the | ||
385 | * @clkp array. | ||
386 | */ | ||
387 | |||
388 | void __init s3c_disable_clocks(struct clk *clkp, int nr_clks) | ||
389 | { | ||
390 | for (; nr_clks > 0; nr_clks--, clkp++) | ||
391 | (clkp->enable)(clkp, 0); | ||
392 | } | ||
393 | |||
379 | /* initalise all the clocks */ | 394 | /* initalise all the clocks */ |
380 | 395 | ||
381 | int __init s3c24xx_register_baseclocks(unsigned long xtal) | 396 | int __init s3c24xx_register_baseclocks(unsigned long xtal) |
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c index 44a84e896546..3282db360fa8 100644 --- a/arch/arm/plat-samsung/gpio-config.c +++ b/arch/arm/plat-samsung/gpio-config.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* linux/arch/arm/plat-s3c/gpio-config.c | 1 | /* linux/arch/arm/plat-s3c/gpio-config.c |
2 | * | 2 | * |
3 | * Copyright 2008 Openmoko, Inc. | 3 | * Copyright 2008 Openmoko, Inc. |
4 | * Copyright 2008 Simtec Electronics | 4 | * Copyright 2008-2010 Simtec Electronics |
5 | * Ben Dooks <ben@simtec.co.uk> | 5 | * Ben Dooks <ben@simtec.co.uk> |
6 | * http://armlinux.simtec.co.uk/ | 6 | * http://armlinux.simtec.co.uk/ |
7 | * | 7 | * |
@@ -41,6 +41,26 @@ int s3c_gpio_cfgpin(unsigned int pin, unsigned int config) | |||
41 | } | 41 | } |
42 | EXPORT_SYMBOL(s3c_gpio_cfgpin); | 42 | EXPORT_SYMBOL(s3c_gpio_cfgpin); |
43 | 43 | ||
44 | unsigned s3c_gpio_getcfg(unsigned int pin) | ||
45 | { | ||
46 | struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); | ||
47 | unsigned long flags; | ||
48 | unsigned ret = 0; | ||
49 | int offset; | ||
50 | |||
51 | if (chip) { | ||
52 | offset = pin - chip->chip.base; | ||
53 | |||
54 | local_irq_save(flags); | ||
55 | ret = s3c_gpio_do_getcfg(chip, offset); | ||
56 | local_irq_restore(flags); | ||
57 | } | ||
58 | |||
59 | return ret; | ||
60 | } | ||
61 | EXPORT_SYMBOL(s3c_gpio_getcfg); | ||
62 | |||
63 | |||
44 | int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull) | 64 | int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull) |
45 | { | 65 | { |
46 | struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); | 66 | struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); |
@@ -61,8 +81,8 @@ int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull) | |||
61 | EXPORT_SYMBOL(s3c_gpio_setpull); | 81 | EXPORT_SYMBOL(s3c_gpio_setpull); |
62 | 82 | ||
63 | #ifdef CONFIG_S3C_GPIO_CFG_S3C24XX | 83 | #ifdef CONFIG_S3C_GPIO_CFG_S3C24XX |
64 | int s3c_gpio_setcfg_s3c24xx_banka(struct s3c_gpio_chip *chip, | 84 | int s3c_gpio_setcfg_s3c24xx_a(struct s3c_gpio_chip *chip, |
65 | unsigned int off, unsigned int cfg) | 85 | unsigned int off, unsigned int cfg) |
66 | { | 86 | { |
67 | void __iomem *reg = chip->base; | 87 | void __iomem *reg = chip->base; |
68 | unsigned int shift = off; | 88 | unsigned int shift = off; |
@@ -87,6 +107,19 @@ int s3c_gpio_setcfg_s3c24xx_banka(struct s3c_gpio_chip *chip, | |||
87 | return 0; | 107 | return 0; |
88 | } | 108 | } |
89 | 109 | ||
110 | unsigned s3c_gpio_getcfg_s3c24xx_a(struct s3c_gpio_chip *chip, | ||
111 | unsigned int off) | ||
112 | { | ||
113 | u32 con; | ||
114 | |||
115 | con = __raw_readl(chip->base); | ||
116 | con >>= off; | ||
117 | con &= 1; | ||
118 | con++; | ||
119 | |||
120 | return S3C_GPIO_SFN(con); | ||
121 | } | ||
122 | |||
90 | int s3c_gpio_setcfg_s3c24xx(struct s3c_gpio_chip *chip, | 123 | int s3c_gpio_setcfg_s3c24xx(struct s3c_gpio_chip *chip, |
91 | unsigned int off, unsigned int cfg) | 124 | unsigned int off, unsigned int cfg) |
92 | { | 125 | { |
@@ -109,6 +142,19 @@ int s3c_gpio_setcfg_s3c24xx(struct s3c_gpio_chip *chip, | |||
109 | 142 | ||
110 | return 0; | 143 | return 0; |
111 | } | 144 | } |
145 | |||
146 | unsigned int s3c_gpio_getcfg_s3c24xx(struct s3c_gpio_chip *chip, | ||
147 | unsigned int off) | ||
148 | { | ||
149 | u32 con; | ||
150 | |||
151 | con = __raw_readl(chip->base); | ||
152 | con >>= off * 2; | ||
153 | con &= 3; | ||
154 | |||
155 | /* this conversion works for IN and OUT as well as special mode */ | ||
156 | return S3C_GPIO_SPECIAL(con); | ||
157 | } | ||
112 | #endif | 158 | #endif |
113 | 159 | ||
114 | #ifdef CONFIG_S3C_GPIO_CFG_S3C64XX | 160 | #ifdef CONFIG_S3C_GPIO_CFG_S3C64XX |
@@ -134,6 +180,25 @@ int s3c_gpio_setcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip, | |||
134 | 180 | ||
135 | return 0; | 181 | return 0; |
136 | } | 182 | } |
183 | |||
184 | unsigned s3c_gpio_getcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip, | ||
185 | unsigned int off) | ||
186 | { | ||
187 | void __iomem *reg = chip->base; | ||
188 | unsigned int shift = (off & 7) * 4; | ||
189 | u32 con; | ||
190 | |||
191 | if (off < 8 && chip->chip.ngpio > 8) | ||
192 | reg -= 4; | ||
193 | |||
194 | con = __raw_readl(reg); | ||
195 | con >>= shift; | ||
196 | con &= 0xf; | ||
197 | |||
198 | /* this conversion works for IN and OUT as well as special mode */ | ||
199 | return S3C_GPIO_SPECIAL(con); | ||
200 | } | ||
201 | |||
137 | #endif /* CONFIG_S3C_GPIO_CFG_S3C64XX */ | 202 | #endif /* CONFIG_S3C_GPIO_CFG_S3C64XX */ |
138 | 203 | ||
139 | #ifdef CONFIG_S3C_GPIO_PULL_UPDOWN | 204 | #ifdef CONFIG_S3C_GPIO_PULL_UPDOWN |
@@ -164,3 +229,35 @@ s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip, | |||
164 | return (__force s3c_gpio_pull_t)pup; | 229 | return (__force s3c_gpio_pull_t)pup; |
165 | } | 230 | } |
166 | #endif | 231 | #endif |
232 | |||
233 | #ifdef CONFIG_S3C_GPIO_PULL_UP | ||
234 | int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip, | ||
235 | unsigned int off, s3c_gpio_pull_t pull) | ||
236 | { | ||
237 | void __iomem *reg = chip->base + 0x08; | ||
238 | u32 pup = __raw_readl(reg); | ||
239 | |||
240 | pup = __raw_readl(reg); | ||
241 | |||
242 | if (pup == S3C_GPIO_PULL_UP) | ||
243 | pup &= ~(1 << off); | ||
244 | else if (pup == S3C_GPIO_PULL_NONE) | ||
245 | pup |= (1 << off); | ||
246 | else | ||
247 | return -EINVAL; | ||
248 | |||
249 | __raw_writel(pup, reg); | ||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip, | ||
254 | unsigned int off) | ||
255 | { | ||
256 | void __iomem *reg = chip->base + 0x08; | ||
257 | u32 pup = __raw_readl(reg); | ||
258 | |||
259 | pup &= (1 << off); | ||
260 | return pup ? S3C_GPIO_PULL_NONE : S3C_GPIO_PULL_UP; | ||
261 | } | ||
262 | #endif /* CONFIG_S3C_GPIO_PULL_UP */ | ||
263 | |||
diff --git a/arch/arm/plat-samsung/include/plat/clock.h b/arch/arm/plat-samsung/include/plat/clock.h index 60b62692ac7a..12caf48a6bdc 100644 --- a/arch/arm/plat-samsung/include/plat/clock.h +++ b/arch/arm/plat-samsung/include/plat/clock.h | |||
@@ -91,6 +91,7 @@ extern int s3c24xx_register_clock(struct clk *clk); | |||
91 | extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks); | 91 | extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks); |
92 | 92 | ||
93 | extern void s3c_register_clocks(struct clk *clk, int nr_clks); | 93 | extern void s3c_register_clocks(struct clk *clk, int nr_clks); |
94 | extern void s3c_disable_clocks(struct clk *clkp, int nr_clks); | ||
94 | 95 | ||
95 | extern int s3c24xx_register_baseclocks(unsigned long xtal); | 96 | extern int s3c24xx_register_baseclocks(unsigned long xtal); |
96 | 97 | ||
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index d316b4a579f4..5dbeb7991e60 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h | |||
@@ -73,6 +73,7 @@ extern struct sys_timer s3c24xx_timer; | |||
73 | extern struct sysdev_class s3c2410_sysclass; | 73 | extern struct sysdev_class s3c2410_sysclass; |
74 | extern struct sysdev_class s3c2410a_sysclass; | 74 | extern struct sysdev_class s3c2410a_sysclass; |
75 | extern struct sysdev_class s3c2412_sysclass; | 75 | extern struct sysdev_class s3c2412_sysclass; |
76 | extern struct sysdev_class s3c2416_sysclass; | ||
76 | extern struct sysdev_class s3c2440_sysclass; | 77 | extern struct sysdev_class s3c2440_sysclass; |
77 | extern struct sysdev_class s3c2442_sysclass; | 78 | extern struct sysdev_class s3c2442_sysclass; |
78 | extern struct sysdev_class s3c2443_sysclass; | 79 | extern struct sysdev_class s3c2443_sysclass; |
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h index dda19da037ad..3e21c75feefa 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h | |||
@@ -30,6 +30,12 @@ static inline int s3c_gpio_do_setcfg(struct s3c_gpio_chip *chip, | |||
30 | return (chip->config->set_config)(chip, off, config); | 30 | return (chip->config->set_config)(chip, off, config); |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline unsigned s3c_gpio_do_getcfg(struct s3c_gpio_chip *chip, | ||
34 | unsigned int off) | ||
35 | { | ||
36 | return (chip->config->get_config)(chip, off); | ||
37 | } | ||
38 | |||
33 | static inline int s3c_gpio_do_setpull(struct s3c_gpio_chip *chip, | 39 | static inline int s3c_gpio_do_setpull(struct s3c_gpio_chip *chip, |
34 | unsigned int off, s3c_gpio_pull_t pull) | 40 | unsigned int off, s3c_gpio_pull_t pull) |
35 | { | 41 | { |
@@ -53,6 +59,18 @@ extern int s3c_gpio_setcfg_s3c24xx(struct s3c_gpio_chip *chip, | |||
53 | unsigned int off, unsigned int cfg); | 59 | unsigned int off, unsigned int cfg); |
54 | 60 | ||
55 | /** | 61 | /** |
62 | * s3c_gpio_getcfg_s3c24xx - S3C24XX style GPIO configuration read. | ||
63 | * @chip: The gpio chip that is being configured. | ||
64 | * @off: The offset for the GPIO being configured. | ||
65 | * | ||
66 | * The reverse of s3c_gpio_setcfg_s3c24xx(). Will return a value whicg | ||
67 | * could be directly passed back to s3c_gpio_setcfg_s3c24xx(), from the | ||
68 | * S3C_GPIO_SPECIAL() macro. | ||
69 | */ | ||
70 | unsigned int s3c_gpio_getcfg_s3c24xx(struct s3c_gpio_chip *chip, | ||
71 | unsigned int off); | ||
72 | |||
73 | /** | ||
56 | * s3c_gpio_setcfg_s3c24xx_a - S3C24XX style GPIO configuration (Bank A) | 74 | * s3c_gpio_setcfg_s3c24xx_a - S3C24XX style GPIO configuration (Bank A) |
57 | * @chip: The gpio chip that is being configured. | 75 | * @chip: The gpio chip that is being configured. |
58 | * @off: The offset for the GPIO being configured. | 76 | * @off: The offset for the GPIO being configured. |
@@ -65,6 +83,21 @@ extern int s3c_gpio_setcfg_s3c24xx(struct s3c_gpio_chip *chip, | |||
65 | extern int s3c_gpio_setcfg_s3c24xx_a(struct s3c_gpio_chip *chip, | 83 | extern int s3c_gpio_setcfg_s3c24xx_a(struct s3c_gpio_chip *chip, |
66 | unsigned int off, unsigned int cfg); | 84 | unsigned int off, unsigned int cfg); |
67 | 85 | ||
86 | |||
87 | /** | ||
88 | * s3c_gpio_getcfg_s3c24xx_a - S3C24XX style GPIO configuration read (Bank A) | ||
89 | * @chip: The gpio chip that is being configured. | ||
90 | * @off: The offset for the GPIO being configured. | ||
91 | * | ||
92 | * The reverse of s3c_gpio_setcfg_s3c24xx_a() turning an GPIO into a usable | ||
93 | * GPIO configuration value. | ||
94 | * | ||
95 | * @sa s3c_gpio_getcfg_s3c24xx | ||
96 | * @sa s3c_gpio_getcfg_s3c64xx_4bit | ||
97 | */ | ||
98 | extern unsigned s3c_gpio_getcfg_s3c24xx_a(struct s3c_gpio_chip *chip, | ||
99 | unsigned int off); | ||
100 | |||
68 | /** | 101 | /** |
69 | * s3c_gpio_setcfg_s3c64xx_4bit - S3C64XX 4bit single register GPIO config. | 102 | * s3c_gpio_setcfg_s3c64xx_4bit - S3C64XX 4bit single register GPIO config. |
70 | * @chip: The gpio chip that is being configured. | 103 | * @chip: The gpio chip that is being configured. |
@@ -85,6 +118,20 @@ extern int s3c_gpio_setcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip, | |||
85 | unsigned int off, unsigned int cfg); | 118 | unsigned int off, unsigned int cfg); |
86 | 119 | ||
87 | 120 | ||
121 | /** | ||
122 | * s3c_gpio_getcfg_s3c64xx_4bit - S3C64XX 4bit single register GPIO config read. | ||
123 | * @chip: The gpio chip that is being configured. | ||
124 | * @off: The offset for the GPIO being configured. | ||
125 | * | ||
126 | * The reverse of s3c_gpio_setcfg_s3c64xx_4bit(), turning a gpio configuration | ||
127 | * register setting into a value the software can use, such as could be passed | ||
128 | * to s3c_gpio_setcfg_s3c64xx_4bit(). | ||
129 | * | ||
130 | * @sa s3c_gpio_getcfg_s3c24xx | ||
131 | */ | ||
132 | extern unsigned s3c_gpio_getcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip, | ||
133 | unsigned int off); | ||
134 | |||
88 | /* Pull-{up,down} resistor controls. | 135 | /* Pull-{up,down} resistor controls. |
89 | * | 136 | * |
90 | * S3C2410,S3C2440,S3C24A0 = Pull-UP, | 137 | * S3C2410,S3C2440,S3C24A0 = Pull-UP, |
@@ -146,6 +193,17 @@ extern s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip, | |||
146 | unsigned int off); | 193 | unsigned int off); |
147 | 194 | ||
148 | /** | 195 | /** |
196 | * s3c_gpio_getpull_1up() - Get configuration for choice of up or none | ||
197 | * @chip: The gpio chip that the GPIO pin belongs to | ||
198 | * @off: The offset to the pin to get the configuration of. | ||
199 | * | ||
200 | * This helper function reads the state of the pull-up resistor for the | ||
201 | * given GPIO in the same case as s3c_gpio_setpull_1up. | ||
202 | */ | ||
203 | extern s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip, | ||
204 | unsigned int off); | ||
205 | |||
206 | /** | ||
149 | * s3c_gpio_setpull_s3c2443() - Pull configuration for s3c2443. | 207 | * s3c_gpio_setpull_s3c2443() - Pull configuration for s3c2443. |
150 | * @chip: The gpio chip that is being configured. | 208 | * @chip: The gpio chip that is being configured. |
151 | * @off: The offset for the GPIO being configured. | 209 | * @off: The offset for the GPIO being configured. |
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h index 29cd6a86cade..8d01e853df39 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h | |||
@@ -77,6 +77,17 @@ struct s3c_gpio_cfg { | |||
77 | */ | 77 | */ |
78 | extern int s3c_gpio_cfgpin(unsigned int pin, unsigned int to); | 78 | extern int s3c_gpio_cfgpin(unsigned int pin, unsigned int to); |
79 | 79 | ||
80 | /** | ||
81 | * s3c_gpio_getcfg - Read the current function for a GPIO pin | ||
82 | * @pin: The pin to read the configuration value for. | ||
83 | * | ||
84 | * Read the configuration state of the given @pin, returning a value that | ||
85 | * could be passed back to s3c_gpio_cfgpin(). | ||
86 | * | ||
87 | * @sa s3c_gpio_cfgpin | ||
88 | */ | ||
89 | extern unsigned s3c_gpio_getcfg(unsigned int pin); | ||
90 | |||
80 | /* Define values for the pull-{up,down} available for each gpio pin. | 91 | /* Define values for the pull-{up,down} available for each gpio pin. |
81 | * | 92 | * |
82 | * These values control the state of the weak pull-{up,down} resistors | 93 | * These values control the state of the weak pull-{up,down} resistors |
diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h index 49ff406a7066..f0584f26d493 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-core.h +++ b/arch/arm/plat-samsung/include/plat/gpio-core.h | |||
@@ -108,6 +108,9 @@ extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip, | |||
108 | extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip); | 108 | extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip); |
109 | extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip); | 109 | extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip); |
110 | 110 | ||
111 | /* exported for core SoC support to change */ | ||
112 | extern struct s3c_gpio_cfg s3c24xx_gpiocfg_default; | ||
113 | |||
111 | #ifdef CONFIG_S3C_GPIO_TRACK | 114 | #ifdef CONFIG_S3C_GPIO_TRACK |
112 | extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; | 115 | extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; |
113 | 116 | ||
diff --git a/arch/arm/plat-samsung/include/plat/pll6553x.h b/arch/arm/plat-samsung/include/plat/pll6553x.h new file mode 100644 index 000000000000..b8b7e1d884f8 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/pll6553x.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/pll6553x.h | ||
2 | * partially from arch/arm/mach-s3c64xx/include/mach/pll.h | ||
3 | * | ||
4 | * Copyright 2008 Openmoko, Inc. | ||
5 | * Copyright 2008 Simtec Electronics | ||
6 | * Ben Dooks <ben@simtec.co.uk> | ||
7 | * http://armlinux.simtec.co.uk/ | ||
8 | * | ||
9 | * Samsung PLL6553x PLL code | ||
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 | /* S3C6400 and compatible (S3C2416, etc.) EPLL code */ | ||
17 | |||
18 | #define PLL6553X_MDIV_MASK ((1 << (23-16)) - 1) | ||
19 | #define PLL6553X_PDIV_MASK ((1 << (13-8)) - 1) | ||
20 | #define PLL6553X_SDIV_MASK ((1 << (2-0)) - 1) | ||
21 | #define PLL6553X_MDIV_SHIFT (16) | ||
22 | #define PLL6553X_PDIV_SHIFT (8) | ||
23 | #define PLL6553X_SDIV_SHIFT (0) | ||
24 | #define PLL6553X_KDIV_MASK (0xffff) | ||
25 | |||
26 | static inline unsigned long s3c_get_pll6553x(unsigned long baseclk, | ||
27 | u32 pll0, u32 pll1) | ||
28 | { | ||
29 | unsigned long result; | ||
30 | u32 mdiv, pdiv, sdiv, kdiv; | ||
31 | u64 tmp; | ||
32 | |||
33 | mdiv = (pll0 >> PLL6553X_MDIV_SHIFT) & PLL6553X_MDIV_MASK; | ||
34 | pdiv = (pll0 >> PLL6553X_PDIV_SHIFT) & PLL6553X_PDIV_MASK; | ||
35 | sdiv = (pll0 >> PLL6553X_SDIV_SHIFT) & PLL6553X_SDIV_MASK; | ||
36 | kdiv = pll1 & PLL6553X_KDIV_MASK; | ||
37 | |||
38 | /* We need to multiple baseclk by mdiv (the integer part) and kdiv | ||
39 | * which is in 2^16ths, so shift mdiv up (does not overflow) and | ||
40 | * add kdiv before multiplying. The use of tmp is to avoid any | ||
41 | * overflows before shifting bac down into result when multipling | ||
42 | * by the mdiv and kdiv pair. | ||
43 | */ | ||
44 | |||
45 | tmp = baseclk; | ||
46 | tmp *= (mdiv << 16) + kdiv; | ||
47 | do_div(tmp, (pdiv << sdiv)); | ||
48 | result = tmp >> 16; | ||
49 | |||
50 | return result; | ||
51 | } | ||
diff --git a/arch/arm/plat-spear/Kconfig b/arch/arm/plat-spear/Kconfig new file mode 100644 index 000000000000..1bb3dbce8810 --- /dev/null +++ b/arch/arm/plat-spear/Kconfig | |||
@@ -0,0 +1,31 @@ | |||
1 | # | ||
2 | # SPEAr Platform configuration file | ||
3 | # | ||
4 | |||
5 | if PLAT_SPEAR | ||
6 | |||
7 | choice | ||
8 | prompt "ST SPEAr Family" | ||
9 | default ARCH_SPEAR3XX | ||
10 | |||
11 | config ARCH_SPEAR3XX | ||
12 | bool "SPEAr3XX" | ||
13 | select ARM_VIC | ||
14 | select CPU_ARM926T | ||
15 | help | ||
16 | Supports for ARM's SPEAR3XX family | ||
17 | |||
18 | config ARCH_SPEAR6XX | ||
19 | bool "SPEAr6XX" | ||
20 | select ARM_VIC | ||
21 | select CPU_ARM926T | ||
22 | help | ||
23 | Supports for ARM's SPEAR6XX family | ||
24 | |||
25 | endchoice | ||
26 | |||
27 | # Adding SPEAr machine specific configuration files | ||
28 | source "arch/arm/mach-spear3xx/Kconfig" | ||
29 | source "arch/arm/mach-spear6xx/Kconfig" | ||
30 | |||
31 | endif | ||
diff --git a/arch/arm/plat-spear/Makefile b/arch/arm/plat-spear/Makefile new file mode 100644 index 000000000000..eb89540aeda9 --- /dev/null +++ b/arch/arm/plat-spear/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # | ||
2 | # SPEAr Platform specific Makefile | ||
3 | # | ||
4 | |||
5 | # Common support | ||
6 | obj-y := clock.o padmux.o time.o | ||
7 | |||
8 | obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o | ||
diff --git a/arch/arm/plat-spear/clock.c b/arch/arm/plat-spear/clock.c new file mode 100644 index 000000000000..ee4f90e534d8 --- /dev/null +++ b/arch/arm/plat-spear/clock.c | |||
@@ -0,0 +1,435 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/clock.c | ||
3 | * | ||
4 | * Clock framework for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/bug.h> | ||
15 | #include <linux/err.h> | ||
16 | #include <linux/io.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <mach/misc_regs.h> | ||
21 | #include <plat/clock.h> | ||
22 | |||
23 | static DEFINE_SPINLOCK(clocks_lock); | ||
24 | static LIST_HEAD(root_clks); | ||
25 | |||
26 | static void propagate_rate(struct list_head *); | ||
27 | |||
28 | static int generic_clk_enable(struct clk *clk) | ||
29 | { | ||
30 | unsigned int val; | ||
31 | |||
32 | if (!clk->en_reg) | ||
33 | return -EFAULT; | ||
34 | |||
35 | val = readl(clk->en_reg); | ||
36 | if (unlikely(clk->flags & RESET_TO_ENABLE)) | ||
37 | val &= ~(1 << clk->en_reg_bit); | ||
38 | else | ||
39 | val |= 1 << clk->en_reg_bit; | ||
40 | |||
41 | writel(val, clk->en_reg); | ||
42 | |||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | static void generic_clk_disable(struct clk *clk) | ||
47 | { | ||
48 | unsigned int val; | ||
49 | |||
50 | if (!clk->en_reg) | ||
51 | return; | ||
52 | |||
53 | val = readl(clk->en_reg); | ||
54 | if (unlikely(clk->flags & RESET_TO_ENABLE)) | ||
55 | val |= 1 << clk->en_reg_bit; | ||
56 | else | ||
57 | val &= ~(1 << clk->en_reg_bit); | ||
58 | |||
59 | writel(val, clk->en_reg); | ||
60 | } | ||
61 | |||
62 | /* generic clk ops */ | ||
63 | static struct clkops generic_clkops = { | ||
64 | .enable = generic_clk_enable, | ||
65 | .disable = generic_clk_disable, | ||
66 | }; | ||
67 | |||
68 | /* | ||
69 | * clk_enable - inform the system when the clock source should be running. | ||
70 | * @clk: clock source | ||
71 | * | ||
72 | * If the clock can not be enabled/disabled, this should return success. | ||
73 | * | ||
74 | * Returns success (0) or negative errno. | ||
75 | */ | ||
76 | int clk_enable(struct clk *clk) | ||
77 | { | ||
78 | unsigned long flags; | ||
79 | int ret = 0; | ||
80 | |||
81 | if (!clk || IS_ERR(clk)) | ||
82 | return -EFAULT; | ||
83 | |||
84 | spin_lock_irqsave(&clocks_lock, flags); | ||
85 | if (clk->usage_count == 0) { | ||
86 | if (clk->ops && clk->ops->enable) | ||
87 | ret = clk->ops->enable(clk); | ||
88 | } | ||
89 | clk->usage_count++; | ||
90 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
91 | |||
92 | return ret; | ||
93 | } | ||
94 | EXPORT_SYMBOL(clk_enable); | ||
95 | |||
96 | /* | ||
97 | * clk_disable - inform the system when the clock source is no longer required. | ||
98 | * @clk: clock source | ||
99 | * | ||
100 | * Inform the system that a clock source is no longer required by | ||
101 | * a driver and may be shut down. | ||
102 | * | ||
103 | * Implementation detail: if the clock source is shared between | ||
104 | * multiple drivers, clk_enable() calls must be balanced by the | ||
105 | * same number of clk_disable() calls for the clock source to be | ||
106 | * disabled. | ||
107 | */ | ||
108 | void clk_disable(struct clk *clk) | ||
109 | { | ||
110 | unsigned long flags; | ||
111 | |||
112 | if (!clk || IS_ERR(clk)) | ||
113 | return; | ||
114 | |||
115 | WARN_ON(clk->usage_count == 0); | ||
116 | |||
117 | spin_lock_irqsave(&clocks_lock, flags); | ||
118 | clk->usage_count--; | ||
119 | if (clk->usage_count == 0) { | ||
120 | if (clk->ops && clk->ops->disable) | ||
121 | clk->ops->disable(clk); | ||
122 | } | ||
123 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
124 | } | ||
125 | EXPORT_SYMBOL(clk_disable); | ||
126 | |||
127 | /** | ||
128 | * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. | ||
129 | * This is only valid once the clock source has been enabled. | ||
130 | * @clk: clock source | ||
131 | */ | ||
132 | unsigned long clk_get_rate(struct clk *clk) | ||
133 | { | ||
134 | unsigned long flags, rate; | ||
135 | |||
136 | spin_lock_irqsave(&clocks_lock, flags); | ||
137 | rate = clk->rate; | ||
138 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
139 | |||
140 | return rate; | ||
141 | } | ||
142 | EXPORT_SYMBOL(clk_get_rate); | ||
143 | |||
144 | /** | ||
145 | * clk_set_parent - set the parent clock source for this clock | ||
146 | * @clk: clock source | ||
147 | * @parent: parent clock source | ||
148 | * | ||
149 | * Returns success (0) or negative errno. | ||
150 | */ | ||
151 | int clk_set_parent(struct clk *clk, struct clk *parent) | ||
152 | { | ||
153 | int i, found = 0, val = 0; | ||
154 | unsigned long flags; | ||
155 | |||
156 | if (!clk || IS_ERR(clk) || !parent || IS_ERR(parent)) | ||
157 | return -EFAULT; | ||
158 | if (clk->usage_count) | ||
159 | return -EBUSY; | ||
160 | if (!clk->pclk_sel) | ||
161 | return -EPERM; | ||
162 | if (clk->pclk == parent) | ||
163 | return 0; | ||
164 | |||
165 | for (i = 0; i < clk->pclk_sel->pclk_count; i++) { | ||
166 | if (clk->pclk_sel->pclk_info[i].pclk == parent) { | ||
167 | found = 1; | ||
168 | break; | ||
169 | } | ||
170 | } | ||
171 | |||
172 | if (!found) | ||
173 | return -EINVAL; | ||
174 | |||
175 | spin_lock_irqsave(&clocks_lock, flags); | ||
176 | /* reflect parent change in hardware */ | ||
177 | val = readl(clk->pclk_sel->pclk_sel_reg); | ||
178 | val &= ~(clk->pclk_sel->pclk_sel_mask << clk->pclk_sel_shift); | ||
179 | val |= clk->pclk_sel->pclk_info[i].pclk_mask << clk->pclk_sel_shift; | ||
180 | writel(val, clk->pclk_sel->pclk_sel_reg); | ||
181 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
182 | |||
183 | /* reflect parent change in software */ | ||
184 | clk->recalc(clk); | ||
185 | propagate_rate(&clk->children); | ||
186 | return 0; | ||
187 | } | ||
188 | EXPORT_SYMBOL(clk_set_parent); | ||
189 | |||
190 | /* registers clock in platform clock framework */ | ||
191 | void clk_register(struct clk_lookup *cl) | ||
192 | { | ||
193 | struct clk *clk = cl->clk; | ||
194 | unsigned long flags; | ||
195 | |||
196 | if (!clk || IS_ERR(clk)) | ||
197 | return; | ||
198 | |||
199 | spin_lock_irqsave(&clocks_lock, flags); | ||
200 | |||
201 | INIT_LIST_HEAD(&clk->children); | ||
202 | if (clk->flags & ALWAYS_ENABLED) | ||
203 | clk->ops = NULL; | ||
204 | else if (!clk->ops) | ||
205 | clk->ops = &generic_clkops; | ||
206 | |||
207 | /* root clock don't have any parents */ | ||
208 | if (!clk->pclk && !clk->pclk_sel) { | ||
209 | list_add(&clk->sibling, &root_clks); | ||
210 | /* add clocks with only one parent to parent's children list */ | ||
211 | } else if (clk->pclk && !clk->pclk_sel) { | ||
212 | list_add(&clk->sibling, &clk->pclk->children); | ||
213 | } else { | ||
214 | /* add clocks with > 1 parent to 1st parent's children list */ | ||
215 | list_add(&clk->sibling, | ||
216 | &clk->pclk_sel->pclk_info[0].pclk->children); | ||
217 | } | ||
218 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
219 | |||
220 | /* add clock to arm clockdev framework */ | ||
221 | clkdev_add(cl); | ||
222 | } | ||
223 | |||
224 | /** | ||
225 | * propagate_rate - recalculate and propagate all clocks in list head | ||
226 | * | ||
227 | * Recalculates all root clocks in list head, which if the clock's .recalc is | ||
228 | * set correctly, should also propagate their rates. | ||
229 | */ | ||
230 | static void propagate_rate(struct list_head *lhead) | ||
231 | { | ||
232 | struct clk *clkp, *_temp; | ||
233 | |||
234 | list_for_each_entry_safe(clkp, _temp, lhead, sibling) { | ||
235 | if (clkp->recalc) | ||
236 | clkp->recalc(clkp); | ||
237 | propagate_rate(&clkp->children); | ||
238 | } | ||
239 | } | ||
240 | |||
241 | /* returns current programmed clocks clock info structure */ | ||
242 | static struct pclk_info *pclk_info_get(struct clk *clk) | ||
243 | { | ||
244 | unsigned int mask, i; | ||
245 | unsigned long flags; | ||
246 | struct pclk_info *info = NULL; | ||
247 | |||
248 | spin_lock_irqsave(&clocks_lock, flags); | ||
249 | mask = (readl(clk->pclk_sel->pclk_sel_reg) >> clk->pclk_sel_shift) | ||
250 | & clk->pclk_sel->pclk_sel_mask; | ||
251 | |||
252 | for (i = 0; i < clk->pclk_sel->pclk_count; i++) { | ||
253 | if (clk->pclk_sel->pclk_info[i].pclk_mask == mask) | ||
254 | info = &clk->pclk_sel->pclk_info[i]; | ||
255 | } | ||
256 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
257 | |||
258 | return info; | ||
259 | } | ||
260 | |||
261 | /* | ||
262 | * Set pclk as cclk's parent and add clock sibling node to current parents | ||
263 | * children list | ||
264 | */ | ||
265 | static void change_parent(struct clk *cclk, struct clk *pclk) | ||
266 | { | ||
267 | unsigned long flags; | ||
268 | |||
269 | spin_lock_irqsave(&clocks_lock, flags); | ||
270 | list_del(&cclk->sibling); | ||
271 | list_add(&cclk->sibling, &pclk->children); | ||
272 | |||
273 | cclk->pclk = pclk; | ||
274 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
275 | } | ||
276 | |||
277 | /* | ||
278 | * calculates current programmed rate of pll1 | ||
279 | * | ||
280 | * In normal mode | ||
281 | * rate = (2 * M[15:8] * Fin)/(N * 2^P) | ||
282 | * | ||
283 | * In Dithered mode | ||
284 | * rate = (2 * M[15:0] * Fin)/(256 * N * 2^P) | ||
285 | */ | ||
286 | void pll1_clk_recalc(struct clk *clk) | ||
287 | { | ||
288 | struct pll_clk_config *config = clk->private_data; | ||
289 | unsigned int num = 2, den = 0, val, mode = 0; | ||
290 | unsigned long flags; | ||
291 | |||
292 | spin_lock_irqsave(&clocks_lock, flags); | ||
293 | mode = (readl(config->mode_reg) >> PLL_MODE_SHIFT) & | ||
294 | PLL_MODE_MASK; | ||
295 | |||
296 | val = readl(config->cfg_reg); | ||
297 | /* calculate denominator */ | ||
298 | den = (val >> PLL_DIV_P_SHIFT) & PLL_DIV_P_MASK; | ||
299 | den = 1 << den; | ||
300 | den *= (val >> PLL_DIV_N_SHIFT) & PLL_DIV_N_MASK; | ||
301 | |||
302 | /* calculate numerator & denominator */ | ||
303 | if (!mode) { | ||
304 | /* Normal mode */ | ||
305 | num *= (val >> PLL_NORM_FDBK_M_SHIFT) & PLL_NORM_FDBK_M_MASK; | ||
306 | } else { | ||
307 | /* Dithered mode */ | ||
308 | num *= (val >> PLL_DITH_FDBK_M_SHIFT) & PLL_DITH_FDBK_M_MASK; | ||
309 | den *= 256; | ||
310 | } | ||
311 | |||
312 | clk->rate = (((clk->pclk->rate/10000) * num) / den) * 10000; | ||
313 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
314 | } | ||
315 | |||
316 | /* calculates current programmed rate of ahb or apb bus */ | ||
317 | void bus_clk_recalc(struct clk *clk) | ||
318 | { | ||
319 | struct bus_clk_config *config = clk->private_data; | ||
320 | unsigned int div; | ||
321 | unsigned long flags; | ||
322 | |||
323 | spin_lock_irqsave(&clocks_lock, flags); | ||
324 | div = ((readl(config->reg) >> config->shift) & config->mask) + 1; | ||
325 | clk->rate = (unsigned long)clk->pclk->rate / div; | ||
326 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
327 | } | ||
328 | |||
329 | /* | ||
330 | * calculates current programmed rate of auxiliary synthesizers | ||
331 | * used by: UART, FIRDA | ||
332 | * | ||
333 | * Fout from synthesizer can be given from two equations: | ||
334 | * Fout1 = (Fin * X/Y)/2 | ||
335 | * Fout2 = Fin * X/Y | ||
336 | * | ||
337 | * Selection of eqn 1 or 2 is programmed in register | ||
338 | */ | ||
339 | void aux_clk_recalc(struct clk *clk) | ||
340 | { | ||
341 | struct aux_clk_config *config = clk->private_data; | ||
342 | struct pclk_info *pclk_info = NULL; | ||
343 | unsigned int num = 1, den = 1, val, eqn; | ||
344 | unsigned long flags; | ||
345 | |||
346 | /* get current programmed parent */ | ||
347 | pclk_info = pclk_info_get(clk); | ||
348 | if (!pclk_info) { | ||
349 | spin_lock_irqsave(&clocks_lock, flags); | ||
350 | clk->pclk = NULL; | ||
351 | clk->rate = 0; | ||
352 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
353 | return; | ||
354 | } | ||
355 | |||
356 | change_parent(clk, pclk_info->pclk); | ||
357 | |||
358 | spin_lock_irqsave(&clocks_lock, flags); | ||
359 | if (pclk_info->scalable) { | ||
360 | val = readl(config->synth_reg); | ||
361 | |||
362 | eqn = (val >> AUX_EQ_SEL_SHIFT) & AUX_EQ_SEL_MASK; | ||
363 | if (eqn == AUX_EQ1_SEL) | ||
364 | den *= 2; | ||
365 | |||
366 | /* calculate numerator */ | ||
367 | num = (val >> AUX_XSCALE_SHIFT) & AUX_XSCALE_MASK; | ||
368 | |||
369 | /* calculate denominator */ | ||
370 | den *= (val >> AUX_YSCALE_SHIFT) & AUX_YSCALE_MASK; | ||
371 | val = (((clk->pclk->rate/10000) * num) / den) * 10000; | ||
372 | } else | ||
373 | val = clk->pclk->rate; | ||
374 | |||
375 | clk->rate = val; | ||
376 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
377 | } | ||
378 | |||
379 | /* | ||
380 | * calculates current programmed rate of gpt synthesizers | ||
381 | * Fout from synthesizer can be given from below equations: | ||
382 | * Fout= Fin/((2 ^ (N+1)) * (M+1)) | ||
383 | */ | ||
384 | void gpt_clk_recalc(struct clk *clk) | ||
385 | { | ||
386 | struct aux_clk_config *config = clk->private_data; | ||
387 | struct pclk_info *pclk_info = NULL; | ||
388 | unsigned int div = 1, val; | ||
389 | unsigned long flags; | ||
390 | |||
391 | pclk_info = pclk_info_get(clk); | ||
392 | if (!pclk_info) { | ||
393 | spin_lock_irqsave(&clocks_lock, flags); | ||
394 | clk->pclk = NULL; | ||
395 | clk->rate = 0; | ||
396 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
397 | return; | ||
398 | } | ||
399 | |||
400 | change_parent(clk, pclk_info->pclk); | ||
401 | |||
402 | spin_lock_irqsave(&clocks_lock, flags); | ||
403 | if (pclk_info->scalable) { | ||
404 | val = readl(config->synth_reg); | ||
405 | div += (val >> GPT_MSCALE_SHIFT) & GPT_MSCALE_MASK; | ||
406 | div *= 1 << (((val >> GPT_NSCALE_SHIFT) & GPT_NSCALE_MASK) + 1); | ||
407 | } | ||
408 | |||
409 | clk->rate = (unsigned long)clk->pclk->rate / div; | ||
410 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
411 | } | ||
412 | |||
413 | /* | ||
414 | * Used for clocks that always have same value as the parent clock divided by a | ||
415 | * fixed divisor | ||
416 | */ | ||
417 | void follow_parent(struct clk *clk) | ||
418 | { | ||
419 | unsigned long flags; | ||
420 | |||
421 | spin_lock_irqsave(&clocks_lock, flags); | ||
422 | clk->rate = clk->pclk->rate; | ||
423 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
424 | } | ||
425 | |||
426 | /** | ||
427 | * recalc_root_clocks - recalculate and propagate all root clocks | ||
428 | * | ||
429 | * Recalculates all root clocks (clocks with no parent), which if the | ||
430 | * clock's .recalc is set correctly, should also propagate their rates. | ||
431 | */ | ||
432 | void recalc_root_clocks(void) | ||
433 | { | ||
434 | propagate_rate(&root_clks); | ||
435 | } | ||
diff --git a/arch/arm/plat-spear/include/plat/clkdev.h b/arch/arm/plat-spear/include/plat/clkdev.h new file mode 100644 index 000000000000..a2d0112fcaf7 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/clkdev.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/clkdev.h | ||
3 | * | ||
4 | * Clock Dev framework definitions for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_CLKDEV_H | ||
15 | #define __PLAT_CLKDEV_H | ||
16 | |||
17 | #define __clk_get(clk) ({ 1; }) | ||
18 | #define __clk_put(clk) do { } while (0) | ||
19 | |||
20 | #endif /* __PLAT_CLKDEV_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/clock.h b/arch/arm/plat-spear/include/plat/clock.h new file mode 100644 index 000000000000..298bafc0a52f --- /dev/null +++ b/arch/arm/plat-spear/include/plat/clock.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/clock.h | ||
3 | * | ||
4 | * Clock framework definitions for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_CLOCK_H | ||
15 | #define __PLAT_CLOCK_H | ||
16 | |||
17 | #include <linux/list.h> | ||
18 | #include <asm/clkdev.h> | ||
19 | #include <linux/types.h> | ||
20 | |||
21 | /* clk structure flags */ | ||
22 | #define ALWAYS_ENABLED (1 << 0) /* clock always enabled */ | ||
23 | #define RESET_TO_ENABLE (1 << 1) /* reset register bit to enable clk */ | ||
24 | |||
25 | /** | ||
26 | * struct clkops - clock operations | ||
27 | * @enable: pointer to clock enable function | ||
28 | * @disable: pointer to clock disable function | ||
29 | */ | ||
30 | struct clkops { | ||
31 | int (*enable) (struct clk *); | ||
32 | void (*disable) (struct clk *); | ||
33 | }; | ||
34 | |||
35 | /** | ||
36 | * struct pclk_info - parents info | ||
37 | * @pclk: pointer to parent clk | ||
38 | * @pclk_mask: value to be written for selecting this parent | ||
39 | * @scalable: Is parent scalable (1 - YES, 0 - NO) | ||
40 | */ | ||
41 | struct pclk_info { | ||
42 | struct clk *pclk; | ||
43 | u8 pclk_mask; | ||
44 | u8 scalable; | ||
45 | }; | ||
46 | |||
47 | /** | ||
48 | * struct pclk_sel - parents selection configuration | ||
49 | * @pclk_info: pointer to array of parent clock info | ||
50 | * @pclk_count: number of parents | ||
51 | * @pclk_sel_reg: register for selecting a parent | ||
52 | * @pclk_sel_mask: mask for selecting parent (can be used to clear bits also) | ||
53 | */ | ||
54 | struct pclk_sel { | ||
55 | struct pclk_info *pclk_info; | ||
56 | u8 pclk_count; | ||
57 | unsigned int *pclk_sel_reg; | ||
58 | unsigned int pclk_sel_mask; | ||
59 | }; | ||
60 | |||
61 | /** | ||
62 | * struct clk - clock structure | ||
63 | * @usage_count: num of users who enabled this clock | ||
64 | * @flags: flags for clock properties | ||
65 | * @rate: programmed clock rate in Hz | ||
66 | * @en_reg: clk enable/disable reg | ||
67 | * @en_reg_bit: clk enable/disable bit | ||
68 | * @ops: clk enable/disable ops - generic_clkops selected if NULL | ||
69 | * @recalc: pointer to clock rate recalculate function | ||
70 | * @pclk: current parent clk | ||
71 | * @pclk_sel: pointer to parent selection structure | ||
72 | * @pclk_sel_shift: register shift for selecting parent of this clock | ||
73 | * @children: list for childrens or this clock | ||
74 | * @sibling: node for list of clocks having same parents | ||
75 | * @private_data: clock specific private data | ||
76 | */ | ||
77 | struct clk { | ||
78 | unsigned int usage_count; | ||
79 | unsigned int flags; | ||
80 | unsigned long rate; | ||
81 | unsigned int *en_reg; | ||
82 | u8 en_reg_bit; | ||
83 | const struct clkops *ops; | ||
84 | void (*recalc) (struct clk *); | ||
85 | |||
86 | struct clk *pclk; | ||
87 | struct pclk_sel *pclk_sel; | ||
88 | unsigned int pclk_sel_shift; | ||
89 | |||
90 | struct list_head children; | ||
91 | struct list_head sibling; | ||
92 | void *private_data; | ||
93 | }; | ||
94 | |||
95 | /* pll configuration structure */ | ||
96 | struct pll_clk_config { | ||
97 | unsigned int *mode_reg; | ||
98 | unsigned int *cfg_reg; | ||
99 | }; | ||
100 | |||
101 | /* ahb and apb bus configuration structure */ | ||
102 | struct bus_clk_config { | ||
103 | unsigned int *reg; | ||
104 | unsigned int mask; | ||
105 | unsigned int shift; | ||
106 | }; | ||
107 | |||
108 | /* | ||
109 | * Aux clk configuration structure: applicable to GPT, UART and FIRDA | ||
110 | */ | ||
111 | struct aux_clk_config { | ||
112 | unsigned int *synth_reg; | ||
113 | }; | ||
114 | |||
115 | /* platform specific clock functions */ | ||
116 | void clk_register(struct clk_lookup *cl); | ||
117 | void recalc_root_clocks(void); | ||
118 | |||
119 | /* clock recalc functions */ | ||
120 | void follow_parent(struct clk *clk); | ||
121 | void pll1_clk_recalc(struct clk *clk); | ||
122 | void bus_clk_recalc(struct clk *clk); | ||
123 | void gpt_clk_recalc(struct clk *clk); | ||
124 | void aux_clk_recalc(struct clk *clk); | ||
125 | |||
126 | #endif /* __PLAT_CLOCK_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S new file mode 100644 index 000000000000..1670734b7e51 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/debug-macro.S | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/debug-macro.S | ||
3 | * | ||
4 | * Debugging macro include header for spear platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/amba/serial.h> | ||
15 | #include <mach/spear.h> | ||
16 | |||
17 | .macro addruart, rx | ||
18 | mrc p15, 0, \rx, c1, c0 | ||
19 | tst \rx, #1 @ MMU enabled? | ||
20 | moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base | ||
21 | movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base | ||
22 | .endm | ||
23 | |||
24 | .macro senduart, rd, rx | ||
25 | strb \rd, [\rx, #UART01x_DR] @ ASC_TX_BUFFER | ||
26 | .endm | ||
27 | |||
28 | .macro waituart, rd, rx | ||
29 | 1001: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER | ||
30 | tst \rd, #UART01x_FR_TXFF @ TX_FULL | ||
31 | bne 1001b | ||
32 | .endm | ||
33 | |||
34 | .macro busyuart, rd, rx | ||
35 | 1002: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER | ||
36 | tst \rd, #UART011_FR_TXFE @ TX_EMPTY | ||
37 | beq 1002b | ||
38 | .endm | ||
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h new file mode 100644 index 000000000000..b857c91257dd --- /dev/null +++ b/arch/arm/plat-spear/include/plat/gpio.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/gpio.h | ||
3 | * | ||
4 | * GPIO macros for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_GPIO_H | ||
15 | #define __PLAT_GPIO_H | ||
16 | |||
17 | #include <asm-generic/gpio.h> | ||
18 | |||
19 | #define gpio_get_value __gpio_get_value | ||
20 | #define gpio_set_value __gpio_set_value | ||
21 | #define gpio_cansleep __gpio_cansleep | ||
22 | #define gpio_to_irq __gpio_to_irq | ||
23 | |||
24 | #endif /* __PLAT_GPIO_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/io.h b/arch/arm/plat-spear/include/plat/io.h new file mode 100644 index 000000000000..4d4ba822b3eb --- /dev/null +++ b/arch/arm/plat-spear/include/plat/io.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/io.h | ||
3 | * | ||
4 | * IO definitions for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_IO_H | ||
15 | #define __PLAT_IO_H | ||
16 | |||
17 | #define IO_SPACE_LIMIT 0xFFFFFFFF | ||
18 | |||
19 | #define __io(a) __typesafe_io(a) | ||
20 | #define __mem_pci(a) (a) | ||
21 | |||
22 | #endif /* __PLAT_IO_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/memory.h b/arch/arm/plat-spear/include/plat/memory.h new file mode 100644 index 000000000000..27a4aba77343 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/memory.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/memory.h | ||
3 | * | ||
4 | * Memory map for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_MEMORY_H | ||
15 | #define __PLAT_MEMORY_H | ||
16 | |||
17 | /* Physical DRAM offset */ | ||
18 | #define PHYS_OFFSET UL(0x00000000) | ||
19 | |||
20 | #endif /* __PLAT_MEMORY_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/padmux.h b/arch/arm/plat-spear/include/plat/padmux.h new file mode 100644 index 000000000000..877f3adcf610 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/padmux.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/padmux.h | ||
3 | * | ||
4 | * SPEAr platform specific gpio pads muxing file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_PADMUX_H | ||
15 | #define __PLAT_PADMUX_H | ||
16 | |||
17 | #include <linux/types.h> | ||
18 | |||
19 | /* | ||
20 | * struct pmx_reg: configuration structure for mode reg and mux reg | ||
21 | * | ||
22 | * offset: offset of mode reg | ||
23 | * mask: mask of mode reg | ||
24 | */ | ||
25 | struct pmx_reg { | ||
26 | u32 offset; | ||
27 | u32 mask; | ||
28 | }; | ||
29 | |||
30 | /* | ||
31 | * struct pmx_dev_mode: configuration structure every group of modes of a device | ||
32 | * | ||
33 | * ids: all modes for this configuration | ||
34 | * mask: mask for supported mode | ||
35 | */ | ||
36 | struct pmx_dev_mode { | ||
37 | u32 ids; | ||
38 | u32 mask; | ||
39 | }; | ||
40 | |||
41 | /* | ||
42 | * struct pmx_mode: mode definition structure | ||
43 | * | ||
44 | * name: mode name | ||
45 | * mask: mode mask | ||
46 | */ | ||
47 | struct pmx_mode { | ||
48 | char *name; | ||
49 | u32 id; | ||
50 | u32 mask; | ||
51 | }; | ||
52 | |||
53 | /* | ||
54 | * struct pmx_dev: device definition structure | ||
55 | * | ||
56 | * name: device name | ||
57 | * modes: device configuration array for different modes supported | ||
58 | * mode_count: size of modes array | ||
59 | * is_active: is peripheral active/enabled | ||
60 | * enb_on_reset: if 1, mask bits to be cleared in reg otherwise to be set in reg | ||
61 | */ | ||
62 | struct pmx_dev { | ||
63 | char *name; | ||
64 | struct pmx_dev_mode *modes; | ||
65 | u8 mode_count; | ||
66 | bool is_active; | ||
67 | bool enb_on_reset; | ||
68 | }; | ||
69 | |||
70 | /* | ||
71 | * struct pmx_driver: driver definition structure | ||
72 | * | ||
73 | * mode: mode to be set | ||
74 | * devs: array of pointer to pmx devices | ||
75 | * devs_count: ARRAY_SIZE of devs | ||
76 | * base: base address of soc config registers | ||
77 | * mode_reg: structure of mode config register | ||
78 | * mux_reg: structure of device mux config register | ||
79 | */ | ||
80 | struct pmx_driver { | ||
81 | struct pmx_mode *mode; | ||
82 | struct pmx_dev **devs; | ||
83 | u8 devs_count; | ||
84 | u32 *base; | ||
85 | struct pmx_reg mode_reg; | ||
86 | struct pmx_reg mux_reg; | ||
87 | }; | ||
88 | |||
89 | /* pmx functions */ | ||
90 | int pmx_register(struct pmx_driver *driver); | ||
91 | |||
92 | #endif /* __PLAT_PADMUX_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/shirq.h b/arch/arm/plat-spear/include/plat/shirq.h new file mode 100644 index 000000000000..03ed8b585dcf --- /dev/null +++ b/arch/arm/plat-spear/include/plat/shirq.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/shirq.h | ||
3 | * | ||
4 | * SPEAr platform shared irq layer header file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_SHIRQ_H | ||
15 | #define __PLAT_SHIRQ_H | ||
16 | |||
17 | #include <linux/irq.h> | ||
18 | #include <linux/types.h> | ||
19 | |||
20 | /* | ||
21 | * struct shirq_dev_config: shared irq device configuration | ||
22 | * | ||
23 | * virq: virtual irq number of device | ||
24 | * enb_mask: enable mask of device | ||
25 | * status_mask: status mask of device | ||
26 | * clear_mask: clear mask of device | ||
27 | */ | ||
28 | struct shirq_dev_config { | ||
29 | u32 virq; | ||
30 | u32 enb_mask; | ||
31 | u32 status_mask; | ||
32 | u32 clear_mask; | ||
33 | }; | ||
34 | |||
35 | /* | ||
36 | * struct shirq_regs: shared irq register configuration | ||
37 | * | ||
38 | * base: base address of shared irq register | ||
39 | * enb_reg: enable register offset | ||
40 | * reset_to_enb: val 1 indicates, we need to clear bit for enabling interrupt | ||
41 | * status_reg: status register offset | ||
42 | * status_reg_mask: status register valid mask | ||
43 | * clear_reg: clear register offset | ||
44 | * reset_to_clear: val 1 indicates, we need to clear bit for clearing interrupt | ||
45 | */ | ||
46 | struct shirq_regs { | ||
47 | void __iomem *base; | ||
48 | u32 enb_reg; | ||
49 | u32 reset_to_enb; | ||
50 | u32 status_reg; | ||
51 | u32 status_reg_mask; | ||
52 | u32 clear_reg; | ||
53 | u32 reset_to_clear; | ||
54 | }; | ||
55 | |||
56 | /* | ||
57 | * struct spear_shirq: shared irq structure | ||
58 | * | ||
59 | * irq: hardware irq number | ||
60 | * dev_config: array of device config structures which are using "irq" line | ||
61 | * dev_count: size of dev_config array | ||
62 | * regs: register configuration for shared irq block | ||
63 | */ | ||
64 | struct spear_shirq { | ||
65 | u32 irq; | ||
66 | struct shirq_dev_config *dev_config; | ||
67 | u32 dev_count; | ||
68 | struct shirq_regs regs; | ||
69 | }; | ||
70 | |||
71 | int spear_shirq_register(struct spear_shirq *shirq); | ||
72 | |||
73 | #endif /* __PLAT_SHIRQ_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/system.h b/arch/arm/plat-spear/include/plat/system.h new file mode 100644 index 000000000000..55a4e405d578 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/system.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/system.h | ||
3 | * | ||
4 | * SPEAr platform specific architecture functions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_SYSTEM_H | ||
15 | #define __PLAT_SYSTEM_H | ||
16 | |||
17 | #include <asm/hardware/sp810.h> | ||
18 | #include <linux/io.h> | ||
19 | #include <mach/spear.h> | ||
20 | |||
21 | static inline void arch_idle(void) | ||
22 | { | ||
23 | /* | ||
24 | * This should do all the clock switching | ||
25 | * and wait for interrupt tricks | ||
26 | */ | ||
27 | cpu_do_idle(); | ||
28 | } | ||
29 | |||
30 | static inline void arch_reset(char mode, const char *cmd) | ||
31 | { | ||
32 | if (mode == 's') { | ||
33 | /* software reset, Jump into ROM at address 0 */ | ||
34 | cpu_reset(0); | ||
35 | } else { | ||
36 | /* hardware reset, Use on-chip reset capability */ | ||
37 | sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | #endif /* __PLAT_SYSTEM_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/timex.h b/arch/arm/plat-spear/include/plat/timex.h new file mode 100644 index 000000000000..914d09dd50fd --- /dev/null +++ b/arch/arm/plat-spear/include/plat/timex.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/timex.h | ||
3 | * | ||
4 | * SPEAr platform specific timex definitions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_TIMEX_H | ||
15 | #define __PLAT_TIMEX_H | ||
16 | |||
17 | #define CLOCK_TICK_RATE 48000000 | ||
18 | |||
19 | #endif /* __PLAT_TIMEX_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h new file mode 100644 index 000000000000..99ba6789cc97 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/uncompress.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/uncompress.h | ||
3 | * | ||
4 | * Serial port stubs for kernel decompress status messages | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/io.h> | ||
15 | #include <linux/amba/serial.h> | ||
16 | #include <mach/spear.h> | ||
17 | |||
18 | #ifndef __PLAT_UNCOMPRESS_H | ||
19 | #define __PLAT_UNCOMPRESS_H | ||
20 | /* | ||
21 | * This does not append a newline | ||
22 | */ | ||
23 | static inline void putc(int c) | ||
24 | { | ||
25 | void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE; | ||
26 | |||
27 | while (readl(base + UART01x_FR) & UART01x_FR_TXFF) | ||
28 | barrier(); | ||
29 | |||
30 | writel(c, base + UART01x_DR); | ||
31 | } | ||
32 | |||
33 | static inline void flush(void) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | /* | ||
38 | * nothing to do | ||
39 | */ | ||
40 | #define arch_decomp_setup() | ||
41 | #define arch_decomp_wdog() | ||
42 | |||
43 | #endif /* __PLAT_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/vmalloc.h b/arch/arm/plat-spear/include/plat/vmalloc.h new file mode 100644 index 000000000000..09e9372aea21 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/vmalloc.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/vmalloc.h | ||
3 | * | ||
4 | * Defining Vmalloc area for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_VMALLOC_H | ||
15 | #define __PLAT_VMALLOC_H | ||
16 | |||
17 | #define VMALLOC_END 0xF0000000 | ||
18 | |||
19 | #endif /* __PLAT_VMALLOC_H */ | ||
diff --git a/arch/arm/plat-spear/padmux.c b/arch/arm/plat-spear/padmux.c new file mode 100644 index 000000000000..d2aab3adcdeb --- /dev/null +++ b/arch/arm/plat-spear/padmux.c | |||
@@ -0,0 +1,164 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/padmux.c | ||
3 | * | ||
4 | * SPEAr platform specific gpio pads muxing source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/err.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/slab.h> | ||
17 | #include <plat/padmux.h> | ||
18 | |||
19 | /* | ||
20 | * struct pmx: pmx definition structure | ||
21 | * | ||
22 | * base: base address of configuration registers | ||
23 | * mode_reg: mode configurations | ||
24 | * mux_reg: muxing configurations | ||
25 | * active_mode: pointer to current active mode | ||
26 | */ | ||
27 | struct pmx { | ||
28 | u32 base; | ||
29 | struct pmx_reg mode_reg; | ||
30 | struct pmx_reg mux_reg; | ||
31 | struct pmx_mode *active_mode; | ||
32 | }; | ||
33 | |||
34 | static struct pmx *pmx; | ||
35 | |||
36 | /** | ||
37 | * pmx_mode_set - Enables an multiplexing mode | ||
38 | * @mode - pointer to pmx mode | ||
39 | * | ||
40 | * It will set mode of operation in hardware. | ||
41 | * Returns -ve on Err otherwise 0 | ||
42 | */ | ||
43 | static int pmx_mode_set(struct pmx_mode *mode) | ||
44 | { | ||
45 | u32 val; | ||
46 | |||
47 | if (!mode->name) | ||
48 | return -EFAULT; | ||
49 | |||
50 | pmx->active_mode = mode; | ||
51 | |||
52 | val = readl(pmx->base + pmx->mode_reg.offset); | ||
53 | val &= ~pmx->mode_reg.mask; | ||
54 | val |= mode->mask & pmx->mode_reg.mask; | ||
55 | writel(val, pmx->base + pmx->mode_reg.offset); | ||
56 | |||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * pmx_devs_enable - Enables list of devices | ||
62 | * @devs - pointer to pmx device array | ||
63 | * @count - number of devices to enable | ||
64 | * | ||
65 | * It will enable pads for all required peripherals once and only once. | ||
66 | * If peripheral is not supported by current mode then request is rejected. | ||
67 | * Conflicts between peripherals are not handled and peripherals will be | ||
68 | * enabled in the order they are present in pmx_dev array. | ||
69 | * In case of conflicts last peripheral enalbed will be present. | ||
70 | * Returns -ve on Err otherwise 0 | ||
71 | */ | ||
72 | static int pmx_devs_enable(struct pmx_dev **devs, u8 count) | ||
73 | { | ||
74 | u32 val, i, mask; | ||
75 | |||
76 | if (!count) | ||
77 | return -EINVAL; | ||
78 | |||
79 | val = readl(pmx->base + pmx->mux_reg.offset); | ||
80 | for (i = 0; i < count; i++) { | ||
81 | u8 j = 0; | ||
82 | |||
83 | if (!devs[i]->name || !devs[i]->modes) { | ||
84 | printk(KERN_ERR "padmux: dev name or modes is null\n"); | ||
85 | continue; | ||
86 | } | ||
87 | /* check if peripheral exists in active mode */ | ||
88 | if (pmx->active_mode) { | ||
89 | bool found = false; | ||
90 | for (j = 0; j < devs[i]->mode_count; j++) { | ||
91 | if (devs[i]->modes[j].ids & | ||
92 | pmx->active_mode->id) { | ||
93 | found = true; | ||
94 | break; | ||
95 | } | ||
96 | } | ||
97 | if (found == false) { | ||
98 | printk(KERN_ERR "%s device not available in %s"\ | ||
99 | "mode\n", devs[i]->name, | ||
100 | pmx->active_mode->name); | ||
101 | continue; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | /* enable peripheral */ | ||
106 | mask = devs[i]->modes[j].mask & pmx->mux_reg.mask; | ||
107 | if (devs[i]->enb_on_reset) | ||
108 | val &= ~mask; | ||
109 | else | ||
110 | val |= mask; | ||
111 | |||
112 | devs[i]->is_active = true; | ||
113 | } | ||
114 | writel(val, pmx->base + pmx->mux_reg.offset); | ||
115 | kfree(pmx); | ||
116 | |||
117 | /* this will ensure that multiplexing can't be changed now */ | ||
118 | pmx = (struct pmx *)-1; | ||
119 | |||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * pmx_register - registers a platform requesting pad mux feature | ||
125 | * @driver - pointer to driver structure containing driver specific parameters | ||
126 | * | ||
127 | * Also this must be called only once. This will allocate memory for pmx | ||
128 | * structure, will call pmx_mode_set, will call pmx_devs_enable. | ||
129 | * Returns -ve on Err otherwise 0 | ||
130 | */ | ||
131 | int pmx_register(struct pmx_driver *driver) | ||
132 | { | ||
133 | int ret = 0; | ||
134 | |||
135 | if (pmx) | ||
136 | return -EPERM; | ||
137 | if (!driver->base || !driver->devs) | ||
138 | return -EFAULT; | ||
139 | |||
140 | pmx = kzalloc(sizeof(*pmx), GFP_KERNEL); | ||
141 | if (!pmx) | ||
142 | return -ENOMEM; | ||
143 | |||
144 | pmx->base = (u32)driver->base; | ||
145 | pmx->mode_reg.offset = driver->mode_reg.offset; | ||
146 | pmx->mode_reg.mask = driver->mode_reg.mask; | ||
147 | pmx->mux_reg.offset = driver->mux_reg.offset; | ||
148 | pmx->mux_reg.mask = driver->mux_reg.mask; | ||
149 | |||
150 | /* choose mode to enable */ | ||
151 | if (driver->mode) { | ||
152 | ret = pmx_mode_set(driver->mode); | ||
153 | if (ret) | ||
154 | goto pmx_fail; | ||
155 | } | ||
156 | ret = pmx_devs_enable(driver->devs, driver->devs_count); | ||
157 | if (ret) | ||
158 | goto pmx_fail; | ||
159 | |||
160 | return 0; | ||
161 | |||
162 | pmx_fail: | ||
163 | return ret; | ||
164 | } | ||
diff --git a/arch/arm/plat-spear/shirq.c b/arch/arm/plat-spear/shirq.c new file mode 100644 index 000000000000..2172d6946aea --- /dev/null +++ b/arch/arm/plat-spear/shirq.c | |||
@@ -0,0 +1,118 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/shirq.c | ||
3 | * | ||
4 | * SPEAr platform shared irq layer source file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/err.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/irq.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <plat/shirq.h> | ||
19 | |||
20 | struct spear_shirq *shirq; | ||
21 | static DEFINE_SPINLOCK(lock); | ||
22 | |||
23 | static void shirq_irq_mask(unsigned irq) | ||
24 | { | ||
25 | struct spear_shirq *shirq = get_irq_chip_data(irq); | ||
26 | u32 val, id = irq - shirq->dev_config[0].virq; | ||
27 | unsigned long flags; | ||
28 | |||
29 | if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1) | ||
30 | return; | ||
31 | |||
32 | spin_lock_irqsave(&lock, flags); | ||
33 | val = readl(shirq->regs.base + shirq->regs.enb_reg); | ||
34 | if (shirq->regs.reset_to_enb) | ||
35 | val |= shirq->dev_config[id].enb_mask; | ||
36 | else | ||
37 | val &= ~(shirq->dev_config[id].enb_mask); | ||
38 | writel(val, shirq->regs.base + shirq->regs.enb_reg); | ||
39 | spin_unlock_irqrestore(&lock, flags); | ||
40 | } | ||
41 | |||
42 | static void shirq_irq_unmask(unsigned irq) | ||
43 | { | ||
44 | struct spear_shirq *shirq = get_irq_chip_data(irq); | ||
45 | u32 val, id = irq - shirq->dev_config[0].virq; | ||
46 | unsigned long flags; | ||
47 | |||
48 | if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1) | ||
49 | return; | ||
50 | |||
51 | spin_lock_irqsave(&lock, flags); | ||
52 | val = readl(shirq->regs.base + shirq->regs.enb_reg); | ||
53 | if (shirq->regs.reset_to_enb) | ||
54 | val &= ~(shirq->dev_config[id].enb_mask); | ||
55 | else | ||
56 | val |= shirq->dev_config[id].enb_mask; | ||
57 | writel(val, shirq->regs.base + shirq->regs.enb_reg); | ||
58 | spin_unlock_irqrestore(&lock, flags); | ||
59 | } | ||
60 | |||
61 | static struct irq_chip shirq_chip = { | ||
62 | .name = "spear_shirq", | ||
63 | .ack = shirq_irq_mask, | ||
64 | .mask = shirq_irq_mask, | ||
65 | .unmask = shirq_irq_unmask, | ||
66 | }; | ||
67 | |||
68 | static void shirq_handler(unsigned irq, struct irq_desc *desc) | ||
69 | { | ||
70 | u32 i, val, mask; | ||
71 | struct spear_shirq *shirq = get_irq_data(irq); | ||
72 | |||
73 | desc->chip->ack(irq); | ||
74 | while ((val = readl(shirq->regs.base + shirq->regs.status_reg) & | ||
75 | shirq->regs.status_reg_mask)) { | ||
76 | for (i = 0; (i < shirq->dev_count) && val; i++) { | ||
77 | if (!(shirq->dev_config[i].status_mask & val)) | ||
78 | continue; | ||
79 | |||
80 | generic_handle_irq(shirq->dev_config[i].virq); | ||
81 | |||
82 | /* clear interrupt */ | ||
83 | val &= ~shirq->dev_config[i].status_mask; | ||
84 | if ((shirq->regs.clear_reg == -1) || | ||
85 | shirq->dev_config[i].clear_mask == -1) | ||
86 | continue; | ||
87 | mask = readl(shirq->regs.base + shirq->regs.clear_reg); | ||
88 | if (shirq->regs.reset_to_clear) | ||
89 | mask &= ~shirq->dev_config[i].clear_mask; | ||
90 | else | ||
91 | mask |= shirq->dev_config[i].clear_mask; | ||
92 | writel(mask, shirq->regs.base + shirq->regs.clear_reg); | ||
93 | } | ||
94 | } | ||
95 | desc->chip->unmask(irq); | ||
96 | } | ||
97 | |||
98 | int spear_shirq_register(struct spear_shirq *shirq) | ||
99 | { | ||
100 | int i; | ||
101 | |||
102 | if (!shirq || !shirq->dev_config || !shirq->regs.base) | ||
103 | return -EFAULT; | ||
104 | |||
105 | if (!shirq->dev_count) | ||
106 | return -EINVAL; | ||
107 | |||
108 | set_irq_chained_handler(shirq->irq, shirq_handler); | ||
109 | for (i = 0; i < shirq->dev_count; i++) { | ||
110 | set_irq_chip(shirq->dev_config[i].virq, &shirq_chip); | ||
111 | set_irq_handler(shirq->dev_config[i].virq, handle_simple_irq); | ||
112 | set_irq_flags(shirq->dev_config[i].virq, IRQF_VALID); | ||
113 | set_irq_chip_data(shirq->dev_config[i].virq, shirq); | ||
114 | } | ||
115 | |||
116 | set_irq_data(shirq->irq, shirq); | ||
117 | return 0; | ||
118 | } | ||
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c new file mode 100644 index 000000000000..a1025d38f383 --- /dev/null +++ b/arch/arm/plat-spear/time.c | |||
@@ -0,0 +1,292 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/time.c | ||
3 | * | ||
4 | * Copyright (C) 2009 ST Microelectronics | ||
5 | * Shiraz Hashim<shiraz.hashim@st.com> | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public | ||
8 | * License version 2. This program is licensed "as is" without any | ||
9 | * warranty of any kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #include <linux/clk.h> | ||
13 | #include <linux/clockchips.h> | ||
14 | #include <linux/clocksource.h> | ||
15 | #include <linux/err.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/io.h> | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/time.h> | ||
21 | #include <linux/irq.h> | ||
22 | #include <asm/mach/time.h> | ||
23 | #include <mach/irqs.h> | ||
24 | #include <mach/hardware.h> | ||
25 | #include <mach/spear.h> | ||
26 | #include <mach/generic.h> | ||
27 | |||
28 | /* | ||
29 | * We would use TIMER0 and TIMER1 as clockevent and clocksource. | ||
30 | * Timer0 and Timer1 both belong to same gpt block in cpu subbsystem. Further | ||
31 | * they share same functional clock. Any change in one's functional clock will | ||
32 | * also affect other timer. | ||
33 | */ | ||
34 | |||
35 | #define CLKEVT 0 /* gpt0, channel0 as clockevent */ | ||
36 | #define CLKSRC 1 /* gpt0, channel1 as clocksource */ | ||
37 | |||
38 | /* Register offsets, x is channel number */ | ||
39 | #define CR(x) ((x) * 0x80 + 0x80) | ||
40 | #define IR(x) ((x) * 0x80 + 0x84) | ||
41 | #define LOAD(x) ((x) * 0x80 + 0x88) | ||
42 | #define COUNT(x) ((x) * 0x80 + 0x8C) | ||
43 | |||
44 | /* Reg bit definitions */ | ||
45 | #define CTRL_INT_ENABLE 0x0100 | ||
46 | #define CTRL_ENABLE 0x0020 | ||
47 | #define CTRL_ONE_SHOT 0x0010 | ||
48 | |||
49 | #define CTRL_PRESCALER1 0x0 | ||
50 | #define CTRL_PRESCALER2 0x1 | ||
51 | #define CTRL_PRESCALER4 0x2 | ||
52 | #define CTRL_PRESCALER8 0x3 | ||
53 | #define CTRL_PRESCALER16 0x4 | ||
54 | #define CTRL_PRESCALER32 0x5 | ||
55 | #define CTRL_PRESCALER64 0x6 | ||
56 | #define CTRL_PRESCALER128 0x7 | ||
57 | #define CTRL_PRESCALER256 0x8 | ||
58 | |||
59 | #define INT_STATUS 0x1 | ||
60 | |||
61 | static __iomem void *gpt_base; | ||
62 | static struct clk *gpt_clk; | ||
63 | |||
64 | static void clockevent_set_mode(enum clock_event_mode mode, | ||
65 | struct clock_event_device *clk_event_dev); | ||
66 | static int clockevent_next_event(unsigned long evt, | ||
67 | struct clock_event_device *clk_event_dev); | ||
68 | |||
69 | /* | ||
70 | * Following clocksource_set_clock and clockevent_set_clock picked | ||
71 | * from arch/mips/kernel/time.c | ||
72 | */ | ||
73 | |||
74 | void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock) | ||
75 | { | ||
76 | u64 temp; | ||
77 | u32 shift; | ||
78 | |||
79 | /* Find a shift value */ | ||
80 | for (shift = 32; shift > 0; shift--) { | ||
81 | temp = (u64) NSEC_PER_SEC << shift; | ||
82 | do_div(temp, clock); | ||
83 | if ((temp >> 32) == 0) | ||
84 | break; | ||
85 | } | ||
86 | cs->shift = shift; | ||
87 | cs->mult = (u32) temp; | ||
88 | } | ||
89 | |||
90 | void __init clockevent_set_clock(struct clock_event_device *cd, | ||
91 | unsigned int clock) | ||
92 | { | ||
93 | u64 temp; | ||
94 | u32 shift; | ||
95 | |||
96 | /* Find a shift value */ | ||
97 | for (shift = 32; shift > 0; shift--) { | ||
98 | temp = (u64) clock << shift; | ||
99 | do_div(temp, NSEC_PER_SEC); | ||
100 | if ((temp >> 32) == 0) | ||
101 | break; | ||
102 | } | ||
103 | cd->shift = shift; | ||
104 | cd->mult = (u32) temp; | ||
105 | } | ||
106 | |||
107 | static cycle_t clocksource_read_cycles(struct clocksource *cs) | ||
108 | { | ||
109 | return (cycle_t) readw(gpt_base + COUNT(CLKSRC)); | ||
110 | } | ||
111 | |||
112 | static struct clocksource clksrc = { | ||
113 | .name = "tmr1", | ||
114 | .rating = 200, /* its a pretty decent clock */ | ||
115 | .read = clocksource_read_cycles, | ||
116 | .mask = 0xFFFF, /* 16 bits */ | ||
117 | .mult = 0, /* to be computed */ | ||
118 | .shift = 0, /* to be computed */ | ||
119 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
120 | }; | ||
121 | |||
122 | static void spear_clocksource_init(void) | ||
123 | { | ||
124 | u32 tick_rate; | ||
125 | u16 val; | ||
126 | |||
127 | /* program the prescaler (/256)*/ | ||
128 | writew(CTRL_PRESCALER256, gpt_base + CR(CLKSRC)); | ||
129 | |||
130 | /* find out actual clock driving Timer */ | ||
131 | tick_rate = clk_get_rate(gpt_clk); | ||
132 | tick_rate >>= CTRL_PRESCALER256; | ||
133 | |||
134 | writew(0xFFFF, gpt_base + LOAD(CLKSRC)); | ||
135 | |||
136 | val = readw(gpt_base + CR(CLKSRC)); | ||
137 | val &= ~CTRL_ONE_SHOT; /* autoreload mode */ | ||
138 | val |= CTRL_ENABLE ; | ||
139 | writew(val, gpt_base + CR(CLKSRC)); | ||
140 | |||
141 | clocksource_set_clock(&clksrc, tick_rate); | ||
142 | |||
143 | /* register the clocksource */ | ||
144 | clocksource_register(&clksrc); | ||
145 | } | ||
146 | |||
147 | static struct clock_event_device clkevt = { | ||
148 | .name = "tmr0", | ||
149 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
150 | .set_mode = clockevent_set_mode, | ||
151 | .set_next_event = clockevent_next_event, | ||
152 | .shift = 0, /* to be computed */ | ||
153 | }; | ||
154 | |||
155 | static void clockevent_set_mode(enum clock_event_mode mode, | ||
156 | struct clock_event_device *clk_event_dev) | ||
157 | { | ||
158 | u32 period; | ||
159 | u16 val; | ||
160 | |||
161 | /* stop the timer */ | ||
162 | val = readw(gpt_base + CR(CLKEVT)); | ||
163 | val &= ~CTRL_ENABLE; | ||
164 | writew(val, gpt_base + CR(CLKEVT)); | ||
165 | |||
166 | switch (mode) { | ||
167 | case CLOCK_EVT_MODE_PERIODIC: | ||
168 | period = clk_get_rate(gpt_clk) / HZ; | ||
169 | period >>= CTRL_PRESCALER16; | ||
170 | writew(period, gpt_base + LOAD(CLKEVT)); | ||
171 | |||
172 | val = readw(gpt_base + CR(CLKEVT)); | ||
173 | val &= ~CTRL_ONE_SHOT; | ||
174 | val |= CTRL_ENABLE | CTRL_INT_ENABLE; | ||
175 | writew(val, gpt_base + CR(CLKEVT)); | ||
176 | |||
177 | break; | ||
178 | case CLOCK_EVT_MODE_ONESHOT: | ||
179 | val = readw(gpt_base + CR(CLKEVT)); | ||
180 | val |= CTRL_ONE_SHOT; | ||
181 | writew(val, gpt_base + CR(CLKEVT)); | ||
182 | |||
183 | break; | ||
184 | case CLOCK_EVT_MODE_UNUSED: | ||
185 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
186 | case CLOCK_EVT_MODE_RESUME: | ||
187 | |||
188 | break; | ||
189 | default: | ||
190 | pr_err("Invalid mode requested\n"); | ||
191 | break; | ||
192 | } | ||
193 | } | ||
194 | |||
195 | static int clockevent_next_event(unsigned long cycles, | ||
196 | struct clock_event_device *clk_event_dev) | ||
197 | { | ||
198 | u16 val; | ||
199 | |||
200 | writew(cycles, gpt_base + LOAD(CLKEVT)); | ||
201 | |||
202 | val = readw(gpt_base + CR(CLKEVT)); | ||
203 | val |= CTRL_ENABLE | CTRL_INT_ENABLE; | ||
204 | writew(val, gpt_base + CR(CLKEVT)); | ||
205 | |||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | static irqreturn_t spear_timer_interrupt(int irq, void *dev_id) | ||
210 | { | ||
211 | struct clock_event_device *evt = &clkevt; | ||
212 | |||
213 | writew(INT_STATUS, gpt_base + IR(CLKEVT)); | ||
214 | |||
215 | evt->event_handler(evt); | ||
216 | |||
217 | return IRQ_HANDLED; | ||
218 | } | ||
219 | |||
220 | static struct irqaction spear_timer_irq = { | ||
221 | .name = "timer", | ||
222 | .flags = IRQF_DISABLED | IRQF_TIMER, | ||
223 | .handler = spear_timer_interrupt | ||
224 | }; | ||
225 | |||
226 | static void __init spear_clockevent_init(void) | ||
227 | { | ||
228 | u32 tick_rate; | ||
229 | |||
230 | /* program the prescaler */ | ||
231 | writew(CTRL_PRESCALER16, gpt_base + CR(CLKEVT)); | ||
232 | |||
233 | tick_rate = clk_get_rate(gpt_clk); | ||
234 | tick_rate >>= CTRL_PRESCALER16; | ||
235 | |||
236 | clockevent_set_clock(&clkevt, tick_rate); | ||
237 | |||
238 | clkevt.max_delta_ns = clockevent_delta2ns(0xfff0, | ||
239 | &clkevt); | ||
240 | clkevt.min_delta_ns = clockevent_delta2ns(3, &clkevt); | ||
241 | |||
242 | clkevt.cpumask = cpumask_of(0); | ||
243 | |||
244 | clockevents_register_device(&clkevt); | ||
245 | |||
246 | setup_irq(SPEAR_GPT0_CHAN0_IRQ, &spear_timer_irq); | ||
247 | } | ||
248 | |||
249 | void __init spear_setup_timer(void) | ||
250 | { | ||
251 | struct clk *pll3_clk; | ||
252 | |||
253 | if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) { | ||
254 | pr_err("%s:cannot get IO addr\n", __func__); | ||
255 | return; | ||
256 | } | ||
257 | |||
258 | gpt_base = (void __iomem *)ioremap(SPEAR_GPT0_BASE, SZ_1K); | ||
259 | if (!gpt_base) { | ||
260 | pr_err("%s:ioremap failed for gpt\n", __func__); | ||
261 | goto err_mem; | ||
262 | } | ||
263 | |||
264 | gpt_clk = clk_get_sys("gpt0", NULL); | ||
265 | if (!gpt_clk) { | ||
266 | pr_err("%s:couldn't get clk for gpt\n", __func__); | ||
267 | goto err_iomap; | ||
268 | } | ||
269 | |||
270 | pll3_clk = clk_get(NULL, "pll3_48m_clk"); | ||
271 | if (!pll3_clk) { | ||
272 | pr_err("%s:couldn't get PLL3 as parent for gpt\n", __func__); | ||
273 | goto err_iomap; | ||
274 | } | ||
275 | |||
276 | clk_set_parent(gpt_clk, pll3_clk); | ||
277 | |||
278 | spear_clockevent_init(); | ||
279 | spear_clocksource_init(); | ||
280 | |||
281 | return; | ||
282 | |||
283 | err_iomap: | ||
284 | iounmap(gpt_base); | ||
285 | |||
286 | err_mem: | ||
287 | release_mem_region(SPEAR_GPT0_BASE, SZ_1K); | ||
288 | } | ||
289 | |||
290 | struct sys_timer spear_sys_timer = { | ||
291 | .init = spear_setup_timer, | ||
292 | }; | ||
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile new file mode 100644 index 000000000000..9b1a66816aa6 --- /dev/null +++ b/arch/arm/plat-versatile/Makefile | |||
@@ -0,0 +1,4 @@ | |||
1 | obj-y := clock.o | ||
2 | obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o | ||
3 | obj-$(CONFIG_ARCH_REALVIEW) += sched-clock.o | ||
4 | obj-$(CONFIG_ARCH_VERSATILE) += sched-clock.o | ||
diff --git a/arch/arm/mach-integrator/clock.c b/arch/arm/plat-versatile/clock.c index 989ecf5f5c46..5c8b6564fdc2 100644 --- a/arch/arm/mach-integrator/clock.c +++ b/arch/arm/plat-versatile/clock.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-integrator/clock.c | 2 | * linux/arch/arm/plat-versatile/clock.c |
3 | * | 3 | * |
4 | * Copyright (C) 2004 ARM Limited. | 4 | * Copyright (C) 2004 ARM Limited. |
5 | * Written by Deep Blue Solutions Limited. | 5 | * Written by Deep Blue Solutions Limited. |
@@ -14,7 +14,8 @@ | |||
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
16 | 16 | ||
17 | #include <asm/clkdev.h> | 17 | #include <asm/hardware/icst.h> |
18 | |||
18 | #include <mach/clkdev.h> | 19 | #include <mach/clkdev.h> |
19 | 20 | ||
20 | int clk_enable(struct clk *clk) | 21 | int clk_enable(struct clk *clk) |
@@ -36,24 +37,38 @@ EXPORT_SYMBOL(clk_get_rate); | |||
36 | 37 | ||
37 | long clk_round_rate(struct clk *clk, unsigned long rate) | 38 | long clk_round_rate(struct clk *clk, unsigned long rate) |
38 | { | 39 | { |
39 | struct icst525_vco vco; | 40 | long ret = -EIO; |
40 | vco = icst525_khz_to_vco(clk->params, rate / 1000); | 41 | if (clk->ops && clk->ops->round) |
41 | return icst525_khz(clk->params, vco) * 1000; | 42 | ret = clk->ops->round(clk, rate); |
43 | return ret; | ||
42 | } | 44 | } |
43 | EXPORT_SYMBOL(clk_round_rate); | 45 | EXPORT_SYMBOL(clk_round_rate); |
44 | 46 | ||
45 | int clk_set_rate(struct clk *clk, unsigned long rate) | 47 | int clk_set_rate(struct clk *clk, unsigned long rate) |
46 | { | 48 | { |
47 | int ret = -EIO; | 49 | int ret = -EIO; |
48 | 50 | if (clk->ops && clk->ops->set) | |
49 | if (clk->setvco) { | 51 | ret = clk->ops->set(clk, rate); |
50 | struct icst525_vco vco; | ||
51 | |||
52 | vco = icst525_khz_to_vco(clk->params, rate / 1000); | ||
53 | clk->rate = icst525_khz(clk->params, vco) * 1000; | ||
54 | clk->setvco(clk, vco); | ||
55 | ret = 0; | ||
56 | } | ||
57 | return ret; | 52 | return ret; |
58 | } | 53 | } |
59 | EXPORT_SYMBOL(clk_set_rate); | 54 | EXPORT_SYMBOL(clk_set_rate); |
55 | |||
56 | long icst_clk_round(struct clk *clk, unsigned long rate) | ||
57 | { | ||
58 | struct icst_vco vco; | ||
59 | vco = icst_hz_to_vco(clk->params, rate); | ||
60 | return icst_hz(clk->params, vco); | ||
61 | } | ||
62 | EXPORT_SYMBOL(icst_clk_round); | ||
63 | |||
64 | int icst_clk_set(struct clk *clk, unsigned long rate) | ||
65 | { | ||
66 | struct icst_vco vco; | ||
67 | |||
68 | vco = icst_hz_to_vco(clk->params, rate); | ||
69 | clk->rate = icst_hz(clk->params, vco); | ||
70 | clk->ops->setvco(clk, vco); | ||
71 | |||
72 | return 0; | ||
73 | } | ||
74 | EXPORT_SYMBOL(icst_clk_set); | ||
diff --git a/arch/arm/plat-versatile/include/plat/clock.h b/arch/arm/plat-versatile/include/plat/clock.h new file mode 100644 index 000000000000..3cfb024ccd70 --- /dev/null +++ b/arch/arm/plat-versatile/include/plat/clock.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef PLAT_CLOCK_H | ||
2 | #define PLAT_CLOCK_H | ||
3 | |||
4 | #include <asm/hardware/icst.h> | ||
5 | |||
6 | struct clk_ops { | ||
7 | long (*round)(struct clk *, unsigned long); | ||
8 | int (*set)(struct clk *, unsigned long); | ||
9 | void (*setvco)(struct clk *, struct icst_vco); | ||
10 | }; | ||
11 | |||
12 | int icst_clk_set(struct clk *, unsigned long); | ||
13 | long icst_clk_round(struct clk *, unsigned long); | ||
14 | |||
15 | #endif | ||
diff --git a/arch/arm/plat-versatile/include/plat/timer-sp.h b/arch/arm/plat-versatile/include/plat/timer-sp.h new file mode 100644 index 000000000000..21e75e30d497 --- /dev/null +++ b/arch/arm/plat-versatile/include/plat/timer-sp.h | |||
@@ -0,0 +1,2 @@ | |||
1 | void sp804_clocksource_init(void __iomem *); | ||
2 | void sp804_clockevents_init(void __iomem *, unsigned int); | ||
diff --git a/arch/arm/plat-versatile/sched-clock.c b/arch/arm/plat-versatile/sched-clock.c new file mode 100644 index 000000000000..9768cf7e83d7 --- /dev/null +++ b/arch/arm/plat-versatile/sched-clock.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-versatile/sched-clock.c | ||
3 | * | ||
4 | * Copyright (C) 1999 - 2003 ARM Limited | ||
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
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 | #include <linux/cnt32_to_63.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <asm/div64.h> | ||
24 | |||
25 | #include <mach/hardware.h> | ||
26 | #include <mach/platform.h> | ||
27 | |||
28 | #ifdef VERSATILE_SYS_BASE | ||
29 | #define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET) | ||
30 | #endif | ||
31 | |||
32 | #ifdef REALVIEW_SYS_BASE | ||
33 | #define REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) | ||
34 | #endif | ||
35 | |||
36 | /* | ||
37 | * This is the Realview and Versatile sched_clock implementation. This | ||
38 | * has a resolution of 41.7ns, and a maximum value of about 35583 days. | ||
39 | * | ||
40 | * The return value is guaranteed to be monotonic in that range as | ||
41 | * long as there is always less than 89 seconds between successive | ||
42 | * calls to this function. | ||
43 | */ | ||
44 | unsigned long long sched_clock(void) | ||
45 | { | ||
46 | unsigned long long v = cnt32_to_63(readl(REFCOUNTER)); | ||
47 | |||
48 | /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */ | ||
49 | v *= 125<<1; | ||
50 | do_div(v, 3<<1); | ||
51 | |||
52 | return v; | ||
53 | } | ||
diff --git a/arch/arm/plat-versatile/timer-sp.c b/arch/arm/plat-versatile/timer-sp.c new file mode 100644 index 000000000000..fb0d1c299718 --- /dev/null +++ b/arch/arm/plat-versatile/timer-sp.c | |||
@@ -0,0 +1,156 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-versatile/timer-sp.c | ||
3 | * | ||
4 | * Copyright (C) 1999 - 2003 ARM Limited | ||
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
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 | #include <linux/clocksource.h> | ||
22 | #include <linux/clockchips.h> | ||
23 | #include <linux/interrupt.h> | ||
24 | #include <linux/irq.h> | ||
25 | #include <linux/io.h> | ||
26 | |||
27 | #include <asm/hardware/arm_timer.h> | ||
28 | |||
29 | #include <plat/timer-sp.h> | ||
30 | |||
31 | /* | ||
32 | * These timers are currently always setup to be clocked at 1MHz. | ||
33 | */ | ||
34 | #define TIMER_FREQ_KHZ (1000) | ||
35 | #define TIMER_RELOAD (TIMER_FREQ_KHZ * 1000 / HZ) | ||
36 | |||
37 | static void __iomem *clksrc_base; | ||
38 | |||
39 | static cycle_t sp804_read(struct clocksource *cs) | ||
40 | { | ||
41 | return ~readl(clksrc_base + TIMER_VALUE); | ||
42 | } | ||
43 | |||
44 | static struct clocksource clocksource_sp804 = { | ||
45 | .name = "timer3", | ||
46 | .rating = 200, | ||
47 | .read = sp804_read, | ||
48 | .mask = CLOCKSOURCE_MASK(32), | ||
49 | .shift = 20, | ||
50 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
51 | }; | ||
52 | |||
53 | void __init sp804_clocksource_init(void __iomem *base) | ||
54 | { | ||
55 | struct clocksource *cs = &clocksource_sp804; | ||
56 | |||
57 | clksrc_base = base; | ||
58 | |||
59 | /* setup timer 0 as free-running clocksource */ | ||
60 | writel(0, clksrc_base + TIMER_CTRL); | ||
61 | writel(0xffffffff, clksrc_base + TIMER_LOAD); | ||
62 | writel(0xffffffff, clksrc_base + TIMER_VALUE); | ||
63 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | ||
64 | clksrc_base + TIMER_CTRL); | ||
65 | |||
66 | cs->mult = clocksource_khz2mult(TIMER_FREQ_KHZ, cs->shift); | ||
67 | clocksource_register(cs); | ||
68 | } | ||
69 | |||
70 | |||
71 | static void __iomem *clkevt_base; | ||
72 | |||
73 | /* | ||
74 | * IRQ handler for the timer | ||
75 | */ | ||
76 | static irqreturn_t sp804_timer_interrupt(int irq, void *dev_id) | ||
77 | { | ||
78 | struct clock_event_device *evt = dev_id; | ||
79 | |||
80 | /* clear the interrupt */ | ||
81 | writel(1, clkevt_base + TIMER_INTCLR); | ||
82 | |||
83 | evt->event_handler(evt); | ||
84 | |||
85 | return IRQ_HANDLED; | ||
86 | } | ||
87 | |||
88 | static void sp804_set_mode(enum clock_event_mode mode, | ||
89 | struct clock_event_device *evt) | ||
90 | { | ||
91 | unsigned long ctrl = TIMER_CTRL_32BIT | TIMER_CTRL_IE; | ||
92 | |||
93 | writel(ctrl, clkevt_base + TIMER_CTRL); | ||
94 | |||
95 | switch (mode) { | ||
96 | case CLOCK_EVT_MODE_PERIODIC: | ||
97 | writel(TIMER_RELOAD, clkevt_base + TIMER_LOAD); | ||
98 | ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE; | ||
99 | break; | ||
100 | |||
101 | case CLOCK_EVT_MODE_ONESHOT: | ||
102 | /* period set, and timer enabled in 'next_event' hook */ | ||
103 | ctrl |= TIMER_CTRL_ONESHOT; | ||
104 | break; | ||
105 | |||
106 | case CLOCK_EVT_MODE_UNUSED: | ||
107 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
108 | default: | ||
109 | break; | ||
110 | } | ||
111 | |||
112 | writel(ctrl, clkevt_base + TIMER_CTRL); | ||
113 | } | ||
114 | |||
115 | static int sp804_set_next_event(unsigned long next, | ||
116 | struct clock_event_device *evt) | ||
117 | { | ||
118 | unsigned long ctrl = readl(clkevt_base + TIMER_CTRL); | ||
119 | |||
120 | writel(next, clkevt_base + TIMER_LOAD); | ||
121 | writel(ctrl | TIMER_CTRL_ENABLE, clkevt_base + TIMER_CTRL); | ||
122 | |||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | static struct clock_event_device sp804_clockevent = { | ||
127 | .name = "timer0", | ||
128 | .shift = 32, | ||
129 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
130 | .set_mode = sp804_set_mode, | ||
131 | .set_next_event = sp804_set_next_event, | ||
132 | .rating = 300, | ||
133 | .cpumask = cpu_all_mask, | ||
134 | }; | ||
135 | |||
136 | static struct irqaction sp804_timer_irq = { | ||
137 | .name = "timer", | ||
138 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
139 | .handler = sp804_timer_interrupt, | ||
140 | .dev_id = &sp804_clockevent, | ||
141 | }; | ||
142 | |||
143 | void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq) | ||
144 | { | ||
145 | struct clock_event_device *evt = &sp804_clockevent; | ||
146 | |||
147 | clkevt_base = base; | ||
148 | |||
149 | evt->irq = timer_irq; | ||
150 | evt->mult = div_sc(TIMER_FREQ_KHZ, NSEC_PER_MSEC, evt->shift); | ||
151 | evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt); | ||
152 | evt->min_delta_ns = clockevent_delta2ns(0xf, evt); | ||
153 | |||
154 | setup_irq(timer_irq, &sp804_timer_irq); | ||
155 | clockevents_register_device(evt); | ||
156 | } | ||