diff options
250 files changed, 17265 insertions, 2100 deletions
diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX index 82e418d648d0..7f5fc3ba9c91 100644 --- a/Documentation/arm/00-INDEX +++ b/Documentation/arm/00-INDEX | |||
| @@ -20,6 +20,8 @@ Samsung-S3C24XX | |||
| 20 | - S3C24XX ARM Linux Overview | 20 | - S3C24XX ARM Linux Overview |
| 21 | Sharp-LH | 21 | Sharp-LH |
| 22 | - Linux on Sharp LH79524 and LH7A40X System On a Chip (SOC) | 22 | - Linux on Sharp LH79524 and LH7A40X System On a Chip (SOC) |
| 23 | SPEAr | ||
| 24 | - ST SPEAr platform Linux Overview | ||
| 23 | VFP/ | 25 | VFP/ |
| 24 | - Release notes for Linux Kernel Vector Floating Point support code | 26 | - Release notes for Linux Kernel Vector Floating Point support code |
| 25 | empeg/ | 27 | empeg/ |
diff --git a/Documentation/arm/SPEAr/overview.txt b/Documentation/arm/SPEAr/overview.txt new file mode 100644 index 000000000000..253a35c6f782 --- /dev/null +++ b/Documentation/arm/SPEAr/overview.txt | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | SPEAr ARM Linux Overview | ||
| 2 | ========================== | ||
| 3 | |||
| 4 | Introduction | ||
| 5 | ------------ | ||
| 6 | |||
| 7 | SPEAr (Structured Processor Enhanced Architecture). | ||
| 8 | weblink : http://www.st.com/spear | ||
| 9 | |||
| 10 | The ST Microelectronics SPEAr range of ARM9/CortexA9 System-on-Chip CPUs are | ||
| 11 | supported by the 'spear' platform of ARM Linux. Currently SPEAr300, | ||
| 12 | SPEAr310, SPEAr320 and SPEAr600 SOCs are supported. Support for the SPEAr13XX | ||
| 13 | series is in progress. | ||
| 14 | |||
| 15 | Hierarchy in SPEAr is as follows: | ||
| 16 | |||
| 17 | SPEAr (Platform) | ||
| 18 | - SPEAr3XX (3XX SOC series, based on ARM9) | ||
| 19 | - SPEAr300 (SOC) | ||
| 20 | - SPEAr300_EVB (Evaluation Board) | ||
| 21 | - SPEAr310 (SOC) | ||
| 22 | - SPEAr310_EVB (Evaluation Board) | ||
| 23 | - SPEAr320 (SOC) | ||
| 24 | - SPEAr320_EVB (Evaluation Board) | ||
| 25 | - SPEAr6XX (6XX SOC series, based on ARM9) | ||
| 26 | - SPEAr600 (SOC) | ||
| 27 | - SPEAr600_EVB (Evaluation Board) | ||
| 28 | - SPEAr13XX (13XX SOC series, based on ARM CORTEXA9) | ||
| 29 | - SPEAr1300 (SOC) | ||
| 30 | |||
| 31 | Configuration | ||
| 32 | ------------- | ||
| 33 | |||
| 34 | A generic configuration is provided for each machine, and can be used as the | ||
| 35 | default by | ||
| 36 | make spear600_defconfig | ||
| 37 | make spear300_defconfig | ||
| 38 | make spear310_defconfig | ||
| 39 | make spear320_defconfig | ||
| 40 | |||
| 41 | Layout | ||
| 42 | ------ | ||
| 43 | |||
| 44 | The common files for multiple machine families (SPEAr3XX, SPEAr6XX and | ||
| 45 | SPEAr13XX) are located in the platform code contained in arch/arm/plat-spear | ||
| 46 | with headers in plat/. | ||
| 47 | |||
| 48 | Each machine series have a directory with name arch/arm/mach-spear followed by | ||
| 49 | series name. Like mach-spear3xx, mach-spear6xx and mach-spear13xx. | ||
| 50 | |||
| 51 | Common file for machines of spear3xx family is mach-spear3xx/spear3xx.c and for | ||
| 52 | spear6xx is mach-spear6xx/spear6xx.c. mach-spear* also contain soc/machine | ||
| 53 | specific files, like spear300.c, spear310.c, spear320.c and spear600.c. | ||
| 54 | mach-spear* also contains board specific files for each machine type. | ||
| 55 | |||
| 56 | |||
| 57 | Document Author | ||
| 58 | --------------- | ||
| 59 | |||
| 60 | Viresh Kumar, (c) 2010 ST Microelectronics | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 382eaa4d0068..aa18ca333f80 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -5229,6 +5229,46 @@ F: drivers/serial/sunsu.c | |||
| 5229 | F: drivers/serial/sunzilog.c | 5229 | F: drivers/serial/sunzilog.c |
| 5230 | F: drivers/serial/sunzilog.h | 5230 | F: drivers/serial/sunzilog.h |
| 5231 | 5231 | ||
| 5232 | SPEAR PLATFORM SUPPORT | ||
| 5233 | M: Viresh Kumar <viresh.kumar@st.com> | ||
| 5234 | W: http://www.st.com/spear | ||
| 5235 | S: Maintained | ||
| 5236 | F: arch/arm/plat-spear/ | ||
| 5237 | |||
| 5238 | SPEAR3XX MACHINE SUPPORT | ||
| 5239 | M: Viresh Kumar <viresh.kumar@st.com> | ||
| 5240 | W: http://www.st.com/spear | ||
| 5241 | S: Maintained | ||
| 5242 | F: arch/arm/mach-spear3xx/ | ||
| 5243 | |||
| 5244 | SPEAR6XX MACHINE SUPPORT | ||
| 5245 | M: Rajeev Kumar <rajeev-dlh.kumar@st.com> | ||
| 5246 | W: http://www.st.com/spear | ||
| 5247 | S: Maintained | ||
| 5248 | F: arch/arm/mach-spear6xx/ | ||
| 5249 | |||
| 5250 | SPEAR CLOCK FRAMEWORK SUPPORT | ||
| 5251 | M: Viresh Kumar <viresh.kumar@st.com> | ||
| 5252 | W: http://www.st.com/spear | ||
| 5253 | S: Maintained | ||
| 5254 | F: arch/arm/mach-spear*/clock.c | ||
| 5255 | F: arch/arm/mach-spear*/include/mach/clkdev.h | ||
| 5256 | F: arch/arm/plat-spear/clock.c | ||
| 5257 | F: arch/arm/plat-spear/include/plat/clock.h and clkdev.h | ||
| 5258 | |||
| 5259 | SPEAR PAD MULTIPLEXING SUPPORT | ||
| 5260 | M: Viresh Kumar <viresh.kumar@st.com> | ||
| 5261 | W: http://www.st.com/spear | ||
| 5262 | S: Maintained | ||
| 5263 | F: arch/arm/plat-spear/include/plat/padmux.h | ||
| 5264 | F: arch/arm/plat-spear/padmux.c | ||
| 5265 | F: arch/arm/mach-spear*/spear*xx.c | ||
| 5266 | F: arch/arm/mach-spear*/include/mach/generic.h | ||
| 5267 | F: arch/arm/mach-spear3xx/spear3*0.c | ||
| 5268 | F: arch/arm/mach-spear3xx/spear3*0_evb.c | ||
| 5269 | F: arch/arm/mach-spear6xx/spear600.c | ||
| 5270 | F: arch/arm/mach-spear6xx/spear600_evb.c | ||
| 5271 | |||
| 5232 | SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER | 5272 | SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER |
| 5233 | M: Roger Wolff <R.E.Wolff@BitWizard.nl> | 5273 | M: Roger Wolff <R.E.Wolff@BitWizard.nl> |
| 5234 | S: Supported | 5274 | S: Supported |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c5408bf1bf43..daaa4b2b46e1 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -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 |
| @@ -231,6 +237,7 @@ config ARCH_AAEC2000 | |||
| 231 | select CPU_ARM920T | 237 | select CPU_ARM920T |
| 232 | select ARM_AMBA | 238 | select ARM_AMBA |
| 233 | select HAVE_CLK | 239 | select HAVE_CLK |
| 240 | select ARCH_USES_GETTIMEOFFSET | ||
| 234 | help | 241 | help |
| 235 | This enables support for systems based on the Agilent AAEC-2000 | 242 | This enables support for systems based on the Agilent AAEC-2000 |
| 236 | 243 | ||
| @@ -238,21 +245,24 @@ config ARCH_INTEGRATOR | |||
| 238 | bool "ARM Ltd. Integrator family" | 245 | bool "ARM Ltd. Integrator family" |
| 239 | select ARM_AMBA | 246 | select ARM_AMBA |
| 240 | select ARCH_HAS_CPUFREQ | 247 | select ARCH_HAS_CPUFREQ |
| 241 | select HAVE_CLK | ||
| 242 | select COMMON_CLKDEV | 248 | select COMMON_CLKDEV |
| 243 | select ICST525 | 249 | select ICST |
| 250 | select GENERIC_TIME | ||
| 251 | select GENERIC_CLOCKEVENTS | ||
| 252 | select PLAT_VERSATILE | ||
| 244 | help | 253 | help |
| 245 | Support for ARM's Integrator platform. | 254 | Support for ARM's Integrator platform. |
| 246 | 255 | ||
| 247 | config ARCH_REALVIEW | 256 | config ARCH_REALVIEW |
| 248 | bool "ARM Ltd. RealView family" | 257 | bool "ARM Ltd. RealView family" |
| 249 | select ARM_AMBA | 258 | select ARM_AMBA |
| 250 | select HAVE_CLK | ||
| 251 | select COMMON_CLKDEV | 259 | select COMMON_CLKDEV |
| 252 | select ICST307 | 260 | select ICST |
| 253 | select GENERIC_TIME | 261 | select GENERIC_TIME |
| 254 | select GENERIC_CLOCKEVENTS | 262 | select GENERIC_CLOCKEVENTS |
| 255 | select ARCH_WANT_OPTIONAL_GPIOLIB | 263 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 264 | select PLAT_VERSATILE | ||
| 265 | select ARM_TIMER_SP804 | ||
| 256 | help | 266 | help |
| 257 | This enables support for ARM Ltd RealView boards. | 267 | This enables support for ARM Ltd RealView boards. |
| 258 | 268 | ||
| @@ -260,20 +270,36 @@ config ARCH_VERSATILE | |||
| 260 | bool "ARM Ltd. Versatile family" | 270 | bool "ARM Ltd. Versatile family" |
| 261 | select ARM_AMBA | 271 | select ARM_AMBA |
| 262 | select ARM_VIC | 272 | select ARM_VIC |
| 263 | select HAVE_CLK | ||
| 264 | select COMMON_CLKDEV | 273 | select COMMON_CLKDEV |
| 265 | select ICST307 | 274 | select ICST |
| 266 | select GENERIC_TIME | 275 | select GENERIC_TIME |
| 267 | select GENERIC_CLOCKEVENTS | 276 | select GENERIC_CLOCKEVENTS |
| 268 | select ARCH_WANT_OPTIONAL_GPIOLIB | 277 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 278 | select PLAT_VERSATILE | ||
| 279 | select ARM_TIMER_SP804 | ||
| 269 | help | 280 | help |
| 270 | This enables support for ARM Ltd Versatile board. | 281 | This enables support for ARM Ltd Versatile board. |
| 271 | 282 | ||
| 283 | config ARCH_VEXPRESS | ||
| 284 | bool "ARM Ltd. Versatile Express family" | ||
| 285 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
| 286 | select ARM_AMBA | ||
| 287 | select ARM_TIMER_SP804 | ||
| 288 | select COMMON_CLKDEV | ||
| 289 | select GENERIC_CLOCKEVENTS | ||
| 290 | select GENERIC_TIME | ||
| 291 | select HAVE_CLK | ||
| 292 | select ICST | ||
| 293 | select PLAT_VERSATILE | ||
| 294 | help | ||
| 295 | This enables support for the ARM Ltd Versatile Express boards. | ||
| 296 | |||
| 272 | config ARCH_AT91 | 297 | config ARCH_AT91 |
| 273 | bool "Atmel AT91" | 298 | bool "Atmel AT91" |
| 274 | select GENERIC_GPIO | 299 | select GENERIC_GPIO |
| 275 | select ARCH_REQUIRE_GPIOLIB | 300 | select ARCH_REQUIRE_GPIOLIB |
| 276 | select HAVE_CLK | 301 | select HAVE_CLK |
| 302 | select ARCH_USES_GETTIMEOFFSET | ||
| 277 | help | 303 | help |
| 278 | This enables support for systems based on the Atmel AT91RM9200, | 304 | This enables support for systems based on the Atmel AT91RM9200, |
| 279 | AT91SAM9 and AT91CAP9 processors. | 305 | AT91SAM9 and AT91CAP9 processors. |
| @@ -293,6 +319,7 @@ config ARCH_BCMRING | |||
| 293 | config ARCH_CLPS711X | 319 | config ARCH_CLPS711X |
| 294 | bool "Cirrus Logic CLPS711x/EP721x-based" | 320 | bool "Cirrus Logic CLPS711x/EP721x-based" |
| 295 | select CPU_ARM720T | 321 | select CPU_ARM720T |
| 322 | select ARCH_USES_GETTIMEOFFSET | ||
| 296 | help | 323 | help |
| 297 | Support for Cirrus Logic 711x/721x based boards. | 324 | Support for Cirrus Logic 711x/721x based boards. |
| 298 | 325 | ||
| @@ -301,6 +328,7 @@ config ARCH_GEMINI | |||
| 301 | select CPU_FA526 | 328 | select CPU_FA526 |
| 302 | select GENERIC_GPIO | 329 | select GENERIC_GPIO |
| 303 | select ARCH_REQUIRE_GPIOLIB | 330 | select ARCH_REQUIRE_GPIOLIB |
| 331 | select ARCH_USES_GETTIMEOFFSET | ||
| 304 | help | 332 | help |
| 305 | Support for the Cortina Systems Gemini family SoCs | 333 | Support for the Cortina Systems Gemini family SoCs |
| 306 | 334 | ||
| @@ -309,6 +337,7 @@ config ARCH_EBSA110 | |||
| 309 | select CPU_SA110 | 337 | select CPU_SA110 |
| 310 | select ISA | 338 | select ISA |
| 311 | select NO_IOPORT | 339 | select NO_IOPORT |
| 340 | select ARCH_USES_GETTIMEOFFSET | ||
| 312 | help | 341 | help |
| 313 | This is an evaluation board for the StrongARM processor available | 342 | This is an evaluation board for the StrongARM processor available |
| 314 | from Digital. It has limited hardware on-board, including an | 343 | from Digital. It has limited hardware on-board, including an |
| @@ -321,10 +350,10 @@ config ARCH_EP93XX | |||
| 321 | select ARM_AMBA | 350 | select ARM_AMBA |
| 322 | select ARM_VIC | 351 | select ARM_VIC |
| 323 | select GENERIC_GPIO | 352 | select GENERIC_GPIO |
| 324 | select HAVE_CLK | ||
| 325 | select COMMON_CLKDEV | 353 | select COMMON_CLKDEV |
| 326 | select ARCH_REQUIRE_GPIOLIB | 354 | select ARCH_REQUIRE_GPIOLIB |
| 327 | select ARCH_HAS_HOLES_MEMORYMODEL | 355 | select ARCH_HAS_HOLES_MEMORYMODEL |
| 356 | select ARCH_USES_GETTIMEOFFSET | ||
| 328 | help | 357 | help |
| 329 | This enables support for the Cirrus EP93xx series of CPUs. | 358 | This enables support for the Cirrus EP93xx series of CPUs. |
| 330 | 359 | ||
| @@ -332,6 +361,7 @@ config ARCH_FOOTBRIDGE | |||
| 332 | bool "FootBridge" | 361 | bool "FootBridge" |
| 333 | select CPU_SA110 | 362 | select CPU_SA110 |
| 334 | select FOOTBRIDGE | 363 | select FOOTBRIDGE |
| 364 | select ARCH_USES_GETTIMEOFFSET | ||
| 335 | help | 365 | help |
| 336 | Support for systems based on the DC21285 companion chip | 366 | Support for systems based on the DC21285 companion chip |
| 337 | ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. | 367 | ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. |
| @@ -341,7 +371,6 @@ config ARCH_MXC | |||
| 341 | select GENERIC_TIME | 371 | select GENERIC_TIME |
| 342 | select GENERIC_CLOCKEVENTS | 372 | select GENERIC_CLOCKEVENTS |
| 343 | select ARCH_REQUIRE_GPIOLIB | 373 | select ARCH_REQUIRE_GPIOLIB |
| 344 | select HAVE_CLK | ||
| 345 | select COMMON_CLKDEV | 374 | select COMMON_CLKDEV |
| 346 | help | 375 | help |
| 347 | Support for Freescale MXC/iMX-based family of processors | 376 | Support for Freescale MXC/iMX-based family of processors |
| @@ -349,7 +378,6 @@ config ARCH_MXC | |||
| 349 | config ARCH_STMP3XXX | 378 | config ARCH_STMP3XXX |
| 350 | bool "Freescale STMP3xxx" | 379 | bool "Freescale STMP3xxx" |
| 351 | select CPU_ARM926T | 380 | select CPU_ARM926T |
| 352 | select HAVE_CLK | ||
| 353 | select COMMON_CLKDEV | 381 | select COMMON_CLKDEV |
| 354 | select ARCH_REQUIRE_GPIOLIB | 382 | select ARCH_REQUIRE_GPIOLIB |
| 355 | select GENERIC_TIME | 383 | select GENERIC_TIME |
| @@ -372,6 +400,7 @@ config ARCH_H720X | |||
| 372 | bool "Hynix HMS720x-based" | 400 | bool "Hynix HMS720x-based" |
| 373 | select CPU_ARM720T | 401 | select CPU_ARM720T |
| 374 | select ISA_DMA_API | 402 | select ISA_DMA_API |
| 403 | select ARCH_USES_GETTIMEOFFSET | ||
| 375 | help | 404 | help |
| 376 | This enables support for systems based on the Hynix HMS720x | 405 | This enables support for systems based on the Hynix HMS720x |
| 377 | 406 | ||
| @@ -414,6 +443,7 @@ config ARCH_IXP23XX | |||
| 414 | depends on MMU | 443 | depends on MMU |
| 415 | select CPU_XSC3 | 444 | select CPU_XSC3 |
| 416 | select PCI | 445 | select PCI |
| 446 | select ARCH_USES_GETTIMEOFFSET | ||
| 417 | help | 447 | help |
| 418 | Support for Intel's IXP23xx (XScale) family of processors. | 448 | Support for Intel's IXP23xx (XScale) family of processors. |
| 419 | 449 | ||
| @@ -422,6 +452,7 @@ config ARCH_IXP2000 | |||
| 422 | depends on MMU | 452 | depends on MMU |
| 423 | select CPU_XSCALE | 453 | select CPU_XSCALE |
| 424 | select PCI | 454 | select PCI |
| 455 | select ARCH_USES_GETTIMEOFFSET | ||
| 425 | help | 456 | help |
| 426 | Support for Intel's IXP2400/2800 (XScale) family of processors. | 457 | Support for Intel's IXP2400/2800 (XScale) family of processors. |
| 427 | 458 | ||
| @@ -440,6 +471,7 @@ config ARCH_L7200 | |||
| 440 | bool "LinkUp-L7200" | 471 | bool "LinkUp-L7200" |
| 441 | select CPU_ARM720T | 472 | select CPU_ARM720T |
| 442 | select FIQ | 473 | select FIQ |
| 474 | select ARCH_USES_GETTIMEOFFSET | ||
| 443 | help | 475 | help |
| 444 | Say Y here if you intend to run this kernel on a LinkUp Systems | 476 | Say Y here if you intend to run this kernel on a LinkUp Systems |
| 445 | L7200 Software Development Board which uses an ARM720T processor. | 477 | L7200 Software Development Board which uses an ARM720T processor. |
| @@ -516,7 +548,6 @@ config ARCH_MMP | |||
| 516 | depends on MMU | 548 | depends on MMU |
| 517 | select GENERIC_GPIO | 549 | select GENERIC_GPIO |
| 518 | select ARCH_REQUIRE_GPIOLIB | 550 | select ARCH_REQUIRE_GPIOLIB |
| 519 | select HAVE_CLK | ||
| 520 | select COMMON_CLKDEV | 551 | select COMMON_CLKDEV |
| 521 | select GENERIC_TIME | 552 | select GENERIC_TIME |
| 522 | select GENERIC_CLOCKEVENTS | 553 | select GENERIC_CLOCKEVENTS |
| @@ -530,6 +561,7 @@ config ARCH_KS8695 | |||
| 530 | select CPU_ARM922T | 561 | select CPU_ARM922T |
| 531 | select GENERIC_GPIO | 562 | select GENERIC_GPIO |
| 532 | select ARCH_REQUIRE_GPIOLIB | 563 | select ARCH_REQUIRE_GPIOLIB |
| 564 | select ARCH_USES_GETTIMEOFFSET | ||
| 533 | help | 565 | help |
| 534 | Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based | 566 | Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based |
| 535 | System-on-Chip devices. | 567 | System-on-Chip devices. |
| @@ -552,7 +584,6 @@ config ARCH_W90X900 | |||
| 552 | select CPU_ARM926T | 584 | select CPU_ARM926T |
| 553 | select ARCH_REQUIRE_GPIOLIB | 585 | select ARCH_REQUIRE_GPIOLIB |
| 554 | select GENERIC_GPIO | 586 | select GENERIC_GPIO |
| 555 | select HAVE_CLK | ||
| 556 | select COMMON_CLKDEV | 587 | select COMMON_CLKDEV |
| 557 | select GENERIC_TIME | 588 | select GENERIC_TIME |
| 558 | select GENERIC_CLOCKEVENTS | 589 | select GENERIC_CLOCKEVENTS |
| @@ -568,7 +599,6 @@ config ARCH_W90X900 | |||
| 568 | config ARCH_NUC93X | 599 | config ARCH_NUC93X |
| 569 | bool "Nuvoton NUC93X CPU" | 600 | bool "Nuvoton NUC93X CPU" |
| 570 | select CPU_ARM926T | 601 | select CPU_ARM926T |
| 571 | select HAVE_CLK | ||
| 572 | select COMMON_CLKDEV | 602 | select COMMON_CLKDEV |
| 573 | help | 603 | help |
| 574 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a | 604 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a |
| @@ -577,8 +607,8 @@ config ARCH_NUC93X | |||
| 577 | config ARCH_PNX4008 | 607 | config ARCH_PNX4008 |
| 578 | bool "Philips Nexperia PNX4008 Mobile" | 608 | bool "Philips Nexperia PNX4008 Mobile" |
| 579 | select CPU_ARM926T | 609 | select CPU_ARM926T |
| 580 | select HAVE_CLK | ||
| 581 | select COMMON_CLKDEV | 610 | select COMMON_CLKDEV |
| 611 | select ARCH_USES_GETTIMEOFFSET | ||
| 582 | help | 612 | help |
| 583 | This enables support for Philips PNX4008 mobile platform. | 613 | This enables support for Philips PNX4008 mobile platform. |
| 584 | 614 | ||
| @@ -588,7 +618,6 @@ config ARCH_PXA | |||
| 588 | select ARCH_MTD_XIP | 618 | select ARCH_MTD_XIP |
| 589 | select ARCH_HAS_CPUFREQ | 619 | select ARCH_HAS_CPUFREQ |
| 590 | select GENERIC_GPIO | 620 | select GENERIC_GPIO |
| 591 | select HAVE_CLK | ||
| 592 | select COMMON_CLKDEV | 621 | select COMMON_CLKDEV |
| 593 | select ARCH_REQUIRE_GPIOLIB | 622 | select ARCH_REQUIRE_GPIOLIB |
| 594 | select GENERIC_TIME | 623 | select GENERIC_TIME |
| @@ -624,6 +653,7 @@ config ARCH_RPC | |||
| 624 | select ISA_DMA_API | 653 | select ISA_DMA_API |
| 625 | select NO_IOPORT | 654 | select NO_IOPORT |
| 626 | select ARCH_SPARSEMEM_ENABLE | 655 | select ARCH_SPARSEMEM_ENABLE |
| 656 | select ARCH_USES_GETTIMEOFFSET | ||
| 627 | help | 657 | help |
| 628 | On the Acorn Risc-PC, Linux can support the internal IDE disk and | 658 | On the Acorn Risc-PC, Linux can support the internal IDE disk and |
| 629 | CD-ROM interface, serial and parallel port, and the floppy drive. | 659 | CD-ROM interface, serial and parallel port, and the floppy drive. |
| @@ -650,6 +680,7 @@ config ARCH_S3C2410 | |||
| 650 | select GENERIC_GPIO | 680 | select GENERIC_GPIO |
| 651 | select ARCH_HAS_CPUFREQ | 681 | select ARCH_HAS_CPUFREQ |
| 652 | select HAVE_CLK | 682 | select HAVE_CLK |
| 683 | select ARCH_USES_GETTIMEOFFSET | ||
| 653 | help | 684 | help |
| 654 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics | 685 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics |
| 655 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or | 686 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or |
| @@ -663,6 +694,7 @@ config ARCH_S3C64XX | |||
| 663 | select ARM_VIC | 694 | select ARM_VIC |
| 664 | select HAVE_CLK | 695 | select HAVE_CLK |
| 665 | select NO_IOPORT | 696 | select NO_IOPORT |
| 697 | select ARCH_USES_GETTIMEOFFSET | ||
| 666 | select ARCH_HAS_CPUFREQ | 698 | select ARCH_HAS_CPUFREQ |
| 667 | select ARCH_REQUIRE_GPIOLIB | 699 | select ARCH_REQUIRE_GPIOLIB |
| 668 | select SAMSUNG_CLKSRC | 700 | select SAMSUNG_CLKSRC |
| @@ -719,6 +751,7 @@ config ARCH_SHARK | |||
| 719 | select ISA_DMA | 751 | select ISA_DMA |
| 720 | select ZONE_DMA | 752 | select ZONE_DMA |
| 721 | select PCI | 753 | select PCI |
| 754 | select ARCH_USES_GETTIMEOFFSET | ||
| 722 | help | 755 | help |
| 723 | Support for the StrongARM based Digital DNARD machine, also known | 756 | Support for the StrongARM based Digital DNARD machine, also known |
| 724 | as "Shark" (<http://www.shark-linux.de/shark.html>). | 757 | as "Shark" (<http://www.shark-linux.de/shark.html>). |
| @@ -728,6 +761,7 @@ config ARCH_LH7A40X | |||
| 728 | select CPU_ARM922T | 761 | select CPU_ARM922T |
| 729 | select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM | 762 | select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM |
| 730 | select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM | 763 | select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM |
| 764 | select ARCH_USES_GETTIMEOFFSET | ||
| 731 | help | 765 | help |
| 732 | Say Y here for systems based on one of the Sharp LH7A40X | 766 | Say Y here for systems based on one of the Sharp LH7A40X |
| 733 | System on a Chip processors. These CPUs include an ARM922T | 767 | System on a Chip processors. These CPUs include an ARM922T |
| @@ -743,7 +777,6 @@ config ARCH_U300 | |||
| 743 | select ARM_VIC | 777 | select ARM_VIC |
| 744 | select GENERIC_TIME | 778 | select GENERIC_TIME |
| 745 | select GENERIC_CLOCKEVENTS | 779 | select GENERIC_CLOCKEVENTS |
| 746 | select HAVE_CLK | ||
| 747 | select COMMON_CLKDEV | 780 | select COMMON_CLKDEV |
| 748 | select GENERIC_GPIO | 781 | select GENERIC_GPIO |
| 749 | help | 782 | help |
| @@ -756,6 +789,7 @@ config ARCH_U8500 | |||
| 756 | select GENERIC_TIME | 789 | select GENERIC_TIME |
| 757 | select GENERIC_CLOCKEVENTS | 790 | select GENERIC_CLOCKEVENTS |
| 758 | select COMMON_CLKDEV | 791 | select COMMON_CLKDEV |
| 792 | select ARCH_REQUIRE_GPIOLIB | ||
| 759 | help | 793 | help |
| 760 | Support for ST-Ericsson's Ux500 architecture | 794 | Support for ST-Ericsson's Ux500 architecture |
| 761 | 795 | ||
| @@ -764,7 +798,6 @@ config ARCH_NOMADIK | |||
| 764 | select ARM_AMBA | 798 | select ARM_AMBA |
| 765 | select ARM_VIC | 799 | select ARM_VIC |
| 766 | select CPU_ARM926T | 800 | select CPU_ARM926T |
| 767 | select HAVE_CLK | ||
| 768 | select COMMON_CLKDEV | 801 | select COMMON_CLKDEV |
| 769 | select GENERIC_TIME | 802 | select GENERIC_TIME |
| 770 | select GENERIC_CLOCKEVENTS | 803 | select GENERIC_CLOCKEVENTS |
| @@ -780,7 +813,6 @@ config ARCH_DAVINCI | |||
| 780 | select GENERIC_CLOCKEVENTS | 813 | select GENERIC_CLOCKEVENTS |
| 781 | select GENERIC_GPIO | 814 | select GENERIC_GPIO |
| 782 | select ARCH_REQUIRE_GPIOLIB | 815 | select ARCH_REQUIRE_GPIOLIB |
| 783 | select HAVE_CLK | ||
| 784 | select ZONE_DMA | 816 | select ZONE_DMA |
| 785 | select HAVE_IDE | 817 | select HAVE_IDE |
| 786 | select COMMON_CLKDEV | 818 | select COMMON_CLKDEV |
| @@ -801,6 +833,18 @@ config ARCH_OMAP | |||
| 801 | help | 833 | help |
| 802 | Support for TI's OMAP platform (OMAP1 and OMAP2). | 834 | Support for TI's OMAP platform (OMAP1 and OMAP2). |
| 803 | 835 | ||
| 836 | config PLAT_SPEAR | ||
| 837 | bool "ST SPEAr" | ||
| 838 | select ARM_AMBA | ||
| 839 | select ARCH_REQUIRE_GPIOLIB | ||
| 840 | select COMMON_CLKDEV | ||
| 841 | select GENERIC_CLOCKEVENTS | ||
| 842 | select GENERIC_GPIO | ||
| 843 | select GENERIC_TIME | ||
| 844 | select HAVE_CLK | ||
| 845 | help | ||
| 846 | Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). | ||
| 847 | |||
| 804 | endchoice | 848 | endchoice |
| 805 | 849 | ||
| 806 | # | 850 | # |
| @@ -886,6 +930,7 @@ source "arch/arm/plat-samsung/Kconfig" | |||
| 886 | source "arch/arm/plat-s3c24xx/Kconfig" | 930 | source "arch/arm/plat-s3c24xx/Kconfig" |
| 887 | source "arch/arm/plat-s5p/Kconfig" | 931 | source "arch/arm/plat-s5p/Kconfig" |
| 888 | source "arch/arm/plat-s5pc1xx/Kconfig" | 932 | source "arch/arm/plat-s5pc1xx/Kconfig" |
| 933 | source "arch/arm/plat-spear/Kconfig" | ||
| 889 | 934 | ||
| 890 | if ARCH_S3C2410 | 935 | if ARCH_S3C2410 |
| 891 | source "arch/arm/mach-s3c2400/Kconfig" | 936 | source "arch/arm/mach-s3c2400/Kconfig" |
| @@ -919,6 +964,8 @@ source "arch/arm/mach-ux500/Kconfig" | |||
| 919 | 964 | ||
| 920 | source "arch/arm/mach-versatile/Kconfig" | 965 | source "arch/arm/mach-versatile/Kconfig" |
| 921 | 966 | ||
| 967 | source "arch/arm/mach-vexpress/Kconfig" | ||
| 968 | |||
| 922 | source "arch/arm/mach-w90x900/Kconfig" | 969 | source "arch/arm/mach-w90x900/Kconfig" |
| 923 | 970 | ||
| 924 | # Definitions to make life easier | 971 | # Definitions to make life easier |
| @@ -936,6 +983,12 @@ config PLAT_ORION | |||
| 936 | config PLAT_PXA | 983 | config PLAT_PXA |
| 937 | bool | 984 | bool |
| 938 | 985 | ||
| 986 | config PLAT_VERSATILE | ||
| 987 | bool | ||
| 988 | |||
| 989 | config ARM_TIMER_SP804 | ||
| 990 | bool | ||
| 991 | |||
| 939 | source arch/arm/mm/Kconfig | 992 | source arch/arm/mm/Kconfig |
| 940 | 993 | ||
| 941 | config IWMMXT | 994 | config IWMMXT |
| @@ -1064,6 +1117,10 @@ config PCI | |||
| 1064 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or | 1117 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or |
| 1065 | VESA. If you have PCI, say Y, otherwise N. | 1118 | VESA. If you have PCI, say Y, otherwise N. |
| 1066 | 1119 | ||
| 1120 | config PCI_DOMAINS | ||
| 1121 | bool | ||
| 1122 | depends on PCI | ||
| 1123 | |||
| 1067 | config PCI_SYSCALL | 1124 | config PCI_SYSCALL |
| 1068 | def_bool PCI | 1125 | def_bool PCI |
| 1069 | 1126 | ||
| @@ -1092,10 +1149,11 @@ source "kernel/time/Kconfig" | |||
| 1092 | config SMP | 1149 | config SMP |
| 1093 | bool "Symmetric Multi-Processing (EXPERIMENTAL)" | 1150 | bool "Symmetric Multi-Processing (EXPERIMENTAL)" |
| 1094 | depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\ | 1151 | depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\ |
| 1095 | MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500) | 1152 | MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 ||\ |
| 1153 | ARCH_U8500 || ARCH_VEXPRESS_CA9X4) | ||
| 1096 | depends on GENERIC_CLOCKEVENTS | 1154 | depends on GENERIC_CLOCKEVENTS |
| 1097 | select USE_GENERIC_SMP_HELPERS | 1155 | select USE_GENERIC_SMP_HELPERS |
| 1098 | select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500) | 1156 | select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4) |
| 1099 | help | 1157 | help |
| 1100 | This enables support for systems with more than one CPU. If you have | 1158 | This enables support for systems with more than one CPU. If you have |
| 1101 | a system with only one CPU, like most personal computers, say N. If | 1159 | a system with only one CPU, like most personal computers, say N. If |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index ed820e737a8a..219cb4ee7e32 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
| @@ -175,9 +175,14 @@ machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx | |||
| 175 | machine-$(CONFIG_ARCH_U300) := u300 | 175 | machine-$(CONFIG_ARCH_U300) := u300 |
| 176 | machine-$(CONFIG_ARCH_U8500) := ux500 | 176 | machine-$(CONFIG_ARCH_U8500) := ux500 |
| 177 | machine-$(CONFIG_ARCH_VERSATILE) := versatile | 177 | machine-$(CONFIG_ARCH_VERSATILE) := versatile |
| 178 | machine-$(CONFIG_ARCH_VEXPRESS) := vexpress | ||
| 178 | machine-$(CONFIG_ARCH_W90X900) := w90x900 | 179 | machine-$(CONFIG_ARCH_W90X900) := w90x900 |
| 179 | machine-$(CONFIG_ARCH_NUC93X) := nuc93x | 180 | machine-$(CONFIG_ARCH_NUC93X) := nuc93x |
| 180 | machine-$(CONFIG_FOOTBRIDGE) := footbridge | 181 | machine-$(CONFIG_FOOTBRIDGE) := footbridge |
| 182 | machine-$(CONFIG_MACH_SPEAR300) := spear3xx | ||
| 183 | machine-$(CONFIG_MACH_SPEAR310) := spear3xx | ||
| 184 | machine-$(CONFIG_MACH_SPEAR320) := spear3xx | ||
| 185 | machine-$(CONFIG_MACH_SPEAR600) := spear6xx | ||
| 181 | 186 | ||
| 182 | # Platform directory name. This list is sorted alphanumerically | 187 | # Platform directory name. This list is sorted alphanumerically |
| 183 | # by CONFIG_* macro name. | 188 | # by CONFIG_* macro name. |
| @@ -192,6 +197,8 @@ plat-$(CONFIG_PLAT_PXA) := pxa | |||
| 192 | plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung | 197 | plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung |
| 193 | plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung | 198 | plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung |
| 194 | plat-$(CONFIG_PLAT_S5P) := s5p samsung | 199 | plat-$(CONFIG_PLAT_S5P) := s5p samsung |
| 200 | plat-$(CONFIG_PLAT_SPEAR) := spear | ||
| 201 | plat-$(CONFIG_PLAT_VERSATILE) := versatile | ||
| 195 | 202 | ||
| 196 | ifeq ($(CONFIG_ARCH_EBSA110),y) | 203 | ifeq ($(CONFIG_ARCH_EBSA110),y) |
| 197 | # This is what happens if you forget the IOCS16 line. | 204 | # 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 6416d5b5020d..4f8390dd6cac 100644 --- a/arch/arm/common/clkdev.c +++ b/arch/arm/common/clkdev.c | |||
| @@ -52,12 +52,13 @@ static struct clk *clk_find(const char *dev_id, const char *con_id) | |||
| 52 | continue; | 52 | continue; |
| 53 | match += 1; | 53 | match += 1; |
| 54 | } | 54 | } |
| 55 | if (match == 0) | ||
| 56 | continue; | ||
| 57 | 55 | ||
| 58 | if (match > best) { | 56 | if (match > best) { |
| 59 | clk = p->clk; | 57 | clk = p->clk; |
| 60 | best = match; | 58 | if (match != 3) |
| 59 | best = match; | ||
| 60 | else | ||
| 61 | break; | ||
| 61 | } | 62 | } |
| 62 | } | 63 | } |
| 63 | return clk; | 64 | 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/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/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/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/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..44bec1f02cb0 100644 --- a/arch/arm/include/asm/pmu.h +++ b/arch/arm/include/asm/pmu.h | |||
| @@ -12,6 +12,11 @@ | |||
| 12 | #ifndef __ARM_PMU_H__ | 12 | #ifndef __ARM_PMU_H__ |
| 13 | #define __ARM_PMU_H__ | 13 | #define __ARM_PMU_H__ |
| 14 | 14 | ||
| 15 | enum arm_pmu_type { | ||
| 16 | ARM_PMU_DEVICE_CPU = 0, | ||
| 17 | ARM_NUM_PMU_DEVICES, | ||
| 18 | }; | ||
| 19 | |||
| 15 | #ifdef CONFIG_CPU_HAS_PMU | 20 | #ifdef CONFIG_CPU_HAS_PMU |
| 16 | 21 | ||
| 17 | struct pmu_irqs { | 22 | struct pmu_irqs { |
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 ca88e6a84707..02f5d99adbc0 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
| @@ -137,7 +137,7 @@ extern unsigned int user_debug; | |||
| 137 | #define dmb() __asm__ __volatile__ ("" : : : "memory") | 137 | #define dmb() __asm__ __volatile__ ("" : : : "memory") |
| 138 | #endif | 138 | #endif |
| 139 | 139 | ||
| 140 | #if __LINUX_ARM_ARCH__ >= 7 || defined(CONFIG_SMP) | 140 | #if defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) |
| 141 | #define mb() dmb() | 141 | #define mb() dmb() |
| 142 | #define rmb() dmb() | 142 | #define rmb() dmb() |
| 143 | #define wmb() dmb() | 143 | #define wmb() dmb() |
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/smp.c b/arch/arm/kernel/smp.c index 577543f3857f..7a3cc0266934 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
| @@ -162,7 +162,7 @@ int __cpu_disable(void) | |||
| 162 | struct task_struct *p; | 162 | struct task_struct *p; |
| 163 | int ret; | 163 | int ret; |
| 164 | 164 | ||
| 165 | ret = mach_cpu_disable(cpu); | 165 | ret = platform_cpu_disable(cpu); |
| 166 | if (ret) | 166 | if (ret) |
| 167 | return ret; | 167 | return ret; |
| 168 | 168 | ||
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 2c27300f9daf..103976411a67 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
| @@ -97,6 +97,7 @@ config ARCH_AT572D940HF | |||
| 97 | 97 | ||
| 98 | config ARCH_AT91X40 | 98 | config ARCH_AT91X40 |
| 99 | bool "AT91x40" | 99 | bool "AT91x40" |
| 100 | select ARCH_USES_GETTIMEOFFSET | ||
| 100 | 101 | ||
| 101 | endchoice | 102 | endchoice |
| 102 | 103 | ||
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-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 44d4c2e8207b..1cb222daa06d 100644 --- a/arch/arm/mach-integrator/cpu.c +++ b/arch/arm/mach-integrator/cpu.c | |||
| @@ -20,32 +20,39 @@ | |||
| 20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
| 21 | 21 | ||
| 22 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
| 23 | #include <mach/platform.h> | ||
| 23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
| 24 | #include <asm/hardware/icst525.h> | 25 | #include <asm/hardware/icst.h> |
| 25 | 26 | ||
| 26 | static struct cpufreq_driver integrator_driver; | 27 | static struct cpufreq_driver integrator_driver; |
| 27 | 28 | ||
| 28 | #define CM_ID (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_ID_OFFSET) | 29 | #define CM_ID IO_ADDRESS(INTEGRATOR_HDR_ID) |
| 29 | #define CM_OSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_OSC_OFFSET) | 30 | #define CM_OSC IO_ADDRESS(INTEGRATOR_HDR_OSC) |
| 30 | #define CM_STAT (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_STAT_OFFSET) | 31 | #define CM_STAT IO_ADDRESS(INTEGRATOR_HDR_STAT) |
| 31 | #define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) | 32 | #define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) |
| 32 | 33 | ||
| 33 | static const struct icst525_params lclk_params = { | 34 | static const struct icst_params lclk_params = { |
| 34 | .ref = 24000, | 35 | .ref = 24000000, |
| 35 | .vco_max = 320000, | 36 | .vco_max = ICST525_VCO_MAX_5V, |
| 37 | .vco_min = ICST525_VCO_MIN, | ||
| 36 | .vd_min = 8, | 38 | .vd_min = 8, |
| 37 | .vd_max = 132, | 39 | .vd_max = 132, |
| 38 | .rd_min = 24, | 40 | .rd_min = 24, |
| 39 | .rd_max = 24, | 41 | .rd_max = 24, |
| 42 | .s2div = icst525_s2div, | ||
| 43 | .idx2s = icst525_idx2s, | ||
| 40 | }; | 44 | }; |
| 41 | 45 | ||
| 42 | static const struct icst525_params cclk_params = { | 46 | static const struct icst_params cclk_params = { |
| 43 | .ref = 24000, | 47 | .ref = 24000000, |
| 44 | .vco_max = 320000, | 48 | .vco_max = ICST525_VCO_MAX_5V, |
| 49 | .vco_min = ICST525_VCO_MIN, | ||
| 45 | .vd_min = 12, | 50 | .vd_min = 12, |
| 46 | .vd_max = 160, | 51 | .vd_max = 160, |
| 47 | .rd_min = 24, | 52 | .rd_min = 24, |
| 48 | .rd_max = 24, | 53 | .rd_max = 24, |
| 54 | .s2div = icst525_s2div, | ||
| 55 | .idx2s = icst525_idx2s, | ||
| 49 | }; | 56 | }; |
| 50 | 57 | ||
| 51 | /* | 58 | /* |
| @@ -53,17 +60,17 @@ static const struct icst525_params cclk_params = { | |||
| 53 | */ | 60 | */ |
| 54 | static int integrator_verify_policy(struct cpufreq_policy *policy) | 61 | static int integrator_verify_policy(struct cpufreq_policy *policy) |
| 55 | { | 62 | { |
| 56 | struct icst525_vco vco; | 63 | struct icst_vco vco; |
| 57 | 64 | ||
| 58 | cpufreq_verify_within_limits(policy, | 65 | cpufreq_verify_within_limits(policy, |
| 59 | policy->cpuinfo.min_freq, | 66 | policy->cpuinfo.min_freq, |
| 60 | policy->cpuinfo.max_freq); | 67 | policy->cpuinfo.max_freq); |
| 61 | 68 | ||
| 62 | vco = icst525_khz_to_vco(&cclk_params, policy->max); | 69 | vco = icst_hz_to_vco(&cclk_params, policy->max * 1000); |
| 63 | policy->max = icst525_khz(&cclk_params, vco); | 70 | policy->max = icst_hz(&cclk_params, vco) / 1000; |
| 64 | 71 | ||
| 65 | vco = icst525_khz_to_vco(&cclk_params, policy->min); | 72 | vco = icst_hz_to_vco(&cclk_params, policy->min * 1000); |
| 66 | policy->min = icst525_khz(&cclk_params, vco); | 73 | policy->min = icst_hz(&cclk_params, vco) / 1000; |
| 67 | 74 | ||
| 68 | cpufreq_verify_within_limits(policy, | 75 | cpufreq_verify_within_limits(policy, |
| 69 | policy->cpuinfo.min_freq, | 76 | policy->cpuinfo.min_freq, |
| @@ -79,7 +86,7 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
| 79 | { | 86 | { |
| 80 | cpumask_t cpus_allowed; | 87 | cpumask_t cpus_allowed; |
| 81 | int cpu = policy->cpu; | 88 | int cpu = policy->cpu; |
| 82 | struct icst525_vco vco; | 89 | struct icst_vco vco; |
| 83 | struct cpufreq_freqs freqs; | 90 | struct cpufreq_freqs freqs; |
| 84 | u_int cm_osc; | 91 | u_int cm_osc; |
| 85 | 92 | ||
| @@ -105,17 +112,17 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
| 105 | } | 112 | } |
| 106 | vco.v = cm_osc & 255; | 113 | vco.v = cm_osc & 255; |
| 107 | vco.r = 22; | 114 | vco.r = 22; |
| 108 | freqs.old = icst525_khz(&cclk_params, vco); | 115 | freqs.old = icst_hz(&cclk_params, vco) / 1000; |
| 109 | 116 | ||
| 110 | /* icst525_khz_to_vco rounds down -- so we need the next | 117 | /* icst_hz_to_vco rounds down -- so we need the next |
| 111 | * larger freq in case of CPUFREQ_RELATION_L. | 118 | * larger freq in case of CPUFREQ_RELATION_L. |
| 112 | */ | 119 | */ |
| 113 | if (relation == CPUFREQ_RELATION_L) | 120 | if (relation == CPUFREQ_RELATION_L) |
| 114 | target_freq += 999; | 121 | target_freq += 999; |
| 115 | if (target_freq > policy->max) | 122 | if (target_freq > policy->max) |
| 116 | target_freq = policy->max; | 123 | target_freq = policy->max; |
| 117 | vco = icst525_khz_to_vco(&cclk_params, target_freq); | 124 | vco = icst_hz_to_vco(&cclk_params, target_freq * 1000); |
| 118 | freqs.new = icst525_khz(&cclk_params, vco); | 125 | freqs.new = icst_hz(&cclk_params, vco) / 1000; |
| 119 | 126 | ||
| 120 | freqs.cpu = policy->cpu; | 127 | freqs.cpu = policy->cpu; |
| 121 | 128 | ||
| @@ -155,7 +162,7 @@ static unsigned int integrator_get(unsigned int cpu) | |||
| 155 | cpumask_t cpus_allowed; | 162 | cpumask_t cpus_allowed; |
| 156 | unsigned int current_freq; | 163 | unsigned int current_freq; |
| 157 | u_int cm_osc; | 164 | u_int cm_osc; |
| 158 | struct icst525_vco vco; | 165 | struct icst_vco vco; |
| 159 | 166 | ||
| 160 | cpus_allowed = current->cpus_allowed; | 167 | cpus_allowed = current->cpus_allowed; |
| 161 | 168 | ||
| @@ -173,7 +180,7 @@ static unsigned int integrator_get(unsigned int cpu) | |||
| 173 | vco.v = cm_osc & 255; | 180 | vco.v = cm_osc & 255; |
| 174 | vco.r = 22; | 181 | vco.r = 22; |
| 175 | 182 | ||
| 176 | current_freq = icst525_khz(&cclk_params, vco); /* current freq */ | 183 | current_freq = icst_hz(&cclk_params, vco) / 1000; /* current freq */ |
| 177 | 184 | ||
| 178 | set_cpus_allowed(current, cpus_allowed); | 185 | set_cpus_allowed(current, cpus_allowed); |
| 179 | 186 | ||
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 0058c937719e..1a0ee93e4519 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | #include <asm/clkdev.h> | 25 | #include <asm/clkdev.h> |
| 26 | #include <mach/clkdev.h> | 26 | #include <mach/clkdev.h> |
| 27 | #include <asm/hardware/icst525.h> | 27 | #include <asm/hardware/icst.h> |
| 28 | #include <mach/lm.h> | 28 | #include <mach/lm.h> |
| 29 | #include <mach/impd1.h> | 29 | #include <mach/impd1.h> |
| 30 | #include <asm/sizes.h> | 30 | #include <asm/sizes.h> |
| @@ -40,32 +40,25 @@ struct impd1_module { | |||
| 40 | struct clk_lookup *clks[3]; | 40 | struct clk_lookup *clks[3]; |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | static const struct icst525_params impd1_vco_params = { | 43 | static const struct icst_params impd1_vco_params = { |
| 44 | .ref = 24000, /* 24 MHz */ | 44 | .ref = 24000000, /* 24 MHz */ |
| 45 | .vco_max = 200000, /* 200 MHz */ | 45 | .vco_max = ICST525_VCO_MAX_3V, |
| 46 | .vco_min = ICST525_VCO_MIN, | ||
| 46 | .vd_min = 12, | 47 | .vd_min = 12, |
| 47 | .vd_max = 519, | 48 | .vd_max = 519, |
| 48 | .rd_min = 3, | 49 | .rd_min = 3, |
| 49 | .rd_max = 120, | 50 | .rd_max = 120, |
| 51 | .s2div = icst525_s2div, | ||
| 52 | .idx2s = icst525_idx2s, | ||
| 50 | }; | 53 | }; |
| 51 | 54 | ||
| 52 | static void impd1_setvco(struct clk *clk, struct icst525_vco vco) | 55 | static void impd1_setvco(struct clk *clk, struct icst_vco vco) |
| 53 | { | 56 | { |
| 54 | struct impd1_module *impd1 = clk->data; | 57 | struct impd1_module *impd1 = clk->data; |
| 55 | int vconr = clk - impd1->vcos; | 58 | u32 val = vco.v | (vco.r << 9) | (vco.s << 16); |
| 56 | u32 val; | ||
| 57 | |||
| 58 | val = vco.v | (vco.r << 9) | (vco.s << 16); | ||
| 59 | 59 | ||
| 60 | writel(0xa05f, impd1->base + IMPD1_LOCK); | 60 | writel(0xa05f, impd1->base + IMPD1_LOCK); |
| 61 | switch (vconr) { | 61 | writel(val, clk->vcoreg); |
| 62 | case 0: | ||
| 63 | writel(val, impd1->base + IMPD1_OSC1); | ||
| 64 | break; | ||
| 65 | case 1: | ||
| 66 | writel(val, impd1->base + IMPD1_OSC2); | ||
| 67 | break; | ||
| 68 | } | ||
| 69 | writel(0, impd1->base + IMPD1_LOCK); | 62 | writel(0, impd1->base + IMPD1_LOCK); |
| 70 | 63 | ||
| 71 | #ifdef DEBUG | 64 | #ifdef DEBUG |
| @@ -73,11 +66,17 @@ static void impd1_setvco(struct clk *clk, struct icst525_vco vco) | |||
| 73 | vco.r = (val >> 9) & 0x7f; | 66 | vco.r = (val >> 9) & 0x7f; |
| 74 | vco.s = (val >> 16) & 7; | 67 | vco.s = (val >> 16) & 7; |
| 75 | 68 | ||
| 76 | pr_debug("IM-PD1: VCO%d clock is %ld kHz\n", | 69 | pr_debug("IM-PD1: VCO%d clock is %ld Hz\n", |
| 77 | vconr, icst525_khz(&impd1_vco_params, vco)); | 70 | vconr, icst525_hz(&impd1_vco_params, vco)); |
| 78 | #endif | 71 | #endif |
| 79 | } | 72 | } |
| 80 | 73 | ||
| 74 | static const struct clk_ops impd1_clk_ops = { | ||
| 75 | .round = icst_clk_round, | ||
| 76 | .set = icst_clk_set, | ||
| 77 | .setvco = impd1_setvco, | ||
| 78 | }; | ||
| 79 | |||
| 81 | void impd1_tweak_control(struct device *dev, u32 mask, u32 val) | 80 | void impd1_tweak_control(struct device *dev, u32 mask, u32 val) |
| 82 | { | 81 | { |
| 83 | struct impd1_module *impd1 = dev_get_drvdata(dev); | 82 | struct impd1_module *impd1 = dev_get_drvdata(dev); |
| @@ -373,11 +372,13 @@ static int impd1_probe(struct lm_device *dev) | |||
| 373 | (unsigned long)dev->resource.start); | 372 | (unsigned long)dev->resource.start); |
| 374 | 373 | ||
| 375 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { | 374 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { |
| 375 | impd1->vcos[i].ops = &impd1_clk_ops, | ||
| 376 | impd1->vcos[i].owner = THIS_MODULE, | 376 | impd1->vcos[i].owner = THIS_MODULE, |
| 377 | impd1->vcos[i].params = &impd1_vco_params, | 377 | impd1->vcos[i].params = &impd1_vco_params, |
| 378 | impd1->vcos[i].data = impd1, | 378 | impd1->vcos[i].data = impd1; |
| 379 | impd1->vcos[i].setvco = impd1_setvco; | ||
| 380 | } | 379 | } |
| 380 | impd1->vcos[0].vcoreg = impd1->base + IMPD1_OSC1; | ||
| 381 | impd1->vcos[1].vcoreg = impd1->base + IMPD1_OSC2; | ||
| 381 | 382 | ||
| 382 | impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", | 383 | impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", |
| 383 | dev->id); | 384 | 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 66ef86d6d9e3..54edb6b8504f 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 148d25fc636f..e5491629c6da 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
| 31 | 31 | ||
| 32 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
| 33 | #include <mach/platform.h> | ||
| 33 | #include <asm/irq.h> | 34 | #include <asm/irq.h> |
| 34 | #include <asm/signal.h> | 35 | #include <asm/signal.h> |
| 35 | #include <asm/system.h> | 36 | #include <asm/system.h> |
| @@ -390,9 +391,9 @@ static int __init pci_v3_setup_resources(struct resource **resource) | |||
| 390 | * means I can't get additional information on the reason for the pm2fb | 391 | * means I can't get additional information on the reason for the pm2fb |
| 391 | * problems. I suppose I'll just have to mind-meld with the machine. ;) | 392 | * problems. I suppose I'll just have to mind-meld with the machine. ;) |
| 392 | */ | 393 | */ |
| 393 | #define SC_PCI (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_PCIENABLE_OFFSET) | 394 | #define SC_PCI IO_ADDRESS(INTEGRATOR_SC_PCIENABLE) |
| 394 | #define SC_LBFADDR (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x20) | 395 | #define SC_LBFADDR IO_ADDRESS(INTEGRATOR_SC_BASE + 0x20) |
| 395 | #define SC_LBFCODE (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x24) | 396 | #define SC_LBFCODE IO_ADDRESS(INTEGRATOR_SC_BASE + 0x24) |
| 396 | 397 | ||
| 397 | static int | 398 | static int |
| 398 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | 399 | 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 2a5c637639bb..266b1f58a784 100644 --- a/arch/arm/mach-iop32x/n2100.c +++ b/arch/arm/mach-iop32x/n2100.c | |||
| @@ -177,7 +177,7 @@ static struct plat_serial8250_port n2100_serial_port[] = { | |||
| 177 | .mapbase = N2100_UART, | 177 | .mapbase = N2100_UART, |
| 178 | .membase = (char *)N2100_UART, | 178 | .membase = (char *)N2100_UART, |
| 179 | .irq = 0, | 179 | .irq = 0, |
| 180 | .flags = UPF_SKIP_TEST, | 180 | .flags = UPF_SKIP_TEST | UPF_AUTO_IRQ | UPF_SHARE_IRQ, |
| 181 | .iotype = UPIO_MEM, | 181 | .iotype = UPIO_MEM, |
| 182 | .regshift = 0, | 182 | .regshift = 0, |
| 183 | .uartclk = 1843200, | 183 | .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-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 23e4d7733610..4a1c2328bcc3 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 c6649472ce0d..aa3e20915d72 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-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 90bd4ef71b2c..1b468bd490af 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> |
| @@ -39,7 +37,7 @@ | |||
| 39 | #include <asm/leds.h> | 37 | #include <asm/leds.h> |
| 40 | #include <asm/mach-types.h> | 38 | #include <asm/mach-types.h> |
| 41 | #include <asm/hardware/arm_timer.h> | 39 | #include <asm/hardware/arm_timer.h> |
| 42 | #include <asm/hardware/icst307.h> | 40 | #include <asm/hardware/icst.h> |
| 43 | 41 | ||
| 44 | #include <asm/mach/arch.h> | 42 | #include <asm/mach/arch.h> |
| 45 | #include <asm/mach/flash.h> | 43 | #include <asm/mach/flash.h> |
| @@ -48,13 +46,12 @@ | |||
| 48 | 46 | ||
| 49 | #include <asm/hardware/gic.h> | 47 | #include <asm/hardware/gic.h> |
| 50 | 48 | ||
| 49 | #include <mach/clkdev.h> | ||
| 51 | #include <mach/platform.h> | 50 | #include <mach/platform.h> |
| 52 | #include <mach/irqs.h> | 51 | #include <mach/irqs.h> |
| 52 | #include <plat/timer-sp.h> | ||
| 53 | 53 | ||
| 54 | #include "core.h" | 54 | #include "core.h" |
| 55 | #include "clock.h" | ||
| 56 | |||
| 57 | #define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) | ||
| 58 | 55 | ||
| 59 | /* used by entry-macro.S and platsmp.c */ | 56 | /* used by entry-macro.S and platsmp.c */ |
| 60 | void __iomem *gic_cpu_base_addr; | 57 | void __iomem *gic_cpu_base_addr; |
| @@ -78,20 +75,6 @@ void __init realview_adjust_zones(int node, unsigned long *size, | |||
| 78 | } | 75 | } |
| 79 | #endif | 76 | #endif |
| 80 | 77 | ||
| 81 | /* | ||
| 82 | * This is the RealView sched_clock implementation. This has | ||
| 83 | * a resolution of 41.7ns, and a maximum value of about 179s. | ||
| 84 | */ | ||
| 85 | unsigned long long sched_clock(void) | ||
| 86 | { | ||
| 87 | unsigned long long v; | ||
| 88 | |||
| 89 | v = (unsigned long long)readl(REALVIEW_REFCOUNTER) * 125; | ||
| 90 | do_div(v, 3); | ||
| 91 | |||
| 92 | return v; | ||
| 93 | } | ||
| 94 | |||
| 95 | 78 | ||
| 96 | #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) | 79 | #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) |
| 97 | 80 | ||
| @@ -273,37 +256,40 @@ struct mmci_platform_data realview_mmc1_plat_data = { | |||
| 273 | /* | 256 | /* |
| 274 | * Clock handling | 257 | * Clock handling |
| 275 | */ | 258 | */ |
| 276 | static const struct icst307_params realview_oscvco_params = { | 259 | static const struct icst_params realview_oscvco_params = { |
| 277 | .ref = 24000, | 260 | .ref = 24000000, |
| 278 | .vco_max = 200000, | 261 | .vco_max = ICST307_VCO_MAX, |
| 262 | .vco_min = ICST307_VCO_MIN, | ||
| 279 | .vd_min = 4 + 8, | 263 | .vd_min = 4 + 8, |
| 280 | .vd_max = 511 + 8, | 264 | .vd_max = 511 + 8, |
| 281 | .rd_min = 1 + 2, | 265 | .rd_min = 1 + 2, |
| 282 | .rd_max = 127 + 2, | 266 | .rd_max = 127 + 2, |
| 267 | .s2div = icst307_s2div, | ||
| 268 | .idx2s = icst307_idx2s, | ||
| 283 | }; | 269 | }; |
| 284 | 270 | ||
| 285 | static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco) | 271 | static void realview_oscvco_set(struct clk *clk, struct icst_vco vco) |
| 286 | { | 272 | { |
| 287 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; | 273 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; |
| 288 | void __iomem *sys_osc; | ||
| 289 | u32 val; | 274 | u32 val; |
| 290 | 275 | ||
| 291 | if (machine_is_realview_pb1176()) | 276 | val = readl(clk->vcoreg) & ~0x7ffff; |
| 292 | sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; | ||
| 293 | else | ||
| 294 | sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; | ||
| 295 | |||
| 296 | val = readl(sys_osc) & ~0x7ffff; | ||
| 297 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 277 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
| 298 | 278 | ||
| 299 | writel(0xa05f, sys_lock); | 279 | writel(0xa05f, sys_lock); |
| 300 | writel(val, sys_osc); | 280 | writel(val, clk->vcoreg); |
| 301 | writel(0, sys_lock); | 281 | writel(0, sys_lock); |
| 302 | } | 282 | } |
| 303 | 283 | ||
| 284 | static const struct clk_ops oscvco_clk_ops = { | ||
| 285 | .round = icst_clk_round, | ||
| 286 | .set = icst_clk_set, | ||
| 287 | .setvco = realview_oscvco_set, | ||
| 288 | }; | ||
| 289 | |||
| 304 | static struct clk oscvco_clk = { | 290 | static struct clk oscvco_clk = { |
| 291 | .ops = &oscvco_clk_ops, | ||
| 305 | .params = &realview_oscvco_params, | 292 | .params = &realview_oscvco_params, |
| 306 | .setvco = realview_oscvco_set, | ||
| 307 | }; | 293 | }; |
| 308 | 294 | ||
| 309 | /* | 295 | /* |
| @@ -346,7 +332,13 @@ static struct clk_lookup lookups[] = { | |||
| 346 | 332 | ||
| 347 | static int __init clk_init(void) | 333 | static int __init clk_init(void) |
| 348 | { | 334 | { |
| 335 | if (machine_is_realview_pb1176()) | ||
| 336 | oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; | ||
| 337 | else | ||
| 338 | oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; | ||
| 339 | |||
| 349 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 340 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 341 | |||
| 350 | return 0; | 342 | return 0; |
| 351 | } | 343 | } |
| 352 | arch_initcall(clk_init); | 344 | arch_initcall(clk_init); |
| @@ -643,133 +635,6 @@ void __iomem *timer2_va_base; | |||
| 643 | void __iomem *timer3_va_base; | 635 | void __iomem *timer3_va_base; |
| 644 | 636 | ||
| 645 | /* | 637 | /* |
| 646 | * How long is the timer interval? | ||
| 647 | */ | ||
| 648 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
| 649 | #if TIMER_INTERVAL >= 0x100000 | ||
| 650 | #define TIMER_RELOAD (TIMER_INTERVAL >> 8) | ||
| 651 | #define TIMER_DIVISOR (TIMER_CTRL_DIV256) | ||
| 652 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
| 653 | #elif TIMER_INTERVAL >= 0x10000 | ||
| 654 | #define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */ | ||
| 655 | #define TIMER_DIVISOR (TIMER_CTRL_DIV16) | ||
| 656 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
| 657 | #else | ||
| 658 | #define TIMER_RELOAD (TIMER_INTERVAL) | ||
| 659 | #define TIMER_DIVISOR (TIMER_CTRL_DIV1) | ||
| 660 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
| 661 | #endif | ||
| 662 | |||
| 663 | static void timer_set_mode(enum clock_event_mode mode, | ||
| 664 | struct clock_event_device *clk) | ||
| 665 | { | ||
| 666 | unsigned long ctrl; | ||
| 667 | |||
| 668 | switch(mode) { | ||
| 669 | case CLOCK_EVT_MODE_PERIODIC: | ||
| 670 | writel(TIMER_RELOAD, timer0_va_base + TIMER_LOAD); | ||
| 671 | |||
| 672 | ctrl = TIMER_CTRL_PERIODIC; | ||
| 673 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE; | ||
| 674 | break; | ||
| 675 | case CLOCK_EVT_MODE_ONESHOT: | ||
| 676 | /* period set, and timer enabled in 'next_event' hook */ | ||
| 677 | ctrl = TIMER_CTRL_ONESHOT; | ||
| 678 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE; | ||
| 679 | break; | ||
| 680 | case CLOCK_EVT_MODE_UNUSED: | ||
| 681 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
| 682 | default: | ||
| 683 | ctrl = 0; | ||
| 684 | } | ||
| 685 | |||
| 686 | writel(ctrl, timer0_va_base + TIMER_CTRL); | ||
| 687 | } | ||
| 688 | |||
| 689 | static int timer_set_next_event(unsigned long evt, | ||
| 690 | struct clock_event_device *unused) | ||
| 691 | { | ||
| 692 | unsigned long ctrl = readl(timer0_va_base + TIMER_CTRL); | ||
| 693 | |||
| 694 | writel(evt, timer0_va_base + TIMER_LOAD); | ||
| 695 | writel(ctrl | TIMER_CTRL_ENABLE, timer0_va_base + TIMER_CTRL); | ||
| 696 | |||
| 697 | return 0; | ||
| 698 | } | ||
| 699 | |||
| 700 | static struct clock_event_device timer0_clockevent = { | ||
| 701 | .name = "timer0", | ||
| 702 | .shift = 32, | ||
| 703 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
| 704 | .set_mode = timer_set_mode, | ||
| 705 | .set_next_event = timer_set_next_event, | ||
| 706 | .rating = 300, | ||
| 707 | .cpumask = cpu_all_mask, | ||
| 708 | }; | ||
| 709 | |||
| 710 | static void __init realview_clockevents_init(unsigned int timer_irq) | ||
| 711 | { | ||
| 712 | timer0_clockevent.irq = timer_irq; | ||
| 713 | timer0_clockevent.mult = | ||
| 714 | div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift); | ||
| 715 | timer0_clockevent.max_delta_ns = | ||
| 716 | clockevent_delta2ns(0xffffffff, &timer0_clockevent); | ||
| 717 | timer0_clockevent.min_delta_ns = | ||
| 718 | clockevent_delta2ns(0xf, &timer0_clockevent); | ||
| 719 | |||
| 720 | clockevents_register_device(&timer0_clockevent); | ||
| 721 | } | ||
| 722 | |||
| 723 | /* | ||
| 724 | * IRQ handler for the timer | ||
| 725 | */ | ||
| 726 | static irqreturn_t realview_timer_interrupt(int irq, void *dev_id) | ||
| 727 | { | ||
| 728 | struct clock_event_device *evt = &timer0_clockevent; | ||
| 729 | |||
| 730 | /* clear the interrupt */ | ||
| 731 | writel(1, timer0_va_base + TIMER_INTCLR); | ||
| 732 | |||
| 733 | evt->event_handler(evt); | ||
| 734 | |||
| 735 | return IRQ_HANDLED; | ||
| 736 | } | ||
| 737 | |||
| 738 | static struct irqaction realview_timer_irq = { | ||
| 739 | .name = "RealView Timer Tick", | ||
| 740 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
| 741 | .handler = realview_timer_interrupt, | ||
| 742 | }; | ||
| 743 | |||
| 744 | static cycle_t realview_get_cycles(struct clocksource *cs) | ||
| 745 | { | ||
| 746 | return ~readl(timer3_va_base + TIMER_VALUE); | ||
| 747 | } | ||
| 748 | |||
| 749 | static struct clocksource clocksource_realview = { | ||
| 750 | .name = "timer3", | ||
| 751 | .rating = 200, | ||
| 752 | .read = realview_get_cycles, | ||
| 753 | .mask = CLOCKSOURCE_MASK(32), | ||
| 754 | .shift = 20, | ||
| 755 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
| 756 | }; | ||
| 757 | |||
| 758 | static void __init realview_clocksource_init(void) | ||
| 759 | { | ||
| 760 | /* setup timer 0 as free-running clocksource */ | ||
| 761 | writel(0, timer3_va_base + TIMER_CTRL); | ||
| 762 | writel(0xffffffff, timer3_va_base + TIMER_LOAD); | ||
| 763 | writel(0xffffffff, timer3_va_base + TIMER_VALUE); | ||
| 764 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | ||
| 765 | timer3_va_base + TIMER_CTRL); | ||
| 766 | |||
| 767 | clocksource_realview.mult = | ||
| 768 | clocksource_khz2mult(1000, clocksource_realview.shift); | ||
| 769 | clocksource_register(&clocksource_realview); | ||
| 770 | } | ||
| 771 | |||
| 772 | /* | ||
| 773 | * Set up the clock source and clock events devices | 638 | * Set up the clock source and clock events devices |
| 774 | */ | 639 | */ |
| 775 | void __init realview_timer_init(unsigned int timer_irq) | 640 | void __init realview_timer_init(unsigned int timer_irq) |
| @@ -796,13 +661,8 @@ void __init realview_timer_init(unsigned int timer_irq) | |||
| 796 | writel(0, timer2_va_base + TIMER_CTRL); | 661 | writel(0, timer2_va_base + TIMER_CTRL); |
| 797 | writel(0, timer3_va_base + TIMER_CTRL); | 662 | writel(0, timer3_va_base + TIMER_CTRL); |
| 798 | 663 | ||
| 799 | /* | 664 | sp804_clocksource_init(timer3_va_base); |
| 800 | * Make irqs happen for the system timer | 665 | sp804_clockevents_init(timer0_va_base, timer_irq); |
| 801 | */ | ||
| 802 | setup_irq(timer_irq, &realview_timer_irq); | ||
| 803 | |||
| 804 | realview_clocksource_init(); | ||
| 805 | realview_clockevents_init(timer_irq); | ||
| 806 | } | 666 | } |
| 807 | 667 | ||
| 808 | /* | 668 | /* |
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-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 109f5a6e71c7..783f1236fe1b 100644 --- a/arch/arm/mach-u300/mmc.c +++ b/arch/arm/mach-u300/mmc.c | |||
| @@ -101,11 +101,12 @@ int __devinit mmc_init(struct amba_device *adev) | |||
| 101 | * we have a regulator we can control instead. | 101 | * we have a regulator we can control instead. |
| 102 | */ | 102 | */ |
| 103 | /* Nominally 2.85V on our platform */ | 103 | /* Nominally 2.85V on our platform */ |
| 104 | mmci_card->mmc0_plat_data.f_max = 24000000; | ||
| 104 | mmci_card->mmc0_plat_data.status = mmc_status; | 105 | mmci_card->mmc0_plat_data.status = mmc_status; |
| 105 | mmci_card->mmc0_plat_data.gpio_wp = -1; | 106 | mmci_card->mmc0_plat_data.gpio_wp = -1; |
| 106 | mmci_card->mmc0_plat_data.gpio_cd = -1; | 107 | mmci_card->mmc0_plat_data.gpio_cd = -1; |
| 107 | mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED | | 108 | mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED | |
| 108 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA; | 109 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; |
| 109 | 110 | ||
| 110 | mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; | 111 | mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; |
| 111 | 112 | ||
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 9ddb49b1cb71..60baba65635e 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
| @@ -28,18 +28,14 @@ | |||
| 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 | 32 | ||
| 36 | #include <asm/clkdev.h> | 33 | #include <asm/clkdev.h> |
| 37 | #include <asm/system.h> | 34 | #include <asm/system.h> |
| 38 | #include <mach/hardware.h> | ||
| 39 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
| 40 | #include <asm/leds.h> | 36 | #include <asm/leds.h> |
| 41 | #include <asm/hardware/arm_timer.h> | 37 | #include <asm/hardware/arm_timer.h> |
| 42 | #include <asm/hardware/icst307.h> | 38 | #include <asm/hardware/icst.h> |
| 43 | #include <asm/hardware/vic.h> | 39 | #include <asm/hardware/vic.h> |
| 44 | #include <asm/mach-types.h> | 40 | #include <asm/mach-types.h> |
| 45 | 41 | ||
| @@ -48,9 +44,12 @@ | |||
| 48 | #include <asm/mach/irq.h> | 44 | #include <asm/mach/irq.h> |
| 49 | #include <asm/mach/time.h> | 45 | #include <asm/mach/time.h> |
| 50 | #include <asm/mach/map.h> | 46 | #include <asm/mach/map.h> |
| 47 | #include <mach/clkdev.h> | ||
| 48 | #include <mach/hardware.h> | ||
| 49 | #include <mach/platform.h> | ||
| 50 | #include <plat/timer-sp.h> | ||
| 51 | 51 | ||
| 52 | #include "core.h" | 52 | #include "core.h" |
| 53 | #include "clock.h" | ||
| 54 | 53 | ||
| 55 | /* | 54 | /* |
| 56 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx | 55 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx |
| @@ -58,7 +57,6 @@ | |||
| 58 | * | 57 | * |
| 59 | * Setup a VA for the Versatile Vectored Interrupt Controller. | 58 | * Setup a VA for the Versatile Vectored Interrupt Controller. |
| 60 | */ | 59 | */ |
| 61 | #define __io_address(n) __io(IO_ADDRESS(n)) | ||
| 62 | #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) | 60 | #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) |
| 63 | #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) | 61 | #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) |
| 64 | 62 | ||
| @@ -228,27 +226,6 @@ void __init versatile_map_io(void) | |||
| 228 | iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); | 226 | iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); |
| 229 | } | 227 | } |
| 230 | 228 | ||
| 231 | #define VERSATILE_REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET) | ||
| 232 | |||
| 233 | /* | ||
| 234 | * This is the Versatile sched_clock implementation. This has | ||
| 235 | * a resolution of 41.7ns, and a maximum value of about 35583 days. | ||
| 236 | * | ||
| 237 | * The return value is guaranteed to be monotonic in that range as | ||
| 238 | * long as there is always less than 89 seconds between successive | ||
| 239 | * calls to this function. | ||
| 240 | */ | ||
| 241 | unsigned long long sched_clock(void) | ||
| 242 | { | ||
| 243 | unsigned long long v = cnt32_to_63(readl(VERSATILE_REFCOUNTER)); | ||
| 244 | |||
| 245 | /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */ | ||
| 246 | v *= 125<<1; | ||
| 247 | do_div(v, 3<<1); | ||
| 248 | |||
| 249 | return v; | ||
| 250 | } | ||
| 251 | |||
| 252 | 229 | ||
| 253 | #define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) | 230 | #define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) |
| 254 | 231 | ||
| @@ -379,33 +356,40 @@ static struct mmci_platform_data mmc0_plat_data = { | |||
| 379 | /* | 356 | /* |
| 380 | * Clock handling | 357 | * Clock handling |
| 381 | */ | 358 | */ |
| 382 | static const struct icst307_params versatile_oscvco_params = { | 359 | static const struct icst_params versatile_oscvco_params = { |
| 383 | .ref = 24000, | 360 | .ref = 24000000, |
| 384 | .vco_max = 200000, | 361 | .vco_max = ICST307_VCO_MAX, |
| 362 | .vco_min = ICST307_VCO_MIN, | ||
| 385 | .vd_min = 4 + 8, | 363 | .vd_min = 4 + 8, |
| 386 | .vd_max = 511 + 8, | 364 | .vd_max = 511 + 8, |
| 387 | .rd_min = 1 + 2, | 365 | .rd_min = 1 + 2, |
| 388 | .rd_max = 127 + 2, | 366 | .rd_max = 127 + 2, |
| 367 | .s2div = icst307_s2div, | ||
| 368 | .idx2s = icst307_idx2s, | ||
| 389 | }; | 369 | }; |
| 390 | 370 | ||
| 391 | static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) | 371 | static void versatile_oscvco_set(struct clk *clk, struct icst_vco vco) |
| 392 | { | 372 | { |
| 393 | void __iomem *sys = __io_address(VERSATILE_SYS_BASE); | 373 | void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; |
| 394 | void __iomem *sys_lock = sys + VERSATILE_SYS_LOCK_OFFSET; | ||
| 395 | u32 val; | 374 | u32 val; |
| 396 | 375 | ||
| 397 | val = readl(sys + clk->oscoff) & ~0x7ffff; | 376 | val = readl(clk->vcoreg) & ~0x7ffff; |
| 398 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 377 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
| 399 | 378 | ||
| 400 | writel(0xa05f, sys_lock); | 379 | writel(0xa05f, sys_lock); |
| 401 | writel(val, sys + clk->oscoff); | 380 | writel(val, clk->vcoreg); |
| 402 | writel(0, sys_lock); | 381 | writel(0, sys_lock); |
| 403 | } | 382 | } |
| 404 | 383 | ||
| 384 | static const struct clk_ops osc4_clk_ops = { | ||
| 385 | .round = icst_clk_round, | ||
| 386 | .set = icst_clk_set, | ||
| 387 | .setvco = versatile_oscvco_set, | ||
| 388 | }; | ||
| 389 | |||
| 405 | static struct clk osc4_clk = { | 390 | static struct clk osc4_clk = { |
| 391 | .ops = &osc4_clk_ops, | ||
| 406 | .params = &versatile_oscvco_params, | 392 | .params = &versatile_oscvco_params, |
| 407 | .oscoff = VERSATILE_SYS_OSCCLCD_OFFSET, | ||
| 408 | .setvco = versatile_oscvco_set, | ||
| 409 | }; | 393 | }; |
| 410 | 394 | ||
| 411 | /* | 395 | /* |
| @@ -851,6 +835,8 @@ void __init versatile_init(void) | |||
| 851 | { | 835 | { |
| 852 | int i; | 836 | int i; |
| 853 | 837 | ||
| 838 | osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET; | ||
| 839 | |||
| 854 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 840 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 855 | 841 | ||
| 856 | platform_device_register(&versatile_flash_device); | 842 | platform_device_register(&versatile_flash_device); |
| @@ -874,120 +860,6 @@ void __init versatile_init(void) | |||
| 874 | #define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20) | 860 | #define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20) |
| 875 | #define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE) | 861 | #define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE) |
| 876 | #define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20) | 862 | #define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20) |
| 877 | #define VA_IC_BASE __io_address(VERSATILE_VIC_BASE) | ||
| 878 | |||
| 879 | /* | ||
| 880 | * How long is the timer interval? | ||
| 881 | */ | ||
| 882 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
| 883 | #if TIMER_INTERVAL >= 0x100000 | ||
| 884 | #define TIMER_RELOAD (TIMER_INTERVAL >> 8) | ||
| 885 | #define TIMER_DIVISOR (TIMER_CTRL_DIV256) | ||
| 886 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
| 887 | #elif TIMER_INTERVAL >= 0x10000 | ||
| 888 | #define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */ | ||
| 889 | #define TIMER_DIVISOR (TIMER_CTRL_DIV16) | ||
| 890 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
| 891 | #else | ||
| 892 | #define TIMER_RELOAD (TIMER_INTERVAL) | ||
| 893 | #define TIMER_DIVISOR (TIMER_CTRL_DIV1) | ||
| 894 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
| 895 | #endif | ||
| 896 | |||
| 897 | static void timer_set_mode(enum clock_event_mode mode, | ||
| 898 | struct clock_event_device *clk) | ||
| 899 | { | ||
| 900 | unsigned long ctrl; | ||
| 901 | |||
| 902 | switch(mode) { | ||
| 903 | case CLOCK_EVT_MODE_PERIODIC: | ||
| 904 | writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD); | ||
| 905 | |||
| 906 | ctrl = TIMER_CTRL_PERIODIC; | ||
| 907 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE; | ||
| 908 | break; | ||
| 909 | case CLOCK_EVT_MODE_ONESHOT: | ||
| 910 | /* period set, and timer enabled in 'next_event' hook */ | ||
| 911 | ctrl = TIMER_CTRL_ONESHOT; | ||
| 912 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE; | ||
| 913 | break; | ||
| 914 | case CLOCK_EVT_MODE_UNUSED: | ||
| 915 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
| 916 | default: | ||
| 917 | ctrl = 0; | ||
| 918 | } | ||
| 919 | |||
| 920 | writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL); | ||
| 921 | } | ||
| 922 | |||
| 923 | static int timer_set_next_event(unsigned long evt, | ||
| 924 | struct clock_event_device *unused) | ||
| 925 | { | ||
| 926 | unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL); | ||
| 927 | |||
| 928 | writel(evt, TIMER0_VA_BASE + TIMER_LOAD); | ||
| 929 | writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL); | ||
| 930 | |||
| 931 | return 0; | ||
| 932 | } | ||
| 933 | |||
| 934 | static struct clock_event_device timer0_clockevent = { | ||
| 935 | .name = "timer0", | ||
| 936 | .shift = 32, | ||
| 937 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
| 938 | .set_mode = timer_set_mode, | ||
| 939 | .set_next_event = timer_set_next_event, | ||
| 940 | }; | ||
| 941 | |||
| 942 | /* | ||
| 943 | * IRQ handler for the timer | ||
| 944 | */ | ||
| 945 | static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id) | ||
| 946 | { | ||
| 947 | struct clock_event_device *evt = &timer0_clockevent; | ||
| 948 | |||
| 949 | writel(1, TIMER0_VA_BASE + TIMER_INTCLR); | ||
| 950 | |||
| 951 | evt->event_handler(evt); | ||
| 952 | |||
| 953 | return IRQ_HANDLED; | ||
| 954 | } | ||
| 955 | |||
| 956 | static struct irqaction versatile_timer_irq = { | ||
| 957 | .name = "Versatile Timer Tick", | ||
| 958 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
| 959 | .handler = versatile_timer_interrupt, | ||
| 960 | }; | ||
| 961 | |||
| 962 | static cycle_t versatile_get_cycles(struct clocksource *cs) | ||
| 963 | { | ||
| 964 | return ~readl(TIMER3_VA_BASE + TIMER_VALUE); | ||
| 965 | } | ||
| 966 | |||
| 967 | static struct clocksource clocksource_versatile = { | ||
| 968 | .name = "timer3", | ||
| 969 | .rating = 200, | ||
| 970 | .read = versatile_get_cycles, | ||
| 971 | .mask = CLOCKSOURCE_MASK(32), | ||
| 972 | .shift = 20, | ||
| 973 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
| 974 | }; | ||
| 975 | |||
| 976 | static int __init versatile_clocksource_init(void) | ||
| 977 | { | ||
| 978 | /* setup timer3 as free-running clocksource */ | ||
| 979 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); | ||
| 980 | writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD); | ||
| 981 | writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE); | ||
| 982 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | ||
| 983 | TIMER3_VA_BASE + TIMER_CTRL); | ||
| 984 | |||
| 985 | clocksource_versatile.mult = | ||
| 986 | clocksource_khz2mult(1000, clocksource_versatile.shift); | ||
| 987 | clocksource_register(&clocksource_versatile); | ||
| 988 | |||
| 989 | return 0; | ||
| 990 | } | ||
| 991 | 863 | ||
| 992 | /* | 864 | /* |
| 993 | * Set up timer interrupt, and return the current time in seconds. | 865 | * Set up timer interrupt, and return the current time in seconds. |
| @@ -1016,22 +888,8 @@ static void __init versatile_timer_init(void) | |||
| 1016 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | 888 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); |
| 1017 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); | 889 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); |
| 1018 | 890 | ||
| 1019 | /* | 891 | sp804_clocksource_init(TIMER3_VA_BASE); |
| 1020 | * Make irqs happen for the system timer | 892 | sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1); |
| 1021 | */ | ||
| 1022 | setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq); | ||
| 1023 | |||
| 1024 | versatile_clocksource_init(); | ||
| 1025 | |||
| 1026 | timer0_clockevent.mult = | ||
| 1027 | div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift); | ||
| 1028 | timer0_clockevent.max_delta_ns = | ||
| 1029 | clockevent_delta2ns(0xffffffff, &timer0_clockevent); | ||
| 1030 | timer0_clockevent.min_delta_ns = | ||
| 1031 | clockevent_delta2ns(0xf, &timer0_clockevent); | ||
| 1032 | |||
| 1033 | timer0_clockevent.cpumask = cpumask_of(0); | ||
| 1034 | clockevents_register_device(&timer0_clockevent); | ||
| 1035 | } | 893 | } |
| 1036 | 894 | ||
| 1037 | struct sys_timer versatile_timer = { | 895 | 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 c4ed9f93f646..33027301639e 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
| @@ -754,7 +754,8 @@ config CACHE_FEROCEON_L2_WRITETHROUGH | |||
| 754 | config CACHE_L2X0 | 754 | config CACHE_L2X0 |
| 755 | bool "Enable the L2x0 outer cache controller" | 755 | bool "Enable the L2x0 outer cache controller" |
| 756 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ | 756 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ |
| 757 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK || ARCH_OMAP4 | 757 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || \ |
| 758 | ARCH_NOMADIK || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 | ||
| 758 | default y | 759 | default y |
| 759 | select OUTER_CACHE | 760 | select OUTER_CACHE |
| 760 | help | 761 | help |
| @@ -781,3 +782,22 @@ config ARM_L1_CACHE_SHIFT | |||
| 781 | int | 782 | int |
| 782 | default 6 if ARM_L1_CACHE_SHIFT_6 | 783 | default 6 if ARM_L1_CACHE_SHIFT_6 |
| 783 | default 5 | 784 | default 5 |
| 785 | |||
| 786 | config ARM_DMA_MEM_BUFFERABLE | ||
| 787 | bool "Use non-cacheable memory for DMA" if CPU_V6 && !CPU_V7 | ||
| 788 | default y if CPU_V6 || CPU_V7 | ||
| 789 | help | ||
| 790 | Historically, the kernel has used strongly ordered mappings to | ||
| 791 | provide DMA coherent memory. With the advent of ARMv7, mapping | ||
| 792 | memory with differing types results in unpredictable behaviour, | ||
| 793 | so on these CPUs, this option is forced on. | ||
| 794 | |||
| 795 | Multiple mappings with differing attributes is also unpredictable | ||
| 796 | on ARMv6 CPUs, but since they do not have aggressive speculative | ||
| 797 | prefetch, no harm appears to occur. | ||
| 798 | |||
| 799 | However, drivers may be missing the necessary barriers for ARMv6, | ||
| 800 | and therefore turning this on may result in unpredictable driver | ||
| 801 | behaviour. Therefore, we offer this as an option. | ||
| 802 | |||
| 803 | You are recommended say 'Y' here and debug any affected drivers. | ||
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index edddd66faac6..28b7c2776198 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 07334632d3e2..78f0fc8595e2 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 | { |
| @@ -99,8 +100,8 @@ static inline void l2x0_inv_all(void) | |||
| 99 | 100 | ||
| 100 | /* invalidate all ways */ | 101 | /* invalidate all ways */ |
| 101 | spin_lock_irqsave(&l2x0_lock, flags); | 102 | spin_lock_irqsave(&l2x0_lock, flags); |
| 102 | writel(0xff, l2x0_base + L2X0_INV_WAY); | 103 | writel(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); |
| 103 | cache_wait(l2x0_base + L2X0_INV_WAY, 0xff); | 104 | cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); |
| 104 | cache_sync(); | 105 | cache_sync(); |
| 105 | spin_unlock_irqrestore(&l2x0_lock, flags); | 106 | spin_unlock_irqrestore(&l2x0_lock, flags); |
| 106 | } | 107 | } |
| @@ -199,9 +200,37 @@ static void l2x0_flush_range(unsigned long start, unsigned long end) | |||
| 199 | void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | 200 | void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) |
| 200 | { | 201 | { |
| 201 | __u32 aux; | 202 | __u32 aux; |
| 203 | __u32 cache_id; | ||
| 204 | int ways; | ||
| 205 | const char *type; | ||
| 202 | 206 | ||
| 203 | l2x0_base = base; | 207 | l2x0_base = base; |
| 204 | 208 | ||
| 209 | cache_id = readl(l2x0_base + L2X0_CACHE_ID); | ||
| 210 | aux = readl(l2x0_base + L2X0_AUX_CTRL); | ||
| 211 | |||
| 212 | /* Determine the number of ways */ | ||
| 213 | switch (cache_id & L2X0_CACHE_ID_PART_MASK) { | ||
| 214 | case L2X0_CACHE_ID_PART_L310: | ||
| 215 | if (aux & (1 << 16)) | ||
| 216 | ways = 16; | ||
| 217 | else | ||
| 218 | ways = 8; | ||
| 219 | type = "L310"; | ||
| 220 | break; | ||
| 221 | case L2X0_CACHE_ID_PART_L210: | ||
| 222 | ways = (aux >> 13) & 0xf; | ||
| 223 | type = "L210"; | ||
| 224 | break; | ||
| 225 | default: | ||
| 226 | /* Assume unknown chips have 8 ways */ | ||
| 227 | ways = 8; | ||
| 228 | type = "L2x0 series"; | ||
| 229 | break; | ||
| 230 | } | ||
| 231 | |||
| 232 | l2x0_way_mask = (1 << ways) - 1; | ||
| 233 | |||
| 205 | /* | 234 | /* |
| 206 | * Check if l2x0 controller is already enabled. | 235 | * Check if l2x0 controller is already enabled. |
| 207 | * If you are booting from non-secure mode | 236 | * If you are booting from non-secure mode |
| @@ -210,8 +239,6 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
| 210 | if (!(readl(l2x0_base + L2X0_CTRL) & 1)) { | 239 | if (!(readl(l2x0_base + L2X0_CTRL) & 1)) { |
| 211 | 240 | ||
| 212 | /* l2x0 controller is disabled */ | 241 | /* l2x0 controller is disabled */ |
| 213 | |||
| 214 | aux = readl(l2x0_base + L2X0_AUX_CTRL); | ||
| 215 | aux &= aux_mask; | 242 | aux &= aux_mask; |
| 216 | aux |= aux_val; | 243 | aux |= aux_val; |
| 217 | writel(aux, l2x0_base + L2X0_AUX_CTRL); | 244 | writel(aux, l2x0_base + L2X0_AUX_CTRL); |
| @@ -226,5 +253,7 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
| 226 | outer_cache.clean_range = l2x0_clean_range; | 253 | outer_cache.clean_range = l2x0_clean_range; |
| 227 | outer_cache.flush_range = l2x0_flush_range; | 254 | outer_cache.flush_range = l2x0_flush_range; |
| 228 | 255 | ||
| 229 | printk(KERN_INFO "L2X0 cache controller enabled\n"); | 256 | printk(KERN_INFO "%s cache controller enabled\n", type); |
| 257 | printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x\n", | ||
| 258 | ways, cache_id, aux); | ||
| 230 | } | 259 | } |
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c index c9b97e9836a2..82df01a72f4a 100644 --- a/arch/arm/mm/fault-armv.c +++ b/arch/arm/mm/fault-armv.c | |||
| @@ -133,8 +133,6 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, | |||
| 133 | flush_dcache_mmap_unlock(mapping); | 133 | flush_dcache_mmap_unlock(mapping); |
| 134 | if (aliases) | 134 | if (aliases) |
| 135 | do_adjust_pte(vma, addr, pfn, ptep); | 135 | do_adjust_pte(vma, addr, pfn, ptep); |
| 136 | else | ||
| 137 | flush_cache_page(vma, addr, pfn); | ||
| 138 | } | 136 | } |
| 139 | 137 | ||
| 140 | /* | 138 | /* |
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 7829cb5425f5..105d1d4f420b 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 | 19 | ||
| 21 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
| @@ -226,20 +225,6 @@ static int __init check_initrd(struct meminfo *mi) | |||
| 226 | return initrd_node; | 225 | return initrd_node; |
| 227 | } | 226 | } |
| 228 | 227 | ||
| 229 | static inline void map_memory_bank(struct membank *bank) | ||
| 230 | { | ||
| 231 | #ifdef CONFIG_MMU | ||
| 232 | struct map_desc map; | ||
| 233 | |||
| 234 | map.pfn = bank_pfn_start(bank); | ||
| 235 | map.virtual = __phys_to_virt(bank_phys_start(bank)); | ||
| 236 | map.length = bank_phys_size(bank); | ||
| 237 | map.type = MT_MEMORY; | ||
| 238 | |||
| 239 | create_mapping(&map); | ||
| 240 | #endif | ||
| 241 | } | ||
| 242 | |||
| 243 | static void __init bootmem_init_node(int node, struct meminfo *mi, | 228 | static void __init bootmem_init_node(int node, struct meminfo *mi, |
| 244 | unsigned long start_pfn, unsigned long end_pfn) | 229 | unsigned long start_pfn, unsigned long end_pfn) |
| 245 | { | 230 | { |
| @@ -249,16 +234,6 @@ static void __init bootmem_init_node(int node, struct meminfo *mi, | |||
| 249 | int i; | 234 | int i; |
| 250 | 235 | ||
| 251 | /* | 236 | /* |
| 252 | * Map the memory banks for this node. | ||
| 253 | */ | ||
| 254 | for_each_nodebank(i, mi, node) { | ||
| 255 | struct membank *bank = &mi->bank[i]; | ||
| 256 | |||
| 257 | if (!bank->highmem) | ||
| 258 | map_memory_bank(bank); | ||
| 259 | } | ||
| 260 | |||
| 261 | /* | ||
| 262 | * Allocate the bootmem bitmap page. | 237 | * Allocate the bootmem bitmap page. |
| 263 | */ | 238 | */ |
| 264 | boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn); | 239 | boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn); |
| @@ -387,21 +362,12 @@ static void arm_memory_present(struct meminfo *mi, int node) | |||
| 387 | } | 362 | } |
| 388 | #endif | 363 | #endif |
| 389 | 364 | ||
| 390 | static int __init meminfo_cmp(const void *_a, const void *_b) | ||
| 391 | { | ||
| 392 | const struct membank *a = _a, *b = _b; | ||
| 393 | long cmp = bank_pfn_start(a) - bank_pfn_start(b); | ||
| 394 | return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; | ||
| 395 | } | ||
| 396 | |||
| 397 | void __init bootmem_init(void) | 365 | void __init bootmem_init(void) |
| 398 | { | 366 | { |
| 399 | struct meminfo *mi = &meminfo; | 367 | struct meminfo *mi = &meminfo; |
| 400 | unsigned long min, max_low, max_high; | 368 | unsigned long min, max_low, max_high; |
| 401 | int node, initrd_node; | 369 | int node, initrd_node; |
| 402 | 370 | ||
| 403 | sort(&mi->bank, mi->nr_banks, sizeof(mi->bank[0]), meminfo_cmp, NULL); | ||
| 404 | |||
| 405 | /* | 371 | /* |
| 406 | * Locate which node contains the ramdisk image, if any. | 372 | * Locate which node contains the ramdisk image, if any. |
| 407 | */ | 373 | */ |
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 9d4da6ac28eb..69852003675f 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> |
| @@ -599,7 +600,7 @@ static void __init create_36bit_mapping(struct map_desc *md, | |||
| 599 | * offsets, and we take full advantage of sections and | 600 | * offsets, and we take full advantage of sections and |
| 600 | * supersections. | 601 | * supersections. |
| 601 | */ | 602 | */ |
| 602 | void __init create_mapping(struct map_desc *md) | 603 | static void __init create_mapping(struct map_desc *md) |
| 603 | { | 604 | { |
| 604 | unsigned long phys, addr, length, end; | 605 | unsigned long phys, addr, length, end; |
| 605 | const struct mem_type *type; | 606 | const struct mem_type *type; |
| @@ -1013,6 +1014,39 @@ static void __init kmap_init(void) | |||
| 1013 | #endif | 1014 | #endif |
| 1014 | } | 1015 | } |
| 1015 | 1016 | ||
| 1017 | static inline void map_memory_bank(struct membank *bank) | ||
| 1018 | { | ||
| 1019 | struct map_desc map; | ||
| 1020 | |||
| 1021 | map.pfn = bank_pfn_start(bank); | ||
| 1022 | map.virtual = __phys_to_virt(bank_phys_start(bank)); | ||
| 1023 | map.length = bank_phys_size(bank); | ||
| 1024 | map.type = MT_MEMORY; | ||
| 1025 | |||
| 1026 | create_mapping(&map); | ||
| 1027 | } | ||
| 1028 | |||
| 1029 | static void __init map_lowmem(void) | ||
| 1030 | { | ||
| 1031 | struct meminfo *mi = &meminfo; | ||
| 1032 | int i; | ||
| 1033 | |||
| 1034 | /* Map all the lowmem memory banks. */ | ||
| 1035 | for (i = 0; i < mi->nr_banks; i++) { | ||
| 1036 | struct membank *bank = &mi->bank[i]; | ||
| 1037 | |||
| 1038 | if (!bank->highmem) | ||
| 1039 | map_memory_bank(bank); | ||
| 1040 | } | ||
| 1041 | } | ||
| 1042 | |||
| 1043 | static int __init meminfo_cmp(const void *_a, const void *_b) | ||
| 1044 | { | ||
| 1045 | const struct membank *a = _a, *b = _b; | ||
| 1046 | long cmp = bank_pfn_start(a) - bank_pfn_start(b); | ||
| 1047 | return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; | ||
| 1048 | } | ||
| 1049 | |||
| 1016 | /* | 1050 | /* |
| 1017 | * paging_init() sets up the page tables, initialises the zone memory | 1051 | * paging_init() sets up the page tables, initialises the zone memory |
| 1018 | * maps, and sets up the zero page, bad page and bad page tables. | 1052 | * maps, and sets up the zero page, bad page and bad page tables. |
| @@ -1021,9 +1055,12 @@ void __init paging_init(struct machine_desc *mdesc) | |||
| 1021 | { | 1055 | { |
| 1022 | void *zero_page; | 1056 | void *zero_page; |
| 1023 | 1057 | ||
| 1058 | sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL); | ||
| 1059 | |||
| 1024 | build_mem_type_table(); | 1060 | build_mem_type_table(); |
| 1025 | sanity_check_meminfo(); | 1061 | sanity_check_meminfo(); |
| 1026 | prepare_page_table(); | 1062 | prepare_page_table(); |
| 1063 | map_lowmem(); | ||
| 1027 | bootmem_init(); | 1064 | bootmem_init(); |
| 1028 | devicemaps_init(mdesc); | 1065 | devicemaps_init(mdesc); |
| 1029 | kmap_init(); | 1066 | 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/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 9a09b2791e03..d28900cfa541 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> |
| @@ -35,8 +37,9 @@ | |||
| 35 | struct nmk_gpio_chip { | 37 | struct nmk_gpio_chip { |
| 36 | struct gpio_chip chip; | 38 | struct gpio_chip chip; |
| 37 | void __iomem *addr; | 39 | void __iomem *addr; |
| 40 | struct clk *clk; | ||
| 38 | unsigned int parent_irq; | 41 | unsigned int parent_irq; |
| 39 | spinlock_t *lock; | 42 | spinlock_t lock; |
| 40 | /* Keep track of configured edges */ | 43 | /* Keep track of configured edges */ |
| 41 | u32 edge_rising; | 44 | u32 edge_rising; |
| 42 | u32 edge_falling; | 45 | u32 edge_falling; |
| @@ -107,40 +110,37 @@ static void nmk_gpio_irq_ack(unsigned int irq) | |||
| 107 | writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); | 110 | writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); |
| 108 | } | 111 | } |
| 109 | 112 | ||
| 110 | static void nmk_gpio_irq_mask(unsigned int irq) | 113 | static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip, |
| 114 | int gpio, bool enable) | ||
| 111 | { | 115 | { |
| 112 | int gpio; | 116 | u32 bitmask = nmk_gpio_get_bitmask(gpio); |
| 113 | struct nmk_gpio_chip *nmk_chip; | 117 | u32 reg; |
| 114 | unsigned long flags; | ||
| 115 | u32 bitmask, reg; | ||
| 116 | |||
| 117 | gpio = NOMADIK_IRQ_TO_GPIO(irq); | ||
| 118 | nmk_chip = get_irq_chip_data(irq); | ||
| 119 | bitmask = nmk_gpio_get_bitmask(gpio); | ||
| 120 | if (!nmk_chip) | ||
| 121 | return; | ||
| 122 | 118 | ||
| 123 | /* we must individually clear the two edges */ | 119 | /* we must individually set/clear the two edges */ |
| 124 | spin_lock_irqsave(&nmk_chip->lock, flags); | ||
| 125 | if (nmk_chip->edge_rising & bitmask) { | 120 | if (nmk_chip->edge_rising & bitmask) { |
| 126 | reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC); | 121 | reg = readl(nmk_chip->addr + NMK_GPIO_RIMSC); |
| 127 | reg &= ~bitmask; | 122 | if (enable) |
| 128 | writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC); | 123 | reg |= bitmask; |
| 124 | else | ||
| 125 | reg &= ~bitmask; | ||
| 126 | writel(reg, nmk_chip->addr + NMK_GPIO_RIMSC); | ||
| 129 | } | 127 | } |
| 130 | if (nmk_chip->edge_falling & bitmask) { | 128 | if (nmk_chip->edge_falling & bitmask) { |
| 131 | reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC); | 129 | reg = readl(nmk_chip->addr + NMK_GPIO_FIMSC); |
| 132 | reg &= ~bitmask; | 130 | if (enable) |
| 133 | writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC); | 131 | reg |= bitmask; |
| 132 | else | ||
| 133 | reg &= ~bitmask; | ||
| 134 | writel(reg, nmk_chip->addr + NMK_GPIO_FIMSC); | ||
| 134 | } | 135 | } |
| 135 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 136 | } |
| 136 | }; | ||
| 137 | 137 | ||
| 138 | static void nmk_gpio_irq_unmask(unsigned int irq) | 138 | static void nmk_gpio_irq_modify(unsigned int irq, bool enable) |
| 139 | { | 139 | { |
| 140 | int gpio; | 140 | int gpio; |
| 141 | struct nmk_gpio_chip *nmk_chip; | 141 | struct nmk_gpio_chip *nmk_chip; |
| 142 | unsigned long flags; | 142 | unsigned long flags; |
| 143 | u32 bitmask, reg; | 143 | u32 bitmask; |
| 144 | 144 | ||
| 145 | gpio = NOMADIK_IRQ_TO_GPIO(irq); | 145 | gpio = NOMADIK_IRQ_TO_GPIO(irq); |
| 146 | nmk_chip = get_irq_chip_data(irq); | 146 | nmk_chip = get_irq_chip_data(irq); |
| @@ -148,23 +148,24 @@ static void nmk_gpio_irq_unmask(unsigned int irq) | |||
| 148 | if (!nmk_chip) | 148 | if (!nmk_chip) |
| 149 | return; | 149 | return; |
| 150 | 150 | ||
| 151 | /* we must individually set the two edges */ | ||
| 152 | spin_lock_irqsave(&nmk_chip->lock, flags); | 151 | spin_lock_irqsave(&nmk_chip->lock, flags); |
| 153 | if (nmk_chip->edge_rising & bitmask) { | 152 | __nmk_gpio_irq_modify(nmk_chip, gpio, enable); |
| 154 | reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC); | ||
| 155 | reg |= bitmask; | ||
| 156 | writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC); | ||
| 157 | } | ||
| 158 | if (nmk_chip->edge_falling & bitmask) { | ||
| 159 | reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC); | ||
| 160 | reg |= bitmask; | ||
| 161 | writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC); | ||
| 162 | } | ||
| 163 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 153 | spin_unlock_irqrestore(&nmk_chip->lock, flags); |
| 164 | } | 154 | } |
| 165 | 155 | ||
| 156 | static void nmk_gpio_irq_mask(unsigned int irq) | ||
| 157 | { | ||
| 158 | nmk_gpio_irq_modify(irq, false); | ||
| 159 | }; | ||
| 160 | |||
| 161 | static void nmk_gpio_irq_unmask(unsigned int irq) | ||
| 162 | { | ||
| 163 | nmk_gpio_irq_modify(irq, true); | ||
| 164 | } | ||
| 165 | |||
| 166 | static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) | 166 | static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) |
| 167 | { | 167 | { |
| 168 | bool enabled = !(irq_to_desc(irq)->status & IRQ_DISABLED); | ||
| 168 | int gpio; | 169 | int gpio; |
| 169 | struct nmk_gpio_chip *nmk_chip; | 170 | struct nmk_gpio_chip *nmk_chip; |
| 170 | unsigned long flags; | 171 | unsigned long flags; |
| @@ -183,19 +184,21 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) | |||
| 183 | 184 | ||
| 184 | spin_lock_irqsave(&nmk_chip->lock, flags); | 185 | spin_lock_irqsave(&nmk_chip->lock, flags); |
| 185 | 186 | ||
| 187 | if (enabled) | ||
| 188 | __nmk_gpio_irq_modify(nmk_chip, gpio, false); | ||
| 189 | |||
| 186 | nmk_chip->edge_rising &= ~bitmask; | 190 | nmk_chip->edge_rising &= ~bitmask; |
| 187 | if (type & IRQ_TYPE_EDGE_RISING) | 191 | if (type & IRQ_TYPE_EDGE_RISING) |
| 188 | nmk_chip->edge_rising |= bitmask; | 192 | nmk_chip->edge_rising |= bitmask; |
| 189 | writel(nmk_chip->edge_rising, nmk_chip->addr + NMK_GPIO_RIMSC); | ||
| 190 | 193 | ||
| 191 | nmk_chip->edge_falling &= ~bitmask; | 194 | nmk_chip->edge_falling &= ~bitmask; |
| 192 | if (type & IRQ_TYPE_EDGE_FALLING) | 195 | if (type & IRQ_TYPE_EDGE_FALLING) |
| 193 | nmk_chip->edge_falling |= bitmask; | 196 | nmk_chip->edge_falling |= bitmask; |
| 194 | writel(nmk_chip->edge_falling, nmk_chip->addr + NMK_GPIO_FIMSC); | ||
| 195 | 197 | ||
| 196 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 198 | if (enabled) |
| 199 | __nmk_gpio_irq_modify(nmk_chip, gpio, true); | ||
| 197 | 200 | ||
| 198 | nmk_gpio_irq_unmask(irq); | 201 | spin_unlock_irqrestore(&nmk_chip->lock, flags); |
| 199 | 202 | ||
| 200 | return 0; | 203 | return 0; |
| 201 | } | 204 | } |
| @@ -211,21 +214,27 @@ static struct irq_chip nmk_gpio_irq_chip = { | |||
| 211 | static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 214 | static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) |
| 212 | { | 215 | { |
| 213 | struct nmk_gpio_chip *nmk_chip; | 216 | struct nmk_gpio_chip *nmk_chip; |
| 214 | struct irq_chip *host_chip; | 217 | struct irq_chip *host_chip = get_irq_chip(irq); |
| 215 | unsigned int gpio_irq; | 218 | unsigned int gpio_irq; |
| 216 | u32 pending; | 219 | u32 pending; |
| 217 | unsigned int first_irq; | 220 | unsigned int first_irq; |
| 218 | 221 | ||
| 222 | if (host_chip->mask_ack) | ||
| 223 | host_chip->mask_ack(irq); | ||
| 224 | else { | ||
| 225 | host_chip->mask(irq); | ||
| 226 | if (host_chip->ack) | ||
| 227 | host_chip->ack(irq); | ||
| 228 | } | ||
| 229 | |||
| 219 | nmk_chip = get_irq_data(irq); | 230 | nmk_chip = get_irq_data(irq); |
| 220 | first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); | 231 | first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); |
| 221 | while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) { | 232 | while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) { |
| 222 | gpio_irq = first_irq + __ffs(pending); | 233 | gpio_irq = first_irq + __ffs(pending); |
| 223 | generic_handle_irq(gpio_irq); | 234 | generic_handle_irq(gpio_irq); |
| 224 | } | 235 | } |
| 225 | if (0) {/* don't ack parent irq, as ack == disable */ | 236 | |
| 226 | host_chip = get_irq_chip(irq); | 237 | host_chip->unmask(irq); |
| 227 | host_chip->ack(irq); | ||
| 228 | } | ||
| 229 | } | 238 | } |
| 230 | 239 | ||
| 231 | static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) | 240 | static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) |
| @@ -239,6 +248,7 @@ static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) | |||
| 239 | set_irq_handler(i, handle_edge_irq); | 248 | set_irq_handler(i, handle_edge_irq); |
| 240 | set_irq_flags(i, IRQF_VALID); | 249 | set_irq_flags(i, IRQF_VALID); |
| 241 | set_irq_chip_data(i, nmk_chip); | 250 | set_irq_chip_data(i, nmk_chip); |
| 251 | set_irq_type(i, IRQ_TYPE_EDGE_FALLING); | ||
| 242 | } | 252 | } |
| 243 | set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler); | 253 | set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler); |
| 244 | set_irq_data(nmk_chip->parent_irq, nmk_chip); | 254 | set_irq_data(nmk_chip->parent_irq, nmk_chip); |
| @@ -297,30 +307,59 @@ static struct gpio_chip nmk_gpio_template = { | |||
| 297 | .can_sleep = 0, | 307 | .can_sleep = 0, |
| 298 | }; | 308 | }; |
| 299 | 309 | ||
| 300 | static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | 310 | static int __init nmk_gpio_probe(struct platform_device *dev) |
| 301 | { | 311 | { |
| 302 | struct nmk_gpio_platform_data *pdata; | 312 | struct nmk_gpio_platform_data *pdata = dev->dev.platform_data; |
| 303 | struct nmk_gpio_chip *nmk_chip; | 313 | struct nmk_gpio_chip *nmk_chip; |
| 304 | struct gpio_chip *chip; | 314 | struct gpio_chip *chip; |
| 315 | struct resource *res; | ||
| 316 | struct clk *clk; | ||
| 317 | int irq; | ||
| 305 | int ret; | 318 | int ret; |
| 306 | 319 | ||
| 307 | pdata = dev->dev.platform_data; | 320 | if (!pdata) |
| 308 | ret = amba_request_regions(dev, pdata->name); | 321 | return -ENODEV; |
| 309 | if (ret) | 322 | |
| 310 | return ret; | 323 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 324 | if (!res) { | ||
| 325 | ret = -ENOENT; | ||
| 326 | goto out; | ||
| 327 | } | ||
| 328 | |||
| 329 | irq = platform_get_irq(dev, 0); | ||
| 330 | if (irq < 0) { | ||
| 331 | ret = irq; | ||
| 332 | goto out; | ||
| 333 | } | ||
| 334 | |||
| 335 | if (request_mem_region(res->start, resource_size(res), | ||
| 336 | dev_name(&dev->dev)) == NULL) { | ||
| 337 | ret = -EBUSY; | ||
| 338 | goto out; | ||
| 339 | } | ||
| 340 | |||
| 341 | clk = clk_get(&dev->dev, NULL); | ||
| 342 | if (IS_ERR(clk)) { | ||
| 343 | ret = PTR_ERR(clk); | ||
| 344 | goto out_release; | ||
| 345 | } | ||
| 346 | |||
| 347 | clk_enable(clk); | ||
| 311 | 348 | ||
| 312 | nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); | 349 | nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); |
| 313 | if (!nmk_chip) { | 350 | if (!nmk_chip) { |
| 314 | ret = -ENOMEM; | 351 | ret = -ENOMEM; |
| 315 | goto out_amba; | 352 | goto out_clk; |
| 316 | } | 353 | } |
| 317 | /* | 354 | /* |
| 318 | * The virt address in nmk_chip->addr is in the nomadik register space, | 355 | * The virt address in nmk_chip->addr is in the nomadik register space, |
| 319 | * so we can simply convert the resource address, without remapping | 356 | * so we can simply convert the resource address, without remapping |
| 320 | */ | 357 | */ |
| 321 | nmk_chip->addr = io_p2v(dev->res.start); | 358 | nmk_chip->clk = clk; |
| 359 | nmk_chip->addr = io_p2v(res->start); | ||
| 322 | nmk_chip->chip = nmk_gpio_template; | 360 | nmk_chip->chip = nmk_gpio_template; |
| 323 | nmk_chip->parent_irq = pdata->parent_irq; | 361 | nmk_chip->parent_irq = irq; |
| 362 | spin_lock_init(&nmk_chip->lock); | ||
| 324 | 363 | ||
| 325 | chip = &nmk_chip->chip; | 364 | chip = &nmk_chip->chip; |
| 326 | chip->base = pdata->first_gpio; | 365 | chip->base = pdata->first_gpio; |
| @@ -332,7 +371,7 @@ static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | |||
| 332 | if (ret) | 371 | if (ret) |
| 333 | goto out_free; | 372 | goto out_free; |
| 334 | 373 | ||
| 335 | amba_set_drvdata(dev, nmk_chip); | 374 | platform_set_drvdata(dev, nmk_chip); |
| 336 | 375 | ||
| 337 | nmk_gpio_init_irq(nmk_chip); | 376 | nmk_gpio_init_irq(nmk_chip); |
| 338 | 377 | ||
| @@ -340,51 +379,50 @@ static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | |||
| 340 | nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr); | 379 | nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr); |
| 341 | return 0; | 380 | return 0; |
| 342 | 381 | ||
| 343 | out_free: | 382 | out_free: |
| 344 | kfree(nmk_chip); | 383 | kfree(nmk_chip); |
| 345 | out_amba: | 384 | out_clk: |
| 346 | amba_release_regions(dev); | 385 | clk_disable(clk); |
| 386 | clk_put(clk); | ||
| 387 | out_release: | ||
| 388 | release_mem_region(res->start, resource_size(res)); | ||
| 389 | out: | ||
| 347 | dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret, | 390 | dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret, |
| 348 | pdata->first_gpio, pdata->first_gpio+31); | 391 | pdata->first_gpio, pdata->first_gpio+31); |
| 349 | return ret; | 392 | return ret; |
| 350 | } | 393 | } |
| 351 | 394 | ||
| 352 | static int nmk_gpio_remove(struct amba_device *dev) | 395 | static int __exit nmk_gpio_remove(struct platform_device *dev) |
| 353 | { | 396 | { |
| 354 | struct nmk_gpio_chip *nmk_chip; | 397 | struct nmk_gpio_chip *nmk_chip; |
| 398 | struct resource *res; | ||
| 355 | 399 | ||
| 356 | nmk_chip = amba_get_drvdata(dev); | 400 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 401 | |||
| 402 | nmk_chip = platform_get_drvdata(dev); | ||
| 357 | gpiochip_remove(&nmk_chip->chip); | 403 | gpiochip_remove(&nmk_chip->chip); |
| 404 | clk_disable(nmk_chip->clk); | ||
| 405 | clk_put(nmk_chip->clk); | ||
| 358 | kfree(nmk_chip); | 406 | kfree(nmk_chip); |
| 359 | amba_release_regions(dev); | 407 | release_mem_region(res->start, resource_size(res)); |
| 360 | return 0; | 408 | return 0; |
| 361 | } | 409 | } |
| 362 | 410 | ||
| 363 | 411 | ||
| 364 | /* We have 0x1f080060 and 0x1f180060, accept both using the mask */ | 412 | static struct platform_driver nmk_gpio_driver = { |
| 365 | static struct amba_id nmk_gpio_ids[] = { | 413 | .driver = { |
| 366 | { | ||
| 367 | .id = 0x1f080060, | ||
| 368 | .mask = 0xffefffff, | ||
| 369 | }, | ||
| 370 | {0, 0}, | ||
| 371 | }; | ||
| 372 | |||
| 373 | static struct amba_driver nmk_gpio_driver = { | ||
| 374 | .drv = { | ||
| 375 | .owner = THIS_MODULE, | 414 | .owner = THIS_MODULE, |
| 376 | .name = "gpio", | 415 | .name = "gpio", |
| 377 | }, | 416 | }, |
| 378 | .probe = nmk_gpio_probe, | 417 | .probe = nmk_gpio_probe, |
| 379 | .remove = nmk_gpio_remove, | 418 | .remove = __exit_p(nmk_gpio_remove), |
| 380 | .suspend = NULL, /* to be done */ | 419 | .suspend = NULL, /* to be done */ |
| 381 | .resume = NULL, | 420 | .resume = NULL, |
| 382 | .id_table = nmk_gpio_ids, | ||
| 383 | }; | 421 | }; |
| 384 | 422 | ||
| 385 | static int __init nmk_gpio_init(void) | 423 | static int __init nmk_gpio_init(void) |
| 386 | { | 424 | { |
| 387 | return amba_driver_register(&nmk_gpio_driver); | 425 | return platform_driver_register(&nmk_gpio_driver); |
| 388 | } | 426 | } |
| 389 | 427 | ||
| 390 | arch_initcall(nmk_gpio_init); | 428 | 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/Makefile b/arch/arm/plat-pxa/Makefile index 0264bfb0ca4f..f68da35f4fb3 100644 --- a/arch/arm/plat-pxa/Makefile +++ b/arch/arm/plat-pxa/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 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 |
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-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 | } | ||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 9c6170cd9aac..87ab0568bb0e 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
| @@ -564,7 +564,7 @@ config I2C_STU300 | |||
| 564 | 564 | ||
| 565 | config I2C_VERSATILE | 565 | config I2C_VERSATILE |
| 566 | tristate "ARM Versatile/Realview I2C bus support" | 566 | tristate "ARM Versatile/Realview I2C bus support" |
| 567 | depends on ARCH_VERSATILE || ARCH_REALVIEW | 567 | depends on ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS |
| 568 | select I2C_ALGOBIT | 568 | select I2C_ALGOBIT |
| 569 | help | 569 | help |
| 570 | Say yes if you want to support the I2C serial bus on ARMs Versatile | 570 | Say yes if you want to support the I2C serial bus on ARMs Versatile |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 84c103a7ee13..ff115d920888 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
| @@ -55,14 +55,16 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) | |||
| 55 | host->cclk = host->mclk / (2 * (clk + 1)); | 55 | host->cclk = host->mclk / (2 * (clk + 1)); |
| 56 | } | 56 | } |
| 57 | if (host->hw_designer == AMBA_VENDOR_ST) | 57 | if (host->hw_designer == AMBA_VENDOR_ST) |
| 58 | clk |= MCI_FCEN; /* Bug fix in ST IP block */ | 58 | clk |= MCI_ST_FCEN; /* Bug fix in ST IP block */ |
| 59 | clk |= MCI_CLK_ENABLE; | 59 | clk |= MCI_CLK_ENABLE; |
| 60 | /* This hasn't proven to be worthwhile */ | 60 | /* This hasn't proven to be worthwhile */ |
| 61 | /* clk |= MCI_CLK_PWRSAVE; */ | 61 | /* clk |= MCI_CLK_PWRSAVE; */ |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) | 64 | if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) |
| 65 | clk |= MCI_WIDE_BUS; | 65 | clk |= MCI_4BIT_BUS; |
| 66 | if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8) | ||
| 67 | clk |= MCI_ST_8BIT_BUS; | ||
| 66 | 68 | ||
| 67 | writel(clk, host->base + MMCICLOCK); | 69 | writel(clk, host->base + MMCICLOCK); |
| 68 | } | 70 | } |
| @@ -629,7 +631,18 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
| 629 | 631 | ||
| 630 | mmc->ops = &mmci_ops; | 632 | mmc->ops = &mmci_ops; |
| 631 | mmc->f_min = (host->mclk + 511) / 512; | 633 | mmc->f_min = (host->mclk + 511) / 512; |
| 632 | mmc->f_max = min(host->mclk, fmax); | 634 | /* |
| 635 | * If the platform data supplies a maximum operating | ||
| 636 | * frequency, this takes precedence. Else, we fall back | ||
| 637 | * to using the module parameter, which has a (low) | ||
| 638 | * default value in case it is not specified. Either | ||
| 639 | * value must not exceed the clock rate into the block, | ||
| 640 | * of course. | ||
| 641 | */ | ||
| 642 | if (plat->f_max) | ||
| 643 | mmc->f_max = min(host->mclk, plat->f_max); | ||
| 644 | else | ||
| 645 | mmc->f_max = min(host->mclk, fmax); | ||
| 633 | dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); | 646 | dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); |
| 634 | 647 | ||
| 635 | #ifdef CONFIG_REGULATOR | 648 | #ifdef CONFIG_REGULATOR |
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 1ceb9a90f59b..d77062e5e3af 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
| @@ -25,9 +25,11 @@ | |||
| 25 | #define MCI_CLK_ENABLE (1 << 8) | 25 | #define MCI_CLK_ENABLE (1 << 8) |
| 26 | #define MCI_CLK_PWRSAVE (1 << 9) | 26 | #define MCI_CLK_PWRSAVE (1 << 9) |
| 27 | #define MCI_CLK_BYPASS (1 << 10) | 27 | #define MCI_CLK_BYPASS (1 << 10) |
| 28 | #define MCI_WIDE_BUS (1 << 11) | 28 | #define MCI_4BIT_BUS (1 << 11) |
| 29 | /* 8bit wide buses supported in ST Micro versions */ | ||
| 30 | #define MCI_ST_8BIT_BUS (1 << 12) | ||
| 29 | /* HW flow control on the ST Micro version */ | 31 | /* HW flow control on the ST Micro version */ |
| 30 | #define MCI_FCEN (1 << 13) | 32 | #define MCI_ST_FCEN (1 << 13) |
| 31 | 33 | ||
| 32 | #define MMCIARGUMENT 0x008 | 34 | #define MMCIARGUMENT 0x008 |
| 33 | #define MMCICOMMAND 0x00c | 35 | #define MMCICOMMAND 0x00c |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index 6b4241748dda..7e466fe72025 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h | |||
| @@ -6,8 +6,29 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/mmc/host.h> | 7 | #include <linux/mmc/host.h> |
| 8 | 8 | ||
| 9 | /** | ||
| 10 | * struct mmci_platform_data - platform configuration for the MMCI | ||
| 11 | * (also known as PL180) block. | ||
| 12 | * @f_max: the maximum operational frequency for this host in this | ||
| 13 | * platform configuration. When this is specified it takes precedence | ||
| 14 | * over the module parameter for the same frequency. | ||
| 15 | * @ocr_mask: available voltages on the 4 pins from the block, this | ||
| 16 | * is ignored if a regulator is used, see the MMC_VDD_* masks in | ||
| 17 | * mmc/host.h | ||
| 18 | * @translate_vdd: a callback function to translate a MMC_VDD_* | ||
| 19 | * mask into a value to be binary or:ed and written into the | ||
| 20 | * MMCIPWR register of the block | ||
| 21 | * @status: if no GPIO read function was given to the block in | ||
| 22 | * gpio_wp (below) this function will be called to determine | ||
| 23 | * whether a card is present in the MMC slot or not | ||
| 24 | * @gpio_wp: read this GPIO pin to see if the card is write protected | ||
| 25 | * @gpio_cd: read this GPIO pin to detect card insertion | ||
| 26 | * @capabilities: the capabilities of the block as implemented in | ||
| 27 | * this platform, signify anything MMC_CAP_* from mmc/host.h | ||
| 28 | */ | ||
| 9 | struct mmci_platform_data { | 29 | struct mmci_platform_data { |
| 10 | unsigned int ocr_mask; /* available voltages */ | 30 | unsigned int f_max; |
| 31 | unsigned int ocr_mask; | ||
| 11 | u32 (*translate_vdd)(struct device *, unsigned int); | 32 | u32 (*translate_vdd)(struct device *, unsigned int); |
| 12 | unsigned int (*status)(struct device *); | 33 | unsigned int (*status)(struct device *); |
| 13 | int gpio_wp; | 34 | int gpio_wp; |
