diff options
275 files changed, 20562 insertions, 4111 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 a67112feba18..c84f003fdfa1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -5272,6 +5272,46 @@ F: drivers/serial/sunsu.c | |||
| 5272 | F: drivers/serial/sunzilog.c | 5272 | F: drivers/serial/sunzilog.c |
| 5273 | F: drivers/serial/sunzilog.h | 5273 | F: drivers/serial/sunzilog.h |
| 5274 | 5274 | ||
| 5275 | SPEAR PLATFORM SUPPORT | ||
| 5276 | M: Viresh Kumar <viresh.kumar@st.com> | ||
| 5277 | W: http://www.st.com/spear | ||
| 5278 | S: Maintained | ||
| 5279 | F: arch/arm/plat-spear/ | ||
| 5280 | |||
| 5281 | SPEAR3XX MACHINE SUPPORT | ||
| 5282 | M: Viresh Kumar <viresh.kumar@st.com> | ||
| 5283 | W: http://www.st.com/spear | ||
| 5284 | S: Maintained | ||
| 5285 | F: arch/arm/mach-spear3xx/ | ||
| 5286 | |||
| 5287 | SPEAR6XX MACHINE SUPPORT | ||
| 5288 | M: Rajeev Kumar <rajeev-dlh.kumar@st.com> | ||
| 5289 | W: http://www.st.com/spear | ||
| 5290 | S: Maintained | ||
| 5291 | F: arch/arm/mach-spear6xx/ | ||
| 5292 | |||
| 5293 | SPEAR CLOCK FRAMEWORK SUPPORT | ||
| 5294 | M: Viresh Kumar <viresh.kumar@st.com> | ||
| 5295 | W: http://www.st.com/spear | ||
| 5296 | S: Maintained | ||
| 5297 | F: arch/arm/mach-spear*/clock.c | ||
| 5298 | F: arch/arm/mach-spear*/include/mach/clkdev.h | ||
| 5299 | F: arch/arm/plat-spear/clock.c | ||
| 5300 | F: arch/arm/plat-spear/include/plat/clock.h and clkdev.h | ||
| 5301 | |||
| 5302 | SPEAR PAD MULTIPLEXING SUPPORT | ||
| 5303 | M: Viresh Kumar <viresh.kumar@st.com> | ||
| 5304 | W: http://www.st.com/spear | ||
| 5305 | S: Maintained | ||
| 5306 | F: arch/arm/plat-spear/include/plat/padmux.h | ||
| 5307 | F: arch/arm/plat-spear/padmux.c | ||
| 5308 | F: arch/arm/mach-spear*/spear*xx.c | ||
| 5309 | F: arch/arm/mach-spear*/include/mach/generic.h | ||
| 5310 | F: arch/arm/mach-spear3xx/spear3*0.c | ||
| 5311 | F: arch/arm/mach-spear3xx/spear3*0_evb.c | ||
| 5312 | F: arch/arm/mach-spear6xx/spear600.c | ||
| 5313 | F: arch/arm/mach-spear6xx/spear600_evb.c | ||
| 5314 | |||
| 5275 | SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER | 5315 | SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER |
| 5276 | M: Roger Wolff <R.E.Wolff@BitWizard.nl> | 5316 | M: Roger Wolff <R.E.Wolff@BitWizard.nl> |
| 5277 | S: Supported | 5317 | S: Supported |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ae0ecdaf353c..492f81344900 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -13,7 +13,7 @@ config ARM | |||
| 13 | select RTC_LIB | 13 | select RTC_LIB |
| 14 | select SYS_SUPPORTS_APM_EMULATION | 14 | select SYS_SUPPORTS_APM_EMULATION |
| 15 | select GENERIC_ATOMIC64 if (!CPU_32v6K) | 15 | select GENERIC_ATOMIC64 if (!CPU_32v6K) |
| 16 | select HAVE_OPROFILE | 16 | select HAVE_OPROFILE if (HAVE_PERF_EVENTS) |
| 17 | select HAVE_ARCH_KGDB | 17 | select HAVE_ARCH_KGDB |
| 18 | select HAVE_KPROBES if (!XIP_KERNEL) | 18 | select HAVE_KPROBES if (!XIP_KERNEL) |
| 19 | select HAVE_KRETPROBES if (HAVE_KPROBES) | 19 | select HAVE_KRETPROBES if (HAVE_KPROBES) |
| @@ -21,6 +21,7 @@ config ARM | |||
| 21 | select HAVE_GENERIC_DMA_COHERENT | 21 | select HAVE_GENERIC_DMA_COHERENT |
| 22 | select HAVE_KERNEL_GZIP | 22 | select HAVE_KERNEL_GZIP |
| 23 | select HAVE_KERNEL_LZO | 23 | select HAVE_KERNEL_LZO |
| 24 | select HAVE_KERNEL_LZMA | ||
| 24 | select HAVE_PERF_EVENTS | 25 | select HAVE_PERF_EVENTS |
| 25 | select PERF_USE_VMALLOC | 26 | select PERF_USE_VMALLOC |
| 26 | help | 27 | help |
| @@ -42,6 +43,11 @@ config GENERIC_GPIO | |||
| 42 | 43 | ||
| 43 | config GENERIC_TIME | 44 | config GENERIC_TIME |
| 44 | bool | 45 | bool |
| 46 | default y | ||
| 47 | |||
| 48 | config ARCH_USES_GETTIMEOFFSET | ||
| 49 | bool | ||
| 50 | default n | ||
| 45 | 51 | ||
| 46 | config GENERIC_CLOCKEVENTS | 52 | config GENERIC_CLOCKEVENTS |
| 47 | bool | 53 | bool |
| @@ -175,28 +181,6 @@ config ARM_L1_CACHE_SHIFT_6 | |||
| 175 | help | 181 | help |
| 176 | Setting ARM L1 cache line size to 64 Bytes. | 182 | Setting ARM L1 cache line size to 64 Bytes. |
| 177 | 183 | ||
| 178 | if OPROFILE | ||
| 179 | |||
| 180 | config OPROFILE_ARMV6 | ||
| 181 | def_bool y | ||
| 182 | depends on CPU_V6 && !SMP | ||
| 183 | select OPROFILE_ARM11_CORE | ||
| 184 | |||
| 185 | config OPROFILE_MPCORE | ||
| 186 | def_bool y | ||
| 187 | depends on CPU_V6 && SMP | ||
| 188 | select OPROFILE_ARM11_CORE | ||
| 189 | |||
| 190 | config OPROFILE_ARM11_CORE | ||
| 191 | bool | ||
| 192 | |||
| 193 | config OPROFILE_ARMV7 | ||
| 194 | def_bool y | ||
| 195 | depends on CPU_V7 && !SMP | ||
| 196 | bool | ||
| 197 | |||
| 198 | endif | ||
| 199 | |||
| 200 | config VECTORS_BASE | 184 | config VECTORS_BASE |
| 201 | hex | 185 | hex |
| 202 | default 0xffff0000 if MMU || CPU_HIGH_VECTOR | 186 | default 0xffff0000 if MMU || CPU_HIGH_VECTOR |
| @@ -231,6 +215,7 @@ config ARCH_AAEC2000 | |||
| 231 | select CPU_ARM920T | 215 | select CPU_ARM920T |
| 232 | select ARM_AMBA | 216 | select ARM_AMBA |
| 233 | select HAVE_CLK | 217 | select HAVE_CLK |
| 218 | select ARCH_USES_GETTIMEOFFSET | ||
| 234 | help | 219 | help |
| 235 | This enables support for systems based on the Agilent AAEC-2000 | 220 | This enables support for systems based on the Agilent AAEC-2000 |
| 236 | 221 | ||
| @@ -238,21 +223,24 @@ config ARCH_INTEGRATOR | |||
| 238 | bool "ARM Ltd. Integrator family" | 223 | bool "ARM Ltd. Integrator family" |
| 239 | select ARM_AMBA | 224 | select ARM_AMBA |
| 240 | select ARCH_HAS_CPUFREQ | 225 | select ARCH_HAS_CPUFREQ |
| 241 | select HAVE_CLK | ||
| 242 | select COMMON_CLKDEV | 226 | select COMMON_CLKDEV |
| 243 | select ICST525 | 227 | select ICST |
| 228 | select GENERIC_TIME | ||
| 229 | select GENERIC_CLOCKEVENTS | ||
| 230 | select PLAT_VERSATILE | ||
| 244 | help | 231 | help |
| 245 | Support for ARM's Integrator platform. | 232 | Support for ARM's Integrator platform. |
| 246 | 233 | ||
| 247 | config ARCH_REALVIEW | 234 | config ARCH_REALVIEW |
| 248 | bool "ARM Ltd. RealView family" | 235 | bool "ARM Ltd. RealView family" |
| 249 | select ARM_AMBA | 236 | select ARM_AMBA |
| 250 | select HAVE_CLK | ||
| 251 | select COMMON_CLKDEV | 237 | select COMMON_CLKDEV |
| 252 | select ICST307 | 238 | select ICST |
| 253 | select GENERIC_TIME | 239 | select GENERIC_TIME |
| 254 | select GENERIC_CLOCKEVENTS | 240 | select GENERIC_CLOCKEVENTS |
| 255 | select ARCH_WANT_OPTIONAL_GPIOLIB | 241 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 242 | select PLAT_VERSATILE | ||
| 243 | select ARM_TIMER_SP804 | ||
| 256 | select GPIO_PL061 if GPIOLIB | 244 | select GPIO_PL061 if GPIOLIB |
| 257 | help | 245 | help |
| 258 | This enables support for ARM Ltd RealView boards. | 246 | This enables support for ARM Ltd RealView boards. |
| @@ -261,20 +249,35 @@ config ARCH_VERSATILE | |||
| 261 | bool "ARM Ltd. Versatile family" | 249 | bool "ARM Ltd. Versatile family" |
| 262 | select ARM_AMBA | 250 | select ARM_AMBA |
| 263 | select ARM_VIC | 251 | select ARM_VIC |
| 264 | select HAVE_CLK | ||
| 265 | select COMMON_CLKDEV | 252 | select COMMON_CLKDEV |
| 266 | select ICST307 | 253 | select ICST |
| 267 | select GENERIC_TIME | 254 | select GENERIC_TIME |
| 268 | select GENERIC_CLOCKEVENTS | 255 | select GENERIC_CLOCKEVENTS |
| 269 | select ARCH_WANT_OPTIONAL_GPIOLIB | 256 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 257 | select PLAT_VERSATILE | ||
| 258 | select ARM_TIMER_SP804 | ||
| 270 | help | 259 | help |
| 271 | This enables support for ARM Ltd Versatile board. | 260 | This enables support for ARM Ltd Versatile board. |
| 272 | 261 | ||
| 262 | config ARCH_VEXPRESS | ||
| 263 | bool "ARM Ltd. Versatile Express family" | ||
| 264 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
| 265 | select ARM_AMBA | ||
| 266 | select ARM_TIMER_SP804 | ||
| 267 | select COMMON_CLKDEV | ||
| 268 | select GENERIC_CLOCKEVENTS | ||
| 269 | select GENERIC_TIME | ||
| 270 | select HAVE_CLK | ||
| 271 | select ICST | ||
| 272 | select PLAT_VERSATILE | ||
| 273 | help | ||
| 274 | This enables support for the ARM Ltd Versatile Express boards. | ||
| 275 | |||
| 273 | config ARCH_AT91 | 276 | config ARCH_AT91 |
| 274 | bool "Atmel AT91" | 277 | bool "Atmel AT91" |
| 275 | select GENERIC_GPIO | ||
| 276 | select ARCH_REQUIRE_GPIOLIB | 278 | select ARCH_REQUIRE_GPIOLIB |
| 277 | select HAVE_CLK | 279 | select HAVE_CLK |
| 280 | select ARCH_USES_GETTIMEOFFSET | ||
| 278 | help | 281 | help |
| 279 | This enables support for systems based on the Atmel AT91RM9200, | 282 | This enables support for systems based on the Atmel AT91RM9200, |
| 280 | AT91SAM9 and AT91CAP9 processors. | 283 | AT91SAM9 and AT91CAP9 processors. |
| @@ -294,6 +297,7 @@ config ARCH_BCMRING | |||
| 294 | config ARCH_CLPS711X | 297 | config ARCH_CLPS711X |
| 295 | bool "Cirrus Logic CLPS711x/EP721x-based" | 298 | bool "Cirrus Logic CLPS711x/EP721x-based" |
| 296 | select CPU_ARM720T | 299 | select CPU_ARM720T |
| 300 | select ARCH_USES_GETTIMEOFFSET | ||
| 297 | help | 301 | help |
| 298 | Support for Cirrus Logic 711x/721x based boards. | 302 | Support for Cirrus Logic 711x/721x based boards. |
| 299 | 303 | ||
| @@ -309,8 +313,8 @@ config ARCH_CNS3XXX | |||
| 309 | config ARCH_GEMINI | 313 | config ARCH_GEMINI |
| 310 | bool "Cortina Systems Gemini" | 314 | bool "Cortina Systems Gemini" |
| 311 | select CPU_FA526 | 315 | select CPU_FA526 |
| 312 | select GENERIC_GPIO | ||
| 313 | select ARCH_REQUIRE_GPIOLIB | 316 | select ARCH_REQUIRE_GPIOLIB |
| 317 | select ARCH_USES_GETTIMEOFFSET | ||
| 314 | help | 318 | help |
| 315 | Support for the Cortina Systems Gemini family SoCs | 319 | Support for the Cortina Systems Gemini family SoCs |
| 316 | 320 | ||
| @@ -319,6 +323,7 @@ config ARCH_EBSA110 | |||
| 319 | select CPU_SA110 | 323 | select CPU_SA110 |
| 320 | select ISA | 324 | select ISA |
| 321 | select NO_IOPORT | 325 | select NO_IOPORT |
| 326 | select ARCH_USES_GETTIMEOFFSET | ||
| 322 | help | 327 | help |
| 323 | This is an evaluation board for the StrongARM processor available | 328 | This is an evaluation board for the StrongARM processor available |
| 324 | from Digital. It has limited hardware on-board, including an | 329 | from Digital. It has limited hardware on-board, including an |
| @@ -330,11 +335,10 @@ config ARCH_EP93XX | |||
| 330 | select CPU_ARM920T | 335 | select CPU_ARM920T |
| 331 | select ARM_AMBA | 336 | select ARM_AMBA |
| 332 | select ARM_VIC | 337 | select ARM_VIC |
| 333 | select GENERIC_GPIO | ||
| 334 | select HAVE_CLK | ||
| 335 | select COMMON_CLKDEV | 338 | select COMMON_CLKDEV |
| 336 | select ARCH_REQUIRE_GPIOLIB | 339 | select ARCH_REQUIRE_GPIOLIB |
| 337 | select ARCH_HAS_HOLES_MEMORYMODEL | 340 | select ARCH_HAS_HOLES_MEMORYMODEL |
| 341 | select ARCH_USES_GETTIMEOFFSET | ||
| 338 | help | 342 | help |
| 339 | This enables support for the Cirrus EP93xx series of CPUs. | 343 | This enables support for the Cirrus EP93xx series of CPUs. |
| 340 | 344 | ||
| @@ -342,6 +346,7 @@ config ARCH_FOOTBRIDGE | |||
| 342 | bool "FootBridge" | 346 | bool "FootBridge" |
| 343 | select CPU_SA110 | 347 | select CPU_SA110 |
| 344 | select FOOTBRIDGE | 348 | select FOOTBRIDGE |
| 349 | select ARCH_USES_GETTIMEOFFSET | ||
| 345 | help | 350 | help |
| 346 | Support for systems based on the DC21285 companion chip | 351 | Support for systems based on the DC21285 companion chip |
| 347 | ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. | 352 | ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. |
| @@ -351,7 +356,6 @@ config ARCH_MXC | |||
| 351 | select GENERIC_TIME | 356 | select GENERIC_TIME |
| 352 | select GENERIC_CLOCKEVENTS | 357 | select GENERIC_CLOCKEVENTS |
| 353 | select ARCH_REQUIRE_GPIOLIB | 358 | select ARCH_REQUIRE_GPIOLIB |
| 354 | select HAVE_CLK | ||
| 355 | select COMMON_CLKDEV | 359 | select COMMON_CLKDEV |
| 356 | help | 360 | help |
| 357 | Support for Freescale MXC/iMX-based family of processors | 361 | Support for Freescale MXC/iMX-based family of processors |
| @@ -359,12 +363,10 @@ config ARCH_MXC | |||
| 359 | config ARCH_STMP3XXX | 363 | config ARCH_STMP3XXX |
| 360 | bool "Freescale STMP3xxx" | 364 | bool "Freescale STMP3xxx" |
| 361 | select CPU_ARM926T | 365 | select CPU_ARM926T |
| 362 | select HAVE_CLK | ||
| 363 | select COMMON_CLKDEV | 366 | select COMMON_CLKDEV |
| 364 | select ARCH_REQUIRE_GPIOLIB | 367 | select ARCH_REQUIRE_GPIOLIB |
| 365 | select GENERIC_TIME | 368 | select GENERIC_TIME |
| 366 | select GENERIC_CLOCKEVENTS | 369 | select GENERIC_CLOCKEVENTS |
| 367 | select GENERIC_GPIO | ||
| 368 | select USB_ARCH_HAS_EHCI | 370 | select USB_ARCH_HAS_EHCI |
| 369 | help | 371 | help |
| 370 | Support for systems based on the Freescale 3xxx CPUs. | 372 | Support for systems based on the Freescale 3xxx CPUs. |
| @@ -382,6 +384,7 @@ config ARCH_H720X | |||
| 382 | bool "Hynix HMS720x-based" | 384 | bool "Hynix HMS720x-based" |
| 383 | select CPU_ARM720T | 385 | select CPU_ARM720T |
| 384 | select ISA_DMA_API | 386 | select ISA_DMA_API |
| 387 | select ARCH_USES_GETTIMEOFFSET | ||
| 385 | help | 388 | help |
| 386 | This enables support for systems based on the Hynix HMS720x | 389 | This enables support for systems based on the Hynix HMS720x |
| 387 | 390 | ||
| @@ -402,7 +405,6 @@ config ARCH_IOP32X | |||
| 402 | select CPU_XSCALE | 405 | select CPU_XSCALE |
| 403 | select PLAT_IOP | 406 | select PLAT_IOP |
| 404 | select PCI | 407 | select PCI |
| 405 | select GENERIC_GPIO | ||
| 406 | select ARCH_REQUIRE_GPIOLIB | 408 | select ARCH_REQUIRE_GPIOLIB |
| 407 | help | 409 | help |
| 408 | Support for Intel's 80219 and IOP32X (XScale) family of | 410 | Support for Intel's 80219 and IOP32X (XScale) family of |
| @@ -414,7 +416,6 @@ config ARCH_IOP33X | |||
| 414 | select CPU_XSCALE | 416 | select CPU_XSCALE |
| 415 | select PLAT_IOP | 417 | select PLAT_IOP |
| 416 | select PCI | 418 | select PCI |
| 417 | select GENERIC_GPIO | ||
| 418 | select ARCH_REQUIRE_GPIOLIB | 419 | select ARCH_REQUIRE_GPIOLIB |
| 419 | help | 420 | help |
| 420 | Support for Intel's IOP33X (XScale) family of processors. | 421 | Support for Intel's IOP33X (XScale) family of processors. |
| @@ -424,6 +425,7 @@ config ARCH_IXP23XX | |||
| 424 | depends on MMU | 425 | depends on MMU |
| 425 | select CPU_XSC3 | 426 | select CPU_XSC3 |
| 426 | select PCI | 427 | select PCI |
| 428 | select ARCH_USES_GETTIMEOFFSET | ||
| 427 | help | 429 | help |
| 428 | Support for Intel's IXP23xx (XScale) family of processors. | 430 | Support for Intel's IXP23xx (XScale) family of processors. |
| 429 | 431 | ||
| @@ -432,6 +434,7 @@ config ARCH_IXP2000 | |||
| 432 | depends on MMU | 434 | depends on MMU |
| 433 | select CPU_XSCALE | 435 | select CPU_XSCALE |
| 434 | select PCI | 436 | select PCI |
| 437 | select ARCH_USES_GETTIMEOFFSET | ||
| 435 | help | 438 | help |
| 436 | Support for Intel's IXP2400/2800 (XScale) family of processors. | 439 | Support for Intel's IXP2400/2800 (XScale) family of processors. |
| 437 | 440 | ||
| @@ -450,6 +453,7 @@ config ARCH_L7200 | |||
| 450 | bool "LinkUp-L7200" | 453 | bool "LinkUp-L7200" |
| 451 | select CPU_ARM720T | 454 | select CPU_ARM720T |
| 452 | select FIQ | 455 | select FIQ |
| 456 | select ARCH_USES_GETTIMEOFFSET | ||
| 453 | help | 457 | help |
| 454 | Say Y here if you intend to run this kernel on a LinkUp Systems | 458 | Say Y here if you intend to run this kernel on a LinkUp Systems |
| 455 | L7200 Software Development Board which uses an ARM720T processor. | 459 | L7200 Software Development Board which uses an ARM720T processor. |
| @@ -463,7 +467,6 @@ config ARCH_L7200 | |||
| 463 | config ARCH_DOVE | 467 | config ARCH_DOVE |
| 464 | bool "Marvell Dove" | 468 | bool "Marvell Dove" |
| 465 | select PCI | 469 | select PCI |
| 466 | select GENERIC_GPIO | ||
| 467 | select ARCH_REQUIRE_GPIOLIB | 470 | select ARCH_REQUIRE_GPIOLIB |
| 468 | select GENERIC_TIME | 471 | select GENERIC_TIME |
| 469 | select GENERIC_CLOCKEVENTS | 472 | select GENERIC_CLOCKEVENTS |
| @@ -475,7 +478,6 @@ config ARCH_KIRKWOOD | |||
| 475 | bool "Marvell Kirkwood" | 478 | bool "Marvell Kirkwood" |
| 476 | select CPU_FEROCEON | 479 | select CPU_FEROCEON |
| 477 | select PCI | 480 | select PCI |
| 478 | select GENERIC_GPIO | ||
| 479 | select ARCH_REQUIRE_GPIOLIB | 481 | select ARCH_REQUIRE_GPIOLIB |
| 480 | select GENERIC_TIME | 482 | select GENERIC_TIME |
| 481 | select GENERIC_CLOCKEVENTS | 483 | select GENERIC_CLOCKEVENTS |
| @@ -497,7 +499,6 @@ config ARCH_MV78XX0 | |||
| 497 | bool "Marvell MV78xx0" | 499 | bool "Marvell MV78xx0" |
| 498 | select CPU_FEROCEON | 500 | select CPU_FEROCEON |
| 499 | select PCI | 501 | select PCI |
| 500 | select GENERIC_GPIO | ||
| 501 | select ARCH_REQUIRE_GPIOLIB | 502 | select ARCH_REQUIRE_GPIOLIB |
| 502 | select GENERIC_TIME | 503 | select GENERIC_TIME |
| 503 | select GENERIC_CLOCKEVENTS | 504 | select GENERIC_CLOCKEVENTS |
| @@ -511,7 +512,6 @@ config ARCH_ORION5X | |||
| 511 | depends on MMU | 512 | depends on MMU |
| 512 | select CPU_FEROCEON | 513 | select CPU_FEROCEON |
| 513 | select PCI | 514 | select PCI |
| 514 | select GENERIC_GPIO | ||
| 515 | select ARCH_REQUIRE_GPIOLIB | 515 | select ARCH_REQUIRE_GPIOLIB |
| 516 | select GENERIC_TIME | 516 | select GENERIC_TIME |
| 517 | select GENERIC_CLOCKEVENTS | 517 | select GENERIC_CLOCKEVENTS |
| @@ -524,9 +524,7 @@ config ARCH_ORION5X | |||
| 524 | config ARCH_MMP | 524 | config ARCH_MMP |
| 525 | bool "Marvell PXA168/910/MMP2" | 525 | bool "Marvell PXA168/910/MMP2" |
| 526 | depends on MMU | 526 | depends on MMU |
| 527 | select GENERIC_GPIO | ||
| 528 | select ARCH_REQUIRE_GPIOLIB | 527 | select ARCH_REQUIRE_GPIOLIB |
| 529 | select HAVE_CLK | ||
| 530 | select COMMON_CLKDEV | 528 | select COMMON_CLKDEV |
| 531 | select GENERIC_TIME | 529 | select GENERIC_TIME |
| 532 | select GENERIC_CLOCKEVENTS | 530 | select GENERIC_CLOCKEVENTS |
| @@ -538,8 +536,8 @@ config ARCH_MMP | |||
| 538 | config ARCH_KS8695 | 536 | config ARCH_KS8695 |
| 539 | bool "Micrel/Kendin KS8695" | 537 | bool "Micrel/Kendin KS8695" |
| 540 | select CPU_ARM922T | 538 | select CPU_ARM922T |
| 541 | select GENERIC_GPIO | 539 | select ARCH_REQUIRE_GPIOLIB |
| 542 | select ARCH_REQUIRE_GPIOLIB | 540 | select ARCH_USES_GETTIMEOFFSET |
| 543 | help | 541 | help |
| 544 | Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based | 542 | Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based |
| 545 | System-on-Chip devices. | 543 | System-on-Chip devices. |
| @@ -561,8 +559,6 @@ config ARCH_W90X900 | |||
| 561 | bool "Nuvoton W90X900 CPU" | 559 | bool "Nuvoton W90X900 CPU" |
| 562 | select CPU_ARM926T | 560 | select CPU_ARM926T |
| 563 | select ARCH_REQUIRE_GPIOLIB | 561 | select ARCH_REQUIRE_GPIOLIB |
| 564 | select GENERIC_GPIO | ||
| 565 | select HAVE_CLK | ||
| 566 | select COMMON_CLKDEV | 562 | select COMMON_CLKDEV |
| 567 | select GENERIC_TIME | 563 | select GENERIC_TIME |
| 568 | select GENERIC_CLOCKEVENTS | 564 | select GENERIC_CLOCKEVENTS |
| @@ -578,7 +574,6 @@ config ARCH_W90X900 | |||
| 578 | config ARCH_NUC93X | 574 | config ARCH_NUC93X |
| 579 | bool "Nuvoton NUC93X CPU" | 575 | bool "Nuvoton NUC93X CPU" |
| 580 | select CPU_ARM926T | 576 | select CPU_ARM926T |
| 581 | select HAVE_CLK | ||
| 582 | select COMMON_CLKDEV | 577 | select COMMON_CLKDEV |
| 583 | help | 578 | help |
| 584 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a | 579 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a |
| @@ -587,8 +582,8 @@ config ARCH_NUC93X | |||
| 587 | config ARCH_PNX4008 | 582 | config ARCH_PNX4008 |
| 588 | bool "Philips Nexperia PNX4008 Mobile" | 583 | bool "Philips Nexperia PNX4008 Mobile" |
| 589 | select CPU_ARM926T | 584 | select CPU_ARM926T |
| 590 | select HAVE_CLK | ||
| 591 | select COMMON_CLKDEV | 585 | select COMMON_CLKDEV |
| 586 | select ARCH_USES_GETTIMEOFFSET | ||
| 592 | help | 587 | help |
| 593 | This enables support for Philips PNX4008 mobile platform. | 588 | This enables support for Philips PNX4008 mobile platform. |
| 594 | 589 | ||
| @@ -597,8 +592,6 @@ config ARCH_PXA | |||
| 597 | depends on MMU | 592 | depends on MMU |
| 598 | select ARCH_MTD_XIP | 593 | select ARCH_MTD_XIP |
| 599 | select ARCH_HAS_CPUFREQ | 594 | select ARCH_HAS_CPUFREQ |
| 600 | select GENERIC_GPIO | ||
| 601 | select HAVE_CLK | ||
| 602 | select COMMON_CLKDEV | 595 | select COMMON_CLKDEV |
| 603 | select ARCH_REQUIRE_GPIOLIB | 596 | select ARCH_REQUIRE_GPIOLIB |
| 604 | select GENERIC_TIME | 597 | select GENERIC_TIME |
| @@ -635,6 +628,7 @@ config ARCH_RPC | |||
| 635 | select ISA_DMA_API | 628 | select ISA_DMA_API |
| 636 | select NO_IOPORT | 629 | select NO_IOPORT |
| 637 | select ARCH_SPARSEMEM_ENABLE | 630 | select ARCH_SPARSEMEM_ENABLE |
| 631 | select ARCH_USES_GETTIMEOFFSET | ||
| 638 | help | 632 | help |
| 639 | On the Acorn Risc-PC, Linux can support the internal IDE disk and | 633 | On the Acorn Risc-PC, Linux can support the internal IDE disk and |
| 640 | CD-ROM interface, serial and parallel port, and the floppy drive. | 634 | CD-ROM interface, serial and parallel port, and the floppy drive. |
| @@ -647,7 +641,6 @@ config ARCH_SA1100 | |||
| 647 | select ARCH_MTD_XIP | 641 | select ARCH_MTD_XIP |
| 648 | select ARCH_HAS_CPUFREQ | 642 | select ARCH_HAS_CPUFREQ |
| 649 | select CPU_FREQ | 643 | select CPU_FREQ |
| 650 | select GENERIC_GPIO | ||
| 651 | select GENERIC_TIME | 644 | select GENERIC_TIME |
| 652 | select GENERIC_CLOCKEVENTS | 645 | select GENERIC_CLOCKEVENTS |
| 653 | select HAVE_CLK | 646 | select HAVE_CLK |
| @@ -661,6 +654,7 @@ config ARCH_S3C2410 | |||
| 661 | select GENERIC_GPIO | 654 | select GENERIC_GPIO |
| 662 | select ARCH_HAS_CPUFREQ | 655 | select ARCH_HAS_CPUFREQ |
| 663 | select HAVE_CLK | 656 | select HAVE_CLK |
| 657 | select ARCH_USES_GETTIMEOFFSET | ||
| 664 | help | 658 | help |
| 665 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics | 659 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics |
| 666 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or | 660 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or |
| @@ -674,10 +668,10 @@ config ARCH_S3C64XX | |||
| 674 | bool "Samsung S3C64XX" | 668 | bool "Samsung S3C64XX" |
| 675 | select PLAT_SAMSUNG | 669 | select PLAT_SAMSUNG |
| 676 | select CPU_V6 | 670 | select CPU_V6 |
| 677 | select GENERIC_GPIO | ||
| 678 | select ARM_VIC | 671 | select ARM_VIC |
| 679 | select HAVE_CLK | 672 | select HAVE_CLK |
| 680 | select NO_IOPORT | 673 | select NO_IOPORT |
| 674 | select ARCH_USES_GETTIMEOFFSET | ||
| 681 | select ARCH_HAS_CPUFREQ | 675 | select ARCH_HAS_CPUFREQ |
| 682 | select ARCH_REQUIRE_GPIOLIB | 676 | select ARCH_REQUIRE_GPIOLIB |
| 683 | select SAMSUNG_CLKSRC | 677 | select SAMSUNG_CLKSRC |
| @@ -734,6 +728,7 @@ config ARCH_SHARK | |||
| 734 | select ISA_DMA | 728 | select ISA_DMA |
| 735 | select ZONE_DMA | 729 | select ZONE_DMA |
| 736 | select PCI | 730 | select PCI |
| 731 | select ARCH_USES_GETTIMEOFFSET | ||
| 737 | help | 732 | help |
| 738 | Support for the StrongARM based Digital DNARD machine, also known | 733 | Support for the StrongARM based Digital DNARD machine, also known |
| 739 | as "Shark" (<http://www.shark-linux.de/shark.html>). | 734 | as "Shark" (<http://www.shark-linux.de/shark.html>). |
| @@ -743,6 +738,7 @@ config ARCH_LH7A40X | |||
| 743 | select CPU_ARM922T | 738 | select CPU_ARM922T |
| 744 | select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM | 739 | select ARCH_DISCONTIGMEM_ENABLE if !LH7A40X_CONTIGMEM |
| 745 | select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM | 740 | select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM |
| 741 | select ARCH_USES_GETTIMEOFFSET | ||
| 746 | help | 742 | help |
| 747 | Say Y here for systems based on one of the Sharp LH7A40X | 743 | Say Y here for systems based on one of the Sharp LH7A40X |
| 748 | System on a Chip processors. These CPUs include an ARM922T | 744 | System on a Chip processors. These CPUs include an ARM922T |
| @@ -758,7 +754,6 @@ config ARCH_U300 | |||
| 758 | select ARM_VIC | 754 | select ARM_VIC |
| 759 | select GENERIC_TIME | 755 | select GENERIC_TIME |
| 760 | select GENERIC_CLOCKEVENTS | 756 | select GENERIC_CLOCKEVENTS |
| 761 | select HAVE_CLK | ||
| 762 | select COMMON_CLKDEV | 757 | select COMMON_CLKDEV |
| 763 | select GENERIC_GPIO | 758 | select GENERIC_GPIO |
| 764 | help | 759 | help |
| @@ -771,6 +766,7 @@ config ARCH_U8500 | |||
| 771 | select GENERIC_TIME | 766 | select GENERIC_TIME |
| 772 | select GENERIC_CLOCKEVENTS | 767 | select GENERIC_CLOCKEVENTS |
| 773 | select COMMON_CLKDEV | 768 | select COMMON_CLKDEV |
| 769 | select ARCH_REQUIRE_GPIOLIB | ||
| 774 | help | 770 | help |
| 775 | Support for ST-Ericsson's Ux500 architecture | 771 | Support for ST-Ericsson's Ux500 architecture |
| 776 | 772 | ||
| @@ -779,11 +775,9 @@ config ARCH_NOMADIK | |||
| 779 | select ARM_AMBA | 775 | select ARM_AMBA |
| 780 | select ARM_VIC | 776 | select ARM_VIC |
| 781 | select CPU_ARM926T | 777 | select CPU_ARM926T |
| 782 | select HAVE_CLK | ||
| 783 | select COMMON_CLKDEV | 778 | select COMMON_CLKDEV |
| 784 | select GENERIC_TIME | 779 | select GENERIC_TIME |
| 785 | select GENERIC_CLOCKEVENTS | 780 | select GENERIC_CLOCKEVENTS |
| 786 | select GENERIC_GPIO | ||
| 787 | select ARCH_REQUIRE_GPIOLIB | 781 | select ARCH_REQUIRE_GPIOLIB |
| 788 | help | 782 | help |
| 789 | Support for the Nomadik platform by ST-Ericsson | 783 | Support for the Nomadik platform by ST-Ericsson |
| @@ -793,9 +787,7 @@ config ARCH_DAVINCI | |||
| 793 | select CPU_ARM926T | 787 | select CPU_ARM926T |
| 794 | select GENERIC_TIME | 788 | select GENERIC_TIME |
| 795 | select GENERIC_CLOCKEVENTS | 789 | select GENERIC_CLOCKEVENTS |
| 796 | select GENERIC_GPIO | ||
| 797 | select ARCH_REQUIRE_GPIOLIB | 790 | select ARCH_REQUIRE_GPIOLIB |
| 798 | select HAVE_CLK | ||
| 799 | select ZONE_DMA | 791 | select ZONE_DMA |
| 800 | select HAVE_IDE | 792 | select HAVE_IDE |
| 801 | select COMMON_CLKDEV | 793 | select COMMON_CLKDEV |
| @@ -806,7 +798,6 @@ config ARCH_DAVINCI | |||
| 806 | 798 | ||
| 807 | config ARCH_OMAP | 799 | config ARCH_OMAP |
| 808 | bool "TI OMAP" | 800 | bool "TI OMAP" |
| 809 | select GENERIC_GPIO | ||
| 810 | select HAVE_CLK | 801 | select HAVE_CLK |
| 811 | select ARCH_REQUIRE_GPIOLIB | 802 | select ARCH_REQUIRE_GPIOLIB |
| 812 | select ARCH_HAS_CPUFREQ | 803 | select ARCH_HAS_CPUFREQ |
| @@ -816,6 +807,17 @@ config ARCH_OMAP | |||
| 816 | help | 807 | help |
| 817 | Support for TI's OMAP platform (OMAP1 and OMAP2). | 808 | Support for TI's OMAP platform (OMAP1 and OMAP2). |
| 818 | 809 | ||
| 810 | config PLAT_SPEAR | ||
| 811 | bool "ST SPEAr" | ||
| 812 | select ARM_AMBA | ||
| 813 | select ARCH_REQUIRE_GPIOLIB | ||
| 814 | select COMMON_CLKDEV | ||
| 815 | select GENERIC_CLOCKEVENTS | ||
| 816 | select GENERIC_TIME | ||
| 817 | select HAVE_CLK | ||
| 818 | help | ||
| 819 | Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). | ||
| 820 | |||
| 819 | endchoice | 821 | endchoice |
| 820 | 822 | ||
| 821 | # | 823 | # |
| @@ -903,6 +905,7 @@ source "arch/arm/plat-samsung/Kconfig" | |||
| 903 | source "arch/arm/plat-s3c24xx/Kconfig" | 905 | source "arch/arm/plat-s3c24xx/Kconfig" |
| 904 | source "arch/arm/plat-s5p/Kconfig" | 906 | source "arch/arm/plat-s5p/Kconfig" |
| 905 | source "arch/arm/plat-s5pc1xx/Kconfig" | 907 | source "arch/arm/plat-s5pc1xx/Kconfig" |
| 908 | source "arch/arm/plat-spear/Kconfig" | ||
| 906 | 909 | ||
| 907 | if ARCH_S3C2410 | 910 | if ARCH_S3C2410 |
| 908 | source "arch/arm/mach-s3c2400/Kconfig" | 911 | source "arch/arm/mach-s3c2400/Kconfig" |
| @@ -937,6 +940,8 @@ source "arch/arm/mach-ux500/Kconfig" | |||
| 937 | 940 | ||
| 938 | source "arch/arm/mach-versatile/Kconfig" | 941 | source "arch/arm/mach-versatile/Kconfig" |
| 939 | 942 | ||
| 943 | source "arch/arm/mach-vexpress/Kconfig" | ||
| 944 | |||
| 940 | source "arch/arm/mach-w90x900/Kconfig" | 945 | source "arch/arm/mach-w90x900/Kconfig" |
| 941 | 946 | ||
| 942 | # Definitions to make life easier | 947 | # Definitions to make life easier |
| @@ -954,6 +959,12 @@ config PLAT_ORION | |||
| 954 | config PLAT_PXA | 959 | config PLAT_PXA |
| 955 | bool | 960 | bool |
| 956 | 961 | ||
| 962 | config PLAT_VERSATILE | ||
| 963 | bool | ||
| 964 | |||
| 965 | config ARM_TIMER_SP804 | ||
| 966 | bool | ||
| 967 | |||
| 957 | source arch/arm/mm/Kconfig | 968 | source arch/arm/mm/Kconfig |
| 958 | 969 | ||
| 959 | config IWMMXT | 970 | config IWMMXT |
| @@ -1082,6 +1093,10 @@ config PCI | |||
| 1082 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or | 1093 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or |
| 1083 | VESA. If you have PCI, say Y, otherwise N. | 1094 | VESA. If you have PCI, say Y, otherwise N. |
| 1084 | 1095 | ||
| 1096 | config PCI_DOMAINS | ||
| 1097 | bool | ||
| 1098 | depends on PCI | ||
| 1099 | |||
| 1085 | config PCI_SYSCALL | 1100 | config PCI_SYSCALL |
| 1086 | def_bool PCI | 1101 | def_bool PCI |
| 1087 | 1102 | ||
| @@ -1110,10 +1125,11 @@ source "kernel/time/Kconfig" | |||
| 1110 | config SMP | 1125 | config SMP |
| 1111 | bool "Symmetric Multi-Processing (EXPERIMENTAL)" | 1126 | bool "Symmetric Multi-Processing (EXPERIMENTAL)" |
| 1112 | depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\ | 1127 | depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\ |
| 1113 | MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500) | 1128 | MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 ||\ |
| 1129 | ARCH_U8500 || ARCH_VEXPRESS_CA9X4) | ||
| 1114 | depends on GENERIC_CLOCKEVENTS | 1130 | depends on GENERIC_CLOCKEVENTS |
| 1115 | select USE_GENERIC_SMP_HELPERS | 1131 | select USE_GENERIC_SMP_HELPERS |
| 1116 | select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500) | 1132 | select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4) |
| 1117 | help | 1133 | help |
| 1118 | This enables support for systems with more than one CPU. If you have | 1134 | This enables support for systems with more than one CPU. If you have |
| 1119 | a system with only one CPU, like most personal computers, say N. If | 1135 | a system with only one CPU, like most personal computers, say N. If |
| @@ -1294,7 +1310,7 @@ config HIGHPTE | |||
| 1294 | 1310 | ||
| 1295 | config HW_PERF_EVENTS | 1311 | config HW_PERF_EVENTS |
| 1296 | bool "Enable hardware performance counter support for perf events" | 1312 | bool "Enable hardware performance counter support for perf events" |
| 1297 | depends on PERF_EVENTS && CPU_HAS_PMU && (CPU_V6 || CPU_V7) | 1313 | depends on PERF_EVENTS && CPU_HAS_PMU |
| 1298 | default y | 1314 | default y |
| 1299 | help | 1315 | help |
| 1300 | Enable hardware performance counter support for perf events. If | 1316 | Enable hardware performance counter support for perf events. If |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 7cdaf5afcee6..d5af3b024300 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
| @@ -176,9 +176,14 @@ machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx | |||
| 176 | machine-$(CONFIG_ARCH_U300) := u300 | 176 | machine-$(CONFIG_ARCH_U300) := u300 |
| 177 | machine-$(CONFIG_ARCH_U8500) := ux500 | 177 | machine-$(CONFIG_ARCH_U8500) := ux500 |
| 178 | machine-$(CONFIG_ARCH_VERSATILE) := versatile | 178 | machine-$(CONFIG_ARCH_VERSATILE) := versatile |
| 179 | machine-$(CONFIG_ARCH_VEXPRESS) := vexpress | ||
| 179 | machine-$(CONFIG_ARCH_W90X900) := w90x900 | 180 | machine-$(CONFIG_ARCH_W90X900) := w90x900 |
| 180 | machine-$(CONFIG_ARCH_NUC93X) := nuc93x | 181 | machine-$(CONFIG_ARCH_NUC93X) := nuc93x |
| 181 | machine-$(CONFIG_FOOTBRIDGE) := footbridge | 182 | machine-$(CONFIG_FOOTBRIDGE) := footbridge |
| 183 | machine-$(CONFIG_MACH_SPEAR300) := spear3xx | ||
| 184 | machine-$(CONFIG_MACH_SPEAR310) := spear3xx | ||
| 185 | machine-$(CONFIG_MACH_SPEAR320) := spear3xx | ||
| 186 | machine-$(CONFIG_MACH_SPEAR600) := spear6xx | ||
| 182 | 187 | ||
| 183 | # Platform directory name. This list is sorted alphanumerically | 188 | # Platform directory name. This list is sorted alphanumerically |
| 184 | # by CONFIG_* macro name. | 189 | # by CONFIG_* macro name. |
| @@ -193,6 +198,8 @@ plat-$(CONFIG_PLAT_PXA) := pxa | |||
| 193 | plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung | 198 | plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung |
| 194 | plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung | 199 | plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung |
| 195 | plat-$(CONFIG_PLAT_S5P) := s5p samsung | 200 | plat-$(CONFIG_PLAT_S5P) := s5p samsung |
| 201 | plat-$(CONFIG_PLAT_SPEAR) := spear | ||
| 202 | plat-$(CONFIG_PLAT_VERSATILE) := versatile | ||
| 196 | 203 | ||
| 197 | ifeq ($(CONFIG_ARCH_EBSA110),y) | 204 | ifeq ($(CONFIG_ARCH_EBSA110),y) |
| 198 | # This is what happens if you forget the IOCS16 line. | 205 | # This is what happens if you forget the IOCS16 line. |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 97c89e7de7d3..53faa9063a03 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
| @@ -65,6 +65,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ | |||
| 65 | 65 | ||
| 66 | suffix_$(CONFIG_KERNEL_GZIP) = gzip | 66 | suffix_$(CONFIG_KERNEL_GZIP) = gzip |
| 67 | suffix_$(CONFIG_KERNEL_LZO) = lzo | 67 | suffix_$(CONFIG_KERNEL_LZO) = lzo |
| 68 | suffix_$(CONFIG_KERNEL_LZMA) = lzma | ||
| 68 | 69 | ||
| 69 | targets := vmlinux vmlinux.lds \ | 70 | targets := vmlinux vmlinux.lds \ |
| 70 | piggy.$(suffix_y) piggy.$(suffix_y).o \ | 71 | piggy.$(suffix_y) piggy.$(suffix_y).o \ |
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c index 9c097073ce4c..4c72a97bc3e1 100644 --- a/arch/arm/boot/compressed/decompress.c +++ b/arch/arm/boot/compressed/decompress.c | |||
| @@ -40,6 +40,10 @@ extern void error(char *); | |||
| 40 | #include "../../../../lib/decompress_unlzo.c" | 40 | #include "../../../../lib/decompress_unlzo.c" |
| 41 | #endif | 41 | #endif |
| 42 | 42 | ||
| 43 | #ifdef CONFIG_KERNEL_LZMA | ||
| 44 | #include "../../../../lib/decompress_unlzma.c" | ||
| 45 | #endif | ||
| 46 | |||
| 43 | void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)) | 47 | void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)) |
| 44 | { | 48 | { |
| 45 | decompress(input, len, NULL, NULL, output, NULL, error); | 49 | decompress(input, len, NULL, NULL, output, NULL, error); |
diff --git a/arch/arm/boot/compressed/piggy.lzma.S b/arch/arm/boot/compressed/piggy.lzma.S new file mode 100644 index 000000000000..d7e69cffbc0a --- /dev/null +++ b/arch/arm/boot/compressed/piggy.lzma.S | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | .section .piggydata,#alloc | ||
| 2 | .globl input_data | ||
| 3 | input_data: | ||
| 4 | .incbin "arch/arm/boot/compressed/piggy.lzma" | ||
| 5 | .globl input_data_end | ||
| 6 | input_data_end: | ||
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig index 4efbb9df0444..0a34c8186924 100644 --- a/arch/arm/common/Kconfig +++ b/arch/arm/common/Kconfig | |||
| @@ -12,10 +12,10 @@ config ARM_VIC_NR | |||
| 12 | The maximum number of VICs available in the system, for | 12 | The maximum number of VICs available in the system, for |
| 13 | power management. | 13 | power management. |
| 14 | 14 | ||
| 15 | config ICST525 | 15 | config ICST |
| 16 | bool | 16 | bool |
| 17 | 17 | ||
| 18 | config ICST307 | 18 | config PL330 |
| 19 | bool | 19 | bool |
| 20 | 20 | ||
| 21 | config SA1111 | 21 | config SA1111 |
| @@ -40,3 +40,4 @@ config SHARP_SCOOP | |||
| 40 | 40 | ||
| 41 | config COMMON_CLKDEV | 41 | config COMMON_CLKDEV |
| 42 | bool | 42 | bool |
| 43 | select HAVE_CLK | ||
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile index 76be7ff2a7ca..e6e8664a9413 100644 --- a/arch/arm/common/Makefile +++ b/arch/arm/common/Makefile | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | obj-$(CONFIG_ARM_GIC) += gic.o | 5 | obj-$(CONFIG_ARM_GIC) += gic.o |
| 6 | obj-$(CONFIG_ARM_VIC) += vic.o | 6 | obj-$(CONFIG_ARM_VIC) += vic.o |
| 7 | obj-$(CONFIG_ICST525) += icst525.o | 7 | obj-$(CONFIG_ICST) += icst.o |
| 8 | obj-$(CONFIG_ICST307) += icst307.o | 8 | obj-$(CONFIG_PL330) += pl330.o |
| 9 | obj-$(CONFIG_SA1111) += sa1111.o | 9 | obj-$(CONFIG_SA1111) += sa1111.o |
| 10 | obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o | 10 | obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o |
| 11 | obj-$(CONFIG_DMABOUNCE) += dmabounce.o | 11 | obj-$(CONFIG_DMABOUNCE) += dmabounce.o |
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c index dba4c1da63ed..e2b2bb66e094 100644 --- a/arch/arm/common/clkdev.c +++ b/arch/arm/common/clkdev.c | |||
| @@ -53,12 +53,13 @@ static struct clk *clk_find(const char *dev_id, const char *con_id) | |||
| 53 | continue; | 53 | continue; |
| 54 | match += 1; | 54 | match += 1; |
| 55 | } | 55 | } |
| 56 | if (match == 0) | ||
| 57 | continue; | ||
| 58 | 56 | ||
| 59 | if (match > best) { | 57 | if (match > best) { |
| 60 | clk = p->clk; | 58 | clk = p->clk; |
| 61 | best = match; | 59 | if (match != 3) |
| 60 | best = match; | ||
| 61 | else | ||
| 62 | break; | ||
| 62 | } | 63 | } |
| 63 | } | 64 | } |
| 64 | return clk; | 65 | return clk; |
diff --git a/arch/arm/common/icst.c b/arch/arm/common/icst.c new file mode 100644 index 000000000000..9a7f09cff300 --- /dev/null +++ b/arch/arm/common/icst.c | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/common/icst307.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * Support functions for calculating clocks/divisors for the ICST307 | ||
| 11 | * clock generators. See http://www.icst.com/ for more information | ||
| 12 | * on these devices. | ||
| 13 | * | ||
| 14 | * This is an almost identical implementation to the ICST525 clock generator. | ||
| 15 | * The s2div and idx2s files are different | ||
| 16 | */ | ||
| 17 | #include <linux/module.h> | ||
| 18 | #include <linux/kernel.h> | ||
| 19 | |||
| 20 | #include <asm/hardware/icst.h> | ||
| 21 | |||
| 22 | /* | ||
| 23 | * Divisors for each OD setting. | ||
| 24 | */ | ||
| 25 | const unsigned char icst307_s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 }; | ||
| 26 | const unsigned char icst525_s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 }; | ||
| 27 | EXPORT_SYMBOL(icst307_s2div); | ||
| 28 | EXPORT_SYMBOL(icst525_s2div); | ||
| 29 | |||
| 30 | unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco) | ||
| 31 | { | ||
| 32 | return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]); | ||
| 33 | } | ||
| 34 | |||
| 35 | EXPORT_SYMBOL(icst_hz); | ||
| 36 | |||
| 37 | /* | ||
| 38 | * Ascending divisor S values. | ||
| 39 | */ | ||
| 40 | const unsigned char icst307_idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 }; | ||
| 41 | const unsigned char icst525_idx2s[8] = { 1, 3, 4, 7, 5, 2, 6, 0 }; | ||
| 42 | EXPORT_SYMBOL(icst307_idx2s); | ||
| 43 | EXPORT_SYMBOL(icst525_idx2s); | ||
| 44 | |||
| 45 | struct icst_vco | ||
| 46 | icst_hz_to_vco(const struct icst_params *p, unsigned long freq) | ||
| 47 | { | ||
| 48 | struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
| 49 | unsigned long f; | ||
| 50 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
| 51 | |||
| 52 | /* | ||
| 53 | * First, find the PLL output divisor such | ||
| 54 | * that the PLL output is within spec. | ||
| 55 | */ | ||
| 56 | do { | ||
| 57 | f = freq * p->s2div[p->idx2s[i]]; | ||
| 58 | |||
| 59 | if (f > p->vco_min && f <= p->vco_max) | ||
| 60 | break; | ||
| 61 | } while (i < 8); | ||
| 62 | |||
| 63 | if (i >= 8) | ||
| 64 | return vco; | ||
| 65 | |||
| 66 | vco.s = p->idx2s[i]; | ||
| 67 | |||
| 68 | /* | ||
| 69 | * Now find the closest divisor combination | ||
| 70 | * which gives a PLL output of 'f'. | ||
| 71 | */ | ||
| 72 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
| 73 | unsigned long fref_div, f_pll; | ||
| 74 | unsigned int vd; | ||
| 75 | int f_diff; | ||
| 76 | |||
| 77 | fref_div = (2 * p->ref) / rd; | ||
| 78 | |||
| 79 | vd = (f + fref_div / 2) / fref_div; | ||
| 80 | if (vd < p->vd_min || vd > p->vd_max) | ||
| 81 | continue; | ||
| 82 | |||
| 83 | f_pll = fref_div * vd; | ||
| 84 | f_diff = f_pll - f; | ||
| 85 | if (f_diff < 0) | ||
| 86 | f_diff = -f_diff; | ||
| 87 | |||
| 88 | if ((unsigned)f_diff < best) { | ||
| 89 | vco.v = vd - 8; | ||
| 90 | vco.r = rd - 2; | ||
| 91 | if (f_diff == 0) | ||
| 92 | break; | ||
| 93 | best = f_diff; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | |||
| 97 | return vco; | ||
| 98 | } | ||
| 99 | |||
| 100 | EXPORT_SYMBOL(icst_hz_to_vco); | ||
diff --git a/arch/arm/common/icst307.c b/arch/arm/common/icst307.c deleted file mode 100644 index 6d094c157540..000000000000 --- a/arch/arm/common/icst307.c +++ /dev/null | |||
| @@ -1,161 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/common/icst307.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * Support functions for calculating clocks/divisors for the ICST307 | ||
| 11 | * clock generators. See http://www.icst.com/ for more information | ||
| 12 | * on these devices. | ||
| 13 | * | ||
| 14 | * This is an almost identical implementation to the ICST525 clock generator. | ||
| 15 | * The s2div and idx2s files are different | ||
| 16 | */ | ||
| 17 | #include <linux/module.h> | ||
| 18 | #include <linux/kernel.h> | ||
| 19 | |||
| 20 | #include <asm/hardware/icst307.h> | ||
| 21 | |||
| 22 | /* | ||
| 23 | * Divisors for each OD setting. | ||
| 24 | */ | ||
| 25 | static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 }; | ||
| 26 | |||
| 27 | unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco) | ||
| 28 | { | ||
| 29 | return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]); | ||
| 30 | } | ||
| 31 | |||
| 32 | EXPORT_SYMBOL(icst307_khz); | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Ascending divisor S values. | ||
| 36 | */ | ||
| 37 | static unsigned char idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 }; | ||
| 38 | |||
| 39 | struct icst307_vco | ||
| 40 | icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq) | ||
| 41 | { | ||
| 42 | struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
| 43 | unsigned long f; | ||
| 44 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
| 45 | |||
| 46 | /* | ||
| 47 | * First, find the PLL output divisor such | ||
| 48 | * that the PLL output is within spec. | ||
| 49 | */ | ||
| 50 | do { | ||
| 51 | f = freq * s2div[idx2s[i]]; | ||
| 52 | |||
| 53 | /* | ||
| 54 | * f must be between 6MHz and 200MHz (3.3 or 5V) | ||
| 55 | */ | ||
| 56 | if (f > 6000 && f <= p->vco_max) | ||
| 57 | break; | ||
| 58 | } while (i < ARRAY_SIZE(idx2s)); | ||
| 59 | |||
| 60 | if (i >= ARRAY_SIZE(idx2s)) | ||
| 61 | return vco; | ||
| 62 | |||
| 63 | vco.s = idx2s[i]; | ||
| 64 | |||
| 65 | /* | ||
| 66 | * Now find the closest divisor combination | ||
| 67 | * which gives a PLL output of 'f'. | ||
| 68 | */ | ||
| 69 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
| 70 | unsigned long fref_div, f_pll; | ||
| 71 | unsigned int vd; | ||
| 72 | int f_diff; | ||
| 73 | |||
| 74 | fref_div = (2 * p->ref) / rd; | ||
| 75 | |||
| 76 | vd = (f + fref_div / 2) / fref_div; | ||
| 77 | if (vd < p->vd_min || vd > p->vd_max) | ||
| 78 | continue; | ||
| 79 | |||
| 80 | f_pll = fref_div * vd; | ||
| 81 | f_diff = f_pll - f; | ||
| 82 | if (f_diff < 0) | ||
| 83 | f_diff = -f_diff; | ||
| 84 | |||
| 85 | if ((unsigned)f_diff < best) { | ||
| 86 | vco.v = vd - 8; | ||
| 87 | vco.r = rd - 2; | ||
| 88 | if (f_diff == 0) | ||
| 89 | break; | ||
| 90 | best = f_diff; | ||
| 91 | } | ||
| 92 | } | ||
| 93 | |||
| 94 | return vco; | ||
| 95 | } | ||
| 96 | |||
| 97 | EXPORT_SYMBOL(icst307_khz_to_vco); | ||
| 98 | |||
| 99 | struct icst307_vco | ||
| 100 | icst307_ps_to_vco(const struct icst307_params *p, unsigned long period) | ||
| 101 | { | ||
| 102 | struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
| 103 | unsigned long f, ps; | ||
| 104 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
| 105 | |||
| 106 | ps = 1000000000UL / p->vco_max; | ||
| 107 | |||
| 108 | /* | ||
| 109 | * First, find the PLL output divisor such | ||
| 110 | * that the PLL output is within spec. | ||
| 111 | */ | ||
| 112 | do { | ||
| 113 | f = period / s2div[idx2s[i]]; | ||
| 114 | |||
| 115 | /* | ||
| 116 | * f must be between 6MHz and 200MHz (3.3 or 5V) | ||
| 117 | */ | ||
| 118 | if (f >= ps && f < 1000000000UL / 6000 + 1) | ||
| 119 | break; | ||
| 120 | } while (i < ARRAY_SIZE(idx2s)); | ||
| 121 | |||
| 122 | if (i >= ARRAY_SIZE(idx2s)) | ||
| 123 | return vco; | ||
| 124 | |||
| 125 | vco.s = idx2s[i]; | ||
| 126 | |||
| 127 | ps = 500000000UL / p->ref; | ||
| 128 | |||
| 129 | /* | ||
| 130 | * Now find the closest divisor combination | ||
| 131 | * which gives a PLL output of 'f'. | ||
| 132 | */ | ||
| 133 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
| 134 | unsigned long f_in_div, f_pll; | ||
| 135 | unsigned int vd; | ||
| 136 | int f_diff; | ||
| 137 | |||
| 138 | f_in_div = ps * rd; | ||
| 139 | |||
| 140 | vd = (f_in_div + f / 2) / f; | ||
| 141 | if (vd < p->vd_min || vd > p->vd_max) | ||
| 142 | continue; | ||
| 143 | |||
| 144 | f_pll = (f_in_div + vd / 2) / vd; | ||
| 145 | f_diff = f_pll - f; | ||
| 146 | if (f_diff < 0) | ||
| 147 | f_diff = -f_diff; | ||
| 148 | |||
| 149 | if ((unsigned)f_diff < best) { | ||
| 150 | vco.v = vd - 8; | ||
| 151 | vco.r = rd - 2; | ||
| 152 | if (f_diff == 0) | ||
| 153 | break; | ||
| 154 | best = f_diff; | ||
| 155 | } | ||
| 156 | } | ||
| 157 | |||
| 158 | return vco; | ||
| 159 | } | ||
| 160 | |||
| 161 | EXPORT_SYMBOL(icst307_ps_to_vco); | ||
diff --git a/arch/arm/common/icst525.c b/arch/arm/common/icst525.c deleted file mode 100644 index 3d377c5bdef6..000000000000 --- a/arch/arm/common/icst525.c +++ /dev/null | |||
| @@ -1,160 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/common/icst525.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * Support functions for calculating clocks/divisors for the ICST525 | ||
| 11 | * clock generators. See http://www.icst.com/ for more information | ||
| 12 | * on these devices. | ||
| 13 | */ | ||
| 14 | #include <linux/module.h> | ||
| 15 | #include <linux/kernel.h> | ||
| 16 | |||
| 17 | #include <asm/hardware/icst525.h> | ||
| 18 | |||
| 19 | /* | ||
| 20 | * Divisors for each OD setting. | ||
| 21 | */ | ||
| 22 | static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 }; | ||
| 23 | |||
| 24 | unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco) | ||
| 25 | { | ||
| 26 | return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]); | ||
| 27 | } | ||
| 28 | |||
| 29 | EXPORT_SYMBOL(icst525_khz); | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Ascending divisor S values. | ||
| 33 | */ | ||
| 34 | static unsigned char idx2s[] = { 1, 3, 4, 7, 5, 2, 6, 0 }; | ||
| 35 | |||
| 36 | struct icst525_vco | ||
| 37 | icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq) | ||
| 38 | { | ||
| 39 | struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
| 40 | unsigned long f; | ||
| 41 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
| 42 | |||
| 43 | /* | ||
| 44 | * First, find the PLL output divisor such | ||
| 45 | * that the PLL output is within spec. | ||
| 46 | */ | ||
| 47 | do { | ||
| 48 | f = freq * s2div[idx2s[i]]; | ||
| 49 | |||
| 50 | /* | ||
| 51 | * f must be between 10MHz and | ||
| 52 | * 320MHz (5V) or 200MHz (3V) | ||
| 53 | */ | ||
| 54 | if (f > 10000 && f <= p->vco_max) | ||
| 55 | break; | ||
| 56 | } while (i < ARRAY_SIZE(idx2s)); | ||
| 57 | |||
| 58 | if (i >= ARRAY_SIZE(idx2s)) | ||
| 59 | return vco; | ||
| 60 | |||
| 61 | vco.s = idx2s[i]; | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Now find the closest divisor combination | ||
| 65 | * which gives a PLL output of 'f'. | ||
| 66 | */ | ||
| 67 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
| 68 | unsigned long fref_div, f_pll; | ||
| 69 | unsigned int vd; | ||
| 70 | int f_diff; | ||
| 71 | |||
| 72 | fref_div = (2 * p->ref) / rd; | ||
| 73 | |||
| 74 | vd = (f + fref_div / 2) / fref_div; | ||
| 75 | if (vd < p->vd_min || vd > p->vd_max) | ||
| 76 | continue; | ||
| 77 | |||
| 78 | f_pll = fref_div * vd; | ||
| 79 | f_diff = f_pll - f; | ||
| 80 | if (f_diff < 0) | ||
| 81 | f_diff = -f_diff; | ||
| 82 | |||
| 83 | if ((unsigned)f_diff < best) { | ||
| 84 | vco.v = vd - 8; | ||
| 85 | vco.r = rd - 2; | ||
| 86 | if (f_diff == 0) | ||
| 87 | break; | ||
| 88 | best = f_diff; | ||
| 89 | } | ||
| 90 | } | ||
| 91 | |||
| 92 | return vco; | ||
| 93 | } | ||
| 94 | |||
| 95 | EXPORT_SYMBOL(icst525_khz_to_vco); | ||
| 96 | |||
| 97 | struct icst525_vco | ||
| 98 | icst525_ps_to_vco(const struct icst525_params *p, unsigned long period) | ||
| 99 | { | ||
| 100 | struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; | ||
| 101 | unsigned long f, ps; | ||
| 102 | unsigned int i = 0, rd, best = (unsigned int)-1; | ||
| 103 | |||
| 104 | ps = 1000000000UL / p->vco_max; | ||
| 105 | |||
| 106 | /* | ||
| 107 | * First, find the PLL output divisor such | ||
| 108 | * that the PLL output is within spec. | ||
| 109 | */ | ||
| 110 | do { | ||
| 111 | f = period / s2div[idx2s[i]]; | ||
| 112 | |||
| 113 | /* | ||
| 114 | * f must be between 10MHz and | ||
| 115 | * 320MHz (5V) or 200MHz (3V) | ||
| 116 | */ | ||
| 117 | if (f >= ps && f < 100000) | ||
| 118 | break; | ||
| 119 | } while (i < ARRAY_SIZE(idx2s)); | ||
| 120 | |||
| 121 | if (i >= ARRAY_SIZE(idx2s)) | ||
| 122 | return vco; | ||
| 123 | |||
| 124 | vco.s = idx2s[i]; | ||
| 125 | |||
| 126 | ps = 500000000UL / p->ref; | ||
| 127 | |||
| 128 | /* | ||
| 129 | * Now find the closest divisor combination | ||
| 130 | * which gives a PLL output of 'f'. | ||
| 131 | */ | ||
| 132 | for (rd = p->rd_min; rd <= p->rd_max; rd++) { | ||
| 133 | unsigned long f_in_div, f_pll; | ||
| 134 | unsigned int vd; | ||
| 135 | int f_diff; | ||
| 136 | |||
| 137 | f_in_div = ps * rd; | ||
| 138 | |||
| 139 | vd = (f_in_div + f / 2) / f; | ||
| 140 | if (vd < p->vd_min || vd > p->vd_max) | ||
| 141 | continue; | ||
| 142 | |||
| 143 | f_pll = (f_in_div + vd / 2) / vd; | ||
| 144 | f_diff = f_pll - f; | ||
| 145 | if (f_diff < 0) | ||
| 146 | f_diff = -f_diff; | ||
| 147 | |||
| 148 | if ((unsigned)f_diff < best) { | ||
| 149 | vco.v = vd - 8; | ||
| 150 | vco.r = rd - 2; | ||
| 151 | if (f_diff == 0) | ||
| 152 | break; | ||
| 153 | best = f_diff; | ||
| 154 | } | ||
| 155 | } | ||
| 156 | |||
| 157 | return vco; | ||
| 158 | } | ||
| 159 | |||
| 160 | EXPORT_SYMBOL(icst525_ps_to_vco); | ||
diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c new file mode 100644 index 000000000000..5ebbab6242a7 --- /dev/null +++ b/arch/arm/common/pl330.c | |||
| @@ -0,0 +1,1966 @@ | |||
| 1 | /* linux/arch/arm/common/pl330.c | ||
| 2 | * | ||
| 3 | * Copyright (C) 2010 Samsung Electronics Co Ltd. | ||
| 4 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include <linux/kernel.h> | ||
| 22 | #include <linux/init.h> | ||
| 23 | #include <linux/slab.h> | ||
| 24 | #include <linux/module.h> | ||
| 25 | #include <linux/string.h> | ||
| 26 | #include <linux/io.h> | ||
| 27 | #include <linux/delay.h> | ||
| 28 | #include <linux/interrupt.h> | ||
| 29 | #include <linux/dma-mapping.h> | ||
| 30 | |||
| 31 | #include <asm/hardware/pl330.h> | ||
| 32 | |||
| 33 | /* Register and Bit field Definitions */ | ||
| 34 | #define DS 0x0 | ||
| 35 | #define DS_ST_STOP 0x0 | ||
| 36 | #define DS_ST_EXEC 0x1 | ||
| 37 | #define DS_ST_CMISS 0x2 | ||
| 38 | #define DS_ST_UPDTPC 0x3 | ||
| 39 | #define DS_ST_WFE 0x4 | ||
| 40 | #define DS_ST_ATBRR 0x5 | ||
| 41 | #define DS_ST_QBUSY 0x6 | ||
| 42 | #define DS_ST_WFP 0x7 | ||
| 43 | #define DS_ST_KILL 0x8 | ||
| 44 | #define DS_ST_CMPLT 0x9 | ||
| 45 | #define DS_ST_FLTCMP 0xe | ||
| 46 | #define DS_ST_FAULT 0xf | ||
| 47 | |||
| 48 | #define DPC 0x4 | ||
| 49 | #define INTEN 0x20 | ||
| 50 | #define ES 0x24 | ||
| 51 | #define INTSTATUS 0x28 | ||
| 52 | #define INTCLR 0x2c | ||
| 53 | #define FSM 0x30 | ||
| 54 | #define FSC 0x34 | ||
| 55 | #define FTM 0x38 | ||
| 56 | |||
| 57 | #define _FTC 0x40 | ||
| 58 | #define FTC(n) (_FTC + (n)*0x4) | ||
| 59 | |||
| 60 | #define _CS 0x100 | ||
| 61 | #define CS(n) (_CS + (n)*0x8) | ||
| 62 | #define CS_CNS (1 << 21) | ||
| 63 | |||
| 64 | #define _CPC 0x104 | ||
| 65 | #define CPC(n) (_CPC + (n)*0x8) | ||
| 66 | |||
| 67 | #define _SA 0x400 | ||
| 68 | #define SA(n) (_SA + (n)*0x20) | ||
| 69 | |||
| 70 | #define _DA 0x404 | ||
| 71 | #define DA(n) (_DA + (n)*0x20) | ||
| 72 | |||
| 73 | #define _CC 0x408 | ||
| 74 | #define CC(n) (_CC + (n)*0x20) | ||
| 75 | |||
| 76 | #define CC_SRCINC (1 << 0) | ||
| 77 | #define CC_DSTINC (1 << 14) | ||
| 78 | #define CC_SRCPRI (1 << 8) | ||
| 79 | #define CC_DSTPRI (1 << 22) | ||
| 80 | #define CC_SRCNS (1 << 9) | ||
| 81 | #define CC_DSTNS (1 << 23) | ||
| 82 | #define CC_SRCIA (1 << 10) | ||
| 83 | #define CC_DSTIA (1 << 24) | ||
| 84 | #define CC_SRCBRSTLEN_SHFT 4 | ||
| 85 | #define CC_DSTBRSTLEN_SHFT 18 | ||
| 86 | #define CC_SRCBRSTSIZE_SHFT 1 | ||
| 87 | #define CC_DSTBRSTSIZE_SHFT 15 | ||
| 88 | #define CC_SRCCCTRL_SHFT 11 | ||
| 89 | #define CC_SRCCCTRL_MASK 0x7 | ||
| 90 | #define CC_DSTCCTRL_SHFT 25 | ||
| 91 | #define CC_DRCCCTRL_MASK 0x7 | ||
| 92 | #define CC_SWAP_SHFT 28 | ||
| 93 | |||
| 94 | #define _LC0 0x40c | ||
| 95 | #define LC0(n) (_LC0 + (n)*0x20) | ||
| 96 | |||
| 97 | #define _LC1 0x410 | ||
| 98 | #define LC1(n) (_LC1 + (n)*0x20) | ||
| 99 | |||
| 100 | #define DBGSTATUS 0xd00 | ||
| 101 | #define DBG_BUSY (1 << 0) | ||
| 102 | |||
| 103 | #define DBGCMD 0xd04 | ||
| 104 | #define DBGINST0 0xd08 | ||
| 105 | #define DBGINST1 0xd0c | ||
| 106 | |||
| 107 | #define CR0 0xe00 | ||
| 108 | #define CR1 0xe04 | ||
| 109 | #define CR2 0xe08 | ||
| 110 | #define CR3 0xe0c | ||
| 111 | #define CR4 0xe10 | ||
| 112 | #define CRD 0xe14 | ||
| 113 | |||
| 114 | #define PERIPH_ID 0xfe0 | ||
| 115 | #define PCELL_ID 0xff0 | ||
| 116 | |||
| 117 | #define CR0_PERIPH_REQ_SET (1 << 0) | ||
| 118 | #define CR0_BOOT_EN_SET (1 << 1) | ||
| 119 | #define CR0_BOOT_MAN_NS (1 << 2) | ||
| 120 | #define CR0_NUM_CHANS_SHIFT 4 | ||
| 121 | #define CR0_NUM_CHANS_MASK 0x7 | ||
| 122 | #define CR0_NUM_PERIPH_SHIFT 12 | ||
| 123 | #define CR0_NUM_PERIPH_MASK 0x1f | ||
| 124 | #define CR0_NUM_EVENTS_SHIFT 17 | ||
| 125 | #define CR0_NUM_EVENTS_MASK 0x1f | ||
| 126 | |||
| 127 | #define CR1_ICACHE_LEN_SHIFT 0 | ||
| 128 | #define CR1_ICACHE_LEN_MASK 0x7 | ||
| 129 | #define CR1_NUM_ICACHELINES_SHIFT 4 | ||
| 130 | #define CR1_NUM_ICACHELINES_MASK 0xf | ||
| 131 | |||
| 132 | #define CRD_DATA_WIDTH_SHIFT 0 | ||
| 133 | #define CRD_DATA_WIDTH_MASK 0x7 | ||
| 134 | #define CRD_WR_CAP_SHIFT 4 | ||
| 135 | #define CRD_WR_CAP_MASK 0x7 | ||
| 136 | #define CRD_WR_Q_DEP_SHIFT 8 | ||
| 137 | #define CRD_WR_Q_DEP_MASK 0xf | ||
| 138 | #define CRD_RD_CAP_SHIFT 12 | ||
| 139 | #define CRD_RD_CAP_MASK 0x7 | ||
| 140 | #define CRD_RD_Q_DEP_SHIFT 16 | ||
| 141 | #define CRD_RD_Q_DEP_MASK 0xf | ||
| 142 | #define CRD_DATA_BUFF_SHIFT 20 | ||
| 143 | #define CRD_DATA_BUFF_MASK 0x3ff | ||
| 144 | |||
| 145 | #define PART 0x330 | ||
| 146 | #define DESIGNER 0x41 | ||
| 147 | #define REVISION 0x0 | ||
| 148 | #define INTEG_CFG 0x0 | ||
| 149 | #define PERIPH_ID_VAL ((PART << 0) | (DESIGNER << 12) \ | ||
| 150 | | (REVISION << 20) | (INTEG_CFG << 24)) | ||
| 151 | |||
| 152 | #define PCELL_ID_VAL 0xb105f00d | ||
| 153 | |||
| 154 | #define PL330_STATE_STOPPED (1 << 0) | ||
| 155 | #define PL330_STATE_EXECUTING (1 << 1) | ||
| 156 | #define PL330_STATE_WFE (1 << 2) | ||
| 157 | #define PL330_STATE_FAULTING (1 << 3) | ||
| 158 | #define PL330_STATE_COMPLETING (1 << 4) | ||
| 159 | #define PL330_STATE_WFP (1 << 5) | ||
| 160 | #define PL330_STATE_KILLING (1 << 6) | ||
| 161 | #define PL330_STATE_FAULT_COMPLETING (1 << 7) | ||
| 162 | #define PL330_STATE_CACHEMISS (1 << 8) | ||
| 163 | #define PL330_STATE_UPDTPC (1 << 9) | ||
| 164 | #define PL330_STATE_ATBARRIER (1 << 10) | ||
| 165 | #define PL330_STATE_QUEUEBUSY (1 << 11) | ||
| 166 | #define PL330_STATE_INVALID (1 << 15) | ||
| 167 | |||
| 168 | #define PL330_STABLE_STATES (PL330_STATE_STOPPED | PL330_STATE_EXECUTING \ | ||
| 169 | | PL330_STATE_WFE | PL330_STATE_FAULTING) | ||
| 170 | |||
| 171 | #define CMD_DMAADDH 0x54 | ||
| 172 | #define CMD_DMAEND 0x00 | ||
| 173 | #define CMD_DMAFLUSHP 0x35 | ||
| 174 | #define CMD_DMAGO 0xa0 | ||
| 175 | #define CMD_DMALD 0x04 | ||
| 176 | #define CMD_DMALDP 0x25 | ||
| 177 | #define CMD_DMALP 0x20 | ||
| 178 | #define CMD_DMALPEND 0x28 | ||
| 179 | #define CMD_DMAKILL 0x01 | ||
| 180 | #define CMD_DMAMOV 0xbc | ||
| 181 | #define CMD_DMANOP 0x18 | ||
| 182 | #define CMD_DMARMB 0x12 | ||
| 183 | #define CMD_DMASEV 0x34 | ||
| 184 | #define CMD_DMAST 0x08 | ||
| 185 | #define CMD_DMASTP 0x29 | ||
| 186 | #define CMD_DMASTZ 0x0c | ||
| 187 | #define CMD_DMAWFE 0x36 | ||
| 188 | #define CMD_DMAWFP 0x30 | ||
| 189 | #define CMD_DMAWMB 0x13 | ||
| 190 | |||
| 191 | #define SZ_DMAADDH 3 | ||
| 192 | #define SZ_DMAEND 1 | ||
| 193 | #define SZ_DMAFLUSHP 2 | ||
| 194 | #define SZ_DMALD 1 | ||
| 195 | #define SZ_DMALDP 2 | ||
| 196 | #define SZ_DMALP 2 | ||
| 197 | #define SZ_DMALPEND 2 | ||
| 198 | #define SZ_DMAKILL 1 | ||
| 199 | #define SZ_DMAMOV 6 | ||
| 200 | #define SZ_DMANOP 1 | ||
| 201 | #define SZ_DMARMB 1 | ||
| 202 | #define SZ_DMASEV 2 | ||
| 203 | #define SZ_DMAST 1 | ||
| 204 | #define SZ_DMASTP 2 | ||
| 205 | #define SZ_DMASTZ 1 | ||
| 206 | #define SZ_DMAWFE 2 | ||
| 207 | #define SZ_DMAWFP 2 | ||
| 208 | #define SZ_DMAWMB 1 | ||
| 209 | #define SZ_DMAGO 6 | ||
| 210 | |||
| 211 | #define BRST_LEN(ccr) ((((ccr) >> CC_SRCBRSTLEN_SHFT) & 0xf) + 1) | ||
| 212 | #define BRST_SIZE(ccr) (1 << (((ccr) >> CC_SRCBRSTSIZE_SHFT) & 0x7)) | ||
| 213 | |||
| 214 | #define BYTE_TO_BURST(b, ccr) ((b) / BRST_SIZE(ccr) / BRST_LEN(ccr)) | ||
| 215 | #define BURST_TO_BYTE(c, ccr) ((c) * BRST_SIZE(ccr) * BRST_LEN(ccr)) | ||
| 216 | |||
| 217 | /* | ||
| 218 | * With 256 bytes, we can do more than 2.5MB and 5MB xfers per req | ||
| 219 | * at 1byte/burst for P<->M and M<->M respectively. | ||
| 220 | * For typical scenario, at 1word/burst, 10MB and 20MB xfers per req | ||
| 221 | * should be enough for P<->M and M<->M respectively. | ||
| 222 | */ | ||
| 223 | #define MCODE_BUFF_PER_REQ 256 | ||
| 224 | |||
| 225 | /* | ||
| 226 | * Mark a _pl330_req as free. | ||
| 227 | * We do it by writing DMAEND as the first instruction | ||
| 228 | * because no valid request is going to have DMAEND as | ||
| 229 | * its first instruction to execute. | ||
| 230 | */ | ||
| 231 | #define MARK_FREE(req) do { \ | ||
| 232 | _emit_END(0, (req)->mc_cpu); \ | ||
| 233 | (req)->mc_len = 0; \ | ||
| 234 | } while (0) | ||
| 235 | |||
| 236 | /* If the _pl330_req is available to the client */ | ||
| 237 | #define IS_FREE(req) (*((u8 *)((req)->mc_cpu)) == CMD_DMAEND) | ||
| 238 | |||
| 239 | /* Use this _only_ to wait on transient states */ | ||
| 240 | #define UNTIL(t, s) while (!(_state(t) & (s))) cpu_relax(); | ||
| 241 | |||
| 242 | #ifdef PL330_DEBUG_MCGEN | ||
| 243 | static unsigned cmd_line; | ||
| 244 | #define PL330_DBGCMD_DUMP(off, x...) do { \ | ||
| 245 | printk("%x:", cmd_line); \ | ||
| 246 | printk(x); \ | ||
| 247 | cmd_line += off; \ | ||
| 248 | } while (0) | ||
| 249 | #define PL330_DBGMC_START(addr) (cmd_line = addr) | ||
| 250 | #else | ||
| 251 | #define PL330_DBGCMD_DUMP(off, x...) do {} while (0) | ||
| 252 | #define PL330_DBGMC_START(addr) do {} while (0) | ||
| 253 | #endif | ||
| 254 | |||
| 255 | struct _xfer_spec { | ||
| 256 | u32 ccr; | ||
| 257 | struct pl330_req *r; | ||
| 258 | struct pl330_xfer *x; | ||
| 259 | }; | ||
| 260 | |||
| 261 | enum dmamov_dst { | ||
| 262 | SAR = 0, | ||
| 263 | CCR, | ||
| 264 | DAR, | ||
| 265 | }; | ||
| 266 | |||
| 267 | enum pl330_dst { | ||
| 268 | SRC = 0, | ||
| 269 | DST, | ||
| 270 | }; | ||
| 271 | |||
| 272 | enum pl330_cond { | ||
| 273 | SINGLE, | ||
| 274 | BURST, | ||
| 275 | ALWAYS, | ||
| 276 | }; | ||
| 277 | |||
| 278 | struct _pl330_req { | ||
| 279 | u32 mc_bus; | ||
| 280 | void *mc_cpu; | ||
| 281 | /* Number of bytes taken to setup MC for the req */ | ||
| 282 | u32 mc_len; | ||
| 283 | struct pl330_req *r; | ||
| 284 | /* Hook to attach to DMAC's list of reqs with due callback */ | ||
| 285 | struct list_head rqd; | ||
| 286 | }; | ||
| 287 | |||
| 288 | /* ToBeDone for tasklet */ | ||
| 289 | struct _pl330_tbd { | ||
| 290 | bool reset_dmac; | ||
| 291 | bool reset_mngr; | ||
| 292 | u8 reset_chan; | ||
| 293 | }; | ||
| 294 | |||
| 295 | /* A DMAC Thread */ | ||
| 296 | struct pl330_thread { | ||
| 297 | u8 id; | ||
| 298 | int ev; | ||
| 299 | /* If the channel is not yet acquired by any client */ | ||
| 300 | bool free; | ||
| 301 | /* Parent DMAC */ | ||
| 302 | struct pl330_dmac *dmac; | ||
| 303 | /* Only two at a time */ | ||
| 304 | struct _pl330_req req[2]; | ||
| 305 | /* Index of the last submitted request */ | ||
| 306 | unsigned lstenq; | ||
| 307 | }; | ||
| 308 | |||
| 309 | enum pl330_dmac_state { | ||
| 310 | UNINIT, | ||
| 311 | INIT, | ||
| 312 | DYING, | ||
| 313 | }; | ||
| 314 | |||
| 315 | /* A DMAC */ | ||
| 316 | struct pl330_dmac { | ||
| 317 | spinlock_t lock; | ||
| 318 | /* Holds list of reqs with due callbacks */ | ||
| 319 | struct list_head req_done; | ||
| 320 | /* Pointer to platform specific stuff */ | ||
| 321 | struct pl330_info *pinfo; | ||
| 322 | /* Maximum possible events/irqs */ | ||
| 323 | int events[32]; | ||
| 324 | /* BUS address of MicroCode buffer */ | ||
| 325 | u32 mcode_bus; | ||
| 326 | /* CPU address of MicroCode buffer */ | ||
| 327 | void *mcode_cpu; | ||
| 328 | /* List of all Channel threads */ | ||
| 329 | struct pl330_thread *channels; | ||
| 330 | /* Pointer to the MANAGER thread */ | ||
| 331 | struct pl330_thread *manager; | ||
| 332 | /* To handle bad news in interrupt */ | ||
| 333 | struct tasklet_struct tasks; | ||
| 334 | struct _pl330_tbd dmac_tbd; | ||
| 335 | /* State of DMAC operation */ | ||
| 336 | enum pl330_dmac_state state; | ||
| 337 | }; | ||
| 338 | |||
| 339 | static inline void _callback(struct pl330_req *r, enum pl330_op_err err) | ||
| 340 | { | ||
| 341 | if (r && r->xfer_cb) | ||
| 342 | r->xfer_cb(r->token, err); | ||
| 343 | } | ||
| 344 | |||
| 345 | static inline bool _queue_empty(struct pl330_thread *thrd) | ||
| 346 | { | ||
| 347 | return (IS_FREE(&thrd->req[0]) && IS_FREE(&thrd->req[1])) | ||
| 348 | ? true : false; | ||
| 349 | } | ||
| 350 | |||
| 351 | static inline bool _queue_full(struct pl330_thread *thrd) | ||
| 352 | { | ||
| 353 | return (IS_FREE(&thrd->req[0]) || IS_FREE(&thrd->req[1])) | ||
| 354 | ? false : true; | ||
| 355 | } | ||
| 356 | |||
| 357 | static inline bool is_manager(struct pl330_thread *thrd) | ||
| 358 | { | ||
| 359 | struct pl330_dmac *pl330 = thrd->dmac; | ||
| 360 | |||
| 361 | /* MANAGER is indexed at the end */ | ||
| 362 | if (thrd->id == pl330->pinfo->pcfg.num_chan) | ||
| 363 | return true; | ||
| 364 | else | ||
| 365 | return false; | ||
| 366 | } | ||
| 367 | |||
| 368 | /* If manager of the thread is in Non-Secure mode */ | ||
| 369 | static inline bool _manager_ns(struct pl330_thread *thrd) | ||
| 370 | { | ||
| 371 | struct pl330_dmac *pl330 = thrd->dmac; | ||
| 372 | |||
| 373 | return (pl330->pinfo->pcfg.mode & DMAC_MODE_NS) ? true : false; | ||
| 374 | } | ||
| 375 | |||
| 376 | static inline u32 get_id(struct pl330_info *pi, u32 off) | ||
| 377 | { | ||
| 378 | void __iomem *regs = pi->base; | ||
| 379 | u32 id = 0; | ||
| 380 | |||
| 381 | id |= (readb(regs + off + 0x0) << 0); | ||
| 382 | id |= (readb(regs + off + 0x4) << 8); | ||
| 383 | id |= (readb(regs + off + 0x8) << 16); | ||
| 384 | id |= (readb(regs + off + 0xc) << 24); | ||
| 385 | |||
| 386 | return id; | ||
| 387 | } | ||
| 388 | |||
| 389 | static inline u32 _emit_ADDH(unsigned dry_run, u8 buf[], | ||
| 390 | enum pl330_dst da, u16 val) | ||
| 391 | { | ||
| 392 | if (dry_run) | ||
| 393 | return SZ_DMAADDH; | ||
| 394 | |||
| 395 | buf[0] = CMD_DMAADDH; | ||
| 396 | buf[0] |= (da << 1); | ||
| 397 | *((u16 *)&buf[1]) = val; | ||
| 398 | |||
| 399 | PL330_DBGCMD_DUMP(SZ_DMAADDH, "\tDMAADDH %s %u\n", | ||
| 400 | da == 1 ? "DA" : "SA", val); | ||
| 401 | |||
| 402 | return SZ_DMAADDH; | ||
| 403 | } | ||
| 404 | |||
| 405 | static inline u32 _emit_END(unsigned dry_run, u8 buf[]) | ||
| 406 | { | ||
| 407 | if (dry_run) | ||
| 408 | return SZ_DMAEND; | ||
| 409 | |||
| 410 | buf[0] = CMD_DMAEND; | ||
| 411 | |||
| 412 | PL330_DBGCMD_DUMP(SZ_DMAEND, "\tDMAEND\n"); | ||
| 413 | |||
| 414 | return SZ_DMAEND; | ||
| 415 | } | ||
| 416 | |||
| 417 | static inline u32 _emit_FLUSHP(unsigned dry_run, u8 buf[], u8 peri) | ||
| 418 | { | ||
| 419 | if (dry_run) | ||
| 420 | return SZ_DMAFLUSHP; | ||
| 421 | |||
| 422 | buf[0] = CMD_DMAFLUSHP; | ||
| 423 | |||
| 424 | peri &= 0x1f; | ||
| 425 | peri <<= 3; | ||
| 426 | buf[1] = peri; | ||
| 427 | |||
| 428 | PL330_DBGCMD_DUMP(SZ_DMAFLUSHP, "\tDMAFLUSHP %u\n", peri >> 3); | ||
| 429 | |||
| 430 | return SZ_DMAFLUSHP; | ||
| 431 | } | ||
| 432 | |||
| 433 | static inline u32 _emit_LD(unsigned dry_run, u8 buf[], enum pl330_cond cond) | ||
| 434 | { | ||
| 435 | if (dry_run) | ||
| 436 | return SZ_DMALD; | ||
| 437 | |||
| 438 | buf[0] = CMD_DMALD; | ||
| 439 | |||
| 440 | if (cond == SINGLE) | ||
| 441 | buf[0] |= (0 << 1) | (1 << 0); | ||
| 442 | else if (cond == BURST) | ||
| 443 | buf[0] |= (1 << 1) | (1 << 0); | ||
| 444 | |||
| 445 | PL330_DBGCMD_DUMP(SZ_DMALD, "\tDMALD%c\n", | ||
| 446 | cond == SINGLE ? 'S' : (cond == BURST ? 'B' : 'A')); | ||
| 447 | |||
| 448 | return SZ_DMALD; | ||
| 449 | } | ||
| 450 | |||
| 451 | static inline u32 _emit_LDP(unsigned dry_run, u8 buf[], | ||
| 452 | enum pl330_cond cond, u8 peri) | ||
| 453 | { | ||
| 454 | if (dry_run) | ||
| 455 | return SZ_DMALDP; | ||
| 456 | |||
| 457 | buf[0] = CMD_DMALDP; | ||
| 458 | |||
| 459 | if (cond == BURST) | ||
| 460 | buf[0] |= (1 << 1); | ||
| 461 | |||
| 462 | peri &= 0x1f; | ||
| 463 | peri <<= 3; | ||
| 464 | buf[1] = peri; | ||
| 465 | |||
| 466 | PL330_DBGCMD_DUMP(SZ_DMALDP, "\tDMALDP%c %u\n", | ||
| 467 | cond == SINGLE ? 'S' : 'B', peri >> 3); | ||
| 468 | |||
| 469 | return SZ_DMALDP; | ||
| 470 | } | ||
| 471 | |||
| 472 | static inline u32 _emit_LP(unsigned dry_run, u8 buf[], | ||
| 473 | unsigned loop, u8 cnt) | ||
| 474 | { | ||
| 475 | if (dry_run) | ||
| 476 | return SZ_DMALP; | ||
| 477 | |||
| 478 | buf[0] = CMD_DMALP; | ||
| 479 | |||
| 480 | if (loop) | ||
| 481 | buf[0] |= (1 << 1); | ||
| 482 | |||
| 483 | cnt--; /* DMAC increments by 1 internally */ | ||
| 484 | buf[1] = cnt; | ||
| 485 | |||
| 486 | PL330_DBGCMD_DUMP(SZ_DMALP, "\tDMALP_%c %u\n", loop ? '1' : '0', cnt); | ||
| 487 | |||
| 488 | return SZ_DMALP; | ||
| 489 | } | ||
| 490 | |||
| 491 | struct _arg_LPEND { | ||
| 492 | enum pl330_cond cond; | ||
| 493 | bool forever; | ||
| 494 | unsigned loop; | ||
| 495 | u8 bjump; | ||
| 496 | }; | ||
| 497 | |||
| 498 | static inline u32 _emit_LPEND(unsigned dry_run, u8 buf[], | ||
| 499 | const struct _arg_LPEND *arg) | ||
| 500 | { | ||
| 501 | enum pl330_cond cond = arg->cond; | ||
| 502 | bool forever = arg->forever; | ||
| 503 | unsigned loop = arg->loop; | ||
| 504 | u8 bjump = arg->bjump; | ||
| 505 | |||
| 506 | if (dry_run) | ||
| 507 | return SZ_DMALPEND; | ||
| 508 | |||
| 509 | buf[0] = CMD_DMALPEND; | ||
| 510 | |||
| 511 | if (loop) | ||
| 512 | buf[0] |= (1 << 2); | ||
| 513 | |||
| 514 | if (!forever) | ||
| 515 | buf[0] |= (1 << 4); | ||
| 516 | |||
| 517 | if (cond == SINGLE) | ||
| 518 | buf[0] |= (0 << 1) | (1 << 0); | ||
| 519 | else if (cond == BURST) | ||
| 520 | buf[0] |= (1 << 1) | (1 << 0); | ||
| 521 | |||
| 522 | buf[1] = bjump; | ||
| 523 | |||
| 524 | PL330_DBGCMD_DUMP(SZ_DMALPEND, "\tDMALP%s%c_%c bjmpto_%x\n", | ||
| 525 | forever ? "FE" : "END", | ||
| 526 | cond == SINGLE ? 'S' : (cond == BURST ? 'B' : 'A'), | ||
| 527 | loop ? '1' : '0', | ||
| 528 | bjump); | ||
| 529 | |||
| 530 | return SZ_DMALPEND; | ||
| 531 | } | ||
| 532 | |||
| 533 | static inline u32 _emit_KILL(unsigned dry_run, u8 buf[]) | ||
| 534 | { | ||
| 535 | if (dry_run) | ||
| 536 | return SZ_DMAKILL; | ||
| 537 | |||
| 538 | buf[0] = CMD_DMAKILL; | ||
| 539 | |||
| 540 | return SZ_DMAKILL; | ||
| 541 | } | ||
| 542 | |||
| 543 | static inline u32 _emit_MOV(unsigned dry_run, u8 buf[], | ||
| 544 | enum dmamov_dst dst, u32 val) | ||
| 545 | { | ||
| 546 | if (dry_run) | ||
| 547 | return SZ_DMAMOV; | ||
| 548 | |||
| 549 | buf[0] = CMD_DMAMOV; | ||
| 550 | buf[1] = dst; | ||
| 551 | *((u32 *)&buf[2]) = val; | ||
| 552 | |||
| 553 | PL330_DBGCMD_DUMP(SZ_DMAMOV, "\tDMAMOV %s 0x%x\n", | ||
| 554 | dst == SAR ? "SAR" : (dst == DAR ? "DAR" : "CCR"), val); | ||
| 555 | |||
| 556 | return SZ_DMAMOV; | ||
| 557 | } | ||
| 558 | |||
| 559 | static inline u32 _emit_NOP(unsigned dry_run, u8 buf[]) | ||
| 560 | { | ||
| 561 | if (dry_run) | ||
| 562 | return SZ_DMANOP; | ||
| 563 | |||
| 564 | buf[0] = CMD_DMANOP; | ||
| 565 | |||
| 566 | PL330_DBGCMD_DUMP(SZ_DMANOP, "\tDMANOP\n"); | ||
| 567 | |||
| 568 | return SZ_DMANOP; | ||
| 569 | } | ||
| 570 | |||
| 571 | static inline u32 _emit_RMB(unsigned dry_run, u8 buf[]) | ||
| 572 | { | ||
| 573 | if (dry_run) | ||
| 574 | return SZ_DMARMB; | ||
| 575 | |||
| 576 | buf[0] = CMD_DMARMB; | ||
| 577 | |||
| 578 | PL330_DBGCMD_DUMP(SZ_DMARMB, "\tDMARMB\n"); | ||
| 579 | |||
| 580 | return SZ_DMARMB; | ||
| 581 | } | ||
| 582 | |||
| 583 | static inline u32 _emit_SEV(unsigned dry_run, u8 buf[], u8 ev) | ||
| 584 | { | ||
| 585 | if (dry_run) | ||
| 586 | return SZ_DMASEV; | ||
| 587 | |||
| 588 | buf[0] = CMD_DMASEV; | ||
| 589 | |||
| 590 | ev &= 0x1f; | ||
| 591 | ev <<= 3; | ||
| 592 | buf[1] = ev; | ||
| 593 | |||
| 594 | PL330_DBGCMD_DUMP(SZ_DMASEV, "\tDMASEV %u\n", ev >> 3); | ||
| 595 | |||
| 596 | return SZ_DMASEV; | ||
| 597 | } | ||
| 598 | |||
| 599 | static inline u32 _emit_ST(unsigned dry_run, u8 buf[], enum pl330_cond cond) | ||
| 600 | { | ||
| 601 | if (dry_run) | ||
| 602 | return SZ_DMAST; | ||
| 603 | |||
| 604 | buf[0] = CMD_DMAST; | ||
| 605 | |||
| 606 | if (cond == SINGLE) | ||
| 607 | buf[0] |= (0 << 1) | (1 << 0); | ||
| 608 | else if (cond == BURST) | ||
| 609 | buf[0] |= (1 << 1) | (1 << 0); | ||
| 610 | |||
| 611 | PL330_DBGCMD_DUMP(SZ_DMAST, "\tDMAST%c\n", | ||
| 612 | cond == SINGLE ? 'S' : (cond == BURST ? 'B' : 'A')); | ||
| 613 | |||
| 614 | return SZ_DMAST; | ||
| 615 | } | ||
| 616 | |||
| 617 | static inline u32 _emit_STP(unsigned dry_run, u8 buf[], | ||
| 618 | enum pl330_cond cond, u8 peri) | ||
| 619 | { | ||
| 620 | if (dry_run) | ||
| 621 | return SZ_DMASTP; | ||
| 622 | |||
| 623 | buf[0] = CMD_DMASTP; | ||
| 624 | |||
| 625 | if (cond == BURST) | ||
| 626 | buf[0] |= (1 << 1); | ||
| 627 | |||
| 628 | peri &= 0x1f; | ||
| 629 | peri <<= 3; | ||
| 630 | buf[1] = peri; | ||
| 631 | |||
| 632 | PL330_DBGCMD_DUMP(SZ_DMASTP, "\tDMASTP%c %u\n", | ||
| 633 | cond == SINGLE ? 'S' : 'B', peri >> 3); | ||
| 634 | |||
| 635 | return SZ_DMASTP; | ||
| 636 | } | ||
| 637 | |||
| 638 | static inline u32 _emit_STZ(unsigned dry_run, u8 buf[]) | ||
| 639 | { | ||
| 640 | if (dry_run) | ||
| 641 | return SZ_DMASTZ; | ||
| 642 | |||
| 643 | buf[0] = CMD_DMASTZ; | ||
| 644 | |||
| 645 | PL330_DBGCMD_DUMP(SZ_DMASTZ, "\tDMASTZ\n"); | ||
| 646 | |||
| 647 | return SZ_DMASTZ; | ||
| 648 | } | ||
| 649 | |||
| 650 | static inline u32 _emit_WFE(unsigned dry_run, u8 buf[], u8 ev, | ||
| 651 | unsigned invalidate) | ||
| 652 | { | ||
| 653 | if (dry_run) | ||
| 654 | return SZ_DMAWFE; | ||
| 655 | |||
| 656 | buf[0] = CMD_DMAWFE; | ||
| 657 | |||
| 658 | ev &= 0x1f; | ||
| 659 | ev <<= 3; | ||
| 660 | buf[1] = ev; | ||
| 661 | |||
| 662 | if (invalidate) | ||
| 663 | buf[1] |= (1 << 1); | ||
| 664 | |||
| 665 | PL330_DBGCMD_DUMP(SZ_DMAWFE, "\tDMAWFE %u%s\n", | ||
| 666 | ev >> 3, invalidate ? ", I" : ""); | ||
| 667 | |||
| 668 | return SZ_DMAWFE; | ||
| 669 | } | ||
| 670 | |||
| 671 | static inline u32 _emit_WFP(unsigned dry_run, u8 buf[], | ||
| 672 | enum pl330_cond cond, u8 peri) | ||
| 673 | { | ||
| 674 | if (dry_run) | ||
| 675 | return SZ_DMAWFP; | ||
| 676 | |||
| 677 | buf[0] = CMD_DMAWFP; | ||
| 678 | |||
| 679 | if (cond == SINGLE) | ||
| 680 | buf[0] |= (0 << 1) | (0 << 0); | ||
| 681 | else if (cond == BURST) | ||
| 682 | buf[0] |= (1 << 1) | (0 << 0); | ||
| 683 | else | ||
| 684 | buf[0] |= (0 << 1) | (1 << 0); | ||
| 685 | |||
| 686 | peri &= 0x1f; | ||
| 687 | peri <<= 3; | ||
| 688 | buf[1] = peri; | ||
| 689 | |||
| 690 | PL330_DBGCMD_DUMP(SZ_DMAWFP, "\tDMAWFP%c %u\n", | ||
| 691 | cond == SINGLE ? 'S' : (cond == BURST ? 'B' : 'P'), peri >> 3); | ||
| 692 | |||
| 693 | return SZ_DMAWFP; | ||
| 694 | } | ||
| 695 | |||
| 696 | static inline u32 _emit_WMB(unsigned dry_run, u8 buf[]) | ||
| 697 | { | ||
| 698 | if (dry_run) | ||
| 699 | return SZ_DMAWMB; | ||
| 700 | |||
| 701 | buf[0] = CMD_DMAWMB; | ||
| 702 | |||
| 703 | PL330_DBGCMD_DUMP(SZ_DMAWMB, "\tDMAWMB\n"); | ||
| 704 | |||
| 705 | return SZ_DMAWMB; | ||
| 706 | } | ||
| 707 | |||
| 708 | struct _arg_GO { | ||
| 709 | u8 chan; | ||
| 710 | u32 addr; | ||
| 711 | unsigned ns; | ||
| 712 | }; | ||
| 713 | |||
| 714 | static inline u32 _emit_GO(unsigned dry_run, u8 buf[], | ||
| 715 | const struct _arg_GO *arg) | ||
| 716 | { | ||
| 717 | u8 chan = arg->chan; | ||
| 718 | u32 addr = arg->addr; | ||
| 719 | unsigned ns = arg->ns; | ||
| 720 | |||
| 721 | if (dry_run) | ||
| 722 | return SZ_DMAGO; | ||
| 723 | |||
| 724 | buf[0] = CMD_DMAGO; | ||
| 725 | buf[0] |= (ns << 1); | ||
| 726 | |||
| 727 | buf[1] = chan & 0x7; | ||
| 728 | |||
| 729 | *((u32 *)&buf[2]) = addr; | ||
| 730 | |||
| 731 | return SZ_DMAGO; | ||
| 732 | } | ||
| 733 | |||
| 734 | #define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t) | ||
| 735 | |||
| 736 | /* Returns Time-Out */ | ||
| 737 | static bool _until_dmac_idle(struct pl330_thread *thrd) | ||
| 738 | { | ||
| 739 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
| 740 | unsigned long loops = msecs_to_loops(5); | ||
| 741 | |||
| 742 | do { | ||
| 743 | /* Until Manager is Idle */ | ||
| 744 | if (!(readl(regs + DBGSTATUS) & DBG_BUSY)) | ||
| 745 | break; | ||
| 746 | |||
| 747 | cpu_relax(); | ||
| 748 | } while (--loops); | ||
| 749 | |||
| 750 | if (!loops) | ||
| 751 | return true; | ||
| 752 | |||
| 753 | return false; | ||
| 754 | } | ||
| 755 | |||
| 756 | static inline void _execute_DBGINSN(struct pl330_thread *thrd, | ||
| 757 | u8 insn[], bool as_manager) | ||
| 758 | { | ||
| 759 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
| 760 | u32 val; | ||
| 761 | |||
| 762 | val = (insn[0] << 16) | (insn[1] << 24); | ||
| 763 | if (!as_manager) { | ||
| 764 | val |= (1 << 0); | ||
| 765 | val |= (thrd->id << 8); /* Channel Number */ | ||
| 766 | } | ||
| 767 | writel(val, regs + DBGINST0); | ||
| 768 | |||
| 769 | val = *((u32 *)&insn[2]); | ||
| 770 | writel(val, regs + DBGINST1); | ||
| 771 | |||
| 772 | /* If timed out due to halted state-machine */ | ||
| 773 | if (_until_dmac_idle(thrd)) { | ||
| 774 | dev_err(thrd->dmac->pinfo->dev, "DMAC halted!\n"); | ||
| 775 | return; | ||
| 776 | } | ||
| 777 | |||
| 778 | /* Get going */ | ||
| 779 | writel(0, regs + DBGCMD); | ||
| 780 | } | ||
| 781 | |||
| 782 | static inline u32 _state(struct pl330_thread *thrd) | ||
| 783 | { | ||
| 784 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
| 785 | u32 val; | ||
| 786 | |||
| 787 | if (is_manager(thrd)) | ||
| 788 | val = readl(regs + DS) & 0xf; | ||
| 789 | else | ||
| 790 | val = readl(regs + CS(thrd->id)) & 0xf; | ||
| 791 | |||
| 792 | switch (val) { | ||
| 793 | case DS_ST_STOP: | ||
| 794 | return PL330_STATE_STOPPED; | ||
| 795 | case DS_ST_EXEC: | ||
| 796 | return PL330_STATE_EXECUTING; | ||
| 797 | case DS_ST_CMISS: | ||
| 798 | return PL330_STATE_CACHEMISS; | ||
| 799 | case DS_ST_UPDTPC: | ||
| 800 | return PL330_STATE_UPDTPC; | ||
| 801 | case DS_ST_WFE: | ||
| 802 | return PL330_STATE_WFE; | ||
| 803 | case DS_ST_FAULT: | ||
| 804 | return PL330_STATE_FAULTING; | ||
| 805 | case DS_ST_ATBRR: | ||
| 806 | if (is_manager(thrd)) | ||
| 807 | return PL330_STATE_INVALID; | ||
| 808 | else | ||
| 809 | return PL330_STATE_ATBARRIER; | ||
| 810 | case DS_ST_QBUSY: | ||
| 811 | if (is_manager(thrd)) | ||
| 812 | return PL330_STATE_INVALID; | ||
| 813 | else | ||
| 814 | return PL330_STATE_QUEUEBUSY; | ||
| 815 | case DS_ST_WFP: | ||
| 816 | if (is_manager(thrd)) | ||
| 817 | return PL330_STATE_INVALID; | ||
| 818 | else | ||
| 819 | return PL330_STATE_WFP; | ||
| 820 | case DS_ST_KILL: | ||
| 821 | if (is_manager(thrd)) | ||
| 822 | return PL330_STATE_INVALID; | ||
| 823 | else | ||
| 824 | return PL330_STATE_KILLING; | ||
| 825 | case DS_ST_CMPLT: | ||
| 826 | if (is_manager(thrd)) | ||
| 827 | return PL330_STATE_INVALID; | ||
| 828 | else | ||
| 829 | return PL330_STATE_COMPLETING; | ||
| 830 | case DS_ST_FLTCMP: | ||
| 831 | if (is_manager(thrd)) | ||
| 832 | return PL330_STATE_INVALID; | ||
| 833 | else | ||
| 834 | return PL330_STATE_FAULT_COMPLETING; | ||
| 835 | default: | ||
| 836 | return PL330_STATE_INVALID; | ||
| 837 | } | ||
| 838 | } | ||
| 839 | |||
| 840 | /* If the request 'req' of thread 'thrd' is currently active */ | ||
| 841 | static inline bool _req_active(struct pl330_thread *thrd, | ||
| 842 | struct _pl330_req *req) | ||
| 843 | { | ||
| 844 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
| 845 | u32 buf = req->mc_bus, pc = readl(regs + CPC(thrd->id)); | ||
| 846 | |||
| 847 | if (IS_FREE(req)) | ||
| 848 | return false; | ||
| 849 | |||
| 850 | return (pc >= buf && pc <= buf + req->mc_len) ? true : false; | ||
| 851 | } | ||
| 852 | |||
| 853 | /* Returns 0 if the thread is inactive, ID of active req + 1 otherwise */ | ||
| 854 | static inline unsigned _thrd_active(struct pl330_thread *thrd) | ||
| 855 | { | ||
| 856 | if (_req_active(thrd, &thrd->req[0])) | ||
| 857 | return 1; /* First req active */ | ||
| 858 | |||
| 859 | if (_req_active(thrd, &thrd->req[1])) | ||
| 860 | return 2; /* Second req active */ | ||
| 861 | |||
| 862 | return 0; | ||
| 863 | } | ||
| 864 | |||
| 865 | static void _stop(struct pl330_thread *thrd) | ||
| 866 | { | ||
| 867 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
| 868 | u8 insn[6] = {0, 0, 0, 0, 0, 0}; | ||
| 869 | |||
| 870 | if (_state(thrd) == PL330_STATE_FAULT_COMPLETING) | ||
| 871 | UNTIL(thrd, PL330_STATE_FAULTING | PL330_STATE_KILLING); | ||
| 872 | |||
| 873 | /* Return if nothing needs to be done */ | ||
| 874 | if (_state(thrd) == PL330_STATE_COMPLETING | ||
| 875 | || _state(thrd) == PL330_STATE_KILLING | ||
| 876 | || _state(thrd) == PL330_STATE_STOPPED) | ||
| 877 | return; | ||
| 878 | |||
| 879 | _emit_KILL(0, insn); | ||
| 880 | |||
| 881 | /* Stop generating interrupts for SEV */ | ||
| 882 | writel(readl(regs + INTEN) & ~(1 << thrd->ev), regs + INTEN); | ||
| 883 | |||
| 884 | _execute_DBGINSN(thrd, insn, is_manager(thrd)); | ||
| 885 | } | ||
| 886 | |||
| 887 | /* Start doing req 'idx' of thread 'thrd' */ | ||
| 888 | static bool _trigger(struct pl330_thread *thrd) | ||
| 889 | { | ||
| 890 | void __iomem *regs = thrd->dmac->pinfo->base; | ||
| 891 | struct _pl330_req *req; | ||
| 892 | struct pl330_req *r; | ||
| 893 | struct _arg_GO go; | ||
| 894 | unsigned ns; | ||
| 895 | u8 insn[6] = {0, 0, 0, 0, 0, 0}; | ||
| 896 | |||
| 897 | /* Return if already ACTIVE */ | ||
| 898 | if (_state(thrd) != PL330_STATE_STOPPED) | ||
| 899 | return true; | ||
| 900 | |||
| 901 | if (!IS_FREE(&thrd->req[1 - thrd->lstenq])) | ||
| 902 | req = &thrd->req[1 - thrd->lstenq]; | ||
| 903 | else if (!IS_FREE(&thrd->req[thrd->lstenq])) | ||
| 904 | req = &thrd->req[thrd->lstenq]; | ||
| 905 | else | ||
| 906 | req = NULL; | ||
| 907 | |||
| 908 | /* Return if no request */ | ||
| 909 | if (!req || !req->r) | ||
| 910 | return true; | ||
| 911 | |||
| 912 | r = req->r; | ||
| 913 | |||
| 914 | if (r->cfg) | ||
| 915 | ns = r->cfg->nonsecure ? 1 : 0; | ||
| 916 | else if (readl(regs + CS(thrd->id)) & CS_CNS) | ||
| 917 | ns = 1; | ||
| 918 | else | ||
| 919 | ns = 0; | ||
| 920 | |||
| 921 | /* See 'Abort Sources' point-4 at Page 2-25 */ | ||
| 922 | if (_manager_ns(thrd) && !ns) | ||
| 923 | dev_info(thrd->dmac->pinfo->dev, "%s:%d Recipe for ABORT!\n", | ||
| 924 | __func__, __LINE__); | ||
| 925 | |||
| 926 | go.chan = thrd->id; | ||
| 927 | go.addr = req->mc_bus; | ||
| 928 | go.ns = ns; | ||
| 929 | _emit_GO(0, insn, &go); | ||
| 930 | |||
| 931 | /* Set to generate interrupts for SEV */ | ||
| 932 | writel(readl(regs + INTEN) | (1 << thrd->ev), regs + INTEN); | ||
| 933 | |||
| 934 | /* Only manager can execute GO */ | ||
| 935 | _execute_DBGINSN(thrd, insn, true); | ||
| 936 | |||
| 937 | return true; | ||
| 938 | } | ||
| 939 | |||
| 940 | static bool _start(struct pl330_thread *thrd) | ||
| 941 | { | ||
| 942 | switch (_state(thrd)) { | ||
| 943 | case PL330_STATE_FAULT_COMPLETING: | ||
| 944 | UNTIL(thrd, PL330_STATE_FAULTING | PL330_STATE_KILLING); | ||
| 945 | |||
| 946 | if (_state(thrd) == PL330_STATE_KILLING) | ||
| 947 | UNTIL(thrd, PL330_STATE_STOPPED) | ||
| 948 | |||
| 949 | case PL330_STATE_FAULTING: | ||
| 950 | _stop(thrd); | ||
| 951 | |||
| 952 | case PL330_STATE_KILLING: | ||
| 953 | case PL330_STATE_COMPLETING: | ||
| 954 | UNTIL(thrd, PL330_STATE_STOPPED) | ||
| 955 | |||
| 956 | case PL330_STATE_STOPPED: | ||
| 957 | return _trigger(thrd); | ||
| 958 | |||
| 959 | case PL330_STATE_WFP: | ||
| 960 | case PL330_STATE_QUEUEBUSY: | ||
| 961 | case PL330_STATE_ATBARRIER: | ||
| 962 | case PL330_STATE_UPDTPC: | ||
| 963 | case PL330_STATE_CACHEMISS: | ||
| 964 | case PL330_STATE_EXECUTING: | ||
| 965 | return true; | ||
| 966 | |||
| 967 | case PL330_STATE_WFE: /* For RESUME, nothing yet */ | ||
| 968 | default: | ||
| 969 | return false; | ||
| 970 | } | ||
| 971 | } | ||
| 972 | |||
| 973 | static inline int _ldst_memtomem(unsigned dry_run, u8 buf[], | ||
| 974 | const struct _xfer_spec *pxs, int cyc) | ||
| 975 | { | ||
| 976 | int off = 0; | ||
| 977 | |||
| 978 | while (cyc--) { | ||
| 979 | off += _emit_LD(dry_run, &buf[off], ALWAYS); | ||
| 980 | off += _emit_RMB(dry_run, &buf[off]); | ||
| 981 | off += _emit_ST(dry_run, &buf[off], ALWAYS); | ||
| 982 | off += _emit_WMB(dry_run, &buf[off]); | ||
| 983 | } | ||
| 984 | |||
| 985 | return off; | ||
| 986 | } | ||
| 987 | |||
| 988 | static inline int _ldst_devtomem(unsigned dry_run, u8 buf[], | ||
| 989 | const struct _xfer_spec *pxs, int cyc) | ||
| 990 | { | ||
| 991 | int off = 0; | ||
| 992 | |||
| 993 | while (cyc--) { | ||
| 994 | off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->r->peri); | ||
| 995 | off += _emit_LDP(dry_run, &buf[off], SINGLE, pxs->r->peri); | ||
| 996 | off += _emit_ST(dry_run, &buf[off], ALWAYS); | ||
| 997 | off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); | ||
| 998 | } | ||
| 999 | |||
| 1000 | return off; | ||
| 1001 | } | ||
| 1002 | |||
| 1003 | static inline int _ldst_memtodev(unsigned dry_run, u8 buf[], | ||
| 1004 | const struct _xfer_spec *pxs, int cyc) | ||
| 1005 | { | ||
| 1006 | int off = 0; | ||
| 1007 | |||
| 1008 | while (cyc--) { | ||
| 1009 | off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->r->peri); | ||
| 1010 | off += _emit_LD(dry_run, &buf[off], ALWAYS); | ||
| 1011 | off += _emit_STP(dry_run, &buf[off], SINGLE, pxs->r->peri); | ||
| 1012 | off += _emit_FLUSHP(dry_run, &buf[off], pxs->r->peri); | ||
| 1013 | } | ||
| 1014 | |||
| 1015 | return off; | ||
| 1016 | } | ||
| 1017 | |||
| 1018 | static int _bursts(unsigned dry_run, u8 buf[], | ||
| 1019 | const struct _xfer_spec *pxs, int cyc) | ||
| 1020 | { | ||
| 1021 | int off = 0; | ||
| 1022 | |||
| 1023 | switch (pxs->r->rqtype) { | ||
| 1024 | case MEMTODEV: | ||
| 1025 | off += _ldst_memtodev(dry_run, &buf[off], pxs, cyc); | ||
| 1026 | break; | ||
| 1027 | case DEVTOMEM: | ||
| 1028 | off += _ldst_devtomem(dry_run, &buf[off], pxs, cyc); | ||
| 1029 | break; | ||
| 1030 | case MEMTOMEM: | ||
| 1031 | off += _ldst_memtomem(dry_run, &buf[off], pxs, cyc); | ||
| 1032 | break; | ||
| 1033 | default: | ||
| 1034 | off += 0x40000000; /* Scare off the Client */ | ||
| 1035 | break; | ||
| 1036 | } | ||
| 1037 | |||
| 1038 | return off; | ||
| 1039 | } | ||
| 1040 | |||
| 1041 | /* Returns bytes consumed and updates bursts */ | ||
| 1042 | static inline int _loop(unsigned dry_run, u8 buf[], | ||
| 1043 | unsigned long *bursts, const struct _xfer_spec *pxs) | ||
| 1044 | { | ||
| 1045 | int cyc, cycmax, szlp, szlpend, szbrst, off; | ||
| 1046 | unsigned lcnt0, lcnt1, ljmp0, ljmp1; | ||
| 1047 | struct _arg_LPEND lpend; | ||
| 1048 | |||
| 1049 | /* Max iterations possibile in DMALP is 256 */ | ||
| 1050 | if (*bursts >= 256*256) { | ||
| 1051 | lcnt1 = 256; | ||
| 1052 | lcnt0 = 256; | ||
| 1053 | cyc = *bursts / lcnt1 / lcnt0; | ||
| 1054 | } else if (*bursts > 256) { | ||
| 1055 | lcnt1 = 256; | ||
| 1056 | lcnt0 = *bursts / lcnt1; | ||
| 1057 | cyc = 1; | ||
| 1058 | } else { | ||
| 1059 | lcnt1 = *bursts; | ||
| 1060 | lcnt0 = 0; | ||
| 1061 | cyc = 1; | ||
| 1062 | } | ||
| 1063 | |||
| 1064 | szlp = _emit_LP(1, buf, 0, 0); | ||
| 1065 | szbrst = _bursts(1, buf, pxs, 1); | ||
| 1066 | |||
| 1067 | lpend.cond = ALWAYS; | ||
| 1068 | lpend.forever = false; | ||
| 1069 | lpend.loop = 0; | ||
| 1070 | lpend.bjump = 0; | ||
| 1071 | szlpend = _emit_LPEND(1, buf, &lpend); | ||
| 1072 | |||
| 1073 | if (lcnt0) { | ||
| 1074 | szlp *= 2; | ||
| 1075 | szlpend *= 2; | ||
| 1076 | } | ||
| 1077 | |||
| 1078 | /* | ||
| 1079 | * Max bursts that we can unroll due to limit on the | ||
| 1080 | * size of backward jump that can be encoded in DMALPEND | ||
| 1081 | * which is 8-bits and hence 255 | ||
| 1082 | */ | ||
| 1083 | cycmax = (255 - (szlp + szlpend)) / szbrst; | ||
| 1084 | |||
| 1085 | cyc = (cycmax < cyc) ? cycmax : cyc; | ||
| 1086 | |||
| 1087 | off = 0; | ||
| 1088 | |||
| 1089 | if (lcnt0) { | ||
| 1090 | off += _emit_LP(dry_run, &buf[off], 0, lcnt0); | ||
| 1091 | ljmp0 = off; | ||
| 1092 | } | ||
| 1093 | |||
| 1094 | off += _emit_LP(dry_run, &buf[off], 1, lcnt1); | ||
| 1095 | ljmp1 = off; | ||
| 1096 | |||
| 1097 | off += _bursts(dry_run, &buf[off], pxs, cyc); | ||
| 1098 | |||
| 1099 | lpend.cond = ALWAYS; | ||
| 1100 | lpend.forever = false; | ||
| 1101 | lpend.loop = 1; | ||
| 1102 | lpend.bjump = off - ljmp1; | ||
| 1103 | off += _emit_LPEND(dry_run, &buf[off], &lpend); | ||
| 1104 | |||
| 1105 | if (lcnt0) { | ||
| 1106 | lpend.cond = ALWAYS; | ||
| 1107 | lpend.forever = false; | ||
| 1108 | lpend.loop = 0; | ||
| 1109 | lpend.bjump = off - ljmp0; | ||
| 1110 | off += _emit_LPEND(dry_run, &buf[off], &lpend); | ||
| 1111 | } | ||
| 1112 | |||
| 1113 | *bursts = lcnt1 * cyc; | ||
| 1114 | if (lcnt0) | ||
| 1115 | *bursts *= lcnt0; | ||
| 1116 | |||
| 1117 | return off; | ||
| 1118 | } | ||
| 1119 | |||
| 1120 | static inline int _setup_loops(unsigned dry_run, u8 buf[], | ||
| 1121 | const struct _xfer_spec *pxs) | ||
| 1122 | { | ||
| 1123 | struct pl330_xfer *x = pxs->x; | ||
| 1124 | u32 ccr = pxs->ccr; | ||
| 1125 | unsigned long c, bursts = BYTE_TO_BURST(x->bytes, ccr); | ||
| 1126 | int off = 0; | ||
| 1127 | |||
| 1128 | while (bursts) { | ||
| 1129 | c = bursts; | ||
| 1130 | off += _loop(dry_run, &buf[off], &c, pxs); | ||
| 1131 | bursts -= c; | ||
| 1132 | } | ||
| 1133 | |||
| 1134 | return off; | ||
| 1135 | } | ||
| 1136 | |||
| 1137 | static inline int _setup_xfer(unsigned dry_run, u8 buf[], | ||
| 1138 | const struct _xfer_spec *pxs) | ||
| 1139 | { | ||
| 1140 | struct pl330_xfer *x = pxs->x; | ||
| 1141 | int off = 0; | ||
| 1142 | |||
| 1143 | /* DMAMOV SAR, x->src_addr */ | ||
| 1144 | off += _emit_MOV(dry_run, &buf[off], SAR, x->src_addr); | ||
| 1145 | /* DMAMOV DAR, x->dst_addr */ | ||
| 1146 | off += _emit_MOV(dry_run, &buf[off], DAR, x->dst_addr); | ||
| 1147 | |||
| 1148 | /* Setup Loop(s) */ | ||
| 1149 | off += _setup_loops(dry_run, &buf[off], pxs); | ||
| 1150 | |||
| 1151 | return off; | ||
| 1152 | } | ||
| 1153 | |||
| 1154 | /* | ||
| 1155 | * A req is a sequence of one or more xfer units. | ||
| 1156 | * Returns the number of bytes taken to setup the MC for the req. | ||
| 1157 | */ | ||
| 1158 | static int _setup_req(unsigned dry_run, struct pl330_thread *thrd, | ||
| 1159 | unsigned index, struct _xfer_spec *pxs) | ||
| 1160 | { | ||
| 1161 | struct _pl330_req *req = &thrd->req[index]; | ||
| 1162 | struct pl330_xfer *x; | ||
| 1163 | u8 *buf = req->mc_cpu; | ||
| 1164 | int off = 0; | ||
| 1165 | |||
| 1166 | PL330_DBGMC_START(req->mc_bus); | ||
| 1167 | |||
| 1168 | /* DMAMOV CCR, ccr */ | ||
| 1169 | off += _emit_MOV(dry_run, &buf[off], CCR, pxs->ccr); | ||
| 1170 | |||
| 1171 | x = pxs->r->x; | ||
| 1172 | do { | ||
| 1173 | /* Error if xfer length is not aligned at burst size */ | ||
| 1174 | if (x->bytes % (BRST_SIZE(pxs->ccr) * BRST_LEN(pxs->ccr))) | ||
| 1175 | return -EINVAL; | ||
| 1176 | |||
| 1177 | pxs->x = x; | ||
| 1178 | off += _setup_xfer(dry_run, &buf[off], pxs); | ||
| 1179 | |||
| 1180 | x = x->next; | ||
| 1181 | } while (x); | ||
| 1182 | |||
| 1183 | /* DMASEV peripheral/event */ | ||
| 1184 | off += _emit_SEV(dry_run, &buf[off], thrd->ev); | ||
| 1185 | /* DMAEND */ | ||
| 1186 | off += _emit_END(dry_run, &buf[off]); | ||
| 1187 | |||
| 1188 | return off; | ||
| 1189 | } | ||
| 1190 | |||
| 1191 | static inline u32 _prepare_ccr(const struct pl330_reqcfg *rqc) | ||
| 1192 | { | ||
| 1193 | u32 ccr = 0; | ||
| 1194 | |||
| 1195 | if (rqc->src_inc) | ||
| 1196 | ccr |= CC_SRCINC; | ||
| 1197 | |||
| 1198 | if (rqc->dst_inc) | ||
| 1199 | ccr |= CC_DSTINC; | ||
| 1200 | |||
| 1201 | /* We set same protection levels for Src and DST for now */ | ||
| 1202 | if (rqc->privileged) | ||
| 1203 | ccr |= CC_SRCPRI | CC_DSTPRI; | ||
| 1204 | if (rqc->nonsecure) | ||
| 1205 | ccr |= CC_SRCNS | CC_DSTNS; | ||
| 1206 | if (rqc->insnaccess) | ||
| 1207 | ccr |= CC_SRCIA | CC_DSTIA; | ||
| 1208 | |||
| 1209 | ccr |= (((rqc->brst_len - 1) & 0xf) << CC_SRCBRSTLEN_SHFT); | ||
| 1210 | ccr |= (((rqc->brst_len - 1) & 0xf) << CC_DSTBRSTLEN_SHFT); | ||
| 1211 | |||
| 1212 | ccr |= (rqc->brst_size << CC_SRCBRSTSIZE_SHFT); | ||
| 1213 | ccr |= (rqc->brst_size << CC_DSTBRSTSIZE_SHFT); | ||
| 1214 | |||
| 1215 | ccr |= (rqc->dcctl << CC_SRCCCTRL_SHFT); | ||
| 1216 | ccr |= (rqc->scctl << CC_DSTCCTRL_SHFT); | ||
| 1217 | |||
| 1218 | ccr |= (rqc->swap << CC_SWAP_SHFT); | ||
| 1219 | |||
| 1220 | return ccr; | ||
| 1221 | } | ||
| 1222 | |||
| 1223 | static inline bool _is_valid(u32 ccr) | ||
| 1224 | { | ||
| 1225 | enum pl330_dstcachectrl dcctl; | ||
| 1226 | enum pl330_srccachectrl scctl; | ||
| 1227 | |||
| 1228 | dcctl = (ccr >> CC_DSTCCTRL_SHFT) & CC_DRCCCTRL_MASK; | ||
| 1229 | scctl = (ccr >> CC_SRCCCTRL_SHFT) & CC_SRCCCTRL_MASK; | ||
| 1230 | |||
| 1231 | if (dcctl == DINVALID1 || dcctl == DINVALID2 | ||
| 1232 | || scctl == SINVALID1 || scctl == SINVALID2) | ||
| 1233 | return false; | ||
| 1234 | else | ||
| 1235 | return true; | ||
| 1236 | } | ||
| 1237 | |||
| 1238 | /* | ||
| 1239 | * Submit a list of xfers after which the client wants notification. | ||
| 1240 | * Client is not notified after each xfer unit, just once after all | ||
| 1241 | * xfer units are done or some error occurs. | ||
| 1242 | */ | ||
| 1243 | int pl330_submit_req(void *ch_id, struct pl330_req *r) | ||
| 1244 | { | ||
| 1245 | struct pl330_thread *thrd = ch_id; | ||
| 1246 | struct pl330_dmac *pl330; | ||
| 1247 | struct pl330_info *pi; | ||
| 1248 | struct _xfer_spec xs; | ||
| 1249 | unsigned long flags; | ||
| 1250 | void __iomem *regs; | ||
| 1251 | unsigned idx; | ||
| 1252 | u32 ccr; | ||
| 1253 | int ret = 0; | ||
| 1254 | |||
| 1255 | /* No Req or Unacquired Channel or DMAC */ | ||
| 1256 | if (!r || !thrd || thrd->free) | ||
| 1257 | return -EINVAL; | ||
| 1258 | |||
| 1259 | pl330 = thrd->dmac; | ||
| 1260 | pi = pl330->pinfo; | ||
| 1261 | regs = pi->base; | ||
| 1262 | |||
| 1263 | if (pl330->state == DYING | ||
| 1264 | || pl330->dmac_tbd.reset_chan & (1 << thrd->id)) { | ||
| 1265 | dev_info(thrd->dmac->pinfo->dev, "%s:%d\n", | ||
| 1266 | __func__, __LINE__); | ||
| 1267 | return -EAGAIN; | ||
| 1268 | } | ||
| 1269 | |||
| 1270 | /* If request for non-existing peripheral */ | ||
| 1271 | if (r->rqtype != MEMTOMEM && r->peri >= pi->pcfg.num_peri) { | ||
| 1272 | dev_info(thrd->dmac->pinfo->dev, | ||
| 1273 | "%s:%d Invalid peripheral(%u)!\n", | ||
| 1274 | __func__, __LINE__, r->peri); | ||
| 1275 | return -EINVAL; | ||
| 1276 | } | ||
| 1277 | |||
| 1278 | spin_lock_irqsave(&pl330->lock, flags); | ||
| 1279 | |||
| 1280 | if (_queue_full(thrd)) { | ||
| 1281 | ret = -EAGAIN; | ||
| 1282 | goto xfer_exit; | ||
| 1283 | } | ||
| 1284 | |||
| 1285 | /* Prefer Secure Channel */ | ||
| 1286 | if (!_manager_ns(thrd)) | ||
| 1287 | r->cfg->nonsecure = 0; | ||
| 1288 | else | ||
| 1289 | r->cfg->nonsecure = 1; | ||
| 1290 | |||
| 1291 | /* Use last settings, if not provided */ | ||
| 1292 | if (r->cfg) | ||
| 1293 | ccr = _prepare_ccr(r->cfg); | ||
| 1294 | else | ||
| 1295 | ccr = readl(regs + CC(thrd->id)); | ||
| 1296 | |||
| 1297 | /* If this req doesn't have valid xfer settings */ | ||
| 1298 | if (!_is_valid(ccr)) { | ||
| 1299 | ret = -EINVAL; | ||
| 1300 | dev_info(thrd->dmac->pinfo->dev, "%s:%d Invalid CCR(%x)!\n", | ||
| 1301 | __func__, __LINE__, ccr); | ||
| 1302 | goto xfer_exit; | ||
| 1303 | } | ||
| 1304 | |||
| 1305 | idx = IS_FREE(&thrd->req[0]) ? 0 : 1; | ||
| 1306 | |||
| 1307 | xs.ccr = ccr; | ||
| 1308 | xs.r = r; | ||
| 1309 | |||
| 1310 | /* First dry run to check if req is acceptable */ | ||
| 1311 | ret = _setup_req(1, thrd, idx, &xs); | ||
| 1312 | if (ret < 0) | ||
| 1313 | goto xfer_exit; | ||
| 1314 | |||
| 1315 | if (ret > pi->mcbufsz / 2) { | ||
| 1316 | dev_info(thrd->dmac->pinfo->dev, | ||
| 1317 | "%s:%d Trying increasing mcbufsz\n", | ||
| 1318 | __func__, __LINE__); | ||
| 1319 | ret = -ENOMEM; | ||
| 1320 | goto xfer_exit; | ||
| 1321 | } | ||
| 1322 | |||
| 1323 | /* Hook the request */ | ||
| 1324 | thrd->lstenq = idx; | ||
| 1325 | thrd->req[idx].mc_len = _setup_req(0, thrd, idx, &xs); | ||
| 1326 | thrd->req[idx].r = r; | ||
| 1327 | |||
| 1328 | ret = 0; | ||
| 1329 | |||
| 1330 | xfer_exit: | ||
| 1331 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
| 1332 | |||
| 1333 | return ret; | ||
| 1334 | } | ||
| 1335 | EXPORT_SYMBOL(pl330_submit_req); | ||
| 1336 | |||
| 1337 | static void pl330_dotask(unsigned long data) | ||
| 1338 | { | ||
| 1339 | struct pl330_dmac *pl330 = (struct pl330_dmac *) data; | ||
| 1340 | struct pl330_info *pi = pl330->pinfo; | ||
| 1341 | unsigned long flags; | ||
| 1342 | int i; | ||
| 1343 | |||
| 1344 | spin_lock_irqsave(&pl330->lock, flags); | ||
| 1345 | |||
| 1346 | /* The DMAC itself gone nuts */ | ||
| 1347 | if (pl330->dmac_tbd.reset_dmac) { | ||
| 1348 | pl330->state = DYING; | ||
| 1349 | /* Reset the manager too */ | ||
| 1350 | pl330->dmac_tbd.reset_mngr = true; | ||
| 1351 | /* Clear the reset flag */ | ||
| 1352 | pl330->dmac_tbd.reset_dmac = false; | ||
| 1353 | } | ||
| 1354 | |||
| 1355 | if (pl330->dmac_tbd.reset_mngr) { | ||
| 1356 | _stop(pl330->manager); | ||
| 1357 | /* Reset all channels */ | ||
| 1358 | pl330->dmac_tbd.reset_chan = (1 << pi->pcfg.num_chan) - 1; | ||
| 1359 | /* Clear the reset flag */ | ||
| 1360 | pl330->dmac_tbd.reset_mngr = false; | ||
| 1361 | } | ||
| 1362 | |||
| 1363 | for (i = 0; i < pi->pcfg.num_chan; i++) { | ||
| 1364 | |||
| 1365 | if (pl330->dmac_tbd.reset_chan & (1 << i)) { | ||
| 1366 | struct pl330_thread *thrd = &pl330->channels[i]; | ||
| 1367 | void __iomem *regs = pi->base; | ||
| 1368 | enum pl330_op_err err; | ||
| 1369 | |||
| 1370 | _stop(thrd); | ||
| 1371 | |||
| 1372 | if (readl(regs + FSC) & (1 << thrd->id)) | ||
| 1373 | err = PL330_ERR_FAIL; | ||
| 1374 | else | ||
| 1375 | err = PL330_ERR_ABORT; | ||
| 1376 | |||
| 1377 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
| 1378 | |||
| 1379 | _callback(thrd->req[1 - thrd->lstenq].r, err); | ||
| 1380 | _callback(thrd->req[thrd->lstenq].r, err); | ||
| 1381 | |||
| 1382 | spin_lock_irqsave(&pl330->lock, flags); | ||
| 1383 | |||
| 1384 | thrd->req[0].r = NULL; | ||
| 1385 | thrd->req[1].r = NULL; | ||
| 1386 | MARK_FREE(&thrd->req[0]); | ||
| 1387 | MARK_FREE(&thrd->req[1]); | ||
| 1388 | |||
| 1389 | /* Clear the reset flag */ | ||
| 1390 | pl330->dmac_tbd.reset_chan &= ~(1 << i); | ||
| 1391 | } | ||
| 1392 | } | ||
| 1393 | |||
| 1394 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
| 1395 | |||
| 1396 | return; | ||
| 1397 | } | ||
| 1398 | |||
| 1399 | /* Returns 1 if state was updated, 0 otherwise */ | ||
| 1400 | int pl330_update(const struct pl330_info *pi) | ||
| 1401 | { | ||
| 1402 | struct _pl330_req *rqdone; | ||
| 1403 | struct pl330_dmac *pl330; | ||
| 1404 | unsigned long flags; | ||
| 1405 | void __iomem *regs; | ||
| 1406 | u32 val; | ||
| 1407 | int id, ev, ret = 0; | ||
| 1408 | |||
| 1409 | if (!pi || !pi->pl330_data) | ||
| 1410 | return 0; | ||
| 1411 | |||
| 1412 | regs = pi->base; | ||
| 1413 | pl330 = pi->pl330_data; | ||
| 1414 | |||
| 1415 | spin_lock_irqsave(&pl330->lock, flags); | ||
| 1416 | |||
| 1417 | val = readl(regs + FSM) & 0x1; | ||
| 1418 | if (val) | ||
| 1419 | pl330->dmac_tbd.reset_mngr = true; | ||
| 1420 | else | ||
| 1421 | pl330->dmac_tbd.reset_mngr = false; | ||
| 1422 | |||
| 1423 | val = readl(regs + FSC) & ((1 << pi->pcfg.num_chan) - 1); | ||
| 1424 | pl330->dmac_tbd.reset_chan |= val; | ||
| 1425 | if (val) { | ||
| 1426 | int i = 0; | ||
| 1427 | while (i < pi->pcfg.num_chan) { | ||
| 1428 | if (val & (1 << i)) { | ||
| 1429 | dev_info(pi->dev, | ||
| 1430 | "Reset Channel-%d\t CS-%x FTC-%x\n", | ||
| 1431 | i, readl(regs + CS(i)), | ||
| 1432 | readl(regs + FTC(i))); | ||
| 1433 | _stop(&pl330->channels[i]); | ||
| 1434 | } | ||
| 1435 | i++; | ||
| 1436 | } | ||
| 1437 | } | ||
| 1438 | |||
| 1439 | /* Check which event happened i.e, thread notified */ | ||
| 1440 | val = readl(regs + ES); | ||
| 1441 | if (pi->pcfg.num_events < 32 | ||
| 1442 | && val & ~((1 << pi->pcfg.num_events) - 1)) { | ||
| 1443 | pl330->dmac_tbd.reset_dmac = true; | ||
| 1444 | dev_err(pi->dev, "%s:%d Unexpected!\n", __func__, __LINE__); | ||
| 1445 | ret = 1; | ||
| 1446 | goto updt_exit; | ||
| 1447 | } | ||
| 1448 | |||
| 1449 | for (ev = 0; ev < pi->pcfg.num_events; ev++) { | ||
| 1450 | if (val & (1 << ev)) { /* Event occured */ | ||
| 1451 | struct pl330_thread *thrd; | ||
| 1452 | u32 inten = readl(regs + INTEN); | ||
| 1453 | int active; | ||
| 1454 | |||
| 1455 | /* Clear the event */ | ||
| 1456 | if (inten & (1 << ev)) | ||
| 1457 | writel(1 << ev, regs + INTCLR); | ||
| 1458 | |||
| 1459 | ret = 1; | ||
| 1460 | |||
| 1461 | id = pl330->events[ev]; | ||
| 1462 | |||
| 1463 | thrd = &pl330->channels[id]; | ||
| 1464 | |||
| 1465 | active = _thrd_active(thrd); | ||
| 1466 | if (!active) /* Aborted */ | ||
| 1467 | continue; | ||
| 1468 | |||
| 1469 | active -= 1; | ||
| 1470 | |||
| 1471 | rqdone = &thrd->req[active]; | ||
| 1472 | MARK_FREE(rqdone); | ||
| 1473 | |||
| 1474 | /* Get going again ASAP */ | ||
| 1475 | _start(thrd); | ||
| 1476 | |||
| 1477 | /* For now, just make a list of callbacks to be done */ | ||
| 1478 | list_add_tail(&rqdone->rqd, &pl330->req_done); | ||
| 1479 | } | ||
| 1480 | } | ||
| 1481 | |||
| 1482 | /* Now that we are in no hurry, do the callbacks */ | ||
| 1483 | while (!list_empty(&pl330->req_done)) { | ||
| 1484 | rqdone = container_of(pl330->req_done.next, | ||
| 1485 | struct _pl330_req, rqd); | ||
| 1486 | |||
| 1487 | list_del_init(&rqdone->rqd); | ||
| 1488 | |||
| 1489 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
| 1490 | _callback(rqdone->r, PL330_ERR_NONE); | ||
| 1491 | spin_lock_irqsave(&pl330->lock, flags); | ||
| 1492 | } | ||
| 1493 | |||
| 1494 | updt_exit: | ||
| 1495 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
| 1496 | |||
| 1497 | if (pl330->dmac_tbd.reset_dmac | ||
| 1498 | || pl330->dmac_tbd.reset_mngr | ||
| 1499 | || pl330->dmac_tbd.reset_chan) { | ||
| 1500 | ret = 1; | ||
| 1501 | tasklet_schedule(&pl330->tasks); | ||
| 1502 | } | ||
| 1503 | |||
| 1504 | return ret; | ||
| 1505 | } | ||
| 1506 | EXPORT_SYMBOL(pl330_update); | ||
| 1507 | |||
| 1508 | int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op) | ||
| 1509 | { | ||
| 1510 | struct pl330_thread *thrd = ch_id; | ||
| 1511 | struct pl330_dmac *pl330; | ||
| 1512 | unsigned long flags; | ||
| 1513 | int ret = 0, active; | ||
| 1514 | |||
| 1515 | if (!thrd || thrd->free || thrd->dmac->state == DYING) | ||
| 1516 | return -EINVAL; | ||
| 1517 | |||
| 1518 | pl330 = thrd->dmac; | ||
| 1519 | |||
| 1520 | spin_lock_irqsave(&pl330->lock, flags); | ||
| 1521 | |||
| 1522 | switch (op) { | ||
| 1523 | case PL330_OP_FLUSH: | ||
| 1524 | /* Make sure the channel is stopped */ | ||
| 1525 | _stop(thrd); | ||
| 1526 | |||
| 1527 | thrd->req[0].r = NULL; | ||
| 1528 | thrd->req[1].r = NULL; | ||
| 1529 | MARK_FREE(&thrd->req[0]); | ||
| 1530 | MARK_FREE(&thrd->req[1]); | ||
| 1531 | break; | ||
| 1532 | |||
| 1533 | case PL330_OP_ABORT: | ||
| 1534 | active = _thrd_active(thrd); | ||
| 1535 | |||
| 1536 | /* Make sure the channel is stopped */ | ||
| 1537 | _stop(thrd); | ||
| 1538 | |||
| 1539 | /* ABORT is only for the active req */ | ||
| 1540 | if (!active) | ||
| 1541 | break; | ||
| 1542 | |||
| 1543 | active--; | ||
| 1544 | |||
| 1545 | thrd->req[active].r = NULL; | ||
| 1546 | MARK_FREE(&thrd->req[active]); | ||
| 1547 | |||
| 1548 | /* Start the next */ | ||
| 1549 | case PL330_OP_START: | ||
| 1550 | if (!_start(thrd)) | ||
| 1551 | ret = -EIO; | ||
| 1552 | break; | ||
| 1553 | |||
| 1554 | default: | ||
| 1555 | ret = -EINVAL; | ||
| 1556 | } | ||
| 1557 | |||
| 1558 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
| 1559 | return ret; | ||
| 1560 | } | ||
| 1561 | EXPORT_SYMBOL(pl330_chan_ctrl); | ||
| 1562 | |||
| 1563 | int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus) | ||
| 1564 | { | ||
| 1565 | struct pl330_thread *thrd = ch_id; | ||
| 1566 | struct pl330_dmac *pl330; | ||
| 1567 | struct pl330_info *pi; | ||
| 1568 | void __iomem *regs; | ||
| 1569 | int active; | ||
| 1570 | u32 val; | ||
| 1571 | |||
| 1572 | if (!pstatus || !thrd || thrd->free) | ||
| 1573 | return -EINVAL; | ||
| 1574 | |||
| 1575 | pl330 = thrd->dmac; | ||
| 1576 | pi = pl330->pinfo; | ||
| 1577 | regs = pi->base; | ||
| 1578 | |||
| 1579 | /* The client should remove the DMAC and add again */ | ||
| 1580 | if (pl330->state == DYING) | ||
| 1581 | pstatus->dmac_halted = true; | ||
| 1582 | else | ||
| 1583 | pstatus->dmac_halted = false; | ||
| 1584 | |||
| 1585 | val = readl(regs + FSC); | ||
| 1586 | if (val & (1 << thrd->id)) | ||
| 1587 | pstatus->faulting = true; | ||
| 1588 | else | ||
| 1589 | pstatus->faulting = false; | ||
| 1590 | |||
| 1591 | active = _thrd_active(thrd); | ||
| 1592 | |||
| 1593 | if (!active) { | ||
| 1594 | /* Indicate that the thread is not running */ | ||
| 1595 | pstatus->top_req = NULL; | ||
| 1596 | pstatus->wait_req = NULL; | ||
| 1597 | } else { | ||
| 1598 | active--; | ||
| 1599 | pstatus->top_req = thrd->req[active].r; | ||
| 1600 | pstatus->wait_req = !IS_FREE(&thrd->req[1 - active]) | ||
| 1601 | ? thrd->req[1 - active].r : NULL; | ||
| 1602 | } | ||
| 1603 | |||
| 1604 | pstatus->src_addr = readl(regs + SA(thrd->id)); | ||
| 1605 | pstatus->dst_addr = readl(regs + DA(thrd->id)); | ||
| 1606 | |||
| 1607 | return 0; | ||
| 1608 | } | ||
| 1609 | EXPORT_SYMBOL(pl330_chan_status); | ||
| 1610 | |||
| 1611 | /* Reserve an event */ | ||
| 1612 | static inline int _alloc_event(struct pl330_thread *thrd) | ||
| 1613 | { | ||
| 1614 | struct pl330_dmac *pl330 = thrd->dmac; | ||
| 1615 | struct pl330_info *pi = pl330->pinfo; | ||
| 1616 | int ev; | ||
| 1617 | |||
| 1618 | for (ev = 0; ev < pi->pcfg.num_events; ev++) | ||
| 1619 | if (pl330->events[ev] == -1) { | ||
| 1620 | pl330->events[ev] = thrd->id; | ||
| 1621 | return ev; | ||
| 1622 | } | ||
| 1623 | |||
| 1624 | return -1; | ||
| 1625 | } | ||
| 1626 | |||
| 1627 | /* Upon success, returns IdentityToken for the | ||
| 1628 | * allocated channel, NULL otherwise. | ||
| 1629 | */ | ||
| 1630 | void *pl330_request_channel(const struct pl330_info *pi) | ||
| 1631 | { | ||
| 1632 | struct pl330_thread *thrd = NULL; | ||
| 1633 | struct pl330_dmac *pl330; | ||
| 1634 | unsigned long flags; | ||
| 1635 | int chans, i; | ||
| 1636 | |||
| 1637 | if (!pi || !pi->pl330_data) | ||
| 1638 | return NULL; | ||
| 1639 | |||
| 1640 | pl330 = pi->pl330_data; | ||
| 1641 | |||
| 1642 | if (pl330->state == DYING) | ||
| 1643 | return NULL; | ||
| 1644 | |||
| 1645 | chans = pi->pcfg.num_chan; | ||
| 1646 | |||
| 1647 | spin_lock_irqsave(&pl330->lock, flags); | ||
| 1648 | |||
| 1649 | for (i = 0; i < chans; i++) { | ||
| 1650 | thrd = &pl330->channels[i]; | ||
| 1651 | if (thrd->free) { | ||
| 1652 | thrd->ev = _alloc_event(thrd); | ||
| 1653 | if (thrd->ev >= 0) { | ||
| 1654 | thrd->free = false; | ||
| 1655 | thrd->lstenq = 1; | ||
| 1656 | thrd->req[0].r = NULL; | ||
| 1657 | MARK_FREE(&thrd->req[0]); | ||
| 1658 | thrd->req[1].r = NULL; | ||
| 1659 | MARK_FREE(&thrd->req[1]); | ||
| 1660 | break; | ||
| 1661 | } | ||
| 1662 | } | ||
| 1663 | thrd = NULL; | ||
| 1664 | } | ||
| 1665 | |||
| 1666 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
| 1667 | |||
| 1668 | return thrd; | ||
| 1669 | } | ||
| 1670 | EXPORT_SYMBOL(pl330_request_channel); | ||
| 1671 | |||
| 1672 | /* Release an event */ | ||
| 1673 | static inline void _free_event(struct pl330_thread *thrd, int ev) | ||
| 1674 | { | ||
| 1675 | struct pl330_dmac *pl330 = thrd->dmac; | ||
| 1676 | struct pl330_info *pi = pl330->pinfo; | ||
| 1677 | |||
| 1678 | /* If the event is valid and was held by the thread */ | ||
| 1679 | if (ev >= 0 && ev < pi->pcfg.num_events | ||
| 1680 | && pl330->events[ev] == thrd->id) | ||
| 1681 | pl330->events[ev] = -1; | ||
| 1682 | } | ||
| 1683 | |||
| 1684 | void pl330_release_channel(void *ch_id) | ||
| 1685 | { | ||
| 1686 | struct pl330_thread *thrd = ch_id; | ||
| 1687 | struct pl330_dmac *pl330; | ||
| 1688 | unsigned long flags; | ||
| 1689 | |||
| 1690 | if (!thrd || thrd->free) | ||
| 1691 | return; | ||
| 1692 | |||
| 1693 | _stop(thrd); | ||
| 1694 | |||
| 1695 | _callback(thrd->req[1 - thrd->lstenq].r, PL330_ERR_ABORT); | ||
| 1696 | _callback(thrd->req[thrd->lstenq].r, PL330_ERR_ABORT); | ||
| 1697 | |||
| 1698 | pl330 = thrd->dmac; | ||
| 1699 | |||
| 1700 | spin_lock_irqsave(&pl330->lock, flags); | ||
| 1701 | _free_event(thrd, thrd->ev); | ||
| 1702 | thrd->free = true; | ||
| 1703 | spin_unlock_irqrestore(&pl330->lock, flags); | ||
| 1704 | } | ||
| 1705 | EXPORT_SYMBOL(pl330_release_channel); | ||
| 1706 | |||
| 1707 | /* Initialize the structure for PL330 configuration, that can be used | ||
| 1708 | * by the client driver the make best use of the DMAC | ||
| 1709 | */ | ||
| 1710 | static void read_dmac_config(struct pl330_info *pi) | ||
| 1711 | { | ||
| 1712 | void __iomem *regs = pi->base; | ||
| 1713 | u32 val; | ||
| 1714 | |||
| 1715 | val = readl(regs + CRD) >> CRD_DATA_WIDTH_SHIFT; | ||
| 1716 | val &= CRD_DATA_WIDTH_MASK; | ||
| 1717 | pi->pcfg.data_bus_width = 8 * (1 << val); | ||
| 1718 | |||
| 1719 | val = readl(regs + CRD) >> CRD_DATA_BUFF_SHIFT; | ||
| 1720 | val &= CRD_DATA_BUFF_MASK; | ||
| 1721 | pi->pcfg.data_buf_dep = val + 1; | ||
| 1722 | |||
| 1723 | val = readl(regs + CR0) >> CR0_NUM_CHANS_SHIFT; | ||
| 1724 | val &= CR0_NUM_CHANS_MASK; | ||
| 1725 | val += 1; | ||
| 1726 | pi->pcfg.num_chan = val; | ||
| 1727 | |||
| 1728 | val = readl(regs + CR0); | ||
| 1729 | if (val & CR0_PERIPH_REQ_SET) { | ||
| 1730 | val = (val >> CR0_NUM_PERIPH_SHIFT) & CR0_NUM_PERIPH_MASK; | ||
| 1731 | val += 1; | ||
| 1732 | pi->pcfg.num_peri = val; | ||
| 1733 | pi->pcfg.peri_ns = readl(regs + CR4); | ||
| 1734 | } else { | ||
| 1735 | pi->pcfg.num_peri = 0; | ||
| 1736 | } | ||
| 1737 | |||
| 1738 | val = readl(regs + CR0); | ||
| 1739 | if (val & CR0_BOOT_MAN_NS) | ||
| 1740 | pi->pcfg.mode |= DMAC_MODE_NS; | ||
| 1741 | else | ||
| 1742 | pi->pcfg.mode &= ~DMAC_MODE_NS; | ||
| 1743 | |||
| 1744 | val = readl(regs + CR0) >> CR0_NUM_EVENTS_SHIFT; | ||
| 1745 | val &= CR0_NUM_EVENTS_MASK; | ||
| 1746 | val += 1; | ||
| 1747 | pi->pcfg.num_events = val; | ||
| 1748 | |||
| 1749 | pi->pcfg.irq_ns = readl(regs + CR3); | ||
| 1750 | |||
| 1751 | pi->pcfg.periph_id = get_id(pi, PERIPH_ID); | ||
| 1752 | pi->pcfg.pcell_id = get_id(pi, PCELL_ID); | ||
| 1753 | } | ||
| 1754 | |||
| 1755 | static inline void _reset_thread(struct pl330_thread *thrd) | ||
| 1756 | { | ||
| 1757 | struct pl330_dmac *pl330 = thrd->dmac; | ||
| 1758 | struct pl330_info *pi = pl330->pinfo; | ||
| 1759 | |||
| 1760 | thrd->req[0].mc_cpu = pl330->mcode_cpu | ||
| 1761 | + (thrd->id * pi->mcbufsz); | ||
| 1762 | thrd->req[0].mc_bus = pl330->mcode_bus | ||
| 1763 | + (thrd->id * pi->mcbufsz); | ||
| 1764 | thrd->req[0].r = NULL; | ||
| 1765 | MARK_FREE(&thrd->req[0]); | ||
| 1766 | |||
| 1767 | thrd->req[1].mc_cpu = thrd->req[0].mc_cpu | ||
| 1768 | + pi->mcbufsz / 2; | ||
| 1769 | thrd->req[1].mc_bus = thrd->req[0].mc_bus | ||
| 1770 | + pi->mcbufsz / 2; | ||
| 1771 | thrd->req[1].r = NULL; | ||
| 1772 | MARK_FREE(&thrd->req[1]); | ||
| 1773 | } | ||
| 1774 | |||
| 1775 | static int dmac_alloc_threads(struct pl330_dmac *pl330) | ||
| 1776 | { | ||
| 1777 | struct pl330_info *pi = pl330->pinfo; | ||
| 1778 | int chans = pi->pcfg.num_chan; | ||
| 1779 | struct pl330_thread *thrd; | ||
| 1780 | int i; | ||
| 1781 | |||
| 1782 | /* Allocate 1 Manager and 'chans' Channel threads */ | ||
| 1783 | pl330->channels = kzalloc((1 + chans) * sizeof(*thrd), | ||
| 1784 | GFP_KERNEL); | ||
| 1785 | if (!pl330->channels) | ||
| 1786 | return -ENOMEM; | ||
| 1787 | |||
| 1788 | /* Init Channel threads */ | ||
| 1789 | for (i = 0; i < chans; i++) { | ||
| 1790 | thrd = &pl330->channels[i]; | ||
| 1791 | thrd->id = i; | ||
| 1792 | thrd->dmac = pl330; | ||
| 1793 | _reset_thread(thrd); | ||
| 1794 | thrd->free = true; | ||
| 1795 | } | ||
| 1796 | |||
| 1797 | /* MANAGER is indexed at the end */ | ||
| 1798 | thrd = &pl330->channels[chans]; | ||
| 1799 | thrd->id = chans; | ||
| 1800 | thrd->dmac = pl330; | ||
| 1801 | thrd->free = false; | ||
| 1802 | pl330->manager = thrd; | ||
| 1803 | |||
| 1804 | return 0; | ||
| 1805 | } | ||
| 1806 | |||
| 1807 | static int dmac_alloc_resources(struct pl330_dmac *pl330) | ||
| 1808 | { | ||
| 1809 | struct pl330_info *pi = pl330->pinfo; | ||
| 1810 | int chans = pi->pcfg.num_chan; | ||
| 1811 | int ret; | ||
| 1812 | |||
| 1813 | /* | ||
| 1814 | * Alloc MicroCode buffer for 'chans' Channel threads. | ||
| 1815 | * A channel's buffer offset is (Channel_Id * MCODE_BUFF_PERCHAN) | ||
| 1816 | */ | ||
| 1817 | pl330->mcode_cpu = dma_alloc_coherent(pi->dev, | ||
| 1818 | chans * pi->mcbufsz, | ||
| 1819 | &pl330->mcode_bus, GFP_KERNEL); | ||
| 1820 | if (!pl330->mcode_cpu) { | ||
| 1821 | dev_err(pi->dev, "%s:%d Can't allocate memory!\n", | ||
| 1822 | __func__, __LINE__); | ||
| 1823 | return -ENOMEM; | ||
| 1824 | } | ||
| 1825 | |||
| 1826 | ret = dmac_alloc_threads(pl330); | ||
| 1827 | if (ret) { | ||
| 1828 | dev_err(pi->dev, "%s:%d Can't to create channels for DMAC!\n", | ||
| 1829 | __func__, __LINE__); | ||
| 1830 | dma_free_coherent(pi->dev, | ||
| 1831 | chans * pi->mcbufsz, | ||
| 1832 | pl330->mcode_cpu, pl330->mcode_bus); | ||
| 1833 | return ret; | ||
| 1834 | } | ||
| 1835 | |||
| 1836 | return 0; | ||
| 1837 | } | ||
| 1838 | |||
| 1839 | int pl330_add(struct pl330_info *pi) | ||
| 1840 | { | ||
| 1841 | struct pl330_dmac *pl330; | ||
| 1842 | void __iomem *regs; | ||
| 1843 | int i, ret; | ||
| 1844 | |||
| 1845 | if (!pi || !pi->dev) | ||
| 1846 | return -EINVAL; | ||
| 1847 | |||
| 1848 | /* If already added */ | ||
| 1849 | if (pi->pl330_data) | ||
| 1850 | return -EINVAL; | ||
| 1851 | |||
| 1852 | /* | ||
| 1853 | * If the SoC can perform reset on the DMAC, then do it | ||
| 1854 | * before reading its configuration. | ||
| 1855 | */ | ||
| 1856 | if (pi->dmac_reset) | ||
| 1857 | pi->dmac_reset(pi); | ||
| 1858 | |||
| 1859 | regs = pi->base; | ||
| 1860 | |||
| 1861 | /* Check if we can handle this DMAC */ | ||
| 1862 | if (get_id(pi, PERIPH_ID) != PERIPH_ID_VAL | ||
| 1863 | || get_id(pi, PCELL_ID) != PCELL_ID_VAL) { | ||
| 1864 | dev_err(pi->dev, "PERIPH_ID 0x%x, PCELL_ID 0x%x !\n", | ||
| 1865 | readl(regs + PERIPH_ID), readl(regs + PCELL_ID)); | ||
| 1866 | return -EINVAL; | ||
| 1867 | } | ||
| 1868 | |||
| 1869 | /* Read the configuration of the DMAC */ | ||
| 1870 | read_dmac_config(pi); | ||
| 1871 | |||
| 1872 | if (pi->pcfg.num_events == 0) { | ||
| 1873 | dev_err(pi->dev, "%s:%d Can't work without events!\n", | ||
| 1874 | __func__, __LINE__); | ||
| 1875 | return -EINVAL; | ||
| 1876 | } | ||
| 1877 | |||
| 1878 | pl330 = kzalloc(sizeof(*pl330), GFP_KERNEL); | ||
| 1879 | if (!pl330) { | ||
| 1880 | dev_err(pi->dev, "%s:%d Can't allocate memory!\n", | ||
| 1881 | __func__, __LINE__); | ||
| 1882 | return -ENOMEM; | ||
| 1883 | } | ||
| 1884 | |||
| 1885 | /* Assign the info structure and private data */ | ||
| 1886 | pl330->pinfo = pi; | ||
| 1887 | pi->pl330_data = pl330; | ||
| 1888 | |||
| 1889 | spin_lock_init(&pl330->lock); | ||
| 1890 | |||
| 1891 | INIT_LIST_HEAD(&pl330->req_done); | ||
| 1892 | |||
| 1893 | /* Use default MC buffer size if not provided */ | ||
| 1894 | if (!pi->mcbufsz) | ||
| 1895 | pi->mcbufsz = MCODE_BUFF_PER_REQ * 2; | ||
| 1896 | |||
| 1897 | /* Mark all events as free */ | ||
| 1898 | for (i = 0; i < pi->pcfg.num_events; i++) | ||
| 1899 | pl330->events[i] = -1; | ||
| 1900 | |||
| 1901 | /* Allocate resources needed by the DMAC */ | ||
| 1902 | ret = dmac_alloc_resources(pl330); | ||
| 1903 | if (ret) { | ||
| 1904 | dev_err(pi->dev, "Unable to create channels for DMAC\n"); | ||
| 1905 | kfree(pl330); | ||
| 1906 | return ret; | ||
| 1907 | } | ||
| 1908 | |||
| 1909 | tasklet_init(&pl330->tasks, pl330_dotask, (unsigned long) pl330); | ||
| 1910 | |||
| 1911 | pl330->state = INIT; | ||
| 1912 | |||
| 1913 | return 0; | ||
| 1914 | } | ||
| 1915 | EXPORT_SYMBOL(pl330_add); | ||
| 1916 | |||
| 1917 | static int dmac_free_threads(struct pl330_dmac *pl330) | ||
| 1918 | { | ||
| 1919 | struct pl330_info *pi = pl330->pinfo; | ||
| 1920 | int chans = pi->pcfg.num_chan; | ||
| 1921 | struct pl330_thread *thrd; | ||
| 1922 | int i; | ||
| 1923 | |||
| 1924 | /* Release Channel threads */ | ||
| 1925 | for (i = 0; i < chans; i++) { | ||
| 1926 | thrd = &pl330->channels[i]; | ||
| 1927 | pl330_release_channel((void *)thrd); | ||
| 1928 | } | ||
| 1929 | |||
| 1930 | /* Free memory */ | ||
| 1931 | kfree(pl330->channels); | ||
| 1932 | |||
| 1933 | return 0; | ||
| 1934 | } | ||
| 1935 | |||
| 1936 | static void dmac_free_resources(struct pl330_dmac *pl330) | ||
| 1937 | { | ||
| 1938 | struct pl330_info *pi = pl330->pinfo; | ||
| 1939 | int chans = pi->pcfg.num_chan; | ||
| 1940 | |||
| 1941 | dmac_free_threads(pl330); | ||
| 1942 | |||
| 1943 | dma_free_coherent(pi->dev, chans * pi->mcbufsz, | ||
| 1944 | pl330->mcode_cpu, pl330->mcode_bus); | ||
| 1945 | } | ||
| 1946 | |||
| 1947 | void pl330_del(struct pl330_info *pi) | ||
| 1948 | { | ||
| 1949 | struct pl330_dmac *pl330; | ||
| 1950 | |||
| 1951 | if (!pi || !pi->pl330_data) | ||
| 1952 | return; | ||
| 1953 | |||
| 1954 | pl330 = pi->pl330_data; | ||
| 1955 | |||
| 1956 | pl330->state = UNINIT; | ||
| 1957 | |||
| 1958 | tasklet_kill(&pl330->tasks); | ||
| 1959 | |||
| 1960 | /* Free DMAC resources */ | ||
| 1961 | dmac_free_resources(pl330); | ||
| 1962 | |||
| 1963 | kfree(pl330); | ||
| 1964 | pi->pl330_data = NULL; | ||
| 1965 | } | ||
| 1966 | EXPORT_SYMBOL(pl330_del); | ||
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index 1cf999ade4bc..ba65f6eedca6 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c | |||
| @@ -266,13 +266,53 @@ static int vic_set_wake(unsigned int irq, unsigned int on) | |||
| 266 | #endif /* CONFIG_PM */ | 266 | #endif /* CONFIG_PM */ |
| 267 | 267 | ||
| 268 | static struct irq_chip vic_chip = { | 268 | static struct irq_chip vic_chip = { |
| 269 | .name = "VIC", | 269 | .name = "VIC", |
| 270 | .ack = vic_ack_irq, | 270 | .ack = vic_ack_irq, |
| 271 | .mask = vic_mask_irq, | 271 | .mask = vic_mask_irq, |
| 272 | .unmask = vic_unmask_irq, | 272 | .unmask = vic_unmask_irq, |
| 273 | .set_wake = vic_set_wake, | 273 | .set_wake = vic_set_wake, |
| 274 | }; | 274 | }; |
| 275 | 275 | ||
| 276 | static void __init vic_disable(void __iomem *base) | ||
| 277 | { | ||
| 278 | writel(0, base + VIC_INT_SELECT); | ||
| 279 | writel(0, base + VIC_INT_ENABLE); | ||
| 280 | writel(~0, base + VIC_INT_ENABLE_CLEAR); | ||
| 281 | writel(0, base + VIC_IRQ_STATUS); | ||
| 282 | writel(0, base + VIC_ITCR); | ||
| 283 | writel(~0, base + VIC_INT_SOFT_CLEAR); | ||
| 284 | } | ||
| 285 | |||
| 286 | static void __init vic_clear_interrupts(void __iomem *base) | ||
| 287 | { | ||
| 288 | unsigned int i; | ||
| 289 | |||
| 290 | writel(0, base + VIC_PL190_VECT_ADDR); | ||
| 291 | for (i = 0; i < 19; i++) { | ||
| 292 | unsigned int value; | ||
| 293 | |||
| 294 | value = readl(base + VIC_PL190_VECT_ADDR); | ||
| 295 | writel(value, base + VIC_PL190_VECT_ADDR); | ||
| 296 | } | ||
| 297 | } | ||
| 298 | |||
| 299 | static void __init vic_set_irq_sources(void __iomem *base, | ||
| 300 | unsigned int irq_start, u32 vic_sources) | ||
| 301 | { | ||
| 302 | unsigned int i; | ||
| 303 | |||
| 304 | for (i = 0; i < 32; i++) { | ||
| 305 | if (vic_sources & (1 << i)) { | ||
| 306 | unsigned int irq = irq_start + i; | ||
| 307 | |||
| 308 | set_irq_chip(irq, &vic_chip); | ||
| 309 | set_irq_chip_data(irq, base); | ||
| 310 | set_irq_handler(irq, handle_level_irq); | ||
| 311 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
| 312 | } | ||
| 313 | } | ||
| 314 | } | ||
| 315 | |||
| 276 | /* | 316 | /* |
| 277 | * The PL190 cell from ARM has been modified by ST to handle 64 interrupts. | 317 | * The PL190 cell from ARM has been modified by ST to handle 64 interrupts. |
| 278 | * The original cell has 32 interrupts, while the modified one has 64, | 318 | * The original cell has 32 interrupts, while the modified one has 64, |
| @@ -287,13 +327,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | |||
| 287 | int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0; | 327 | int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0; |
| 288 | 328 | ||
| 289 | /* Disable all interrupts initially. */ | 329 | /* Disable all interrupts initially. */ |
| 290 | 330 | vic_disable(base); | |
| 291 | writel(0, base + VIC_INT_SELECT); | ||
| 292 | writel(0, base + VIC_INT_ENABLE); | ||
| 293 | writel(~0, base + VIC_INT_ENABLE_CLEAR); | ||
| 294 | writel(0, base + VIC_IRQ_STATUS); | ||
| 295 | writel(0, base + VIC_ITCR); | ||
| 296 | writel(~0, base + VIC_INT_SOFT_CLEAR); | ||
| 297 | 331 | ||
| 298 | /* | 332 | /* |
| 299 | * Make sure we clear all existing interrupts. The vector registers | 333 | * Make sure we clear all existing interrupts. The vector registers |
| @@ -302,13 +336,8 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | |||
| 302 | * the second base address, which is 0x20 in the page | 336 | * the second base address, which is 0x20 in the page |
| 303 | */ | 337 | */ |
| 304 | if (vic_2nd_block) { | 338 | if (vic_2nd_block) { |
| 305 | writel(0, base + VIC_PL190_VECT_ADDR); | 339 | vic_clear_interrupts(base); |
| 306 | for (i = 0; i < 19; i++) { | ||
| 307 | unsigned int value; | ||
| 308 | 340 | ||
| 309 | value = readl(base + VIC_PL190_VECT_ADDR); | ||
| 310 | writel(value, base + VIC_PL190_VECT_ADDR); | ||
| 311 | } | ||
| 312 | /* ST has 16 vectors as well, but we don't enable them by now */ | 341 | /* ST has 16 vectors as well, but we don't enable them by now */ |
| 313 | for (i = 0; i < 16; i++) { | 342 | for (i = 0; i < 16; i++) { |
| 314 | void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); | 343 | void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); |
| @@ -318,16 +347,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | |||
| 318 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); | 347 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); |
| 319 | } | 348 | } |
| 320 | 349 | ||
| 321 | for (i = 0; i < 32; i++) { | 350 | vic_set_irq_sources(base, irq_start, vic_sources); |
| 322 | if (vic_sources & (1 << i)) { | ||
| 323 | unsigned int irq = irq_start + i; | ||
| 324 | |||
| 325 | set_irq_chip(irq, &vic_chip); | ||
| 326 | set_irq_chip_data(irq, base); | ||
| 327 | set_irq_handler(irq, handle_level_irq); | ||
| 328 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
| 329 | } | ||
| 330 | } | ||
| 331 | } | 351 | } |
| 332 | 352 | ||
| 333 | /** | 353 | /** |
| @@ -365,37 +385,14 @@ void __init vic_init(void __iomem *base, unsigned int irq_start, | |||
| 365 | } | 385 | } |
| 366 | 386 | ||
| 367 | /* Disable all interrupts initially. */ | 387 | /* Disable all interrupts initially. */ |
| 388 | vic_disable(base); | ||
| 368 | 389 | ||
| 369 | writel(0, base + VIC_INT_SELECT); | 390 | /* Make sure we clear all existing interrupts */ |
| 370 | writel(0, base + VIC_INT_ENABLE); | 391 | vic_clear_interrupts(base); |
| 371 | writel(~0, base + VIC_INT_ENABLE_CLEAR); | ||
| 372 | writel(0, base + VIC_IRQ_STATUS); | ||
| 373 | writel(0, base + VIC_ITCR); | ||
| 374 | writel(~0, base + VIC_INT_SOFT_CLEAR); | ||
| 375 | |||
| 376 | /* | ||
| 377 | * Make sure we clear all existing interrupts | ||
| 378 | */ | ||
| 379 | writel(0, base + VIC_PL190_VECT_ADDR); | ||
| 380 | for (i = 0; i < 19; i++) { | ||
| 381 | unsigned int value; | ||
| 382 | |||
| 383 | value = readl(base + VIC_PL190_VECT_ADDR); | ||
| 384 | writel(value, base + VIC_PL190_VECT_ADDR); | ||
| 385 | } | ||
| 386 | 392 | ||
| 387 | vic_init2(base); | 393 | vic_init2(base); |
| 388 | 394 | ||
| 389 | for (i = 0; i < 32; i++) { | 395 | vic_set_irq_sources(base, irq_start, vic_sources); |
| 390 | if (vic_sources & (1 << i)) { | ||
| 391 | unsigned int irq = irq_start + i; | ||
| 392 | |||
| 393 | set_irq_chip(irq, &vic_chip); | ||
| 394 | set_irq_chip_data(irq, base); | ||
| 395 | set_irq_handler(irq, handle_level_irq); | ||
| 396 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
| 397 | } | ||
| 398 | } | ||
| 399 | 396 | ||
| 400 | vic_pm_register(base, irq_start, resume_sources); | 397 | vic_pm_register(base, irq_start, resume_sources); |
| 401 | } | 398 | } |
diff --git a/arch/arm/configs/spear300_defconfig b/arch/arm/configs/spear300_defconfig new file mode 100644 index 000000000000..35e64d1cb750 --- /dev/null +++ b/arch/arm/configs/spear300_defconfig | |||
| @@ -0,0 +1,773 @@ | |||
| 1 | # | ||
| 2 | # Automatically generated make config: don't edit | ||
| 3 | # Linux kernel version: 2.6.32 | ||
| 4 | # Tue Mar 23 14:36:23 2010 | ||
| 5 | # | ||
| 6 | CONFIG_ARM=y | ||
| 7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
| 8 | CONFIG_GENERIC_GPIO=y | ||
| 9 | CONFIG_GENERIC_TIME=y | ||
| 10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
| 11 | CONFIG_GENERIC_HARDIRQS=y | ||
| 12 | CONFIG_STACKTRACE_SUPPORT=y | ||
| 13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
| 14 | CONFIG_LOCKDEP_SUPPORT=y | ||
| 15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
| 16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
| 17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
| 18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
| 19 | CONFIG_GENERIC_HWEIGHT=y | ||
| 20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
| 21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
| 22 | CONFIG_VECTORS_BASE=0xffff0000 | ||
| 23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
| 24 | CONFIG_CONSTRUCTORS=y | ||
| 25 | |||
| 26 | # | ||
| 27 | # General setup | ||
| 28 | # | ||
| 29 | CONFIG_EXPERIMENTAL=y | ||
| 30 | CONFIG_BROKEN_ON_SMP=y | ||
| 31 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
| 32 | CONFIG_LOCALVERSION="" | ||
| 33 | CONFIG_LOCALVERSION_AUTO=y | ||
| 34 | CONFIG_SWAP=y | ||
| 35 | CONFIG_SYSVIPC=y | ||
| 36 | CONFIG_SYSVIPC_SYSCTL=y | ||
| 37 | CONFIG_BSD_PROCESS_ACCT=y | ||
| 38 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
| 39 | |||
| 40 | # | ||
| 41 | # RCU Subsystem | ||
| 42 | # | ||
| 43 | CONFIG_TREE_RCU=y | ||
| 44 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
| 45 | # CONFIG_RCU_TRACE is not set | ||
| 46 | CONFIG_RCU_FANOUT=32 | ||
| 47 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
| 48 | # CONFIG_TREE_RCU_TRACE is not set | ||
| 49 | # CONFIG_IKCONFIG is not set | ||
| 50 | CONFIG_LOG_BUF_SHIFT=17 | ||
| 51 | # CONFIG_GROUP_SCHED is not set | ||
| 52 | # CONFIG_CGROUPS is not set | ||
| 53 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
| 54 | # CONFIG_RELAY is not set | ||
| 55 | CONFIG_NAMESPACES=y | ||
| 56 | # CONFIG_UTS_NS is not set | ||
| 57 | # CONFIG_IPC_NS is not set | ||
| 58 | # CONFIG_USER_NS is not set | ||
| 59 | # CONFIG_PID_NS is not set | ||
| 60 | CONFIG_BLK_DEV_INITRD=y | ||
| 61 | CONFIG_INITRAMFS_SOURCE="" | ||
| 62 | CONFIG_RD_GZIP=y | ||
| 63 | CONFIG_RD_BZIP2=y | ||
| 64 | CONFIG_RD_LZMA=y | ||
| 65 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
| 66 | CONFIG_SYSCTL=y | ||
| 67 | CONFIG_ANON_INODES=y | ||
| 68 | # CONFIG_EMBEDDED is not set | ||
| 69 | CONFIG_UID16=y | ||
| 70 | CONFIG_SYSCTL_SYSCALL=y | ||
| 71 | CONFIG_KALLSYMS=y | ||
| 72 | # CONFIG_KALLSYMS_ALL is not set | ||
| 73 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
| 74 | CONFIG_HOTPLUG=y | ||
| 75 | CONFIG_PRINTK=y | ||
| 76 | CONFIG_BUG=y | ||
| 77 | CONFIG_ELF_CORE=y | ||
| 78 | CONFIG_BASE_FULL=y | ||
| 79 | CONFIG_FUTEX=y | ||
| 80 | CONFIG_EPOLL=y | ||
| 81 | CONFIG_SIGNALFD=y | ||
| 82 | CONFIG_TIMERFD=y | ||
| 83 | CONFIG_EVENTFD=y | ||
| 84 | CONFIG_SHMEM=y | ||
| 85 | CONFIG_AIO=y | ||
| 86 | |||
| 87 | # | ||
| 88 | # Kernel Performance Events And Counters | ||
| 89 | # | ||
| 90 | CONFIG_VM_EVENT_COUNTERS=y | ||
| 91 | CONFIG_SLUB_DEBUG=y | ||
| 92 | CONFIG_COMPAT_BRK=y | ||
| 93 | # CONFIG_SLAB is not set | ||
| 94 | CONFIG_SLUB=y | ||
| 95 | # CONFIG_SLOB is not set | ||
| 96 | # CONFIG_PROFILING is not set | ||
| 97 | CONFIG_HAVE_OPROFILE=y | ||
| 98 | # CONFIG_KPROBES is not set | ||
| 99 | CONFIG_HAVE_KPROBES=y | ||
| 100 | CONFIG_HAVE_KRETPROBES=y | ||
| 101 | CONFIG_HAVE_CLK=y | ||
| 102 | |||
| 103 | # | ||
| 104 | # GCOV-based kernel profiling | ||
| 105 | # | ||
| 106 | # CONFIG_GCOV_KERNEL is not set | ||
| 107 | # CONFIG_SLOW_WORK is not set | ||
| 108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
| 109 | CONFIG_SLABINFO=y | ||
| 110 | CONFIG_RT_MUTEXES=y | ||
| 111 | CONFIG_BASE_SMALL=0 | ||
| 112 | CONFIG_MODULES=y | ||
| 113 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
| 114 | CONFIG_MODULE_UNLOAD=y | ||
| 115 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
| 116 | CONFIG_MODVERSIONS=y | ||
| 117 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
| 118 | CONFIG_BLOCK=y | ||
| 119 | CONFIG_LBDAF=y | ||
| 120 | CONFIG_BLK_DEV_BSG=y | ||
| 121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
| 122 | |||
| 123 | # | ||
| 124 | # IO Schedulers | ||
| 125 | # | ||
| 126 | CONFIG_IOSCHED_NOOP=y | ||
| 127 | CONFIG_IOSCHED_AS=y | ||
| 128 | CONFIG_IOSCHED_DEADLINE=y | ||
| 129 | CONFIG_IOSCHED_CFQ=y | ||
| 130 | # CONFIG_DEFAULT_AS is not set | ||
| 131 | # CONFIG_DEFAULT_DEADLINE is not set | ||
| 132 | CONFIG_DEFAULT_CFQ=y | ||
| 133 | # CONFIG_DEFAULT_NOOP is not set | ||
| 134 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
| 135 | # CONFIG_FREEZER is not set | ||
| 136 | |||
| 137 | # | ||
| 138 | # System Type | ||
| 139 | # | ||
| 140 | CONFIG_MMU=y | ||
| 141 | # CONFIG_ARCH_AAEC2000 is not set | ||
| 142 | # CONFIG_ARCH_INTEGRATOR is not set | ||
| 143 | # CONFIG_ARCH_REALVIEW is not set | ||
| 144 | # CONFIG_ARCH_VERSATILE is not set | ||
| 145 | # CONFIG_ARCH_AT91 is not set | ||
| 146 | # CONFIG_ARCH_CLPS711X is not set | ||
| 147 | # CONFIG_ARCH_GEMINI is not set | ||
| 148 | # CONFIG_ARCH_EBSA110 is not set | ||
| 149 | # CONFIG_ARCH_EP93XX is not set | ||
| 150 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
| 151 | # CONFIG_ARCH_MXC is not set | ||
| 152 | # CONFIG_ARCH_STMP3XXX is not set | ||
| 153 | # CONFIG_ARCH_NETX is not set | ||
| 154 | # CONFIG_ARCH_H720X is not set | ||
| 155 | # CONFIG_ARCH_NOMADIK is not set | ||
| 156 | # CONFIG_ARCH_IOP13XX is not set | ||
| 157 | # CONFIG_ARCH_IOP32X is not set | ||
| 158 | # CONFIG_ARCH_IOP33X is not set | ||
| 159 | # CONFIG_ARCH_IXP23XX is not set | ||
| 160 | # CONFIG_ARCH_IXP2000 is not set | ||
| 161 | # CONFIG_ARCH_IXP4XX is not set | ||
| 162 | # CONFIG_ARCH_L7200 is not set | ||
| 163 | # CONFIG_ARCH_KIRKWOOD is not set | ||
| 164 | # CONFIG_ARCH_LOKI is not set | ||
| 165 | # CONFIG_ARCH_MV78XX0 is not set | ||
| 166 | # CONFIG_ARCH_ORION5X is not set | ||
| 167 | # CONFIG_ARCH_MMP is not set | ||
| 168 | # CONFIG_ARCH_KS8695 is not set | ||
| 169 | # CONFIG_ARCH_NS9XXX is not set | ||
| 170 | # CONFIG_ARCH_W90X900 is not set | ||
| 171 | # CONFIG_ARCH_PNX4008 is not set | ||
| 172 | # CONFIG_ARCH_PXA is not set | ||
| 173 | # CONFIG_ARCH_MSM is not set | ||
| 174 | # CONFIG_ARCH_RPC is not set | ||
| 175 | # CONFIG_ARCH_SA1100 is not set | ||
| 176 | # CONFIG_ARCH_S3C2410 is not set | ||
| 177 | # CONFIG_ARCH_S3C64XX is not set | ||
| 178 | # CONFIG_ARCH_S5PC1XX is not set | ||
| 179 | # CONFIG_ARCH_SHARK is not set | ||
| 180 | # CONFIG_ARCH_LH7A40X is not set | ||
| 181 | # CONFIG_ARCH_U300 is not set | ||
| 182 | # CONFIG_ARCH_DAVINCI is not set | ||
| 183 | # CONFIG_ARCH_OMAP is not set | ||
| 184 | # CONFIG_ARCH_BCMRING is not set | ||
| 185 | CONFIG_PLAT_SPEAR=y | ||
| 186 | CONFIG_ARCH_SPEAR3XX=y | ||
| 187 | # CONFIG_ARCH_SPEAR6XX is not set | ||
| 188 | CONFIG_MACH_SPEAR300=y | ||
| 189 | # CONFIG_MACH_SPEAR310 is not set | ||
| 190 | # CONFIG_MACH_SPEAR320 is not set | ||
| 191 | CONFIG_BOARD_SPEAR300_EVB=y | ||
| 192 | |||
| 193 | # | ||
| 194 | # Processor Type | ||
| 195 | # | ||
| 196 | CONFIG_CPU_32=y | ||
| 197 | CONFIG_CPU_ARM926T=y | ||
| 198 | CONFIG_CPU_32v5=y | ||
| 199 | CONFIG_CPU_ABRT_EV5TJ=y | ||
| 200 | CONFIG_CPU_PABRT_LEGACY=y | ||
| 201 | CONFIG_CPU_CACHE_VIVT=y | ||
| 202 | CONFIG_CPU_COPY_V4WB=y | ||
| 203 | CONFIG_CPU_TLB_V4WBI=y | ||
| 204 | CONFIG_CPU_CP15=y | ||
| 205 | CONFIG_CPU_CP15_MMU=y | ||
| 206 | |||
| 207 | # | ||
| 208 | # Processor Features | ||
| 209 | # | ||
| 210 | CONFIG_ARM_THUMB=y | ||
| 211 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
| 212 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
| 213 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
| 214 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
| 215 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
| 216 | CONFIG_ARM_VIC=y | ||
| 217 | CONFIG_ARM_VIC_NR=2 | ||
| 218 | CONFIG_COMMON_CLKDEV=y | ||
| 219 | |||
| 220 | # | ||
| 221 | # Bus support | ||
| 222 | # | ||
| 223 | CONFIG_ARM_AMBA=y | ||
| 224 | # CONFIG_PCI_SYSCALL is not set | ||
| 225 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
| 226 | # CONFIG_PCCARD is not set | ||
| 227 | |||
| 228 | # | ||
| 229 | # Kernel Features | ||
| 230 | # | ||
| 231 | # CONFIG_NO_HZ is not set | ||
| 232 | # CONFIG_HIGH_RES_TIMERS is not set | ||
| 233 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
| 234 | CONFIG_VMSPLIT_3G=y | ||
| 235 | # CONFIG_VMSPLIT_2G is not set | ||
| 236 | # CONFIG_VMSPLIT_1G is not set | ||
| 237 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
| 238 | CONFIG_PREEMPT_NONE=y | ||
| 239 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
| 240 | # CONFIG_PREEMPT is not set | ||
| 241 | CONFIG_HZ=100 | ||
| 242 | # CONFIG_AEABI is not set | ||
| 243 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
| 244 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
| 245 | # CONFIG_HIGHMEM is not set | ||
| 246 | CONFIG_SELECT_MEMORY_MODEL=y | ||
| 247 | CONFIG_FLATMEM_MANUAL=y | ||
| 248 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
| 249 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
| 250 | CONFIG_FLATMEM=y | ||
| 251 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
| 252 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
| 253 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
| 254 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
| 255 | CONFIG_ZONE_DMA_FLAG=0 | ||
| 256 | CONFIG_VIRT_TO_BUS=y | ||
| 257 | CONFIG_HAVE_MLOCK=y | ||
| 258 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
| 259 | # CONFIG_KSM is not set | ||
| 260 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
| 261 | CONFIG_ALIGNMENT_TRAP=y | ||
| 262 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
| 263 | |||
| 264 | # | ||
| 265 | # Boot options | ||
| 266 | # | ||
| 267 | CONFIG_ZBOOT_ROM_TEXT=0 | ||
| 268 | CONFIG_ZBOOT_ROM_BSS=0 | ||
| 269 | CONFIG_CMDLINE="" | ||
| 270 | # CONFIG_XIP_KERNEL is not set | ||
| 271 | # CONFIG_KEXEC is not set | ||
| 272 | |||
| 273 | # | ||
| 274 | # CPU Power Management | ||
| 275 | # | ||
| 276 | # CONFIG_CPU_IDLE is not set | ||
| 277 | |||
| 278 | # | ||
| 279 | # Floating point emulation | ||
| 280 | # | ||
| 281 | |||
| 282 | # | ||
| 283 | # At least one emulation must be selected | ||
| 284 | # | ||
| 285 | # CONFIG_FPE_NWFPE is not set | ||
| 286 | # CONFIG_FPE_FASTFPE is not set | ||
| 287 | # CONFIG_VFP is not set | ||
| 288 | |||
| 289 | # | ||
| 290 | # Userspace binary formats | ||
| 291 | # | ||
| 292 | CONFIG_BINFMT_ELF=y | ||
| 293 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
| 294 | CONFIG_HAVE_AOUT=y | ||
| 295 | # CONFIG_BINFMT_AOUT is not set | ||
| 296 | CONFIG_BINFMT_MISC=y | ||
| 297 | |||
| 298 | # | ||
| 299 | # Power management options | ||
| 300 | # | ||
| 301 | # CONFIG_PM is not set | ||
| 302 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
| 303 | # CONFIG_NET is not set | ||
| 304 | |||
| 305 | # | ||
| 306 | # Device Drivers | ||
| 307 | # | ||
| 308 | |||
| 309 | # | ||
| 310 | # Generic Driver Options | ||
| 311 | # | ||
| 312 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 313 | # CONFIG_DEVTMPFS is not set | ||
| 314 | CONFIG_STANDALONE=y | ||
| 315 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
| 316 | CONFIG_FW_LOADER=y | ||
| 317 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
| 318 | CONFIG_EXTRA_FIRMWARE="" | ||
| 319 | # CONFIG_DEBUG_DRIVER is not set | ||
| 320 | # CONFIG_DEBUG_DEVRES is not set | ||
| 321 | # CONFIG_SYS_HYPERVISOR is not set | ||
| 322 | # CONFIG_MTD is not set | ||
| 323 | # CONFIG_PARPORT is not set | ||
| 324 | CONFIG_BLK_DEV=y | ||
| 325 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
| 326 | # CONFIG_BLK_DEV_LOOP is not set | ||
| 327 | CONFIG_BLK_DEV_RAM=y | ||
| 328 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
| 329 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
| 330 | # CONFIG_BLK_DEV_XIP is not set | ||
| 331 | # CONFIG_CDROM_PKTCDVD is not set | ||
| 332 | CONFIG_MISC_DEVICES=y | ||
| 333 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
| 334 | # CONFIG_C2PORT is not set | ||
| 335 | |||
| 336 | # | ||
| 337 | # EEPROM support | ||
| 338 | # | ||
| 339 | # CONFIG_EEPROM_93CX6 is not set | ||
| 340 | CONFIG_HAVE_IDE=y | ||
| 341 | # CONFIG_IDE is not set | ||
| 342 | |||
| 343 | # | ||
| 344 | # SCSI device support | ||
| 345 | # | ||
| 346 | # CONFIG_RAID_ATTRS is not set | ||
| 347 | # CONFIG_SCSI is not set | ||
| 348 | # CONFIG_SCSI_DMA is not set | ||
| 349 | # CONFIG_SCSI_NETLINK is not set | ||
| 350 | # CONFIG_ATA is not set | ||
| 351 | # CONFIG_MD is not set | ||
| 352 | # CONFIG_PHONE is not set | ||
| 353 | |||
| 354 | # | ||
| 355 | # Input device support | ||
| 356 | # | ||
| 357 | CONFIG_INPUT=y | ||
| 358 | CONFIG_INPUT_FF_MEMLESS=y | ||
| 359 | # CONFIG_INPUT_POLLDEV is not set | ||
| 360 | |||
| 361 | # | ||
| 362 | # Userland interfaces | ||
| 363 | # | ||
| 364 | CONFIG_INPUT_MOUSEDEV=y | ||
| 365 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 366 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
| 367 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
| 368 | # CONFIG_INPUT_JOYDEV is not set | ||
| 369 | # CONFIG_INPUT_EVDEV is not set | ||
| 370 | # CONFIG_INPUT_EVBUG is not set | ||
| 371 | |||
| 372 | # | ||
| 373 | # Input Device Drivers | ||
| 374 | # | ||
| 375 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 376 | # CONFIG_INPUT_MOUSE is not set | ||
| 377 | # CONFIG_INPUT_JOYSTICK is not set | ||
| 378 | # CONFIG_INPUT_TABLET is not set | ||
| 379 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
| 380 | # CONFIG_INPUT_MISC is not set | ||
| 381 | |||
| 382 | # | ||
| 383 | # Hardware I/O ports | ||
| 384 | # | ||
| 385 | CONFIG_SERIO=y | ||
| 386 | CONFIG_SERIO_SERPORT=y | ||
| 387 | # CONFIG_SERIO_AMBAKMI is not set | ||
| 388 | # CONFIG_SERIO_RAW is not set | ||
| 389 | # CONFIG_GAMEPORT is not set | ||
| 390 | |||
| 391 | # | ||
| 392 | # Character devices | ||
| 393 | # | ||
| 394 | CONFIG_VT=y | ||
| 395 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
| 396 | CONFIG_VT_CONSOLE=y | ||
| 397 | CONFIG_HW_CONSOLE=y | ||
| 398 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
| 399 | CONFIG_DEVKMEM=y | ||
| 400 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
| 401 | |||
| 402 | # | ||
| 403 | # Serial drivers | ||
| 404 | # | ||
| 405 | # CONFIG_SERIAL_8250 is not set | ||
| 406 | |||
| 407 | # | ||
| 408 | # Non-8250 serial port support | ||
| 409 | # | ||
| 410 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
| 411 | CONFIG_SERIAL_AMBA_PL011=y | ||
| 412 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||
| 413 | CONFIG_SERIAL_CORE=y | ||
| 414 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
| 415 | CONFIG_UNIX98_PTYS=y | ||
| 416 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
| 417 | # CONFIG_LEGACY_PTYS is not set | ||
| 418 | # CONFIG_IPMI_HANDLER is not set | ||
| 419 | # CONFIG_HW_RANDOM is not set | ||
| 420 | # CONFIG_R3964 is not set | ||
| 421 | CONFIG_RAW_DRIVER=y | ||
| 422 | CONFIG_MAX_RAW_DEVS=8192 | ||
| 423 | # CONFIG_TCG_TPM is not set | ||
| 424 | # CONFIG_I2C is not set | ||
| 425 | # CONFIG_SPI is not set | ||
| 426 | |||
| 427 | # | ||
| 428 | # PPS support | ||
| 429 | # | ||
| 430 | # CONFIG_PPS is not set | ||
| 431 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
| 432 | CONFIG_GPIOLIB=y | ||
| 433 | # CONFIG_DEBUG_GPIO is not set | ||
| 434 | CONFIG_GPIO_SYSFS=y | ||
| 435 | |||
| 436 | # | ||
| 437 | # Memory mapped GPIO expanders: | ||
| 438 | # | ||
| 439 | CONFIG_GPIO_PL061=y | ||
| 440 | |||
| 441 | # | ||
| 442 | # I2C GPIO expanders: | ||
| 443 | # | ||
| 444 | |||
| 445 | # | ||
| 446 | # PCI GPIO expanders: | ||
| 447 | # | ||
| 448 | |||
| 449 | # | ||
| 450 | # SPI GPIO expanders: | ||
| 451 | # | ||
| 452 | |||
| 453 | # | ||
| 454 | # AC97 GPIO expanders: | ||
| 455 | # | ||
| 456 | # CONFIG_W1 is not set | ||
| 457 | # CONFIG_POWER_SUPPLY is not set | ||
| 458 | # CONFIG_HWMON is not set | ||
| 459 | # CONFIG_THERMAL is not set | ||
| 460 | # CONFIG_WATCHDOG is not set | ||
| 461 | CONFIG_SSB_POSSIBLE=y | ||
| 462 | |||
| 463 | # | ||
| 464 | # Sonics Silicon Backplane | ||
| 465 | # | ||
| 466 | # CONFIG_SSB is not set | ||
| 467 | |||
| 468 | # | ||
| 469 | # Multifunction device drivers | ||
| 470 | # | ||
| 471 | # CONFIG_MFD_CORE is not set | ||
| 472 | # CONFIG_MFD_SM501 is not set | ||
| 473 | # CONFIG_MFD_ASIC3 is not set | ||
| 474 | # CONFIG_HTC_EGPIO is not set | ||
| 475 | # CONFIG_HTC_PASIC3 is not set | ||
| 476 | # CONFIG_MFD_TMIO is not set | ||
| 477 | # CONFIG_MFD_T7L66XB is not set | ||
| 478 | # CONFIG_MFD_TC6387XB is not set | ||
| 479 | # CONFIG_MFD_TC6393XB is not set | ||
| 480 | # CONFIG_REGULATOR is not set | ||
| 481 | # CONFIG_MEDIA_SUPPORT is not set | ||
| 482 | |||
| 483 | # | ||
| 484 | # Graphics support | ||
| 485 | # | ||
| 486 | # CONFIG_VGASTATE is not set | ||
| 487 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
| 488 | # CONFIG_FB is not set | ||
| 489 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
| 490 | |||
| 491 | # | ||
| 492 | # Display device support | ||
| 493 | # | ||
| 494 | # CONFIG_DISPLAY_SUPPORT is not set | ||
| 495 | |||
| 496 | # | ||
| 497 | # Console display driver support | ||
| 498 | # | ||
| 499 | # CONFIG_VGA_CONSOLE is not set | ||
| 500 | CONFIG_DUMMY_CONSOLE=y | ||
| 501 | # CONFIG_SOUND is not set | ||
| 502 | # CONFIG_HID_SUPPORT is not set | ||
| 503 | # CONFIG_USB_SUPPORT is not set | ||
| 504 | # CONFIG_MMC is not set | ||
| 505 | # CONFIG_MEMSTICK is not set | ||
| 506 | # CONFIG_NEW_LEDS is not set | ||
| 507 | # CONFIG_ACCESSIBILITY is not set | ||
| 508 | CONFIG_RTC_LIB=y | ||
| 509 | # CONFIG_RTC_CLASS is not set | ||
| 510 | # CONFIG_DMADEVICES is not set | ||
| 511 | # CONFIG_AUXDISPLAY is not set | ||
| 512 | # CONFIG_UIO is not set | ||
| 513 | |||
| 514 | # | ||
| 515 | # TI VLYNQ | ||
| 516 | # | ||
| 517 | # CONFIG_STAGING is not set | ||
| 518 | |||
| 519 | # | ||
| 520 | # File systems | ||
| 521 | # | ||
| 522 | CONFIG_EXT2_FS=y | ||
| 523 | CONFIG_EXT2_FS_XATTR=y | ||
| 524 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
| 525 | CONFIG_EXT2_FS_SECURITY=y | ||
| 526 | # CONFIG_EXT2_FS_XIP is not set | ||
| 527 | CONFIG_EXT3_FS=y | ||
| 528 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
| 529 | CONFIG_EXT3_FS_XATTR=y | ||
| 530 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
| 531 | CONFIG_EXT3_FS_SECURITY=y | ||
| 532 | # CONFIG_EXT4_FS is not set | ||
| 533 | CONFIG_JBD=y | ||
| 534 | # CONFIG_JBD_DEBUG is not set | ||
| 535 | CONFIG_FS_MBCACHE=y | ||
| 536 | # CONFIG_REISERFS_FS is not set | ||
| 537 | # CONFIG_JFS_FS is not set | ||
| 538 | # CONFIG_FS_POSIX_ACL is not set | ||
| 539 | # CONFIG_XFS_FS is not set | ||
| 540 | # CONFIG_GFS2_FS is not set | ||
| 541 | # CONFIG_BTRFS_FS is not set | ||
| 542 | # CONFIG_NILFS2_FS is not set | ||
| 543 | CONFIG_FILE_LOCKING=y | ||
| 544 | CONFIG_FSNOTIFY=y | ||
| 545 | CONFIG_DNOTIFY=y | ||
| 546 | # CONFIG_INOTIFY is not set | ||
| 547 | CONFIG_INOTIFY_USER=y | ||
| 548 | # CONFIG_QUOTA is not set | ||
| 549 | # CONFIG_AUTOFS_FS is not set | ||
| 550 | CONFIG_AUTOFS4_FS=m | ||
| 551 | # CONFIG_FUSE_FS is not set | ||
| 552 | |||
| 553 | # | ||
| 554 | # Caches | ||
| 555 | # | ||
| 556 | # CONFIG_FSCACHE is not set | ||
| 557 | |||
| 558 | # | ||
| 559 | # CD-ROM/DVD Filesystems | ||
| 560 | # | ||
| 561 | # CONFIG_ISO9660_FS is not set | ||
| 562 | # CONFIG_UDF_FS is not set | ||
| 563 | |||
| 564 | # | ||
| 565 | # DOS/FAT/NT Filesystems | ||
| 566 | # | ||
| 567 | CONFIG_FAT_FS=m | ||
| 568 | CONFIG_MSDOS_FS=m | ||
| 569 | CONFIG_VFAT_FS=m | ||
| 570 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
| 571 | CONFIG_FAT_DEFAULT_IOCHARSET="ascii" | ||
| 572 | # CONFIG_NTFS_FS is not set | ||
| 573 | |||
| 574 | # | ||
| 575 | # Pseudo filesystems | ||
| 576 | # | ||
| 577 | CONFIG_PROC_FS=y | ||
| 578 | CONFIG_PROC_SYSCTL=y | ||
| 579 | CONFIG_PROC_PAGE_MONITOR=y | ||
| 580 | CONFIG_SYSFS=y | ||
| 581 | CONFIG_TMPFS=y | ||
| 582 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
| 583 | # CONFIG_HUGETLB_PAGE is not set | ||
| 584 | # CONFIG_CONFIGFS_FS is not set | ||
| 585 | CONFIG_MISC_FILESYSTEMS=y | ||
| 586 | # CONFIG_ADFS_FS is not set | ||
| 587 | # CONFIG_AFFS_FS is not set | ||
| 588 | # CONFIG_HFS_FS is not set | ||
| 589 | # CONFIG_HFSPLUS_FS is not set | ||
| 590 | # CONFIG_BEFS_FS is not set | ||
| 591 | # CONFIG_BFS_FS is not set | ||
| 592 | # CONFIG_EFS_FS is not set | ||
| 593 | # CONFIG_SQUASHFS is not set | ||
| 594 | # CONFIG_VXFS_FS is not set | ||
| 595 | # CONFIG_MINIX_FS is not set | ||
| 596 | # CONFIG_OMFS_FS is not set | ||
| 597 | # CONFIG_HPFS_FS is not set | ||
| 598 | # CONFIG_QNX4FS_FS is not set | ||
| 599 | # CONFIG_ROMFS_FS is not set | ||
| 600 | # CONFIG_SYSV_FS is not set | ||
| 601 | # CONFIG_UFS_FS is not set | ||
| 602 | |||
| 603 | # | ||
| 604 | # Partition Types | ||
| 605 | # | ||
| 606 | CONFIG_PARTITION_ADVANCED=y | ||
| 607 | # CONFIG_ACORN_PARTITION is not set | ||
| 608 | # CONFIG_OSF_PARTITION is not set | ||
| 609 | # CONFIG_AMIGA_PARTITION is not set | ||
| 610 | # CONFIG_ATARI_PARTITION is not set | ||
| 611 | # CONFIG_MAC_PARTITION is not set | ||
| 612 | CONFIG_MSDOS_PARTITION=y | ||
| 613 | # CONFIG_BSD_DISKLABEL is not set | ||
| 614 | # CONFIG_MINIX_SUBPARTITION is not set | ||
| 615 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
| 616 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
| 617 | # CONFIG_LDM_PARTITION is not set | ||
| 618 | # CONFIG_SGI_PARTITION is not set | ||
| 619 | # CONFIG_ULTRIX_PARTITION is not set | ||
| 620 | # CONFIG_SUN_PARTITION is not set | ||
| 621 | # CONFIG_KARMA_PARTITION is not set | ||
| 622 | # CONFIG_EFI_PARTITION is not set | ||
| 623 | # CONFIG_SYSV68_PARTITION is not set | ||
| 624 | CONFIG_NLS=y | ||
| 625 | CONFIG_NLS_DEFAULT="utf8" | ||
| 626 | CONFIG_NLS_CODEPAGE_437=y | ||
| 627 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
| 628 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
| 629 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
| 630 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
| 631 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
| 632 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
| 633 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
| 634 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
| 635 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
| 636 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
| 637 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
| 638 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
| 639 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
| 640 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
| 641 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
| 642 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
| 643 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
| 644 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
| 645 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
| 646 | # CONFIG_NLS_ISO8859_8 is not set | ||
| 647 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
| 648 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
| 649 | CONFIG_NLS_ASCII=m | ||
| 650 | # CONFIG_NLS_ISO8859_1 is not set | ||
| 651 | # CONFIG_NLS_ISO8859_2 is not set | ||
| 652 | # CONFIG_NLS_ISO8859_3 is not set | ||
| 653 | # CONFIG_NLS_ISO8859_4 is not set | ||
| 654 | # CONFIG_NLS_ISO8859_5 is not set | ||
| 655 | # CONFIG_NLS_ISO8859_6 is not set | ||
| 656 | # CONFIG_NLS_ISO8859_7 is not set | ||
| 657 | # CONFIG_NLS_ISO8859_9 is not set | ||
| 658 | # CONFIG_NLS_ISO8859_13 is not set | ||
| 659 | # CONFIG_NLS_ISO8859_14 is not set | ||
| 660 | # CONFIG_NLS_ISO8859_15 is not set | ||
| 661 | # CONFIG_NLS_KOI8_R is not set | ||
| 662 | # CONFIG_NLS_KOI8_U is not set | ||
| 663 | # CONFIG_NLS_UTF8 is not set | ||
| 664 | |||
| 665 | # | ||
| 666 | # Kernel hacking | ||
| 667 | # | ||
| 668 | # CONFIG_PRINTK_TIME is not set | ||
| 669 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
| 670 | CONFIG_ENABLE_MUST_CHECK=y | ||
| 671 | CONFIG_FRAME_WARN=1024 | ||
| 672 | CONFIG_MAGIC_SYSRQ=y | ||
| 673 | # CONFIG_STRIP_ASM_SYMS is not set | ||
| 674 | # CONFIG_UNUSED_SYMBOLS is not set | ||
| 675 | CONFIG_DEBUG_FS=y | ||
| 676 | # CONFIG_HEADERS_CHECK is not set | ||
| 677 | CONFIG_DEBUG_KERNEL=y | ||
| 678 | # CONFIG_DEBUG_SHIRQ is not set | ||
| 679 | CONFIG_DETECT_SOFTLOCKUP=y | ||
| 680 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
| 681 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
| 682 | CONFIG_DETECT_HUNG_TASK=y | ||
| 683 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
| 684 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
| 685 | CONFIG_SCHED_DEBUG=y | ||
| 686 | # CONFIG_SCHEDSTATS is not set | ||
| 687 | # CONFIG_TIMER_STATS is not set | ||
| 688 | # CONFIG_DEBUG_OBJECTS is not set | ||
| 689 | # CONFIG_SLUB_DEBUG_ON is not set | ||
| 690 | # CONFIG_SLUB_STATS is not set | ||
| 691 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
| 692 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
| 693 | # CONFIG_RT_MUTEX_TESTER is not set | ||
| 694 | CONFIG_DEBUG_SPINLOCK=y | ||
| 695 | # CONFIG_DEBUG_MUTEXES is not set | ||
| 696 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
| 697 | # CONFIG_PROVE_LOCKING is not set | ||
| 698 | # CONFIG_LOCK_STAT is not set | ||
| 699 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
| 700 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
| 701 | # CONFIG_DEBUG_KOBJECT is not set | ||
| 702 | CONFIG_DEBUG_BUGVERBOSE=y | ||
| 703 | CONFIG_DEBUG_INFO=y | ||
| 704 | # CONFIG_DEBUG_VM is not set | ||
| 705 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
| 706 | CONFIG_DEBUG_MEMORY_INIT=y | ||
| 707 | # CONFIG_DEBUG_LIST is not set | ||
| 708 | # CONFIG_DEBUG_SG is not set | ||
| 709 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
| 710 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
| 711 | CONFIG_FRAME_POINTER=y | ||
| 712 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
| 713 | # CONFIG_RCU_TORTURE_TEST is not set | ||
| 714 | CONFIG_RCU_CPU_STALL_DETECTOR=y | ||
| 715 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
| 716 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
| 717 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
| 718 | # CONFIG_FAULT_INJECTION is not set | ||
| 719 | # CONFIG_LATENCYTOP is not set | ||
| 720 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
| 721 | # CONFIG_PAGE_POISONING is not set | ||
| 722 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
| 723 | CONFIG_TRACING_SUPPORT=y | ||
| 724 | CONFIG_FTRACE=y | ||
| 725 | # CONFIG_FUNCTION_TRACER is not set | ||
| 726 | # CONFIG_IRQSOFF_TRACER is not set | ||
| 727 | # CONFIG_SCHED_TRACER is not set | ||
| 728 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
| 729 | # CONFIG_BOOT_TRACER is not set | ||
| 730 | CONFIG_BRANCH_PROFILE_NONE=y | ||
| 731 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
| 732 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
| 733 | # CONFIG_STACK_TRACER is not set | ||
| 734 | # CONFIG_KMEMTRACE is not set | ||
| 735 | # CONFIG_WORKQUEUE_TRACER is not set | ||
| 736 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
| 737 | # CONFIG_DYNAMIC_DEBUG is not set | ||
| 738 | # CONFIG_SAMPLES is not set | ||
| 739 | CONFIG_HAVE_ARCH_KGDB=y | ||
| 740 | # CONFIG_KGDB is not set | ||
| 741 | # CONFIG_DEBUG_USER is not set | ||
| 742 | # CONFIG_DEBUG_ERRORS is not set | ||
| 743 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
| 744 | # CONFIG_DEBUG_LL is not set | ||
| 745 | |||
| 746 | # | ||
| 747 | # Security options | ||
| 748 | # | ||
| 749 | # CONFIG_KEYS is not set | ||
| 750 | # CONFIG_SECURITY is not set | ||
| 751 | # CONFIG_SECURITYFS is not set | ||
| 752 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
| 753 | # CONFIG_CRYPTO is not set | ||
| 754 | # CONFIG_BINARY_PRINTF is not set | ||
| 755 | |||
| 756 | # | ||
| 757 | # Library routines | ||
| 758 | # | ||
| 759 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
| 760 | # CONFIG_CRC_CCITT is not set | ||
| 761 | # CONFIG_CRC16 is not set | ||
| 762 | # CONFIG_CRC_T10DIF is not set | ||
| 763 | # CONFIG_CRC_ITU_T is not set | ||
| 764 | # CONFIG_CRC32 is not set | ||
| 765 | # CONFIG_CRC7 is not set | ||
| 766 | # CONFIG_LIBCRC32C is not set | ||
| 767 | CONFIG_ZLIB_INFLATE=y | ||
| 768 | CONFIG_DECOMPRESS_GZIP=y | ||
| 769 | CONFIG_DECOMPRESS_BZIP2=y | ||
| 770 | CONFIG_DECOMPRESS_LZMA=y | ||
| 771 | CONFIG_HAS_IOMEM=y | ||
| 772 | CONFIG_HAS_IOPORT=y | ||
| 773 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/arm/configs/spear310_defconfig b/arch/arm/configs/spear310_defconfig new file mode 100644 index 000000000000..cbbfd290bba8 --- /dev/null +++ b/arch/arm/configs/spear310_defconfig | |||
| @@ -0,0 +1,775 @@ | |||
| 1 | # | ||
| 2 | # Automatically generated make config: don't edit | ||
| 3 | # Linux kernel version: 2.6.32 | ||
| 4 | # Tue Mar 23 14:37:01 2010 | ||
| 5 | # | ||
| 6 | CONFIG_ARM=y | ||
| 7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
| 8 | CONFIG_GENERIC_GPIO=y | ||
| 9 | CONFIG_GENERIC_TIME=y | ||
| 10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
| 11 | CONFIG_GENERIC_HARDIRQS=y | ||
| 12 | CONFIG_STACKTRACE_SUPPORT=y | ||
| 13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
| 14 | CONFIG_LOCKDEP_SUPPORT=y | ||
| 15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
| 16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
| 17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
| 18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
| 19 | CONFIG_GENERIC_HWEIGHT=y | ||
| 20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
| 21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
| 22 | CONFIG_VECTORS_BASE=0xffff0000 | ||
| 23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
| 24 | CONFIG_CONSTRUCTORS=y | ||
| 25 | |||
| 26 | # | ||
| 27 | # General setup | ||
| 28 | # | ||
| 29 | CONFIG_EXPERIMENTAL=y | ||
| 30 | CONFIG_BROKEN_ON_SMP=y | ||
| 31 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
| 32 | CONFIG_LOCALVERSION="" | ||
| 33 | CONFIG_LOCALVERSION_AUTO=y | ||
| 34 | CONFIG_SWAP=y | ||
| 35 | CONFIG_SYSVIPC=y | ||
| 36 | CONFIG_SYSVIPC_SYSCTL=y | ||
| 37 | CONFIG_BSD_PROCESS_ACCT=y | ||
| 38 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
| 39 | |||
| 40 | # | ||
| 41 | # RCU Subsystem | ||
| 42 | # | ||
| 43 | CONFIG_TREE_RCU=y | ||
| 44 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
| 45 | # CONFIG_RCU_TRACE is not set | ||
| 46 | CONFIG_RCU_FANOUT=32 | ||
| 47 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
| 48 | # CONFIG_TREE_RCU_TRACE is not set | ||
| 49 | # CONFIG_IKCONFIG is not set | ||
| 50 | CONFIG_LOG_BUF_SHIFT=17 | ||
| 51 | # CONFIG_GROUP_SCHED is not set | ||
| 52 | # CONFIG_CGROUPS is not set | ||
| 53 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
| 54 | # CONFIG_RELAY is not set | ||
| 55 | CONFIG_NAMESPACES=y | ||
| 56 | # CONFIG_UTS_NS is not set | ||
| 57 | # CONFIG_IPC_NS is not set | ||
| 58 | # CONFIG_USER_NS is not set | ||
| 59 | # CONFIG_PID_NS is not set | ||
| 60 | CONFIG_BLK_DEV_INITRD=y | ||
| 61 | CONFIG_INITRAMFS_SOURCE="" | ||
| 62 | CONFIG_RD_GZIP=y | ||
| 63 | CONFIG_RD_BZIP2=y | ||
| 64 | CONFIG_RD_LZMA=y | ||
| 65 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
| 66 | CONFIG_SYSCTL=y | ||
| 67 | CONFIG_ANON_INODES=y | ||
| 68 | # CONFIG_EMBEDDED is not set | ||
| 69 | CONFIG_UID16=y | ||
| 70 | CONFIG_SYSCTL_SYSCALL=y | ||
| 71 | CONFIG_KALLSYMS=y | ||
| 72 | # CONFIG_KALLSYMS_ALL is not set | ||
| 73 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
| 74 | CONFIG_HOTPLUG=y | ||
| 75 | CONFIG_PRINTK=y | ||
| 76 | CONFIG_BUG=y | ||
| 77 | CONFIG_ELF_CORE=y | ||
| 78 | CONFIG_BASE_FULL=y | ||
| 79 | CONFIG_FUTEX=y | ||
| 80 | CONFIG_EPOLL=y | ||
| 81 | CONFIG_SIGNALFD=y | ||
| 82 | CONFIG_TIMERFD=y | ||
| 83 | CONFIG_EVENTFD=y | ||
| 84 | CONFIG_SHMEM=y | ||
| 85 | CONFIG_AIO=y | ||
| 86 | |||
| 87 | # | ||
| 88 | # Kernel Performance Events And Counters | ||
| 89 | # | ||
| 90 | CONFIG_VM_EVENT_COUNTERS=y | ||
| 91 | CONFIG_SLUB_DEBUG=y | ||
| 92 | CONFIG_COMPAT_BRK=y | ||
| 93 | # CONFIG_SLAB is not set | ||
| 94 | CONFIG_SLUB=y | ||
| 95 | # CONFIG_SLOB is not set | ||
| 96 | # CONFIG_PROFILING is not set | ||
| 97 | CONFIG_HAVE_OPROFILE=y | ||
| 98 | # CONFIG_KPROBES is not set | ||
| 99 | CONFIG_HAVE_KPROBES=y | ||
| 100 | CONFIG_HAVE_KRETPROBES=y | ||
| 101 | CONFIG_HAVE_CLK=y | ||
| 102 | |||
| 103 | # | ||
| 104 | # GCOV-based kernel profiling | ||
| 105 | # | ||
| 106 | # CONFIG_GCOV_KERNEL is not set | ||
| 107 | # CONFIG_SLOW_WORK is not set | ||
| 108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
| 109 | CONFIG_SLABINFO=y | ||
| 110 | CONFIG_RT_MUTEXES=y | ||
| 111 | CONFIG_BASE_SMALL=0 | ||
| 112 | CONFIG_MODULES=y | ||
| 113 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
| 114 | CONFIG_MODULE_UNLOAD=y | ||
| 115 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
| 116 | CONFIG_MODVERSIONS=y | ||
| 117 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
| 118 | CONFIG_BLOCK=y | ||
| 119 | CONFIG_LBDAF=y | ||
| 120 | CONFIG_BLK_DEV_BSG=y | ||
| 121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
| 122 | |||
| 123 | # | ||
| 124 | # IO Schedulers | ||
| 125 | # | ||
| 126 | CONFIG_IOSCHED_NOOP=y | ||
| 127 | CONFIG_IOSCHED_AS=y | ||
| 128 | CONFIG_IOSCHED_DEADLINE=y | ||
| 129 | CONFIG_IOSCHED_CFQ=y | ||
| 130 | # CONFIG_DEFAULT_AS is not set | ||
| 131 | # CONFIG_DEFAULT_DEADLINE is not set | ||
| 132 | CONFIG_DEFAULT_CFQ=y | ||
| 133 | # CONFIG_DEFAULT_NOOP is not set | ||
| 134 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
| 135 | # CONFIG_FREEZER is not set | ||
| 136 | |||
| 137 | # | ||
| 138 | # System Type | ||
| 139 | # | ||
| 140 | CONFIG_MMU=y | ||
| 141 | # CONFIG_ARCH_AAEC2000 is not set | ||
| 142 | # CONFIG_ARCH_INTEGRATOR is not set | ||
| 143 | # CONFIG_ARCH_REALVIEW is not set | ||
| 144 | # CONFIG_ARCH_VERSATILE is not set | ||
| 145 | # CONFIG_ARCH_AT91 is not set | ||
| 146 | # CONFIG_ARCH_CLPS711X is not set | ||
| 147 | # CONFIG_ARCH_GEMINI is not set | ||
| 148 | # CONFIG_ARCH_EBSA110 is not set | ||
| 149 | # CONFIG_ARCH_EP93XX is not set | ||
| 150 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
| 151 | # CONFIG_ARCH_MXC is not set | ||
| 152 | # CONFIG_ARCH_STMP3XXX is not set | ||
| 153 | # CONFIG_ARCH_NETX is not set | ||
| 154 | # CONFIG_ARCH_H720X is not set | ||
| 155 | # CONFIG_ARCH_NOMADIK is not set | ||
| 156 | # CONFIG_ARCH_IOP13XX is not set | ||
| 157 | # CONFIG_ARCH_IOP32X is not set | ||
| 158 | # CONFIG_ARCH_IOP33X is not set | ||
| 159 | # CONFIG_ARCH_IXP23XX is not set | ||
| 160 | # CONFIG_ARCH_IXP2000 is not set | ||
| 161 | # CONFIG_ARCH_IXP4XX is not set | ||
| 162 | # CONFIG_ARCH_L7200 is not set | ||
| 163 | # CONFIG_ARCH_KIRKWOOD is not set | ||
| 164 | # CONFIG_ARCH_LOKI is not set | ||
| 165 | # CONFIG_ARCH_MV78XX0 is not set | ||
| 166 | # CONFIG_ARCH_ORION5X is not set | ||
| 167 | # CONFIG_ARCH_MMP is not set | ||
| 168 | # CONFIG_ARCH_KS8695 is not set | ||
| 169 | # CONFIG_ARCH_NS9XXX is not set | ||
| 170 | # CONFIG_ARCH_W90X900 is not set | ||
| 171 | # CONFIG_ARCH_PNX4008 is not set | ||
| 172 | # CONFIG_ARCH_PXA is not set | ||
| 173 | # CONFIG_ARCH_MSM is not set | ||
| 174 | # CONFIG_ARCH_RPC is not set | ||
| 175 | # CONFIG_ARCH_SA1100 is not set | ||
| 176 | # CONFIG_ARCH_S3C2410 is not set | ||
| 177 | # CONFIG_ARCH_S3C64XX is not set | ||
| 178 | # CONFIG_ARCH_S5PC1XX is not set | ||
| 179 | # CONFIG_ARCH_SHARK is not set | ||
| 180 | # CONFIG_ARCH_LH7A40X is not set | ||
| 181 | # CONFIG_ARCH_U300 is not set | ||
| 182 | # CONFIG_ARCH_DAVINCI is not set | ||
| 183 | # CONFIG_ARCH_OMAP is not set | ||
| 184 | # CONFIG_ARCH_BCMRING is not set | ||
| 185 | CONFIG_PLAT_SPEAR=y | ||
| 186 | CONFIG_ARCH_SPEAR3XX=y | ||
| 187 | # CONFIG_ARCH_SPEAR6XX is not set | ||
| 188 | # CONFIG_MACH_SPEAR300 is not set | ||
| 189 | CONFIG_MACH_SPEAR310=y | ||
| 190 | # CONFIG_MACH_SPEAR320 is not set | ||
| 191 | # CONFIG_BOARD_SPEAR300_EVB is not set | ||
| 192 | CONFIG_BOARD_SPEAR310_EVB=y | ||
| 193 | |||
| 194 | # | ||
| 195 | # Processor Type | ||
| 196 | # | ||
| 197 | CONFIG_CPU_32=y | ||
| 198 | CONFIG_CPU_ARM926T=y | ||
| 199 | CONFIG_CPU_32v5=y | ||
| 200 | CONFIG_CPU_ABRT_EV5TJ=y | ||
| 201 | CONFIG_CPU_PABRT_LEGACY=y | ||
| 202 | CONFIG_CPU_CACHE_VIVT=y | ||
| 203 | CONFIG_CPU_COPY_V4WB=y | ||
| 204 | CONFIG_CPU_TLB_V4WBI=y | ||
| 205 | CONFIG_CPU_CP15=y | ||
| 206 | CONFIG_CPU_CP15_MMU=y | ||
| 207 | |||
| 208 | # | ||
| 209 | # Processor Features | ||
| 210 | # | ||
| 211 | CONFIG_ARM_THUMB=y | ||
| 212 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
| 213 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
| 214 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
| 215 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
| 216 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
| 217 | CONFIG_ARM_VIC=y | ||
| 218 | CONFIG_ARM_VIC_NR=2 | ||
| 219 | CONFIG_COMMON_CLKDEV=y | ||
| 220 | |||
| 221 | # | ||
| 222 | # Bus support | ||
| 223 | # | ||
| 224 | CONFIG_ARM_AMBA=y | ||
| 225 | # CONFIG_PCI_SYSCALL is not set | ||
| 226 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
| 227 | # CONFIG_PCCARD is not set | ||
| 228 | |||
| 229 | # | ||
| 230 | # Kernel Features | ||
| 231 | # | ||
| 232 | # CONFIG_NO_HZ is not set | ||
| 233 | # CONFIG_HIGH_RES_TIMERS is not set | ||
| 234 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
| 235 | CONFIG_VMSPLIT_3G=y | ||
| 236 | # CONFIG_VMSPLIT_2G is not set | ||
| 237 | # CONFIG_VMSPLIT_1G is not set | ||
| 238 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
| 239 | CONFIG_PREEMPT_NONE=y | ||
| 240 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
| 241 | # CONFIG_PREEMPT is not set | ||
| 242 | CONFIG_HZ=100 | ||
| 243 | # CONFIG_AEABI is not set | ||
| 244 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
| 245 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
| 246 | # CONFIG_HIGHMEM is not set | ||
| 247 | CONFIG_SELECT_MEMORY_MODEL=y | ||
| 248 | CONFIG_FLATMEM_MANUAL=y | ||
| 249 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
| 250 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
| 251 | CONFIG_FLATMEM=y | ||
| 252 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
| 253 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
| 254 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
| 255 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
| 256 | CONFIG_ZONE_DMA_FLAG=0 | ||
| 257 | CONFIG_VIRT_TO_BUS=y | ||
| 258 | CONFIG_HAVE_MLOCK=y | ||
| 259 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
| 260 | # CONFIG_KSM is not set | ||
| 261 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
| 262 | CONFIG_ALIGNMENT_TRAP=y | ||
| 263 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
| 264 | |||
| 265 | # | ||
| 266 | # Boot options | ||
| 267 | # | ||
| 268 | CONFIG_ZBOOT_ROM_TEXT=0 | ||
| 269 | CONFIG_ZBOOT_ROM_BSS=0 | ||
| 270 | CONFIG_CMDLINE="" | ||
| 271 | # CONFIG_XIP_KERNEL is not set | ||
| 272 | # CONFIG_KEXEC is not set | ||
| 273 | |||
| 274 | # | ||
| 275 | # CPU Power Management | ||
| 276 | # | ||
| 277 | # CONFIG_CPU_IDLE is not set | ||
| 278 | |||
| 279 | # | ||
| 280 | # Floating point emulation | ||
| 281 | # | ||
| 282 | |||
| 283 | # | ||
| 284 | # At least one emulation must be selected | ||
| 285 | # | ||
| 286 | # CONFIG_FPE_NWFPE is not set | ||
| 287 | # CONFIG_FPE_FASTFPE is not set | ||
| 288 | # CONFIG_VFP is not set | ||
| 289 | |||
| 290 | # | ||
| 291 | # Userspace binary formats | ||
| 292 | # | ||
| 293 | CONFIG_BINFMT_ELF=y | ||
| 294 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
| 295 | CONFIG_HAVE_AOUT=y | ||
| 296 | # CONFIG_BINFMT_AOUT is not set | ||
| 297 | CONFIG_BINFMT_MISC=y | ||
| 298 | |||
| 299 | # | ||
| 300 | # Power management options | ||
| 301 | # | ||
| 302 | # CONFIG_PM is not set | ||
| 303 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
| 304 | # CONFIG_NET is not set | ||
| 305 | |||
| 306 | # | ||
| 307 | # Device Drivers | ||
| 308 | # | ||
| 309 | |||
| 310 | # | ||
| 311 | # Generic Driver Options | ||
| 312 | # | ||
| 313 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 314 | # CONFIG_DEVTMPFS is not set | ||
| 315 | CONFIG_STANDALONE=y | ||
| 316 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
| 317 | CONFIG_FW_LOADER=y | ||
| 318 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
| 319 | CONFIG_EXTRA_FIRMWARE="" | ||
| 320 | # CONFIG_DEBUG_DRIVER is not set | ||
| 321 | # CONFIG_DEBUG_DEVRES is not set | ||
| 322 | # CONFIG_SYS_HYPERVISOR is not set | ||
| 323 | # CONFIG_MTD is not set | ||
| 324 | # CONFIG_PARPORT is not set | ||
| 325 | CONFIG_BLK_DEV=y | ||
| 326 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
| 327 | # CONFIG_BLK_DEV_LOOP is not set | ||
| 328 | CONFIG_BLK_DEV_RAM=y | ||
| 329 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
| 330 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
| 331 | # CONFIG_BLK_DEV_XIP is not set | ||
| 332 | # CONFIG_CDROM_PKTCDVD is not set | ||
| 333 | # CONFIG_MG_DISK is not set | ||
| 334 | CONFIG_MISC_DEVICES=y | ||
| 335 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
| 336 | # CONFIG_C2PORT is not set | ||
| 337 | |||
| 338 | # | ||
| 339 | # EEPROM support | ||
| 340 | # | ||
| 341 | # CONFIG_EEPROM_93CX6 is not set | ||
| 342 | CONFIG_HAVE_IDE=y | ||
| 343 | # CONFIG_IDE is not set | ||
| 344 | |||
| 345 | # | ||
| 346 | # SCSI device support | ||
| 347 | # | ||
| 348 | # CONFIG_RAID_ATTRS is not set | ||
| 349 | # CONFIG_SCSI is not set | ||
| 350 | # CONFIG_SCSI_DMA is not set | ||
| 351 | # CONFIG_SCSI_NETLINK is not set | ||
| 352 | # CONFIG_ATA is not set | ||
| 353 | # CONFIG_MD is not set | ||
| 354 | # CONFIG_PHONE is not set | ||
| 355 | |||
| 356 | # | ||
| 357 | # Input device support | ||
| 358 | # | ||
| 359 | CONFIG_INPUT=y | ||
| 360 | CONFIG_INPUT_FF_MEMLESS=y | ||
| 361 | # CONFIG_INPUT_POLLDEV is not set | ||
| 362 | |||
| 363 | # | ||
| 364 | # Userland interfaces | ||
| 365 | # | ||
| 366 | CONFIG_INPUT_MOUSEDEV=y | ||
| 367 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 368 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
| 369 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
| 370 | # CONFIG_INPUT_JOYDEV is not set | ||
| 371 | # CONFIG_INPUT_EVDEV is not set | ||
| 372 | # CONFIG_INPUT_EVBUG is not set | ||
| 373 | |||
| 374 | # | ||
| 375 | # Input Device Drivers | ||
| 376 | # | ||
| 377 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 378 | # CONFIG_INPUT_MOUSE is not set | ||
| 379 | # CONFIG_INPUT_JOYSTICK is not set | ||
| 380 | # CONFIG_INPUT_TABLET is not set | ||
| 381 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
| 382 | # CONFIG_INPUT_MISC is not set | ||
| 383 | |||
| 384 | # | ||
| 385 | # Hardware I/O ports | ||
| 386 | # | ||
| 387 | CONFIG_SERIO=y | ||
| 388 | CONFIG_SERIO_SERPORT=y | ||
| 389 | # CONFIG_SERIO_AMBAKMI is not set | ||
| 390 | # CONFIG_SERIO_RAW is not set | ||
| 391 | # CONFIG_GAMEPORT is not set | ||
| 392 | |||
| 393 | # | ||
| 394 | # Character devices | ||
| 395 | # | ||
| 396 | CONFIG_VT=y | ||
| 397 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
| 398 | CONFIG_VT_CONSOLE=y | ||
| 399 | CONFIG_HW_CONSOLE=y | ||
| 400 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
| 401 | CONFIG_DEVKMEM=y | ||
| 402 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
| 403 | |||
| 404 | # | ||
| 405 | # Serial drivers | ||
| 406 | # | ||
| 407 | # CONFIG_SERIAL_8250 is not set | ||
| 408 | |||
| 409 | # | ||
| 410 | # Non-8250 serial port support | ||
| 411 | # | ||
| 412 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
| 413 | CONFIG_SERIAL_AMBA_PL011=y | ||
| 414 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||
| 415 | CONFIG_SERIAL_CORE=y | ||
| 416 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
| 417 | CONFIG_UNIX98_PTYS=y | ||
| 418 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
| 419 | # CONFIG_LEGACY_PTYS is not set | ||
| 420 | # CONFIG_IPMI_HANDLER is not set | ||
| 421 | # CONFIG_HW_RANDOM is not set | ||
| 422 | # CONFIG_R3964 is not set | ||
| 423 | CONFIG_RAW_DRIVER=y | ||
| 424 | CONFIG_MAX_RAW_DEVS=8192 | ||
| 425 | # CONFIG_TCG_TPM is not set | ||
| 426 | # CONFIG_I2C is not set | ||
| 427 | # CONFIG_SPI is not set | ||
| 428 | |||
| 429 | # | ||
| 430 | # PPS support | ||
| 431 | # | ||
| 432 | # CONFIG_PPS is not set | ||
| 433 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
| 434 | CONFIG_GPIOLIB=y | ||
| 435 | # CONFIG_DEBUG_GPIO is not set | ||
| 436 | CONFIG_GPIO_SYSFS=y | ||
| 437 | |||
| 438 | # | ||
| 439 | # Memory mapped GPIO expanders: | ||
| 440 | # | ||
| 441 | CONFIG_GPIO_PL061=y | ||
| 442 | |||
| 443 | # | ||
| 444 | # I2C GPIO expanders: | ||
| 445 | # | ||
| 446 | |||
| 447 | # | ||
| 448 | # PCI GPIO expanders: | ||
| 449 | # | ||
| 450 | |||
| 451 | # | ||
| 452 | # SPI GPIO expanders: | ||
| 453 | # | ||
| 454 | |||
| 455 | # | ||
| 456 | # AC97 GPIO expanders: | ||
| 457 | # | ||
| 458 | # CONFIG_W1 is not set | ||
| 459 | # CONFIG_POWER_SUPPLY is not set | ||
| 460 | # CONFIG_HWMON is not set | ||
| 461 | # CONFIG_THERMAL is not set | ||
| 462 | # CONFIG_WATCHDOG is not set | ||
| 463 | CONFIG_SSB_POSSIBLE=y | ||
| 464 | |||
| 465 | # | ||
| 466 | # Sonics Silicon Backplane | ||
| 467 | # | ||
| 468 | # CONFIG_SSB is not set | ||
| 469 | |||
| 470 | # | ||
| 471 | # Multifunction device drivers | ||
| 472 | # | ||
| 473 | # CONFIG_MFD_CORE is not set | ||
| 474 | # CONFIG_MFD_SM501 is not set | ||
| 475 | # CONFIG_MFD_ASIC3 is not set | ||
| 476 | # CONFIG_HTC_EGPIO is not set | ||
| 477 | # CONFIG_HTC_PASIC3 is not set | ||
| 478 | # CONFIG_MFD_TMIO is not set | ||
| 479 | # CONFIG_MFD_T7L66XB is not set | ||
| 480 | # CONFIG_MFD_TC6387XB is not set | ||
| 481 | # CONFIG_MFD_TC6393XB is not set | ||
| 482 | # CONFIG_REGULATOR is not set | ||
| 483 | # CONFIG_MEDIA_SUPPORT is not set | ||
| 484 | |||
| 485 | # | ||
| 486 | # Graphics support | ||
| 487 | # | ||
| 488 | # CONFIG_VGASTATE is not set | ||
| 489 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
| 490 | # CONFIG_FB is not set | ||
| 491 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
| 492 | |||
| 493 | # | ||
| 494 | # Display device support | ||
| 495 | # | ||
| 496 | # CONFIG_DISPLAY_SUPPORT is not set | ||
| 497 | |||
| 498 | # | ||
| 499 | # Console display driver support | ||
| 500 | # | ||
| 501 | # CONFIG_VGA_CONSOLE is not set | ||
| 502 | CONFIG_DUMMY_CONSOLE=y | ||
| 503 | # CONFIG_SOUND is not set | ||
| 504 | # CONFIG_HID_SUPPORT is not set | ||
| 505 | # CONFIG_USB_SUPPORT is not set | ||
| 506 | # CONFIG_MMC is not set | ||
| 507 | # CONFIG_MEMSTICK is not set | ||
| 508 | # CONFIG_NEW_LEDS is not set | ||
| 509 | # CONFIG_ACCESSIBILITY is not set | ||
| 510 | CONFIG_RTC_LIB=y | ||
| 511 | # CONFIG_RTC_CLASS is not set | ||
| 512 | # CONFIG_DMADEVICES is not set | ||
| 513 | # CONFIG_AUXDISPLAY is not set | ||
| 514 | # CONFIG_UIO is not set | ||
| 515 | |||
| 516 | # | ||
| 517 | # TI VLYNQ | ||
| 518 | # | ||
| 519 | # CONFIG_STAGING is not set | ||
| 520 | |||
| 521 | # | ||
| 522 | # File systems | ||
| 523 | # | ||
| 524 | CONFIG_EXT2_FS=y | ||
| 525 | CONFIG_EXT2_FS_XATTR=y | ||
| 526 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
| 527 | CONFIG_EXT2_FS_SECURITY=y | ||
| 528 | # CONFIG_EXT2_FS_XIP is not set | ||
| 529 | CONFIG_EXT3_FS=y | ||
| 530 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
| 531 | CONFIG_EXT3_FS_XATTR=y | ||
| 532 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
| 533 | CONFIG_EXT3_FS_SECURITY=y | ||
| 534 | # CONFIG_EXT4_FS is not set | ||
| 535 | CONFIG_JBD=y | ||
| 536 | # CONFIG_JBD_DEBUG is not set | ||
| 537 | CONFIG_FS_MBCACHE=y | ||
| 538 | # CONFIG_REISERFS_FS is not set | ||
| 539 | # CONFIG_JFS_FS is not set | ||
| 540 | # CONFIG_FS_POSIX_ACL is not set | ||
| 541 | # CONFIG_XFS_FS is not set | ||
| 542 | # CONFIG_GFS2_FS is not set | ||
| 543 | # CONFIG_BTRFS_FS is not set | ||
| 544 | # CONFIG_NILFS2_FS is not set | ||
| 545 | CONFIG_FILE_LOCKING=y | ||
| 546 | CONFIG_FSNOTIFY=y | ||
| 547 | CONFIG_DNOTIFY=y | ||
| 548 | # CONFIG_INOTIFY is not set | ||
| 549 | CONFIG_INOTIFY_USER=y | ||
| 550 | # CONFIG_QUOTA is not set | ||
| 551 | # CONFIG_AUTOFS_FS is not set | ||
| 552 | CONFIG_AUTOFS4_FS=m | ||
| 553 | # CONFIG_FUSE_FS is not set | ||
| 554 | |||
| 555 | # | ||
| 556 | # Caches | ||
| 557 | # | ||
| 558 | # CONFIG_FSCACHE is not set | ||
| 559 | |||
| 560 | # | ||
| 561 | # CD-ROM/DVD Filesystems | ||
| 562 | # | ||
| 563 | # CONFIG_ISO9660_FS is not set | ||
| 564 | # CONFIG_UDF_FS is not set | ||
| 565 | |||
| 566 | # | ||
| 567 | # DOS/FAT/NT Filesystems | ||
| 568 | # | ||
| 569 | CONFIG_FAT_FS=m | ||
| 570 | CONFIG_MSDOS_FS=m | ||
| 571 | CONFIG_VFAT_FS=m | ||
| 572 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
| 573 | CONFIG_FAT_DEFAULT_IOCHARSET="ascii" | ||
| 574 | # CONFIG_NTFS_FS is not set | ||
| 575 | |||
| 576 | # | ||
| 577 | # Pseudo filesystems | ||
| 578 | # | ||
| 579 | CONFIG_PROC_FS=y | ||
| 580 | CONFIG_PROC_SYSCTL=y | ||
| 581 | CONFIG_PROC_PAGE_MONITOR=y | ||
| 582 | CONFIG_SYSFS=y | ||
| 583 | CONFIG_TMPFS=y | ||
| 584 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
| 585 | # CONFIG_HUGETLB_PAGE is not set | ||
| 586 | # CONFIG_CONFIGFS_FS is not set | ||
| 587 | CONFIG_MISC_FILESYSTEMS=y | ||
| 588 | # CONFIG_ADFS_FS is not set | ||
| 589 | # CONFIG_AFFS_FS is not set | ||
| 590 | # CONFIG_HFS_FS is not set | ||
| 591 | # CONFIG_HFSPLUS_FS is not set | ||
| 592 | # CONFIG_BEFS_FS is not set | ||
| 593 | # CONFIG_BFS_FS is not set | ||
| 594 | # CONFIG_EFS_FS is not set | ||
| 595 | # CONFIG_SQUASHFS is not set | ||
| 596 | # CONFIG_VXFS_FS is not set | ||
| 597 | # CONFIG_MINIX_FS is not set | ||
| 598 | # CONFIG_OMFS_FS is not set | ||
| 599 | # CONFIG_HPFS_FS is not set | ||
| 600 | # CONFIG_QNX4FS_FS is not set | ||
| 601 | # CONFIG_ROMFS_FS is not set | ||
| 602 | # CONFIG_SYSV_FS is not set | ||
| 603 | # CONFIG_UFS_FS is not set | ||
| 604 | |||
| 605 | # | ||
| 606 | # Partition Types | ||
| 607 | # | ||
| 608 | CONFIG_PARTITION_ADVANCED=y | ||
| 609 | # CONFIG_ACORN_PARTITION is not set | ||
| 610 | # CONFIG_OSF_PARTITION is not set | ||
| 611 | # CONFIG_AMIGA_PARTITION is not set | ||
| 612 | # CONFIG_ATARI_PARTITION is not set | ||
| 613 | # CONFIG_MAC_PARTITION is not set | ||
| 614 | CONFIG_MSDOS_PARTITION=y | ||
| 615 | # CONFIG_BSD_DISKLABEL is not set | ||
| 616 | # CONFIG_MINIX_SUBPARTITION is not set | ||
| 617 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
| 618 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
| 619 | # CONFIG_LDM_PARTITION is not set | ||
| 620 | # CONFIG_SGI_PARTITION is not set | ||
| 621 | # CONFIG_ULTRIX_PARTITION is not set | ||
| 622 | # CONFIG_SUN_PARTITION is not set | ||
| 623 | # CONFIG_KARMA_PARTITION is not set | ||
| 624 | # CONFIG_EFI_PARTITION is not set | ||
| 625 | # CONFIG_SYSV68_PARTITION is not set | ||
| 626 | CONFIG_NLS=y | ||
| 627 | CONFIG_NLS_DEFAULT="utf8" | ||
| 628 | CONFIG_NLS_CODEPAGE_437=y | ||
| 629 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
| 630 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
| 631 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
| 632 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
| 633 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
| 634 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
| 635 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
| 636 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
| 637 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
| 638 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
| 639 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
| 640 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
| 641 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
| 642 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
| 643 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
| 644 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
| 645 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
| 646 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
| 647 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
| 648 | # CONFIG_NLS_ISO8859_8 is not set | ||
| 649 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
| 650 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
| 651 | CONFIG_NLS_ASCII=m | ||
| 652 | # CONFIG_NLS_ISO8859_1 is not set | ||
| 653 | # CONFIG_NLS_ISO8859_2 is not set | ||
| 654 | # CONFIG_NLS_ISO8859_3 is not set | ||
| 655 | # CONFIG_NLS_ISO8859_4 is not set | ||
| 656 | # CONFIG_NLS_ISO8859_5 is not set | ||
| 657 | # CONFIG_NLS_ISO8859_6 is not set | ||
| 658 | # CONFIG_NLS_ISO8859_7 is not set | ||
| 659 | # CONFIG_NLS_ISO8859_9 is not set | ||
| 660 | # CONFIG_NLS_ISO8859_13 is not set | ||
| 661 | # CONFIG_NLS_ISO8859_14 is not set | ||
| 662 | # CONFIG_NLS_ISO8859_15 is not set | ||
| 663 | # CONFIG_NLS_KOI8_R is not set | ||
| 664 | # CONFIG_NLS_KOI8_U is not set | ||
| 665 | # CONFIG_NLS_UTF8 is not set | ||
| 666 | |||
| 667 | # | ||
| 668 | # Kernel hacking | ||
| 669 | # | ||
| 670 | # CONFIG_PRINTK_TIME is not set | ||
| 671 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
| 672 | CONFIG_ENABLE_MUST_CHECK=y | ||
| 673 | CONFIG_FRAME_WARN=1024 | ||
| 674 | CONFIG_MAGIC_SYSRQ=y | ||
| 675 | # CONFIG_STRIP_ASM_SYMS is not set | ||
| 676 | # CONFIG_UNUSED_SYMBOLS is not set | ||
| 677 | CONFIG_DEBUG_FS=y | ||
| 678 | # CONFIG_HEADERS_CHECK is not set | ||
| 679 | CONFIG_DEBUG_KERNEL=y | ||
| 680 | # CONFIG_DEBUG_SHIRQ is not set | ||
| 681 | CONFIG_DETECT_SOFTLOCKUP=y | ||
| 682 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
| 683 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
| 684 | CONFIG_DETECT_HUNG_TASK=y | ||
| 685 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
| 686 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
| 687 | CONFIG_SCHED_DEBUG=y | ||
| 688 | # CONFIG_SCHEDSTATS is not set | ||
| 689 | # CONFIG_TIMER_STATS is not set | ||
| 690 | # CONFIG_DEBUG_OBJECTS is not set | ||
| 691 | # CONFIG_SLUB_DEBUG_ON is not set | ||
| 692 | # CONFIG_SLUB_STATS is not set | ||
| 693 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
| 694 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
| 695 | # CONFIG_RT_MUTEX_TESTER is not set | ||
| 696 | CONFIG_DEBUG_SPINLOCK=y | ||
| 697 | # CONFIG_DEBUG_MUTEXES is not set | ||
| 698 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
| 699 | # CONFIG_PROVE_LOCKING is not set | ||
| 700 | # CONFIG_LOCK_STAT is not set | ||
| 701 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
| 702 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
| 703 | # CONFIG_DEBUG_KOBJECT is not set | ||
| 704 | CONFIG_DEBUG_BUGVERBOSE=y | ||
| 705 | CONFIG_DEBUG_INFO=y | ||
| 706 | # CONFIG_DEBUG_VM is not set | ||
| 707 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
| 708 | CONFIG_DEBUG_MEMORY_INIT=y | ||
| 709 | # CONFIG_DEBUG_LIST is not set | ||
| 710 | # CONFIG_DEBUG_SG is not set | ||
| 711 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
| 712 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
| 713 | CONFIG_FRAME_POINTER=y | ||
| 714 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
| 715 | # CONFIG_RCU_TORTURE_TEST is not set | ||
| 716 | CONFIG_RCU_CPU_STALL_DETECTOR=y | ||
| 717 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
| 718 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
| 719 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
| 720 | # CONFIG_FAULT_INJECTION is not set | ||
| 721 | # CONFIG_LATENCYTOP is not set | ||
| 722 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
| 723 | # CONFIG_PAGE_POISONING is not set | ||
| 724 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
| 725 | CONFIG_TRACING_SUPPORT=y | ||
| 726 | CONFIG_FTRACE=y | ||
| 727 | # CONFIG_FUNCTION_TRACER is not set | ||
| 728 | # CONFIG_IRQSOFF_TRACER is not set | ||
| 729 | # CONFIG_SCHED_TRACER is not set | ||
| 730 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
| 731 | # CONFIG_BOOT_TRACER is not set | ||
| 732 | CONFIG_BRANCH_PROFILE_NONE=y | ||
| 733 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
| 734 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
| 735 | # CONFIG_STACK_TRACER is not set | ||
| 736 | # CONFIG_KMEMTRACE is not set | ||
| 737 | # CONFIG_WORKQUEUE_TRACER is not set | ||
| 738 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
| 739 | # CONFIG_DYNAMIC_DEBUG is not set | ||
| 740 | # CONFIG_SAMPLES is not set | ||
| 741 | CONFIG_HAVE_ARCH_KGDB=y | ||
| 742 | # CONFIG_KGDB is not set | ||
| 743 | # CONFIG_DEBUG_USER is not set | ||
| 744 | # CONFIG_DEBUG_ERRORS is not set | ||
| 745 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
| 746 | # CONFIG_DEBUG_LL is not set | ||
| 747 | |||
| 748 | # | ||
| 749 | # Security options | ||
| 750 | # | ||
| 751 | # CONFIG_KEYS is not set | ||
| 752 | # CONFIG_SECURITY is not set | ||
| 753 | # CONFIG_SECURITYFS is not set | ||
| 754 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
| 755 | # CONFIG_CRYPTO is not set | ||
| 756 | # CONFIG_BINARY_PRINTF is not set | ||
| 757 | |||
| 758 | # | ||
| 759 | # Library routines | ||
| 760 | # | ||
| 761 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
| 762 | # CONFIG_CRC_CCITT is not set | ||
| 763 | # CONFIG_CRC16 is not set | ||
| 764 | # CONFIG_CRC_T10DIF is not set | ||
| 765 | # CONFIG_CRC_ITU_T is not set | ||
| 766 | # CONFIG_CRC32 is not set | ||
| 767 | # CONFIG_CRC7 is not set | ||
| 768 | # CONFIG_LIBCRC32C is not set | ||
| 769 | CONFIG_ZLIB_INFLATE=y | ||
| 770 | CONFIG_DECOMPRESS_GZIP=y | ||
| 771 | CONFIG_DECOMPRESS_BZIP2=y | ||
| 772 | CONFIG_DECOMPRESS_LZMA=y | ||
| 773 | CONFIG_HAS_IOMEM=y | ||
| 774 | CONFIG_HAS_IOPORT=y | ||
| 775 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/arm/configs/spear320_defconfig b/arch/arm/configs/spear320_defconfig new file mode 100644 index 000000000000..2ae3c110a21a --- /dev/null +++ b/arch/arm/configs/spear320_defconfig | |||
| @@ -0,0 +1,775 @@ | |||
| 1 | # | ||
| 2 | # Automatically generated make config: don't edit | ||
| 3 | # Linux kernel version: 2.6.32 | ||
| 4 | # Tue Mar 23 14:37:12 2010 | ||
| 5 | # | ||
| 6 | CONFIG_ARM=y | ||
| 7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
| 8 | CONFIG_GENERIC_GPIO=y | ||
| 9 | CONFIG_GENERIC_TIME=y | ||
| 10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
| 11 | CONFIG_GENERIC_HARDIRQS=y | ||
| 12 | CONFIG_STACKTRACE_SUPPORT=y | ||
| 13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
| 14 | CONFIG_LOCKDEP_SUPPORT=y | ||
| 15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
| 16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
| 17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
| 18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
| 19 | CONFIG_GENERIC_HWEIGHT=y | ||
| 20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
| 21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
| 22 | CONFIG_VECTORS_BASE=0xffff0000 | ||
| 23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
| 24 | CONFIG_CONSTRUCTORS=y | ||
| 25 | |||
| 26 | # | ||
| 27 | # General setup | ||
| 28 | # | ||
| 29 | CONFIG_EXPERIMENTAL=y | ||
| 30 | CONFIG_BROKEN_ON_SMP=y | ||
| 31 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
| 32 | CONFIG_LOCALVERSION="" | ||
| 33 | CONFIG_LOCALVERSION_AUTO=y | ||
| 34 | CONFIG_SWAP=y | ||
| 35 | CONFIG_SYSVIPC=y | ||
| 36 | CONFIG_SYSVIPC_SYSCTL=y | ||
| 37 | CONFIG_BSD_PROCESS_ACCT=y | ||
| 38 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
| 39 | |||
| 40 | # | ||
| 41 | # RCU Subsystem | ||
| 42 | # | ||
| 43 | CONFIG_TREE_RCU=y | ||
| 44 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
| 45 | # CONFIG_RCU_TRACE is not set | ||
| 46 | CONFIG_RCU_FANOUT=32 | ||
| 47 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
| 48 | # CONFIG_TREE_RCU_TRACE is not set | ||
| 49 | # CONFIG_IKCONFIG is not set | ||
| 50 | CONFIG_LOG_BUF_SHIFT=17 | ||
| 51 | # CONFIG_GROUP_SCHED is not set | ||
| 52 | # CONFIG_CGROUPS is not set | ||
| 53 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
| 54 | # CONFIG_RELAY is not set | ||
| 55 | CONFIG_NAMESPACES=y | ||
| 56 | # CONFIG_UTS_NS is not set | ||
| 57 | # CONFIG_IPC_NS is not set | ||
| 58 | # CONFIG_USER_NS is not set | ||
| 59 | # CONFIG_PID_NS is not set | ||
| 60 | CONFIG_BLK_DEV_INITRD=y | ||
| 61 | CONFIG_INITRAMFS_SOURCE="" | ||
| 62 | CONFIG_RD_GZIP=y | ||
| 63 | CONFIG_RD_BZIP2=y | ||
| 64 | CONFIG_RD_LZMA=y | ||
| 65 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
| 66 | CONFIG_SYSCTL=y | ||
| 67 | CONFIG_ANON_INODES=y | ||
| 68 | # CONFIG_EMBEDDED is not set | ||
| 69 | CONFIG_UID16=y | ||
| 70 | CONFIG_SYSCTL_SYSCALL=y | ||
| 71 | CONFIG_KALLSYMS=y | ||
| 72 | # CONFIG_KALLSYMS_ALL is not set | ||
| 73 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
| 74 | CONFIG_HOTPLUG=y | ||
| 75 | CONFIG_PRINTK=y | ||
| 76 | CONFIG_BUG=y | ||
| 77 | CONFIG_ELF_CORE=y | ||
| 78 | CONFIG_BASE_FULL=y | ||
| 79 | CONFIG_FUTEX=y | ||
| 80 | CONFIG_EPOLL=y | ||
| 81 | CONFIG_SIGNALFD=y | ||
| 82 | CONFIG_TIMERFD=y | ||
| 83 | CONFIG_EVENTFD=y | ||
| 84 | CONFIG_SHMEM=y | ||
| 85 | CONFIG_AIO=y | ||
| 86 | |||
| 87 | # | ||
| 88 | # Kernel Performance Events And Counters | ||
| 89 | # | ||
| 90 | CONFIG_VM_EVENT_COUNTERS=y | ||
| 91 | CONFIG_SLUB_DEBUG=y | ||
| 92 | CONFIG_COMPAT_BRK=y | ||
| 93 | # CONFIG_SLAB is not set | ||
| 94 | CONFIG_SLUB=y | ||
| 95 | # CONFIG_SLOB is not set | ||
| 96 | # CONFIG_PROFILING is not set | ||
| 97 | CONFIG_HAVE_OPROFILE=y | ||
| 98 | # CONFIG_KPROBES is not set | ||
| 99 | CONFIG_HAVE_KPROBES=y | ||
| 100 | CONFIG_HAVE_KRETPROBES=y | ||
| 101 | CONFIG_HAVE_CLK=y | ||
| 102 | |||
| 103 | # | ||
| 104 | # GCOV-based kernel profiling | ||
| 105 | # | ||
| 106 | # CONFIG_GCOV_KERNEL is not set | ||
| 107 | # CONFIG_SLOW_WORK is not set | ||
| 108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
| 109 | CONFIG_SLABINFO=y | ||
| 110 | CONFIG_RT_MUTEXES=y | ||
| 111 | CONFIG_BASE_SMALL=0 | ||
| 112 | CONFIG_MODULES=y | ||
| 113 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
| 114 | CONFIG_MODULE_UNLOAD=y | ||
| 115 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
| 116 | CONFIG_MODVERSIONS=y | ||
| 117 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
| 118 | CONFIG_BLOCK=y | ||
| 119 | CONFIG_LBDAF=y | ||
| 120 | CONFIG_BLK_DEV_BSG=y | ||
| 121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
| 122 | |||
| 123 | # | ||
| 124 | # IO Schedulers | ||
| 125 | # | ||
| 126 | CONFIG_IOSCHED_NOOP=y | ||
| 127 | CONFIG_IOSCHED_AS=y | ||
| 128 | CONFIG_IOSCHED_DEADLINE=y | ||
| 129 | CONFIG_IOSCHED_CFQ=y | ||
| 130 | # CONFIG_DEFAULT_AS is not set | ||
| 131 | # CONFIG_DEFAULT_DEADLINE is not set | ||
| 132 | CONFIG_DEFAULT_CFQ=y | ||
| 133 | # CONFIG_DEFAULT_NOOP is not set | ||
| 134 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
| 135 | # CONFIG_FREEZER is not set | ||
| 136 | |||
| 137 | # | ||
| 138 | # System Type | ||
| 139 | # | ||
| 140 | CONFIG_MMU=y | ||
| 141 | # CONFIG_ARCH_AAEC2000 is not set | ||
| 142 | # CONFIG_ARCH_INTEGRATOR is not set | ||
| 143 | # CONFIG_ARCH_REALVIEW is not set | ||
| 144 | # CONFIG_ARCH_VERSATILE is not set | ||
| 145 | # CONFIG_ARCH_AT91 is not set | ||
| 146 | # CONFIG_ARCH_CLPS711X is not set | ||
| 147 | # CONFIG_ARCH_GEMINI is not set | ||
| 148 | # CONFIG_ARCH_EBSA110 is not set | ||
| 149 | # CONFIG_ARCH_EP93XX is not set | ||
| 150 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
| 151 | # CONFIG_ARCH_MXC is not set | ||
| 152 | # CONFIG_ARCH_STMP3XXX is not set | ||
| 153 | # CONFIG_ARCH_NETX is not set | ||
| 154 | # CONFIG_ARCH_H720X is not set | ||
| 155 | # CONFIG_ARCH_NOMADIK is not set | ||
| 156 | # CONFIG_ARCH_IOP13XX is not set | ||
| 157 | # CONFIG_ARCH_IOP32X is not set | ||
| 158 | # CONFIG_ARCH_IOP33X is not set | ||
| 159 | # CONFIG_ARCH_IXP23XX is not set | ||
| 160 | # CONFIG_ARCH_IXP2000 is not set | ||
| 161 | # CONFIG_ARCH_IXP4XX is not set | ||
| 162 | # CONFIG_ARCH_L7200 is not set | ||
| 163 | # CONFIG_ARCH_KIRKWOOD is not set | ||
| 164 | # CONFIG_ARCH_LOKI is not set | ||
| 165 | # CONFIG_ARCH_MV78XX0 is not set | ||
| 166 | # CONFIG_ARCH_ORION5X is not set | ||
| 167 | # CONFIG_ARCH_MMP is not set | ||
| 168 | # CONFIG_ARCH_KS8695 is not set | ||
| 169 | # CONFIG_ARCH_NS9XXX is not set | ||
| 170 | # CONFIG_ARCH_W90X900 is not set | ||
| 171 | # CONFIG_ARCH_PNX4008 is not set | ||
| 172 | # CONFIG_ARCH_PXA is not set | ||
| 173 | # CONFIG_ARCH_MSM is not set | ||
| 174 | # CONFIG_ARCH_RPC is not set | ||
| 175 | # CONFIG_ARCH_SA1100 is not set | ||
| 176 | # CONFIG_ARCH_S3C2410 is not set | ||
| 177 | # CONFIG_ARCH_S3C64XX is not set | ||
| 178 | # CONFIG_ARCH_S5PC1XX is not set | ||
| 179 | # CONFIG_ARCH_SHARK is not set | ||
| 180 | # CONFIG_ARCH_LH7A40X is not set | ||
| 181 | # CONFIG_ARCH_U300 is not set | ||
| 182 | # CONFIG_ARCH_DAVINCI is not set | ||
| 183 | # CONFIG_ARCH_OMAP is not set | ||
| 184 | # CONFIG_ARCH_BCMRING is not set | ||
| 185 | CONFIG_PLAT_SPEAR=y | ||
| 186 | CONFIG_ARCH_SPEAR3XX=y | ||
| 187 | # CONFIG_ARCH_SPEAR6XX is not set | ||
| 188 | # CONFIG_MACH_SPEAR300 is not set | ||
| 189 | # CONFIG_MACH_SPEAR310 is not set | ||
| 190 | CONFIG_MACH_SPEAR320=y | ||
| 191 | # CONFIG_BOARD_SPEAR300_EVB is not set | ||
| 192 | CONFIG_BOARD_SPEAR320_EVB=y | ||
| 193 | |||
| 194 | # | ||
| 195 | # Processor Type | ||
| 196 | # | ||
| 197 | CONFIG_CPU_32=y | ||
| 198 | CONFIG_CPU_ARM926T=y | ||
| 199 | CONFIG_CPU_32v5=y | ||
| 200 | CONFIG_CPU_ABRT_EV5TJ=y | ||
| 201 | CONFIG_CPU_PABRT_LEGACY=y | ||
| 202 | CONFIG_CPU_CACHE_VIVT=y | ||
| 203 | CONFIG_CPU_COPY_V4WB=y | ||
| 204 | CONFIG_CPU_TLB_V4WBI=y | ||
| 205 | CONFIG_CPU_CP15=y | ||
| 206 | CONFIG_CPU_CP15_MMU=y | ||
| 207 | |||
| 208 | # | ||
| 209 | # Processor Features | ||
| 210 | # | ||
| 211 | CONFIG_ARM_THUMB=y | ||
| 212 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
| 213 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
| 214 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
| 215 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
| 216 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
| 217 | CONFIG_ARM_VIC=y | ||
| 218 | CONFIG_ARM_VIC_NR=2 | ||
| 219 | CONFIG_COMMON_CLKDEV=y | ||
| 220 | |||
| 221 | # | ||
| 222 | # Bus support | ||
| 223 | # | ||
| 224 | CONFIG_ARM_AMBA=y | ||
| 225 | # CONFIG_PCI_SYSCALL is not set | ||
| 226 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
| 227 | # CONFIG_PCCARD is not set | ||
| 228 | |||
| 229 | # | ||
| 230 | # Kernel Features | ||
| 231 | # | ||
| 232 | # CONFIG_NO_HZ is not set | ||
| 233 | # CONFIG_HIGH_RES_TIMERS is not set | ||
| 234 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
| 235 | CONFIG_VMSPLIT_3G=y | ||
| 236 | # CONFIG_VMSPLIT_2G is not set | ||
| 237 | # CONFIG_VMSPLIT_1G is not set | ||
| 238 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
| 239 | CONFIG_PREEMPT_NONE=y | ||
| 240 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
| 241 | # CONFIG_PREEMPT is not set | ||
| 242 | CONFIG_HZ=100 | ||
| 243 | # CONFIG_AEABI is not set | ||
| 244 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
| 245 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
| 246 | # CONFIG_HIGHMEM is not set | ||
| 247 | CONFIG_SELECT_MEMORY_MODEL=y | ||
| 248 | CONFIG_FLATMEM_MANUAL=y | ||
| 249 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
| 250 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
| 251 | CONFIG_FLATMEM=y | ||
| 252 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
| 253 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
| 254 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
| 255 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
| 256 | CONFIG_ZONE_DMA_FLAG=0 | ||
| 257 | CONFIG_VIRT_TO_BUS=y | ||
| 258 | CONFIG_HAVE_MLOCK=y | ||
| 259 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
| 260 | # CONFIG_KSM is not set | ||
| 261 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
| 262 | CONFIG_ALIGNMENT_TRAP=y | ||
| 263 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
| 264 | |||
| 265 | # | ||
| 266 | # Boot options | ||
| 267 | # | ||
| 268 | CONFIG_ZBOOT_ROM_TEXT=0 | ||
| 269 | CONFIG_ZBOOT_ROM_BSS=0 | ||
| 270 | CONFIG_CMDLINE="" | ||
| 271 | # CONFIG_XIP_KERNEL is not set | ||
| 272 | # CONFIG_KEXEC is not set | ||
| 273 | |||
| 274 | # | ||
| 275 | # CPU Power Management | ||
| 276 | # | ||
| 277 | # CONFIG_CPU_IDLE is not set | ||
| 278 | |||
| 279 | # | ||
| 280 | # Floating point emulation | ||
| 281 | # | ||
| 282 | |||
| 283 | # | ||
| 284 | # At least one emulation must be selected | ||
| 285 | # | ||
| 286 | # CONFIG_FPE_NWFPE is not set | ||
| 287 | # CONFIG_FPE_FASTFPE is not set | ||
| 288 | # CONFIG_VFP is not set | ||
| 289 | |||
| 290 | # | ||
| 291 | # Userspace binary formats | ||
| 292 | # | ||
| 293 | CONFIG_BINFMT_ELF=y | ||
| 294 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
| 295 | CONFIG_HAVE_AOUT=y | ||
| 296 | # CONFIG_BINFMT_AOUT is not set | ||
| 297 | CONFIG_BINFMT_MISC=y | ||
| 298 | |||
| 299 | # | ||
| 300 | # Power management options | ||
| 301 | # | ||
| 302 | # CONFIG_PM is not set | ||
| 303 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
| 304 | # CONFIG_NET is not set | ||
| 305 | |||
| 306 | # | ||
| 307 | # Device Drivers | ||
| 308 | # | ||
| 309 | |||
| 310 | # | ||
| 311 | # Generic Driver Options | ||
| 312 | # | ||
| 313 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 314 | # CONFIG_DEVTMPFS is not set | ||
| 315 | CONFIG_STANDALONE=y | ||
| 316 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
| 317 | CONFIG_FW_LOADER=y | ||
| 318 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
| 319 | CONFIG_EXTRA_FIRMWARE="" | ||
| 320 | # CONFIG_DEBUG_DRIVER is not set | ||
| 321 | # CONFIG_DEBUG_DEVRES is not set | ||
| 322 | # CONFIG_SYS_HYPERVISOR is not set | ||
| 323 | # CONFIG_MTD is not set | ||
| 324 | # CONFIG_PARPORT is not set | ||
| 325 | CONFIG_BLK_DEV=y | ||
| 326 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
| 327 | # CONFIG_BLK_DEV_LOOP is not set | ||
| 328 | CONFIG_BLK_DEV_RAM=y | ||
| 329 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
| 330 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
| 331 | # CONFIG_BLK_DEV_XIP is not set | ||
| 332 | # CONFIG_CDROM_PKTCDVD is not set | ||
| 333 | # CONFIG_MG_DISK is not set | ||
| 334 | CONFIG_MISC_DEVICES=y | ||
| 335 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
| 336 | # CONFIG_C2PORT is not set | ||
| 337 | |||
| 338 | # | ||
| 339 | # EEPROM support | ||
| 340 | # | ||
| 341 | # CONFIG_EEPROM_93CX6 is not set | ||
| 342 | CONFIG_HAVE_IDE=y | ||
| 343 | # CONFIG_IDE is not set | ||
| 344 | |||
| 345 | # | ||
| 346 | # SCSI device support | ||
| 347 | # | ||
| 348 | # CONFIG_RAID_ATTRS is not set | ||
| 349 | # CONFIG_SCSI is not set | ||
| 350 | # CONFIG_SCSI_DMA is not set | ||
| 351 | # CONFIG_SCSI_NETLINK is not set | ||
| 352 | # CONFIG_ATA is not set | ||
| 353 | # CONFIG_MD is not set | ||
| 354 | # CONFIG_PHONE is not set | ||
| 355 | |||
| 356 | # | ||
| 357 | # Input device support | ||
| 358 | # | ||
| 359 | CONFIG_INPUT=y | ||
| 360 | CONFIG_INPUT_FF_MEMLESS=y | ||
| 361 | # CONFIG_INPUT_POLLDEV is not set | ||
| 362 | |||
| 363 | # | ||
| 364 | # Userland interfaces | ||
| 365 | # | ||
| 366 | CONFIG_INPUT_MOUSEDEV=y | ||
| 367 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 368 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
| 369 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
| 370 | # CONFIG_INPUT_JOYDEV is not set | ||
| 371 | # CONFIG_INPUT_EVDEV is not set | ||
| 372 | # CONFIG_INPUT_EVBUG is not set | ||
| 373 | |||
| 374 | # | ||
| 375 | # Input Device Drivers | ||
| 376 | # | ||
| 377 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 378 | # CONFIG_INPUT_MOUSE is not set | ||
| 379 | # CONFIG_INPUT_JOYSTICK is not set | ||
| 380 | # CONFIG_INPUT_TABLET is not set | ||
| 381 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
| 382 | # CONFIG_INPUT_MISC is not set | ||
| 383 | |||
| 384 | # | ||
| 385 | # Hardware I/O ports | ||
| 386 | # | ||
| 387 | CONFIG_SERIO=y | ||
| 388 | CONFIG_SERIO_SERPORT=y | ||
| 389 | # CONFIG_SERIO_AMBAKMI is not set | ||
| 390 | # CONFIG_SERIO_RAW is not set | ||
| 391 | # CONFIG_GAMEPORT is not set | ||
| 392 | |||
| 393 | # | ||
| 394 | # Character devices | ||
| 395 | # | ||
| 396 | CONFIG_VT=y | ||
| 397 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
| 398 | CONFIG_VT_CONSOLE=y | ||
| 399 | CONFIG_HW_CONSOLE=y | ||
| 400 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
| 401 | CONFIG_DEVKMEM=y | ||
| 402 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
| 403 | |||
| 404 | # | ||
| 405 | # Serial drivers | ||
| 406 | # | ||
| 407 | # CONFIG_SERIAL_8250 is not set | ||
| 408 | |||
| 409 | # | ||
| 410 | # Non-8250 serial port support | ||
| 411 | # | ||
| 412 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
| 413 | CONFIG_SERIAL_AMBA_PL011=y | ||
| 414 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||
| 415 | CONFIG_SERIAL_CORE=y | ||
| 416 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
| 417 | CONFIG_UNIX98_PTYS=y | ||
| 418 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
| 419 | # CONFIG_LEGACY_PTYS is not set | ||
| 420 | # CONFIG_IPMI_HANDLER is not set | ||
| 421 | # CONFIG_HW_RANDOM is not set | ||
| 422 | # CONFIG_R3964 is not set | ||
| 423 | CONFIG_RAW_DRIVER=y | ||
| 424 | CONFIG_MAX_RAW_DEVS=8192 | ||
| 425 | # CONFIG_TCG_TPM is not set | ||
| 426 | # CONFIG_I2C is not set | ||
| 427 | # CONFIG_SPI is not set | ||
| 428 | |||
| 429 | # | ||
| 430 | # PPS support | ||
| 431 | # | ||
| 432 | # CONFIG_PPS is not set | ||
| 433 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
| 434 | CONFIG_GPIOLIB=y | ||
| 435 | # CONFIG_DEBUG_GPIO is not set | ||
| 436 | CONFIG_GPIO_SYSFS=y | ||
| 437 | |||
| 438 | # | ||
| 439 | # Memory mapped GPIO expanders: | ||
| 440 | # | ||
| 441 | CONFIG_GPIO_PL061=y | ||
| 442 | |||
| 443 | # | ||
| 444 | # I2C GPIO expanders: | ||
| 445 | # | ||
| 446 | |||
| 447 | # | ||
| 448 | # PCI GPIO expanders: | ||
| 449 | # | ||
| 450 | |||
| 451 | # | ||
| 452 | # SPI GPIO expanders: | ||
| 453 | # | ||
| 454 | |||
| 455 | # | ||
| 456 | # AC97 GPIO expanders: | ||
| 457 | # | ||
| 458 | # CONFIG_W1 is not set | ||
| 459 | # CONFIG_POWER_SUPPLY is not set | ||
| 460 | # CONFIG_HWMON is not set | ||
| 461 | # CONFIG_THERMAL is not set | ||
| 462 | # CONFIG_WATCHDOG is not set | ||
| 463 | CONFIG_SSB_POSSIBLE=y | ||
| 464 | |||
| 465 | # | ||
| 466 | # Sonics Silicon Backplane | ||
| 467 | # | ||
| 468 | # CONFIG_SSB is not set | ||
| 469 | |||
| 470 | # | ||
| 471 | # Multifunction device drivers | ||
| 472 | # | ||
| 473 | # CONFIG_MFD_CORE is not set | ||
| 474 | # CONFIG_MFD_SM501 is not set | ||
| 475 | # CONFIG_MFD_ASIC3 is not set | ||
| 476 | # CONFIG_HTC_EGPIO is not set | ||
| 477 | # CONFIG_HTC_PASIC3 is not set | ||
| 478 | # CONFIG_MFD_TMIO is not set | ||
| 479 | # CONFIG_MFD_T7L66XB is not set | ||
| 480 | # CONFIG_MFD_TC6387XB is not set | ||
| 481 | # CONFIG_MFD_TC6393XB is not set | ||
| 482 | # CONFIG_REGULATOR is not set | ||
| 483 | # CONFIG_MEDIA_SUPPORT is not set | ||
| 484 | |||
| 485 | # | ||
| 486 | # Graphics support | ||
| 487 | # | ||
| 488 | # CONFIG_VGASTATE is not set | ||
| 489 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
| 490 | # CONFIG_FB is not set | ||
| 491 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
| 492 | |||
| 493 | # | ||
| 494 | # Display device support | ||
| 495 | # | ||
| 496 | # CONFIG_DISPLAY_SUPPORT is not set | ||
| 497 | |||
| 498 | # | ||
| 499 | # Console display driver support | ||
| 500 | # | ||
| 501 | # CONFIG_VGA_CONSOLE is not set | ||
| 502 | CONFIG_DUMMY_CONSOLE=y | ||
| 503 | # CONFIG_SOUND is not set | ||
| 504 | # CONFIG_HID_SUPPORT is not set | ||
| 505 | # CONFIG_USB_SUPPORT is not set | ||
| 506 | # CONFIG_MMC is not set | ||
| 507 | # CONFIG_MEMSTICK is not set | ||
| 508 | # CONFIG_NEW_LEDS is not set | ||
| 509 | # CONFIG_ACCESSIBILITY is not set | ||
| 510 | CONFIG_RTC_LIB=y | ||
| 511 | # CONFIG_RTC_CLASS is not set | ||
| 512 | # CONFIG_DMADEVICES is not set | ||
| 513 | # CONFIG_AUXDISPLAY is not set | ||
| 514 | # CONFIG_UIO is not set | ||
| 515 | |||
| 516 | # | ||
| 517 | # TI VLYNQ | ||
| 518 | # | ||
| 519 | # CONFIG_STAGING is not set | ||
| 520 | |||
| 521 | # | ||
| 522 | # File systems | ||
| 523 | # | ||
| 524 | CONFIG_EXT2_FS=y | ||
| 525 | CONFIG_EXT2_FS_XATTR=y | ||
| 526 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
| 527 | CONFIG_EXT2_FS_SECURITY=y | ||
| 528 | # CONFIG_EXT2_FS_XIP is not set | ||
| 529 | CONFIG_EXT3_FS=y | ||
| 530 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
| 531 | CONFIG_EXT3_FS_XATTR=y | ||
| 532 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
| 533 | CONFIG_EXT3_FS_SECURITY=y | ||
| 534 | # CONFIG_EXT4_FS is not set | ||
| 535 | CONFIG_JBD=y | ||
| 536 | # CONFIG_JBD_DEBUG is not set | ||
| 537 | CONFIG_FS_MBCACHE=y | ||
| 538 | # CONFIG_REISERFS_FS is not set | ||
| 539 | # CONFIG_JFS_FS is not set | ||
| 540 | # CONFIG_FS_POSIX_ACL is not set | ||
| 541 | # CONFIG_XFS_FS is not set | ||
| 542 | # CONFIG_GFS2_FS is not set | ||
| 543 | # CONFIG_BTRFS_FS is not set | ||
| 544 | # CONFIG_NILFS2_FS is not set | ||
| 545 | CONFIG_FILE_LOCKING=y | ||
| 546 | CONFIG_FSNOTIFY=y | ||
| 547 | CONFIG_DNOTIFY=y | ||
| 548 | # CONFIG_INOTIFY is not set | ||
| 549 | CONFIG_INOTIFY_USER=y | ||
| 550 | # CONFIG_QUOTA is not set | ||
| 551 | # CONFIG_AUTOFS_FS is not set | ||
| 552 | CONFIG_AUTOFS4_FS=m | ||
| 553 | # CONFIG_FUSE_FS is not set | ||
| 554 | |||
| 555 | # | ||
| 556 | # Caches | ||
| 557 | # | ||
| 558 | # CONFIG_FSCACHE is not set | ||
| 559 | |||
| 560 | # | ||
| 561 | # CD-ROM/DVD Filesystems | ||
| 562 | # | ||
| 563 | # CONFIG_ISO9660_FS is not set | ||
| 564 | # CONFIG_UDF_FS is not set | ||
| 565 | |||
| 566 | # | ||
| 567 | # DOS/FAT/NT Filesystems | ||
| 568 | # | ||
| 569 | CONFIG_FAT_FS=m | ||
| 570 | CONFIG_MSDOS_FS=m | ||
| 571 | CONFIG_VFAT_FS=m | ||
| 572 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
| 573 | CONFIG_FAT_DEFAULT_IOCHARSET="ascii" | ||
| 574 | # CONFIG_NTFS_FS is not set | ||
| 575 | |||
| 576 | # | ||
| 577 | # Pseudo filesystems | ||
| 578 | # | ||
| 579 | CONFIG_PROC_FS=y | ||
| 580 | CONFIG_PROC_SYSCTL=y | ||
| 581 | CONFIG_PROC_PAGE_MONITOR=y | ||
| 582 | CONFIG_SYSFS=y | ||
| 583 | CONFIG_TMPFS=y | ||
| 584 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
| 585 | # CONFIG_HUGETLB_PAGE is not set | ||
| 586 | # CONFIG_CONFIGFS_FS is not set | ||
| 587 | CONFIG_MISC_FILESYSTEMS=y | ||
| 588 | # CONFIG_ADFS_FS is not set | ||
| 589 | # CONFIG_AFFS_FS is not set | ||
| 590 | # CONFIG_HFS_FS is not set | ||
| 591 | # CONFIG_HFSPLUS_FS is not set | ||
| 592 | # CONFIG_BEFS_FS is not set | ||
| 593 | # CONFIG_BFS_FS is not set | ||
| 594 | # CONFIG_EFS_FS is not set | ||
| 595 | # CONFIG_SQUASHFS is not set | ||
| 596 | # CONFIG_VXFS_FS is not set | ||
| 597 | # CONFIG_MINIX_FS is not set | ||
| 598 | # CONFIG_OMFS_FS is not set | ||
| 599 | # CONFIG_HPFS_FS is not set | ||
| 600 | # CONFIG_QNX4FS_FS is not set | ||
| 601 | # CONFIG_ROMFS_FS is not set | ||
| 602 | # CONFIG_SYSV_FS is not set | ||
| 603 | # CONFIG_UFS_FS is not set | ||
| 604 | |||
| 605 | # | ||
| 606 | # Partition Types | ||
| 607 | # | ||
| 608 | CONFIG_PARTITION_ADVANCED=y | ||
| 609 | # CONFIG_ACORN_PARTITION is not set | ||
| 610 | # CONFIG_OSF_PARTITION is not set | ||
| 611 | # CONFIG_AMIGA_PARTITION is not set | ||
| 612 | # CONFIG_ATARI_PARTITION is not set | ||
| 613 | # CONFIG_MAC_PARTITION is not set | ||
| 614 | CONFIG_MSDOS_PARTITION=y | ||
| 615 | # CONFIG_BSD_DISKLABEL is not set | ||
| 616 | # CONFIG_MINIX_SUBPARTITION is not set | ||
| 617 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
| 618 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
| 619 | # CONFIG_LDM_PARTITION is not set | ||
| 620 | # CONFIG_SGI_PARTITION is not set | ||
| 621 | # CONFIG_ULTRIX_PARTITION is not set | ||
| 622 | # CONFIG_SUN_PARTITION is not set | ||
| 623 | # CONFIG_KARMA_PARTITION is not set | ||
| 624 | # CONFIG_EFI_PARTITION is not set | ||
| 625 | # CONFIG_SYSV68_PARTITION is not set | ||
| 626 | CONFIG_NLS=y | ||
| 627 | CONFIG_NLS_DEFAULT="utf8" | ||
| 628 | CONFIG_NLS_CODEPAGE_437=y | ||
| 629 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
| 630 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
| 631 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
| 632 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
| 633 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
| 634 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
| 635 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
| 636 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
| 637 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
| 638 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
| 639 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
| 640 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
| 641 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
| 642 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
| 643 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
| 644 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
| 645 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
| 646 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
| 647 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
| 648 | # CONFIG_NLS_ISO8859_8 is not set | ||
| 649 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
| 650 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
| 651 | CONFIG_NLS_ASCII=m | ||
| 652 | # CONFIG_NLS_ISO8859_1 is not set | ||
| 653 | # CONFIG_NLS_ISO8859_2 is not set | ||
| 654 | # CONFIG_NLS_ISO8859_3 is not set | ||
| 655 | # CONFIG_NLS_ISO8859_4 is not set | ||
| 656 | # CONFIG_NLS_ISO8859_5 is not set | ||
| 657 | # CONFIG_NLS_ISO8859_6 is not set | ||
| 658 | # CONFIG_NLS_ISO8859_7 is not set | ||
| 659 | # CONFIG_NLS_ISO8859_9 is not set | ||
| 660 | # CONFIG_NLS_ISO8859_13 is not set | ||
| 661 | # CONFIG_NLS_ISO8859_14 is not set | ||
| 662 | # CONFIG_NLS_ISO8859_15 is not set | ||
| 663 | # CONFIG_NLS_KOI8_R is not set | ||
| 664 | # CONFIG_NLS_KOI8_U is not set | ||
| 665 | # CONFIG_NLS_UTF8 is not set | ||
| 666 | |||
| 667 | # | ||
| 668 | # Kernel hacking | ||
| 669 | # | ||
| 670 | # CONFIG_PRINTK_TIME is not set | ||
| 671 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
| 672 | CONFIG_ENABLE_MUST_CHECK=y | ||
| 673 | CONFIG_FRAME_WARN=1024 | ||
| 674 | CONFIG_MAGIC_SYSRQ=y | ||
| 675 | # CONFIG_STRIP_ASM_SYMS is not set | ||
| 676 | # CONFIG_UNUSED_SYMBOLS is not set | ||
| 677 | CONFIG_DEBUG_FS=y | ||
| 678 | # CONFIG_HEADERS_CHECK is not set | ||
| 679 | CONFIG_DEBUG_KERNEL=y | ||
| 680 | # CONFIG_DEBUG_SHIRQ is not set | ||
| 681 | CONFIG_DETECT_SOFTLOCKUP=y | ||
| 682 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
| 683 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
| 684 | CONFIG_DETECT_HUNG_TASK=y | ||
| 685 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
| 686 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
| 687 | CONFIG_SCHED_DEBUG=y | ||
| 688 | # CONFIG_SCHEDSTATS is not set | ||
| 689 | # CONFIG_TIMER_STATS is not set | ||
| 690 | # CONFIG_DEBUG_OBJECTS is not set | ||
| 691 | # CONFIG_SLUB_DEBUG_ON is not set | ||
| 692 | # CONFIG_SLUB_STATS is not set | ||
| 693 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
| 694 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
| 695 | # CONFIG_RT_MUTEX_TESTER is not set | ||
| 696 | CONFIG_DEBUG_SPINLOCK=y | ||
| 697 | # CONFIG_DEBUG_MUTEXES is not set | ||
| 698 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
| 699 | # CONFIG_PROVE_LOCKING is not set | ||
| 700 | # CONFIG_LOCK_STAT is not set | ||
| 701 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
| 702 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
| 703 | # CONFIG_DEBUG_KOBJECT is not set | ||
| 704 | CONFIG_DEBUG_BUGVERBOSE=y | ||
| 705 | CONFIG_DEBUG_INFO=y | ||
| 706 | # CONFIG_DEBUG_VM is not set | ||
| 707 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
| 708 | CONFIG_DEBUG_MEMORY_INIT=y | ||
| 709 | # CONFIG_DEBUG_LIST is not set | ||
| 710 | # CONFIG_DEBUG_SG is not set | ||
| 711 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
| 712 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
| 713 | CONFIG_FRAME_POINTER=y | ||
| 714 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
| 715 | # CONFIG_RCU_TORTURE_TEST is not set | ||
| 716 | CONFIG_RCU_CPU_STALL_DETECTOR=y | ||
| 717 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
| 718 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
| 719 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
| 720 | # CONFIG_FAULT_INJECTION is not set | ||
| 721 | # CONFIG_LATENCYTOP is not set | ||
| 722 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
| 723 | # CONFIG_PAGE_POISONING is not set | ||
| 724 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
| 725 | CONFIG_TRACING_SUPPORT=y | ||
| 726 | CONFIG_FTRACE=y | ||
| 727 | # CONFIG_FUNCTION_TRACER is not set | ||
| 728 | # CONFIG_IRQSOFF_TRACER is not set | ||
| 729 | # CONFIG_SCHED_TRACER is not set | ||
| 730 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
| 731 | # CONFIG_BOOT_TRACER is not set | ||
| 732 | CONFIG_BRANCH_PROFILE_NONE=y | ||
| 733 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
| 734 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
| 735 | # CONFIG_STACK_TRACER is not set | ||
| 736 | # CONFIG_KMEMTRACE is not set | ||
| 737 | # CONFIG_WORKQUEUE_TRACER is not set | ||
| 738 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
| 739 | # CONFIG_DYNAMIC_DEBUG is not set | ||
| 740 | # CONFIG_SAMPLES is not set | ||
| 741 | CONFIG_HAVE_ARCH_KGDB=y | ||
| 742 | # CONFIG_KGDB is not set | ||
| 743 | # CONFIG_DEBUG_USER is not set | ||
| 744 | # CONFIG_DEBUG_ERRORS is not set | ||
| 745 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
| 746 | # CONFIG_DEBUG_LL is not set | ||
| 747 | |||
| 748 | # | ||
| 749 | # Security options | ||
| 750 | # | ||
| 751 | # CONFIG_KEYS is not set | ||
| 752 | # CONFIG_SECURITY is not set | ||
| 753 | # CONFIG_SECURITYFS is not set | ||
| 754 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
| 755 | # CONFIG_CRYPTO is not set | ||
| 756 | # CONFIG_BINARY_PRINTF is not set | ||
| 757 | |||
| 758 | # | ||
| 759 | # Library routines | ||
| 760 | # | ||
| 761 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
| 762 | # CONFIG_CRC_CCITT is not set | ||
| 763 | # CONFIG_CRC16 is not set | ||
| 764 | # CONFIG_CRC_T10DIF is not set | ||
| 765 | # CONFIG_CRC_ITU_T is not set | ||
| 766 | # CONFIG_CRC32 is not set | ||
| 767 | # CONFIG_CRC7 is not set | ||
| 768 | # CONFIG_LIBCRC32C is not set | ||
| 769 | CONFIG_ZLIB_INFLATE=y | ||
| 770 | CONFIG_DECOMPRESS_GZIP=y | ||
| 771 | CONFIG_DECOMPRESS_BZIP2=y | ||
| 772 | CONFIG_DECOMPRESS_LZMA=y | ||
| 773 | CONFIG_HAS_IOMEM=y | ||
| 774 | CONFIG_HAS_IOPORT=y | ||
| 775 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/arm/configs/spear600_defconfig b/arch/arm/configs/spear600_defconfig new file mode 100644 index 000000000000..c85a02924ec5 --- /dev/null +++ b/arch/arm/configs/spear600_defconfig | |||
| @@ -0,0 +1,760 @@ | |||
| 1 | # | ||
| 2 | # Automatically generated make config: don't edit | ||
| 3 | # Linux kernel version: 2.6.32 | ||
| 4 | # Tue Mar 23 14:37:26 2010 | ||
| 5 | # | ||
| 6 | CONFIG_ARM=y | ||
| 7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
| 8 | CONFIG_GENERIC_GPIO=y | ||
| 9 | CONFIG_GENERIC_TIME=y | ||
| 10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
| 11 | CONFIG_GENERIC_HARDIRQS=y | ||
| 12 | CONFIG_STACKTRACE_SUPPORT=y | ||
| 13 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
| 14 | CONFIG_LOCKDEP_SUPPORT=y | ||
| 15 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
| 16 | CONFIG_HARDIRQS_SW_RESEND=y | ||
| 17 | CONFIG_GENERIC_IRQ_PROBE=y | ||
| 18 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
| 19 | CONFIG_GENERIC_HWEIGHT=y | ||
| 20 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
| 21 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
| 22 | CONFIG_VECTORS_BASE=0xffff0000 | ||
| 23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
| 24 | CONFIG_CONSTRUCTORS=y | ||
| 25 | |||
| 26 | # | ||
| 27 | # General setup | ||
| 28 | # | ||
| 29 | CONFIG_EXPERIMENTAL=y | ||
| 30 | CONFIG_BROKEN_ON_SMP=y | ||
| 31 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
| 32 | CONFIG_LOCALVERSION="" | ||
| 33 | CONFIG_LOCALVERSION_AUTO=y | ||
| 34 | CONFIG_SWAP=y | ||
| 35 | CONFIG_SYSVIPC=y | ||
| 36 | CONFIG_SYSVIPC_SYSCTL=y | ||
| 37 | CONFIG_BSD_PROCESS_ACCT=y | ||
| 38 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
| 39 | |||
| 40 | # | ||
| 41 | # RCU Subsystem | ||
| 42 | # | ||
| 43 | CONFIG_TREE_RCU=y | ||
| 44 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
| 45 | # CONFIG_RCU_TRACE is not set | ||
| 46 | CONFIG_RCU_FANOUT=32 | ||
| 47 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
| 48 | # CONFIG_TREE_RCU_TRACE is not set | ||
| 49 | # CONFIG_IKCONFIG is not set | ||
| 50 | CONFIG_LOG_BUF_SHIFT=17 | ||
| 51 | # CONFIG_GROUP_SCHED is not set | ||
| 52 | # CONFIG_CGROUPS is not set | ||
| 53 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
| 54 | # CONFIG_RELAY is not set | ||
| 55 | CONFIG_NAMESPACES=y | ||
| 56 | # CONFIG_UTS_NS is not set | ||
| 57 | # CONFIG_IPC_NS is not set | ||
| 58 | # CONFIG_USER_NS is not set | ||
| 59 | # CONFIG_PID_NS is not set | ||
| 60 | CONFIG_BLK_DEV_INITRD=y | ||
| 61 | CONFIG_INITRAMFS_SOURCE="" | ||
| 62 | CONFIG_RD_GZIP=y | ||
| 63 | CONFIG_RD_BZIP2=y | ||
| 64 | CONFIG_RD_LZMA=y | ||
| 65 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
| 66 | CONFIG_SYSCTL=y | ||
| 67 | CONFIG_ANON_INODES=y | ||
| 68 | # CONFIG_EMBEDDED is not set | ||
| 69 | CONFIG_UID16=y | ||
| 70 | CONFIG_SYSCTL_SYSCALL=y | ||
| 71 | CONFIG_KALLSYMS=y | ||
| 72 | # CONFIG_KALLSYMS_ALL is not set | ||
| 73 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
| 74 | CONFIG_HOTPLUG=y | ||
| 75 | CONFIG_PRINTK=y | ||
| 76 | CONFIG_BUG=y | ||
| 77 | CONFIG_ELF_CORE=y | ||
| 78 | CONFIG_BASE_FULL=y | ||
| 79 | CONFIG_FUTEX=y | ||
| 80 | CONFIG_EPOLL=y | ||
| 81 | CONFIG_SIGNALFD=y | ||
| 82 | CONFIG_TIMERFD=y | ||
| 83 | CONFIG_EVENTFD=y | ||
| 84 | CONFIG_SHMEM=y | ||
| 85 | CONFIG_AIO=y | ||
| 86 | |||
| 87 | # | ||
| 88 | # Kernel Performance Events And Counters | ||
| 89 | # | ||
| 90 | CONFIG_VM_EVENT_COUNTERS=y | ||
| 91 | CONFIG_SLUB_DEBUG=y | ||
| 92 | CONFIG_COMPAT_BRK=y | ||
| 93 | # CONFIG_SLAB is not set | ||
| 94 | CONFIG_SLUB=y | ||
| 95 | # CONFIG_SLOB is not set | ||
| 96 | # CONFIG_PROFILING is not set | ||
| 97 | CONFIG_HAVE_OPROFILE=y | ||
| 98 | # CONFIG_KPROBES is not set | ||
| 99 | CONFIG_HAVE_KPROBES=y | ||
| 100 | CONFIG_HAVE_KRETPROBES=y | ||
| 101 | CONFIG_HAVE_CLK=y | ||
| 102 | |||
| 103 | # | ||
| 104 | # GCOV-based kernel profiling | ||
| 105 | # | ||
| 106 | # CONFIG_GCOV_KERNEL is not set | ||
| 107 | # CONFIG_SLOW_WORK is not set | ||
| 108 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
| 109 | CONFIG_SLABINFO=y | ||
| 110 | CONFIG_RT_MUTEXES=y | ||
| 111 | CONFIG_BASE_SMALL=0 | ||
| 112 | CONFIG_MODULES=y | ||
| 113 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
| 114 | CONFIG_MODULE_UNLOAD=y | ||
| 115 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
| 116 | CONFIG_MODVERSIONS=y | ||
| 117 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
| 118 | CONFIG_BLOCK=y | ||
| 119 | CONFIG_LBDAF=y | ||
| 120 | CONFIG_BLK_DEV_BSG=y | ||
| 121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
| 122 | |||
| 123 | # | ||
| 124 | # IO Schedulers | ||
| 125 | # | ||
| 126 | CONFIG_IOSCHED_NOOP=y | ||
| 127 | CONFIG_IOSCHED_AS=y | ||
| 128 | CONFIG_IOSCHED_DEADLINE=y | ||
| 129 | CONFIG_IOSCHED_CFQ=y | ||
| 130 | # CONFIG_DEFAULT_AS is not set | ||
| 131 | # CONFIG_DEFAULT_DEADLINE is not set | ||
| 132 | CONFIG_DEFAULT_CFQ=y | ||
| 133 | # CONFIG_DEFAULT_NOOP is not set | ||
| 134 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
| 135 | # CONFIG_FREEZER is not set | ||
| 136 | |||
| 137 | # | ||
| 138 | # System Type | ||
| 139 | # | ||
| 140 | CONFIG_MMU=y | ||
| 141 | # CONFIG_ARCH_AAEC2000 is not set | ||
| 142 | # CONFIG_ARCH_INTEGRATOR is not set | ||
| 143 | # CONFIG_ARCH_REALVIEW is not set | ||
| 144 | # CONFIG_ARCH_VERSATILE is not set | ||
| 145 | # CONFIG_ARCH_AT91 is not set | ||
| 146 | # CONFIG_ARCH_CLPS711X is not set | ||
| 147 | # CONFIG_ARCH_GEMINI is not set | ||
| 148 | # CONFIG_ARCH_EBSA110 is not set | ||
| 149 | # CONFIG_ARCH_EP93XX is not set | ||
| 150 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
| 151 | # CONFIG_ARCH_MXC is not set | ||
| 152 | # CONFIG_ARCH_STMP3XXX is not set | ||
| 153 | # CONFIG_ARCH_NETX is not set | ||
| 154 | # CONFIG_ARCH_H720X is not set | ||
| 155 | # CONFIG_ARCH_NOMADIK is not set | ||
| 156 | # CONFIG_ARCH_IOP13XX is not set | ||
| 157 | # CONFIG_ARCH_IOP32X is not set | ||
| 158 | # CONFIG_ARCH_IOP33X is not set | ||
| 159 | # CONFIG_ARCH_IXP23XX is not set | ||
| 160 | # CONFIG_ARCH_IXP2000 is not set | ||
| 161 | # CONFIG_ARCH_IXP4XX is not set | ||
| 162 | # CONFIG_ARCH_L7200 is not set | ||
| 163 | # CONFIG_ARCH_KIRKWOOD is not set | ||
| 164 | # CONFIG_ARCH_LOKI is not set | ||
| 165 | # CONFIG_ARCH_MV78XX0 is not set | ||
| 166 | # CONFIG_ARCH_ORION5X is not set | ||
| 167 | # CONFIG_ARCH_MMP is not set | ||
| 168 | # CONFIG_ARCH_KS8695 is not set | ||
| 169 | # CONFIG_ARCH_NS9XXX is not set | ||
| 170 | # CONFIG_ARCH_W90X900 is not set | ||
| 171 | # CONFIG_ARCH_PNX4008 is not set | ||
| 172 | # CONFIG_ARCH_PXA is not set | ||
| 173 | # CONFIG_ARCH_MSM is not set | ||
| 174 | # CONFIG_ARCH_RPC is not set | ||
| 175 | # CONFIG_ARCH_SA1100 is not set | ||
| 176 | # CONFIG_ARCH_S3C2410 is not set | ||
| 177 | # CONFIG_ARCH_S3C64XX is not set | ||
| 178 | # CONFIG_ARCH_S5PC1XX is not set | ||
| 179 | # CONFIG_ARCH_SHARK is not set | ||
| 180 | # CONFIG_ARCH_LH7A40X is not set | ||
| 181 | # CONFIG_ARCH_U300 is not set | ||
| 182 | # CONFIG_ARCH_DAVINCI is not set | ||
| 183 | # CONFIG_ARCH_OMAP is not set | ||
| 184 | # CONFIG_ARCH_BCMRING is not set | ||
| 185 | CONFIG_PLAT_SPEAR=y | ||
| 186 | # CONFIG_ARCH_SPEAR3XX is not set | ||
| 187 | CONFIG_ARCH_SPEAR6XX=y | ||
| 188 | # CONFIG_MACH_SPEAR300 is not set | ||
| 189 | # CONFIG_MACH_SPEAR310 is not set | ||
| 190 | # CONFIG_MACH_SPEAR320 is not set | ||
| 191 | # CONFIG_BOARD_SPEAR300_EVB is not set | ||
| 192 | CONFIG_MACH_SPEAR600=y | ||
| 193 | CONFIG_BOARD_SPEAR600_EVB=y | ||
| 194 | |||
| 195 | # | ||
| 196 | # Processor Type | ||
| 197 | # | ||
| 198 | CONFIG_CPU_32=y | ||
| 199 | CONFIG_CPU_ARM926T=y | ||
| 200 | CONFIG_CPU_32v5=y | ||
| 201 | CONFIG_CPU_ABRT_EV5TJ=y | ||
| 202 | CONFIG_CPU_PABRT_LEGACY=y | ||
| 203 | CONFIG_CPU_CACHE_VIVT=y | ||
| 204 | CONFIG_CPU_COPY_V4WB=y | ||
| 205 | CONFIG_CPU_TLB_V4WBI=y | ||
| 206 | CONFIG_CPU_CP15=y | ||
| 207 | CONFIG_CPU_CP15_MMU=y | ||
| 208 | |||
| 209 | # | ||
| 210 | # Processor Features | ||
| 211 | # | ||
| 212 | CONFIG_ARM_THUMB=y | ||
| 213 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
| 214 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
| 215 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
| 216 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
| 217 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
| 218 | CONFIG_ARM_VIC=y | ||
| 219 | CONFIG_ARM_VIC_NR=2 | ||
| 220 | CONFIG_COMMON_CLKDEV=y | ||
| 221 | |||
| 222 | # | ||
| 223 | # Bus support | ||
| 224 | # | ||
| 225 | CONFIG_ARM_AMBA=y | ||
| 226 | # CONFIG_PCI_SYSCALL is not set | ||
| 227 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
| 228 | # CONFIG_PCCARD is not set | ||
| 229 | |||
| 230 | # | ||
| 231 | # Kernel Features | ||
| 232 | # | ||
| 233 | # CONFIG_NO_HZ is not set | ||
| 234 | # CONFIG_HIGH_RES_TIMERS is not set | ||
| 235 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
| 236 | CONFIG_VMSPLIT_3G=y | ||
| 237 | # CONFIG_VMSPLIT_2G is not set | ||
| 238 | # CONFIG_VMSPLIT_1G is not set | ||
| 239 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
| 240 | CONFIG_PREEMPT_NONE=y | ||
| 241 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
| 242 | # CONFIG_PREEMPT is not set | ||
| 243 | CONFIG_HZ=100 | ||
| 244 | # CONFIG_AEABI is not set | ||
| 245 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
| 246 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
| 247 | # CONFIG_HIGHMEM is not set | ||
| 248 | CONFIG_SELECT_MEMORY_MODEL=y | ||
| 249 | CONFIG_FLATMEM_MANUAL=y | ||
| 250 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
| 251 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
| 252 | CONFIG_FLATMEM=y | ||
| 253 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
| 254 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
| 255 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
| 256 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
| 257 | CONFIG_ZONE_DMA_FLAG=0 | ||
| 258 | CONFIG_VIRT_TO_BUS=y | ||
| 259 | CONFIG_HAVE_MLOCK=y | ||
| 260 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
| 261 | # CONFIG_KSM is not set | ||
| 262 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
| 263 | CONFIG_ALIGNMENT_TRAP=y | ||
| 264 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
| 265 | |||
| 266 | # | ||
| 267 | # Boot options | ||
| 268 | # | ||
| 269 | CONFIG_ZBOOT_ROM_TEXT=0 | ||
| 270 | CONFIG_ZBOOT_ROM_BSS=0 | ||
| 271 | CONFIG_CMDLINE="" | ||
| 272 | # CONFIG_XIP_KERNEL is not set | ||
| 273 | # CONFIG_KEXEC is not set | ||
| 274 | |||
| 275 | # | ||
| 276 | # CPU Power Management | ||
| 277 | # | ||
| 278 | # CONFIG_CPU_IDLE is not set | ||
| 279 | |||
| 280 | # | ||
| 281 | # Floating point emulation | ||
| 282 | # | ||
| 283 | |||
| 284 | # | ||
| 285 | # At least one emulation must be selected | ||
| 286 | # | ||
| 287 | # CONFIG_FPE_NWFPE is not set | ||
| 288 | # CONFIG_FPE_FASTFPE is not set | ||
| 289 | # CONFIG_VFP is not set | ||
| 290 | |||
| 291 | # | ||
| 292 | # Userspace binary formats | ||
| 293 | # | ||
| 294 | CONFIG_BINFMT_ELF=y | ||
| 295 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
| 296 | CONFIG_HAVE_AOUT=y | ||
| 297 | # CONFIG_BINFMT_AOUT is not set | ||
| 298 | CONFIG_BINFMT_MISC=y | ||
| 299 | # CONFIG_ARTHUR is not set | ||
| 300 | |||
| 301 | # | ||
| 302 | # Power management options | ||
| 303 | # | ||
| 304 | # CONFIG_PM is not set | ||
| 305 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
| 306 | # CONFIG_NET is not set | ||
| 307 | |||
| 308 | # | ||
| 309 | # Device Drivers | ||
| 310 | # | ||
| 311 | |||
| 312 | # | ||
| 313 | # Generic Driver Options | ||
| 314 | # | ||
| 315 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 316 | # CONFIG_DEVTMPFS is not set | ||
| 317 | CONFIG_STANDALONE=y | ||
| 318 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
| 319 | CONFIG_FW_LOADER=y | ||
| 320 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
| 321 | CONFIG_EXTRA_FIRMWARE="" | ||
| 322 | # CONFIG_DEBUG_DRIVER is not set | ||
| 323 | # CONFIG_DEBUG_DEVRES is not set | ||
| 324 | # CONFIG_SYS_HYPERVISOR is not set | ||
| 325 | # CONFIG_MTD is not set | ||
| 326 | # CONFIG_PARPORT is not set | ||
| 327 | CONFIG_BLK_DEV=y | ||
| 328 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
| 329 | # CONFIG_BLK_DEV_LOOP is not set | ||
| 330 | CONFIG_BLK_DEV_RAM=y | ||
| 331 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
| 332 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
| 333 | # CONFIG_BLK_DEV_XIP is not set | ||
| 334 | # CONFIG_CDROM_PKTCDVD is not set | ||
| 335 | CONFIG_MISC_DEVICES=y | ||
| 336 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
| 337 | # CONFIG_C2PORT is not set | ||
| 338 | |||
| 339 | # | ||
| 340 | # EEPROM support | ||
| 341 | # | ||
| 342 | # CONFIG_EEPROM_93CX6 is not set | ||
| 343 | CONFIG_HAVE_IDE=y | ||
| 344 | # CONFIG_IDE is not set | ||
| 345 | |||
| 346 | # | ||
| 347 | # SCSI device support | ||
| 348 | # | ||
| 349 | # CONFIG_RAID_ATTRS is not set | ||
| 350 | # CONFIG_SCSI is not set | ||
| 351 | # CONFIG_SCSI_DMA is not set | ||
| 352 | # CONFIG_SCSI_NETLINK is not set | ||
| 353 | # CONFIG_ATA is not set | ||
| 354 | # CONFIG_MD is not set | ||
| 355 | # CONFIG_PHONE is not set | ||
| 356 | |||
| 357 | # | ||
| 358 | # Input device support | ||
| 359 | # | ||
| 360 | CONFIG_INPUT=y | ||
| 361 | CONFIG_INPUT_FF_MEMLESS=y | ||
| 362 | # CONFIG_INPUT_POLLDEV is not set | ||
| 363 | |||
| 364 | # | ||
| 365 | # Userland interfaces | ||
| 366 | # | ||
| 367 | CONFIG_INPUT_MOUSEDEV=y | ||
| 368 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 369 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
| 370 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
| 371 | # CONFIG_INPUT_JOYDEV is not set | ||
| 372 | # CONFIG_INPUT_EVDEV is not set | ||
| 373 | # CONFIG_INPUT_EVBUG is not set | ||
| 374 | |||
| 375 | # | ||
| 376 | # Hardware I/O ports | ||
| 377 | # | ||
| 378 | CONFIG_SERIO=y | ||
| 379 | CONFIG_SERIO_SERPORT=y | ||
| 380 | # CONFIG_SERIO_AMBAKMI is not set | ||
| 381 | # CONFIG_SERIO_RAW is not set | ||
| 382 | # CONFIG_GAMEPORT is not set | ||
| 383 | |||
| 384 | # | ||
| 385 | # Character devices | ||
| 386 | # | ||
| 387 | CONFIG_VT=y | ||
| 388 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
| 389 | CONFIG_VT_CONSOLE=y | ||
| 390 | CONFIG_HW_CONSOLE=y | ||
| 391 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
| 392 | CONFIG_DEVKMEM=y | ||
| 393 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
| 394 | |||
| 395 | # | ||
| 396 | # Serial drivers | ||
| 397 | # | ||
| 398 | # CONFIG_SERIAL_8250 is not set | ||
| 399 | |||
| 400 | # | ||
| 401 | # Non-8250 serial port support | ||
| 402 | # | ||
| 403 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
| 404 | CONFIG_SERIAL_AMBA_PL011=y | ||
| 405 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||
| 406 | CONFIG_SERIAL_CORE=y | ||
| 407 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
| 408 | CONFIG_UNIX98_PTYS=y | ||
| 409 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
| 410 | # CONFIG_LEGACY_PTYS is not set | ||
| 411 | # CONFIG_R3964 is not set | ||
| 412 | CONFIG_RAW_DRIVER=y | ||
| 413 | CONFIG_MAX_RAW_DEVS=8192 | ||
| 414 | # CONFIG_TCG_TPM is not set | ||
| 415 | # CONFIG_I2C is not set | ||
| 416 | # CONFIG_SPI is not set | ||
| 417 | |||
| 418 | # | ||
| 419 | # PPS support | ||
| 420 | # | ||
| 421 | # CONFIG_PPS is not set | ||
| 422 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
| 423 | CONFIG_GPIOLIB=y | ||
| 424 | # CONFIG_DEBUG_GPIO is not set | ||
| 425 | CONFIG_GPIO_SYSFS=y | ||
| 426 | |||
| 427 | # | ||
| 428 | # Memory mapped GPIO expanders: | ||
| 429 | # | ||
| 430 | CONFIG_GPIO_PL061=y | ||
| 431 | |||
| 432 | # | ||
| 433 | # I2C GPIO expanders: | ||
| 434 | # | ||
| 435 | |||
| 436 | # | ||
| 437 | # PCI GPIO expanders: | ||
| 438 | # | ||
| 439 | |||
| 440 | # | ||
| 441 | # SPI GPIO expanders: | ||
| 442 | # | ||
| 443 | |||
| 444 | # | ||
| 445 | # AC97 GPIO expanders: | ||
| 446 | # | ||
| 447 | # CONFIG_W1 is not set | ||
| 448 | # CONFIG_POWER_SUPPLY is not set | ||
| 449 | # CONFIG_HWMON is not set | ||
| 450 | # CONFIG_THERMAL is not set | ||
| 451 | # CONFIG_WATCHDOG is not set | ||
| 452 | CONFIG_SSB_POSSIBLE=y | ||
| 453 | |||
| 454 | # | ||
| 455 | # Sonics Silicon Backplane | ||
| 456 | # | ||
| 457 | # CONFIG_SSB is not set | ||
| 458 | |||
| 459 | # | ||
| 460 | # Multifunction device drivers | ||
| 461 | # | ||
| 462 | # CONFIG_MFD_CORE is not set | ||
| 463 | # CONFIG_MFD_SM501 is not set | ||
| 464 | # CONFIG_HTC_PASIC3 is not set | ||
| 465 | # CONFIG_MFD_TMIO is not set | ||
| 466 | # CONFIG_MFD_T7L66XB is not set | ||
| 467 | # CONFIG_MFD_TC6387XB is not set | ||
| 468 | # CONFIG_REGULATOR is not set | ||
| 469 | # CONFIG_MEDIA_SUPPORT is not set | ||
| 470 | |||
| 471 | # | ||
| 472 | # Graphics support | ||
| 473 | # | ||
| 474 | # CONFIG_VGASTATE is not set | ||
| 475 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
| 476 | # CONFIG_FB is not set | ||
| 477 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
| 478 | |||
| 479 | # | ||
| 480 | # Display device support | ||
| 481 | # | ||
| 482 | # CONFIG_DISPLAY_SUPPORT is not set | ||
| 483 | |||
| 484 | # | ||
| 485 | # Console display driver support | ||
| 486 | # | ||
| 487 | # CONFIG_VGA_CONSOLE is not set | ||
| 488 | CONFIG_DUMMY_CONSOLE=y | ||
| 489 | # CONFIG_HID_SUPPORT is not set | ||
| 490 | # CONFIG_USB_SUPPORT is not set | ||
| 491 | # CONFIG_MMC is not set | ||
| 492 | # CONFIG_MEMSTICK is not set | ||
| 493 | # CONFIG_NEW_LEDS is not set | ||
| 494 | # CONFIG_ACCESSIBILITY is not set | ||
| 495 | CONFIG_RTC_LIB=y | ||
| 496 | # CONFIG_RTC_CLASS is not set | ||
| 497 | # CONFIG_DMADEVICES is not set | ||
| 498 | # CONFIG_AUXDISPLAY is not set | ||
| 499 | # CONFIG_UIO is not set | ||
| 500 | |||
| 501 | # | ||
| 502 | # TI VLYNQ | ||
| 503 | # | ||
| 504 | # CONFIG_STAGING is not set | ||
| 505 | |||
| 506 | # | ||
| 507 | # File systems | ||
| 508 | # | ||
| 509 | CONFIG_EXT2_FS=y | ||
| 510 | CONFIG_EXT2_FS_XATTR=y | ||
| 511 | # CONFIG_EXT2_FS_POSIX_ACL is not set | ||
| 512 | CONFIG_EXT2_FS_SECURITY=y | ||
| 513 | # CONFIG_EXT2_FS_XIP is not set | ||
| 514 | CONFIG_EXT3_FS=y | ||
| 515 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
| 516 | CONFIG_EXT3_FS_XATTR=y | ||
| 517 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
| 518 | CONFIG_EXT3_FS_SECURITY=y | ||
| 519 | # CONFIG_EXT4_FS is not set | ||
| 520 | CONFIG_JBD=y | ||
| 521 | # CONFIG_JBD_DEBUG is not set | ||
| 522 | CONFIG_FS_MBCACHE=y | ||
| 523 | # CONFIG_REISERFS_FS is not set | ||
| 524 | # CONFIG_JFS_FS is not set | ||
| 525 | # CONFIG_FS_POSIX_ACL is not set | ||
| 526 | # CONFIG_XFS_FS is not set | ||
| 527 | # CONFIG_GFS2_FS is not set | ||
| 528 | # CONFIG_BTRFS_FS is not set | ||
| 529 | # CONFIG_NILFS2_FS is not set | ||
| 530 | CONFIG_FILE_LOCKING=y | ||
| 531 | CONFIG_FSNOTIFY=y | ||
| 532 | CONFIG_DNOTIFY=y | ||
| 533 | # CONFIG_INOTIFY is not set | ||
| 534 | CONFIG_INOTIFY_USER=y | ||
| 535 | # CONFIG_QUOTA is not set | ||
| 536 | # CONFIG_AUTOFS_FS is not set | ||
| 537 | CONFIG_AUTOFS4_FS=m | ||
| 538 | # CONFIG_FUSE_FS is not set | ||
| 539 | |||
| 540 | # | ||
| 541 | # Caches | ||
| 542 | # | ||
| 543 | # CONFIG_FSCACHE is not set | ||
| 544 | |||
| 545 | # | ||
| 546 | # CD-ROM/DVD Filesystems | ||
| 547 | # | ||
| 548 | # CONFIG_ISO9660_FS is not set | ||
| 549 | # CONFIG_UDF_FS is not set | ||
| 550 | |||
| 551 | # | ||
| 552 | # DOS/FAT/NT Filesystems | ||
| 553 | # | ||
| 554 | CONFIG_FAT_FS=m | ||
| 555 | CONFIG_MSDOS_FS=m | ||
| 556 | CONFIG_VFAT_FS=m | ||
| 557 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
| 558 | CONFIG_FAT_DEFAULT_IOCHARSET="ascii" | ||
| 559 | # CONFIG_NTFS_FS is not set | ||
| 560 | |||
| 561 | # | ||
| 562 | # Pseudo filesystems | ||
| 563 | # | ||
| 564 | CONFIG_PROC_FS=y | ||
| 565 | CONFIG_PROC_SYSCTL=y | ||
| 566 | CONFIG_PROC_PAGE_MONITOR=y | ||
| 567 | CONFIG_SYSFS=y | ||
| 568 | CONFIG_TMPFS=y | ||
| 569 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
| 570 | # CONFIG_HUGETLB_PAGE is not set | ||
| 571 | # CONFIG_CONFIGFS_FS is not set | ||
| 572 | CONFIG_MISC_FILESYSTEMS=y | ||
| 573 | # CONFIG_ADFS_FS is not set | ||
| 574 | # CONFIG_AFFS_FS is not set | ||
| 575 | # CONFIG_HFS_FS is not set | ||
| 576 | # CONFIG_HFSPLUS_FS is not set | ||
| 577 | # CONFIG_BEFS_FS is not set | ||
| 578 | # CONFIG_BFS_FS is not set | ||
| 579 | # CONFIG_EFS_FS is not set | ||
| 580 | # CONFIG_SQUASHFS is not set | ||
| 581 | # CONFIG_VXFS_FS is not set | ||
| 582 | # CONFIG_MINIX_FS is not set | ||
| 583 | # CONFIG_OMFS_FS is not set | ||
| 584 | # CONFIG_HPFS_FS is not set | ||
| 585 | # CONFIG_QNX4FS_FS is not set | ||
| 586 | # CONFIG_ROMFS_FS is not set | ||
| 587 | # CONFIG_SYSV_FS is not set | ||
| 588 | # CONFIG_UFS_FS is not set | ||
| 589 | |||
| 590 | # | ||
| 591 | # Partition Types | ||
| 592 | # | ||
| 593 | CONFIG_PARTITION_ADVANCED=y | ||
| 594 | # CONFIG_ACORN_PARTITION is not set | ||
| 595 | # CONFIG_OSF_PARTITION is not set | ||
| 596 | # CONFIG_AMIGA_PARTITION is not set | ||
| 597 | # CONFIG_ATARI_PARTITION is not set | ||
| 598 | # CONFIG_MAC_PARTITION is not set | ||
| 599 | CONFIG_MSDOS_PARTITION=y | ||
| 600 | # CONFIG_BSD_DISKLABEL is not set | ||
| 601 | # CONFIG_MINIX_SUBPARTITION is not set | ||
| 602 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
| 603 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
| 604 | # CONFIG_LDM_PARTITION is not set | ||
| 605 | # CONFIG_SGI_PARTITION is not set | ||
| 606 | # CONFIG_ULTRIX_PARTITION is not set | ||
| 607 | # CONFIG_SUN_PARTITION is not set | ||
| 608 | # CONFIG_KARMA_PARTITION is not set | ||
| 609 | # CONFIG_EFI_PARTITION is not set | ||
| 610 | # CONFIG_SYSV68_PARTITION is not set | ||
| 611 | CONFIG_NLS=y | ||
| 612 | CONFIG_NLS_DEFAULT="utf8" | ||
| 613 | CONFIG_NLS_CODEPAGE_437=y | ||
| 614 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
| 615 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
| 616 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
| 617 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
| 618 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
| 619 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
| 620 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
| 621 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
| 622 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
| 623 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
| 624 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
| 625 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
| 626 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
| 627 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
| 628 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
| 629 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
| 630 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
| 631 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
| 632 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
| 633 | # CONFIG_NLS_ISO8859_8 is not set | ||
| 634 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
| 635 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
| 636 | CONFIG_NLS_ASCII=m | ||
| 637 | # CONFIG_NLS_ISO8859_1 is not set | ||
| 638 | # CONFIG_NLS_ISO8859_2 is not set | ||
| 639 | # CONFIG_NLS_ISO8859_3 is not set | ||
| 640 | # CONFIG_NLS_ISO8859_4 is not set | ||
| 641 | # CONFIG_NLS_ISO8859_5 is not set | ||
| 642 | # CONFIG_NLS_ISO8859_6 is not set | ||
| 643 | # CONFIG_NLS_ISO8859_7 is not set | ||
| 644 | # CONFIG_NLS_ISO8859_9 is not set | ||
| 645 | # CONFIG_NLS_ISO8859_13 is not set | ||
| 646 | # CONFIG_NLS_ISO8859_14 is not set | ||
| 647 | # CONFIG_NLS_ISO8859_15 is not set | ||
| 648 | # CONFIG_NLS_KOI8_R is not set | ||
| 649 | # CONFIG_NLS_KOI8_U is not set | ||
| 650 | # CONFIG_NLS_UTF8 is not set | ||
| 651 | |||
| 652 | # | ||
| 653 | # Kernel hacking | ||
| 654 | # | ||
| 655 | # CONFIG_PRINTK_TIME is not set | ||
| 656 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
| 657 | CONFIG_ENABLE_MUST_CHECK=y | ||
| 658 | CONFIG_FRAME_WARN=1024 | ||
| 659 | CONFIG_MAGIC_SYSRQ=y | ||
| 660 | # CONFIG_STRIP_ASM_SYMS is not set | ||
| 661 | # CONFIG_UNUSED_SYMBOLS is not set | ||
| 662 | CONFIG_DEBUG_FS=y | ||
| 663 | # CONFIG_HEADERS_CHECK is not set | ||
| 664 | CONFIG_DEBUG_KERNEL=y | ||
| 665 | # CONFIG_DEBUG_SHIRQ is not set | ||
| 666 | CONFIG_DETECT_SOFTLOCKUP=y | ||
| 667 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
| 668 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
| 669 | CONFIG_DETECT_HUNG_TASK=y | ||
| 670 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
| 671 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
| 672 | CONFIG_SCHED_DEBUG=y | ||
| 673 | # CONFIG_SCHEDSTATS is not set | ||
| 674 | # CONFIG_TIMER_STATS is not set | ||
| 675 | # CONFIG_DEBUG_OBJECTS is not set | ||
| 676 | # CONFIG_SLUB_DEBUG_ON is not set | ||
| 677 | # CONFIG_SLUB_STATS is not set | ||
| 678 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
| 679 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
| 680 | # CONFIG_RT_MUTEX_TESTER is not set | ||
| 681 | CONFIG_DEBUG_SPINLOCK=y | ||
| 682 | # CONFIG_DEBUG_MUTEXES is not set | ||
| 683 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
| 684 | # CONFIG_PROVE_LOCKING is not set | ||
| 685 | # CONFIG_LOCK_STAT is not set | ||
| 686 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
| 687 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
| 688 | # CONFIG_DEBUG_KOBJECT is not set | ||
| 689 | CONFIG_DEBUG_BUGVERBOSE=y | ||
| 690 | CONFIG_DEBUG_INFO=y | ||
| 691 | # CONFIG_DEBUG_VM is not set | ||
| 692 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
| 693 | CONFIG_DEBUG_MEMORY_INIT=y | ||
| 694 | # CONFIG_DEBUG_LIST is not set | ||
| 695 | # CONFIG_DEBUG_SG is not set | ||
| 696 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
| 697 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
| 698 | CONFIG_FRAME_POINTER=y | ||
| 699 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
| 700 | # CONFIG_RCU_TORTURE_TEST is not set | ||
| 701 | CONFIG_RCU_CPU_STALL_DETECTOR=y | ||
| 702 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
| 703 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
| 704 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
| 705 | # CONFIG_FAULT_INJECTION is not set | ||
| 706 | # CONFIG_LATENCYTOP is not set | ||
| 707 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
| 708 | # CONFIG_PAGE_POISONING is not set | ||
| 709 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
| 710 | CONFIG_TRACING_SUPPORT=y | ||
| 711 | CONFIG_FTRACE=y | ||
| 712 | # CONFIG_FUNCTION_TRACER is not set | ||
| 713 | # CONFIG_IRQSOFF_TRACER is not set | ||
| 714 | # CONFIG_SCHED_TRACER is not set | ||
| 715 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
| 716 | # CONFIG_BOOT_TRACER is not set | ||
| 717 | CONFIG_BRANCH_PROFILE_NONE=y | ||
| 718 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
| 719 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
| 720 | # CONFIG_STACK_TRACER is not set | ||
| 721 | # CONFIG_KMEMTRACE is not set | ||
| 722 | # CONFIG_WORKQUEUE_TRACER is not set | ||
| 723 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
| 724 | # CONFIG_DYNAMIC_DEBUG is not set | ||
| 725 | # CONFIG_SAMPLES is not set | ||
| 726 | CONFIG_HAVE_ARCH_KGDB=y | ||
| 727 | # CONFIG_KGDB is not set | ||
| 728 | # CONFIG_DEBUG_USER is not set | ||
| 729 | # CONFIG_DEBUG_ERRORS is not set | ||
| 730 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
| 731 | # CONFIG_DEBUG_LL is not set | ||
| 732 | |||
| 733 | # | ||
| 734 | # Security options | ||
| 735 | # | ||
| 736 | # CONFIG_KEYS is not set | ||
| 737 | # CONFIG_SECURITY is not set | ||
| 738 | # CONFIG_SECURITYFS is not set | ||
| 739 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
| 740 | # CONFIG_CRYPTO is not set | ||
| 741 | # CONFIG_BINARY_PRINTF is not set | ||
| 742 | |||
| 743 | # | ||
| 744 | # Library routines | ||
| 745 | # | ||
| 746 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
| 747 | # CONFIG_CRC_CCITT is not set | ||
| 748 | # CONFIG_CRC16 is not set | ||
| 749 | # CONFIG_CRC_T10DIF is not set | ||
| 750 | # CONFIG_CRC_ITU_T is not set | ||
| 751 | # CONFIG_CRC32 is not set | ||
| 752 | # CONFIG_CRC7 is not set | ||
| 753 | # CONFIG_LIBCRC32C is not set | ||
| 754 | CONFIG_ZLIB_INFLATE=y | ||
| 755 | CONFIG_DECOMPRESS_GZIP=y | ||
| 756 | CONFIG_DECOMPRESS_BZIP2=y | ||
| 757 | CONFIG_DECOMPRESS_LZMA=y | ||
| 758 | CONFIG_HAS_IOMEM=y | ||
| 759 | CONFIG_HAS_IOPORT=y | ||
| 760 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/arm/configs/stamp9g20_defconfig b/arch/arm/configs/stamp9g20_defconfig new file mode 100644 index 000000000000..06a8293c61ca --- /dev/null +++ b/arch/arm/configs/stamp9g20_defconfig | |||
| @@ -0,0 +1,1456 @@ | |||
| 1 | # | ||
| 2 | # Automatically generated make config: don't edit | ||
| 3 | # Linux kernel version: 2.6.34-rc1 | ||
| 4 | # Wed Mar 17 16:38:03 2010 | ||
| 5 | # | ||
| 6 | CONFIG_ARM=y | ||
| 7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | ||
| 8 | CONFIG_GENERIC_GPIO=y | ||
| 9 | CONFIG_GENERIC_TIME=y | ||
| 10 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
| 11 | CONFIG_HAVE_PROC_CPU=y | ||
| 12 | CONFIG_GENERIC_HARDIRQS=y | ||
| 13 | CONFIG_STACKTRACE_SUPPORT=y | ||
| 14 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
| 15 | CONFIG_LOCKDEP_SUPPORT=y | ||
| 16 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
| 17 | CONFIG_HARDIRQS_SW_RESEND=y | ||
| 18 | CONFIG_GENERIC_IRQ_PROBE=y | ||
| 19 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
| 20 | CONFIG_GENERIC_HWEIGHT=y | ||
| 21 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
| 22 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
| 23 | CONFIG_VECTORS_BASE=0xffff0000 | ||
| 24 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
| 25 | CONFIG_CONSTRUCTORS=y | ||
| 26 | |||
| 27 | # | ||
| 28 | # General setup | ||
| 29 | # | ||
| 30 | CONFIG_EXPERIMENTAL=y | ||
| 31 | CONFIG_BROKEN_ON_SMP=y | ||
| 32 | CONFIG_LOCK_KERNEL=y | ||
| 33 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
| 34 | CONFIG_LOCALVERSION="" | ||
| 35 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 36 | CONFIG_HAVE_KERNEL_GZIP=y | ||
| 37 | CONFIG_HAVE_KERNEL_LZO=y | ||
| 38 | CONFIG_KERNEL_GZIP=y | ||
| 39 | # CONFIG_KERNEL_BZIP2 is not set | ||
| 40 | # CONFIG_KERNEL_LZMA is not set | ||
| 41 | # CONFIG_KERNEL_LZO is not set | ||
| 42 | # CONFIG_SWAP is not set | ||
| 43 | CONFIG_SYSVIPC=y | ||
| 44 | CONFIG_SYSVIPC_SYSCTL=y | ||
| 45 | # CONFIG_POSIX_MQUEUE is not set | ||
| 46 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
| 47 | # CONFIG_TASKSTATS is not set | ||
| 48 | # CONFIG_AUDIT is not set | ||
| 49 | |||
| 50 | # | ||
| 51 | # RCU Subsystem | ||
| 52 | # | ||
| 53 | # CONFIG_TREE_RCU is not set | ||
| 54 | CONFIG_TREE_PREEMPT_RCU=y | ||
| 55 | # CONFIG_TINY_RCU is not set | ||
| 56 | # CONFIG_RCU_TRACE is not set | ||
| 57 | CONFIG_RCU_FANOUT=32 | ||
| 58 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
| 59 | # CONFIG_TREE_RCU_TRACE is not set | ||
| 60 | # CONFIG_IKCONFIG is not set | ||
| 61 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 62 | # CONFIG_CGROUPS is not set | ||
| 63 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
| 64 | # CONFIG_RELAY is not set | ||
| 65 | CONFIG_NAMESPACES=y | ||
| 66 | # CONFIG_UTS_NS is not set | ||
| 67 | # CONFIG_IPC_NS is not set | ||
| 68 | # CONFIG_USER_NS is not set | ||
| 69 | # CONFIG_PID_NS is not set | ||
| 70 | # CONFIG_NET_NS is not set | ||
| 71 | CONFIG_BLK_DEV_INITRD=y | ||
| 72 | CONFIG_INITRAMFS_SOURCE="" | ||
| 73 | CONFIG_RD_GZIP=y | ||
| 74 | CONFIG_RD_BZIP2=y | ||
| 75 | CONFIG_RD_LZMA=y | ||
| 76 | CONFIG_RD_LZO=y | ||
| 77 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
| 78 | CONFIG_SYSCTL=y | ||
| 79 | CONFIG_ANON_INODES=y | ||
| 80 | # CONFIG_EMBEDDED is not set | ||
| 81 | CONFIG_UID16=y | ||
| 82 | CONFIG_SYSCTL_SYSCALL=y | ||
| 83 | CONFIG_KALLSYMS=y | ||
| 84 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
| 85 | CONFIG_HOTPLUG=y | ||
| 86 | CONFIG_PRINTK=y | ||
| 87 | CONFIG_BUG=y | ||
| 88 | CONFIG_ELF_CORE=y | ||
| 89 | CONFIG_BASE_FULL=y | ||
| 90 | CONFIG_FUTEX=y | ||
| 91 | CONFIG_EPOLL=y | ||
| 92 | CONFIG_SIGNALFD=y | ||
| 93 | CONFIG_TIMERFD=y | ||
| 94 | CONFIG_EVENTFD=y | ||
| 95 | CONFIG_SHMEM=y | ||
| 96 | CONFIG_AIO=y | ||
| 97 | CONFIG_HAVE_PERF_EVENTS=y | ||
| 98 | CONFIG_PERF_USE_VMALLOC=y | ||
| 99 | |||
| 100 | # | ||
| 101 | # Kernel Performance Events And Counters | ||
| 102 | # | ||
| 103 | # CONFIG_PERF_EVENTS is not set | ||
| 104 | # CONFIG_PERF_COUNTERS is not set | ||
| 105 | CONFIG_VM_EVENT_COUNTERS=y | ||
| 106 | CONFIG_COMPAT_BRK=y | ||
| 107 | CONFIG_SLAB=y | ||
| 108 | # CONFIG_SLUB is not set | ||
| 109 | # CONFIG_SLOB is not set | ||
| 110 | # CONFIG_PROFILING is not set | ||
| 111 | CONFIG_HAVE_OPROFILE=y | ||
| 112 | # CONFIG_KPROBES is not set | ||
| 113 | CONFIG_HAVE_KPROBES=y | ||
| 114 | CONFIG_HAVE_KRETPROBES=y | ||
| 115 | CONFIG_HAVE_CLK=y | ||
| 116 | |||
| 117 | # | ||
| 118 | # GCOV-based kernel profiling | ||
| 119 | # | ||
| 120 | # CONFIG_SLOW_WORK is not set | ||
| 121 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
| 122 | CONFIG_SLABINFO=y | ||
| 123 | CONFIG_RT_MUTEXES=y | ||
| 124 | CONFIG_BASE_SMALL=0 | ||
| 125 | CONFIG_MODULES=y | ||
| 126 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
| 127 | CONFIG_MODULE_UNLOAD=y | ||
| 128 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
| 129 | # CONFIG_MODVERSIONS is not set | ||
| 130 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
| 131 | CONFIG_BLOCK=y | ||
| 132 | # CONFIG_LBDAF is not set | ||
| 133 | # CONFIG_BLK_DEV_BSG is not set | ||
| 134 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
| 135 | |||
| 136 | # | ||
| 137 | # IO Schedulers | ||
| 138 | # | ||
| 139 | CONFIG_IOSCHED_NOOP=y | ||
| 140 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 141 | CONFIG_IOSCHED_CFQ=y | ||
| 142 | # CONFIG_DEFAULT_DEADLINE is not set | ||
| 143 | CONFIG_DEFAULT_CFQ=y | ||
| 144 | # CONFIG_DEFAULT_NOOP is not set | ||
| 145 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
| 146 | # CONFIG_INLINE_SPIN_TRYLOCK is not set | ||
| 147 | # CONFIG_INLINE_SPIN_TRYLOCK_BH is not set | ||
| 148 | # CONFIG_INLINE_SPIN_LOCK is not set | ||
| 149 | # CONFIG_INLINE_SPIN_LOCK_BH is not set | ||
| 150 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set | ||
| 151 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set | ||
| 152 | # CONFIG_INLINE_SPIN_UNLOCK is not set | ||
| 153 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set | ||
| 154 | # CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set | ||
| 155 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set | ||
| 156 | # CONFIG_INLINE_READ_TRYLOCK is not set | ||
| 157 | # CONFIG_INLINE_READ_LOCK is not set | ||
| 158 | # CONFIG_INLINE_READ_LOCK_BH is not set | ||
| 159 | # CONFIG_INLINE_READ_LOCK_IRQ is not set | ||
| 160 | # CONFIG_INLINE_READ_LOCK_IRQSAVE is not set | ||
| 161 | # CONFIG_INLINE_READ_UNLOCK is not set | ||
| 162 | # CONFIG_INLINE_READ_UNLOCK_BH is not set | ||
| 163 | # CONFIG_INLINE_READ_UNLOCK_IRQ is not set | ||
| 164 | # CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set | ||
| 165 | # CONFIG_INLINE_WRITE_TRYLOCK is not set | ||
| 166 | # CONFIG_INLINE_WRITE_LOCK is not set | ||
| 167 | # CONFIG_INLINE_WRITE_LOCK_BH is not set | ||
| 168 | # CONFIG_INLINE_WRITE_LOCK_IRQ is not set | ||
| 169 | # CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set | ||
| 170 | # CONFIG_INLINE_WRITE_UNLOCK is not set | ||
| 171 | # CONFIG_INLINE_WRITE_UNLOCK_BH is not set | ||
| 172 | # CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set | ||
| 173 | # CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set | ||
| 174 | # CONFIG_MUTEX_SPIN_ON_OWNER is not set | ||
| 175 | CONFIG_FREEZER=y | ||
| 176 | |||
| 177 | # | ||
| 178 | # System Type | ||
| 179 | # | ||
| 180 | CONFIG_MMU=y | ||
| 181 | # CONFIG_ARCH_AAEC2000 is not set | ||
| 182 | # CONFIG_ARCH_INTEGRATOR is not set | ||
| 183 | # CONFIG_ARCH_REALVIEW is not set | ||
| 184 | # CONFIG_ARCH_VERSATILE is not set | ||
| 185 | CONFIG_ARCH_AT91=y | ||
| 186 | # CONFIG_ARCH_CLPS711X is not set | ||
| 187 | # CONFIG_ARCH_GEMINI is not set | ||
| 188 | # CONFIG_ARCH_EBSA110 is not set | ||
| 189 | # CONFIG_ARCH_EP93XX is not set | ||
| 190 | # CONFIG_ARCH_FOOTBRIDGE is not set | ||
| 191 | # CONFIG_ARCH_MXC is not set | ||
| 192 | # CONFIG_ARCH_STMP3XXX is not set | ||
| 193 | # CONFIG_ARCH_NETX is not set | ||
| 194 | # CONFIG_ARCH_H720X is not set | ||
| 195 | # CONFIG_ARCH_NOMADIK is not set | ||
| 196 | # CONFIG_ARCH_IOP13XX is not set | ||
| 197 | # CONFIG_ARCH_IOP32X is not set | ||
| 198 | # CONFIG_ARCH_IOP33X is not set | ||
| 199 | # CONFIG_ARCH_IXP23XX is not set | ||
| 200 | # CONFIG_ARCH_IXP2000 is not set | ||
| 201 | # CONFIG_ARCH_IXP4XX is not set | ||
| 202 | # CONFIG_ARCH_L7200 is not set | ||
| 203 | # CONFIG_ARCH_DOVE is not set | ||
| 204 | # CONFIG_ARCH_KIRKWOOD is not set | ||
| 205 | # CONFIG_ARCH_LOKI is not set | ||
| 206 | # CONFIG_ARCH_MV78XX0 is not set | ||
| 207 | # CONFIG_ARCH_ORION5X is not set | ||
| 208 | # CONFIG_ARCH_MMP is not set | ||
| 209 | # CONFIG_ARCH_KS8695 is not set | ||
| 210 | # CONFIG_ARCH_NS9XXX is not set | ||
| 211 | # CONFIG_ARCH_W90X900 is not set | ||
| 212 | # CONFIG_ARCH_NUC93X is not set | ||
| 213 | # CONFIG_ARCH_PNX4008 is not set | ||
| 214 | # CONFIG_ARCH_PXA is not set | ||
| 215 | # CONFIG_ARCH_MSM is not set | ||
| 216 | # CONFIG_ARCH_RPC is not set | ||
| 217 | # CONFIG_ARCH_SA1100 is not set | ||
| 218 | # CONFIG_ARCH_S3C2410 is not set | ||
| 219 | # CONFIG_ARCH_S3C64XX is not set | ||
| 220 | # CONFIG_ARCH_S5PC1XX is not set | ||
| 221 | # CONFIG_ARCH_SHARK is not set | ||
| 222 | # CONFIG_ARCH_LH7A40X is not set | ||
| 223 | # CONFIG_ARCH_U300 is not set | ||
| 224 | # CONFIG_ARCH_DAVINCI is not set | ||
| 225 | # CONFIG_ARCH_OMAP is not set | ||
| 226 | # CONFIG_ARCH_BCMRING is not set | ||
| 227 | # CONFIG_ARCH_U8500 is not set | ||
| 228 | CONFIG_HAVE_AT91_USART3=y | ||
| 229 | CONFIG_HAVE_AT91_USART4=y | ||
| 230 | CONFIG_HAVE_AT91_USART5=y | ||
| 231 | |||
| 232 | # | ||
| 233 | # Atmel AT91 System-on-Chip | ||
| 234 | # | ||
| 235 | # CONFIG_ARCH_AT91RM9200 is not set | ||
| 236 | # CONFIG_ARCH_AT91SAM9260 is not set | ||
| 237 | # CONFIG_ARCH_AT91SAM9261 is not set | ||
| 238 | # CONFIG_ARCH_AT91SAM9G10 is not set | ||
| 239 | # CONFIG_ARCH_AT91SAM9263 is not set | ||
| 240 | # CONFIG_ARCH_AT91SAM9RL is not set | ||
| 241 | CONFIG_ARCH_AT91SAM9G20=y | ||
| 242 | # CONFIG_ARCH_AT91SAM9G45 is not set | ||
| 243 | # CONFIG_ARCH_AT91CAP9 is not set | ||
| 244 | # CONFIG_ARCH_AT572D940HF is not set | ||
| 245 | # CONFIG_ARCH_AT91X40 is not set | ||
| 246 | CONFIG_AT91_PMC_UNIT=y | ||
| 247 | |||
| 248 | # | ||
| 249 | # AT91SAM9G20 Board Type | ||
| 250 | # | ||
| 251 | # CONFIG_MACH_AT91SAM9G20EK is not set | ||
| 252 | # CONFIG_MACH_AT91SAM9G20EK_2MMC is not set | ||
| 253 | # CONFIG_MACH_CPU9G20 is not set | ||
| 254 | CONFIG_MACH_PORTUXG20=y | ||
| 255 | CONFIG_MACH_STAMP9G20=y | ||
| 256 | |||
| 257 | # | ||
| 258 | # AT91 Board Options | ||
| 259 | # | ||
| 260 | |||
| 261 | # | ||
| 262 | # AT91 Feature Selections | ||
| 263 | # | ||
| 264 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 265 | CONFIG_AT91_SLOW_CLOCK=y | ||
| 266 | CONFIG_AT91_TIMER_HZ=100 | ||
| 267 | CONFIG_AT91_EARLY_DBGU=y | ||
| 268 | # CONFIG_AT91_EARLY_USART0 is not set | ||
| 269 | # CONFIG_AT91_EARLY_USART1 is not set | ||
| 270 | # CONFIG_AT91_EARLY_USART2 is not set | ||
| 271 | # CONFIG_AT91_EARLY_USART3 is not set | ||
| 272 | # CONFIG_AT91_EARLY_USART4 is not set | ||
| 273 | # CONFIG_AT91_EARLY_USART5 is not set | ||
| 274 | |||
| 275 | # | ||
| 276 | # Processor Type | ||
| 277 | # | ||
| 278 | CONFIG_CPU_ARM926T=y | ||
| 279 | CONFIG_CPU_32v5=y | ||
| 280 | CONFIG_CPU_ABRT_EV5TJ=y | ||
| 281 | CONFIG_CPU_PABRT_LEGACY=y | ||
| 282 | CONFIG_CPU_CACHE_VIVT=y | ||
| 283 | CONFIG_CPU_COPY_V4WB=y | ||
| 284 | CONFIG_CPU_TLB_V4WBI=y | ||
| 285 | CONFIG_CPU_CP15=y | ||
| 286 | CONFIG_CPU_CP15_MMU=y | ||
| 287 | |||
| 288 | # | ||
| 289 | # Processor Features | ||
| 290 | # | ||
| 291 | CONFIG_ARM_THUMB=y | ||
| 292 | # CONFIG_CPU_ICACHE_DISABLE is not set | ||
| 293 | # CONFIG_CPU_DCACHE_DISABLE is not set | ||
| 294 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
| 295 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
| 296 | CONFIG_ARM_L1_CACHE_SHIFT=5 | ||
| 297 | |||
| 298 | # | ||
| 299 | # Bus support | ||
| 300 | # | ||
| 301 | # CONFIG_PCI_SYSCALL is not set | ||
| 302 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
| 303 | # CONFIG_PCCARD is not set | ||
| 304 | |||
| 305 | # | ||
| 306 | # Kernel Features | ||
| 307 | # | ||
| 308 | CONFIG_TICK_ONESHOT=y | ||
| 309 | CONFIG_NO_HZ=y | ||
| 310 | CONFIG_HIGH_RES_TIMERS=y | ||
| 311 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
| 312 | CONFIG_VMSPLIT_3G=y | ||
| 313 | # CONFIG_VMSPLIT_2G is not set | ||
| 314 | # CONFIG_VMSPLIT_1G is not set | ||
| 315 | CONFIG_PAGE_OFFSET=0xC0000000 | ||
| 316 | # CONFIG_PREEMPT_NONE is not set | ||
| 317 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
| 318 | CONFIG_PREEMPT=y | ||
| 319 | CONFIG_HZ=100 | ||
| 320 | CONFIG_AEABI=y | ||
| 321 | # CONFIG_OABI_COMPAT is not set | ||
| 322 | # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set | ||
| 323 | # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set | ||
| 324 | # CONFIG_HIGHMEM is not set | ||
| 325 | CONFIG_SELECT_MEMORY_MODEL=y | ||
| 326 | CONFIG_FLATMEM_MANUAL=y | ||
| 327 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
| 328 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
| 329 | CONFIG_FLATMEM=y | ||
| 330 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
| 331 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
| 332 | CONFIG_SPLIT_PTLOCK_CPUS=999999 | ||
| 333 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
| 334 | CONFIG_ZONE_DMA_FLAG=0 | ||
| 335 | CONFIG_VIRT_TO_BUS=y | ||
| 336 | # CONFIG_KSM is not set | ||
| 337 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
| 338 | # CONFIG_LEDS is not set | ||
| 339 | CONFIG_ALIGNMENT_TRAP=y | ||
| 340 | # CONFIG_UACCESS_WITH_MEMCPY is not set | ||
| 341 | |||
| 342 | # | ||
| 343 | # Boot options | ||
| 344 | # | ||
| 345 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 346 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 347 | CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw" | ||
| 348 | # CONFIG_XIP_KERNEL is not set | ||
| 349 | CONFIG_KEXEC=y | ||
| 350 | CONFIG_ATAGS_PROC=y | ||
| 351 | |||
| 352 | # | ||
| 353 | # CPU Power Management | ||
| 354 | # | ||
| 355 | CONFIG_CPU_IDLE=y | ||
| 356 | CONFIG_CPU_IDLE_GOV_LADDER=y | ||
| 357 | CONFIG_CPU_IDLE_GOV_MENU=y | ||
| 358 | |||
| 359 | # | ||
| 360 | # Floating point emulation | ||
| 361 | # | ||
| 362 | |||
| 363 | # | ||
| 364 | # At least one emulation must be selected | ||
| 365 | # | ||
| 366 | # CONFIG_VFP is not set | ||
| 367 | |||
| 368 | # | ||
| 369 | # Userspace binary formats | ||
| 370 | # | ||
| 371 | CONFIG_BINFMT_ELF=y | ||
| 372 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
| 373 | CONFIG_HAVE_AOUT=y | ||
| 374 | # CONFIG_BINFMT_AOUT is not set | ||
| 375 | # CONFIG_BINFMT_MISC is not set | ||
| 376 | |||
| 377 | # | ||
| 378 | # Power management options | ||
| 379 | # | ||
| 380 | CONFIG_PM=y | ||
| 381 | # CONFIG_PM_DEBUG is not set | ||
| 382 | CONFIG_PM_SLEEP=y | ||
| 383 | CONFIG_SUSPEND=y | ||
| 384 | CONFIG_SUSPEND_FREEZER=y | ||
| 385 | # CONFIG_APM_EMULATION is not set | ||
| 386 | # CONFIG_PM_RUNTIME is not set | ||
| 387 | CONFIG_PM_OPS=y | ||
| 388 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
| 389 | CONFIG_NET=y | ||
| 390 | |||
| 391 | # | ||
| 392 | # Networking options | ||
| 393 | # | ||
| 394 | CONFIG_PACKET=y | ||
| 395 | CONFIG_UNIX=y | ||
| 396 | # CONFIG_NET_KEY is not set | ||
| 397 | CONFIG_INET=y | ||
| 398 | # CONFIG_IP_MULTICAST is not set | ||
| 399 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
| 400 | CONFIG_IP_FIB_HASH=y | ||
| 401 | # CONFIG_IP_PNP is not set | ||
| 402 | # CONFIG_NET_IPIP is not set | ||
| 403 | # CONFIG_NET_IPGRE is not set | ||
| 404 | # CONFIG_ARPD is not set | ||
| 405 | # CONFIG_SYN_COOKIES is not set | ||
| 406 | # CONFIG_INET_AH is not set | ||
| 407 | # CONFIG_INET_ESP is not set | ||
| 408 | # CONFIG_INET_IPCOMP is not set | ||
| 409 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
| 410 | # CONFIG_INET_TUNNEL is not set | ||
| 411 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
| 412 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
| 413 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
| 414 | # CONFIG_INET_LRO is not set | ||
| 415 | CONFIG_INET_DIAG=y | ||
| 416 | CONFIG_INET_TCP_DIAG=y | ||
| 417 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
| 418 | CONFIG_TCP_CONG_CUBIC=y | ||
| 419 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
| 420 | # CONFIG_TCP_MD5SIG is not set | ||
| 421 | # CONFIG_IPV6 is not set | ||
| 422 | # CONFIG_NETWORK_SECMARK is not set | ||
| 423 | # CONFIG_NETFILTER is not set | ||
| 424 | # CONFIG_IP_DCCP is not set | ||
| 425 | # CONFIG_IP_SCTP is not set | ||
| 426 | # CONFIG_RDS is not set | ||
| 427 | # CONFIG_TIPC is not set | ||
| 428 | # CONFIG_ATM is not set | ||
| 429 | # CONFIG_BRIDGE is not set | ||
| 430 | # CONFIG_NET_DSA is not set | ||
| 431 | # CONFIG_VLAN_8021Q is not set | ||
| 432 | # CONFIG_DECNET is not set | ||
| 433 | # CONFIG_LLC2 is not set | ||
| 434 | # CONFIG_IPX is not set | ||
| 435 | # CONFIG_ATALK is not set | ||
| 436 | # CONFIG_X25 is not set | ||
| 437 | # CONFIG_LAPB is not set | ||
| 438 | # CONFIG_ECONET is not set | ||
| 439 | # CONFIG_WAN_ROUTER is not set | ||
| 440 | # CONFIG_PHONET is not set | ||
| 441 | # CONFIG_IEEE802154 is not set | ||
| 442 | # CONFIG_NET_SCHED is not set | ||
| 443 | # CONFIG_DCB is not set | ||
| 444 | |||
| 445 | # | ||
| 446 | # Network testing | ||
| 447 | # | ||
| 448 | # CONFIG_NET_PKTGEN is not set | ||
| 449 | # CONFIG_HAMRADIO is not set | ||
| 450 | # CONFIG_CAN is not set | ||
| 451 | # CONFIG_IRDA is not set | ||
| 452 | # CONFIG_BT is not set | ||
| 453 | # CONFIG_AF_RXRPC is not set | ||
| 454 | # CONFIG_WIRELESS is not set | ||
| 455 | # CONFIG_WIMAX is not set | ||
| 456 | # CONFIG_RFKILL is not set | ||
| 457 | # CONFIG_NET_9P is not set | ||
| 458 | |||
| 459 | # | ||
| 460 | # Device Drivers | ||
| 461 | # | ||
| 462 | |||
| 463 | # | ||
| 464 | # Generic Driver Options | ||
| 465 | # | ||
| 466 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 467 | # CONFIG_DEVTMPFS is not set | ||
| 468 | CONFIG_STANDALONE=y | ||
| 469 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
| 470 | CONFIG_FW_LOADER=y | ||
| 471 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
| 472 | CONFIG_EXTRA_FIRMWARE="" | ||
| 473 | # CONFIG_SYS_HYPERVISOR is not set | ||
| 474 | # CONFIG_CONNECTOR is not set | ||
| 475 | CONFIG_MTD=y | ||
| 476 | # CONFIG_MTD_DEBUG is not set | ||
| 477 | # CONFIG_MTD_TESTS is not set | ||
| 478 | CONFIG_MTD_CONCAT=y | ||
| 479 | CONFIG_MTD_PARTITIONS=y | ||
| 480 | # CONFIG_MTD_REDBOOT_PARTS is not set | ||
| 481 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 482 | # CONFIG_MTD_AFS_PARTS is not set | ||
| 483 | # CONFIG_MTD_AR7_PARTS is not set | ||
| 484 | |||
| 485 | # | ||
| 486 | # User Modules And Translation Layers | ||
| 487 | # | ||
| 488 | CONFIG_MTD_CHAR=y | ||
| 489 | CONFIG_MTD_BLKDEVS=y | ||
| 490 | CONFIG_MTD_BLOCK=y | ||
| 491 | # CONFIG_FTL is not set | ||
| 492 | # CONFIG_NFTL is not set | ||
| 493 | # CONFIG_INFTL is not set | ||
| 494 | # CONFIG_RFD_FTL is not set | ||
| 495 | # CONFIG_SSFDC is not set | ||
| 496 | # CONFIG_MTD_OOPS is not set | ||
| 497 | |||
| 498 | # | ||
| 499 | # RAM/ROM/Flash chip drivers | ||
| 500 | # | ||
| 501 | # CONFIG_MTD_CFI is not set | ||
| 502 | # CONFIG_MTD_JEDECPROBE is not set | ||
| 503 | CONFIG_MTD_MAP_BANK_WIDTH_1=y | ||
| 504 | CONFIG_MTD_MAP_BANK_WIDTH_2=y | ||
| 505 | CONFIG_MTD_MAP_BANK_WIDTH_4=y | ||
| 506 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | ||
| 507 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | ||
| 508 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | ||
| 509 | CONFIG_MTD_CFI_I1=y | ||
| 510 | CONFIG_MTD_CFI_I2=y | ||
| 511 | # CONFIG_MTD_CFI_I4 is not set | ||
| 512 | # CONFIG_MTD_CFI_I8 is not set | ||
| 513 | # CONFIG_MTD_RAM is not set | ||
| 514 | # CONFIG_MTD_ROM is not set | ||
| 515 | # CONFIG_MTD_ABSENT is not set | ||
| 516 | |||
| 517 | # | ||
| 518 | # Mapping drivers for chip access | ||
| 519 | # | ||
| 520 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | ||
| 521 | # CONFIG_MTD_PLATRAM is not set | ||
| 522 | |||
| 523 | # | ||
| 524 | # Self-contained MTD device drivers | ||
| 525 | # | ||
| 526 | CONFIG_MTD_DATAFLASH=y | ||
| 527 | # CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set | ||
| 528 | # CONFIG_MTD_DATAFLASH_OTP is not set | ||
| 529 | # CONFIG_MTD_M25P80 is not set | ||
| 530 | # CONFIG_MTD_SST25L is not set | ||
| 531 | # CONFIG_MTD_SLRAM is not set | ||
| 532 | # CONFIG_MTD_PHRAM is not set | ||
| 533 | # CONFIG_MTD_MTDRAM is not set | ||
| 534 | # CONFIG_MTD_BLOCK2MTD is not set | ||
| 535 | |||
| 536 | # | ||
| 537 | # Disk-On-Chip Device Drivers | ||
| 538 | # | ||
| 539 | # CONFIG_MTD_DOC2000 is not set | ||
| 540 | # CONFIG_MTD_DOC2001 is not set | ||
| 541 | # CONFIG_MTD_DOC2001PLUS is not set | ||
| 542 | CONFIG_MTD_NAND=y | ||
| 543 | # CONFIG_MTD_NAND_VERIFY_WRITE is not set | ||
| 544 | # CONFIG_MTD_NAND_ECC_SMC is not set | ||
| 545 | # CONFIG_MTD_NAND_MUSEUM_IDS is not set | ||
| 546 | # CONFIG_MTD_NAND_GPIO is not set | ||
| 547 | CONFIG_MTD_NAND_IDS=y | ||
| 548 | # CONFIG_MTD_NAND_DISKONCHIP is not set | ||
| 549 | CONFIG_MTD_NAND_ATMEL=y | ||
| 550 | # CONFIG_MTD_NAND_ATMEL_ECC_HW is not set | ||
| 551 | CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y | ||
| 552 | # CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set | ||
| 553 | # CONFIG_MTD_NAND_NANDSIM is not set | ||
| 554 | # CONFIG_MTD_NAND_PLATFORM is not set | ||
| 555 | # CONFIG_MTD_ALAUDA is not set | ||
| 556 | # CONFIG_MTD_ONENAND is not set | ||
| 557 | |||
| 558 | # | ||
| 559 | # LPDDR flash memory drivers | ||
| 560 | # | ||
| 561 | # CONFIG_MTD_LPDDR is not set | ||
| 562 | |||
| 563 | # | ||
| 564 | # UBI - Unsorted block images | ||
| 565 | # | ||
| 566 | # CONFIG_MTD_UBI is not set | ||
| 567 | # CONFIG_PARPORT is not set | ||
| 568 | CONFIG_BLK_DEV=y | ||
| 569 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
| 570 | CONFIG_BLK_DEV_LOOP=y | ||
| 571 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
| 572 | |||
| 573 | # | ||
| 574 | # DRBD disabled because PROC_FS, INET or CONNECTOR not selected | ||
| 575 | # | ||
| 576 | # CONFIG_BLK_DEV_NBD is not set | ||
| 577 | # CONFIG_BLK_DEV_UB is not set | ||
| 578 | CONFIG_BLK_DEV_RAM=y | ||
| 579 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
| 580 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 581 | # CONFIG_BLK_DEV_XIP is not set | ||
| 582 | # CONFIG_CDROM_PKTCDVD is not set | ||
| 583 | # CONFIG_ATA_OVER_ETH is not set | ||
| 584 | # CONFIG_MG_DISK is not set | ||
| 585 | # CONFIG_MISC_DEVICES is not set | ||
| 586 | CONFIG_HAVE_IDE=y | ||
| 587 | # CONFIG_IDE is not set | ||
| 588 | |||
| 589 | # | ||
| 590 | # SCSI device support | ||
| 591 | # | ||
| 592 | # CONFIG_RAID_ATTRS is not set | ||
| 593 | CONFIG_SCSI=y | ||
| 594 | CONFIG_SCSI_DMA=y | ||
| 595 | # CONFIG_SCSI_TGT is not set | ||
| 596 | # CONFIG_SCSI_NETLINK is not set | ||
| 597 | CONFIG_SCSI_PROC_FS=y | ||
| 598 | |||
| 599 | # | ||
| 600 | # SCSI support type (disk, tape, CD-ROM) | ||
| 601 | # | ||
| 602 | CONFIG_BLK_DEV_SD=y | ||
| 603 | # CONFIG_CHR_DEV_ST is not set | ||
| 604 | # CONFIG_CHR_DEV_OSST is not set | ||
| 605 | # CONFIG_BLK_DEV_SR is not set | ||
| 606 | # CONFIG_CHR_DEV_SG is not set | ||
| 607 | # CONFIG_CHR_DEV_SCH is not set | ||
| 608 | CONFIG_SCSI_MULTI_LUN=y | ||
| 609 | # CONFIG_SCSI_CONSTANTS is not set | ||
| 610 | # CONFIG_SCSI_LOGGING is not set | ||
| 611 | # CONFIG_SCSI_SCAN_ASYNC is not set | ||
| 612 | CONFIG_SCSI_WAIT_SCAN=m | ||
| 613 | |||
| 614 | # | ||
| 615 | # SCSI Transports | ||
| 616 | # | ||
| 617 | # CONFIG_SCSI_SPI_ATTRS is not set | ||
| 618 | # CONFIG_SCSI_FC_ATTRS is not set | ||
| 619 | # CONFIG_SCSI_ISCSI_ATTRS is not set | ||
| 620 | # CONFIG_SCSI_SAS_LIBSAS is not set | ||
| 621 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
| 622 | # CONFIG_SCSI_LOWLEVEL is not set | ||
| 623 | # CONFIG_SCSI_DH is not set | ||
| 624 | # CONFIG_SCSI_OSD_INITIATOR is not set | ||
| 625 | # CONFIG_ATA is not set | ||
| 626 | # CONFIG_MD is not set | ||
| 627 | CONFIG_NETDEVICES=y | ||
| 628 | # CONFIG_DUMMY is not set | ||
| 629 | # CONFIG_BONDING is not set | ||
| 630 | # CONFIG_MACVLAN is not set | ||
| 631 | # CONFIG_EQUALIZER is not set | ||
| 632 | # CONFIG_TUN is not set | ||
| 633 | # CONFIG_VETH is not set | ||
| 634 | CONFIG_PHYLIB=y | ||
| 635 | |||
| 636 | # | ||
| 637 | # MII PHY device drivers | ||
| 638 | # | ||
| 639 | # CONFIG_MARVELL_PHY is not set | ||
| 640 | # CONFIG_DAVICOM_PHY is not set | ||
| 641 | # CONFIG_QSEMI_PHY is not set | ||
| 642 | # CONFIG_LXT_PHY is not set | ||
| 643 | # CONFIG_CICADA_PHY is not set | ||
| 644 | # CONFIG_VITESSE_PHY is not set | ||
| 645 | # CONFIG_SMSC_PHY is not set | ||
| 646 | # CONFIG_BROADCOM_PHY is not set | ||
| 647 | # CONFIG_ICPLUS_PHY is not set | ||
| 648 | # CONFIG_REALTEK_PHY is not set | ||
| 649 | # CONFIG_NATIONAL_PHY is not set | ||
| 650 | # CONFIG_STE10XP is not set | ||
| 651 | # CONFIG_LSI_ET1011C_PHY is not set | ||
| 652 | # CONFIG_FIXED_PHY is not set | ||
| 653 | # CONFIG_MDIO_BITBANG is not set | ||
| 654 | CONFIG_NET_ETHERNET=y | ||
| 655 | # CONFIG_MII is not set | ||
| 656 | CONFIG_MACB=y | ||
| 657 | # CONFIG_AX88796 is not set | ||
| 658 | # CONFIG_SMC91X is not set | ||
| 659 | # CONFIG_DM9000 is not set | ||
| 660 | # CONFIG_ENC28J60 is not set | ||
| 661 | # CONFIG_ETHOC is not set | ||
| 662 | # CONFIG_SMC911X is not set | ||
| 663 | # CONFIG_SMSC911X is not set | ||
| 664 | # CONFIG_DNET is not set | ||
| 665 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
| 666 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
| 667 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
| 668 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
| 669 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | ||
| 670 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | ||
| 671 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | ||
| 672 | # CONFIG_B44 is not set | ||
| 673 | # CONFIG_KS8842 is not set | ||
| 674 | # CONFIG_KS8851 is not set | ||
| 675 | # CONFIG_KS8851_MLL is not set | ||
| 676 | # CONFIG_NETDEV_1000 is not set | ||
| 677 | # CONFIG_NETDEV_10000 is not set | ||
| 678 | # CONFIG_WLAN is not set | ||
| 679 | |||
| 680 | # | ||
| 681 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
| 682 | # | ||
| 683 | |||
| 684 | # | ||
| 685 | # USB Network Adapters | ||
| 686 | # | ||
| 687 | # CONFIG_USB_CATC is not set | ||
| 688 | # CONFIG_USB_KAWETH is not set | ||
| 689 | # CONFIG_USB_PEGASUS is not set | ||
| 690 | # CONFIG_USB_RTL8150 is not set | ||
| 691 | # CONFIG_USB_USBNET is not set | ||
| 692 | # CONFIG_WAN is not set | ||
| 693 | # CONFIG_PPP is not set | ||
| 694 | # CONFIG_SLIP is not set | ||
| 695 | # CONFIG_NETCONSOLE is not set | ||
| 696 | # CONFIG_NETPOLL is not set | ||
| 697 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
| 698 | # CONFIG_ISDN is not set | ||
| 699 | # CONFIG_PHONE is not set | ||
| 700 | |||
| 701 | # | ||
| 702 | # Input device support | ||
| 703 | # | ||
| 704 | CONFIG_INPUT=y | ||
| 705 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
| 706 | # CONFIG_INPUT_POLLDEV is not set | ||
| 707 | # CONFIG_INPUT_SPARSEKMAP is not set | ||
| 708 | |||
| 709 | # | ||
| 710 | # Userland interfaces | ||
| 711 | # | ||
| 712 | CONFIG_INPUT_MOUSEDEV=y | ||
| 713 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 714 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=320 | ||
| 715 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240 | ||
| 716 | # CONFIG_INPUT_JOYDEV is not set | ||
| 717 | # CONFIG_INPUT_EVDEV is not set | ||
| 718 | # CONFIG_INPUT_EVBUG is not set | ||
| 719 | |||
| 720 | # | ||
| 721 | # Input Device Drivers | ||
| 722 | # | ||
| 723 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 724 | # CONFIG_INPUT_MOUSE is not set | ||
| 725 | # CONFIG_INPUT_JOYSTICK is not set | ||
| 726 | # CONFIG_INPUT_TABLET is not set | ||
| 727 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
| 728 | # CONFIG_INPUT_MISC is not set | ||
| 729 | |||
| 730 | # | ||
| 731 | # Hardware I/O ports | ||
| 732 | # | ||
| 733 | # CONFIG_SERIO is not set | ||
| 734 | # CONFIG_GAMEPORT is not set | ||
| 735 | |||
| 736 | # | ||
| 737 | # Character devices | ||
| 738 | # | ||
| 739 | CONFIG_VT=y | ||
| 740 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
| 741 | CONFIG_VT_CONSOLE=y | ||
| 742 | CONFIG_HW_CONSOLE=y | ||
| 743 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
| 744 | CONFIG_DEVKMEM=y | ||
| 745 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
| 746 | |||
| 747 | # | ||
| 748 | # Serial drivers | ||
| 749 | # | ||
| 750 | # CONFIG_SERIAL_8250 is not set | ||
| 751 | |||
| 752 | # | ||
| 753 | # Non-8250 serial port support | ||
| 754 | # | ||
| 755 | CONFIG_SERIAL_ATMEL=y | ||
| 756 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 757 | CONFIG_SERIAL_ATMEL_PDC=y | ||
| 758 | # CONFIG_SERIAL_ATMEL_TTYAT is not set | ||
| 759 | # CONFIG_SERIAL_MAX3100 is not set | ||
| 760 | CONFIG_SERIAL_CORE=y | ||
| 761 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
| 762 | # CONFIG_SERIAL_TIMBERDALE is not set | ||
| 763 | CONFIG_UNIX98_PTYS=y | ||
| 764 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
| 765 | # CONFIG_LEGACY_PTYS is not set | ||
| 766 | # CONFIG_IPMI_HANDLER is not set | ||
| 767 | # CONFIG_HW_RANDOM is not set | ||
| 768 | # CONFIG_R3964 is not set | ||
| 769 | # CONFIG_RAW_DRIVER is not set | ||
| 770 | # CONFIG_TCG_TPM is not set | ||
| 771 | CONFIG_I2C=y | ||
| 772 | CONFIG_I2C_BOARDINFO=y | ||
| 773 | CONFIG_I2C_COMPAT=y | ||
| 774 | CONFIG_I2C_CHARDEV=y | ||
| 775 | CONFIG_I2C_HELPER_AUTO=y | ||
| 776 | CONFIG_I2C_ALGOBIT=y | ||
| 777 | |||
| 778 | # | ||
| 779 | # I2C Hardware Bus support | ||
| 780 | # | ||
| 781 | |||
| 782 | # | ||
| 783 | # I2C system bus drivers (mostly embedded / system-on-chip) | ||
| 784 | # | ||
| 785 | # CONFIG_I2C_DESIGNWARE is not set | ||
| 786 | CONFIG_I2C_GPIO=y | ||
| 787 | # CONFIG_I2C_OCORES is not set | ||
| 788 | # CONFIG_I2C_SIMTEC is not set | ||
| 789 | # CONFIG_I2C_XILINX is not set | ||
| 790 | |||
| 791 | # | ||
| 792 | # External I2C/SMBus adapter drivers | ||
| 793 | # | ||
| 794 | # CONFIG_I2C_PARPORT_LIGHT is not set | ||
| 795 | # CONFIG_I2C_TAOS_EVM is not set | ||
| 796 | # CONFIG_I2C_TINY_USB is not set | ||
| 797 | |||
| 798 | # | ||
| 799 | # Other I2C/SMBus bus drivers | ||
| 800 | # | ||
| 801 | # CONFIG_I2C_PCA_PLATFORM is not set | ||
| 802 | # CONFIG_I2C_STUB is not set | ||
| 803 | |||
| 804 | # | ||
| 805 | # Miscellaneous I2C Chip support | ||
| 806 | # | ||
| 807 | # CONFIG_SENSORS_TSL2550 is not set | ||
| 808 | # CONFIG_I2C_DEBUG_CORE is not set | ||
| 809 | # CONFIG_I2C_DEBUG_ALGO is not set | ||
| 810 | # CONFIG_I2C_DEBUG_BUS is not set | ||
| 811 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
| 812 | CONFIG_SPI=y | ||
| 813 | CONFIG_SPI_MASTER=y | ||
| 814 | |||
| 815 | # | ||
| 816 | # SPI Master Controller Drivers | ||
| 817 | # | ||
| 818 | CONFIG_SPI_ATMEL=y | ||
| 819 | # CONFIG_SPI_BITBANG is not set | ||
| 820 | # CONFIG_SPI_GPIO is not set | ||
| 821 | # CONFIG_SPI_XILINX is not set | ||
| 822 | # CONFIG_SPI_DESIGNWARE is not set | ||
| 823 | |||
| 824 | # | ||
| 825 | # SPI Protocol Masters | ||
| 826 | # | ||
| 827 | CONFIG_SPI_SPIDEV=y | ||
| 828 | # CONFIG_SPI_TLE62X0 is not set | ||
| 829 | |||
| 830 | # | ||
| 831 | # PPS support | ||
| 832 | # | ||
| 833 | # CONFIG_PPS is not set | ||
| 834 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
| 835 | CONFIG_GPIOLIB=y | ||
| 836 | CONFIG_GPIO_SYSFS=y | ||
| 837 | |||
| 838 | # | ||
| 839 | # Memory mapped GPIO expanders: | ||
| 840 | # | ||
| 841 | # CONFIG_GPIO_IT8761E is not set | ||
| 842 | |||
| 843 | # | ||
| 844 | # I2C GPIO expanders: | ||
| 845 | # | ||
| 846 | # CONFIG_GPIO_MAX7300 is not set | ||
| 847 | # CONFIG_GPIO_MAX732X is not set | ||
| 848 | # CONFIG_GPIO_PCA953X is not set | ||
| 849 | # CONFIG_GPIO_PCF857X is not set | ||
| 850 | # CONFIG_GPIO_ADP5588 is not set | ||
| 851 | |||
| 852 | # | ||
| 853 | # PCI GPIO expanders: | ||
| 854 | # | ||
| 855 | |||
| 856 | # | ||
| 857 | # SPI GPIO expanders: | ||
| 858 | # | ||
| 859 | # CONFIG_GPIO_MAX7301 is not set | ||
| 860 | # CONFIG_GPIO_MCP23S08 is not set | ||
| 861 | # CONFIG_GPIO_MC33880 is not set | ||
| 862 | |||
| 863 | # | ||
| 864 | # AC97 GPIO expanders: | ||
| 865 | # | ||
| 866 | CONFIG_W1=y | ||
| 867 | |||
| 868 | # | ||
| 869 | # 1-wire Bus Masters | ||
| 870 | # | ||
| 871 | # CONFIG_W1_MASTER_DS2490 is not set | ||
| 872 | # CONFIG_W1_MASTER_DS2482 is not set | ||
| 873 | # CONFIG_W1_MASTER_DS1WM is not set | ||
| 874 | CONFIG_W1_MASTER_GPIO=y | ||
| 875 | |||
| 876 | # | ||
| 877 | # 1-wire Slaves | ||
| 878 | # | ||
| 879 | CONFIG_W1_SLAVE_THERM=y | ||
| 880 | # CONFIG_W1_SLAVE_SMEM is not set | ||
| 881 | CONFIG_W1_SLAVE_DS2431=y | ||
| 882 | # CONFIG_W1_SLAVE_DS2433 is not set | ||
| 883 | # CONFIG_W1_SLAVE_DS2760 is not set | ||
| 884 | # CONFIG_W1_SLAVE_BQ27000 is not set | ||
| 885 | # CONFIG_POWER_SUPPLY is not set | ||
| 886 | # CONFIG_HWMON is not set | ||
| 887 | # CONFIG_THERMAL is not set | ||
| 888 | CONFIG_WATCHDOG=y | ||
| 889 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
| 890 | |||
| 891 | # | ||
| 892 | # Watchdog Device Drivers | ||
| 893 | # | ||
| 894 | # CONFIG_SOFT_WATCHDOG is not set | ||
| 895 | # CONFIG_MAX63XX_WATCHDOG is not set | ||
| 896 | CONFIG_AT91SAM9X_WATCHDOG=y | ||
| 897 | |||
| 898 | # | ||
| 899 | # USB-based Watchdog Cards | ||
| 900 | # | ||
| 901 | # CONFIG_USBPCWATCHDOG is not set | ||
| 902 | CONFIG_SSB_POSSIBLE=y | ||
| 903 | |||
| 904 | # | ||
| 905 | # Sonics Silicon Backplane | ||
| 906 | # | ||
| 907 | # CONFIG_SSB is not set | ||
| 908 | |||
| 909 | # | ||
| 910 | # Multifunction device drivers | ||
| 911 | # | ||
| 912 | # CONFIG_MFD_CORE is not set | ||
| 913 | # CONFIG_MFD_88PM860X is not set | ||
| 914 | # CONFIG_MFD_SM501 is not set | ||
| 915 | # CONFIG_MFD_ASIC3 is not set | ||
| 916 | # CONFIG_HTC_EGPIO is not set | ||
| 917 | # CONFIG_HTC_PASIC3 is not set | ||
| 918 | # CONFIG_HTC_I2CPLD is not set | ||
| 919 | # CONFIG_TPS65010 is not set | ||
| 920 | # CONFIG_TWL4030_CORE is not set | ||
| 921 | # CONFIG_MFD_TMIO is not set | ||
| 922 | # CONFIG_MFD_T7L66XB is not set | ||
| 923 | # CONFIG_MFD_TC6387XB is not set | ||
| 924 | # CONFIG_MFD_TC6393XB is not set | ||
| 925 | # CONFIG_PMIC_DA903X is not set | ||
| 926 | # CONFIG_PMIC_ADP5520 is not set | ||
| 927 | # CONFIG_MFD_MAX8925 is not set | ||
| 928 | # CONFIG_MFD_WM8400 is not set | ||
| 929 | # CONFIG_MFD_WM831X is not set | ||
| 930 | # CONFIG_MFD_WM8350_I2C is not set | ||
| 931 | # CONFIG_MFD_WM8994 is not set | ||
| 932 | # CONFIG_MFD_PCF50633 is not set | ||
| 933 | # CONFIG_MFD_MC13783 is not set | ||
| 934 | # CONFIG_AB3100_CORE is not set | ||
| 935 | # CONFIG_EZX_PCAP is not set | ||
| 936 | # CONFIG_AB4500_CORE is not set | ||
| 937 | # CONFIG_REGULATOR is not set | ||
| 938 | # CONFIG_MEDIA_SUPPORT is not set | ||
| 939 | |||
| 940 | # | ||
| 941 | # Graphics support | ||
| 942 | # | ||
| 943 | # CONFIG_VGASTATE is not set | ||
| 944 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
| 945 | # CONFIG_FB is not set | ||
| 946 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
| 947 | |||
| 948 | # | ||
| 949 | # Display device support | ||
| 950 | # | ||
| 951 | # CONFIG_DISPLAY_SUPPORT is not set | ||
| 952 | |||
| 953 | # | ||
| 954 | # Console display driver support | ||
| 955 | # | ||
| 956 | # CONFIG_VGA_CONSOLE is not set | ||
| 957 | CONFIG_DUMMY_CONSOLE=y | ||
| 958 | # CONFIG_SOUND is not set | ||
| 959 | # CONFIG_HID_SUPPORT is not set | ||
| 960 | CONFIG_USB_SUPPORT=y | ||
| 961 | CONFIG_USB_ARCH_HAS_HCD=y | ||
| 962 | CONFIG_USB_ARCH_HAS_OHCI=y | ||
| 963 | # CONFIG_USB_ARCH_HAS_EHCI is not set | ||
| 964 | CONFIG_USB=y | ||
| 965 | # CONFIG_USB_DEBUG is not set | ||
| 966 | # CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set | ||
| 967 | |||
| 968 | # | ||
| 969 | # Miscellaneous USB options | ||
| 970 | # | ||
| 971 | CONFIG_USB_DEVICEFS=y | ||
| 972 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 973 | # CONFIG_USB_DYNAMIC_MINORS is not set | ||
| 974 | # CONFIG_USB_OTG is not set | ||
| 975 | CONFIG_USB_MON=y | ||
| 976 | # CONFIG_USB_WUSB is not set | ||
| 977 | # CONFIG_USB_WUSB_CBAF is not set | ||
| 978 | |||
| 979 | # | ||
| 980 | # USB Host Controller Drivers | ||
| 981 | # | ||
| 982 | # CONFIG_USB_C67X00_HCD is not set | ||
| 983 | # CONFIG_USB_OXU210HP_HCD is not set | ||
| 984 | # CONFIG_USB_ISP116X_HCD is not set | ||
| 985 | # CONFIG_USB_ISP1760_HCD is not set | ||
| 986 | # CONFIG_USB_ISP1362_HCD is not set | ||
| 987 | CONFIG_USB_OHCI_HCD=y | ||
| 988 | # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set | ||
| 989 | # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set | ||
| 990 | CONFIG_USB_OHCI_LITTLE_ENDIAN=y | ||
| 991 | # CONFIG_USB_SL811_HCD is not set | ||
| 992 | # CONFIG_USB_R8A66597_HCD is not set | ||
| 993 | # CONFIG_USB_HWA_HCD is not set | ||
| 994 | # CONFIG_USB_MUSB_HDRC is not set | ||
| 995 | # CONFIG_USB_GADGET_MUSB_HDRC is not set | ||
| 996 | |||
| 997 | # | ||
| 998 | # USB Device Class drivers | ||
| 999 | # | ||
| 1000 | # CONFIG_USB_ACM is not set | ||
| 1001 | # CONFIG_USB_PRINTER is not set | ||
| 1002 | # CONFIG_USB_WDM is not set | ||
| 1003 | # CONFIG_USB_TMC is not set | ||
| 1004 | |||
| 1005 | # | ||
| 1006 | # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may | ||
| 1007 | # | ||
| 1008 | |||
| 1009 | # | ||
| 1010 | # also be needed; see USB_STORAGE Help for more info | ||
| 1011 | # | ||
| 1012 | CONFIG_USB_STORAGE=y | ||
| 1013 | # CONFIG_USB_STORAGE_DEBUG is not set | ||
| 1014 | # CONFIG_USB_STORAGE_DATAFAB is not set | ||
| 1015 | # CONFIG_USB_STORAGE_FREECOM is not set | ||
| 1016 | # CONFIG_USB_STORAGE_ISD200 is not set | ||
| 1017 | # CONFIG_USB_STORAGE_USBAT is not set | ||
| 1018 | # CONFIG_USB_STORAGE_SDDR09 is not set | ||
| 1019 | # CONFIG_USB_STORAGE_SDDR55 is not set | ||
| 1020 | # CONFIG_USB_STORAGE_JUMPSHOT is not set | ||
| 1021 | # CONFIG_USB_STORAGE_ALAUDA is not set | ||
| 1022 | # CONFIG_USB_STORAGE_ONETOUCH is not set | ||
| 1023 | # CONFIG_USB_STORAGE_KARMA is not set | ||
| 1024 | # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set | ||
| 1025 | # CONFIG_USB_LIBUSUAL is not set | ||
| 1026 | |||
| 1027 | # | ||
| 1028 | # USB Imaging devices | ||
| 1029 | # | ||
| 1030 | # CONFIG_USB_MDC800 is not set | ||
| 1031 | # CONFIG_USB_MICROTEK is not set | ||
| 1032 | |||
| 1033 | # | ||
| 1034 | # USB port drivers | ||
| 1035 | # | ||
| 1036 | # CONFIG_USB_SERIAL is not set | ||
| 1037 | |||
| 1038 | # | ||
| 1039 | # USB Miscellaneous drivers | ||
| 1040 | # | ||
| 1041 | # CONFIG_USB_EMI62 is not set | ||
| 1042 | # CONFIG_USB_EMI26 is not set | ||
| 1043 | # CONFIG_USB_ADUTUX is not set | ||
| 1044 | # CONFIG_USB_SEVSEG is not set | ||
| 1045 | # CONFIG_USB_RIO500 is not set | ||
| 1046 | # CONFIG_USB_LEGOTOWER is not set | ||
| 1047 | # CONFIG_USB_LCD is not set | ||
| 1048 | # CONFIG_USB_LED is not set | ||
| 1049 | # CONFIG_USB_CYPRESS_CY7C63 is not set | ||
| 1050 | # CONFIG_USB_CYTHERM is not set | ||
| 1051 | # CONFIG_USB_IDMOUSE is not set | ||
| 1052 | # CONFIG_USB_FTDI_ELAN is not set | ||
| 1053 | # CONFIG_USB_APPLEDISPLAY is not set | ||
| 1054 | # CONFIG_USB_LD is not set | ||
| 1055 | # CONFIG_USB_TRANCEVIBRATOR is not set | ||
| 1056 | # CONFIG_USB_IOWARRIOR is not set | ||
| 1057 | # CONFIG_USB_TEST is not set | ||
| 1058 | # CONFIG_USB_ISIGHTFW is not set | ||
| 1059 | CONFIG_USB_GADGET=m | ||
| 1060 | # CONFIG_USB_GADGET_DEBUG_FILES is not set | ||
| 1061 | CONFIG_USB_GADGET_VBUS_DRAW=2 | ||
| 1062 | CONFIG_USB_GADGET_SELECTED=y | ||
| 1063 | CONFIG_USB_GADGET_AT91=y | ||
| 1064 | CONFIG_USB_AT91=m | ||
| 1065 | # CONFIG_USB_GADGET_ATMEL_USBA is not set | ||
| 1066 | # CONFIG_USB_GADGET_FSL_USB2 is not set | ||
| 1067 | # CONFIG_USB_GADGET_LH7A40X is not set | ||
| 1068 | # CONFIG_USB_GADGET_OMAP is not set | ||
| 1069 | # CONFIG_USB_GADGET_PXA25X is not set | ||
| 1070 | # CONFIG_USB_GADGET_R8A66597 is not set | ||
| 1071 | # CONFIG_USB_GADGET_PXA27X is not set | ||
| 1072 | # CONFIG_USB_GADGET_S3C_HSOTG is not set | ||
| 1073 | # CONFIG_USB_GADGET_IMX is not set | ||
| 1074 | # CONFIG_USB_GADGET_S3C2410 is not set | ||
| 1075 | # CONFIG_USB_GADGET_M66592 is not set | ||
| 1076 | # CONFIG_USB_GADGET_AMD5536UDC is not set | ||
| 1077 | # CONFIG_USB_GADGET_FSL_QE is not set | ||
| 1078 | # CONFIG_USB_GADGET_CI13XXX is not set | ||
| 1079 | # CONFIG_USB_GADGET_NET2280 is not set | ||
| 1080 | # CONFIG_USB_GADGET_GOKU is not set | ||
| 1081 | # CONFIG_USB_GADGET_LANGWELL is not set | ||
| 1082 | # CONFIG_USB_GADGET_DUMMY_HCD is not set | ||
| 1083 | # CONFIG_USB_GADGET_DUALSPEED is not set | ||
| 1084 | CONFIG_USB_ZERO=m | ||
| 1085 | # CONFIG_USB_AUDIO is not set | ||
| 1086 | CONFIG_USB_ETH=m | ||
| 1087 | CONFIG_USB_ETH_RNDIS=y | ||
| 1088 | # CONFIG_USB_ETH_EEM is not set | ||
| 1089 | # CONFIG_USB_GADGETFS is not set | ||
| 1090 | CONFIG_USB_FILE_STORAGE=m | ||
| 1091 | # CONFIG_USB_FILE_STORAGE_TEST is not set | ||
| 1092 | # CONFIG_USB_MASS_STORAGE is not set | ||
| 1093 | CONFIG_USB_G_SERIAL=m | ||
| 1094 | # CONFIG_USB_MIDI_GADGET is not set | ||
| 1095 | # CONFIG_USB_G_PRINTER is not set | ||
| 1096 | # CONFIG_USB_CDC_COMPOSITE is not set | ||
| 1097 | # CONFIG_USB_G_NOKIA is not set | ||
| 1098 | # CONFIG_USB_G_MULTI is not set | ||
| 1099 | |||
| 1100 | # | ||
| 1101 | # OTG and related infrastructure | ||
| 1102 | # | ||
| 1103 | # CONFIG_USB_GPIO_VBUS is not set | ||
| 1104 | # CONFIG_USB_ULPI is not set | ||
| 1105 | # CONFIG_NOP_USB_XCEIV is not set | ||
| 1106 | CONFIG_MMC=y | ||
| 1107 | # CONFIG_MMC_DEBUG is not set | ||
| 1108 | # CONFIG_MMC_UNSAFE_RESUME is not set | ||
| 1109 | |||
| 1110 | # | ||
| 1111 | # MMC/SD/SDIO Card Drivers | ||
| 1112 | # | ||
| 1113 | CONFIG_MMC_BLOCK=y | ||
| 1114 | CONFIG_MMC_BLOCK_BOUNCE=y | ||
| 1115 | # CONFIG_SDIO_UART is not set | ||
| 1116 | # CONFIG_MMC_TEST is not set | ||
| 1117 | |||
| 1118 | # | ||
| 1119 | # MMC/SD/SDIO Host Controller Drivers | ||
| 1120 | # | ||
| 1121 | # CONFIG_MMC_SDHCI is not set | ||
| 1122 | # CONFIG_MMC_AT91 is not set | ||
| 1123 | CONFIG_MMC_ATMELMCI=y | ||
| 1124 | # CONFIG_MMC_SPI is not set | ||
| 1125 | # CONFIG_MEMSTICK is not set | ||
| 1126 | CONFIG_NEW_LEDS=y | ||
| 1127 | CONFIG_LEDS_CLASS=y | ||
| 1128 | |||
| 1129 | # | ||
| 1130 | # LED drivers | ||
| 1131 | # | ||
| 1132 | # CONFIG_LEDS_PCA9532 is not set | ||
| 1133 | CONFIG_LEDS_GPIO=y | ||
| 1134 | CONFIG_LEDS_GPIO_PLATFORM=y | ||
| 1135 | # CONFIG_LEDS_LP3944 is not set | ||
| 1136 | # CONFIG_LEDS_PCA955X is not set | ||
| 1137 | # CONFIG_LEDS_DAC124S085 is not set | ||
| 1138 | # CONFIG_LEDS_BD2802 is not set | ||
| 1139 | # CONFIG_LEDS_LT3593 is not set | ||
| 1140 | |||
| 1141 | # | ||
| 1142 | # LED Triggers | ||
| 1143 | # | ||
| 1144 | CONFIG_LEDS_TRIGGERS=y | ||
| 1145 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
| 1146 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 1147 | # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set | ||
| 1148 | # CONFIG_LEDS_TRIGGER_GPIO is not set | ||
| 1149 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
| 1150 | |||
| 1151 | # | ||
| 1152 | # iptables trigger is under Netfilter config (LED target) | ||
| 1153 | # | ||
| 1154 | # CONFIG_ACCESSIBILITY is not set | ||
| 1155 | CONFIG_RTC_LIB=y | ||
| 1156 | CONFIG_RTC_CLASS=y | ||
| 1157 | CONFIG_RTC_HCTOSYS=y | ||
| 1158 | CONFIG_RTC_HCTOSYS_DEVICE="rtc0" | ||
| 1159 | # CONFIG_RTC_DEBUG is not set | ||
| 1160 | |||
| 1161 | # | ||
| 1162 | # RTC interfaces | ||
| 1163 | # | ||
| 1164 | CONFIG_RTC_INTF_SYSFS=y | ||
| 1165 | CONFIG_RTC_INTF_PROC=y | ||
| 1166 | CONFIG_RTC_INTF_DEV=y | ||
| 1167 | # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set | ||
| 1168 | # CONFIG_RTC_DRV_TEST is not set | ||
| 1169 | |||
| 1170 | # | ||
| 1171 | # I2C RTC drivers | ||
| 1172 | # | ||
| 1173 | # CONFIG_RTC_DRV_DS1307 is not set | ||
| 1174 | # CONFIG_RTC_DRV_DS1374 is not set | ||
| 1175 | # CONFIG_RTC_DRV_DS1672 is not set | ||
| 1176 | # CONFIG_RTC_DRV_MAX6900 is not set | ||
| 1177 | # CONFIG_RTC_DRV_RS5C372 is not set | ||
| 1178 | # CONFIG_RTC_DRV_ISL1208 is not set | ||
| 1179 | # CONFIG_RTC_DRV_X1205 is not set | ||
| 1180 | # CONFIG_RTC_DRV_PCF8563 is not set | ||
| 1181 | # CONFIG_RTC_DRV_PCF8583 is not set | ||
| 1182 | # CONFIG_RTC_DRV_M41T80 is not set | ||
| 1183 | # CONFIG_RTC_DRV_BQ32K is not set | ||
| 1184 | # CONFIG_RTC_DRV_S35390A is not set | ||
| 1185 | # CONFIG_RTC_DRV_FM3130 is not set | ||
| 1186 | # CONFIG_RTC_DRV_RX8581 is not set | ||
| 1187 | # CONFIG_RTC_DRV_RX8025 is not set | ||
| 1188 | |||
| 1189 | # | ||
| 1190 | # SPI RTC drivers | ||
| 1191 | # | ||
| 1192 | # CONFIG_RTC_DRV_M41T94 is not set | ||
| 1193 | # CONFIG_RTC_DRV_DS1305 is not set | ||
| 1194 | # CONFIG_RTC_DRV_DS1390 is not set | ||
| 1195 | # CONFIG_RTC_DRV_MAX6902 is not set | ||
| 1196 | # CONFIG_RTC_DRV_R9701 is not set | ||
| 1197 | # CONFIG_RTC_DRV_RS5C348 is not set | ||
| 1198 | # CONFIG_RTC_DRV_DS3234 is not set | ||
| 1199 | # CONFIG_RTC_DRV_PCF2123 is not set | ||
| 1200 | |||
| 1201 | # | ||
| 1202 | # Platform RTC drivers | ||
| 1203 | # | ||
| 1204 | # CONFIG_RTC_DRV_CMOS is not set | ||
| 1205 | # CONFIG_RTC_DRV_DS1286 is not set | ||
| 1206 | # CONFIG_RTC_DRV_DS1511 is not set | ||
| 1207 | # CONFIG_RTC_DRV_DS1553 is not set | ||
| 1208 | # CONFIG_RTC_DRV_DS1742 is not set | ||
| 1209 | # CONFIG_RTC_DRV_STK17TA8 is not set | ||
| 1210 | # CONFIG_RTC_DRV_M48T86 is not set | ||
| 1211 | # CONFIG_RTC_DRV_M48T35 is not set | ||
| 1212 | # CONFIG_RTC_DRV_M48T59 is not set | ||
| 1213 | # CONFIG_RTC_DRV_MSM6242 is not set | ||
| 1214 | # CONFIG_RTC_DRV_BQ4802 is not set | ||
| 1215 | # CONFIG_RTC_DRV_RP5C01 is not set | ||
| 1216 | # CONFIG_RTC_DRV_V3020 is not set | ||
| 1217 | |||
| 1218 | # | ||
| 1219 | # on-CPU RTC drivers | ||
| 1220 | # | ||
| 1221 | CONFIG_RTC_DRV_AT91SAM9=y | ||
| 1222 | CONFIG_RTC_DRV_AT91SAM9_RTT=0 | ||
| 1223 | CONFIG_RTC_DRV_AT91SAM9_GPBR=0 | ||
| 1224 | # CONFIG_DMADEVICES is not set | ||
| 1225 | # CONFIG_AUXDISPLAY is not set | ||
| 1226 | # CONFIG_UIO is not set | ||
| 1227 | |||
| 1228 | # | ||
| 1229 | # TI VLYNQ | ||
| 1230 | # | ||
| 1231 | # CONFIG_STAGING is not set | ||
| 1232 | |||
| 1233 | # | ||
| 1234 | # File systems | ||
| 1235 | # | ||
| 1236 | CONFIG_EXT2_FS=y | ||
| 1237 | # CONFIG_EXT2_FS_XATTR is not set | ||
| 1238 | # CONFIG_EXT2_FS_XIP is not set | ||
| 1239 | CONFIG_EXT3_FS=y | ||
| 1240 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
| 1241 | CONFIG_EXT3_FS_XATTR=y | ||
| 1242 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
| 1243 | # CONFIG_EXT3_FS_SECURITY is not set | ||
| 1244 | # CONFIG_EXT4_FS is not set | ||
| 1245 | CONFIG_JBD=y | ||
| 1246 | CONFIG_FS_MBCACHE=y | ||
| 1247 | # CONFIG_REISERFS_FS is not set | ||
| 1248 | # CONFIG_JFS_FS is not set | ||
| 1249 | # CONFIG_FS_POSIX_ACL is not set | ||
| 1250 | # CONFIG_XFS_FS is not set | ||
| 1251 | # CONFIG_OCFS2_FS is not set | ||
| 1252 | # CONFIG_BTRFS_FS is not set | ||
| 1253 | # CONFIG_NILFS2_FS is not set | ||
| 1254 | CONFIG_FILE_LOCKING=y | ||
| 1255 | CONFIG_FSNOTIFY=y | ||
| 1256 | CONFIG_DNOTIFY=y | ||
| 1257 | CONFIG_INOTIFY=y | ||
| 1258 | CONFIG_INOTIFY_USER=y | ||
| 1259 | # CONFIG_QUOTA is not set | ||
| 1260 | # CONFIG_AUTOFS_FS is not set | ||
| 1261 | # CONFIG_AUTOFS4_FS is not set | ||
| 1262 | # CONFIG_FUSE_FS is not set | ||
| 1263 | |||
| 1264 | # | ||
| 1265 | # Caches | ||
| 1266 | # | ||
| 1267 | # CONFIG_FSCACHE is not set | ||
| 1268 | |||
| 1269 | # | ||
| 1270 | # CD-ROM/DVD Filesystems | ||
| 1271 | # | ||
| 1272 | # CONFIG_ISO9660_FS is not set | ||
| 1273 | # CONFIG_UDF_FS is not set | ||
| 1274 | |||
| 1275 | # | ||
| 1276 | # DOS/FAT/NT Filesystems | ||
| 1277 | # | ||
| 1278 | CONFIG_FAT_FS=y | ||
| 1279 | # CONFIG_MSDOS_FS is not set | ||
| 1280 | CONFIG_VFAT_FS=y | ||
| 1281 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
| 1282 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | ||
| 1283 | # CONFIG_NTFS_FS is not set | ||
| 1284 | |||
| 1285 | # | ||
| 1286 | # Pseudo filesystems | ||
| 1287 | # | ||
| 1288 | CONFIG_PROC_FS=y | ||
| 1289 | CONFIG_PROC_SYSCTL=y | ||
| 1290 | CONFIG_PROC_PAGE_MONITOR=y | ||
| 1291 | CONFIG_SYSFS=y | ||
| 1292 | CONFIG_TMPFS=y | ||
| 1293 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
| 1294 | # CONFIG_HUGETLB_PAGE is not set | ||
| 1295 | # CONFIG_CONFIGFS_FS is not set | ||
| 1296 | CONFIG_MISC_FILESYSTEMS=y | ||
| 1297 | # CONFIG_ADFS_FS is not set | ||
| 1298 | # CONFIG_AFFS_FS is not set | ||
| 1299 | # CONFIG_HFS_FS is not set | ||
| 1300 | # CONFIG_HFSPLUS_FS is not set | ||
| 1301 | # CONFIG_BEFS_FS is not set | ||
| 1302 | # CONFIG_BFS_FS is not set | ||
| 1303 | # CONFIG_EFS_FS is not set | ||
| 1304 | CONFIG_JFFS2_FS=y | ||
| 1305 | CONFIG_JFFS2_FS_DEBUG=0 | ||
| 1306 | CONFIG_JFFS2_FS_WRITEBUFFER=y | ||
| 1307 | # CONFIG_JFFS2_FS_WBUF_VERIFY is not set | ||
| 1308 | CONFIG_JFFS2_SUMMARY=y | ||
| 1309 | # CONFIG_JFFS2_FS_XATTR is not set | ||
| 1310 | # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set | ||
| 1311 | CONFIG_JFFS2_ZLIB=y | ||
| 1312 | # CONFIG_JFFS2_LZO is not set | ||
| 1313 | CONFIG_JFFS2_RTIME=y | ||
| 1314 | # CONFIG_JFFS2_RUBIN is not set | ||
| 1315 | # CONFIG_LOGFS is not set | ||
| 1316 | # CONFIG_CRAMFS is not set | ||
| 1317 | # CONFIG_SQUASHFS is not set | ||
| 1318 | # CONFIG_VXFS_FS is not set | ||
| 1319 | # CONFIG_MINIX_FS is not set | ||
| 1320 | # CONFIG_OMFS_FS is not set | ||
| 1321 | # CONFIG_HPFS_FS is not set | ||
| 1322 | # CONFIG_QNX4FS_FS is not set | ||
| 1323 | # CONFIG_ROMFS_FS is not set | ||
| 1324 | # CONFIG_SYSV_FS is not set | ||
| 1325 | # CONFIG_UFS_FS is not set | ||
| 1326 | CONFIG_NETWORK_FILESYSTEMS=y | ||
| 1327 | CONFIG_NFS_FS=y | ||
| 1328 | CONFIG_NFS_V3=y | ||
| 1329 | # CONFIG_NFS_V3_ACL is not set | ||
| 1330 | # CONFIG_NFS_V4 is not set | ||
| 1331 | # CONFIG_NFSD is not set | ||
| 1332 | CONFIG_LOCKD=y | ||
| 1333 | CONFIG_LOCKD_V4=y | ||
| 1334 | CONFIG_NFS_COMMON=y | ||
| 1335 | CONFIG_SUNRPC=y | ||
| 1336 | # CONFIG_RPCSEC_GSS_KRB5 is not set | ||
| 1337 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
| 1338 | # CONFIG_SMB_FS is not set | ||
| 1339 | # CONFIG_CIFS is not set | ||
| 1340 | # CONFIG_NCP_FS is not set | ||
| 1341 | # CONFIG_CODA_FS is not set | ||
| 1342 | # CONFIG_AFS_FS is not set | ||
| 1343 | |||
| 1344 | # | ||
| 1345 | # Partition Types | ||
| 1346 | # | ||
| 1347 | # CONFIG_PARTITION_ADVANCED is not set | ||
| 1348 | CONFIG_MSDOS_PARTITION=y | ||
| 1349 | CONFIG_NLS=y | ||
| 1350 | CONFIG_NLS_DEFAULT="iso8859-1" | ||
| 1351 | CONFIG_NLS_CODEPAGE_437=y | ||
| 1352 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
| 1353 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
| 1354 | CONFIG_NLS_CODEPAGE_850=y | ||
| 1355 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
| 1356 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
| 1357 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
| 1358 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
| 1359 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
| 1360 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
| 1361 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
| 1362 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
| 1363 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
| 1364 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
| 1365 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
| 1366 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
| 1367 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
| 1368 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
| 1369 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
| 1370 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
| 1371 | # CONFIG_NLS_ISO8859_8 is not set | ||
| 1372 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
| 1373 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
| 1374 | # CONFIG_NLS_ASCII is not set | ||
| 1375 | CONFIG_NLS_ISO8859_1=y | ||
| 1376 | # CONFIG_NLS_ISO8859_2 is not set | ||
| 1377 | # CONFIG_NLS_ISO8859_3 is not set | ||
| 1378 | # CONFIG_NLS_ISO8859_4 is not set | ||
| 1379 | # CONFIG_NLS_ISO8859_5 is not set | ||
| 1380 | # CONFIG_NLS_ISO8859_6 is not set | ||
| 1381 | # CONFIG_NLS_ISO8859_7 is not set | ||
| 1382 | # CONFIG_NLS_ISO8859_9 is not set | ||
| 1383 | # CONFIG_NLS_ISO8859_13 is not set | ||
| 1384 | # CONFIG_NLS_ISO8859_14 is not set | ||
| 1385 | CONFIG_NLS_ISO8859_15=y | ||
| 1386 | # CONFIG_NLS_KOI8_R is not set | ||
| 1387 | # CONFIG_NLS_KOI8_U is not set | ||
| 1388 | CONFIG_NLS_UTF8=y | ||
| 1389 | # CONFIG_DLM is not set | ||
| 1390 | |||
| 1391 | # | ||
| 1392 | # Kernel hacking | ||
| 1393 | # | ||
| 1394 | # CONFIG_PRINTK_TIME is not set | ||
| 1395 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
| 1396 | CONFIG_ENABLE_MUST_CHECK=y | ||
| 1397 | CONFIG_FRAME_WARN=1024 | ||
| 1398 | # CONFIG_MAGIC_SYSRQ is not set | ||
| 1399 | # CONFIG_STRIP_ASM_SYMS is not set | ||
| 1400 | # CONFIG_UNUSED_SYMBOLS is not set | ||
| 1401 | # CONFIG_DEBUG_FS is not set | ||
| 1402 | # CONFIG_HEADERS_CHECK is not set | ||
| 1403 | # CONFIG_DEBUG_KERNEL is not set | ||
| 1404 | CONFIG_DEBUG_BUGVERBOSE=y | ||
| 1405 | CONFIG_DEBUG_MEMORY_INIT=y | ||
| 1406 | CONFIG_FRAME_POINTER=y | ||
| 1407 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
| 1408 | # CONFIG_LATENCYTOP is not set | ||
| 1409 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
| 1410 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
| 1411 | CONFIG_TRACING_SUPPORT=y | ||
| 1412 | # CONFIG_FTRACE is not set | ||
| 1413 | # CONFIG_SAMPLES is not set | ||
| 1414 | CONFIG_HAVE_ARCH_KGDB=y | ||
| 1415 | # CONFIG_ARM_UNWIND is not set | ||
| 1416 | # CONFIG_DEBUG_USER is not set | ||
| 1417 | # CONFIG_OC_ETM is not set | ||
| 1418 | |||
| 1419 | # | ||
| 1420 | # Security options | ||
| 1421 | # | ||
| 1422 | # CONFIG_KEYS is not set | ||
| 1423 | # CONFIG_SECURITY is not set | ||
| 1424 | # CONFIG_SECURITYFS is not set | ||
| 1425 | # CONFIG_DEFAULT_SECURITY_SELINUX is not set | ||
| 1426 | # CONFIG_DEFAULT_SECURITY_SMACK is not set | ||
| 1427 | # CONFIG_DEFAULT_SECURITY_TOMOYO is not set | ||
| 1428 | CONFIG_DEFAULT_SECURITY_DAC=y | ||
| 1429 | CONFIG_DEFAULT_SECURITY="" | ||
| 1430 | # CONFIG_CRYPTO is not set | ||
| 1431 | # CONFIG_BINARY_PRINTF is not set | ||
| 1432 | |||
| 1433 | # | ||
| 1434 | # Library routines | ||
| 1435 | # | ||
| 1436 | CONFIG_BITREVERSE=y | ||
| 1437 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
| 1438 | # CONFIG_CRC_CCITT is not set | ||
| 1439 | # CONFIG_CRC16 is not set | ||
| 1440 | # CONFIG_CRC_T10DIF is not set | ||
| 1441 | # CONFIG_CRC_ITU_T is not set | ||
| 1442 | CONFIG_CRC32=y | ||
| 1443 | # CONFIG_CRC7 is not set | ||
| 1444 | # CONFIG_LIBCRC32C is not set | ||
| 1445 | CONFIG_ZLIB_INFLATE=y | ||
| 1446 | CONFIG_ZLIB_DEFLATE=y | ||
| 1447 | CONFIG_LZO_DECOMPRESS=y | ||
| 1448 | CONFIG_DECOMPRESS_GZIP=y | ||
| 1449 | CONFIG_DECOMPRESS_BZIP2=y | ||
| 1450 | CONFIG_DECOMPRESS_LZMA=y | ||
| 1451 | CONFIG_DECOMPRESS_LZO=y | ||
| 1452 | CONFIG_HAS_IOMEM=y | ||
| 1453 | CONFIG_HAS_IOPORT=y | ||
| 1454 | CONFIG_HAS_DMA=y | ||
| 1455 | CONFIG_NLATTR=y | ||
| 1456 | CONFIG_GENERIC_ATOMIC64=y | ||
diff --git a/arch/arm/include/asm/hardware/arm_timer.h b/arch/arm/include/asm/hardware/arm_timer.h index 04be3bdf46b8..c0f4e7bf22de 100644 --- a/arch/arm/include/asm/hardware/arm_timer.h +++ b/arch/arm/include/asm/hardware/arm_timer.h | |||
| @@ -1,21 +1,30 @@ | |||
| 1 | #ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H | 1 | #ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H |
| 2 | #define __ASM_ARM_HARDWARE_ARM_TIMER_H | 2 | #define __ASM_ARM_HARDWARE_ARM_TIMER_H |
| 3 | 3 | ||
| 4 | #define TIMER_LOAD 0x00 | 4 | /* |
| 5 | #define TIMER_VALUE 0x04 | 5 | * ARM timer implementation, found in Integrator, Versatile and Realview |
| 6 | #define TIMER_CTRL 0x08 | 6 | * platforms. Not all platforms support all registers and bits in these |
| 7 | #define TIMER_CTRL_ONESHOT (1 << 0) | 7 | * registers, so we mark them with A for Integrator AP, C for Integrator |
| 8 | #define TIMER_CTRL_32BIT (1 << 1) | 8 | * CP, V for Versatile and R for Realview. |
| 9 | #define TIMER_CTRL_DIV1 (0 << 2) | 9 | * |
| 10 | #define TIMER_CTRL_DIV16 (1 << 2) | 10 | * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview |
| 11 | #define TIMER_CTRL_DIV256 (2 << 2) | 11 | * can have 16-bit or 32-bit selectable via a bit in the control register. |
| 12 | #define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable (versatile only) */ | 12 | */ |
| 13 | #define TIMER_CTRL_PERIODIC (1 << 6) | 13 | #define TIMER_LOAD 0x00 /* ACVR rw */ |
| 14 | #define TIMER_CTRL_ENABLE (1 << 7) | 14 | #define TIMER_VALUE 0x04 /* ACVR ro */ |
| 15 | #define TIMER_CTRL 0x08 /* ACVR rw */ | ||
| 16 | #define TIMER_CTRL_ONESHOT (1 << 0) /* CVR */ | ||
| 17 | #define TIMER_CTRL_32BIT (1 << 1) /* CVR */ | ||
| 18 | #define TIMER_CTRL_DIV1 (0 << 2) /* ACVR */ | ||
| 19 | #define TIMER_CTRL_DIV16 (1 << 2) /* ACVR */ | ||
| 20 | #define TIMER_CTRL_DIV256 (2 << 2) /* ACVR */ | ||
| 21 | #define TIMER_CTRL_IE (1 << 5) /* VR */ | ||
| 22 | #define TIMER_CTRL_PERIODIC (1 << 6) /* ACVR */ | ||
| 23 | #define TIMER_CTRL_ENABLE (1 << 7) /* ACVR */ | ||
| 15 | 24 | ||
| 16 | #define TIMER_INTCLR 0x0c | 25 | #define TIMER_INTCLR 0x0c /* ACVR wo */ |
| 17 | #define TIMER_RIS 0x10 | 26 | #define TIMER_RIS 0x10 /* CVR ro */ |
| 18 | #define TIMER_MIS 0x14 | 27 | #define TIMER_MIS 0x14 /* CVR ro */ |
| 19 | #define TIMER_BGLOAD 0x18 | 28 | #define TIMER_BGLOAD 0x18 /* CVR rw */ |
| 20 | 29 | ||
| 21 | #endif | 30 | #endif |
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h index cdb9022716fd..6bcba48800fe 100644 --- a/arch/arm/include/asm/hardware/cache-l2x0.h +++ b/arch/arm/include/asm/hardware/cache-l2x0.h | |||
| @@ -21,6 +21,9 @@ | |||
| 21 | #define __ASM_ARM_HARDWARE_L2X0_H | 21 | #define __ASM_ARM_HARDWARE_L2X0_H |
| 22 | 22 | ||
| 23 | #define L2X0_CACHE_ID 0x000 | 23 | #define L2X0_CACHE_ID 0x000 |
| 24 | #define L2X0_CACHE_ID_PART_MASK (0xf << 6) | ||
| 25 | #define L2X0_CACHE_ID_PART_L210 (1 << 6) | ||
| 26 | #define L2X0_CACHE_ID_PART_L310 (3 << 6) | ||
| 24 | #define L2X0_CACHE_TYPE 0x004 | 27 | #define L2X0_CACHE_TYPE 0x004 |
| 25 | #define L2X0_CTRL 0x100 | 28 | #define L2X0_CTRL 0x100 |
| 26 | #define L2X0_AUX_CTRL 0x104 | 29 | #define L2X0_AUX_CTRL 0x104 |
diff --git a/arch/arm/include/asm/hardware/icst.h b/arch/arm/include/asm/hardware/icst.h new file mode 100644 index 000000000000..10382a3dcec9 --- /dev/null +++ b/arch/arm/include/asm/hardware/icst.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/include/asm/hardware/icst.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * Support functions for calculating clocks/divisors for the ICST | ||
| 11 | * clock generators. See http://www.icst.com/ for more information | ||
| 12 | * on these devices. | ||
| 13 | */ | ||
| 14 | #ifndef ASMARM_HARDWARE_ICST_H | ||
| 15 | #define ASMARM_HARDWARE_ICST_H | ||
| 16 | |||
| 17 | struct icst_params { | ||
| 18 | unsigned long ref; | ||
| 19 | unsigned long vco_max; /* inclusive */ | ||
| 20 | unsigned long vco_min; /* exclusive */ | ||
| 21 | unsigned short vd_min; /* inclusive */ | ||
| 22 | unsigned short vd_max; /* inclusive */ | ||
| 23 | unsigned char rd_min; /* inclusive */ | ||
| 24 | unsigned char rd_max; /* inclusive */ | ||
| 25 | const unsigned char *s2div; /* chip specific s2div array */ | ||
| 26 | const unsigned char *idx2s; /* chip specific idx2s array */ | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct icst_vco { | ||
| 30 | unsigned short v; | ||
| 31 | unsigned char r; | ||
| 32 | unsigned char s; | ||
| 33 | }; | ||
| 34 | |||
| 35 | unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco); | ||
| 36 | struct icst_vco icst_hz_to_vco(const struct icst_params *p, unsigned long freq); | ||
| 37 | |||
| 38 | /* | ||
| 39 | * ICST307 VCO frequency must be between 6MHz and 200MHz (3.3 or 5V). | ||
| 40 | * This frequency is pre-output divider. | ||
| 41 | */ | ||
| 42 | #define ICST307_VCO_MIN 6000000 | ||
| 43 | #define ICST307_VCO_MAX 200000000 | ||
| 44 | |||
| 45 | extern const unsigned char icst307_s2div[]; | ||
| 46 | extern const unsigned char icst307_idx2s[]; | ||
| 47 | |||
| 48 | /* | ||
| 49 | * ICST525 VCO frequency must be between 10MHz and 200MHz (3V) or 320MHz (5V). | ||
| 50 | * This frequency is pre-output divider. | ||
| 51 | */ | ||
| 52 | #define ICST525_VCO_MIN 10000000 | ||
| 53 | #define ICST525_VCO_MAX_3V 200000000 | ||
| 54 | #define ICST525_VCO_MAX_5V 320000000 | ||
| 55 | |||
| 56 | extern const unsigned char icst525_s2div[]; | ||
| 57 | extern const unsigned char icst525_idx2s[]; | ||
| 58 | |||
| 59 | #endif | ||
diff --git a/arch/arm/include/asm/hardware/icst307.h b/arch/arm/include/asm/hardware/icst307.h deleted file mode 100644 index 554f128a1046..000000000000 --- a/arch/arm/include/asm/hardware/icst307.h +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/include/asm/hardware/icst307.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * Support functions for calculating clocks/divisors for the ICS307 | ||
| 11 | * clock generators. See http://www.icst.com/ for more information | ||
| 12 | * on these devices. | ||
| 13 | * | ||
| 14 | * This file is similar to the icst525.h file | ||
| 15 | */ | ||
| 16 | #ifndef ASMARM_HARDWARE_ICST307_H | ||
| 17 | #define ASMARM_HARDWARE_ICST307_H | ||
| 18 | |||
| 19 | struct icst307_params { | ||
| 20 | unsigned long ref; | ||
| 21 | unsigned long vco_max; /* inclusive */ | ||
| 22 | unsigned short vd_min; /* inclusive */ | ||
| 23 | unsigned short vd_max; /* inclusive */ | ||
| 24 | unsigned char rd_min; /* inclusive */ | ||
| 25 | unsigned char rd_max; /* inclusive */ | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct icst307_vco { | ||
| 29 | unsigned short v; | ||
| 30 | unsigned char r; | ||
| 31 | unsigned char s; | ||
| 32 | }; | ||
| 33 | |||
| 34 | unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco); | ||
| 35 | struct icst307_vco icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq); | ||
| 36 | struct icst307_vco icst307_ps_to_vco(const struct icst307_params *p, unsigned long period); | ||
| 37 | |||
| 38 | #endif | ||
diff --git a/arch/arm/include/asm/hardware/icst525.h b/arch/arm/include/asm/hardware/icst525.h deleted file mode 100644 index 58f0dc43e2ed..000000000000 --- a/arch/arm/include/asm/hardware/icst525.h +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/include/asm/hardware/icst525.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * Support functions for calculating clocks/divisors for the ICST525 | ||
| 11 | * clock generators. See http://www.icst.com/ for more information | ||
| 12 | * on these devices. | ||
| 13 | */ | ||
| 14 | #ifndef ASMARM_HARDWARE_ICST525_H | ||
| 15 | #define ASMARM_HARDWARE_ICST525_H | ||
| 16 | |||
| 17 | struct icst525_params { | ||
| 18 | unsigned long ref; | ||
| 19 | unsigned long vco_max; /* inclusive */ | ||
| 20 | unsigned short vd_min; /* inclusive */ | ||
| 21 | unsigned short vd_max; /* inclusive */ | ||
| 22 | unsigned char rd_min; /* inclusive */ | ||
| 23 | unsigned char rd_max; /* inclusive */ | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct icst525_vco { | ||
| 27 | unsigned short v; | ||
| 28 | unsigned char r; | ||
| 29 | unsigned char s; | ||
| 30 | }; | ||
| 31 | |||
| 32 | unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco); | ||
| 33 | struct icst525_vco icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq); | ||
| 34 | struct icst525_vco icst525_ps_to_vco(const struct icst525_params *p, unsigned long period); | ||
| 35 | |||
| 36 | #endif | ||
diff --git a/arch/arm/include/asm/hardware/pl330.h b/arch/arm/include/asm/hardware/pl330.h new file mode 100644 index 000000000000..575fa8186ca0 --- /dev/null +++ b/arch/arm/include/asm/hardware/pl330.h | |||
| @@ -0,0 +1,217 @@ | |||
| 1 | /* linux/include/asm/hardware/pl330.h | ||
| 2 | * | ||
| 3 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
| 4 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __PL330_CORE_H | ||
| 22 | #define __PL330_CORE_H | ||
| 23 | |||
| 24 | #define PL330_MAX_CHAN 8 | ||
| 25 | #define PL330_MAX_IRQS 32 | ||
| 26 | #define PL330_MAX_PERI 32 | ||
| 27 | |||
| 28 | enum pl330_srccachectrl { | ||
| 29 | SCCTRL0 = 0, /* Noncacheable and nonbufferable */ | ||
| 30 | SCCTRL1, /* Bufferable only */ | ||
| 31 | SCCTRL2, /* Cacheable, but do not allocate */ | ||
| 32 | SCCTRL3, /* Cacheable and bufferable, but do not allocate */ | ||
| 33 | SINVALID1, | ||
| 34 | SINVALID2, | ||
| 35 | SCCTRL6, /* Cacheable write-through, allocate on reads only */ | ||
| 36 | SCCTRL7, /* Cacheable write-back, allocate on reads only */ | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum pl330_dstcachectrl { | ||
| 40 | DCCTRL0 = 0, /* Noncacheable and nonbufferable */ | ||
| 41 | DCCTRL1, /* Bufferable only */ | ||
| 42 | DCCTRL2, /* Cacheable, but do not allocate */ | ||
| 43 | DCCTRL3, /* Cacheable and bufferable, but do not allocate */ | ||
| 44 | DINVALID1 = 8, | ||
| 45 | DINVALID2, | ||
| 46 | DCCTRL6, /* Cacheable write-through, allocate on writes only */ | ||
| 47 | DCCTRL7, /* Cacheable write-back, allocate on writes only */ | ||
| 48 | }; | ||
| 49 | |||
| 50 | /* Populated by the PL330 core driver for DMA API driver's info */ | ||
| 51 | struct pl330_config { | ||
| 52 | u32 periph_id; | ||
| 53 | u32 pcell_id; | ||
| 54 | #define DMAC_MODE_NS (1 << 0) | ||
| 55 | unsigned int mode; | ||
| 56 | unsigned int data_bus_width:10; /* In number of bits */ | ||
| 57 | unsigned int data_buf_dep:10; | ||
| 58 | unsigned int num_chan:4; | ||
| 59 | unsigned int num_peri:6; | ||
| 60 | u32 peri_ns; | ||
| 61 | unsigned int num_events:6; | ||
| 62 | u32 irq_ns; | ||
| 63 | }; | ||
| 64 | |||
| 65 | /* Handle to the DMAC provided to the PL330 core */ | ||
| 66 | struct pl330_info { | ||
| 67 | /* Owning device */ | ||
| 68 | struct device *dev; | ||
| 69 | /* Size of MicroCode buffers for each channel. */ | ||
| 70 | unsigned mcbufsz; | ||
| 71 | /* ioremap'ed address of PL330 registers. */ | ||
| 72 | void __iomem *base; | ||
| 73 | /* Client can freely use it. */ | ||
| 74 | void *client_data; | ||
| 75 | /* PL330 core data, Client must not touch it. */ | ||
| 76 | void *pl330_data; | ||
| 77 | /* Populated by the PL330 core driver during pl330_add */ | ||
| 78 | struct pl330_config pcfg; | ||
| 79 | /* | ||
| 80 | * If the DMAC has some reset mechanism, then the | ||
| 81 | * client may want to provide pointer to the method. | ||
| 82 | */ | ||
| 83 | void (*dmac_reset)(struct pl330_info *pi); | ||
| 84 | }; | ||
| 85 | |||
| 86 | enum pl330_byteswap { | ||
| 87 | SWAP_NO = 0, | ||
| 88 | SWAP_2, | ||
| 89 | SWAP_4, | ||
| 90 | SWAP_8, | ||
| 91 | SWAP_16, | ||
| 92 | }; | ||
| 93 | |||
| 94 | /** | ||
| 95 | * Request Configuration. | ||
| 96 | * The PL330 core does not modify this and uses the last | ||
| 97 | * working configuration if the request doesn't provide any. | ||
| 98 | * | ||
| 99 | * The Client may want to provide this info only for the | ||
| 100 | * first request and a request with new settings. | ||
| 101 | */ | ||
| 102 | struct pl330_reqcfg { | ||
| 103 | /* Address Incrementing */ | ||
| 104 | unsigned dst_inc:1; | ||
| 105 | unsigned src_inc:1; | ||
| 106 | |||
| 107 | /* | ||
| 108 | * For now, the SRC & DST protection levels | ||
| 109 | * and burst size/length are assumed same. | ||
| 110 | */ | ||
| 111 | bool nonsecure; | ||
| 112 | bool privileged; | ||
| 113 | bool insnaccess; | ||
| 114 | unsigned brst_len:5; | ||
| 115 | unsigned brst_size:3; /* in power of 2 */ | ||
| 116 | |||
| 117 | enum pl330_dstcachectrl dcctl; | ||
| 118 | enum pl330_srccachectrl scctl; | ||
| 119 | enum pl330_byteswap swap; | ||
| 120 | }; | ||
| 121 | |||
| 122 | /* | ||
| 123 | * One cycle of DMAC operation. | ||
| 124 | * There may be more than one xfer in a request. | ||
| 125 | */ | ||
| 126 | struct pl330_xfer { | ||
| 127 | u32 src_addr; | ||
| 128 | u32 dst_addr; | ||
| 129 | /* Size to xfer */ | ||
| 130 | u32 bytes; | ||
| 131 | /* | ||
| 132 | * Pointer to next xfer in the list. | ||
| 133 | * The last xfer in the req must point to NULL. | ||
| 134 | */ | ||
| 135 | struct pl330_xfer *next; | ||
| 136 | }; | ||
| 137 | |||
| 138 | /* The xfer callbacks are made with one of these arguments. */ | ||
| 139 | enum pl330_op_err { | ||
| 140 | /* The all xfers in the request were success. */ | ||
| 141 | PL330_ERR_NONE, | ||
| 142 | /* If req aborted due to global error. */ | ||
| 143 | PL330_ERR_ABORT, | ||
| 144 | /* If req failed due to problem with Channel. */ | ||
| 145 | PL330_ERR_FAIL, | ||
| 146 | }; | ||
| 147 | |||
| 148 | enum pl330_reqtype { | ||
| 149 | MEMTOMEM, | ||
| 150 | MEMTODEV, | ||
| 151 | DEVTOMEM, | ||
| 152 | DEVTODEV, | ||
| 153 | }; | ||
| 154 | |||
| 155 | /* A request defining Scatter-Gather List ending with NULL xfer. */ | ||
| 156 | struct pl330_req { | ||
| 157 | enum pl330_reqtype rqtype; | ||
| 158 | /* Index of peripheral for the xfer. */ | ||
| 159 | unsigned peri:5; | ||
| 160 | /* Unique token for this xfer, set by the client. */ | ||
| 161 | void *token; | ||
| 162 | /* Callback to be called after xfer. */ | ||
| 163 | void (*xfer_cb)(void *token, enum pl330_op_err err); | ||
| 164 | /* If NULL, req will be done at last set parameters. */ | ||
| 165 | struct pl330_reqcfg *cfg; | ||
| 166 | /* Pointer to first xfer in the request. */ | ||
| 167 | struct pl330_xfer *x; | ||
| 168 | }; | ||
| 169 | |||
| 170 | /* | ||
| 171 | * To know the status of the channel and DMAC, the client | ||
| 172 | * provides a pointer to this structure. The PL330 core | ||
| 173 | * fills it with current information. | ||
| 174 | */ | ||
| 175 | struct pl330_chanstatus { | ||
| 176 | /* | ||
| 177 | * If the DMAC engine halted due to some error, | ||
| 178 | * the client should remove-add DMAC. | ||
| 179 | */ | ||
| 180 | bool dmac_halted; | ||
| 181 | /* | ||
| 182 | * If channel is halted due to some error, | ||
| 183 | * the client should ABORT/FLUSH and START the channel. | ||
| 184 | */ | ||
| 185 | bool faulting; | ||
| 186 | /* Location of last load */ | ||
| 187 | u32 src_addr; | ||
| 188 | /* Location of last store */ | ||
| 189 | u32 dst_addr; | ||
| 190 | /* | ||
| 191 | * Pointer to the currently active req, NULL if channel is | ||
| 192 | * inactive, even though the requests may be present. | ||
| 193 | */ | ||
| 194 | struct pl330_req *top_req; | ||
| 195 | /* Pointer to req waiting second in the queue if any. */ | ||
| 196 | struct pl330_req *wait_req; | ||
| 197 | }; | ||
| 198 | |||
| 199 | enum pl330_chan_op { | ||
| 200 | /* Start the channel */ | ||
| 201 | PL330_OP_START, | ||
| 202 | /* Abort the active xfer */ | ||
| 203 | PL330_OP_ABORT, | ||
| 204 | /* Stop xfer and flush queue */ | ||
| 205 | PL330_OP_FLUSH, | ||
| 206 | }; | ||
| 207 | |||
| 208 | extern int pl330_add(struct pl330_info *); | ||
| 209 | extern void pl330_del(struct pl330_info *pi); | ||
| 210 | extern int pl330_update(const struct pl330_info *pi); | ||
| 211 | extern void pl330_release_channel(void *ch_id); | ||
| 212 | extern void *pl330_request_channel(const struct pl330_info *pi); | ||
| 213 | extern int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus); | ||
| 214 | extern int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op); | ||
| 215 | extern int pl330_submit_req(void *ch_id, struct pl330_req *r); | ||
| 216 | |||
| 217 | #endif /* __PL330_CORE_H */ | ||
diff --git a/arch/arm/include/asm/hardware/sp810.h b/arch/arm/include/asm/hardware/sp810.h new file mode 100644 index 000000000000..a101f10bb5b1 --- /dev/null +++ b/arch/arm/include/asm/hardware/sp810.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/include/asm/hardware/sp810.h | ||
| 3 | * | ||
| 4 | * ARM PrimeXsys System Controller SP810 header file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __ASM_ARM_SP810_H | ||
| 15 | #define __ASM_ARM_SP810_H | ||
| 16 | |||
| 17 | #include <linux/io.h> | ||
| 18 | |||
| 19 | /* sysctl registers offset */ | ||
| 20 | #define SCCTRL 0x000 | ||
| 21 | #define SCSYSSTAT 0x004 | ||
| 22 | #define SCIMCTRL 0x008 | ||
| 23 | #define SCIMSTAT 0x00C | ||
| 24 | #define SCXTALCTRL 0x010 | ||
| 25 | #define SCPLLCTRL 0x014 | ||
| 26 | #define SCPLLFCTRL 0x018 | ||
| 27 | #define SCPERCTRL0 0x01C | ||
| 28 | #define SCPERCTRL1 0x020 | ||
| 29 | #define SCPEREN 0x024 | ||
| 30 | #define SCPERDIS 0x028 | ||
| 31 | #define SCPERCLKEN 0x02C | ||
| 32 | #define SCPERSTAT 0x030 | ||
| 33 | #define SCSYSID0 0xEE0 | ||
| 34 | #define SCSYSID1 0xEE4 | ||
| 35 | #define SCSYSID2 0xEE8 | ||
| 36 | #define SCSYSID3 0xEEC | ||
| 37 | #define SCITCR 0xF00 | ||
| 38 | #define SCITIR0 0xF04 | ||
| 39 | #define SCITIR1 0xF08 | ||
| 40 | #define SCITOR 0xF0C | ||
| 41 | #define SCCNTCTRL 0xF10 | ||
| 42 | #define SCCNTDATA 0xF14 | ||
| 43 | #define SCCNTSTEP 0xF18 | ||
| 44 | #define SCPERIPHID0 0xFE0 | ||
| 45 | #define SCPERIPHID1 0xFE4 | ||
| 46 | #define SCPERIPHID2 0xFE8 | ||
| 47 | #define SCPERIPHID3 0xFEC | ||
| 48 | #define SCPCELLID0 0xFF0 | ||
| 49 | #define SCPCELLID1 0xFF4 | ||
| 50 | #define SCPCELLID2 0xFF8 | ||
| 51 | #define SCPCELLID3 0xFFC | ||
| 52 | |||
| 53 | static inline void sysctl_soft_reset(void __iomem *base) | ||
| 54 | { | ||
| 55 | /* writing any value to SCSYSSTAT reg will reset system */ | ||
| 56 | writel(0, base + SCSYSSTAT); | ||
| 57 | } | ||
| 58 | |||
| 59 | #endif /* __ASM_ARM_SP810_H */ | ||
diff --git a/arch/arm/include/asm/ioctls.h b/arch/arm/include/asm/ioctls.h index a91d8a1523cf..7f0b6d13296a 100644 --- a/arch/arm/include/asm/ioctls.h +++ b/arch/arm/include/asm/ioctls.h | |||
| @@ -53,6 +53,9 @@ | |||
| 53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
| 54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
| 55 | 55 | ||
| 56 | #define TIOCGRS485 0x542E | ||
| 57 | #define TIOCSRS485 0x542F | ||
| 58 | |||
| 56 | #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ | 59 | #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ |
| 57 | #define FIOCLEX 0x5451 | 60 | #define FIOCLEX 0x5451 |
| 58 | #define FIOASYNC 0x5452 | 61 | #define FIOASYNC 0x5452 |
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h index a38bdc7afa34..52f0da1e97df 100644 --- a/arch/arm/include/asm/mach/pci.h +++ b/arch/arm/include/asm/mach/pci.h | |||
| @@ -8,10 +8,16 @@ | |||
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #ifndef __ASM_MACH_PCI_H | ||
| 12 | #define __ASM_MACH_PCI_H | ||
| 13 | |||
| 11 | struct pci_sys_data; | 14 | struct pci_sys_data; |
| 12 | struct pci_bus; | 15 | struct pci_bus; |
| 13 | 16 | ||
| 14 | struct hw_pci { | 17 | struct hw_pci { |
| 18 | #ifdef CONFIG_PCI_DOMAINS | ||
| 19 | int domain; | ||
| 20 | #endif | ||
| 15 | struct list_head buses; | 21 | struct list_head buses; |
| 16 | int nr_controllers; | 22 | int nr_controllers; |
| 17 | int (*setup)(int nr, struct pci_sys_data *); | 23 | int (*setup)(int nr, struct pci_sys_data *); |
| @@ -26,6 +32,9 @@ struct hw_pci { | |||
| 26 | * Per-controller structure | 32 | * Per-controller structure |
| 27 | */ | 33 | */ |
| 28 | struct pci_sys_data { | 34 | struct pci_sys_data { |
| 35 | #ifdef CONFIG_PCI_DOMAINS | ||
| 36 | int domain; | ||
| 37 | #endif | ||
| 29 | struct list_head node; | 38 | struct list_head node; |
| 30 | int busnr; /* primary bus number */ | 39 | int busnr; /* primary bus number */ |
| 31 | u64 mem_offset; /* bus->cpu memory mapping offset */ | 40 | u64 mem_offset; /* bus->cpu memory mapping offset */ |
| @@ -70,3 +79,5 @@ extern int pci_v3_setup(int nr, struct pci_sys_data *); | |||
| 70 | extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *); | 79 | extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *); |
| 71 | extern void pci_v3_preinit(void); | 80 | extern void pci_v3_preinit(void); |
| 72 | extern void pci_v3_postinit(void); | 81 | extern void pci_v3_postinit(void); |
| 82 | |||
| 83 | #endif /* __ASM_MACH_PCI_H */ | ||
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h index 8bffc3ff3acf..35d408f6dccf 100644 --- a/arch/arm/include/asm/mach/time.h +++ b/arch/arm/include/asm/mach/time.h | |||
| @@ -38,7 +38,7 @@ struct sys_timer { | |||
| 38 | void (*init)(void); | 38 | void (*init)(void); |
| 39 | void (*suspend)(void); | 39 | void (*suspend)(void); |
| 40 | void (*resume)(void); | 40 | void (*resume)(void); |
| 41 | #ifndef CONFIG_GENERIC_TIME | 41 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET |
| 42 | unsigned long (*offset)(void); | 42 | unsigned long (*offset)(void); |
| 43 | #endif | 43 | #endif |
| 44 | }; | 44 | }; |
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h index 47980118d0a5..92e2a833693d 100644 --- a/arch/arm/include/asm/pci.h +++ b/arch/arm/include/asm/pci.h | |||
| @@ -4,8 +4,23 @@ | |||
| 4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
| 5 | #include <asm-generic/pci-dma-compat.h> | 5 | #include <asm-generic/pci-dma-compat.h> |
| 6 | 6 | ||
| 7 | #include <asm/mach/pci.h> /* for pci_sys_data */ | ||
| 7 | #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ | 8 | #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ |
| 8 | 9 | ||
| 10 | #ifdef CONFIG_PCI_DOMAINS | ||
| 11 | static inline int pci_domain_nr(struct pci_bus *bus) | ||
| 12 | { | ||
| 13 | struct pci_sys_data *root = bus->sysdata; | ||
| 14 | |||
| 15 | return root->domain; | ||
| 16 | } | ||
| 17 | |||
| 18 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
| 19 | { | ||
| 20 | return pci_domain_nr(bus); | ||
| 21 | } | ||
| 22 | #endif /* CONFIG_PCI_DOMAINS */ | ||
| 23 | |||
| 9 | #ifdef CONFIG_PCI_HOST_ITE8152 | 24 | #ifdef CONFIG_PCI_HOST_ITE8152 |
| 10 | /* ITE bridge requires setting latency timer to avoid early bus access | 25 | /* ITE bridge requires setting latency timer to avoid early bus access |
| 11 | termination by PIC bus mater devices | 26 | termination by PIC bus mater devices |
diff --git a/arch/arm/include/asm/perf_event.h b/arch/arm/include/asm/perf_event.h index 49e3049aba32..48837e6d8887 100644 --- a/arch/arm/include/asm/perf_event.h +++ b/arch/arm/include/asm/perf_event.h | |||
| @@ -28,4 +28,21 @@ set_perf_event_pending(void) | |||
| 28 | * same indexes here for consistency. */ | 28 | * same indexes here for consistency. */ |
| 29 | #define PERF_EVENT_INDEX_OFFSET 1 | 29 | #define PERF_EVENT_INDEX_OFFSET 1 |
| 30 | 30 | ||
| 31 | /* ARM perf PMU IDs for use by internal perf clients. */ | ||
| 32 | enum arm_perf_pmu_ids { | ||
| 33 | ARM_PERF_PMU_ID_XSCALE1 = 0, | ||
| 34 | ARM_PERF_PMU_ID_XSCALE2, | ||
| 35 | ARM_PERF_PMU_ID_V6, | ||
| 36 | ARM_PERF_PMU_ID_V6MP, | ||
| 37 | ARM_PERF_PMU_ID_CA8, | ||
| 38 | ARM_PERF_PMU_ID_CA9, | ||
| 39 | ARM_NUM_PMU_IDS, | ||
| 40 | }; | ||
| 41 | |||
| 42 | extern enum arm_perf_pmu_ids | ||
| 43 | armpmu_get_pmu_id(void); | ||
| 44 | |||
| 45 | extern int | ||
| 46 | armpmu_get_max_events(void); | ||
| 47 | |||
| 31 | #endif /* __ARM_PERF_EVENT_H__ */ | 48 | #endif /* __ARM_PERF_EVENT_H__ */ |
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 11397687f42c..ab68cf1ef80f 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
| @@ -314,7 +314,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
| 314 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED) | 314 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED) |
| 315 | #define pgprot_writecombine(prot) \ | 315 | #define pgprot_writecombine(prot) \ |
| 316 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE) | 316 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE) |
| 317 | #if __LINUX_ARM_ARCH__ >= 7 | 317 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE |
| 318 | #define pgprot_dmacoherent(prot) \ | 318 | #define pgprot_dmacoherent(prot) \ |
| 319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) | 319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) |
| 320 | #else | 320 | #else |
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h index 2829b9f981a1..8ccea012722c 100644 --- a/arch/arm/include/asm/pmu.h +++ b/arch/arm/include/asm/pmu.h | |||
| @@ -12,33 +12,33 @@ | |||
| 12 | #ifndef __ARM_PMU_H__ | 12 | #ifndef __ARM_PMU_H__ |
| 13 | #define __ARM_PMU_H__ | 13 | #define __ARM_PMU_H__ |
| 14 | 14 | ||
| 15 | #ifdef CONFIG_CPU_HAS_PMU | 15 | enum arm_pmu_type { |
| 16 | 16 | ARM_PMU_DEVICE_CPU = 0, | |
| 17 | struct pmu_irqs { | 17 | ARM_NUM_PMU_DEVICES, |
| 18 | const int *irqs; | ||
| 19 | int num_irqs; | ||
| 20 | }; | 18 | }; |
| 21 | 19 | ||
| 20 | #ifdef CONFIG_CPU_HAS_PMU | ||
| 21 | |||
| 22 | /** | 22 | /** |
| 23 | * reserve_pmu() - reserve the hardware performance counters | 23 | * reserve_pmu() - reserve the hardware performance counters |
| 24 | * | 24 | * |
| 25 | * Reserve the hardware performance counters in the system for exclusive use. | 25 | * Reserve the hardware performance counters in the system for exclusive use. |
| 26 | * The 'struct pmu_irqs' for the system is returned on success, ERR_PTR() | 26 | * The platform_device for the system is returned on success, ERR_PTR() |
| 27 | * encoded error on failure. | 27 | * encoded error on failure. |
| 28 | */ | 28 | */ |
| 29 | extern const struct pmu_irqs * | 29 | extern struct platform_device * |
| 30 | reserve_pmu(void); | 30 | reserve_pmu(enum arm_pmu_type device); |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * release_pmu() - Relinquish control of the performance counters | 33 | * release_pmu() - Relinquish control of the performance counters |
| 34 | * | 34 | * |
| 35 | * Release the performance counters and allow someone else to use them. | 35 | * Release the performance counters and allow someone else to use them. |
| 36 | * Callers must have disabled the counters and released IRQs before calling | 36 | * Callers must have disabled the counters and released IRQs before calling |
| 37 | * this. The 'struct pmu_irqs' returned from reserve_pmu() must be passed as | 37 | * this. The platform_device returned from reserve_pmu() must be passed as |
| 38 | * a cookie. | 38 | * a cookie. |
| 39 | */ | 39 | */ |
| 40 | extern int | 40 | extern int |
| 41 | release_pmu(const struct pmu_irqs *irqs); | 41 | release_pmu(struct platform_device *pdev); |
| 42 | 42 | ||
| 43 | /** | 43 | /** |
| 44 | * init_pmu() - Initialise the PMU. | 44 | * init_pmu() - Initialise the PMU. |
| @@ -48,24 +48,26 @@ release_pmu(const struct pmu_irqs *irqs); | |||
| 48 | * the actual hardware initialisation. | 48 | * the actual hardware initialisation. |
| 49 | */ | 49 | */ |
| 50 | extern int | 50 | extern int |
| 51 | init_pmu(void); | 51 | init_pmu(enum arm_pmu_type device); |
| 52 | 52 | ||
| 53 | #else /* CONFIG_CPU_HAS_PMU */ | 53 | #else /* CONFIG_CPU_HAS_PMU */ |
| 54 | 54 | ||
| 55 | static inline const struct pmu_irqs * | 55 | #include <linux/err.h> |
| 56 | reserve_pmu(void) | 56 | |
| 57 | static inline struct platform_device * | ||
| 58 | reserve_pmu(enum arm_pmu_type device) | ||
| 57 | { | 59 | { |
| 58 | return ERR_PTR(-ENODEV); | 60 | return ERR_PTR(-ENODEV); |
| 59 | } | 61 | } |
| 60 | 62 | ||
| 61 | static inline int | 63 | static inline int |
| 62 | release_pmu(const struct pmu_irqs *irqs) | 64 | release_pmu(struct platform_device *pdev) |
| 63 | { | 65 | { |
| 64 | return -ENODEV; | 66 | return -ENODEV; |
| 65 | } | 67 | } |
| 66 | 68 | ||
| 67 | static inline int | 69 | static inline int |
| 68 | init_pmu(void) | 70 | init_pmu(enum arm_pmu_type device) |
| 69 | { | 71 | { |
| 70 | return -ENODEV; | 72 | return -ENODEV; |
| 71 | } | 73 | } |
diff --git a/arch/arm/include/asm/scatterlist.h b/arch/arm/include/asm/scatterlist.h index ca0a37d03400..bcda59f39941 100644 --- a/arch/arm/include/asm/scatterlist.h +++ b/arch/arm/include/asm/scatterlist.h | |||
| @@ -4,24 +4,8 @@ | |||
| 4 | #include <asm/memory.h> | 4 | #include <asm/memory.h> |
| 5 | #include <asm/types.h> | 5 | #include <asm/types.h> |
| 6 | 6 | ||
| 7 | struct scatterlist { | 7 | #include <asm-generic/scatterlist.h> |
| 8 | #ifdef CONFIG_DEBUG_SG | ||
| 9 | unsigned long sg_magic; | ||
| 10 | #endif | ||
| 11 | unsigned long page_link; | ||
| 12 | unsigned int offset; /* buffer offset */ | ||
| 13 | dma_addr_t dma_address; /* dma address */ | ||
| 14 | unsigned int length; /* length */ | ||
| 15 | }; | ||
| 16 | 8 | ||
| 17 | /* | 9 | #undef ARCH_HAS_SG_CHAIN |
| 18 | * These macros should be used after a pci_map_sg call has been done | ||
| 19 | * to get bus addresses of each of the SG entries and their lengths. | ||
| 20 | * You should only work with the number of sg entries pci_map_sg | ||
| 21 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
| 22 | * is 0. | ||
| 23 | */ | ||
| 24 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
| 25 | #define sg_dma_len(sg) ((sg)->length) | ||
| 26 | 10 | ||
| 27 | #endif /* _ASMARM_SCATTERLIST_H */ | 11 | #endif /* _ASMARM_SCATTERLIST_H */ |
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index e0d763be1846..3d05190797cb 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
| @@ -82,7 +82,7 @@ struct secondary_data { | |||
| 82 | extern struct secondary_data secondary_data; | 82 | extern struct secondary_data secondary_data; |
| 83 | 83 | ||
| 84 | extern int __cpu_disable(void); | 84 | extern int __cpu_disable(void); |
| 85 | extern int mach_cpu_disable(unsigned int cpu); | 85 | extern int platform_cpu_disable(unsigned int cpu); |
| 86 | 86 | ||
| 87 | extern void __cpu_die(unsigned int cpu); | 87 | extern void __cpu_die(unsigned int cpu); |
| 88 | extern void cpu_die(void); | 88 | extern void cpu_die(void); |
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 4ace45ec3ef8..5f4f48002734 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
| @@ -141,7 +141,7 @@ extern unsigned int user_debug; | |||
| 141 | 141 | ||
| 142 | #ifdef CONFIG_ARCH_HAS_BARRIERS | 142 | #ifdef CONFIG_ARCH_HAS_BARRIERS |
| 143 | #include <mach/barriers.h> | 143 | #include <mach/barriers.h> |
| 144 | #elif __LINUX_ARM_ARCH__ >= 7 || defined(CONFIG_SMP) | 144 | #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) |
| 145 | #define mb() do { dsb(); outer_sync(); } while (0) | 145 | #define mb() do { dsb(); outer_sync(); } while (0) |
| 146 | #define rmb() dmb() | 146 | #define rmb() dmb() |
| 147 | #define wmb() mb() | 147 | #define wmb() mb() |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index bd397e0b663e..c6273a3bfc25 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
| @@ -527,6 +527,9 @@ static void __init pcibios_init_hw(struct hw_pci *hw) | |||
| 527 | if (!sys) | 527 | if (!sys) |
| 528 | panic("PCI: unable to allocate sys data!"); | 528 | panic("PCI: unable to allocate sys data!"); |
| 529 | 529 | ||
| 530 | #ifdef CONFIG_PCI_DOMAINS | ||
| 531 | sys->domain = hw->domain; | ||
| 532 | #endif | ||
| 530 | sys->hw = hw; | 533 | sys->hw = hw; |
| 531 | sys->busnr = busnr; | 534 | sys->busnr = busnr; |
| 532 | sys->swizzle = hw->swizzle; | 535 | sys->swizzle = hw->swizzle; |
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c index 7d5b9fb01e71..2c4a185f92cd 100644 --- a/arch/arm/kernel/dma.c +++ b/arch/arm/kernel/dma.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <linux/scatterlist.h> | 18 | #include <linux/scatterlist.h> |
| 19 | #include <linux/seq_file.h> | ||
| 20 | #include <linux/proc_fs.h> | ||
| 19 | 21 | ||
| 20 | #include <asm/dma.h> | 22 | #include <asm/dma.h> |
| 21 | 23 | ||
| @@ -264,3 +266,37 @@ int get_dma_residue(unsigned int chan) | |||
| 264 | return ret; | 266 | return ret; |
| 265 | } | 267 | } |
| 266 | EXPORT_SYMBOL(get_dma_residue); | 268 | EXPORT_SYMBOL(get_dma_residue); |
| 269 | |||
| 270 | #ifdef CONFIG_PROC_FS | ||
| 271 | static int proc_dma_show(struct seq_file *m, void *v) | ||
| 272 | { | ||
| 273 | int i; | ||
| 274 | |||
| 275 | for (i = 0 ; i < MAX_DMA_CHANNELS ; i++) { | ||
| 276 | dma_t *dma = dma_channel(i); | ||
| 277 | if (dma && dma->lock) | ||
| 278 | seq_printf(m, "%2d: %s\n", i, dma->device_id); | ||
| 279 | } | ||
| 280 | return 0; | ||
| 281 | } | ||
| 282 | |||
| 283 | static int proc_dma_open(struct inode *inode, struct file *file) | ||
| 284 | { | ||
| 285 | return single_open(file, proc_dma_show, NULL); | ||
| 286 | } | ||
| 287 | |||
| 288 | static const struct file_operations proc_dma_operations = { | ||
| 289 | .open = proc_dma_open, | ||
| 290 | .read = seq_read, | ||
| 291 | .llseek = seq_lseek, | ||
| 292 | .release = single_release, | ||
| 293 | }; | ||
| 294 | |||
| 295 | static int __init proc_dma_init(void) | ||
| 296 | { | ||
| 297 | proc_create("dma", 0, NULL, &proc_dma_operations); | ||
| 298 | return 0; | ||
| 299 | } | ||
| 300 | |||
| 301 | __initcall(proc_dma_init); | ||
| 302 | #endif | ||
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 9e70f2053f9a..c45768614c8a 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
| @@ -16,7 +16,9 @@ | |||
| 16 | 16 | ||
| 17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
| 18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 19 | #include <linux/module.h> | ||
| 19 | #include <linux/perf_event.h> | 20 | #include <linux/perf_event.h> |
| 21 | #include <linux/platform_device.h> | ||
| 20 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
| 21 | #include <linux/uaccess.h> | 23 | #include <linux/uaccess.h> |
| 22 | 24 | ||
| @@ -26,7 +28,7 @@ | |||
| 26 | #include <asm/pmu.h> | 28 | #include <asm/pmu.h> |
| 27 | #include <asm/stacktrace.h> | 29 | #include <asm/stacktrace.h> |
| 28 | 30 | ||
| 29 | static const struct pmu_irqs *pmu_irqs; | 31 | static struct platform_device *pmu_device; |
| 30 | 32 | ||
| 31 | /* | 33 | /* |
| 32 | * Hardware lock to serialize accesses to PMU registers. Needed for the | 34 | * Hardware lock to serialize accesses to PMU registers. Needed for the |
| @@ -67,8 +69,18 @@ struct cpu_hw_events { | |||
| 67 | }; | 69 | }; |
| 68 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); | 70 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events); |
| 69 | 71 | ||
| 72 | /* PMU names. */ | ||
| 73 | static const char *arm_pmu_names[] = { | ||
| 74 | [ARM_PERF_PMU_ID_XSCALE1] = "xscale1", | ||
| 75 | [ARM_PERF_PMU_ID_XSCALE2] = "xscale2", | ||
| 76 | [ARM_PERF_PMU_ID_V6] = "v6", | ||
| 77 | [ARM_PERF_PMU_ID_V6MP] = "v6mpcore", | ||
| 78 | [ARM_PERF_PMU_ID_CA8] = "ARMv7 Cortex-A8", | ||
| 79 | [ARM_PERF_PMU_ID_CA9] = "ARMv7 Cortex-A9", | ||
| 80 | }; | ||
| 81 | |||
| 70 | struct arm_pmu { | 82 | struct arm_pmu { |
| 71 | char *name; | 83 | enum arm_perf_pmu_ids id; |
| 72 | irqreturn_t (*handle_irq)(int irq_num, void *dev); | 84 | irqreturn_t (*handle_irq)(int irq_num, void *dev); |
| 73 | void (*enable)(struct hw_perf_event *evt, int idx); | 85 | void (*enable)(struct hw_perf_event *evt, int idx); |
| 74 | void (*disable)(struct hw_perf_event *evt, int idx); | 86 | void (*disable)(struct hw_perf_event *evt, int idx); |
| @@ -87,6 +99,30 @@ struct arm_pmu { | |||
| 87 | /* Set at runtime when we know what CPU type we are. */ | 99 | /* Set at runtime when we know what CPU type we are. */ |
| 88 | static const struct arm_pmu *armpmu; | 100 | static const struct arm_pmu *armpmu; |
| 89 | 101 | ||
| 102 | enum arm_perf_pmu_ids | ||
| 103 | armpmu_get_pmu_id(void) | ||
| 104 | { | ||
| 105 | int id = -ENODEV; | ||
| 106 | |||
| 107 | if (armpmu != NULL) | ||
| 108 | id = armpmu->id; | ||
| 109 | |||
| 110 | return id; | ||
| 111 | } | ||
| 112 | EXPORT_SYMBOL_GPL(armpmu_get_pmu_id); | ||
| 113 | |||
| 114 | int | ||
| 115 | armpmu_get_max_events(void) | ||
| 116 | { | ||
| 117 | int max_events = 0; | ||
| 118 | |||
| 119 | if (armpmu != NULL) | ||
| 120 | max_events = armpmu->num_events; | ||
| 121 | |||
| 122 | return max_events; | ||
| 123 | } | ||
| 124 | EXPORT_SYMBOL_GPL(armpmu_get_max_events); | ||
| 125 | |||
| 90 | #define HW_OP_UNSUPPORTED 0xFFFF | 126 | #define HW_OP_UNSUPPORTED 0xFFFF |
| 91 | 127 | ||
| 92 | #define C(_x) \ | 128 | #define C(_x) \ |
| @@ -314,38 +350,44 @@ validate_group(struct perf_event *event) | |||
| 314 | static int | 350 | static int |
| 315 | armpmu_reserve_hardware(void) | 351 | armpmu_reserve_hardware(void) |
| 316 | { | 352 | { |
| 317 | int i; | 353 | int i, err = -ENODEV, irq; |
| 318 | int err; | ||
| 319 | 354 | ||
| 320 | pmu_irqs = reserve_pmu(); | 355 | pmu_device = reserve_pmu(ARM_PMU_DEVICE_CPU); |
| 321 | if (IS_ERR(pmu_irqs)) { | 356 | if (IS_ERR(pmu_device)) { |
| 322 | pr_warning("unable to reserve pmu\n"); | 357 | pr_warning("unable to reserve pmu\n"); |
| 323 | return PTR_ERR(pmu_irqs); | 358 | return PTR_ERR(pmu_device); |
| 324 | } | 359 | } |
| 325 | 360 | ||
| 326 | init_pmu(); | 361 | init_pmu(ARM_PMU_DEVICE_CPU); |
| 327 | 362 | ||
| 328 | if (pmu_irqs->num_irqs < 1) { | 363 | if (pmu_device->num_resources < 1) { |
| 329 | pr_err("no irqs for PMUs defined\n"); | 364 | pr_err("no irqs for PMUs defined\n"); |
| 330 | return -ENODEV; | 365 | return -ENODEV; |
| 331 | } | 366 | } |
| 332 | 367 | ||
| 333 | for (i = 0; i < pmu_irqs->num_irqs; ++i) { | 368 | for (i = 0; i < pmu_device->num_resources; ++i) { |
| 334 | err = request_irq(pmu_irqs->irqs[i], armpmu->handle_irq, | 369 | irq = platform_get_irq(pmu_device, i); |
| 370 | if (irq < 0) | ||
| 371 | continue; | ||
| 372 | |||
| 373 | err = request_irq(irq, armpmu->handle_irq, | ||
| 335 | IRQF_DISABLED | IRQF_NOBALANCING, | 374 | IRQF_DISABLED | IRQF_NOBALANCING, |
| 336 | "armpmu", NULL); | 375 | "armpmu", NULL); |
| 337 | if (err) { | 376 | if (err) { |
| 338 | pr_warning("unable to request IRQ%d for ARM " | 377 | pr_warning("unable to request IRQ%d for ARM perf " |
| 339 | "perf counters\n", pmu_irqs->irqs[i]); | 378 | "counters\n", irq); |
| 340 | break; | 379 | break; |
| 341 | } | 380 | } |
| 342 | } | 381 | } |
| 343 | 382 | ||
| 344 | if (err) { | 383 | if (err) { |
| 345 | for (i = i - 1; i >= 0; --i) | 384 | for (i = i - 1; i >= 0; --i) { |
| 346 | free_irq(pmu_irqs->irqs[i], NULL); | 385 | irq = platform_get_irq(pmu_device, i); |
| 347 | release_pmu(pmu_irqs); | 386 | if (irq >= 0) |
| 348 | pmu_irqs = NULL; | 387 | free_irq(irq, NULL); |
| 388 | } | ||
| 389 | release_pmu(pmu_device); | ||
| 390 | pmu_device = NULL; | ||
| 349 | } | 391 | } |
| 350 | 392 | ||
| 351 | return err; | 393 | return err; |
| @@ -354,14 +396,17 @@ armpmu_reserve_hardware(void) | |||
| 354 | static void | 396 | static void |
| 355 | armpmu_release_hardware(void) | 397 | armpmu_release_hardware(void) |
| 356 | { | 398 | { |
| 357 | int i; | 399 | int i, irq; |
| 358 | 400 | ||
| 359 | for (i = pmu_irqs->num_irqs - 1; i >= 0; --i) | 401 | for (i = pmu_device->num_resources - 1; i >= 0; --i) { |
| 360 | free_irq(pmu_irqs->irqs[i], NULL); | 402 | irq = platform_get_irq(pmu_device, i); |
| 403 | if (irq >= 0) | ||
| 404 | free_irq(irq, NULL); | ||
| 405 | } | ||
| 361 | armpmu->stop(); | 406 | armpmu->stop(); |
| 362 | 407 | ||
| 363 | release_pmu(pmu_irqs); | 408 | release_pmu(pmu_device); |
| 364 | pmu_irqs = NULL; | 409 | pmu_device = NULL; |
| 365 | } | 410 | } |
| 366 | 411 | ||
| 367 | static atomic_t active_events = ATOMIC_INIT(0); | 412 | static atomic_t active_events = ATOMIC_INIT(0); |
| @@ -1144,7 +1189,7 @@ armv6mpcore_pmu_disable_event(struct hw_perf_event *hwc, | |||
| 1144 | } | 1189 | } |
| 1145 | 1190 | ||
| 1146 | static const struct arm_pmu armv6pmu = { | 1191 | static const struct arm_pmu armv6pmu = { |
| 1147 | .name = "v6", | 1192 | .id = ARM_PERF_PMU_ID_V6, |
| 1148 | .handle_irq = armv6pmu_handle_irq, | 1193 | .handle_irq = armv6pmu_handle_irq, |
| 1149 | .enable = armv6pmu_enable_event, | 1194 | .enable = armv6pmu_enable_event, |
| 1150 | .disable = armv6pmu_disable_event, | 1195 | .disable = armv6pmu_disable_event, |
| @@ -1167,7 +1212,7 @@ static const struct arm_pmu armv6pmu = { | |||
| 1167 | * reset the period and enable the interrupt reporting. | 1212 | * reset the period and enable the interrupt reporting. |
| 1168 | */ | 1213 | */ |
| 1169 | static const struct arm_pmu armv6mpcore_pmu = { | 1214 | static const struct arm_pmu armv6mpcore_pmu = { |
| 1170 | .name = "v6mpcore", | 1215 | .id = ARM_PERF_PMU_ID_V6MP, |
| 1171 | .handle_irq = armv6pmu_handle_irq, | 1216 | .handle_irq = armv6pmu_handle_irq, |
| 1172 | .enable = armv6pmu_enable_event, | 1217 | .enable = armv6pmu_enable_event, |
| 1173 | .disable = armv6mpcore_pmu_disable_event, | 1218 | .disable = armv6mpcore_pmu_disable_event, |
| @@ -1197,10 +1242,6 @@ static const struct arm_pmu armv6mpcore_pmu = { | |||
| 1197 | * counter and all 4 performance counters together can be reset separately. | 1242 | * counter and all 4 performance counters together can be reset separately. |
| 1198 | */ | 1243 | */ |
| 1199 | 1244 | ||
| 1200 | #define ARMV7_PMU_CORTEX_A8_NAME "ARMv7 Cortex-A8" | ||
| 1201 | |||
| 1202 | #define ARMV7_PMU_CORTEX_A9_NAME "ARMv7 Cortex-A9" | ||
| 1203 | |||
| 1204 | /* Common ARMv7 event types */ | 1245 | /* Common ARMv7 event types */ |
| 1205 | enum armv7_perf_types { | 1246 | enum armv7_perf_types { |
| 1206 | ARMV7_PERFCTR_PMNC_SW_INCR = 0x00, | 1247 | ARMV7_PERFCTR_PMNC_SW_INCR = 0x00, |
| @@ -2079,6 +2120,803 @@ static u32 __init armv7_reset_read_pmnc(void) | |||
| 2079 | return nb_cnt + 1; | 2120 | return nb_cnt + 1; |
| 2080 | } | 2121 | } |
| 2081 | 2122 | ||
| 2123 | /* | ||
| 2124 | * ARMv5 [xscale] Performance counter handling code. | ||
| 2125 | * | ||
| 2126 | * Based on xscale OProfile code. | ||
| 2127 | * | ||
| 2128 | * There are two variants of the xscale PMU that we support: | ||
| 2129 | * - xscale1pmu: 2 event counters and a cycle counter | ||
| 2130 | * - xscale2pmu: 4 event counters and a cycle counter | ||
| 2131 | * The two variants share event definitions, but have different | ||
| 2132 | * PMU structures. | ||
| 2133 | */ | ||
| 2134 | |||
| 2135 | enum xscale_perf_types { | ||
| 2136 | XSCALE_PERFCTR_ICACHE_MISS = 0x00, | ||
| 2137 | XSCALE_PERFCTR_ICACHE_NO_DELIVER = 0x01, | ||
| 2138 | XSCALE_PERFCTR_DATA_STALL = 0x02, | ||
| 2139 | XSCALE_PERFCTR_ITLB_MISS = 0x03, | ||
| 2140 | XSCALE_PERFCTR_DTLB_MISS = 0x04, | ||
| 2141 | XSCALE_PERFCTR_BRANCH = 0x05, | ||
| 2142 | XSCALE_PERFCTR_BRANCH_MISS = 0x06, | ||
| 2143 | XSCALE_PERFCTR_INSTRUCTION = 0x07, | ||
| 2144 | XSCALE_PERFCTR_DCACHE_FULL_STALL = 0x08, | ||
| 2145 | XSCALE_PERFCTR_DCACHE_FULL_STALL_CONTIG = 0x09, | ||
| 2146 | XSCALE_PERFCTR_DCACHE_ACCESS = 0x0A, | ||
| 2147 | XSCALE_PERFCTR_DCACHE_MISS = 0x0B, | ||
| 2148 | XSCALE_PERFCTR_DCACHE_WRITE_BACK = 0x0C, | ||
| 2149 | XSCALE_PERFCTR_PC_CHANGED = 0x0D, | ||
| 2150 | XSCALE_PERFCTR_BCU_REQUEST = 0x10, | ||
| 2151 | XSCALE_PERFCTR_BCU_FULL = 0x11, | ||
| 2152 | XSCALE_PERFCTR_BCU_DRAIN = 0x12, | ||
| 2153 | XSCALE_PERFCTR_BCU_ECC_NO_ELOG = 0x14, | ||
| 2154 | XSCALE_PERFCTR_BCU_1_BIT_ERR = 0x15, | ||
| 2155 | XSCALE_PERFCTR_RMW = 0x16, | ||
| 2156 | /* XSCALE_PERFCTR_CCNT is not hardware defined */ | ||
| 2157 | XSCALE_PERFCTR_CCNT = 0xFE, | ||
| 2158 | XSCALE_PERFCTR_UNUSED = 0xFF, | ||
| 2159 | }; | ||
| 2160 | |||
| 2161 | enum xscale_counters { | ||
| 2162 | XSCALE_CYCLE_COUNTER = 1, | ||
| 2163 | XSCALE_COUNTER0, | ||
| 2164 | XSCALE_COUNTER1, | ||
| 2165 | XSCALE_COUNTER2, | ||
| 2166 | XSCALE_COUNTER3, | ||
| 2167 | }; | ||
| 2168 | |||
| 2169 | static const unsigned xscale_perf_map[PERF_COUNT_HW_MAX] = { | ||
| 2170 | [PERF_COUNT_HW_CPU_CYCLES] = XSCALE_PERFCTR_CCNT, | ||
| 2171 | [PERF_COUNT_HW_INSTRUCTIONS] = XSCALE_PERFCTR_INSTRUCTION, | ||
| 2172 | [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED, | ||
| 2173 | [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED, | ||
| 2174 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = XSCALE_PERFCTR_BRANCH, | ||
| 2175 | [PERF_COUNT_HW_BRANCH_MISSES] = XSCALE_PERFCTR_BRANCH_MISS, | ||
| 2176 | [PERF_COUNT_HW_BUS_CYCLES] = HW_OP_UNSUPPORTED, | ||
| 2177 | }; | ||
| 2178 | |||
| 2179 | static const unsigned xscale_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] | ||
| 2180 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
| 2181 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = { | ||
| 2182 | [C(L1D)] = { | ||
| 2183 | [C(OP_READ)] = { | ||
| 2184 | [C(RESULT_ACCESS)] = XSCALE_PERFCTR_DCACHE_ACCESS, | ||
| 2185 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DCACHE_MISS, | ||
| 2186 | }, | ||
| 2187 | [C(OP_WRITE)] = { | ||
| 2188 | [C(RESULT_ACCESS)] = XSCALE_PERFCTR_DCACHE_ACCESS, | ||
| 2189 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DCACHE_MISS, | ||
| 2190 | }, | ||
| 2191 | [C(OP_PREFETCH)] = { | ||
| 2192 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2193 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2194 | }, | ||
| 2195 | }, | ||
| 2196 | [C(L1I)] = { | ||
| 2197 | [C(OP_READ)] = { | ||
| 2198 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2199 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, | ||
| 2200 | }, | ||
| 2201 | [C(OP_WRITE)] = { | ||
| 2202 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2203 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ICACHE_MISS, | ||
| 2204 | }, | ||
| 2205 | [C(OP_PREFETCH)] = { | ||
| 2206 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2207 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2208 | }, | ||
| 2209 | }, | ||
| 2210 | [C(LL)] = { | ||
| 2211 | [C(OP_READ)] = { | ||
| 2212 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2213 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2214 | }, | ||
| 2215 | [C(OP_WRITE)] = { | ||
| 2216 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2217 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2218 | }, | ||
| 2219 | [C(OP_PREFETCH)] = { | ||
| 2220 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2221 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2222 | }, | ||
| 2223 | }, | ||
| 2224 | [C(DTLB)] = { | ||
| 2225 | [C(OP_READ)] = { | ||
| 2226 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2227 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DTLB_MISS, | ||
| 2228 | }, | ||
| 2229 | [C(OP_WRITE)] = { | ||
| 2230 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2231 | [C(RESULT_MISS)] = XSCALE_PERFCTR_DTLB_MISS, | ||
| 2232 | }, | ||
| 2233 | [C(OP_PREFETCH)] = { | ||
| 2234 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2235 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2236 | }, | ||
| 2237 | }, | ||
| 2238 | [C(ITLB)] = { | ||
| 2239 | [C(OP_READ)] = { | ||
| 2240 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2241 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ITLB_MISS, | ||
| 2242 | }, | ||
| 2243 | [C(OP_WRITE)] = { | ||
| 2244 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2245 | [C(RESULT_MISS)] = XSCALE_PERFCTR_ITLB_MISS, | ||
| 2246 | }, | ||
| 2247 | [C(OP_PREFETCH)] = { | ||
| 2248 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2249 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2250 | }, | ||
| 2251 | }, | ||
| 2252 | [C(BPU)] = { | ||
| 2253 | [C(OP_READ)] = { | ||
| 2254 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2255 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2256 | }, | ||
| 2257 | [C(OP_WRITE)] = { | ||
| 2258 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2259 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2260 | }, | ||
| 2261 | [C(OP_PREFETCH)] = { | ||
| 2262 | [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED, | ||
| 2263 | [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED, | ||
| 2264 | }, | ||
| 2265 | }, | ||
| 2266 | }; | ||
| 2267 | |||
| 2268 | #define XSCALE_PMU_ENABLE 0x001 | ||
| 2269 | #define XSCALE_PMN_RESET 0x002 | ||
| 2270 | #define XSCALE_CCNT_RESET 0x004 | ||
| 2271 | #define XSCALE_PMU_RESET (CCNT_RESET | PMN_RESET) | ||
| 2272 | #define XSCALE_PMU_CNT64 0x008 | ||
| 2273 | |||
| 2274 | static inline int | ||
| 2275 | xscalepmu_event_map(int config) | ||
| 2276 | { | ||
| 2277 | int mapping = xscale_perf_map[config]; | ||
| 2278 | if (HW_OP_UNSUPPORTED == mapping) | ||
| 2279 | mapping = -EOPNOTSUPP; | ||
| 2280 | return mapping; | ||
| 2281 | } | ||
| 2282 | |||
| 2283 | static u64 | ||
| 2284 | xscalepmu_raw_event(u64 config) | ||
| 2285 | { | ||
| 2286 | return config & 0xff; | ||
| 2287 | } | ||
| 2288 | |||
| 2289 | #define XSCALE1_OVERFLOWED_MASK 0x700 | ||
| 2290 | #define XSCALE1_CCOUNT_OVERFLOW 0x400 | ||
| 2291 | #define XSCALE1_COUNT0_OVERFLOW 0x100 | ||
| 2292 | #define XSCALE1_COUNT1_OVERFLOW 0x200 | ||
| 2293 | #define XSCALE1_CCOUNT_INT_EN 0x040 | ||
| 2294 | #define XSCALE1_COUNT0_INT_EN 0x010 | ||
| 2295 | #define XSCALE1_COUNT1_INT_EN 0x020 | ||
| 2296 | #define XSCALE1_COUNT0_EVT_SHFT 12 | ||
| 2297 | #define XSCALE1_COUNT0_EVT_MASK (0xff << XSCALE1_COUNT0_EVT_SHFT) | ||
| 2298 | #define XSCALE1_COUNT1_EVT_SHFT 20 | ||
| 2299 | #define XSCALE1_COUNT1_EVT_MASK (0xff << XSCALE1_COUNT1_EVT_SHFT) | ||
| 2300 | |||
| 2301 | static inline u32 | ||
| 2302 | xscale1pmu_read_pmnc(void) | ||
| 2303 | { | ||
| 2304 | u32 val; | ||
| 2305 | asm volatile("mrc p14, 0, %0, c0, c0, 0" : "=r" (val)); | ||
| 2306 | return val; | ||
| 2307 | } | ||
| 2308 | |||
| 2309 | static inline void | ||
| 2310 | xscale1pmu_write_pmnc(u32 val) | ||
| 2311 | { | ||
| 2312 | /* upper 4bits and 7, 11 are write-as-0 */ | ||
| 2313 | val &= 0xffff77f; | ||
| 2314 | asm volatile("mcr p14, 0, %0, c0, c0, 0" : : "r" (val)); | ||
| 2315 | } | ||
| 2316 | |||
| 2317 | static inline int | ||
| 2318 | xscale1_pmnc_counter_has_overflowed(unsigned long pmnc, | ||
| 2319 | enum xscale_counters counter) | ||
| 2320 | { | ||
| 2321 | int ret = 0; | ||
| 2322 | |||
| 2323 | switch (counter) { | ||
| 2324 | case XSCALE_CYCLE_COUNTER: | ||
| 2325 | ret = pmnc & XSCALE1_CCOUNT_OVERFLOW; | ||
| 2326 | break; | ||
| 2327 | case XSCALE_COUNTER0: | ||
| 2328 | ret = pmnc & XSCALE1_COUNT0_OVERFLOW; | ||
| 2329 | break; | ||
| 2330 | case XSCALE_COUNTER1: | ||
| 2331 | ret = pmnc & XSCALE1_COUNT1_OVERFLOW; | ||
| 2332 | break; | ||
| 2333 | default: | ||
| 2334 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
| 2335 | } | ||
| 2336 | |||
| 2337 | return ret; | ||
| 2338 | } | ||
| 2339 | |||
| 2340 | static irqreturn_t | ||
| 2341 | xscale1pmu_handle_irq(int irq_num, void *dev) | ||
| 2342 | { | ||
| 2343 | unsigned long pmnc; | ||
| 2344 | struct perf_sample_data data; | ||
| 2345 | struct cpu_hw_events *cpuc; | ||
| 2346 | struct pt_regs *regs; | ||
| 2347 | int idx; | ||
| 2348 | |||
| 2349 | /* | ||
| 2350 | * NOTE: there's an A stepping erratum that states if an overflow | ||
| 2351 | * bit already exists and another occurs, the previous | ||
| 2352 | * Overflow bit gets cleared. There's no workaround. | ||
| 2353 | * Fixed in B stepping or later. | ||
| 2354 | */ | ||
| 2355 | pmnc = xscale1pmu_read_pmnc(); | ||
| 2356 | |||
| 2357 | /* | ||
| 2358 | * Write the value back to clear the overflow flags. Overflow | ||
| 2359 | * flags remain in pmnc for use below. We also disable the PMU | ||
| 2360 | * while we process the interrupt. | ||
| 2361 | */ | ||
| 2362 | xscale1pmu_write_pmnc(pmnc & ~XSCALE_PMU_ENABLE); | ||
| 2363 | |||
| 2364 | if (!(pmnc & XSCALE1_OVERFLOWED_MASK)) | ||
| 2365 | return IRQ_NONE; | ||
| 2366 | |||
| 2367 | regs = get_irq_regs(); | ||
| 2368 | |||
| 2369 | perf_sample_data_init(&data, 0); | ||
| 2370 | |||
| 2371 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
| 2372 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
| 2373 | struct perf_event *event = cpuc->events[idx]; | ||
| 2374 | struct hw_perf_event *hwc; | ||
| 2375 | |||
| 2376 | if (!test_bit(idx, cpuc->active_mask)) | ||
| 2377 | continue; | ||
| 2378 | |||
| 2379 | if (!xscale1_pmnc_counter_has_overflowed(pmnc, idx)) | ||
| 2380 | continue; | ||
| 2381 | |||
| 2382 | hwc = &event->hw; | ||
| 2383 | armpmu_event_update(event, hwc, idx); | ||
| 2384 | data.period = event->hw.last_period; | ||
| 2385 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
| 2386 | continue; | ||
| 2387 | |||
| 2388 | if (perf_event_overflow(event, 0, &data, regs)) | ||
| 2389 | armpmu->disable(hwc, idx); | ||
| 2390 | } | ||
| 2391 | |||
| 2392 | perf_event_do_pending(); | ||
| 2393 | |||
| 2394 | /* | ||
| 2395 | * Re-enable the PMU. | ||
| 2396 | */ | ||
| 2397 | pmnc = xscale1pmu_read_pmnc() | XSCALE_PMU_ENABLE; | ||
| 2398 | xscale1pmu_write_pmnc(pmnc); | ||
| 2399 | |||
| 2400 | return IRQ_HANDLED; | ||
| 2401 | } | ||
| 2402 | |||
| 2403 | static void | ||
| 2404 | xscale1pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
| 2405 | { | ||
| 2406 | unsigned long val, mask, evt, flags; | ||
| 2407 | |||
| 2408 | switch (idx) { | ||
| 2409 | case XSCALE_CYCLE_COUNTER: | ||
| 2410 | mask = 0; | ||
| 2411 | evt = XSCALE1_CCOUNT_INT_EN; | ||
| 2412 | break; | ||
| 2413 | case XSCALE_COUNTER0: | ||
| 2414 | mask = XSCALE1_COUNT0_EVT_MASK; | ||
| 2415 | evt = (hwc->config_base << XSCALE1_COUNT0_EVT_SHFT) | | ||
| 2416 | XSCALE1_COUNT0_INT_EN; | ||
| 2417 | break; | ||
| 2418 | case XSCALE_COUNTER1: | ||
| 2419 | mask = XSCALE1_COUNT1_EVT_MASK; | ||
| 2420 | evt = (hwc->config_base << XSCALE1_COUNT1_EVT_SHFT) | | ||
| 2421 | XSCALE1_COUNT1_INT_EN; | ||
| 2422 | break; | ||
| 2423 | default: | ||
| 2424 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
| 2425 | return; | ||
| 2426 | } | ||
| 2427 | |||
| 2428 | spin_lock_irqsave(&pmu_lock, flags); | ||
| 2429 | val = xscale1pmu_read_pmnc(); | ||
| 2430 | val &= ~mask; | ||
| 2431 | val |= evt; | ||
| 2432 | xscale1pmu_write_pmnc(val); | ||
| 2433 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
| 2434 | } | ||
| 2435 | |||
| 2436 | static void | ||
| 2437 | xscale1pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
| 2438 | { | ||
| 2439 | unsigned long val, mask, evt, flags; | ||
| 2440 | |||
| 2441 | switch (idx) { | ||
| 2442 | case XSCALE_CYCLE_COUNTER: | ||
| 2443 | mask = XSCALE1_CCOUNT_INT_EN; | ||
| 2444 | evt = 0; | ||
| 2445 | break; | ||
| 2446 | case XSCALE_COUNTER0: | ||
| 2447 | mask = XSCALE1_COUNT0_INT_EN | XSCALE1_COUNT0_EVT_MASK; | ||
| 2448 | evt = XSCALE_PERFCTR_UNUSED << XSCALE1_COUNT0_EVT_SHFT; | ||
| 2449 | break; | ||
| 2450 | case XSCALE_COUNTER1: | ||
| 2451 | mask = XSCALE1_COUNT1_INT_EN | XSCALE1_COUNT1_EVT_MASK; | ||
| 2452 | evt = XSCALE_PERFCTR_UNUSED << XSCALE1_COUNT1_EVT_SHFT; | ||
| 2453 | break; | ||
| 2454 | default: | ||
| 2455 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
| 2456 | return; | ||
| 2457 | } | ||
| 2458 | |||
| 2459 | spin_lock_irqsave(&pmu_lock, flags); | ||
| 2460 | val = xscale1pmu_read_pmnc(); | ||
| 2461 | val &= ~mask; | ||
| 2462 | val |= evt; | ||
| 2463 | xscale1pmu_write_pmnc(val); | ||
| 2464 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
| 2465 | } | ||
| 2466 | |||
| 2467 | static int | ||
| 2468 | xscale1pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
| 2469 | struct hw_perf_event *event) | ||
| 2470 | { | ||
| 2471 | if (XSCALE_PERFCTR_CCNT == event->config_base) { | ||
| 2472 | if (test_and_set_bit(XSCALE_CYCLE_COUNTER, cpuc->used_mask)) | ||
| 2473 | return -EAGAIN; | ||
| 2474 | |||
| 2475 | return XSCALE_CYCLE_COUNTER; | ||
| 2476 | } else { | ||
| 2477 | if (!test_and_set_bit(XSCALE_COUNTER1, cpuc->used_mask)) { | ||
| 2478 | return XSCALE_COUNTER1; | ||
| 2479 | } | ||
| 2480 | |||
| 2481 | if (!test_and_set_bit(XSCALE_COUNTER0, cpuc->used_mask)) { | ||
| 2482 | return XSCALE_COUNTER0; | ||
| 2483 | } | ||
| 2484 | |||
| 2485 | return -EAGAIN; | ||
| 2486 | } | ||
| 2487 | } | ||
| 2488 | |||
| 2489 | static void | ||
| 2490 | xscale1pmu_start(void) | ||
| 2491 | { | ||
| 2492 | unsigned long flags, val; | ||
| 2493 | |||
| 2494 | spin_lock_irqsave(&pmu_lock, flags); | ||
| 2495 | val = xscale1pmu_read_pmnc(); | ||
| 2496 | val |= XSCALE_PMU_ENABLE; | ||
| 2497 | xscale1pmu_write_pmnc(val); | ||
| 2498 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
| 2499 | } | ||
| 2500 | |||
| 2501 | static void | ||
| 2502 | xscale1pmu_stop(void) | ||
| 2503 | { | ||
| 2504 | unsigned long flags, val; | ||
| 2505 | |||
| 2506 | spin_lock_irqsave(&pmu_lock, flags); | ||
| 2507 | val = xscale1pmu_read_pmnc(); | ||
| 2508 | val &= ~XSCALE_PMU_ENABLE; | ||
| 2509 | xscale1pmu_write_pmnc(val); | ||
| 2510 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
| 2511 | } | ||
| 2512 | |||
| 2513 | static inline u32 | ||
| 2514 | xscale1pmu_read_counter(int counter) | ||
| 2515 | { | ||
| 2516 | u32 val = 0; | ||
| 2517 | |||
| 2518 | switch (counter) { | ||
| 2519 | case XSCALE_CYCLE_COUNTER: | ||
| 2520 | asm volatile("mrc p14, 0, %0, c1, c0, 0" : "=r" (val)); | ||
| 2521 | break; | ||
| 2522 | case XSCALE_COUNTER0: | ||
| 2523 | asm volatile("mrc p14, 0, %0, c2, c0, 0" : "=r" (val)); | ||
| 2524 | break; | ||
| 2525 | case XSCALE_COUNTER1: | ||
| 2526 | asm volatile("mrc p14, 0, %0, c3, c0, 0" : "=r" (val)); | ||
| 2527 | break; | ||
| 2528 | } | ||
| 2529 | |||
| 2530 | return val; | ||
| 2531 | } | ||
| 2532 | |||
| 2533 | static inline void | ||
| 2534 | xscale1pmu_write_counter(int counter, u32 val) | ||
| 2535 | { | ||
| 2536 | switch (counter) { | ||
| 2537 | case XSCALE_CYCLE_COUNTER: | ||
| 2538 | asm volatile("mcr p14, 0, %0, c1, c0, 0" : : "r" (val)); | ||
| 2539 | break; | ||
| 2540 | case XSCALE_COUNTER0: | ||
| 2541 | asm volatile("mcr p14, 0, %0, c2, c0, 0" : : "r" (val)); | ||
| 2542 | break; | ||
| 2543 | case XSCALE_COUNTER1: | ||
| 2544 | asm volatile("mcr p14, 0, %0, c3, c0, 0" : : "r" (val)); | ||
| 2545 | break; | ||
| 2546 | } | ||
| 2547 | } | ||
| 2548 | |||
| 2549 | static const struct arm_pmu xscale1pmu = { | ||
| 2550 | .id = ARM_PERF_PMU_ID_XSCALE1, | ||
| 2551 | .handle_irq = xscale1pmu_handle_irq, | ||
| 2552 | .enable = xscale1pmu_enable_event, | ||
| 2553 | .disable = xscale1pmu_disable_event, | ||
| 2554 | .event_map = xscalepmu_event_map, | ||
| 2555 | .raw_event = xscalepmu_raw_event, | ||
| 2556 | .read_counter = xscale1pmu_read_counter, | ||
| 2557 | .write_counter = xscale1pmu_write_counter, | ||
| 2558 | .get_event_idx = xscale1pmu_get_event_idx, | ||
| 2559 | .start = xscale1pmu_start, | ||
| 2560 | .stop = xscale1pmu_stop, | ||
| 2561 | .num_events = 3, | ||
| 2562 | .max_period = (1LLU << 32) - 1, | ||
| 2563 | }; | ||
| 2564 | |||
| 2565 | #define XSCALE2_OVERFLOWED_MASK 0x01f | ||
| 2566 | #define XSCALE2_CCOUNT_OVERFLOW 0x001 | ||
| 2567 | #define XSCALE2_COUNT0_OVERFLOW 0x002 | ||
| 2568 | #define XSCALE2_COUNT1_OVERFLOW 0x004 | ||
| 2569 | #define XSCALE2_COUNT2_OVERFLOW 0x008 | ||
| 2570 | #define XSCALE2_COUNT3_OVERFLOW 0x010 | ||
| 2571 | #define XSCALE2_CCOUNT_INT_EN 0x001 | ||
| 2572 | #define XSCALE2_COUNT0_INT_EN 0x002 | ||
| 2573 | #define XSCALE2_COUNT1_INT_EN 0x004 | ||
| 2574 | #define XSCALE2_COUNT2_INT_EN 0x008 | ||
| 2575 | #define XSCALE2_COUNT3_INT_EN 0x010 | ||
| 2576 | #define XSCALE2_COUNT0_EVT_SHFT 0 | ||
| 2577 | #define XSCALE2_COUNT0_EVT_MASK (0xff << XSCALE2_COUNT0_EVT_SHFT) | ||
| 2578 | #define XSCALE2_COUNT1_EVT_SHFT 8 | ||
| 2579 | #define XSCALE2_COUNT1_EVT_MASK (0xff << XSCALE2_COUNT1_EVT_SHFT) | ||
| 2580 | #define XSCALE2_COUNT2_EVT_SHFT 16 | ||
| 2581 | #define XSCALE2_COUNT2_EVT_MASK (0xff << XSCALE2_COUNT2_EVT_SHFT) | ||
| 2582 | #define XSCALE2_COUNT3_EVT_SHFT 24 | ||
| 2583 | #define XSCALE2_COUNT3_EVT_MASK (0xff << XSCALE2_COUNT3_EVT_SHFT) | ||
| 2584 | |||
| 2585 | static inline u32 | ||
| 2586 | xscale2pmu_read_pmnc(void) | ||
| 2587 | { | ||
| 2588 | u32 val; | ||
| 2589 | asm volatile("mrc p14, 0, %0, c0, c1, 0" : "=r" (val)); | ||
| 2590 | /* bits 1-2 and 4-23 are read-unpredictable */ | ||
| 2591 | return val & 0xff000009; | ||
| 2592 | } | ||
| 2593 | |||
| 2594 | static inline void | ||
| 2595 | xscale2pmu_write_pmnc(u32 val) | ||
| 2596 | { | ||
| 2597 | /* bits 4-23 are write-as-0, 24-31 are write ignored */ | ||
| 2598 | val &= 0xf; | ||
| 2599 | asm volatile("mcr p14, 0, %0, c0, c1, 0" : : "r" (val)); | ||
| 2600 | } | ||
| 2601 | |||
| 2602 | static inline u32 | ||
| 2603 | xscale2pmu_read_overflow_flags(void) | ||
| 2604 | { | ||
| 2605 | u32 val; | ||
| 2606 | asm volatile("mrc p14, 0, %0, c5, c1, 0" : "=r" (val)); | ||
| 2607 | return val; | ||
| 2608 | } | ||
| 2609 | |||
| 2610 | static inline void | ||
| 2611 | xscale2pmu_write_overflow_flags(u32 val) | ||
| 2612 | { | ||
| 2613 | asm volatile("mcr p14, 0, %0, c5, c1, 0" : : "r" (val)); | ||
| 2614 | } | ||
| 2615 | |||
| 2616 | static inline u32 | ||
| 2617 | xscale2pmu_read_event_select(void) | ||
| 2618 | { | ||
| 2619 | u32 val; | ||
| 2620 | asm volatile("mrc p14, 0, %0, c8, c1, 0" : "=r" (val)); | ||
| 2621 | return val; | ||
| 2622 | } | ||
| 2623 | |||
| 2624 | static inline void | ||
| 2625 | xscale2pmu_write_event_select(u32 val) | ||
| 2626 | { | ||
| 2627 | asm volatile("mcr p14, 0, %0, c8, c1, 0" : : "r"(val)); | ||
| 2628 | } | ||
| 2629 | |||
| 2630 | static inline u32 | ||
| 2631 | xscale2pmu_read_int_enable(void) | ||
| 2632 | { | ||
| 2633 | u32 val; | ||
| 2634 | asm volatile("mrc p14, 0, %0, c4, c1, 0" : "=r" (val)); | ||
| 2635 | return val; | ||
| 2636 | } | ||
| 2637 | |||
| 2638 | static void | ||
| 2639 | xscale2pmu_write_int_enable(u32 val) | ||
| 2640 | { | ||
| 2641 | asm volatile("mcr p14, 0, %0, c4, c1, 0" : : "r" (val)); | ||
| 2642 | } | ||
| 2643 | |||
| 2644 | static inline int | ||
| 2645 | xscale2_pmnc_counter_has_overflowed(unsigned long of_flags, | ||
| 2646 | enum xscale_counters counter) | ||
| 2647 | { | ||
| 2648 | int ret = 0; | ||
| 2649 | |||
| 2650 | switch (counter) { | ||
| 2651 | case XSCALE_CYCLE_COUNTER: | ||
| 2652 | ret = of_flags & XSCALE2_CCOUNT_OVERFLOW; | ||
| 2653 | break; | ||
| 2654 | case XSCALE_COUNTER0: | ||
| 2655 | ret = of_flags & XSCALE2_COUNT0_OVERFLOW; | ||
| 2656 | break; | ||
| 2657 | case XSCALE_COUNTER1: | ||
| 2658 | ret = of_flags & XSCALE2_COUNT1_OVERFLOW; | ||
| 2659 | break; | ||
| 2660 | case XSCALE_COUNTER2: | ||
| 2661 | ret = of_flags & XSCALE2_COUNT2_OVERFLOW; | ||
| 2662 | break; | ||
| 2663 | case XSCALE_COUNTER3: | ||
| 2664 | ret = of_flags & XSCALE2_COUNT3_OVERFLOW; | ||
| 2665 | break; | ||
| 2666 | default: | ||
| 2667 | WARN_ONCE(1, "invalid counter number (%d)\n", counter); | ||
| 2668 | } | ||
| 2669 | |||
| 2670 | return ret; | ||
| 2671 | } | ||
| 2672 | |||
| 2673 | static irqreturn_t | ||
| 2674 | xscale2pmu_handle_irq(int irq_num, void *dev) | ||
| 2675 | { | ||
| 2676 | unsigned long pmnc, of_flags; | ||
| 2677 | struct perf_sample_data data; | ||
| 2678 | struct cpu_hw_events *cpuc; | ||
| 2679 | struct pt_regs *regs; | ||
| 2680 | int idx; | ||
| 2681 | |||
| 2682 | /* Disable the PMU. */ | ||
| 2683 | pmnc = xscale2pmu_read_pmnc(); | ||
| 2684 | xscale2pmu_write_pmnc(pmnc & ~XSCALE_PMU_ENABLE); | ||
| 2685 | |||
| 2686 | /* Check the overflow flag register. */ | ||
| 2687 | of_flags = xscale2pmu_read_overflow_flags(); | ||
| 2688 | if (!(of_flags & XSCALE2_OVERFLOWED_MASK)) | ||
| 2689 | return IRQ_NONE; | ||
| 2690 | |||
| 2691 | /* Clear the overflow bits. */ | ||
| 2692 | xscale2pmu_write_overflow_flags(of_flags); | ||
| 2693 | |||
| 2694 | regs = get_irq_regs(); | ||
| 2695 | |||
| 2696 | perf_sample_data_init(&data, 0); | ||
| 2697 | |||
| 2698 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
| 2699 | for (idx = 0; idx <= armpmu->num_events; ++idx) { | ||
| 2700 | struct perf_event *event = cpuc->events[idx]; | ||
| 2701 | struct hw_perf_event *hwc; | ||
| 2702 | |||
| 2703 | if (!test_bit(idx, cpuc->active_mask)) | ||
| 2704 | continue; | ||
| 2705 | |||
| 2706 | if (!xscale2_pmnc_counter_has_overflowed(pmnc, idx)) | ||
| 2707 | continue; | ||
| 2708 | |||
| 2709 | hwc = &event->hw; | ||
| 2710 | armpmu_event_update(event, hwc, idx); | ||
| 2711 | data.period = event->hw.last_period; | ||
| 2712 | if (!armpmu_event_set_period(event, hwc, idx)) | ||
| 2713 | continue; | ||
| 2714 | |||
| 2715 | if (perf_event_overflow(event, 0, &data, regs)) | ||
| 2716 | armpmu->disable(hwc, idx); | ||
| 2717 | } | ||
| 2718 | |||
| 2719 | perf_event_do_pending(); | ||
| 2720 | |||
| 2721 | /* | ||
| 2722 | * Re-enable the PMU. | ||
| 2723 | */ | ||
| 2724 | pmnc = xscale2pmu_read_pmnc() | XSCALE_PMU_ENABLE; | ||
| 2725 | xscale2pmu_write_pmnc(pmnc); | ||
| 2726 | |||
| 2727 | return IRQ_HANDLED; | ||
| 2728 | } | ||
| 2729 | |||
| 2730 | static void | ||
| 2731 | xscale2pmu_enable_event(struct hw_perf_event *hwc, int idx) | ||
| 2732 | { | ||
| 2733 | unsigned long flags, ien, evtsel; | ||
| 2734 | |||
| 2735 | ien = xscale2pmu_read_int_enable(); | ||
| 2736 | evtsel = xscale2pmu_read_event_select(); | ||
| 2737 | |||
| 2738 | switch (idx) { | ||
| 2739 | case XSCALE_CYCLE_COUNTER: | ||
| 2740 | ien |= XSCALE2_CCOUNT_INT_EN; | ||
| 2741 | break; | ||
| 2742 | case XSCALE_COUNTER0: | ||
| 2743 | ien |= XSCALE2_COUNT0_INT_EN; | ||
| 2744 | evtsel &= ~XSCALE2_COUNT0_EVT_MASK; | ||
| 2745 | evtsel |= hwc->config_base << XSCALE2_COUNT0_EVT_SHFT; | ||
| 2746 | break; | ||
| 2747 | case XSCALE_COUNTER1: | ||
| 2748 | ien |= XSCALE2_COUNT1_INT_EN; | ||
| 2749 | evtsel &= ~XSCALE2_COUNT1_EVT_MASK; | ||
| 2750 | evtsel |= hwc->config_base << XSCALE2_COUNT1_EVT_SHFT; | ||
| 2751 | break; | ||
| 2752 | case XSCALE_COUNTER2: | ||
| 2753 | ien |= XSCALE2_COUNT2_INT_EN; | ||
| 2754 | evtsel &= ~XSCALE2_COUNT2_EVT_MASK; | ||
| 2755 | evtsel |= hwc->config_base << XSCALE2_COUNT2_EVT_SHFT; | ||
| 2756 | break; | ||
| 2757 | case XSCALE_COUNTER3: | ||
| 2758 | ien |= XSCALE2_COUNT3_INT_EN; | ||
| 2759 | evtsel &= ~XSCALE2_COUNT3_EVT_MASK; | ||
| 2760 | evtsel |= hwc->config_base << XSCALE2_COUNT3_EVT_SHFT; | ||
| 2761 | break; | ||
| 2762 | default: | ||
| 2763 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
| 2764 | return; | ||
| 2765 | } | ||
| 2766 | |||
| 2767 | spin_lock_irqsave(&pmu_lock, flags); | ||
| 2768 | xscale2pmu_write_event_select(evtsel); | ||
| 2769 | xscale2pmu_write_int_enable(ien); | ||
| 2770 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
| 2771 | } | ||
| 2772 | |||
| 2773 | static void | ||
| 2774 | xscale2pmu_disable_event(struct hw_perf_event *hwc, int idx) | ||
| 2775 | { | ||
| 2776 | unsigned long flags, ien, evtsel; | ||
| 2777 | |||
| 2778 | ien = xscale2pmu_read_int_enable(); | ||
| 2779 | evtsel = xscale2pmu_read_event_select(); | ||
| 2780 | |||
| 2781 | switch (idx) { | ||
| 2782 | case XSCALE_CYCLE_COUNTER: | ||
| 2783 | ien &= ~XSCALE2_CCOUNT_INT_EN; | ||
| 2784 | break; | ||
| 2785 | case XSCALE_COUNTER0: | ||
| 2786 | ien &= ~XSCALE2_COUNT0_INT_EN; | ||
| 2787 | evtsel &= ~XSCALE2_COUNT0_EVT_MASK; | ||
| 2788 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT0_EVT_SHFT; | ||
| 2789 | break; | ||
| 2790 | case XSCALE_COUNTER1: | ||
| 2791 | ien &= ~XSCALE2_COUNT1_INT_EN; | ||
| 2792 | evtsel &= ~XSCALE2_COUNT1_EVT_MASK; | ||
| 2793 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT1_EVT_SHFT; | ||
| 2794 | break; | ||
| 2795 | case XSCALE_COUNTER2: | ||
| 2796 | ien &= ~XSCALE2_COUNT2_INT_EN; | ||
| 2797 | evtsel &= ~XSCALE2_COUNT2_EVT_MASK; | ||
| 2798 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT2_EVT_SHFT; | ||
| 2799 | break; | ||
| 2800 | case XSCALE_COUNTER3: | ||
| 2801 | ien &= ~XSCALE2_COUNT3_INT_EN; | ||
| 2802 | evtsel &= ~XSCALE2_COUNT3_EVT_MASK; | ||
| 2803 | evtsel |= XSCALE_PERFCTR_UNUSED << XSCALE2_COUNT3_EVT_SHFT; | ||
| 2804 | break; | ||
| 2805 | default: | ||
| 2806 | WARN_ONCE(1, "invalid counter number (%d)\n", idx); | ||
| 2807 | return; | ||
| 2808 | } | ||
| 2809 | |||
| 2810 | spin_lock_irqsave(&pmu_lock, flags); | ||
| 2811 | xscale2pmu_write_event_select(evtsel); | ||
| 2812 | xscale2pmu_write_int_enable(ien); | ||
| 2813 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
| 2814 | } | ||
| 2815 | |||
| 2816 | static int | ||
| 2817 | xscale2pmu_get_event_idx(struct cpu_hw_events *cpuc, | ||
| 2818 | struct hw_perf_event *event) | ||
| 2819 | { | ||
| 2820 | int idx = xscale1pmu_get_event_idx(cpuc, event); | ||
| 2821 | if (idx >= 0) | ||
| 2822 | goto out; | ||
| 2823 | |||
| 2824 | if (!test_and_set_bit(XSCALE_COUNTER3, cpuc->used_mask)) | ||
| 2825 | idx = XSCALE_COUNTER3; | ||
| 2826 | else if (!test_and_set_bit(XSCALE_COUNTER2, cpuc->used_mask)) | ||
| 2827 | idx = XSCALE_COUNTER2; | ||
| 2828 | out: | ||
| 2829 | return idx; | ||
| 2830 | } | ||
| 2831 | |||
| 2832 | static void | ||
| 2833 | xscale2pmu_start(void) | ||
| 2834 | { | ||
| 2835 | unsigned long flags, val; | ||
| 2836 | |||
| 2837 | spin_lock_irqsave(&pmu_lock, flags); | ||
| 2838 | val = xscale2pmu_read_pmnc() & ~XSCALE_PMU_CNT64; | ||
| 2839 | val |= XSCALE_PMU_ENABLE; | ||
| 2840 | xscale2pmu_write_pmnc(val); | ||
| 2841 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
| 2842 | } | ||
| 2843 | |||
| 2844 | static void | ||
| 2845 | xscale2pmu_stop(void) | ||
| 2846 | { | ||
| 2847 | unsigned long flags, val; | ||
| 2848 | |||
| 2849 | spin_lock_irqsave(&pmu_lock, flags); | ||
| 2850 | val = xscale2pmu_read_pmnc(); | ||
| 2851 | val &= ~XSCALE_PMU_ENABLE; | ||
| 2852 | xscale2pmu_write_pmnc(val); | ||
| 2853 | spin_unlock_irqrestore(&pmu_lock, flags); | ||
| 2854 | } | ||
| 2855 | |||
| 2856 | static inline u32 | ||
| 2857 | xscale2pmu_read_counter(int counter) | ||
| 2858 | { | ||
| 2859 | u32 val = 0; | ||
| 2860 | |||
| 2861 | switch (counter) { | ||
| 2862 | case XSCALE_CYCLE_COUNTER: | ||
| 2863 | asm volatile("mrc p14, 0, %0, c1, c1, 0" : "=r" (val)); | ||
| 2864 | break; | ||
| 2865 | case XSCALE_COUNTER0: | ||
| 2866 | asm volatile("mrc p14, 0, %0, c0, c2, 0" : "=r" (val)); | ||
| 2867 | break; | ||
| 2868 | case XSCALE_COUNTER1: | ||
| 2869 | asm volatile("mrc p14, 0, %0, c1, c2, 0" : "=r" (val)); | ||
| 2870 | break; | ||
| 2871 | case XSCALE_COUNTER2: | ||
| 2872 | asm volatile("mrc p14, 0, %0, c2, c2, 0" : "=r" (val)); | ||
| 2873 | break; | ||
| 2874 | case XSCALE_COUNTER3: | ||
| 2875 | asm volatile("mrc p14, 0, %0, c3, c2, 0" : "=r" (val)); | ||
| 2876 | break; | ||
| 2877 | } | ||
| 2878 | |||
| 2879 | return val; | ||
| 2880 | } | ||
| 2881 | |||
| 2882 | static inline void | ||
| 2883 | xscale2pmu_write_counter(int counter, u32 val) | ||
| 2884 | { | ||
| 2885 | switch (counter) { | ||
| 2886 | case XSCALE_CYCLE_COUNTER: | ||
| 2887 | asm volatile("mcr p14, 0, %0, c1, c1, 0" : : "r" (val)); | ||
| 2888 | break; | ||
| 2889 | case XSCALE_COUNTER0: | ||
| 2890 | asm volatile("mcr p14, 0, %0, c0, c2, 0" : : "r" (val)); | ||
| 2891 | break; | ||
| 2892 | case XSCALE_COUNTER1: | ||
| 2893 | asm volatile("mcr p14, 0, %0, c1, c2, 0" : : "r" (val)); | ||
| 2894 | break; | ||
| 2895 | case XSCALE_COUNTER2: | ||
| 2896 | asm volatile("mcr p14, 0, %0, c2, c2, 0" : : "r" (val)); | ||
| 2897 | break; | ||
| 2898 | case XSCALE_COUNTER3: | ||
| 2899 | asm volatile("mcr p14, 0, %0, c3, c2, 0" : : "r" (val)); | ||
| 2900 | break; | ||
| 2901 | } | ||
| 2902 | } | ||
| 2903 | |||
| 2904 | static const struct arm_pmu xscale2pmu = { | ||
| 2905 | .id = ARM_PERF_PMU_ID_XSCALE2, | ||
| 2906 | .handle_irq = xscale2pmu_handle_irq, | ||
| 2907 | .enable = xscale2pmu_enable_event, | ||
| 2908 | .disable = xscale2pmu_disable_event, | ||
| 2909 | .event_map = xscalepmu_event_map, | ||
| 2910 | .raw_event = xscalepmu_raw_event, | ||
| 2911 | .read_counter = xscale2pmu_read_counter, | ||
| 2912 | .write_counter = xscale2pmu_write_counter, | ||
| 2913 | .get_event_idx = xscale2pmu_get_event_idx, | ||
| 2914 | .start = xscale2pmu_start, | ||
| 2915 | .stop = xscale2pmu_stop, | ||
| 2916 | .num_events = 5, | ||
| 2917 | .max_period = (1LLU << 32) - 1, | ||
| 2918 | }; | ||
| 2919 | |||
| 2082 | static int __init | 2920 | static int __init |
| 2083 | init_hw_perf_events(void) | 2921 | init_hw_perf_events(void) |
| 2084 | { | 2922 | { |
| @@ -2086,7 +2924,7 @@ init_hw_perf_events(void) | |||
| 2086 | unsigned long implementor = (cpuid & 0xFF000000) >> 24; | 2924 | unsigned long implementor = (cpuid & 0xFF000000) >> 24; |
| 2087 | unsigned long part_number = (cpuid & 0xFFF0); | 2925 | unsigned long part_number = (cpuid & 0xFFF0); |
| 2088 | 2926 | ||
| 2089 | /* We only support ARM CPUs implemented by ARM at the moment. */ | 2927 | /* ARM Ltd CPUs. */ |
| 2090 | if (0x41 == implementor) { | 2928 | if (0x41 == implementor) { |
| 2091 | switch (part_number) { | 2929 | switch (part_number) { |
| 2092 | case 0xB360: /* ARM1136 */ | 2930 | case 0xB360: /* ARM1136 */ |
| @@ -2105,7 +2943,7 @@ init_hw_perf_events(void) | |||
| 2105 | perf_max_events = armv6mpcore_pmu.num_events; | 2943 | perf_max_events = armv6mpcore_pmu.num_events; |
| 2106 | break; | 2944 | break; |
| 2107 | case 0xC080: /* Cortex-A8 */ | 2945 | case 0xC080: /* Cortex-A8 */ |
| 2108 | armv7pmu.name = ARMV7_PMU_CORTEX_A8_NAME; | 2946 | armv7pmu.id = ARM_PERF_PMU_ID_CA8; |
| 2109 | memcpy(armpmu_perf_cache_map, armv7_a8_perf_cache_map, | 2947 | memcpy(armpmu_perf_cache_map, armv7_a8_perf_cache_map, |
| 2110 | sizeof(armv7_a8_perf_cache_map)); | 2948 | sizeof(armv7_a8_perf_cache_map)); |
| 2111 | armv7pmu.event_map = armv7_a8_pmu_event_map; | 2949 | armv7pmu.event_map = armv7_a8_pmu_event_map; |
| @@ -2117,7 +2955,7 @@ init_hw_perf_events(void) | |||
| 2117 | perf_max_events = armv7pmu.num_events; | 2955 | perf_max_events = armv7pmu.num_events; |
| 2118 | break; | 2956 | break; |
| 2119 | case 0xC090: /* Cortex-A9 */ | 2957 | case 0xC090: /* Cortex-A9 */ |
| 2120 | armv7pmu.name = ARMV7_PMU_CORTEX_A9_NAME; | 2958 | armv7pmu.id = ARM_PERF_PMU_ID_CA9; |
| 2121 | memcpy(armpmu_perf_cache_map, armv7_a9_perf_cache_map, | 2959 | memcpy(armpmu_perf_cache_map, armv7_a9_perf_cache_map, |
| 2122 | sizeof(armv7_a9_perf_cache_map)); | 2960 | sizeof(armv7_a9_perf_cache_map)); |
| 2123 | armv7pmu.event_map = armv7_a9_pmu_event_map; | 2961 | armv7pmu.event_map = armv7_a9_pmu_event_map; |
| @@ -2128,15 +2966,33 @@ init_hw_perf_events(void) | |||
| 2128 | armv7pmu.num_events = armv7_reset_read_pmnc(); | 2966 | armv7pmu.num_events = armv7_reset_read_pmnc(); |
| 2129 | perf_max_events = armv7pmu.num_events; | 2967 | perf_max_events = armv7pmu.num_events; |
| 2130 | break; | 2968 | break; |
| 2131 | default: | 2969 | } |
| 2132 | pr_info("no hardware support available\n"); | 2970 | /* Intel CPUs [xscale]. */ |
| 2133 | perf_max_events = -1; | 2971 | } else if (0x69 == implementor) { |
| 2972 | part_number = (cpuid >> 13) & 0x7; | ||
| 2973 | switch (part_number) { | ||
| 2974 | case 1: | ||
| 2975 | armpmu = &xscale1pmu; | ||
| 2976 | memcpy(armpmu_perf_cache_map, xscale_perf_cache_map, | ||
| 2977 | sizeof(xscale_perf_cache_map)); | ||
| 2978 | perf_max_events = xscale1pmu.num_events; | ||
| 2979 | break; | ||
| 2980 | case 2: | ||
| 2981 | armpmu = &xscale2pmu; | ||
| 2982 | memcpy(armpmu_perf_cache_map, xscale_perf_cache_map, | ||
| 2983 | sizeof(xscale_perf_cache_map)); | ||
| 2984 | perf_max_events = xscale2pmu.num_events; | ||
| 2985 | break; | ||
| 2134 | } | 2986 | } |
| 2135 | } | 2987 | } |
| 2136 | 2988 | ||
| 2137 | if (armpmu) | 2989 | if (armpmu) { |
| 2138 | pr_info("enabled with %s PMU driver, %d counters available\n", | 2990 | pr_info("enabled with %s PMU driver, %d counters available\n", |
| 2139 | armpmu->name, armpmu->num_events); | 2991 | arm_pmu_names[armpmu->id], armpmu->num_events); |
| 2992 | } else { | ||
| 2993 | pr_info("no hardware support available\n"); | ||
| 2994 | perf_max_events = -1; | ||
| 2995 | } | ||
| 2140 | 2996 | ||
| 2141 | return 0; | 2997 | return 0; |
| 2142 | } | 2998 | } |
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c index a124312e343f..b8af96ea62e6 100644 --- a/arch/arm/kernel/pmu.c +++ b/arch/arm/kernel/pmu.c | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | * linux/arch/arm/kernel/pmu.c | 2 | * linux/arch/arm/kernel/pmu.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles | 4 | * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles |
| 5 | * Copyright (C) 2010 ARM Ltd, Will Deacon | ||
| 5 | * | 6 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
| @@ -9,65 +10,78 @@ | |||
| 9 | * | 10 | * |
| 10 | */ | 11 | */ |
| 11 | 12 | ||
| 13 | #define pr_fmt(fmt) "PMU: " fmt | ||
| 14 | |||
| 12 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
| 13 | #include <linux/err.h> | 16 | #include <linux/err.h> |
| 14 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
| 15 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 16 | #include <linux/module.h> | 19 | #include <linux/module.h> |
| 20 | #include <linux/platform_device.h> | ||
| 17 | 21 | ||
| 18 | #include <asm/pmu.h> | 22 | #include <asm/pmu.h> |
| 19 | 23 | ||
| 20 | /* | 24 | static volatile long pmu_lock; |
| 21 | * Define the IRQs for the system. We could use something like a platform | 25 | |
| 22 | * device but that seems fairly heavyweight for this. Also, the performance | 26 | static struct platform_device *pmu_devices[ARM_NUM_PMU_DEVICES]; |
| 23 | * counters can't be removed or hotplugged. | 27 | |
| 24 | * | 28 | static int __devinit pmu_device_probe(struct platform_device *pdev) |
| 25 | * Ordering is important: init_pmu() will use the ordering to set the affinity | 29 | { |
| 26 | * to the corresponding core. e.g. the first interrupt will go to cpu 0, the | 30 | |
| 27 | * second goes to cpu 1 etc. | 31 | if (pdev->id < 0 || pdev->id >= ARM_NUM_PMU_DEVICES) { |
| 28 | */ | 32 | pr_warning("received registration request for unknown " |
| 29 | static const int irqs[] = { | 33 | "device %d\n", pdev->id); |
| 30 | #if defined(CONFIG_ARCH_OMAP2) | 34 | return -EINVAL; |
| 31 | 3, | 35 | } |
| 32 | #elif defined(CONFIG_ARCH_BCMRING) | 36 | |
| 33 | IRQ_PMUIRQ, | 37 | if (pmu_devices[pdev->id]) |
| 34 | #elif defined(CONFIG_MACH_REALVIEW_EB) | 38 | pr_warning("registering new PMU device type %d overwrites " |
| 35 | IRQ_EB11MP_PMU_CPU0, | 39 | "previous registration!\n", pdev->id); |
| 36 | IRQ_EB11MP_PMU_CPU1, | 40 | else |
| 37 | IRQ_EB11MP_PMU_CPU2, | 41 | pr_info("registered new PMU device of type %d\n", |
| 38 | IRQ_EB11MP_PMU_CPU3, | 42 | pdev->id); |
| 39 | #elif defined(CONFIG_ARCH_OMAP3) | ||
| 40 | INT_34XX_BENCH_MPU_EMUL, | ||
| 41 | #elif defined(CONFIG_ARCH_IOP32X) | ||
| 42 | IRQ_IOP32X_CORE_PMU, | ||
| 43 | #elif defined(CONFIG_ARCH_IOP33X) | ||
| 44 | IRQ_IOP33X_CORE_PMU, | ||
| 45 | #elif defined(CONFIG_ARCH_PXA) | ||
| 46 | IRQ_PMU, | ||
| 47 | #endif | ||
| 48 | }; | ||
| 49 | 43 | ||
| 50 | static const struct pmu_irqs pmu_irqs = { | 44 | pmu_devices[pdev->id] = pdev; |
| 51 | .irqs = irqs, | 45 | return 0; |
| 52 | .num_irqs = ARRAY_SIZE(irqs), | 46 | } |
| 47 | |||
| 48 | static struct platform_driver pmu_driver = { | ||
| 49 | .driver = { | ||
| 50 | .name = "arm-pmu", | ||
| 51 | }, | ||
| 52 | .probe = pmu_device_probe, | ||
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | static volatile long pmu_lock; | 55 | static int __init register_pmu_driver(void) |
| 56 | { | ||
| 57 | return platform_driver_register(&pmu_driver); | ||
| 58 | } | ||
| 59 | device_initcall(register_pmu_driver); | ||
| 56 | 60 | ||
| 57 | const struct pmu_irqs * | 61 | struct platform_device * |
| 58 | reserve_pmu(void) | 62 | reserve_pmu(enum arm_pmu_type device) |
| 59 | { | 63 | { |
| 60 | return test_and_set_bit_lock(0, &pmu_lock) ? ERR_PTR(-EBUSY) : | 64 | struct platform_device *pdev; |
| 61 | &pmu_irqs; | 65 | |
| 66 | if (test_and_set_bit_lock(device, &pmu_lock)) { | ||
| 67 | pdev = ERR_PTR(-EBUSY); | ||
| 68 | } else if (pmu_devices[device] == NULL) { | ||
| 69 | clear_bit_unlock(device, &pmu_lock); | ||
| 70 | pdev = ERR_PTR(-ENODEV); | ||
| 71 | } else { | ||
| 72 | pdev = pmu_devices[device]; | ||
| 73 | } | ||
| 74 | |||
| 75 | return pdev; | ||
| 62 | } | 76 | } |
| 63 | EXPORT_SYMBOL_GPL(reserve_pmu); | 77 | EXPORT_SYMBOL_GPL(reserve_pmu); |
| 64 | 78 | ||
| 65 | int | 79 | int |
| 66 | release_pmu(const struct pmu_irqs *irqs) | 80 | release_pmu(struct platform_device *pdev) |
| 67 | { | 81 | { |
| 68 | if (WARN_ON(irqs != &pmu_irqs)) | 82 | if (WARN_ON(pdev != pmu_devices[pdev->id])) |
| 69 | return -EINVAL; | 83 | return -EINVAL; |
| 70 | clear_bit_unlock(0, &pmu_lock); | 84 | clear_bit_unlock(pdev->id, &pmu_lock); |
| 71 | return 0; | 85 | return 0; |
| 72 | } | 86 | } |
| 73 | EXPORT_SYMBOL_GPL(release_pmu); | 87 | EXPORT_SYMBOL_GPL(release_pmu); |
| @@ -87,17 +101,42 @@ set_irq_affinity(int irq, | |||
| 87 | #endif | 101 | #endif |
| 88 | } | 102 | } |
| 89 | 103 | ||
| 90 | int | 104 | static int |
| 91 | init_pmu(void) | 105 | init_cpu_pmu(void) |
| 92 | { | 106 | { |
| 93 | int i, err = 0; | 107 | int i, err = 0; |
| 108 | struct platform_device *pdev = pmu_devices[ARM_PMU_DEVICE_CPU]; | ||
| 109 | |||
| 110 | if (!pdev) { | ||
| 111 | err = -ENODEV; | ||
| 112 | goto out; | ||
| 113 | } | ||
| 94 | 114 | ||
| 95 | for (i = 0; i < pmu_irqs.num_irqs; ++i) { | 115 | for (i = 0; i < pdev->num_resources; ++i) { |
| 96 | err = set_irq_affinity(pmu_irqs.irqs[i], i); | 116 | err = set_irq_affinity(platform_get_irq(pdev, i), i); |
| 97 | if (err) | 117 | if (err) |
| 98 | break; | 118 | break; |
| 99 | } | 119 | } |
| 100 | 120 | ||
| 121 | out: | ||
| 122 | return err; | ||
| 123 | } | ||
| 124 | |||
| 125 | int | ||
| 126 | init_pmu(enum arm_pmu_type device) | ||
| 127 | { | ||
| 128 | int err = 0; | ||
| 129 | |||
| 130 | switch (device) { | ||
| 131 | case ARM_PMU_DEVICE_CPU: | ||
| 132 | err = init_cpu_pmu(); | ||
| 133 | break; | ||
| 134 | default: | ||
| 135 | pr_warning("attempt to initialise unknown device %d\n", | ||
| 136 | device); | ||
| 137 | err = -EINVAL; | ||
| 138 | } | ||
| 139 | |||
| 101 | return err; | 140 | return err; |
| 102 | } | 141 | } |
| 103 | EXPORT_SYMBOL_GPL(init_pmu); | 142 | EXPORT_SYMBOL_GPL(init_pmu); |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index a01194e583ff..b8c3d0f689d9 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
| @@ -168,7 +168,7 @@ int __cpu_disable(void) | |||
| 168 | struct task_struct *p; | 168 | struct task_struct *p; |
| 169 | int ret; | 169 | int ret; |
| 170 | 170 | ||
| 171 | ret = mach_cpu_disable(cpu); | 171 | ret = platform_cpu_disable(cpu); |
| 172 | if (ret) | 172 | if (ret) |
| 173 | return ret; | 173 | return ret; |
| 174 | 174 | ||
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 28753805d2d1..38c261f9951c 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
| @@ -72,12 +72,15 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
| 72 | EXPORT_SYMBOL(profile_pc); | 72 | EXPORT_SYMBOL(profile_pc); |
| 73 | #endif | 73 | #endif |
| 74 | 74 | ||
| 75 | #ifndef CONFIG_GENERIC_TIME | 75 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET |
| 76 | static unsigned long dummy_gettimeoffset(void) | 76 | u32 arch_gettimeoffset(void) |
| 77 | { | 77 | { |
| 78 | if (system_timer->offset != NULL) | ||
| 79 | return system_timer->offset() * 1000; | ||
| 80 | |||
| 78 | return 0; | 81 | return 0; |
| 79 | } | 82 | } |
| 80 | #endif | 83 | #endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */ |
| 81 | 84 | ||
| 82 | #ifdef CONFIG_LEDS_TIMER | 85 | #ifdef CONFIG_LEDS_TIMER |
| 83 | static inline void do_leds(void) | 86 | static inline void do_leds(void) |
| @@ -93,63 +96,6 @@ static inline void do_leds(void) | |||
| 93 | #define do_leds() | 96 | #define do_leds() |
| 94 | #endif | 97 | #endif |
| 95 | 98 | ||
| 96 | #ifndef CONFIG_GENERIC_TIME | ||
| 97 | void do_gettimeofday(struct timeval *tv) | ||
| 98 | { | ||
| 99 | unsigned long flags; | ||
| 100 | unsigned long seq; | ||
| 101 | unsigned long usec, sec; | ||
| 102 | |||
| 103 | do { | ||
| 104 | seq = read_seqbegin_irqsave(&xtime_lock, flags); | ||
| 105 | usec = system_timer->offset(); | ||
| 106 | sec = xtime.tv_sec; | ||
| 107 | usec += xtime.tv_nsec / 1000; | ||
| 108 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); | ||
| 109 | |||
| 110 | /* usec may have gone up a lot: be safe */ | ||
| 111 | while (usec >= 1000000) { | ||
| 112 | usec -= 1000000; | ||
| 113 | sec++; | ||
| 114 | } | ||
| 115 | |||
| 116 | tv->tv_sec = sec; | ||
| 117 | tv->tv_usec = usec; | ||
| 118 | } | ||
| 119 | |||
| 120 | EXPORT_SYMBOL(do_gettimeofday); | ||
| 121 | |||
| 122 | int do_settimeofday(struct timespec *tv) | ||
| 123 | { | ||
| 124 | time_t wtm_sec, sec = tv->tv_sec; | ||
| 125 | long wtm_nsec, nsec = tv->tv_nsec; | ||
| 126 | |||
| 127 | if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) | ||
| 128 | return -EINVAL; | ||
| 129 | |||
| 130 | write_seqlock_irq(&xtime_lock); | ||
| 131 | /* | ||
| 132 | * This is revolting. We need to set "xtime" correctly. However, the | ||
| 133 | * value in this location is the value at the most recent update of | ||
| 134 | * wall time. Discover what correction gettimeofday() would have | ||
| 135 | * done, and then undo it! | ||
| 136 | */ | ||
| 137 | nsec -= system_timer->offset() * NSEC_PER_USEC; | ||
| 138 | |||
| 139 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); | ||
| 140 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); | ||
| 141 | |||
| 142 | set_normalized_timespec(&xtime, sec, nsec); | ||
| 143 | set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); | ||
| 144 | |||
| 145 | ntp_clear(); | ||
| 146 | write_sequnlock_irq(&xtime_lock); | ||
| 147 | clock_was_set(); | ||
| 148 | return 0; | ||
| 149 | } | ||
| 150 | |||
| 151 | EXPORT_SYMBOL(do_settimeofday); | ||
| 152 | #endif /* !CONFIG_GENERIC_TIME */ | ||
| 153 | 99 | ||
| 154 | #ifndef CONFIG_GENERIC_CLOCKEVENTS | 100 | #ifndef CONFIG_GENERIC_CLOCKEVENTS |
| 155 | /* | 101 | /* |
| @@ -214,10 +160,6 @@ device_initcall(timer_init_sysfs); | |||
| 214 | 160 | ||
| 215 | void __init time_init(void) | 161 | void __init time_init(void) |
| 216 | { | 162 | { |
| 217 | #ifndef CONFIG_GENERIC_TIME | ||
| 218 | if (system_timer->offset == NULL) | ||
| 219 | system_timer->offset = dummy_gettimeoffset; | ||
| 220 | #endif | ||
| 221 | system_timer->init(); | 163 | system_timer->init(); |
| 222 | } | 164 | } |
| 223 | 165 | ||
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 2db43a5ddd9b..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 | ||
| @@ -360,6 +361,19 @@ config MACH_CPU9G20 | |||
| 360 | Select this if you are using a Eukrea Electromatique's | 361 | Select this if you are using a Eukrea Electromatique's |
| 361 | CPU9G20 Board <http://www.eukrea.com/> | 362 | CPU9G20 Board <http://www.eukrea.com/> |
| 362 | 363 | ||
| 364 | config MACH_PORTUXG20 | ||
| 365 | bool "taskit PortuxG20" | ||
| 366 | help | ||
| 367 | Select this if you are using taskit's PortuxG20. | ||
| 368 | <http://www.taskit.de/en/> | ||
| 369 | |||
| 370 | config MACH_STAMP9G20 | ||
| 371 | bool "taskit Stamp9G20 CPU module" | ||
| 372 | help | ||
| 373 | Select this if you are using taskit's Stamp9G20 CPU module on its | ||
| 374 | evaluation board. | ||
| 375 | <http://www.taskit.de/en/> | ||
| 376 | |||
| 363 | endif | 377 | endif |
| 364 | 378 | ||
| 365 | # ---------------------------------------------------------- | 379 | # ---------------------------------------------------------- |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index d4004557532a..c1f821e58222 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
| @@ -63,6 +63,8 @@ obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o | |||
| 63 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o | 63 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o |
| 64 | obj-$(CONFIG_MACH_AT91SAM9G20EK_2MMC) += board-sam9g20ek-2slot-mmc.o | 64 | obj-$(CONFIG_MACH_AT91SAM9G20EK_2MMC) += board-sam9g20ek-2slot-mmc.o |
| 65 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o | 65 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o |
| 66 | obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o | ||
| 67 | obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o | ||
| 66 | 68 | ||
| 67 | # AT91SAM9G45 board-specific support | 69 | # AT91SAM9G45 board-specific support |
| 68 | obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o | 70 | obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o |
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c new file mode 100644 index 000000000000..87958274290f --- /dev/null +++ b/arch/arm/mach-at91/board-stamp9g20.c | |||
| @@ -0,0 +1,315 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de> | ||
| 3 | * taskit GmbH | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | */ | ||
| 19 | |||
| 20 | #include <linux/mm.h> | ||
| 21 | #include <linux/platform_device.h> | ||
| 22 | #include <linux/gpio.h> | ||
| 23 | #include <linux/w1-gpio.h> | ||
| 24 | |||
| 25 | #include <asm/mach-types.h> | ||
| 26 | #include <asm/mach/arch.h> | ||
| 27 | |||
| 28 | #include <mach/board.h> | ||
| 29 | #include <mach/at91sam9_smc.h> | ||
| 30 | |||
| 31 | #include "sam9_smc.h" | ||
| 32 | #include "generic.h" | ||
| 33 | |||
| 34 | |||
| 35 | static void __init portuxg20_map_io(void) | ||
| 36 | { | ||
| 37 | /* Initialize processor: 18.432 MHz crystal */ | ||
| 38 | at91sam9260_initialize(18432000); | ||
| 39 | |||
| 40 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
| 41 | at91_register_uart(0, 0, 0); | ||
| 42 | |||
| 43 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
| 44 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
| 45 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ||
| 46 | | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
| 47 | |||
| 48 | /* USART1 on ttyS2. (Rx, Tx, CTS, RTS) */ | ||
| 49 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
| 50 | |||
| 51 | /* USART2 on ttyS3. (Rx, Tx, CTS, RTS) */ | ||
| 52 | at91_register_uart(AT91SAM9260_ID_US2, 3, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
| 53 | |||
| 54 | /* USART4 on ttyS5. (Rx, Tx only) */ | ||
| 55 | at91_register_uart(AT91SAM9260_ID_US4, 5, 0); | ||
| 56 | |||
| 57 | /* USART5 on ttyS6. (Rx, Tx only) */ | ||
| 58 | at91_register_uart(AT91SAM9260_ID_US5, 6, 0); | ||
| 59 | |||
| 60 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
| 61 | at91_set_serial_console(0); | ||
| 62 | } | ||
| 63 | |||
| 64 | static void __init stamp9g20_map_io(void) | ||
| 65 | { | ||
| 66 | /* Initialize processor: 18.432 MHz crystal */ | ||
| 67 | at91sam9260_initialize(18432000); | ||
| 68 | |||
| 69 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
| 70 | at91_register_uart(0, 0, 0); | ||
| 71 | |||
| 72 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
| 73 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
| 74 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ||
| 75 | | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
| 76 | |||
| 77 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
| 78 | at91_set_serial_console(0); | ||
| 79 | } | ||
| 80 | |||
| 81 | static void __init init_irq(void) | ||
| 82 | { | ||
| 83 | at91sam9260_init_interrupts(NULL); | ||
| 84 | } | ||
| 85 | |||
| 86 | |||
| 87 | /* | ||
| 88 | * NAND flash | ||
| 89 | */ | ||
| 90 | static struct atmel_nand_data __initdata nand_data = { | ||
| 91 | .ale = 21, | ||
| 92 | .cle = 22, | ||
| 93 | .rdy_pin = AT91_PIN_PC13, | ||
| 94 | .enable_pin = AT91_PIN_PC14, | ||
| 95 | .bus_width_16 = 0, | ||
| 96 | }; | ||
| 97 | |||
| 98 | static struct sam9_smc_config __initdata nand_smc_config = { | ||
| 99 | .ncs_read_setup = 0, | ||
| 100 | .nrd_setup = 2, | ||
| 101 | .ncs_write_setup = 0, | ||
| 102 | .nwe_setup = 2, | ||
| 103 | |||
| 104 | .ncs_read_pulse = 4, | ||
| 105 | .nrd_pulse = 4, | ||
| 106 | .ncs_write_pulse = 4, | ||
| 107 | .nwe_pulse = 4, | ||
| 108 | |||
| 109 | .read_cycle = 7, | ||
| 110 | .write_cycle = 7, | ||
| 111 | |||
| 112 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, | ||
| 113 | .tdf_cycles = 3, | ||
| 114 | }; | ||
| 115 | |||
| 116 | static void __init add_device_nand(void) | ||
| 117 | { | ||
| 118 | /* configure chip-select 3 (NAND) */ | ||
| 119 | sam9_smc_configure(3, &nand_smc_config); | ||
| 120 | |||
| 121 | at91_add_device_nand(&nand_data); | ||
| 122 | } | ||
| 123 | |||
| 124 | |||
| 125 | /* | ||
| 126 | * MCI (SD/MMC) | ||
| 127 | * det_pin, wp_pin and vcc_pin are not connected | ||
| 128 | */ | ||
| 129 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
| 130 | static struct mci_platform_data __initdata mmc_data = { | ||
| 131 | .slot[0] = { | ||
| 132 | .bus_width = 4, | ||
| 133 | }, | ||
| 134 | }; | ||
| 135 | #else | ||
| 136 | static struct at91_mmc_data __initdata mmc_data = { | ||
| 137 | .slot_b = 0, | ||
| 138 | .wire4 = 1, | ||
| 139 | }; | ||
| 140 | #endif | ||
| 141 | |||
| 142 | |||
| 143 | /* | ||
| 144 | * USB Host port | ||
| 145 | */ | ||
| 146 | static struct at91_usbh_data __initdata usbh_data = { | ||
| 147 | .ports = 2, | ||
| 148 | }; | ||
| 149 | |||
| 150 | |||
| 151 | /* | ||
| 152 | * USB Device port | ||
| 153 | */ | ||
| 154 | static struct at91_udc_data __initdata portuxg20_udc_data = { | ||
| 155 | .vbus_pin = AT91_PIN_PC7, | ||
| 156 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
| 157 | }; | ||
| 158 | |||
| 159 | static struct at91_udc_data __initdata stamp9g20_udc_data = { | ||
| 160 | .vbus_pin = AT91_PIN_PA22, | ||
| 161 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
| 162 | }; | ||
| 163 | |||
| 164 | |||
| 165 | /* | ||
| 166 | * MACB Ethernet device | ||
| 167 | */ | ||
| 168 | static struct at91_eth_data __initdata macb_data = { | ||
| 169 | .phy_irq_pin = AT91_PIN_PA28, | ||
| 170 | .is_rmii = 1, | ||
| 171 | }; | ||
| 172 | |||
| 173 | |||
| 174 | /* | ||
| 175 | * LEDs | ||
| 176 | */ | ||
| 177 | static struct gpio_led portuxg20_leds[] = { | ||
| 178 | { | ||
| 179 | .name = "LED2", | ||
| 180 | .gpio = AT91_PIN_PC5, | ||
| 181 | .default_trigger = "none", | ||
| 182 | }, { | ||
| 183 | .name = "LED3", | ||
| 184 | .gpio = AT91_PIN_PC4, | ||
| 185 | .default_trigger = "none", | ||
| 186 | }, { | ||
| 187 | .name = "LED4", | ||
| 188 | .gpio = AT91_PIN_PC10, | ||
| 189 | .default_trigger = "heartbeat", | ||
| 190 | } | ||
| 191 | }; | ||
| 192 | |||
| 193 | static struct gpio_led stamp9g20_leds[] = { | ||
| 194 | { | ||
| 195 | .name = "D8", | ||
| 196 | .gpio = AT91_PIN_PB18, | ||
| 197 | .active_low = 1, | ||
| 198 | .default_trigger = "none", | ||
| 199 | }, { | ||
| 200 | .name = "D9", | ||
| 201 | .gpio = AT91_PIN_PB19, | ||
| 202 | .active_low = 1, | ||
| 203 | .default_trigger = "none", | ||
| 204 | }, { | ||
| 205 | .name = "D10", | ||
| 206 | .gpio = AT91_PIN_PB20, | ||
| 207 | .active_low = 1, | ||
| 208 | .default_trigger = "heartbeat", | ||
| 209 | } | ||
| 210 | }; | ||
| 211 | |||
| 212 | |||
| 213 | /* | ||
| 214 | * SPI devices | ||
| 215 | */ | ||
| 216 | static struct spi_board_info portuxg20_spi_devices[] = { | ||
| 217 | { | ||
| 218 | .modalias = "spidev", | ||
| 219 | .chip_select = 0, | ||
| 220 | .max_speed_hz = 1 * 1000 * 1000, | ||
| 221 | .bus_num = 0, | ||
| 222 | }, { | ||
| 223 | .modalias = "spidev", | ||
| 224 | .chip_select = 0, | ||
| 225 | .max_speed_hz = 1 * 1000 * 1000, | ||
| 226 | .bus_num = 1, | ||
| 227 | }, | ||
| 228 | }; | ||
| 229 | |||
| 230 | |||
| 231 | /* | ||
| 232 | * Dallas 1-Wire | ||
| 233 | */ | ||
| 234 | static struct w1_gpio_platform_data w1_gpio_pdata = { | ||
| 235 | .pin = AT91_PIN_PA29, | ||
| 236 | .is_open_drain = 1, | ||
| 237 | }; | ||
| 238 | |||
| 239 | static struct platform_device w1_device = { | ||
| 240 | .name = "w1-gpio", | ||
| 241 | .id = -1, | ||
| 242 | .dev.platform_data = &w1_gpio_pdata, | ||
| 243 | }; | ||
| 244 | |||
| 245 | void add_w1(void) | ||
| 246 | { | ||
| 247 | at91_set_GPIO_periph(w1_gpio_pdata.pin, 1); | ||
| 248 | at91_set_multi_drive(w1_gpio_pdata.pin, 1); | ||
| 249 | platform_device_register(&w1_device); | ||
| 250 | } | ||
| 251 | |||
| 252 | |||
| 253 | static void __init generic_board_init(void) | ||
| 254 | { | ||
| 255 | /* Serial */ | ||
| 256 | at91_add_device_serial(); | ||
| 257 | /* NAND */ | ||
| 258 | add_device_nand(); | ||
| 259 | /* MMC */ | ||
| 260 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
| 261 | at91_add_device_mci(0, &mmc_data); | ||
| 262 | #else | ||
| 263 | at91_add_device_mmc(0, &mmc_data); | ||
| 264 | #endif | ||
| 265 | /* USB Host */ | ||
| 266 | at91_add_device_usbh(&usbh_data); | ||
| 267 | /* Ethernet */ | ||
| 268 | at91_add_device_eth(&macb_data); | ||
| 269 | /* I2C */ | ||
| 270 | at91_add_device_i2c(NULL, 0); | ||
| 271 | /* W1 */ | ||
| 272 | add_w1(); | ||
| 273 | } | ||
| 274 | |||
| 275 | static void __init portuxg20_board_init(void) | ||
| 276 | { | ||
| 277 | generic_board_init(); | ||
| 278 | /* SPI */ | ||
| 279 | at91_add_device_spi(portuxg20_spi_devices, ARRAY_SIZE(portuxg20_spi_devices)); | ||
| 280 | /* USB Device */ | ||
| 281 | at91_add_device_udc(&portuxg20_udc_data); | ||
| 282 | /* LEDs */ | ||
| 283 | at91_gpio_leds(portuxg20_leds, ARRAY_SIZE(portuxg20_leds)); | ||
| 284 | } | ||
| 285 | |||
| 286 | static void __init stamp9g20_board_init(void) | ||
| 287 | { | ||
| 288 | generic_board_init(); | ||
| 289 | /* USB Device */ | ||
| 290 | at91_add_device_udc(&stamp9g20_udc_data); | ||
| 291 | /* LEDs */ | ||
| 292 | at91_gpio_leds(stamp9g20_leds, ARRAY_SIZE(stamp9g20_leds)); | ||
| 293 | } | ||
| 294 | |||
| 295 | MACHINE_START(PORTUXG20, "taskit PortuxG20") | ||
| 296 | /* Maintainer: taskit GmbH */ | ||
| 297 | .phys_io = AT91_BASE_SYS, | ||
| 298 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
| 299 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
| 300 | .timer = &at91sam926x_timer, | ||
| 301 | .map_io = portuxg20_map_io, | ||
| 302 | .init_irq = init_irq, | ||
| 303 | .init_machine = portuxg20_board_init, | ||
| 304 | MACHINE_END | ||
| 305 | |||
| 306 | MACHINE_START(STAMP9G20, "taskit Stamp9G20") | ||
| 307 | /* Maintainer: taskit GmbH */ | ||
| 308 | .phys_io = AT91_BASE_SYS, | ||
| 309 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
| 310 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
| 311 | .timer = &at91sam926x_timer, | ||
| 312 | .map_io = stamp9g20_map_io, | ||
| 313 | .init_irq = init_irq, | ||
| 314 | .init_machine = stamp9g20_board_init, | ||
| 315 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index ceaec6c16eb2..df2ed848c9f8 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <linux/usb/atmel_usba_udc.h> | 39 | #include <linux/usb/atmel_usba_udc.h> |
| 40 | #include <linux/atmel-mci.h> | 40 | #include <linux/atmel-mci.h> |
| 41 | #include <sound/atmel-ac97c.h> | 41 | #include <sound/atmel-ac97c.h> |
| 42 | #include <linux/serial.h> | ||
| 42 | 43 | ||
| 43 | /* USB Device */ | 44 | /* USB Device */ |
| 44 | struct at91_udc_data { | 45 | struct at91_udc_data { |
| @@ -143,9 +144,10 @@ extern struct platform_device *atmel_default_console_device; | |||
| 143 | extern void __init __deprecated at91_init_serial(struct at91_uart_config *config); | 144 | extern void __init __deprecated at91_init_serial(struct at91_uart_config *config); |
| 144 | 145 | ||
| 145 | struct atmel_uart_data { | 146 | struct atmel_uart_data { |
| 146 | short use_dma_tx; /* use transmit DMA? */ | 147 | short use_dma_tx; /* use transmit DMA? */ |
| 147 | short use_dma_rx; /* use receive DMA? */ | 148 | short use_dma_rx; /* use receive DMA? */ |
| 148 | void __iomem *regs; /* virtual base address, if any */ | 149 | void __iomem *regs; /* virt. base address, if any */ |
| 150 | struct serial_rs485 rs485; /* rs485 settings */ | ||
| 149 | }; | 151 | }; |
| 150 | extern void __init at91_add_device_serial(void); | 152 | extern void __init at91_add_device_serial(void); |
| 151 | 153 | ||
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h index 5a0650101d45..833659d1200a 100644 --- a/arch/arm/mach-at91/include/mach/cpu.h +++ b/arch/arm/mach-at91/include/mach/cpu.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #define ARCH_ID_AT91SAM9260 0x019803a0 | 21 | #define ARCH_ID_AT91SAM9260 0x019803a0 |
| 22 | #define ARCH_ID_AT91SAM9261 0x019703a0 | 22 | #define ARCH_ID_AT91SAM9261 0x019703a0 |
| 23 | #define ARCH_ID_AT91SAM9263 0x019607a0 | 23 | #define ARCH_ID_AT91SAM9263 0x019607a0 |
| 24 | #define ARCH_ID_AT91SAM9G10 0x819903a0 | 24 | #define ARCH_ID_AT91SAM9G10 0x019903a0 |
| 25 | #define ARCH_ID_AT91SAM9G20 0x019905a0 | 25 | #define ARCH_ID_AT91SAM9G20 0x019905a0 |
| 26 | #define ARCH_ID_AT91SAM9RL64 0x019b03a0 | 26 | #define ARCH_ID_AT91SAM9RL64 0x019b03a0 |
| 27 | #define ARCH_ID_AT91SAM9G45 0x819b05a0 | 27 | #define ARCH_ID_AT91SAM9G45 0x819b05a0 |
| @@ -108,7 +108,7 @@ static inline unsigned long at91cap9_rev_identify(void) | |||
| 108 | #endif | 108 | #endif |
| 109 | 109 | ||
| 110 | #ifdef CONFIG_ARCH_AT91SAM9G10 | 110 | #ifdef CONFIG_ARCH_AT91SAM9G10 |
| 111 | #define cpu_is_at91sam9g10() (at91_cpu_identify() == ARCH_ID_AT91SAM9G10) | 111 | #define cpu_is_at91sam9g10() ((at91_cpu_identify() & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) |
| 112 | #else | 112 | #else |
| 113 | #define cpu_is_at91sam9g10() (0) | 113 | #define cpu_is_at91sam9g10() (0) |
| 114 | #endif | 114 | #endif |
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h index 5268af3933c2..c80e090b3670 100644 --- a/arch/arm/mach-at91/include/mach/system.h +++ b/arch/arm/mach-at91/include/mach/system.h | |||
| @@ -24,21 +24,24 @@ | |||
| 24 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
| 25 | #include <mach/at91_st.h> | 25 | #include <mach/at91_st.h> |
| 26 | #include <mach/at91_dbgu.h> | 26 | #include <mach/at91_dbgu.h> |
| 27 | #include <mach/at91_pmc.h> | ||
| 27 | 28 | ||
| 28 | static inline void arch_idle(void) | 29 | static inline void arch_idle(void) |
| 29 | { | 30 | { |
| 31 | #ifndef CONFIG_DEBUG_KERNEL | ||
| 30 | /* | 32 | /* |
| 31 | * Disable the processor clock. The processor will be automatically | 33 | * Disable the processor clock. The processor will be automatically |
| 32 | * re-enabled by an interrupt or by a reset. | 34 | * re-enabled by an interrupt or by a reset. |
| 33 | */ | 35 | */ |
| 34 | // at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | 36 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); |
| 35 | 37 | #else | |
| 36 | /* | 38 | /* |
| 37 | * Set the processor (CP15) into 'Wait for Interrupt' mode. | 39 | * Set the processor (CP15) into 'Wait for Interrupt' mode. |
| 38 | * Unlike disabling the processor clock via the PMC (above) | 40 | * Unlike disabling the processor clock via the PMC (above) |
| 39 | * this allows the processor to be woken via JTAG. | 41 | * this allows the processor to be woken via JTAG. |
| 40 | */ | 42 | */ |
| 41 | cpu_do_idle(); | 43 | cpu_do_idle(); |
| 44 | #endif | ||
| 42 | } | 45 | } |
| 43 | 46 | ||
| 44 | void (*at91_arch_reset)(void); | 47 | void (*at91_arch_reset)(void); |
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c index 53dd2a9eecf9..2f139196d63d 100644 --- a/arch/arm/mach-bcmring/arch.c +++ b/arch/arm/mach-bcmring/arch.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <asm/setup.h> | 29 | #include <asm/setup.h> |
| 30 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
| 31 | #include <asm/mach/time.h> | 31 | #include <asm/mach/time.h> |
| 32 | #include <asm/pmu.h> | ||
| 32 | 33 | ||
| 33 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
| 34 | #include <mach/dma.h> | 35 | #include <mach/dma.h> |
| @@ -85,8 +86,23 @@ static struct platform_device nand_device = { | |||
| 85 | .num_resources = ARRAY_SIZE(nand_resource), | 86 | .num_resources = ARRAY_SIZE(nand_resource), |
| 86 | }; | 87 | }; |
| 87 | 88 | ||
| 89 | static struct resource pmu_resource = { | ||
| 90 | .start = IRQ_PMUIRQ, | ||
| 91 | .end = IRQ_PMUIRQ, | ||
| 92 | .flags = IORESOURCE_IRQ, | ||
| 93 | }; | ||
| 94 | |||
| 95 | static struct platform_device pmu_device = { | ||
| 96 | .name = "arm-pmu", | ||
| 97 | .id = ARM_PMU_DEVICE_CPU, | ||
| 98 | .resource = &pmu_resource, | ||
| 99 | .num_resources = 1, | ||
| 100 | }; | ||
| 101 | |||
| 102 | |||
| 88 | static struct platform_device *devices[] __initdata = { | 103 | static struct platform_device *devices[] __initdata = { |
| 89 | &nand_device, | 104 | &nand_device, |
| 105 | &pmu_device, | ||
| 90 | }; | 106 | }; |
| 91 | 107 | ||
| 92 | /**************************************************************************** | 108 | /**************************************************************************** |
diff --git a/arch/arm/mach-clps711x/mm.c b/arch/arm/mach-clps711x/mm.c index a7b4591205a3..986592176767 100644 --- a/arch/arm/mach-clps711x/mm.c +++ b/arch/arm/mach-clps711x/mm.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
| 24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
| 25 | #include <linux/bootmem.h> | ||
| 26 | 25 | ||
| 27 | #include <asm/sizes.h> | 26 | #include <asm/sizes.h> |
| 28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c index caf6d5154aec..3a1a855bfdca 100644 --- a/arch/arm/mach-ep93xx/adssphere.c +++ b/arch/arm/mach-ep93xx/adssphere.c | |||
| @@ -41,7 +41,7 @@ static struct platform_device adssphere_flash = { | |||
| 41 | .resource = &adssphere_flash_resource, | 41 | .resource = &adssphere_flash_resource, |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | static struct ep93xx_eth_data adssphere_eth_data = { | 44 | static struct ep93xx_eth_data __initdata adssphere_eth_data = { |
| 45 | .phy_id = 1, | 45 | .phy_id = 1, |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 5f80092b6ace..e29bdef9b2e2 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
| @@ -96,6 +96,10 @@ static struct clk clk_keypad = { | |||
| 96 | .enable_mask = EP93XX_SYSCON_KEYTCHCLKDIV_KEN, | 96 | .enable_mask = EP93XX_SYSCON_KEYTCHCLKDIV_KEN, |
| 97 | .set_rate = set_keytchclk_rate, | 97 | .set_rate = set_keytchclk_rate, |
| 98 | }; | 98 | }; |
| 99 | static struct clk clk_spi = { | ||
| 100 | .parent = &clk_xtali, | ||
| 101 | .rate = EP93XX_EXT_CLK_RATE, | ||
| 102 | }; | ||
| 99 | static struct clk clk_pwm = { | 103 | static struct clk clk_pwm = { |
| 100 | .parent = &clk_xtali, | 104 | .parent = &clk_xtali, |
| 101 | .rate = EP93XX_EXT_CLK_RATE, | 105 | .rate = EP93XX_EXT_CLK_RATE, |
| @@ -186,6 +190,7 @@ static struct clk_lookup clocks[] = { | |||
| 186 | INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), | 190 | INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), |
| 187 | INIT_CK("ep93xx-keypad", NULL, &clk_keypad), | 191 | INIT_CK("ep93xx-keypad", NULL, &clk_keypad), |
| 188 | INIT_CK("ep93xx-fb", NULL, &clk_video), | 192 | INIT_CK("ep93xx-fb", NULL, &clk_video), |
| 193 | INIT_CK("ep93xx-spi.0", NULL, &clk_spi), | ||
| 189 | INIT_CK(NULL, "pwm_clk", &clk_pwm), | 194 | INIT_CK(NULL, "pwm_clk", &clk_pwm), |
| 190 | INIT_CK(NULL, "m2p0", &clk_m2p0), | 195 | INIT_CK(NULL, "m2p0", &clk_m2p0), |
| 191 | INIT_CK(NULL, "m2p1", &clk_m2p1), | 196 | INIT_CK(NULL, "m2p1", &clk_m2p1), |
| @@ -473,6 +478,14 @@ static int __init ep93xx_clock_init(void) | |||
| 473 | /* Initialize the pll2 derived clocks */ | 478 | /* Initialize the pll2 derived clocks */ |
| 474 | clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); | 479 | clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); |
| 475 | 480 | ||
| 481 | /* | ||
| 482 | * EP93xx SSP clock rate was doubled in version E2. For more information | ||
| 483 | * see: | ||
| 484 | * http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf | ||
| 485 | */ | ||
| 486 | if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2) | ||
| 487 | clk_spi.rate /= 2; | ||
| 488 | |||
| 476 | pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n", | 489 | pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n", |
| 477 | clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); | 490 | clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); |
| 478 | pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", | 491 | pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", |
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 90fb591cbffa..9092677f63eb 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
| @@ -31,10 +31,12 @@ | |||
| 31 | #include <linux/amba/serial.h> | 31 | #include <linux/amba/serial.h> |
| 32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
| 33 | #include <linux/i2c-gpio.h> | 33 | #include <linux/i2c-gpio.h> |
| 34 | #include <linux/spi/spi.h> | ||
| 34 | 35 | ||
| 35 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
| 36 | #include <mach/fb.h> | 37 | #include <mach/fb.h> |
| 37 | #include <mach/ep93xx_keypad.h> | 38 | #include <mach/ep93xx_keypad.h> |
| 39 | #include <mach/ep93xx_spi.h> | ||
| 38 | 40 | ||
| 39 | #include <asm/mach/map.h> | 41 | #include <asm/mach/map.h> |
| 40 | #include <asm/mach/time.h> | 42 | #include <asm/mach/time.h> |
| @@ -222,6 +224,20 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits) | |||
| 222 | } | 224 | } |
| 223 | EXPORT_SYMBOL(ep93xx_devcfg_set_clear); | 225 | EXPORT_SYMBOL(ep93xx_devcfg_set_clear); |
| 224 | 226 | ||
| 227 | /** | ||
| 228 | * ep93xx_chip_revision() - returns the EP93xx chip revision | ||
| 229 | * | ||
| 230 | * See <mach/platform.h> for more information. | ||
| 231 | */ | ||
| 232 | unsigned int ep93xx_chip_revision(void) | ||
| 233 | { | ||
| 234 | unsigned int v; | ||
| 235 | |||
| 236 | v = __raw_readl(EP93XX_SYSCON_SYSCFG); | ||
| 237 | v &= EP93XX_SYSCON_SYSCFG_REV_MASK; | ||
| 238 | v >>= EP93XX_SYSCON_SYSCFG_REV_SHIFT; | ||
| 239 | return v; | ||
| 240 | } | ||
| 225 | 241 | ||
| 226 | /************************************************************************* | 242 | /************************************************************************* |
| 227 | * EP93xx peripheral handling | 243 | * EP93xx peripheral handling |
| @@ -330,6 +346,10 @@ static struct platform_device ep93xx_ohci_device = { | |||
| 330 | .resource = ep93xx_ohci_resources, | 346 | .resource = ep93xx_ohci_resources, |
| 331 | }; | 347 | }; |
| 332 | 348 | ||
| 349 | |||
| 350 | /************************************************************************* | ||
| 351 | * EP93xx ethernet peripheral handling | ||
| 352 | *************************************************************************/ | ||
| 333 | static struct ep93xx_eth_data ep93xx_eth_data; | 353 | static struct ep93xx_eth_data ep93xx_eth_data; |
| 334 | 354 | ||
| 335 | static struct resource ep93xx_eth_resource[] = { | 355 | static struct resource ep93xx_eth_resource[] = { |
| @@ -354,6 +374,12 @@ static struct platform_device ep93xx_eth_device = { | |||
| 354 | .resource = ep93xx_eth_resource, | 374 | .resource = ep93xx_eth_resource, |
| 355 | }; | 375 | }; |
| 356 | 376 | ||
| 377 | /** | ||
| 378 | * ep93xx_register_eth - Register the built-in ethernet platform device. | ||
| 379 | * @data: platform specific ethernet configuration (__initdata) | ||
| 380 | * @copy_addr: flag indicating that the MAC address should be copied | ||
| 381 | * from the IndAd registers (as programmed by the bootloader) | ||
| 382 | */ | ||
| 357 | void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) | 383 | void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) |
| 358 | { | 384 | { |
| 359 | if (copy_addr) | 385 | if (copy_addr) |
| @@ -370,11 +396,19 @@ void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) | |||
| 370 | static struct i2c_gpio_platform_data ep93xx_i2c_data; | 396 | static struct i2c_gpio_platform_data ep93xx_i2c_data; |
| 371 | 397 | ||
| 372 | static struct platform_device ep93xx_i2c_device = { | 398 | static struct platform_device ep93xx_i2c_device = { |
| 373 | .name = "i2c-gpio", | 399 | .name = "i2c-gpio", |
| 374 | .id = 0, | 400 | .id = 0, |
| 375 | .dev.platform_data = &ep93xx_i2c_data, | 401 | .dev = { |
| 402 | .platform_data = &ep93xx_i2c_data, | ||
| 403 | }, | ||
| 376 | }; | 404 | }; |
| 377 | 405 | ||
| 406 | /** | ||
| 407 | * ep93xx_register_i2c - Register the i2c platform device. | ||
| 408 | * @data: platform specific i2c-gpio configuration (__initdata) | ||
| 409 | * @devices: platform specific i2c bus device information (__initdata) | ||
| 410 | * @num: the number of devices on the i2c bus | ||
| 411 | */ | ||
| 378 | void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | 412 | void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, |
| 379 | struct i2c_board_info *devices, int num) | 413 | struct i2c_board_info *devices, int num) |
| 380 | { | 414 | { |
| @@ -398,17 +432,67 @@ void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | |||
| 398 | platform_device_register(&ep93xx_i2c_device); | 432 | platform_device_register(&ep93xx_i2c_device); |
| 399 | } | 433 | } |
| 400 | 434 | ||
| 435 | /************************************************************************* | ||
| 436 | * EP93xx SPI peripheral handling | ||
| 437 | *************************************************************************/ | ||
| 438 | static struct ep93xx_spi_info ep93xx_spi_master_data; | ||
| 439 | |||
| 440 | static struct resource ep93xx_spi_resources[] = { | ||
| 441 | { | ||
| 442 | .start = EP93XX_SPI_PHYS_BASE, | ||
| 443 | .end = EP93XX_SPI_PHYS_BASE + 0x18 - 1, | ||
| 444 | .flags = IORESOURCE_MEM, | ||
| 445 | }, | ||
| 446 | { | ||
| 447 | .start = IRQ_EP93XX_SSP, | ||
| 448 | .end = IRQ_EP93XX_SSP, | ||
| 449 | .flags = IORESOURCE_IRQ, | ||
| 450 | }, | ||
| 451 | }; | ||
| 452 | |||
| 453 | static struct platform_device ep93xx_spi_device = { | ||
| 454 | .name = "ep93xx-spi", | ||
| 455 | .id = 0, | ||
| 456 | .dev = { | ||
| 457 | .platform_data = &ep93xx_spi_master_data, | ||
| 458 | }, | ||
| 459 | .num_resources = ARRAY_SIZE(ep93xx_spi_resources), | ||
| 460 | .resource = ep93xx_spi_resources, | ||
| 461 | }; | ||
| 462 | |||
| 463 | /** | ||
| 464 | * ep93xx_register_spi() - registers spi platform device | ||
| 465 | * @info: ep93xx board specific spi master info (__initdata) | ||
| 466 | * @devices: SPI devices to register (__initdata) | ||
| 467 | * @num: number of SPI devices to register | ||
| 468 | * | ||
| 469 | * This function registers platform device for the EP93xx SPI controller and | ||
| 470 | * also makes sure that SPI pins are muxed so that I2S is not using those pins. | ||
| 471 | */ | ||
| 472 | void __init ep93xx_register_spi(struct ep93xx_spi_info *info, | ||
| 473 | struct spi_board_info *devices, int num) | ||
| 474 | { | ||
| 475 | /* | ||
| 476 | * When SPI is used, we need to make sure that I2S is muxed off from | ||
| 477 | * SPI pins. | ||
| 478 | */ | ||
| 479 | ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2SONSSP); | ||
| 480 | |||
| 481 | ep93xx_spi_master_data = *info; | ||
| 482 | spi_register_board_info(devices, num); | ||
| 483 | platform_device_register(&ep93xx_spi_device); | ||
| 484 | } | ||
| 401 | 485 | ||
| 402 | /************************************************************************* | 486 | /************************************************************************* |
| 403 | * EP93xx LEDs | 487 | * EP93xx LEDs |
| 404 | *************************************************************************/ | 488 | *************************************************************************/ |
| 405 | static struct gpio_led ep93xx_led_pins[] = { | 489 | static struct gpio_led ep93xx_led_pins[] = { |
| 406 | { | 490 | { |
| 407 | .name = "platform:grled", | 491 | .name = "platform:grled", |
| 408 | .gpio = EP93XX_GPIO_LINE_GRLED, | 492 | .gpio = EP93XX_GPIO_LINE_GRLED, |
| 409 | }, { | 493 | }, { |
| 410 | .name = "platform:rdled", | 494 | .name = "platform:rdled", |
| 411 | .gpio = EP93XX_GPIO_LINE_RDLED, | 495 | .gpio = EP93XX_GPIO_LINE_RDLED, |
| 412 | }, | 496 | }, |
| 413 | }; | 497 | }; |
| 414 | 498 | ||
| @@ -528,7 +612,7 @@ static struct platform_device ep93xx_fb_device = { | |||
| 528 | .name = "ep93xx-fb", | 612 | .name = "ep93xx-fb", |
| 529 | .id = -1, | 613 | .id = -1, |
| 530 | .dev = { | 614 | .dev = { |
| 531 | .platform_data = &ep93xxfb_data, | 615 | .platform_data = &ep93xxfb_data, |
| 532 | .coherent_dma_mask = DMA_BIT_MASK(32), | 616 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 533 | .dma_mask = &ep93xx_fb_device.dev.coherent_dma_mask, | 617 | .dma_mask = &ep93xx_fb_device.dev.coherent_dma_mask, |
| 534 | }, | 618 | }, |
| @@ -536,6 +620,10 @@ static struct platform_device ep93xx_fb_device = { | |||
| 536 | .resource = ep93xx_fb_resource, | 620 | .resource = ep93xx_fb_resource, |
| 537 | }; | 621 | }; |
| 538 | 622 | ||
| 623 | /** | ||
| 624 | * ep93xx_register_fb - Register the framebuffer platform device. | ||
| 625 | * @data: platform specific framebuffer configuration (__initdata) | ||
| 626 | */ | ||
| 539 | void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) | 627 | void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) |
| 540 | { | 628 | { |
| 541 | ep93xxfb_data = *data; | 629 | ep93xxfb_data = *data; |
| @@ -546,6 +634,8 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) | |||
| 546 | /************************************************************************* | 634 | /************************************************************************* |
| 547 | * EP93xx matrix keypad peripheral handling | 635 | * EP93xx matrix keypad peripheral handling |
| 548 | *************************************************************************/ | 636 | *************************************************************************/ |
| 637 | static struct ep93xx_keypad_platform_data ep93xx_keypad_data; | ||
| 638 | |||
| 549 | static struct resource ep93xx_keypad_resource[] = { | 639 | static struct resource ep93xx_keypad_resource[] = { |
| 550 | { | 640 | { |
| 551 | .start = EP93XX_KEY_MATRIX_PHYS_BASE, | 641 | .start = EP93XX_KEY_MATRIX_PHYS_BASE, |
| @@ -559,15 +649,22 @@ static struct resource ep93xx_keypad_resource[] = { | |||
| 559 | }; | 649 | }; |
| 560 | 650 | ||
| 561 | static struct platform_device ep93xx_keypad_device = { | 651 | static struct platform_device ep93xx_keypad_device = { |
| 562 | .name = "ep93xx-keypad", | 652 | .name = "ep93xx-keypad", |
| 563 | .id = -1, | 653 | .id = -1, |
| 564 | .num_resources = ARRAY_SIZE(ep93xx_keypad_resource), | 654 | .dev = { |
| 565 | .resource = ep93xx_keypad_resource, | 655 | .platform_data = &ep93xx_keypad_data, |
| 656 | }, | ||
| 657 | .num_resources = ARRAY_SIZE(ep93xx_keypad_resource), | ||
| 658 | .resource = ep93xx_keypad_resource, | ||
| 566 | }; | 659 | }; |
| 567 | 660 | ||
| 661 | /** | ||
| 662 | * ep93xx_register_keypad - Register the keypad platform device. | ||
| 663 | * @data: platform specific keypad configuration (__initdata) | ||
| 664 | */ | ||
| 568 | void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data) | 665 | void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data) |
| 569 | { | 666 | { |
| 570 | ep93xx_keypad_device.dev.platform_data = data; | 667 | ep93xx_keypad_data = *data; |
| 571 | platform_device_register(&ep93xx_keypad_device); | 668 | platform_device_register(&ep93xx_keypad_device); |
| 572 | } | 669 | } |
| 573 | 670 | ||
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c index d22d67ac8b99..3884182cd362 100644 --- a/arch/arm/mach-ep93xx/edb93xx.c +++ b/arch/arm/mach-ep93xx/edb93xx.c | |||
| @@ -74,7 +74,7 @@ static void __init edb93xx_register_flash(void) | |||
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | static struct ep93xx_eth_data edb93xx_eth_data = { | 77 | static struct ep93xx_eth_data __initdata edb93xx_eth_data = { |
| 78 | .phy_id = 1, | 78 | .phy_id = 1, |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| @@ -82,7 +82,7 @@ static struct ep93xx_eth_data edb93xx_eth_data = { | |||
| 82 | /************************************************************************* | 82 | /************************************************************************* |
| 83 | * EDB93xx i2c peripheral handling | 83 | * EDB93xx i2c peripheral handling |
| 84 | *************************************************************************/ | 84 | *************************************************************************/ |
| 85 | static struct i2c_gpio_platform_data edb93xx_i2c_gpio_data = { | 85 | static struct i2c_gpio_platform_data __initdata edb93xx_i2c_gpio_data = { |
| 86 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | 86 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, |
| 87 | .sda_is_open_drain = 0, | 87 | .sda_is_open_drain = 0, |
| 88 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | 88 | .scl_pin = EP93XX_GPIO_LINE_EECLK, |
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c index 3da7ca816d19..a809618e9f05 100644 --- a/arch/arm/mach-ep93xx/gesbc9312.c +++ b/arch/arm/mach-ep93xx/gesbc9312.c | |||
| @@ -41,7 +41,7 @@ static struct platform_device gesbc9312_flash = { | |||
| 41 | .resource = &gesbc9312_flash_resource, | 41 | .resource = &gesbc9312_flash_resource, |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | static struct ep93xx_eth_data gesbc9312_eth_data = { | 44 | static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { |
| 45 | .phy_id = 1, | 45 | .phy_id = 1, |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h index 93e2ecc79ceb..b1e096f0c2d2 100644 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | |||
| @@ -106,6 +106,7 @@ | |||
| 106 | 106 | ||
| 107 | #define EP93XX_AAC_BASE EP93XX_APB_IOMEM(0x00080000) | 107 | #define EP93XX_AAC_BASE EP93XX_APB_IOMEM(0x00080000) |
| 108 | 108 | ||
| 109 | #define EP93XX_SPI_PHYS_BASE EP93XX_APB_PHYS(0x000a0000) | ||
| 109 | #define EP93XX_SPI_BASE EP93XX_APB_IOMEM(0x000a0000) | 110 | #define EP93XX_SPI_BASE EP93XX_APB_IOMEM(0x000a0000) |
| 110 | 111 | ||
| 111 | #define EP93XX_IRDA_BASE EP93XX_APB_IOMEM(0x000b0000) | 112 | #define EP93XX_IRDA_BASE EP93XX_APB_IOMEM(0x000b0000) |
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index c6dc14dbca18..9a4413dd44bb 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h | |||
| @@ -6,9 +6,11 @@ | |||
| 6 | 6 | ||
| 7 | struct i2c_gpio_platform_data; | 7 | struct i2c_gpio_platform_data; |
| 8 | struct i2c_board_info; | 8 | struct i2c_board_info; |
| 9 | struct spi_board_info; | ||
| 9 | struct platform_device; | 10 | struct platform_device; |
| 10 | struct ep93xxfb_mach_info; | 11 | struct ep93xxfb_mach_info; |
| 11 | struct ep93xx_keypad_platform_data; | 12 | struct ep93xx_keypad_platform_data; |
| 13 | struct ep93xx_spi_info; | ||
| 12 | 14 | ||
| 13 | struct ep93xx_eth_data | 15 | struct ep93xx_eth_data |
| 14 | { | 16 | { |
| @@ -33,9 +35,19 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits) | |||
| 33 | ep93xx_devcfg_set_clear(0x00, bits); | 35 | ep93xx_devcfg_set_clear(0x00, bits); |
| 34 | } | 36 | } |
| 35 | 37 | ||
| 38 | #define EP93XX_CHIP_REV_D0 3 | ||
| 39 | #define EP93XX_CHIP_REV_D1 4 | ||
| 40 | #define EP93XX_CHIP_REV_E0 5 | ||
| 41 | #define EP93XX_CHIP_REV_E1 6 | ||
| 42 | #define EP93XX_CHIP_REV_E2 7 | ||
| 43 | |||
| 44 | unsigned int ep93xx_chip_revision(void); | ||
| 45 | |||
| 36 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); | 46 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); |
| 37 | void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | 47 | void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, |
| 38 | struct i2c_board_info *devices, int num); | 48 | struct i2c_board_info *devices, int num); |
| 49 | void ep93xx_register_spi(struct ep93xx_spi_info *info, | ||
| 50 | struct spi_board_info *devices, int num); | ||
| 39 | void ep93xx_register_fb(struct ep93xxfb_mach_info *data); | 51 | void ep93xx_register_fb(struct ep93xxfb_mach_info *data); |
| 40 | void ep93xx_register_pwm(int pwm0, int pwm1); | 52 | void ep93xx_register_pwm(int pwm0, int pwm1); |
| 41 | int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); | 53 | int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); |
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c index c33360e82868..1cc911b4efa6 100644 --- a/arch/arm/mach-ep93xx/micro9.c +++ b/arch/arm/mach-ep93xx/micro9.c | |||
| @@ -80,7 +80,7 @@ static void __init micro9_register_flash(void) | |||
| 80 | /************************************************************************* | 80 | /************************************************************************* |
| 81 | * Micro9 Ethernet | 81 | * Micro9 Ethernet |
| 82 | *************************************************************************/ | 82 | *************************************************************************/ |
| 83 | static struct ep93xx_eth_data micro9_eth_data = { | 83 | static struct ep93xx_eth_data __initdata micro9_eth_data = { |
| 84 | .phy_id = 0x1f, | 84 | .phy_id = 0x1f, |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c index cd93990f1b99..388aec95f60e 100644 --- a/arch/arm/mach-ep93xx/simone.c +++ b/arch/arm/mach-ep93xx/simone.c | |||
| @@ -49,17 +49,17 @@ static struct platform_device simone_flash = { | |||
| 49 | }, | 49 | }, |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | static struct ep93xx_eth_data simone_eth_data = { | 52 | static struct ep93xx_eth_data __initdata simone_eth_data = { |
| 53 | .phy_id = 1, | 53 | .phy_id = 1, |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | static struct ep93xxfb_mach_info simone_fb_info = { | 56 | static struct ep93xxfb_mach_info __initdata simone_fb_info = { |
| 57 | .num_modes = EP93XXFB_USE_MODEDB, | 57 | .num_modes = EP93XXFB_USE_MODEDB, |
| 58 | .bpp = 16, | 58 | .bpp = 16, |
| 59 | .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, | 59 | .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | static struct i2c_gpio_platform_data simone_i2c_gpio_data = { | 62 | static struct i2c_gpio_platform_data __initdata simone_i2c_gpio_data = { |
| 63 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | 63 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, |
| 64 | .sda_is_open_drain = 0, | 64 | .sda_is_open_drain = 0, |
| 65 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | 65 | .scl_pin = EP93XX_GPIO_LINE_EECLK, |
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c index 51134b0382ca..38deaee40397 100644 --- a/arch/arm/mach-ep93xx/snappercl15.c +++ b/arch/arm/mach-ep93xx/snappercl15.c | |||
| @@ -125,11 +125,11 @@ static struct platform_device snappercl15_nand_device = { | |||
| 125 | .num_resources = ARRAY_SIZE(snappercl15_nand_resource), | 125 | .num_resources = ARRAY_SIZE(snappercl15_nand_resource), |
| 126 | }; | 126 | }; |
| 127 | 127 | ||
| 128 | static struct ep93xx_eth_data snappercl15_eth_data = { | 128 | static struct ep93xx_eth_data __initdata snappercl15_eth_data = { |
| 129 | .phy_id = 1, | 129 | .phy_id = 1, |
| 130 | }; | 130 | }; |
| 131 | 131 | ||
| 132 | static struct i2c_gpio_platform_data snappercl15_i2c_gpio_data = { | 132 | static struct i2c_gpio_platform_data __initdata snappercl15_i2c_gpio_data = { |
| 133 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | 133 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, |
| 134 | .sda_is_open_drain = 0, | 134 | .sda_is_open_drain = 0, |
| 135 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | 135 | .scl_pin = EP93XX_GPIO_LINE_EECLK, |
| @@ -145,7 +145,7 @@ static struct i2c_board_info __initdata snappercl15_i2c_data[] = { | |||
| 145 | }, | 145 | }, |
| 146 | }; | 146 | }; |
| 147 | 147 | ||
| 148 | static struct ep93xxfb_mach_info snappercl15_fb_info = { | 148 | static struct ep93xxfb_mach_info __initdata snappercl15_fb_info = { |
| 149 | .num_modes = EP93XXFB_USE_MODEDB, | 149 | .num_modes = EP93XXFB_USE_MODEDB, |
| 150 | .bpp = 16, | 150 | .bpp = 16, |
| 151 | }; | 151 | }; |
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index fac1ec7a60fb..9553031900b0 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c | |||
| @@ -186,7 +186,7 @@ static struct platform_device ts72xx_wdt_device = { | |||
| 186 | .resource = ts72xx_wdt_resources, | 186 | .resource = ts72xx_wdt_resources, |
| 187 | }; | 187 | }; |
| 188 | 188 | ||
| 189 | static struct ep93xx_eth_data ts72xx_eth_data = { | 189 | static struct ep93xx_eth_data __initdata ts72xx_eth_data = { |
| 190 | .phy_id = 1, | 190 | .phy_id = 1, |
| 191 | }; | 191 | }; |
| 192 | 192 | ||
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index df97d16390e3..27db275b367c 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig | |||
| @@ -11,6 +11,7 @@ config ARCH_INTEGRATOR_AP | |||
| 11 | config ARCH_INTEGRATOR_CP | 11 | config ARCH_INTEGRATOR_CP |
| 12 | bool "Support Integrator/CP platform" | 12 | bool "Support Integrator/CP platform" |
| 13 | select ARCH_CINTEGRATOR | 13 | select ARCH_CINTEGRATOR |
| 14 | select ARM_TIMER_SP804 | ||
| 14 | help | 15 | help |
| 15 | Include support for the ARM(R) Integrator CP platform. | 16 | Include support for the ARM(R) Integrator CP platform. |
| 16 | 17 | ||
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile index 6a5ef8d30b10..ebeef966e1f5 100644 --- a/arch/arm/mach-integrator/Makefile +++ b/arch/arm/mach-integrator/Makefile | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | # Object file lists. | 5 | # Object file lists. |
| 6 | 6 | ||
| 7 | obj-y := clock.o core.o lm.o | 7 | obj-y := core.o lm.o |
| 8 | obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o | 8 | obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o |
| 9 | obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o | 9 | obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o |
| 10 | 10 | ||
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h deleted file mode 100644 index 609c49de3d47..000000000000 --- a/arch/arm/mach-integrator/common.h +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | extern void integrator_time_init(unsigned long, unsigned int); | ||
| 2 | extern unsigned long integrator_gettimeoffset(void); | ||
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 8b390e36ba69..b02cfc06e0ae 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c | |||
| @@ -24,15 +24,13 @@ | |||
| 24 | #include <asm/clkdev.h> | 24 | #include <asm/clkdev.h> |
| 25 | #include <mach/clkdev.h> | 25 | #include <mach/clkdev.h> |
| 26 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
| 27 | #include <mach/platform.h> | ||
| 27 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
| 28 | #include <asm/hardware/arm_timer.h> | ||
| 29 | #include <mach/cm.h> | 29 | #include <mach/cm.h> |
| 30 | #include <asm/system.h> | 30 | #include <asm/system.h> |
| 31 | #include <asm/leds.h> | 31 | #include <asm/leds.h> |
| 32 | #include <asm/mach/time.h> | 32 | #include <asm/mach/time.h> |
| 33 | 33 | ||
| 34 | #include "common.h" | ||
| 35 | |||
| 36 | static struct amba_pl010_data integrator_uart_data; | 34 | static struct amba_pl010_data integrator_uart_data; |
| 37 | 35 | ||
| 38 | static struct amba_device rtc_device = { | 36 | static struct amba_device rtc_device = { |
| @@ -163,8 +161,8 @@ arch_initcall(integrator_init); | |||
| 163 | * UART0 7 6 | 161 | * UART0 7 6 |
| 164 | * UART1 5 4 | 162 | * UART1 5 4 |
| 165 | */ | 163 | */ |
| 166 | #define SC_CTRLC (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLC_OFFSET) | 164 | #define SC_CTRLC IO_ADDRESS(INTEGRATOR_SC_CTRLC) |
| 167 | #define SC_CTRLS (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLS_OFFSET) | 165 | #define SC_CTRLS IO_ADDRESS(INTEGRATOR_SC_CTRLS) |
| 168 | 166 | ||
| 169 | static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) | 167 | static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) |
| 170 | { | 168 | { |
| @@ -196,7 +194,7 @@ static struct amba_pl010_data integrator_uart_data = { | |||
| 196 | .set_mctrl = integrator_uart_set_mctrl, | 194 | .set_mctrl = integrator_uart_set_mctrl, |
| 197 | }; | 195 | }; |
| 198 | 196 | ||
| 199 | #define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET | 197 | #define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_CTRL) |
| 200 | 198 | ||
| 201 | static DEFINE_SPINLOCK(cm_lock); | 199 | static DEFINE_SPINLOCK(cm_lock); |
| 202 | 200 | ||
| @@ -217,120 +215,3 @@ void cm_control(u32 mask, u32 set) | |||
| 217 | } | 215 | } |
| 218 | 216 | ||
| 219 | EXPORT_SYMBOL(cm_control); | 217 | EXPORT_SYMBOL(cm_control); |
| 220 | |||
| 221 | /* | ||
| 222 | * Where is the timer (VA)? | ||
| 223 | */ | ||
| 224 | #define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000) | ||
| 225 | #define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100) | ||
| 226 | #define TIMER2_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000200) | ||
| 227 | #define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) | ||
| 228 | |||
| 229 | /* | ||
| 230 | * How long is the timer interval? | ||
| 231 | */ | ||
| 232 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
| 233 | #if TIMER_INTERVAL >= 0x100000 | ||
| 234 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
| 235 | #elif TIMER_INTERVAL >= 0x10000 | ||
| 236 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
| 237 | #else | ||
| 238 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
| 239 | #endif | ||
| 240 | |||
| 241 | static unsigned long timer_reload; | ||
| 242 | |||
| 243 | /* | ||
| 244 | * Returns number of ms since last clock interrupt. Note that interrupts | ||
| 245 | * will have been disabled by do_gettimeoffset() | ||
| 246 | */ | ||
| 247 | unsigned long integrator_gettimeoffset(void) | ||
| 248 | { | ||
| 249 | unsigned long ticks1, ticks2, status; | ||
| 250 | |||
| 251 | /* | ||
| 252 | * Get the current number of ticks. Note that there is a race | ||
| 253 | * condition between us reading the timer and checking for | ||
| 254 | * an interrupt. We get around this by ensuring that the | ||
| 255 | * counter has not reloaded between our two reads. | ||
| 256 | */ | ||
| 257 | ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff; | ||
| 258 | do { | ||
| 259 | ticks1 = ticks2; | ||
| 260 | status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS); | ||
| 261 | ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff; | ||
| 262 | } while (ticks2 > ticks1); | ||
| 263 | |||
| 264 | /* | ||
| 265 | * Number of ticks since last interrupt. | ||
| 266 | */ | ||
| 267 | ticks1 = timer_reload - ticks2; | ||
| 268 | |||
| 269 | /* | ||
| 270 | * Interrupt pending? If so, we've reloaded once already. | ||
| 271 | */ | ||
| 272 | if (status & (1 << IRQ_TIMERINT1)) | ||
| 273 | ticks1 += timer_reload; | ||
| 274 | |||
| 275 | /* | ||
| 276 | * Convert the ticks to usecs | ||
| 277 | */ | ||
| 278 | return TICKS2USECS(ticks1); | ||
| 279 | } | ||
| 280 | |||
| 281 | /* | ||
| 282 | * IRQ handler for the timer | ||
| 283 | */ | ||
| 284 | static irqreturn_t | ||
| 285 | integrator_timer_interrupt(int irq, void *dev_id) | ||
| 286 | { | ||
| 287 | /* | ||
| 288 | * clear the interrupt | ||
| 289 | */ | ||
| 290 | writel(1, TIMER1_VA_BASE + TIMER_INTCLR); | ||
| 291 | |||
| 292 | timer_tick(); | ||
| 293 | |||
| 294 | return IRQ_HANDLED; | ||
| 295 | } | ||
| 296 | |||
| 297 | static struct irqaction integrator_timer_irq = { | ||
| 298 | .name = "Integrator Timer Tick", | ||
| 299 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
| 300 | .handler = integrator_timer_interrupt, | ||
| 301 | }; | ||
| 302 | |||
| 303 | /* | ||
| 304 | * Set up timer interrupt, and return the current time in seconds. | ||
| 305 | */ | ||
| 306 | void __init integrator_time_init(unsigned long reload, unsigned int ctrl) | ||
| 307 | { | ||
| 308 | unsigned int timer_ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC; | ||
| 309 | |||
| 310 | timer_reload = reload; | ||
| 311 | timer_ctrl |= ctrl; | ||
| 312 | |||
| 313 | if (timer_reload > 0x100000) { | ||
| 314 | timer_reload >>= 8; | ||
| 315 | timer_ctrl |= TIMER_CTRL_DIV256; | ||
| 316 | } else if (timer_reload > 0x010000) { | ||
| 317 | timer_reload >>= 4; | ||
| 318 | timer_ctrl |= TIMER_CTRL_DIV16; | ||
| 319 | } | ||
| 320 | |||
| 321 | /* | ||
| 322 | * Initialise to a known state (all timers off) | ||
| 323 | */ | ||
| 324 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); | ||
| 325 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); | ||
| 326 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | ||
| 327 | |||
| 328 | writel(timer_reload, TIMER1_VA_BASE + TIMER_LOAD); | ||
| 329 | writel(timer_reload, TIMER1_VA_BASE + TIMER_VALUE); | ||
| 330 | writel(timer_ctrl, TIMER1_VA_BASE + TIMER_CTRL); | ||
| 331 | |||
| 332 | /* | ||
| 333 | * Make irqs happen for the system timer | ||
| 334 | */ | ||
| 335 | setup_irq(IRQ_TIMERINT1, &integrator_timer_irq); | ||
| 336 | } | ||
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c index f77f20255045..a3fbcb3adc29 100644 --- a/arch/arm/mach-integrator/cpu.c +++ b/arch/arm/mach-integrator/cpu.c | |||
| @@ -19,32 +19,39 @@ | |||
| 19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
| 20 | 20 | ||
| 21 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
| 22 | #include <mach/platform.h> | ||
| 22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
| 23 | #include <asm/hardware/icst525.h> | 24 | #include <asm/hardware/icst.h> |
| 24 | 25 | ||
| 25 | static struct cpufreq_driver integrator_driver; | 26 | static struct cpufreq_driver integrator_driver; |
| 26 | 27 | ||
| 27 | #define CM_ID (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_ID_OFFSET) | 28 | #define CM_ID IO_ADDRESS(INTEGRATOR_HDR_ID) |
| 28 | #define CM_OSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_OSC_OFFSET) | 29 | #define CM_OSC IO_ADDRESS(INTEGRATOR_HDR_OSC) |
| 29 | #define CM_STAT (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_STAT_OFFSET) | 30 | #define CM_STAT IO_ADDRESS(INTEGRATOR_HDR_STAT) |
| 30 | #define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) | 31 | #define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) |
| 31 | 32 | ||
| 32 | static const struct icst525_params lclk_params = { | 33 | static const struct icst_params lclk_params = { |
| 33 | .ref = 24000, | 34 | .ref = 24000000, |
| 34 | .vco_max = 320000, | 35 | .vco_max = ICST525_VCO_MAX_5V, |
| 36 | .vco_min = ICST525_VCO_MIN, | ||
| 35 | .vd_min = 8, | 37 | .vd_min = 8, |
| 36 | .vd_max = 132, | 38 | .vd_max = 132, |
| 37 | .rd_min = 24, | 39 | .rd_min = 24, |
| 38 | .rd_max = 24, | 40 | .rd_max = 24, |
| 41 | .s2div = icst525_s2div, | ||
| 42 | .idx2s = icst525_idx2s, | ||
| 39 | }; | 43 | }; |
| 40 | 44 | ||
| 41 | static const struct icst525_params cclk_params = { | 45 | static const struct icst_params cclk_params = { |
| 42 | .ref = 24000, | 46 | .ref = 24000000, |
| 43 | .vco_max = 320000, | 47 | .vco_max = ICST525_VCO_MAX_5V, |
| 48 | .vco_min = ICST525_VCO_MIN, | ||
| 44 | .vd_min = 12, | 49 | .vd_min = 12, |
| 45 | .vd_max = 160, | 50 | .vd_max = 160, |
| 46 | .rd_min = 24, | 51 | .rd_min = 24, |
| 47 | .rd_max = 24, | 52 | .rd_max = 24, |
| 53 | .s2div = icst525_s2div, | ||
| 54 | .idx2s = icst525_idx2s, | ||
| 48 | }; | 55 | }; |
| 49 | 56 | ||
| 50 | /* | 57 | /* |
| @@ -52,17 +59,17 @@ static const struct icst525_params cclk_params = { | |||
| 52 | */ | 59 | */ |
| 53 | static int integrator_verify_policy(struct cpufreq_policy *policy) | 60 | static int integrator_verify_policy(struct cpufreq_policy *policy) |
| 54 | { | 61 | { |
| 55 | struct icst525_vco vco; | 62 | struct icst_vco vco; |
| 56 | 63 | ||
| 57 | cpufreq_verify_within_limits(policy, | 64 | cpufreq_verify_within_limits(policy, |
| 58 | policy->cpuinfo.min_freq, | 65 | policy->cpuinfo.min_freq, |
| 59 | policy->cpuinfo.max_freq); | 66 | policy->cpuinfo.max_freq); |
| 60 | 67 | ||
| 61 | vco = icst525_khz_to_vco(&cclk_params, policy->max); | 68 | vco = icst_hz_to_vco(&cclk_params, policy->max * 1000); |
| 62 | policy->max = icst525_khz(&cclk_params, vco); | 69 | policy->max = icst_hz(&cclk_params, vco) / 1000; |
| 63 | 70 | ||
| 64 | vco = icst525_khz_to_vco(&cclk_params, policy->min); | 71 | vco = icst_hz_to_vco(&cclk_params, policy->min * 1000); |
| 65 | policy->min = icst525_khz(&cclk_params, vco); | 72 | policy->min = icst_hz(&cclk_params, vco) / 1000; |
| 66 | 73 | ||
| 67 | cpufreq_verify_within_limits(policy, | 74 | cpufreq_verify_within_limits(policy, |
| 68 | policy->cpuinfo.min_freq, | 75 | policy->cpuinfo.min_freq, |
| @@ -78,7 +85,7 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
| 78 | { | 85 | { |
| 79 | cpumask_t cpus_allowed; | 86 | cpumask_t cpus_allowed; |
| 80 | int cpu = policy->cpu; | 87 | int cpu = policy->cpu; |
| 81 | struct icst525_vco vco; | 88 | struct icst_vco vco; |
| 82 | struct cpufreq_freqs freqs; | 89 | struct cpufreq_freqs freqs; |
| 83 | u_int cm_osc; | 90 | u_int cm_osc; |
| 84 | 91 | ||
| @@ -104,17 +111,17 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
| 104 | } | 111 | } |
| 105 | vco.v = cm_osc & 255; | 112 | vco.v = cm_osc & 255; |
| 106 | vco.r = 22; | 113 | vco.r = 22; |
| 107 | freqs.old = icst525_khz(&cclk_params, vco); | 114 | freqs.old = icst_hz(&cclk_params, vco) / 1000; |
| 108 | 115 | ||
| 109 | /* icst525_khz_to_vco rounds down -- so we need the next | 116 | /* icst_hz_to_vco rounds down -- so we need the next |
| 110 | * larger freq in case of CPUFREQ_RELATION_L. | 117 | * larger freq in case of CPUFREQ_RELATION_L. |
| 111 | */ | 118 | */ |
| 112 | if (relation == CPUFREQ_RELATION_L) | 119 | if (relation == CPUFREQ_RELATION_L) |
| 113 | target_freq += 999; | 120 | target_freq += 999; |
| 114 | if (target_freq > policy->max) | 121 | if (target_freq > policy->max) |
| 115 | target_freq = policy->max; | 122 | target_freq = policy->max; |
| 116 | vco = icst525_khz_to_vco(&cclk_params, target_freq); | 123 | vco = icst_hz_to_vco(&cclk_params, target_freq * 1000); |
| 117 | freqs.new = icst525_khz(&cclk_params, vco); | 124 | freqs.new = icst_hz(&cclk_params, vco) / 1000; |
| 118 | 125 | ||
| 119 | freqs.cpu = policy->cpu; | 126 | freqs.cpu = policy->cpu; |
| 120 | 127 | ||
| @@ -154,7 +161,7 @@ static unsigned int integrator_get(unsigned int cpu) | |||
| 154 | cpumask_t cpus_allowed; | 161 | cpumask_t cpus_allowed; |
| 155 | unsigned int current_freq; | 162 | unsigned int current_freq; |
| 156 | u_int cm_osc; | 163 | u_int cm_osc; |
| 157 | struct icst525_vco vco; | 164 | struct icst_vco vco; |
| 158 | 165 | ||
| 159 | cpus_allowed = current->cpus_allowed; | 166 | cpus_allowed = current->cpus_allowed; |
| 160 | 167 | ||
| @@ -172,7 +179,7 @@ static unsigned int integrator_get(unsigned int cpu) | |||
| 172 | vco.v = cm_osc & 255; | 179 | vco.v = cm_osc & 255; |
| 173 | vco.r = 22; | 180 | vco.r = 22; |
| 174 | 181 | ||
| 175 | current_freq = icst525_khz(&cclk_params, vco); /* current freq */ | 182 | current_freq = icst_hz(&cclk_params, vco) / 1000; /* current freq */ |
| 176 | 183 | ||
| 177 | set_cpus_allowed(current, cpus_allowed); | 184 | set_cpus_allowed(current, cpus_allowed); |
| 178 | 185 | ||
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 41b10725cef7..fd684bf205e5 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | #include <asm/clkdev.h> | 26 | #include <asm/clkdev.h> |
| 27 | #include <mach/clkdev.h> | 27 | #include <mach/clkdev.h> |
| 28 | #include <asm/hardware/icst525.h> | 28 | #include <asm/hardware/icst.h> |
| 29 | #include <mach/lm.h> | 29 | #include <mach/lm.h> |
| 30 | #include <mach/impd1.h> | 30 | #include <mach/impd1.h> |
| 31 | #include <asm/sizes.h> | 31 | #include <asm/sizes.h> |
| @@ -41,32 +41,25 @@ struct impd1_module { | |||
| 41 | struct clk_lookup *clks[3]; | 41 | struct clk_lookup *clks[3]; |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | static const struct icst525_params impd1_vco_params = { | 44 | static const struct icst_params impd1_vco_params = { |
| 45 | .ref = 24000, /* 24 MHz */ | 45 | .ref = 24000000, /* 24 MHz */ |
| 46 | .vco_max = 200000, /* 200 MHz */ | 46 | .vco_max = ICST525_VCO_MAX_3V, |
| 47 | .vco_min = ICST525_VCO_MIN, | ||
| 47 | .vd_min = 12, | 48 | .vd_min = 12, |
| 48 | .vd_max = 519, | 49 | .vd_max = 519, |
| 49 | .rd_min = 3, | 50 | .rd_min = 3, |
| 50 | .rd_max = 120, | 51 | .rd_max = 120, |
| 52 | .s2div = icst525_s2div, | ||
| 53 | .idx2s = icst525_idx2s, | ||
| 51 | }; | 54 | }; |
| 52 | 55 | ||
| 53 | static void impd1_setvco(struct clk *clk, struct icst525_vco vco) | 56 | static void impd1_setvco(struct clk *clk, struct icst_vco vco) |
| 54 | { | 57 | { |
| 55 | struct impd1_module *impd1 = clk->data; | 58 | struct impd1_module *impd1 = clk->data; |
| 56 | int vconr = clk - impd1->vcos; | 59 | u32 val = vco.v | (vco.r << 9) | (vco.s << 16); |
| 57 | u32 val; | ||
| 58 | |||
| 59 | val = vco.v | (vco.r << 9) | (vco.s << 16); | ||
| 60 | 60 | ||
| 61 | writel(0xa05f, impd1->base + IMPD1_LOCK); | 61 | writel(0xa05f, impd1->base + IMPD1_LOCK); |
| 62 | switch (vconr) { | 62 | writel(val, clk->vcoreg); |
| 63 | case 0: | ||
| 64 | writel(val, impd1->base + IMPD1_OSC1); | ||
| 65 | break; | ||
| 66 | case 1: | ||
| 67 | writel(val, impd1->base + IMPD1_OSC2); | ||
| 68 | break; | ||
| 69 | } | ||
| 70 | writel(0, impd1->base + IMPD1_LOCK); | 63 | writel(0, impd1->base + IMPD1_LOCK); |
| 71 | 64 | ||
| 72 | #ifdef DEBUG | 65 | #ifdef DEBUG |
| @@ -74,11 +67,17 @@ static void impd1_setvco(struct clk *clk, struct icst525_vco vco) | |||
| 74 | vco.r = (val >> 9) & 0x7f; | 67 | vco.r = (val >> 9) & 0x7f; |
| 75 | vco.s = (val >> 16) & 7; | 68 | vco.s = (val >> 16) & 7; |
| 76 | 69 | ||
| 77 | pr_debug("IM-PD1: VCO%d clock is %ld kHz\n", | 70 | pr_debug("IM-PD1: VCO%d clock is %ld Hz\n", |
| 78 | vconr, icst525_khz(&impd1_vco_params, vco)); | 71 | vconr, icst525_hz(&impd1_vco_params, vco)); |
| 79 | #endif | 72 | #endif |
| 80 | } | 73 | } |
| 81 | 74 | ||
| 75 | static const struct clk_ops impd1_clk_ops = { | ||
| 76 | .round = icst_clk_round, | ||
| 77 | .set = icst_clk_set, | ||
| 78 | .setvco = impd1_setvco, | ||
| 79 | }; | ||
| 80 | |||
| 82 | void impd1_tweak_control(struct device *dev, u32 mask, u32 val) | 81 | void impd1_tweak_control(struct device *dev, u32 mask, u32 val) |
| 83 | { | 82 | { |
| 84 | struct impd1_module *impd1 = dev_get_drvdata(dev); | 83 | struct impd1_module *impd1 = dev_get_drvdata(dev); |
| @@ -374,11 +373,13 @@ static int impd1_probe(struct lm_device *dev) | |||
| 374 | (unsigned long)dev->resource.start); | 373 | (unsigned long)dev->resource.start); |
| 375 | 374 | ||
| 376 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { | 375 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { |
| 376 | impd1->vcos[i].ops = &impd1_clk_ops, | ||
| 377 | impd1->vcos[i].owner = THIS_MODULE, | 377 | impd1->vcos[i].owner = THIS_MODULE, |
| 378 | impd1->vcos[i].params = &impd1_vco_params, | 378 | impd1->vcos[i].params = &impd1_vco_params, |
| 379 | impd1->vcos[i].data = impd1, | 379 | impd1->vcos[i].data = impd1; |
| 380 | impd1->vcos[i].setvco = impd1_setvco; | ||
| 381 | } | 380 | } |
| 381 | impd1->vcos[0].vcoreg = impd1->base + IMPD1_OSC1; | ||
| 382 | impd1->vcos[1].vcoreg = impd1->base + IMPD1_OSC2; | ||
| 382 | 383 | ||
| 383 | impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", | 384 | impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", |
| 384 | dev->id); | 385 | dev->id); |
diff --git a/arch/arm/mach-integrator/include/mach/clkdev.h b/arch/arm/mach-integrator/include/mach/clkdev.h index 9293e410832a..bfe07679faec 100644 --- a/arch/arm/mach-integrator/include/mach/clkdev.h +++ b/arch/arm/mach-integrator/include/mach/clkdev.h | |||
| @@ -2,14 +2,15 @@ | |||
| 2 | #define __ASM_MACH_CLKDEV_H | 2 | #define __ASM_MACH_CLKDEV_H |
| 3 | 3 | ||
| 4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
| 5 | #include <asm/hardware/icst525.h> | 5 | #include <plat/clock.h> |
| 6 | 6 | ||
| 7 | struct clk { | 7 | struct clk { |
| 8 | unsigned long rate; | 8 | unsigned long rate; |
| 9 | const struct clk_ops *ops; | ||
| 9 | struct module *owner; | 10 | struct module *owner; |
| 10 | const struct icst525_params *params; | 11 | const struct icst_params *params; |
| 12 | void __iomem *vcoreg; | ||
| 11 | void *data; | 13 | void *data; |
| 12 | void (*setvco)(struct clk *, struct icst525_vco vco); | ||
| 13 | }; | 14 | }; |
| 14 | 15 | ||
| 15 | static inline int __clk_get(struct clk *clk) | 16 | static inline int __clk_get(struct clk *clk) |
diff --git a/arch/arm/mach-integrator/include/mach/entry-macro.S b/arch/arm/mach-integrator/include/mach/entry-macro.S index 7649c57acb53..3d029c9f3ef6 100644 --- a/arch/arm/mach-integrator/include/mach/entry-macro.S +++ b/arch/arm/mach-integrator/include/mach/entry-macro.S | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
| 9 | */ | 9 | */ |
| 10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
| 11 | #include <mach/platform.h> | ||
| 11 | #include <mach/irqs.h> | 12 | #include <mach/irqs.h> |
| 12 | 13 | ||
| 13 | .macro disable_fiq | 14 | .macro disable_fiq |
diff --git a/arch/arm/mach-integrator/include/mach/hardware.h b/arch/arm/mach-integrator/include/mach/hardware.h index d795642fad22..8e26360ce9a3 100644 --- a/arch/arm/mach-integrator/include/mach/hardware.h +++ b/arch/arm/mach-integrator/include/mach/hardware.h | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #define __ASM_ARCH_HARDWARE_H | 23 | #define __ASM_ARCH_HARDWARE_H |
| 24 | 24 | ||
| 25 | #include <asm/sizes.h> | 25 | #include <asm/sizes.h> |
| 26 | #include <mach/platform.h> | ||
| 27 | 26 | ||
| 28 | /* | 27 | /* |
| 29 | * Where in virtual memory the IO devices (timers, system controllers | 28 | * Where in virtual memory the IO devices (timers, system controllers |
| @@ -36,17 +35,19 @@ | |||
| 36 | #define PCIO_BASE PCI_IO_VADDR | 35 | #define PCIO_BASE PCI_IO_VADDR |
| 37 | #define PCIMEM_BASE PCI_MEMORY_VADDR | 36 | #define PCIMEM_BASE PCI_MEMORY_VADDR |
| 38 | 37 | ||
| 39 | #ifdef CONFIG_MMU | ||
| 40 | /* macro to get at IO space when running virtually */ | ||
| 41 | #define IO_ADDRESS(x) (((x) >> 4) + IO_BASE) | ||
| 42 | #else | ||
| 43 | #define IO_ADDRESS(x) (x) | ||
| 44 | #endif | ||
| 45 | |||
| 46 | #define pcibios_assign_all_busses() 1 | 38 | #define pcibios_assign_all_busses() 1 |
| 47 | 39 | ||
| 48 | #define PCIBIOS_MIN_IO 0x6000 | 40 | #define PCIBIOS_MIN_IO 0x6000 |
| 49 | #define PCIBIOS_MIN_MEM 0x00100000 | 41 | #define PCIBIOS_MIN_MEM 0x00100000 |
| 50 | 42 | ||
| 43 | /* macro to get at IO space when running virtually */ | ||
| 44 | #ifdef CONFIG_MMU | ||
| 45 | #define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE) | ||
| 46 | #else | ||
| 47 | #define IO_ADDRESS(x) (x) | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #define __io_address(n) ((void __iomem *)IO_ADDRESS(n)) | ||
| 51 | |||
| 51 | #endif | 52 | #endif |
| 52 | 53 | ||
diff --git a/arch/arm/mach-integrator/include/mach/platform.h b/arch/arm/mach-integrator/include/mach/platform.h index e00a2624f269..5e6ea5cfea6e 100644 --- a/arch/arm/mach-integrator/include/mach/platform.h +++ b/arch/arm/mach-integrator/include/mach/platform.h | |||
| @@ -23,9 +23,6 @@ | |||
| 23 | * | 23 | * |
| 24 | * Integrator address map | 24 | * Integrator address map |
| 25 | * | 25 | * |
| 26 | * NOTE: This is a multi-hosted header file for use with uHAL and | ||
| 27 | * supported debuggers. | ||
| 28 | * | ||
| 29 | * ***********************************************************************/ | 26 | * ***********************************************************************/ |
| 30 | 27 | ||
| 31 | #ifndef __address_h | 28 | #ifndef __address_h |
| @@ -290,12 +287,14 @@ | |||
| 290 | #define INTEGRATOR_DBG_LEDS (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET) | 287 | #define INTEGRATOR_DBG_LEDS (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET) |
| 291 | #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) | 288 | #define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) |
| 292 | 289 | ||
| 290 | #define INTEGRATOR_AP_GPIO_BASE 0x1B000000 /* GPIO */ | ||
| 293 | 291 | ||
| 294 | #if defined(CONFIG_ARCH_INTEGRATOR_AP) | 292 | #define INTEGRATOR_CP_MMC_BASE 0x1C000000 /* MMC */ |
| 295 | #define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */ | 293 | #define INTEGRATOR_CP_AACI_BASE 0x1D000000 /* AACI */ |
| 296 | #elif defined(CONFIG_ARCH_INTEGRATOR_CP) | 294 | #define INTEGRATOR_CP_ETH_BASE 0xC8000000 /* Ethernet */ |
| 297 | #define INTEGRATOR_GPIO_BASE 0xC9000000 /* GPIO */ | 295 | #define INTEGRATOR_CP_GPIO_BASE 0xC9000000 /* GPIO */ |
| 298 | #endif | 296 | #define INTEGRATOR_CP_SIC_BASE 0xCA000000 /* SIC */ |
| 297 | #define INTEGRATOR_CP_CTL_BASE 0xCB000000 /* CP system control */ | ||
| 299 | 298 | ||
| 300 | /* ------------------------------------------------------------------------ | 299 | /* ------------------------------------------------------------------------ |
| 301 | * KMI keyboard/mouse definitions | 300 | * KMI keyboard/mouse definitions |
| @@ -328,20 +327,6 @@ | |||
| 328 | */ | 327 | */ |
| 329 | #define PHYS_PCI_V3_BASE 0x62000000 | 328 | #define PHYS_PCI_V3_BASE 0x62000000 |
| 330 | 329 | ||
| 331 | #define PCI_DRAMSIZE INTEGRATOR_SSRAM_SIZE | ||
| 332 | |||
| 333 | /* 'export' these to UHAL */ | ||
| 334 | #define UHAL_PCI_IO PCI_IO_BASE | ||
| 335 | #define UHAL_PCI_MEM PCI_MEM_BASE | ||
| 336 | #define UHAL_PCI_ALLOC_IO_BASE 0x00004000 | ||
| 337 | #define UHAL_PCI_ALLOC_MEM_BASE PCI_MEM_BASE | ||
| 338 | #define UHAL_PCI_MAX_SLOT 20 | ||
| 339 | |||
| 340 | /* ======================================================================== | ||
| 341 | * Start of uHAL definitions | ||
| 342 | * ======================================================================== | ||
| 343 | */ | ||
| 344 | |||
| 345 | /* ------------------------------------------------------------------------ | 330 | /* ------------------------------------------------------------------------ |
| 346 | * Integrator Interrupt Controllers | 331 | * Integrator Interrupt Controllers |
| 347 | * ------------------------------------------------------------------------ | 332 | * ------------------------------------------------------------------------ |
| @@ -389,7 +374,7 @@ | |||
| 389 | */ | 374 | */ |
| 390 | 375 | ||
| 391 | /* ------------------------------------------------------------------------ | 376 | /* ------------------------------------------------------------------------ |
| 392 | * LED's - The header LED is not accessible via the uHAL API | 377 | * LED's |
| 393 | * ------------------------------------------------------------------------ | 378 | * ------------------------------------------------------------------------ |
| 394 | * | 379 | * |
| 395 | */ | 380 | */ |
| @@ -402,34 +387,18 @@ | |||
| 402 | #define LED_BANK INTEGRATOR_DBG_LEDS | 387 | #define LED_BANK INTEGRATOR_DBG_LEDS |
| 403 | 388 | ||
| 404 | /* | 389 | /* |
| 405 | * Memory definitions - run uHAL out of SSRAM. | ||
| 406 | * | ||
| 407 | */ | ||
| 408 | #define uHAL_MEMORY_SIZE INTEGRATOR_SSRAM_SIZE | ||
| 409 | |||
| 410 | /* | ||
| 411 | * Clean base - dummy | ||
| 412 | * | ||
| 413 | */ | ||
| 414 | #define CLEAN_BASE INTEGRATOR_BOOT_ROM_HI | ||
| 415 | |||
| 416 | /* | ||
| 417 | * Timer definitions | 390 | * Timer definitions |
| 418 | * | 391 | * |
| 419 | * Only use timer 1 & 2 | 392 | * Only use timer 1 & 2 |
| 420 | * (both run at 24MHz and will need the clock divider set to 16). | 393 | * (both run at 24MHz and will need the clock divider set to 16). |
| 421 | * | 394 | * |
| 422 | * Timer 0 runs at bus frequency and therefore could vary and currently | 395 | * Timer 0 runs at bus frequency |
| 423 | * uHAL can't handle that. | ||
| 424 | * | ||
| 425 | */ | 396 | */ |
| 426 | 397 | ||
| 427 | #define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE | 398 | #define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE |
| 428 | #define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100) | 399 | #define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100) |
| 429 | #define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200) | 400 | #define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200) |
| 430 | 401 | ||
| 431 | #define MAX_TIMER 2 | ||
| 432 | #define MAX_PERIOD 699050 | ||
| 433 | #define TICKS_PER_uSEC 24 | 402 | #define TICKS_PER_uSEC 24 |
| 434 | 403 | ||
| 435 | /* | 404 | /* |
| @@ -437,14 +406,9 @@ | |||
| 437 | * | 406 | * |
| 438 | */ | 407 | */ |
| 439 | #define mSEC_1 1000 | 408 | #define mSEC_1 1000 |
| 440 | #define mSEC_5 (mSEC_1 * 5) | ||
| 441 | #define mSEC_10 (mSEC_1 * 10) | 409 | #define mSEC_10 (mSEC_1 * 10) |
| 442 | #define mSEC_25 (mSEC_1 * 25) | ||
| 443 | #define SEC_1 (mSEC_1 * 1000) | ||
| 444 | 410 | ||
| 445 | #define INTEGRATOR_CSR_BASE 0x10000000 | 411 | #define INTEGRATOR_CSR_BASE 0x10000000 |
| 446 | #define INTEGRATOR_CSR_SIZE 0x10000000 | 412 | #define INTEGRATOR_CSR_SIZE 0x10000000 |
| 447 | 413 | ||
| 448 | #endif | 414 | #endif |
| 449 | |||
| 450 | /* END */ | ||
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 8138a7e24562..227cf4d05088 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
| @@ -27,9 +27,14 @@ | |||
| 27 | #include <linux/sysdev.h> | 27 | #include <linux/sysdev.h> |
| 28 | #include <linux/amba/bus.h> | 28 | #include <linux/amba/bus.h> |
| 29 | #include <linux/amba/kmi.h> | 29 | #include <linux/amba/kmi.h> |
| 30 | #include <linux/clocksource.h> | ||
| 31 | #include <linux/clockchips.h> | ||
| 32 | #include <linux/interrupt.h> | ||
| 30 | #include <linux/io.h> | 33 | #include <linux/io.h> |
| 31 | 34 | ||
| 32 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
| 36 | #include <mach/platform.h> | ||
| 37 | #include <asm/hardware/arm_timer.h> | ||
| 33 | #include <asm/irq.h> | 38 | #include <asm/irq.h> |
| 34 | #include <asm/setup.h> | 39 | #include <asm/setup.h> |
| 35 | #include <asm/param.h> /* HZ */ | 40 | #include <asm/param.h> /* HZ */ |
| @@ -43,8 +48,6 @@ | |||
| 43 | #include <asm/mach/map.h> | 48 | #include <asm/mach/map.h> |
| 44 | #include <asm/mach/time.h> | 49 | #include <asm/mach/time.h> |
| 45 | 50 | ||
| 46 | #include "common.h" | ||
| 47 | |||
| 48 | /* | 51 | /* |
| 49 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx | 52 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx |
| 50 | * is the (PA >> 12). | 53 | * is the (PA >> 12). |
| @@ -55,7 +58,7 @@ | |||
| 55 | #define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) | 58 | #define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) |
| 56 | #define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE) | 59 | #define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE) |
| 57 | #define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE) | 60 | #define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE) |
| 58 | #define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_IC_OFFSET | 61 | #define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_IC) |
| 59 | 62 | ||
| 60 | /* | 63 | /* |
| 61 | * Logical Physical | 64 | * Logical Physical |
| @@ -117,8 +120,8 @@ static struct map_desc ap_io_desc[] __initdata = { | |||
| 117 | .length = SZ_4K, | 120 | .length = SZ_4K, |
| 118 | .type = MT_DEVICE | 121 | .type = MT_DEVICE |
| 119 | }, { | 122 | }, { |
| 120 | .virtual = IO_ADDRESS(INTEGRATOR_GPIO_BASE), | 123 | .virtual = IO_ADDRESS(INTEGRATOR_AP_GPIO_BASE), |
| 121 | .pfn = __phys_to_pfn(INTEGRATOR_GPIO_BASE), | 124 | .pfn = __phys_to_pfn(INTEGRATOR_AP_GPIO_BASE), |
| 122 | .length = SZ_4K, | 125 | .length = SZ_4K, |
| 123 | .type = MT_DEVICE | 126 | .type = MT_DEVICE |
| 124 | }, { | 127 | }, { |
| @@ -334,14 +337,163 @@ static void __init ap_init(void) | |||
| 334 | } | 337 | } |
| 335 | } | 338 | } |
| 336 | 339 | ||
| 340 | /* | ||
| 341 | * Where is the timer (VA)? | ||
| 342 | */ | ||
| 343 | #define TIMER0_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER0_BASE) | ||
| 344 | #define TIMER1_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER1_BASE) | ||
| 345 | #define TIMER2_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER2_BASE) | ||
| 346 | |||
| 347 | /* | ||
| 348 | * How long is the timer interval? | ||
| 349 | */ | ||
| 350 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
| 351 | #if TIMER_INTERVAL >= 0x100000 | ||
| 352 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
| 353 | #elif TIMER_INTERVAL >= 0x10000 | ||
| 354 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
| 355 | #else | ||
| 356 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
| 357 | #endif | ||
| 358 | |||
| 359 | static unsigned long timer_reload; | ||
| 360 | |||
| 361 | static void __iomem * const clksrc_base = (void __iomem *)TIMER2_VA_BASE; | ||
| 362 | |||
| 363 | static cycle_t timersp_read(struct clocksource *cs) | ||
| 364 | { | ||
| 365 | return ~(readl(clksrc_base + TIMER_VALUE) & 0xffff); | ||
| 366 | } | ||
| 367 | |||
| 368 | static struct clocksource clocksource_timersp = { | ||
| 369 | .name = "timer2", | ||
| 370 | .rating = 200, | ||
| 371 | .read = timersp_read, | ||
| 372 | .mask = CLOCKSOURCE_MASK(16), | ||
| 373 | .shift = 16, | ||
| 374 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
| 375 | }; | ||
| 376 | |||
| 377 | static void integrator_clocksource_init(u32 khz) | ||
| 378 | { | ||
| 379 | struct clocksource *cs = &clocksource_timersp; | ||
| 380 | void __iomem *base = clksrc_base; | ||
| 381 | u32 ctrl = TIMER_CTRL_ENABLE; | ||
| 382 | |||
| 383 | if (khz >= 1500) { | ||
| 384 | khz /= 16; | ||
| 385 | ctrl = TIMER_CTRL_DIV16; | ||
| 386 | } | ||
| 387 | |||
| 388 | writel(ctrl, base + TIMER_CTRL); | ||
| 389 | writel(0xffff, base + TIMER_LOAD); | ||
| 390 | |||
| 391 | cs->mult = clocksource_khz2mult(khz, cs->shift); | ||
| 392 | clocksource_register(cs); | ||
| 393 | } | ||
| 394 | |||
| 395 | static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; | ||
| 396 | |||
| 397 | /* | ||
| 398 | * IRQ handler for the timer | ||
| 399 | */ | ||
| 400 | static irqreturn_t integrator_timer_interrupt(int irq, void *dev_id) | ||
| 401 | { | ||
| 402 | struct clock_event_device *evt = dev_id; | ||
| 403 | |||
| 404 | /* clear the interrupt */ | ||
| 405 | writel(1, clkevt_base + TIMER_INTCLR); | ||
| 406 | |||
| 407 | evt->event_handler(evt); | ||
| 408 | |||
| 409 | return IRQ_HANDLED; | ||
| 410 | } | ||
| 411 | |||
| 412 | static void clkevt_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) | ||
| 413 | { | ||
| 414 | u32 ctrl = readl(clkevt_base + TIMER_CTRL) & ~TIMER_CTRL_ENABLE; | ||
| 415 | |||
| 416 | BUG_ON(mode == CLOCK_EVT_MODE_ONESHOT); | ||
| 417 | |||
| 418 | if (mode == CLOCK_EVT_MODE_PERIODIC) { | ||
| 419 | writel(ctrl, clkevt_base + TIMER_CTRL); | ||
| 420 | writel(timer_reload, clkevt_base + TIMER_LOAD); | ||
| 421 | ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE; | ||
| 422 | } | ||
| 423 | |||
| 424 | writel(ctrl, clkevt_base + TIMER_CTRL); | ||
| 425 | } | ||
| 426 | |||
| 427 | static int clkevt_set_next_event(unsigned long next, struct clock_event_device *evt) | ||
| 428 | { | ||
| 429 | unsigned long ctrl = readl(clkevt_base + TIMER_CTRL); | ||
| 430 | |||
| 431 | writel(ctrl & ~TIMER_CTRL_ENABLE, clkevt_base + TIMER_CTRL); | ||
| 432 | writel(next, clkevt_base + TIMER_LOAD); | ||
| 433 | writel(ctrl | TIMER_CTRL_ENABLE, clkevt_base + TIMER_CTRL); | ||
| 434 | |||
| 435 | return 0; | ||
| 436 | } | ||
| 437 | |||
| 438 | static struct clock_event_device integrator_clockevent = { | ||
| 439 | .name = "timer1", | ||
| 440 | .shift = 34, | ||
| 441 | .features = CLOCK_EVT_FEAT_PERIODIC, | ||
| 442 | .set_mode = clkevt_set_mode, | ||
| 443 | .set_next_event = clkevt_set_next_event, | ||
| 444 | .rating = 300, | ||
| 445 | .cpumask = cpu_all_mask, | ||
| 446 | }; | ||
| 447 | |||
| 448 | static struct irqaction integrator_timer_irq = { | ||
| 449 | .name = "timer", | ||
| 450 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
| 451 | .handler = integrator_timer_interrupt, | ||
| 452 | .dev_id = &integrator_clockevent, | ||
| 453 | }; | ||
| 454 | |||
| 455 | static void integrator_clockevent_init(u32 khz) | ||
| 456 | { | ||
| 457 | struct clock_event_device *evt = &integrator_clockevent; | ||
| 458 | unsigned int ctrl = 0; | ||
| 459 | |||
| 460 | if (khz * 1000 > 0x100000 * HZ) { | ||
| 461 | khz /= 256; | ||
| 462 | ctrl |= TIMER_CTRL_DIV256; | ||
| 463 | } else if (khz * 1000 > 0x10000 * HZ) { | ||
| 464 | khz /= 16; | ||
| 465 | ctrl |= TIMER_CTRL_DIV16; | ||
| 466 | } | ||
| 467 | |||
| 468 | timer_reload = khz * 1000 / HZ; | ||
| 469 | writel(ctrl, clkevt_base + TIMER_CTRL); | ||
| 470 | |||
| 471 | evt->irq = IRQ_TIMERINT1; | ||
| 472 | evt->mult = div_sc(khz, NSEC_PER_MSEC, evt->shift); | ||
| 473 | evt->max_delta_ns = clockevent_delta2ns(0xffff, evt); | ||
| 474 | evt->min_delta_ns = clockevent_delta2ns(0xf, evt); | ||
| 475 | |||
| 476 | setup_irq(IRQ_TIMERINT1, &integrator_timer_irq); | ||
| 477 | clockevents_register_device(evt); | ||
| 478 | } | ||
| 479 | |||
| 480 | /* | ||
| 481 | * Set up timer(s). | ||
| 482 | */ | ||
| 337 | static void __init ap_init_timer(void) | 483 | static void __init ap_init_timer(void) |
| 338 | { | 484 | { |
| 339 | integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, 0); | 485 | u32 khz = TICKS_PER_uSEC * 1000; |
| 486 | |||
| 487 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); | ||
| 488 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); | ||
| 489 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | ||
| 490 | |||
| 491 | integrator_clocksource_init(khz); | ||
| 492 | integrator_clockevent_init(khz); | ||
| 340 | } | 493 | } |
| 341 | 494 | ||
| 342 | static struct sys_timer ap_timer = { | 495 | static struct sys_timer ap_timer = { |
| 343 | .init = ap_init_timer, | 496 | .init = ap_init_timer, |
| 344 | .offset = integrator_gettimeoffset, | ||
| 345 | }; | 497 | }; |
| 346 | 498 | ||
| 347 | MACHINE_START(INTEGRATOR, "ARM-Integrator") | 499 | MACHINE_START(INTEGRATOR, "ARM-Integrator") |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 15e6cc5a352f..cde57b2b83b5 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
| @@ -25,10 +25,12 @@ | |||
| 25 | #include <asm/clkdev.h> | 25 | #include <asm/clkdev.h> |
| 26 | #include <mach/clkdev.h> | 26 | #include <mach/clkdev.h> |
| 27 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
| 28 | #include <mach/platform.h> | ||
| 28 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
| 29 | #include <asm/setup.h> | 30 | #include <asm/setup.h> |
| 30 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
| 31 | #include <asm/hardware/icst525.h> | 32 | #include <asm/hardware/arm_timer.h> |
| 33 | #include <asm/hardware/icst.h> | ||
| 32 | 34 | ||
| 33 | #include <mach/cm.h> | 35 | #include <mach/cm.h> |
| 34 | #include <mach/lm.h> | 36 | #include <mach/lm.h> |
| @@ -39,24 +41,20 @@ | |||
| 39 | #include <asm/mach/map.h> | 41 | #include <asm/mach/map.h> |
| 40 | #include <asm/mach/time.h> | 42 | #include <asm/mach/time.h> |
| 41 | 43 | ||
| 42 | #include "common.h" | 44 | #include <plat/timer-sp.h> |
| 43 | |||
| 44 | #define INTCP_PA_MMC_BASE 0x1c000000 | ||
| 45 | #define INTCP_PA_AACI_BASE 0x1d000000 | ||
| 46 | 45 | ||
| 47 | #define INTCP_PA_FLASH_BASE 0x24000000 | 46 | #define INTCP_PA_FLASH_BASE 0x24000000 |
| 48 | #define INTCP_FLASH_SIZE SZ_32M | 47 | #define INTCP_FLASH_SIZE SZ_32M |
| 49 | 48 | ||
| 50 | #define INTCP_PA_CLCD_BASE 0xc0000000 | 49 | #define INTCP_PA_CLCD_BASE 0xc0000000 |
| 51 | 50 | ||
| 52 | #define INTCP_VA_CIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + 0x40 | 51 | #define INTCP_VA_CIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x40) |
| 53 | #define INTCP_VA_PIC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) | 52 | #define INTCP_VA_PIC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) |
| 54 | #define INTCP_VA_SIC_BASE IO_ADDRESS(0xca000000) | 53 | #define INTCP_VA_SIC_BASE IO_ADDRESS(INTEGRATOR_CP_SIC_BASE) |
| 55 | 54 | ||
| 56 | #define INTCP_PA_ETH_BASE 0xc8000000 | ||
| 57 | #define INTCP_ETH_SIZE 0x10 | 55 | #define INTCP_ETH_SIZE 0x10 |
| 58 | 56 | ||
| 59 | #define INTCP_VA_CTRL_BASE IO_ADDRESS(0xcb000000) | 57 | #define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE) |
| 60 | #define INTCP_FLASHPROG 0x04 | 58 | #define INTCP_FLASHPROG 0x04 |
| 61 | #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) | 59 | #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) |
| 62 | #define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) | 60 | #define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) |
| @@ -71,7 +69,9 @@ | |||
| 71 | * f1600000 16000000 UART 0 | 69 | * f1600000 16000000 UART 0 |
| 72 | * f1700000 17000000 UART 1 | 70 | * f1700000 17000000 UART 1 |
| 73 | * f1a00000 1a000000 Debug LEDs | 71 | * f1a00000 1a000000 Debug LEDs |
| 74 | * f1b00000 1b000000 GPIO | 72 | * fc900000 c9000000 GPIO |
| 73 | * fca00000 ca000000 SIC | ||
| 74 | * fcb00000 cb000000 CP system control | ||
| 75 | */ | 75 | */ |
| 76 | 76 | ||
| 77 | static struct map_desc intcp_io_desc[] __initdata = { | 77 | static struct map_desc intcp_io_desc[] __initdata = { |
| @@ -116,18 +116,18 @@ static struct map_desc intcp_io_desc[] __initdata = { | |||
| 116 | .length = SZ_4K, | 116 | .length = SZ_4K, |
| 117 | .type = MT_DEVICE | 117 | .type = MT_DEVICE |
| 118 | }, { | 118 | }, { |
| 119 | .virtual = IO_ADDRESS(INTEGRATOR_GPIO_BASE), | 119 | .virtual = IO_ADDRESS(INTEGRATOR_CP_GPIO_BASE), |
| 120 | .pfn = __phys_to_pfn(INTEGRATOR_GPIO_BASE), | 120 | .pfn = __phys_to_pfn(INTEGRATOR_CP_GPIO_BASE), |
| 121 | .length = SZ_4K, | 121 | .length = SZ_4K, |
| 122 | .type = MT_DEVICE | 122 | .type = MT_DEVICE |
| 123 | }, { | 123 | }, { |
| 124 | .virtual = IO_ADDRESS(0xca000000), | 124 | .virtual = IO_ADDRESS(INTEGRATOR_CP_SIC_BASE), |
| 125 | .pfn = __phys_to_pfn(0xca000000), | 125 | .pfn = __phys_to_pfn(INTEGRATOR_CP_SIC_BASE), |
| 126 | .length = SZ_4K, | 126 | .length = SZ_4K, |
| 127 | .type = MT_DEVICE | 127 | .type = MT_DEVICE |
| 128 | }, { | 128 | }, { |
| 129 | .virtual = IO_ADDRESS(0xcb000000), | 129 | .virtual = IO_ADDRESS(INTEGRATOR_CP_CTL_BASE), |
| 130 | .pfn = __phys_to_pfn(0xcb000000), | 130 | .pfn = __phys_to_pfn(INTEGRATOR_CP_CTL_BASE), |
| 131 | .length = SZ_4K, | 131 | .length = SZ_4K, |
| 132 | .type = MT_DEVICE | 132 | .type = MT_DEVICE |
| 133 | } | 133 | } |
| @@ -266,33 +266,43 @@ static void __init intcp_init_irq(void) | |||
| 266 | /* | 266 | /* |
| 267 | * Clock handling | 267 | * Clock handling |
| 268 | */ | 268 | */ |
| 269 | #define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) | 269 | #define CM_LOCK (__io_address(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) |
| 270 | #define CM_AUXOSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+0x1c) | 270 | #define CM_AUXOSC (__io_address(INTEGRATOR_HDR_BASE)+0x1c) |
| 271 | 271 | ||
| 272 | static const struct icst525_params cp_auxvco_params = { | 272 | static const struct icst_params cp_auxvco_params = { |
| 273 | .ref = 24000, | 273 | .ref = 24000000, |
| 274 | .vco_max = 320000, | 274 | .vco_max = ICST525_VCO_MAX_5V, |
| 275 | .vco_min = ICST525_VCO_MIN, | ||
| 275 | .vd_min = 8, | 276 | .vd_min = 8, |
| 276 | .vd_max = 263, | 277 | .vd_max = 263, |
| 277 | .rd_min = 3, | 278 | .rd_min = 3, |
| 278 | .rd_max = 65, | 279 | .rd_max = 65, |
| 280 | .s2div = icst525_s2div, | ||
| 281 | .idx2s = icst525_idx2s, | ||
| 279 | }; | 282 | }; |
| 280 | 283 | ||
| 281 | static void cp_auxvco_set(struct clk *clk, struct icst525_vco vco) | 284 | static void cp_auxvco_set(struct clk *clk, struct icst_vco vco) |
| 282 | { | 285 | { |
| 283 | u32 val; | 286 | u32 val; |
| 284 | 287 | ||
| 285 | val = readl(CM_AUXOSC) & ~0x7ffff; | 288 | val = readl(clk->vcoreg) & ~0x7ffff; |
| 286 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 289 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
| 287 | 290 | ||
| 288 | writel(0xa05f, CM_LOCK); | 291 | writel(0xa05f, CM_LOCK); |
| 289 | writel(val, CM_AUXOSC); | 292 | writel(val, clk->vcoreg); |
| 290 | writel(0, CM_LOCK); | 293 | writel(0, CM_LOCK); |
| 291 | } | 294 | } |
| 292 | 295 | ||
| 296 | static const struct clk_ops cp_auxclk_ops = { | ||
| 297 | .round = icst_clk_round, | ||
| 298 | .set = icst_clk_set, | ||
| 299 | .setvco = cp_auxvco_set, | ||
| 300 | }; | ||
| 301 | |||
| 293 | static struct clk cp_auxclk = { | 302 | static struct clk cp_auxclk = { |
| 303 | .ops = &cp_auxclk_ops, | ||
| 294 | .params = &cp_auxvco_params, | 304 | .params = &cp_auxvco_params, |
| 295 | .setvco = cp_auxvco_set, | 305 | .vcoreg = CM_AUXOSC, |
| 296 | }; | 306 | }; |
| 297 | 307 | ||
| 298 | static struct clk_lookup cp_lookups[] = { | 308 | static struct clk_lookup cp_lookups[] = { |
| @@ -363,8 +373,8 @@ static struct platform_device intcp_flash_device = { | |||
| 363 | 373 | ||
| 364 | static struct resource smc91x_resources[] = { | 374 | static struct resource smc91x_resources[] = { |
| 365 | [0] = { | 375 | [0] = { |
| 366 | .start = INTCP_PA_ETH_BASE, | 376 | .start = INTEGRATOR_CP_ETH_BASE, |
| 367 | .end = INTCP_PA_ETH_BASE + INTCP_ETH_SIZE - 1, | 377 | .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1, |
| 368 | .flags = IORESOURCE_MEM, | 378 | .flags = IORESOURCE_MEM, |
| 369 | }, | 379 | }, |
| 370 | [1] = { | 380 | [1] = { |
| @@ -394,8 +404,8 @@ static struct platform_device *intcp_devs[] __initdata = { | |||
| 394 | */ | 404 | */ |
| 395 | static unsigned int mmc_status(struct device *dev) | 405 | static unsigned int mmc_status(struct device *dev) |
| 396 | { | 406 | { |
| 397 | unsigned int status = readl(IO_ADDRESS(0xca000000) + 4); | 407 | unsigned int status = readl(IO_ADDRESS(0xca000000 + 4)); |
| 398 | writel(8, IO_ADDRESS(0xcb000000) + 8); | 408 | writel(8, IO_ADDRESS(INTEGRATOR_CP_CTL_BASE + 8)); |
| 399 | 409 | ||
| 400 | return status & 8; | 410 | return status & 8; |
| 401 | } | 411 | } |
| @@ -413,8 +423,8 @@ static struct amba_device mmc_device = { | |||
| 413 | .platform_data = &mmc_data, | 423 | .platform_data = &mmc_data, |
| 414 | }, | 424 | }, |
| 415 | .res = { | 425 | .res = { |
| 416 | .start = INTCP_PA_MMC_BASE, | 426 | .start = INTEGRATOR_CP_MMC_BASE, |
| 417 | .end = INTCP_PA_MMC_BASE + SZ_4K - 1, | 427 | .end = INTEGRATOR_CP_MMC_BASE + SZ_4K - 1, |
| 418 | .flags = IORESOURCE_MEM, | 428 | .flags = IORESOURCE_MEM, |
| 419 | }, | 429 | }, |
| 420 | .irq = { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }, | 430 | .irq = { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }, |
| @@ -426,8 +436,8 @@ static struct amba_device aaci_device = { | |||
| 426 | .init_name = "mb:1d", | 436 | .init_name = "mb:1d", |
| 427 | }, | 437 | }, |
| 428 | .res = { | 438 | .res = { |
| 429 | .start = INTCP_PA_AACI_BASE, | 439 | .start = INTEGRATOR_CP_AACI_BASE, |
| 430 | .end = INTCP_PA_AACI_BASE + SZ_4K - 1, | 440 | .end = INTEGRATOR_CP_AACI_BASE + SZ_4K - 1, |
| 431 | .flags = IORESOURCE_MEM, | 441 | .flags = IORESOURCE_MEM, |
| 432 | }, | 442 | }, |
| 433 | .irq = { IRQ_CP_AACIINT, NO_IRQ }, | 443 | .irq = { IRQ_CP_AACIINT, NO_IRQ }, |
| @@ -567,16 +577,22 @@ static void __init intcp_init(void) | |||
| 567 | } | 577 | } |
| 568 | } | 578 | } |
| 569 | 579 | ||
| 570 | #define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */ | 580 | #define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE) |
| 581 | #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE) | ||
| 582 | #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE) | ||
| 571 | 583 | ||
| 572 | static void __init intcp_timer_init(void) | 584 | static void __init intcp_timer_init(void) |
| 573 | { | 585 | { |
| 574 | integrator_time_init(1000000 / HZ, TIMER_CTRL_IE); | 586 | writel(0, TIMER0_VA_BASE + TIMER_CTRL); |
| 587 | writel(0, TIMER1_VA_BASE + TIMER_CTRL); | ||
| 588 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | ||
| 589 | |||
| 590 | sp804_clocksource_init(TIMER2_VA_BASE); | ||
| 591 | sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1); | ||
| 575 | } | 592 | } |
| 576 | 593 | ||
| 577 | static struct sys_timer cp_timer = { | 594 | static struct sys_timer cp_timer = { |
| 578 | .init = intcp_timer_init, | 595 | .init = intcp_timer_init, |
| 579 | .offset = integrator_gettimeoffset, | ||
| 580 | }; | 596 | }; |
| 581 | 597 | ||
| 582 | MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") | 598 | MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") |
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c index 8dcc823f4135..28be186adb89 100644 --- a/arch/arm/mach-integrator/leds.c +++ b/arch/arm/mach-integrator/leds.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
| 28 | 28 | ||
| 29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
| 30 | #include <mach/platform.h> | ||
| 30 | #include <asm/leds.h> | 31 | #include <asm/leds.h> |
| 31 | #include <asm/system.h> | 32 | #include <asm/system.h> |
| 32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index ffbd349363af..9cef0590d5aa 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
| 30 | 30 | ||
| 31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
| 32 | #include <mach/platform.h> | ||
| 32 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
| 33 | #include <asm/signal.h> | 34 | #include <asm/signal.h> |
| 34 | #include <asm/system.h> | 35 | #include <asm/system.h> |
| @@ -389,9 +390,9 @@ static int __init pci_v3_setup_resources(struct resource **resource) | |||
| 389 | * means I can't get additional information on the reason for the pm2fb | 390 | * means I can't get additional information on the reason for the pm2fb |
| 390 | * problems. I suppose I'll just have to mind-meld with the machine. ;) | 391 | * problems. I suppose I'll just have to mind-meld with the machine. ;) |
| 391 | */ | 392 | */ |
| 392 | #define SC_PCI (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_PCIENABLE_OFFSET) | 393 | #define SC_PCI IO_ADDRESS(INTEGRATOR_SC_PCIENABLE) |
| 393 | #define SC_LBFADDR (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x20) | 394 | #define SC_LBFADDR IO_ADDRESS(INTEGRATOR_SC_BASE + 0x20) |
| 394 | #define SC_LBFCODE (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x24) | 395 | #define SC_LBFCODE IO_ADDRESS(INTEGRATOR_SC_BASE + 0x24) |
| 395 | 396 | ||
| 396 | static int | 397 | static int |
| 397 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | 398 | v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) |
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c index 5d99039286eb..f108a31afc2b 100644 --- a/arch/arm/mach-iop32x/n2100.c +++ b/arch/arm/mach-iop32x/n2100.c | |||
| @@ -176,7 +176,7 @@ static struct plat_serial8250_port n2100_serial_port[] = { | |||
| 176 | .mapbase = N2100_UART, | 176 | .mapbase = N2100_UART, |
| 177 | .membase = (char *)N2100_UART, | 177 | .membase = (char *)N2100_UART, |
| 178 | .irq = 0, | 178 | .irq = 0, |
| 179 | .flags = UPF_SKIP_TEST, | 179 | .flags = UPF_SKIP_TEST | UPF_AUTO_IRQ | UPF_SHARE_IRQ, |
| 180 | .iotype = UPIO_MEM, | 180 | .iotype = UPIO_MEM, |
| 181 | .regshift = 0, | 181 | .regshift = 0, |
| 182 | .uartclk = 1843200, | 182 | .uartclk = 1843200, |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 71728d36d501..0bce09799d18 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/tty.h> | 21 | #include <linux/tty.h> |
| 22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
| 23 | #include <linux/serial_core.h> | 23 | #include <linux/serial_core.h> |
| 24 | #include <linux/bootmem.h> | ||
| 25 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
| 26 | #include <linux/bitops.h> | 25 | #include <linux/bitops.h> |
| 27 | #include <linux/time.h> | 26 | #include <linux/time.h> |
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig index 3c5e0f522e9c..71f3ea623974 100644 --- a/arch/arm/mach-nomadik/Kconfig +++ b/arch/arm/mach-nomadik/Kconfig | |||
| @@ -6,6 +6,7 @@ config MACH_NOMADIK_8815NHK | |||
| 6 | bool "ST 8815 Nomadik Hardware Kit (evaluation board)" | 6 | bool "ST 8815 Nomadik Hardware Kit (evaluation board)" |
| 7 | select NOMADIK_8815 | 7 | select NOMADIK_8815 |
| 8 | select HAS_MTU | 8 | select HAS_MTU |
| 9 | select NOMADIK_GPIO | ||
| 9 | 10 | ||
| 10 | endmenu | 11 | endmenu |
| 11 | 12 | ||
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile index 36f67fb207d2..a6bbd1a7b4e7 100644 --- a/arch/arm/mach-nomadik/Makefile +++ b/arch/arm/mach-nomadik/Makefile | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | # Object file lists. | 8 | # Object file lists. |
| 9 | 9 | ||
| 10 | obj-y += clock.o gpio.o | 10 | obj-y += clock.o |
| 11 | 11 | ||
| 12 | # Cpu revision | 12 | # Cpu revision |
| 13 | obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o | 13 | obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o |
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index ab3712c86d2b..841d459ad59d 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c | |||
| @@ -32,7 +32,6 @@ | |||
| 32 | #include <mach/setup.h> | 32 | #include <mach/setup.h> |
| 33 | #include <mach/nand.h> | 33 | #include <mach/nand.h> |
| 34 | #include <mach/fsmc.h> | 34 | #include <mach/fsmc.h> |
| 35 | #include "clock.h" | ||
| 36 | 35 | ||
| 37 | /* Initial value for SRC control register: all timers use MXTAL/8 source */ | 36 | /* Initial value for SRC control register: all timers use MXTAL/8 source */ |
| 38 | #define SRC_CR_INIT_MASK 0x00007fff | 37 | #define SRC_CR_INIT_MASK 0x00007fff |
| @@ -202,11 +201,6 @@ static struct amba_device *amba_devs[] __initdata = { | |||
| 202 | &uart1_device, | 201 | &uart1_device, |
| 203 | }; | 202 | }; |
| 204 | 203 | ||
| 205 | /* We have a fixed clock alone, by now */ | ||
| 206 | static struct clk nhk8815_clk_48 = { | ||
| 207 | .rate = 48*1000*1000, | ||
| 208 | }; | ||
| 209 | |||
| 210 | static struct resource nhk8815_eth_resources[] = { | 204 | static struct resource nhk8815_eth_resources[] = { |
| 211 | { | 205 | { |
| 212 | .name = "smc91x-regs", | 206 | .name = "smc91x-regs", |
| @@ -276,10 +270,8 @@ static void __init nhk8815_platform_init(void) | |||
| 276 | platform_add_devices(nhk8815_platform_devices, | 270 | platform_add_devices(nhk8815_platform_devices, |
| 277 | ARRAY_SIZE(nhk8815_platform_devices)); | 271 | ARRAY_SIZE(nhk8815_platform_devices)); |
| 278 | 272 | ||
| 279 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 273 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
| 280 | nmdk_clk_create(&nhk8815_clk_48, amba_devs[i]->dev.init_name); | ||
| 281 | amba_device_register(amba_devs[i], &iomem_resource); | 274 | amba_device_register(amba_devs[i], &iomem_resource); |
| 282 | } | ||
| 283 | } | 275 | } |
| 284 | 276 | ||
| 285 | MACHINE_START(NOMADIK, "NHK8815") | 277 | MACHINE_START(NOMADIK, "NHK8815") |
diff --git a/arch/arm/mach-nomadik/clock.c b/arch/arm/mach-nomadik/clock.c index 9f92502a0083..60f5bee09f2e 100644 --- a/arch/arm/mach-nomadik/clock.c +++ b/arch/arm/mach-nomadik/clock.c | |||
| @@ -32,14 +32,36 @@ void clk_disable(struct clk *clk) | |||
| 32 | } | 32 | } |
| 33 | EXPORT_SYMBOL(clk_disable); | 33 | EXPORT_SYMBOL(clk_disable); |
| 34 | 34 | ||
| 35 | /* Create a clock structure with the given name */ | 35 | /* We have a fixed clock alone, for now */ |
| 36 | int nmdk_clk_create(struct clk *clk, const char *dev_id) | 36 | static struct clk clk_48 = { |
| 37 | { | 37 | .rate = 48 * 1000 * 1000, |
| 38 | struct clk_lookup *clkdev; | 38 | }; |
| 39 | |||
| 40 | /* | ||
| 41 | * Catch-all default clock to satisfy drivers using the clk API. We don't | ||
| 42 | * model the actual hardware clocks yet. | ||
| 43 | */ | ||
| 44 | static struct clk clk_default; | ||
| 39 | 45 | ||
| 40 | clkdev = clkdev_alloc(clk, NULL, dev_id); | 46 | #define CLK(_clk, dev) \ |
| 41 | if (!clkdev) | 47 | { \ |
| 42 | return -ENOMEM; | 48 | .clk = _clk, \ |
| 43 | clkdev_add(clkdev); | 49 | .dev_id = dev, \ |
| 50 | } | ||
| 51 | |||
| 52 | static struct clk_lookup lookups[] = { | ||
| 53 | CLK(&clk_48, "uart0"), | ||
| 54 | CLK(&clk_48, "uart1"), | ||
| 55 | CLK(&clk_default, "gpio.0"), | ||
| 56 | CLK(&clk_default, "gpio.1"), | ||
| 57 | CLK(&clk_default, "gpio.2"), | ||
| 58 | CLK(&clk_default, "gpio.3"), | ||
| 59 | }; | ||
| 60 | |||
| 61 | static int __init clk_init(void) | ||
| 62 | { | ||
| 63 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
| 44 | return 0; | 64 | return 0; |
| 45 | } | 65 | } |
| 66 | |||
| 67 | arch_initcall(clk_init); | ||
diff --git a/arch/arm/mach-nomadik/clock.h b/arch/arm/mach-nomadik/clock.h index 235faec7f627..5563985a2cc7 100644 --- a/arch/arm/mach-nomadik/clock.h +++ b/arch/arm/mach-nomadik/clock.h | |||
| @@ -11,4 +11,3 @@ | |||
| 11 | struct clk { | 11 | struct clk { |
| 12 | unsigned long rate; | 12 | unsigned long rate; |
| 13 | }; | 13 | }; |
| 14 | extern int nmdk_clk_create(struct clk *clk, const char *dev_id); | ||
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c index 9bf33b30a025..91c3c901b469 100644 --- a/arch/arm/mach-nomadik/cpu-8815.c +++ b/arch/arm/mach-nomadik/cpu-8815.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
| 22 | #include <linux/amba/bus.h> | 22 | #include <linux/amba/bus.h> |
| 23 | #include <linux/platform_device.h> | ||
| 23 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
| 24 | 25 | ||
| 25 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
| @@ -30,60 +31,66 @@ | |||
| 30 | #include <asm/cacheflush.h> | 31 | #include <asm/cacheflush.h> |
| 31 | #include <asm/hardware/cache-l2x0.h> | 32 | #include <asm/hardware/cache-l2x0.h> |
| 32 | 33 | ||
| 34 | #define __MEM_4K_RESOURCE(x) \ | ||
| 35 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | ||
| 36 | |||
| 33 | /* The 8815 has 4 GPIO blocks, let's register them immediately */ | 37 | /* The 8815 has 4 GPIO blocks, let's register them immediately */ |
| 38 | |||
| 39 | #define GPIO_RESOURCE(block) \ | ||
| 40 | { \ | ||
| 41 | .start = NOMADIK_GPIO##block##_BASE, \ | ||
| 42 | .end = NOMADIK_GPIO##block##_BASE + SZ_4K - 1, \ | ||
| 43 | .flags = IORESOURCE_MEM, \ | ||
| 44 | }, \ | ||
| 45 | { \ | ||
| 46 | .start = IRQ_GPIO##block, \ | ||
| 47 | .end = IRQ_GPIO##block, \ | ||
| 48 | .flags = IORESOURCE_IRQ, \ | ||
| 49 | } | ||
| 50 | |||
| 51 | #define GPIO_DEVICE(block) \ | ||
| 52 | { \ | ||
| 53 | .name = "gpio", \ | ||
| 54 | .id = block, \ | ||
| 55 | .num_resources = 2, \ | ||
| 56 | .resource = &cpu8815_gpio_resources[block * 2], \ | ||
| 57 | .dev = { \ | ||
| 58 | .platform_data = &cpu8815_gpio[block], \ | ||
| 59 | }, \ | ||
| 60 | } | ||
| 61 | |||
| 34 | static struct nmk_gpio_platform_data cpu8815_gpio[] = { | 62 | static struct nmk_gpio_platform_data cpu8815_gpio[] = { |
| 35 | { | 63 | { |
| 36 | .name = "GPIO-0-31", | 64 | .name = "GPIO-0-31", |
| 37 | .first_gpio = 0, | 65 | .first_gpio = 0, |
| 38 | .first_irq = NOMADIK_GPIO_TO_IRQ(0), | 66 | .first_irq = NOMADIK_GPIO_TO_IRQ(0), |
| 39 | .parent_irq = IRQ_GPIO0, | ||
| 40 | }, { | 67 | }, { |
| 41 | .name = "GPIO-32-63", | 68 | .name = "GPIO-32-63", |
| 42 | .first_gpio = 32, | 69 | .first_gpio = 32, |
| 43 | .first_irq = NOMADIK_GPIO_TO_IRQ(32), | 70 | .first_irq = NOMADIK_GPIO_TO_IRQ(32), |
| 44 | .parent_irq = IRQ_GPIO1, | ||
| 45 | }, { | 71 | }, { |
| 46 | .name = "GPIO-64-95", | 72 | .name = "GPIO-64-95", |
| 47 | .first_gpio = 64, | 73 | .first_gpio = 64, |
| 48 | .first_irq = NOMADIK_GPIO_TO_IRQ(64), | 74 | .first_irq = NOMADIK_GPIO_TO_IRQ(64), |
| 49 | .parent_irq = IRQ_GPIO2, | ||
| 50 | }, { | 75 | }, { |
| 51 | .name = "GPIO-96-127", /* 124..127 not routed to pin */ | 76 | .name = "GPIO-96-127", /* 124..127 not routed to pin */ |
| 52 | .first_gpio = 96, | 77 | .first_gpio = 96, |
| 53 | .first_irq = NOMADIK_GPIO_TO_IRQ(96), | 78 | .first_irq = NOMADIK_GPIO_TO_IRQ(96), |
| 54 | .parent_irq = IRQ_GPIO3, | ||
| 55 | } | 79 | } |
| 56 | }; | 80 | }; |
| 57 | 81 | ||
| 58 | #define __MEM_4K_RESOURCE(x) \ | 82 | static struct resource cpu8815_gpio_resources[] = { |
| 59 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | 83 | GPIO_RESOURCE(0), |
| 84 | GPIO_RESOURCE(1), | ||
| 85 | GPIO_RESOURCE(2), | ||
| 86 | GPIO_RESOURCE(3), | ||
| 87 | }; | ||
| 60 | 88 | ||
| 61 | static struct amba_device cpu8815_amba_gpio[] = { | 89 | static struct platform_device cpu8815_platform_gpio[] = { |
| 62 | { | 90 | GPIO_DEVICE(0), |
| 63 | .dev = { | 91 | GPIO_DEVICE(1), |
| 64 | .init_name = "gpio0", | 92 | GPIO_DEVICE(2), |
| 65 | .platform_data = cpu8815_gpio + 0, | 93 | GPIO_DEVICE(3), |
| 66 | }, | ||
| 67 | __MEM_4K_RESOURCE(NOMADIK_GPIO0_BASE), | ||
| 68 | }, { | ||
| 69 | .dev = { | ||
| 70 | .init_name = "gpio1", | ||
| 71 | .platform_data = cpu8815_gpio + 1, | ||
| 72 | }, | ||
| 73 | __MEM_4K_RESOURCE(NOMADIK_GPIO1_BASE), | ||
| 74 | }, { | ||
| 75 | .dev = { | ||
| 76 | .init_name = "gpio2", | ||
| 77 | .platform_data = cpu8815_gpio + 2, | ||
| 78 | }, | ||
| 79 | __MEM_4K_RESOURCE(NOMADIK_GPIO2_BASE), | ||
| 80 | }, { | ||
| 81 | .dev = { | ||
| 82 | .init_name = "gpio3", | ||
| 83 | .platform_data = cpu8815_gpio + 3, | ||
| 84 | }, | ||
| 85 | __MEM_4K_RESOURCE(NOMADIK_GPIO3_BASE), | ||
| 86 | }, | ||
| 87 | }; | 94 | }; |
| 88 | 95 | ||
| 89 | static struct amba_device cpu8815_amba_rng = { | 96 | static struct amba_device cpu8815_amba_rng = { |
| @@ -93,11 +100,14 @@ static struct amba_device cpu8815_amba_rng = { | |||
| 93 | __MEM_4K_RESOURCE(NOMADIK_RNG_BASE), | 100 | __MEM_4K_RESOURCE(NOMADIK_RNG_BASE), |
| 94 | }; | 101 | }; |
| 95 | 102 | ||
| 103 | static struct platform_device *platform_devs[] __initdata = { | ||
| 104 | cpu8815_platform_gpio + 0, | ||
| 105 | cpu8815_platform_gpio + 1, | ||
| 106 | cpu8815_platform_gpio + 2, | ||
| 107 | cpu8815_platform_gpio + 3, | ||
| 108 | }; | ||
| 109 | |||
| 96 | static struct amba_device *amba_devs[] __initdata = { | 110 | static struct amba_device *amba_devs[] __initdata = { |
| 97 | cpu8815_amba_gpio + 0, | ||
| 98 | cpu8815_amba_gpio + 1, | ||
| 99 | cpu8815_amba_gpio + 2, | ||
| 100 | cpu8815_amba_gpio + 3, | ||
| 101 | &cpu8815_amba_rng | 111 | &cpu8815_amba_rng |
| 102 | }; | 112 | }; |
| 103 | 113 | ||
| @@ -105,6 +115,7 @@ static int __init cpu8815_init(void) | |||
| 105 | { | 115 | { |
| 106 | int i; | 116 | int i; |
| 107 | 117 | ||
| 118 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | ||
| 108 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | 119 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
| 109 | amba_device_register(amba_devs[i], &iomem_resource); | 120 | amba_device_register(amba_devs[i], &iomem_resource); |
| 110 | return 0; | 121 | return 0; |
diff --git a/arch/arm/mach-nomadik/include/mach/gpio.h b/arch/arm/mach-nomadik/include/mach/gpio.h index 61577c9f9a7d..7a81a0420343 100644 --- a/arch/arm/mach-nomadik/include/mach/gpio.h +++ b/arch/arm/mach-nomadik/include/mach/gpio.h | |||
| @@ -1,71 +1,6 @@ | |||
| 1 | /* | ||
| 2 | * Structures and registers for GPIO access in the Nomadik SoC | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 STMicroelectronics | ||
| 5 | * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> | ||
| 6 | * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | #ifndef __ASM_ARCH_GPIO_H | 1 | #ifndef __ASM_ARCH_GPIO_H |
| 13 | #define __ASM_ARCH_GPIO_H | 2 | #define __ASM_ARCH_GPIO_H |
| 14 | 3 | ||
| 15 | #include <asm-generic/gpio.h> | 4 | #include <plat/gpio.h> |
| 16 | |||
| 17 | /* | ||
| 18 | * These currently cause a function call to happen, they may be optimized | ||
| 19 | * if needed by adding cpu-specific defines to identify blocks | ||
| 20 | * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc) | ||
| 21 | */ | ||
| 22 | #define gpio_get_value __gpio_get_value | ||
| 23 | #define gpio_set_value __gpio_set_value | ||
| 24 | #define gpio_cansleep __gpio_cansleep | ||
| 25 | #define gpio_to_irq __gpio_to_irq | ||
| 26 | |||
| 27 | /* | ||
| 28 | * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving | ||
| 29 | * the "gpio" namespace for generic and cross-machine functions | ||
| 30 | */ | ||
| 31 | |||
| 32 | /* Register in the logic block */ | ||
| 33 | #define NMK_GPIO_DAT 0x00 | ||
| 34 | #define NMK_GPIO_DATS 0x04 | ||
| 35 | #define NMK_GPIO_DATC 0x08 | ||
| 36 | #define NMK_GPIO_PDIS 0x0c | ||
| 37 | #define NMK_GPIO_DIR 0x10 | ||
| 38 | #define NMK_GPIO_DIRS 0x14 | ||
| 39 | #define NMK_GPIO_DIRC 0x18 | ||
| 40 | #define NMK_GPIO_SLPC 0x1c | ||
| 41 | #define NMK_GPIO_AFSLA 0x20 | ||
| 42 | #define NMK_GPIO_AFSLB 0x24 | ||
| 43 | |||
| 44 | #define NMK_GPIO_RIMSC 0x40 | ||
| 45 | #define NMK_GPIO_FIMSC 0x44 | ||
| 46 | #define NMK_GPIO_IS 0x48 | ||
| 47 | #define NMK_GPIO_IC 0x4c | ||
| 48 | #define NMK_GPIO_RWIMSC 0x50 | ||
| 49 | #define NMK_GPIO_FWIMSC 0x54 | ||
| 50 | #define NMK_GPIO_WKS 0x58 | ||
| 51 | |||
| 52 | /* Alternate functions: function C is set in hw by setting both A and B */ | ||
| 53 | #define NMK_GPIO_ALT_GPIO 0 | ||
| 54 | #define NMK_GPIO_ALT_A 1 | ||
| 55 | #define NMK_GPIO_ALT_B 2 | ||
| 56 | #define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) | ||
| 57 | |||
| 58 | extern int nmk_gpio_set_mode(int gpio, int gpio_mode); | ||
| 59 | extern int nmk_gpio_get_mode(int gpio); | ||
| 60 | |||
| 61 | /* | ||
| 62 | * Platform data to register a block: only the initial gpio/irq number. | ||
| 63 | */ | ||
| 64 | struct nmk_gpio_platform_data { | ||
| 65 | char *name; | ||
| 66 | int first_gpio; | ||
| 67 | int first_irq; | ||
| 68 | int parent_irq; | ||
| 69 | }; | ||
| 70 | 5 | ||
| 71 | #endif /* __ASM_ARCH_GPIO_H */ | 6 | #endif /* __ASM_ARCH_GPIO_H */ |
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c index e36639f66150..8e313b4b99a9 100644 --- a/arch/arm/mach-omap1/board-htcherald.c +++ b/arch/arm/mach-omap1/board-htcherald.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
| 30 | #include <linux/input.h> | 30 | #include <linux/input.h> |
| 31 | #include <linux/bootmem.h> | ||
| 32 | #include <linux/io.h> | 31 | #include <linux/io.h> |
| 33 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
| 34 | 33 | ||
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2271b9bd1f50..12154d10e536 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
| @@ -17,8 +17,10 @@ | |||
| 17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
| 18 | 18 | ||
| 19 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
| 20 | #include <mach/irqs.h> | ||
| 20 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
| 21 | #include <asm/mach/map.h> | 22 | #include <asm/mach/map.h> |
| 23 | #include <asm/pmu.h> | ||
| 22 | 24 | ||
| 23 | #include <plat/control.h> | 25 | #include <plat/control.h> |
| 24 | #include <plat/tc.h> | 26 | #include <plat/tc.h> |
| @@ -453,6 +455,37 @@ static void omap_init_mcspi(void) | |||
| 453 | static inline void omap_init_mcspi(void) {} | 455 | static inline void omap_init_mcspi(void) {} |
| 454 | #endif | 456 | #endif |
| 455 | 457 | ||
| 458 | static struct resource omap2_pmu_resource = { | ||
| 459 | .start = 3, | ||
| 460 | .end = 3, | ||
| 461 | .flags = IORESOURCE_IRQ, | ||
| 462 | }; | ||
| 463 | |||
| 464 | static struct resource omap3_pmu_resource = { | ||
| 465 | .start = INT_34XX_BENCH_MPU_EMUL, | ||
| 466 | .end = INT_34XX_BENCH_MPU_EMUL, | ||
| 467 | .flags = IORESOURCE_IRQ, | ||
| 468 | }; | ||
| 469 | |||
| 470 | static struct platform_device omap_pmu_device = { | ||
| 471 | .name = "arm-pmu", | ||
| 472 | .id = ARM_PMU_DEVICE_CPU, | ||
| 473 | .num_resources = 1, | ||
| 474 | }; | ||
| 475 | |||
| 476 | static void omap_init_pmu(void) | ||
| 477 | { | ||
| 478 | if (cpu_is_omap24xx()) | ||
| 479 | omap_pmu_device.resource = &omap2_pmu_resource; | ||
| 480 | else if (cpu_is_omap34xx()) | ||
| 481 | omap_pmu_device.resource = &omap3_pmu_resource; | ||
| 482 | else | ||
| 483 | return; | ||
| 484 | |||
| 485 | platform_device_register(&omap_pmu_device); | ||
| 486 | } | ||
| 487 | |||
| 488 | |||
| 456 | #ifdef CONFIG_OMAP_SHA1_MD5 | 489 | #ifdef CONFIG_OMAP_SHA1_MD5 |
| 457 | static struct resource sha1_md5_resources[] = { | 490 | static struct resource sha1_md5_resources[] = { |
| 458 | { | 491 | { |
| @@ -797,6 +830,7 @@ static int __init omap2_init_devices(void) | |||
| 797 | omap_init_camera(); | 830 | omap_init_camera(); |
| 798 | omap_init_mbox(); | 831 | omap_init_mbox(); |
| 799 | omap_init_mcspi(); | 832 | omap_init_mcspi(); |
| 833 | omap_init_pmu(); | ||
| 800 | omap_hdq_init(); | 834 | omap_hdq_init(); |
| 801 | omap_init_sti(); | 835 | omap_init_sti(); |
| 802 | omap_init_sha1_md5(); | 836 | omap_init_sha1_md5(); |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e436dcb19795..2c12e8cd7183 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
| @@ -43,7 +43,6 @@ | |||
| 43 | #include <linux/err.h> | 43 | #include <linux/err.h> |
| 44 | #include <linux/list.h> | 44 | #include <linux/list.h> |
| 45 | #include <linux/mutex.h> | 45 | #include <linux/mutex.h> |
| 46 | #include <linux/bootmem.h> | ||
| 47 | 46 | ||
| 48 | #include <plat/common.h> | 47 | #include <plat/common.h> |
| 49 | #include <plat/cpu.h> | 48 | #include <plat/cpu.h> |
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile index e704edb733c0..a01b76b7c956 100644 --- a/arch/arm/mach-realview/Makefile +++ b/arch/arm/mach-realview/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := core.o clock.o | 5 | obj-y := core.o |
| 6 | obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o | 6 | obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o |
| 7 | obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o | 7 | obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o |
| 8 | obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o | 8 | obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o |
diff --git a/arch/arm/mach-realview/clock.c b/arch/arm/mach-realview/clock.c deleted file mode 100644 index a7043115de72..000000000000 --- a/arch/arm/mach-realview/clock.c +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-realview/clock.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2004 ARM Limited. | ||
| 5 | * Written by Deep Blue Solutions Limited. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | #include <linux/module.h> | ||
| 12 | #include <linux/kernel.h> | ||
| 13 | #include <linux/device.h> | ||
| 14 | #include <linux/list.h> | ||
| 15 | #include <linux/errno.h> | ||
| 16 | #include <linux/err.h> | ||
| 17 | #include <linux/string.h> | ||
| 18 | #include <linux/clk.h> | ||
| 19 | #include <linux/mutex.h> | ||
| 20 | |||
| 21 | #include <asm/hardware/icst307.h> | ||
| 22 | |||
| 23 | #include "clock.h" | ||
| 24 | |||
| 25 | int clk_enable(struct clk *clk) | ||
| 26 | { | ||
| 27 | return 0; | ||
| 28 | } | ||
| 29 | EXPORT_SYMBOL(clk_enable); | ||
| 30 | |||
| 31 | void clk_disable(struct clk *clk) | ||
| 32 | { | ||
| 33 | } | ||
| 34 | EXPORT_SYMBOL(clk_disable); | ||
| 35 | |||
| 36 | unsigned long clk_get_rate(struct clk *clk) | ||
| 37 | { | ||
| 38 | return clk->rate; | ||
| 39 | } | ||
| 40 | EXPORT_SYMBOL(clk_get_rate); | ||
| 41 | |||
| 42 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
| 43 | { | ||
| 44 | struct icst307_vco vco; | ||
| 45 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
| 46 | return icst307_khz(clk->params, vco) * 1000; | ||
| 47 | } | ||
| 48 | EXPORT_SYMBOL(clk_round_rate); | ||
| 49 | |||
| 50 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
| 51 | { | ||
| 52 | int ret = -EIO; | ||
| 53 | |||
| 54 | if (clk->setvco) { | ||
| 55 | struct icst307_vco vco; | ||
| 56 | |||
| 57 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
| 58 | clk->rate = icst307_khz(clk->params, vco) * 1000; | ||
| 59 | clk->setvco(clk, vco); | ||
| 60 | ret = 0; | ||
| 61 | } | ||
| 62 | return ret; | ||
| 63 | } | ||
| 64 | EXPORT_SYMBOL(clk_set_rate); | ||
diff --git a/arch/arm/mach-realview/clock.h b/arch/arm/mach-realview/clock.h deleted file mode 100644 index ebbb0f06b600..000000000000 --- a/arch/arm/mach-realview/clock.h +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-realview/clock.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2004 ARM Limited. | ||
| 5 | * Written by Deep Blue Solutions Limited. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | struct module; | ||
| 12 | struct icst307_params; | ||
| 13 | |||
| 14 | struct clk { | ||
| 15 | unsigned long rate; | ||
| 16 | const struct icst307_params *params; | ||
| 17 | void *data; | ||
| 18 | void (*setvco)(struct clk *, struct icst307_vco vco); | ||
| 19 | }; | ||
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index d5a95738f85b..595be19f8ad5 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
| @@ -25,8 +25,6 @@ | |||
| 25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
| 26 | #include <linux/amba/bus.h> | 26 | #include <linux/amba/bus.h> |
| 27 | #include <linux/amba/clcd.h> | 27 | #include <linux/amba/clcd.h> |
| 28 | #include <linux/clocksource.h> | ||
| 29 | #include <linux/clockchips.h> | ||
| 30 | #include <linux/io.h> | 28 | #include <linux/io.h> |
| 31 | #include <linux/smsc911x.h> | 29 | #include <linux/smsc911x.h> |
| 32 | #include <linux/ata_platform.h> | 30 | #include <linux/ata_platform.h> |
| @@ -40,7 +38,7 @@ | |||
| 40 | #include <asm/leds.h> | 38 | #include <asm/leds.h> |
| 41 | #include <asm/mach-types.h> | 39 | #include <asm/mach-types.h> |
| 42 | #include <asm/hardware/arm_timer.h> | 40 | #include <asm/hardware/arm_timer.h> |
| 43 | #include <asm/hardware/icst307.h> | 41 | #include <asm/hardware/icst.h> |
| 44 | 42 | ||
| 45 | #include <asm/mach/arch.h> | 43 | #include <asm/mach/arch.h> |
| 46 | #include <asm/mach/flash.h> | 44 | #include <asm/mach/flash.h> |
| @@ -49,13 +47,12 @@ | |||
| 49 | 47 | ||
| 50 | #include <asm/hardware/gic.h> | 48 | #include <asm/hardware/gic.h> |
| 51 | 49 | ||
| 50 | #include <mach/clkdev.h> | ||
| 52 | #include <mach/platform.h> | 51 | #include <mach/platform.h> |
| 53 | #include <mach/irqs.h> | 52 | #include <mach/irqs.h> |
| 53 | #include <plat/timer-sp.h> | ||
| 54 | 54 | ||
| 55 | #include "core.h" | 55 | #include "core.h" |
| 56 | #include "clock.h" | ||
| 57 | |||
| 58 | #define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) | ||
| 59 | 56 | ||
| 60 | /* used by entry-macro.S and platsmp.c */ | 57 | /* used by entry-macro.S and platsmp.c */ |
| 61 | void __iomem *gic_cpu_base_addr; | 58 | void __iomem *gic_cpu_base_addr; |
| @@ -79,20 +76,6 @@ void __init realview_adjust_zones(int node, unsigned long *size, | |||
| 79 | } | 76 | } |
| 80 | #endif | 77 | #endif |
| 81 | 78 | ||
| 82 | /* | ||
| 83 | * This is the RealView sched_clock implementation. This has | ||
| 84 | * a resolution of 41.7ns, and a maximum value of about 179s. | ||
| 85 | */ | ||
| 86 | unsigned long long sched_clock(void) | ||
| 87 | { | ||
| 88 | unsigned long long v; | ||
| 89 | |||
| 90 | v = (unsigned long long)readl(REALVIEW_REFCOUNTER) * 125; | ||
| 91 | do_div(v, 3); | ||
| 92 | |||
| 93 | return v; | ||
| 94 | } | ||
| 95 | |||
| 96 | 79 | ||
| 97 | #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) | 80 | #define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) |
| 98 | 81 | ||
| @@ -274,37 +257,40 @@ struct mmci_platform_data realview_mmc1_plat_data = { | |||
| 274 | /* | 257 | /* |
| 275 | * Clock handling | 258 | * Clock handling |
| 276 | */ | 259 | */ |
| 277 | static const struct icst307_params realview_oscvco_params = { | 260 | static const struct icst_params realview_oscvco_params = { |
| 278 | .ref = 24000, | 261 | .ref = 24000000, |
| 279 | .vco_max = 200000, | 262 | .vco_max = ICST307_VCO_MAX, |
| 263 | .vco_min = ICST307_VCO_MIN, | ||
| 280 | .vd_min = 4 + 8, | 264 | .vd_min = 4 + 8, |
| 281 | .vd_max = 511 + 8, | 265 | .vd_max = 511 + 8, |
| 282 | .rd_min = 1 + 2, | 266 | .rd_min = 1 + 2, |
| 283 | .rd_max = 127 + 2, | 267 | .rd_max = 127 + 2, |
| 268 | .s2div = icst307_s2div, | ||
| 269 | .idx2s = icst307_idx2s, | ||
| 284 | }; | 270 | }; |
| 285 | 271 | ||
| 286 | static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco) | 272 | static void realview_oscvco_set(struct clk *clk, struct icst_vco vco) |
| 287 | { | 273 | { |
| 288 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; | 274 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; |
| 289 | void __iomem *sys_osc; | ||
| 290 | u32 val; | 275 | u32 val; |
| 291 | 276 | ||
| 292 | if (machine_is_realview_pb1176()) | 277 | val = readl(clk->vcoreg) & ~0x7ffff; |
| 293 | sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; | ||
| 294 | else | ||
| 295 | sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; | ||
| 296 | |||
| 297 | val = readl(sys_osc) & ~0x7ffff; | ||
| 298 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 278 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
| 299 | 279 | ||
| 300 | writel(0xa05f, sys_lock); | 280 | writel(0xa05f, sys_lock); |
| 301 | writel(val, sys_osc); | 281 | writel(val, clk->vcoreg); |
| 302 | writel(0, sys_lock); | 282 | writel(0, sys_lock); |
| 303 | } | 283 | } |
| 304 | 284 | ||
| 285 | static const struct clk_ops oscvco_clk_ops = { | ||
| 286 | .round = icst_clk_round, | ||
| 287 | .set = icst_clk_set, | ||
| 288 | .setvco = realview_oscvco_set, | ||
| 289 | }; | ||
| 290 | |||
| 305 | static struct clk oscvco_clk = { | 291 | static struct clk oscvco_clk = { |
| 292 | .ops = &oscvco_clk_ops, | ||
| 306 | .params = &realview_oscvco_params, | 293 | .params = &realview_oscvco_params, |
| 307 | .setvco = realview_oscvco_set, | ||
| 308 | }; | 294 | }; |
| 309 | 295 | ||
| 310 | /* | 296 | /* |
| @@ -347,7 +333,13 @@ static struct clk_lookup lookups[] = { | |||
| 347 | 333 | ||
| 348 | static int __init clk_init(void) | 334 | static int __init clk_init(void) |
| 349 | { | 335 | { |
| 336 | if (machine_is_realview_pb1176()) | ||
| 337 | oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; | ||
| 338 | else | ||
| 339 | oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; | ||
| 340 | |||
| 350 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 341 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 342 | |||
| 351 | return 0; | 343 | return 0; |
| 352 | } | 344 | } |
| 353 | arch_initcall(clk_init); | 345 | arch_initcall(clk_init); |
| @@ -644,133 +636,6 @@ void __iomem *timer2_va_base; | |||
| 644 | void __iomem *timer3_va_base; | 636 | void __iomem *timer3_va_base; |
| 645 | 637 | ||
| 646 | /* | 638 | /* |
| 647 | * How long is the timer interval? | ||
| 648 | */ | ||
| 649 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
| 650 | #if TIMER_INTERVAL >= 0x100000 | ||
| 651 | #define TIMER_RELOAD (TIMER_INTERVAL >> 8) | ||
| 652 | #define TIMER_DIVISOR (TIMER_CTRL_DIV256) | ||
| 653 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
| 654 | #elif TIMER_INTERVAL >= 0x10000 | ||
| 655 | #define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */ | ||
| 656 | #define TIMER_DIVISOR (TIMER_CTRL_DIV16) | ||
| 657 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
| 658 | #else | ||
| 659 | #define TIMER_RELOAD (TIMER_INTERVAL) | ||
| 660 | #define TIMER_DIVISOR (TIMER_CTRL_DIV1) | ||
| 661 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
| 662 | #endif | ||
| 663 | |||
| 664 | static void timer_set_mode(enum clock_event_mode mode, | ||
| 665 | struct clock_event_device *clk) | ||
| 666 | { | ||
| 667 | unsigned long ctrl; | ||
| 668 | |||
| 669 | switch(mode) { | ||
| 670 | case CLOCK_EVT_MODE_PERIODIC: | ||
| 671 | writel(TIMER_RELOAD, timer0_va_base + TIMER_LOAD); | ||
| 672 | |||
| 673 | ctrl = TIMER_CTRL_PERIODIC; | ||
| 674 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE; | ||
| 675 | break; | ||
| 676 | case CLOCK_EVT_MODE_ONESHOT: | ||
| 677 | /* period set, and timer enabled in 'next_event' hook */ | ||
| 678 | ctrl = TIMER_CTRL_ONESHOT; | ||
| 679 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE; | ||
| 680 | break; | ||
| 681 | case CLOCK_EVT_MODE_UNUSED: | ||
| 682 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
| 683 | default: | ||
| 684 | ctrl = 0; | ||
| 685 | } | ||
| 686 | |||
| 687 | writel(ctrl, timer0_va_base + TIMER_CTRL); | ||
| 688 | } | ||
| 689 | |||
| 690 | static int timer_set_next_event(unsigned long evt, | ||
| 691 | struct clock_event_device *unused) | ||
| 692 | { | ||
| 693 | unsigned long ctrl = readl(timer0_va_base + TIMER_CTRL); | ||
| 694 | |||
| 695 | writel(evt, timer0_va_base + TIMER_LOAD); | ||
| 696 | writel(ctrl | TIMER_CTRL_ENABLE, timer0_va_base + TIMER_CTRL); | ||
| 697 | |||
| 698 | return 0; | ||
| 699 | } | ||
| 700 | |||
| 701 | static struct clock_event_device timer0_clockevent = { | ||
| 702 | .name = "timer0", | ||
| 703 | .shift = 32, | ||
| 704 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
| 705 | .set_mode = timer_set_mode, | ||
| 706 | .set_next_event = timer_set_next_event, | ||
| 707 | .rating = 300, | ||
| 708 | .cpumask = cpu_all_mask, | ||
| 709 | }; | ||
| 710 | |||
| 711 | static void __init realview_clockevents_init(unsigned int timer_irq) | ||
| 712 | { | ||
| 713 | timer0_clockevent.irq = timer_irq; | ||
| 714 | timer0_clockevent.mult = | ||
| 715 | div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift); | ||
| 716 | timer0_clockevent.max_delta_ns = | ||
| 717 | clockevent_delta2ns(0xffffffff, &timer0_clockevent); | ||
| 718 | timer0_clockevent.min_delta_ns = | ||
| 719 | clockevent_delta2ns(0xf, &timer0_clockevent); | ||
| 720 | |||
| 721 | clockevents_register_device(&timer0_clockevent); | ||
| 722 | } | ||
| 723 | |||
| 724 | /* | ||
| 725 | * IRQ handler for the timer | ||
| 726 | */ | ||
| 727 | static irqreturn_t realview_timer_interrupt(int irq, void *dev_id) | ||
| 728 | { | ||
| 729 | struct clock_event_device *evt = &timer0_clockevent; | ||
| 730 | |||
| 731 | /* clear the interrupt */ | ||
| 732 | writel(1, timer0_va_base + TIMER_INTCLR); | ||
| 733 | |||
| 734 | evt->event_handler(evt); | ||
| 735 | |||
| 736 | return IRQ_HANDLED; | ||
| 737 | } | ||
| 738 | |||
| 739 | static struct irqaction realview_timer_irq = { | ||
| 740 | .name = "RealView Timer Tick", | ||
| 741 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
| 742 | .handler = realview_timer_interrupt, | ||
| 743 | }; | ||
| 744 | |||
| 745 | static cycle_t realview_get_cycles(struct clocksource *cs) | ||
| 746 | { | ||
| 747 | return ~readl(timer3_va_base + TIMER_VALUE); | ||
| 748 | } | ||
| 749 | |||
| 750 | static struct clocksource clocksource_realview = { | ||
| 751 | .name = "timer3", | ||
| 752 | .rating = 200, | ||
| 753 | .read = realview_get_cycles, | ||
| 754 | .mask = CLOCKSOURCE_MASK(32), | ||
| 755 | .shift = 20, | ||
| 756 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
| 757 | }; | ||
| 758 | |||
| 759 | static void __init realview_clocksource_init(void) | ||
| 760 | { | ||
| 761 | /* setup timer 0 as free-running clocksource */ | ||
| 762 | writel(0, timer3_va_base + TIMER_CTRL); | ||
| 763 | writel(0xffffffff, timer3_va_base + TIMER_LOAD); | ||
| 764 | writel(0xffffffff, timer3_va_base + TIMER_VALUE); | ||
| 765 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | ||
| 766 | timer3_va_base + TIMER_CTRL); | ||
| 767 | |||
| 768 | clocksource_realview.mult = | ||
| 769 | clocksource_khz2mult(1000, clocksource_realview.shift); | ||
| 770 | clocksource_register(&clocksource_realview); | ||
| 771 | } | ||
| 772 | |||
| 773 | /* | ||
| 774 | * Set up the clock source and clock events devices | 639 | * Set up the clock source and clock events devices |
| 775 | */ | 640 | */ |
| 776 | void __init realview_timer_init(unsigned int timer_irq) | 641 | void __init realview_timer_init(unsigned int timer_irq) |
| @@ -797,13 +662,8 @@ void __init realview_timer_init(unsigned int timer_irq) | |||
| 797 | writel(0, timer2_va_base + TIMER_CTRL); | 662 | writel(0, timer2_va_base + TIMER_CTRL); |
| 798 | writel(0, timer3_va_base + TIMER_CTRL); | 663 | writel(0, timer3_va_base + TIMER_CTRL); |
| 799 | 664 | ||
| 800 | /* | 665 | sp804_clocksource_init(timer3_va_base); |
| 801 | * Make irqs happen for the system timer | 666 | sp804_clockevents_init(timer0_va_base, timer_irq); |
| 802 | */ | ||
| 803 | setup_irq(timer_irq, &realview_timer_irq); | ||
| 804 | |||
| 805 | realview_clocksource_init(); | ||
| 806 | realview_clockevents_init(timer_irq); | ||
| 807 | } | 667 | } |
| 808 | 668 | ||
| 809 | /* | 669 | /* |
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c index be048e3e8799..f95521a5e5ce 100644 --- a/arch/arm/mach-realview/hotplug.c +++ b/arch/arm/mach-realview/hotplug.c | |||
| @@ -131,7 +131,7 @@ void platform_cpu_die(unsigned int cpu) | |||
| 131 | cpu_leave_lowpower(); | 131 | cpu_leave_lowpower(); |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | int mach_cpu_disable(unsigned int cpu) | 134 | int platform_cpu_disable(unsigned int cpu) |
| 135 | { | 135 | { |
| 136 | /* | 136 | /* |
| 137 | * we don't allow CPU 0 to be shutdown (it is still too special | 137 | * we don't allow CPU 0 to be shutdown (it is still too special |
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h index 04b37a89801c..e58d0771b64e 100644 --- a/arch/arm/mach-realview/include/mach/clkdev.h +++ b/arch/arm/mach-realview/include/mach/clkdev.h | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | #ifndef __ASM_MACH_CLKDEV_H | 1 | #ifndef __ASM_MACH_CLKDEV_H |
| 2 | #define __ASM_MACH_CLKDEV_H | 2 | #define __ASM_MACH_CLKDEV_H |
| 3 | 3 | ||
| 4 | #include <plat/clock.h> | ||
| 5 | |||
| 6 | struct clk { | ||
| 7 | unsigned long rate; | ||
| 8 | const struct clk_ops *ops; | ||
| 9 | const struct icst_params *params; | ||
| 10 | void __iomem *vcoreg; | ||
| 11 | }; | ||
| 12 | |||
| 4 | #define __clk_get(clk) ({ 1; }) | 13 | #define __clk_get(clk) ({ 1; }) |
| 5 | #define __clk_put(clk) do { } while (0) | 14 | #define __clk_put(clk) do { } while (0) |
| 6 | 15 | ||
diff --git a/arch/arm/mach-realview/include/mach/irqs-pb1176.h b/arch/arm/mach-realview/include/mach/irqs-pb1176.h index 2410d4f8ddd3..830055bb8628 100644 --- a/arch/arm/mach-realview/include/mach/irqs-pb1176.h +++ b/arch/arm/mach-realview/include/mach/irqs-pb1176.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */ | 31 | #define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */ |
| 32 | #define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */ | 32 | #define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */ |
| 33 | #define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */ | 33 | #define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */ |
| 34 | #define IRQ_DC1176_CORE_PMU (IRQ_DC1176_GIC_START + 7) /* Core PMU interrupt */ | ||
| 34 | #define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */ | 35 | #define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */ |
| 35 | #define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */ | 36 | #define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */ |
| 36 | #define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */ | 37 | #define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */ |
diff --git a/arch/arm/mach-realview/include/mach/irqs-pba8.h b/arch/arm/mach-realview/include/mach/irqs-pba8.h index 86792a9f2ab6..4a88a4edb651 100644 --- a/arch/arm/mach-realview/include/mach/irqs-pba8.h +++ b/arch/arm/mach-realview/include/mach/irqs-pba8.h | |||
| @@ -23,12 +23,6 @@ | |||
| 23 | 23 | ||
| 24 | #define IRQ_PBA8_GIC_START 32 | 24 | #define IRQ_PBA8_GIC_START 32 |
| 25 | 25 | ||
| 26 | /* L220 | ||
| 27 | #define IRQ_PBA8_L220_EVENT (IRQ_PBA8_GIC_START + 29) | ||
| 28 | #define IRQ_PBA8_L220_SLAVE (IRQ_PBA8_GIC_START + 30) | ||
| 29 | #define IRQ_PBA8_L220_DECODE (IRQ_PBA8_GIC_START + 31) | ||
| 30 | */ | ||
| 31 | |||
| 32 | /* | 26 | /* |
| 33 | * PB-A8 on-board gic irq sources | 27 | * PB-A8 on-board gic irq sources |
| 34 | */ | 28 | */ |
| @@ -65,6 +59,8 @@ | |||
| 65 | #define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */ | 59 | #define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */ |
| 66 | #define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */ | 60 | #define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */ |
| 67 | 61 | ||
| 62 | #define IRQ_PBA8_PMU (IRQ_PBA8_GIC_START + 47) /* Cortex-A8 PMU */ | ||
| 63 | |||
| 68 | /* ... */ | 64 | /* ... */ |
| 69 | #define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50) | 65 | #define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50) |
| 70 | #define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51) | 66 | #define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51) |
diff --git a/arch/arm/mach-realview/include/mach/irqs-pbx.h b/arch/arm/mach-realview/include/mach/irqs-pbx.h index deaad4302b17..206a3001f46b 100644 --- a/arch/arm/mach-realview/include/mach/irqs-pbx.h +++ b/arch/arm/mach-realview/include/mach/irqs-pbx.h | |||
| @@ -22,12 +22,6 @@ | |||
| 22 | 22 | ||
| 23 | #define IRQ_PBX_GIC_START 32 | 23 | #define IRQ_PBX_GIC_START 32 |
| 24 | 24 | ||
| 25 | /* L220 | ||
| 26 | #define IRQ_PBX_L220_EVENT (IRQ_PBX_GIC_START + 29) | ||
| 27 | #define IRQ_PBX_L220_SLAVE (IRQ_PBX_GIC_START + 30) | ||
| 28 | #define IRQ_PBX_L220_DECODE (IRQ_PBX_GIC_START + 31) | ||
| 29 | */ | ||
| 30 | |||
| 31 | /* | 25 | /* |
| 32 | * PBX on-board gic irq sources | 26 | * PBX on-board gic irq sources |
| 33 | */ | 27 | */ |
| @@ -77,10 +71,10 @@ | |||
| 77 | #define IRQ_PBX_TIMER4_5 (IRQ_PBX_GIC_START + 41) /* Timer 0/1 (default timer) */ | 71 | #define IRQ_PBX_TIMER4_5 (IRQ_PBX_GIC_START + 41) /* Timer 0/1 (default timer) */ |
| 78 | #define IRQ_PBX_TIMER6_7 (IRQ_PBX_GIC_START + 42) /* Timer 2/3 */ | 72 | #define IRQ_PBX_TIMER6_7 (IRQ_PBX_GIC_START + 42) /* Timer 2/3 */ |
| 79 | /* ... */ | 73 | /* ... */ |
| 80 | #define IRQ_PBX_PMU_CPU3 (IRQ_PBX_GIC_START + 44) /* CPU PMU Interrupts */ | 74 | #define IRQ_PBX_PMU_CPU0 (IRQ_PBX_GIC_START + 44) /* CPU PMU Interrupts */ |
| 81 | #define IRQ_PBX_PMU_CPU2 (IRQ_PBX_GIC_START + 45) | 75 | #define IRQ_PBX_PMU_CPU1 (IRQ_PBX_GIC_START + 45) |
| 82 | #define IRQ_PBX_PMU_CPU1 (IRQ_PBX_GIC_START + 46) | 76 | #define IRQ_PBX_PMU_CPU2 (IRQ_PBX_GIC_START + 46) |
| 83 | #define IRQ_PBX_PMU_CPU0 (IRQ_PBX_GIC_START + 47) | 77 | #define IRQ_PBX_PMU_CPU3 (IRQ_PBX_GIC_START + 47) |
| 84 | 78 | ||
| 85 | /* ... */ | 79 | /* ... */ |
| 86 | #define IRQ_PBX_PCI0 (IRQ_PBX_GIC_START + 50) | 80 | #define IRQ_PBX_PCI0 (IRQ_PBX_GIC_START + 50) |
diff --git a/arch/arm/mach-realview/include/mach/platform.h b/arch/arm/mach-realview/include/mach/platform.h index 86c0c4435a46..1b77a27badaf 100644 --- a/arch/arm/mach-realview/include/mach/platform.h +++ b/arch/arm/mach-realview/include/mach/platform.h | |||
| @@ -231,12 +231,6 @@ | |||
| 231 | #define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */ | 231 | #define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */ |
| 232 | #define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ | 232 | #define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ |
| 233 | 233 | ||
| 234 | /* | ||
| 235 | * Clean base - dummy | ||
| 236 | * | ||
| 237 | */ | ||
| 238 | #define CLEAN_BASE REALVIEW_BOOT_ROM_HI | ||
| 239 | |||
| 240 | /* | 234 | /* |
| 241 | * System controller bit assignment | 235 | * System controller bit assignment |
| 242 | */ | 236 | */ |
| @@ -249,20 +243,6 @@ | |||
| 249 | #define REALVIEW_TIMER4_EnSel 21 | 243 | #define REALVIEW_TIMER4_EnSel 21 |
| 250 | 244 | ||
| 251 | 245 | ||
| 252 | #define MAX_TIMER 2 | ||
| 253 | #define MAX_PERIOD 699050 | ||
| 254 | #define TICKS_PER_uSEC 1 | ||
| 255 | |||
| 256 | /* | ||
| 257 | * These are useconds NOT ticks. | ||
| 258 | * | ||
| 259 | */ | ||
| 260 | #define mSEC_1 1000 | ||
| 261 | #define mSEC_5 (mSEC_1 * 5) | ||
| 262 | #define mSEC_10 (mSEC_1 * 10) | ||
| 263 | #define mSEC_25 (mSEC_1 * 25) | ||
| 264 | #define SEC_1 (mSEC_1 * 1000) | ||
| 265 | |||
| 266 | #define REALVIEW_CSR_BASE 0x10000000 | 246 | #define REALVIEW_CSR_BASE 0x10000000 |
| 267 | #define REALVIEW_CSR_SIZE 0x10000000 | 247 | #define REALVIEW_CSR_SIZE 0x10000000 |
| 268 | 248 | ||
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 7d857d300558..422ccd70d5f5 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
| @@ -31,8 +31,8 @@ | |||
| 31 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
| 32 | #include <asm/leds.h> | 32 | #include <asm/leds.h> |
| 33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
| 34 | #include <asm/pmu.h> | ||
| 34 | #include <asm/hardware/gic.h> | 35 | #include <asm/hardware/gic.h> |
| 35 | #include <asm/hardware/icst307.h> | ||
| 36 | #include <asm/hardware/cache-l2x0.h> | 36 | #include <asm/hardware/cache-l2x0.h> |
| 37 | #include <asm/localtimer.h> | 37 | #include <asm/localtimer.h> |
| 38 | 38 | ||
| @@ -44,7 +44,6 @@ | |||
| 44 | #include <mach/irqs.h> | 44 | #include <mach/irqs.h> |
| 45 | 45 | ||
| 46 | #include "core.h" | 46 | #include "core.h" |
| 47 | #include "clock.h" | ||
| 48 | 47 | ||
| 49 | static struct map_desc realview_eb_io_desc[] __initdata = { | 48 | static struct map_desc realview_eb_io_desc[] __initdata = { |
| 50 | { | 49 | { |
| @@ -294,6 +293,36 @@ static struct resource realview_eb_isp1761_resources[] = { | |||
| 294 | }, | 293 | }, |
| 295 | }; | 294 | }; |
| 296 | 295 | ||
| 296 | static struct resource pmu_resources[] = { | ||
| 297 | [0] = { | ||
| 298 | .start = IRQ_EB11MP_PMU_CPU0, | ||
| 299 | .end = IRQ_EB11MP_PMU_CPU0, | ||
| 300 | .flags = IORESOURCE_IRQ, | ||
| 301 | }, | ||
| 302 | [1] = { | ||
| 303 | .start = IRQ_EB11MP_PMU_CPU1, | ||
| 304 | .end = IRQ_EB11MP_PMU_CPU1, | ||
| 305 | .flags = IORESOURCE_IRQ, | ||
| 306 | }, | ||
| 307 | [2] = { | ||
| 308 | .start = IRQ_EB11MP_PMU_CPU2, | ||
| 309 | .end = IRQ_EB11MP_PMU_CPU2, | ||
| 310 | .flags = IORESOURCE_IRQ, | ||
| 311 | }, | ||
| 312 | [3] = { | ||
| 313 | .start = IRQ_EB11MP_PMU_CPU3, | ||
| 314 | .end = IRQ_EB11MP_PMU_CPU3, | ||
| 315 | .flags = IORESOURCE_IRQ, | ||
| 316 | }, | ||
| 317 | }; | ||
| 318 | |||
| 319 | static struct platform_device pmu_device = { | ||
| 320 | .name = "arm-pmu", | ||
| 321 | .id = ARM_PMU_DEVICE_CPU, | ||
| 322 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
| 323 | .resource = pmu_resources, | ||
| 324 | }; | ||
| 325 | |||
| 297 | static void __init gic_init_irq(void) | 326 | static void __init gic_init_irq(void) |
| 298 | { | 327 | { |
| 299 | if (core_tile_eb11mp() || core_tile_a9mp()) { | 328 | if (core_tile_eb11mp() || core_tile_a9mp()) { |
| @@ -407,6 +436,7 @@ static void __init realview_eb_init(void) | |||
| 407 | * Bits: .... ...0 0111 1001 0000 .... .... .... */ | 436 | * Bits: .... ...0 0111 1001 0000 .... .... .... */ |
| 408 | l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff); | 437 | l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff); |
| 409 | #endif | 438 | #endif |
| 439 | platform_device_register(&pmu_device); | ||
| 410 | } | 440 | } |
| 411 | 441 | ||
| 412 | realview_flash_register(&realview_eb_flash_resource, 1); | 442 | realview_flash_register(&realview_eb_flash_resource, 1); |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index 44392e51dd50..96568ebfa2bb 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
| @@ -31,8 +31,8 @@ | |||
| 31 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
| 32 | #include <asm/leds.h> | 32 | #include <asm/leds.h> |
| 33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
| 34 | #include <asm/pmu.h> | ||
| 34 | #include <asm/hardware/gic.h> | 35 | #include <asm/hardware/gic.h> |
| 35 | #include <asm/hardware/icst307.h> | ||
| 36 | #include <asm/hardware/cache-l2x0.h> | 36 | #include <asm/hardware/cache-l2x0.h> |
| 37 | 37 | ||
| 38 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
| @@ -44,7 +44,6 @@ | |||
| 44 | #include <mach/irqs.h> | 44 | #include <mach/irqs.h> |
| 45 | 45 | ||
| 46 | #include "core.h" | 46 | #include "core.h" |
| 47 | #include "clock.h" | ||
| 48 | 47 | ||
| 49 | static struct map_desc realview_pb1176_io_desc[] __initdata = { | 48 | static struct map_desc realview_pb1176_io_desc[] __initdata = { |
| 50 | { | 49 | { |
| @@ -263,6 +262,19 @@ static struct resource realview_pb1176_isp1761_resources[] = { | |||
| 263 | }, | 262 | }, |
| 264 | }; | 263 | }; |
| 265 | 264 | ||
| 265 | static struct resource pmu_resource = { | ||
| 266 | .start = IRQ_DC1176_CORE_PMU, | ||
| 267 | .end = IRQ_DC1176_CORE_PMU, | ||
| 268 | .flags = IORESOURCE_IRQ, | ||
| 269 | }; | ||
| 270 | |||
| 271 | static struct platform_device pmu_device = { | ||
| 272 | .name = "arm-pmu", | ||
| 273 | .id = ARM_PMU_DEVICE_CPU, | ||
| 274 | .num_resources = 1, | ||
| 275 | .resource = &pmu_resource, | ||
| 276 | }; | ||
| 277 | |||
| 266 | static void __init gic_init_irq(void) | 278 | static void __init gic_init_irq(void) |
| 267 | { | 279 | { |
| 268 | /* ARM1176 DevChip GIC, primary */ | 280 | /* ARM1176 DevChip GIC, primary */ |
| @@ -324,6 +336,7 @@ static void __init realview_pb1176_init(void) | |||
| 324 | realview_eth_register(NULL, realview_pb1176_smsc911x_resources); | 336 | realview_eth_register(NULL, realview_pb1176_smsc911x_resources); |
| 325 | platform_device_register(&realview_i2c_device); | 337 | platform_device_register(&realview_i2c_device); |
| 326 | realview_usb_register(realview_pb1176_isp1761_resources); | 338 | realview_usb_register(realview_pb1176_isp1761_resources); |
| 339 | platform_device_register(&pmu_device); | ||
| 327 | 340 | ||
| 328 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 341 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
| 329 | struct amba_device *d = amba_devs[i]; | 342 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 3e02731af959..7fbefbbebaf0 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
| @@ -31,8 +31,8 @@ | |||
| 31 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
| 32 | #include <asm/leds.h> | 32 | #include <asm/leds.h> |
| 33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
| 34 | #include <asm/pmu.h> | ||
| 34 | #include <asm/hardware/gic.h> | 35 | #include <asm/hardware/gic.h> |
| 35 | #include <asm/hardware/icst307.h> | ||
| 36 | #include <asm/hardware/cache-l2x0.h> | 36 | #include <asm/hardware/cache-l2x0.h> |
| 37 | #include <asm/localtimer.h> | 37 | #include <asm/localtimer.h> |
| 38 | 38 | ||
| @@ -45,7 +45,6 @@ | |||
| 45 | #include <mach/irqs.h> | 45 | #include <mach/irqs.h> |
| 46 | 46 | ||
| 47 | #include "core.h" | 47 | #include "core.h" |
| 48 | #include "clock.h" | ||
| 49 | 48 | ||
| 50 | static struct map_desc realview_pb11mp_io_desc[] __initdata = { | 49 | static struct map_desc realview_pb11mp_io_desc[] __initdata = { |
| 51 | { | 50 | { |
| @@ -260,6 +259,36 @@ static struct resource realview_pb11mp_isp1761_resources[] = { | |||
| 260 | }, | 259 | }, |
| 261 | }; | 260 | }; |
| 262 | 261 | ||
| 262 | static struct resource pmu_resources[] = { | ||
| 263 | [0] = { | ||
| 264 | .start = IRQ_TC11MP_PMU_CPU0, | ||
| 265 | .end = IRQ_TC11MP_PMU_CPU0, | ||
| 266 | .flags = IORESOURCE_IRQ, | ||
| 267 | }, | ||
| 268 | [1] = { | ||
| 269 | .start = IRQ_TC11MP_PMU_CPU1, | ||
| 270 | .end = IRQ_TC11MP_PMU_CPU1, | ||
| 271 | .flags = IORESOURCE_IRQ, | ||
| 272 | }, | ||
| 273 | [2] = { | ||
| 274 | .start = IRQ_TC11MP_PMU_CPU2, | ||
| 275 | .end = IRQ_TC11MP_PMU_CPU2, | ||
| 276 | .flags = IORESOURCE_IRQ, | ||
| 277 | }, | ||
| 278 | [3] = { | ||
| 279 | .start = IRQ_TC11MP_PMU_CPU3, | ||
| 280 | .end = IRQ_TC11MP_PMU_CPU3, | ||
| 281 | .flags = IORESOURCE_IRQ, | ||
| 282 | }, | ||
| 283 | }; | ||
| 284 | |||
| 285 | static struct platform_device pmu_device = { | ||
| 286 | .name = "arm-pmu", | ||
| 287 | .id = ARM_PMU_DEVICE_CPU, | ||
| 288 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
| 289 | .resource = pmu_resources, | ||
| 290 | }; | ||
| 291 | |||
| 263 | static void __init gic_init_irq(void) | 292 | static void __init gic_init_irq(void) |
| 264 | { | 293 | { |
| 265 | unsigned int pldctrl; | 294 | unsigned int pldctrl; |
| @@ -329,6 +358,7 @@ static void __init realview_pb11mp_init(void) | |||
| 329 | platform_device_register(&realview_i2c_device); | 358 | platform_device_register(&realview_i2c_device); |
| 330 | platform_device_register(&realview_cf_device); | 359 | platform_device_register(&realview_cf_device); |
| 331 | realview_usb_register(realview_pb11mp_isp1761_resources); | 360 | realview_usb_register(realview_pb11mp_isp1761_resources); |
| 361 | platform_device_register(&pmu_device); | ||
| 332 | 362 | ||
| 333 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 363 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
| 334 | struct amba_device *d = amba_devs[i]; | 364 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index fe4e25c4201a..d3c113b3dfce 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
| @@ -30,8 +30,8 @@ | |||
| 30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
| 31 | #include <asm/leds.h> | 31 | #include <asm/leds.h> |
| 32 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
| 33 | #include <asm/pmu.h> | ||
| 33 | #include <asm/hardware/gic.h> | 34 | #include <asm/hardware/gic.h> |
| 34 | #include <asm/hardware/icst307.h> | ||
| 35 | 35 | ||
| 36 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
| 37 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
| @@ -42,7 +42,6 @@ | |||
| 42 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
| 43 | 43 | ||
| 44 | #include "core.h" | 44 | #include "core.h" |
| 45 | #include "clock.h" | ||
| 46 | 45 | ||
| 47 | static struct map_desc realview_pba8_io_desc[] __initdata = { | 46 | static struct map_desc realview_pba8_io_desc[] __initdata = { |
| 48 | { | 47 | { |
| @@ -250,6 +249,19 @@ static struct resource realview_pba8_isp1761_resources[] = { | |||
| 250 | }, | 249 | }, |
| 251 | }; | 250 | }; |
| 252 | 251 | ||
| 252 | static struct resource pmu_resource = { | ||
| 253 | .start = IRQ_PBA8_PMU, | ||
| 254 | .end = IRQ_PBA8_PMU, | ||
| 255 | .flags = IORESOURCE_IRQ, | ||
| 256 | }; | ||
| 257 | |||
| 258 | static struct platform_device pmu_device = { | ||
| 259 | .name = "arm-pmu", | ||
| 260 | .id = ARM_PMU_DEVICE_CPU, | ||
| 261 | .num_resources = 1, | ||
| 262 | .resource = &pmu_resource, | ||
| 263 | }; | ||
| 264 | |||
| 253 | static void __init gic_init_irq(void) | 265 | static void __init gic_init_irq(void) |
| 254 | { | 266 | { |
| 255 | /* ARM PB-A8 on-board GIC */ | 267 | /* ARM PB-A8 on-board GIC */ |
| @@ -296,6 +308,7 @@ static void __init realview_pba8_init(void) | |||
| 296 | platform_device_register(&realview_i2c_device); | 308 | platform_device_register(&realview_i2c_device); |
| 297 | platform_device_register(&realview_cf_device); | 309 | platform_device_register(&realview_cf_device); |
| 298 | realview_usb_register(realview_pba8_isp1761_resources); | 310 | realview_usb_register(realview_pba8_isp1761_resources); |
| 311 | platform_device_register(&pmu_device); | ||
| 299 | 312 | ||
| 300 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 313 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { |
| 301 | struct amba_device *d = amba_devs[i]; | 314 | struct amba_device *d = amba_devs[i]; |
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index d94857eb0690..a235ba30996b 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
| 30 | #include <asm/leds.h> | 30 | #include <asm/leds.h> |
| 31 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
| 32 | #include <asm/pmu.h> | ||
| 32 | #include <asm/smp_twd.h> | 33 | #include <asm/smp_twd.h> |
| 33 | #include <asm/hardware/gic.h> | 34 | #include <asm/hardware/gic.h> |
| 34 | #include <asm/hardware/cache-l2x0.h> | 35 | #include <asm/hardware/cache-l2x0.h> |
| @@ -270,6 +271,36 @@ static struct resource realview_pbx_isp1761_resources[] = { | |||
| 270 | }, | 271 | }, |
| 271 | }; | 272 | }; |
| 272 | 273 | ||
| 274 | static struct resource pmu_resources[] = { | ||
| 275 | [0] = { | ||
| 276 | .start = IRQ_PBX_PMU_CPU0, | ||
| 277 | .end = IRQ_PBX_PMU_CPU0, | ||
| 278 | .flags = IORESOURCE_IRQ, | ||
| 279 | }, | ||
| 280 | [1] = { | ||
| 281 | .start = IRQ_PBX_PMU_CPU1, | ||
| 282 | .end = IRQ_PBX_PMU_CPU1, | ||
| 283 | .flags = IORESOURCE_IRQ, | ||
| 284 | }, | ||
| 285 | [2] = { | ||
| 286 | .start = IRQ_PBX_PMU_CPU2, | ||
| 287 | .end = IRQ_PBX_PMU_CPU2, | ||
| 288 | .flags = IORESOURCE_IRQ, | ||
| 289 | }, | ||
| 290 | [3] = { | ||
| 291 | .start = IRQ_PBX_PMU_CPU3, | ||
| 292 | .end = IRQ_PBX_PMU_CPU3, | ||
| 293 | .flags = IORESOURCE_IRQ, | ||
| 294 | }, | ||
| 295 | }; | ||
| 296 | |||
| 297 | static struct platform_device pmu_device = { | ||
| 298 | .name = "arm-pmu", | ||
| 299 | .id = ARM_PMU_DEVICE_CPU, | ||
| 300 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
| 301 | .resource = pmu_resources, | ||
| 302 | }; | ||
| 303 | |||
| 273 | static void __init gic_init_irq(void) | 304 | static void __init gic_init_irq(void) |
| 274 | { | 305 | { |
| 275 | /* ARM PBX on-board GIC */ | 306 | /* ARM PBX on-board GIC */ |
| @@ -354,6 +385,7 @@ static void __init realview_pbx_init(void) | |||
| 354 | /* 16KB way size, 8-way associativity, parity disabled | 385 | /* 16KB way size, 8-way associativity, parity disabled |
| 355 | * Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */ | 386 | * Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */ |
| 356 | l2x0_init(l2x0_base, 0x02520000, 0xc0000fff); | 387 | l2x0_init(l2x0_base, 0x02520000, 0xc0000fff); |
| 388 | platform_device_register(&pmu_device); | ||
| 357 | } | 389 | } |
| 358 | #endif | 390 | #endif |
| 359 | 391 | ||
diff --git a/arch/arm/mach-spear3xx/Kconfig b/arch/arm/mach-spear3xx/Kconfig new file mode 100644 index 000000000000..20d1317cc486 --- /dev/null +++ b/arch/arm/mach-spear3xx/Kconfig | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # | ||
| 2 | # SPEAr3XX Machine configuration file | ||
| 3 | # | ||
| 4 | |||
| 5 | if ARCH_SPEAR3XX | ||
| 6 | |||
| 7 | choice | ||
| 8 | prompt "SPEAr3XX Family" | ||
| 9 | default MACH_SPEAR300 | ||
| 10 | |||
| 11 | config MACH_SPEAR300 | ||
| 12 | bool "SPEAr300" | ||
| 13 | help | ||
| 14 | Supports ST SPEAr300 Machine | ||
| 15 | |||
| 16 | config MACH_SPEAR310 | ||
| 17 | bool "SPEAr310" | ||
| 18 | help | ||
| 19 | Supports ST SPEAr310 Machine | ||
| 20 | |||
| 21 | config MACH_SPEAR320 | ||
| 22 | bool "SPEAr320" | ||
| 23 | help | ||
| 24 | Supports ST SPEAr320 Machine | ||
| 25 | |||
| 26 | endchoice | ||
| 27 | |||
| 28 | # Adding SPEAr3XX machine specific configuration files | ||
| 29 | source "arch/arm/mach-spear3xx/Kconfig300" | ||
| 30 | source "arch/arm/mach-spear3xx/Kconfig310" | ||
| 31 | source "arch/arm/mach-spear3xx/Kconfig320" | ||
| 32 | |||
| 33 | endif #ARCH_SPEAR3XX | ||
diff --git a/arch/arm/mach-spear3xx/Kconfig300 b/arch/arm/mach-spear3xx/Kconfig300 new file mode 100644 index 000000000000..c519a05b4ab4 --- /dev/null +++ b/arch/arm/mach-spear3xx/Kconfig300 | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # | ||
| 2 | # SPEAr300 machine configuration file | ||
| 3 | # | ||
| 4 | |||
| 5 | if MACH_SPEAR300 | ||
| 6 | |||
| 7 | choice | ||
| 8 | prompt "SPEAr300 Boards" | ||
| 9 | default BOARD_SPEAR300_EVB | ||
| 10 | |||
| 11 | config BOARD_SPEAR300_EVB | ||
| 12 | bool "SPEAr300 Evaluation Board" | ||
| 13 | help | ||
| 14 | Supports ST SPEAr300 Evaluation Board | ||
| 15 | endchoice | ||
| 16 | |||
| 17 | endif #MACH_SPEAR300 | ||
diff --git a/arch/arm/mach-spear3xx/Kconfig310 b/arch/arm/mach-spear3xx/Kconfig310 new file mode 100644 index 000000000000..60e7442d75bd --- /dev/null +++ b/arch/arm/mach-spear3xx/Kconfig310 | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # | ||
| 2 | # SPEAr310 machine configuration file | ||
| 3 | # | ||
| 4 | |||
| 5 | if MACH_SPEAR310 | ||
| 6 | |||
| 7 | choice | ||
| 8 | prompt "SPEAr310 Boards" | ||
| 9 | default BOARD_SPEAR310_EVB | ||
| 10 | |||
| 11 | config BOARD_SPEAR310_EVB | ||
| 12 | bool "SPEAr310 Evaluation Board" | ||
| 13 | help | ||
| 14 | Supports ST SPEAr310 Evaluation Board | ||
| 15 | endchoice | ||
| 16 | |||
| 17 | endif #MACH_SPEAR310 | ||
diff --git a/arch/arm/mach-spear3xx/Kconfig320 b/arch/arm/mach-spear3xx/Kconfig320 new file mode 100644 index 000000000000..1c1d438399b8 --- /dev/null +++ b/arch/arm/mach-spear3xx/Kconfig320 | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # | ||
| 2 | # SPEAr320 machine configuration file | ||
| 3 | # | ||
| 4 | |||
| 5 | if MACH_SPEAR320 | ||
| 6 | |||
| 7 | choice | ||
| 8 | prompt "SPEAr320 Boards" | ||
| 9 | default BOARD_SPEAR320_EVB | ||
| 10 | |||
| 11 | config BOARD_SPEAR320_EVB | ||
| 12 | bool "SPEAr320 Evaluation Board" | ||
| 13 | help | ||
| 14 | Supports ST SPEAr320 Evaluation Board | ||
| 15 | endchoice | ||
| 16 | |||
| 17 | endif #MACH_SPEAR320 | ||
diff --git a/arch/arm/mach-spear3xx/Makefile b/arch/arm/mach-spear3xx/Makefile new file mode 100644 index 000000000000..b24862489704 --- /dev/null +++ b/arch/arm/mach-spear3xx/Makefile | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | # | ||
| 2 | # Makefile for SPEAr3XX machine series | ||
| 3 | # | ||
| 4 | |||
| 5 | # common files | ||
| 6 | obj-y += spear3xx.o clock.o | ||
| 7 | |||
| 8 | # spear300 specific files | ||
| 9 | obj-$(CONFIG_MACH_SPEAR300) += spear300.o | ||
| 10 | |||
| 11 | # spear300 boards files | ||
| 12 | obj-$(CONFIG_BOARD_SPEAR300_EVB) += spear300_evb.o | ||
| 13 | |||
| 14 | |||
| 15 | # spear310 specific files | ||
| 16 | obj-$(CONFIG_MACH_SPEAR310) += spear310.o | ||
| 17 | |||
| 18 | # spear310 boards files | ||
| 19 | obj-$(CONFIG_BOARD_SPEAR310_EVB) += spear310_evb.o | ||
| 20 | |||
| 21 | |||
| 22 | # spear320 specific files | ||
| 23 | obj-$(CONFIG_MACH_SPEAR320) += spear320.o | ||
| 24 | |||
| 25 | # spear320 boards files | ||
| 26 | obj-$(CONFIG_BOARD_SPEAR320_EVB) += spear320_evb.o | ||
diff --git a/arch/arm/mach-spear3xx/Makefile.boot b/arch/arm/mach-spear3xx/Makefile.boot new file mode 100644 index 000000000000..7a1f3c0eadb8 --- /dev/null +++ b/arch/arm/mach-spear3xx/Makefile.boot | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | zreladdr-y := 0x00008000 | ||
| 2 | params_phys-y := 0x00000100 | ||
| 3 | initrd_phys-y := 0x00800000 | ||
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c new file mode 100644 index 000000000000..39f6ccf22294 --- /dev/null +++ b/arch/arm/mach-spear3xx/clock.c | |||
| @@ -0,0 +1,389 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/clock.c | ||
| 3 | * | ||
| 4 | * SPEAr3xx machines clock framework source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/init.h> | ||
| 15 | #include <linux/kernel.h> | ||
| 16 | #include <mach/misc_regs.h> | ||
| 17 | #include <plat/clock.h> | ||
| 18 | |||
| 19 | /* root clks */ | ||
| 20 | /* 32 KHz oscillator clock */ | ||
| 21 | static struct clk osc_32k_clk = { | ||
| 22 | .flags = ALWAYS_ENABLED, | ||
| 23 | .rate = 32000, | ||
| 24 | }; | ||
| 25 | |||
| 26 | /* 24 MHz oscillator clock */ | ||
| 27 | static struct clk osc_24m_clk = { | ||
| 28 | .flags = ALWAYS_ENABLED, | ||
| 29 | .rate = 24000000, | ||
| 30 | }; | ||
| 31 | |||
| 32 | /* clock derived from 32 KHz osc clk */ | ||
| 33 | /* rtc clock */ | ||
| 34 | static struct clk rtc_clk = { | ||
| 35 | .pclk = &osc_32k_clk, | ||
| 36 | .en_reg = PERIP1_CLK_ENB, | ||
| 37 | .en_reg_bit = RTC_CLK_ENB, | ||
| 38 | .recalc = &follow_parent, | ||
| 39 | }; | ||
| 40 | |||
| 41 | /* clock derived from 24 MHz osc clk */ | ||
| 42 | /* pll1 configuration structure */ | ||
| 43 | static struct pll_clk_config pll1_config = { | ||
| 44 | .mode_reg = PLL1_CTR, | ||
| 45 | .cfg_reg = PLL1_FRQ, | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* PLL1 clock */ | ||
| 49 | static struct clk pll1_clk = { | ||
| 50 | .pclk = &osc_24m_clk, | ||
| 51 | .en_reg = PLL1_CTR, | ||
| 52 | .en_reg_bit = PLL_ENABLE, | ||
| 53 | .recalc = &pll1_clk_recalc, | ||
| 54 | .private_data = &pll1_config, | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* PLL3 48 MHz clock */ | ||
| 58 | static struct clk pll3_48m_clk = { | ||
| 59 | .flags = ALWAYS_ENABLED, | ||
| 60 | .pclk = &osc_24m_clk, | ||
| 61 | .rate = 48000000, | ||
| 62 | }; | ||
| 63 | |||
| 64 | /* watch dog timer clock */ | ||
| 65 | static struct clk wdt_clk = { | ||
| 66 | .flags = ALWAYS_ENABLED, | ||
| 67 | .pclk = &osc_24m_clk, | ||
| 68 | .recalc = &follow_parent, | ||
| 69 | }; | ||
| 70 | |||
| 71 | /* clock derived from pll1 clk */ | ||
| 72 | /* cpu clock */ | ||
| 73 | static struct clk cpu_clk = { | ||
| 74 | .flags = ALWAYS_ENABLED, | ||
| 75 | .pclk = &pll1_clk, | ||
| 76 | .recalc = &follow_parent, | ||
| 77 | }; | ||
| 78 | |||
| 79 | /* ahb configuration structure */ | ||
| 80 | static struct bus_clk_config ahb_config = { | ||
| 81 | .reg = CORE_CLK_CFG, | ||
| 82 | .mask = PLL_HCLK_RATIO_MASK, | ||
| 83 | .shift = PLL_HCLK_RATIO_SHIFT, | ||
| 84 | }; | ||
| 85 | |||
| 86 | /* ahb clock */ | ||
| 87 | static struct clk ahb_clk = { | ||
| 88 | .flags = ALWAYS_ENABLED, | ||
| 89 | .pclk = &pll1_clk, | ||
| 90 | .recalc = &bus_clk_recalc, | ||
| 91 | .private_data = &ahb_config, | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* uart configurations */ | ||
| 95 | static struct aux_clk_config uart_config = { | ||
| 96 | .synth_reg = UART_CLK_SYNT, | ||
| 97 | }; | ||
| 98 | |||
| 99 | /* uart parents */ | ||
| 100 | static struct pclk_info uart_pclk_info[] = { | ||
| 101 | { | ||
| 102 | .pclk = &pll1_clk, | ||
| 103 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
| 104 | .scalable = 1, | ||
| 105 | }, { | ||
| 106 | .pclk = &pll3_48m_clk, | ||
| 107 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
| 108 | .scalable = 0, | ||
| 109 | }, | ||
| 110 | }; | ||
| 111 | |||
| 112 | /* uart parent select structure */ | ||
| 113 | static struct pclk_sel uart_pclk_sel = { | ||
| 114 | .pclk_info = uart_pclk_info, | ||
| 115 | .pclk_count = ARRAY_SIZE(uart_pclk_info), | ||
| 116 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
| 117 | .pclk_sel_mask = UART_CLK_MASK, | ||
| 118 | }; | ||
| 119 | |||
| 120 | /* uart clock */ | ||
| 121 | static struct clk uart_clk = { | ||
| 122 | .en_reg = PERIP1_CLK_ENB, | ||
| 123 | .en_reg_bit = UART_CLK_ENB, | ||
| 124 | .pclk_sel = &uart_pclk_sel, | ||
| 125 | .pclk_sel_shift = UART_CLK_SHIFT, | ||
| 126 | .recalc = &aux_clk_recalc, | ||
| 127 | .private_data = &uart_config, | ||
| 128 | }; | ||
| 129 | |||
| 130 | /* firda configurations */ | ||
| 131 | static struct aux_clk_config firda_config = { | ||
| 132 | .synth_reg = FIRDA_CLK_SYNT, | ||
| 133 | }; | ||
| 134 | |||
| 135 | /* firda parents */ | ||
| 136 | static struct pclk_info firda_pclk_info[] = { | ||
| 137 | { | ||
| 138 | .pclk = &pll1_clk, | ||
| 139 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
| 140 | .scalable = 1, | ||
| 141 | }, { | ||
| 142 | .pclk = &pll3_48m_clk, | ||
| 143 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
| 144 | .scalable = 0, | ||
| 145 | }, | ||
| 146 | }; | ||
| 147 | |||
| 148 | /* firda parent select structure */ | ||
| 149 | static struct pclk_sel firda_pclk_sel = { | ||
| 150 | .pclk_info = firda_pclk_info, | ||
| 151 | .pclk_count = ARRAY_SIZE(firda_pclk_info), | ||
| 152 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
| 153 | .pclk_sel_mask = FIRDA_CLK_MASK, | ||
| 154 | }; | ||
| 155 | |||
| 156 | /* firda clock */ | ||
| 157 | static struct clk firda_clk = { | ||
| 158 | .en_reg = PERIP1_CLK_ENB, | ||
| 159 | .en_reg_bit = FIRDA_CLK_ENB, | ||
| 160 | .pclk_sel = &firda_pclk_sel, | ||
| 161 | .pclk_sel_shift = FIRDA_CLK_SHIFT, | ||
| 162 | .recalc = &aux_clk_recalc, | ||
| 163 | .private_data = &firda_config, | ||
| 164 | }; | ||
| 165 | |||
| 166 | /* gpt parents */ | ||
| 167 | static struct pclk_info gpt_pclk_info[] = { | ||
| 168 | { | ||
| 169 | .pclk = &pll1_clk, | ||
| 170 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
| 171 | .scalable = 1, | ||
| 172 | }, { | ||
| 173 | .pclk = &pll3_48m_clk, | ||
| 174 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
| 175 | .scalable = 0, | ||
| 176 | }, | ||
| 177 | }; | ||
| 178 | |||
| 179 | /* gpt parent select structure */ | ||
| 180 | static struct pclk_sel gpt_pclk_sel = { | ||
| 181 | .pclk_info = gpt_pclk_info, | ||
| 182 | .pclk_count = ARRAY_SIZE(gpt_pclk_info), | ||
| 183 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
| 184 | .pclk_sel_mask = GPT_CLK_MASK, | ||
| 185 | }; | ||
| 186 | |||
| 187 | /* gpt0 configurations */ | ||
| 188 | static struct aux_clk_config gpt0_config = { | ||
| 189 | .synth_reg = PRSC1_CLK_CFG, | ||
| 190 | }; | ||
| 191 | |||
| 192 | /* gpt0 timer clock */ | ||
| 193 | static struct clk gpt0_clk = { | ||
| 194 | .flags = ALWAYS_ENABLED, | ||
| 195 | .pclk_sel = &gpt_pclk_sel, | ||
| 196 | .pclk_sel_shift = GPT0_CLK_SHIFT, | ||
| 197 | .recalc = &gpt_clk_recalc, | ||
| 198 | .private_data = &gpt0_config, | ||
| 199 | }; | ||
| 200 | |||
| 201 | /* gpt1 configurations */ | ||
| 202 | static struct aux_clk_config gpt1_config = { | ||
| 203 | .synth_reg = PRSC2_CLK_CFG, | ||
| 204 | }; | ||
| 205 | |||
| 206 | /* gpt1 timer clock */ | ||
| 207 | static struct clk gpt1_clk = { | ||
| 208 | .en_reg = PERIP1_CLK_ENB, | ||
| 209 | .en_reg_bit = GPT1_CLK_ENB, | ||
| 210 | .pclk_sel = &gpt_pclk_sel, | ||
| 211 | .pclk_sel_shift = GPT1_CLK_SHIFT, | ||
| 212 | .recalc = &gpt_clk_recalc, | ||
| 213 | .private_data = &gpt1_config, | ||
| 214 | }; | ||
| 215 | |||
| 216 | /* gpt2 configurations */ | ||
| 217 | static struct aux_clk_config gpt2_config = { | ||
| 218 | .synth_reg = PRSC3_CLK_CFG, | ||
| 219 | }; | ||
| 220 | |||
| 221 | /* gpt2 timer clock */ | ||
| 222 | static struct clk gpt2_clk = { | ||
| 223 | .en_reg = PERIP1_CLK_ENB, | ||
| 224 | .en_reg_bit = GPT2_CLK_ENB, | ||
| 225 | .pclk_sel = &gpt_pclk_sel, | ||
| 226 | .pclk_sel_shift = GPT2_CLK_SHIFT, | ||
| 227 | .recalc = &gpt_clk_recalc, | ||
| 228 | .private_data = &gpt2_config, | ||
| 229 | }; | ||
| 230 | |||
| 231 | /* clock derived from pll3 clk */ | ||
| 232 | /* usbh clock */ | ||
| 233 | static struct clk usbh_clk = { | ||
| 234 | .pclk = &pll3_48m_clk, | ||
| 235 | .en_reg = PERIP1_CLK_ENB, | ||
| 236 | .en_reg_bit = USBH_CLK_ENB, | ||
| 237 | .recalc = &follow_parent, | ||
| 238 | }; | ||
| 239 | |||
| 240 | /* usbd clock */ | ||
| 241 | static struct clk usbd_clk = { | ||
| 242 | .pclk = &pll3_48m_clk, | ||
| 243 | .en_reg = PERIP1_CLK_ENB, | ||
| 244 | .en_reg_bit = USBD_CLK_ENB, | ||
| 245 | .recalc = &follow_parent, | ||
| 246 | }; | ||
| 247 | |||
| 248 | /* clcd clock */ | ||
| 249 | static struct clk clcd_clk = { | ||
| 250 | .flags = ALWAYS_ENABLED, | ||
| 251 | .pclk = &pll3_48m_clk, | ||
| 252 | .recalc = &follow_parent, | ||
| 253 | }; | ||
| 254 | |||
| 255 | /* clock derived from ahb clk */ | ||
| 256 | /* apb configuration structure */ | ||
| 257 | static struct bus_clk_config apb_config = { | ||
| 258 | .reg = CORE_CLK_CFG, | ||
| 259 | .mask = HCLK_PCLK_RATIO_MASK, | ||
| 260 | .shift = HCLK_PCLK_RATIO_SHIFT, | ||
| 261 | }; | ||
| 262 | |||
| 263 | /* apb clock */ | ||
| 264 | static struct clk apb_clk = { | ||
| 265 | .flags = ALWAYS_ENABLED, | ||
| 266 | .pclk = &ahb_clk, | ||
| 267 | .recalc = &bus_clk_recalc, | ||
| 268 | .private_data = &apb_config, | ||
| 269 | }; | ||
| 270 | |||
| 271 | /* i2c clock */ | ||
| 272 | static struct clk i2c_clk = { | ||
| 273 | .pclk = &ahb_clk, | ||
| 274 | .en_reg = PERIP1_CLK_ENB, | ||
| 275 | .en_reg_bit = I2C_CLK_ENB, | ||
| 276 | .recalc = &follow_parent, | ||
| 277 | }; | ||
| 278 | |||
| 279 | /* dma clock */ | ||
| 280 | static struct clk dma_clk = { | ||
| 281 | .pclk = &ahb_clk, | ||
| 282 | .en_reg = PERIP1_CLK_ENB, | ||
| 283 | .en_reg_bit = DMA_CLK_ENB, | ||
| 284 | .recalc = &follow_parent, | ||
| 285 | }; | ||
| 286 | |||
| 287 | /* jpeg clock */ | ||
| 288 | static struct clk jpeg_clk = { | ||
| 289 | .pclk = &ahb_clk, | ||
| 290 | .en_reg = PERIP1_CLK_ENB, | ||
| 291 | .en_reg_bit = JPEG_CLK_ENB, | ||
| 292 | .recalc = &follow_parent, | ||
| 293 | }; | ||
| 294 | |||
| 295 | /* gmac clock */ | ||
| 296 | static struct clk gmac_clk = { | ||
| 297 | .pclk = &ahb_clk, | ||
| 298 | .en_reg = PERIP1_CLK_ENB, | ||
| 299 | .en_reg_bit = GMAC_CLK_ENB, | ||
| 300 | .recalc = &follow_parent, | ||
| 301 | }; | ||
| 302 | |||
| 303 | /* smi clock */ | ||
| 304 | static struct clk smi_clk = { | ||
| 305 | .pclk = &ahb_clk, | ||
| 306 | .en_reg = PERIP1_CLK_ENB, | ||
| 307 | .en_reg_bit = SMI_CLK_ENB, | ||
| 308 | .recalc = &follow_parent, | ||
| 309 | }; | ||
| 310 | |||
| 311 | /* c3 clock */ | ||
| 312 | static struct clk c3_clk = { | ||
| 313 | .pclk = &ahb_clk, | ||
| 314 | .en_reg = PERIP1_CLK_ENB, | ||
| 315 | .en_reg_bit = C3_CLK_ENB, | ||
| 316 | .recalc = &follow_parent, | ||
| 317 | }; | ||
| 318 | |||
| 319 | /* clock derived from apb clk */ | ||
| 320 | /* adc clock */ | ||
| 321 | static struct clk adc_clk = { | ||
| 322 | .pclk = &apb_clk, | ||
| 323 | .en_reg = PERIP1_CLK_ENB, | ||
| 324 | .en_reg_bit = ADC_CLK_ENB, | ||
| 325 | .recalc = &follow_parent, | ||
| 326 | }; | ||
| 327 | |||
| 328 | /* ssp clock */ | ||
| 329 | static struct clk ssp_clk = { | ||
| 330 | .pclk = &apb_clk, | ||
| 331 | .en_reg = PERIP1_CLK_ENB, | ||
| 332 | .en_reg_bit = SSP_CLK_ENB, | ||
| 333 | .recalc = &follow_parent, | ||
| 334 | }; | ||
| 335 | |||
| 336 | /* gpio clock */ | ||
| 337 | static struct clk gpio_clk = { | ||
| 338 | .pclk = &apb_clk, | ||
| 339 | .en_reg = PERIP1_CLK_ENB, | ||
| 340 | .en_reg_bit = GPIO_CLK_ENB, | ||
| 341 | .recalc = &follow_parent, | ||
| 342 | }; | ||
| 343 | |||
| 344 | /* array of all spear 3xx clock lookups */ | ||
| 345 | static struct clk_lookup spear_clk_lookups[] = { | ||
| 346 | /* root clks */ | ||
| 347 | { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, | ||
| 348 | { .con_id = "osc_24m_clk", .clk = &osc_24m_clk}, | ||
| 349 | /* clock derived from 32 KHz osc clk */ | ||
| 350 | { .dev_id = "rtc", .clk = &rtc_clk}, | ||
| 351 | /* clock derived from 24 MHz osc clk */ | ||
| 352 | { .con_id = "pll1_clk", .clk = &pll1_clk}, | ||
| 353 | { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk}, | ||
| 354 | { .dev_id = "wdt", .clk = &wdt_clk}, | ||
| 355 | /* clock derived from pll1 clk */ | ||
| 356 | { .con_id = "cpu_clk", .clk = &cpu_clk}, | ||
| 357 | { .con_id = "ahb_clk", .clk = &ahb_clk}, | ||
| 358 | { .dev_id = "uart", .clk = &uart_clk}, | ||
| 359 | { .dev_id = "firda", .clk = &firda_clk}, | ||
| 360 | { .dev_id = "gpt0", .clk = &gpt0_clk}, | ||
| 361 | { .dev_id = "gpt1", .clk = &gpt1_clk}, | ||
| 362 | { .dev_id = "gpt2", .clk = &gpt2_clk}, | ||
| 363 | /* clock derived from pll3 clk */ | ||
| 364 | { .dev_id = "usbh", .clk = &usbh_clk}, | ||
| 365 | { .dev_id = "usbd", .clk = &usbd_clk}, | ||
| 366 | { .dev_id = "clcd", .clk = &clcd_clk}, | ||
| 367 | /* clock derived from ahb clk */ | ||
| 368 | { .con_id = "apb_clk", .clk = &apb_clk}, | ||
| 369 | { .dev_id = "i2c", .clk = &i2c_clk}, | ||
| 370 | { .dev_id = "dma", .clk = &dma_clk}, | ||
| 371 | { .dev_id = "jpeg", .clk = &jpeg_clk}, | ||
| 372 | { .dev_id = "gmac", .clk = &gmac_clk}, | ||
| 373 | { .dev_id = "smi", .clk = &smi_clk}, | ||
| 374 | { .dev_id = "c3", .clk = &c3_clk}, | ||
| 375 | /* clock derived from apb clk */ | ||
| 376 | { .dev_id = "adc", .clk = &adc_clk}, | ||
| 377 | { .dev_id = "ssp", .clk = &ssp_clk}, | ||
| 378 | { .dev_id = "gpio", .clk = &gpio_clk}, | ||
| 379 | }; | ||
| 380 | |||
| 381 | void __init clk_init(void) | ||
| 382 | { | ||
| 383 | int i; | ||
| 384 | |||
| 385 | for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) | ||
| 386 | clk_register(&spear_clk_lookups[i]); | ||
| 387 | |||
| 388 | recalc_root_clocks(); | ||
| 389 | } | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/clkdev.h b/arch/arm/mach-spear3xx/include/mach/clkdev.h new file mode 100644 index 000000000000..a3d07339d9f1 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/clkdev.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/clkdev.h | ||
| 3 | * | ||
| 4 | * Clock Dev framework definitions for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_CLKDEV_H | ||
| 15 | #define __MACH_CLKDEV_H | ||
| 16 | |||
| 17 | #include <plat/clkdev.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_CLKDEV_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/debug-macro.S b/arch/arm/mach-spear3xx/include/mach/debug-macro.S new file mode 100644 index 000000000000..590519f10d6e --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/debug-macro.S | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/debug-macro.S | ||
| 3 | * | ||
| 4 | * Debugging macro include header spear3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <plat/debug-macro.S> | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/entry-macro.S b/arch/arm/mach-spear3xx/include/mach/entry-macro.S new file mode 100644 index 000000000000..947625d6b48d --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/entry-macro.S | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/entry-macro.S | ||
| 3 | * | ||
| 4 | * Low-level IRQ helper macros for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <mach/hardware.h> | ||
| 15 | #include <mach/spear.h> | ||
| 16 | #include <asm/hardware/vic.h> | ||
| 17 | |||
| 18 | .macro disable_fiq | ||
| 19 | .endm | ||
| 20 | |||
| 21 | .macro get_irqnr_preamble, base, tmp | ||
| 22 | .endm | ||
| 23 | |||
| 24 | .macro arch_ret_to_user, tmp1, tmp2 | ||
| 25 | .endm | ||
| 26 | |||
| 27 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
| 28 | ldr \base, =VA_SPEAR3XX_ML1_VIC_BASE | ||
| 29 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status | ||
| 30 | teq \irqstat, #0 | ||
| 31 | beq 1001f @ this will set/reset | ||
| 32 | @ zero register | ||
| 33 | /* | ||
| 34 | * Following code will find bit position of least significang | ||
| 35 | * bit set in irqstat, using following equation | ||
| 36 | * least significant bit set in n = (n & ~(n-1)) | ||
| 37 | */ | ||
| 38 | sub \tmp, \irqstat, #1 @ tmp = irqstat - 1 | ||
| 39 | mvn \tmp, \tmp @ tmp = ~tmp | ||
| 40 | and \irqstat, \irqstat, \tmp @ irqstat &= tmp | ||
| 41 | /* Now, irqstat is = bit no. of 1st bit set in vic irq status */ | ||
| 42 | clz \tmp, \irqstat @ tmp = leading zeros | ||
| 43 | rsb \irqnr, \tmp, #0x1F @ irqnr = 32 - tmp - 1 | ||
| 44 | |||
| 45 | 1001: /* EQ will be set if no irqs pending */ | ||
| 46 | .endm | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h new file mode 100644 index 000000000000..af7e02c909a3 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/generic.h | |||
| @@ -0,0 +1,205 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/generic.h | ||
| 3 | * | ||
| 4 | * SPEAr3XX machine family generic header file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_GENERIC_H | ||
| 15 | #define __MACH_GENERIC_H | ||
| 16 | |||
| 17 | #include <asm/mach/time.h> | ||
| 18 | #include <asm/mach/map.h> | ||
| 19 | #include <linux/init.h> | ||
| 20 | #include <linux/platform_device.h> | ||
| 21 | #include <linux/amba/bus.h> | ||
| 22 | #include <plat/padmux.h> | ||
| 23 | |||
| 24 | /* spear3xx declarations */ | ||
| 25 | /* | ||
| 26 | * Each GPT has 2 timer channels | ||
| 27 | * Following GPT channels will be used as clock source and clockevent | ||
| 28 | */ | ||
| 29 | #define SPEAR_GPT0_BASE SPEAR3XX_ML1_TMR_BASE | ||
| 30 | #define SPEAR_GPT0_CHAN0_IRQ IRQ_CPU_GPT1_1 | ||
| 31 | #define SPEAR_GPT0_CHAN1_IRQ IRQ_CPU_GPT1_2 | ||
| 32 | |||
| 33 | /* Add spear3xx family device structure declarations here */ | ||
| 34 | extern struct amba_device gpio_device; | ||
| 35 | extern struct amba_device uart_device; | ||
| 36 | extern struct sys_timer spear_sys_timer; | ||
| 37 | |||
| 38 | /* Add spear3xx family function declarations here */ | ||
| 39 | void __init clk_init(void); | ||
| 40 | void __init spear3xx_map_io(void); | ||
| 41 | void __init spear3xx_init_irq(void); | ||
| 42 | void __init spear3xx_init(void); | ||
| 43 | void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size); | ||
| 44 | |||
| 45 | /* pad mux declarations */ | ||
| 46 | #define PMX_FIRDA_MASK (1 << 14) | ||
| 47 | #define PMX_I2C_MASK (1 << 13) | ||
| 48 | #define PMX_SSP_CS_MASK (1 << 12) | ||
| 49 | #define PMX_SSP_MASK (1 << 11) | ||
| 50 | #define PMX_MII_MASK (1 << 10) | ||
| 51 | #define PMX_GPIO_PIN0_MASK (1 << 9) | ||
| 52 | #define PMX_GPIO_PIN1_MASK (1 << 8) | ||
| 53 | #define PMX_GPIO_PIN2_MASK (1 << 7) | ||
| 54 | #define PMX_GPIO_PIN3_MASK (1 << 6) | ||
| 55 | #define PMX_GPIO_PIN4_MASK (1 << 5) | ||
| 56 | #define PMX_GPIO_PIN5_MASK (1 << 4) | ||
| 57 | #define PMX_UART0_MODEM_MASK (1 << 3) | ||
| 58 | #define PMX_UART0_MASK (1 << 2) | ||
| 59 | #define PMX_TIMER_3_4_MASK (1 << 1) | ||
| 60 | #define PMX_TIMER_1_2_MASK (1 << 0) | ||
| 61 | |||
| 62 | /* pad mux devices */ | ||
| 63 | extern struct pmx_dev pmx_firda; | ||
| 64 | extern struct pmx_dev pmx_i2c; | ||
| 65 | extern struct pmx_dev pmx_ssp_cs; | ||
| 66 | extern struct pmx_dev pmx_ssp; | ||
| 67 | extern struct pmx_dev pmx_mii; | ||
| 68 | extern struct pmx_dev pmx_gpio_pin0; | ||
| 69 | extern struct pmx_dev pmx_gpio_pin1; | ||
| 70 | extern struct pmx_dev pmx_gpio_pin2; | ||
| 71 | extern struct pmx_dev pmx_gpio_pin3; | ||
| 72 | extern struct pmx_dev pmx_gpio_pin4; | ||
| 73 | extern struct pmx_dev pmx_gpio_pin5; | ||
| 74 | extern struct pmx_dev pmx_uart0_modem; | ||
| 75 | extern struct pmx_dev pmx_uart0; | ||
| 76 | extern struct pmx_dev pmx_timer_3_4; | ||
| 77 | extern struct pmx_dev pmx_timer_1_2; | ||
| 78 | |||
| 79 | #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) | ||
| 80 | /* padmux plgpio devices */ | ||
| 81 | extern struct pmx_dev pmx_plgpio_0_1; | ||
| 82 | extern struct pmx_dev pmx_plgpio_2_3; | ||
| 83 | extern struct pmx_dev pmx_plgpio_4_5; | ||
| 84 | extern struct pmx_dev pmx_plgpio_6_9; | ||
| 85 | extern struct pmx_dev pmx_plgpio_10_27; | ||
| 86 | extern struct pmx_dev pmx_plgpio_28; | ||
| 87 | extern struct pmx_dev pmx_plgpio_29; | ||
| 88 | extern struct pmx_dev pmx_plgpio_30; | ||
| 89 | extern struct pmx_dev pmx_plgpio_31; | ||
| 90 | extern struct pmx_dev pmx_plgpio_32; | ||
| 91 | extern struct pmx_dev pmx_plgpio_33; | ||
| 92 | extern struct pmx_dev pmx_plgpio_34_36; | ||
| 93 | extern struct pmx_dev pmx_plgpio_37_42; | ||
| 94 | extern struct pmx_dev pmx_plgpio_43_44_47_48; | ||
| 95 | extern struct pmx_dev pmx_plgpio_45_46_49_50; | ||
| 96 | #endif | ||
| 97 | |||
| 98 | extern struct pmx_driver pmx_driver; | ||
| 99 | |||
| 100 | /* spear300 declarations */ | ||
| 101 | #ifdef CONFIG_MACH_SPEAR300 | ||
| 102 | /* Add spear300 machine device structure declarations here */ | ||
| 103 | extern struct amba_device gpio1_device; | ||
| 104 | |||
| 105 | /* pad mux modes */ | ||
| 106 | extern struct pmx_mode nand_mode; | ||
| 107 | extern struct pmx_mode nor_mode; | ||
| 108 | extern struct pmx_mode photo_frame_mode; | ||
| 109 | extern struct pmx_mode lend_ip_phone_mode; | ||
| 110 | extern struct pmx_mode hend_ip_phone_mode; | ||
| 111 | extern struct pmx_mode lend_wifi_phone_mode; | ||
| 112 | extern struct pmx_mode hend_wifi_phone_mode; | ||
| 113 | extern struct pmx_mode ata_pabx_wi2s_mode; | ||
| 114 | extern struct pmx_mode ata_pabx_i2s_mode; | ||
| 115 | extern struct pmx_mode caml_lcdw_mode; | ||
| 116 | extern struct pmx_mode camu_lcd_mode; | ||
| 117 | extern struct pmx_mode camu_wlcd_mode; | ||
| 118 | extern struct pmx_mode caml_lcd_mode; | ||
| 119 | |||
| 120 | /* pad mux devices */ | ||
| 121 | extern struct pmx_dev pmx_fsmc_2_chips; | ||
| 122 | extern struct pmx_dev pmx_fsmc_4_chips; | ||
| 123 | extern struct pmx_dev pmx_keyboard; | ||
| 124 | extern struct pmx_dev pmx_clcd; | ||
| 125 | extern struct pmx_dev pmx_telecom_gpio; | ||
| 126 | extern struct pmx_dev pmx_telecom_tdm; | ||
| 127 | extern struct pmx_dev pmx_telecom_spi_cs_i2c_clk; | ||
| 128 | extern struct pmx_dev pmx_telecom_camera; | ||
| 129 | extern struct pmx_dev pmx_telecom_dac; | ||
| 130 | extern struct pmx_dev pmx_telecom_i2s; | ||
| 131 | extern struct pmx_dev pmx_telecom_boot_pins; | ||
| 132 | extern struct pmx_dev pmx_telecom_sdio_4bit; | ||
| 133 | extern struct pmx_dev pmx_telecom_sdio_8bit; | ||
| 134 | extern struct pmx_dev pmx_gpio1; | ||
| 135 | |||
| 136 | void spear300_pmx_init(void); | ||
| 137 | |||
| 138 | /* Add spear300 machine function declarations here */ | ||
| 139 | void __init spear300_init(void); | ||
| 140 | |||
| 141 | #endif /* CONFIG_MACH_SPEAR300 */ | ||
| 142 | |||
| 143 | /* spear310 declarations */ | ||
| 144 | #ifdef CONFIG_MACH_SPEAR310 | ||
| 145 | /* Add spear310 machine device structure declarations here */ | ||
| 146 | |||
| 147 | /* pad mux devices */ | ||
| 148 | extern struct pmx_dev pmx_emi_cs_0_1_4_5; | ||
| 149 | extern struct pmx_dev pmx_emi_cs_2_3; | ||
| 150 | extern struct pmx_dev pmx_uart1; | ||
| 151 | extern struct pmx_dev pmx_uart2; | ||
| 152 | extern struct pmx_dev pmx_uart3_4_5; | ||
| 153 | extern struct pmx_dev pmx_fsmc; | ||
| 154 | extern struct pmx_dev pmx_rs485_0_1; | ||
| 155 | extern struct pmx_dev pmx_tdm0; | ||
| 156 | |||
| 157 | void spear310_pmx_init(void); | ||
| 158 | |||
| 159 | /* Add spear310 machine function declarations here */ | ||
| 160 | void __init spear310_init(void); | ||
| 161 | |||
| 162 | #endif /* CONFIG_MACH_SPEAR310 */ | ||
| 163 | |||
| 164 | /* spear320 declarations */ | ||
| 165 | #ifdef CONFIG_MACH_SPEAR320 | ||
| 166 | /* Add spear320 machine device structure declarations here */ | ||
| 167 | |||
| 168 | /* pad mux modes */ | ||
| 169 | extern struct pmx_mode auto_net_smii_mode; | ||
| 170 | extern struct pmx_mode auto_net_mii_mode; | ||
| 171 | extern struct pmx_mode auto_exp_mode; | ||
| 172 | extern struct pmx_mode small_printers_mode; | ||
| 173 | |||
| 174 | /* pad mux devices */ | ||
| 175 | extern struct pmx_dev pmx_clcd; | ||
| 176 | extern struct pmx_dev pmx_emi; | ||
| 177 | extern struct pmx_dev pmx_fsmc; | ||
| 178 | extern struct pmx_dev pmx_spp; | ||
| 179 | extern struct pmx_dev pmx_sdio; | ||
| 180 | extern struct pmx_dev pmx_i2s; | ||
| 181 | extern struct pmx_dev pmx_uart1; | ||
| 182 | extern struct pmx_dev pmx_uart1_modem; | ||
| 183 | extern struct pmx_dev pmx_uart2; | ||
| 184 | extern struct pmx_dev pmx_touchscreen; | ||
| 185 | extern struct pmx_dev pmx_can; | ||
| 186 | extern struct pmx_dev pmx_sdio_led; | ||
| 187 | extern struct pmx_dev pmx_pwm0; | ||
| 188 | extern struct pmx_dev pmx_pwm1; | ||
| 189 | extern struct pmx_dev pmx_pwm2; | ||
| 190 | extern struct pmx_dev pmx_pwm3; | ||
| 191 | extern struct pmx_dev pmx_ssp1; | ||
| 192 | extern struct pmx_dev pmx_ssp2; | ||
| 193 | extern struct pmx_dev pmx_mii1; | ||
| 194 | extern struct pmx_dev pmx_smii0; | ||
| 195 | extern struct pmx_dev pmx_smii1; | ||
| 196 | extern struct pmx_dev pmx_i2c1; | ||
| 197 | |||
| 198 | void spear320_pmx_init(void); | ||
| 199 | |||
| 200 | /* Add spear320 machine function declarations here */ | ||
| 201 | void __init spear320_init(void); | ||
| 202 | |||
| 203 | #endif /* CONFIG_MACH_SPEAR320 */ | ||
| 204 | |||
| 205 | #endif /* __MACH_GENERIC_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/gpio.h b/arch/arm/mach-spear3xx/include/mach/gpio.h new file mode 100644 index 000000000000..451b2081bfc9 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/gpio.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/gpio.h | ||
| 3 | * | ||
| 4 | * GPIO macros for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_GPIO_H | ||
| 15 | #define __MACH_GPIO_H | ||
| 16 | |||
| 17 | #include <plat/gpio.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_GPIO_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/hardware.h b/arch/arm/mach-spear3xx/include/mach/hardware.h new file mode 100644 index 000000000000..4a86e6a3c444 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/hardware.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/hardware.h | ||
| 3 | * | ||
| 4 | * Hardware definitions for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_HARDWARE_H | ||
| 15 | #define __MACH_HARDWARE_H | ||
| 16 | |||
| 17 | /* Vitual to physical translation of statically mapped space */ | ||
| 18 | #define IO_ADDRESS(x) (x | 0xF0000000) | ||
| 19 | |||
| 20 | #endif /* __MACH_HARDWARE_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/io.h b/arch/arm/mach-spear3xx/include/mach/io.h new file mode 100644 index 000000000000..30cff8a1f6b5 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/io.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/io.h | ||
| 3 | * | ||
| 4 | * IO definitions for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_IO_H | ||
| 15 | #define __MACH_IO_H | ||
| 16 | |||
| 17 | #include <plat/io.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_IO_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/irqs.h b/arch/arm/mach-spear3xx/include/mach/irqs.h new file mode 100644 index 000000000000..7f940b818473 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/irqs.h | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/irqs.h | ||
| 3 | * | ||
| 4 | * IRQ helper macros for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_IRQS_H | ||
| 15 | #define __MACH_IRQS_H | ||
| 16 | |||
| 17 | /* SPEAr3xx IRQ definitions */ | ||
| 18 | #define IRQ_HW_ACCEL_MOD_0 0 | ||
| 19 | #define IRQ_INTRCOMM_RAS_ARM 1 | ||
| 20 | #define IRQ_CPU_GPT1_1 2 | ||
| 21 | #define IRQ_CPU_GPT1_2 3 | ||
| 22 | #define IRQ_BASIC_GPT1_1 4 | ||
| 23 | #define IRQ_BASIC_GPT1_2 5 | ||
| 24 | #define IRQ_BASIC_GPT2_1 6 | ||
| 25 | #define IRQ_BASIC_GPT2_2 7 | ||
| 26 | #define IRQ_BASIC_DMA 8 | ||
| 27 | #define IRQ_BASIC_SMI 9 | ||
| 28 | #define IRQ_BASIC_RTC 10 | ||
| 29 | #define IRQ_BASIC_GPIO 11 | ||
| 30 | #define IRQ_BASIC_WDT 12 | ||
| 31 | #define IRQ_DDR_CONTROLLER 13 | ||
| 32 | #define IRQ_SYS_ERROR 14 | ||
| 33 | #define IRQ_WAKEUP_RCV 15 | ||
| 34 | #define IRQ_JPEG 16 | ||
| 35 | #define IRQ_IRDA 17 | ||
| 36 | #define IRQ_ADC 18 | ||
| 37 | #define IRQ_UART 19 | ||
| 38 | #define IRQ_SSP 20 | ||
| 39 | #define IRQ_I2C 21 | ||
| 40 | #define IRQ_MAC_1 22 | ||
| 41 | #define IRQ_MAC_2 23 | ||
| 42 | #define IRQ_USB_DEV 24 | ||
| 43 | #define IRQ_USB_H_OHCI_0 25 | ||
| 44 | #define IRQ_USB_H_EHCI_0 26 | ||
| 45 | #define IRQ_USB_H_EHCI_1 IRQ_USB_H_EHCI_0 | ||
| 46 | #define IRQ_USB_H_OHCI_1 27 | ||
| 47 | #define IRQ_GEN_RAS_1 28 | ||
| 48 | #define IRQ_GEN_RAS_2 29 | ||
| 49 | #define IRQ_GEN_RAS_3 30 | ||
| 50 | #define IRQ_HW_ACCEL_MOD_1 31 | ||
| 51 | #define IRQ_VIC_END 32 | ||
| 52 | |||
| 53 | #define VIRQ_START IRQ_VIC_END | ||
| 54 | |||
| 55 | /* SPEAr300 Virtual irq definitions */ | ||
| 56 | #ifdef CONFIG_MACH_SPEAR300 | ||
| 57 | /* IRQs sharing IRQ_GEN_RAS_1 */ | ||
| 58 | #define VIRQ_IT_PERS_S (VIRQ_START + 0) | ||
| 59 | #define VIRQ_IT_CHANGE_S (VIRQ_START + 1) | ||
| 60 | #define VIRQ_I2S (VIRQ_START + 2) | ||
| 61 | #define VIRQ_TDM (VIRQ_START + 3) | ||
| 62 | #define VIRQ_CAMERA_L (VIRQ_START + 4) | ||
| 63 | #define VIRQ_CAMERA_F (VIRQ_START + 5) | ||
| 64 | #define VIRQ_CAMERA_V (VIRQ_START + 6) | ||
| 65 | #define VIRQ_KEYBOARD (VIRQ_START + 7) | ||
| 66 | #define VIRQ_GPIO1 (VIRQ_START + 8) | ||
| 67 | |||
| 68 | /* IRQs sharing IRQ_GEN_RAS_3 */ | ||
| 69 | #define IRQ_CLCD IRQ_GEN_RAS_3 | ||
| 70 | |||
| 71 | /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ | ||
| 72 | #define IRQ_SDIO IRQ_INTRCOMM_RAS_ARM | ||
| 73 | |||
| 74 | /* GPIO pins virtual irqs */ | ||
| 75 | #define SPEAR_GPIO_INT_BASE (VIRQ_START + 9) | ||
| 76 | #define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO_INT_BASE + 8) | ||
| 77 | #define SPEAR_GPIO_INT_END (SPEAR_GPIO1_INT_BASE + 8) | ||
| 78 | |||
| 79 | /* SPEAr310 Virtual irq definitions */ | ||
| 80 | #elif defined(CONFIG_MACH_SPEAR310) | ||
| 81 | /* IRQs sharing IRQ_GEN_RAS_1 */ | ||
| 82 | #define VIRQ_SMII0 (VIRQ_START + 0) | ||
| 83 | #define VIRQ_SMII1 (VIRQ_START + 1) | ||
| 84 | #define VIRQ_SMII2 (VIRQ_START + 2) | ||
| 85 | #define VIRQ_SMII3 (VIRQ_START + 3) | ||
| 86 | #define VIRQ_WAKEUP_SMII0 (VIRQ_START + 4) | ||
| 87 | #define VIRQ_WAKEUP_SMII1 (VIRQ_START + 5) | ||
| 88 | #define VIRQ_WAKEUP_SMII2 (VIRQ_START + 6) | ||
| 89 | #define VIRQ_WAKEUP_SMII3 (VIRQ_START + 7) | ||
| 90 | |||
| 91 | /* IRQs sharing IRQ_GEN_RAS_2 */ | ||
| 92 | #define VIRQ_UART1 (VIRQ_START + 8) | ||
| 93 | #define VIRQ_UART2 (VIRQ_START + 9) | ||
| 94 | #define VIRQ_UART3 (VIRQ_START + 10) | ||
| 95 | #define VIRQ_UART4 (VIRQ_START + 11) | ||
| 96 | #define VIRQ_UART5 (VIRQ_START + 12) | ||
| 97 | |||
| 98 | /* IRQs sharing IRQ_GEN_RAS_3 */ | ||
| 99 | #define VIRQ_EMI (VIRQ_START + 13) | ||
| 100 | #define VIRQ_PLGPIO (VIRQ_START + 14) | ||
| 101 | |||
| 102 | /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ | ||
| 103 | #define VIRQ_TDM_HDLC (VIRQ_START + 15) | ||
| 104 | #define VIRQ_RS485_0 (VIRQ_START + 16) | ||
| 105 | #define VIRQ_RS485_1 (VIRQ_START + 17) | ||
| 106 | |||
| 107 | /* GPIO pins virtual irqs */ | ||
| 108 | #define SPEAR_GPIO_INT_BASE (VIRQ_START + 18) | ||
| 109 | |||
| 110 | /* SPEAr320 Virtual irq definitions */ | ||
| 111 | #else | ||
| 112 | /* IRQs sharing IRQ_GEN_RAS_1 */ | ||
| 113 | #define VIRQ_EMI (VIRQ_START + 0) | ||
| 114 | #define VIRQ_CLCD (VIRQ_START + 1) | ||
| 115 | #define VIRQ_SPP (VIRQ_START + 2) | ||
| 116 | |||
| 117 | /* IRQs sharing IRQ_GEN_RAS_2 */ | ||
| 118 | #define IRQ_SDIO IRQ_GEN_RAS_2 | ||
| 119 | |||
| 120 | /* IRQs sharing IRQ_GEN_RAS_3 */ | ||
| 121 | #define VIRQ_PLGPIO (VIRQ_START + 3) | ||
| 122 | #define VIRQ_I2S_PLAY (VIRQ_START + 4) | ||
| 123 | #define VIRQ_I2S_REC (VIRQ_START + 5) | ||
| 124 | |||
| 125 | /* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ | ||
| 126 | #define VIRQ_CANU (VIRQ_START + 6) | ||
| 127 | #define VIRQ_CANL (VIRQ_START + 7) | ||
| 128 | #define VIRQ_UART1 (VIRQ_START + 8) | ||
| 129 | #define VIRQ_UART2 (VIRQ_START + 9) | ||
| 130 | #define VIRQ_SSP1 (VIRQ_START + 10) | ||
| 131 | #define VIRQ_SSP2 (VIRQ_START + 11) | ||
| 132 | #define VIRQ_SMII0 (VIRQ_START + 12) | ||
| 133 | #define VIRQ_MII1_SMII1 (VIRQ_START + 13) | ||
| 134 | #define VIRQ_WAKEUP_SMII0 (VIRQ_START + 14) | ||
| 135 | #define VIRQ_WAKEUP_MII1_SMII1 (VIRQ_START + 15) | ||
| 136 | #define VIRQ_I2C (VIRQ_START + 16) | ||
| 137 | |||
| 138 | /* GPIO pins virtual irqs */ | ||
| 139 | #define SPEAR_GPIO_INT_BASE (VIRQ_START + 17) | ||
| 140 | |||
| 141 | #endif | ||
| 142 | |||
| 143 | /* PLGPIO Virtual IRQs */ | ||
| 144 | #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) | ||
| 145 | #define SPEAR_PLGPIO_INT_BASE (SPEAR_GPIO_INT_BASE + 8) | ||
| 146 | #define SPEAR_GPIO_INT_END (SPEAR_PLGPIO_INT_BASE + 102) | ||
| 147 | #endif | ||
| 148 | |||
| 149 | #define VIRQ_END SPEAR_GPIO_INT_END | ||
| 150 | #define NR_IRQS VIRQ_END | ||
| 151 | |||
| 152 | #endif /* __MACH_IRQS_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/memory.h b/arch/arm/mach-spear3xx/include/mach/memory.h new file mode 100644 index 000000000000..51735221ea19 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/memory.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/memory.h | ||
| 3 | * | ||
| 4 | * Memory map for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_MEMORY_H | ||
| 15 | #define __MACH_MEMORY_H | ||
| 16 | |||
| 17 | #include <plat/memory.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_MEMORY_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/misc_regs.h b/arch/arm/mach-spear3xx/include/mach/misc_regs.h new file mode 100644 index 000000000000..38d767a1aba0 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/misc_regs.h | |||
| @@ -0,0 +1,163 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/misc_regs.h | ||
| 3 | * | ||
| 4 | * Miscellaneous registers definitions for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_MISC_REGS_H | ||
| 15 | #define __MACH_MISC_REGS_H | ||
| 16 | |||
| 17 | #include <mach/spear.h> | ||
| 18 | |||
| 19 | #define MISC_BASE VA_SPEAR3XX_ICM3_MISC_REG_BASE | ||
| 20 | |||
| 21 | #define SOC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x000)) | ||
| 22 | #define DIAG_CFG_CTR ((unsigned int *)(MISC_BASE + 0x004)) | ||
| 23 | #define PLL1_CTR ((unsigned int *)(MISC_BASE + 0x008)) | ||
| 24 | #define PLL1_FRQ ((unsigned int *)(MISC_BASE + 0x00C)) | ||
| 25 | #define PLL1_MOD ((unsigned int *)(MISC_BASE + 0x010)) | ||
| 26 | #define PLL2_CTR ((unsigned int *)(MISC_BASE + 0x014)) | ||
| 27 | /* PLL_CTR register masks */ | ||
| 28 | #define PLL_ENABLE 2 | ||
| 29 | #define PLL_MODE_SHIFT 4 | ||
| 30 | #define PLL_MODE_MASK 0x3 | ||
| 31 | #define PLL_MODE_NORMAL 0 | ||
| 32 | #define PLL_MODE_FRACTION 1 | ||
| 33 | #define PLL_MODE_DITH_DSB 2 | ||
| 34 | #define PLL_MODE_DITH_SSB 3 | ||
| 35 | |||
| 36 | #define PLL2_FRQ ((unsigned int *)(MISC_BASE + 0x018)) | ||
| 37 | /* PLL FRQ register masks */ | ||
| 38 | #define PLL_DIV_N_SHIFT 0 | ||
| 39 | #define PLL_DIV_N_MASK 0xFF | ||
| 40 | #define PLL_DIV_P_SHIFT 8 | ||
| 41 | #define PLL_DIV_P_MASK 0x7 | ||
| 42 | #define PLL_NORM_FDBK_M_SHIFT 24 | ||
| 43 | #define PLL_NORM_FDBK_M_MASK 0xFF | ||
| 44 | #define PLL_DITH_FDBK_M_SHIFT 16 | ||
| 45 | #define PLL_DITH_FDBK_M_MASK 0xFFFF | ||
| 46 | |||
| 47 | #define PLL2_MOD ((unsigned int *)(MISC_BASE + 0x01C)) | ||
| 48 | #define PLL_CLK_CFG ((unsigned int *)(MISC_BASE + 0x020)) | ||
| 49 | #define CORE_CLK_CFG ((unsigned int *)(MISC_BASE + 0x024)) | ||
| 50 | /* CORE CLK CFG register masks */ | ||
| 51 | #define PLL_HCLK_RATIO_SHIFT 10 | ||
| 52 | #define PLL_HCLK_RATIO_MASK 0x3 | ||
| 53 | #define HCLK_PCLK_RATIO_SHIFT 8 | ||
| 54 | #define HCLK_PCLK_RATIO_MASK 0x3 | ||
| 55 | |||
| 56 | #define PERIP_CLK_CFG ((unsigned int *)(MISC_BASE + 0x028)) | ||
| 57 | /* PERIP_CLK_CFG register masks */ | ||
| 58 | #define UART_CLK_SHIFT 4 | ||
| 59 | #define UART_CLK_MASK 0x1 | ||
| 60 | #define FIRDA_CLK_SHIFT 5 | ||
| 61 | #define FIRDA_CLK_MASK 0x3 | ||
| 62 | #define GPT0_CLK_SHIFT 8 | ||
| 63 | #define GPT1_CLK_SHIFT 11 | ||
| 64 | #define GPT2_CLK_SHIFT 12 | ||
| 65 | #define GPT_CLK_MASK 0x1 | ||
| 66 | #define AUX_CLK_PLL3_MASK 0 | ||
| 67 | #define AUX_CLK_PLL1_MASK 1 | ||
| 68 | |||
| 69 | #define PERIP1_CLK_ENB ((unsigned int *)(MISC_BASE + 0x02C)) | ||
| 70 | /* PERIP1_CLK_ENB register masks */ | ||
| 71 | #define UART_CLK_ENB 3 | ||
| 72 | #define SSP_CLK_ENB 5 | ||
| 73 | #define I2C_CLK_ENB 7 | ||
| 74 | #define JPEG_CLK_ENB 8 | ||
| 75 | #define FIRDA_CLK_ENB 10 | ||
| 76 | #define GPT1_CLK_ENB 11 | ||
| 77 | #define GPT2_CLK_ENB 12 | ||
| 78 | #define ADC_CLK_ENB 15 | ||
| 79 | #define RTC_CLK_ENB 17 | ||
| 80 | #define GPIO_CLK_ENB 18 | ||
| 81 | #define DMA_CLK_ENB 19 | ||
| 82 | #define SMI_CLK_ENB 21 | ||
| 83 | #define GMAC_CLK_ENB 23 | ||
| 84 | #define USBD_CLK_ENB 24 | ||
| 85 | #define USBH_CLK_ENB 25 | ||
| 86 | #define C3_CLK_ENB 31 | ||
| 87 | |||
| 88 | #define SOC_CORE_ID ((unsigned int *)(MISC_BASE + 0x030)) | ||
| 89 | #define RAS_CLK_ENB ((unsigned int *)(MISC_BASE + 0x034)) | ||
| 90 | #define PERIP1_SOF_RST ((unsigned int *)(MISC_BASE + 0x038)) | ||
| 91 | /* PERIP1_SOF_RST register masks */ | ||
| 92 | #define JPEG_SOF_RST 8 | ||
| 93 | |||
| 94 | #define SOC_USER_ID ((unsigned int *)(MISC_BASE + 0x03C)) | ||
| 95 | #define RAS_SOF_RST ((unsigned int *)(MISC_BASE + 0x040)) | ||
| 96 | #define PRSC1_CLK_CFG ((unsigned int *)(MISC_BASE + 0x044)) | ||
| 97 | #define PRSC2_CLK_CFG ((unsigned int *)(MISC_BASE + 0x048)) | ||
| 98 | #define PRSC3_CLK_CFG ((unsigned int *)(MISC_BASE + 0x04C)) | ||
| 99 | /* gpt synthesizer register masks */ | ||
| 100 | #define GPT_MSCALE_SHIFT 0 | ||
| 101 | #define GPT_MSCALE_MASK 0xFFF | ||
| 102 | #define GPT_NSCALE_SHIFT 12 | ||
| 103 | #define GPT_NSCALE_MASK 0xF | ||
| 104 | |||
| 105 | #define AMEM_CLK_CFG ((unsigned int *)(MISC_BASE + 0x050)) | ||
| 106 | #define EXPI_CLK_CFG ((unsigned int *)(MISC_BASE + 0x054)) | ||
| 107 | #define CLCD_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x05C)) | ||
| 108 | #define FIRDA_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x060)) | ||
| 109 | #define UART_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x064)) | ||
| 110 | #define GMAC_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x068)) | ||
| 111 | #define RAS1_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x06C)) | ||
| 112 | #define RAS2_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x070)) | ||
| 113 | #define RAS3_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x074)) | ||
| 114 | #define RAS4_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x078)) | ||
| 115 | /* aux clk synthesiser register masks for irda to ras4 */ | ||
| 116 | #define AUX_EQ_SEL_SHIFT 30 | ||
| 117 | #define AUX_EQ_SEL_MASK 1 | ||
| 118 | #define AUX_EQ1_SEL 0 | ||
| 119 | #define AUX_EQ2_SEL 1 | ||
| 120 | #define AUX_XSCALE_SHIFT 16 | ||
| 121 | #define AUX_XSCALE_MASK 0xFFF | ||
| 122 | #define AUX_YSCALE_SHIFT 0 | ||
| 123 | #define AUX_YSCALE_MASK 0xFFF | ||
| 124 | |||
| 125 | #define ICM1_ARB_CFG ((unsigned int *)(MISC_BASE + 0x07C)) | ||
| 126 | #define ICM2_ARB_CFG ((unsigned int *)(MISC_BASE + 0x080)) | ||
| 127 | #define ICM3_ARB_CFG ((unsigned int *)(MISC_BASE + 0x084)) | ||
| 128 | #define ICM4_ARB_CFG ((unsigned int *)(MISC_BASE + 0x088)) | ||
| 129 | #define ICM5_ARB_CFG ((unsigned int *)(MISC_BASE + 0x08C)) | ||
| 130 | #define ICM6_ARB_CFG ((unsigned int *)(MISC_BASE + 0x090)) | ||
| 131 | #define ICM7_ARB_CFG ((unsigned int *)(MISC_BASE + 0x094)) | ||
| 132 | #define ICM8_ARB_CFG ((unsigned int *)(MISC_BASE + 0x098)) | ||
| 133 | #define ICM9_ARB_CFG ((unsigned int *)(MISC_BASE + 0x09C)) | ||
| 134 | #define DMA_CHN_CFG ((unsigned int *)(MISC_BASE + 0x0A0)) | ||
| 135 | #define USB2_PHY_CFG ((unsigned int *)(MISC_BASE + 0x0A4)) | ||
| 136 | #define GMAC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0A8)) | ||
| 137 | #define EXPI_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0AC)) | ||
| 138 | #define PRC1_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C0)) | ||
| 139 | #define PRC2_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C4)) | ||
| 140 | #define PRC3_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C8)) | ||
| 141 | #define PRC4_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0CC)) | ||
| 142 | #define PRC1_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D0)) | ||
| 143 | #define PRC2_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D4)) | ||
| 144 | #define PRC3_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D8)) | ||
| 145 | #define PRC4_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0DC)) | ||
| 146 | #define PWRDOWN_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0E0)) | ||
| 147 | #define COMPSSTL_1V8_CFG ((unsigned int *)(MISC_BASE + 0x0E4)) | ||
| 148 | #define COMPSSTL_2V5_CFG ((unsigned int *)(MISC_BASE + 0x0E8)) | ||
| 149 | #define COMPCOR_3V3_CFG ((unsigned int *)(MISC_BASE + 0x0EC)) | ||
| 150 | #define SSTLPAD_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F0)) | ||
| 151 | #define BIST1_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F4)) | ||
| 152 | #define BIST2_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F8)) | ||
| 153 | #define BIST3_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0FC)) | ||
| 154 | #define BIST4_CFG_CTR ((unsigned int *)(MISC_BASE + 0x100)) | ||
| 155 | #define BIST5_CFG_CTR ((unsigned int *)(MISC_BASE + 0x104)) | ||
| 156 | #define BIST1_STS_RES ((unsigned int *)(MISC_BASE + 0x108)) | ||
| 157 | #define BIST2_STS_RES ((unsigned int *)(MISC_BASE + 0x10C)) | ||
| 158 | #define BIST3_STS_RES ((unsigned int *)(MISC_BASE + 0x110)) | ||
| 159 | #define BIST4_STS_RES ((unsigned int *)(MISC_BASE + 0x114)) | ||
| 160 | #define BIST5_STS_RES ((unsigned int *)(MISC_BASE + 0x118)) | ||
| 161 | #define SYSERR_CFG_CTR ((unsigned int *)(MISC_BASE + 0x11C)) | ||
| 162 | |||
| 163 | #endif /* __MACH_MISC_REGS_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/spear.h b/arch/arm/mach-spear3xx/include/mach/spear.h new file mode 100644 index 000000000000..dcca8568a486 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/spear.h | |||
| @@ -0,0 +1,144 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/spear.h | ||
| 3 | * | ||
| 4 | * SPEAr3xx Machine family specific definition | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_SPEAR3XX_H | ||
| 15 | #define __MACH_SPEAR3XX_H | ||
| 16 | |||
| 17 | #include <mach/hardware.h> | ||
| 18 | #include <mach/spear300.h> | ||
| 19 | #include <mach/spear310.h> | ||
| 20 | #include <mach/spear320.h> | ||
| 21 | |||
| 22 | #define SPEAR3XX_ML_SDRAM_BASE 0x00000000 | ||
| 23 | #define SPEAR3XX_ML_SDRAM_SIZE 0x40000000 | ||
| 24 | |||
| 25 | #define SPEAR3XX_ICM9_BASE 0xC0000000 | ||
| 26 | #define SPEAR3XX_ICM9_SIZE 0x10000000 | ||
| 27 | |||
| 28 | /* ICM1 - Low speed connection */ | ||
| 29 | #define SPEAR3XX_ICM1_2_BASE 0xD0000000 | ||
| 30 | #define SPEAR3XX_ICM1_2_SIZE 0x10000000 | ||
| 31 | |||
| 32 | #define SPEAR3XX_ICM1_UART_BASE 0xD0000000 | ||
| 33 | #define VA_SPEAR3XX_ICM1_UART_BASE IO_ADDRESS(SPEAR3XX_ICM1_UART_BASE) | ||
| 34 | #define SPEAR3XX_ICM1_UART_SIZE 0x00080000 | ||
| 35 | |||
| 36 | #define SPEAR3XX_ICM1_ADC_BASE 0xD0080000 | ||
| 37 | #define SPEAR3XX_ICM1_ADC_SIZE 0x00080000 | ||
| 38 | |||
| 39 | #define SPEAR3XX_ICM1_SSP_BASE 0xD0100000 | ||
| 40 | #define SPEAR3XX_ICM1_SSP_SIZE 0x00080000 | ||
| 41 | |||
| 42 | #define SPEAR3XX_ICM1_I2C_BASE 0xD0180000 | ||
| 43 | #define SPEAR3XX_ICM1_I2C_SIZE 0x00080000 | ||
| 44 | |||
| 45 | #define SPEAR3XX_ICM1_JPEG_BASE 0xD0800000 | ||
| 46 | #define SPEAR3XX_ICM1_JPEG_SIZE 0x00800000 | ||
| 47 | |||
| 48 | #define SPEAR3XX_ICM1_IRDA_BASE 0xD1000000 | ||
| 49 | #define SPEAR3XX_ICM1_IRDA_SIZE 0x00080000 | ||
| 50 | |||
| 51 | #define SPEAR3XX_ICM1_SRAM_BASE 0xD2800000 | ||
| 52 | #define SPEAR3XX_ICM1_SRAM_SIZE 0x05800000 | ||
| 53 | |||
| 54 | /* ICM2 - Application Subsystem */ | ||
| 55 | #define SPEAR3XX_ICM2_HWACCEL0_BASE 0xD8800000 | ||
| 56 | #define SPEAR3XX_ICM2_HWACCEL0_SIZE 0x00800000 | ||
| 57 | |||
| 58 | #define SPEAR3XX_ICM2_HWACCEL1_BASE 0xD9000000 | ||
| 59 | #define SPEAR3XX_ICM2_HWACCEL1_SIZE 0x00800000 | ||
| 60 | |||
| 61 | /* ICM4 - High Speed Connection */ | ||
| 62 | #define SPEAR3XX_ICM4_BASE 0xE0000000 | ||
| 63 | #define SPEAR3XX_ICM4_SIZE 0x08000000 | ||
| 64 | |||
| 65 | #define SPEAR3XX_ICM4_MII_BASE 0xE0800000 | ||
| 66 | #define SPEAR3XX_ICM4_MII_SIZE 0x00800000 | ||
| 67 | |||
| 68 | #define SPEAR3XX_ICM4_USBD_FIFO_BASE 0xE1000000 | ||
| 69 | #define SPEAR3XX_ICM4_USBD_FIFO_SIZE 0x00100000 | ||
| 70 | |||
| 71 | #define SPEAR3XX_ICM4_USBD_CSR_BASE 0xE1100000 | ||
| 72 | #define SPEAR3XX_ICM4_USBD_CSR_SIZE 0x00100000 | ||
| 73 | |||
| 74 | #define SPEAR3XX_ICM4_USBD_PLDT_BASE 0xE1200000 | ||
| 75 | #define SPEAR3XX_ICM4_USBD_PLDT_SIZE 0x00100000 | ||
| 76 | |||
| 77 | #define SPEAR3XX_ICM4_USB_EHCI0_1_BASE 0xE1800000 | ||
| 78 | #define SPEAR3XX_ICM4_USB_EHCI0_1_SIZE 0x00100000 | ||
| 79 | |||
| 80 | #define SPEAR3XX_ICM4_USB_OHCI0_BASE 0xE1900000 | ||
| 81 | #define SPEAR3XX_ICM4_USB_OHCI0_SIZE 0x00100000 | ||
| 82 | |||
| 83 | #define SPEAR3XX_ICM4_USB_OHCI1_BASE 0xE2100000 | ||
| 84 | #define SPEAR3XX_ICM4_USB_OHCI1_SIZE 0x00100000 | ||
| 85 | |||
| 86 | #define SPEAR3XX_ICM4_USB_ARB_BASE 0xE2800000 | ||
| 87 | #define SPEAR3XX_ICM4_USB_ARB_SIZE 0x00010000 | ||
| 88 | |||
| 89 | /* ML1 - Multi Layer CPU Subsystem */ | ||
| 90 | #define SPEAR3XX_ICM3_ML1_2_BASE 0xF0000000 | ||
| 91 | #define SPEAR3XX_ICM3_ML1_2_SIZE 0x0F000000 | ||
| 92 | |||
| 93 | #define SPEAR3XX_ML1_TMR_BASE 0xF0000000 | ||
| 94 | #define SPEAR3XX_ML1_TMR_SIZE 0x00100000 | ||
| 95 | |||
| 96 | #define SPEAR3XX_ML1_VIC_BASE 0xF1100000 | ||
| 97 | #define VA_SPEAR3XX_ML1_VIC_BASE IO_ADDRESS(SPEAR3XX_ML1_VIC_BASE) | ||
| 98 | #define SPEAR3XX_ML1_VIC_SIZE 0x00100000 | ||
| 99 | |||
| 100 | /* ICM3 - Basic Subsystem */ | ||
| 101 | #define SPEAR3XX_ICM3_SMEM_BASE 0xF8000000 | ||
| 102 | #define SPEAR3XX_ICM3_SMEM_SIZE 0x04000000 | ||
| 103 | |||
| 104 | #define SPEAR3XX_ICM3_SMI_CTRL_BASE 0xFC000000 | ||
| 105 | #define SPEAR3XX_ICM3_SMI_CTRL_SIZE 0x00200000 | ||
| 106 | |||
| 107 | #define SPEAR3XX_ICM3_DMA_BASE 0xFC400000 | ||
| 108 | #define SPEAR3XX_ICM3_DMA_SIZE 0x00200000 | ||
| 109 | |||
| 110 | #define SPEAR3XX_ICM3_SDRAM_CTRL_BASE 0xFC600000 | ||
| 111 | #define SPEAR3XX_ICM3_SDRAM_CTRL_SIZE 0x00200000 | ||
| 112 | |||
| 113 | #define SPEAR3XX_ICM3_TMR0_BASE 0xFC800000 | ||
| 114 | #define SPEAR3XX_ICM3_TMR0_SIZE 0x00080000 | ||
| 115 | |||
| 116 | #define SPEAR3XX_ICM3_WDT_BASE 0xFC880000 | ||
| 117 | #define SPEAR3XX_ICM3_WDT_SIZE 0x00080000 | ||
| 118 | |||
| 119 | #define SPEAR3XX_ICM3_RTC_BASE 0xFC900000 | ||
| 120 | #define SPEAR3XX_ICM3_RTC_SIZE 0x00080000 | ||
| 121 | |||
| 122 | #define SPEAR3XX_ICM3_GPIO_BASE 0xFC980000 | ||
| 123 | #define SPEAR3XX_ICM3_GPIO_SIZE 0x00080000 | ||
| 124 | |||
| 125 | #define SPEAR3XX_ICM3_SYS_CTRL_BASE 0xFCA00000 | ||
| 126 | #define VA_SPEAR3XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR3XX_ICM3_SYS_CTRL_BASE) | ||
| 127 | #define SPEAR3XX_ICM3_SYS_CTRL_SIZE 0x00080000 | ||
| 128 | |||
| 129 | #define SPEAR3XX_ICM3_MISC_REG_BASE 0xFCA80000 | ||
| 130 | #define VA_SPEAR3XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR3XX_ICM3_MISC_REG_BASE) | ||
| 131 | #define SPEAR3XX_ICM3_MISC_REG_SIZE 0x00080000 | ||
| 132 | |||
| 133 | #define SPEAR3XX_ICM3_TMR1_BASE 0xFCB00000 | ||
| 134 | #define SPEAR3XX_ICM3_TMR1_SIZE 0x00080000 | ||
| 135 | |||
| 136 | /* Debug uart for linux, will be used for debug and uncompress messages */ | ||
| 137 | #define SPEAR_DBG_UART_BASE SPEAR3XX_ICM1_UART_BASE | ||
| 138 | #define VA_SPEAR_DBG_UART_BASE VA_SPEAR3XX_ICM1_UART_BASE | ||
| 139 | |||
| 140 | /* Sysctl base for spear platform */ | ||
| 141 | #define SPEAR_SYS_CTRL_BASE SPEAR3XX_ICM3_SYS_CTRL_BASE | ||
| 142 | #define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR3XX_ICM3_SYS_CTRL_BASE | ||
| 143 | |||
| 144 | #endif /* __MACH_SPEAR3XX_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/spear300.h b/arch/arm/mach-spear3xx/include/mach/spear300.h new file mode 100644 index 000000000000..ccaa76522ee2 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/spear300.h | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/spear300.h | ||
| 3 | * | ||
| 4 | * SPEAr300 Machine specific definition | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifdef CONFIG_MACH_SPEAR300 | ||
| 15 | |||
| 16 | #ifndef __MACH_SPEAR300_H | ||
| 17 | #define __MACH_SPEAR300_H | ||
| 18 | |||
| 19 | /* Base address of various IPs */ | ||
| 20 | #define SPEAR300_TELECOM_BASE 0x50000000 | ||
| 21 | #define SPEAR300_TELECOM_SIZE 0x10000000 | ||
| 22 | |||
| 23 | /* Interrupt registers offsets and masks */ | ||
| 24 | #define SPEAR300_TELECOM_REG_SIZE 0x00010000 | ||
| 25 | #define INT_ENB_MASK_REG 0x54 | ||
| 26 | #define INT_STS_MASK_REG 0x58 | ||
| 27 | #define IT_PERS_S_IRQ_MASK (1 << 0) | ||
| 28 | #define IT_CHANGE_S_IRQ_MASK (1 << 1) | ||
| 29 | #define I2S_IRQ_MASK (1 << 2) | ||
| 30 | #define TDM_IRQ_MASK (1 << 3) | ||
| 31 | #define CAMERA_L_IRQ_MASK (1 << 4) | ||
| 32 | #define CAMERA_F_IRQ_MASK (1 << 5) | ||
| 33 | #define CAMERA_V_IRQ_MASK (1 << 6) | ||
| 34 | #define KEYBOARD_IRQ_MASK (1 << 7) | ||
| 35 | #define GPIO1_IRQ_MASK (1 << 8) | ||
| 36 | |||
| 37 | #define SHIRQ_RAS1_MASK 0x1FF | ||
| 38 | |||
| 39 | #define SPEAR300_CLCD_BASE 0x60000000 | ||
| 40 | #define SPEAR300_CLCD_SIZE 0x10000000 | ||
| 41 | |||
| 42 | #define SPEAR300_SDIO_BASE 0x70000000 | ||
| 43 | #define SPEAR300_SDIO_SIZE 0x10000000 | ||
| 44 | |||
| 45 | #define SPEAR300_NAND_0_BASE 0x80000000 | ||
| 46 | #define SPEAR300_NAND_0_SIZE 0x04000000 | ||
| 47 | |||
| 48 | #define SPEAR300_NAND_1_BASE 0x84000000 | ||
| 49 | #define SPEAR300_NAND_1_SIZE 0x04000000 | ||
| 50 | |||
| 51 | #define SPEAR300_NAND_2_BASE 0x88000000 | ||
| 52 | #define SPEAR300_NAND_2_SIZE 0x04000000 | ||
| 53 | |||
| 54 | #define SPEAR300_NAND_3_BASE 0x8c000000 | ||
| 55 | #define SPEAR300_NAND_3_SIZE 0x04000000 | ||
| 56 | |||
| 57 | #define SPEAR300_NOR_0_BASE 0x90000000 | ||
| 58 | #define SPEAR300_NOR_0_SIZE 0x01000000 | ||
| 59 | |||
| 60 | #define SPEAR300_NOR_1_BASE 0x91000000 | ||
| 61 | #define SPEAR300_NOR_1_SIZE 0x01000000 | ||
| 62 | |||
| 63 | #define SPEAR300_NOR_2_BASE 0x92000000 | ||
| 64 | #define SPEAR300_NOR_2_SIZE 0x01000000 | ||
| 65 | |||
| 66 | #define SPEAR300_NOR_3_BASE 0x93000000 | ||
| 67 | #define SPEAR300_NOR_3_SIZE 0x01000000 | ||
| 68 | |||
| 69 | #define SPEAR300_FSMC_BASE 0x94000000 | ||
| 70 | #define SPEAR300_FSMC_SIZE 0x05000000 | ||
| 71 | |||
| 72 | #define SPEAR300_SOC_CONFIG_BASE 0x99000000 | ||
| 73 | #define SPEAR300_SOC_CONFIG_SIZE 0x00000008 | ||
| 74 | |||
| 75 | #define SPEAR300_KEYBOARD_BASE 0xA0000000 | ||
| 76 | #define SPEAR300_KEYBOARD_SIZE 0x09000000 | ||
| 77 | |||
| 78 | #define SPEAR300_GPIO_BASE 0xA9000000 | ||
| 79 | #define SPEAR300_GPIO_SIZE 0x07000000 | ||
| 80 | |||
| 81 | #endif /* __MACH_SPEAR300_H */ | ||
| 82 | |||
| 83 | #endif /* CONFIG_MACH_SPEAR300 */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/spear310.h b/arch/arm/mach-spear3xx/include/mach/spear310.h new file mode 100644 index 000000000000..b27bb8af3309 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/spear310.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/spear310.h | ||
| 3 | * | ||
| 4 | * SPEAr310 Machine specific definition | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifdef CONFIG_MACH_SPEAR310 | ||
| 15 | |||
| 16 | #ifndef __MACH_SPEAR310_H | ||
| 17 | #define __MACH_SPEAR310_H | ||
| 18 | |||
| 19 | #define SPEAR310_NAND_BASE 0x40000000 | ||
| 20 | #define SPEAR310_NAND_SIZE 0x04000000 | ||
| 21 | |||
| 22 | #define SPEAR310_FSMC_BASE 0x44000000 | ||
| 23 | #define SPEAR310_FSMC_SIZE 0x01000000 | ||
| 24 | |||
| 25 | #define SPEAR310_UART1_BASE 0xB2000000 | ||
| 26 | #define SPEAR310_UART2_BASE 0xB2080000 | ||
| 27 | #define SPEAR310_UART3_BASE 0xB2100000 | ||
| 28 | #define SPEAR310_UART4_BASE 0xB2180000 | ||
| 29 | #define SPEAR310_UART5_BASE 0xB2200000 | ||
| 30 | #define SPEAR310_UART_SIZE 0x00080000 | ||
| 31 | |||
| 32 | #define SPEAR310_HDLC_BASE 0xB2800000 | ||
| 33 | #define SPEAR310_HDLC_SIZE 0x00800000 | ||
| 34 | |||
| 35 | #define SPEAR310_RS485_0_BASE 0xB3000000 | ||
| 36 | #define SPEAR310_RS485_0_SIZE 0x00800000 | ||
| 37 | |||
| 38 | #define SPEAR310_RS485_1_BASE 0xB3800000 | ||
| 39 | #define SPEAR310_RS485_1_SIZE 0x00800000 | ||
| 40 | |||
| 41 | #define SPEAR310_SOC_CONFIG_BASE 0xB4000000 | ||
| 42 | #define SPEAR310_SOC_CONFIG_SIZE 0x00000070 | ||
| 43 | /* Interrupt registers offsets and masks */ | ||
| 44 | #define INT_STS_MASK_REG 0x04 | ||
| 45 | #define SMII0_IRQ_MASK (1 << 0) | ||
| 46 | #define SMII1_IRQ_MASK (1 << 1) | ||
| 47 | #define SMII2_IRQ_MASK (1 << 2) | ||
| 48 | #define SMII3_IRQ_MASK (1 << 3) | ||
| 49 | #define WAKEUP_SMII0_IRQ_MASK (1 << 4) | ||
| 50 | #define WAKEUP_SMII1_IRQ_MASK (1 << 5) | ||
| 51 | #define WAKEUP_SMII2_IRQ_MASK (1 << 6) | ||
| 52 | #define WAKEUP_SMII3_IRQ_MASK (1 << 7) | ||
| 53 | #define UART1_IRQ_MASK (1 << 8) | ||
| 54 | #define UART2_IRQ_MASK (1 << 9) | ||
| 55 | #define UART3_IRQ_MASK (1 << 10) | ||
| 56 | #define UART4_IRQ_MASK (1 << 11) | ||
| 57 | #define UART5_IRQ_MASK (1 << 12) | ||
| 58 | #define EMI_IRQ_MASK (1 << 13) | ||
| 59 | #define TDM_HDLC_IRQ_MASK (1 << 14) | ||
| 60 | #define RS485_0_IRQ_MASK (1 << 15) | ||
| 61 | #define RS485_1_IRQ_MASK (1 << 16) | ||
| 62 | |||
| 63 | #define SHIRQ_RAS1_MASK 0x000FF | ||
| 64 | #define SHIRQ_RAS2_MASK 0x01F00 | ||
| 65 | #define SHIRQ_RAS3_MASK 0x02000 | ||
| 66 | #define SHIRQ_INTRCOMM_RAS_MASK 0x1C000 | ||
| 67 | |||
| 68 | #endif /* __MACH_SPEAR310_H */ | ||
| 69 | |||
| 70 | #endif /* CONFIG_MACH_SPEAR310 */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/spear320.h b/arch/arm/mach-spear3xx/include/mach/spear320.h new file mode 100644 index 000000000000..cacf17a958cd --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/spear320.h | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/spear320.h | ||
| 3 | * | ||
| 4 | * SPEAr320 Machine specific definition | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifdef CONFIG_MACH_SPEAR320 | ||
| 15 | |||
| 16 | #ifndef __MACH_SPEAR320_H | ||
| 17 | #define __MACH_SPEAR320_H | ||
| 18 | |||
| 19 | #define SPEAR320_EMI_CTRL_BASE 0x40000000 | ||
| 20 | #define SPEAR320_EMI_CTRL_SIZE 0x08000000 | ||
| 21 | |||
| 22 | #define SPEAR320_FSMC_BASE 0x4C000000 | ||
| 23 | #define SPEAR320_FSMC_SIZE 0x01000000 | ||
| 24 | |||
| 25 | #define SPEAR320_I2S_BASE 0x60000000 | ||
| 26 | #define SPEAR320_I2S_SIZE 0x10000000 | ||
| 27 | |||
| 28 | #define SPEAR320_SDIO_BASE 0x70000000 | ||
| 29 | #define SPEAR320_SDIO_SIZE 0x10000000 | ||
| 30 | |||
| 31 | #define SPEAR320_CLCD_BASE 0x90000000 | ||
| 32 | #define SPEAR320_CLCD_SIZE 0x10000000 | ||
| 33 | |||
| 34 | #define SPEAR320_PAR_PORT_BASE 0xA0000000 | ||
| 35 | #define SPEAR320_PAR_PORT_SIZE 0x01000000 | ||
| 36 | |||
| 37 | #define SPEAR320_CAN0_BASE 0xA1000000 | ||
| 38 | #define SPEAR320_CAN0_SIZE 0x01000000 | ||
| 39 | |||
| 40 | #define SPEAR320_CAN1_BASE 0xA2000000 | ||
| 41 | #define SPEAR320_CAN1_SIZE 0x01000000 | ||
| 42 | |||
| 43 | #define SPEAR320_UART1_BASE 0xA3000000 | ||
| 44 | #define SPEAR320_UART2_BASE 0xA4000000 | ||
| 45 | #define SPEAR320_UART_SIZE 0x01000000 | ||
| 46 | |||
| 47 | #define SPEAR320_SSP0_BASE 0xA5000000 | ||
| 48 | #define SPEAR320_SSP0_SIZE 0x01000000 | ||
| 49 | |||
| 50 | #define SPEAR320_SSP1_BASE 0xA6000000 | ||
| 51 | #define SPEAR320_SSP1_SIZE 0x01000000 | ||
| 52 | |||
| 53 | #define SPEAR320_I2C_BASE 0xA7000000 | ||
| 54 | #define SPEAR320_I2C_SIZE 0x01000000 | ||
| 55 | |||
| 56 | #define SPEAR320_PWM_BASE 0xA8000000 | ||
| 57 | #define SPEAR320_PWM_SIZE 0x01000000 | ||
| 58 | |||
| 59 | #define SPEAR320_SMII0_BASE 0xAA000000 | ||
| 60 | #define SPEAR320_SMII0_SIZE 0x01000000 | ||
| 61 | |||
| 62 | #define SPEAR320_SMII1_BASE 0xAB000000 | ||
| 63 | #define SPEAR320_SMII1_SIZE 0x01000000 | ||
| 64 | |||
| 65 | #define SPEAR320_SOC_CONFIG_BASE 0xB4000000 | ||
| 66 | #define SPEAR320_SOC_CONFIG_SIZE 0x00000070 | ||
| 67 | /* Interrupt registers offsets and masks */ | ||
| 68 | #define INT_STS_MASK_REG 0x04 | ||
| 69 | #define INT_CLR_MASK_REG 0x04 | ||
| 70 | #define INT_ENB_MASK_REG 0x08 | ||
| 71 | #define GPIO_IRQ_MASK (1 << 0) | ||
| 72 | #define I2S_PLAY_IRQ_MASK (1 << 1) | ||
| 73 | #define I2S_REC_IRQ_MASK (1 << 2) | ||
| 74 | #define EMI_IRQ_MASK (1 << 7) | ||
| 75 | #define CLCD_IRQ_MASK (1 << 8) | ||
| 76 | #define SPP_IRQ_MASK (1 << 9) | ||
| 77 | #define SDIO_IRQ_MASK (1 << 10) | ||
| 78 | #define CAN_U_IRQ_MASK (1 << 11) | ||
| 79 | #define CAN_L_IRQ_MASK (1 << 12) | ||
| 80 | #define UART1_IRQ_MASK (1 << 13) | ||
| 81 | #define UART2_IRQ_MASK (1 << 14) | ||
| 82 | #define SSP1_IRQ_MASK (1 << 15) | ||
| 83 | #define SSP2_IRQ_MASK (1 << 16) | ||
| 84 | #define SMII0_IRQ_MASK (1 << 17) | ||
| 85 | #define MII1_SMII1_IRQ_MASK (1 << 18) | ||
| 86 | #define WAKEUP_SMII0_IRQ_MASK (1 << 19) | ||
| 87 | #define WAKEUP_MII1_SMII1_IRQ_MASK (1 << 20) | ||
| 88 | #define I2C1_IRQ_MASK (1 << 21) | ||
| 89 | |||
| 90 | #define SHIRQ_RAS1_MASK 0x000380 | ||
| 91 | #define SHIRQ_RAS3_MASK 0x000007 | ||
| 92 | #define SHIRQ_INTRCOMM_RAS_MASK 0x3FF800 | ||
| 93 | |||
| 94 | #endif /* __MACH_SPEAR320_H */ | ||
| 95 | |||
| 96 | #endif /* CONFIG_MACH_SPEAR320 */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/system.h b/arch/arm/mach-spear3xx/include/mach/system.h new file mode 100644 index 000000000000..92cee6335c90 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/system.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/system.h | ||
| 3 | * | ||
| 4 | * SPEAr3xx Machine family specific architecture functions | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_SYSTEM_H | ||
| 15 | #define __MACH_SYSTEM_H | ||
| 16 | |||
| 17 | #include <plat/system.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_SYSTEM_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/timex.h b/arch/arm/mach-spear3xx/include/mach/timex.h new file mode 100644 index 000000000000..a38cc9de876f --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/timex.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/timex.h | ||
| 3 | * | ||
| 4 | * SPEAr3XX machine family specific timex definitions | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_TIMEX_H | ||
| 15 | #define __MACH_TIMEX_H | ||
| 16 | |||
| 17 | #include <plat/timex.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_TIMEX_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/uncompress.h b/arch/arm/mach-spear3xx/include/mach/uncompress.h new file mode 100644 index 000000000000..53ba8bbc0dfa --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/uncompress.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/uncompress.h | ||
| 3 | * | ||
| 4 | * Serial port stubs for kernel decompress status messages | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_UNCOMPRESS_H | ||
| 15 | #define __MACH_UNCOMPRESS_H | ||
| 16 | |||
| 17 | #include <plat/uncompress.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/mach-spear3xx/include/mach/vmalloc.h b/arch/arm/mach-spear3xx/include/mach/vmalloc.h new file mode 100644 index 000000000000..df977b3c9a63 --- /dev/null +++ b/arch/arm/mach-spear3xx/include/mach/vmalloc.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/include/mach/vmalloc.h | ||
| 3 | * | ||
| 4 | * Defining Vmalloc area for SPEAr3xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_VMALLOC_H | ||
| 15 | #define __MACH_VMALLOC_H | ||
| 16 | |||
| 17 | #include <plat/vmalloc.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_VMALLOC_H */ | ||
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c new file mode 100644 index 000000000000..3560f8c1e723 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear300.c | |||
| @@ -0,0 +1,468 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/spear300.c | ||
| 3 | * | ||
| 4 | * SPEAr300 machine source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/types.h> | ||
| 15 | #include <linux/amba/pl061.h> | ||
| 16 | #include <linux/ptrace.h> | ||
| 17 | #include <asm/irq.h> | ||
| 18 | #include <mach/generic.h> | ||
| 19 | #include <mach/spear.h> | ||
| 20 | #include <plat/shirq.h> | ||
| 21 | |||
| 22 | /* pad multiplexing support */ | ||
| 23 | /* muxing registers */ | ||
| 24 | #define PAD_MUX_CONFIG_REG 0x00 | ||
| 25 | #define MODE_CONFIG_REG 0x04 | ||
| 26 | |||
| 27 | /* modes */ | ||
| 28 | #define NAND_MODE (1 << 0) | ||
| 29 | #define NOR_MODE (1 << 1) | ||
| 30 | #define PHOTO_FRAME_MODE (1 << 2) | ||
| 31 | #define LEND_IP_PHONE_MODE (1 << 3) | ||
| 32 | #define HEND_IP_PHONE_MODE (1 << 4) | ||
| 33 | #define LEND_WIFI_PHONE_MODE (1 << 5) | ||
| 34 | #define HEND_WIFI_PHONE_MODE (1 << 6) | ||
| 35 | #define ATA_PABX_WI2S_MODE (1 << 7) | ||
| 36 | #define ATA_PABX_I2S_MODE (1 << 8) | ||
| 37 | #define CAML_LCDW_MODE (1 << 9) | ||
| 38 | #define CAMU_LCD_MODE (1 << 10) | ||
| 39 | #define CAMU_WLCD_MODE (1 << 11) | ||
| 40 | #define CAML_LCD_MODE (1 << 12) | ||
| 41 | #define ALL_MODES 0x1FFF | ||
| 42 | |||
| 43 | struct pmx_mode nand_mode = { | ||
| 44 | .id = NAND_MODE, | ||
| 45 | .name = "nand mode", | ||
| 46 | .mask = 0x00, | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct pmx_mode nor_mode = { | ||
| 50 | .id = NOR_MODE, | ||
| 51 | .name = "nor mode", | ||
| 52 | .mask = 0x01, | ||
| 53 | }; | ||
| 54 | |||
| 55 | struct pmx_mode photo_frame_mode = { | ||
| 56 | .id = PHOTO_FRAME_MODE, | ||
| 57 | .name = "photo frame mode", | ||
| 58 | .mask = 0x02, | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct pmx_mode lend_ip_phone_mode = { | ||
| 62 | .id = LEND_IP_PHONE_MODE, | ||
| 63 | .name = "lend ip phone mode", | ||
| 64 | .mask = 0x03, | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct pmx_mode hend_ip_phone_mode = { | ||
| 68 | .id = HEND_IP_PHONE_MODE, | ||
| 69 | .name = "hend ip phone mode", | ||
| 70 | .mask = 0x04, | ||
| 71 | }; | ||
| 72 | |||
| 73 | struct pmx_mode lend_wifi_phone_mode = { | ||
| 74 | .id = LEND_WIFI_PHONE_MODE, | ||
| 75 | .name = "lend wifi phone mode", | ||
| 76 | .mask = 0x05, | ||
| 77 | }; | ||
| 78 | |||
| 79 | struct pmx_mode hend_wifi_phone_mode = { | ||
| 80 | .id = HEND_WIFI_PHONE_MODE, | ||
| 81 | .name = "hend wifi phone mode", | ||
| 82 | .mask = 0x06, | ||
| 83 | }; | ||
| 84 | |||
| 85 | struct pmx_mode ata_pabx_wi2s_mode = { | ||
| 86 | .id = ATA_PABX_WI2S_MODE, | ||
| 87 | .name = "ata pabx wi2s mode", | ||
| 88 | .mask = 0x07, | ||
| 89 | }; | ||
| 90 | |||
| 91 | struct pmx_mode ata_pabx_i2s_mode = { | ||
| 92 | .id = ATA_PABX_I2S_MODE, | ||
| 93 | .name = "ata pabx i2s mode", | ||
| 94 | .mask = 0x08, | ||
| 95 | }; | ||
| 96 | |||
| 97 | struct pmx_mode caml_lcdw_mode = { | ||
| 98 | .id = CAML_LCDW_MODE, | ||
| 99 | .name = "caml lcdw mode", | ||
| 100 | .mask = 0x0C, | ||
| 101 | }; | ||
| 102 | |||
| 103 | struct pmx_mode camu_lcd_mode = { | ||
| 104 | .id = CAMU_LCD_MODE, | ||
| 105 | .name = "camu lcd mode", | ||
| 106 | .mask = 0x0D, | ||
| 107 | }; | ||
| 108 | |||
| 109 | struct pmx_mode camu_wlcd_mode = { | ||
| 110 | .id = CAMU_WLCD_MODE, | ||
| 111 | .name = "camu wlcd mode", | ||
| 112 | .mask = 0x0E, | ||
| 113 | }; | ||
| 114 | |||
| 115 | struct pmx_mode caml_lcd_mode = { | ||
| 116 | .id = CAML_LCD_MODE, | ||
| 117 | .name = "caml lcd mode", | ||
| 118 | .mask = 0x0F, | ||
| 119 | }; | ||
| 120 | |||
| 121 | /* devices */ | ||
| 122 | struct pmx_dev_mode pmx_fsmc_2_chips_modes[] = { | ||
| 123 | { | ||
| 124 | .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE | | ||
| 125 | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE, | ||
| 126 | .mask = PMX_FIRDA_MASK, | ||
| 127 | }, | ||
| 128 | }; | ||
| 129 | |||
| 130 | struct pmx_dev pmx_fsmc_2_chips = { | ||
| 131 | .name = "fsmc_2_chips", | ||
| 132 | .modes = pmx_fsmc_2_chips_modes, | ||
| 133 | .mode_count = ARRAY_SIZE(pmx_fsmc_2_chips_modes), | ||
| 134 | .enb_on_reset = 1, | ||
| 135 | }; | ||
| 136 | |||
| 137 | struct pmx_dev_mode pmx_fsmc_4_chips_modes[] = { | ||
| 138 | { | ||
| 139 | .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE | | ||
| 140 | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE, | ||
| 141 | .mask = PMX_FIRDA_MASK | PMX_UART0_MASK, | ||
| 142 | }, | ||
| 143 | }; | ||
| 144 | |||
| 145 | struct pmx_dev pmx_fsmc_4_chips = { | ||
| 146 | .name = "fsmc_4_chips", | ||
| 147 | .modes = pmx_fsmc_4_chips_modes, | ||
| 148 | .mode_count = ARRAY_SIZE(pmx_fsmc_4_chips_modes), | ||
| 149 | .enb_on_reset = 1, | ||
| 150 | }; | ||
| 151 | |||
| 152 | struct pmx_dev_mode pmx_keyboard_modes[] = { | ||
| 153 | { | ||
| 154 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | | ||
| 155 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | | ||
| 156 | CAML_LCDW_MODE | CAMU_LCD_MODE | CAMU_WLCD_MODE | | ||
| 157 | CAML_LCD_MODE, | ||
| 158 | .mask = 0x0, | ||
| 159 | }, | ||
| 160 | }; | ||
| 161 | |||
| 162 | struct pmx_dev pmx_keyboard = { | ||
| 163 | .name = "keyboard", | ||
| 164 | .modes = pmx_keyboard_modes, | ||
| 165 | .mode_count = ARRAY_SIZE(pmx_keyboard_modes), | ||
| 166 | .enb_on_reset = 1, | ||
| 167 | }; | ||
| 168 | |||
| 169 | struct pmx_dev_mode pmx_clcd_modes[] = { | ||
| 170 | { | ||
| 171 | .ids = PHOTO_FRAME_MODE, | ||
| 172 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK , | ||
| 173 | }, { | ||
| 174 | .ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE | | ||
| 175 | CAMU_LCD_MODE | CAML_LCD_MODE, | ||
| 176 | .mask = PMX_TIMER_3_4_MASK, | ||
| 177 | }, | ||
| 178 | }; | ||
| 179 | |||
| 180 | struct pmx_dev pmx_clcd = { | ||
| 181 | .name = "clcd", | ||
| 182 | .modes = pmx_clcd_modes, | ||
| 183 | .mode_count = ARRAY_SIZE(pmx_clcd_modes), | ||
| 184 | .enb_on_reset = 1, | ||
| 185 | }; | ||
| 186 | |||
| 187 | struct pmx_dev_mode pmx_telecom_gpio_modes[] = { | ||
| 188 | { | ||
| 189 | .ids = PHOTO_FRAME_MODE | CAMU_LCD_MODE | CAML_LCD_MODE, | ||
| 190 | .mask = PMX_MII_MASK, | ||
| 191 | }, { | ||
| 192 | .ids = LEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE, | ||
| 193 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, | ||
| 194 | }, { | ||
| 195 | .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_WLCD_MODE, | ||
| 196 | .mask = PMX_MII_MASK | PMX_TIMER_3_4_MASK, | ||
| 197 | }, { | ||
| 198 | .ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE, | ||
| 199 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK, | ||
| 200 | }, { | ||
| 201 | .ids = ATA_PABX_WI2S_MODE, | ||
| 202 | .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | ||
| 203 | | PMX_UART0_MODEM_MASK, | ||
| 204 | }, | ||
| 205 | }; | ||
| 206 | |||
| 207 | struct pmx_dev pmx_telecom_gpio = { | ||
| 208 | .name = "telecom_gpio", | ||
| 209 | .modes = pmx_telecom_gpio_modes, | ||
| 210 | .mode_count = ARRAY_SIZE(pmx_telecom_gpio_modes), | ||
| 211 | .enb_on_reset = 1, | ||
| 212 | }; | ||
| 213 | |||
| 214 | struct pmx_dev_mode pmx_telecom_tdm_modes[] = { | ||
| 215 | { | ||
| 216 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | | ||
| 217 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | ||
| 218 | | HEND_WIFI_PHONE_MODE | ATA_PABX_WI2S_MODE | ||
| 219 | | ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | ||
| 220 | | CAMU_WLCD_MODE | CAML_LCD_MODE, | ||
| 221 | .mask = PMX_UART0_MODEM_MASK | PMX_SSP_CS_MASK, | ||
| 222 | }, | ||
| 223 | }; | ||
| 224 | |||
| 225 | struct pmx_dev pmx_telecom_tdm = { | ||
| 226 | .name = "telecom_tdm", | ||
| 227 | .modes = pmx_telecom_tdm_modes, | ||
| 228 | .mode_count = ARRAY_SIZE(pmx_telecom_tdm_modes), | ||
| 229 | .enb_on_reset = 1, | ||
| 230 | }; | ||
| 231 | |||
| 232 | struct pmx_dev_mode pmx_telecom_spi_cs_i2c_clk_modes[] = { | ||
| 233 | { | ||
| 234 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | | ||
| 235 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | ||
| 236 | | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE | | ||
| 237 | CAML_LCDW_MODE | CAML_LCD_MODE, | ||
| 238 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, | ||
| 239 | }, | ||
| 240 | }; | ||
| 241 | |||
| 242 | struct pmx_dev pmx_telecom_spi_cs_i2c_clk = { | ||
| 243 | .name = "telecom_spi_cs_i2c_clk", | ||
| 244 | .modes = pmx_telecom_spi_cs_i2c_clk_modes, | ||
| 245 | .mode_count = ARRAY_SIZE(pmx_telecom_spi_cs_i2c_clk_modes), | ||
| 246 | .enb_on_reset = 1, | ||
| 247 | }; | ||
| 248 | |||
| 249 | struct pmx_dev_mode pmx_telecom_camera_modes[] = { | ||
| 250 | { | ||
| 251 | .ids = CAML_LCDW_MODE | CAML_LCD_MODE, | ||
| 252 | .mask = PMX_MII_MASK, | ||
| 253 | }, { | ||
| 254 | .ids = CAMU_LCD_MODE | CAMU_WLCD_MODE, | ||
| 255 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | PMX_MII_MASK, | ||
| 256 | }, | ||
| 257 | }; | ||
| 258 | |||
| 259 | struct pmx_dev pmx_telecom_camera = { | ||
| 260 | .name = "telecom_camera", | ||
| 261 | .modes = pmx_telecom_camera_modes, | ||
| 262 | .mode_count = ARRAY_SIZE(pmx_telecom_camera_modes), | ||
| 263 | .enb_on_reset = 1, | ||
| 264 | }; | ||
| 265 | |||
| 266 | struct pmx_dev_mode pmx_telecom_dac_modes[] = { | ||
| 267 | { | ||
| 268 | .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | ||
| 269 | | CAMU_WLCD_MODE | CAML_LCD_MODE, | ||
| 270 | .mask = PMX_TIMER_1_2_MASK, | ||
| 271 | }, | ||
| 272 | }; | ||
| 273 | |||
| 274 | struct pmx_dev pmx_telecom_dac = { | ||
| 275 | .name = "telecom_dac", | ||
| 276 | .modes = pmx_telecom_dac_modes, | ||
| 277 | .mode_count = ARRAY_SIZE(pmx_telecom_dac_modes), | ||
| 278 | .enb_on_reset = 1, | ||
| 279 | }; | ||
| 280 | |||
| 281 | struct pmx_dev_mode pmx_telecom_i2s_modes[] = { | ||
| 282 | { | ||
| 283 | .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | ||
| 284 | | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | | ||
| 285 | ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | ||
| 286 | | CAMU_WLCD_MODE | CAML_LCD_MODE, | ||
| 287 | .mask = PMX_UART0_MODEM_MASK, | ||
| 288 | }, | ||
| 289 | }; | ||
| 290 | |||
| 291 | struct pmx_dev pmx_telecom_i2s = { | ||
| 292 | .name = "telecom_i2s", | ||
| 293 | .modes = pmx_telecom_i2s_modes, | ||
| 294 | .mode_count = ARRAY_SIZE(pmx_telecom_i2s_modes), | ||
| 295 | .enb_on_reset = 1, | ||
| 296 | }; | ||
| 297 | |||
| 298 | struct pmx_dev_mode pmx_telecom_boot_pins_modes[] = { | ||
| 299 | { | ||
| 300 | .ids = NAND_MODE | NOR_MODE, | ||
| 301 | .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK | | ||
| 302 | PMX_TIMER_3_4_MASK, | ||
| 303 | }, | ||
| 304 | }; | ||
| 305 | |||
| 306 | struct pmx_dev pmx_telecom_boot_pins = { | ||
| 307 | .name = "telecom_boot_pins", | ||
| 308 | .modes = pmx_telecom_boot_pins_modes, | ||
| 309 | .mode_count = ARRAY_SIZE(pmx_telecom_boot_pins_modes), | ||
| 310 | .enb_on_reset = 1, | ||
| 311 | }; | ||
| 312 | |||
| 313 | struct pmx_dev_mode pmx_telecom_sdio_4bit_modes[] = { | ||
| 314 | { | ||
| 315 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | | ||
| 316 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | | ||
| 317 | HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | | ||
| 318 | CAMU_WLCD_MODE | CAML_LCD_MODE | ATA_PABX_WI2S_MODE | | ||
| 319 | ATA_PABX_I2S_MODE, | ||
| 320 | .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK | | ||
| 321 | PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | | ||
| 322 | PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK, | ||
| 323 | }, | ||
| 324 | }; | ||
| 325 | |||
| 326 | struct pmx_dev pmx_telecom_sdio_4bit = { | ||
| 327 | .name = "telecom_sdio_4bit", | ||
| 328 | .modes = pmx_telecom_sdio_4bit_modes, | ||
| 329 | .mode_count = ARRAY_SIZE(pmx_telecom_sdio_4bit_modes), | ||
| 330 | .enb_on_reset = 1, | ||
| 331 | }; | ||
| 332 | |||
| 333 | struct pmx_dev_mode pmx_telecom_sdio_8bit_modes[] = { | ||
| 334 | { | ||
| 335 | .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | | ||
| 336 | HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | | ||
| 337 | HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE | | ||
| 338 | CAMU_WLCD_MODE | CAML_LCD_MODE, | ||
| 339 | .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK | | ||
| 340 | PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | | ||
| 341 | PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK | PMX_MII_MASK, | ||
| 342 | }, | ||
| 343 | }; | ||
| 344 | |||
| 345 | struct pmx_dev pmx_telecom_sdio_8bit = { | ||
| 346 | .name = "telecom_sdio_8bit", | ||
| 347 | .modes = pmx_telecom_sdio_8bit_modes, | ||
| 348 | .mode_count = ARRAY_SIZE(pmx_telecom_sdio_8bit_modes), | ||
| 349 | .enb_on_reset = 1, | ||
| 350 | }; | ||
| 351 | |||
| 352 | struct pmx_dev_mode pmx_gpio1_modes[] = { | ||
| 353 | { | ||
| 354 | .ids = PHOTO_FRAME_MODE, | ||
| 355 | .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK | | ||
| 356 | PMX_TIMER_3_4_MASK, | ||
| 357 | }, | ||
| 358 | }; | ||
| 359 | |||
| 360 | struct pmx_dev pmx_gpio1 = { | ||
| 361 | .name = "arm gpio1", | ||
| 362 | .modes = pmx_gpio1_modes, | ||
| 363 | .mode_count = ARRAY_SIZE(pmx_gpio1_modes), | ||
| 364 | .enb_on_reset = 1, | ||
| 365 | }; | ||
| 366 | |||
| 367 | /* pmx driver structure */ | ||
| 368 | struct pmx_driver pmx_driver = { | ||
| 369 | .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x0000000f}, | ||
| 370 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, | ||
| 371 | }; | ||
| 372 | |||
| 373 | /* Add spear300 specific devices here */ | ||
| 374 | /* arm gpio1 device registeration */ | ||
| 375 | static struct pl061_platform_data gpio1_plat_data = { | ||
| 376 | .gpio_base = 8, | ||
| 377 | .irq_base = SPEAR_GPIO1_INT_BASE, | ||
| 378 | }; | ||
| 379 | |||
| 380 | struct amba_device gpio1_device = { | ||
| 381 | .dev = { | ||
| 382 | .init_name = "gpio1", | ||
| 383 | .platform_data = &gpio1_plat_data, | ||
| 384 | }, | ||
| 385 | .res = { | ||
| 386 | .start = SPEAR300_GPIO_BASE, | ||
| 387 | .end = SPEAR300_GPIO_BASE + SPEAR300_GPIO_SIZE - 1, | ||
| 388 | .flags = IORESOURCE_MEM, | ||
| 389 | }, | ||
| 390 | .irq = {VIRQ_GPIO1, NO_IRQ}, | ||
| 391 | }; | ||
| 392 | |||
| 393 | /* spear3xx shared irq */ | ||
| 394 | struct shirq_dev_config shirq_ras1_config[] = { | ||
| 395 | { | ||
| 396 | .virq = VIRQ_IT_PERS_S, | ||
| 397 | .enb_mask = IT_PERS_S_IRQ_MASK, | ||
| 398 | .status_mask = IT_PERS_S_IRQ_MASK, | ||
| 399 | }, { | ||
| 400 | .virq = VIRQ_IT_CHANGE_S, | ||
| 401 | .enb_mask = IT_CHANGE_S_IRQ_MASK, | ||
| 402 | .status_mask = IT_CHANGE_S_IRQ_MASK, | ||
| 403 | }, { | ||
| 404 | .virq = VIRQ_I2S, | ||
| 405 | .enb_mask = I2S_IRQ_MASK, | ||
| 406 | .status_mask = I2S_IRQ_MASK, | ||
| 407 | }, { | ||
| 408 | .virq = VIRQ_TDM, | ||
| 409 | .enb_mask = TDM_IRQ_MASK, | ||
| 410 | .status_mask = TDM_IRQ_MASK, | ||
| 411 | }, { | ||
| 412 | .virq = VIRQ_CAMERA_L, | ||
| 413 | .enb_mask = CAMERA_L_IRQ_MASK, | ||
| 414 | .status_mask = CAMERA_L_IRQ_MASK, | ||
| 415 | }, { | ||
| 416 | .virq = VIRQ_CAMERA_F, | ||
| 417 | .enb_mask = CAMERA_F_IRQ_MASK, | ||
| 418 | .status_mask = CAMERA_F_IRQ_MASK, | ||
| 419 | }, { | ||
| 420 | .virq = VIRQ_CAMERA_V, | ||
| 421 | .enb_mask = CAMERA_V_IRQ_MASK, | ||
| 422 | .status_mask = CAMERA_V_IRQ_MASK, | ||
| 423 | }, { | ||
| 424 | .virq = VIRQ_KEYBOARD, | ||
| 425 | .enb_mask = KEYBOARD_IRQ_MASK, | ||
| 426 | .status_mask = KEYBOARD_IRQ_MASK, | ||
| 427 | }, { | ||
| 428 | .virq = VIRQ_GPIO1, | ||
| 429 | .enb_mask = GPIO1_IRQ_MASK, | ||
| 430 | .status_mask = GPIO1_IRQ_MASK, | ||
| 431 | }, | ||
| 432 | }; | ||
| 433 | |||
| 434 | struct spear_shirq shirq_ras1 = { | ||
| 435 | .irq = IRQ_GEN_RAS_1, | ||
| 436 | .dev_config = shirq_ras1_config, | ||
| 437 | .dev_count = ARRAY_SIZE(shirq_ras1_config), | ||
| 438 | .regs = { | ||
| 439 | .enb_reg = INT_ENB_MASK_REG, | ||
| 440 | .status_reg = INT_STS_MASK_REG, | ||
| 441 | .status_reg_mask = SHIRQ_RAS1_MASK, | ||
| 442 | .clear_reg = -1, | ||
| 443 | }, | ||
| 444 | }; | ||
| 445 | |||
| 446 | /* spear300 routines */ | ||
| 447 | void __init spear300_init(void) | ||
| 448 | { | ||
| 449 | int ret = 0; | ||
| 450 | |||
| 451 | /* call spear3xx family common init function */ | ||
| 452 | spear3xx_init(); | ||
| 453 | |||
| 454 | /* shared irq registeration */ | ||
| 455 | shirq_ras1.regs.base = | ||
| 456 | ioremap(SPEAR300_TELECOM_BASE, SPEAR300_TELECOM_REG_SIZE); | ||
| 457 | if (shirq_ras1.regs.base) { | ||
| 458 | ret = spear_shirq_register(&shirq_ras1); | ||
| 459 | if (ret) | ||
| 460 | printk(KERN_ERR "Error registering Shared IRQ\n"); | ||
| 461 | } | ||
| 462 | } | ||
| 463 | |||
| 464 | void spear300_pmx_init(void) | ||
| 465 | { | ||
| 466 | spear_pmx_init(&pmx_driver, SPEAR300_SOC_CONFIG_BASE, | ||
| 467 | SPEAR300_SOC_CONFIG_SIZE); | ||
| 468 | } | ||
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c new file mode 100644 index 000000000000..bb21db152a23 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear300_evb.c | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/spear300_evb.c | ||
| 3 | * | ||
| 4 | * SPEAr300 evaluation board source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <asm/mach/arch.h> | ||
| 15 | #include <asm/mach-types.h> | ||
| 16 | #include <mach/generic.h> | ||
| 17 | #include <mach/spear.h> | ||
| 18 | |||
| 19 | /* padmux devices to enable */ | ||
| 20 | static struct pmx_dev *pmx_devs[] = { | ||
| 21 | /* spear3xx specific devices */ | ||
| 22 | &pmx_i2c, | ||
| 23 | &pmx_ssp_cs, | ||
| 24 | &pmx_ssp, | ||
| 25 | &pmx_mii, | ||
| 26 | &pmx_uart0, | ||
| 27 | |||
| 28 | /* spear300 specific devices */ | ||
| 29 | &pmx_fsmc_2_chips, | ||
| 30 | &pmx_clcd, | ||
| 31 | &pmx_telecom_sdio_4bit, | ||
| 32 | &pmx_gpio1, | ||
| 33 | }; | ||
| 34 | |||
| 35 | static struct amba_device *amba_devs[] __initdata = { | ||
| 36 | /* spear3xx specific devices */ | ||
| 37 | &gpio_device, | ||
| 38 | &uart_device, | ||
| 39 | |||
| 40 | /* spear300 specific devices */ | ||
| 41 | &gpio1_device, | ||
| 42 | }; | ||
| 43 | |||
| 44 | static struct platform_device *plat_devs[] __initdata = { | ||
| 45 | /* spear3xx specific devices */ | ||
| 46 | |||
| 47 | /* spear300 specific devices */ | ||
| 48 | }; | ||
| 49 | |||
| 50 | static void __init spear300_evb_init(void) | ||
| 51 | { | ||
| 52 | unsigned int i; | ||
| 53 | |||
| 54 | /* call spear300 machine init function */ | ||
| 55 | spear300_init(); | ||
| 56 | |||
| 57 | /* padmux initialization */ | ||
| 58 | pmx_driver.mode = &photo_frame_mode; | ||
| 59 | pmx_driver.devs = pmx_devs; | ||
| 60 | pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); | ||
| 61 | spear300_pmx_init(); | ||
| 62 | |||
| 63 | /* Add Platform Devices */ | ||
| 64 | platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); | ||
| 65 | |||
| 66 | /* Add Amba Devices */ | ||
| 67 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
| 68 | amba_device_register(amba_devs[i], &iomem_resource); | ||
| 69 | } | ||
| 70 | |||
| 71 | MACHINE_START(SPEAR300, "ST-SPEAR300-EVB") | ||
| 72 | .boot_params = 0x00000100, | ||
| 73 | .map_io = spear3xx_map_io, | ||
| 74 | .init_irq = spear3xx_init_irq, | ||
| 75 | .timer = &spear_sys_timer, | ||
| 76 | .init_machine = spear300_evb_init, | ||
| 77 | MACHINE_END | ||
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c new file mode 100644 index 000000000000..96a1ab824bac --- /dev/null +++ b/arch/arm/mach-spear3xx/spear310.c | |||
| @@ -0,0 +1,302 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/spear310.c | ||
| 3 | * | ||
| 4 | * SPEAr310 machine source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/ptrace.h> | ||
| 15 | #include <asm/irq.h> | ||
| 16 | #include <mach/generic.h> | ||
| 17 | #include <mach/spear.h> | ||
| 18 | #include <plat/shirq.h> | ||
| 19 | |||
| 20 | /* pad multiplexing support */ | ||
| 21 | /* muxing registers */ | ||
| 22 | #define PAD_MUX_CONFIG_REG 0x08 | ||
| 23 | |||
| 24 | /* devices */ | ||
| 25 | struct pmx_dev_mode pmx_emi_cs_0_1_4_5_modes[] = { | ||
| 26 | { | ||
| 27 | .ids = 0x00, | ||
| 28 | .mask = PMX_TIMER_3_4_MASK, | ||
| 29 | }, | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct pmx_dev pmx_emi_cs_0_1_4_5 = { | ||
| 33 | .name = "emi_cs_0_1_4_5", | ||
| 34 | .modes = pmx_emi_cs_0_1_4_5_modes, | ||
| 35 | .mode_count = ARRAY_SIZE(pmx_emi_cs_0_1_4_5_modes), | ||
| 36 | .enb_on_reset = 1, | ||
| 37 | }; | ||
| 38 | |||
| 39 | struct pmx_dev_mode pmx_emi_cs_2_3_modes[] = { | ||
| 40 | { | ||
| 41 | .ids = 0x00, | ||
| 42 | .mask = PMX_TIMER_1_2_MASK, | ||
| 43 | }, | ||
| 44 | }; | ||
| 45 | |||
| 46 | struct pmx_dev pmx_emi_cs_2_3 = { | ||
| 47 | .name = "emi_cs_2_3", | ||
| 48 | .modes = pmx_emi_cs_2_3_modes, | ||
| 49 | .mode_count = ARRAY_SIZE(pmx_emi_cs_2_3_modes), | ||
| 50 | .enb_on_reset = 1, | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct pmx_dev_mode pmx_uart1_modes[] = { | ||
| 54 | { | ||
| 55 | .ids = 0x00, | ||
| 56 | .mask = PMX_FIRDA_MASK, | ||
| 57 | }, | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct pmx_dev pmx_uart1 = { | ||
| 61 | .name = "uart1", | ||
| 62 | .modes = pmx_uart1_modes, | ||
| 63 | .mode_count = ARRAY_SIZE(pmx_uart1_modes), | ||
| 64 | .enb_on_reset = 1, | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct pmx_dev_mode pmx_uart2_modes[] = { | ||
| 68 | { | ||
| 69 | .ids = 0x00, | ||
| 70 | .mask = PMX_TIMER_1_2_MASK, | ||
| 71 | }, | ||
| 72 | }; | ||
| 73 | |||
| 74 | struct pmx_dev pmx_uart2 = { | ||
| 75 | .name = "uart2", | ||
| 76 | .modes = pmx_uart2_modes, | ||
| 77 | .mode_count = ARRAY_SIZE(pmx_uart2_modes), | ||
| 78 | .enb_on_reset = 1, | ||
| 79 | }; | ||
| 80 | |||
| 81 | struct pmx_dev_mode pmx_uart3_4_5_modes[] = { | ||
| 82 | { | ||
| 83 | .ids = 0x00, | ||
| 84 | .mask = PMX_UART0_MODEM_MASK, | ||
| 85 | }, | ||
| 86 | }; | ||
| 87 | |||
| 88 | struct pmx_dev pmx_uart3_4_5 = { | ||
| 89 | .name = "uart3_4_5", | ||
| 90 | .modes = pmx_uart3_4_5_modes, | ||
| 91 | .mode_count = ARRAY_SIZE(pmx_uart3_4_5_modes), | ||
| 92 | .enb_on_reset = 1, | ||
| 93 | }; | ||
| 94 | |||
| 95 | struct pmx_dev_mode pmx_fsmc_modes[] = { | ||
| 96 | { | ||
| 97 | .ids = 0x00, | ||
| 98 | .mask = PMX_SSP_CS_MASK, | ||
| 99 | }, | ||
| 100 | }; | ||
| 101 | |||
| 102 | struct pmx_dev pmx_fsmc = { | ||
| 103 | .name = "fsmc", | ||
| 104 | .modes = pmx_fsmc_modes, | ||
| 105 | .mode_count = ARRAY_SIZE(pmx_fsmc_modes), | ||
| 106 | .enb_on_reset = 1, | ||
| 107 | }; | ||
| 108 | |||
| 109 | struct pmx_dev_mode pmx_rs485_0_1_modes[] = { | ||
| 110 | { | ||
| 111 | .ids = 0x00, | ||
| 112 | .mask = PMX_MII_MASK, | ||
| 113 | }, | ||
| 114 | }; | ||
| 115 | |||
| 116 | struct pmx_dev pmx_rs485_0_1 = { | ||
| 117 | .name = "rs485_0_1", | ||
| 118 | .modes = pmx_rs485_0_1_modes, | ||
| 119 | .mode_count = ARRAY_SIZE(pmx_rs485_0_1_modes), | ||
| 120 | .enb_on_reset = 1, | ||
| 121 | }; | ||
| 122 | |||
| 123 | struct pmx_dev_mode pmx_tdm0_modes[] = { | ||
| 124 | { | ||
| 125 | .ids = 0x00, | ||
| 126 | .mask = PMX_MII_MASK, | ||
| 127 | }, | ||
| 128 | }; | ||
| 129 | |||
| 130 | struct pmx_dev pmx_tdm0 = { | ||
| 131 | .name = "tdm0", | ||
| 132 | .modes = pmx_tdm0_modes, | ||
| 133 | .mode_count = ARRAY_SIZE(pmx_tdm0_modes), | ||
| 134 | .enb_on_reset = 1, | ||
| 135 | }; | ||
| 136 | |||
| 137 | /* pmx driver structure */ | ||
| 138 | struct pmx_driver pmx_driver = { | ||
| 139 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, | ||
| 140 | }; | ||
| 141 | |||
| 142 | /* Add spear310 specific devices here */ | ||
| 143 | |||
| 144 | /* spear3xx shared irq */ | ||
| 145 | struct shirq_dev_config shirq_ras1_config[] = { | ||
| 146 | { | ||
| 147 | .virq = VIRQ_SMII0, | ||
| 148 | .status_mask = SMII0_IRQ_MASK, | ||
| 149 | }, { | ||
| 150 | .virq = VIRQ_SMII1, | ||
| 151 | .status_mask = SMII1_IRQ_MASK, | ||
| 152 | }, { | ||
| 153 | .virq = VIRQ_SMII2, | ||
| 154 | .status_mask = SMII2_IRQ_MASK, | ||
| 155 | }, { | ||
| 156 | .virq = VIRQ_SMII3, | ||
| 157 | .status_mask = SMII3_IRQ_MASK, | ||
| 158 | }, { | ||
| 159 | .virq = VIRQ_WAKEUP_SMII0, | ||
| 160 | .status_mask = WAKEUP_SMII0_IRQ_MASK, | ||
| 161 | }, { | ||
| 162 | .virq = VIRQ_WAKEUP_SMII1, | ||
| 163 | .status_mask = WAKEUP_SMII1_IRQ_MASK, | ||
| 164 | }, { | ||
| 165 | .virq = VIRQ_WAKEUP_SMII2, | ||
| 166 | .status_mask = WAKEUP_SMII2_IRQ_MASK, | ||
| 167 | }, { | ||
| 168 | .virq = VIRQ_WAKEUP_SMII3, | ||
| 169 | .status_mask = WAKEUP_SMII3_IRQ_MASK, | ||
| 170 | }, | ||
| 171 | }; | ||
| 172 | |||
| 173 | struct spear_shirq shirq_ras1 = { | ||
| 174 | .irq = IRQ_GEN_RAS_1, | ||
| 175 | .dev_config = shirq_ras1_config, | ||
| 176 | .dev_count = ARRAY_SIZE(shirq_ras1_config), | ||
| 177 | .regs = { | ||
| 178 | .enb_reg = -1, | ||
| 179 | .status_reg = INT_STS_MASK_REG, | ||
| 180 | .status_reg_mask = SHIRQ_RAS1_MASK, | ||
| 181 | .clear_reg = -1, | ||
| 182 | }, | ||
| 183 | }; | ||
| 184 | |||
| 185 | struct shirq_dev_config shirq_ras2_config[] = { | ||
| 186 | { | ||
| 187 | .virq = VIRQ_UART1, | ||
| 188 | .status_mask = UART1_IRQ_MASK, | ||
| 189 | }, { | ||
| 190 | .virq = VIRQ_UART2, | ||
| 191 | .status_mask = UART2_IRQ_MASK, | ||
| 192 | }, { | ||
| 193 | .virq = VIRQ_UART3, | ||
| 194 | .status_mask = UART3_IRQ_MASK, | ||
| 195 | }, { | ||
| 196 | .virq = VIRQ_UART4, | ||
| 197 | .status_mask = UART4_IRQ_MASK, | ||
| 198 | }, { | ||
| 199 | .virq = VIRQ_UART5, | ||
| 200 | .status_mask = UART5_IRQ_MASK, | ||
| 201 | }, | ||
| 202 | }; | ||
| 203 | |||
| 204 | struct spear_shirq shirq_ras2 = { | ||
| 205 | .irq = IRQ_GEN_RAS_2, | ||
| 206 | .dev_config = shirq_ras2_config, | ||
| 207 | .dev_count = ARRAY_SIZE(shirq_ras2_config), | ||
| 208 | .regs = { | ||
| 209 | .enb_reg = -1, | ||
| 210 | .status_reg = INT_STS_MASK_REG, | ||
| 211 | .status_reg_mask = SHIRQ_RAS2_MASK, | ||
| 212 | .clear_reg = -1, | ||
| 213 | }, | ||
| 214 | }; | ||
| 215 | |||
| 216 | struct shirq_dev_config shirq_ras3_config[] = { | ||
| 217 | { | ||
| 218 | .virq = VIRQ_EMI, | ||
| 219 | .status_mask = EMI_IRQ_MASK, | ||
| 220 | }, | ||
| 221 | }; | ||
| 222 | |||
| 223 | struct spear_shirq shirq_ras3 = { | ||
| 224 | .irq = IRQ_GEN_RAS_3, | ||
| 225 | .dev_config = shirq_ras3_config, | ||
| 226 | .dev_count = ARRAY_SIZE(shirq_ras3_config), | ||
| 227 | .regs = { | ||
| 228 | .enb_reg = -1, | ||
| 229 | .status_reg = INT_STS_MASK_REG, | ||
| 230 | .status_reg_mask = SHIRQ_RAS3_MASK, | ||
| 231 | .clear_reg = -1, | ||
| 232 | }, | ||
| 233 | }; | ||
| 234 | |||
| 235 | struct shirq_dev_config shirq_intrcomm_ras_config[] = { | ||
| 236 | { | ||
| 237 | .virq = VIRQ_TDM_HDLC, | ||
| 238 | .status_mask = TDM_HDLC_IRQ_MASK, | ||
| 239 | }, { | ||
| 240 | .virq = VIRQ_RS485_0, | ||
| 241 | .status_mask = RS485_0_IRQ_MASK, | ||
| 242 | }, { | ||
| 243 | .virq = VIRQ_RS485_1, | ||
| 244 | .status_mask = RS485_1_IRQ_MASK, | ||
| 245 | }, | ||
| 246 | }; | ||
| 247 | |||
| 248 | struct spear_shirq shirq_intrcomm_ras = { | ||
| 249 | .irq = IRQ_INTRCOMM_RAS_ARM, | ||
| 250 | .dev_config = shirq_intrcomm_ras_config, | ||
| 251 | .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config), | ||
| 252 | .regs = { | ||
| 253 | .enb_reg = -1, | ||
| 254 | .status_reg = INT_STS_MASK_REG, | ||
| 255 | .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK, | ||
| 256 | .clear_reg = -1, | ||
| 257 | }, | ||
| 258 | }; | ||
| 259 | |||
| 260 | /* spear310 routines */ | ||
| 261 | void __init spear310_init(void) | ||
| 262 | { | ||
| 263 | void __iomem *base; | ||
| 264 | int ret = 0; | ||
| 265 | |||
| 266 | /* call spear3xx family common init function */ | ||
| 267 | spear3xx_init(); | ||
| 268 | |||
| 269 | /* shared irq registeration */ | ||
| 270 | base = ioremap(SPEAR310_SOC_CONFIG_BASE, SPEAR310_SOC_CONFIG_SIZE); | ||
| 271 | if (base) { | ||
| 272 | /* shirq 1 */ | ||
| 273 | shirq_ras1.regs.base = base; | ||
| 274 | ret = spear_shirq_register(&shirq_ras1); | ||
| 275 | if (ret) | ||
| 276 | printk(KERN_ERR "Error registering Shared IRQ 1\n"); | ||
| 277 | |||
| 278 | /* shirq 2 */ | ||
| 279 | shirq_ras2.regs.base = base; | ||
| 280 | ret = spear_shirq_register(&shirq_ras2); | ||
| 281 | if (ret) | ||
| 282 | printk(KERN_ERR "Error registering Shared IRQ 2\n"); | ||
| 283 | |||
| 284 | /* shirq 3 */ | ||
| 285 | shirq_ras3.regs.base = base; | ||
| 286 | ret = spear_shirq_register(&shirq_ras3); | ||
| 287 | if (ret) | ||
| 288 | printk(KERN_ERR "Error registering Shared IRQ 3\n"); | ||
| 289 | |||
| 290 | /* shirq 4 */ | ||
| 291 | shirq_intrcomm_ras.regs.base = base; | ||
| 292 | ret = spear_shirq_register(&shirq_intrcomm_ras); | ||
| 293 | if (ret) | ||
| 294 | printk(KERN_ERR "Error registering Shared IRQ 4\n"); | ||
| 295 | } | ||
| 296 | } | ||
| 297 | |||
| 298 | void spear310_pmx_init(void) | ||
| 299 | { | ||
| 300 | spear_pmx_init(&pmx_driver, SPEAR310_SOC_CONFIG_BASE, | ||
| 301 | SPEAR310_SOC_CONFIG_SIZE); | ||
| 302 | } | ||
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c new file mode 100644 index 000000000000..7facf6643199 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear310_evb.c | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/spear310_evb.c | ||
| 3 | * | ||
| 4 | * SPEAr310 evaluation board source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <asm/mach/arch.h> | ||
| 15 | #include <asm/mach-types.h> | ||
| 16 | #include <mach/generic.h> | ||
| 17 | #include <mach/spear.h> | ||
| 18 | |||
| 19 | /* padmux devices to enable */ | ||
| 20 | static struct pmx_dev *pmx_devs[] = { | ||
| 21 | /* spear3xx specific devices */ | ||
| 22 | &pmx_i2c, | ||
| 23 | &pmx_ssp, | ||
| 24 | &pmx_gpio_pin0, | ||
| 25 | &pmx_gpio_pin1, | ||
| 26 | &pmx_gpio_pin2, | ||
| 27 | &pmx_gpio_pin3, | ||
| 28 | &pmx_gpio_pin4, | ||
| 29 | &pmx_gpio_pin5, | ||
| 30 | &pmx_uart0, | ||
| 31 | |||
| 32 | /* spear310 specific devices */ | ||
| 33 | &pmx_emi_cs_0_1_4_5, | ||
| 34 | &pmx_emi_cs_2_3, | ||
| 35 | &pmx_uart1, | ||
| 36 | &pmx_uart2, | ||
| 37 | &pmx_uart3_4_5, | ||
| 38 | &pmx_fsmc, | ||
| 39 | &pmx_rs485_0_1, | ||
| 40 | &pmx_tdm0, | ||
| 41 | }; | ||
| 42 | |||
| 43 | static struct amba_device *amba_devs[] __initdata = { | ||
| 44 | /* spear3xx specific devices */ | ||
| 45 | &gpio_device, | ||
| 46 | &uart_device, | ||
| 47 | |||
| 48 | /* spear310 specific devices */ | ||
| 49 | }; | ||
| 50 | |||
| 51 | static struct platform_device *plat_devs[] __initdata = { | ||
| 52 | /* spear3xx specific devices */ | ||
| 53 | |||
| 54 | /* spear310 specific devices */ | ||
| 55 | }; | ||
| 56 | |||
| 57 | static void __init spear310_evb_init(void) | ||
| 58 | { | ||
| 59 | unsigned int i; | ||
| 60 | |||
| 61 | /* call spear310 machine init function */ | ||
| 62 | spear310_init(); | ||
| 63 | |||
| 64 | /* padmux initialization */ | ||
| 65 | pmx_driver.mode = NULL; | ||
| 66 | pmx_driver.devs = pmx_devs; | ||
| 67 | pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); | ||
| 68 | spear310_pmx_init(); | ||
| 69 | |||
| 70 | /* Add Platform Devices */ | ||
| 71 | platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); | ||
| 72 | |||
| 73 | /* Add Amba Devices */ | ||
| 74 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
| 75 | amba_device_register(amba_devs[i], &iomem_resource); | ||
| 76 | } | ||
| 77 | |||
| 78 | MACHINE_START(SPEAR310, "ST-SPEAR310-EVB") | ||
| 79 | .boot_params = 0x00000100, | ||
| 80 | .map_io = spear3xx_map_io, | ||
| 81 | .init_irq = spear3xx_init_irq, | ||
| 82 | .timer = &spear_sys_timer, | ||
| 83 | .init_machine = spear310_evb_init, | ||
| 84 | MACHINE_END | ||
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c new file mode 100644 index 000000000000..6a1219549369 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear320.c | |||
| @@ -0,0 +1,549 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/spear320.c | ||
| 3 | * | ||
| 4 | * SPEAr320 machine source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/ptrace.h> | ||
| 15 | #include <asm/irq.h> | ||
| 16 | #include <mach/generic.h> | ||
| 17 | #include <mach/spear.h> | ||
| 18 | #include <plat/shirq.h> | ||
| 19 | |||
| 20 | /* pad multiplexing support */ | ||
| 21 | /* muxing registers */ | ||
| 22 | #define PAD_MUX_CONFIG_REG 0x0C | ||
| 23 | #define MODE_CONFIG_REG 0x10 | ||
| 24 | |||
| 25 | /* modes */ | ||
| 26 | #define AUTO_NET_SMII_MODE (1 << 0) | ||
| 27 | #define AUTO_NET_MII_MODE (1 << 1) | ||
| 28 | #define AUTO_EXP_MODE (1 << 2) | ||
| 29 | #define SMALL_PRINTERS_MODE (1 << 3) | ||
| 30 | #define ALL_MODES 0xF | ||
| 31 | |||
| 32 | struct pmx_mode auto_net_smii_mode = { | ||
| 33 | .id = AUTO_NET_SMII_MODE, | ||
| 34 | .name = "Automation Networking SMII Mode", | ||
| 35 | .mask = 0x00, | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct pmx_mode auto_net_mii_mode = { | ||
| 39 | .id = AUTO_NET_MII_MODE, | ||
| 40 | .name = "Automation Networking MII Mode", | ||
| 41 | .mask = 0x01, | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct pmx_mode auto_exp_mode = { | ||
| 45 | .id = AUTO_EXP_MODE, | ||
| 46 | .name = "Automation Expanded Mode", | ||
| 47 | .mask = 0x02, | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct pmx_mode small_printers_mode = { | ||
| 51 | .id = SMALL_PRINTERS_MODE, | ||
| 52 | .name = "Small Printers Mode", | ||
| 53 | .mask = 0x03, | ||
| 54 | }; | ||
| 55 | |||
| 56 | /* devices */ | ||
| 57 | struct pmx_dev_mode pmx_clcd_modes[] = { | ||
| 58 | { | ||
| 59 | .ids = AUTO_NET_SMII_MODE, | ||
| 60 | .mask = 0x0, | ||
| 61 | }, | ||
| 62 | }; | ||
| 63 | |||
| 64 | struct pmx_dev pmx_clcd = { | ||
| 65 | .name = "clcd", | ||
| 66 | .modes = pmx_clcd_modes, | ||
| 67 | .mode_count = ARRAY_SIZE(pmx_clcd_modes), | ||
| 68 | .enb_on_reset = 1, | ||
| 69 | }; | ||
| 70 | |||
| 71 | struct pmx_dev_mode pmx_emi_modes[] = { | ||
| 72 | { | ||
| 73 | .ids = AUTO_EXP_MODE, | ||
| 74 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, | ||
| 75 | }, | ||
| 76 | }; | ||
| 77 | |||
| 78 | struct pmx_dev pmx_emi = { | ||
| 79 | .name = "emi", | ||
| 80 | .modes = pmx_emi_modes, | ||
| 81 | .mode_count = ARRAY_SIZE(pmx_emi_modes), | ||
| 82 | .enb_on_reset = 1, | ||
| 83 | }; | ||
| 84 | |||
| 85 | struct pmx_dev_mode pmx_fsmc_modes[] = { | ||
| 86 | { | ||
| 87 | .ids = ALL_MODES, | ||
| 88 | .mask = 0x0, | ||
| 89 | }, | ||
| 90 | }; | ||
| 91 | |||
| 92 | struct pmx_dev pmx_fsmc = { | ||
| 93 | .name = "fsmc", | ||
| 94 | .modes = pmx_fsmc_modes, | ||
| 95 | .mode_count = ARRAY_SIZE(pmx_fsmc_modes), | ||
| 96 | .enb_on_reset = 1, | ||
| 97 | }; | ||
| 98 | |||
| 99 | struct pmx_dev_mode pmx_spp_modes[] = { | ||
| 100 | { | ||
| 101 | .ids = SMALL_PRINTERS_MODE, | ||
| 102 | .mask = 0x0, | ||
| 103 | }, | ||
| 104 | }; | ||
| 105 | |||
| 106 | struct pmx_dev pmx_spp = { | ||
| 107 | .name = "spp", | ||
| 108 | .modes = pmx_spp_modes, | ||
| 109 | .mode_count = ARRAY_SIZE(pmx_spp_modes), | ||
| 110 | .enb_on_reset = 1, | ||
| 111 | }; | ||
| 112 | |||
| 113 | struct pmx_dev_mode pmx_sdio_modes[] = { | ||
| 114 | { | ||
| 115 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | | ||
| 116 | SMALL_PRINTERS_MODE, | ||
| 117 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, | ||
| 118 | }, | ||
| 119 | }; | ||
| 120 | |||
| 121 | struct pmx_dev pmx_sdio = { | ||
| 122 | .name = "sdio", | ||
| 123 | .modes = pmx_sdio_modes, | ||
| 124 | .mode_count = ARRAY_SIZE(pmx_sdio_modes), | ||
| 125 | .enb_on_reset = 1, | ||
| 126 | }; | ||
| 127 | |||
| 128 | struct pmx_dev_mode pmx_i2s_modes[] = { | ||
| 129 | { | ||
| 130 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
| 131 | .mask = PMX_UART0_MODEM_MASK, | ||
| 132 | }, | ||
| 133 | }; | ||
| 134 | |||
| 135 | struct pmx_dev pmx_i2s = { | ||
| 136 | .name = "i2s", | ||
| 137 | .modes = pmx_i2s_modes, | ||
| 138 | .mode_count = ARRAY_SIZE(pmx_i2s_modes), | ||
| 139 | .enb_on_reset = 1, | ||
| 140 | }; | ||
| 141 | |||
| 142 | struct pmx_dev_mode pmx_uart1_modes[] = { | ||
| 143 | { | ||
| 144 | .ids = ALL_MODES, | ||
| 145 | .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK, | ||
| 146 | }, | ||
| 147 | }; | ||
| 148 | |||
| 149 | struct pmx_dev pmx_uart1 = { | ||
| 150 | .name = "uart1", | ||
| 151 | .modes = pmx_uart1_modes, | ||
| 152 | .mode_count = ARRAY_SIZE(pmx_uart1_modes), | ||
| 153 | .enb_on_reset = 1, | ||
| 154 | }; | ||
| 155 | |||
| 156 | struct pmx_dev_mode pmx_uart1_modem_modes[] = { | ||
| 157 | { | ||
| 158 | .ids = AUTO_EXP_MODE, | ||
| 159 | .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | | ||
| 160 | PMX_SSP_CS_MASK, | ||
| 161 | }, { | ||
| 162 | .ids = SMALL_PRINTERS_MODE, | ||
| 163 | .mask = PMX_GPIO_PIN3_MASK | PMX_GPIO_PIN4_MASK | | ||
| 164 | PMX_GPIO_PIN5_MASK | PMX_SSP_CS_MASK, | ||
| 165 | }, | ||
| 166 | }; | ||
| 167 | |||
| 168 | struct pmx_dev pmx_uart1_modem = { | ||
| 169 | .name = "uart1_modem", | ||
| 170 | .modes = pmx_uart1_modem_modes, | ||
| 171 | .mode_count = ARRAY_SIZE(pmx_uart1_modem_modes), | ||
| 172 | .enb_on_reset = 1, | ||
| 173 | }; | ||
| 174 | |||
| 175 | struct pmx_dev_mode pmx_uart2_modes[] = { | ||
| 176 | { | ||
| 177 | .ids = ALL_MODES, | ||
| 178 | .mask = PMX_FIRDA_MASK, | ||
| 179 | }, | ||
| 180 | }; | ||
| 181 | |||
| 182 | struct pmx_dev pmx_uart2 = { | ||
| 183 | .name = "uart2", | ||
| 184 | .modes = pmx_uart2_modes, | ||
| 185 | .mode_count = ARRAY_SIZE(pmx_uart2_modes), | ||
| 186 | .enb_on_reset = 1, | ||
| 187 | }; | ||
| 188 | |||
| 189 | struct pmx_dev_mode pmx_touchscreen_modes[] = { | ||
| 190 | { | ||
| 191 | .ids = AUTO_NET_SMII_MODE, | ||
| 192 | .mask = PMX_SSP_CS_MASK, | ||
| 193 | }, | ||
| 194 | }; | ||
| 195 | |||
| 196 | struct pmx_dev pmx_touchscreen = { | ||
| 197 | .name = "touchscreen", | ||
| 198 | .modes = pmx_touchscreen_modes, | ||
| 199 | .mode_count = ARRAY_SIZE(pmx_touchscreen_modes), | ||
| 200 | .enb_on_reset = 1, | ||
| 201 | }; | ||
| 202 | |||
| 203 | struct pmx_dev_mode pmx_can_modes[] = { | ||
| 204 | { | ||
| 205 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE, | ||
| 206 | .mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | | ||
| 207 | PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK, | ||
| 208 | }, | ||
| 209 | }; | ||
| 210 | |||
| 211 | struct pmx_dev pmx_can = { | ||
| 212 | .name = "can", | ||
| 213 | .modes = pmx_can_modes, | ||
| 214 | .mode_count = ARRAY_SIZE(pmx_can_modes), | ||
| 215 | .enb_on_reset = 1, | ||
| 216 | }; | ||
| 217 | |||
| 218 | struct pmx_dev_mode pmx_sdio_led_modes[] = { | ||
| 219 | { | ||
| 220 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
| 221 | .mask = PMX_SSP_CS_MASK, | ||
| 222 | }, | ||
| 223 | }; | ||
| 224 | |||
| 225 | struct pmx_dev pmx_sdio_led = { | ||
| 226 | .name = "sdio_led", | ||
| 227 | .modes = pmx_sdio_led_modes, | ||
| 228 | .mode_count = ARRAY_SIZE(pmx_sdio_led_modes), | ||
| 229 | .enb_on_reset = 1, | ||
| 230 | }; | ||
| 231 | |||
| 232 | struct pmx_dev_mode pmx_pwm0_modes[] = { | ||
| 233 | { | ||
| 234 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
| 235 | .mask = PMX_UART0_MODEM_MASK, | ||
| 236 | }, { | ||
| 237 | .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE, | ||
| 238 | .mask = PMX_MII_MASK, | ||
| 239 | }, | ||
| 240 | }; | ||
| 241 | |||
| 242 | struct pmx_dev pmx_pwm0 = { | ||
| 243 | .name = "pwm0", | ||
| 244 | .modes = pmx_pwm0_modes, | ||
| 245 | .mode_count = ARRAY_SIZE(pmx_pwm0_modes), | ||
| 246 | .enb_on_reset = 1, | ||
| 247 | }; | ||
| 248 | |||
| 249 | struct pmx_dev_mode pmx_pwm1_modes[] = { | ||
| 250 | { | ||
| 251 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
| 252 | .mask = PMX_UART0_MODEM_MASK, | ||
| 253 | }, { | ||
| 254 | .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE, | ||
| 255 | .mask = PMX_MII_MASK, | ||
| 256 | }, | ||
| 257 | }; | ||
| 258 | |||
| 259 | struct pmx_dev pmx_pwm1 = { | ||
| 260 | .name = "pwm1", | ||
| 261 | .modes = pmx_pwm1_modes, | ||
| 262 | .mode_count = ARRAY_SIZE(pmx_pwm1_modes), | ||
| 263 | .enb_on_reset = 1, | ||
| 264 | }; | ||
| 265 | |||
| 266 | struct pmx_dev_mode pmx_pwm2_modes[] = { | ||
| 267 | { | ||
| 268 | .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, | ||
| 269 | .mask = PMX_SSP_CS_MASK, | ||
| 270 | }, { | ||
| 271 | .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE, | ||
| 272 | .mask = PMX_MII_MASK, | ||
| 273 | }, | ||
| 274 | }; | ||
| 275 | |||
| 276 | struct pmx_dev pmx_pwm2 = { | ||
| 277 | .name = "pwm2", | ||
| 278 | .modes = pmx_pwm2_modes, | ||
| 279 | .mode_count = ARRAY_SIZE(pmx_pwm2_modes), | ||
| 280 | .enb_on_reset = 1, | ||
| 281 | }; | ||
| 282 | |||
| 283 | struct pmx_dev_mode pmx_pwm3_modes[] = { | ||
| 284 | { | ||
| 285 | .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE, | ||
| 286 | .mask = PMX_MII_MASK, | ||
| 287 | }, | ||
| 288 | }; | ||
| 289 | |||
| 290 | struct pmx_dev pmx_pwm3 = { | ||
| 291 | .name = "pwm3", | ||
| 292 | .modes = pmx_pwm3_modes, | ||
| 293 | .mode_count = ARRAY_SIZE(pmx_pwm3_modes), | ||
| 294 | .enb_on_reset = 1, | ||
| 295 | }; | ||
| 296 | |||
| 297 | struct pmx_dev_mode pmx_ssp1_modes[] = { | ||
| 298 | { | ||
| 299 | .ids = SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE, | ||
| 300 | .mask = PMX_MII_MASK, | ||
| 301 | }, | ||
| 302 | }; | ||
| 303 | |||
| 304 | struct pmx_dev pmx_ssp1 = { | ||
| 305 | .name = "ssp1", | ||
| 306 | .modes = pmx_ssp1_modes, | ||
| 307 | .mode_count = ARRAY_SIZE(pmx_ssp1_modes), | ||
| 308 | .enb_on_reset = 1, | ||
| 309 | }; | ||
| 310 | |||
| 311 | struct pmx_dev_mode pmx_ssp2_modes[] = { | ||
| 312 | { | ||
| 313 | .ids = AUTO_NET_SMII_MODE, | ||
| 314 | .mask = PMX_MII_MASK, | ||
| 315 | }, | ||
| 316 | }; | ||
| 317 | |||
| 318 | struct pmx_dev pmx_ssp2 = { | ||
| 319 | .name = "ssp2", | ||
| 320 | .modes = pmx_ssp2_modes, | ||
| 321 | .mode_count = ARRAY_SIZE(pmx_ssp2_modes), | ||
| 322 | .enb_on_reset = 1, | ||
| 323 | }; | ||
| 324 | |||
| 325 | struct pmx_dev_mode pmx_mii1_modes[] = { | ||
| 326 | { | ||
| 327 | .ids = AUTO_NET_MII_MODE, | ||
| 328 | .mask = 0x0, | ||
| 329 | }, | ||
| 330 | }; | ||
| 331 | |||
| 332 | struct pmx_dev pmx_mii1 = { | ||
| 333 | .name = "mii1", | ||
| 334 | .modes = pmx_mii1_modes, | ||
| 335 | .mode_count = ARRAY_SIZE(pmx_mii1_modes), | ||
| 336 | .enb_on_reset = 1, | ||
| 337 | }; | ||
| 338 | |||
| 339 | struct pmx_dev_mode pmx_smii0_modes[] = { | ||
| 340 | { | ||
| 341 | .ids = AUTO_NET_SMII_MODE | AUTO_EXP_MODE | SMALL_PRINTERS_MODE, | ||
| 342 | .mask = PMX_MII_MASK, | ||
| 343 | }, | ||
| 344 | }; | ||
| 345 | |||
| 346 | struct pmx_dev pmx_smii0 = { | ||
| 347 | .name = "smii0", | ||
| 348 | .modes = pmx_smii0_modes, | ||
| 349 | .mode_count = ARRAY_SIZE(pmx_smii0_modes), | ||
| 350 | .enb_on_reset = 1, | ||
| 351 | }; | ||
| 352 | |||
| 353 | struct pmx_dev_mode pmx_smii1_modes[] = { | ||
| 354 | { | ||
| 355 | .ids = AUTO_NET_SMII_MODE | SMALL_PRINTERS_MODE, | ||
| 356 | .mask = PMX_MII_MASK, | ||
| 357 | }, | ||
| 358 | }; | ||
| 359 | |||
| 360 | struct pmx_dev pmx_smii1 = { | ||
| 361 | .name = "smii1", | ||
| 362 | .modes = pmx_smii1_modes, | ||
| 363 | .mode_count = ARRAY_SIZE(pmx_smii1_modes), | ||
| 364 | .enb_on_reset = 1, | ||
| 365 | }; | ||
| 366 | |||
| 367 | struct pmx_dev_mode pmx_i2c1_modes[] = { | ||
| 368 | { | ||
| 369 | .ids = AUTO_EXP_MODE, | ||
| 370 | .mask = 0x0, | ||
| 371 | }, | ||
| 372 | }; | ||
| 373 | |||
| 374 | struct pmx_dev pmx_i2c1 = { | ||
| 375 | .name = "i2c1", | ||
| 376 | .modes = pmx_i2c1_modes, | ||
| 377 | .mode_count = ARRAY_SIZE(pmx_i2c1_modes), | ||
| 378 | .enb_on_reset = 1, | ||
| 379 | }; | ||
| 380 | |||
| 381 | /* pmx driver structure */ | ||
| 382 | struct pmx_driver pmx_driver = { | ||
| 383 | .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x00000007}, | ||
| 384 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, | ||
| 385 | }; | ||
| 386 | |||
| 387 | /* Add spear320 specific devices here */ | ||
| 388 | |||
| 389 | /* spear3xx shared irq */ | ||
| 390 | struct shirq_dev_config shirq_ras1_config[] = { | ||
| 391 | { | ||
| 392 | .virq = VIRQ_EMI, | ||
| 393 | .status_mask = EMI_IRQ_MASK, | ||
| 394 | .clear_mask = EMI_IRQ_MASK, | ||
| 395 | }, { | ||
| 396 | .virq = VIRQ_CLCD, | ||
| 397 | .status_mask = CLCD_IRQ_MASK, | ||
| 398 | .clear_mask = CLCD_IRQ_MASK, | ||
| 399 | }, { | ||
| 400 | .virq = VIRQ_SPP, | ||
| 401 | .status_mask = SPP_IRQ_MASK, | ||
| 402 | .clear_mask = SPP_IRQ_MASK, | ||
| 403 | }, | ||
| 404 | }; | ||
| 405 | |||
| 406 | struct spear_shirq shirq_ras1 = { | ||
| 407 | .irq = IRQ_GEN_RAS_1, | ||
| 408 | .dev_config = shirq_ras1_config, | ||
| 409 | .dev_count = ARRAY_SIZE(shirq_ras1_config), | ||
| 410 | .regs = { | ||
| 411 | .enb_reg = -1, | ||
| 412 | .status_reg = INT_STS_MASK_REG, | ||
| 413 | .status_reg_mask = SHIRQ_RAS1_MASK, | ||
| 414 | .clear_reg = INT_CLR_MASK_REG, | ||
| 415 | .reset_to_clear = 1, | ||
| 416 | }, | ||
| 417 | }; | ||
| 418 | |||
| 419 | struct shirq_dev_config shirq_ras3_config[] = { | ||
| 420 | { | ||
| 421 | .virq = VIRQ_PLGPIO, | ||
| 422 | .enb_mask = GPIO_IRQ_MASK, | ||
| 423 | .status_mask = GPIO_IRQ_MASK, | ||
| 424 | .clear_mask = GPIO_IRQ_MASK, | ||
| 425 | }, { | ||
| 426 | .virq = VIRQ_I2S_PLAY, | ||
| 427 | .enb_mask = I2S_PLAY_IRQ_MASK, | ||
| 428 | .status_mask = I2S_PLAY_IRQ_MASK, | ||
| 429 | .clear_mask = I2S_PLAY_IRQ_MASK, | ||
| 430 | }, { | ||
| 431 | .virq = VIRQ_I2S_REC, | ||
| 432 | .enb_mask = I2S_REC_IRQ_MASK, | ||
| 433 | .status_mask = I2S_REC_IRQ_MASK, | ||
| 434 | .clear_mask = I2S_REC_IRQ_MASK, | ||
| 435 | }, | ||
| 436 | }; | ||
| 437 | |||
| 438 | struct spear_shirq shirq_ras3 = { | ||
| 439 | .irq = IRQ_GEN_RAS_3, | ||
| 440 | .dev_config = shirq_ras3_config, | ||
| 441 | .dev_count = ARRAY_SIZE(shirq_ras3_config), | ||
| 442 | .regs = { | ||
| 443 | .enb_reg = INT_ENB_MASK_REG, | ||
| 444 | .reset_to_enb = 1, | ||
| 445 | .status_reg = INT_STS_MASK_REG, | ||
| 446 | .status_reg_mask = SHIRQ_RAS3_MASK, | ||
| 447 | .clear_reg = INT_CLR_MASK_REG, | ||
| 448 | .reset_to_clear = 1, | ||
| 449 | }, | ||
| 450 | }; | ||
| 451 | |||
| 452 | struct shirq_dev_config shirq_intrcomm_ras_config[] = { | ||
| 453 | { | ||
| 454 | .virq = VIRQ_CANU, | ||
| 455 | .status_mask = CAN_U_IRQ_MASK, | ||
| 456 | .clear_mask = CAN_U_IRQ_MASK, | ||
| 457 | }, { | ||
| 458 | .virq = VIRQ_CANL, | ||
| 459 | .status_mask = CAN_L_IRQ_MASK, | ||
| 460 | .clear_mask = CAN_L_IRQ_MASK, | ||
| 461 | }, { | ||
| 462 | .virq = VIRQ_UART1, | ||
| 463 | .status_mask = UART1_IRQ_MASK, | ||
| 464 | .clear_mask = UART1_IRQ_MASK, | ||
| 465 | }, { | ||
| 466 | .virq = VIRQ_UART2, | ||
| 467 | .status_mask = UART2_IRQ_MASK, | ||
| 468 | .clear_mask = UART2_IRQ_MASK, | ||
| 469 | }, { | ||
| 470 | .virq = VIRQ_SSP1, | ||
| 471 | .status_mask = SSP1_IRQ_MASK, | ||
| 472 | .clear_mask = SSP1_IRQ_MASK, | ||
| 473 | }, { | ||
| 474 | .virq = VIRQ_SSP2, | ||
| 475 | .status_mask = SSP2_IRQ_MASK, | ||
| 476 | .clear_mask = SSP2_IRQ_MASK, | ||
| 477 | }, { | ||
| 478 | .virq = VIRQ_SMII0, | ||
| 479 | .status_mask = SMII0_IRQ_MASK, | ||
| 480 | .clear_mask = SMII0_IRQ_MASK, | ||
| 481 | }, { | ||
| 482 | .virq = VIRQ_MII1_SMII1, | ||
| 483 | .status_mask = MII1_SMII1_IRQ_MASK, | ||
| 484 | .clear_mask = MII1_SMII1_IRQ_MASK, | ||
| 485 | }, { | ||
| 486 | .virq = VIRQ_WAKEUP_SMII0, | ||
| 487 | .status_mask = WAKEUP_SMII0_IRQ_MASK, | ||
| 488 | .clear_mask = WAKEUP_SMII0_IRQ_MASK, | ||
| 489 | }, { | ||
| 490 | .virq = VIRQ_WAKEUP_MII1_SMII1, | ||
| 491 | .status_mask = WAKEUP_MII1_SMII1_IRQ_MASK, | ||
| 492 | .clear_mask = WAKEUP_MII1_SMII1_IRQ_MASK, | ||
| 493 | }, { | ||
| 494 | .virq = VIRQ_I2C, | ||
| 495 | .status_mask = I2C1_IRQ_MASK, | ||
| 496 | .clear_mask = I2C1_IRQ_MASK, | ||
| 497 | }, | ||
| 498 | }; | ||
| 499 | |||
| 500 | struct spear_shirq shirq_intrcomm_ras = { | ||
| 501 | .irq = IRQ_INTRCOMM_RAS_ARM, | ||
| 502 | .dev_config = shirq_intrcomm_ras_config, | ||
| 503 | .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config), | ||
| 504 | .regs = { | ||
| 505 | .enb_reg = -1, | ||
| 506 | .status_reg = INT_STS_MASK_REG, | ||
| 507 | .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK, | ||
| 508 | .clear_reg = INT_CLR_MASK_REG, | ||
| 509 | .reset_to_clear = 1, | ||
| 510 | }, | ||
| 511 | }; | ||
| 512 | |||
| 513 | /* spear320 routines */ | ||
| 514 | void __init spear320_init(void) | ||
| 515 | { | ||
| 516 | void __iomem *base; | ||
| 517 | int ret = 0; | ||
| 518 | |||
| 519 | /* call spear3xx family common init function */ | ||
| 520 | spear3xx_init(); | ||
| 521 | |||
| 522 | /* shared irq registeration */ | ||
| 523 | base = ioremap(SPEAR320_SOC_CONFIG_BASE, SPEAR320_SOC_CONFIG_SIZE); | ||
| 524 | if (base) { | ||
| 525 | /* shirq 1 */ | ||
| 526 | shirq_ras1.regs.base = base; | ||
| 527 | ret = spear_shirq_register(&shirq_ras1); | ||
| 528 | if (ret) | ||
| 529 | printk(KERN_ERR "Error registering Shared IRQ 1\n"); | ||
| 530 | |||
| 531 | /* shirq 3 */ | ||
| 532 | shirq_ras3.regs.base = base; | ||
| 533 | ret = spear_shirq_register(&shirq_ras3); | ||
| 534 | if (ret) | ||
| 535 | printk(KERN_ERR "Error registering Shared IRQ 3\n"); | ||
| 536 | |||
| 537 | /* shirq 4 */ | ||
| 538 | shirq_intrcomm_ras.regs.base = base; | ||
| 539 | ret = spear_shirq_register(&shirq_intrcomm_ras); | ||
| 540 | if (ret) | ||
| 541 | printk(KERN_ERR "Error registering Shared IRQ 4\n"); | ||
| 542 | } | ||
| 543 | } | ||
| 544 | |||
| 545 | void spear320_pmx_init(void) | ||
| 546 | { | ||
| 547 | spear_pmx_init(&pmx_driver, SPEAR320_SOC_CONFIG_BASE, | ||
| 548 | SPEAR320_SOC_CONFIG_SIZE); | ||
| 549 | } | ||
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c new file mode 100644 index 000000000000..62ac685a4135 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear320_evb.c | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/spear320_evb.c | ||
| 3 | * | ||
| 4 | * SPEAr320 evaluation board source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <asm/mach/arch.h> | ||
| 15 | #include <asm/mach-types.h> | ||
| 16 | #include <mach/generic.h> | ||
| 17 | #include <mach/spear.h> | ||
| 18 | |||
| 19 | /* padmux devices to enable */ | ||
| 20 | static struct pmx_dev *pmx_devs[] = { | ||
| 21 | /* spear3xx specific devices */ | ||
| 22 | &pmx_i2c, | ||
| 23 | &pmx_ssp, | ||
| 24 | &pmx_mii, | ||
| 25 | &pmx_uart0, | ||
| 26 | |||
| 27 | /* spear320 specific devices */ | ||
| 28 | &pmx_fsmc, | ||
| 29 | &pmx_sdio, | ||
| 30 | &pmx_i2s, | ||
| 31 | &pmx_uart1, | ||
| 32 | &pmx_uart2, | ||
| 33 | &pmx_can, | ||
| 34 | &pmx_pwm0, | ||
| 35 | &pmx_pwm1, | ||
| 36 | &pmx_pwm2, | ||
| 37 | &pmx_mii1, | ||
| 38 | }; | ||
| 39 | |||
| 40 | static struct amba_device *amba_devs[] __initdata = { | ||
| 41 | /* spear3xx specific devices */ | ||
| 42 | &gpio_device, | ||
| 43 | &uart_device, | ||
| 44 | |||
| 45 | /* spear320 specific devices */ | ||
| 46 | }; | ||
| 47 | |||
| 48 | static struct platform_device *plat_devs[] __initdata = { | ||
| 49 | /* spear3xx specific devices */ | ||
| 50 | |||
| 51 | /* spear320 specific devices */ | ||
| 52 | }; | ||
| 53 | |||
| 54 | static void __init spear320_evb_init(void) | ||
| 55 | { | ||
| 56 | unsigned int i; | ||
| 57 | |||
| 58 | /* call spear320 machine init function */ | ||
| 59 | spear320_init(); | ||
| 60 | |||
| 61 | /* padmux initialization */ | ||
| 62 | pmx_driver.mode = &auto_net_mii_mode; | ||
| 63 | pmx_driver.devs = pmx_devs; | ||
| 64 | pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); | ||
| 65 | spear320_pmx_init(); | ||
| 66 | |||
| 67 | /* Add Platform Devices */ | ||
| 68 | platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); | ||
| 69 | |||
| 70 | /* Add Amba Devices */ | ||
| 71 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
| 72 | amba_device_register(amba_devs[i], &iomem_resource); | ||
| 73 | } | ||
| 74 | |||
| 75 | MACHINE_START(SPEAR320, "ST-SPEAR320-EVB") | ||
| 76 | .boot_params = 0x00000100, | ||
| 77 | .map_io = spear3xx_map_io, | ||
| 78 | .init_irq = spear3xx_init_irq, | ||
| 79 | .timer = &spear_sys_timer, | ||
| 80 | .init_machine = spear320_evb_init, | ||
| 81 | MACHINE_END | ||
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c new file mode 100644 index 000000000000..e87313aeae20 --- /dev/null +++ b/arch/arm/mach-spear3xx/spear3xx.c | |||
| @@ -0,0 +1,548 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear3xx/spear3xx.c | ||
| 3 | * | ||
| 4 | * SPEAr3XX machines common source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/types.h> | ||
| 15 | #include <linux/amba/pl061.h> | ||
| 16 | #include <linux/ptrace.h> | ||
| 17 | #include <linux/io.h> | ||
| 18 | #include <asm/hardware/vic.h> | ||
| 19 | #include <asm/irq.h> | ||
| 20 | #include <asm/mach/arch.h> | ||
| 21 | #include <mach/generic.h> | ||
| 22 | #include <mach/spear.h> | ||
| 23 | |||
| 24 | /* Add spear3xx machines common devices here */ | ||
| 25 | /* gpio device registeration */ | ||
| 26 | static struct pl061_platform_data gpio_plat_data = { | ||
| 27 | .gpio_base = 0, | ||
| 28 | .irq_base = SPEAR_GPIO_INT_BASE, | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct amba_device gpio_device = { | ||
| 32 | .dev = { | ||
| 33 | .init_name = "gpio", | ||
| 34 | .platform_data = &gpio_plat_data, | ||
| 35 | }, | ||
| 36 | .res = { | ||
| 37 | .start = SPEAR3XX_ICM3_GPIO_BASE, | ||
| 38 | .end = SPEAR3XX_ICM3_GPIO_BASE + SPEAR3XX_ICM3_GPIO_SIZE - 1, | ||
| 39 | .flags = IORESOURCE_MEM, | ||
| 40 | }, | ||
| 41 | .irq = {IRQ_BASIC_GPIO, NO_IRQ}, | ||
| 42 | }; | ||
| 43 | |||
| 44 | /* uart device registeration */ | ||
| 45 | struct amba_device uart_device = { | ||
| 46 | .dev = { | ||
| 47 | .init_name = "uart", | ||
| 48 | }, | ||
| 49 | .res = { | ||
| 50 | .start = SPEAR3XX_ICM1_UART_BASE, | ||
| 51 | .end = SPEAR3XX_ICM1_UART_BASE + SPEAR3XX_ICM1_UART_SIZE - 1, | ||
| 52 | .flags = IORESOURCE_MEM, | ||
| 53 | }, | ||
| 54 | .irq = {IRQ_UART, NO_IRQ}, | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* Do spear3xx familiy common initialization part here */ | ||
| 58 | void __init spear3xx_init(void) | ||
| 59 | { | ||
| 60 | /* nothing to do for now */ | ||
| 61 | } | ||
| 62 | |||
| 63 | /* This will initialize vic */ | ||
| 64 | void __init spear3xx_init_irq(void) | ||
| 65 | { | ||
| 66 | vic_init((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE, 0, ~0, 0); | ||
| 67 | } | ||
| 68 | |||
| 69 | /* Following will create static virtual/physical mappings */ | ||
| 70 | struct map_desc spear3xx_io_desc[] __initdata = { | ||
| 71 | { | ||
| 72 | .virtual = VA_SPEAR3XX_ICM1_UART_BASE, | ||
| 73 | .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE), | ||
| 74 | .length = SPEAR3XX_ICM1_UART_SIZE, | ||
| 75 | .type = MT_DEVICE | ||
| 76 | }, { | ||
| 77 | .virtual = VA_SPEAR3XX_ML1_VIC_BASE, | ||
| 78 | .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE), | ||
| 79 | .length = SPEAR3XX_ML1_VIC_SIZE, | ||
| 80 | .type = MT_DEVICE | ||
| 81 | }, { | ||
| 82 | .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE, | ||
| 83 | .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE), | ||
| 84 | .length = SPEAR3XX_ICM3_SYS_CTRL_SIZE, | ||
| 85 | .type = MT_DEVICE | ||
| 86 | }, { | ||
| 87 | .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE, | ||
| 88 | .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE), | ||
| 89 | .length = SPEAR3XX_ICM3_MISC_REG_SIZE, | ||
| 90 | .type = MT_DEVICE | ||
| 91 | }, | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* This will create static memory mapping for selected devices */ | ||
| 95 | void __init spear3xx_map_io(void) | ||
| 96 | { | ||
| 97 | iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc)); | ||
| 98 | |||
| 99 | /* This will initialize clock framework */ | ||
| 100 | clk_init(); | ||
| 101 | } | ||
| 102 | |||
| 103 | /* pad multiplexing support */ | ||
| 104 | /* devices */ | ||
| 105 | struct pmx_dev_mode pmx_firda_modes[] = { | ||
| 106 | { | ||
| 107 | .ids = 0xffffffff, | ||
| 108 | .mask = PMX_FIRDA_MASK, | ||
| 109 | }, | ||
| 110 | }; | ||
| 111 | |||
| 112 | struct pmx_dev pmx_firda = { | ||
| 113 | .name = "firda", | ||
| 114 | .modes = pmx_firda_modes, | ||
| 115 | .mode_count = ARRAY_SIZE(pmx_firda_modes), | ||
| 116 | .enb_on_reset = 0, | ||
| 117 | }; | ||
| 118 | |||
| 119 | struct pmx_dev_mode pmx_i2c_modes[] = { | ||
| 120 | { | ||
| 121 | .ids = 0xffffffff, | ||
| 122 | .mask = PMX_I2C_MASK, | ||
| 123 | }, | ||
| 124 | }; | ||
| 125 | |||
| 126 | struct pmx_dev pmx_i2c = { | ||
| 127 | .name = "i2c", | ||
| 128 | .modes = pmx_i2c_modes, | ||
| 129 | .mode_count = ARRAY_SIZE(pmx_i2c_modes), | ||
| 130 | .enb_on_reset = 0, | ||
| 131 | }; | ||
| 132 | |||
| 133 | struct pmx_dev_mode pmx_ssp_cs_modes[] = { | ||
| 134 | { | ||
| 135 | .ids = 0xffffffff, | ||
| 136 | .mask = PMX_SSP_CS_MASK, | ||
| 137 | }, | ||
| 138 | }; | ||
| 139 | |||
| 140 | struct pmx_dev pmx_ssp_cs = { | ||
| 141 | .name = "ssp_chip_selects", | ||
| 142 | .modes = pmx_ssp_cs_modes, | ||
| 143 | .mode_count = ARRAY_SIZE(pmx_ssp_cs_modes), | ||
| 144 | .enb_on_reset = 0, | ||
| 145 | }; | ||
| 146 | |||
| 147 | struct pmx_dev_mode pmx_ssp_modes[] = { | ||
| 148 | { | ||
| 149 | .ids = 0xffffffff, | ||
| 150 | .mask = PMX_SSP_MASK, | ||
| 151 | }, | ||
| 152 | }; | ||
| 153 | |||
| 154 | struct pmx_dev pmx_ssp = { | ||
| 155 | .name = "ssp", | ||
| 156 | .modes = pmx_ssp_modes, | ||
| 157 | .mode_count = ARRAY_SIZE(pmx_ssp_modes), | ||
| 158 | .enb_on_reset = 0, | ||
| 159 | }; | ||
| 160 | |||
| 161 | struct pmx_dev_mode pmx_mii_modes[] = { | ||
| 162 | { | ||
| 163 | .ids = 0xffffffff, | ||
| 164 | .mask = PMX_MII_MASK, | ||
| 165 | }, | ||
| 166 | }; | ||
| 167 | |||
| 168 | struct pmx_dev pmx_mii = { | ||
| 169 | .name = "mii", | ||
| 170 | .modes = pmx_mii_modes, | ||
| 171 | .mode_count = ARRAY_SIZE(pmx_mii_modes), | ||
| 172 | .enb_on_reset = 0, | ||
| 173 | }; | ||
| 174 | |||
| 175 | struct pmx_dev_mode pmx_gpio_pin0_modes[] = { | ||
| 176 | { | ||
| 177 | .ids = 0xffffffff, | ||
| 178 | .mask = PMX_GPIO_PIN0_MASK, | ||
| 179 | }, | ||
| 180 | }; | ||
| 181 | |||
| 182 | struct pmx_dev pmx_gpio_pin0 = { | ||
| 183 | .name = "gpio_pin0", | ||
| 184 | .modes = pmx_gpio_pin0_modes, | ||
| 185 | .mode_count = ARRAY_SIZE(pmx_gpio_pin0_modes), | ||
| 186 | .enb_on_reset = 0, | ||
| 187 | }; | ||
| 188 | |||
| 189 | struct pmx_dev_mode pmx_gpio_pin1_modes[] = { | ||
| 190 | { | ||
| 191 | .ids = 0xffffffff, | ||
| 192 | .mask = PMX_GPIO_PIN1_MASK, | ||
| 193 | }, | ||
| 194 | }; | ||
| 195 | |||
| 196 | struct pmx_dev pmx_gpio_pin1 = { | ||
| 197 | .name = "gpio_pin1", | ||
| 198 | .modes = pmx_gpio_pin1_modes, | ||
| 199 | .mode_count = ARRAY_SIZE(pmx_gpio_pin1_modes), | ||
| 200 | .enb_on_reset = 0, | ||
| 201 | }; | ||
| 202 | |||
| 203 | struct pmx_dev_mode pmx_gpio_pin2_modes[] = { | ||
| 204 | { | ||
| 205 | .ids = 0xffffffff, | ||
| 206 | .mask = PMX_GPIO_PIN2_MASK, | ||
| 207 | }, | ||
| 208 | }; | ||
| 209 | |||
| 210 | struct pmx_dev pmx_gpio_pin2 = { | ||
| 211 | .name = "gpio_pin2", | ||
| 212 | .modes = pmx_gpio_pin2_modes, | ||
| 213 | .mode_count = ARRAY_SIZE(pmx_gpio_pin2_modes), | ||
| 214 | .enb_on_reset = 0, | ||
| 215 | }; | ||
| 216 | |||
| 217 | struct pmx_dev_mode pmx_gpio_pin3_modes[] = { | ||
| 218 | { | ||
| 219 | .ids = 0xffffffff, | ||
| 220 | .mask = PMX_GPIO_PIN3_MASK, | ||
| 221 | }, | ||
| 222 | }; | ||
| 223 | |||
| 224 | struct pmx_dev pmx_gpio_pin3 = { | ||
| 225 | .name = "gpio_pin3", | ||
| 226 | .modes = pmx_gpio_pin3_modes, | ||
| 227 | .mode_count = ARRAY_SIZE(pmx_gpio_pin3_modes), | ||
| 228 | .enb_on_reset = 0, | ||
| 229 | }; | ||
| 230 | |||
| 231 | struct pmx_dev_mode pmx_gpio_pin4_modes[] = { | ||
| 232 | { | ||
| 233 | .ids = 0xffffffff, | ||
| 234 | .mask = PMX_GPIO_PIN4_MASK, | ||
| 235 | }, | ||
| 236 | }; | ||
| 237 | |||
| 238 | struct pmx_dev pmx_gpio_pin4 = { | ||
| 239 | .name = "gpio_pin4", | ||
| 240 | .modes = pmx_gpio_pin4_modes, | ||
| 241 | .mode_count = ARRAY_SIZE(pmx_gpio_pin4_modes), | ||
| 242 | .enb_on_reset = 0, | ||
| 243 | }; | ||
| 244 | |||
| 245 | struct pmx_dev_mode pmx_gpio_pin5_modes[] = { | ||
| 246 | { | ||
| 247 | .ids = 0xffffffff, | ||
| 248 | .mask = PMX_GPIO_PIN5_MASK, | ||
| 249 | }, | ||
| 250 | }; | ||
| 251 | |||
| 252 | struct pmx_dev pmx_gpio_pin5 = { | ||
| 253 | .name = "gpio_pin5", | ||
| 254 | .modes = pmx_gpio_pin5_modes, | ||
| 255 | .mode_count = ARRAY_SIZE(pmx_gpio_pin5_modes), | ||
| 256 | .enb_on_reset = 0, | ||
| 257 | }; | ||
| 258 | |||
| 259 | struct pmx_dev_mode pmx_uart0_modem_modes[] = { | ||
| 260 | { | ||
| 261 | .ids = 0xffffffff, | ||
| 262 | .mask = PMX_UART0_MODEM_MASK, | ||
| 263 | }, | ||
| 264 | }; | ||
| 265 | |||
| 266 | struct pmx_dev pmx_uart0_modem = { | ||
| 267 | .name = "uart0_modem", | ||
| 268 | .modes = pmx_uart0_modem_modes, | ||
| 269 | .mode_count = ARRAY_SIZE(pmx_uart0_modem_modes), | ||
| 270 | .enb_on_reset = 0, | ||
| 271 | }; | ||
| 272 | |||
| 273 | struct pmx_dev_mode pmx_uart0_modes[] = { | ||
| 274 | { | ||
| 275 | .ids = 0xffffffff, | ||
| 276 | .mask = PMX_UART0_MASK, | ||
| 277 | }, | ||
| 278 | }; | ||
| 279 | |||
| 280 | struct pmx_dev pmx_uart0 = { | ||
| 281 | .name = "uart0", | ||
| 282 | .modes = pmx_uart0_modes, | ||
| 283 | .mode_count = ARRAY_SIZE(pmx_uart0_modes), | ||
| 284 | .enb_on_reset = 0, | ||
| 285 | }; | ||
| 286 | |||
| 287 | struct pmx_dev_mode pmx_timer_3_4_modes[] = { | ||
| 288 | { | ||
| 289 | .ids = 0xffffffff, | ||
| 290 | .mask = PMX_TIMER_3_4_MASK, | ||
| 291 | }, | ||
| 292 | }; | ||
| 293 | |||
| 294 | struct pmx_dev pmx_timer_3_4 = { | ||
| 295 | .name = "timer_3_4", | ||
| 296 | .modes = pmx_timer_3_4_modes, | ||
| 297 | .mode_count = ARRAY_SIZE(pmx_timer_3_4_modes), | ||
| 298 | .enb_on_reset = 0, | ||
| 299 | }; | ||
| 300 | |||
| 301 | struct pmx_dev_mode pmx_timer_1_2_modes[] = { | ||
| 302 | { | ||
| 303 | .ids = 0xffffffff, | ||
| 304 | .mask = PMX_TIMER_1_2_MASK, | ||
| 305 | }, | ||
| 306 | }; | ||
| 307 | |||
| 308 | struct pmx_dev pmx_timer_1_2 = { | ||
| 309 | .name = "timer_1_2", | ||
| 310 | .modes = pmx_timer_1_2_modes, | ||
| 311 | .mode_count = ARRAY_SIZE(pmx_timer_1_2_modes), | ||
| 312 | .enb_on_reset = 0, | ||
| 313 | }; | ||
| 314 | |||
| 315 | #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) | ||
| 316 | /* plgpios devices */ | ||
| 317 | struct pmx_dev_mode pmx_plgpio_0_1_modes[] = { | ||
| 318 | { | ||
| 319 | .ids = 0x00, | ||
| 320 | .mask = PMX_FIRDA_MASK, | ||
| 321 | }, | ||
| 322 | }; | ||
| 323 | |||
| 324 | struct pmx_dev pmx_plgpio_0_1 = { | ||
| 325 | .name = "plgpio 0 and 1", | ||
| 326 | .modes = pmx_plgpio_0_1_modes, | ||
| 327 | .mode_count = ARRAY_SIZE(pmx_plgpio_0_1_modes), | ||
| 328 | .enb_on_reset = 1, | ||
| 329 | }; | ||
| 330 | |||
| 331 | struct pmx_dev_mode pmx_plgpio_2_3_modes[] = { | ||
| 332 | { | ||
| 333 | .ids = 0x00, | ||
| 334 | .mask = PMX_UART0_MASK, | ||
| 335 | }, | ||
| 336 | }; | ||
| 337 | |||
| 338 | struct pmx_dev pmx_plgpio_2_3 = { | ||
| 339 | .name = "plgpio 2 and 3", | ||
| 340 | .modes = pmx_plgpio_2_3_modes, | ||
| 341 | .mode_count = ARRAY_SIZE(pmx_plgpio_2_3_modes), | ||
| 342 | .enb_on_reset = 1, | ||
| 343 | }; | ||
| 344 | |||
| 345 | struct pmx_dev_mode pmx_plgpio_4_5_modes[] = { | ||
| 346 | { | ||
| 347 | .ids = 0x00, | ||
| 348 | .mask = PMX_I2C_MASK, | ||
| 349 | }, | ||
| 350 | }; | ||
| 351 | |||
| 352 | struct pmx_dev pmx_plgpio_4_5 = { | ||
| 353 | .name = "plgpio 4 and 5", | ||
| 354 | .modes = pmx_plgpio_4_5_modes, | ||
| 355 | .mode_count = ARRAY_SIZE(pmx_plgpio_4_5_modes), | ||
| 356 | .enb_on_reset = 1, | ||
| 357 | }; | ||
| 358 | |||
| 359 | struct pmx_dev_mode pmx_plgpio_6_9_modes[] = { | ||
| 360 | { | ||
| 361 | .ids = 0x00, | ||
| 362 | .mask = PMX_SSP_MASK, | ||
| 363 | }, | ||
| 364 | }; | ||
| 365 | |||
| 366 | struct pmx_dev pmx_plgpio_6_9 = { | ||
| 367 | .name = "plgpio 6 to 9", | ||
| 368 | .modes = pmx_plgpio_6_9_modes, | ||
| 369 | .mode_count = ARRAY_SIZE(pmx_plgpio_6_9_modes), | ||
| 370 | .enb_on_reset = 1, | ||
| 371 | }; | ||
| 372 | |||
| 373 | struct pmx_dev_mode pmx_plgpio_10_27_modes[] = { | ||
| 374 | { | ||
| 375 | .ids = 0x00, | ||
| 376 | .mask = PMX_MII_MASK, | ||
| 377 | }, | ||
| 378 | }; | ||
| 379 | |||
| 380 | struct pmx_dev pmx_plgpio_10_27 = { | ||
| 381 | .name = "plgpio 10 to 27", | ||
| 382 | .modes = pmx_plgpio_10_27_modes, | ||
| 383 | .mode_count = ARRAY_SIZE(pmx_plgpio_10_27_modes), | ||
| 384 | .enb_on_reset = 1, | ||
| 385 | }; | ||
| 386 | |||
| 387 | struct pmx_dev_mode pmx_plgpio_28_modes[] = { | ||
| 388 | { | ||
| 389 | .ids = 0x00, | ||
| 390 | .mask = PMX_GPIO_PIN0_MASK, | ||
| 391 | }, | ||
| 392 | }; | ||
| 393 | |||
| 394 | struct pmx_dev pmx_plgpio_28 = { | ||
| 395 | .name = "plgpio 28", | ||
| 396 | .modes = pmx_plgpio_28_modes, | ||
| 397 | .mode_count = ARRAY_SIZE(pmx_plgpio_28_modes), | ||
| 398 | .enb_on_reset = 1, | ||
| 399 | }; | ||
| 400 | |||
| 401 | struct pmx_dev_mode pmx_plgpio_29_modes[] = { | ||
| 402 | { | ||
| 403 | .ids = 0x00, | ||
| 404 | .mask = PMX_GPIO_PIN1_MASK, | ||
| 405 | }, | ||
| 406 | }; | ||
| 407 | |||
| 408 | struct pmx_dev pmx_plgpio_29 = { | ||
| 409 | .name = "plgpio 29", | ||
| 410 | .modes = pmx_plgpio_29_modes, | ||
| 411 | .mode_count = ARRAY_SIZE(pmx_plgpio_29_modes), | ||
| 412 | .enb_on_reset = 1, | ||
| 413 | }; | ||
| 414 | |||
| 415 | struct pmx_dev_mode pmx_plgpio_30_modes[] = { | ||
| 416 | { | ||
| 417 | .ids = 0x00, | ||
| 418 | .mask = PMX_GPIO_PIN2_MASK, | ||
| 419 | }, | ||
| 420 | }; | ||
| 421 | |||
| 422 | struct pmx_dev pmx_plgpio_30 = { | ||
| 423 | .name = "plgpio 30", | ||
| 424 | .modes = pmx_plgpio_30_modes, | ||
| 425 | .mode_count = ARRAY_SIZE(pmx_plgpio_30_modes), | ||
| 426 | .enb_on_reset = 1, | ||
| 427 | }; | ||
| 428 | |||
| 429 | struct pmx_dev_mode pmx_plgpio_31_modes[] = { | ||
| 430 | { | ||
| 431 | .ids = 0x00, | ||
| 432 | .mask = PMX_GPIO_PIN3_MASK, | ||
| 433 | }, | ||
| 434 | }; | ||
| 435 | |||
| 436 | struct pmx_dev pmx_plgpio_31 = { | ||
| 437 | .name = "plgpio 31", | ||
| 438 | .modes = pmx_plgpio_31_modes, | ||
| 439 | .mode_count = ARRAY_SIZE(pmx_plgpio_31_modes), | ||
| 440 | .enb_on_reset = 1, | ||
| 441 | }; | ||
| 442 | |||
| 443 | struct pmx_dev_mode pmx_plgpio_32_modes[] = { | ||
| 444 | { | ||
| 445 | .ids = 0x00, | ||
| 446 | .mask = PMX_GPIO_PIN4_MASK, | ||
| 447 | }, | ||
| 448 | }; | ||
| 449 | |||
| 450 | struct pmx_dev pmx_plgpio_32 = { | ||
| 451 | .name = "plgpio 32", | ||
| 452 | .modes = pmx_plgpio_32_modes, | ||
| 453 | .mode_count = ARRAY_SIZE(pmx_plgpio_32_modes), | ||
| 454 | .enb_on_reset = 1, | ||
| 455 | }; | ||
| 456 | |||
| 457 | struct pmx_dev_mode pmx_plgpio_33_modes[] = { | ||
| 458 | { | ||
| 459 | .ids = 0x00, | ||
| 460 | .mask = PMX_GPIO_PIN5_MASK, | ||
| 461 | }, | ||
| 462 | }; | ||
| 463 | |||
| 464 | struct pmx_dev pmx_plgpio_33 = { | ||
| 465 | .name = "plgpio 33", | ||
| 466 | .modes = pmx_plgpio_33_modes, | ||
| 467 | .mode_count = ARRAY_SIZE(pmx_plgpio_33_modes), | ||
| 468 | .enb_on_reset = 1, | ||
| 469 | }; | ||
| 470 | |||
| 471 | struct pmx_dev_mode pmx_plgpio_34_36_modes[] = { | ||
| 472 | { | ||
| 473 | .ids = 0x00, | ||
| 474 | .mask = PMX_SSP_CS_MASK, | ||
| 475 | }, | ||
| 476 | }; | ||
| 477 | |||
| 478 | struct pmx_dev pmx_plgpio_34_36 = { | ||
| 479 | .name = "plgpio 34 to 36", | ||
| 480 | .modes = pmx_plgpio_34_36_modes, | ||
| 481 | .mode_count = ARRAY_SIZE(pmx_plgpio_34_36_modes), | ||
| 482 | .enb_on_reset = 1, | ||
| 483 | }; | ||
| 484 | |||
| 485 | struct pmx_dev_mode pmx_plgpio_37_42_modes[] = { | ||
| 486 | { | ||
| 487 | .ids = 0x00, | ||
| 488 | .mask = PMX_UART0_MODEM_MASK, | ||
| 489 | }, | ||
| 490 | }; | ||
| 491 | |||
| 492 | struct pmx_dev pmx_plgpio_37_42 = { | ||
| 493 | .name = "plgpio 37 to 42", | ||
| 494 | .modes = pmx_plgpio_37_42_modes, | ||
| 495 | .mode_count = ARRAY_SIZE(pmx_plgpio_37_42_modes), | ||
| 496 | .enb_on_reset = 1, | ||
| 497 | }; | ||
| 498 | |||
| 499 | struct pmx_dev_mode pmx_plgpio_43_44_47_48_modes[] = { | ||
| 500 | { | ||
| 501 | .ids = 0x00, | ||
| 502 | .mask = PMX_TIMER_1_2_MASK, | ||
| 503 | }, | ||
| 504 | }; | ||
| 505 | |||
| 506 | struct pmx_dev pmx_plgpio_43_44_47_48 = { | ||
| 507 | .name = "plgpio 43, 44, 47 and 48", | ||
| 508 | .modes = pmx_plgpio_43_44_47_48_modes, | ||
| 509 | .mode_count = ARRAY_SIZE(pmx_plgpio_43_44_47_48_modes), | ||
| 510 | .enb_on_reset = 1, | ||
| 511 | }; | ||
| 512 | |||
| 513 | struct pmx_dev_mode pmx_plgpio_45_46_49_50_modes[] = { | ||
| 514 | { | ||
| 515 | .ids = 0x00, | ||
| 516 | .mask = PMX_TIMER_3_4_MASK, | ||
| 517 | }, | ||
| 518 | }; | ||
| 519 | |||
| 520 | struct pmx_dev pmx_plgpio_45_46_49_50 = { | ||
| 521 | .name = "plgpio 45, 46, 49 and 50", | ||
| 522 | .modes = pmx_plgpio_45_46_49_50_modes, | ||
| 523 | .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes), | ||
| 524 | .enb_on_reset = 1, | ||
| 525 | }; | ||
| 526 | |||
| 527 | #endif | ||
| 528 | |||
| 529 | /* spear padmux initialization function */ | ||
| 530 | void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size) | ||
| 531 | { | ||
| 532 | int ret = 0; | ||
| 533 | |||
| 534 | /* pad mux initialization */ | ||
| 535 | pmx_driver->base = ioremap(base, size); | ||
| 536 | if (!pmx_driver->base) { | ||
| 537 | ret = -ENOMEM; | ||
| 538 | goto pmx_fail; | ||
| 539 | } | ||
| 540 | |||
| 541 | ret = pmx_register(pmx_driver); | ||
| 542 | iounmap(pmx_driver->base); | ||
| 543 | |||
| 544 | pmx_fail: | ||
| 545 | if (ret) | ||
| 546 | printk(KERN_ERR "padmux: registeration failed. err no: %d\n", | ||
| 547 | ret); | ||
| 548 | } | ||
diff --git a/arch/arm/mach-spear6xx/Kconfig b/arch/arm/mach-spear6xx/Kconfig new file mode 100644 index 000000000000..bddba034f862 --- /dev/null +++ b/arch/arm/mach-spear6xx/Kconfig | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | # | ||
| 2 | # SPEAr6XX Machine configuration file | ||
| 3 | # | ||
| 4 | |||
| 5 | if ARCH_SPEAR6XX | ||
| 6 | |||
| 7 | choice | ||
| 8 | prompt "SPEAr6XX Family" | ||
| 9 | default MACH_SPEAR600 | ||
| 10 | |||
| 11 | config MACH_SPEAR600 | ||
| 12 | bool "SPEAr600" | ||
| 13 | help | ||
| 14 | Supports ST SPEAr600 Machine | ||
| 15 | endchoice | ||
| 16 | |||
| 17 | # Adding SPEAr6XX machine specific configuration files | ||
| 18 | source "arch/arm/mach-spear6xx/Kconfig600" | ||
| 19 | |||
| 20 | endif #ARCH_SPEAR6XX | ||
diff --git a/arch/arm/mach-spear6xx/Kconfig600 b/arch/arm/mach-spear6xx/Kconfig600 new file mode 100644 index 000000000000..9e19f65eb78e --- /dev/null +++ b/arch/arm/mach-spear6xx/Kconfig600 | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # | ||
| 2 | # SPEAr600 machine configuration file | ||
| 3 | # | ||
| 4 | |||
| 5 | if MACH_SPEAR600 | ||
| 6 | |||
| 7 | choice | ||
| 8 | prompt "SPEAr600 Boards" | ||
| 9 | default BOARD_SPEAR600_EVB | ||
| 10 | |||
| 11 | config BOARD_SPEAR600_EVB | ||
| 12 | bool "SPEAr600 Evaluation Board" | ||
| 13 | help | ||
| 14 | Supports ST SPEAr600 Evaluation Board | ||
| 15 | endchoice | ||
| 16 | |||
| 17 | endif #MACH_SPEAR600 | ||
diff --git a/arch/arm/mach-spear6xx/Makefile b/arch/arm/mach-spear6xx/Makefile new file mode 100644 index 000000000000..cc1a4d82d459 --- /dev/null +++ b/arch/arm/mach-spear6xx/Makefile | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | # | ||
| 2 | # Makefile for SPEAr6XX machine series | ||
| 3 | # | ||
| 4 | |||
| 5 | # common files | ||
| 6 | obj-y += clock.o spear6xx.o | ||
| 7 | |||
| 8 | # spear600 specific files | ||
| 9 | obj-$(CONFIG_MACH_SPEAR600) += spear600.o | ||
| 10 | |||
| 11 | # spear600 boards files | ||
| 12 | obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o | ||
diff --git a/arch/arm/mach-spear6xx/Makefile.boot b/arch/arm/mach-spear6xx/Makefile.boot new file mode 100644 index 000000000000..7a1f3c0eadb8 --- /dev/null +++ b/arch/arm/mach-spear6xx/Makefile.boot | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | zreladdr-y := 0x00008000 | ||
| 2 | params_phys-y := 0x00000100 | ||
| 3 | initrd_phys-y := 0x00800000 | ||
diff --git a/arch/arm/mach-spear6xx/clock.c b/arch/arm/mach-spear6xx/clock.c new file mode 100644 index 000000000000..13e27c769685 --- /dev/null +++ b/arch/arm/mach-spear6xx/clock.c | |||
| @@ -0,0 +1,483 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/clock.c | ||
| 3 | * | ||
| 4 | * SPEAr6xx machines clock framework source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/init.h> | ||
| 15 | #include <linux/kernel.h> | ||
| 16 | #include <mach/misc_regs.h> | ||
| 17 | #include <plat/clock.h> | ||
| 18 | |||
| 19 | /* root clks */ | ||
| 20 | /* 32 KHz oscillator clock */ | ||
| 21 | static struct clk osc_32k_clk = { | ||
| 22 | .flags = ALWAYS_ENABLED, | ||
| 23 | .rate = 32000, | ||
| 24 | }; | ||
| 25 | |||
| 26 | /* 30 MHz oscillator clock */ | ||
| 27 | static struct clk osc_30m_clk = { | ||
| 28 | .flags = ALWAYS_ENABLED, | ||
| 29 | .rate = 30000000, | ||
| 30 | }; | ||
| 31 | |||
| 32 | /* clock derived from 32 KHz osc clk */ | ||
| 33 | /* rtc clock */ | ||
| 34 | static struct clk rtc_clk = { | ||
| 35 | .pclk = &osc_32k_clk, | ||
| 36 | .en_reg = PERIP1_CLK_ENB, | ||
| 37 | .en_reg_bit = RTC_CLK_ENB, | ||
| 38 | .recalc = &follow_parent, | ||
| 39 | }; | ||
| 40 | |||
| 41 | /* clock derived from 30 MHz osc clk */ | ||
| 42 | /* pll1 configuration structure */ | ||
| 43 | static struct pll_clk_config pll1_config = { | ||
| 44 | .mode_reg = PLL1_CTR, | ||
| 45 | .cfg_reg = PLL1_FRQ, | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* PLL1 clock */ | ||
| 49 | static struct clk pll1_clk = { | ||
| 50 | .pclk = &osc_30m_clk, | ||
| 51 | .en_reg = PLL1_CTR, | ||
| 52 | .en_reg_bit = PLL_ENABLE, | ||
| 53 | .recalc = &pll1_clk_recalc, | ||
| 54 | .private_data = &pll1_config, | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* PLL3 48 MHz clock */ | ||
| 58 | static struct clk pll3_48m_clk = { | ||
| 59 | .flags = ALWAYS_ENABLED, | ||
| 60 | .pclk = &osc_30m_clk, | ||
| 61 | .rate = 48000000, | ||
| 62 | }; | ||
| 63 | |||
| 64 | /* watch dog timer clock */ | ||
| 65 | static struct clk wdt_clk = { | ||
| 66 | .flags = ALWAYS_ENABLED, | ||
| 67 | .pclk = &osc_30m_clk, | ||
| 68 | .recalc = &follow_parent, | ||
| 69 | }; | ||
| 70 | |||
| 71 | /* clock derived from pll1 clk */ | ||
| 72 | /* cpu clock */ | ||
| 73 | static struct clk cpu_clk = { | ||
| 74 | .flags = ALWAYS_ENABLED, | ||
| 75 | .pclk = &pll1_clk, | ||
| 76 | .recalc = &follow_parent, | ||
| 77 | }; | ||
| 78 | |||
| 79 | /* ahb configuration structure */ | ||
| 80 | static struct bus_clk_config ahb_config = { | ||
| 81 | .reg = CORE_CLK_CFG, | ||
| 82 | .mask = PLL_HCLK_RATIO_MASK, | ||
| 83 | .shift = PLL_HCLK_RATIO_SHIFT, | ||
| 84 | }; | ||
| 85 | |||
| 86 | /* ahb clock */ | ||
| 87 | static struct clk ahb_clk = { | ||
| 88 | .flags = ALWAYS_ENABLED, | ||
| 89 | .pclk = &pll1_clk, | ||
| 90 | .recalc = &bus_clk_recalc, | ||
| 91 | .private_data = &ahb_config, | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* uart parents */ | ||
| 95 | static struct pclk_info uart_pclk_info[] = { | ||
| 96 | { | ||
| 97 | .pclk = &pll1_clk, | ||
| 98 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
| 99 | .scalable = 1, | ||
| 100 | }, { | ||
| 101 | .pclk = &pll3_48m_clk, | ||
| 102 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
| 103 | .scalable = 0, | ||
| 104 | }, | ||
| 105 | }; | ||
| 106 | |||
| 107 | /* uart parent select structure */ | ||
| 108 | static struct pclk_sel uart_pclk_sel = { | ||
| 109 | .pclk_info = uart_pclk_info, | ||
| 110 | .pclk_count = ARRAY_SIZE(uart_pclk_info), | ||
| 111 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
| 112 | .pclk_sel_mask = UART_CLK_MASK, | ||
| 113 | }; | ||
| 114 | |||
| 115 | /* uart configurations */ | ||
| 116 | static struct aux_clk_config uart_config = { | ||
| 117 | .synth_reg = UART_CLK_SYNT, | ||
| 118 | }; | ||
| 119 | |||
| 120 | /* uart0 clock */ | ||
| 121 | static struct clk uart0_clk = { | ||
| 122 | .en_reg = PERIP1_CLK_ENB, | ||
| 123 | .en_reg_bit = UART0_CLK_ENB, | ||
| 124 | .pclk_sel = &uart_pclk_sel, | ||
| 125 | .pclk_sel_shift = UART_CLK_SHIFT, | ||
| 126 | .recalc = &aux_clk_recalc, | ||
| 127 | .private_data = &uart_config, | ||
| 128 | }; | ||
| 129 | |||
| 130 | /* uart1 clock */ | ||
| 131 | static struct clk uart1_clk = { | ||
| 132 | .en_reg = PERIP1_CLK_ENB, | ||
| 133 | .en_reg_bit = UART1_CLK_ENB, | ||
| 134 | .pclk_sel = &uart_pclk_sel, | ||
| 135 | .pclk_sel_shift = UART_CLK_SHIFT, | ||
| 136 | .recalc = &aux_clk_recalc, | ||
| 137 | .private_data = &uart_config, | ||
| 138 | }; | ||
| 139 | |||
| 140 | /* firda configurations */ | ||
| 141 | static struct aux_clk_config firda_config = { | ||
| 142 | .synth_reg = FIRDA_CLK_SYNT, | ||
| 143 | }; | ||
| 144 | |||
| 145 | /* firda parents */ | ||
| 146 | static struct pclk_info firda_pclk_info[] = { | ||
| 147 | { | ||
| 148 | .pclk = &pll1_clk, | ||
| 149 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
| 150 | .scalable = 1, | ||
| 151 | }, { | ||
| 152 | .pclk = &pll3_48m_clk, | ||
| 153 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
| 154 | .scalable = 0, | ||
| 155 | }, | ||
| 156 | }; | ||
| 157 | |||
| 158 | /* firda parent select structure */ | ||
| 159 | static struct pclk_sel firda_pclk_sel = { | ||
| 160 | .pclk_info = firda_pclk_info, | ||
| 161 | .pclk_count = ARRAY_SIZE(firda_pclk_info), | ||
| 162 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
| 163 | .pclk_sel_mask = FIRDA_CLK_MASK, | ||
| 164 | }; | ||
| 165 | |||
| 166 | /* firda clock */ | ||
| 167 | static struct clk firda_clk = { | ||
| 168 | .en_reg = PERIP1_CLK_ENB, | ||
| 169 | .en_reg_bit = FIRDA_CLK_ENB, | ||
| 170 | .pclk_sel = &firda_pclk_sel, | ||
| 171 | .pclk_sel_shift = FIRDA_CLK_SHIFT, | ||
| 172 | .recalc = &aux_clk_recalc, | ||
| 173 | .private_data = &firda_config, | ||
| 174 | }; | ||
| 175 | |||
| 176 | /* clcd configurations */ | ||
| 177 | static struct aux_clk_config clcd_config = { | ||
| 178 | .synth_reg = CLCD_CLK_SYNT, | ||
| 179 | }; | ||
| 180 | |||
| 181 | /* clcd parents */ | ||
| 182 | static struct pclk_info clcd_pclk_info[] = { | ||
| 183 | { | ||
| 184 | .pclk = &pll1_clk, | ||
| 185 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
| 186 | .scalable = 1, | ||
| 187 | }, { | ||
| 188 | .pclk = &pll3_48m_clk, | ||
| 189 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
| 190 | .scalable = 0, | ||
| 191 | }, | ||
| 192 | }; | ||
| 193 | |||
| 194 | /* clcd parent select structure */ | ||
| 195 | static struct pclk_sel clcd_pclk_sel = { | ||
| 196 | .pclk_info = clcd_pclk_info, | ||
| 197 | .pclk_count = ARRAY_SIZE(clcd_pclk_info), | ||
| 198 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
| 199 | .pclk_sel_mask = CLCD_CLK_MASK, | ||
| 200 | }; | ||
| 201 | |||
| 202 | /* clcd clock */ | ||
| 203 | static struct clk clcd_clk = { | ||
| 204 | .en_reg = PERIP1_CLK_ENB, | ||
| 205 | .en_reg_bit = CLCD_CLK_ENB, | ||
| 206 | .pclk_sel = &clcd_pclk_sel, | ||
| 207 | .pclk_sel_shift = CLCD_CLK_SHIFT, | ||
| 208 | .recalc = &aux_clk_recalc, | ||
| 209 | .private_data = &clcd_config, | ||
| 210 | }; | ||
| 211 | |||
| 212 | /* gpt parents */ | ||
| 213 | static struct pclk_info gpt_pclk_info[] = { | ||
| 214 | { | ||
| 215 | .pclk = &pll1_clk, | ||
| 216 | .pclk_mask = AUX_CLK_PLL1_MASK, | ||
| 217 | .scalable = 1, | ||
| 218 | }, { | ||
| 219 | .pclk = &pll3_48m_clk, | ||
| 220 | .pclk_mask = AUX_CLK_PLL3_MASK, | ||
| 221 | .scalable = 0, | ||
| 222 | }, | ||
| 223 | }; | ||
| 224 | |||
| 225 | /* gpt parent select structure */ | ||
| 226 | static struct pclk_sel gpt_pclk_sel = { | ||
| 227 | .pclk_info = gpt_pclk_info, | ||
| 228 | .pclk_count = ARRAY_SIZE(gpt_pclk_info), | ||
| 229 | .pclk_sel_reg = PERIP_CLK_CFG, | ||
| 230 | .pclk_sel_mask = GPT_CLK_MASK, | ||
| 231 | }; | ||
| 232 | |||
| 233 | /* gpt0_1 configurations */ | ||
| 234 | static struct aux_clk_config gpt0_1_config = { | ||
| 235 | .synth_reg = PRSC1_CLK_CFG, | ||
| 236 | }; | ||
| 237 | |||
| 238 | /* gpt0 ARM1 subsystem timer clock */ | ||
| 239 | static struct clk gpt0_clk = { | ||
| 240 | .flags = ALWAYS_ENABLED, | ||
| 241 | .pclk_sel = &gpt_pclk_sel, | ||
| 242 | .pclk_sel_shift = GPT0_CLK_SHIFT, | ||
| 243 | .recalc = &gpt_clk_recalc, | ||
| 244 | .private_data = &gpt0_1_config, | ||
| 245 | }; | ||
| 246 | |||
| 247 | /* gpt1 timer clock */ | ||
| 248 | static struct clk gpt1_clk = { | ||
| 249 | .flags = ALWAYS_ENABLED, | ||
| 250 | .pclk_sel = &gpt_pclk_sel, | ||
| 251 | .pclk_sel_shift = GPT1_CLK_SHIFT, | ||
| 252 | .recalc = &gpt_clk_recalc, | ||
| 253 | .private_data = &gpt0_1_config, | ||
| 254 | }; | ||
| 255 | |||
| 256 | /* gpt2 configurations */ | ||
| 257 | static struct aux_clk_config gpt2_config = { | ||
| 258 | .synth_reg = PRSC2_CLK_CFG, | ||
| 259 | }; | ||
| 260 | |||
| 261 | /* gpt2 timer clock */ | ||
| 262 | static struct clk gpt2_clk = { | ||
| 263 | .en_reg = PERIP1_CLK_ENB, | ||
| 264 | .en_reg_bit = GPT2_CLK_ENB, | ||
| 265 | .pclk_sel = &gpt_pclk_sel, | ||
| 266 | .pclk_sel_shift = GPT2_CLK_SHIFT, | ||
| 267 | .recalc = &gpt_clk_recalc, | ||
| 268 | .private_data = &gpt2_config, | ||
| 269 | }; | ||
| 270 | |||
| 271 | /* gpt3 configurations */ | ||
| 272 | static struct aux_clk_config gpt3_config = { | ||
| 273 | .synth_reg = PRSC3_CLK_CFG, | ||
| 274 | }; | ||
| 275 | |||
| 276 | /* gpt3 timer clock */ | ||
| 277 | static struct clk gpt3_clk = { | ||
| 278 | .en_reg = PERIP1_CLK_ENB, | ||
| 279 | .en_reg_bit = GPT3_CLK_ENB, | ||
| 280 | .pclk_sel = &gpt_pclk_sel, | ||
| 281 | .pclk_sel_shift = GPT3_CLK_SHIFT, | ||
| 282 | .recalc = &gpt_clk_recalc, | ||
| 283 | .private_data = &gpt3_config, | ||
| 284 | }; | ||
| 285 | |||
| 286 | /* clock derived from pll3 clk */ | ||
| 287 | /* usbh0 clock */ | ||
| 288 | static struct clk usbh0_clk = { | ||
| 289 | .pclk = &pll3_48m_clk, | ||
| 290 | .en_reg = PERIP1_CLK_ENB, | ||
| 291 | .en_reg_bit = USBH0_CLK_ENB, | ||
| 292 | .recalc = &follow_parent, | ||
| 293 | }; | ||
| 294 | |||
| 295 | /* usbh1 clock */ | ||
| 296 | static struct clk usbh1_clk = { | ||
| 297 | .pclk = &pll3_48m_clk, | ||
| 298 | .en_reg = PERIP1_CLK_ENB, | ||
| 299 | .en_reg_bit = USBH1_CLK_ENB, | ||
| 300 | .recalc = &follow_parent, | ||
| 301 | }; | ||
| 302 | |||
| 303 | /* usbd clock */ | ||
| 304 | static struct clk usbd_clk = { | ||
| 305 | .pclk = &pll3_48m_clk, | ||
| 306 | .en_reg = PERIP1_CLK_ENB, | ||
| 307 | .en_reg_bit = USBD_CLK_ENB, | ||
| 308 | .recalc = &follow_parent, | ||
| 309 | }; | ||
| 310 | |||
| 311 | /* clock derived from ahb clk */ | ||
| 312 | /* apb configuration structure */ | ||
| 313 | static struct bus_clk_config apb_config = { | ||
| 314 | .reg = CORE_CLK_CFG, | ||
| 315 | .mask = HCLK_PCLK_RATIO_MASK, | ||
| 316 | .shift = HCLK_PCLK_RATIO_SHIFT, | ||
| 317 | }; | ||
| 318 | |||
| 319 | /* apb clock */ | ||
| 320 | static struct clk apb_clk = { | ||
| 321 | .flags = ALWAYS_ENABLED, | ||
| 322 | .pclk = &ahb_clk, | ||
| 323 | .recalc = &bus_clk_recalc, | ||
| 324 | .private_data = &apb_config, | ||
| 325 | }; | ||
| 326 | |||
| 327 | /* i2c clock */ | ||
| 328 | static struct clk i2c_clk = { | ||
| 329 | .pclk = &ahb_clk, | ||
| 330 | .en_reg = PERIP1_CLK_ENB, | ||
| 331 | .en_reg_bit = I2C_CLK_ENB, | ||
| 332 | .recalc = &follow_parent, | ||
| 333 | }; | ||
| 334 | |||
| 335 | /* dma clock */ | ||
| 336 | static struct clk dma_clk = { | ||
| 337 | .pclk = &ahb_clk, | ||
| 338 | .en_reg = PERIP1_CLK_ENB, | ||
| 339 | .en_reg_bit = DMA_CLK_ENB, | ||
| 340 | .recalc = &follow_parent, | ||
| 341 | }; | ||
| 342 | |||
| 343 | /* jpeg clock */ | ||
| 344 | static struct clk jpeg_clk = { | ||
| 345 | .pclk = &ahb_clk, | ||
| 346 | .en_reg = PERIP1_CLK_ENB, | ||
| 347 | .en_reg_bit = JPEG_CLK_ENB, | ||
| 348 | .recalc = &follow_parent, | ||
| 349 | }; | ||
| 350 | |||
| 351 | /* gmac clock */ | ||
| 352 | static struct clk gmac_clk = { | ||
| 353 | .pclk = &ahb_clk, | ||
| 354 | .en_reg = PERIP1_CLK_ENB, | ||
| 355 | .en_reg_bit = GMAC_CLK_ENB, | ||
| 356 | .recalc = &follow_parent, | ||
| 357 | }; | ||
| 358 | |||
| 359 | /* smi clock */ | ||
| 360 | static struct clk smi_clk = { | ||
| 361 | .pclk = &ahb_clk, | ||
| 362 | .en_reg = PERIP1_CLK_ENB, | ||
| 363 | .en_reg_bit = SMI_CLK_ENB, | ||
| 364 | .recalc = &follow_parent, | ||
| 365 | }; | ||
| 366 | |||
| 367 | /* fsmc clock */ | ||
| 368 | static struct clk fsmc_clk = { | ||
| 369 | .pclk = &ahb_clk, | ||
| 370 | .en_reg = PERIP1_CLK_ENB, | ||
| 371 | .en_reg_bit = FSMC_CLK_ENB, | ||
| 372 | .recalc = &follow_parent, | ||
| 373 | }; | ||
| 374 | |||
| 375 | /* clock derived from apb clk */ | ||
| 376 | /* adc clock */ | ||
| 377 | static struct clk adc_clk = { | ||
| 378 | .pclk = &apb_clk, | ||
| 379 | .en_reg = PERIP1_CLK_ENB, | ||
| 380 | .en_reg_bit = ADC_CLK_ENB, | ||
| 381 | .recalc = &follow_parent, | ||
| 382 | }; | ||
| 383 | |||
| 384 | /* ssp0 clock */ | ||
| 385 | static struct clk ssp0_clk = { | ||
| 386 | .pclk = &apb_clk, | ||
| 387 | .en_reg = PERIP1_CLK_ENB, | ||
| 388 | .en_reg_bit = SSP0_CLK_ENB, | ||
| 389 | .recalc = &follow_parent, | ||
| 390 | }; | ||
| 391 | |||
| 392 | /* ssp1 clock */ | ||
| 393 | static struct clk ssp1_clk = { | ||
| 394 | .pclk = &apb_clk, | ||
| 395 | .en_reg = PERIP1_CLK_ENB, | ||
| 396 | .en_reg_bit = SSP1_CLK_ENB, | ||
| 397 | .recalc = &follow_parent, | ||
| 398 | }; | ||
| 399 | |||
| 400 | /* ssp2 clock */ | ||
| 401 | static struct clk ssp2_clk = { | ||
| 402 | .pclk = &apb_clk, | ||
| 403 | .en_reg = PERIP1_CLK_ENB, | ||
| 404 | .en_reg_bit = SSP2_CLK_ENB, | ||
| 405 | .recalc = &follow_parent, | ||
| 406 | }; | ||
| 407 | |||
| 408 | /* gpio0 ARM subsystem clock */ | ||
| 409 | static struct clk gpio0_clk = { | ||
| 410 | .flags = ALWAYS_ENABLED, | ||
| 411 | .pclk = &apb_clk, | ||
| 412 | .recalc = &follow_parent, | ||
| 413 | }; | ||
| 414 | |||
| 415 | /* gpio1 clock */ | ||
| 416 | static struct clk gpio1_clk = { | ||
| 417 | .pclk = &apb_clk, | ||
| 418 | .en_reg = PERIP1_CLK_ENB, | ||
| 419 | .en_reg_bit = GPIO1_CLK_ENB, | ||
| 420 | .recalc = &follow_parent, | ||
| 421 | }; | ||
| 422 | |||
| 423 | /* gpio2 clock */ | ||
| 424 | static struct clk gpio2_clk = { | ||
| 425 | .pclk = &apb_clk, | ||
| 426 | .en_reg = PERIP1_CLK_ENB, | ||
| 427 | .en_reg_bit = GPIO2_CLK_ENB, | ||
| 428 | .recalc = &follow_parent, | ||
| 429 | }; | ||
| 430 | |||
| 431 | /* array of all spear 6xx clock lookups */ | ||
| 432 | static struct clk_lookup spear_clk_lookups[] = { | ||
| 433 | /* root clks */ | ||
| 434 | { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, | ||
| 435 | { .con_id = "osc_30m_clk", .clk = &osc_30m_clk}, | ||
| 436 | /* clock derived from 32 KHz os clk */ | ||
| 437 | { .dev_id = "rtc", .clk = &rtc_clk}, | ||
| 438 | /* clock derived from 30 MHz os clk */ | ||
| 439 | { .con_id = "pll1_clk", .clk = &pll1_clk}, | ||
| 440 | { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk}, | ||
| 441 | { .dev_id = "wdt", .clk = &wdt_clk}, | ||
| 442 | /* clock derived from pll1 clk */ | ||
| 443 | { .con_id = "cpu_clk", .clk = &cpu_clk}, | ||
| 444 | { .con_id = "ahb_clk", .clk = &ahb_clk}, | ||
| 445 | { .dev_id = "uart0", .clk = &uart0_clk}, | ||
| 446 | { .dev_id = "uart1", .clk = &uart1_clk}, | ||
| 447 | { .dev_id = "firda", .clk = &firda_clk}, | ||
| 448 | { .dev_id = "clcd", .clk = &clcd_clk}, | ||
| 449 | { .dev_id = "gpt0", .clk = &gpt0_clk}, | ||
| 450 | { .dev_id = "gpt1", .clk = &gpt1_clk}, | ||
| 451 | { .dev_id = "gpt2", .clk = &gpt2_clk}, | ||
| 452 | { .dev_id = "gpt3", .clk = &gpt3_clk}, | ||
| 453 | /* clock derived from pll3 clk */ | ||
| 454 | { .dev_id = "usbh0", .clk = &usbh0_clk}, | ||
| 455 | { .dev_id = "usbh1", .clk = &usbh1_clk}, | ||
| 456 | { .dev_id = "usbd", .clk = &usbd_clk}, | ||
| 457 | /* clock derived from ahb clk */ | ||
| 458 | { .con_id = "apb_clk", .clk = &apb_clk}, | ||
| 459 | { .dev_id = "i2c", .clk = &i2c_clk}, | ||
| 460 | { .dev_id = "dma", .clk = &dma_clk}, | ||
| 461 | { .dev_id = "jpeg", .clk = &jpeg_clk}, | ||
| 462 | { .dev_id = "gmac", .clk = &gmac_clk}, | ||
| 463 | { .dev_id = "smi", .clk = &smi_clk}, | ||
| 464 | { .dev_id = "fsmc", .clk = &fsmc_clk}, | ||
| 465 | /* clock derived from apb clk */ | ||
| 466 | { .dev_id = "adc", .clk = &adc_clk}, | ||
| 467 | { .dev_id = "ssp0", .clk = &ssp0_clk}, | ||
| 468 | { .dev_id = "ssp1", .clk = &ssp1_clk}, | ||
| 469 | { .dev_id = "ssp2", .clk = &ssp2_clk}, | ||
| 470 | { .dev_id = "gpio0", .clk = &gpio0_clk}, | ||
| 471 | { .dev_id = "gpio1", .clk = &gpio1_clk}, | ||
| 472 | { .dev_id = "gpio2", .clk = &gpio2_clk}, | ||
| 473 | }; | ||
| 474 | |||
| 475 | void __init clk_init(void) | ||
| 476 | { | ||
| 477 | int i; | ||
| 478 | |||
| 479 | for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) | ||
| 480 | clk_register(&spear_clk_lookups[i]); | ||
| 481 | |||
| 482 | recalc_root_clocks(); | ||
| 483 | } | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/clkdev.h b/arch/arm/mach-spear6xx/include/mach/clkdev.h new file mode 100644 index 000000000000..05676bf440d3 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/clkdev.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/clkdev.h | ||
| 3 | * | ||
| 4 | * Clock Dev framework definitions for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_CLKDEV_H | ||
| 15 | #define __MACH_CLKDEV_H | ||
| 16 | |||
| 17 | #include <plat/clkdev.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_CLKDEV_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/debug-macro.S b/arch/arm/mach-spear6xx/include/mach/debug-macro.S new file mode 100644 index 000000000000..0f3ea39edd96 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/debug-macro.S | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/debug-macro.S | ||
| 3 | * | ||
| 4 | * Debugging macro include header for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <plat/debug-macro.S> | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/entry-macro.S b/arch/arm/mach-spear6xx/include/mach/entry-macro.S new file mode 100644 index 000000000000..9eaecaeafcf0 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/entry-macro.S | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/entry-macro.S | ||
| 3 | * | ||
| 4 | * Low-level IRQ helper macros for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <mach/hardware.h> | ||
| 15 | #include <mach/spear.h> | ||
| 16 | #include <asm/hardware/vic.h> | ||
| 17 | |||
| 18 | .macro disable_fiq | ||
| 19 | .endm | ||
| 20 | |||
| 21 | .macro get_irqnr_preamble, base, tmp | ||
| 22 | .endm | ||
| 23 | |||
| 24 | .macro arch_ret_to_user, tmp1, tmp2 | ||
| 25 | .endm | ||
| 26 | |||
| 27 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
| 28 | ldr \base, =VA_SPEAR6XX_CPU_VIC_PRI_BASE | ||
| 29 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status | ||
| 30 | mov \irqnr, #0 | ||
| 31 | teq \irqstat, #0 | ||
| 32 | bne 1001f | ||
| 33 | ldr \base, =VA_SPEAR6XX_CPU_VIC_SEC_BASE | ||
| 34 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status | ||
| 35 | teq \irqstat, #0 | ||
| 36 | beq 1002f @ this will set/reset | ||
| 37 | @ zero register | ||
| 38 | mov \irqnr, #32 | ||
| 39 | 1001: | ||
| 40 | /* | ||
| 41 | * Following code will find bit position of least significang | ||
| 42 | * bit set in irqstat, using following equation | ||
| 43 | * least significant bit set in n = (n & ~(n-1)) | ||
| 44 | */ | ||
| 45 | sub \tmp, \irqstat, #1 @ tmp = irqstat - 1 | ||
| 46 | mvn \tmp, \tmp @ tmp = ~tmp | ||
| 47 | and \irqstat, \irqstat, \tmp @ irqstat &= tmp | ||
| 48 | /* Now, irqstat is = bit no. of 1st bit set in vic irq status */ | ||
| 49 | clz \tmp, \irqstat @ tmp = leading zeros | ||
| 50 | |||
| 51 | rsb \tmp, \tmp, #0x1F @ tmp = 32 - tmp - 1 | ||
| 52 | add \irqnr, \irqnr, \tmp | ||
| 53 | |||
| 54 | 1002: /* EQ will be set if no irqs pending */ | ||
| 55 | .endm | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/generic.h b/arch/arm/mach-spear6xx/include/mach/generic.h new file mode 100644 index 000000000000..16205a538756 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/generic.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/generic.h | ||
| 3 | * | ||
| 4 | * SPEAr6XX machine family specific generic header file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_GENERIC_H | ||
| 15 | #define __MACH_GENERIC_H | ||
| 16 | |||
| 17 | #include <asm/mach/time.h> | ||
| 18 | #include <asm/mach/map.h> | ||
| 19 | #include <linux/init.h> | ||
| 20 | #include <linux/platform_device.h> | ||
| 21 | #include <linux/amba/bus.h> | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Each GPT has 2 timer channels | ||
| 25 | * Following GPT channels will be used as clock source and clockevent | ||
| 26 | */ | ||
| 27 | #define SPEAR_GPT0_BASE SPEAR6XX_CPU_TMR_BASE | ||
| 28 | #define SPEAR_GPT0_CHAN0_IRQ IRQ_CPU_GPT1_1 | ||
| 29 | #define SPEAR_GPT0_CHAN1_IRQ IRQ_CPU_GPT1_2 | ||
| 30 | |||
| 31 | /* Add spear6xx family device structure declarations here */ | ||
| 32 | extern struct amba_device gpio_device[]; | ||
| 33 | extern struct amba_device uart_device[]; | ||
| 34 | extern struct sys_timer spear_sys_timer; | ||
| 35 | |||
| 36 | /* Add spear6xx family function declarations here */ | ||
| 37 | void __init spear6xx_map_io(void); | ||
| 38 | void __init spear6xx_init_irq(void); | ||
| 39 | void __init spear6xx_init(void); | ||
| 40 | void __init spear600_init(void); | ||
| 41 | void __init clk_init(void); | ||
| 42 | |||
| 43 | /* Add spear600 machine device structure declarations here */ | ||
| 44 | |||
| 45 | #endif /* __MACH_GENERIC_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/gpio.h b/arch/arm/mach-spear6xx/include/mach/gpio.h new file mode 100644 index 000000000000..3a789dbb69f7 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/gpio.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/gpio.h | ||
| 3 | * | ||
| 4 | * GPIO macros for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_GPIO_H | ||
| 15 | #define __MACH_GPIO_H | ||
| 16 | |||
| 17 | #include <plat/gpio.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_GPIO_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/hardware.h b/arch/arm/mach-spear6xx/include/mach/hardware.h new file mode 100644 index 000000000000..7545116deca9 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/hardware.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/hardware.h | ||
| 3 | * | ||
| 4 | * Hardware definitions for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_HARDWARE_H | ||
| 15 | #define __MACH_HARDWARE_H | ||
| 16 | |||
| 17 | /* Vitual to physical translation of statically mapped space */ | ||
| 18 | #define IO_ADDRESS(x) (x | 0xF0000000) | ||
| 19 | |||
| 20 | #endif /* __MACH_HARDWARE_H */ | ||
| 21 | |||
diff --git a/arch/arm/mach-spear6xx/include/mach/io.h b/arch/arm/mach-spear6xx/include/mach/io.h new file mode 100644 index 000000000000..fb7c106cea94 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/io.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/io.h | ||
| 3 | * | ||
| 4 | * IO definitions for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_IO_H | ||
| 15 | #define __MACH_IO_H | ||
| 16 | |||
| 17 | #include <plat/io.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_IO_H */ | ||
| 20 | |||
diff --git a/arch/arm/mach-spear6xx/include/mach/irqs.h b/arch/arm/mach-spear6xx/include/mach/irqs.h new file mode 100644 index 000000000000..8f214b03d75d --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/irqs.h | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/irqs.h | ||
| 3 | * | ||
| 4 | * IRQ helper macros for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_IRQS_H | ||
| 15 | #define __MACH_IRQS_H | ||
| 16 | |||
| 17 | /* IRQ definitions */ | ||
| 18 | /* VIC 1 */ | ||
| 19 | #define IRQ_INTRCOMM_SW_IRQ 0 | ||
| 20 | #define IRQ_INTRCOMM_CPU_1 1 | ||
| 21 | #define IRQ_INTRCOMM_CPU_2 2 | ||
| 22 | #define IRQ_INTRCOMM_RAS2A11_1 3 | ||
| 23 | #define IRQ_INTRCOMM_RAS2A11_2 4 | ||
| 24 | #define IRQ_INTRCOMM_RAS2A12_1 5 | ||
| 25 | #define IRQ_INTRCOMM_RAS2A12_2 6 | ||
| 26 | #define IRQ_GEN_RAS_0 7 | ||
| 27 | #define IRQ_GEN_RAS_1 8 | ||
| 28 | #define IRQ_GEN_RAS_2 9 | ||
| 29 | #define IRQ_GEN_RAS_3 10 | ||
| 30 | #define IRQ_GEN_RAS_4 11 | ||
| 31 | #define IRQ_GEN_RAS_5 12 | ||
| 32 | #define IRQ_GEN_RAS_6 13 | ||
| 33 | #define IRQ_GEN_RAS_7 14 | ||
| 34 | #define IRQ_GEN_RAS_8 15 | ||
| 35 | #define IRQ_CPU_GPT1_1 16 | ||
| 36 | #define IRQ_CPU_GPT1_2 17 | ||
| 37 | #define IRQ_LOCAL_GPIO 18 | ||
| 38 | #define IRQ_PLL_UNLOCK 19 | ||
| 39 | #define IRQ_JPEG 20 | ||
| 40 | #define IRQ_FSMC 21 | ||
| 41 | #define IRQ_IRDA 22 | ||
| 42 | #define IRQ_RESERVED 23 | ||
| 43 | #define IRQ_UART_0 24 | ||
| 44 | #define IRQ_UART_1 25 | ||
| 45 | #define IRQ_SSP_1 26 | ||
| 46 | #define IRQ_SSP_2 27 | ||
| 47 | #define IRQ_I2C 28 | ||
| 48 | #define IRQ_GEN_RAS_9 29 | ||
| 49 | #define IRQ_GEN_RAS_10 30 | ||
| 50 | #define IRQ_GEN_RAS_11 31 | ||
| 51 | |||
| 52 | /* VIC 2 */ | ||
| 53 | #define IRQ_APPL_GPT1_1 32 | ||
| 54 | #define IRQ_APPL_GPT1_2 33 | ||
| 55 | #define IRQ_APPL_GPT2_1 34 | ||
| 56 | #define IRQ_APPL_GPT2_2 35 | ||
| 57 | #define IRQ_APPL_GPIO 36 | ||
| 58 | #define IRQ_APPL_SSP 37 | ||
| 59 | #define IRQ_APPL_ADC 38 | ||
| 60 | #define IRQ_APPL_RESERVED 39 | ||
| 61 | #define IRQ_AHB_EXP_MASTER 40 | ||
| 62 | #define IRQ_DDR_CONTROLLER 41 | ||
| 63 | #define IRQ_BASIC_DMA 42 | ||
| 64 | #define IRQ_BASIC_RESERVED1 43 | ||
| 65 | #define IRQ_BASIC_SMI 44 | ||
| 66 | #define IRQ_BASIC_CLCD 45 | ||
| 67 | #define IRQ_EXP_AHB_1 46 | ||
| 68 | #define IRQ_EXP_AHB_2 47 | ||
| 69 | #define IRQ_BASIC_GPT1_1 48 | ||
| 70 | #define IRQ_BASIC_GPT1_2 49 | ||
| 71 | #define IRQ_BASIC_RTC 50 | ||
| 72 | #define IRQ_BASIC_GPIO 51 | ||
| 73 | #define IRQ_BASIC_WDT 52 | ||
| 74 | #define IRQ_BASIC_RESERVED 53 | ||
| 75 | #define IRQ_AHB_EXP_SLAVE 54 | ||
| 76 | #define IRQ_GMAC_1 55 | ||
| 77 | #define IRQ_GMAC_2 56 | ||
| 78 | #define IRQ_USB_DEV 57 | ||
| 79 | #define IRQ_USB_H_OHCI_0 58 | ||
| 80 | #define IRQ_USB_H_EHCI_0 59 | ||
| 81 | #define IRQ_USB_H_OHCI_1 60 | ||
| 82 | #define IRQ_USB_H_EHCI_1 61 | ||
| 83 | #define IRQ_EXP_AHB_3 62 | ||
| 84 | #define IRQ_EXP_AHB_4 63 | ||
| 85 | |||
| 86 | #define IRQ_VIC_END 64 | ||
| 87 | |||
| 88 | /* GPIO pins virtual irqs */ | ||
| 89 | #define SPEAR_GPIO_INT_BASE IRQ_VIC_END | ||
| 90 | #define SPEAR_GPIO0_INT_BASE SPEAR_GPIO_INT_BASE | ||
| 91 | #define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO0_INT_BASE + 8) | ||
| 92 | #define SPEAR_GPIO2_INT_BASE (SPEAR_GPIO1_INT_BASE + 8) | ||
| 93 | #define SPEAR_GPIO_INT_END (SPEAR_GPIO2_INT_BASE + 8) | ||
| 94 | #define VIRTUAL_IRQS (SPEAR_GPIO_INT_END - IRQ_VIC_END) | ||
| 95 | #define NR_IRQS (IRQ_VIC_END + VIRTUAL_IRQS) | ||
| 96 | |||
| 97 | #endif /* __MACH_IRQS_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/memory.h b/arch/arm/mach-spear6xx/include/mach/memory.h new file mode 100644 index 000000000000..781f088fc228 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/memory.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/memory.h | ||
| 3 | * | ||
| 4 | * Memory map for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_MEMORY_H | ||
| 15 | #define __MACH_MEMORY_H | ||
| 16 | |||
| 17 | #include <plat/memory.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_MEMORY_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/misc_regs.h b/arch/arm/mach-spear6xx/include/mach/misc_regs.h new file mode 100644 index 000000000000..03908036b0d0 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/misc_regs.h | |||
| @@ -0,0 +1,173 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/misc_regs.h | ||
| 3 | * | ||
| 4 | * Miscellaneous registers definitions for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_MISC_REGS_H | ||
| 15 | #define __MACH_MISC_REGS_H | ||
| 16 | |||
| 17 | #include <mach/spear.h> | ||
| 18 | |||
| 19 | #define MISC_BASE VA_SPEAR6XX_ICM3_MISC_REG_BASE | ||
| 20 | |||
| 21 | #define SOC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x000)) | ||
| 22 | #define DIAG_CFG_CTR ((unsigned int *)(MISC_BASE + 0x004)) | ||
| 23 | #define PLL1_CTR ((unsigned int *)(MISC_BASE + 0x008)) | ||
| 24 | #define PLL1_FRQ ((unsigned int *)(MISC_BASE + 0x00C)) | ||
| 25 | #define PLL1_MOD ((unsigned int *)(MISC_BASE + 0x010)) | ||
| 26 | #define PLL2_CTR ((unsigned int *)(MISC_BASE + 0x014)) | ||
| 27 | /* PLL_CTR register masks */ | ||
| 28 | #define PLL_ENABLE 2 | ||
| 29 | #define PLL_MODE_SHIFT 4 | ||
| 30 | #define PLL_MODE_MASK 0x3 | ||
| 31 | #define PLL_MODE_NORMAL 0 | ||
| 32 | #define PLL_MODE_FRACTION 1 | ||
| 33 | #define PLL_MODE_DITH_DSB 2 | ||
| 34 | #define PLL_MODE_DITH_SSB 3 | ||
| 35 | |||
| 36 | #define PLL2_FRQ ((unsigned int *)(MISC_BASE + 0x018)) | ||
| 37 | /* PLL FRQ register masks */ | ||
| 38 | #define PLL_DIV_N_SHIFT 0 | ||
| 39 | #define PLL_DIV_N_MASK 0xFF | ||
| 40 | #define PLL_DIV_P_SHIFT 8 | ||
| 41 | #define PLL_DIV_P_MASK 0x7 | ||
| 42 | #define PLL_NORM_FDBK_M_SHIFT 24 | ||
| 43 | #define PLL_NORM_FDBK_M_MASK 0xFF | ||
| 44 | #define PLL_DITH_FDBK_M_SHIFT 16 | ||
| 45 | #define PLL_DITH_FDBK_M_MASK 0xFFFF | ||
| 46 | |||
| 47 | #define PLL2_MOD ((unsigned int *)(MISC_BASE + 0x01C)) | ||
| 48 | #define PLL_CLK_CFG ((unsigned int *)(MISC_BASE + 0x020)) | ||
| 49 | #define CORE_CLK_CFG ((unsigned int *)(MISC_BASE + 0x024)) | ||
| 50 | /* CORE CLK CFG register masks */ | ||
| 51 | #define PLL_HCLK_RATIO_SHIFT 10 | ||
| 52 | #define PLL_HCLK_RATIO_MASK 0x3 | ||
| 53 | #define HCLK_PCLK_RATIO_SHIFT 8 | ||
| 54 | #define HCLK_PCLK_RATIO_MASK 0x3 | ||
| 55 | |||
| 56 | #define PERIP_CLK_CFG ((unsigned int *)(MISC_BASE + 0x028)) | ||
| 57 | /* PERIP_CLK_CFG register masks */ | ||
| 58 | #define CLCD_CLK_SHIFT 2 | ||
| 59 | #define CLCD_CLK_MASK 0x3 | ||
| 60 | #define UART_CLK_SHIFT 4 | ||
| 61 | #define UART_CLK_MASK 0x1 | ||
| 62 | #define FIRDA_CLK_SHIFT 5 | ||
| 63 | #define FIRDA_CLK_MASK 0x3 | ||
| 64 | #define GPT0_CLK_SHIFT 8 | ||
| 65 | #define GPT1_CLK_SHIFT 10 | ||
| 66 | #define GPT2_CLK_SHIFT 11 | ||
| 67 | #define GPT3_CLK_SHIFT 12 | ||
| 68 | #define GPT_CLK_MASK 0x1 | ||
| 69 | #define AUX_CLK_PLL3_MASK 0 | ||
| 70 | #define AUX_CLK_PLL1_MASK 1 | ||
| 71 | |||
| 72 | #define PERIP1_CLK_ENB ((unsigned int *)(MISC_BASE + 0x02C)) | ||
| 73 | /* PERIP1_CLK_ENB register masks */ | ||
| 74 | #define UART0_CLK_ENB 3 | ||
| 75 | #define UART1_CLK_ENB 4 | ||
| 76 | #define SSP0_CLK_ENB 5 | ||
| 77 | #define SSP1_CLK_ENB 6 | ||
| 78 | #define I2C_CLK_ENB 7 | ||
| 79 | #define JPEG_CLK_ENB 8 | ||
| 80 | #define FSMC_CLK_ENB 9 | ||
| 81 | #define FIRDA_CLK_ENB 10 | ||
| 82 | #define GPT2_CLK_ENB 11 | ||
| 83 | #define GPT3_CLK_ENB 12 | ||
| 84 | #define GPIO2_CLK_ENB 13 | ||
| 85 | #define SSP2_CLK_ENB 14 | ||
| 86 | #define ADC_CLK_ENB 15 | ||
| 87 | #define GPT1_CLK_ENB 11 | ||
| 88 | #define RTC_CLK_ENB 17 | ||
| 89 | #define GPIO1_CLK_ENB 18 | ||
| 90 | #define DMA_CLK_ENB 19 | ||
| 91 | #define SMI_CLK_ENB 21 | ||
| 92 | #define CLCD_CLK_ENB 22 | ||
| 93 | #define GMAC_CLK_ENB 23 | ||
| 94 | #define USBD_CLK_ENB 24 | ||
| 95 | #define USBH0_CLK_ENB 25 | ||
| 96 | #define USBH1_CLK_ENB 26 | ||
| 97 | |||
| 98 | #define SOC_CORE_ID ((unsigned int *)(MISC_BASE + 0x030)) | ||
| 99 | #define RAS_CLK_ENB ((unsigned int *)(MISC_BASE + 0x034)) | ||
| 100 | #define PERIP1_SOF_RST ((unsigned int *)(MISC_BASE + 0x038)) | ||
| 101 | /* PERIP1_SOF_RST register masks */ | ||
| 102 | #define JPEG_SOF_RST 8 | ||
| 103 | |||
| 104 | #define SOC_USER_ID ((unsigned int *)(MISC_BASE + 0x03C)) | ||
| 105 | #define RAS_SOF_RST ((unsigned int *)(MISC_BASE + 0x040)) | ||
| 106 | #define PRSC1_CLK_CFG ((unsigned int *)(MISC_BASE + 0x044)) | ||
| 107 | #define PRSC2_CLK_CFG ((unsigned int *)(MISC_BASE + 0x048)) | ||
| 108 | #define PRSC3_CLK_CFG ((unsigned int *)(MISC_BASE + 0x04C)) | ||
| 109 | /* gpt synthesizer register masks */ | ||
| 110 | #define GPT_MSCALE_SHIFT 0 | ||
| 111 | #define GPT_MSCALE_MASK 0xFFF | ||
| 112 | #define GPT_NSCALE_SHIFT 12 | ||
| 113 | #define GPT_NSCALE_MASK 0xF | ||
| 114 | |||
| 115 | #define AMEM_CLK_CFG ((unsigned int *)(MISC_BASE + 0x050)) | ||
| 116 | #define EXPI_CLK_CFG ((unsigned int *)(MISC_BASE + 0x054)) | ||
| 117 | #define CLCD_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x05C)) | ||
| 118 | #define FIRDA_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x060)) | ||
| 119 | #define UART_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x064)) | ||
| 120 | #define GMAC_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x068)) | ||
| 121 | #define RAS1_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x06C)) | ||
| 122 | #define RAS2_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x070)) | ||
| 123 | #define RAS3_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x074)) | ||
| 124 | #define RAS4_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x078)) | ||
| 125 | /* aux clk synthesiser register masks for irda to ras4 */ | ||
| 126 | #define AUX_EQ_SEL_SHIFT 30 | ||
| 127 | #define AUX_EQ_SEL_MASK 1 | ||
| 128 | #define AUX_EQ1_SEL 0 | ||
| 129 | #define AUX_EQ2_SEL 1 | ||
| 130 | #define AUX_XSCALE_SHIFT 16 | ||
| 131 | #define AUX_XSCALE_MASK 0xFFF | ||
| 132 | #define AUX_YSCALE_SHIFT 0 | ||
| 133 | #define AUX_YSCALE_MASK 0xFFF | ||
| 134 | |||
| 135 | #define ICM1_ARB_CFG ((unsigned int *)(MISC_BASE + 0x07C)) | ||
| 136 | #define ICM2_ARB_CFG ((unsigned int *)(MISC_BASE + 0x080)) | ||
| 137 | #define ICM3_ARB_CFG ((unsigned int *)(MISC_BASE + 0x084)) | ||
| 138 | #define ICM4_ARB_CFG ((unsigned int *)(MISC_BASE + 0x088)) | ||
| 139 | #define ICM5_ARB_CFG ((unsigned int *)(MISC_BASE + 0x08C)) | ||
| 140 | #define ICM6_ARB_CFG ((unsigned int *)(MISC_BASE + 0x090)) | ||
| 141 | #define ICM7_ARB_CFG ((unsigned int *)(MISC_BASE + 0x094)) | ||
| 142 | #define ICM8_ARB_CFG ((unsigned int *)(MISC_BASE + 0x098)) | ||
| 143 | #define ICM9_ARB_CFG ((unsigned int *)(MISC_BASE + 0x09C)) | ||
| 144 | #define DMA_CHN_CFG ((unsigned int *)(MISC_BASE + 0x0A0)) | ||
| 145 | #define USB2_PHY_CFG ((unsigned int *)(MISC_BASE + 0x0A4)) | ||
| 146 | #define GMAC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0A8)) | ||
| 147 | #define EXPI_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0AC)) | ||
| 148 | #define PRC1_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C0)) | ||
| 149 | #define PRC2_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C4)) | ||
| 150 | #define PRC3_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C8)) | ||
| 151 | #define PRC4_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0CC)) | ||
| 152 | #define PRC1_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D0)) | ||
| 153 | #define PRC2_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D4)) | ||
| 154 | #define PRC3_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D8)) | ||
| 155 | #define PRC4_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0DC)) | ||
| 156 | #define PWRDOWN_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0E0)) | ||
| 157 | #define COMPSSTL_1V8_CFG ((unsigned int *)(MISC_BASE + 0x0E4)) | ||
| 158 | #define COMPSSTL_2V5_CFG ((unsigned int *)(MISC_BASE + 0x0E8)) | ||
| 159 | #define COMPCOR_3V3_CFG ((unsigned int *)(MISC_BASE + 0x0EC)) | ||
| 160 | #define SSTLPAD_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F0)) | ||
| 161 | #define BIST1_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F4)) | ||
| 162 | #define BIST2_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F8)) | ||
| 163 | #define BIST3_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0FC)) | ||
| 164 | #define BIST4_CFG_CTR ((unsigned int *)(MISC_BASE + 0x100)) | ||
| 165 | #define BIST5_CFG_CTR ((unsigned int *)(MISC_BASE + 0x104)) | ||
| 166 | #define BIST1_STS_RES ((unsigned int *)(MISC_BASE + 0x108)) | ||
| 167 | #define BIST2_STS_RES ((unsigned int *)(MISC_BASE + 0x10C)) | ||
| 168 | #define BIST3_STS_RES ((unsigned int *)(MISC_BASE + 0x110)) | ||
| 169 | #define BIST4_STS_RES ((unsigned int *)(MISC_BASE + 0x114)) | ||
| 170 | #define BIST5_STS_RES ((unsigned int *)(MISC_BASE + 0x118)) | ||
| 171 | #define SYSERR_CFG_CTR ((unsigned int *)(MISC_BASE + 0x11C)) | ||
| 172 | |||
| 173 | #endif /* __MACH_MISC_REGS_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/spear.h b/arch/arm/mach-spear6xx/include/mach/spear.h new file mode 100644 index 000000000000..a835f5b6b182 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/spear.h | |||
| @@ -0,0 +1,173 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/spear.h | ||
| 3 | * | ||
| 4 | * SPEAr6xx Machine family specific definition | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_SPEAR6XX_H | ||
| 15 | #define __MACH_SPEAR6XX_H | ||
| 16 | |||
| 17 | #include <mach/hardware.h> | ||
| 18 | #include <mach/spear600.h> | ||
| 19 | |||
| 20 | #define SPEAR6XX_ML_SDRAM_BASE 0x00000000 | ||
| 21 | #define SPEAR6XX_ML_SDRAM_SIZE 0x40000000 | ||
| 22 | |||
| 23 | /* ICM1 - Low speed connection */ | ||
| 24 | #define SPEAR6XX_ICM1_BASE 0xD0000000 | ||
| 25 | #define SPEAR6XX_ICM1_SIZE 0x08000000 | ||
| 26 | |||
| 27 | #define SPEAR6XX_ICM1_UART0_BASE 0xD0000000 | ||
| 28 | #define VA_SPEAR6XX_ICM1_UART0_BASE IO_ADDRESS(SPEAR6XX_ICM1_UART0_BASE) | ||
| 29 | #define SPEAR6XX_ICM1_UART0_SIZE 0x00080000 | ||
| 30 | |||
| 31 | #define SPEAR6XX_ICM1_UART1_BASE 0xD0080000 | ||
| 32 | #define SPEAR6XX_ICM1_UART1_SIZE 0x00080000 | ||
| 33 | |||
| 34 | #define SPEAR6XX_ICM1_SSP0_BASE 0xD0100000 | ||
| 35 | #define SPEAR6XX_ICM1_SSP0_SIZE 0x00080000 | ||
| 36 | |||
| 37 | #define SPEAR6XX_ICM1_SSP1_BASE 0xD0180000 | ||
| 38 | #define SPEAR6XX_ICM1_SSP1_SIZE 0x00080000 | ||
| 39 | |||
| 40 | #define SPEAR6XX_ICM1_I2C_BASE 0xD0200000 | ||
| 41 | #define SPEAR6XX_ICM1_I2C_SIZE 0x00080000 | ||
| 42 | |||
| 43 | #define SPEAR6XX_ICM1_JPEG_BASE 0xD0800000 | ||
| 44 | #define SPEAR6XX_ICM1_JPEG_SIZE 0x00800000 | ||
| 45 | |||
| 46 | #define SPEAR6XX_ICM1_IRDA_BASE 0xD1000000 | ||
| 47 | #define SPEAR6XX_ICM1_IRDA_SIZE 0x00800000 | ||
| 48 | |||
| 49 | #define SPEAR6XX_ICM1_FSMC_BASE 0xD1800000 | ||
| 50 | #define SPEAR6XX_ICM1_FSMC_SIZE 0x00800000 | ||
| 51 | |||
| 52 | #define SPEAR6XX_ICM1_NAND_BASE 0xD2000000 | ||
| 53 | #define SPEAR6XX_ICM1_NAND_SIZE 0x00800000 | ||
| 54 | |||
| 55 | #define SPEAR6XX_ICM1_SRAM_BASE 0xD2800000 | ||
| 56 | #define SPEAR6XX_ICM1_SRAM_SIZE 0x00800000 | ||
| 57 | |||
| 58 | /* ICM2 - Application Subsystem */ | ||
| 59 | #define SPEAR6XX_ICM2_BASE 0xD8000000 | ||
| 60 | #define SPEAR6XX_ICM2_SIZE 0x08000000 | ||
| 61 | |||
| 62 | #define SPEAR6XX_ICM2_TMR0_BASE 0xD8000000 | ||
| 63 | #define SPEAR6XX_ICM2_TMR0_SIZE 0x00080000 | ||
| 64 | |||
| 65 | #define SPEAR6XX_ICM2_TMR1_BASE 0xD8080000 | ||
| 66 | #define SPEAR6XX_ICM2_TMR1_SIZE 0x00080000 | ||
| 67 | |||
| 68 | #define SPEAR6XX_ICM2_GPIO_BASE 0xD8100000 | ||
| 69 | #define SPEAR6XX_ICM2_GPIO_SIZE 0x00080000 | ||
| 70 | |||
| 71 | #define SPEAR6XX_ICM2_SPI2_BASE 0xD8180000 | ||
| 72 | #define SPEAR6XX_ICM2_SPI2_SIZE 0x00080000 | ||
| 73 | |||
| 74 | #define SPEAR6XX_ICM2_ADC_BASE 0xD8200000 | ||
| 75 | #define SPEAR6XX_ICM2_ADC_SIZE 0x00080000 | ||
| 76 | |||
| 77 | /* ML-1, 2 - Multi Layer CPU Subsystem */ | ||
| 78 | #define SPEAR6XX_ML_CPU_BASE 0xF0000000 | ||
| 79 | #define SPEAR6XX_ML_CPU_SIZE 0x08000000 | ||
| 80 | |||
| 81 | #define SPEAR6XX_CPU_TMR_BASE 0xF0000000 | ||
| 82 | #define SPEAR6XX_CPU_TMR_SIZE 0x00100000 | ||
| 83 | |||
| 84 | #define SPEAR6XX_CPU_GPIO_BASE 0xF0100000 | ||
| 85 | #define SPEAR6XX_CPU_GPIO_SIZE 0x00100000 | ||
| 86 | |||
| 87 | #define SPEAR6XX_CPU_VIC_SEC_BASE 0xF1000000 | ||
| 88 | #define VA_SPEAR6XX_CPU_VIC_SEC_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_SEC_BASE) | ||
| 89 | #define SPEAR6XX_CPU_VIC_SEC_SIZE 0x00100000 | ||
| 90 | |||
| 91 | #define SPEAR6XX_CPU_VIC_PRI_BASE 0xF1100000 | ||
| 92 | #define VA_SPEAR6XX_CPU_VIC_PRI_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_PRI_BASE) | ||
| 93 | #define SPEAR6XX_CPU_VIC_PRI_SIZE 0x00100000 | ||
| 94 | |||
| 95 | /* ICM3 - Basic Subsystem */ | ||
| 96 | #define SPEAR6XX_ICM3_BASE 0xF8000000 | ||
| 97 | #define SPEAR6XX_ICM3_SIZE 0x08000000 | ||
| 98 | |||
| 99 | #define SPEAR6XX_ICM3_SMEM_BASE 0xF8000000 | ||
| 100 | #define SPEAR6XX_ICM3_SMEM_SIZE 0x04000000 | ||
| 101 | |||
| 102 | #define SPEAR6XX_ICM3_SMI_CTRL_BASE 0xFC000000 | ||
| 103 | #define SPEAR6XX_ICM3_SMI_CTRL_SIZE 0x00200000 | ||
| 104 | |||
| 105 | #define SPEAR6XX_ICM3_CLCD_BASE 0xFC200000 | ||
| 106 | #define SPEAR6XX_ICM3_CLCD_SIZE 0x00200000 | ||
| 107 | |||
| 108 | #define SPEAR6XX_ICM3_DMA_BASE 0xFC400000 | ||
| 109 | #define SPEAR6XX_ICM3_DMA_SIZE 0x00200000 | ||
| 110 | |||
| 111 | #define SPEAR6XX_ICM3_SDRAM_CTRL_BASE 0xFC600000 | ||
| 112 | #define SPEAR6XX_ICM3_SDRAM_CTRL_SIZE 0x00200000 | ||
| 113 | |||
| 114 | #define SPEAR6XX_ICM3_TMR_BASE 0xFC800000 | ||
| 115 | #define SPEAR6XX_ICM3_TMR_SIZE 0x00080000 | ||
| 116 | |||
| 117 | #define SPEAR6XX_ICM3_WDT_BASE 0xFC880000 | ||
| 118 | #define SPEAR6XX_ICM3_WDT_SIZE 0x00080000 | ||
| 119 | |||
| 120 | #define SPEAR6XX_ICM3_RTC_BASE 0xFC900000 | ||
| 121 | #define SPEAR6XX_ICM3_RTC_SIZE 0x00080000 | ||
| 122 | |||
| 123 | #define SPEAR6XX_ICM3_GPIO_BASE 0xFC980000 | ||
| 124 | #define SPEAR6XX_ICM3_GPIO_SIZE 0x00080000 | ||
| 125 | |||
| 126 | #define SPEAR6XX_ICM3_SYS_CTRL_BASE 0xFCA00000 | ||
| 127 | #define VA_SPEAR6XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR6XX_ICM3_SYS_CTRL_BASE) | ||
| 128 | #define SPEAR6XX_ICM3_SYS_CTRL_SIZE 0x00080000 | ||
| 129 | |||
| 130 | #define SPEAR6XX_ICM3_MISC_REG_BASE 0xFCA80000 | ||
| 131 | #define VA_SPEAR6XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR6XX_ICM3_MISC_REG_BASE) | ||
| 132 | #define SPEAR6XX_ICM3_MISC_REG_SIZE 0x00080000 | ||
| 133 | |||
| 134 | /* ICM4 - High Speed Connection */ | ||
| 135 | #define SPEAR6XX_ICM4_BASE 0xE0000000 | ||
| 136 | #define SPEAR6XX_ICM4_SIZE 0x08000000 | ||
| 137 | |||
| 138 | #define SPEAR6XX_ICM4_GMAC_BASE 0xE0800000 | ||
| 139 | #define SPEAR6XX_ICM4_GMAC_SIZE 0x00800000 | ||
| 140 | |||
| 141 | #define SPEAR6XX_ICM4_USBD_FIFO_BASE 0xE1000000 | ||
| 142 | #define SPEAR6XX_ICM4_USBD_FIFO_SIZE 0x00100000 | ||
| 143 | |||
| 144 | #define SPEAR6XX_ICM4_USBD_CSR_BASE 0xE1100000 | ||
| 145 | #define SPEAR6XX_ICM4_USBD_CSR_SIZE 0x00100000 | ||
| 146 | |||
| 147 | #define SPEAR6XX_ICM4_USBD_PLDT_BASE 0xE1200000 | ||
| 148 | #define SPEAR6XX_ICM4_USBD_PLDT_SIZE 0x00100000 | ||
| 149 | |||
| 150 | #define SPEAR6XX_ICM4_USB_EHCI0_BASE 0xE1800000 | ||
| 151 | #define SPEAR6XX_ICM4_USB_EHCI0_SIZE 0x00100000 | ||
| 152 | |||
| 153 | #define SPEAR6XX_ICM4_USB_OHCI0_BASE 0xE1900000 | ||
| 154 | #define SPEAR6XX_ICM4_USB_OHCI0_SIZE 0x00100000 | ||
| 155 | |||
| 156 | #define SPEAR6XX_ICM4_USB_EHCI1_BASE 0xE2000000 | ||
| 157 | #define SPEAR6XX_ICM4_USB_EHCI1_SIZE 0x00100000 | ||
| 158 | |||
| 159 | #define SPEAR6XX_ICM4_USB_OHCI1_BASE 0xE2100000 | ||
| 160 | #define SPEAR6XX_ICM4_USB_OHCI1_SIZE 0x00100000 | ||
| 161 | |||
| 162 | #define SPEAR6XX_ICM4_USB_ARB_BASE 0xE2800000 | ||
| 163 | #define SPEAR6XX_ICM4_USB_ARB_SIZE 0x00010000 | ||
| 164 | |||
| 165 | /* Debug uart for linux, will be used for debug and uncompress messages */ | ||
| 166 | #define SPEAR_DBG_UART_BASE SPEAR6XX_ICM1_UART0_BASE | ||
| 167 | #define VA_SPEAR_DBG_UART_BASE VA_SPEAR6XX_ICM1_UART0_BASE | ||
| 168 | |||
| 169 | /* Sysctl base for spear platform */ | ||
| 170 | #define SPEAR_SYS_CTRL_BASE SPEAR6XX_ICM3_SYS_CTRL_BASE | ||
| 171 | #define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR6XX_ICM3_SYS_CTRL_BASE | ||
| 172 | |||
| 173 | #endif /* __MACH_SPEAR6XX_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/spear600.h b/arch/arm/mach-spear6xx/include/mach/spear600.h new file mode 100644 index 000000000000..c068cc50b0fb --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/spear600.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear66xx/include/mach/spear600.h | ||
| 3 | * | ||
| 4 | * SPEAr600 Machine specific definition | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifdef CONFIG_MACH_SPEAR600 | ||
| 15 | |||
| 16 | #ifndef __MACH_SPEAR600_H | ||
| 17 | #define __MACH_SPEAR600_H | ||
| 18 | |||
| 19 | #endif /* __MACH_SPEAR600_H */ | ||
| 20 | |||
| 21 | #endif /* CONFIG_MACH_SPEAR600 */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/system.h b/arch/arm/mach-spear6xx/include/mach/system.h new file mode 100644 index 000000000000..0b1d2be81cfb --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/system.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/system.h | ||
| 3 | * | ||
| 4 | * SPEAr6xx Machine family specific architecture functions | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_SYSTEM_H | ||
| 15 | #define __MACH_SYSTEM_H | ||
| 16 | |||
| 17 | #include <plat/system.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_SYSTEM_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/timex.h b/arch/arm/mach-spear6xx/include/mach/timex.h new file mode 100644 index 000000000000..ac1c5b005695 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/timex.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/timex.h | ||
| 3 | * | ||
| 4 | * SPEAr6XX machine family specific timex definitions | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_TIMEX_H | ||
| 15 | #define __MACH_TIMEX_H | ||
| 16 | |||
| 17 | #include <plat/timex.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_TIMEX_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/uncompress.h b/arch/arm/mach-spear6xx/include/mach/uncompress.h new file mode 100644 index 000000000000..77f0765e21e1 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/uncompress.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/uncompress.h | ||
| 3 | * | ||
| 4 | * Serial port stubs for kernel decompress status messages | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_UNCOMPRESS_H | ||
| 15 | #define __MACH_UNCOMPRESS_H | ||
| 16 | |||
| 17 | #include <plat/uncompress.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/mach-spear6xx/include/mach/vmalloc.h b/arch/arm/mach-spear6xx/include/mach/vmalloc.h new file mode 100644 index 000000000000..4a0b56cb2a91 --- /dev/null +++ b/arch/arm/mach-spear6xx/include/mach/vmalloc.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/include/mach/vmalloc.h | ||
| 3 | * | ||
| 4 | * Defining Vmalloc area for SPEAr6xx machine family | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __MACH_VMALLOC_H | ||
| 15 | #define __MACH_VMALLOC_H | ||
| 16 | |||
| 17 | #include <plat/vmalloc.h> | ||
| 18 | |||
| 19 | #endif /* __MACH_VMALLOC_H */ | ||
diff --git a/arch/arm/mach-spear6xx/spear600.c b/arch/arm/mach-spear6xx/spear600.c new file mode 100644 index 000000000000..5c484c433dc1 --- /dev/null +++ b/arch/arm/mach-spear6xx/spear600.c | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/spear600.c | ||
| 3 | * | ||
| 4 | * SPEAr600 machine source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/ptrace.h> | ||
| 15 | #include <asm/irq.h> | ||
| 16 | #include <mach/generic.h> | ||
| 17 | #include <mach/spear.h> | ||
| 18 | |||
| 19 | /* Add spear600 specific devices here */ | ||
| 20 | |||
| 21 | void __init spear600_init(void) | ||
| 22 | { | ||
| 23 | /* call spear6xx family common init function */ | ||
| 24 | spear6xx_init(); | ||
| 25 | } | ||
diff --git a/arch/arm/mach-spear6xx/spear600_evb.c b/arch/arm/mach-spear6xx/spear600_evb.c new file mode 100644 index 000000000000..daff8d04f7b6 --- /dev/null +++ b/arch/arm/mach-spear6xx/spear600_evb.c | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/spear600_evb.c | ||
| 3 | * | ||
| 4 | * SPEAr600 evaluation board source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Viresh Kumar<viresh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <asm/mach/arch.h> | ||
| 15 | #include <asm/mach-types.h> | ||
| 16 | #include <mach/generic.h> | ||
| 17 | #include <mach/spear.h> | ||
| 18 | |||
| 19 | static struct amba_device *amba_devs[] __initdata = { | ||
| 20 | &gpio_device[0], | ||
| 21 | &gpio_device[1], | ||
| 22 | &gpio_device[2], | ||
| 23 | &uart_device[0], | ||
| 24 | &uart_device[1], | ||
| 25 | }; | ||
| 26 | |||
| 27 | static struct platform_device *plat_devs[] __initdata = { | ||
| 28 | }; | ||
| 29 | |||
| 30 | static void __init spear600_evb_init(void) | ||
| 31 | { | ||
| 32 | unsigned int i; | ||
| 33 | |||
| 34 | /* call spear600 machine init function */ | ||
| 35 | spear600_init(); | ||
| 36 | |||
| 37 | /* Add Platform Devices */ | ||
| 38 | platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); | ||
| 39 | |||
| 40 | /* Add Amba Devices */ | ||
| 41 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | ||
| 42 | amba_device_register(amba_devs[i], &iomem_resource); | ||
| 43 | } | ||
| 44 | |||
| 45 | MACHINE_START(SPEAR600, "ST-SPEAR600-EVB") | ||
| 46 | .boot_params = 0x00000100, | ||
| 47 | .map_io = spear6xx_map_io, | ||
| 48 | .init_irq = spear6xx_init_irq, | ||
| 49 | .timer = &spear_sys_timer, | ||
| 50 | .init_machine = spear600_evb_init, | ||
| 51 | MACHINE_END | ||
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c new file mode 100644 index 000000000000..b67e571d4bf7 --- /dev/null +++ b/arch/arm/mach-spear6xx/spear6xx.c | |||
| @@ -0,0 +1,158 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-spear6xx/spear6xx.c | ||
| 3 | * | ||
| 4 | * SPEAr6XX machines common source file | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 ST Microelectronics | ||
| 7 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public | ||
| 10 | * License version 2. This program is licensed "as is" without any | ||
| 11 | * warranty of any kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/types.h> | ||
| 15 | #include <linux/amba/pl061.h> | ||
| 16 | #include <linux/types.h> | ||
| 17 | #include <linux/ptrace.h> | ||
| 18 | #include <linux/io.h> | ||
| 19 | #include <asm/hardware/vic.h> | ||
| 20 | #include <asm/irq.h> | ||
| 21 | #include <asm/mach/arch.h> | ||
| 22 | #include <mach/irqs.h> | ||
| 23 | #include <mach/generic.h> | ||
| 24 | #include <mach/spear.h> | ||
| 25 | |||
| 26 | /* Add spear6xx machines common devices here */ | ||
| 27 | /* uart device registeration */ | ||
| 28 | struct amba_device uart_device[] = { | ||
| 29 | { | ||
| 30 | .dev = { | ||
| 31 | .init_name = "uart0", | ||
| 32 | }, | ||
| 33 | .res = { | ||
| 34 | .start = SPEAR6XX_ICM1_UART0_BASE, | ||
| 35 | .end = SPEAR6XX_ICM1_UART0_BASE + | ||
| 36 | SPEAR6XX_ICM1_UART0_SIZE - 1, | ||
| 37 | .flags = IORESOURCE_MEM, | ||
| 38 | }, | ||
| 39 | .irq = {IRQ_UART_0, NO_IRQ}, | ||
| 40 | }, { | ||
| 41 | .dev = { | ||
| 42 | .init_name = "uart1", | ||
| 43 | }, | ||
| 44 | .res = { | ||
| 45 | .start = SPEAR6XX_ICM1_UART1_BASE, | ||
| 46 | .end = SPEAR6XX_ICM1_UART1_BASE + | ||
| 47 | SPEAR6XX_ICM1_UART1_SIZE - 1, | ||
| 48 | .flags = IORESOURCE_MEM, | ||
| 49 | }, | ||
| 50 | .irq = {IRQ_UART_1, NO_IRQ}, | ||
| 51 | } | ||
| 52 | }; | ||
| 53 | |||
| 54 | /* gpio device registeration */ | ||
| 55 | static struct pl061_platform_data gpio_plat_data[] = { | ||
| 56 | { | ||
| 57 | .gpio_base = 0, | ||
| 58 | .irq_base = SPEAR_GPIO0_INT_BASE, | ||
| 59 | }, { | ||
| 60 | .gpio_base = 8, | ||
| 61 | .irq_base = SPEAR_GPIO1_INT_BASE, | ||
| 62 | }, { | ||
| 63 | .gpio_base = 16, | ||
| 64 | .irq_base = SPEAR_GPIO2_INT_BASE, | ||
| 65 | }, | ||
| 66 | }; | ||
| 67 | |||
| 68 | struct amba_device gpio_device[] = { | ||
| 69 | { | ||
| 70 | .dev = { | ||
| 71 | .init_name = "gpio0", | ||
| 72 | .platform_data = &gpio_plat_data[0], | ||
| 73 | }, | ||
| 74 | .res = { | ||
| 75 | .start = SPEAR6XX_CPU_GPIO_BASE, | ||
| 76 | .end = SPEAR6XX_CPU_GPIO_BASE + | ||
| 77 | SPEAR6XX_CPU_GPIO_SIZE - 1, | ||
| 78 | .flags = IORESOURCE_MEM, | ||
| 79 | }, | ||
| 80 | .irq = {IRQ_LOCAL_GPIO, NO_IRQ}, | ||
| 81 | }, { | ||
| 82 | .dev = { | ||
| 83 | .init_name = "gpio1", | ||
| 84 | .platform_data = &gpio_plat_data[1], | ||
| 85 | }, | ||
| 86 | .res = { | ||
| 87 | .start = SPEAR6XX_ICM3_GPIO_BASE, | ||
| 88 | .end = SPEAR6XX_ICM3_GPIO_BASE + | ||
| 89 | SPEAR6XX_ICM3_GPIO_SIZE - 1, | ||
| 90 | .flags = IORESOURCE_MEM, | ||
| 91 | }, | ||
| 92 | .irq = {IRQ_BASIC_GPIO, NO_IRQ}, | ||
| 93 | }, { | ||
| 94 | .dev = { | ||
| 95 | .init_name = "gpio2", | ||
| 96 | .platform_data = &gpio_plat_data[2], | ||
| 97 | }, | ||
| 98 | .res = { | ||
| 99 | .start = SPEAR6XX_ICM2_GPIO_BASE, | ||
| 100 | .end = SPEAR6XX_ICM2_GPIO_BASE + | ||
| 101 | SPEAR6XX_ICM2_GPIO_SIZE - 1, | ||
| 102 | .flags = IORESOURCE_MEM, | ||
| 103 | }, | ||
| 104 | .irq = {IRQ_APPL_GPIO, NO_IRQ}, | ||
| 105 | } | ||
| 106 | }; | ||
| 107 | |||
| 108 | /* This will add devices, and do machine specific tasks */ | ||
| 109 | void __init spear6xx_init(void) | ||
| 110 | { | ||
| 111 | /* nothing to do for now */ | ||
| 112 | } | ||
| 113 | |||
| 114 | /* This will initialize vic */ | ||
| 115 | void __init spear6xx_init_irq(void) | ||
| 116 | { | ||
| 117 | vic_init((void __iomem *)VA_SPEAR6XX_CPU_VIC_PRI_BASE, 0, ~0, 0); | ||
| 118 | vic_init((void __iomem *)VA_SPEAR6XX_CPU_VIC_SEC_BASE, 32, ~0, 0); | ||
| 119 | } | ||
| 120 | |||
| 121 | /* Following will create static virtual/physical mappings */ | ||
| 122 | static struct map_desc spear6xx_io_desc[] __initdata = { | ||
| 123 | { | ||
| 124 | .virtual = VA_SPEAR6XX_ICM1_UART0_BASE, | ||
| 125 | .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE), | ||
| 126 | .length = SPEAR6XX_ICM1_UART0_SIZE, | ||
| 127 | .type = MT_DEVICE | ||
| 128 | }, { | ||
| 129 | .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE, | ||
| 130 | .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE), | ||
| 131 | .length = SPEAR6XX_CPU_VIC_PRI_SIZE, | ||
| 132 | .type = MT_DEVICE | ||
| 133 | }, { | ||
| 134 | .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE, | ||
| 135 | .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE), | ||
| 136 | .length = SPEAR6XX_CPU_VIC_SEC_SIZE, | ||
| 137 | .type = MT_DEVICE | ||
| 138 | }, { | ||
| 139 | .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE, | ||
| 140 | .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE), | ||
| 141 | .length = SPEAR6XX_ICM3_MISC_REG_BASE, | ||
| 142 | .type = MT_DEVICE | ||
| 143 | }, { | ||
| 144 | .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE, | ||
| 145 | .pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE), | ||
| 146 | .length = SPEAR6XX_ICM3_MISC_REG_SIZE, | ||
| 147 | .type = MT_DEVICE | ||
| 148 | }, | ||
| 149 | }; | ||
| 150 | |||
| 151 | /* This will create static memory mapping for selected devices */ | ||
| 152 | void __init spear6xx_map_io(void) | ||
| 153 | { | ||
| 154 | iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); | ||
| 155 | |||
| 156 | /* This will initialize clock framework */ | ||
| 157 | clk_init(); | ||
| 158 | } | ||
diff --git a/arch/arm/mach-u300/mmc.c b/arch/arm/mach-u300/mmc.c index 77fbb1e0e528..88506d030596 100644 --- a/arch/arm/mach-u300/mmc.c +++ b/arch/arm/mach-u300/mmc.c | |||
| @@ -102,11 +102,12 @@ int __devinit mmc_init(struct amba_device *adev) | |||
| 102 | * we have a regulator we can control instead. | 102 | * we have a regulator we can control instead. |
| 103 | */ | 103 | */ |
| 104 | /* Nominally 2.85V on our platform */ | 104 | /* Nominally 2.85V on our platform */ |
| 105 | mmci_card->mmc0_plat_data.f_max = 24000000; | ||
| 105 | mmci_card->mmc0_plat_data.status = mmc_status; | 106 | mmci_card->mmc0_plat_data.status = mmc_status; |
| 106 | mmci_card->mmc0_plat_data.gpio_wp = -1; | 107 | mmci_card->mmc0_plat_data.gpio_wp = -1; |
| 107 | mmci_card->mmc0_plat_data.gpio_cd = -1; | 108 | mmci_card->mmc0_plat_data.gpio_cd = -1; |
| 108 | mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED | | 109 | mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED | |
| 109 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA; | 110 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; |
| 110 | 111 | ||
| 111 | mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; | 112 | mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; |
| 112 | 113 | ||
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 03625d744857..6625e5bbf4d6 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig | |||
| @@ -1,15 +1,42 @@ | |||
| 1 | menu "ST-Ericsson platform type" | 1 | if ARCH_U8500 |
| 2 | depends on ARCH_U8500 | ||
| 3 | 2 | ||
| 4 | comment "ST-Ericsson Multicore Mobile Platforms" | 3 | config UX500_SOC_COMMON |
| 5 | 4 | bool | |
| 6 | config MACH_U8500_MOP | ||
| 7 | bool "U8500 Early Development platform" | ||
| 8 | default y | 5 | default y |
| 9 | select ARM_GIC | 6 | select ARM_GIC |
| 10 | select HAS_MTU | 7 | select HAS_MTU |
| 8 | select NOMADIK_GPIO | ||
| 9 | |||
| 10 | config UX500_SOC_DB8500 | ||
| 11 | bool | ||
| 12 | |||
| 13 | config UX500_SOC_DB5500 | ||
| 14 | bool | ||
| 15 | |||
| 16 | choice | ||
| 17 | prompt "Ux500 target platform" | ||
| 18 | default MACH_U8500_MOP | ||
| 19 | |||
| 20 | config MACH_U8500_MOP | ||
| 21 | bool "U8500 Development platform" | ||
| 22 | select UX500_SOC_DB8500 | ||
| 11 | help | 23 | help |
| 12 | Include support for mop500 development platform | 24 | Include support for mop500 development platform |
| 13 | based on U8500 architecture. The platform is based | 25 | based on U8500 architecture. The platform is based |
| 14 | on early drop silicon version of 8500. | 26 | on early drop silicon version of 8500. |
| 15 | endmenu | 27 | |
| 28 | config MACH_U5500 | ||
| 29 | bool "U5500 Development platform" | ||
| 30 | select UX500_SOC_DB5500 | ||
| 31 | help | ||
| 32 | Include support for the U5500 development platform. | ||
| 33 | endchoice | ||
| 34 | |||
| 35 | config UX500_DEBUG_UART | ||
| 36 | int "Ux500 UART to use for low-level debug" | ||
| 37 | default 2 | ||
| 38 | help | ||
| 39 | Choose the UART on which kernel low-level debug messages should be | ||
| 40 | output. | ||
| 41 | |||
| 42 | endif | ||
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile index 95e6e24c0042..c7bc4199e3a8 100644 --- a/arch/arm/mach-ux500/Makefile +++ b/arch/arm/mach-ux500/Makefile | |||
| @@ -2,7 +2,9 @@ | |||
| 2 | # Makefile for the linux kernel, U8500 machine. | 2 | # Makefile for the linux kernel, U8500 machine. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := clock.o | 5 | obj-y := clock.o cpu.o devices.o |
| 6 | obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o | 6 | obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o devices-db5500.o |
| 7 | obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o | ||
| 7 | obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o | 8 | obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o |
| 9 | obj-$(CONFIG_MACH_U5500) += board-u5500.o | ||
| 8 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o | 10 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 803aec1d6728..072196c57263 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
| @@ -17,37 +17,14 @@ | |||
| 17 | #include <linux/amba/pl022.h> | 17 | #include <linux/amba/pl022.h> |
| 18 | #include <linux/spi/spi.h> | 18 | #include <linux/spi/spi.h> |
| 19 | 19 | ||
| 20 | #include <asm/localtimer.h> | ||
| 21 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
| 22 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
| 23 | 22 | ||
| 24 | #include <plat/mtu.h> | ||
| 25 | #include <plat/i2c.h> | 23 | #include <plat/i2c.h> |
| 26 | 24 | ||
| 27 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
| 28 | #include <mach/setup.h> | 26 | #include <mach/setup.h> |
| 29 | 27 | #include <mach/devices.h> | |
| 30 | #define __MEM_4K_RESOURCE(x) \ | ||
| 31 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | ||
| 32 | |||
| 33 | /* These are active devices on this board */ | ||
| 34 | static struct amba_device uart0_device = { | ||
| 35 | .dev = { .init_name = "uart0" }, | ||
| 36 | __MEM_4K_RESOURCE(U8500_UART0_BASE), | ||
| 37 | .irq = {IRQ_UART0, NO_IRQ}, | ||
| 38 | }; | ||
| 39 | |||
| 40 | static struct amba_device uart1_device = { | ||
| 41 | .dev = { .init_name = "uart1" }, | ||
| 42 | __MEM_4K_RESOURCE(U8500_UART1_BASE), | ||
| 43 | .irq = {IRQ_UART1, NO_IRQ}, | ||
| 44 | }; | ||
| 45 | |||
| 46 | static struct amba_device uart2_device = { | ||
| 47 | .dev = { .init_name = "uart2" }, | ||
| 48 | __MEM_4K_RESOURCE(U8500_UART2_BASE), | ||
| 49 | .irq = {IRQ_UART2, NO_IRQ}, | ||
| 50 | }; | ||
| 51 | 28 | ||
| 52 | static void ab4500_spi_cs_control(u32 command) | 29 | static void ab4500_spi_cs_control(u32 command) |
| 53 | { | 30 | { |
| @@ -93,55 +70,8 @@ static struct pl022_ssp_controller ssp0_platform_data = { | |||
| 93 | .num_chipselect = 5, | 70 | .num_chipselect = 5, |
| 94 | }; | 71 | }; |
| 95 | 72 | ||
| 96 | static struct amba_device pl022_device = { | ||
| 97 | .dev = { | ||
| 98 | .coherent_dma_mask = ~0, | ||
| 99 | .init_name = "pl022", | ||
| 100 | .platform_data = &ssp0_platform_data, | ||
| 101 | }, | ||
| 102 | .res = { | ||
| 103 | .start = U8500_SSP0_BASE, | ||
| 104 | .end = U8500_SSP0_BASE + SZ_4K - 1, | ||
| 105 | .flags = IORESOURCE_MEM, | ||
| 106 | }, | ||
| 107 | .irq = {IRQ_SSP0, NO_IRQ }, | ||
| 108 | /* ST-Ericsson modified id */ | ||
| 109 | .periphid = SSP_PER_ID, | ||
| 110 | }; | ||
| 111 | |||
| 112 | static struct amba_device pl031_device = { | ||
| 113 | .dev = { | ||
| 114 | .init_name = "pl031", | ||
| 115 | }, | ||
| 116 | .res = { | ||
| 117 | .start = U8500_RTC_BASE, | ||
| 118 | .end = U8500_RTC_BASE + SZ_4K - 1, | ||
| 119 | .flags = IORESOURCE_MEM, | ||
| 120 | }, | ||
| 121 | .irq = {IRQ_RTC_RTT, NO_IRQ}, | ||
| 122 | }; | ||
| 123 | |||
| 124 | #define U8500_I2C_RESOURCES(id, size) \ | ||
| 125 | static struct resource u8500_i2c_resources_##id[] = { \ | ||
| 126 | [0] = { \ | ||
| 127 | .start = U8500_I2C##id##_BASE, \ | ||
| 128 | .end = U8500_I2C##id##_BASE + size - 1, \ | ||
| 129 | .flags = IORESOURCE_MEM, \ | ||
| 130 | }, \ | ||
| 131 | [1] = { \ | ||
| 132 | .start = IRQ_I2C##id, \ | ||
| 133 | .end = IRQ_I2C##id, \ | ||
| 134 | .flags = IORESOURCE_IRQ \ | ||
| 135 | } \ | ||
| 136 | } | ||
| 137 | |||
| 138 | U8500_I2C_RESOURCES(0, SZ_4K); | ||
| 139 | U8500_I2C_RESOURCES(1, SZ_4K); | ||
| 140 | U8500_I2C_RESOURCES(2, SZ_4K); | ||
| 141 | U8500_I2C_RESOURCES(3, SZ_4K); | ||
| 142 | |||
| 143 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ | 73 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ |
| 144 | static struct nmk_i2c_controller u8500_i2c_##id = { \ | 74 | static struct nmk_i2c_controller u8500_i2c##id##_data = { \ |
| 145 | /* \ | 75 | /* \ |
| 146 | * slave data setup time, which is \ | 76 | * slave data setup time, which is \ |
| 147 | * 250 ns,100ns,10ns which is 14,6,2 \ | 77 | * 250 ns,100ns,10ns which is 14,6,2 \ |
| @@ -169,58 +99,32 @@ U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | |||
| 169 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | 99 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); |
| 170 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | 100 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); |
| 171 | 101 | ||
| 172 | #define U8500_I2C_PDEVICE(cid) \ | ||
| 173 | static struct platform_device i2c_controller##cid = { \ | ||
| 174 | .name = "nmk-i2c", \ | ||
| 175 | .id = cid, \ | ||
| 176 | .num_resources = 2, \ | ||
| 177 | .resource = u8500_i2c_resources_##cid, \ | ||
| 178 | .dev = { \ | ||
| 179 | .platform_data = &u8500_i2c_##cid \ | ||
| 180 | } \ | ||
| 181 | } | ||
| 182 | |||
| 183 | U8500_I2C_PDEVICE(0); | ||
| 184 | U8500_I2C_PDEVICE(1); | ||
| 185 | U8500_I2C_PDEVICE(2); | ||
| 186 | U8500_I2C_PDEVICE(3); | ||
| 187 | |||
| 188 | static struct amba_device *amba_devs[] __initdata = { | 102 | static struct amba_device *amba_devs[] __initdata = { |
| 189 | &uart0_device, | 103 | &ux500_uart0_device, |
| 190 | &uart1_device, | 104 | &ux500_uart1_device, |
| 191 | &uart2_device, | 105 | &ux500_uart2_device, |
| 192 | &pl022_device, | 106 | &u8500_ssp0_device, |
| 193 | &pl031_device, | ||
| 194 | }; | 107 | }; |
| 195 | 108 | ||
| 196 | /* add any platform devices here - TODO */ | 109 | /* add any platform devices here - TODO */ |
| 197 | static struct platform_device *platform_devs[] __initdata = { | 110 | static struct platform_device *platform_devs[] __initdata = { |
| 198 | &i2c_controller0, | 111 | &u8500_i2c0_device, |
| 199 | &i2c_controller1, | 112 | &ux500_i2c1_device, |
| 200 | &i2c_controller2, | 113 | &ux500_i2c2_device, |
| 201 | &i2c_controller3, | 114 | &ux500_i2c3_device, |
| 202 | }; | ||
| 203 | |||
| 204 | static void __init u8500_timer_init(void) | ||
| 205 | { | ||
| 206 | #ifdef CONFIG_LOCAL_TIMERS | ||
| 207 | /* Setup the local timer base */ | ||
| 208 | twd_base = __io_address(U8500_TWD_BASE); | ||
| 209 | #endif | ||
| 210 | /* Setup the MTU base */ | ||
| 211 | mtu_base = __io_address(U8500_MTU0_BASE); | ||
| 212 | |||
| 213 | nmdk_timer_init(); | ||
| 214 | } | ||
| 215 | |||
| 216 | static struct sys_timer u8500_timer = { | ||
| 217 | .init = u8500_timer_init, | ||
| 218 | }; | 115 | }; |
| 219 | 116 | ||
| 220 | static void __init u8500_init_machine(void) | 117 | static void __init u8500_init_machine(void) |
| 221 | { | 118 | { |
| 222 | int i; | 119 | int i; |
| 223 | 120 | ||
| 121 | u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data; | ||
| 122 | ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data; | ||
| 123 | ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data; | ||
| 124 | ux500_i2c3_device.dev.platform_data = &u8500_i2c3_data; | ||
| 125 | |||
| 126 | u8500_ssp0_device.dev.platform_data = &ssp0_platform_data; | ||
| 127 | |||
| 224 | /* Register the active AMBA devices on this board */ | 128 | /* Register the active AMBA devices on this board */ |
| 225 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | 129 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
| 226 | amba_device_register(amba_devs[i], &iomem_resource); | 130 | amba_device_register(amba_devs[i], &iomem_resource); |
| @@ -239,8 +143,8 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform") | |||
| 239 | .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc, | 143 | .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc, |
| 240 | .boot_params = 0x100, | 144 | .boot_params = 0x100, |
| 241 | .map_io = u8500_map_io, | 145 | .map_io = u8500_map_io, |
| 242 | .init_irq = u8500_init_irq, | 146 | .init_irq = ux500_init_irq, |
| 243 | /* we re-use nomadik timer here */ | 147 | /* we re-use nomadik timer here */ |
| 244 | .timer = &u8500_timer, | 148 | .timer = &ux500_timer, |
| 245 | .init_machine = u8500_init_machine, | 149 | .init_machine = u8500_init_machine, |
| 246 | MACHINE_END | 150 | MACHINE_END |
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c new file mode 100644 index 000000000000..4430e69cf538 --- /dev/null +++ b/arch/arm/mach-ux500/board-u5500.c | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <linux/init.h> | ||
| 9 | #include <linux/platform_device.h> | ||
| 10 | #include <linux/amba/bus.h> | ||
| 11 | #include <linux/gpio.h> | ||
| 12 | |||
| 13 | #include <asm/mach/arch.h> | ||
| 14 | #include <asm/mach-types.h> | ||
| 15 | |||
| 16 | #include <mach/hardware.h> | ||
| 17 | #include <mach/devices.h> | ||
| 18 | #include <mach/setup.h> | ||
| 19 | |||
| 20 | static struct amba_device *amba_board_devs[] __initdata = { | ||
| 21 | &ux500_uart0_device, | ||
| 22 | &ux500_uart1_device, | ||
| 23 | &ux500_uart2_device, | ||
| 24 | }; | ||
| 25 | |||
| 26 | static void __init u5500_init_machine(void) | ||
| 27 | { | ||
| 28 | u5500_init_devices(); | ||
| 29 | |||
| 30 | amba_add_devices(amba_board_devs, ARRAY_SIZE(amba_board_devs)); | ||
| 31 | } | ||
| 32 | |||
| 33 | MACHINE_START(U8500, "ST-Ericsson U5500 Platform") | ||
| 34 | .phys_io = UX500_UART0_BASE, | ||
| 35 | .io_pg_offst = (IO_ADDRESS(UX500_UART0_BASE) >> 18) & 0xfffc, | ||
| 36 | .boot_params = 0x00000100, | ||
| 37 | .map_io = u5500_map_io, | ||
| 38 | .init_irq = ux500_init_irq, | ||
| 39 | .timer = &ux500_timer, | ||
| 40 | .init_machine = u5500_init_machine, | ||
| 41 | MACHINE_END | ||
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c index 8359a73d0041..1b2c9890e8b4 100644 --- a/arch/arm/mach-ux500/clock.c +++ b/arch/arm/mach-ux500/clock.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2009 ST-Ericsson | 2 | * Copyright (C) 2009 ST-Ericsson |
| 3 | * heavily based on realview platform | 3 | * Copyright (C) 2009 STMicroelectronics |
| 4 | * | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as | 6 | * it under the terms of the GNU General Public License version 2 as |
| @@ -12,33 +12,130 @@ | |||
| 12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
| 13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
| 14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
| 15 | #include <linux/mutex.h> | 15 | #include <linux/io.h> |
| 16 | 16 | ||
| 17 | #include <asm/clkdev.h> | 17 | #include <asm/clkdev.h> |
| 18 | 18 | ||
| 19 | /* currently the clk structure | 19 | #include <mach/hardware.h> |
| 20 | * just supports rate. This would | 20 | #include "clock.h" |
| 21 | * be extended as and when new devices are | 21 | |
| 22 | * added - TODO | 22 | #define PRCC_PCKEN 0x00 |
| 23 | */ | 23 | #define PRCC_PCKDIS 0x04 |
| 24 | struct clk { | 24 | #define PRCC_KCKEN 0x08 |
| 25 | unsigned long rate; | 25 | #define PRCC_KCKDIS 0x0C |
| 26 | }; | 26 | |
| 27 | #define PRCM_YYCLKEN0_MGT_SET 0x510 | ||
| 28 | #define PRCM_YYCLKEN1_MGT_SET 0x514 | ||
| 29 | #define PRCM_YYCLKEN0_MGT_CLR 0x518 | ||
| 30 | #define PRCM_YYCLKEN1_MGT_CLR 0x51C | ||
| 31 | #define PRCM_YYCLKEN0_MGT_VAL 0x520 | ||
| 32 | #define PRCM_YYCLKEN1_MGT_VAL 0x524 | ||
| 33 | |||
| 34 | #define PRCM_SVAMMDSPCLK_MGT 0x008 | ||
| 35 | #define PRCM_SIAMMDSPCLK_MGT 0x00C | ||
| 36 | #define PRCM_SGACLK_MGT 0x014 | ||
| 37 | #define PRCM_UARTCLK_MGT 0x018 | ||
| 38 | #define PRCM_MSP02CLK_MGT 0x01C | ||
| 39 | #define PRCM_MSP1CLK_MGT 0x288 | ||
| 40 | #define PRCM_I2CCLK_MGT 0x020 | ||
| 41 | #define PRCM_SDMMCCLK_MGT 0x024 | ||
| 42 | #define PRCM_SLIMCLK_MGT 0x028 | ||
| 43 | #define PRCM_PER1CLK_MGT 0x02C | ||
| 44 | #define PRCM_PER2CLK_MGT 0x030 | ||
| 45 | #define PRCM_PER3CLK_MGT 0x034 | ||
| 46 | #define PRCM_PER5CLK_MGT 0x038 | ||
| 47 | #define PRCM_PER6CLK_MGT 0x03C | ||
| 48 | #define PRCM_PER7CLK_MGT 0x040 | ||
| 49 | #define PRCM_LCDCLK_MGT 0x044 | ||
| 50 | #define PRCM_BMLCLK_MGT 0x04C | ||
| 51 | #define PRCM_HSITXCLK_MGT 0x050 | ||
| 52 | #define PRCM_HSIRXCLK_MGT 0x054 | ||
| 53 | #define PRCM_HDMICLK_MGT 0x058 | ||
| 54 | #define PRCM_APEATCLK_MGT 0x05C | ||
| 55 | #define PRCM_APETRACECLK_MGT 0x060 | ||
| 56 | #define PRCM_MCDECLK_MGT 0x064 | ||
| 57 | #define PRCM_IPI2CCLK_MGT 0x068 | ||
| 58 | #define PRCM_DSIALTCLK_MGT 0x06C | ||
| 59 | #define PRCM_DMACLK_MGT 0x074 | ||
| 60 | #define PRCM_B2R2CLK_MGT 0x078 | ||
| 61 | #define PRCM_TVCLK_MGT 0x07C | ||
| 62 | #define PRCM_UNIPROCLK_MGT 0x278 | ||
| 63 | #define PRCM_SSPCLK_MGT 0x280 | ||
| 64 | #define PRCM_RNGCLK_MGT 0x284 | ||
| 65 | #define PRCM_UICCCLK_MGT 0x27C | ||
| 66 | |||
| 67 | #define PRCM_MGT_ENABLE (1 << 8) | ||
| 68 | |||
| 69 | static DEFINE_SPINLOCK(clocks_lock); | ||
| 70 | |||
| 71 | static void __clk_enable(struct clk *clk) | ||
| 72 | { | ||
| 73 | if (clk->enabled++ == 0) { | ||
| 74 | if (clk->parent_cluster) | ||
| 75 | __clk_enable(clk->parent_cluster); | ||
| 76 | |||
| 77 | if (clk->parent_periph) | ||
| 78 | __clk_enable(clk->parent_periph); | ||
| 79 | |||
| 80 | if (clk->ops && clk->ops->enable) | ||
| 81 | clk->ops->enable(clk); | ||
| 82 | } | ||
| 83 | } | ||
| 27 | 84 | ||
| 28 | int clk_enable(struct clk *clk) | 85 | int clk_enable(struct clk *clk) |
| 29 | { | 86 | { |
| 87 | unsigned long flags; | ||
| 88 | |||
| 89 | spin_lock_irqsave(&clocks_lock, flags); | ||
| 90 | __clk_enable(clk); | ||
| 91 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
| 92 | |||
| 30 | return 0; | 93 | return 0; |
| 31 | } | 94 | } |
| 32 | EXPORT_SYMBOL(clk_enable); | 95 | EXPORT_SYMBOL(clk_enable); |
| 33 | 96 | ||
| 97 | static void __clk_disable(struct clk *clk) | ||
| 98 | { | ||
| 99 | if (--clk->enabled == 0) { | ||
| 100 | if (clk->ops && clk->ops->disable) | ||
| 101 | clk->ops->disable(clk); | ||
| 102 | |||
| 103 | if (clk->parent_periph) | ||
| 104 | __clk_disable(clk->parent_periph); | ||
| 105 | |||
| 106 | if (clk->parent_cluster) | ||
| 107 | __clk_disable(clk->parent_cluster); | ||
| 108 | } | ||
| 109 | } | ||
| 110 | |||
| 34 | void clk_disable(struct clk *clk) | 111 | void clk_disable(struct clk *clk) |
| 35 | { | 112 | { |
| 113 | unsigned long flags; | ||
| 114 | |||
| 115 | WARN_ON(!clk->enabled); | ||
| 116 | |||
| 117 | spin_lock_irqsave(&clocks_lock, flags); | ||
| 118 | __clk_disable(clk); | ||
| 119 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
| 36 | } | 120 | } |
| 37 | EXPORT_SYMBOL(clk_disable); | 121 | EXPORT_SYMBOL(clk_disable); |
| 38 | 122 | ||
| 39 | unsigned long clk_get_rate(struct clk *clk) | 123 | unsigned long clk_get_rate(struct clk *clk) |
| 40 | { | 124 | { |
| 41 | return clk->rate; | 125 | unsigned long rate; |
| 126 | |||
| 127 | if (clk->ops && clk->ops->get_rate) | ||
| 128 | return clk->ops->get_rate(clk); | ||
| 129 | |||
| 130 | rate = clk->rate; | ||
| 131 | if (!rate) { | ||
| 132 | if (clk->parent_periph) | ||
| 133 | rate = clk_get_rate(clk->parent_periph); | ||
| 134 | else if (clk->parent_cluster) | ||
| 135 | rate = clk_get_rate(clk->parent_cluster); | ||
| 136 | } | ||
| 137 | |||
| 138 | return rate; | ||
| 42 | } | 139 | } |
| 43 | EXPORT_SYMBOL(clk_get_rate); | 140 | EXPORT_SYMBOL(clk_get_rate); |
| 44 | 141 | ||
| @@ -56,37 +153,373 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
| 56 | } | 153 | } |
| 57 | EXPORT_SYMBOL(clk_set_rate); | 154 | EXPORT_SYMBOL(clk_set_rate); |
| 58 | 155 | ||
| 59 | /* ssp clock */ | 156 | static void clk_prcmu_enable(struct clk *clk) |
| 60 | static struct clk ssp_clk = { | 157 | { |
| 61 | .rate = 48000000, | 158 | void __iomem *cg_set_reg = __io_address(U8500_PRCMU_BASE) |
| 159 | + PRCM_YYCLKEN0_MGT_SET + clk->prcmu_cg_off; | ||
| 160 | |||
| 161 | writel(1 << clk->prcmu_cg_bit, cg_set_reg); | ||
| 162 | } | ||
| 163 | |||
| 164 | static void clk_prcmu_disable(struct clk *clk) | ||
| 165 | { | ||
| 166 | void __iomem *cg_clr_reg = __io_address(U8500_PRCMU_BASE) | ||
| 167 | + PRCM_YYCLKEN0_MGT_CLR + clk->prcmu_cg_off; | ||
| 168 | |||
| 169 | writel(1 << clk->prcmu_cg_bit, cg_clr_reg); | ||
| 170 | } | ||
| 171 | |||
| 172 | /* ED doesn't have the combined set/clr registers */ | ||
| 173 | static void clk_prcmu_ed_enable(struct clk *clk) | ||
| 174 | { | ||
| 175 | void __iomem *addr = __io_address(U8500_PRCMU_BASE) | ||
| 176 | + clk->prcmu_cg_mgt; | ||
| 177 | |||
| 178 | writel(readl(addr) | PRCM_MGT_ENABLE, addr); | ||
| 179 | } | ||
| 180 | |||
| 181 | static void clk_prcmu_ed_disable(struct clk *clk) | ||
| 182 | { | ||
| 183 | void __iomem *addr = __io_address(U8500_PRCMU_BASE) | ||
| 184 | + clk->prcmu_cg_mgt; | ||
| 185 | |||
| 186 | writel(readl(addr) & ~PRCM_MGT_ENABLE, addr); | ||
| 187 | } | ||
| 188 | |||
| 189 | static struct clkops clk_prcmu_ops = { | ||
| 190 | .enable = clk_prcmu_enable, | ||
| 191 | .disable = clk_prcmu_disable, | ||
| 62 | }; | 192 | }; |
| 63 | 193 | ||
| 64 | /* fixed clock */ | 194 | static unsigned int clkrst_base[] = { |
| 65 | static struct clk f38_clk = { | 195 | [1] = U8500_CLKRST1_BASE, |
| 66 | .rate = 38400000, | 196 | [2] = U8500_CLKRST2_BASE, |
| 197 | [3] = U8500_CLKRST3_BASE, | ||
| 198 | [5] = U8500_CLKRST5_BASE, | ||
| 199 | [6] = U8500_CLKRST6_BASE, | ||
| 200 | [7] = U8500_CLKRST7_BASE_ED, | ||
| 67 | }; | 201 | }; |
| 68 | 202 | ||
| 69 | static struct clk_lookup lookups[] = { | 203 | static void clk_prcc_enable(struct clk *clk) |
| 70 | { | 204 | { |
| 71 | /* UART0 */ | 205 | void __iomem *addr = __io_address(clkrst_base[clk->cluster]); |
| 72 | .dev_id = "uart0", | 206 | |
| 73 | .clk = &f38_clk, | 207 | if (clk->prcc_kernel != -1) |
| 74 | }, { /* UART1 */ | 208 | writel(1 << clk->prcc_kernel, addr + PRCC_KCKEN); |
| 75 | .dev_id = "uart1", | 209 | |
| 76 | .clk = &f38_clk, | 210 | if (clk->prcc_bus != -1) |
| 77 | }, { /* UART2 */ | 211 | writel(1 << clk->prcc_bus, addr + PRCC_PCKEN); |
| 78 | .dev_id = "uart2", | 212 | } |
| 79 | .clk = &f38_clk, | 213 | |
| 80 | }, { /* SSP */ | 214 | static void clk_prcc_disable(struct clk *clk) |
| 81 | .dev_id = "pl022", | 215 | { |
| 82 | .clk = &ssp_clk, | 216 | void __iomem *addr = __io_address(clkrst_base[clk->cluster]); |
| 83 | } | 217 | |
| 218 | if (clk->prcc_bus != -1) | ||
| 219 | writel(1 << clk->prcc_bus, addr + PRCC_PCKDIS); | ||
| 220 | |||
| 221 | if (clk->prcc_kernel != -1) | ||
| 222 | writel(1 << clk->prcc_kernel, addr + PRCC_KCKDIS); | ||
| 223 | } | ||
| 224 | |||
| 225 | static struct clkops clk_prcc_ops = { | ||
| 226 | .enable = clk_prcc_enable, | ||
| 227 | .disable = clk_prcc_disable, | ||
| 228 | }; | ||
| 229 | |||
| 230 | static struct clk clk_32khz = { | ||
| 231 | .rate = 32000, | ||
| 232 | }; | ||
| 233 | |||
| 234 | /* | ||
| 235 | * PRCMU level clock gating | ||
| 236 | */ | ||
| 237 | |||
| 238 | /* Bank 0 */ | ||
| 239 | static DEFINE_PRCMU_CLK(svaclk, 0x0, 2, SVAMMDSPCLK); | ||
| 240 | static DEFINE_PRCMU_CLK(siaclk, 0x0, 3, SIAMMDSPCLK); | ||
| 241 | static DEFINE_PRCMU_CLK(sgaclk, 0x0, 4, SGACLK); | ||
| 242 | static DEFINE_PRCMU_CLK_RATE(uartclk, 0x0, 5, UARTCLK, 38400000); | ||
| 243 | static DEFINE_PRCMU_CLK(msp02clk, 0x0, 6, MSP02CLK); | ||
| 244 | static DEFINE_PRCMU_CLK(msp1clk, 0x0, 7, MSP1CLK); /* v1 */ | ||
| 245 | static DEFINE_PRCMU_CLK_RATE(i2cclk, 0x0, 8, I2CCLK, 48000000); | ||
| 246 | static DEFINE_PRCMU_CLK_RATE(sdmmcclk, 0x0, 9, SDMMCCLK, 50000000); | ||
| 247 | static DEFINE_PRCMU_CLK(slimclk, 0x0, 10, SLIMCLK); | ||
| 248 | static DEFINE_PRCMU_CLK(per1clk, 0x0, 11, PER1CLK); | ||
| 249 | static DEFINE_PRCMU_CLK(per2clk, 0x0, 12, PER2CLK); | ||
| 250 | static DEFINE_PRCMU_CLK(per3clk, 0x0, 13, PER3CLK); | ||
| 251 | static DEFINE_PRCMU_CLK(per5clk, 0x0, 14, PER5CLK); | ||
| 252 | static DEFINE_PRCMU_CLK_RATE(per6clk, 0x0, 15, PER6CLK, 133330000); | ||
| 253 | static DEFINE_PRCMU_CLK_RATE(per7clk, 0x0, 16, PER7CLK, 100000000); | ||
| 254 | static DEFINE_PRCMU_CLK(lcdclk, 0x0, 17, LCDCLK); | ||
| 255 | static DEFINE_PRCMU_CLK(bmlclk, 0x0, 18, BMLCLK); | ||
| 256 | static DEFINE_PRCMU_CLK(hsitxclk, 0x0, 19, HSITXCLK); | ||
| 257 | static DEFINE_PRCMU_CLK(hsirxclk, 0x0, 20, HSIRXCLK); | ||
| 258 | static DEFINE_PRCMU_CLK(hdmiclk, 0x0, 21, HDMICLK); | ||
| 259 | static DEFINE_PRCMU_CLK(apeatclk, 0x0, 22, APEATCLK); | ||
| 260 | static DEFINE_PRCMU_CLK(apetraceclk, 0x0, 23, APETRACECLK); | ||
| 261 | static DEFINE_PRCMU_CLK(mcdeclk, 0x0, 24, MCDECLK); | ||
| 262 | static DEFINE_PRCMU_CLK(ipi2clk, 0x0, 25, IPI2CCLK); | ||
| 263 | static DEFINE_PRCMU_CLK(dsialtclk, 0x0, 26, DSIALTCLK); /* v1 */ | ||
| 264 | static DEFINE_PRCMU_CLK(dmaclk, 0x0, 27, DMACLK); | ||
| 265 | static DEFINE_PRCMU_CLK(b2r2clk, 0x0, 28, B2R2CLK); | ||
| 266 | static DEFINE_PRCMU_CLK(tvclk, 0x0, 29, TVCLK); | ||
| 267 | static DEFINE_PRCMU_CLK(uniproclk, 0x0, 30, UNIPROCLK); /* v1 */ | ||
| 268 | static DEFINE_PRCMU_CLK_RATE(sspclk, 0x0, 31, SSPCLK, 48000000); /* v1 */ | ||
| 269 | |||
| 270 | /* Bank 1 */ | ||
| 271 | static DEFINE_PRCMU_CLK(rngclk, 0x4, 0, RNGCLK); /* v1 */ | ||
| 272 | static DEFINE_PRCMU_CLK(uiccclk, 0x4, 1, UICCCLK); /* v1 */ | ||
| 273 | |||
| 274 | /* | ||
| 275 | * PRCC level clock gating | ||
| 276 | * Format: per#, clk, PCKEN bit, KCKEN bit, parent | ||
| 277 | */ | ||
| 278 | |||
| 279 | /* Peripheral Cluster #1 */ | ||
| 280 | static DEFINE_PRCC_CLK(1, i2c4, 10, 9, &clk_i2cclk); | ||
| 281 | static DEFINE_PRCC_CLK(1, gpio0, 9, -1, NULL); | ||
| 282 | static DEFINE_PRCC_CLK(1, slimbus0, 8, 8, &clk_slimclk); | ||
| 283 | static DEFINE_PRCC_CLK(1, spi3_ed, 7, 7, NULL); | ||
| 284 | static DEFINE_PRCC_CLK(1, spi3_v1, 7, -1, NULL); | ||
| 285 | static DEFINE_PRCC_CLK(1, i2c2, 6, 6, &clk_i2cclk); | ||
| 286 | static DEFINE_PRCC_CLK(1, sdi0, 5, 5, &clk_sdmmcclk); | ||
| 287 | static DEFINE_PRCC_CLK(1, msp1_ed, 4, 4, &clk_msp02clk); | ||
| 288 | static DEFINE_PRCC_CLK(1, msp1_v1, 4, 4, &clk_msp1clk); | ||
| 289 | static DEFINE_PRCC_CLK(1, msp0, 3, 3, &clk_msp02clk); | ||
| 290 | static DEFINE_PRCC_CLK(1, i2c1, 2, 2, &clk_i2cclk); | ||
| 291 | static DEFINE_PRCC_CLK(1, uart1, 1, 1, &clk_uartclk); | ||
| 292 | static DEFINE_PRCC_CLK(1, uart0, 0, 0, &clk_uartclk); | ||
| 293 | |||
| 294 | /* Peripheral Cluster #2 */ | ||
| 295 | |||
| 296 | static DEFINE_PRCC_CLK(2, gpio1_ed, 12, -1, NULL); | ||
| 297 | static DEFINE_PRCC_CLK(2, ssitx_ed, 11, -1, NULL); | ||
| 298 | static DEFINE_PRCC_CLK(2, ssirx_ed, 10, -1, NULL); | ||
| 299 | static DEFINE_PRCC_CLK(2, spi0_ed, 9, -1, NULL); | ||
| 300 | static DEFINE_PRCC_CLK(2, sdi3_ed, 8, 6, &clk_sdmmcclk); | ||
| 301 | static DEFINE_PRCC_CLK(2, sdi1_ed, 7, 5, &clk_sdmmcclk); | ||
| 302 | static DEFINE_PRCC_CLK(2, msp2_ed, 6, 4, &clk_msp02clk); | ||
| 303 | static DEFINE_PRCC_CLK(2, sdi4_ed, 4, 2, &clk_sdmmcclk); | ||
| 304 | static DEFINE_PRCC_CLK(2, pwl_ed, 3, 1, NULL); | ||
| 305 | static DEFINE_PRCC_CLK(2, spi1_ed, 2, -1, NULL); | ||
| 306 | static DEFINE_PRCC_CLK(2, spi2_ed, 1, -1, NULL); | ||
| 307 | static DEFINE_PRCC_CLK(2, i2c3_ed, 0, 0, &clk_i2cclk); | ||
| 308 | |||
| 309 | static DEFINE_PRCC_CLK(2, gpio1_v1, 11, -1, NULL); | ||
| 310 | static DEFINE_PRCC_CLK(2, ssitx_v1, 10, 7, NULL); | ||
| 311 | static DEFINE_PRCC_CLK(2, ssirx_v1, 9, 6, NULL); | ||
| 312 | static DEFINE_PRCC_CLK(2, spi0_v1, 8, -1, NULL); | ||
| 313 | static DEFINE_PRCC_CLK(2, sdi3_v1, 7, 5, &clk_sdmmcclk); | ||
| 314 | static DEFINE_PRCC_CLK(2, sdi1_v1, 6, 4, &clk_sdmmcclk); | ||
| 315 | static DEFINE_PRCC_CLK(2, msp2_v1, 5, 3, &clk_msp02clk); | ||
| 316 | static DEFINE_PRCC_CLK(2, sdi4_v1, 4, 2, &clk_sdmmcclk); | ||
| 317 | static DEFINE_PRCC_CLK(2, pwl_v1, 3, 1, NULL); | ||
| 318 | static DEFINE_PRCC_CLK(2, spi1_v1, 2, -1, NULL); | ||
| 319 | static DEFINE_PRCC_CLK(2, spi2_v1, 1, -1, NULL); | ||
| 320 | static DEFINE_PRCC_CLK(2, i2c3_v1, 0, 0, &clk_i2cclk); | ||
| 321 | |||
| 322 | /* Peripheral Cluster #3 */ | ||
| 323 | static DEFINE_PRCC_CLK(3, gpio2, 8, -1, NULL); | ||
| 324 | static DEFINE_PRCC_CLK(3, sdi5, 7, 7, &clk_sdmmcclk); | ||
| 325 | static DEFINE_PRCC_CLK(3, uart2, 6, 6, &clk_uartclk); | ||
| 326 | static DEFINE_PRCC_CLK(3, ske, 5, 5, &clk_32khz); | ||
| 327 | static DEFINE_PRCC_CLK(3, sdi2, 4, 4, &clk_sdmmcclk); | ||
| 328 | static DEFINE_PRCC_CLK(3, i2c0, 3, 3, &clk_i2cclk); | ||
| 329 | static DEFINE_PRCC_CLK(3, ssp1_ed, 2, 2, &clk_i2cclk); | ||
| 330 | static DEFINE_PRCC_CLK(3, ssp0_ed, 1, 1, &clk_i2cclk); | ||
| 331 | static DEFINE_PRCC_CLK(3, ssp1_v1, 2, 2, &clk_sspclk); | ||
| 332 | static DEFINE_PRCC_CLK(3, ssp0_v1, 1, 1, &clk_sspclk); | ||
| 333 | static DEFINE_PRCC_CLK(3, fsmc, 0, -1, NULL); | ||
| 334 | |||
| 335 | /* Peripheral Cluster #4 is in the always on domain */ | ||
| 336 | |||
| 337 | /* Peripheral Cluster #5 */ | ||
| 338 | static DEFINE_PRCC_CLK(5, gpio3, 1, -1, NULL); | ||
| 339 | static DEFINE_PRCC_CLK(5, usb_ed, 0, 0, &clk_i2cclk); | ||
| 340 | static DEFINE_PRCC_CLK(5, usb_v1, 0, 0, NULL); | ||
| 341 | |||
| 342 | /* Peripheral Cluster #6 */ | ||
| 343 | |||
| 344 | static DEFINE_PRCC_CLK(6, mtu1_v1, 8, -1, NULL); | ||
| 345 | static DEFINE_PRCC_CLK(6, mtu0_v1, 7, -1, NULL); | ||
| 346 | static DEFINE_PRCC_CLK(6, cfgreg_v1, 6, 6, NULL); | ||
| 347 | static DEFINE_PRCC_CLK(6, dmc_ed, 6, 6, NULL); | ||
| 348 | static DEFINE_PRCC_CLK(6, hash1, 5, -1, NULL); | ||
| 349 | static DEFINE_PRCC_CLK(6, unipro_v1, 4, 1, &clk_uniproclk); | ||
| 350 | static DEFINE_PRCC_CLK(6, cryp1_ed, 4, -1, NULL); | ||
| 351 | static DEFINE_PRCC_CLK(6, pka, 3, -1, NULL); | ||
| 352 | static DEFINE_PRCC_CLK(6, hash0, 2, -1, NULL); | ||
| 353 | static DEFINE_PRCC_CLK(6, cryp0, 1, -1, NULL); | ||
| 354 | static DEFINE_PRCC_CLK(6, rng_ed, 0, 0, &clk_i2cclk); | ||
| 355 | static DEFINE_PRCC_CLK(6, rng_v1, 0, 0, &clk_rngclk); | ||
| 356 | |||
| 357 | /* Peripheral Cluster #7 */ | ||
| 358 | |||
| 359 | static DEFINE_PRCC_CLK(7, tzpc0_ed, 4, -1, NULL); | ||
| 360 | static DEFINE_PRCC_CLK(7, mtu1_ed, 3, -1, NULL); | ||
| 361 | static DEFINE_PRCC_CLK(7, mtu0_ed, 2, -1, NULL); | ||
| 362 | static DEFINE_PRCC_CLK(7, wdg_ed, 1, -1, NULL); | ||
| 363 | static DEFINE_PRCC_CLK(7, cfgreg_ed, 0, -1, NULL); | ||
| 364 | |||
| 365 | static struct clk_lookup u8500_common_clks[] = { | ||
| 366 | /* Peripheral Cluster #1 */ | ||
| 367 | CLK(gpio0, "gpio.0", NULL), | ||
| 368 | CLK(gpio0, "gpio.1", NULL), | ||
| 369 | CLK(slimbus0, "slimbus0", NULL), | ||
| 370 | CLK(i2c2, "nmk-i2c.2", NULL), | ||
| 371 | CLK(sdi0, "sdi0", NULL), | ||
| 372 | CLK(msp0, "msp0", NULL), | ||
| 373 | CLK(i2c1, "nmk-i2c.1", NULL), | ||
| 374 | CLK(uart1, "uart1", NULL), | ||
| 375 | CLK(uart0, "uart0", NULL), | ||
| 376 | |||
| 377 | /* Peripheral Cluster #3 */ | ||
| 378 | CLK(gpio2, "gpio.2", NULL), | ||
| 379 | CLK(gpio2, "gpio.3", NULL), | ||
| 380 | CLK(gpio2, "gpio.4", NULL), | ||
| 381 | CLK(gpio2, "gpio.5", NULL), | ||
| 382 | CLK(sdi5, "sdi5", NULL), | ||
| 383 | CLK(uart2, "uart2", NULL), | ||
| 384 | CLK(ske, "ske", NULL), | ||
| 385 | CLK(sdi2, "sdi2", NULL), | ||
| 386 | CLK(i2c0, "nmk-i2c.0", NULL), | ||
| 387 | CLK(fsmc, "fsmc", NULL), | ||
| 388 | |||
| 389 | /* Peripheral Cluster #5 */ | ||
| 390 | CLK(gpio3, "gpio.8", NULL), | ||
| 391 | |||
| 392 | /* Peripheral Cluster #6 */ | ||
| 393 | CLK(hash1, "hash1", NULL), | ||
| 394 | CLK(pka, "pka", NULL), | ||
| 395 | CLK(hash0, "hash0", NULL), | ||
| 396 | CLK(cryp0, "cryp0", NULL), | ||
| 397 | |||
| 398 | /* PRCMU level clock gating */ | ||
| 399 | |||
| 400 | /* Bank 0 */ | ||
| 401 | CLK(svaclk, "sva", NULL), | ||
| 402 | CLK(siaclk, "sia", NULL), | ||
| 403 | CLK(sgaclk, "sga", NULL), | ||
| 404 | CLK(slimclk, "slim", NULL), | ||
| 405 | CLK(lcdclk, "lcd", NULL), | ||
| 406 | CLK(bmlclk, "bml", NULL), | ||
| 407 | CLK(hsitxclk, "stm-hsi.0", NULL), | ||
| 408 | CLK(hsirxclk, "stm-hsi.1", NULL), | ||
| 409 | CLK(hdmiclk, "hdmi", NULL), | ||
| 410 | CLK(apeatclk, "apeat", NULL), | ||
| 411 | CLK(apetraceclk, "apetrace", NULL), | ||
| 412 | CLK(mcdeclk, "mcde", NULL), | ||
| 413 | CLK(ipi2clk, "ipi2", NULL), | ||
| 414 | CLK(dmaclk, "dma40", NULL), | ||
| 415 | CLK(b2r2clk, "b2r2", NULL), | ||
| 416 | CLK(tvclk, "tv", NULL), | ||
| 417 | }; | ||
| 418 | |||
| 419 | static struct clk_lookup u8500_ed_clks[] = { | ||
| 420 | /* Peripheral Cluster #1 */ | ||
| 421 | CLK(spi3_ed, "spi3", NULL), | ||
| 422 | CLK(msp1_ed, "msp1", NULL), | ||
| 423 | |||
| 424 | /* Peripheral Cluster #2 */ | ||
| 425 | CLK(gpio1_ed, "gpio.6", NULL), | ||
| 426 | CLK(gpio1_ed, "gpio.7", NULL), | ||
| 427 | CLK(ssitx_ed, "ssitx", NULL), | ||
| 428 | CLK(ssirx_ed, "ssirx", NULL), | ||
| 429 | CLK(spi0_ed, "spi0", NULL), | ||
| 430 | CLK(sdi3_ed, "sdi3", NULL), | ||
| 431 | CLK(sdi1_ed, "sdi1", NULL), | ||
| 432 | CLK(msp2_ed, "msp2", NULL), | ||
| 433 | CLK(sdi4_ed, "sdi4", NULL), | ||
| 434 | CLK(pwl_ed, "pwl", NULL), | ||
| 435 | CLK(spi1_ed, "spi1", NULL), | ||
| 436 | CLK(spi2_ed, "spi2", NULL), | ||
| 437 | CLK(i2c3_ed, "nmk-i2c.3", NULL), | ||
| 438 | |||
| 439 | /* Peripheral Cluster #3 */ | ||
| 440 | CLK(ssp1_ed, "ssp1", NULL), | ||
| 441 | CLK(ssp0_ed, "ssp0", NULL), | ||
| 442 | |||
| 443 | /* Peripheral Cluster #5 */ | ||
| 444 | CLK(usb_ed, "musb_hdrc.0", "usb"), | ||
| 445 | |||
| 446 | /* Peripheral Cluster #6 */ | ||
| 447 | CLK(dmc_ed, "dmc", NULL), | ||
| 448 | CLK(cryp1_ed, "cryp1", NULL), | ||
| 449 | CLK(rng_ed, "rng", NULL), | ||
| 450 | |||
| 451 | /* Peripheral Cluster #7 */ | ||
| 452 | CLK(tzpc0_ed, "tzpc0", NULL), | ||
| 453 | CLK(mtu1_ed, "mtu1", NULL), | ||
| 454 | CLK(mtu0_ed, "mtu0", NULL), | ||
| 455 | CLK(wdg_ed, "wdg", NULL), | ||
| 456 | CLK(cfgreg_ed, "cfgreg", NULL), | ||
| 457 | }; | ||
| 458 | |||
| 459 | static struct clk_lookup u8500_v1_clks[] = { | ||
| 460 | /* Peripheral Cluster #1 */ | ||
| 461 | CLK(i2c4, "nmk-i2c.4", NULL), | ||
| 462 | CLK(spi3_v1, "spi3", NULL), | ||
| 463 | CLK(msp1_v1, "msp1", NULL), | ||
| 464 | |||
| 465 | /* Peripheral Cluster #2 */ | ||
| 466 | CLK(gpio1_v1, "gpio.6", NULL), | ||
| 467 | CLK(gpio1_v1, "gpio.7", NULL), | ||
| 468 | CLK(ssitx_v1, "ssitx", NULL), | ||
| 469 | CLK(ssirx_v1, "ssirx", NULL), | ||
| 470 | CLK(spi0_v1, "spi0", NULL), | ||
| 471 | CLK(sdi3_v1, "sdi3", NULL), | ||
| 472 | CLK(sdi1_v1, "sdi1", NULL), | ||
| 473 | CLK(msp2_v1, "msp2", NULL), | ||
| 474 | CLK(sdi4_v1, "sdi4", NULL), | ||
| 475 | CLK(pwl_v1, "pwl", NULL), | ||
| 476 | CLK(spi1_v1, "spi1", NULL), | ||
| 477 | CLK(spi2_v1, "spi2", NULL), | ||
| 478 | CLK(i2c3_v1, "nmk-i2c.3", NULL), | ||
| 479 | |||
| 480 | /* Peripheral Cluster #3 */ | ||
| 481 | CLK(ssp1_v1, "ssp1", NULL), | ||
| 482 | CLK(ssp0_v1, "ssp0", NULL), | ||
| 483 | |||
| 484 | /* Peripheral Cluster #5 */ | ||
| 485 | CLK(usb_v1, "musb_hdrc.0", "usb"), | ||
| 486 | |||
| 487 | /* Peripheral Cluster #6 */ | ||
| 488 | CLK(mtu1_v1, "mtu1", NULL), | ||
| 489 | CLK(mtu0_v1, "mtu0", NULL), | ||
| 490 | CLK(cfgreg_v1, "cfgreg", NULL), | ||
| 491 | CLK(hash1, "hash1", NULL), | ||
| 492 | CLK(unipro_v1, "unipro", NULL), | ||
| 493 | CLK(rng_v1, "rng", NULL), | ||
| 494 | |||
| 495 | /* PRCMU level clock gating */ | ||
| 496 | |||
| 497 | /* Bank 0 */ | ||
| 498 | CLK(uniproclk, "uniproclk", NULL), | ||
| 499 | CLK(dsialtclk, "dsialt", NULL), | ||
| 500 | |||
| 501 | /* Bank 1 */ | ||
| 502 | CLK(rngclk, "rng", NULL), | ||
| 503 | CLK(uiccclk, "uicc", NULL), | ||
| 84 | }; | 504 | }; |
| 85 | 505 | ||
| 86 | static int __init clk_init(void) | 506 | static int __init clk_init(void) |
| 87 | { | 507 | { |
| 88 | /* register the clock lookups */ | 508 | if (cpu_is_u8500ed()) { |
| 89 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 509 | clk_prcmu_ops.enable = clk_prcmu_ed_enable; |
| 510 | clk_prcmu_ops.disable = clk_prcmu_ed_disable; | ||
| 511 | } else if (cpu_is_u5500()) { | ||
| 512 | /* Clock tree for U5500 not implemented yet */ | ||
| 513 | clk_prcc_ops.enable = clk_prcc_ops.disable = NULL; | ||
| 514 | clk_prcmu_ops.enable = clk_prcmu_ops.disable = NULL; | ||
| 515 | } | ||
| 516 | |||
| 517 | clkdev_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks)); | ||
| 518 | if (cpu_is_u8500ed()) | ||
| 519 | clkdev_add_table(u8500_ed_clks, ARRAY_SIZE(u8500_ed_clks)); | ||
| 520 | else | ||
| 521 | clkdev_add_table(u8500_v1_clks, ARRAY_SIZE(u8500_v1_clks)); | ||
| 522 | |||
| 90 | return 0; | 523 | return 0; |
| 91 | } | 524 | } |
| 92 | arch_initcall(clk_init); | 525 | arch_initcall(clk_init); |
diff --git a/arch/arm/mach-ux500/clock.h b/arch/arm/mach-ux500/clock.h new file mode 100644 index 000000000000..e4f99b65026f --- /dev/null +++ b/arch/arm/mach-ux500/clock.h | |||
| @@ -0,0 +1,125 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 ST-Ericsson | ||
| 3 | * Copyright (C) 2009 STMicroelectronics | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | */ | ||
| 9 | |||
| 10 | /** | ||
| 11 | * struct clkops - ux500 clock operations | ||
| 12 | * @enable: function to enable the clock | ||
| 13 | * @disable: function to disable the clock | ||
| 14 | * @get_rate: function to get the current clock rate | ||
| 15 | * | ||
| 16 | * This structure contains function pointers to functions that will be used to | ||
| 17 | * control the clock. All of these functions are optional. If get_rate is | ||
| 18 | * NULL, the rate in the struct clk will be used. | ||
| 19 | */ | ||
| 20 | struct clkops { | ||
| 21 | void (*enable) (struct clk *); | ||
| 22 | void (*disable) (struct clk *); | ||
| 23 | unsigned long (*get_rate) (struct clk *); | ||
| 24 | }; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * struct clk - ux500 clock structure | ||
| 28 | * @ops: pointer to clkops struct used to control this clock | ||
| 29 | * @name: name, for debugging | ||
| 30 | * @enabled: refcount. positive if enabled, zero if disabled | ||
| 31 | * @rate: fixed rate for clocks which don't implement | ||
| 32 | * ops->getrate | ||
| 33 | * @prcmu_cg_off: address offset of the combined enable/disable register | ||
| 34 | * (used on u8500v1) | ||
| 35 | * @prcmu_cg_bit: bit in the combined enable/disable register (used on | ||
| 36 | * u8500v1) | ||
| 37 | * @prcmu_cg_mgt: address of the enable/disable register (used on | ||
| 38 | * u8500ed) | ||
| 39 | * @cluster: peripheral cluster number | ||
| 40 | * @prcc_bus: bit for the bus clock in the peripheral's CLKRST | ||
| 41 | * @prcc_kernel: bit for the kernel clock in the peripheral's CLKRST. | ||
| 42 | * -1 if no kernel clock exists. | ||
| 43 | * @parent_cluster: pointer to parent's cluster clk struct | ||
| 44 | * @parent_periph: pointer to parent's peripheral clk struct | ||
| 45 | * | ||
| 46 | * Peripherals are organised into clusters, and each cluster has an associated | ||
| 47 | * bus clock. Some peripherals also have a parent peripheral clock. | ||
| 48 | * | ||
| 49 | * In order to enable a clock for a peripheral, we need to enable: | ||
| 50 | * (1) the parent cluster (bus) clock at the PRCMU level | ||
| 51 | * (2) the parent peripheral clock (if any) at the PRCMU level | ||
| 52 | * (3) the peripheral's bus & kernel clock at the PRCC level | ||
| 53 | * | ||
| 54 | * (1) and (2) are handled by defining clk structs (DEFINE_PRCMU_CLK) for each | ||
| 55 | * of the cluster and peripheral clocks, and hooking these as the parents of | ||
| 56 | * the individual peripheral clocks. | ||
| 57 | * | ||
| 58 | * (3) is handled by specifying the bits in the PRCC control registers required | ||
| 59 | * to enable these clocks and modifying them in the ->enable and | ||
| 60 | * ->disable callbacks of the peripheral clocks (DEFINE_PRCC_CLK). | ||
| 61 | * | ||
| 62 | * This structure describes both the PRCMU-level clocks and PRCC-level clocks. | ||
| 63 | * The prcmu_* fields are only used for the PRCMU clocks, and the cluster, | ||
| 64 | * prcc, and parent pointers are only used for the PRCC-level clocks. | ||
| 65 | */ | ||
| 66 | struct clk { | ||
| 67 | const struct clkops *ops; | ||
| 68 | const char *name; | ||
| 69 | unsigned int enabled; | ||
| 70 | |||
| 71 | unsigned long rate; | ||
| 72 | struct list_head list; | ||
| 73 | |||
| 74 | /* These three are only for PRCMU clks */ | ||
| 75 | |||
| 76 | unsigned int prcmu_cg_off; | ||
| 77 | unsigned int prcmu_cg_bit; | ||
| 78 | unsigned int prcmu_cg_mgt; | ||
| 79 | |||
| 80 | /* The rest are only for PRCC clks */ | ||
| 81 | |||
| 82 | int cluster; | ||
| 83 | unsigned int prcc_bus; | ||
| 84 | unsigned int prcc_kernel; | ||
| 85 | |||
| 86 | struct clk *parent_cluster; | ||
| 87 | struct clk *parent_periph; | ||
| 88 | }; | ||
| 89 | |||
| 90 | #define DEFINE_PRCMU_CLK(_name, _cg_off, _cg_bit, _reg) \ | ||
| 91 | struct clk clk_##_name = { \ | ||
| 92 | .name = #_name, \ | ||
| 93 | .ops = &clk_prcmu_ops, \ | ||
| 94 | .prcmu_cg_off = _cg_off, \ | ||
| 95 | .prcmu_cg_bit = _cg_bit, \ | ||
| 96 | .prcmu_cg_mgt = PRCM_##_reg##_MGT \ | ||
| 97 | } | ||
| 98 | |||
| 99 | #define DEFINE_PRCMU_CLK_RATE(_name, _cg_off, _cg_bit, _reg, _rate) \ | ||
| 100 | struct clk clk_##_name = { \ | ||
| 101 | .name = #_name, \ | ||
| 102 | .ops = &clk_prcmu_ops, \ | ||
| 103 | .prcmu_cg_off = _cg_off, \ | ||
| 104 | .prcmu_cg_bit = _cg_bit, \ | ||
| 105 | .rate = _rate, \ | ||
| 106 | .prcmu_cg_mgt = PRCM_##_reg##_MGT \ | ||
| 107 | } | ||
| 108 | |||
| 109 | #define DEFINE_PRCC_CLK(_pclust, _name, _bus_en, _kernel_en, _kernclk) \ | ||
| 110 | struct clk clk_##_name = { \ | ||
| 111 | .name = #_name, \ | ||
| 112 | .ops = &clk_prcc_ops, \ | ||
| 113 | .cluster = _pclust, \ | ||
| 114 | .prcc_bus = _bus_en, \ | ||
| 115 | .prcc_kernel = _kernel_en, \ | ||
| 116 | .parent_cluster = &clk_per##_pclust##clk, \ | ||
| 117 | .parent_periph = _kernclk \ | ||
| 118 | } | ||
| 119 | |||
| 120 | #define CLK(_clk, _devname, _conname) \ | ||
| 121 | { \ | ||
| 122 | .clk = &clk_##_clk, \ | ||
| 123 | .dev_id = _devname, \ | ||
| 124 | .con_id = _conname, \ | ||
| 125 | } | ||
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c new file mode 100644 index 000000000000..6a3ac4539f16 --- /dev/null +++ b/arch/arm/mach-ux500/cpu-db5500.c | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <linux/platform_device.h> | ||
| 9 | #include <linux/amba/bus.h> | ||
| 10 | #include <linux/io.h> | ||
| 11 | |||
| 12 | #include <asm/mach/map.h> | ||
| 13 | |||
| 14 | #include <mach/hardware.h> | ||
| 15 | #include <mach/devices.h> | ||
| 16 | #include <mach/setup.h> | ||
| 17 | |||
| 18 | static struct map_desc u5500_io_desc[] __initdata = { | ||
| 19 | __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K), | ||
| 20 | __IO_DEV_DESC(U5500_GPIO1_BASE, SZ_4K), | ||
| 21 | __IO_DEV_DESC(U5500_GPIO2_BASE, SZ_4K), | ||
| 22 | __IO_DEV_DESC(U5500_GPIO3_BASE, SZ_4K), | ||
| 23 | __IO_DEV_DESC(U5500_GPIO4_BASE, SZ_4K), | ||
| 24 | }; | ||
| 25 | |||
| 26 | static struct platform_device *u5500_platform_devs[] __initdata = { | ||
| 27 | &u5500_gpio_devs[0], | ||
| 28 | &u5500_gpio_devs[1], | ||
| 29 | &u5500_gpio_devs[2], | ||
| 30 | &u5500_gpio_devs[3], | ||
| 31 | &u5500_gpio_devs[4], | ||
| 32 | &u5500_gpio_devs[5], | ||
| 33 | &u5500_gpio_devs[6], | ||
| 34 | &u5500_gpio_devs[7], | ||
| 35 | }; | ||
| 36 | |||
| 37 | void __init u5500_map_io(void) | ||
| 38 | { | ||
| 39 | ux500_map_io(); | ||
| 40 | |||
| 41 | iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc)); | ||
| 42 | } | ||
| 43 | |||
| 44 | void __init u5500_init_devices(void) | ||
| 45 | { | ||
| 46 | ux500_init_devices(); | ||
| 47 | |||
| 48 | platform_add_devices(u5500_platform_devs, | ||
| 49 | ARRAY_SIZE(u5500_platform_devs)); | ||
| 50 | } | ||
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 397bc1f9ed94..d04299f3b6b5 100644 --- a/arch/arm/mach-ux500/cpu-u8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
| @@ -13,44 +13,55 @@ | |||
| 13 | #include <linux/device.h> | 13 | #include <linux/device.h> |
| 14 | #include <linux/amba/bus.h> | 14 | #include <linux/amba/bus.h> |
| 15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
| 16 | #include <linux/gpio.h> | ||
| 16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/io.h> | ||
| 17 | 19 | ||
| 18 | #include <asm/hardware/gic.h> | ||
| 19 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
| 20 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
| 22 | #include <mach/setup.h> | ||
| 23 | #include <mach/devices.h> | ||
| 21 | 24 | ||
| 22 | /* add any platform devices here - TODO */ | ||
| 23 | static struct platform_device *platform_devs[] __initdata = { | 25 | static struct platform_device *platform_devs[] __initdata = { |
| 24 | /* yet to be added, add i2c0, gpio.. */ | 26 | &u8500_gpio_devs[0], |
| 27 | &u8500_gpio_devs[1], | ||
| 28 | &u8500_gpio_devs[2], | ||
| 29 | &u8500_gpio_devs[3], | ||
| 30 | &u8500_gpio_devs[4], | ||
| 31 | &u8500_gpio_devs[5], | ||
| 32 | &u8500_gpio_devs[6], | ||
| 33 | &u8500_gpio_devs[7], | ||
| 34 | &u8500_gpio_devs[8], | ||
| 25 | }; | 35 | }; |
| 26 | 36 | ||
| 27 | #define __IO_DEV_DESC(x, sz) { \ | ||
| 28 | .virtual = IO_ADDRESS(x), \ | ||
| 29 | .pfn = __phys_to_pfn(x), \ | ||
| 30 | .length = sz, \ | ||
| 31 | .type = MT_DEVICE, \ | ||
| 32 | } | ||
| 33 | |||
| 34 | /* minimum static i/o mapping required to boot U8500 platforms */ | 37 | /* minimum static i/o mapping required to boot U8500 platforms */ |
| 35 | static struct map_desc u8500_io_desc[] __initdata = { | 38 | static struct map_desc u8500_io_desc[] __initdata = { |
| 36 | __IO_DEV_DESC(U8500_UART2_BASE, SZ_4K), | 39 | __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K), |
| 37 | __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K), | 40 | __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K), |
| 38 | __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K), | 41 | __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K), |
| 42 | __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K), | ||
| 43 | __IO_DEV_DESC(U8500_GPIO3_BASE, SZ_4K), | ||
| 44 | }; | ||
| 45 | |||
| 46 | static struct map_desc u8500ed_io_desc[] __initdata = { | ||
| 47 | __IO_DEV_DESC(U8500_MTU0_BASE_ED, SZ_4K), | ||
| 48 | __IO_DEV_DESC(U8500_CLKRST7_BASE_ED, SZ_8K), | ||
| 49 | }; | ||
| 50 | |||
| 51 | static struct map_desc u8500v1_io_desc[] __initdata = { | ||
| 39 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), | 52 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), |
| 40 | __IO_DEV_DESC(U8500_TWD_BASE, SZ_4K), | ||
| 41 | __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K), | ||
| 42 | __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K), | ||
| 43 | }; | 53 | }; |
| 44 | 54 | ||
| 45 | void __init u8500_map_io(void) | 55 | void __init u8500_map_io(void) |
| 46 | { | 56 | { |
| 57 | ux500_map_io(); | ||
| 58 | |||
| 47 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); | 59 | iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); |
| 48 | } | ||
| 49 | 60 | ||
| 50 | void __init u8500_init_irq(void) | 61 | if (cpu_is_u8500ed()) |
| 51 | { | 62 | iotable_init(u8500ed_io_desc, ARRAY_SIZE(u8500ed_io_desc)); |
| 52 | gic_dist_init(0, __io_address(U8500_GIC_DIST_BASE), 29); | 63 | else |
| 53 | gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE)); | 64 | iotable_init(u8500v1_io_desc, ARRAY_SIZE(u8500v1_io_desc)); |
| 54 | } | 65 | } |
| 55 | 66 | ||
| 56 | /* | 67 | /* |
| @@ -58,6 +69,8 @@ void __init u8500_init_irq(void) | |||
| 58 | */ | 69 | */ |
| 59 | void __init u8500_init_devices(void) | 70 | void __init u8500_init_devices(void) |
| 60 | { | 71 | { |
| 72 | ux500_init_devices(); | ||
| 73 | |||
| 61 | /* Register the platform devices */ | 74 | /* Register the platform devices */ |
| 62 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | 75 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); |
| 63 | 76 | ||
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c new file mode 100644 index 000000000000..d81ad023963c --- /dev/null +++ b/arch/arm/mach-ux500/cpu.c | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <linux/platform_device.h> | ||
| 9 | #include <linux/amba/bus.h> | ||
| 10 | #include <linux/io.h> | ||
| 11 | #include <linux/clk.h> | ||
| 12 | |||
| 13 | #include <asm/hardware/cache-l2x0.h> | ||
| 14 | #include <asm/hardware/gic.h> | ||
| 15 | #include <asm/mach/map.h> | ||
| 16 | #include <asm/localtimer.h> | ||
| 17 | |||
| 18 | #include <plat/mtu.h> | ||
| 19 | #include <mach/hardware.h> | ||
| 20 | #include <mach/setup.h> | ||
| 21 | #include <mach/devices.h> | ||
| 22 | |||
| 23 | #include "clock.h" | ||
| 24 | |||
| 25 | static struct map_desc ux500_io_desc[] __initdata = { | ||
| 26 | __IO_DEV_DESC(UX500_UART0_BASE, SZ_4K), | ||
| 27 | __IO_DEV_DESC(UX500_UART2_BASE, SZ_4K), | ||
| 28 | |||
| 29 | __IO_DEV_DESC(UX500_GIC_CPU_BASE, SZ_4K), | ||
| 30 | __IO_DEV_DESC(UX500_GIC_DIST_BASE, SZ_4K), | ||
| 31 | __IO_DEV_DESC(UX500_L2CC_BASE, SZ_4K), | ||
| 32 | __IO_DEV_DESC(UX500_TWD_BASE, SZ_4K), | ||
| 33 | __IO_DEV_DESC(UX500_SCU_BASE, SZ_4K), | ||
| 34 | |||
| 35 | __IO_DEV_DESC(UX500_CLKRST1_BASE, SZ_4K), | ||
| 36 | __IO_DEV_DESC(UX500_CLKRST2_BASE, SZ_4K), | ||
| 37 | __IO_DEV_DESC(UX500_CLKRST3_BASE, SZ_4K), | ||
| 38 | __IO_DEV_DESC(UX500_CLKRST5_BASE, SZ_4K), | ||
| 39 | __IO_DEV_DESC(UX500_CLKRST6_BASE, SZ_4K), | ||
| 40 | |||
| 41 | __IO_DEV_DESC(UX500_MTU0_BASE, SZ_4K), | ||
| 42 | __IO_DEV_DESC(UX500_MTU1_BASE, SZ_4K), | ||
| 43 | |||
| 44 | __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K), | ||
| 45 | }; | ||
| 46 | |||
| 47 | static struct amba_device *ux500_amba_devs[] __initdata = { | ||
| 48 | &ux500_pl031_device, | ||
| 49 | }; | ||
| 50 | |||
| 51 | void __init ux500_map_io(void) | ||
| 52 | { | ||
| 53 | iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc)); | ||
| 54 | } | ||
| 55 | |||
| 56 | void __init ux500_init_devices(void) | ||
| 57 | { | ||
| 58 | amba_add_devices(ux500_amba_devs, ARRAY_SIZE(ux500_amba_devs)); | ||
| 59 | } | ||
| 60 | |||
| 61 | void __init ux500_init_irq(void) | ||
| 62 | { | ||
| 63 | gic_dist_init(0, __io_address(UX500_GIC_DIST_BASE), 29); | ||
| 64 | gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE)); | ||
| 65 | } | ||
| 66 | |||
| 67 | #ifdef CONFIG_CACHE_L2X0 | ||
| 68 | static int ux500_l2x0_init(void) | ||
| 69 | { | ||
| 70 | void __iomem *l2x0_base; | ||
| 71 | |||
| 72 | l2x0_base = __io_address(UX500_L2CC_BASE); | ||
| 73 | |||
| 74 | /* 64KB way size, 8 way associativity, force WA */ | ||
| 75 | l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff); | ||
| 76 | |||
| 77 | return 0; | ||
| 78 | } | ||
| 79 | early_initcall(ux500_l2x0_init); | ||
| 80 | #endif | ||
| 81 | |||
| 82 | static void __init ux500_timer_init(void) | ||
| 83 | { | ||
| 84 | #ifdef CONFIG_LOCAL_TIMERS | ||
| 85 | /* Setup the local timer base */ | ||
| 86 | twd_base = __io_address(UX500_TWD_BASE); | ||
| 87 | #endif | ||
| 88 | /* Setup the MTU base */ | ||
| 89 | if (cpu_is_u8500ed()) | ||
| 90 | mtu_base = __io_address(U8500_MTU0_BASE_ED); | ||
| 91 | else | ||
| 92 | mtu_base = __io_address(UX500_MTU0_BASE); | ||
| 93 | |||
| 94 | nmdk_timer_init(); | ||
| 95 | } | ||
| 96 | |||
| 97 | struct sys_timer ux500_timer = { | ||
| 98 | .init = ux500_timer_init, | ||
| 99 | }; | ||
diff --git a/arch/arm/mach-ux500/devices-db5500.c b/arch/arm/mach-ux500/devices-db5500.c new file mode 100644 index 000000000000..33e5b56bebb6 --- /dev/null +++ b/arch/arm/mach-ux500/devices-db5500.c | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <linux/platform_device.h> | ||
| 9 | #include <linux/interrupt.h> | ||
| 10 | #include <linux/gpio.h> | ||
| 11 | |||
| 12 | #include <mach/hardware.h> | ||
| 13 | #include <mach/devices.h> | ||
| 14 | |||
| 15 | static struct nmk_gpio_platform_data u5500_gpio_data[] = { | ||
| 16 | GPIO_DATA("GPIO-0-31", 0), | ||
| 17 | GPIO_DATA("GPIO-32-63", 32), /* 36..63 not routed to pin */ | ||
| 18 | GPIO_DATA("GPIO-64-95", 64), /* 83..95 not routed to pin */ | ||
| 19 | GPIO_DATA("GPIO-96-127", 96), /* 102..127 not routed to pin */ | ||
| 20 | GPIO_DATA("GPIO-128-159", 128), /* 149..159 not routed to pin */ | ||
| 21 | GPIO_DATA("GPIO-160-191", 160), | ||
| 22 | GPIO_DATA("GPIO-192-223", 192), | ||
| 23 | GPIO_DATA("GPIO-224-255", 224), /* 228..255 not routed to pin */ | ||
| 24 | }; | ||
| 25 | |||
| 26 | static struct resource u5500_gpio_resources[] = { | ||
| 27 | GPIO_RESOURCE(0), | ||
| 28 | GPIO_RESOURCE(1), | ||
| 29 | GPIO_RESOURCE(2), | ||
| 30 | GPIO_RESOURCE(3), | ||
| 31 | GPIO_RESOURCE(4), | ||
| 32 | GPIO_RESOURCE(5), | ||
| 33 | GPIO_RESOURCE(6), | ||
| 34 | GPIO_RESOURCE(7), | ||
| 35 | }; | ||
| 36 | |||
| 37 | struct platform_device u5500_gpio_devs[] = { | ||
| 38 | GPIO_DEVICE(0), | ||
| 39 | GPIO_DEVICE(1), | ||
| 40 | GPIO_DEVICE(2), | ||
| 41 | GPIO_DEVICE(3), | ||
| 42 | GPIO_DEVICE(4), | ||
| 43 | GPIO_DEVICE(5), | ||
| 44 | GPIO_DEVICE(6), | ||
| 45 | GPIO_DEVICE(7), | ||
| 46 | }; | ||
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c new file mode 100644 index 000000000000..20334236afce --- /dev/null +++ b/arch/arm/mach-ux500/devices-db8500.c | |||
| @@ -0,0 +1,107 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <linux/kernel.h> | ||
| 9 | #include <linux/platform_device.h> | ||
| 10 | #include <linux/interrupt.h> | ||
| 11 | #include <linux/io.h> | ||
| 12 | #include <linux/gpio.h> | ||
| 13 | #include <linux/amba/bus.h> | ||
| 14 | |||
| 15 | #include <mach/hardware.h> | ||
| 16 | #include <mach/setup.h> | ||
| 17 | |||
| 18 | static struct nmk_gpio_platform_data u8500_gpio_data[] = { | ||
| 19 | GPIO_DATA("GPIO-0-31", 0), | ||
| 20 | GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */ | ||
| 21 | GPIO_DATA("GPIO-64-95", 64), | ||
| 22 | GPIO_DATA("GPIO-96-127", 96), /* 98..127 not routed to pin */ | ||
| 23 | GPIO_DATA("GPIO-128-159", 128), | ||
| 24 | GPIO_DATA("GPIO-160-191", 160), /* 172..191 not routed to pin */ | ||
| 25 | GPIO_DATA("GPIO-192-223", 192), | ||
| 26 | GPIO_DATA("GPIO-224-255", 224), /* 231..255 not routed to pin */ | ||
| 27 | GPIO_DATA("GPIO-256-288", 256), /* 268..288 not routed to pin */ | ||
| 28 | }; | ||
| 29 | |||
| 30 | static struct resource u8500_gpio_resources[] = { | ||
| 31 | GPIO_RESOURCE(0), | ||
| 32 | GPIO_RESOURCE(1), | ||
| 33 | GPIO_RESOURCE(2), | ||
| 34 | GPIO_RESOURCE(3), | ||
| 35 | GPIO_RESOURCE(4), | ||
| 36 | GPIO_RESOURCE(5), | ||
| 37 | GPIO_RESOURCE(6), | ||
| 38 | GPIO_RESOURCE(7), | ||
| 39 | GPIO_RESOURCE(8), | ||
| 40 | }; | ||
| 41 | |||
| 42 | struct platform_device u8500_gpio_devs[] = { | ||
| 43 | GPIO_DEVICE(0), | ||
| 44 | GPIO_DEVICE(1), | ||
| 45 | GPIO_DEVICE(2), | ||
| 46 | GPIO_DEVICE(3), | ||
| 47 | GPIO_DEVICE(4), | ||
| 48 | GPIO_DEVICE(5), | ||
| 49 | GPIO_DEVICE(6), | ||
| 50 | GPIO_DEVICE(7), | ||
| 51 | GPIO_DEVICE(8), | ||
| 52 | }; | ||
| 53 | |||
| 54 | struct amba_device u8500_ssp0_device = { | ||
| 55 | .dev = { | ||
| 56 | .coherent_dma_mask = ~0, | ||
| 57 | .init_name = "ssp0", | ||
| 58 | }, | ||
| 59 | .res = { | ||
| 60 | .start = U8500_SSP0_BASE, | ||
| 61 | .end = U8500_SSP0_BASE + SZ_4K - 1, | ||
| 62 | .flags = IORESOURCE_MEM, | ||
| 63 | }, | ||
| 64 | .irq = {IRQ_SSP0, NO_IRQ }, | ||
| 65 | /* ST-Ericsson modified id */ | ||
| 66 | .periphid = SSP_PER_ID, | ||
| 67 | }; | ||
| 68 | |||
| 69 | static struct resource u8500_i2c0_resources[] = { | ||
| 70 | [0] = { | ||
| 71 | .start = U8500_I2C0_BASE, | ||
| 72 | .end = U8500_I2C0_BASE + SZ_4K - 1, | ||
| 73 | .flags = IORESOURCE_MEM, | ||
| 74 | }, | ||
| 75 | [1] = { | ||
| 76 | .start = IRQ_I2C0, | ||
| 77 | .end = IRQ_I2C0, | ||
| 78 | .flags = IORESOURCE_IRQ, | ||
| 79 | } | ||
| 80 | }; | ||
| 81 | |||
| 82 | struct platform_device u8500_i2c0_device = { | ||
| 83 | .name = "nmk-i2c", | ||
| 84 | .id = 0, | ||
| 85 | .resource = u8500_i2c0_resources, | ||
| 86 | .num_resources = ARRAY_SIZE(u8500_i2c0_resources), | ||
| 87 | }; | ||
| 88 | |||
| 89 | static struct resource u8500_i2c4_resources[] = { | ||
| 90 | [0] = { | ||
| 91 | .start = U8500_I2C4_BASE, | ||
| 92 | .end = U8500_I2C4_BASE + SZ_4K - 1, | ||
| 93 | .flags = IORESOURCE_MEM, | ||
| 94 | }, | ||
| 95 | [1] = { | ||
| 96 | .start = IRQ_I2C4, | ||
| 97 | .end = IRQ_I2C4, | ||
| 98 | .flags = IORESOURCE_IRQ, | ||
| 99 | } | ||
| 100 | }; | ||
| 101 | |||
| 102 | struct platform_device u8500_i2c4_device = { | ||
| 103 | .name = "nmk-i2c", | ||
| 104 | .id = 4, | ||
| 105 | .resource = u8500_i2c4_resources, | ||
| 106 | .num_resources = ARRAY_SIZE(u8500_i2c4_resources), | ||
| 107 | }; | ||
diff --git a/arch/arm/mach-ux500/devices.c b/arch/arm/mach-ux500/devices.c new file mode 100644 index 000000000000..8a268893cb7f --- /dev/null +++ b/arch/arm/mach-ux500/devices.c | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <linux/kernel.h> | ||
| 9 | #include <linux/platform_device.h> | ||
| 10 | #include <linux/interrupt.h> | ||
| 11 | #include <linux/io.h> | ||
| 12 | #include <linux/amba/bus.h> | ||
| 13 | |||
| 14 | #include <mach/hardware.h> | ||
| 15 | #include <mach/setup.h> | ||
| 16 | |||
| 17 | #define __MEM_4K_RESOURCE(x) \ | ||
| 18 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | ||
| 19 | |||
| 20 | struct amba_device ux500_pl031_device = { | ||
| 21 | .dev = { | ||
| 22 | .init_name = "pl031", | ||
| 23 | }, | ||
| 24 | .res = { | ||
| 25 | .start = UX500_RTC_BASE, | ||
| 26 | .end = UX500_RTC_BASE + SZ_4K - 1, | ||
| 27 | .flags = IORESOURCE_MEM, | ||
| 28 | }, | ||
| 29 | .irq = {IRQ_RTC_RTT, NO_IRQ}, | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct amba_device ux500_uart0_device = { | ||
| 33 | .dev = { .init_name = "uart0" }, | ||
| 34 | __MEM_4K_RESOURCE(UX500_UART0_BASE), | ||
| 35 | .irq = {IRQ_UART0, NO_IRQ}, | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct amba_device ux500_uart1_device = { | ||
| 39 | .dev = { .init_name = "uart1" }, | ||
| 40 | __MEM_4K_RESOURCE(UX500_UART1_BASE), | ||
| 41 | .irq = {IRQ_UART1, NO_IRQ}, | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct amba_device ux500_uart2_device = { | ||
| 45 | .dev = { .init_name = "uart2" }, | ||
| 46 | __MEM_4K_RESOURCE(UX500_UART2_BASE), | ||
| 47 | .irq = {IRQ_UART2, NO_IRQ}, | ||
| 48 | }; | ||
| 49 | |||
| 50 | #define UX500_I2C_RESOURCES(id, size) \ | ||
| 51 | static struct resource ux500_i2c##id##_resources[] = { \ | ||
| 52 | [0] = { \ | ||
| 53 | .start = UX500_I2C##id##_BASE, \ | ||
| 54 | .end = UX500_I2C##id##_BASE + size - 1, \ | ||
| 55 | .flags = IORESOURCE_MEM, \ | ||
| 56 | }, \ | ||
| 57 | [1] = { \ | ||
| 58 | .start = IRQ_I2C##id, \ | ||
| 59 | .end = IRQ_I2C##id, \ | ||
| 60 | .flags = IORESOURCE_IRQ \ | ||
| 61 | } \ | ||
| 62 | } | ||
| 63 | |||
| 64 | UX500_I2C_RESOURCES(1, SZ_4K); | ||
| 65 | UX500_I2C_RESOURCES(2, SZ_4K); | ||
| 66 | UX500_I2C_RESOURCES(3, SZ_4K); | ||
| 67 | |||
| 68 | #define UX500_I2C_PDEVICE(cid) \ | ||
| 69 | struct platform_device ux500_i2c##cid##_device = { \ | ||
| 70 | .name = "nmk-i2c", \ | ||
| 71 | .id = cid, \ | ||
| 72 | .num_resources = 2, \ | ||
| 73 | .resource = ux500_i2c##cid##_resources, \ | ||
| 74 | } | ||
| 75 | |||
| 76 | UX500_I2C_PDEVICE(1); | ||
| 77 | UX500_I2C_PDEVICE(2); | ||
| 78 | UX500_I2C_PDEVICE(3); | ||
| 79 | |||
| 80 | void __init amba_add_devices(struct amba_device *devs[], int num) | ||
| 81 | { | ||
| 82 | int i; | ||
| 83 | |||
| 84 | for (i = 0; i < num; i++) { | ||
| 85 | struct amba_device *d = devs[i]; | ||
| 86 | amba_device_register(d, &iomem_resource); | ||
| 87 | } | ||
| 88 | } | ||
diff --git a/arch/arm/mach-ux500/include/mach/db5500-regs.h b/arch/arm/mach-ux500/include/mach/db5500-regs.h new file mode 100644 index 000000000000..545c80fc8024 --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/db5500-regs.h | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __MACH_DB5500_REGS_H | ||
| 8 | #define __MACH_DB5500_REGS_H | ||
| 9 | |||
| 10 | #define U5500_PER1_BASE 0xA0020000 | ||
| 11 | #define U5500_PER2_BASE 0xA0010000 | ||
| 12 | #define U5500_PER3_BASE 0x80140000 | ||
| 13 | #define U5500_PER4_BASE 0x80150000 | ||
| 14 | #define U5500_PER5_BASE 0x80100000 | ||
| 15 | #define U5500_PER6_BASE 0x80120000 | ||
| 16 | |||
| 17 | #define U5500_GIC_DIST_BASE 0xA0411000 | ||
| 18 | #define U5500_GIC_CPU_BASE 0xA0410100 | ||
| 19 | #define U5500_DMA_BASE 0x90030000 | ||
| 20 | #define U5500_MCDE_BASE 0xA0400000 | ||
| 21 | #define U5500_MODEM_BASE 0xB0000000 | ||
| 22 | #define U5500_L2CC_BASE 0xA0412000 | ||
| 23 | #define U5500_SCU_BASE 0xA0410000 | ||
| 24 | #define U5500_DSI1_BASE 0xA0401000 | ||
| 25 | #define U5500_DSI2_BASE 0xA0402000 | ||
| 26 | #define U5500_SIA_BASE 0xA0100000 | ||
| 27 | #define U5500_SVA_BASE 0x80200000 | ||
| 28 | #define U5500_HSEM_BASE 0xA0000000 | ||
| 29 | #define U5500_NAND0_BASE 0x60000000 | ||
| 30 | #define U5500_NAND1_BASE 0x70000000 | ||
| 31 | #define U5500_TWD_BASE 0xa0410600 | ||
| 32 | #define U5500_B2R2_BASE 0xa0200000 | ||
| 33 | |||
| 34 | #define U5500_FSMC_BASE (U5500_PER1_BASE + 0x0000) | ||
| 35 | #define U5500_SDI0_BASE (U5500_PER1_BASE + 0x1000) | ||
| 36 | #define U5500_SDI2_BASE (U5500_PER1_BASE + 0x2000) | ||
| 37 | #define U5500_UART0_BASE (U5500_PER1_BASE + 0x3000) | ||
| 38 | #define U5500_I2C1_BASE (U5500_PER1_BASE + 0x4000) | ||
| 39 | #define U5500_MSP0_BASE (U5500_PER1_BASE + 0x5000) | ||
| 40 | #define U5500_GPIO0_BASE (U5500_PER1_BASE + 0xE000) | ||
| 41 | #define U5500_CLKRST1_BASE (U5500_PER1_BASE + 0xF000) | ||
| 42 | |||
| 43 | #define U5500_USBOTG_BASE (U5500_PER2_BASE + 0x0000) | ||
| 44 | #define U5500_GPIO1_BASE (U5500_PER2_BASE + 0xE000) | ||
| 45 | #define U5500_CLKRST2_BASE (U5500_PER2_BASE + 0xF000) | ||
| 46 | |||
| 47 | #define U5500_KEYPAD_BASE (U5500_PER3_BASE + 0x0000) | ||
| 48 | #define U5500_PWM_BASE (U5500_PER3_BASE + 0x1000) | ||
| 49 | #define U5500_GPIO3_BASE (U5500_PER3_BASE + 0xE000) | ||
| 50 | #define U5500_CLKRST3_BASE (U5500_PER3_BASE + 0xF000) | ||
| 51 | |||
| 52 | #define U5500_BACKUPRAM0_BASE (U5500_PER4_BASE + 0x0000) | ||
| 53 | #define U5500_BACKUPRAM1_BASE (U5500_PER4_BASE + 0x1000) | ||
| 54 | #define U5500_RTT0_BASE (U5500_PER4_BASE + 0x2000) | ||
| 55 | #define U5500_RTT1_BASE (U5500_PER4_BASE + 0x3000) | ||
| 56 | #define U5500_RTC_BASE (U5500_PER4_BASE + 0x4000) | ||
| 57 | #define U5500_SCR_BASE (U5500_PER4_BASE + 0x5000) | ||
| 58 | #define U5500_DMC_BASE (U5500_PER4_BASE + 0x6000) | ||
| 59 | #define U5500_PRCMU_BASE (U5500_PER4_BASE + 0x7000) | ||
| 60 | #define U5500_MSP1_BASE (U5500_PER4_BASE + 0x9000) | ||
| 61 | #define U5500_GPIO2_BASE (U5500_PER4_BASE + 0xA000) | ||
| 62 | #define U5500_CDETECT_BASE (U5500_PER4_BASE + 0xF000) | ||
| 63 | |||
| 64 | #define U5500_SPI0_BASE (U5500_PER5_BASE + 0x0000) | ||
| 65 | #define U5500_SPI1_BASE (U5500_PER5_BASE + 0x1000) | ||
| 66 | #define U5500_SPI2_BASE (U5500_PER5_BASE + 0x2000) | ||
| 67 | #define U5500_SPI3_BASE (U5500_PER5_BASE + 0x3000) | ||
| 68 | #define U5500_UART1_BASE (U5500_PER5_BASE + 0x4000) | ||
| 69 | #define U5500_UART2_BASE (U5500_PER5_BASE + 0x5000) | ||
| 70 | #define U5500_UART3_BASE (U5500_PER5_BASE + 0x6000) | ||
| 71 | #define U5500_SDI1_BASE (U5500_PER5_BASE + 0x7000) | ||
| 72 | #define U5500_SDI3_BASE (U5500_PER5_BASE + 0x8000) | ||
| 73 | #define U5500_SDI4_BASE (U5500_PER5_BASE + 0x9000) | ||
| 74 | #define U5500_I2C2_BASE (U5500_PER5_BASE + 0xA000) | ||
| 75 | #define U5500_I2C3_BASE (U5500_PER5_BASE + 0xB000) | ||
| 76 | #define U5500_MSP2_BASE (U5500_PER5_BASE + 0xC000) | ||
| 77 | #define U5500_IRDA_BASE (U5500_PER5_BASE + 0xD000) | ||
| 78 | #define U5500_IRRC_BASE (U5500_PER5_BASE + 0x10000) | ||
| 79 | #define U5500_GPIO4_BASE (U5500_PER5_BASE + 0x1E000) | ||
| 80 | #define U5500_CLKRST5_BASE (U5500_PER5_BASE + 0x1F000) | ||
| 81 | |||
| 82 | #define U5500_RNG_BASE (U5500_PER6_BASE + 0x0000) | ||
| 83 | #define U5500_HASH0_BASE (U5500_PER6_BASE + 0x1000) | ||
| 84 | #define U5500_HASH1_BASE (U5500_PER6_BASE + 0x2000) | ||
| 85 | #define U5500_PKA_BASE (U5500_PER6_BASE + 0x4000) | ||
| 86 | #define U5500_PKAM_BASE (U5500_PER6_BASE + 0x5000) | ||
| 87 | #define U5500_MTU0_BASE (U5500_PER6_BASE + 0x6000) | ||
| 88 | #define U5500_MTU1_BASE (U5500_PER6_BASE + 0x7000) | ||
| 89 | #define U5500_CR_BASE (U5500_PER6_BASE + 0x8000) | ||
| 90 | #define U5500_CRYP0_BASE (U5500_PER6_BASE + 0xA000) | ||
| 91 | #define U5500_CRYP1_BASE (U5500_PER6_BASE + 0xB000) | ||
| 92 | #define U5500_CLKRST6_BASE (U5500_PER6_BASE + 0xF000) | ||
| 93 | |||
| 94 | #define U5500_GPIOBANK0_BASE U5500_GPIO0_BASE | ||
| 95 | #define U5500_GPIOBANK1_BASE (U5500_GPIO0_BASE + 0x80) | ||
| 96 | #define U5500_GPIOBANK2_BASE U5500_GPIO1_BASE | ||
| 97 | #define U5500_GPIOBANK3_BASE U5500_GPIO2_BASE | ||
| 98 | #define U5500_GPIOBANK4_BASE U5500_GPIO3_BASE | ||
| 99 | #define U5500_GPIOBANK5_BASE U5500_GPIO4_BASE | ||
| 100 | #define U5500_GPIOBANK6_BASE (U5500_GPIO4_BASE + 0x80) | ||
| 101 | #define U5500_GPIOBANK7_BASE (U5500_GPIO4_BASE + 0x100) | ||
| 102 | |||
| 103 | #endif | ||
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/include/mach/db8500-regs.h new file mode 100644 index 000000000000..9169e1e382a3 --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/db8500-regs.h | |||
| @@ -0,0 +1,135 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __MACH_DB8500_REGS_H | ||
| 8 | #define __MACH_DB8500_REGS_H | ||
| 9 | |||
| 10 | #define U8500_PER3_BASE 0x80000000 | ||
| 11 | #define U8500_STM_BASE 0x80100000 | ||
| 12 | #define U8500_STM_REG_BASE (U8500_STM_BASE + 0xF000) | ||
| 13 | #define U8500_PER2_BASE 0x80110000 | ||
| 14 | #define U8500_PER1_BASE 0x80120000 | ||
| 15 | #define U8500_B2R2_BASE 0x80130000 | ||
| 16 | #define U8500_HSEM_BASE 0x80140000 | ||
| 17 | #define U8500_PER4_BASE 0x80150000 | ||
| 18 | #define U8500_ICN_BASE 0x81000000 | ||
| 19 | |||
| 20 | #define U8500_BOOT_ROM_BASE 0x90000000 | ||
| 21 | /* ASIC ID is at 0xff4 offset within this region */ | ||
| 22 | #define U8500_ASIC_ID_BASE 0x9001F000 | ||
| 23 | |||
| 24 | #define U8500_PER6_BASE 0xa03c0000 | ||
| 25 | #define U8500_PER5_BASE 0xa03e0000 | ||
| 26 | #define U8500_PER7_BASE_ED 0xa03d0000 | ||
| 27 | |||
| 28 | #define U8500_SVA_BASE 0xa0100000 | ||
| 29 | #define U8500_SIA_BASE 0xa0200000 | ||
| 30 | |||
| 31 | #define U8500_SGA_BASE 0xa0300000 | ||
| 32 | #define U8500_MCDE_BASE 0xa0350000 | ||
| 33 | #define U8500_DMA_BASE_ED 0xa0362000 | ||
| 34 | #define U8500_DMA_BASE 0x801C0000 /* v1 */ | ||
| 35 | |||
| 36 | #define U8500_SBAG_BASE 0xa0390000 | ||
| 37 | |||
| 38 | #define U8500_SCU_BASE 0xa0410000 | ||
| 39 | #define U8500_GIC_CPU_BASE 0xa0410100 | ||
| 40 | #define U8500_TWD_BASE 0xa0410600 | ||
| 41 | #define U8500_GIC_DIST_BASE 0xa0411000 | ||
| 42 | #define U8500_L2CC_BASE 0xa0412000 | ||
| 43 | |||
| 44 | #define U8500_MODEM_I2C 0xb7e02000 | ||
| 45 | |||
| 46 | #define U8500_GPIO0_BASE (U8500_PER1_BASE + 0xE000) | ||
| 47 | #define U8500_GPIO1_BASE (U8500_PER3_BASE + 0xE000) | ||
| 48 | #define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xE000) | ||
| 49 | #define U8500_GPIO3_BASE (U8500_PER5_BASE + 0x1E000) | ||
| 50 | |||
| 51 | /* per7 base addressess */ | ||
| 52 | #define U8500_CR_BASE_ED (U8500_PER7_BASE_ED + 0x8000) | ||
| 53 | #define U8500_MTU0_BASE_ED (U8500_PER7_BASE_ED + 0xa000) | ||
| 54 | #define U8500_MTU1_BASE_ED (U8500_PER7_BASE_ED + 0xb000) | ||
| 55 | #define U8500_TZPC0_BASE_ED (U8500_PER7_BASE_ED + 0xc000) | ||
| 56 | #define U8500_CLKRST7_BASE_ED (U8500_PER7_BASE_ED + 0xf000) | ||
| 57 | |||
| 58 | #define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000) | ||
| 59 | #define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000) | ||
| 60 | |||
| 61 | /* per6 base addressess */ | ||
| 62 | #define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000) | ||
| 63 | #define U8500_PKA_BASE (U8500_PER6_BASE + 0x1000) | ||
| 64 | #define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000) | ||
| 65 | #define U8500_MTU0_BASE (U8500_PER6_BASE + 0x6000) /* v1 */ | ||
| 66 | #define U8500_MTU1_BASE (U8500_PER6_BASE + 0x7000) /* v1 */ | ||
| 67 | #define U8500_CR_BASE (U8500_PER6_BASE + 0x8000) /* v1 */ | ||
| 68 | #define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000) | ||
| 69 | #define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000) | ||
| 70 | #define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000) | ||
| 71 | |||
| 72 | /* per5 base addressess */ | ||
| 73 | #define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000) | ||
| 74 | #define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000) | ||
| 75 | |||
| 76 | /* per4 base addressess */ | ||
| 77 | #define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x00000) | ||
| 78 | #define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x01000) | ||
| 79 | #define U8500_RTT0_BASE (U8500_PER4_BASE + 0x02000) | ||
| 80 | #define U8500_RTT1_BASE (U8500_PER4_BASE + 0x03000) | ||
| 81 | #define U8500_RTC_BASE (U8500_PER4_BASE + 0x04000) | ||
| 82 | #define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) | ||
| 83 | #define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) | ||
| 84 | #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) | ||
| 85 | #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x0f000) | ||
| 86 | |||
| 87 | /* per3 base addresses */ | ||
| 88 | #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) | ||
| 89 | #define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000) | ||
| 90 | #define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000) | ||
| 91 | #define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000) | ||
| 92 | #define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000) | ||
| 93 | #define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000) | ||
| 94 | #define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000) | ||
| 95 | #define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000) | ||
| 96 | #define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000) | ||
| 97 | |||
| 98 | /* per2 base addressess */ | ||
| 99 | #define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000) | ||
| 100 | #define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000) | ||
| 101 | #define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000) | ||
| 102 | #define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000) | ||
| 103 | #define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000) | ||
| 104 | #define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000) | ||
| 105 | #define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000) | ||
| 106 | #define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000) | ||
| 107 | #define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000) | ||
| 108 | #define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000) | ||
| 109 | #define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000) | ||
| 110 | #define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000) | ||
| 111 | |||
| 112 | /* per1 base addresses */ | ||
| 113 | #define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000) | ||
| 114 | #define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000) | ||
| 115 | #define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000) | ||
| 116 | #define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000) | ||
| 117 | #define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000) | ||
| 118 | #define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000) | ||
| 119 | #define U8500_I2C4_BASE (U8500_PER1_BASE + 0xa000) | ||
| 120 | #define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xb000) | ||
| 121 | #define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000) | ||
| 122 | |||
| 123 | #define U8500_SHRM_GOP_INTERRUPT_BASE 0xB7C00040 | ||
| 124 | |||
| 125 | #define U8500_GPIOBANK0_BASE U8500_GPIO0_BASE | ||
| 126 | #define U8500_GPIOBANK1_BASE (U8500_GPIO0_BASE + 0x80) | ||
| 127 | #define U8500_GPIOBANK2_BASE U8500_GPIO1_BASE | ||
| 128 | #define U8500_GPIOBANK3_BASE (U8500_GPIO1_BASE + 0x80) | ||
| 129 | #define U8500_GPIOBANK4_BASE (U8500_GPIO1_BASE + 0x100) | ||
| 130 | #define U8500_GPIOBANK5_BASE (U8500_GPIO1_BASE + 0x180) | ||
| 131 | #define U8500_GPIOBANK6_BASE U8500_GPIO2_BASE | ||
| 132 | #define U8500_GPIOBANK7_BASE (U8500_GPIO2_BASE + 0x80) | ||
| 133 | #define U8500_GPIOBANK8_BASE U8500_GPIO3_BASE | ||
| 134 | |||
| 135 | #endif | ||
diff --git a/arch/arm/mach-ux500/include/mach/debug-macro.S b/arch/arm/mach-ux500/include/mach/debug-macro.S index 09cbfda8aee5..c5203b7ea552 100644 --- a/arch/arm/mach-ux500/include/mach/debug-macro.S +++ b/arch/arm/mach-ux500/include/mach/debug-macro.S | |||
| @@ -10,11 +10,19 @@ | |||
| 10 | */ | 10 | */ |
| 11 | #include <mach/hardware.h> | 11 | #include <mach/hardware.h> |
| 12 | 12 | ||
| 13 | #if CONFIG_UX500_DEBUG_UART > 2 | ||
| 14 | #error Invalid Ux500 debug UART | ||
| 15 | #endif | ||
| 16 | |||
| 17 | #define __UX500_UART(n) UX500_UART##n##_BASE | ||
| 18 | #define UX500_UART(n) __UX500_UART(n) | ||
| 19 | #define UART_BASE UX500_UART(CONFIG_UX500_DEBUG_UART) | ||
| 20 | |||
| 13 | .macro addruart, rx, tmp | 21 | .macro addruart, rx, tmp |
| 14 | mrc p15, 0, \rx, c1, c0 | 22 | mrc p15, 0, \rx, c1, c0 |
| 15 | tst \rx, #1 @ MMU enabled? | 23 | tst \rx, #1 @ MMU enabled? |
| 16 | ldreq \rx, =U8500_UART2_BASE @ no, physical address | 24 | ldreq \rx, =UART_BASE @ no, physical address |
| 17 | ldrne \rx, =IO_ADDRESS(U8500_UART2_BASE) @ yes, virtual address | 25 | ldrne \rx, =IO_ADDRESS(UART_BASE) @ yes, virtual address |
| 18 | .endm | 26 | .endm |
| 19 | 27 | ||
| 20 | #include <asm/hardware/debug-pl01x.S> | 28 | #include <asm/hardware/debug-pl01x.S> |
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h new file mode 100644 index 000000000000..0422af00a56e --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/devices.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2010 | ||
| 3 | * | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __ASM_ARCH_DEVICES_H__ | ||
| 8 | #define __ASM_ARCH_DEVICES_H__ | ||
| 9 | |||
| 10 | struct platform_device; | ||
| 11 | struct amba_device; | ||
| 12 | |||
| 13 | extern struct platform_device u5500_gpio_devs[]; | ||
| 14 | extern struct platform_device u8500_gpio_devs[]; | ||
| 15 | |||
| 16 | extern struct amba_device ux500_pl031_device; | ||
| 17 | extern struct amba_device u8500_ssp0_device; | ||
| 18 | extern struct amba_device ux500_uart0_device; | ||
| 19 | extern struct amba_device ux500_uart1_device; | ||
| 20 | extern struct amba_device ux500_uart2_device; | ||
| 21 | |||
| 22 | extern struct platform_device ux500_i2c1_device; | ||
| 23 | extern struct platform_device ux500_i2c2_device; | ||
| 24 | extern struct platform_device ux500_i2c3_device; | ||
| 25 | |||
| 26 | extern struct platform_device u8500_i2c0_device; | ||
| 27 | extern struct platform_device u8500_i2c4_device; | ||
| 28 | |||
| 29 | #endif | ||
diff --git a/arch/arm/mach-ux500/include/mach/entry-macro.S b/arch/arm/mach-ux500/include/mach/entry-macro.S index eece3301fef7..60ea88db8283 100644 --- a/arch/arm/mach-ux500/include/mach/entry-macro.S +++ b/arch/arm/mach-ux500/include/mach/entry-macro.S | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | .endm | 17 | .endm |
| 18 | 18 | ||
| 19 | .macro get_irqnr_preamble, base, tmp | 19 | .macro get_irqnr_preamble, base, tmp |
| 20 | ldr \base, =IO_ADDRESS(U8500_GIC_CPU_BASE) | 20 | ldr \base, =IO_ADDRESS(UX500_GIC_CPU_BASE) |
| 21 | .endm | 21 | .endm |
| 22 | 22 | ||
| 23 | .macro arch_ret_to_user, tmp1, tmp2 | 23 | .macro arch_ret_to_user, tmp1, tmp2 |
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h new file mode 100644 index 000000000000..d548a622e7d2 --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/gpio.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | #ifndef __ASM_ARCH_GPIO_H | ||
| 2 | #define __ASM_ARCH_GPIO_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * 288 (#267 is the highest one actually hooked up) onchip GPIOs, plus enough | ||
| 6 | * room for a couple of GPIO expanders. | ||
| 7 | */ | ||
| 8 | #define ARCH_NR_GPIOS 350 | ||
| 9 | |||
| 10 | #include <plat/gpio.h> | ||
| 11 | |||
| 12 | #define __GPIO_RESOURCE(soc, block) \ | ||
| 13 | { \ | ||
| 14 | .start = soc##_GPIOBANK##block##_BASE, \ | ||
| 15 | .end = soc##_GPIOBANK##block##_BASE + 127, \ | ||
| 16 | .flags = IORESOURCE_MEM, \ | ||
| 17 | }, \ | ||
| 18 | { \ | ||
| 19 | .start = IRQ_GPIO##block, \ | ||
| 20 | .end = IRQ_GPIO##block, \ | ||
| 21 | .flags = IORESOURCE_IRQ, \ | ||
| 22 | } | ||
| 23 | |||
| 24 | #define __GPIO_DEVICE(soc, block) \ | ||
| 25 | { \ | ||
| 26 | .name = "gpio", \ | ||
| 27 | .id = block, \ | ||
| 28 | .num_resources = 2, \ | ||
| 29 | .resource = &soc##_gpio_resources[block * 2], \ | ||
| 30 | .dev = { \ | ||
| 31 | .platform_data = &soc##_gpio_data[block], \ | ||
| 32 | }, \ | ||
| 33 | } | ||
| 34 | |||
| 35 | #define GPIO_DATA(_name, first) \ | ||
| 36 | { \ | ||
| 37 | .name = _name, \ | ||
| 38 | .first_gpio = first, \ | ||
| 39 | .first_irq = NOMADIK_GPIO_TO_IRQ(first), \ | ||
| 40 | } | ||
| 41 | |||
| 42 | #ifdef CONFIG_UX500_SOC_DB8500 | ||
| 43 | #define GPIO_RESOURCE(block) __GPIO_RESOURCE(U8500, block) | ||
| 44 | #define GPIO_DEVICE(block) __GPIO_DEVICE(u8500, block) | ||
| 45 | #elif defined(CONFIG_UX500_SOC_DB5500) | ||
| 46 | #define GPIO_RESOURCE(block) __GPIO_RESOURCE(U5500, block) | ||
| 47 | #define GPIO_DEVICE(block) __GPIO_DEVICE(u5500, block) | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #endif /* __ASM_ARCH_GPIO_H */ | ||
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h index 04ea836969b3..8656379a8309 100644 --- a/arch/arm/mach-ux500/include/mach/hardware.h +++ b/arch/arm/mach-ux500/include/mach/hardware.h | |||
| @@ -23,109 +23,106 @@ | |||
| 23 | 23 | ||
| 24 | /* typesafe io address */ | 24 | /* typesafe io address */ |
| 25 | #define __io_address(n) __io(IO_ADDRESS(n)) | 25 | #define __io_address(n) __io(IO_ADDRESS(n)) |
| 26 | /* used by some plat-nomadik code */ | ||
| 27 | #define io_p2v(n) __io_address(n) | ||
| 26 | 28 | ||
| 27 | /* | 29 | #include <mach/db8500-regs.h> |
| 28 | * Base address definitions for U8500 Onchip IPs. All the | 30 | #include <mach/db5500-regs.h> |
| 29 | * peripherals are contained in a single 1 Mbyte region, with | 31 | |
| 30 | * AHB peripherals at the bottom and APB peripherals at the | 32 | #ifdef CONFIG_UX500_SOC_DB8500 |
| 31 | * top of the region. PER stands for PERIPHERAL region which | 33 | #define UX500(periph) U8500_##periph##_BASE |
| 32 | * itself divided into sub regions. | 34 | #elif defined(CONFIG_UX500_SOC_DB5500) |
| 33 | */ | 35 | #define UX500(periph) U5500_##periph##_BASE |
| 34 | #define U8500_PER3_BASE 0x80000000 | 36 | #endif |
| 35 | #define U8500_PER2_BASE 0x80110000 | 37 | |
| 36 | #define U8500_PER1_BASE 0x80120000 | 38 | #define UX500_BACKUPRAM0_BASE UX500(BACKUPRAM0) |
| 37 | #define U8500_PER4_BASE 0x80150000 | 39 | #define UX500_BACKUPRAM1_BASE UX500(BACKUPRAM1) |
| 38 | 40 | #define UX500_B2R2_BASE UX500(B2R2) | |
| 39 | #define U8500_PER6_BASE 0xa03c0000 | 41 | |
| 40 | #define U8500_PER5_BASE 0xa03e0000 | 42 | #define UX500_CLKRST1_BASE UX500(CLKRST1) |
| 41 | #define U8500_PER7_BASE 0xa03d0000 | 43 | #define UX500_CLKRST2_BASE UX500(CLKRST2) |
| 42 | 44 | #define UX500_CLKRST3_BASE UX500(CLKRST3) | |
| 43 | #define U8500_SVA_BASE 0xa0100000 | 45 | #define UX500_CLKRST5_BASE UX500(CLKRST5) |
| 44 | #define U8500_SIA_BASE 0xa0200000 | 46 | #define UX500_CLKRST6_BASE UX500(CLKRST6) |
| 45 | 47 | ||
| 46 | #define U8500_SGA_BASE 0xa0300000 | 48 | #define UX500_DMA_BASE UX500(DMA) |
| 47 | #define U8500_MCDE_BASE 0xa0350000 | 49 | #define UX500_FSMC_BASE UX500(FSMC) |
| 48 | #define U8500_DMA_BASE 0xa0362000 | 50 | |
| 49 | 51 | #define UX500_GIC_CPU_BASE UX500(GIC_CPU) | |
| 50 | #define U8500_SCU_BASE 0xa0410000 | 52 | #define UX500_GIC_DIST_BASE UX500(GIC_DIST) |
| 51 | #define U8500_GIC_CPU_BASE 0xa0410100 | 53 | |
| 52 | #define U8500_TWD_BASE 0xa0410600 | 54 | #define UX500_I2C1_BASE UX500(I2C1) |
| 53 | #define U8500_GIC_DIST_BASE 0xa0411000 | 55 | #define UX500_I2C2_BASE UX500(I2C2) |
| 54 | #define U8500_L2CC_BASE 0xa0412000 | 56 | #define UX500_I2C3_BASE UX500(I2C3) |
| 55 | 57 | ||
| 56 | #define U8500_TWD_SIZE 0x100 | 58 | #define UX500_L2CC_BASE UX500(L2CC) |
| 57 | 59 | #define UX500_MCDE_BASE UX500(MCDE) | |
| 58 | /* per7 base addressess */ | 60 | #define UX500_MTU0_BASE UX500(MTU0) |
| 59 | #define U8500_CR_BASE (U8500_PER7_BASE + 0x8000) | 61 | #define UX500_MTU1_BASE UX500(MTU1) |
| 60 | #define U8500_MTU0_BASE (U8500_PER7_BASE + 0xa000) | 62 | #define UX500_PRCMU_BASE UX500(PRCMU) |
| 61 | #define U8500_MTU1_BASE (U8500_PER7_BASE + 0xb000) | 63 | |
| 62 | #define U8500_TZPC0_BASE (U8500_PER7_BASE + 0xc000) | 64 | #define UX500_RNG_BASE UX500(RNG) |
| 63 | #define U8500_CLKRST7_BASE (U8500_PER7_BASE + 0xf000) | 65 | #define UX500_RTC_BASE UX500(RTC) |
| 64 | 66 | ||
| 65 | /* per6 base addressess */ | 67 | #define UX500_SCU_BASE UX500(SCU) |
| 66 | #define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000) | 68 | |
| 67 | #define U8500_PKA_BASE (U8500_PER6_BASE + 0x1000) | 69 | #define UX500_SDI0_BASE UX500(SDI0) |
| 68 | #define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000) | 70 | #define UX500_SDI1_BASE UX500(SDI1) |
| 69 | #define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000) | 71 | #define UX500_SDI2_BASE UX500(SDI2) |
| 70 | #define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000) | 72 | #define UX500_SDI3_BASE UX500(SDI3) |
| 71 | #define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000) | 73 | #define UX500_SDI4_BASE UX500(SDI4) |
| 72 | 74 | ||
| 73 | /* per5 base addressess */ | 75 | #define UX500_SPI0_BASE UX500(SPI0) |
| 74 | #define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000) | 76 | #define UX500_SPI1_BASE UX500(SPI1) |
| 75 | #define U8500_GPIO5_BASE (U8500_PER5_BASE + 0x1e000) | 77 | #define UX500_SPI2_BASE UX500(SPI2) |
| 76 | #define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000) | 78 | #define UX500_SPI3_BASE UX500(SPI3) |
| 77 | 79 | ||
| 78 | /* per4 base addressess */ | 80 | #define UX500_SIA_BASE UX500(SIA) |
| 79 | #define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x0000) | 81 | #define UX500_SVA_BASE UX500(SVA) |
| 80 | #define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x1000) | 82 | |
| 81 | #define U8500_RTT0_BASE (U8500_PER4_BASE + 0x2000) | 83 | #define UX500_TWD_BASE UX500(TWD) |
| 82 | #define U8500_RTT1_BASE (U8500_PER4_BASE + 0x3000) | 84 | |
| 83 | #define U8500_RTC_BASE (U8500_PER4_BASE + 0x4000) | 85 | #define UX500_UART0_BASE UX500(UART0) |
| 84 | #define U8500_SCR_BASE (U8500_PER4_BASE + 0x5000) | 86 | #define UX500_UART1_BASE UX500(UART1) |
| 85 | #define U8500_DMC_BASE (U8500_PER4_BASE + 0x6000) | 87 | #define UX500_UART2_BASE UX500(UART2) |
| 86 | #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x7000) | 88 | |
| 87 | 89 | #define UX500_USBOTG_BASE UX500(USBOTG) | |
| 88 | /* per3 base addressess */ | ||
| 89 | #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) | ||
| 90 | #define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000) | ||
| 91 | #define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000) | ||
| 92 | #define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000) | ||
| 93 | #define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000) | ||
| 94 | #define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000) | ||
| 95 | #define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000) | ||
| 96 | #define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000) | ||
| 97 | #define U8500_GPIO3_BASE (U8500_PER3_BASE + 0xe000) | ||
| 98 | #define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000) | ||
| 99 | |||
| 100 | /* per2 base addressess */ | ||
| 101 | #define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000) | ||
| 102 | #define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000) | ||
| 103 | #define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000) | ||
| 104 | #define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000) | ||
| 105 | #define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000) | ||
| 106 | #define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000) | ||
| 107 | #define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000) | ||
| 108 | #define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000) | ||
| 109 | #define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000) | ||
| 110 | #define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000) | ||
| 111 | #define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000) | ||
| 112 | #define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xe000) | ||
| 113 | #define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000) | ||
| 114 | |||
| 115 | /* per1 base addresses */ | ||
| 116 | #define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000) | ||
| 117 | #define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000) | ||
| 118 | #define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000) | ||
| 119 | #define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000) | ||
| 120 | #define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000) | ||
| 121 | #define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000) | ||
| 122 | #define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000) | ||
| 123 | #define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000) | ||
| 124 | #define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xa000) | ||
| 125 | #define U8500_GPIO1_BASE (U8500_PER1_BASE + 0xe000) | ||
| 126 | #define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000) | ||
| 127 | 90 | ||
| 128 | /* ST-Ericsson modified pl022 id */ | 91 | /* ST-Ericsson modified pl022 id */ |
| 129 | #define SSP_PER_ID 0x01080022 | 92 | #define SSP_PER_ID 0x01080022 |
| 130 | 93 | ||
| 94 | #ifndef __ASSEMBLY__ | ||
| 95 | |||
| 96 | #include <asm/cputype.h> | ||
| 97 | |||
| 98 | static inline bool cpu_is_u8500(void) | ||
| 99 | { | ||
| 100 | #ifdef CONFIG_UX500_SOC_DB8500 | ||
| 101 | return 1; | ||
| 102 | #else | ||
| 103 | return 0; | ||
| 104 | #endif | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline bool cpu_is_u8500ed(void) | ||
| 108 | { | ||
| 109 | return cpu_is_u8500() && (read_cpuid_id() & 15) == 0; | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline bool cpu_is_u8500v1(void) | ||
| 113 | { | ||
| 114 | return cpu_is_u8500() && (read_cpuid_id() & 15) == 1; | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline bool cpu_is_u5500(void) | ||
| 118 | { | ||
| 119 | #ifdef CONFIG_UX500_SOC_DB5500 | ||
| 120 | return 1; | ||
| 121 | #else | ||
| 122 | return 0; | ||
| 123 | #endif | ||
| 124 | } | ||
| 125 | |||
| 126 | #endif | ||
| 127 | |||
| 131 | #endif /* __MACH_HARDWARE_H */ | 128 | #endif /* __MACH_HARDWARE_H */ |
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h index 394b5dd2200f..7970684b1d09 100644 --- a/arch/arm/mach-ux500/include/mach/irqs.h +++ b/arch/arm/mach-ux500/include/mach/irqs.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #define IRQ_AB4500 (IRQ_SHPI_START + 40) | 42 | #define IRQ_AB4500 (IRQ_SHPI_START + 40) |
| 43 | #define IRQ_DISP (IRQ_SHPI_START + 48) | 43 | #define IRQ_DISP (IRQ_SHPI_START + 48) |
| 44 | #define IRQ_SiPI3 (IRQ_SHPI_START + 49) | 44 | #define IRQ_SiPI3 (IRQ_SHPI_START + 49) |
| 45 | #define IRQ_I2C4 (IRQ_SHPI_START + 51) | ||
| 45 | #define IRQ_SSP1 (IRQ_SHPI_START + 52) | 46 | #define IRQ_SSP1 (IRQ_SHPI_START + 52) |
| 46 | #define IRQ_I2C2 (IRQ_SHPI_START + 55) | 47 | #define IRQ_I2C2 (IRQ_SHPI_START + 55) |
| 47 | #define IRQ_SDMMC0 (IRQ_SHPI_START + 60) | 48 | #define IRQ_SDMMC0 (IRQ_SHPI_START + 60) |
| @@ -66,6 +67,12 @@ | |||
| 66 | /* There are 128 shared peripheral interrupts assigned to | 67 | /* There are 128 shared peripheral interrupts assigned to |
| 67 | * INTID[160:32]. The first 32 interrupts are reserved. | 68 | * INTID[160:32]. The first 32 interrupts are reserved. |
| 68 | */ | 69 | */ |
| 69 | #define NR_IRQS 161 | 70 | #define U8500_SOC_NR_IRQS 161 |
| 71 | |||
| 72 | /* After chip-specific IRQ numbers we have the GPIO ones */ | ||
| 73 | #define NOMADIK_NR_GPIO 288 | ||
| 74 | #define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + U8500_SOC_NR_IRQS) | ||
| 75 | #define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - U8500_SOC_NR_IRQS) | ||
| 76 | #define NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) | ||
| 70 | 77 | ||
| 71 | #endif /*ASM_ARCH_IRQS_H*/ | 78 | #endif /*ASM_ARCH_IRQS_H*/ |
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h index cf0ce1687f24..e978dbd9e210 100644 --- a/arch/arm/mach-ux500/include/mach/setup.h +++ b/arch/arm/mach-ux500/include/mach/setup.h | |||
| @@ -14,10 +14,28 @@ | |||
| 14 | #include <asm/mach/time.h> | 14 | #include <asm/mach/time.h> |
| 15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 16 | 16 | ||
| 17 | extern void u8500_map_io(void); | 17 | extern void __init ux500_map_io(void); |
| 18 | extern void u8500_init_devices(void); | 18 | extern void __init u5500_map_io(void); |
| 19 | extern void u8500_init_irq(void); | 19 | extern void __init u8500_map_io(void); |
| 20 | |||
| 21 | extern void __init ux500_init_devices(void); | ||
| 22 | extern void __init u5500_init_devices(void); | ||
| 23 | extern void __init u8500_init_devices(void); | ||
| 24 | |||
| 25 | extern void __init ux500_init_irq(void); | ||
| 20 | /* We re-use nomadik_timer for this platform */ | 26 | /* We re-use nomadik_timer for this platform */ |
| 21 | extern void nmdk_timer_init(void); | 27 | extern void nmdk_timer_init(void); |
| 22 | 28 | ||
| 29 | extern void __init amba_add_devices(struct amba_device *devs[], int num); | ||
| 30 | |||
| 31 | struct sys_timer; | ||
| 32 | extern struct sys_timer ux500_timer; | ||
| 33 | |||
| 34 | #define __IO_DEV_DESC(x, sz) { \ | ||
| 35 | .virtual = IO_ADDRESS(x), \ | ||
| 36 | .pfn = __phys_to_pfn(x), \ | ||
| 37 | .length = sz, \ | ||
| 38 | .type = MT_DEVICE, \ | ||
| 39 | } | ||
| 40 | |||
| 23 | #endif /* __ASM_ARCH_SETUP_H */ | 41 | #endif /* __ASM_ARCH_SETUP_H */ |
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index 8dfe7ca245d8..438ef16aec90 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c | |||
| @@ -30,7 +30,7 @@ volatile int __cpuinitdata pen_release = -1; | |||
| 30 | 30 | ||
| 31 | static unsigned int __init get_core_count(void) | 31 | static unsigned int __init get_core_count(void) |
| 32 | { | 32 | { |
| 33 | return scu_get_core_count(__io_address(U8500_SCU_BASE)); | 33 | return scu_get_core_count(__io_address(UX500_SCU_BASE)); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | static DEFINE_SPINLOCK(boot_lock); | 36 | static DEFINE_SPINLOCK(boot_lock); |
| @@ -44,7 +44,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
| 44 | * core (e.g. timer irq), then they will not have been enabled | 44 | * core (e.g. timer irq), then they will not have been enabled |
| 45 | * for us: do so | 45 | * for us: do so |
| 46 | */ | 46 | */ |
| 47 | gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE)); | 47 | gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE)); |
| 48 | 48 | ||
| 49 | /* | 49 | /* |
| 50 | * let the primary processor know we're out of the | 50 | * let the primary processor know we're out of the |
| @@ -75,7 +75,8 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 75 | * that it has been released by resetting pen_release. | 75 | * that it has been released by resetting pen_release. |
| 76 | */ | 76 | */ |
| 77 | pen_release = cpu; | 77 | pen_release = cpu; |
| 78 | flush_cache_all(); | 78 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); |
| 79 | outer_clean_range(__pa(&pen_release), __pa(&pen_release) + 1); | ||
| 79 | 80 | ||
| 80 | timeout = jiffies + (1 * HZ); | 81 | timeout = jiffies + (1 * HZ); |
| 81 | while (time_before(jiffies, timeout)) { | 82 | while (time_before(jiffies, timeout)) { |
| @@ -105,12 +106,12 @@ static void __init wakeup_secondary(void) | |||
| 105 | */ | 106 | */ |
| 106 | #define U8500_CPU1_JUMPADDR_OFFSET 0x1FF4 | 107 | #define U8500_CPU1_JUMPADDR_OFFSET 0x1FF4 |
| 107 | __raw_writel(virt_to_phys(u8500_secondary_startup), | 108 | __raw_writel(virt_to_phys(u8500_secondary_startup), |
| 108 | (void __iomem *)IO_ADDRESS(U8500_BACKUPRAM0_BASE) + | 109 | __io_address(UX500_BACKUPRAM0_BASE) + |
| 109 | U8500_CPU1_JUMPADDR_OFFSET); | 110 | U8500_CPU1_JUMPADDR_OFFSET); |
| 110 | 111 | ||
| 111 | #define U8500_CPU1_WAKEMAGIC_OFFSET 0x1FF0 | 112 | #define U8500_CPU1_WAKEMAGIC_OFFSET 0x1FF0 |
| 112 | __raw_writel(0xA1FEED01, | 113 | __raw_writel(0xA1FEED01, |
| 113 | (void __iomem *)IO_ADDRESS(U8500_BACKUPRAM0_BASE) + | 114 | __io_address(UX500_BACKUPRAM0_BASE) + |
| 114 | U8500_CPU1_WAKEMAGIC_OFFSET); | 115 | U8500_CPU1_WAKEMAGIC_OFFSET); |
| 115 | 116 | ||
| 116 | /* make sure write buffer is drained */ | 117 | /* make sure write buffer is drained */ |
| @@ -171,7 +172,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 171 | * boot CPU, but only if we have more than one CPU. | 172 | * boot CPU, but only if we have more than one CPU. |
| 172 | */ | 173 | */ |
| 173 | percpu_timer_setup(); | 174 | percpu_timer_setup(); |
| 174 | scu_enable(__io_address(U8500_SCU_BASE)); | 175 | scu_enable(__io_address(UX500_SCU_BASE)); |
| 175 | wakeup_secondary(); | 176 | wakeup_secondary(); |
| 176 | } | 177 | } |
| 177 | } | 178 | } |
diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile index ba81e70ed813..97cf4d831b0c 100644 --- a/arch/arm/mach-versatile/Makefile +++ b/arch/arm/mach-versatile/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := core.o clock.o | 5 | obj-y := core.o |
| 6 | obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o | 6 | obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o |
| 7 | obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o | 7 | obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o |
| 8 | obj-$(CONFIG_PCI) += pci.o | 8 | obj-$(CONFIG_PCI) += pci.o |
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c deleted file mode 100644 index c50a44ea7ee6..000000000000 --- a/arch/arm/mach-versatile/clock.c +++ /dev/null | |||
| @@ -1,65 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-versatile/clock.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2004 ARM Limited. | ||
| 5 | * Written by Deep Blue Solutions Limited. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | #include <linux/module.h> | ||
| 12 | #include <linux/kernel.h> | ||
| 13 | #include <linux/device.h> | ||
| 14 | #include <linux/list.h> | ||
| 15 | #include <linux/errno.h> | ||
| 16 | #include <linux/err.h> | ||
| 17 | #include <linux/string.h> | ||
| 18 | #include <linux/clk.h> | ||
| 19 | #include <linux/mutex.h> | ||
| 20 | |||
| 21 | #include <asm/clkdev.h> | ||
| 22 | #include <asm/hardware/icst307.h> | ||
| 23 | |||
| 24 | #include "clock.h" | ||
| 25 | |||
| 26 | int clk_enable(struct clk *clk) | ||
| 27 | { | ||
| 28 | return 0; | ||
| 29 | } | ||
| 30 | EXPORT_SYMBOL(clk_enable); | ||
| 31 | |||
| 32 | void clk_disable(struct clk *clk) | ||
| 33 | { | ||
| 34 | } | ||
| 35 | EXPORT_SYMBOL(clk_disable); | ||
| 36 | |||
| 37 | unsigned long clk_get_rate(struct clk *clk) | ||
| 38 | { | ||
| 39 | return clk->rate; | ||
| 40 | } | ||
| 41 | EXPORT_SYMBOL(clk_get_rate); | ||
| 42 | |||
| 43 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
| 44 | { | ||
| 45 | struct icst307_vco vco; | ||
| 46 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
| 47 | return icst307_khz(clk->params, vco) * 1000; | ||
| 48 | } | ||
| 49 | EXPORT_SYMBOL(clk_round_rate); | ||
| 50 | |||
| 51 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
| 52 | { | ||
| 53 | int ret = -EIO; | ||
| 54 | |||
| 55 | if (clk->setvco) { | ||
| 56 | struct icst307_vco vco; | ||
| 57 | |||
| 58 | vco = icst307_khz_to_vco(clk->params, rate / 1000); | ||
| 59 | clk->rate = icst307_khz(clk->params, vco) * 1000; | ||
| 60 | clk->setvco(clk, vco); | ||
| 61 | ret = 0; | ||
| 62 | } | ||
| 63 | return ret; | ||
| 64 | } | ||
| 65 | EXPORT_SYMBOL(clk_set_rate); | ||
diff --git a/arch/arm/mach-versatile/clock.h b/arch/arm/mach-versatile/clock.h deleted file mode 100644 index 03468fdc3e58..000000000000 --- a/arch/arm/mach-versatile/clock.h +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-versatile/clock.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2004 ARM Limited. | ||
| 5 | * Written by Deep Blue Solutions Limited. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | struct module; | ||
| 12 | struct icst307_params; | ||
| 13 | |||
| 14 | struct clk { | ||
| 15 | unsigned long rate; | ||
| 16 | const struct icst307_params *params; | ||
| 17 | u32 oscoff; | ||
| 18 | void *data; | ||
| 19 | void (*setvco)(struct clk *, struct icst307_vco vco); | ||
| 20 | }; | ||
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 3b1a4ee01815..3dff8641b03f 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
| @@ -28,19 +28,15 @@ | |||
| 28 | #include <linux/amba/clcd.h> | 28 | #include <linux/amba/clcd.h> |
| 29 | #include <linux/amba/pl061.h> | 29 | #include <linux/amba/pl061.h> |
| 30 | #include <linux/amba/mmci.h> | 30 | #include <linux/amba/mmci.h> |
| 31 | #include <linux/clocksource.h> | ||
| 32 | #include <linux/clockchips.h> | ||
| 33 | #include <linux/cnt32_to_63.h> | ||
| 34 | #include <linux/io.h> | 31 | #include <linux/io.h> |
| 35 | #include <linux/gfp.h> | 32 | #include <linux/gfp.h> |
| 36 | 33 | ||
| 37 | #include <asm/clkdev.h> | 34 | #include <asm/clkdev.h> |
| 38 | #include <asm/system.h> | 35 | #include <asm/system.h> |
| 39 | #include <mach/hardware.h> | ||
| 40 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
| 41 | #include <asm/leds.h> | 37 | #include <asm/leds.h> |
| 42 | #include <asm/hardware/arm_timer.h> | 38 | #include <asm/hardware/arm_timer.h> |
| 43 | #include <asm/hardware/icst307.h> | 39 | #include <asm/hardware/icst.h> |
| 44 | #include <asm/hardware/vic.h> | 40 | #include <asm/hardware/vic.h> |
| 45 | #include <asm/mach-types.h> | 41 | #include <asm/mach-types.h> |
| 46 | 42 | ||
| @@ -49,9 +45,12 @@ | |||
| 49 | #include <asm/mach/irq.h> | 45 | #include <asm/mach/irq.h> |
| 50 | #include <asm/mach/time.h> | 46 | #include <asm/mach/time.h> |
| 51 | #include <asm/mach/map.h> | 47 | #include <asm/mach/map.h> |
| 48 | #include <mach/clkdev.h> | ||
| 49 | #include <mach/hardware.h> | ||
| 50 | #include <mach/platform.h> | ||
| 51 | #include <plat/timer-sp.h> | ||
| 52 | 52 | ||
| 53 | #include "core.h" | 53 | #include "core.h" |
| 54 | #include "clock.h" | ||
| 55 | 54 | ||
| 56 | /* | 55 | /* |
| 57 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx | 56 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx |
| @@ -59,7 +58,6 @@ | |||
| 59 | * | 58 | * |
| 60 | * Setup a VA for the Versatile Vectored Interrupt Controller. | 59 | * Setup a VA for the Versatile Vectored Interrupt Controller. |
| 61 | */ | 60 | */ |
| 62 | #define __io_address(n) __io(IO_ADDRESS(n)) | ||
| 63 | #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) | 61 | #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) |
| 64 | #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) | 62 | #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) |
| 65 | 63 | ||
| @@ -229,27 +227,6 @@ void __init versatile_map_io(void) | |||
| 229 | iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); | 227 | iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); |
| 230 | } | 228 | } |
| 231 | 229 | ||
| 232 | #define VERSATILE_REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET) | ||
| 233 | |||
| 234 | /* | ||
| 235 | * This is the Versatile sched_clock implementation. This has | ||
| 236 | * a resolution of 41.7ns, and a maximum value of about 35583 days. | ||
| 237 | * | ||
| 238 | * The return value is guaranteed to be monotonic in that range as | ||
| 239 | * long as there is always less than 89 seconds between successive | ||
| 240 | * calls to this function. | ||
| 241 | */ | ||
| 242 | unsigned long long sched_clock(void) | ||
| 243 | { | ||
| 244 | unsigned long long v = cnt32_to_63(readl(VERSATILE_REFCOUNTER)); | ||
| 245 | |||
| 246 | /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */ | ||
| 247 | v *= 125<<1; | ||
| 248 | do_div(v, 3<<1); | ||
| 249 | |||
| 250 | return v; | ||
| 251 | } | ||
| 252 | |||
| 253 | 230 | ||
| 254 | #define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) | 231 | #define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) |
| 255 | 232 | ||
| @@ -380,33 +357,40 @@ static struct mmci_platform_data mmc0_plat_data = { | |||
| 380 | /* | 357 | /* |
| 381 | * Clock handling | 358 | * Clock handling |
| 382 | */ | 359 | */ |
| 383 | static const struct icst307_params versatile_oscvco_params = { | 360 | static const struct icst_params versatile_oscvco_params = { |
| 384 | .ref = 24000, | 361 | .ref = 24000000, |
| 385 | .vco_max = 200000, | 362 | .vco_max = ICST307_VCO_MAX, |
| 363 | .vco_min = ICST307_VCO_MIN, | ||
| 386 | .vd_min = 4 + 8, | 364 | .vd_min = 4 + 8, |
| 387 | .vd_max = 511 + 8, | 365 | .vd_max = 511 + 8, |
| 388 | .rd_min = 1 + 2, | 366 | .rd_min = 1 + 2, |
| 389 | .rd_max = 127 + 2, | 367 | .rd_max = 127 + 2, |
| 368 | .s2div = icst307_s2div, | ||
| 369 | .idx2s = icst307_idx2s, | ||
| 390 | }; | 370 | }; |
| 391 | 371 | ||
| 392 | static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) | 372 | static void versatile_oscvco_set(struct clk *clk, struct icst_vco vco) |
| 393 | { | 373 | { |
| 394 | void __iomem *sys = __io_address(VERSATILE_SYS_BASE); | 374 | void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; |
| 395 | void __iomem *sys_lock = sys + VERSATILE_SYS_LOCK_OFFSET; | ||
| 396 | u32 val; | 375 | u32 val; |
| 397 | 376 | ||
| 398 | val = readl(sys + clk->oscoff) & ~0x7ffff; | 377 | val = readl(clk->vcoreg) & ~0x7ffff; |
| 399 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 378 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
| 400 | 379 | ||
| 401 | writel(0xa05f, sys_lock); | 380 | writel(0xa05f, sys_lock); |
| 402 | writel(val, sys + clk->oscoff); | 381 | writel(val, clk->vcoreg); |
| 403 | writel(0, sys_lock); | 382 | writel(0, sys_lock); |
| 404 | } | 383 | } |
| 405 | 384 | ||
| 385 | static const struct clk_ops osc4_clk_ops = { | ||
| 386 | .round = icst_clk_round, | ||
| 387 | .set = icst_clk_set, | ||
| 388 | .setvco = versatile_oscvco_set, | ||
| 389 | }; | ||
| 390 | |||
| 406 | static struct clk osc4_clk = { | 391 | static struct clk osc4_clk = { |
| 392 | .ops = &osc4_clk_ops, | ||
| 407 | .params = &versatile_oscvco_params, | 393 | .params = &versatile_oscvco_params, |
| 408 | .oscoff = VERSATILE_SYS_OSCCLCD_OFFSET, | ||
| 409 | .setvco = versatile_oscvco_set, | ||
| 410 | }; | 394 | }; |
| 411 | 395 | ||
| 412 | /* | 396 | /* |
| @@ -852,6 +836,8 @@ void __init versatile_init(void) | |||
| 852 | { | 836 | { |
| 853 | int i; | 837 | int i; |
| 854 | 838 | ||
| 839 | osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET; | ||
| 840 | |||
| 855 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 841 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 856 | 842 | ||
| 857 | platform_device_register(&versatile_flash_device); | 843 | platform_device_register(&versatile_flash_device); |
| @@ -875,120 +861,6 @@ void __init versatile_init(void) | |||
| 875 | #define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20) | 861 | #define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20) |
| 876 | #define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE) | 862 | #define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE) |
| 877 | #define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20) | 863 | #define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20) |
| 878 | #define VA_IC_BASE __io_address(VERSATILE_VIC_BASE) | ||
| 879 | |||
| 880 | /* | ||
| 881 | * How long is the timer interval? | ||
| 882 | */ | ||
| 883 | #define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) | ||
| 884 | #if TIMER_INTERVAL >= 0x100000 | ||
| 885 | #define TIMER_RELOAD (TIMER_INTERVAL >> 8) | ||
| 886 | #define TIMER_DIVISOR (TIMER_CTRL_DIV256) | ||
| 887 | #define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) | ||
| 888 | #elif TIMER_INTERVAL >= 0x10000 | ||
| 889 | #define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */ | ||
| 890 | #define TIMER_DIVISOR (TIMER_CTRL_DIV16) | ||
| 891 | #define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) | ||
| 892 | #else | ||
| 893 | #define TIMER_RELOAD (TIMER_INTERVAL) | ||
| 894 | #define TIMER_DIVISOR (TIMER_CTRL_DIV1) | ||
| 895 | #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) | ||
| 896 | #endif | ||
| 897 | |||
| 898 | static void timer_set_mode(enum clock_event_mode mode, | ||
| 899 | struct clock_event_device *clk) | ||
| 900 | { | ||
| 901 | unsigned long ctrl; | ||
| 902 | |||
| 903 | switch(mode) { | ||
| 904 | case CLOCK_EVT_MODE_PERIODIC: | ||
| 905 | writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD); | ||
| 906 | |||
| 907 | ctrl = TIMER_CTRL_PERIODIC; | ||
| 908 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE; | ||
| 909 | break; | ||
| 910 | case CLOCK_EVT_MODE_ONESHOT: | ||
| 911 | /* period set, and timer enabled in 'next_event' hook */ | ||
| 912 | ctrl = TIMER_CTRL_ONESHOT; | ||
| 913 | ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE; | ||
| 914 | break; | ||
| 915 | case CLOCK_EVT_MODE_UNUSED: | ||
| 916 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
| 917 | default: | ||
| 918 | ctrl = 0; | ||
| 919 | } | ||
| 920 | |||
| 921 | writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL); | ||
| 922 | } | ||
| 923 | |||
| 924 | static int timer_set_next_event(unsigned long evt, | ||
| 925 | struct clock_event_device *unused) | ||
| 926 | { | ||
| 927 | unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL); | ||
| 928 | |||
| 929 | writel(evt, TIMER0_VA_BASE + TIMER_LOAD); | ||
| 930 | writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL); | ||
| 931 | |||
| 932 | return 0; | ||
| 933 | } | ||
| 934 | |||
| 935 | static struct clock_event_device timer0_clockevent = { | ||
| 936 | .name = "timer0", | ||
| 937 | .shift = 32, | ||
| 938 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
| 939 | .set_mode = timer_set_mode, | ||
| 940 | .set_next_event = timer_set_next_event, | ||
| 941 | }; | ||
| 942 | |||
| 943 | /* | ||
| 944 | * IRQ handler for the timer | ||
| 945 | */ | ||
| 946 | static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id) | ||
| 947 | { | ||
| 948 | struct clock_event_device *evt = &timer0_clockevent; | ||
| 949 | |||
| 950 | writel(1, TIMER0_VA_BASE + TIMER_INTCLR); | ||
| 951 | |||
| 952 | evt->event_handler(evt); | ||
| 953 | |||
| 954 | return IRQ_HANDLED; | ||
| 955 | } | ||
| 956 | |||
| 957 | static struct irqaction versatile_timer_irq = { | ||
| 958 | .name = "Versatile Timer Tick", | ||
| 959 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
| 960 | .handler = versatile_timer_interrupt, | ||
| 961 | }; | ||
| 962 | |||
| 963 | static cycle_t versatile_get_cycles(struct clocksource *cs) | ||
| 964 | { | ||
| 965 | return ~readl(TIMER3_VA_BASE + TIMER_VALUE); | ||
| 966 | } | ||
| 967 | |||
| 968 | static struct clocksource clocksource_versatile = { | ||
| 969 | .name = "timer3", | ||
| 970 | .rating = 200, | ||
| 971 | .read = versatile_get_cycles, | ||
| 972 | .mask = CLOCKSOURCE_MASK(32), | ||
| 973 | .shift = 20, | ||
| 974 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
| 975 | }; | ||
| 976 | |||
| 977 | static int __init versatile_clocksource_init(void) | ||
| 978 | { | ||
| 979 | /* setup timer3 as free-running clocksource */ | ||
| 980 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); | ||
| 981 | writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD); | ||
| 982 | writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE); | ||
| 983 | writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, | ||
| 984 | TIMER3_VA_BASE + TIMER_CTRL); | ||
| 985 | |||
| 986 | clocksource_versatile.mult = | ||
| 987 | clocksource_khz2mult(1000, clocksource_versatile.shift); | ||
| 988 | clocksource_register(&clocksource_versatile); | ||
| 989 | |||
| 990 | return 0; | ||
| 991 | } | ||
| 992 | 864 | ||
| 993 | /* | 865 | /* |
| 994 | * Set up timer interrupt, and return the current time in seconds. | 866 | * Set up timer interrupt, and return the current time in seconds. |
| @@ -1017,22 +889,8 @@ static void __init versatile_timer_init(void) | |||
| 1017 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); | 889 | writel(0, TIMER2_VA_BASE + TIMER_CTRL); |
| 1018 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); | 890 | writel(0, TIMER3_VA_BASE + TIMER_CTRL); |
| 1019 | 891 | ||
| 1020 | /* | 892 | sp804_clocksource_init(TIMER3_VA_BASE); |
| 1021 | * Make irqs happen for the system timer | 893 | sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1); |
| 1022 | */ | ||
| 1023 | setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq); | ||
| 1024 | |||
| 1025 | versatile_clocksource_init(); | ||
| 1026 | |||
| 1027 | timer0_clockevent.mult = | ||
| 1028 | div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift); | ||
| 1029 | timer0_clockevent.max_delta_ns = | ||
| 1030 | clockevent_delta2ns(0xffffffff, &timer0_clockevent); | ||
| 1031 | timer0_clockevent.min_delta_ns = | ||
| 1032 | clockevent_delta2ns(0xf, &timer0_clockevent); | ||
| 1033 | |||
| 1034 | timer0_clockevent.cpumask = cpumask_of(0); | ||
| 1035 | clockevents_register_device(&timer0_clockevent); | ||
| 1036 | } | 894 | } |
| 1037 | 895 | ||
| 1038 | struct sys_timer versatile_timer = { | 896 | struct sys_timer versatile_timer = { |
diff --git a/arch/arm/mach-versatile/include/mach/clkdev.h b/arch/arm/mach-versatile/include/mach/clkdev.h index 04b37a89801c..e58d0771b64e 100644 --- a/arch/arm/mach-versatile/include/mach/clkdev.h +++ b/arch/arm/mach-versatile/include/mach/clkdev.h | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | #ifndef __ASM_MACH_CLKDEV_H | 1 | #ifndef __ASM_MACH_CLKDEV_H |
| 2 | #define __ASM_MACH_CLKDEV_H | 2 | #define __ASM_MACH_CLKDEV_H |
| 3 | 3 | ||
| 4 | #include <plat/clock.h> | ||
| 5 | |||
| 6 | struct clk { | ||
| 7 | unsigned long rate; | ||
| 8 | const struct clk_ops *ops; | ||
| 9 | const struct icst_params *params; | ||
| 10 | void __iomem *vcoreg; | ||
| 11 | }; | ||
| 12 | |||
| 4 | #define __clk_get(clk) ({ 1; }) | 13 | #define __clk_get(clk) ({ 1; }) |
| 5 | #define __clk_put(clk) do { } while (0) | 14 | #define __clk_put(clk) do { } while (0) |
| 6 | 15 | ||
diff --git a/arch/arm/mach-versatile/include/mach/entry-macro.S b/arch/arm/mach-versatile/include/mach/entry-macro.S index 8c8020980585..e6f7c1663160 100644 --- a/arch/arm/mach-versatile/include/mach/entry-macro.S +++ b/arch/arm/mach-versatile/include/mach/entry-macro.S | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
| 9 | */ | 9 | */ |
| 10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
| 11 | #include <mach/platform.h> | ||
| 11 | #include <asm/hardware/vic.h> | 12 | #include <asm/hardware/vic.h> |
| 12 | 13 | ||
| 13 | .macro disable_fiq | 14 | .macro disable_fiq |
diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h index 7aa906c93154..4f8f99aac938 100644 --- a/arch/arm/mach-versatile/include/mach/hardware.h +++ b/arch/arm/mach-versatile/include/mach/hardware.h | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #define __ASM_ARCH_HARDWARE_H | 23 | #define __ASM_ARCH_HARDWARE_H |
| 24 | 24 | ||
| 25 | #include <asm/sizes.h> | 25 | #include <asm/sizes.h> |
| 26 | #include <mach/platform.h> | ||
| 27 | 26 | ||
| 28 | /* | 27 | /* |
| 29 | * PCI space virtual addresses | 28 | * PCI space virtual addresses |
| @@ -49,4 +48,6 @@ | |||
| 49 | /* macro to get at IO space when running virtually */ | 48 | /* macro to get at IO space when running virtually */ |
| 50 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) | 49 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) |
| 51 | 50 | ||
| 51 | #define __io_address(n) __io(IO_ADDRESS(n)) | ||
| 52 | |||
| 52 | #endif | 53 | #endif |
diff --git a/arch/arm/mach-versatile/include/mach/platform.h b/arch/arm/mach-versatile/include/mach/platform.h index 83207395191a..ec087407b163 100644 --- a/arch/arm/mach-versatile/include/mach/platform.h +++ b/arch/arm/mach-versatile/include/mach/platform.h | |||
| @@ -205,7 +205,7 @@ | |||
| 205 | #define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */ | 205 | #define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */ |
| 206 | #define VERSATILE_DMAC_BASE 0x10130000 /* DMA controller */ | 206 | #define VERSATILE_DMAC_BASE 0x10130000 /* DMA controller */ |
| 207 | #define VERSATILE_VIC_BASE 0x10140000 /* Vectored interrupt controller */ | 207 | #define VERSATILE_VIC_BASE 0x10140000 /* Vectored interrupt controller */ |
| 208 | #define VERSATILE_PERIPH_BASE 0x10150000 /* off-chip peripherals alias from */ | 208 | #define VERSATILE_PERIPH_BASE 0x10150000 /* off-chip peripherals alias from */ |
| 209 | /* 0x10000000 - 0x100FFFFF */ | 209 | /* 0x10000000 - 0x100FFFFF */ |
| 210 | #define VERSATILE_AHBM_BASE 0x101D0000 /* AHB monitor */ | 210 | #define VERSATILE_AHBM_BASE 0x101D0000 /* AHB monitor */ |
| 211 | #define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */ | 211 | #define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */ |
| @@ -213,7 +213,7 @@ | |||
| 213 | #define VERSATILE_TIMER0_1_BASE 0x101E2000 /* Timer 0 and 1 */ | 213 | #define VERSATILE_TIMER0_1_BASE 0x101E2000 /* Timer 0 and 1 */ |
| 214 | #define VERSATILE_TIMER2_3_BASE 0x101E3000 /* Timer 2 and 3 */ | 214 | #define VERSATILE_TIMER2_3_BASE 0x101E3000 /* Timer 2 and 3 */ |
| 215 | #define VERSATILE_GPIO0_BASE 0x101E4000 /* GPIO port 0 */ | 215 | #define VERSATILE_GPIO0_BASE 0x101E4000 /* GPIO port 0 */ |
| 216 | #define VERSATILE_GPIO1_BASE 0x101E5000 /* GPIO port 1 */ | 216 | #define VERSATILE_GPIO1_BASE 0x101E5000 /* GPIO port 1 */ |
| 217 | #define VERSATILE_GPIO2_BASE 0x101E6000 /* GPIO port 2 */ | 217 | #define VERSATILE_GPIO2_BASE 0x101E6000 /* GPIO port 2 */ |
| 218 | #define VERSATILE_GPIO3_BASE 0x101E7000 /* GPIO port 3 */ | 218 | #define VERSATILE_GPIO3_BASE 0x101E7000 /* GPIO port 3 */ |
| 219 | #define VERSATILE_RTC_BASE 0x101E8000 /* Real Time Clock */ | 219 | #define VERSATILE_RTC_BASE 0x101E8000 /* Real Time Clock */ |
| @@ -379,12 +379,6 @@ | |||
| 379 | #define SIC_INT_PCI3 30 | 379 | #define SIC_INT_PCI3 30 |
| 380 | 380 | ||
| 381 | 381 | ||
| 382 | /* | ||
| 383 | * Clean base - dummy | ||
| 384 | * | ||
| 385 | */ | ||
| 386 | #define CLEAN_BASE VERSATILE_BOOT_ROM_HI | ||
| 387 | |||
| 388 | /* | 382 | /* |
| 389 | * System controller bit assignment | 383 | * System controller bit assignment |
| 390 | */ | 384 | */ |
| @@ -397,20 +391,6 @@ | |||
| 397 | #define VERSATILE_TIMER4_EnSel 21 | 391 | #define VERSATILE_TIMER4_EnSel 21 |
| 398 | 392 | ||
| 399 | 393 | ||
| 400 | #define MAX_TIMER 2 | ||
| 401 | #define MAX_PERIOD 699050 | ||
| 402 | #define TICKS_PER_uSEC 1 | ||
| 403 | |||
| 404 | /* | ||
| 405 | * These are useconds NOT ticks. | ||
| 406 | * | ||
| 407 | */ | ||
| 408 | #define mSEC_1 1000 | ||
| 409 | #define mSEC_5 (mSEC_1 * 5) | ||
| 410 | #define mSEC_10 (mSEC_1 * 10) | ||
| 411 | #define mSEC_25 (mSEC_1 * 25) | ||
| 412 | #define SEC_1 (mSEC_1 * 1000) | ||
| 413 | |||
| 414 | #define VERSATILE_CSR_BASE 0x10000000 | 394 | #define VERSATILE_CSR_BASE 0x10000000 |
| 415 | #define VERSATILE_CSR_SIZE 0x10000000 | 395 | #define VERSATILE_CSR_SIZE 0x10000000 |
| 416 | 396 | ||
| @@ -432,5 +412,3 @@ | |||
| 432 | #endif | 412 | #endif |
| 433 | 413 | ||
| 434 | #endif | 414 | #endif |
| 435 | |||
| 436 | /* END */ | ||
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig new file mode 100644 index 000000000000..3f19b660a165 --- /dev/null +++ b/arch/arm/mach-vexpress/Kconfig | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | menu "Versatile Express platform type" | ||
| 2 | depends on ARCH_VEXPRESS | ||
| 3 | |||
| 4 | config ARCH_VEXPRESS_CA9X4 | ||
| 5 | bool "Versatile Express Cortex-A9x4 tile" | ||
| 6 | select CPU_V7 | ||
| 7 | select ARM_GIC | ||
| 8 | |||
| 9 | endmenu | ||
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile new file mode 100644 index 000000000000..1b71b77ade22 --- /dev/null +++ b/arch/arm/mach-vexpress/Makefile | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | # | ||
| 2 | # Makefile for the linux kernel. | ||
| 3 | # | ||
| 4 | |||
| 5 | obj-y := v2m.o | ||
| 6 | obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o | ||
| 7 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | ||
| 8 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o | ||
diff --git a/arch/arm/mach-vexpress/Makefile.boot b/arch/arm/mach-vexpress/Makefile.boot new file mode 100644 index 000000000000..07c2d9c457ec --- /dev/null +++ b/arch/arm/mach-vexpress/Makefile.boot | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | zreladdr-y := 0x60008000 | ||
| 2 | params_phys-y := 0x60000100 | ||
| 3 | initrd_phys-y := 0x60800000 | ||
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h new file mode 100644 index 000000000000..57dd95ce41f9 --- /dev/null +++ b/arch/arm/mach-vexpress/core.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #define __MMIO_P2V(x) (((x) & 0xfffff) | (((x) & 0x0f000000) >> 4) | 0xf8000000) | ||
| 2 | #define MMIO_P2V(x) ((void __iomem *)__MMIO_P2V(x)) | ||
| 3 | |||
| 4 | #define AMBA_DEVICE(name,busid,base,plat) \ | ||
| 5 | struct amba_device name##_device = { \ | ||
| 6 | .dev = { \ | ||
| 7 | .coherent_dma_mask = ~0UL, \ | ||
| 8 | .init_name = busid, \ | ||
| 9 | .platform_data = plat, \ | ||
| 10 | }, \ | ||
| 11 | .res = { \ | ||
| 12 | .start = base, \ | ||
| 13 | .end = base + SZ_4K - 1, \ | ||
| 14 | .flags = IORESOURCE_MEM, \ | ||
| 15 | }, \ | ||
| 16 | .dma_mask = ~0UL, \ | ||
| 17 | .irq = IRQ_##base, \ | ||
| 18 | /* .dma = DMA_##base,*/ \ | ||
| 19 | } | ||
| 20 | |||
| 21 | struct map_desc; | ||
| 22 | |||
| 23 | void v2m_map_io(struct map_desc *tile, size_t num); | ||
| 24 | extern struct sys_timer v2m_timer; | ||
| 25 | |||
| 26 | extern void __iomem *gic_cpu_base_addr; | ||
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c new file mode 100644 index 000000000000..e6f73030d5f0 --- /dev/null +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
| @@ -0,0 +1,249 @@ | |||
| 1 | /* | ||
| 2 | * Versatile Express Core Tile Cortex A9x4 Support | ||
| 3 | */ | ||
| 4 | #include <linux/init.h> | ||
| 5 | #include <linux/device.h> | ||
| 6 | #include <linux/dma-mapping.h> | ||
| 7 | #include <linux/platform_device.h> | ||
| 8 | #include <linux/amba/bus.h> | ||
| 9 | #include <linux/amba/clcd.h> | ||
| 10 | |||
| 11 | #include <asm/clkdev.h> | ||
| 12 | #include <asm/hardware/arm_timer.h> | ||
| 13 | #include <asm/hardware/cache-l2x0.h> | ||
| 14 | #include <asm/hardware/gic.h> | ||
| 15 | #include <asm/mach-types.h> | ||
| 16 | #include <asm/pmu.h> | ||
| 17 | |||
| 18 | #include <mach/clkdev.h> | ||
| 19 | #include <mach/ct-ca9x4.h> | ||
| 20 | |||
| 21 | #include <plat/timer-sp.h> | ||
| 22 | |||
| 23 | #include <asm/mach/arch.h> | ||
| 24 | #include <asm/mach/map.h> | ||
| 25 | #include <asm/mach/time.h> | ||
| 26 | |||
| 27 | #include "core.h" | ||
| 28 | |||
| 29 | #include <mach/motherboard.h> | ||
| 30 | |||
| 31 | #define V2M_PA_CS7 0x10000000 | ||
| 32 | |||
| 33 | static struct map_desc ct_ca9x4_io_desc[] __initdata = { | ||
| 34 | { | ||
| 35 | .virtual = __MMIO_P2V(CT_CA9X4_MPIC), | ||
| 36 | .pfn = __phys_to_pfn(CT_CA9X4_MPIC), | ||
| 37 | .length = SZ_16K, | ||
| 38 | .type = MT_DEVICE, | ||
| 39 | }, { | ||
| 40 | .virtual = __MMIO_P2V(CT_CA9X4_SP804_TIMER), | ||
| 41 | .pfn = __phys_to_pfn(CT_CA9X4_SP804_TIMER), | ||
| 42 | .length = SZ_4K, | ||
| 43 | .type = MT_DEVICE, | ||
| 44 | }, { | ||
| 45 | .virtual = __MMIO_P2V(CT_CA9X4_L2CC), | ||
| 46 | .pfn = __phys_to_pfn(CT_CA9X4_L2CC), | ||
| 47 | .length = SZ_4K, | ||
| 48 | .type = MT_DEVICE, | ||
| 49 | }, | ||
| 50 | }; | ||
| 51 | |||
| 52 | static void __init ct_ca9x4_map_io(void) | ||
| 53 | { | ||
| 54 | v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); | ||
| 55 | } | ||
| 56 | |||
| 57 | void __iomem *gic_cpu_base_addr; | ||
| 58 | |||
| 59 | static void __init ct_ca9x4_init_irq(void) | ||
| 60 | { | ||
| 61 | gic_cpu_base_addr = MMIO_P2V(A9_MPCORE_GIC_CPU); | ||
| 62 | gic_dist_init(0, MMIO_P2V(A9_MPCORE_GIC_DIST), 29); | ||
| 63 | gic_cpu_init(0, gic_cpu_base_addr); | ||
| 64 | } | ||
| 65 | |||
| 66 | #if 0 | ||
| 67 | static void ct_ca9x4_timer_init(void) | ||
| 68 | { | ||
| 69 | writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL); | ||
| 70 | writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL); | ||
| 71 | |||
| 72 | sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1)); | ||
| 73 | sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0); | ||
| 74 | } | ||
| 75 | |||
| 76 | static struct sys_timer ct_ca9x4_timer = { | ||
| 77 | .init = ct_ca9x4_timer_init, | ||
| 78 | }; | ||
| 79 | #endif | ||
| 80 | |||
| 81 | static struct clcd_panel xvga_panel = { | ||
| 82 | .mode = { | ||
| 83 | .name = "XVGA", | ||
| 84 | .refresh = 60, | ||
| 85 | .xres = 1024, | ||
| 86 | .yres = 768, | ||
| 87 | .pixclock = 15384, | ||
| 88 | .left_margin = 168, | ||
| 89 | .right_margin = 8, | ||
| 90 | .upper_margin = 29, | ||
| 91 | .lower_margin = 3, | ||
| 92 | .hsync_len = 144, | ||
| 93 | .vsync_len = 6, | ||
| 94 | .sync = 0, | ||
| 95 | .vmode = FB_VMODE_NONINTERLACED, | ||
| 96 | }, | ||
| 97 | .width = -1, | ||
| 98 | .height = -1, | ||
| 99 | .tim2 = TIM2_BCD | TIM2_IPC, | ||
| 100 | .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1), | ||
| 101 | .bpp = 16, | ||
| 102 | }; | ||
| 103 | |||
| 104 | static void ct_ca9x4_clcd_enable(struct clcd_fb *fb) | ||
| 105 | { | ||
| 106 | v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0); | ||
| 107 | v2m_cfg_write(SYS_CFG_DVIMODE | SYS_CFG_SITE_DB1, 2); | ||
| 108 | } | ||
| 109 | |||
| 110 | static int ct_ca9x4_clcd_setup(struct clcd_fb *fb) | ||
| 111 | { | ||
| 112 | unsigned long framesize = 1024 * 768 * 2; | ||
| 113 | dma_addr_t dma; | ||
| 114 | |||
| 115 | fb->panel = &xvga_panel; | ||
| 116 | |||
| 117 | fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, | ||
| 118 | &dma, GFP_KERNEL); | ||
| 119 | if (!fb->fb.screen_base) { | ||
| 120 | printk(KERN_ERR "CLCD: unable to map frame buffer\n"); | ||
| 121 | return -ENOMEM; | ||
| 122 | } | ||
| 123 | fb->fb.fix.smem_start = dma; | ||
| 124 | fb->fb.fix.smem_len = framesize; | ||
| 125 | |||
| 126 | return 0; | ||
| 127 | } | ||
| 128 | |||
| 129 | static int ct_ca9x4_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) | ||
| 130 | { | ||
| 131 | return dma_mmap_writecombine(&fb->dev->dev, vma, fb->fb.screen_base, | ||
| 132 | fb->fb.fix.smem_start, fb->fb.fix.smem_len); | ||
| 133 | } | ||
| 134 | |||
| 135 | static void ct_ca9x4_clcd_remove(struct clcd_fb *fb) | ||
| 136 | { | ||
| 137 | dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len, | ||
| 138 | fb->fb.screen_base, fb->fb.fix.smem_start); | ||
| 139 | } | ||
| 140 | |||
| 141 | static struct clcd_board ct_ca9x4_clcd_data = { | ||
| 142 | .name = "CT-CA9X4", | ||
| 143 | .check = clcdfb_check, | ||
| 144 | .decode = clcdfb_decode, | ||
| 145 | .enable = ct_ca9x4_clcd_enable, | ||
| 146 | .setup = ct_ca9x4_clcd_setup, | ||
| 147 | .mmap = ct_ca9x4_clcd_mmap, | ||
| 148 | .remove = ct_ca9x4_clcd_remove, | ||
| 149 | }; | ||
| 150 | |||
| 151 | static AMBA_DEVICE(clcd, "ct:clcd", CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data); | ||
| 152 | static AMBA_DEVICE(dmc, "ct:dmc", CT_CA9X4_DMC, NULL); | ||
| 153 | static AMBA_DEVICE(smc, "ct:smc", CT_CA9X4_SMC, NULL); | ||
| 154 | static AMBA_DEVICE(gpio, "ct:gpio", CT_CA9X4_GPIO, NULL); | ||
| 155 | |||
| 156 | static struct amba_device *ct_ca9x4_amba_devs[] __initdata = { | ||
| 157 | &clcd_device, | ||
| 158 | &dmc_device, | ||
| 159 | &smc_device, | ||
| 160 | &gpio_device, | ||
| 161 | }; | ||
| 162 | |||
| 163 | |||
| 164 | static long ct_round(struct clk *clk, unsigned long rate) | ||
| 165 | { | ||
| 166 | return rate; | ||
| 167 | } | ||
| 168 | |||
| 169 | static int ct_set(struct clk *clk, unsigned long rate) | ||
| 170 | { | ||
| 171 | return v2m_cfg_write(SYS_CFG_OSC | SYS_CFG_SITE_DB1 | 1, rate); | ||
| 172 | } | ||
| 173 | |||
| 174 | static const struct clk_ops osc1_clk_ops = { | ||
| 175 | .round = ct_round, | ||
| 176 | .set = ct_set, | ||
| 177 | }; | ||
| 178 | |||
| 179 | static struct clk osc1_clk = { | ||
| 180 | .ops = &osc1_clk_ops, | ||
| 181 | .rate = 24000000, | ||
| 182 | }; | ||
| 183 | |||
| 184 | static struct clk_lookup lookups[] = { | ||
| 185 | { /* CLCD */ | ||
| 186 | .dev_id = "ct:clcd", | ||
| 187 | .clk = &osc1_clk, | ||
| 188 | }, | ||
| 189 | }; | ||
| 190 | |||
| 191 | static struct resource pmu_resources[] = { | ||
| 192 | [0] = { | ||
| 193 | .start = IRQ_CT_CA9X4_PMU_CPU0, | ||
| 194 | .end = IRQ_CT_CA9X4_PMU_CPU0, | ||
| 195 | .flags = IORESOURCE_IRQ, | ||
| 196 | }, | ||
| 197 | [1] = { | ||
| 198 | .start = IRQ_CT_CA9X4_PMU_CPU1, | ||
| 199 | .end = IRQ_CT_CA9X4_PMU_CPU1, | ||
| 200 | .flags = IORESOURCE_IRQ, | ||
| 201 | }, | ||
| 202 | [2] = { | ||
| 203 | .start = IRQ_CT_CA9X4_PMU_CPU2, | ||
| 204 | .end = IRQ_CT_CA9X4_PMU_CPU2, | ||
| 205 | .flags = IORESOURCE_IRQ, | ||
| 206 | }, | ||
| 207 | [3] = { | ||
| 208 | .start = IRQ_CT_CA9X4_PMU_CPU3, | ||
| 209 | .end = IRQ_CT_CA9X4_PMU_CPU3, | ||
| 210 | .flags = IORESOURCE_IRQ, | ||
| 211 | }, | ||
| 212 | }; | ||
| 213 | |||
| 214 | static struct platform_device pmu_device = { | ||
| 215 | .name = "arm-pmu", | ||
| 216 | .id = ARM_PMU_DEVICE_CPU, | ||
| 217 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
| 218 | .resource = pmu_resources, | ||
| 219 | }; | ||
| 220 | |||
| 221 | static void ct_ca9x4_init(void) | ||
| 222 | { | ||
| 223 | int i; | ||
| 224 | |||
| 225 | #ifdef CONFIG_CACHE_L2X0 | ||
| 226 | l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff); | ||
| 227 | #endif | ||
| 228 | |||
| 229 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
| 230 | |||
| 231 | for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++) | ||
| 232 | amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource); | ||
| 233 | |||
| 234 | platform_device_register(&pmu_device); | ||
| 235 | } | ||
| 236 | |||
| 237 | MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4") | ||
| 238 | .phys_io = V2M_UART0, | ||
| 239 | .io_pg_offst = (__MMIO_P2V(V2M_UART0) >> 18) & 0xfffc, | ||
| 240 | .boot_params = PHYS_OFFSET + 0x00000100, | ||
| 241 | .map_io = ct_ca9x4_map_io, | ||
| 242 | .init_irq = ct_ca9x4_init_irq, | ||
| 243 | #if 0 | ||
| 244 | .timer = &ct_ca9x4_timer, | ||
| 245 | #else | ||
| 246 | .timer = &v2m_timer, | ||
| 247 | #endif | ||
| 248 | .init_machine = ct_ca9x4_init, | ||
| 249 | MACHINE_END | ||
diff --git a/arch/arm/mach-vexpress/headsmp.S b/arch/arm/mach-vexpress/headsmp.S new file mode 100644 index 000000000000..8a78ff68e1ee --- /dev/null +++ b/arch/arm/mach-vexpress/headsmp.S | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-vexpress/headsmp.S | ||
| 3 | * | ||
| 4 | * Copyright (c) 2003 ARM Limited | ||
| 5 | * All Rights Reserved | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | #include <linux/linkage.h> | ||
| 12 | #include <linux/init.h> | ||
| 13 | |||
| 14 | __INIT | ||
| 15 | |||
| 16 | /* | ||
| 17 | * Versatile Express specific entry point for secondary CPUs. This | ||
| 18 | * provides a "holding pen" into which all secondary cores are held | ||
| 19 | * until we're ready for them to initialise. | ||
| 20 | */ | ||
| 21 | ENTRY(vexpress_secondary_startup) | ||
| 22 | mrc p15, 0, r0, c0, c0, 5 | ||
| 23 | and r0, r0, #15 | ||
| 24 | adr r4, 1f | ||
| 25 | ldmia r4, {r5, r6} | ||
| 26 | sub r4, r4, r5 | ||
| 27 | add r6, r6, r4 | ||
| 28 | pen: ldr r7, [r6] | ||
| 29 | cmp r7, r0 | ||
| 30 | bne pen | ||
| 31 | |||
| 32 | /* | ||
| 33 | * we've been released from the holding pen: secondary_stack | ||
| 34 | * should now contain the SVC stack for this core | ||
| 35 | */ | ||
| 36 | b secondary_startup | ||
| 37 | |||
| 38 | 1: .long . | ||
| 39 | .long pen_release | ||
diff --git a/arch/arm/mach-vexpress/include/mach/clkdev.h b/arch/arm/mach-vexpress/include/mach/clkdev.h new file mode 100644 index 000000000000..3f8307d73cad --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/clkdev.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef __ASM_MACH_CLKDEV_H | ||
| 2 | #define __ASM_MACH_CLKDEV_H | ||
| 3 | |||
| 4 | #include <plat/clock.h> | ||
| 5 | |||
| 6 | struct clk { | ||
| 7 | const struct clk_ops *ops; | ||
| 8 | unsigned long rate; | ||
| 9 | const struct icst_params *params; | ||
| 10 | }; | ||
| 11 | |||
| 12 | #define __clk_get(clk) ({ 1; }) | ||
| 13 | #define __clk_put(clk) do { } while (0) | ||
| 14 | |||
| 15 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h new file mode 100644 index 000000000000..8650f04136ef --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #ifndef __MACH_CT_CA9X4_H | ||
| 2 | #define __MACH_CT_CA9X4_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Physical base addresses | ||
| 6 | */ | ||
| 7 | #define CT_CA9X4_CLCDC (0x10020000) | ||
| 8 | #define CT_CA9X4_AXIRAM (0x10060000) | ||
| 9 | #define CT_CA9X4_DMC (0x100e0000) | ||
| 10 | #define CT_CA9X4_SMC (0x100e1000) | ||
| 11 | #define CT_CA9X4_SCC (0x100e2000) | ||
| 12 | #define CT_CA9X4_SP804_TIMER (0x100e4000) | ||
| 13 | #define CT_CA9X4_SP805_WDT (0x100e5000) | ||
| 14 | #define CT_CA9X4_TZPC (0x100e6000) | ||
| 15 | #define CT_CA9X4_GPIO (0x100e8000) | ||
| 16 | #define CT_CA9X4_FASTAXI (0x100e9000) | ||
| 17 | #define CT_CA9X4_SLOWAXI (0x100ea000) | ||
| 18 | #define CT_CA9X4_TZASC (0x100ec000) | ||
| 19 | #define CT_CA9X4_CORESIGHT (0x10200000) | ||
| 20 | #define CT_CA9X4_MPIC (0x1e000000) | ||
| 21 | #define CT_CA9X4_SYSTIMER (0x1e004000) | ||
| 22 | #define CT_CA9X4_SYSWDT (0x1e007000) | ||
| 23 | #define CT_CA9X4_L2CC (0x1e00a000) | ||
| 24 | |||
| 25 | #define CT_CA9X4_TIMER0 (CT_CA9X4_SP804_TIMER + 0x000) | ||
| 26 | #define CT_CA9X4_TIMER1 (CT_CA9X4_SP804_TIMER + 0x020) | ||
| 27 | |||
| 28 | #define A9_MPCORE_SCU (CT_CA9X4_MPIC + 0x0000) | ||
| 29 | #define A9_MPCORE_GIC_CPU (CT_CA9X4_MPIC + 0x0100) | ||
| 30 | #define A9_MPCORE_GIT (CT_CA9X4_MPIC + 0x0200) | ||
| 31 | #define A9_MPCORE_GIC_DIST (CT_CA9X4_MPIC + 0x1000) | ||
| 32 | |||
| 33 | /* | ||
| 34 | * Interrupts. Those in {} are for AMBA devices | ||
| 35 | */ | ||
| 36 | #define IRQ_CT_CA9X4_CLCDC { 76 } | ||
| 37 | #define IRQ_CT_CA9X4_DMC { -1 } | ||
| 38 | #define IRQ_CT_CA9X4_SMC { 77, 78 } | ||
| 39 | #define IRQ_CT_CA9X4_TIMER0 80 | ||
| 40 | #define IRQ_CT_CA9X4_TIMER1 81 | ||
| 41 | #define IRQ_CT_CA9X4_GPIO { 82 } | ||
| 42 | #define IRQ_CT_CA9X4_PMU_CPU0 92 | ||
| 43 | #define IRQ_CT_CA9X4_PMU_CPU1 93 | ||
| 44 | #define IRQ_CT_CA9X4_PMU_CPU2 94 | ||
| 45 | #define IRQ_CT_CA9X4_PMU_CPU3 95 | ||
| 46 | |||
| 47 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/debug-macro.S b/arch/arm/mach-vexpress/include/mach/debug-macro.S new file mode 100644 index 000000000000..5167e2aceeba --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/debug-macro.S | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* arch/arm/mach-realview/include/mach/debug-macro.S | ||
| 2 | * | ||
| 3 | * Debugging macro include header | ||
| 4 | * | ||
| 5 | * Copyright (C) 1994-1999 Russell King | ||
| 6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #define DEBUG_LL_UART_OFFSET 0x00009000 | ||
| 14 | |||
| 15 | .macro addruart,rx,tmp | ||
| 16 | mrc p15, 0, \rx, c1, c0 | ||
| 17 | tst \rx, #1 @ MMU enabled? | ||
| 18 | moveq \rx, #0x10000000 | ||
| 19 | movne \rx, #0xf8000000 @ virtual base | ||
| 20 | orr \rx, \rx, #DEBUG_LL_UART_OFFSET | ||
| 21 | .endm | ||
| 22 | |||
| 23 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/mach-vexpress/include/mach/entry-macro.S b/arch/arm/mach-vexpress/include/mach/entry-macro.S new file mode 100644 index 000000000000..20e9fb514f0a --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/entry-macro.S | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | #include <asm/hardware/gic.h> | ||
| 2 | |||
| 3 | .macro disable_fiq | ||
| 4 | .endm | ||
| 5 | |||
| 6 | .macro get_irqnr_preamble, base, tmp | ||
| 7 | ldr \base, =gic_cpu_base_addr | ||
| 8 | ldr \base, [\base] | ||
| 9 | .endm | ||
| 10 | |||
| 11 | .macro arch_ret_to_user, tmp1, tmp2 | ||
| 12 | .endm | ||
| 13 | |||
| 14 | /* | ||
| 15 | * The interrupt numbering scheme is defined in the | ||
| 16 | * interrupt controller spec. To wit: | ||
| 17 | * | ||
| 18 | * Interrupts 0-15 are IPI | ||
| 19 | * 16-28 are reserved | ||
| 20 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
| 21 | * 32-1020 are global | ||
| 22 | * 1021-1022 are reserved | ||
| 23 | * 1023 is "spurious" (no interrupt) | ||
| 24 | * | ||
| 25 | * For now, we ignore all local interrupts so only return an interrupt if it's | ||
| 26 | * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. | ||
| 27 | * | ||
| 28 | * A simple read from the controller will tell us the number of the highest | ||
| 29 | * priority enabled interrupt. We then just need to check whether it is in the | ||
| 30 | * valid range for an IRQ (30-1020 inclusive). | ||
| 31 | */ | ||
| 32 | |||
| 33 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
| 34 | ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ | ||
| 35 | ldr \tmp, =1021 | ||
| 36 | bic \irqnr, \irqstat, #0x1c00 | ||
| 37 | cmp \irqnr, #29 | ||
| 38 | cmpcc \irqnr, \irqnr | ||
| 39 | cmpne \irqnr, \tmp | ||
| 40 | cmpcs \irqnr, \irqnr | ||
| 41 | .endm | ||
| 42 | |||
| 43 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
| 44 | * register) is preserved from the macro above. | ||
| 45 | * If there is an IPI, we immediately signal end of interrupt on the | ||
| 46 | * controller, since this requires the original irqstat value which | ||
| 47 | * we won't easily be able to recreate later. | ||
| 48 | */ | ||
| 49 | |||
| 50 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
| 51 | bic \irqnr, \irqstat, #0x1c00 | ||
| 52 | cmp \irqnr, #16 | ||
| 53 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
| 54 | cmpcs \irqnr, \irqnr | ||
| 55 | .endm | ||
| 56 | |||
| 57 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
| 58 | |||
| 59 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
| 60 | bic \irqnr, \irqstat, #0x1c00 | ||
| 61 | mov \tmp, #0 | ||
| 62 | cmp \irqnr, #29 | ||
| 63 | moveq \tmp, #1 | ||
| 64 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
| 65 | cmp \tmp, #0 | ||
| 66 | .endm | ||
| 67 | |||
diff --git a/arch/arm/mach-vexpress/include/mach/hardware.h b/arch/arm/mach-vexpress/include/mach/hardware.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/hardware.h | |||
| @@ -0,0 +1 @@ | |||
| /* empty */ | |||
diff --git a/arch/arm/mach-vexpress/include/mach/io.h b/arch/arm/mach-vexpress/include/mach/io.h new file mode 100644 index 000000000000..748bb524ee71 --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/io.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-vexpress/include/mach/io.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 ARM Limited | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | #ifndef __ASM_ARM_ARCH_IO_H | ||
| 21 | #define __ASM_ARM_ARCH_IO_H | ||
| 22 | |||
| 23 | #define IO_SPACE_LIMIT 0xffffffff | ||
| 24 | |||
| 25 | #define __io(a) __typesafe_io(a) | ||
| 26 | #define __mem_pci(a) (a) | ||
| 27 | |||
| 28 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/irqs.h b/arch/arm/mach-vexpress/include/mach/irqs.h new file mode 100644 index 000000000000..7054cbfc9de5 --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/irqs.h | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #define IRQ_LOCALTIMER 29 | ||
| 2 | #define IRQ_LOCALWDOG 30 | ||
| 3 | |||
| 4 | #define NR_IRQS 128 | ||
diff --git a/arch/arm/mach-vexpress/include/mach/memory.h b/arch/arm/mach-vexpress/include/mach/memory.h new file mode 100644 index 000000000000..be28232ae639 --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/memory.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-vexpress/include/mach/memory.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 ARM Limited | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | #ifndef __ASM_ARCH_MEMORY_H | ||
| 21 | #define __ASM_ARCH_MEMORY_H | ||
| 22 | |||
| 23 | #define PHYS_OFFSET UL(0x60000000) | ||
| 24 | |||
| 25 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/motherboard.h b/arch/arm/mach-vexpress/include/mach/motherboard.h new file mode 100644 index 000000000000..98a8ded055bf --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/motherboard.h | |||
| @@ -0,0 +1,121 @@ | |||
| 1 | #ifndef __MACH_MOTHERBOARD_H | ||
| 2 | #define __MACH_MOTHERBOARD_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Physical addresses, offset from V2M_PA_CS0-3 | ||
| 6 | */ | ||
| 7 | #define V2M_NOR0 (V2M_PA_CS0) | ||
| 8 | #define V2M_NOR1 (V2M_PA_CS1) | ||
| 9 | #define V2M_SRAM (V2M_PA_CS2) | ||
| 10 | #define V2M_VIDEO_SRAM (V2M_PA_CS3 + 0x00000000) | ||
| 11 | #define V2M_LAN9118 (V2M_PA_CS3 + 0x02000000) | ||
| 12 | #define V2M_ISP1761 (V2M_PA_CS3 + 0x03000000) | ||
| 13 | |||
| 14 | /* | ||
| 15 | * Physical addresses, offset from V2M_PA_CS7 | ||
| 16 | */ | ||
| 17 | #define V2M_SYSREGS (V2M_PA_CS7 + 0x00000000) | ||
| 18 | #define V2M_SYSCTL (V2M_PA_CS7 + 0x00001000) | ||
| 19 | #define V2M_SERIAL_BUS_PCI (V2M_PA_CS7 + 0x00002000) | ||
| 20 | |||
| 21 | #define V2M_AACI (V2M_PA_CS7 + 0x00004000) | ||
| 22 | #define V2M_MMCI (V2M_PA_CS7 + 0x00005000) | ||
| 23 | #define V2M_KMI0 (V2M_PA_CS7 + 0x00006000) | ||
| 24 | #define V2M_KMI1 (V2M_PA_CS7 + 0x00007000) | ||
| 25 | |||
| 26 | #define V2M_UART0 (V2M_PA_CS7 + 0x00009000) | ||
| 27 | #define V2M_UART1 (V2M_PA_CS7 + 0x0000a000) | ||
| 28 | #define V2M_UART2 (V2M_PA_CS7 + 0x0000b000) | ||
| 29 | #define V2M_UART3 (V2M_PA_CS7 + 0x0000c000) | ||
| 30 | |||
| 31 | #define V2M_WDT (V2M_PA_CS7 + 0x0000f000) | ||
| 32 | |||
| 33 | #define V2M_TIMER01 (V2M_PA_CS7 + 0x00011000) | ||
| 34 | #define V2M_TIMER23 (V2M_PA_CS7 + 0x00012000) | ||
| 35 | |||
| 36 | #define V2M_SERIAL_BUS_DVI (V2M_PA_CS7 + 0x00016000) | ||
| 37 | #define V2M_RTC (V2M_PA_CS7 + 0x00017000) | ||
| 38 | |||
| 39 | #define V2M_CF (V2M_PA_CS7 + 0x0001a000) | ||
| 40 | #define V2M_CLCD (V2M_PA_CS7 + 0x0001f000) | ||
| 41 | |||
| 42 | #define V2M_SYS_ID (V2M_SYSREGS + 0x000) | ||
| 43 | #define V2M_SYS_SW (V2M_SYSREGS + 0x004) | ||
| 44 | #define V2M_SYS_LED (V2M_SYSREGS + 0x008) | ||
| 45 | #define V2M_SYS_100HZ (V2M_SYSREGS + 0x024) | ||
| 46 | #define V2M_SYS_FLAGS (V2M_SYSREGS + 0x030) | ||
| 47 | #define V2M_SYS_FLAGSSET (V2M_SYSREGS + 0x030) | ||
| 48 | #define V2M_SYS_FLAGSCLR (V2M_SYSREGS + 0x034) | ||
| 49 | #define V2M_SYS_NVFLAGS (V2M_SYSREGS + 0x038) | ||
| 50 | #define V2M_SYS_NVFLAGSSET (V2M_SYSREGS + 0x038) | ||
| 51 | #define V2M_SYS_NVFLAGSCLR (V2M_SYSREGS + 0x03c) | ||
| 52 | #define V2M_SYS_MCI (V2M_SYSREGS + 0x048) | ||
| 53 | #define V2M_SYS_FLASH (V2M_SYSREGS + 0x03c) | ||
| 54 | #define V2M_SYS_CFGSW (V2M_SYSREGS + 0x058) | ||
| 55 | #define V2M_SYS_24MHZ (V2M_SYSREGS + 0x05c) | ||
| 56 | #define V2M_SYS_MISC (V2M_SYSREGS + 0x060) | ||
| 57 | #define V2M_SYS_DMA (V2M_SYSREGS + 0x064) | ||
| 58 | #define V2M_SYS_PROCID0 (V2M_SYSREGS + 0x084) | ||
| 59 | #define V2M_SYS_PROCID1 (V2M_SYSREGS + 0x088) | ||
| 60 | #define V2M_SYS_CFGDATA (V2M_SYSREGS + 0x0a0) | ||
| 61 | #define V2M_SYS_CFGCTRL (V2M_SYSREGS + 0x0a4) | ||
| 62 | #define V2M_SYS_CFGSTAT (V2M_SYSREGS + 0x0a8) | ||
| 63 | |||
| 64 | #define V2M_TIMER0 (V2M_TIMER01 + 0x000) | ||
| 65 | #define V2M_TIMER1 (V2M_TIMER01 + 0x020) | ||
| 66 | |||
| 67 | #define V2M_TIMER2 (V2M_TIMER23 + 0x000) | ||
| 68 | #define V2M_TIMER3 (V2M_TIMER23 + 0x020) | ||
| 69 | |||
| 70 | |||
| 71 | /* | ||
| 72 | * Interrupts. Those in {} are for AMBA devices | ||
| 73 | */ | ||
| 74 | #define IRQ_V2M_WDT { (32 + 0) } | ||
| 75 | #define IRQ_V2M_TIMER0 (32 + 2) | ||
| 76 | #define IRQ_V2M_TIMER1 (32 + 2) | ||
| 77 | #define IRQ_V2M_TIMER2 (32 + 3) | ||
| 78 | #define IRQ_V2M_TIMER3 (32 + 3) | ||
| 79 | #define IRQ_V2M_RTC { (32 + 4) } | ||
| 80 | #define IRQ_V2M_UART0 { (32 + 5) } | ||
| 81 | #define IRQ_V2M_UART1 { (32 + 6) } | ||
| 82 | #define IRQ_V2M_UART2 { (32 + 7) } | ||
| 83 | #define IRQ_V2M_UART3 { (32 + 8) } | ||
| 84 | #define IRQ_V2M_MMCI { (32 + 9), (32 + 10) } | ||
| 85 | #define IRQ_V2M_AACI { (32 + 11) } | ||
| 86 | #define IRQ_V2M_KMI0 { (32 + 12) } | ||
| 87 | #define IRQ_V2M_KMI1 { (32 + 13) } | ||
| 88 | #define IRQ_V2M_CLCD { (32 + 14) } | ||
| 89 | #define IRQ_V2M_LAN9118 (32 + 15) | ||
| 90 | #define IRQ_V2M_ISP1761 (32 + 16) | ||
| 91 | #define IRQ_V2M_PCIE (32 + 17) | ||
| 92 | |||
| 93 | |||
| 94 | /* | ||
| 95 | * Configuration | ||
| 96 | */ | ||
| 97 | #define SYS_CFG_START (1 << 31) | ||
| 98 | #define SYS_CFG_WRITE (1 << 30) | ||
| 99 | #define SYS_CFG_OSC (1 << 20) | ||
| 100 | #define SYS_CFG_VOLT (2 << 20) | ||
| 101 | #define SYS_CFG_AMP (3 << 20) | ||
| 102 | #define SYS_CFG_TEMP (4 << 20) | ||
| 103 | #define SYS_CFG_RESET (5 << 20) | ||
| 104 | #define SYS_CFG_SCC (6 << 20) | ||
| 105 | #define SYS_CFG_MUXFPGA (7 << 20) | ||
| 106 | #define SYS_CFG_SHUTDOWN (8 << 20) | ||
| 107 | #define SYS_CFG_REBOOT (9 << 20) | ||
| 108 | #define SYS_CFG_DVIMODE (11 << 20) | ||
| 109 | #define SYS_CFG_POWER (12 << 20) | ||
| 110 | #define SYS_CFG_SITE_MB (0 << 16) | ||
| 111 | #define SYS_CFG_SITE_DB1 (1 << 16) | ||
| 112 | #define SYS_CFG_SITE_DB2 (2 << 16) | ||
| 113 | #define SYS_CFG_STACK(n) ((n) << 12) | ||
| 114 | |||
| 115 | #define SYS_CFG_ERR (1 << 1) | ||
| 116 | #define SYS_CFG_COMPLETE (1 << 0) | ||
| 117 | |||
| 118 | int v2m_cfg_write(u32 devfn, u32 data); | ||
| 119 | int v2m_cfg_read(u32 devfn, u32 *data); | ||
| 120 | |||
| 121 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/smp.h b/arch/arm/mach-vexpress/include/mach/smp.h new file mode 100644 index 000000000000..72a9621ed087 --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/smp.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #ifndef __MACH_SMP_H | ||
| 2 | #define __MACH_SMP_H | ||
| 3 | |||
| 4 | #include <asm/hardware/gic.h> | ||
| 5 | |||
| 6 | #define hard_smp_processor_id() \ | ||
| 7 | ({ \ | ||
| 8 | unsigned int cpunum; \ | ||
| 9 | __asm__("mrc p15, 0, %0, c0, c0, 5" \ | ||
| 10 | : "=r" (cpunum)); \ | ||
| 11 | cpunum &= 0x0F; \ | ||
| 12 | }) | ||
| 13 | |||
| 14 | /* | ||
| 15 | * We use IRQ1 as the IPI | ||
| 16 | */ | ||
| 17 | static inline void smp_cross_call(const struct cpumask *mask) | ||
| 18 | { | ||
| 19 | gic_raise_softirq(mask, 1); | ||
| 20 | } | ||
| 21 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/system.h b/arch/arm/mach-vexpress/include/mach/system.h new file mode 100644 index 000000000000..899a4e628a4c --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/system.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-vexpress/include/mach/system.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 ARM Limited | ||
| 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | */ | ||
| 21 | #ifndef __ASM_ARCH_SYSTEM_H | ||
| 22 | #define __ASM_ARCH_SYSTEM_H | ||
| 23 | |||
| 24 | static inline void arch_idle(void) | ||
| 25 | { | ||
| 26 | /* | ||
| 27 | * This should do all the clock switching | ||
| 28 | * and wait for interrupt tricks | ||
| 29 | */ | ||
| 30 | cpu_do_idle(); | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline void arch_reset(char mode, const char *cmd) | ||
| 34 | { | ||
| 35 | } | ||
| 36 | |||
| 37 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/timex.h b/arch/arm/mach-vexpress/include/mach/timex.h new file mode 100644 index 000000000000..00029bacd43c --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/timex.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-vexpress/include/mach/timex.h | ||
| 3 | * | ||
| 4 | * RealView architecture timex specifications | ||
| 5 | * | ||
| 6 | * Copyright (C) 2003 ARM Limited | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #define CLOCK_TICK_RATE (50000000 / 16) | ||
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h new file mode 100644 index 000000000000..7972c5748d0e --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/uncompress.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-vexpress/include/mach/uncompress.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 ARM Limited | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | #define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) | ||
| 21 | #define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c)) | ||
| 22 | #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) | ||
| 23 | #define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18)) | ||
| 24 | |||
| 25 | #define get_uart_base() (0x10000000 + 0x00009000) | ||
| 26 | |||
| 27 | /* | ||
| 28 | * This does not append a newline | ||
| 29 | */ | ||
| 30 | static inline void putc(int c) | ||
| 31 | { | ||
| 32 | unsigned long base = get_uart_base(); | ||
| 33 | |||
| 34 | while (AMBA_UART_FR(base) & (1 << 5)) | ||
| 35 | barrier(); | ||
| 36 | |||
| 37 | AMBA_UART_DR(base) = c; | ||
| 38 | } | ||
| 39 | |||
| 40 | static inline void flush(void) | ||
| 41 | { | ||
| 42 | unsigned long base = get_uart_base(); | ||
| 43 | |||
| 44 | while (AMBA_UART_FR(base) & (1 << 3)) | ||
| 45 | barrier(); | ||
| 46 | } | ||
| 47 | |||
| 48 | /* | ||
| 49 | * nothing to do | ||
| 50 | */ | ||
| 51 | #define arch_decomp_setup() | ||
| 52 | #define arch_decomp_wdog() | ||
diff --git a/arch/arm/mach-vexpress/include/mach/vmalloc.h b/arch/arm/mach-vexpress/include/mach/vmalloc.h new file mode 100644 index 000000000000..f43a36ef678b --- /dev/null +++ b/arch/arm/mach-vexpress/include/mach/vmalloc.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-vexpress/include/mach/vmalloc.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 ARM Limited | ||
| 5 | * Copyright (C) 2000 Russell King. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | */ | ||
| 21 | #define VMALLOC_END 0xf8000000UL | ||
diff --git a/arch/arm/mach-vexpress/localtimer.c b/arch/arm/mach-vexpress/localtimer.c new file mode 100644 index 000000000000..c0e3a59a0bfc --- /dev/null +++ b/arch/arm/mach-vexpress/localtimer.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-vexpress/localtimer.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 ARM Ltd. | ||
| 5 | * All Rights Reserved | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/smp.h> | ||
| 13 | #include <linux/clockchips.h> | ||
| 14 | |||
| 15 | #include <asm/smp_twd.h> | ||
| 16 | #include <asm/localtimer.h> | ||
| 17 | #include <mach/irqs.h> | ||
| 18 | |||
| 19 | /* | ||
| 20 | * Setup the local clock events for a CPU. | ||
| 21 | */ | ||
| 22 | void __cpuinit local_timer_setup(struct clock_event_device *evt) | ||
| 23 | { | ||
| 24 | evt->irq = IRQ_LOCALTIMER; | ||
| 25 | twd_timer_setup(evt); | ||
| 26 | } | ||
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c new file mode 100644 index 000000000000..670970699ba9 --- /dev/null +++ b/arch/arm/mach-vexpress/platsmp.c | |||
| @@ -0,0 +1,190 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-vexpress/platsmp.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 ARM Ltd. | ||
| 5 | * All Rights Reserved | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/errno.h> | ||
| 13 | #include <linux/delay.h> | ||
| 14 | #include <linux/device.h> | ||
| 15 | #include <linux/jiffies.h> | ||
| 16 | #include <linux/smp.h> | ||
| 17 | #include <linux/io.h> | ||
| 18 | |||
| 19 | #include <asm/cacheflush.h> | ||
| 20 | #include <asm/localtimer.h> | ||
| 21 | #include <asm/smp_scu.h> | ||
| 22 | #include <asm/unified.h> | ||
| 23 | |||
| 24 | #include <mach/ct-ca9x4.h> | ||
| 25 | #include <mach/motherboard.h> | ||
| 26 | #define V2M_PA_CS7 0x10000000 | ||
| 27 | |||
| 28 | #include "core.h" | ||
| 29 | |||
| 30 | extern void vexpress_secondary_startup(void); | ||
| 31 | |||
| 32 | /* | ||
| 33 | * control for which core is the next to come out of the secondary | ||
| 34 | * boot "holding pen" | ||
| 35 | */ | ||
| 36 | volatile int __cpuinitdata pen_release = -1; | ||
| 37 | |||
| 38 | static void __iomem *scu_base_addr(void) | ||
| 39 | { | ||
| 40 | return MMIO_P2V(A9_MPCORE_SCU); | ||
| 41 | } | ||
| 42 | |||
| 43 | static DEFINE_SPINLOCK(boot_lock); | ||
| 44 | |||
| 45 | void __cpuinit platform_secondary_init(unsigned int cpu) | ||
| 46 | { | ||
| 47 | trace_hardirqs_off(); | ||
| 48 | |||
| 49 | /* | ||
| 50 | * if any interrupts are already enabled for the primary | ||
| 51 | * core (e.g. timer irq), then they will not have been enabled | ||
| 52 | * for us: do so | ||
| 53 | */ | ||
| 54 | gic_cpu_init(0, gic_cpu_base_addr); | ||
| 55 | |||
| 56 | /* | ||
| 57 | * let the primary processor know we're out of the | ||
| 58 | * pen, then head off into the C entry point | ||
| 59 | */ | ||
| 60 | pen_release = -1; | ||
| 61 | smp_wmb(); | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Synchronise with the boot thread. | ||
| 65 | */ | ||
| 66 | spin_lock(&boot_lock); | ||
| 67 | spin_unlock(&boot_lock); | ||
| 68 | } | ||
| 69 | |||
| 70 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
| 71 | { | ||
| 72 | unsigned long timeout; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Set synchronisation state between this boot processor | ||
| 76 | * and the secondary one | ||
| 77 | */ | ||
| 78 | spin_lock(&boot_lock); | ||
| 79 | |||
| 80 | /* | ||
| 81 | * This is really belt and braces; we hold unintended secondary | ||
| 82 | * CPUs in the holding pen until we're ready for them. However, | ||
| 83 | * since we haven't sent them a soft interrupt, they shouldn't | ||
| 84 | * be there. | ||
| 85 | */ | ||
| 86 | pen_release = cpu; | ||
| 87 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
| 88 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
| 89 | |||
| 90 | /* | ||
| 91 | * Send the secondary CPU a soft interrupt, thereby causing | ||
| 92 | * the boot monitor to read the system wide flags register, | ||
| 93 | * and branch to the address found there. | ||
| 94 | */ | ||
| 95 | smp_cross_call(cpumask_of(cpu)); | ||
| 96 | |||
| 97 | timeout = jiffies + (1 * HZ); | ||
| 98 | while (time_before(jiffies, timeout)) { | ||
| 99 | smp_rmb(); | ||
| 100 | if (pen_release == -1) | ||
| 101 | break; | ||
| 102 | |||
| 103 | udelay(10); | ||
| 104 | } | ||
| 105 | |||
| 106 | /* | ||
| 107 | * now the secondary core is starting up let it run its | ||
| 108 | * calibrations, then wait for it to finish | ||
| 109 | */ | ||
| 110 | spin_unlock(&boot_lock); | ||
| 111 | |||
| 112 | return pen_release != -1 ? -ENOSYS : 0; | ||
| 113 | } | ||
| 114 | |||
| 115 | /* | ||
| 116 | * Initialise the CPU possible map early - this describes the CPUs | ||
| 117 | * which may be present or become present in the system. | ||
| 118 | */ | ||
| 119 | void __init smp_init_cpus(void) | ||
| 120 | { | ||
| 121 | void __iomem *scu_base = scu_base_addr(); | ||
| 122 | unsigned int i, ncores; | ||
| 123 | |||
| 124 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; | ||
| 125 | |||
| 126 | /* sanity check */ | ||
| 127 | if (ncores == 0) { | ||
| 128 | printk(KERN_ERR | ||
| 129 | "vexpress: strange CM count of 0? Default to 1\n"); | ||
| 130 | |||
| 131 | ncores = 1; | ||
| 132 | } | ||
| 133 | |||
| 134 | if (ncores > NR_CPUS) { | ||
| 135 | printk(KERN_WARNING | ||
| 136 | "vexpress: no. of cores (%d) greater than configured " | ||
| 137 | "maximum of %d - clipping\n", | ||
| 138 | ncores, NR_CPUS); | ||
| 139 | ncores = NR_CPUS; | ||
| 140 | } | ||
| 141 | |||
| 142 | for (i = 0; i < ncores; i++) | ||
| 143 | set_cpu_possible(i, true); | ||
| 144 | } | ||
| 145 | |||
| 146 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
| 147 | { | ||
| 148 | unsigned int ncores = num_possible_cpus(); | ||
| 149 | unsigned int cpu = smp_processor_id(); | ||
| 150 | int i; | ||
| 151 | |||
| 152 | smp_store_cpu_info(cpu); | ||
| 153 | |||
| 154 | /* | ||
| 155 | * are we trying to boot more cores than exist? | ||
| 156 | */ | ||
| 157 | if (max_cpus > ncores) | ||
| 158 | max_cpus = ncores; | ||
| 159 | |||
| 160 | /* | ||
| 161 | * Initialise the present map, which describes the set of CPUs | ||
| 162 | * actually populated at the present time. | ||
| 163 | */ | ||
| 164 | for (i = 0; i < max_cpus; i++) | ||
| 165 | set_cpu_present(i, true); | ||
| 166 | |||
| 167 | /* | ||
| 168 | * Initialise the SCU if there are more than one CPU and let | ||
| 169 | * them know where to start. | ||
| 170 | */ | ||
| 171 | if (max_cpus > 1) { | ||
| 172 | /* | ||
| 173 | * Enable the local timer or broadcast device for the | ||
| 174 | * boot CPU, but only if we have more than one CPU. | ||
| 175 | */ | ||
| 176 | percpu_timer_setup(); | ||
| 177 | |||
| 178 | scu_enable(scu_base_addr()); | ||
| 179 | |||
| 180 | /* | ||
| 181 | * Write the address of secondary startup into the | ||
| 182 | * system-wide flags register. The boot monitor waits | ||
| 183 | * until it receives a soft interrupt, and then the | ||
| 184 | * secondary CPU branches to this address. | ||
| 185 | */ | ||
| 186 | writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR)); | ||
| 187 | writel(BSYM(virt_to_phys(vexpress_secondary_startup)), | ||
| 188 | MMIO_P2V(V2M_SYS_FLAGSSET)); | ||
| 189 | } | ||
| 190 | } | ||
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c new file mode 100644 index 000000000000..d250711b8c7a --- /dev/null +++ b/arch/arm/mach-vexpress/v2m.c | |||
| @@ -0,0 +1,361 @@ | |||
| 1 | /* | ||
| 2 | * Versatile Express V2M Motherboard Support | ||
| 3 | */ | ||
| 4 | #include <linux/device.h> | ||
| 5 | #include <linux/amba/bus.h> | ||
| 6 | #include <linux/amba/mmci.h> | ||
| 7 | #include <linux/io.h> | ||
| 8 | #include <linux/init.h> | ||
| 9 | #include <linux/platform_device.h> | ||
| 10 | #include <linux/smsc911x.h> | ||
| 11 | #include <linux/spinlock.h> | ||
| 12 | #include <linux/sysdev.h> | ||
| 13 | #include <linux/usb/isp1760.h> | ||
| 14 | |||
| 15 | #include <asm/clkdev.h> | ||
| 16 | #include <asm/sizes.h> | ||
| 17 | #include <asm/mach/flash.h> | ||
| 18 | #include <asm/mach/map.h> | ||
| 19 | #include <asm/mach/time.h> | ||
| 20 | #include <asm/hardware/arm_timer.h> | ||
| 21 | |||
| 22 | #include <mach/clkdev.h> | ||
| 23 | #include <mach/motherboard.h> | ||
| 24 | |||
| 25 | #include <plat/timer-sp.h> | ||
| 26 | |||
| 27 | #include "core.h" | ||
| 28 | |||
| 29 | #define V2M_PA_CS0 0x40000000 | ||
| 30 | #define V2M_PA_CS1 0x44000000 | ||
| 31 | #define V2M_PA_CS2 0x48000000 | ||
| 32 | #define V2M_PA_CS3 0x4c000000 | ||
| 33 | #define V2M_PA_CS7 0x10000000 | ||
| 34 | |||
| 35 | static struct map_desc v2m_io_desc[] __initdata = { | ||
| 36 | { | ||
| 37 | .virtual = __MMIO_P2V(V2M_PA_CS7), | ||
| 38 | .pfn = __phys_to_pfn(V2M_PA_CS7), | ||
| 39 | .length = SZ_128K, | ||
| 40 | .type = MT_DEVICE, | ||
| 41 | }, | ||
| 42 | }; | ||
| 43 | |||
| 44 | void __init v2m_map_io(struct map_desc *tile, size_t num) | ||
| 45 | { | ||
| 46 | iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); | ||
| 47 | iotable_init(tile, num); | ||
| 48 | } | ||
| 49 | |||
| 50 | |||
| 51 | static void v2m_timer_init(void) | ||
| 52 | { | ||
| 53 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); | ||
| 54 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); | ||
| 55 | |||
| 56 | sp804_clocksource_init(MMIO_P2V(V2M_TIMER1)); | ||
| 57 | sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0); | ||
| 58 | } | ||
| 59 | |||
| 60 | struct sys_timer v2m_timer = { | ||
| 61 | .init = v2m_timer_init, | ||
| 62 | }; | ||
| 63 | |||
| 64 | |||
| 65 | static DEFINE_SPINLOCK(v2m_cfg_lock); | ||
| 66 | |||
| 67 | int v2m_cfg_write(u32 devfn, u32 data) | ||
| 68 | { | ||
| 69 | /* Configuration interface broken? */ | ||
| 70 | u32 val; | ||
| 71 | |||
| 72 | printk("%s: writing %08x to %08x\n", __func__, data, devfn); | ||
| 73 | |||
| 74 | devfn |= SYS_CFG_START | SYS_CFG_WRITE; | ||
| 75 | |||
| 76 | spin_lock(&v2m_cfg_lock); | ||
| 77 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
| 78 | writel(val & ~SYS_CFG_COMPLETE, MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
| 79 | |||
| 80 | writel(data, MMIO_P2V(V2M_SYS_CFGDATA)); | ||
| 81 | writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL)); | ||
| 82 | |||
| 83 | do { | ||
| 84 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
| 85 | } while (val == 0); | ||
| 86 | spin_unlock(&v2m_cfg_lock); | ||
| 87 | |||
| 88 | return !!(val & SYS_CFG_ERR); | ||
| 89 | } | ||
| 90 | |||
| 91 | int v2m_cfg_read(u32 devfn, u32 *data) | ||
| 92 | { | ||
| 93 | u32 val; | ||
| 94 | |||
| 95 | devfn |= SYS_CFG_START; | ||
| 96 | |||
| 97 | spin_lock(&v2m_cfg_lock); | ||
| 98 | writel(0, MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
| 99 | writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL)); | ||
| 100 | |||
| 101 | mb(); | ||
| 102 | |||
| 103 | do { | ||
| 104 | cpu_relax(); | ||
| 105 | val = readl(MMIO_P2V(V2M_SYS_CFGSTAT)); | ||
| 106 | } while (val == 0); | ||
| 107 | |||
| 108 | *data = readl(MMIO_P2V(V2M_SYS_CFGDATA)); | ||
| 109 | spin_unlock(&v2m_cfg_lock); | ||
| 110 | |||
| 111 | return !!(val & SYS_CFG_ERR); | ||
| 112 | } | ||
| 113 | |||
| 114 | |||
| 115 | static struct resource v2m_pcie_i2c_resource = { | ||
| 116 | .start = V2M_SERIAL_BUS_PCI, | ||
| 117 | .end = V2M_SERIAL_BUS_PCI + SZ_4K - 1, | ||
| 118 | .flags = IORESOURCE_MEM, | ||
| 119 | }; | ||
| 120 | |||
| 121 | static struct platform_device v2m_pcie_i2c_device = { | ||
| 122 | .name = "versatile-i2c", | ||
| 123 | .id = 0, | ||
| 124 | .num_resources = 1, | ||
| 125 | .resource = &v2m_pcie_i2c_resource, | ||
| 126 | }; | ||
| 127 | |||
| 128 | static struct resource v2m_ddc_i2c_resource = { | ||
| 129 | .start = V2M_SERIAL_BUS_DVI, | ||
| 130 | .end = V2M_SERIAL_BUS_DVI + SZ_4K - 1, | ||
| 131 | .flags = IORESOURCE_MEM, | ||
| 132 | }; | ||
| 133 | |||
| 134 | static struct platform_device v2m_ddc_i2c_device = { | ||
| 135 | .name = "versatile-i2c", | ||
| 136 | .id = 1, | ||
| 137 | .num_resources = 1, | ||
| 138 | .resource = &v2m_ddc_i2c_resource, | ||
| 139 | }; | ||
| 140 | |||
| 141 | static struct resource v2m_eth_resources[] = { | ||
| 142 | { | ||
| 143 | .start = V2M_LAN9118, | ||
| 144 | .end = V2M_LAN9118 + SZ_64K - 1, | ||
| 145 | .flags = IORESOURCE_MEM, | ||
| 146 | }, { | ||
| 147 | .start = IRQ_V2M_LAN9118, | ||
| 148 | .end = IRQ_V2M_LAN9118, | ||
| 149 | .flags = IORESOURCE_IRQ, | ||
| 150 | }, | ||
| 151 | }; | ||
| 152 | |||
| 153 | static struct smsc911x_platform_config v2m_eth_config = { | ||
| 154 | .flags = SMSC911X_USE_32BIT, | ||
| 155 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, | ||
| 156 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
| 157 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
| 158 | }; | ||
| 159 | |||
| 160 | static struct platform_device v2m_eth_device = { | ||
| 161 | .name = "smsc911x", | ||
| 162 | .id = -1, | ||
| 163 | .resource = v2m_eth_resources, | ||
| 164 | .num_resources = ARRAY_SIZE(v2m_eth_resources), | ||
| 165 | .dev.platform_data = &v2m_eth_config, | ||
| 166 | }; | ||
| 167 | |||
| 168 | static struct resource v2m_usb_resources[] = { | ||
| 169 | { | ||
| 170 | .start = V2M_ISP1761, | ||
| 171 | .end = V2M_ISP1761 + SZ_128K - 1, | ||
| 172 | .flags = IORESOURCE_MEM, | ||
| 173 | }, { | ||
| 174 | .start = IRQ_V2M_ISP1761, | ||
| 175 | .end = IRQ_V2M_ISP1761, | ||
| 176 | .flags = IORESOURCE_IRQ, | ||
| 177 | }, | ||
| 178 | }; | ||
| 179 | |||
| 180 | static struct isp1760_platform_data v2m_usb_config = { | ||
| 181 | .is_isp1761 = true, | ||
| 182 | .bus_width_16 = false, | ||
| 183 | .port1_otg = true, | ||
| 184 | .analog_oc = false, | ||
| 185 | .dack_polarity_high = false, | ||
| 186 | .dreq_polarity_high = false, | ||
| 187 | }; | ||
| 188 | |||
| 189 | static struct platform_device v2m_usb_device = { | ||
| 190 | .name = "isp1760", | ||
| 191 | .id = -1, | ||
| 192 | .resource = v2m_usb_resources, | ||
| 193 | .num_resources = ARRAY_SIZE(v2m_usb_resources), | ||
| 194 | .dev.platform_data = &v2m_usb_config, | ||
| 195 | }; | ||
| 196 | |||
| 197 | static int v2m_flash_init(void) | ||
| 198 | { | ||
| 199 | writel(0, MMIO_P2V(V2M_SYS_FLASH)); | ||
| 200 | return 0; | ||
| 201 | } | ||
| 202 | |||
| 203 | static void v2m_flash_exit(void) | ||
| 204 | { | ||
| 205 | writel(0, MMIO_P2V(V2M_SYS_FLASH)); | ||
| 206 | } | ||
| 207 | |||
| 208 | static void v2m_flash_set_vpp(int on) | ||
| 209 | { | ||
| 210 | writel(on != 0, MMIO_P2V(V2M_SYS_FLASH)); | ||
| 211 | } | ||
| 212 | |||
| 213 | static struct flash_platform_data v2m_flash_data = { | ||
| 214 | .map_name = "cfi_probe", | ||
| 215 | .width = 4, | ||
| 216 | .init = v2m_flash_init, | ||
| 217 | .exit = v2m_flash_exit, | ||
| 218 | .set_vpp = v2m_flash_set_vpp, | ||
| 219 | }; | ||
| 220 | |||
| 221 | static struct resource v2m_flash_resources[] = { | ||
| 222 | { | ||
| 223 | .start = V2M_NOR0, | ||
| 224 | .end = V2M_NOR0 + SZ_64M - 1, | ||
| 225 | .flags = IORESOURCE_MEM, | ||
| 226 | }, { | ||
| 227 | .start = V2M_NOR1, | ||
| 228 | .end = V2M_NOR1 + SZ_64M - 1, | ||
| 229 | .flags = IORESOURCE_MEM, | ||
| 230 | }, | ||
| 231 | }; | ||
| 232 | |||
| 233 | static struct platform_device v2m_flash_device = { | ||
| 234 | .name = "armflash", | ||
| 235 | .id = -1, | ||
| 236 | .resource = v2m_flash_resources, | ||
| 237 | .num_resources = ARRAY_SIZE(v2m_flash_resources), | ||
| 238 | .dev.platform_data = &v2m_flash_data, | ||
| 239 | }; | ||
| 240 | |||
| 241 | |||
| 242 | static unsigned int v2m_mmci_status(struct device *dev) | ||
| 243 | { | ||
| 244 | return !(readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0)); | ||
| 245 | } | ||
| 246 | |||
| 247 | static struct mmci_platform_data v2m_mmci_data = { | ||
| 248 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | ||
| 249 | .status = v2m_mmci_status, | ||
| 250 | }; | ||
| 251 | |||
| 252 | static AMBA_DEVICE(aaci, "mb:aaci", V2M_AACI, NULL); | ||
| 253 | static AMBA_DEVICE(mmci, "mb:mmci", V2M_MMCI, &v2m_mmci_data); | ||
| 254 | static AMBA_DEVICE(kmi0, "mb:kmi0", V2M_KMI0, NULL); | ||
| 255 | static AMBA_DEVICE(kmi1, "mb:kmi1", V2M_KMI1, NULL); | ||
| 256 | static AMBA_DEVICE(uart0, "mb:uart0", V2M_UART0, NULL); | ||
| 257 | static AMBA_DEVICE(uart1, "mb:uart1", V2M_UART1, NULL); | ||
| 258 | static AMBA_DEVICE(uart2, "mb:uart2", V2M_UART2, NULL); | ||
| 259 | static AMBA_DEVICE(uart3, "mb:uart3", V2M_UART3, NULL); | ||
| 260 | static AMBA_DEVICE(wdt, "mb:wdt", V2M_WDT, NULL); | ||
| 261 | static AMBA_DEVICE(rtc, "mb:rtc", V2M_RTC, NULL); | ||
| 262 | |||
| 263 | static struct amba_device *v2m_amba_devs[] __initdata = { | ||
| 264 | &aaci_device, | ||
| 265 | &mmci_device, | ||
| 266 | &kmi0_device, | ||
| 267 | &kmi1_device, | ||
| 268 | &uart0_device, | ||
| 269 | &uart1_device, | ||
| 270 | &uart2_device, | ||
| 271 | &uart3_device, | ||
| 272 | &wdt_device, | ||
| 273 | &rtc_device, | ||
| 274 | }; | ||
| 275 | |||
| 276 | |||
| 277 | static long v2m_osc_round(struct clk *clk, unsigned long rate) | ||
| 278 | { | ||
| 279 | return rate; | ||
| 280 | } | ||
| 281 | |||
| 282 | static int v2m_osc1_set(struct clk *clk, unsigned long rate) | ||
| 283 | { | ||
| 284 | return v2m_cfg_write(SYS_CFG_OSC | SYS_CFG_SITE_MB | 1, rate); | ||
| 285 | } | ||
| 286 | |||
| 287 | static const struct clk_ops osc1_clk_ops = { | ||
| 288 | .round = v2m_osc_round, | ||
| 289 | .set = v2m_osc1_set, | ||
| 290 | }; | ||
| 291 | |||
| 292 | static struct clk osc1_clk = { | ||
| 293 | .ops = &osc1_clk_ops, | ||
| 294 | .rate = 24000000, | ||
| 295 | }; | ||
| 296 | |||
| 297 | static struct clk osc2_clk = { | ||
| 298 | .rate = 24000000, | ||
| 299 | }; | ||
| 300 | |||
| 301 | static struct clk_lookup v2m_lookups[] = { | ||
| 302 | { /* UART0 */ | ||
| 303 | .dev_id = "mb:uart0", | ||
| 304 | .clk = &osc2_clk, | ||
| 305 | }, { /* UART1 */ | ||
| 306 | .dev_id = "mb:uart1", | ||
| 307 | .clk = &osc2_clk, | ||
| 308 | }, { /* UART2 */ | ||
| 309 | .dev_id = "mb:uart2", | ||
| 310 | .clk = &osc2_clk, | ||
| 311 | }, { /* UART3 */ | ||
| 312 | .dev_id = "mb:uart3", | ||
| 313 | .clk = &osc2_clk, | ||
| 314 | }, { /* KMI0 */ | ||
| 315 | .dev_id = "mb:kmi0", | ||
| 316 | .clk = &osc2_clk, | ||
| 317 | }, { /* KMI1 */ | ||
| 318 | .dev_id = "mb:kmi1", | ||
| 319 | .clk = &osc2_clk, | ||
| 320 | }, { /* MMC0 */ | ||
| 321 | .dev_id = "mb:mmci", | ||
| 322 | .clk = &osc2_clk, | ||
| 323 | }, { /* CLCD */ | ||
| 324 | .dev_id = "mb:clcd", | ||
| 325 | .clk = &osc1_clk, | ||
| 326 | }, | ||
| 327 | }; | ||
| 328 | |||
| 329 | static void v2m_power_off(void) | ||
| 330 | { | ||
| 331 | if (v2m_cfg_write(SYS_CFG_SHUTDOWN | SYS_CFG_SITE_MB, 0)) | ||
| 332 | printk(KERN_EMERG "Unable to shutdown\n"); | ||
| 333 | } | ||
| 334 | |||
| 335 | static void v2m_restart(char str, const char *cmd) | ||
| 336 | { | ||
| 337 | if (v2m_cfg_write(SYS_CFG_REBOOT | SYS_CFG_SITE_MB, 0)) | ||
| 338 | printk(KERN_EMERG "Unable to reboot\n"); | ||
| 339 | } | ||
| 340 | |||
| 341 | static int __init v2m_init(void) | ||
| 342 | { | ||
| 343 | int i; | ||
| 344 | |||
| 345 | clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups)); | ||
| 346 | |||
| 347 | platform_device_register(&v2m_pcie_i2c_device); | ||
| 348 | platform_device_register(&v2m_ddc_i2c_device); | ||
| 349 | platform_device_register(&v2m_flash_device); | ||
| 350 | platform_device_register(&v2m_eth_device); | ||
| 351 | platform_device_register(&v2m_usb_device); | ||
| 352 | |||
| 353 | for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++) | ||
| 354 | amba_device_register(v2m_amba_devs[i], &iomem_resource); | ||
| 355 | |||
| 356 | pm_power_off = v2m_power_off; | ||
| 357 | arm_pm_restart = v2m_restart; | ||
| 358 | |||
| 359 | return 0; | ||
| 360 | } | ||
| 361 | arch_initcall(v2m_init); | ||
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 3e62aae2225a..346ae14824a5 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
| @@ -762,7 +762,8 @@ config CACHE_FEROCEON_L2_WRITETHROUGH | |||
| 762 | config CACHE_L2X0 | 762 | config CACHE_L2X0 |
| 763 | bool "Enable the L2x0 outer cache controller" | 763 | bool "Enable the L2x0 outer cache controller" |
| 764 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ | 764 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ |
| 765 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK || ARCH_OMAP4 | 765 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || \ |
| 766 | ARCH_NOMADIK || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 | ||
| 766 | default y | 767 | default y |
| 767 | select OUTER_CACHE | 768 | select OUTER_CACHE |
| 768 | select OUTER_CACHE_SYNC | 769 | select OUTER_CACHE_SYNC |
| @@ -791,6 +792,25 @@ config ARM_L1_CACHE_SHIFT | |||
| 791 | default 6 if ARM_L1_CACHE_SHIFT_6 | 792 | default 6 if ARM_L1_CACHE_SHIFT_6 |
| 792 | default 5 | 793 | default 5 |
| 793 | 794 | ||
| 795 | config ARM_DMA_MEM_BUFFERABLE | ||
| 796 | bool "Use non-cacheable memory for DMA" if CPU_V6 && !CPU_V7 | ||
| 797 | default y if CPU_V6 || CPU_V7 | ||
| 798 | help | ||
| 799 | Historically, the kernel has used strongly ordered mappings to | ||
| 800 | provide DMA coherent memory. With the advent of ARMv7, mapping | ||
| 801 | memory with differing types results in unpredictable behaviour, | ||
| 802 | so on these CPUs, this option is forced on. | ||
| 803 | |||
| 804 | Multiple mappings with differing attributes is also unpredictable | ||
| 805 | on ARMv6 CPUs, but since they do not have aggressive speculative | ||
| 806 | prefetch, no harm appears to occur. | ||
| 807 | |||
| 808 | However, drivers may be missing the necessary barriers for ARMv6, | ||
| 809 | and therefore turning this on may result in unpredictable driver | ||
| 810 | behaviour. Therefore, we offer this as an option. | ||
| 811 | |||
| 812 | You are recommended say 'Y' here and debug any affected drivers. | ||
| 813 | |||
| 794 | config ARCH_HAS_BARRIERS | 814 | config ARCH_HAS_BARRIERS |
| 795 | bool | 815 | bool |
| 796 | help | 816 | help |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index a2ab51fa73e2..6f98c358989a 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
| 19 | #include <linux/proc_fs.h> | 19 | #include <linux/proc_fs.h> |
| 20 | #include <linux/seq_file.h> | ||
| 20 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 21 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
| 22 | #include <linux/uaccess.h> | 23 | #include <linux/uaccess.h> |
| @@ -94,36 +95,29 @@ static const char *usermode_action[] = { | |||
| 94 | "signal+warn" | 95 | "signal+warn" |
| 95 | }; | 96 | }; |
| 96 | 97 | ||
| 97 | static int | 98 | static int alignment_proc_show(struct seq_file *m, void *v) |
| 98 | proc_alignment_read(char *page, char **start, off_t off, int count, int *eof, | ||
| 99 | void *data) | ||
| 100 | { | 99 | { |
| 101 | char *p = page; | 100 | seq_printf(m, "User:\t\t%lu\n", ai_user); |
| 102 | int len; | 101 | seq_printf(m, "System:\t\t%lu\n", ai_sys); |
| 103 | 102 | seq_printf(m, "Skipped:\t%lu\n", ai_skipped); | |
| 104 | p += sprintf(p, "User:\t\t%lu\n", ai_user); | 103 | seq_printf(m, "Half:\t\t%lu\n", ai_half); |
| 105 | p += sprintf(p, "System:\t\t%lu\n", ai_sys); | 104 | seq_printf(m, "Word:\t\t%lu\n", ai_word); |
| 106 | p += sprintf(p, "Skipped:\t%lu\n", ai_skipped); | ||
| 107 | p += sprintf(p, "Half:\t\t%lu\n", ai_half); | ||
| 108 | p += sprintf(p, "Word:\t\t%lu\n", ai_word); | ||
| 109 | if (cpu_architecture() >= CPU_ARCH_ARMv5TE) | 105 | if (cpu_architecture() >= CPU_ARCH_ARMv5TE) |
| 110 | p += sprintf(p, "DWord:\t\t%lu\n", ai_dword); | 106 | seq_printf(m, "DWord:\t\t%lu\n", ai_dword); |
| 111 | p += sprintf(p, "Multi:\t\t%lu\n", ai_multi); | 107 | seq_printf(m, "Multi:\t\t%lu\n", ai_multi); |
| 112 | p += sprintf(p, "User faults:\t%i (%s)\n", ai_usermode, | 108 | seq_printf(m, "User faults:\t%i (%s)\n", ai_usermode, |
| 113 | usermode_action[ai_usermode]); | 109 | usermode_action[ai_usermode]); |
| 114 | 110 | ||
| 115 | len = (p - page) - off; | 111 | return 0; |
| 116 | if (len < 0) | 112 | } |
| 117 | len = 0; | ||
| 118 | |||
| 119 | *eof = (len <= count) ? 1 : 0; | ||
| 120 | *start = page + off; | ||
| 121 | 113 | ||
| 122 | return len; | 114 | static int alignment_proc_open(struct inode *inode, struct file *file) |
| 115 | { | ||
| 116 | return single_open(file, alignment_proc_show, NULL); | ||
| 123 | } | 117 | } |
| 124 | 118 | ||
| 125 | static int proc_alignment_write(struct file *file, const char __user *buffer, | 119 | static ssize_t alignment_proc_write(struct file *file, const char __user *buffer, |
| 126 | unsigned long count, void *data) | 120 | size_t count, loff_t *pos) |
| 127 | { | 121 | { |
| 128 | char mode; | 122 | char mode; |
| 129 | 123 | ||
| @@ -136,6 +130,13 @@ static int proc_alignment_write(struct file *file, const char __user *buffer, | |||
| 136 | return count; | 130 | return count; |
| 137 | } | 131 | } |
| 138 | 132 | ||
| 133 | static const struct file_operations alignment_proc_fops = { | ||
| 134 | .open = alignment_proc_open, | ||
| 135 | .read = seq_read, | ||
| 136 | .llseek = seq_lseek, | ||
| 137 | .release = single_release, | ||
| 138 | .write = alignment_proc_write, | ||
| 139 | }; | ||
| 139 | #endif /* CONFIG_PROC_FS */ | 140 | #endif /* CONFIG_PROC_FS */ |
| 140 | 141 | ||
| 141 | union offset_union { | 142 | union offset_union { |
| @@ -901,12 +902,10 @@ static int __init alignment_init(void) | |||
| 901 | #ifdef CONFIG_PROC_FS | 902 | #ifdef CONFIG_PROC_FS |
| 902 | struct proc_dir_entry *res; | 903 | struct proc_dir_entry *res; |
| 903 | 904 | ||
| 904 | res = create_proc_entry("cpu/alignment", S_IWUSR | S_IRUGO, NULL); | 905 | res = proc_create("cpu/alignment", S_IWUSR | S_IRUGO, NULL, |
| 906 | &alignment_proc_fops); | ||
| 905 | if (!res) | 907 | if (!res) |
| 906 | return -ENOMEM; | 908 | return -ENOMEM; |
| 907 | |||
| 908 | res->read_proc = proc_alignment_read; | ||
| 909 | res->write_proc = proc_alignment_write; | ||
| 910 | #endif | 909 | #endif |
| 911 | 910 | ||
| 912 | /* | 911 | /* |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 21ad68ba22ba..9819869d2bc9 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | static void __iomem *l2x0_base; | 28 | static void __iomem *l2x0_base; |
| 29 | static DEFINE_SPINLOCK(l2x0_lock); | 29 | static DEFINE_SPINLOCK(l2x0_lock); |
| 30 | static uint32_t l2x0_way_mask; /* Bitmask of active ways */ | ||
| 30 | 31 | ||
| 31 | static inline void cache_wait(void __iomem *reg, unsigned long mask) | 32 | static inline void cache_wait(void __iomem *reg, unsigned long mask) |
| 32 | { | 33 | { |
| @@ -108,8 +109,8 @@ static inline void l2x0_inv_all(void) | |||
| 108 | 109 | ||
| 109 | /* invalidate all ways */ | 110 | /* invalidate all ways */ |
| 110 | spin_lock_irqsave(&l2x0_lock, flags); | 111 | spin_lock_irqsave(&l2x0_lock, flags); |
| 111 | writel(0xff, l2x0_base + L2X0_INV_WAY); | 112 | writel(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); |
| 112 | cache_wait(l2x0_base + L2X0_INV_WAY, 0xff); | 113 | cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); |
| 113 | cache_sync(); | 114 | cache_sync(); |
| 114 | spin_unlock_irqrestore(&l2x0_lock, flags); | 115 | spin_unlock_irqrestore(&l2x0_lock, flags); |
| 115 | } | 116 | } |
| @@ -208,9 +209,37 @@ static void l2x0_flush_range(unsigned long start, unsigned long end) | |||
| 208 | void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | 209 | void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) |
| 209 | { | 210 | { |
| 210 | __u32 aux; | 211 | __u32 aux; |
| 212 | __u32 cache_id; | ||
| 213 | int ways; | ||
| 214 | const char *type; | ||
| 211 | 215 | ||
| 212 | l2x0_base = base; | 216 | l2x0_base = base; |
| 213 | 217 | ||
| 218 | cache_id = readl(l2x0_base + L2X0_CACHE_ID); | ||
| 219 | aux = readl(l2x0_base + L2X0_AUX_CTRL); | ||
| 220 | |||
| 221 | /* Determine the number of ways */ | ||
| 222 | switch (cache_id & L2X0_CACHE_ID_PART_MASK) { | ||
| 223 | case L2X0_CACHE_ID_PART_L310: | ||
| 224 | if (aux & (1 << 16)) | ||
| 225 | ways = 16; | ||
| 226 | else | ||
| 227 | ways = 8; | ||
| 228 | type = "L310"; | ||
| 229 | break; | ||
| 230 | case L2X0_CACHE_ID_PART_L210: | ||
| 231 | ways = (aux >> 13) & 0xf; | ||
| 232 | type = "L210"; | ||
| 233 | break; | ||
| 234 | default: | ||
| 235 | /* Assume unknown chips have 8 ways */ | ||
| 236 | ways = 8; | ||
| 237 | type = "L2x0 series"; | ||
| 238 | break; | ||
| 239 | } | ||
| 240 | |||
| 241 | l2x0_way_mask = (1 << ways) - 1; | ||
| 242 | |||
| 214 | /* | 243 | /* |
| 215 | * Check if l2x0 controller is already enabled. | 244 | * Check if l2x0 controller is already enabled. |
| 216 | * If you are booting from non-secure mode | 245 | * If you are booting from non-secure mode |
| @@ -219,8 +248,6 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
| 219 | if (!(readl(l2x0_base + L2X0_CTRL) & 1)) { | 248 | if (!(readl(l2x0_base + L2X0_CTRL) & 1)) { |
| 220 | 249 | ||
| 221 | /* l2x0 controller is disabled */ | 250 | /* l2x0 controller is disabled */ |
| 222 | |||
| 223 | aux = readl(l2x0_base + L2X0_AUX_CTRL); | ||
| 224 | aux &= aux_mask; | 251 | aux &= aux_mask; |
| 225 | aux |= aux_val; | 252 | aux |= aux_val; |
| 226 | writel(aux, l2x0_base + L2X0_AUX_CTRL); | 253 | writel(aux, l2x0_base + L2X0_AUX_CTRL); |
| @@ -236,5 +263,7 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
| 236 | outer_cache.flush_range = l2x0_flush_range; | 263 | outer_cache.flush_range = l2x0_flush_range; |
| 237 | outer_cache.sync = l2x0_cache_sync; | 264 | outer_cache.sync = l2x0_cache_sync; |
| 238 | 265 | ||
| 239 | printk(KERN_INFO "L2X0 cache controller enabled\n"); | 266 | printk(KERN_INFO "%s cache controller enabled\n", type); |
| 267 | printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x\n", | ||
| 268 | ways, cache_id, aux); | ||
| 240 | } | 269 | } |
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c index 0d414c28eb2c..9b906dec1ca1 100644 --- a/arch/arm/mm/fault-armv.c +++ b/arch/arm/mm/fault-armv.c | |||
| @@ -134,8 +134,6 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, | |||
| 134 | flush_dcache_mmap_unlock(mapping); | 134 | flush_dcache_mmap_unlock(mapping); |
| 135 | if (aliases) | 135 | if (aliases) |
| 136 | do_adjust_pte(vma, addr, pfn, ptep); | 136 | do_adjust_pte(vma, addr, pfn, ptep); |
| 137 | else | ||
| 138 | flush_cache_page(vma, addr, pfn); | ||
| 139 | } | 137 | } |
| 140 | 138 | ||
| 141 | /* | 139 | /* |
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 9d40c341e07e..92f5801f99c1 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
| @@ -463,7 +463,12 @@ static struct fsr_info { | |||
| 463 | { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, | 463 | { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, |
| 464 | { do_bad, SIGKILL, 0, "terminal exception" }, | 464 | { do_bad, SIGKILL, 0, "terminal exception" }, |
| 465 | { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, | 465 | { do_bad, SIGILL, BUS_ADRALN, "alignment exception" }, |
| 466 | /* Do we need runtime check ? */ | ||
| 467 | #if __LINUX_ARM_ARCH__ < 6 | ||
| 466 | { do_bad, SIGBUS, 0, "external abort on linefetch" }, | 468 | { do_bad, SIGBUS, 0, "external abort on linefetch" }, |
| 469 | #else | ||
| 470 | { do_translation_fault, SIGSEGV, SEGV_MAPERR, "I-cache maintenance fault" }, | ||
| 471 | #endif | ||
| 467 | { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" }, | 472 | { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" }, |
| 468 | { do_bad, SIGBUS, 0, "external abort on linefetch" }, | 473 | { do_bad, SIGBUS, 0, "external abort on linefetch" }, |
| 469 | { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" }, | 474 | { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" }, |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0ed29bfeba1c..1ba6cf5a2c02 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/mman.h> | 15 | #include <linux/mman.h> |
| 16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
| 17 | #include <linux/initrd.h> | 17 | #include <linux/initrd.h> |
| 18 | #include <linux/sort.h> | ||
| 19 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
| 20 | #include <linux/gfp.h> | 19 | #include <linux/gfp.h> |
| 21 | 20 | ||
| @@ -224,20 +223,6 @@ static int __init check_initrd(struct meminfo *mi) | |||
| 224 | return initrd_node; | 223 | return initrd_node; |
| 225 | } | 224 | } |
| 226 | 225 | ||
| 227 | static inline void map_memory_bank(struct membank *bank) | ||
| 228 | { | ||
| 229 | #ifdef CONFIG_MMU | ||
| 230 | struct map_desc map; | ||
| 231 | |||
| 232 | map.pfn = bank_pfn_start(bank); | ||
| 233 | map.virtual = __phys_to_virt(bank_phys_start(bank)); | ||
| 234 | map.length = bank_phys_size(bank); | ||
| 235 | map.type = MT_MEMORY; | ||
| 236 | |||
| 237 | create_mapping(&map); | ||
| 238 | #endif | ||
| 239 | } | ||
| 240 | |||
| 241 | static void __init bootmem_init_node(int node, struct meminfo *mi, | 226 | static void __init bootmem_init_node(int node, struct meminfo *mi, |
| 242 | unsigned long start_pfn, unsigned long end_pfn) | 227 | unsigned long start_pfn, unsigned long end_pfn) |
| 243 | { | 228 | { |
| @@ -247,16 +232,6 @@ static void __init bootmem_init_node(int node, struct meminfo *mi, | |||
| 247 | int i; | 232 | int i; |
| 248 | 233 | ||
| 249 | /* | 234 | /* |
| 250 | * Map the memory banks for this node. | ||
| 251 | */ | ||
| 252 | for_each_nodebank(i, mi, node) { | ||
| 253 | struct membank *bank = &mi->bank[i]; | ||
| 254 | |||
| 255 | if (!bank->highmem) | ||
| 256 | map_memory_bank(bank); | ||
| 257 | } | ||
| 258 | |||
| 259 | /* | ||
| 260 | * Allocate the bootmem bitmap page. | 235 | * Allocate the bootmem bitmap page. |
| 261 | */ | 236 | */ |
| 262 | boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn); | 237 | boot_pages = bootmem_bootmap_pages(end_pfn - start_pfn); |
| @@ -385,21 +360,12 @@ static void arm_memory_present(struct meminfo *mi, int node) | |||
| 385 | } | 360 | } |
| 386 | #endif | 361 | #endif |
| 387 | 362 | ||
| 388 | static int __init meminfo_cmp(const void *_a, const void *_b) | ||
| 389 | { | ||
| 390 | const struct membank *a = _a, *b = _b; | ||
| 391 | long cmp = bank_pfn_start(a) - bank_pfn_start(b); | ||
| 392 | return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; | ||
| 393 | } | ||
| 394 | |||
| 395 | void __init bootmem_init(void) | 363 | void __init bootmem_init(void) |
| 396 | { | 364 | { |
| 397 | struct meminfo *mi = &meminfo; | 365 | struct meminfo *mi = &meminfo; |
| 398 | unsigned long min, max_low, max_high; | 366 | unsigned long min, max_low, max_high; |
| 399 | int node, initrd_node; | 367 | int node, initrd_node; |
| 400 | 368 | ||
| 401 | sort(&mi->bank, mi->nr_banks, sizeof(mi->bank[0]), meminfo_cmp, NULL); | ||
| 402 | |||
| 403 | /* | 369 | /* |
| 404 | * Locate which node contains the ramdisk image, if any. | 370 | * Locate which node contains the ramdisk image, if any. |
| 405 | */ | 371 | */ |
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index a888363398f8..815d08eecbb0 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h | |||
| @@ -28,10 +28,7 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page | |||
| 28 | 28 | ||
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | struct map_desc; | ||
| 32 | struct meminfo; | ||
| 33 | struct pglist_data; | 31 | struct pglist_data; |
| 34 | 32 | ||
| 35 | void __init create_mapping(struct map_desc *md); | ||
| 36 | void __init bootmem_init(void); | 33 | void __init bootmem_init(void); |
| 37 | void reserve_node_zero(struct pglist_data *pgdat); | 34 | void reserve_node_zero(struct pglist_data *pgdat); |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 241c24a1c18f..e7113d0b8168 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/bootmem.h> | 14 | #include <linux/bootmem.h> |
| 15 | #include <linux/mman.h> | 15 | #include <linux/mman.h> |
| 16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
| 17 | #include <linux/sort.h> | ||
| 17 | 18 | ||
| 18 | #include <asm/cputype.h> | 19 | #include <asm/cputype.h> |
| 19 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
| @@ -603,7 +604,7 @@ static void __init create_36bit_mapping(struct map_desc *md, | |||
| 603 | * offsets, and we take full advantage of sections and | 604 | * offsets, and we take full advantage of sections and |
| 604 | * supersections. | 605 | * supersections. |
| 605 | */ | 606 | */ |
| 606 | void __init create_mapping(struct map_desc *md) | 607 | static void __init create_mapping(struct map_desc *md) |
| 607 | { | 608 | { |
| 608 | unsigned long phys, addr, length, end; | 609 | unsigned long phys, addr, length, end; |
| 609 | const struct mem_type *type; | 610 | const struct mem_type *type; |
| @@ -1017,6 +1018,39 @@ static void __init kmap_init(void) | |||
| 1017 | #endif | 1018 | #endif |
| 1018 | } | 1019 | } |
| 1019 | 1020 | ||
| 1021 | static inline void map_memory_bank(struct membank *bank) | ||
| 1022 | { | ||
| 1023 | struct map_desc map; | ||
| 1024 | |||
| 1025 | map.pfn = bank_pfn_start(bank); | ||
| 1026 | map.virtual = __phys_to_virt(bank_phys_start(bank)); | ||
| 1027 | map.length = bank_phys_size(bank); | ||
| 1028 | map.type = MT_MEMORY; | ||
| 1029 | |||
| 1030 | create_mapping(&map); | ||
| 1031 | } | ||
| 1032 | |||
| 1033 | static void __init map_lowmem(void) | ||
| 1034 | { | ||
| 1035 | struct meminfo *mi = &meminfo; | ||
| 1036 | int i; | ||
| 1037 | |||
| 1038 | /* Map all the lowmem memory banks. */ | ||
| 1039 | for (i = 0; i < mi->nr_banks; i++) { | ||
| 1040 | struct membank *bank = &mi->bank[i]; | ||
| 1041 | |||
| 1042 | if (!bank->highmem) | ||
| 1043 | map_memory_bank(bank); | ||
| 1044 | } | ||
| 1045 | } | ||
| 1046 | |||
| 1047 | static int __init meminfo_cmp(const void *_a, const void *_b) | ||
| 1048 | { | ||
| 1049 | const struct membank *a = _a, *b = _b; | ||
| 1050 | long cmp = bank_pfn_start(a) - bank_pfn_start(b); | ||
| 1051 | return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; | ||
| 1052 | } | ||
| 1053 | |||
| 1020 | /* | 1054 | /* |
| 1021 | * paging_init() sets up the page tables, initialises the zone memory | 1055 | * paging_init() sets up the page tables, initialises the zone memory |
| 1022 | * maps, and sets up the zero page, bad page and bad page tables. | 1056 | * maps, and sets up the zero page, bad page and bad page tables. |
| @@ -1025,9 +1059,12 @@ void __init paging_init(struct machine_desc *mdesc) | |||
| 1025 | { | 1059 | { |
| 1026 | void *zero_page; | 1060 | void *zero_page; |
| 1027 | 1061 | ||
| 1062 | sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL); | ||
| 1063 | |||
| 1028 | build_mem_type_table(); | 1064 | build_mem_type_table(); |
| 1029 | sanity_check_meminfo(); | 1065 | sanity_check_meminfo(); |
| 1030 | prepare_page_table(); | 1066 | prepare_page_table(); |
| 1067 | map_lowmem(); | ||
| 1031 | bootmem_init(); | 1068 | bootmem_init(); |
| 1032 | devicemaps_init(mdesc); | 1069 | devicemaps_init(mdesc); |
| 1033 | kmap_init(); | 1070 | kmap_init(); |
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c index 4c0ab50f399a..cb7658e8acc5 100644 --- a/arch/arm/nwfpe/fpmodule.c +++ b/arch/arm/nwfpe/fpmodule.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include "fpa11.h" | 24 | #include "fpa11.h" |
| 25 | 25 | ||
| 26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| 27 | #include <linux/moduleparam.h> | ||
| 27 | 28 | ||
| 28 | /* XXX */ | 29 | /* XXX */ |
| 29 | #include <linux/errno.h> | 30 | #include <linux/errno.h> |
| @@ -134,13 +135,17 @@ a SIGFPE exception if necessary. If not the relevant bits in the | |||
| 134 | cumulative exceptions flag byte are set and we return. | 135 | cumulative exceptions flag byte are set and we return. |
| 135 | */ | 136 | */ |
| 136 | 137 | ||
| 138 | #ifdef CONFIG_DEBUG_USER | ||
| 139 | /* By default, ignore inexact errors as there are far too many of them to log */ | ||
| 140 | static int debug = ~BIT_IXC; | ||
| 141 | #endif | ||
| 142 | |||
| 137 | void float_raise(signed char flags) | 143 | void float_raise(signed char flags) |
| 138 | { | 144 | { |
| 139 | register unsigned int fpsr, cumulativeTraps; | 145 | register unsigned int fpsr, cumulativeTraps; |
| 140 | 146 | ||
| 141 | #ifdef CONFIG_DEBUG_USER | 147 | #ifdef CONFIG_DEBUG_USER |
| 142 | /* Ignore inexact errors as there are far too many of them to log */ | 148 | if (flags & debug) |
| 143 | if (flags & ~BIT_IXC) | ||
| 144 | printk(KERN_DEBUG | 149 | printk(KERN_DEBUG |
| 145 | "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", | 150 | "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", |
| 146 | current->comm, current->pid, flags, | 151 | current->comm, current->pid, flags, |
| @@ -179,3 +184,7 @@ module_exit(fpe_exit); | |||
| 179 | MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>"); | 184 | MODULE_AUTHOR("Scott Bambrough <scottb@rebel.com>"); |
| 180 | MODULE_DESCRIPTION("NWFPE floating point emulator (" NWFPE_BITS " precision)"); | 185 | MODULE_DESCRIPTION("NWFPE floating point emulator (" NWFPE_BITS " precision)"); |
| 181 | MODULE_LICENSE("GPL"); | 186 | MODULE_LICENSE("GPL"); |
| 187 | |||
| 188 | #ifdef CONFIG_DEBUG_USER | ||
| 189 | module_param(debug, int, 0644); | ||
| 190 | #endif | ||
diff --git a/arch/arm/oprofile/Makefile b/arch/arm/oprofile/Makefile index 88e31f549f50..e666eafed152 100644 --- a/arch/arm/oprofile/Makefile +++ b/arch/arm/oprofile/Makefile | |||
| @@ -6,9 +6,4 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ | |||
| 6 | oprofilefs.o oprofile_stats.o \ | 6 | oprofilefs.o oprofile_stats.o \ |
| 7 | timer_int.o ) | 7 | timer_int.o ) |
| 8 | 8 | ||
| 9 | oprofile-y := $(DRIVER_OBJS) common.o backtrace.o | 9 | oprofile-y := $(DRIVER_OBJS) common.o |
| 10 | oprofile-$(CONFIG_CPU_XSCALE) += op_model_xscale.o | ||
| 11 | oprofile-$(CONFIG_OPROFILE_ARM11_CORE) += op_model_arm11_core.o | ||
| 12 | oprofile-$(CONFIG_OPROFILE_ARMV6) += op_model_v6.o | ||
| 13 | oprofile-$(CONFIG_OPROFILE_MPCORE) += op_model_mpcore.o | ||
| 14 | oprofile-$(CONFIG_OPROFILE_ARMV7) += op_model_v7.o | ||
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c deleted file mode 100644 index d805a52b5032..000000000000 --- a/arch/arm/oprofile/backtrace.c +++ /dev/null | |||
| @@ -1,83 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Arm specific backtracing code for oprofile | ||
| 3 | * | ||
| 4 | * Copyright 2005 Openedhand Ltd. | ||
| 5 | * | ||
| 6 | * Author: Richard Purdie <rpurdie@openedhand.com> | ||
| 7 | * | ||
| 8 | * Based on i386 oprofile backtrace code by John Levon, David Smith | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include <linux/oprofile.h> | ||
| 17 | #include <linux/sched.h> | ||
| 18 | #include <linux/mm.h> | ||
| 19 | #include <linux/uaccess.h> | ||
| 20 | #include <asm/ptrace.h> | ||
| 21 | #include <asm/stacktrace.h> | ||
| 22 | |||
| 23 | static int report_trace(struct stackframe *frame, void *d) | ||
| 24 | { | ||
| 25 | unsigned int *depth = d; | ||
| 26 | |||
| 27 | if (*depth) { | ||
| 28 | oprofile_add_trace(frame->pc); | ||
| 29 | (*depth)--; | ||
| 30 | } | ||
| 31 | |||
| 32 | return *depth == 0; | ||
| 33 | } | ||
| 34 | |||
| 35 | /* | ||
| 36 | * The registers we're interested in are at the end of the variable | ||
| 37 | * length saved register structure. The fp points at the end of this | ||
| 38 | * structure so the address of this struct is: | ||
| 39 | * (struct frame_tail *)(xxx->fp)-1 | ||
| 40 | */ | ||
| 41 | struct frame_tail { | ||
| 42 | struct frame_tail *fp; | ||
| 43 | unsigned long sp; | ||
| 44 | unsigned long lr; | ||
| 45 | } __attribute__((packed)); | ||
| 46 | |||
| 47 | static struct frame_tail* user_backtrace(struct frame_tail *tail) | ||
| 48 | { | ||
| 49 | struct frame_tail buftail[2]; | ||
| 50 | |||
| 51 | /* Also check accessibility of one struct frame_tail beyond */ | ||
| 52 | if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) | ||
| 53 | return NULL; | ||
| 54 | if (__copy_from_user_inatomic(buftail, tail, sizeof(buftail))) | ||
| 55 | return NULL; | ||
| 56 | |||
| 57 | oprofile_add_trace(buftail[0].lr); | ||
| 58 | |||
| 59 | /* frame pointers should strictly progress back up the stack | ||
| 60 | * (towards higher addresses) */ | ||
| 61 | if (tail >= buftail[0].fp) | ||
| 62 | return NULL; | ||
| 63 | |||
| 64 | return buftail[0].fp-1; | ||
| 65 | } | ||
| 66 | |||
| 67 | void arm_backtrace(struct pt_regs * const regs, unsigned int depth) | ||
| 68 | { | ||
| 69 | struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1; | ||
| 70 | |||
| 71 | if (!user_mode(regs)) { | ||
| 72 | struct stackframe frame; | ||
| 73 | frame.fp = regs->ARM_fp; | ||
| 74 | frame.sp = regs->ARM_sp; | ||
| 75 | frame.lr = regs->ARM_lr; | ||
| 76 | frame.pc = regs->ARM_pc; | ||
| 77 | walk_stackframe(&frame, report_trace, &depth); | ||
| 78 | return; | ||
| 79 | } | ||
| 80 | |||
| 81 | while (depth-- && tail && !((unsigned long) tail & 3)) | ||
| 82 | tail = user_backtrace(tail); | ||
| 83 | } | ||
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c index 3fcd752d6146..0691176899ff 100644 --- a/arch/arm/oprofile/common.c +++ b/arch/arm/oprofile/common.c | |||
| @@ -2,32 +2,184 @@ | |||
| 2 | * @file common.c | 2 | * @file common.c |
| 3 | * | 3 | * |
| 4 | * @remark Copyright 2004 Oprofile Authors | 4 | * @remark Copyright 2004 Oprofile Authors |
| 5 | * @remark Copyright 2010 ARM Ltd. | ||
| 5 | * @remark Read the file COPYING | 6 | * @remark Read the file COPYING |
| 6 | * | 7 | * |
| 7 | * @author Zwane Mwaikambo | 8 | * @author Zwane Mwaikambo |
| 9 | * @author Will Deacon [move to perf] | ||
| 8 | */ | 10 | */ |
| 9 | 11 | ||
| 12 | #include <linux/cpumask.h> | ||
| 13 | #include <linux/err.h> | ||
| 14 | #include <linux/errno.h> | ||
| 10 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 16 | #include <linux/mutex.h> | ||
| 11 | #include <linux/oprofile.h> | 17 | #include <linux/oprofile.h> |
| 12 | #include <linux/errno.h> | 18 | #include <linux/perf_event.h> |
| 19 | #include <linux/platform_device.h> | ||
| 13 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
| 14 | #include <linux/sysdev.h> | 21 | #include <asm/stacktrace.h> |
| 15 | #include <linux/mutex.h> | 22 | #include <linux/uaccess.h> |
| 16 | 23 | ||
| 17 | #include "op_counter.h" | 24 | #include <asm/perf_event.h> |
| 18 | #include "op_arm_model.h" | 25 | #include <asm/ptrace.h> |
| 26 | |||
| 27 | #ifdef CONFIG_HW_PERF_EVENTS | ||
| 28 | /* | ||
| 29 | * Per performance monitor configuration as set via oprofilefs. | ||
| 30 | */ | ||
| 31 | struct op_counter_config { | ||
| 32 | unsigned long count; | ||
| 33 | unsigned long enabled; | ||
| 34 | unsigned long event; | ||
| 35 | unsigned long unit_mask; | ||
| 36 | unsigned long kernel; | ||
| 37 | unsigned long user; | ||
| 38 | struct perf_event_attr attr; | ||
| 39 | }; | ||
| 19 | 40 | ||
| 20 | static struct op_arm_model_spec *op_arm_model; | ||
| 21 | static int op_arm_enabled; | 41 | static int op_arm_enabled; |
| 22 | static DEFINE_MUTEX(op_arm_mutex); | 42 | static DEFINE_MUTEX(op_arm_mutex); |
| 23 | 43 | ||
| 24 | struct op_counter_config *counter_config; | 44 | static struct op_counter_config *counter_config; |
| 45 | static struct perf_event **perf_events[nr_cpumask_bits]; | ||
| 46 | static int perf_num_counters; | ||
| 47 | |||
| 48 | /* | ||
| 49 | * Overflow callback for oprofile. | ||
| 50 | */ | ||
| 51 | static void op_overflow_handler(struct perf_event *event, int unused, | ||
| 52 | struct perf_sample_data *data, struct pt_regs *regs) | ||
| 53 | { | ||
| 54 | int id; | ||
| 55 | u32 cpu = smp_processor_id(); | ||
| 56 | |||
| 57 | for (id = 0; id < perf_num_counters; ++id) | ||
| 58 | if (perf_events[cpu][id] == event) | ||
| 59 | break; | ||
| 60 | |||
| 61 | if (id != perf_num_counters) | ||
| 62 | oprofile_add_sample(regs, id); | ||
| 63 | else | ||
| 64 | pr_warning("oprofile: ignoring spurious overflow " | ||
| 65 | "on cpu %u\n", cpu); | ||
| 66 | } | ||
| 67 | |||
| 68 | /* | ||
| 69 | * Called by op_arm_setup to create perf attributes to mirror the oprofile | ||
| 70 | * settings in counter_config. Attributes are created as `pinned' events and | ||
| 71 | * so are permanently scheduled on the PMU. | ||
| 72 | */ | ||
| 73 | static void op_perf_setup(void) | ||
| 74 | { | ||
| 75 | int i; | ||
| 76 | u32 size = sizeof(struct perf_event_attr); | ||
| 77 | struct perf_event_attr *attr; | ||
| 78 | |||
| 79 | for (i = 0; i < perf_num_counters; ++i) { | ||
| 80 | attr = &counter_config[i].attr; | ||
| 81 | memset(attr, 0, size); | ||
| 82 | attr->type = PERF_TYPE_RAW; | ||
| 83 | attr->size = size; | ||
| 84 | attr->config = counter_config[i].event; | ||
| 85 | attr->sample_period = counter_config[i].count; | ||
| 86 | attr->pinned = 1; | ||
| 87 | } | ||
| 88 | } | ||
| 89 | |||
| 90 | static int op_create_counter(int cpu, int event) | ||
| 91 | { | ||
| 92 | int ret = 0; | ||
| 93 | struct perf_event *pevent; | ||
| 94 | |||
| 95 | if (!counter_config[event].enabled || (perf_events[cpu][event] != NULL)) | ||
| 96 | return ret; | ||
| 97 | |||
| 98 | pevent = perf_event_create_kernel_counter(&counter_config[event].attr, | ||
| 99 | cpu, -1, | ||
| 100 | op_overflow_handler); | ||
| 101 | |||
| 102 | if (IS_ERR(pevent)) { | ||
| 103 | ret = PTR_ERR(pevent); | ||
| 104 | } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) { | ||
| 105 | pr_warning("oprofile: failed to enable event %d " | ||
| 106 | "on CPU %d\n", event, cpu); | ||
| 107 | ret = -EBUSY; | ||
| 108 | } else { | ||
| 109 | perf_events[cpu][event] = pevent; | ||
| 110 | } | ||
| 111 | |||
| 112 | return ret; | ||
| 113 | } | ||
| 114 | |||
| 115 | static void op_destroy_counter(int cpu, int event) | ||
| 116 | { | ||
| 117 | struct perf_event *pevent = perf_events[cpu][event]; | ||
| 118 | |||
| 119 | if (pevent) { | ||
| 120 | perf_event_release_kernel(pevent); | ||
| 121 | perf_events[cpu][event] = NULL; | ||
| 122 | } | ||
| 123 | } | ||
| 124 | |||
| 125 | /* | ||
| 126 | * Called by op_arm_start to create active perf events based on the | ||
| 127 | * perviously configured attributes. | ||
| 128 | */ | ||
| 129 | static int op_perf_start(void) | ||
| 130 | { | ||
| 131 | int cpu, event, ret = 0; | ||
| 132 | |||
| 133 | for_each_online_cpu(cpu) { | ||
| 134 | for (event = 0; event < perf_num_counters; ++event) { | ||
| 135 | ret = op_create_counter(cpu, event); | ||
| 136 | if (ret) | ||
| 137 | goto out; | ||
| 138 | } | ||
| 139 | } | ||
| 140 | |||
| 141 | out: | ||
| 142 | return ret; | ||
| 143 | } | ||
| 144 | |||
| 145 | /* | ||
| 146 | * Called by op_arm_stop at the end of a profiling run. | ||
| 147 | */ | ||
| 148 | static void op_perf_stop(void) | ||
| 149 | { | ||
| 150 | int cpu, event; | ||
| 151 | |||
| 152 | for_each_online_cpu(cpu) | ||
| 153 | for (event = 0; event < perf_num_counters; ++event) | ||
| 154 | op_destroy_counter(cpu, event); | ||
| 155 | } | ||
| 156 | |||
| 157 | |||
| 158 | static char *op_name_from_perf_id(enum arm_perf_pmu_ids id) | ||
| 159 | { | ||
| 160 | switch (id) { | ||
| 161 | case ARM_PERF_PMU_ID_XSCALE1: | ||
| 162 | return "arm/xscale1"; | ||
| 163 | case ARM_PERF_PMU_ID_XSCALE2: | ||
| 164 | return "arm/xscale2"; | ||
| 165 | case ARM_PERF_PMU_ID_V6: | ||
| 166 | return "arm/armv6"; | ||
| 167 | case ARM_PERF_PMU_ID_V6MP: | ||
| 168 | return "arm/mpcore"; | ||
| 169 | case ARM_PERF_PMU_ID_CA8: | ||
| 170 | return "arm/armv7"; | ||
| 171 | case ARM_PERF_PMU_ID_CA9: | ||
| 172 | return "arm/armv7-ca9"; | ||
| 173 | default: | ||
| 174 | return NULL; | ||
| 175 | } | ||
| 176 | } | ||
| 25 | 177 | ||
| 26 | static int op_arm_create_files(struct super_block *sb, struct dentry *root) | 178 | static int op_arm_create_files(struct super_block *sb, struct dentry *root) |
| 27 | { | 179 | { |
| 28 | unsigned int i; | 180 | unsigned int i; |
| 29 | 181 | ||
| 30 | for (i = 0; i < op_arm_model->num_counters; i++) { | 182 | for (i = 0; i < perf_num_counters; i++) { |
| 31 | struct dentry *dir; | 183 | struct dentry *dir; |
| 32 | char buf[4]; | 184 | char buf[4]; |
| 33 | 185 | ||
| @@ -46,12 +198,10 @@ static int op_arm_create_files(struct super_block *sb, struct dentry *root) | |||
| 46 | 198 | ||
| 47 | static int op_arm_setup(void) | 199 | static int op_arm_setup(void) |
| 48 | { | 200 | { |
| 49 | int ret; | ||
| 50 | |||
| 51 | spin_lock(&oprofilefs_lock); | 201 | spin_lock(&oprofilefs_lock); |
| 52 | ret = op_arm_model->setup_ctrs(); | 202 | op_perf_setup(); |
| 53 | spin_unlock(&oprofilefs_lock); | 203 | spin_unlock(&oprofilefs_lock); |
| 54 | return ret; | 204 | return 0; |
| 55 | } | 205 | } |
| 56 | 206 | ||
| 57 | static int op_arm_start(void) | 207 | static int op_arm_start(void) |
| @@ -60,8 +210,9 @@ static int op_arm_start(void) | |||
| 60 | 210 | ||
| 61 | mutex_lock(&op_arm_mutex); | 211 | mutex_lock(&op_arm_mutex); |
| 62 | if (!op_arm_enabled) { | 212 | if (!op_arm_enabled) { |
| 63 | ret = op_arm_model->start(); | 213 | ret = 0; |
| 64 | op_arm_enabled = !ret; | 214 | op_perf_start(); |
| 215 | op_arm_enabled = 1; | ||
| 65 | } | 216 | } |
| 66 | mutex_unlock(&op_arm_mutex); | 217 | mutex_unlock(&op_arm_mutex); |
| 67 | return ret; | 218 | return ret; |
| @@ -71,113 +222,205 @@ static void op_arm_stop(void) | |||
| 71 | { | 222 | { |
| 72 | mutex_lock(&op_arm_mutex); | 223 | mutex_lock(&op_arm_mutex); |
| 73 | if (op_arm_enabled) | 224 | if (op_arm_enabled) |
| 74 | op_arm_model->stop(); | 225 | op_perf_stop(); |
| 75 | op_arm_enabled = 0; | 226 | op_arm_enabled = 0; |
| 76 | mutex_unlock(&op_arm_mutex); | 227 | mutex_unlock(&op_arm_mutex); |
| 77 | } | 228 | } |
| 78 | 229 | ||
| 79 | #ifdef CONFIG_PM | 230 | #ifdef CONFIG_PM |
| 80 | static int op_arm_suspend(struct sys_device *dev, pm_message_t state) | 231 | static int op_arm_suspend(struct platform_device *dev, pm_message_t state) |
| 81 | { | 232 | { |
| 82 | mutex_lock(&op_arm_mutex); | 233 | mutex_lock(&op_arm_mutex); |
| 83 | if (op_arm_enabled) | 234 | if (op_arm_enabled) |
| 84 | op_arm_model->stop(); | 235 | op_perf_stop(); |
| 85 | mutex_unlock(&op_arm_mutex); | 236 | mutex_unlock(&op_arm_mutex); |
| 86 | return 0; | 237 | return 0; |
| 87 | } | 238 | } |
| 88 | 239 | ||
| 89 | static int op_arm_resume(struct sys_device *dev) | 240 | static int op_arm_resume(struct platform_device *dev) |
| 90 | { | 241 | { |
| 91 | mutex_lock(&op_arm_mutex); | 242 | mutex_lock(&op_arm_mutex); |
| 92 | if (op_arm_enabled && op_arm_model->start()) | 243 | if (op_arm_enabled && op_perf_start()) |
| 93 | op_arm_enabled = 0; | 244 | op_arm_enabled = 0; |
| 94 | mutex_unlock(&op_arm_mutex); | 245 | mutex_unlock(&op_arm_mutex); |
| 95 | return 0; | 246 | return 0; |
| 96 | } | 247 | } |
| 97 | 248 | ||
| 98 | static struct sysdev_class oprofile_sysclass = { | 249 | static struct platform_driver oprofile_driver = { |
| 99 | .name = "oprofile", | 250 | .driver = { |
| 251 | .name = "arm-oprofile", | ||
| 252 | }, | ||
| 100 | .resume = op_arm_resume, | 253 | .resume = op_arm_resume, |
| 101 | .suspend = op_arm_suspend, | 254 | .suspend = op_arm_suspend, |
| 102 | }; | 255 | }; |
| 103 | 256 | ||
| 104 | static struct sys_device device_oprofile = { | 257 | static struct platform_device *oprofile_pdev; |
| 105 | .id = 0, | ||
| 106 | .cls = &oprofile_sysclass, | ||
| 107 | }; | ||
| 108 | 258 | ||
| 109 | static int __init init_driverfs(void) | 259 | static int __init init_driverfs(void) |
| 110 | { | 260 | { |
| 111 | int ret; | 261 | int ret; |
| 112 | 262 | ||
| 113 | if (!(ret = sysdev_class_register(&oprofile_sysclass))) | 263 | ret = platform_driver_register(&oprofile_driver); |
| 114 | ret = sysdev_register(&device_oprofile); | 264 | if (ret) |
| 265 | goto out; | ||
| 115 | 266 | ||
| 267 | oprofile_pdev = platform_device_register_simple( | ||
| 268 | oprofile_driver.driver.name, 0, NULL, 0); | ||
| 269 | if (IS_ERR(oprofile_pdev)) { | ||
| 270 | ret = PTR_ERR(oprofile_pdev); | ||
| 271 | platform_driver_unregister(&oprofile_driver); | ||
| 272 | } | ||
| 273 | |||
| 274 | out: | ||
| 116 | return ret; | 275 | return ret; |
| 117 | } | 276 | } |
| 118 | 277 | ||
| 119 | static void exit_driverfs(void) | 278 | static void exit_driverfs(void) |
| 120 | { | 279 | { |
| 121 | sysdev_unregister(&device_oprofile); | 280 | platform_device_unregister(oprofile_pdev); |
| 122 | sysdev_class_unregister(&oprofile_sysclass); | 281 | platform_driver_unregister(&oprofile_driver); |
| 123 | } | 282 | } |
| 124 | #else | 283 | #else |
| 125 | #define init_driverfs() do { } while (0) | 284 | static int __init init_driverfs(void) { return 0; } |
| 126 | #define exit_driverfs() do { } while (0) | 285 | #define exit_driverfs() do { } while (0) |
| 127 | #endif /* CONFIG_PM */ | 286 | #endif /* CONFIG_PM */ |
| 128 | 287 | ||
| 129 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 288 | static int report_trace(struct stackframe *frame, void *d) |
| 130 | { | 289 | { |
| 131 | struct op_arm_model_spec *spec = NULL; | 290 | unsigned int *depth = d; |
| 132 | int ret = -ENODEV; | ||
| 133 | 291 | ||
| 134 | ops->backtrace = arm_backtrace; | 292 | if (*depth) { |
| 293 | oprofile_add_trace(frame->pc); | ||
| 294 | (*depth)--; | ||
| 295 | } | ||
| 135 | 296 | ||
| 136 | #ifdef CONFIG_CPU_XSCALE | 297 | return *depth == 0; |
| 137 | spec = &op_xscale_spec; | 298 | } |
| 138 | #endif | ||
| 139 | 299 | ||
| 140 | #ifdef CONFIG_OPROFILE_ARMV6 | 300 | /* |
| 141 | spec = &op_armv6_spec; | 301 | * The registers we're interested in are at the end of the variable |
| 142 | #endif | 302 | * length saved register structure. The fp points at the end of this |
| 303 | * structure so the address of this struct is: | ||
| 304 | * (struct frame_tail *)(xxx->fp)-1 | ||
| 305 | */ | ||
| 306 | struct frame_tail { | ||
| 307 | struct frame_tail *fp; | ||
| 308 | unsigned long sp; | ||
| 309 | unsigned long lr; | ||
| 310 | } __attribute__((packed)); | ||
| 143 | 311 | ||
| 144 | #ifdef CONFIG_OPROFILE_MPCORE | 312 | static struct frame_tail* user_backtrace(struct frame_tail *tail) |
| 145 | spec = &op_mpcore_spec; | 313 | { |
| 146 | #endif | 314 | struct frame_tail buftail[2]; |
| 147 | 315 | ||
| 148 | #ifdef CONFIG_OPROFILE_ARMV7 | 316 | /* Also check accessibility of one struct frame_tail beyond */ |
| 149 | spec = &op_armv7_spec; | 317 | if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) |
| 150 | #endif | 318 | return NULL; |
| 319 | if (__copy_from_user_inatomic(buftail, tail, sizeof(buftail))) | ||
| 320 | return NULL; | ||
| 151 | 321 | ||
| 152 | if (spec) { | 322 | oprofile_add_trace(buftail[0].lr); |
| 153 | ret = spec->init(); | ||
| 154 | if (ret < 0) | ||
| 155 | return ret; | ||
| 156 | 323 | ||
| 157 | counter_config = kcalloc(spec->num_counters, sizeof(struct op_counter_config), | 324 | /* frame pointers should strictly progress back up the stack |
| 158 | GFP_KERNEL); | 325 | * (towards higher addresses) */ |
| 159 | if (!counter_config) | 326 | if (tail >= buftail[0].fp) |
| 160 | return -ENOMEM; | 327 | return NULL; |
| 161 | 328 | ||
| 162 | op_arm_model = spec; | 329 | return buftail[0].fp-1; |
| 163 | init_driverfs(); | 330 | } |
| 164 | ops->create_files = op_arm_create_files; | 331 | |
| 165 | ops->setup = op_arm_setup; | 332 | static void arm_backtrace(struct pt_regs * const regs, unsigned int depth) |
| 166 | ops->shutdown = op_arm_stop; | 333 | { |
| 167 | ops->start = op_arm_start; | 334 | struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1; |
| 168 | ops->stop = op_arm_stop; | 335 | |
| 169 | ops->cpu_type = op_arm_model->name; | 336 | if (!user_mode(regs)) { |
| 170 | printk(KERN_INFO "oprofile: using %s\n", spec->name); | 337 | struct stackframe frame; |
| 338 | frame.fp = regs->ARM_fp; | ||
| 339 | frame.sp = regs->ARM_sp; | ||
| 340 | frame.lr = regs->ARM_lr; | ||
| 341 | frame.pc = regs->ARM_pc; | ||
| 342 | walk_stackframe(&frame, report_trace, &depth); | ||
| 343 | return; | ||
| 171 | } | 344 | } |
| 172 | 345 | ||
| 346 | while (depth-- && tail && !((unsigned long) tail & 3)) | ||
| 347 | tail = user_backtrace(tail); | ||
| 348 | } | ||
| 349 | |||
| 350 | int __init oprofile_arch_init(struct oprofile_operations *ops) | ||
| 351 | { | ||
| 352 | int cpu, ret = 0; | ||
| 353 | |||
| 354 | perf_num_counters = armpmu_get_max_events(); | ||
| 355 | |||
| 356 | counter_config = kcalloc(perf_num_counters, | ||
| 357 | sizeof(struct op_counter_config), GFP_KERNEL); | ||
| 358 | |||
| 359 | if (!counter_config) { | ||
| 360 | pr_info("oprofile: failed to allocate %d " | ||
| 361 | "counters\n", perf_num_counters); | ||
| 362 | return -ENOMEM; | ||
| 363 | } | ||
| 364 | |||
| 365 | ret = init_driverfs(); | ||
| 366 | if (ret) { | ||
| 367 | kfree(counter_config); | ||
| 368 | return ret; | ||
| 369 | } | ||
| 370 | |||
| 371 | for_each_possible_cpu(cpu) { | ||
| 372 | perf_events[cpu] = kcalloc(perf_num_counters, | ||
| 373 | sizeof(struct perf_event *), GFP_KERNEL); | ||
| 374 | if (!perf_events[cpu]) { | ||
| 375 | pr_info("oprofile: failed to allocate %d perf events " | ||
| 376 | "for cpu %d\n", perf_num_counters, cpu); | ||
| 377 | while (--cpu >= 0) | ||
| 378 | kfree(perf_events[cpu]); | ||
| 379 | return -ENOMEM; | ||
| 380 | } | ||
| 381 | } | ||
| 382 | |||
| 383 | ops->backtrace = arm_backtrace; | ||
| 384 | ops->create_files = op_arm_create_files; | ||
| 385 | ops->setup = op_arm_setup; | ||
| 386 | ops->start = op_arm_start; | ||
| 387 | ops->stop = op_arm_stop; | ||
| 388 | ops->shutdown = op_arm_stop; | ||
| 389 | ops->cpu_type = op_name_from_perf_id(armpmu_get_pmu_id()); | ||
| 390 | |||
| 391 | if (!ops->cpu_type) | ||
| 392 | ret = -ENODEV; | ||
| 393 | else | ||
| 394 | pr_info("oprofile: using %s\n", ops->cpu_type); | ||
| 395 | |||
| 173 | return ret; | 396 | return ret; |
| 174 | } | 397 | } |
| 175 | 398 | ||
| 176 | void oprofile_arch_exit(void) | 399 | void oprofile_arch_exit(void) |
| 177 | { | 400 | { |
| 178 | if (op_arm_model) { | 401 | int cpu, id; |
| 402 | struct perf_event *event; | ||
| 403 | |||
| 404 | if (*perf_events) { | ||
| 179 | exit_driverfs(); | 405 | exit_driverfs(); |
| 180 | op_arm_model = NULL; | 406 | for_each_possible_cpu(cpu) { |
| 407 | for (id = 0; id < perf_num_counters; ++id) { | ||
| 408 | event = perf_events[cpu][id]; | ||
| 409 | if (event != NULL) | ||
| 410 | perf_event_release_kernel(event); | ||
| 411 | } | ||
| 412 | kfree(perf_events[cpu]); | ||
| 413 | } | ||
| 181 | } | 414 | } |
| 182 | kfree(counter_config); | 415 | |
| 416 | if (counter_config) | ||
| 417 | kfree(counter_config); | ||
| 418 | } | ||
| 419 | #else | ||
| 420 | int __init oprofile_arch_init(struct oprofile_operations *ops) | ||
| 421 | { | ||
| 422 | pr_info("oprofile: hardware counters not available\n"); | ||
| 423 | return -ENODEV; | ||
| 183 | } | 424 | } |
| 425 | void oprofile_arch_exit(void) {} | ||
| 426 | #endif /* CONFIG_HW_PERF_EVENTS */ | ||
diff --git a/arch/arm/oprofile/op_arm_model.h b/arch/arm/oprofile/op_arm_model.h deleted file mode 100644 index 8c4e4f6a1de3..000000000000 --- a/arch/arm/oprofile/op_arm_model.h +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file op_arm_model.h | ||
| 3 | * interface to ARM machine specific operations | ||
| 4 | * | ||
| 5 | * @remark Copyright 2004 Oprofile Authors | ||
| 6 | * @remark Read the file COPYING | ||
| 7 | * | ||
| 8 | * @author Zwane Mwaikambo | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef OP_ARM_MODEL_H | ||
| 12 | #define OP_ARM_MODEL_H | ||
| 13 | |||
| 14 | struct op_arm_model_spec { | ||
| 15 | int (*init)(void); | ||
| 16 | unsigned int num_counters; | ||
| 17 | int (*setup_ctrs)(void); | ||
| 18 | int (*start)(void); | ||
| 19 | void (*stop)(void); | ||
| 20 | char *name; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #ifdef CONFIG_CPU_XSCALE | ||
| 24 | extern struct op_arm_model_spec op_xscale_spec; | ||
| 25 | #endif | ||
| 26 | |||
| 27 | extern struct op_arm_model_spec op_armv6_spec; | ||
| 28 | extern struct op_arm_model_spec op_mpcore_spec; | ||
| 29 | extern struct op_arm_model_spec op_armv7_spec; | ||
| 30 | |||
| 31 | extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth); | ||
| 32 | |||
| 33 | extern int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec); | ||
| 34 | extern void op_arm_exit(void); | ||
| 35 | #endif /* OP_ARM_MODEL_H */ | ||
diff --git a/arch/arm/oprofile/op_counter.h b/arch/arm/oprofile/op_counter.h deleted file mode 100644 index ca942a63b52f..000000000000 --- a/arch/arm/oprofile/op_counter.h +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file op_counter.h | ||
| 3 | * | ||
| 4 | * @remark Copyright 2004 Oprofile Authors | ||
| 5 | * @remark Read the file COPYING | ||
| 6 | * | ||
| 7 | * @author Zwane Mwaikambo | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef OP_COUNTER_H | ||
| 11 | #define OP_COUNTER_H | ||
| 12 | |||
| 13 | /* Per performance monitor configuration as set via | ||
| 14 | * oprofilefs. | ||
| 15 | */ | ||
| 16 | struct op_counter_config { | ||
| 17 | unsigned long count; | ||
| 18 | unsigned long enabled; | ||
| 19 | unsigned long event; | ||
| 20 | unsigned long unit_mask; | ||
| 21 | unsigned long kernel; | ||
| 22 | unsigned long user; | ||
| 23 | }; | ||
| 24 | |||
| 25 | extern struct op_counter_config *counter_config; | ||
| 26 | |||
| 27 | #endif /* OP_COUNTER_H */ | ||
diff --git a/arch/arm/oprofile/op_model_arm11_core.c b/arch/arm/oprofile/op_model_arm11_core.c deleted file mode 100644 index ef3e2653b90c..000000000000 --- a/arch/arm/oprofile/op_model_arm11_core.c +++ /dev/null | |||
| @@ -1,162 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file op_model_arm11_core.c | ||
| 3 | * ARM11 Event Monitor Driver | ||
| 4 | * @remark Copyright 2004 ARM SMP Development Team | ||
| 5 | */ | ||
| 6 | #include <linux/types.h> | ||
| 7 | #include <linux/errno.h> | ||
| 8 | #include <linux/oprofile.h> | ||
| 9 | #include <linux/interrupt.h> | ||
| 10 | #include <linux/irq.h> | ||
| 11 | #include <linux/smp.h> | ||
| 12 | |||
| 13 | #include "op_counter.h" | ||
| 14 | #include "op_arm_model.h" | ||
| 15 | #include "op_model_arm11_core.h" | ||
| 16 | |||
| 17 | /* | ||
| 18 | * ARM11 PMU support | ||
| 19 | */ | ||
| 20 | static inline void arm11_write_pmnc(u32 val) | ||
| 21 | { | ||
| 22 | /* upper 4bits and 7, 11 are write-as-0 */ | ||
| 23 | val &= 0x0ffff77f; | ||
| 24 | asm volatile("mcr p15, 0, %0, c15, c12, 0" : : "r" (val)); | ||
| 25 | } | ||
| 26 | |||
| 27 | static inline u32 arm11_read_pmnc(void) | ||
| 28 | { | ||
| 29 | u32 val; | ||
| 30 | asm volatile("mrc p15, 0, %0, c15, c12, 0" : "=r" (val)); | ||
| 31 | return val; | ||
| 32 | } | ||
| 33 | |||
| 34 | static void arm11_reset_counter(unsigned int cnt) | ||
| 35 | { | ||
| 36 | u32 val = -(u32)counter_config[CPU_COUNTER(smp_processor_id(), cnt)].count; | ||
| 37 | switch (cnt) { | ||
| 38 | case CCNT: | ||
| 39 | asm volatile("mcr p15, 0, %0, c15, c12, 1" : : "r" (val)); | ||
| 40 | break; | ||
| 41 | |||
| 42 | case PMN0: | ||
| 43 | asm volatile("mcr p15, 0, %0, c15, c12, 2" : : "r" (val)); | ||
| 44 | break; | ||
| 45 | |||
| 46 | case PMN1: | ||
| 47 | asm volatile("mcr p15, 0, %0, c15, c12, 3" : : "r" (val)); | ||
| 48 | break; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | int arm11_setup_pmu(void) | ||
| 53 | { | ||
| 54 | unsigned int cnt; | ||
| 55 | u32 pmnc; | ||
| 56 | |||
| 57 | if (arm11_read_pmnc() & PMCR_E) { | ||
| 58 | printk(KERN_ERR "oprofile: CPU%u PMU still enabled when setup new event counter.\n", smp_processor_id()); | ||
| 59 | return -EBUSY; | ||
| 60 | } | ||
| 61 | |||
| 62 | /* initialize PMNC, reset overflow, D bit, C bit and P bit. */ | ||
| 63 | arm11_write_pmnc(PMCR_OFL_PMN0 | PMCR_OFL_PMN1 | PMCR_OFL_CCNT | | ||
| 64 | PMCR_C | PMCR_P); | ||
| 65 | |||
| 66 | for (pmnc = 0, cnt = PMN0; cnt <= CCNT; cnt++) { | ||
| 67 | unsigned long event; | ||
| 68 | |||
| 69 | if (!counter_config[CPU_COUNTER(smp_processor_id(), cnt)].enabled) | ||
| 70 | continue; | ||
| 71 | |||
| 72 | event = counter_config[CPU_COUNTER(smp_processor_id(), cnt)].event & 255; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Set event (if destined for PMNx counters) | ||
| 76 | */ | ||
| 77 | if (cnt == PMN0) { | ||
| 78 | pmnc |= event << 20; | ||
| 79 | } else if (cnt == PMN1) { | ||
| 80 | pmnc |= event << 12; | ||
| 81 | } | ||
| 82 | |||
| 83 | /* | ||
| 84 | * We don't need to set the event if it's a cycle count | ||
| 85 | * Enable interrupt for this counter | ||
| 86 | */ | ||
| 87 | pmnc |= PMCR_IEN_PMN0 << cnt; | ||
| 88 | arm11_reset_counter(cnt); | ||
| 89 | } | ||
| 90 | arm11_write_pmnc(pmnc); | ||
| 91 | |||
| 92 | return 0; | ||
| 93 | } | ||
| 94 | |||
| 95 | int arm11_start_pmu(void) | ||
| 96 | { | ||
| 97 | arm11_write_pmnc(arm11_read_pmnc() | PMCR_E); | ||
| 98 | return 0; | ||
| 99 | } | ||
| 100 | |||
| 101 | int arm11_stop_pmu(void) | ||
| 102 | { | ||
| 103 | unsigned int cnt; | ||
| 104 | |||
| 105 | arm11_write_pmnc(arm11_read_pmnc() & ~PMCR_E); | ||
| 106 | |||
| 107 | for (cnt = PMN0; cnt <= CCNT; cnt++) | ||
| 108 | arm11_reset_counter(cnt); | ||
| 109 | |||
| 110 | return 0; | ||
| 111 | } | ||
| 112 | |||
| 113 | /* | ||
| 114 | * CPU counters' IRQ handler (one IRQ per CPU) | ||
| 115 | */ | ||
| 116 | static irqreturn_t arm11_pmu_interrupt(int irq, void *arg) | ||
| 117 | { | ||
| 118 | struct pt_regs *regs = get_irq_regs(); | ||
| 119 | unsigned int cnt; | ||
| 120 | u32 pmnc; | ||
| 121 | |||
| 122 | pmnc = arm11_read_pmnc(); | ||
| 123 | |||
| 124 | for (cnt = PMN0; cnt <= CCNT; cnt++) { | ||
| 125 | if ((pmnc & (PMCR_OFL_PMN0 << cnt)) && (pmnc & (PMCR_IEN_PMN0 << cnt))) { | ||
| 126 | arm11_reset_counter(cnt); | ||
| 127 | oprofile_add_sample(regs, CPU_COUNTER(smp_processor_id(), cnt)); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | /* Clear counter flag(s) */ | ||
| 131 | arm11_write_pmnc(pmnc); | ||
| 132 | return IRQ_HANDLED; | ||
| 133 | } | ||
| 134 | |||
| 135 | int arm11_request_interrupts(const int *irqs, int nr) | ||
| 136 | { | ||
| 137 | unsigned int i; | ||
| 138 | int ret = 0; | ||
| 139 | |||
| 140 | for(i = 0; i < nr; i++) { | ||
| 141 | ret = request_irq(irqs[i], arm11_pmu_interrupt, IRQF_DISABLED, "CP15 PMU", NULL); | ||
| 142 | if (ret != 0) { | ||
| 143 | printk(KERN_ERR "oprofile: unable to request IRQ%u for MPCORE-EM\n", | ||
| 144 | irqs[i]); | ||
| 145 | break; | ||
| 146 | } | ||
| 147 | } | ||
| 148 | |||
| 149 | if (i != nr) | ||
| 150 | while (i-- != 0) | ||
| 151 | free_irq(irqs[i], NULL); | ||
| 152 | |||
| 153 | return ret; | ||
| 154 | } | ||
| 155 | |||
| 156 | void arm11_release_interrupts(const int *irqs, int nr) | ||
| 157 | { | ||
| 158 | unsigned int i; | ||
| 159 | |||
| 160 | for (i = 0; i < nr; i++) | ||
| 161 | free_irq(irqs[i], NULL); | ||
| 162 | } | ||
diff --git a/arch/arm/oprofile/op_model_arm11_core.h b/arch/arm/oprofile/op_model_arm11_core.h deleted file mode 100644 index 1902b99d9dfd..000000000000 --- a/arch/arm/oprofile/op_model_arm11_core.h +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file op_model_arm11_core.h | ||
| 3 | * ARM11 Event Monitor Driver | ||
| 4 | * @remark Copyright 2004 ARM SMP Development Team | ||
| 5 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
| 6 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
| 7 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
| 8 | * @remark Copyright 2004 Intel Corporation | ||
| 9 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
| 10 | * @remark Copyright 2004 Oprofile Authors | ||
| 11 | * | ||
| 12 | * @remark Read the file COPYING | ||
| 13 | * | ||
| 14 | * @author Zwane Mwaikambo | ||
| 15 | */ | ||
| 16 | #ifndef OP_MODEL_ARM11_CORE_H | ||
| 17 | #define OP_MODEL_ARM11_CORE_H | ||
| 18 | |||
| 19 | /* | ||
| 20 | * Per-CPU PMCR | ||
| 21 | */ | ||
| 22 | #define PMCR_E (1 << 0) /* Enable */ | ||
| 23 | #define PMCR_P (1 << 1) /* Count reset */ | ||
| 24 | #define PMCR_C (1 << 2) /* Cycle counter reset */ | ||
| 25 | #define PMCR_D (1 << 3) /* Cycle counter counts every 64th cpu cycle */ | ||
| 26 | #define PMCR_IEN_PMN0 (1 << 4) /* Interrupt enable count reg 0 */ | ||
| 27 | #define PMCR_IEN_PMN1 (1 << 5) /* Interrupt enable count reg 1 */ | ||
| 28 | #define PMCR_IEN_CCNT (1 << 6) /* Interrupt enable cycle counter */ | ||
| 29 | #define PMCR_OFL_PMN0 (1 << 8) /* Count reg 0 overflow */ | ||
| 30 | #define PMCR_OFL_PMN1 (1 << 9) /* Count reg 1 overflow */ | ||
| 31 | #define PMCR_OFL_CCNT (1 << 10) /* Cycle counter overflow */ | ||
| 32 | |||
| 33 | #define PMN0 0 | ||
| 34 | #define PMN1 1 | ||
| 35 | #define CCNT 2 | ||
| 36 | |||
| 37 | #define CPU_COUNTER(cpu, counter) ((cpu) * 3 + (counter)) | ||
| 38 | |||
| 39 | int arm11_setup_pmu(void); | ||
| 40 | int arm11_start_pmu(void); | ||
| 41 | int arm11_stop_pmu(void); | ||
| 42 | int arm11_request_interrupts(const int *, int); | ||
| 43 | void arm11_release_interrupts(const int *, int); | ||
| 44 | |||
| 45 | #endif | ||
diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c deleted file mode 100644 index f73ce875a395..000000000000 --- a/arch/arm/oprofile/op_model_mpcore.c +++ /dev/null | |||
| @@ -1,306 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file op_model_mpcore.c | ||
| 3 | * MPCORE Event Monitor Driver | ||
| 4 | * @remark Copyright 2004 ARM SMP Development Team | ||
| 5 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
| 6 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
| 7 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
| 8 | * @remark Copyright 2004 Intel Corporation | ||
| 9 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
| 10 | * @remark Copyright 2004 Oprofile Authors | ||
| 11 | * | ||
| 12 | * @remark Read the file COPYING | ||
| 13 | * | ||
| 14 | * @author Zwane Mwaikambo | ||
| 15 | * | ||
| 16 | * Counters: | ||
| 17 | * 0: PMN0 on CPU0, per-cpu configurable event counter | ||
| 18 | * 1: PMN1 on CPU0, per-cpu configurable event counter | ||
| 19 | * 2: CCNT on CPU0 | ||
| 20 | * 3: PMN0 on CPU1 | ||
| 21 | * 4: PMN1 on CPU1 | ||
| 22 | * 5: CCNT on CPU1 | ||
| 23 | * 6: PMN0 on CPU1 | ||
| 24 | * 7: PMN1 on CPU1 | ||
| 25 | * 8: CCNT on CPU1 | ||
| 26 | * 9: PMN0 on CPU1 | ||
| 27 | * 10: PMN1 on CPU1 | ||
| 28 | * 11: CCNT on CPU1 | ||
| 29 | * 12-19: configurable SCU event counters | ||
| 30 | */ | ||
| 31 | |||
| 32 | /* #define DEBUG */ | ||
| 33 | #include <linux/types.h> | ||
| 34 | #include <linux/errno.h> | ||
| 35 | #include <linux/err.h> | ||
| 36 | #include <linux/sched.h> | ||
| 37 | #include <linux/oprofile.h> | ||
| 38 | #include <linux/interrupt.h> | ||
| 39 | #include <linux/smp.h> | ||
| 40 | #include <linux/io.h> | ||
| 41 | |||
| 42 | #include <asm/irq.h> | ||
| 43 | #include <asm/mach/irq.h> | ||
| 44 | #include <mach/hardware.h> | ||
| 45 | #include <mach/board-eb.h> | ||
| 46 | #include <asm/system.h> | ||
| 47 | #include <asm/pmu.h> | ||
| 48 | |||
| 49 | #include "op_counter.h" | ||
| 50 | #include "op_arm_model.h" | ||
| 51 | #include "op_model_arm11_core.h" | ||
| 52 | #include "op_model_mpcore.h" | ||
| 53 | |||
| 54 | /* | ||
| 55 | * MPCore SCU event monitor support | ||
| 56 | */ | ||
| 57 | #define SCU_EVENTMONITORS_VA_BASE __io_address(REALVIEW_EB11MP_SCU_BASE + 0x10) | ||
| 58 | |||
| 59 | /* | ||
| 60 | * Bitmask of used SCU counters | ||
| 61 | */ | ||
| 62 | static unsigned int scu_em_used; | ||
| 63 | static const struct pmu_irqs *pmu_irqs; | ||
| 64 | |||
| 65 | /* | ||
| 66 | * 2 helper fns take a counter number from 0-7 (not the userspace-visible counter number) | ||
| 67 | */ | ||
| 68 | static inline void scu_reset_counter(struct eventmonitor __iomem *emc, unsigned int n) | ||
| 69 | { | ||
| 70 | writel(-(u32)counter_config[SCU_COUNTER(n)].count, &emc->MC[n]); | ||
| 71 | } | ||
| 72 | |||
| 73 | static inline void scu_set_event(struct eventmonitor __iomem *emc, unsigned int n, u32 event) | ||
| 74 | { | ||
| 75 | event &= 0xff; | ||
| 76 | writeb(event, &emc->MCEB[n]); | ||
| 77 | } | ||
| 78 | |||
| 79 | /* | ||
| 80 | * SCU counters' IRQ handler (one IRQ per counter => 2 IRQs per CPU) | ||
| 81 | */ | ||
| 82 | static irqreturn_t scu_em_interrupt(int irq, void *arg) | ||
| 83 | { | ||
| 84 | struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE; | ||
| 85 | unsigned int cnt; | ||
| 86 | |||
| 87 | cnt = irq - IRQ_EB11MP_PMU_SCU0; | ||
| 88 | oprofile_add_sample(get_irq_regs(), SCU_COUNTER(cnt)); | ||
| 89 | scu_reset_counter(emc, cnt); | ||
| 90 | |||
| 91 | /* Clear overflow flag for this counter */ | ||
| 92 | writel(1 << (cnt + 16), &emc->PMCR); | ||
| 93 | |||
| 94 | return IRQ_HANDLED; | ||
| 95 | } | ||
| 96 | |||
| 97 | /* Configure just the SCU counters that the user has requested */ | ||
| 98 | static void scu_setup(void) | ||
| 99 | { | ||
| 100 | struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE; | ||
| 101 | unsigned int i; | ||
| 102 | |||
| 103 | scu_em_used = 0; | ||
| 104 | |||
| 105 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
| 106 | if (counter_config[SCU_COUNTER(i)].enabled && | ||
| 107 | counter_config[SCU_COUNTER(i)].event) { | ||
| 108 | scu_set_event(emc, i, 0); /* disable counter for now */ | ||
| 109 | scu_em_used |= 1 << i; | ||
| 110 | } | ||
| 111 | } | ||
| 112 | } | ||
| 113 | |||
| 114 | static int scu_start(void) | ||
| 115 | { | ||
| 116 | struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE; | ||
| 117 | unsigned int temp, i; | ||
| 118 | unsigned long event; | ||
| 119 | int ret = 0; | ||
| 120 | |||
| 121 | /* | ||
| 122 | * request the SCU counter interrupts that we need | ||
| 123 | */ | ||
| 124 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
| 125 | if (scu_em_used & (1 << i)) { | ||
| 126 | ret = request_irq(IRQ_EB11MP_PMU_SCU0 + i, scu_em_interrupt, IRQF_DISABLED, "SCU PMU", NULL); | ||
| 127 | if (ret) { | ||
| 128 | printk(KERN_ERR "oprofile: unable to request IRQ%u for SCU Event Monitor\n", | ||
| 129 | IRQ_EB11MP_PMU_SCU0 + i); | ||
| 130 | goto err_free_scu; | ||
| 131 | } | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 135 | /* | ||
| 136 | * clear overflow and enable interrupt for all used counters | ||
| 137 | */ | ||
| 138 | temp = readl(&emc->PMCR); | ||
| 139 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
| 140 | if (scu_em_used & (1 << i)) { | ||
| 141 | scu_reset_counter(emc, i); | ||
| 142 | event = counter_config[SCU_COUNTER(i)].event; | ||
| 143 | scu_set_event(emc, i, event); | ||
| 144 | |||
| 145 | /* clear overflow/interrupt */ | ||
| 146 | temp |= 1 << (i + 16); | ||
| 147 | /* enable interrupt*/ | ||
| 148 | temp |= 1 << (i + 8); | ||
| 149 | } | ||
| 150 | } | ||
| 151 | |||
| 152 | /* Enable all 8 counters */ | ||
| 153 | temp |= PMCR_E; | ||
| 154 | writel(temp, &emc->PMCR); | ||
| 155 | |||
| 156 | return 0; | ||
| 157 | |||
| 158 | err_free_scu: | ||
| 159 | while (i--) | ||
| 160 | free_irq(IRQ_EB11MP_PMU_SCU0 + i, NULL); | ||
| 161 | return ret; | ||
| 162 | } | ||
| 163 | |||
| 164 | static void scu_stop(void) | ||
| 165 | { | ||
| 166 | struct eventmonitor __iomem *emc = SCU_EVENTMONITORS_VA_BASE; | ||
| 167 | unsigned int temp, i; | ||
| 168 | |||
| 169 | /* Disable counter interrupts */ | ||
| 170 | /* Don't disable all 8 counters (with the E bit) as they may be in use */ | ||
| 171 | temp = readl(&emc->PMCR); | ||
| 172 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
| 173 | if (scu_em_used & (1 << i)) | ||
| 174 | temp &= ~(1 << (i + 8)); | ||
| 175 | } | ||
| 176 | writel(temp, &emc->PMCR); | ||
| 177 | |||
| 178 | /* Free counter interrupts and reset counters */ | ||
| 179 | for (i = 0; i < NUM_SCU_COUNTERS; i++) { | ||
| 180 | if (scu_em_used & (1 << i)) { | ||
| 181 | scu_reset_counter(emc, i); | ||
| 182 | free_irq(IRQ_EB11MP_PMU_SCU0 + i, NULL); | ||
| 183 | } | ||
| 184 | } | ||
| 185 | } | ||
| 186 | |||
| 187 | struct em_function_data { | ||
| 188 | int (*fn)(void); | ||
| 189 | int ret; | ||
| 190 | }; | ||
| 191 | |||
| 192 | static void em_func(void *data) | ||
| 193 | { | ||
| 194 | struct em_function_data *d = data; | ||
| 195 | int ret = d->fn(); | ||
| 196 | if (ret) | ||
| 197 | d->ret = ret; | ||
| 198 | } | ||
| 199 | |||
| 200 | static int em_call_function(int (*fn)(void)) | ||
| 201 | { | ||
| 202 | struct em_function_data data; | ||
| 203 | |||
| 204 | data.fn = fn; | ||
| 205 | data.ret = 0; | ||
| 206 | |||
| 207 | preempt_disable(); | ||
| 208 | smp_call_function(em_func, &data, 1); | ||
| 209 | em_func(&data); | ||
| 210 | preempt_enable(); | ||
| 211 | |||
| 212 | return data.ret; | ||
| 213 | } | ||
| 214 | |||
| 215 | /* | ||
| 216 | * Glue to stick the individual ARM11 PMUs and the SCU | ||
| 217 | * into the oprofile framework. | ||
| 218 | */ | ||
| 219 | static int em_setup_ctrs(void) | ||
| 220 | { | ||
| 221 | int ret; | ||
| 222 | |||
| 223 | /* Configure CPU counters by cross-calling to the other CPUs */ | ||
| 224 | ret = em_call_function(arm11_setup_pmu); | ||
| 225 | if (ret == 0) | ||
| 226 | scu_setup(); | ||
| 227 | |||
| 228 | return 0; | ||
| 229 | } | ||
| 230 | |||
| 231 | static int em_start(void) | ||
| 232 | { | ||
| 233 | int ret; | ||
| 234 | |||
| 235 | pmu_irqs = reserve_pmu(); | ||
| 236 | if (IS_ERR(pmu_irqs)) { | ||
| 237 | ret = PTR_ERR(pmu_irqs); | ||
| 238 | goto out; | ||
| 239 | } | ||
| 240 | |||
| 241 | ret = arm11_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
| 242 | if (ret == 0) { | ||
| 243 | em_call_function(arm11_start_pmu); | ||
| 244 | |||
| 245 | ret = scu_start(); | ||
| 246 | if (ret) { | ||
| 247 | arm11_release_interrupts(pmu_irqs->irqs, | ||
| 248 | pmu_irqs->num_irqs); | ||
| 249 | } else { | ||
| 250 | release_pmu(pmu_irqs); | ||
| 251 | pmu_irqs = NULL; | ||
| 252 | } | ||
| 253 | } | ||
| 254 | |||
| 255 | out: | ||
| 256 | return ret; | ||
| 257 | } | ||
| 258 | |||
| 259 | static void em_stop(void) | ||
| 260 | { | ||
| 261 | em_call_function(arm11_stop_pmu); | ||
| 262 | arm11_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
| 263 | scu_stop(); | ||
| 264 | release_pmu(pmu_irqs); | ||
| 265 | } | ||
| 266 | |||
| 267 | /* | ||
| 268 | * Why isn't there a function to route an IRQ to a specific CPU in | ||
| 269 | * genirq? | ||
| 270 | */ | ||
| 271 | static void em_route_irq(int irq, unsigned int cpu) | ||
| 272 | { | ||
| 273 | struct irq_desc *desc = irq_desc + irq; | ||
| 274 | const struct cpumask *mask = cpumask_of(cpu); | ||
| 275 | |||
| 276 | spin_lock_irq(&desc->lock); | ||
| 277 | cpumask_copy(desc->affinity, mask); | ||
| 278 | desc->chip->set_affinity(irq, mask); | ||
| 279 | spin_unlock_irq(&desc->lock); | ||
| 280 | } | ||
| 281 | |||
| 282 | static int em_setup(void) | ||
| 283 | { | ||
| 284 | /* | ||
| 285 | * Send SCU PMU interrupts to the "owner" CPU. | ||
| 286 | */ | ||
| 287 | em_route_irq(IRQ_EB11MP_PMU_SCU0, 0); | ||
| 288 | em_route_irq(IRQ_EB11MP_PMU_SCU1, 0); | ||
| 289 | em_route_irq(IRQ_EB11MP_PMU_SCU2, 1); | ||
| 290 | em_route_irq(IRQ_EB11MP_PMU_SCU3, 1); | ||
| 291 | em_route_irq(IRQ_EB11MP_PMU_SCU4, 2); | ||
| 292 | em_route_irq(IRQ_EB11MP_PMU_SCU5, 2); | ||
| 293 | em_route_irq(IRQ_EB11MP_PMU_SCU6, 3); | ||
| 294 | em_route_irq(IRQ_EB11MP_PMU_SCU7, 3); | ||
| 295 | |||
| 296 | return init_pmu(); | ||
| 297 | } | ||
| 298 | |||
| 299 | struct op_arm_model_spec op_mpcore_spec = { | ||
| 300 | .init = em_setup, | ||
| 301 | .num_counters = MPCORE_NUM_COUNTERS, | ||
| 302 | .setup_ctrs = em_setup_ctrs, | ||
| 303 | .start = em_start, | ||
| 304 | .stop = em_stop, | ||
| 305 | .name = "arm/mpcore", | ||
| 306 | }; | ||
diff --git a/arch/arm/oprofile/op_model_mpcore.h b/arch/arm/oprofile/op_model_mpcore.h deleted file mode 100644 index 73d811023688..000000000000 --- a/arch/arm/oprofile/op_model_mpcore.h +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file op_model_mpcore.c | ||
| 3 | * MPCORE Event Monitor Driver | ||
| 4 | * @remark Copyright 2004 ARM SMP Development Team | ||
| 5 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
| 6 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
| 7 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
| 8 | * @remark Copyright 2004 Intel Corporation | ||
| 9 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
| 10 | * @remark Copyright 2004 Oprofile Authors | ||
| 11 | * | ||
| 12 | * @remark Read the file COPYING | ||
| 13 | * | ||
| 14 | * @author Zwane Mwaikambo | ||
| 15 | */ | ||
| 16 | #ifndef OP_MODEL_MPCORE_H | ||
| 17 | #define OP_MODEL_MPCORE_H | ||
| 18 | |||
| 19 | struct eventmonitor { | ||
| 20 | unsigned long PMCR; | ||
| 21 | unsigned char MCEB[8]; | ||
| 22 | unsigned long MC[8]; | ||
| 23 | }; | ||
| 24 | |||
| 25 | /* | ||
| 26 | * List of userspace counter numbers: note that the structure is important. | ||
| 27 | * The code relies on CPUn's counters being CPU0's counters + 3n | ||
| 28 | * and on CPU0's counters starting at 0 | ||
| 29 | */ | ||
| 30 | |||
| 31 | #define COUNTER_CPU0_PMN0 0 | ||
| 32 | #define COUNTER_CPU0_PMN1 1 | ||
| 33 | #define COUNTER_CPU0_CCNT 2 | ||
| 34 | |||
| 35 | #define COUNTER_CPU1_PMN0 3 | ||
| 36 | #define COUNTER_CPU1_PMN1 4 | ||
| 37 | #define COUNTER_CPU1_CCNT 5 | ||
| 38 | |||
| 39 | #define COUNTER_CPU2_PMN0 6 | ||
| 40 | #define COUNTER_CPU2_PMN1 7 | ||
| 41 | #define COUNTER_CPU2_CCNT 8 | ||
| 42 | |||
| 43 | #define COUNTER_CPU3_PMN0 9 | ||
| 44 | #define COUNTER_CPU3_PMN1 10 | ||
| 45 | #define COUNTER_CPU3_CCNT 11 | ||
| 46 | |||
| 47 | #define COUNTER_SCU_MN0 12 | ||
| 48 | #define COUNTER_SCU_MN1 13 | ||
| 49 | #define COUNTER_SCU_MN2 14 | ||
| 50 | #define COUNTER_SCU_MN3 15 | ||
| 51 | #define COUNTER_SCU_MN4 16 | ||
| 52 | #define COUNTER_SCU_MN5 17 | ||
| 53 | #define COUNTER_SCU_MN6 18 | ||
| 54 | #define COUNTER_SCU_MN7 19 | ||
| 55 | #define NUM_SCU_COUNTERS 8 | ||
| 56 | |||
| 57 | #define SCU_COUNTER(number) ((number) + COUNTER_SCU_MN0) | ||
| 58 | |||
| 59 | #define MPCORE_NUM_COUNTERS SCU_COUNTER(NUM_SCU_COUNTERS) | ||
| 60 | |||
| 61 | #endif | ||
diff --git a/arch/arm/oprofile/op_model_v6.c b/arch/arm/oprofile/op_model_v6.c deleted file mode 100644 index a22357a2fd08..000000000000 --- a/arch/arm/oprofile/op_model_v6.c +++ /dev/null | |||
| @@ -1,78 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file op_model_v6.c | ||
| 3 | * ARM11 Performance Monitor Driver | ||
| 4 | * | ||
| 5 | * Based on op_model_xscale.c | ||
| 6 | * | ||
| 7 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
| 8 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
| 9 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
| 10 | * @remark Copyright 2004 Intel Corporation | ||
| 11 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
| 12 | * @remark Copyright 2004 OProfile Authors | ||
| 13 | * | ||
| 14 | * @remark Read the file COPYING | ||
| 15 | * | ||
| 16 | * @author Tony Lindgren <tony@atomide.com> | ||
| 17 | */ | ||
| 18 | |||
| 19 | /* #define DEBUG */ | ||
| 20 | #include <linux/types.h> | ||
| 21 | #include <linux/errno.h> | ||
| 22 | #include <linux/err.h> | ||
| 23 | #include <linux/sched.h> | ||
| 24 | #include <linux/oprofile.h> | ||
| 25 | #include <linux/interrupt.h> | ||
| 26 | #include <asm/irq.h> | ||
| 27 | #include <asm/system.h> | ||
| 28 | #include <asm/pmu.h> | ||
| 29 | |||
| 30 | #include "op_counter.h" | ||
| 31 | #include "op_arm_model.h" | ||
| 32 | #include "op_model_arm11_core.h" | ||
| 33 | |||
| 34 | static const struct pmu_irqs *pmu_irqs; | ||
| 35 | |||
| 36 | static void armv6_pmu_stop(void) | ||
| 37 | { | ||
| 38 | arm11_stop_pmu(); | ||
| 39 | arm11_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
| 40 | release_pmu(pmu_irqs); | ||
| 41 | pmu_irqs = NULL; | ||
| 42 | } | ||
| 43 | |||
| 44 | static int armv6_pmu_start(void) | ||
| 45 | { | ||
| 46 | int ret; | ||
| 47 | |||
| 48 | pmu_irqs = reserve_pmu(); | ||
| 49 | if (IS_ERR(pmu_irqs)) { | ||
| 50 | ret = PTR_ERR(pmu_irqs); | ||
| 51 | goto out; | ||
| 52 | } | ||
| 53 | |||
| 54 | ret = arm11_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
| 55 | if (ret >= 0) { | ||
| 56 | ret = arm11_start_pmu(); | ||
| 57 | } else { | ||
| 58 | release_pmu(pmu_irqs); | ||
| 59 | pmu_irqs = NULL; | ||
| 60 | } | ||
| 61 | |||
| 62 | out: | ||
| 63 | return ret; | ||
| 64 | } | ||
| 65 | |||
| 66 | static int armv6_detect_pmu(void) | ||
| 67 | { | ||
| 68 | return 0; | ||
| 69 | } | ||
| 70 | |||
| 71 | struct op_arm_model_spec op_armv6_spec = { | ||
| 72 | .init = armv6_detect_pmu, | ||
| 73 | .num_counters = 3, | ||
| 74 | .setup_ctrs = arm11_setup_pmu, | ||
| 75 | .start = armv6_pmu_start, | ||
| 76 | .stop = armv6_pmu_stop, | ||
| 77 | .name = "arm/armv6", | ||
| 78 | }; | ||
diff --git a/arch/arm/oprofile/op_model_v7.c b/arch/arm/oprofile/op_model_v7.c deleted file mode 100644 index 8642d0891ae1..000000000000 --- a/arch/arm/oprofile/op_model_v7.c +++ /dev/null | |||
| @@ -1,415 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * op_model_v7.c | ||
| 3 | * ARM V7 (Cortex A8) Event Monitor Driver | ||
| 4 | * | ||
| 5 | * Copyright 2008 Jean Pihet <jpihet@mvista.com> | ||
| 6 | * Copyright 2004 ARM SMP Development Team | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | #include <linux/types.h> | ||
| 13 | #include <linux/errno.h> | ||
| 14 | #include <linux/err.h> | ||
| 15 | #include <linux/oprofile.h> | ||
| 16 | #include <linux/interrupt.h> | ||
| 17 | #include <linux/irq.h> | ||
| 18 | #include <linux/smp.h> | ||
| 19 | |||
| 20 | #include <asm/pmu.h> | ||
| 21 | |||
| 22 | #include "op_counter.h" | ||
| 23 | #include "op_arm_model.h" | ||
| 24 | #include "op_model_v7.h" | ||
| 25 | |||
| 26 | /* #define DEBUG */ | ||
| 27 | |||
| 28 | |||
| 29 | /* | ||
| 30 | * ARM V7 PMNC support | ||
| 31 | */ | ||
| 32 | |||
| 33 | static u32 cnt_en[CNTMAX]; | ||
| 34 | |||
| 35 | static inline void armv7_pmnc_write(u32 val) | ||
| 36 | { | ||
| 37 | val &= PMNC_MASK; | ||
| 38 | asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r" (val)); | ||
| 39 | } | ||
| 40 | |||
| 41 | static inline u32 armv7_pmnc_read(void) | ||
| 42 | { | ||
| 43 | u32 val; | ||
| 44 | |||
| 45 | asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (val)); | ||
| 46 | return val; | ||
| 47 | } | ||
| 48 | |||
| 49 | static inline u32 armv7_pmnc_enable_counter(unsigned int cnt) | ||
| 50 | { | ||
| 51 | u32 val; | ||
| 52 | |||
| 53 | if (cnt >= CNTMAX) { | ||
| 54 | printk(KERN_ERR "oprofile: CPU%u enabling wrong PMNC counter" | ||
| 55 | " %d\n", smp_processor_id(), cnt); | ||
| 56 | return -1; | ||
| 57 | } | ||
| 58 | |||
| 59 | if (cnt == CCNT) | ||
| 60 | val = CNTENS_C; | ||
| 61 | else | ||
| 62 | val = (1 << (cnt - CNT0)); | ||
| 63 | |||
| 64 | val &= CNTENS_MASK; | ||
| 65 | asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r" (val)); | ||
| 66 | |||
| 67 | return cnt; | ||
| 68 | } | ||
| 69 | |||
| 70 | static inline u32 armv7_pmnc_disable_counter(unsigned int cnt) | ||
| 71 | { | ||
| 72 | u32 val; | ||
| 73 | |||
| 74 | if (cnt >= CNTMAX) { | ||
| 75 | printk(KERN_ERR "oprofile: CPU%u disabling wrong PMNC counter" | ||
| 76 | " %d\n", smp_processor_id(), cnt); | ||
| 77 | return -1; | ||
| 78 | } | ||
| 79 | |||
| 80 | if (cnt == CCNT) | ||
| 81 | val = CNTENC_C; | ||
| 82 | else | ||
| 83 | val = (1 << (cnt - CNT0)); | ||
| 84 | |||
| 85 | val &= CNTENC_MASK; | ||
| 86 | asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r" (val)); | ||
| 87 | |||
| 88 | return cnt; | ||
| 89 | } | ||
| 90 | |||
| 91 | static inline u32 armv7_pmnc_enable_intens(unsigned int cnt) | ||
| 92 | { | ||
| 93 | u32 val; | ||
| 94 | |||
| 95 | if (cnt >= CNTMAX) { | ||
| 96 | printk(KERN_ERR "oprofile: CPU%u enabling wrong PMNC counter" | ||
| 97 | " interrupt enable %d\n", smp_processor_id(), cnt); | ||
| 98 | return -1; | ||
| 99 | } | ||
| 100 | |||
| 101 | if (cnt == CCNT) | ||
| 102 | val = INTENS_C; | ||
| 103 | else | ||
| 104 | val = (1 << (cnt - CNT0)); | ||
| 105 | |||
| 106 | val &= INTENS_MASK; | ||
| 107 | asm volatile("mcr p15, 0, %0, c9, c14, 1" : : "r" (val)); | ||
| 108 | |||
| 109 | return cnt; | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline u32 armv7_pmnc_getreset_flags(void) | ||
| 113 | { | ||
| 114 | u32 val; | ||
| 115 | |||
| 116 | /* Read */ | ||
| 117 | asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val)); | ||
| 118 | |||
| 119 | /* Write to clear flags */ | ||
| 120 | val &= FLAG_MASK; | ||
| 121 | asm volatile("mcr p15, 0, %0, c9, c12, 3" : : "r" (val)); | ||
| 122 | |||
| 123 | return val; | ||
| 124 | } | ||
| 125 | |||
| 126 | static inline int armv7_pmnc_select_counter(unsigned int cnt) | ||
| 127 | { | ||
| 128 | u32 val; | ||
| 129 | |||
| 130 | if ((cnt == CCNT) || (cnt >= CNTMAX)) { | ||
| 131 | printk(KERN_ERR "oprofile: CPU%u selecting wrong PMNC counteri" | ||
| 132 | " %d\n", smp_processor_id(), cnt); | ||
| 133 | return -1; | ||
| 134 | } | ||
| 135 | |||
| 136 | val = (cnt - CNT0) & SELECT_MASK; | ||
| 137 | asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r" (val)); | ||
| 138 | |||
| 139 | return cnt; | ||
| 140 | } | ||
| 141 | |||
| 142 | static inline void armv7_pmnc_write_evtsel(unsigned int cnt, u32 val) | ||
| 143 | { | ||
| 144 | if (armv7_pmnc_select_counter(cnt) == cnt) { | ||
| 145 | val &= EVTSEL_MASK; | ||
| 146 | asm volatile("mcr p15, 0, %0, c9, c13, 1" : : "r" (val)); | ||
| 147 | } | ||
| 148 | } | ||
| 149 | |||
| 150 | static void armv7_pmnc_reset_counter(unsigned int cnt) | ||
| 151 | { | ||
| 152 | u32 cpu_cnt = CPU_COUNTER(smp_processor_id(), cnt); | ||
| 153 | u32 val = -(u32)counter_config[cpu_cnt].count; | ||
| 154 | |||
| 155 | switch (cnt) { | ||
| 156 | case CCNT: | ||
| 157 | armv7_pmnc_disable_counter(cnt); | ||
| 158 | |||
| 159 | asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (val)); | ||
| 160 | |||
| 161 | if (cnt_en[cnt] != 0) | ||
| 162 | armv7_pmnc_enable_counter(cnt); | ||
| 163 | |||
| 164 | break; | ||
| 165 | |||
| 166 | case CNT0: | ||
| 167 | case CNT1: | ||
| 168 | case CNT2: | ||
| 169 | case CNT3: | ||
| 170 | armv7_pmnc_disable_counter(cnt); | ||
| 171 | |||
| 172 | if (armv7_pmnc_select_counter(cnt) == cnt) | ||
| 173 | asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r" (val)); | ||
| 174 | |||
| 175 | if (cnt_en[cnt] != 0) | ||
| 176 | armv7_pmnc_enable_counter(cnt); | ||
| 177 | |||
| 178 | break; | ||
| 179 | |||
| 180 | default: | ||
| 181 | printk(KERN_ERR "oprofile: CPU%u resetting wrong PMNC counter" | ||
| 182 | " %d\n", smp_processor_id(), cnt); | ||
| 183 | break; | ||
| 184 | } | ||
| 185 | } | ||
| 186 | |||
| 187 | int armv7_setup_pmnc(void) | ||
| 188 | { | ||
| 189 | unsigned int cnt; | ||
| 190 | |||
| 191 | if (armv7_pmnc_read() & PMNC_E) { | ||
| 192 | printk(KERN_ERR "oprofile: CPU%u PMNC still enabled when setup" | ||
| 193 | " new event counter.\n", smp_processor_id()); | ||
| 194 | return -EBUSY; | ||
| 195 | } | ||
| 196 | |||
| 197 | /* Initialize & Reset PMNC: C bit and P bit */ | ||
| 198 | armv7_pmnc_write(PMNC_P | PMNC_C); | ||
| 199 | |||
| 200 | |||
| 201 | for (cnt = CCNT; cnt < CNTMAX; cnt++) { | ||
| 202 | unsigned long event; | ||
| 203 | u32 cpu_cnt = CPU_COUNTER(smp_processor_id(), cnt); | ||
| 204 | |||
| 205 | /* | ||
| 206 | * Disable counter | ||
| 207 | */ | ||
| 208 | armv7_pmnc_disable_counter(cnt); | ||
| 209 | cnt_en[cnt] = 0; | ||
| 210 | |||
| 211 | if (!counter_config[cpu_cnt].enabled) | ||
| 212 | continue; | ||
| 213 | |||
| 214 | event = counter_config[cpu_cnt].event & 255; | ||
| 215 | |||
| 216 | /* | ||
| 217 | * Set event (if destined for PMNx counters) | ||
| 218 | * We don't need to set the event if it's a cycle count | ||
| 219 | */ | ||
| 220 | if (cnt != CCNT) | ||
| 221 | armv7_pmnc_write_evtsel(cnt, event); | ||
| 222 | |||
| 223 | /* | ||
| 224 | * Enable interrupt for this counter | ||
| 225 | */ | ||
| 226 | armv7_pmnc_enable_intens(cnt); | ||
| 227 | |||
| 228 | /* | ||
| 229 | * Reset counter | ||
| 230 | */ | ||
| 231 | armv7_pmnc_reset_counter(cnt); | ||
| 232 | |||
| 233 | /* | ||
| 234 | * Enable counter | ||
| 235 | */ | ||
| 236 | armv7_pmnc_enable_counter(cnt); | ||
| 237 | cnt_en[cnt] = 1; | ||
| 238 | } | ||
| 239 | |||
| 240 | return 0; | ||
| 241 | } | ||
| 242 | |||
| 243 | static inline void armv7_start_pmnc(void) | ||
| 244 | { | ||
| 245 | armv7_pmnc_write(armv7_pmnc_read() | PMNC_E); | ||
| 246 | } | ||
| 247 | |||
| 248 | static inline void armv7_stop_pmnc(void) | ||
| 249 | { | ||
| 250 | armv7_pmnc_write(armv7_pmnc_read() & ~PMNC_E); | ||
| 251 | } | ||
| 252 | |||
| 253 | /* | ||
| 254 | * CPU counters' IRQ handler (one IRQ per CPU) | ||
| 255 | */ | ||
| 256 | static irqreturn_t armv7_pmnc_interrupt(int irq, void *arg) | ||
| 257 | { | ||
| 258 | struct pt_regs *regs = get_irq_regs(); | ||
| 259 | unsigned int cnt; | ||
| 260 | u32 flags; | ||
| 261 | |||
| 262 | |||
| 263 | /* | ||
| 264 | * Stop IRQ generation | ||
| 265 | */ | ||
| 266 | armv7_stop_pmnc(); | ||
| 267 | |||
| 268 | /* | ||
| 269 | * Get and reset overflow status flags | ||
| 270 | */ | ||
| 271 | flags = armv7_pmnc_getreset_flags(); | ||
| 272 | |||
| 273 | /* | ||
| 274 | * Cycle counter | ||
| 275 | */ | ||
| 276 | if (flags & FLAG_C) { | ||
| 277 | u32 cpu_cnt = CPU_COUNTER(smp_processor_id(), CCNT); | ||
| 278 | armv7_pmnc_reset_counter(CCNT); | ||
| 279 | oprofile_add_sample(regs, cpu_cnt); | ||
| 280 | } | ||
| 281 | |||
| 282 | /* | ||
| 283 | * PMNC counters 0:3 | ||
| 284 | */ | ||
| 285 | for (cnt = CNT0; cnt < CNTMAX; cnt++) { | ||
| 286 | if (flags & (1 << (cnt - CNT0))) { | ||
| 287 | u32 cpu_cnt = CPU_COUNTER(smp_processor_id(), cnt); | ||
| 288 | armv7_pmnc_reset_counter(cnt); | ||
| 289 | oprofile_add_sample(regs, cpu_cnt); | ||
| 290 | } | ||
| 291 | } | ||
| 292 | |||
| 293 | /* | ||
| 294 | * Allow IRQ generation | ||
| 295 | */ | ||
| 296 | armv7_start_pmnc(); | ||
| 297 | |||
| 298 | return IRQ_HANDLED; | ||
| 299 | } | ||
| 300 | |||
| 301 | int armv7_request_interrupts(const int *irqs, int nr) | ||
| 302 | { | ||
| 303 | unsigned int i; | ||
| 304 | int ret = 0; | ||
| 305 | |||
| 306 | for (i = 0; i < nr; i++) { | ||
| 307 | ret = request_irq(irqs[i], armv7_pmnc_interrupt, | ||
| 308 | IRQF_DISABLED, "CP15 PMNC", NULL); | ||
| 309 | if (ret != 0) { | ||
| 310 | printk(KERN_ERR "oprofile: unable to request IRQ%u" | ||
| 311 | " for ARMv7\n", | ||
| 312 | irqs[i]); | ||
| 313 | break; | ||
| 314 | } | ||
| 315 | } | ||
| 316 | |||
| 317 | if (i != nr) | ||
| 318 | while (i-- != 0) | ||
| 319 | free_irq(irqs[i], NULL); | ||
| 320 | |||
| 321 | return ret; | ||
| 322 | } | ||
| 323 | |||
| 324 | void armv7_release_interrupts(const int *irqs, int nr) | ||
| 325 | { | ||
| 326 | unsigned int i; | ||
| 327 | |||
| 328 | for (i = 0; i < nr; i++) | ||
| 329 | free_irq(irqs[i], NULL); | ||
| 330 | } | ||
| 331 | |||
| 332 | #ifdef DEBUG | ||
| 333 | static void armv7_pmnc_dump_regs(void) | ||
| 334 | { | ||
| 335 | u32 val; | ||
| 336 | unsigned int cnt; | ||
| 337 | |||
| 338 | printk(KERN_INFO "PMNC registers dump:\n"); | ||
| 339 | |||
| 340 | asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r" (val)); | ||
| 341 | printk(KERN_INFO "PMNC =0x%08x\n", val); | ||
| 342 | |||
| 343 | asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r" (val)); | ||
| 344 | printk(KERN_INFO "CNTENS=0x%08x\n", val); | ||
| 345 | |||
| 346 | asm volatile("mrc p15, 0, %0, c9, c14, 1" : "=r" (val)); | ||
| 347 | printk(KERN_INFO "INTENS=0x%08x\n", val); | ||
| 348 | |||
| 349 | asm volatile("mrc p15, 0, %0, c9, c12, 3" : "=r" (val)); | ||
| 350 | printk(KERN_INFO "FLAGS =0x%08x\n", val); | ||
| 351 | |||
| 352 | asm volatile("mrc p15, 0, %0, c9, c12, 5" : "=r" (val)); | ||
| 353 | printk(KERN_INFO "SELECT=0x%08x\n", val); | ||
| 354 | |||
| 355 | asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (val)); | ||
| 356 | printk(KERN_INFO "CCNT =0x%08x\n", val); | ||
| 357 | |||
| 358 | for (cnt = CNT0; cnt < CNTMAX; cnt++) { | ||
| 359 | armv7_pmnc_select_counter(cnt); | ||
| 360 | asm volatile("mrc p15, 0, %0, c9, c13, 2" : "=r" (val)); | ||
| 361 | printk(KERN_INFO "CNT[%d] count =0x%08x\n", cnt-CNT0, val); | ||
| 362 | asm volatile("mrc p15, 0, %0, c9, c13, 1" : "=r" (val)); | ||
| 363 | printk(KERN_INFO "CNT[%d] evtsel=0x%08x\n", cnt-CNT0, val); | ||
| 364 | } | ||
| 365 | } | ||
| 366 | #endif | ||
| 367 | |||
| 368 | static const struct pmu_irqs *pmu_irqs; | ||
| 369 | |||
| 370 | static void armv7_pmnc_stop(void) | ||
| 371 | { | ||
| 372 | #ifdef DEBUG | ||
| 373 | armv7_pmnc_dump_regs(); | ||
| 374 | #endif | ||
| 375 | armv7_stop_pmnc(); | ||
| 376 | armv7_release_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
| 377 | release_pmu(pmu_irqs); | ||
| 378 | pmu_irqs = NULL; | ||
| 379 | } | ||
| 380 | |||
| 381 | static int armv7_pmnc_start(void) | ||
| 382 | { | ||
| 383 | int ret; | ||
| 384 | |||
| 385 | pmu_irqs = reserve_pmu(); | ||
| 386 | if (IS_ERR(pmu_irqs)) | ||
| 387 | return PTR_ERR(pmu_irqs); | ||
| 388 | |||
| 389 | #ifdef DEBUG | ||
| 390 | armv7_pmnc_dump_regs(); | ||
| 391 | #endif | ||
| 392 | ret = armv7_request_interrupts(pmu_irqs->irqs, pmu_irqs->num_irqs); | ||
| 393 | if (ret >= 0) { | ||
| 394 | armv7_start_pmnc(); | ||
| 395 | } else { | ||
| 396 | release_pmu(pmu_irqs); | ||
| 397 | pmu_irqs = NULL; | ||
| 398 | } | ||
| 399 | |||
| 400 | return ret; | ||
| 401 | } | ||
| 402 | |||
| 403 | static int armv7_detect_pmnc(void) | ||
| 404 | { | ||
| 405 | return 0; | ||
| 406 | } | ||
| 407 | |||
| 408 | struct op_arm_model_spec op_armv7_spec = { | ||
| 409 | .init = armv7_detect_pmnc, | ||
| 410 | .num_counters = 5, | ||
| 411 | .setup_ctrs = armv7_setup_pmnc, | ||
| 412 | .start = armv7_pmnc_start, | ||
| 413 | .stop = armv7_pmnc_stop, | ||
| 414 | .name = "arm/armv7", | ||
| 415 | }; | ||
diff --git a/arch/arm/oprofile/op_model_v7.h b/arch/arm/oprofile/op_model_v7.h deleted file mode 100644 index 9ca334b39c75..000000000000 --- a/arch/arm/oprofile/op_model_v7.h +++ /dev/null | |||
| @@ -1,103 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * op_model_v7.h | ||
| 3 | * ARM v7 (Cortex A8) Event Monitor Driver | ||
| 4 | * | ||
| 5 | * Copyright 2008 Jean Pihet <jpihet@mvista.com> | ||
| 6 | * Copyright 2004 ARM SMP Development Team | ||
| 7 | * Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
| 8 | * Copyright 2000-2004 MontaVista Software Inc | ||
| 9 | * Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
| 10 | * Copyright 2004 Intel Corporation | ||
| 11 | * Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
| 12 | * Copyright 2004 Oprofile Authors | ||
| 13 | * | ||
| 14 | * Read the file COPYING | ||
| 15 | * | ||
| 16 | * This program is free software; you can redistribute it and/or modify | ||
| 17 | * it under the terms of the GNU General Public License version 2 as | ||
| 18 | * published by the Free Software Foundation. | ||
| 19 | */ | ||
| 20 | #ifndef OP_MODEL_V7_H | ||
| 21 | #define OP_MODEL_V7_H | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Per-CPU PMNC: config reg | ||
| 25 | */ | ||
| 26 | #define PMNC_E (1 << 0) /* Enable all counters */ | ||
| 27 | #define PMNC_P (1 << 1) /* Reset all counters */ | ||
| 28 | #define PMNC_C (1 << 2) /* Cycle counter reset */ | ||
| 29 | #define PMNC_D (1 << 3) /* CCNT counts every 64th cpu cycle */ | ||
| 30 | #define PMNC_X (1 << 4) /* Export to ETM */ | ||
| 31 | #define PMNC_DP (1 << 5) /* Disable CCNT if non-invasive debug*/ | ||
| 32 | #define PMNC_MASK 0x3f /* Mask for writable bits */ | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Available counters | ||
| 36 | */ | ||
| 37 | #define CCNT 0 | ||
| 38 | #define CNT0 1 | ||
| 39 | #define CNT1 2 | ||
| 40 | #define CNT2 3 | ||
| 41 | #define CNT3 4 | ||
| 42 | #define CNTMAX 5 | ||
| 43 | |||
| 44 | #define CPU_COUNTER(cpu, counter) ((cpu) * CNTMAX + (counter)) | ||
| 45 | |||
| 46 | /* | ||
| 47 | * CNTENS: counters enable reg | ||
| 48 | */ | ||
| 49 | #define CNTENS_P0 (1 << 0) | ||
| 50 | #define CNTENS_P1 (1 << 1) | ||
| 51 | #define CNTENS_P2 (1 << 2) | ||
| 52 | #define CNTENS_P3 (1 << 3) | ||
| 53 | #define CNTENS_C (1 << 31) | ||
| 54 | #define CNTENS_MASK 0x8000000f /* Mask for writable bits */ | ||
| 55 | |||
| 56 | /* | ||
| 57 | * CNTENC: counters disable reg | ||
| 58 | */ | ||
| 59 | #define CNTENC_P0 (1 << 0) | ||
| 60 | #define CNTENC_P1 (1 << 1) | ||
| 61 | #define CNTENC_P2 (1 << 2) | ||
| 62 | #define CNTENC_P3 (1 << 3) | ||
| 63 | #define CNTENC_C (1 << 31) | ||
| 64 | #define CNTENC_MASK 0x8000000f /* Mask for writable bits */ | ||
| 65 | |||
| 66 | /* | ||
| 67 | * INTENS: counters overflow interrupt enable reg | ||
| 68 | */ | ||
| 69 | #define INTENS_P0 (1 << 0) | ||
| 70 | #define INTENS_P1 (1 << 1) | ||
| 71 | #define INTENS_P2 (1 << 2) | ||
| 72 | #define INTENS_P3 (1 << 3) | ||
| 73 | #define INTENS_C (1 << 31) | ||
| 74 | #define INTENS_MASK 0x8000000f /* Mask for writable bits */ | ||
| 75 | |||
| 76 | /* | ||
| 77 | * EVTSEL: Event selection reg | ||
| 78 | */ | ||
| 79 | #define EVTSEL_MASK 0x7f /* Mask for writable bits */ | ||
| 80 | |||
| 81 | /* | ||
| 82 | * SELECT: Counter selection reg | ||
| 83 | */ | ||
| 84 | #define SELECT_MASK 0x1f /* Mask for writable bits */ | ||
| 85 | |||
| 86 | /* | ||
| 87 | * FLAG: counters overflow flag status reg | ||
| 88 | */ | ||
| 89 | #define FLAG_P0 (1 << 0) | ||
| 90 | #define FLAG_P1 (1 << 1) | ||
| 91 | #define FLAG_P2 (1 << 2) | ||
| 92 | #define FLAG_P3 (1 << 3) | ||
| 93 | #define FLAG_C (1 << 31) | ||
| 94 | #define FLAG_MASK 0x8000000f /* Mask for writable bits */ | ||
| 95 | |||
| 96 | |||
| 97 | int armv7_setup_pmu(void); | ||
| 98 | int armv7_start_pmu(void); | ||
| 99 | int armv7_stop_pmu(void); | ||
| 100 | int armv7_request_interrupts(const int *, int); | ||
| 101 | void armv7_release_interrupts(const int *, int); | ||
| 102 | |||
| 103 | #endif | ||
diff --git a/arch/arm/oprofile/op_model_xscale.c b/arch/arm/oprofile/op_model_xscale.c deleted file mode 100644 index 1d34a02048bd..000000000000 --- a/arch/arm/oprofile/op_model_xscale.c +++ /dev/null | |||
| @@ -1,444 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * @file op_model_xscale.c | ||
| 3 | * XScale Performance Monitor Driver | ||
| 4 | * | ||
| 5 | * @remark Copyright 2000-2004 Deepak Saxena <dsaxena@mvista.com> | ||
| 6 | * @remark Copyright 2000-2004 MontaVista Software Inc | ||
| 7 | * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> | ||
| 8 | * @remark Copyright 2004 Intel Corporation | ||
| 9 | * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> | ||
| 10 | * @remark Copyright 2004 OProfile Authors | ||
| 11 | * | ||
| 12 | * @remark Read the file COPYING | ||
| 13 | * | ||
| 14 | * @author Zwane Mwaikambo | ||
| 15 | */ | ||
| 16 | |||
| 17 | /* #define DEBUG */ | ||
| 18 | #include <linux/types.h> | ||
| 19 | #include <linux/errno.h> | ||
| 20 | #include <linux/err.h> | ||
| 21 | #include <linux/sched.h> | ||
| 22 | #include <linux/oprofile.h> | ||
| 23 | #include <linux/interrupt.h> | ||
| 24 | #include <linux/irq.h> | ||
| 25 | |||
| 26 | #include <asm/cputype.h> | ||
| 27 | #include <asm/pmu.h> | ||
| 28 | |||
| 29 | #include "op_counter.h" | ||
| 30 | #include "op_arm_model.h" | ||
| 31 | |||
| 32 | #define PMU_ENABLE 0x001 /* Enable counters */ | ||
| 33 | #define PMN_RESET 0x002 /* Reset event counters */ | ||
| 34 | #define CCNT_RESET 0x004 /* Reset clock counter */ | ||
| 35 | #define PMU_RESET (CCNT_RESET | PMN_RESET) | ||
| 36 | #define PMU_CNT64 0x008 /* Make CCNT count every 64th cycle */ | ||
| 37 | |||
| 38 | /* | ||
| 39 | * Different types of events that can be counted by the XScale PMU | ||
| 40 | * as used by Oprofile userspace. Here primarily for documentation | ||
| 41 | * purposes. | ||
| 42 | */ | ||
| 43 | |||
| 44 | #define EVT_ICACHE_MISS 0x00 | ||
| 45 | #define EVT_ICACHE_NO_DELIVER 0x01 | ||
| 46 | #define EVT_DATA_STALL 0x02 | ||
| 47 | #define EVT_ITLB_MISS 0x03 | ||
| 48 | #define EVT_DTLB_MISS 0x04 | ||
| 49 | #define EVT_BRANCH 0x05 | ||
| 50 | #define EVT_BRANCH_MISS 0x06 | ||
| 51 | #define EVT_INSTRUCTION 0x07 | ||
| 52 | #define EVT_DCACHE_FULL_STALL 0x08 | ||
| 53 | #define EVT_DCACHE_FULL_STALL_CONTIG 0x09 | ||
| 54 | #define EVT_DCACHE_ACCESS 0x0A | ||
| 55 | #define EVT_DCACHE_MISS 0x0B | ||
| 56 | #define EVT_DCACE_WRITE_BACK 0x0C | ||
| 57 | #define EVT_PC_CHANGED 0x0D | ||
| 58 | #define EVT_BCU_REQUEST 0x10 | ||
| 59 | #define EVT_BCU_FULL 0x11 | ||
| 60 | #define EVT_BCU_DRAIN 0x12 | ||
| 61 | #define EVT_BCU_ECC_NO_ELOG 0x14 | ||
| 62 | #define EVT_BCU_1_BIT_ERR 0x15 | ||
| 63 | #define EVT_RMW 0x16 | ||
| 64 | /* EVT_CCNT is not hardware defined */ | ||
| 65 | #define EVT_CCNT 0xFE | ||
| 66 | #define EVT_UNUSED 0xFF | ||
| 67 | |||
| 68 | struct pmu_counter { | ||
| 69 | volatile unsigned long ovf; | ||
| 70 | unsigned long reset_counter; | ||
| 71 | }; | ||
| 72 | |||
| 73 | enum { CCNT, PMN0, PMN1, PMN2, PMN3, MAX_COUNTERS }; | ||
| 74 | |||
| 75 | static struct pmu_counter results[MAX_COUNTERS]; | ||
| 76 | |||
| 77 | /* | ||
| 78 | * There are two versions of the PMU in current XScale processors | ||
| 79 | * with differing register layouts and number of performance counters. | ||
| 80 | * e.g. IOP32x is xsc1 whilst IOP33x is xsc2. | ||
| 81 | * We detect which register layout to use in xscale_detect_pmu() | ||
| 82 | */ | ||
| 83 | enum { PMU_XSC1, PMU_XSC2 }; | ||
| 84 | |||
| 85 | struct pmu_type { | ||
| 86 | int id; | ||
| 87 | char *name; | ||
| 88 | int num_counters; | ||
| 89 | unsigned int int_enable; | ||
| 90 | unsigned int cnt_ovf[MAX_COUNTERS]; | ||
| 91 | unsigned int int_mask[MAX_COUNTERS]; | ||
| 92 | }; | ||
| 93 | |||
| 94 | static struct pmu_type pmu_parms[] = { | ||
| 95 | { | ||
| 96 | .id = PMU_XSC1, | ||
| 97 | .name = "arm/xscale1", | ||
| 98 | .num_counters = 3, | ||
| 99 | .int_mask = { [PMN0] = 0x10, [PMN1] = 0x20, | ||
| 100 | [CCNT] = 0x40 }, | ||
| 101 | .cnt_ovf = { [CCNT] = 0x400, [PMN0] = 0x100, | ||
| 102 | [PMN1] = 0x200}, | ||
| 103 | }, | ||
| 104 | { | ||
| 105 | .id = PMU_XSC2, | ||
| 106 | .name = "arm/xscale2", | ||
| 107 | .num_counters = 5, | ||
| 108 | .int_mask = { [CCNT] = 0x01, [PMN0] = 0x02, | ||
| 109 | [PMN1] = 0x04, [PMN2] = 0x08, | ||
| 110 | [PMN3] = 0x10 }, | ||
| 111 | .cnt_ovf = { [CCNT] = 0x01, [PMN0] = 0x02, | ||
| 112 | [PMN1] = 0x04, [PMN2] = 0x08, | ||
| 113 | [PMN3] = 0x10 }, | ||
| 114 | }, | ||
| 115 | }; | ||
| 116 | |||
| 117 | static struct pmu_type *pmu; | ||
| 118 | |||
| 119 | static void write_pmnc(u32 val) | ||
| 120 | { | ||
| 121 | if (pmu->id == PMU_XSC1) { | ||
| 122 | /* upper 4bits and 7, 11 are write-as-0 */ | ||
| 123 | val &= 0xffff77f; | ||
| 124 | __asm__ __volatile__ ("mcr p14, 0, %0, c0, c0, 0" : : "r" (val)); | ||
| 125 | } else { | ||
| 126 | /* bits 4-23 are write-as-0, 24-31 are write ignored */ | ||
| 127 | val &= 0xf; | ||
| 128 | __asm__ __volatile__ ("mcr p14, 0, %0, c0, c1, 0" : : "r" (val)); | ||
| 129 | } | ||
| 130 | } | ||
| 131 | |||
| 132 | static u32 read_pmnc(void) | ||
| 133 | { | ||
| 134 | u32 val; | ||
| 135 | |||
| 136 | if (pmu->id == PMU_XSC1) | ||
| 137 | __asm__ __volatile__ ("mrc p14, 0, %0, c0, c0, 0" : "=r" (val)); | ||
| 138 | else { | ||
| 139 | __asm__ __volatile__ ("mrc p14, 0, %0, c0, c1, 0" : "=r" (val)); | ||
| 140 | /* bits 1-2 and 4-23 are read-unpredictable */ | ||
| 141 | val &= 0xff000009; | ||
| 142 | } | ||
| 143 | |||
| 144 | return val; | ||
| 145 | } | ||
| 146 | |||
| 147 | static u32 __xsc1_read_counter(int counter) | ||
| 148 | { | ||
| 149 | u32 val = 0; | ||
| 150 | |||
| 151 | switch (counter) { | ||
| 152 | case CCNT: | ||
| 153 | __asm__ __volatile__ ("mrc p14, 0, %0, c1, c0, 0" : "=r" (val)); | ||
| 154 | break; | ||
| 155 | case PMN0: | ||
| 156 | __asm__ __volatile__ ("mrc p14, 0, %0, c2, c0, 0" : "=r" (val)); | ||
| 157 | break; | ||
| 158 | case PMN1: | ||
| 159 | __asm__ __volatile__ ("mrc p14, 0, %0, c3, c0, 0" : "=r" (val)); | ||
| 160 | break; | ||
| 161 | } | ||
| 162 | return val; | ||
| 163 | } | ||
| 164 | |||
| 165 | static u32 __xsc2_read_counter(int counter) | ||
| 166 | { | ||
| 167 | u32 val = 0; | ||
| 168 | |||
| 169 | switch (counter) { | ||
| 170 | case CCNT: | ||
| 171 | __asm__ __volatile__ ("mrc p14, 0, %0, c1, c1, 0" : "=r" (val)); | ||
| 172 | break; | ||
| 173 | case PMN0: | ||
| 174 | __asm__ __volatile__ ("mrc p14, 0, %0, c0, c2, 0" : "=r" (val)); | ||
| 175 | break; | ||
| 176 | case PMN1: | ||
| 177 | __asm__ __volatile__ ("mrc p14, 0, %0, c1, c2, 0" : "=r" (val)); | ||
| 178 | break; | ||
| 179 | case PMN2: | ||
| 180 | __asm__ __volatile__ ("mrc p14, 0, %0, c2, c2, 0" : "=r" (val)); | ||
| 181 | break; | ||
| 182 | case PMN3: | ||
| 183 | __asm__ __volatile__ ("mrc p14, 0, %0, c3, c2, 0" : "=r" (val)); | ||
| 184 | break; | ||
| 185 | } | ||
| 186 | return val; | ||
| 187 | } | ||
| 188 | |||
| 189 | static u32 read_counter(int counter) | ||
| 190 | { | ||
| 191 | u32 val; | ||
| 192 | |||
| 193 | if (pmu->id == PMU_XSC1) | ||
| 194 | val = __xsc1_read_counter(counter); | ||
| 195 | else | ||
| 196 | val = __xsc2_read_counter(counter); | ||
| 197 | |||
| 198 | return val; | ||
| 199 | } | ||
| 200 | |||
| 201 | static void __xsc1_write_counter(int counter, u32 val) | ||
| 202 | { | ||
| 203 | switch (counter) { | ||
| 204 | case CCNT: | ||
| 205 | __asm__ __volatile__ ("mcr p14, 0, %0, c1, c0, 0" : : "r" (val)); | ||
| 206 | break; | ||
| 207 | case PMN0: | ||
| 208 | __asm__ __volatile__ ("mcr p14, 0, %0, c2, c0, 0" : : "r" (val)); | ||
| 209 | break; | ||
| 210 | case PMN1: | ||
| 211 | __asm__ __volatile__ ("mcr p14, 0, %0, c3, c0, 0" : : "r" (val)); | ||
| 212 | break; | ||
| 213 | } | ||
| 214 | } | ||
| 215 | |||
| 216 | static void __xsc2_write_counter(int counter, u32 val) | ||
| 217 | { | ||
| 218 | switch (counter) { | ||
| 219 | case CCNT: | ||
| 220 | __asm__ __volatile__ ("mcr p14, 0, %0, c1, c1, 0" : : "r" (val)); | ||
| 221 | break; | ||
| 222 | case PMN0: | ||
| 223 | __asm__ __volatile__ ("mcr p14, 0, %0, c0, c2, 0" : : "r" (val)); | ||
| 224 | break; | ||
| 225 | case PMN1: | ||
| 226 | __asm__ __volatile__ ("mcr p14, 0, %0, c1, c2, 0" : : "r" (val)); | ||
| 227 | break; | ||
| 228 | case PMN2: | ||
| 229 | __asm__ __volatile__ ("mcr p14, 0, %0, c2, c2, 0" : : "r" (val)); | ||
| 230 | break; | ||
| 231 | case PMN3: | ||
| 232 | __asm__ __volatile__ ("mcr p14, 0, %0, c3, c2, 0" : : "r" (val)); | ||
| 233 | break; | ||
| 234 | } | ||
| 235 | } | ||
| 236 | |||
| 237 | static void write_counter(int counter, u32 val) | ||
| 238 | { | ||
| 239 | if (pmu->id == PMU_XSC1) | ||
| 240 | __xsc1_write_counter(counter, val); | ||
| 241 | else | ||
| 242 | __xsc2_write_counter(counter, val); | ||
| 243 | } | ||
| 244 | |||
| 245 | static int xscale_setup_ctrs(void) | ||
| 246 | { | ||
| 247 | u32 evtsel, pmnc; | ||
| 248 | int i; | ||
| 249 | |||
| 250 | for (i = CCNT; i < MAX_COUNTERS; i++) { | ||
| 251 | if (counter_config[i].enabled) | ||
| 252 | continue; | ||
| 253 | |||
| 254 | counter_config[i].event = EVT_UNUSED; | ||
| 255 | } | ||
| 256 | |||
| 257 | switch (pmu->id) { | ||
| 258 | case PMU_XSC1: | ||
| 259 | pmnc = (counter_config[PMN1].event << 20) | (counter_config[PMN0].event << 12); | ||
| 260 | pr_debug("xscale_setup_ctrs: pmnc: %#08x\n", pmnc); | ||
| 261 | write_pmnc(pmnc); | ||
| 262 | break; | ||
| 263 | |||
| 264 | case PMU_XSC2: | ||
| 265 | evtsel = counter_config[PMN0].event | (counter_config[PMN1].event << 8) | | ||
| 266 | (counter_config[PMN2].event << 16) | (counter_config[PMN3].event << 24); | ||
| 267 | |||
| 268 | pr_debug("xscale_setup_ctrs: evtsel %#08x\n", evtsel); | ||
| 269 | __asm__ __volatile__ ("mcr p14, 0, %0, c8, c1, 0" : : "r" (evtsel)); | ||
| 270 | break; | ||
| 271 | } | ||
| 272 | |||
| 273 | for (i = CCNT; i < MAX_COUNTERS; i++) { | ||
| 274 | if (counter_config[i].event == EVT_UNUSED) { | ||
| 275 | counter_config[i].event = 0; | ||
| 276 | pmu->int_enable &= ~pmu->int_mask[i]; | ||
| 277 | continue; | ||
| 278 | } | ||
| 279 | |||
| 280 | results[i].reset_counter = counter_config[i].count; | ||
| 281 | write_counter(i, -(u32)counter_config[i].count); | ||
| 282 | pmu->int_enable |= pmu->int_mask[i]; | ||
| 283 | pr_debug("xscale_setup_ctrs: counter%d %#08x from %#08lx\n", i, | ||
| 284 | read_counter(i), counter_config[i].count); | ||
| 285 | } | ||
| 286 | |||
| 287 | return 0; | ||
| 288 | } | ||
| 289 | |||
| 290 | static void inline __xsc1_check_ctrs(void) | ||
| 291 | { | ||
| 292 | int i; | ||
| 293 | u32 pmnc = read_pmnc(); | ||
| 294 | |||
| 295 | /* NOTE: there's an A stepping errata that states if an overflow */ | ||
| 296 | /* bit already exists and another occurs, the previous */ | ||
| 297 | /* Overflow bit gets cleared. There's no workaround. */ | ||
| 298 | /* Fixed in B stepping or later */ | ||
| 299 | |||
| 300 | /* Write the value back to clear the overflow flags. Overflow */ | ||
| 301 | /* flags remain in pmnc for use below */ | ||
| 302 | write_pmnc(pmnc & ~PMU_ENABLE); | ||
| 303 | |||
| 304 | for (i = CCNT; i <= PMN1; i++) { | ||
| 305 | if (!(pmu->int_mask[i] & pmu->int_enable)) | ||
| 306 | continue; | ||
| 307 | |||
| 308 | if (pmnc & pmu->cnt_ovf[i]) | ||
| 309 | results[i].ovf++; | ||
| 310 | } | ||
| 311 | } | ||
| 312 | |||
| 313 | static void inline __xsc2_check_ctrs(void) | ||
| 314 | { | ||
| 315 | int i; | ||
| 316 | u32 flag = 0, pmnc = read_pmnc(); | ||
| 317 | |||
| 318 | pmnc &= ~PMU_ENABLE; | ||
| 319 | write_pmnc(pmnc); | ||
| 320 | |||
| 321 | /* read overflow flag register */ | ||
| 322 | __asm__ __volatile__ ("mrc p14, 0, %0, c5, c1, 0" : "=r" (flag)); | ||
| 323 | |||
| 324 | for (i = CCNT; i <= PMN3; i++) { | ||
| 325 | if (!(pmu->int_mask[i] & pmu->int_enable)) | ||
| 326 | continue; | ||
| 327 | |||
| 328 | if (flag & pmu->cnt_ovf[i]) | ||
| 329 | results[i].ovf++; | ||
| 330 | } | ||
| 331 | |||
| 332 | /* writeback clears overflow bits */ | ||
| 333 | __asm__ __volatile__ ("mcr p14, 0, %0, c5, c1, 0" : : "r" (flag)); | ||
| 334 | } | ||
| 335 | |||
| 336 | static irqreturn_t xscale_pmu_interrupt(int irq, void *arg) | ||
| 337 | { | ||
| 338 | int i; | ||
| 339 | u32 pmnc; | ||
| 340 | |||
| 341 | if (pmu->id == PMU_XSC1) | ||
| 342 | __xsc1_check_ctrs(); | ||
| 343 | else | ||
| 344 | __xsc2_check_ctrs(); | ||
| 345 | |||
| 346 | for (i = CCNT; i < MAX_COUNTERS; i++) { | ||
| 347 | if (!results[i].ovf) | ||
| 348 | continue; | ||
| 349 | |||
| 350 | write_counter(i, -(u32)results[i].reset_counter); | ||
| 351 | oprofile_add_sample(get_irq_regs(), i); | ||
| 352 | results[i].ovf--; | ||
| 353 | } | ||
| 354 | |||
| 355 | pmnc = read_pmnc() | PMU_ENABLE; | ||
| 356 | write_pmnc(pmnc); | ||
| 357 | |||
| 358 | return IRQ_HANDLED; | ||
| 359 | } | ||
| 360 | |||
| 361 | static const struct pmu_irqs *pmu_irqs; | ||
| 362 | |||
| 363 | static void xscale_pmu_stop(void) | ||
| 364 | { | ||
| 365 | u32 pmnc = read_pmnc(); | ||
| 366 | |||
| 367 | pmnc &= ~PMU_ENABLE; | ||
| 368 | write_pmnc(pmnc); | ||
| 369 | |||
| 370 | free_irq(pmu_irqs->irqs[0], results); | ||
| 371 | release_pmu(pmu_irqs); | ||
| 372 | pmu_irqs = NULL; | ||
| 373 | } | ||
| 374 | |||
| 375 | static int xscale_pmu_start(void) | ||
| 376 | { | ||
| 377 | int ret; | ||
| 378 | u32 pmnc; | ||
| 379 | |||
| 380 | pmu_irqs = reserve_pmu(); | ||
| 381 | if (IS_ERR(pmu_irqs)) | ||
| 382 | return PTR_ERR(pmu_irqs); | ||
| 383 | |||
| 384 | pmnc = read_pmnc(); | ||
| 385 | |||
| 386 | ret = request_irq(pmu_irqs->irqs[0], xscale_pmu_interrupt, | ||
| 387 | IRQF_DISABLED, "XScale PMU", (void *)results); | ||
| 388 | |||
| 389 | if (ret < 0) { | ||
| 390 | printk(KERN_ERR "oprofile: unable to request IRQ%d for XScale PMU\n", | ||
| 391 | pmu_irqs->irqs[0]); | ||
| 392 | release_pmu(pmu_irqs); | ||
| 393 | pmu_irqs = NULL; | ||
| 394 | return ret; | ||
| 395 | } | ||
| 396 | |||
| 397 | if (pmu->id == PMU_XSC1) | ||
| 398 | pmnc |= pmu->int_enable; | ||
| 399 | else { | ||
| 400 | __asm__ __volatile__ ("mcr p14, 0, %0, c4, c1, 0" : : "r" (pmu->int_enable)); | ||
| 401 | pmnc &= ~PMU_CNT64; | ||
| 402 | } | ||
| 403 | |||
| 404 | pmnc |= PMU_ENABLE; | ||
| 405 | write_pmnc(pmnc); | ||
| 406 | pr_debug("xscale_pmu_start: pmnc: %#08x mask: %08x\n", pmnc, pmu->int_enable); | ||
| 407 | return 0; | ||
| 408 | } | ||
| 409 | |||
| 410 | static int xscale_detect_pmu(void) | ||
| 411 | { | ||
| 412 | int ret = 0; | ||
| 413 | u32 id; | ||
| 414 | |||
| 415 | id = (read_cpuid(CPUID_ID) >> 13) & 0x7; | ||
| 416 | |||
| 417 | switch (id) { | ||
| 418 | case 1: | ||
| 419 | pmu = &pmu_parms[PMU_XSC1]; | ||
| 420 | break; | ||
| 421 | case 2: | ||
| 422 | pmu = &pmu_parms[PMU_XSC2]; | ||
| 423 | break; | ||
| 424 | default: | ||
| 425 | ret = -ENODEV; | ||
| 426 | break; | ||
| 427 | } | ||
| 428 | |||
| 429 | if (!ret) { | ||
| 430 | op_xscale_spec.name = pmu->name; | ||
| 431 | op_xscale_spec.num_counters = pmu->num_counters; | ||
| 432 | pr_debug("xscale_detect_pmu: detected %s PMU\n", pmu->name); | ||
| 433 | } | ||
| 434 | |||
| 435 | return ret; | ||
| 436 | } | ||
| 437 | |||
| 438 | struct op_arm_model_spec op_xscale_spec = { | ||
| 439 | .init = xscale_detect_pmu, | ||
| 440 | .setup_ctrs = xscale_setup_ctrs, | ||
| 441 | .start = xscale_pmu_start, | ||
| 442 | .stop = xscale_pmu_stop, | ||
| 443 | }; | ||
| 444 | |||
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile index 36bff0325959..69b09c1cec8b 100644 --- a/arch/arm/plat-iop/Makefile +++ b/arch/arm/plat-iop/Makefile | |||
| @@ -13,6 +13,7 @@ obj-$(CONFIG_ARCH_IOP32X) += time.o | |||
| 13 | obj-$(CONFIG_ARCH_IOP32X) += io.o | 13 | obj-$(CONFIG_ARCH_IOP32X) += io.o |
| 14 | obj-$(CONFIG_ARCH_IOP32X) += cp6.o | 14 | obj-$(CONFIG_ARCH_IOP32X) += cp6.o |
| 15 | obj-$(CONFIG_ARCH_IOP32X) += adma.o | 15 | obj-$(CONFIG_ARCH_IOP32X) += adma.o |
| 16 | obj-$(CONFIG_ARCH_IOP32X) += pmu.o | ||
| 16 | 17 | ||
| 17 | # IOP33X | 18 | # IOP33X |
| 18 | obj-$(CONFIG_ARCH_IOP33X) += gpio.o | 19 | obj-$(CONFIG_ARCH_IOP33X) += gpio.o |
| @@ -23,6 +24,7 @@ obj-$(CONFIG_ARCH_IOP33X) += time.o | |||
| 23 | obj-$(CONFIG_ARCH_IOP33X) += io.o | 24 | obj-$(CONFIG_ARCH_IOP33X) += io.o |
| 24 | obj-$(CONFIG_ARCH_IOP33X) += cp6.o | 25 | obj-$(CONFIG_ARCH_IOP33X) += cp6.o |
| 25 | obj-$(CONFIG_ARCH_IOP33X) += adma.o | 26 | obj-$(CONFIG_ARCH_IOP33X) += adma.o |
| 27 | obj-$(CONFIG_ARCH_IOP33X) += pmu.o | ||
| 26 | 28 | ||
| 27 | # IOP13XX | 29 | # IOP13XX |
| 28 | obj-$(CONFIG_ARCH_IOP13XX) += cp6.o | 30 | obj-$(CONFIG_ARCH_IOP13XX) += cp6.o |
diff --git a/arch/arm/plat-iop/pmu.c b/arch/arm/plat-iop/pmu.c new file mode 100644 index 000000000000..a2024b8685a1 --- /dev/null +++ b/arch/arm/plat-iop/pmu.c | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /* | ||
| 2 | * PMU IRQ registration for the iop3xx xscale PMU families. | ||
| 3 | * Copyright (C) 2010 Will Deacon, ARM Ltd. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <linux/platform_device.h> | ||
| 12 | #include <asm/pmu.h> | ||
| 13 | #include <mach/irqs.h> | ||
| 14 | |||
| 15 | static struct resource pmu_resource = { | ||
| 16 | #ifdef CONFIG_ARCH_IOP32X | ||
| 17 | .start = IRQ_IOP32X_CORE_PMU, | ||
| 18 | .end = IRQ_IOP32X_CORE_PMU, | ||
| 19 | #endif | ||
| 20 | #ifdef CONFIG_ARCH_IOP33X | ||
| 21 | .start = IRQ_IOP33X_CORE_PMU, | ||
| 22 | .end = IRQ_IOP33X_CORE_PMU, | ||
| 23 | #endif | ||
| 24 | .flags = IORESOURCE_IRQ, | ||
| 25 | }; | ||
| 26 | |||
| 27 | static struct platform_device pmu_device = { | ||
| 28 | .name = "arm-pmu", | ||
| 29 | .id = ARM_PMU_DEVICE_CPU, | ||
| 30 | .resource = &pmu_resource, | ||
| 31 | .num_resources = 1, | ||
| 32 | }; | ||
| 33 | |||
| 34 | static int __init iop3xx_pmu_init(void) | ||
| 35 | { | ||
| 36 | platform_device_register(&pmu_device); | ||
| 37 | return 0; | ||
| 38 | } | ||
| 39 | |||
| 40 | arch_initcall(iop3xx_pmu_init); | ||
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index 159daf583f85..5da3f97c537b 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig | |||
| @@ -19,4 +19,9 @@ config HAS_MTU | |||
| 19 | to multiple interrupt generating programmable | 19 | to multiple interrupt generating programmable |
| 20 | 32-bit free running decrementing counters. | 20 | 32-bit free running decrementing counters. |
| 21 | 21 | ||
| 22 | config NOMADIK_GPIO | ||
| 23 | bool | ||
| 24 | help | ||
| 25 | Support for the Nomadik GPIO controller. | ||
| 26 | |||
| 22 | endif | 27 | endif |
diff --git a/arch/arm/plat-nomadik/Makefile b/arch/arm/plat-nomadik/Makefile index 37c7cdd0f8f0..c33547361bd7 100644 --- a/arch/arm/plat-nomadik/Makefile +++ b/arch/arm/plat-nomadik/Makefile | |||
| @@ -3,3 +3,4 @@ | |||
| 3 | # Licensed under GPLv2 | 3 | # Licensed under GPLv2 |
| 4 | 4 | ||
| 5 | obj-$(CONFIG_HAS_MTU) += timer.o | 5 | obj-$(CONFIG_HAS_MTU) += timer.o |
| 6 | obj-$(CONFIG_NOMADIK_GPIO) += gpio.o | ||
diff --git a/arch/arm/mach-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c index 66b1c91ccc74..5a6ef252c38b 100644 --- a/arch/arm/mach-nomadik/gpio.c +++ b/arch/arm/plat-nomadik/gpio.c | |||
| @@ -13,8 +13,10 @@ | |||
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
| 16 | #include <linux/amba/bus.h> | 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
| 18 | #include <linux/clk.h> | ||
| 19 | #include <linux/err.h> | ||
| 18 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
| 19 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
| 20 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
| @@ -36,8 +38,9 @@ | |||
| 36 | struct nmk_gpio_chip { | 38 | struct nmk_gpio_chip { |
| 37 | struct gpio_chip chip; | 39 | struct gpio_chip chip; |
| 38 | void __iomem *addr; | 40 | void __iomem *addr; |
| 41 | struct clk *clk; | ||
| 39 | unsigned int parent_irq; | 42 | unsigned int parent_irq; |
| 40 | spinlock_t *lock; | 43 | spinlock_t lock; |
| 41 | /* Keep track of configured edges */ | 44 | /* Keep track of configured edges */ |
| 42 | u32 edge_rising; | 45 | u32 edge_rising; |
| 43 | u32 edge_falling; | 46 | u32 edge_falling; |
| @@ -108,40 +111,37 @@ static void nmk_gpio_irq_ack(unsigned int irq) | |||
| 108 | writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); | 111 | writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); |
| 109 | } | 112 | } |
| 110 | 113 | ||
| 111 | static void nmk_gpio_irq_mask(unsigned int irq) | 114 | static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip, |
| 115 | int gpio, bool enable) | ||
| 112 | { | 116 | { |
| 113 | int gpio; | 117 | u32 bitmask = nmk_gpio_get_bitmask(gpio); |
| 114 | struct nmk_gpio_chip *nmk_chip; | 118 | u32 reg; |
| 115 | unsigned long flags; | ||
| 116 | u32 bitmask, reg; | ||
| 117 | |||
| 118 | gpio = NOMADIK_IRQ_TO_GPIO(irq); | ||
| 119 | nmk_chip = get_irq_chip_data(irq); | ||
| 120 | bitmask = nmk_gpio_get_bitmask(gpio); | ||
| 121 | if (!nmk_chip) | ||
| 122 | return; | ||
| 123 | 119 | ||
| 124 | /* we must individually clear the two edges */ | 120 | /* we must individually set/clear the two edges */ |
| 125 | spin_lock_irqsave(&nmk_chip->lock, flags); | ||
| 126 | if (nmk_chip->edge_rising & bitmask) { | 121 | if (nmk_chip->edge_rising & bitmask) { |
| 127 | reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC); | 122 | reg = readl(nmk_chip->addr + NMK_GPIO_RIMSC); |
| 128 | reg &= ~bitmask; | 123 | if (enable) |
| 129 | writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC); | 124 | reg |= bitmask; |
| 125 | else | ||
| 126 | reg &= ~bitmask; | ||
| 127 | writel(reg, nmk_chip->addr + NMK_GPIO_RIMSC); | ||
| 130 | } | 128 | } |
| 131 | if (nmk_chip->edge_falling & bitmask) { | 129 | if (nmk_chip->edge_falling & bitmask) { |
| 132 | reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC); | 130 | reg = readl(nmk_chip->addr + NMK_GPIO_FIMSC); |
| 133 | reg &= ~bitmask; | 131 | if (enable) |
| 134 | writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC); | 132 | reg |= bitmask; |
| 133 | else | ||
| 134 | reg &= ~bitmask; | ||
| 135 | writel(reg, nmk_chip->addr + NMK_GPIO_FIMSC); | ||
| 135 | } | 136 | } |
| 136 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 137 | } |
| 137 | }; | ||
| 138 | 138 | ||
| 139 | static void nmk_gpio_irq_unmask(unsigned int irq) | 139 | static void nmk_gpio_irq_modify(unsigned int irq, bool enable) |
| 140 | { | 140 | { |
| 141 | int gpio; | 141 | int gpio; |
| 142 | struct nmk_gpio_chip *nmk_chip; | 142 | struct nmk_gpio_chip *nmk_chip; |
| 143 | unsigned long flags; | 143 | unsigned long flags; |
| 144 | u32 bitmask, reg; | 144 | u32 bitmask; |
| 145 | 145 | ||
| 146 | gpio = NOMADIK_IRQ_TO_GPIO(irq); | 146 | gpio = NOMADIK_IRQ_TO_GPIO(irq); |
| 147 | nmk_chip = get_irq_chip_data(irq); | 147 | nmk_chip = get_irq_chip_data(irq); |
| @@ -149,23 +149,24 @@ static void nmk_gpio_irq_unmask(unsigned int irq) | |||
| 149 | if (!nmk_chip) | 149 | if (!nmk_chip) |
| 150 | return; | 150 | return; |
| 151 | 151 | ||
| 152 | /* we must individually set the two edges */ | ||
| 153 | spin_lock_irqsave(&nmk_chip->lock, flags); | 152 | spin_lock_irqsave(&nmk_chip->lock, flags); |
| 154 | if (nmk_chip->edge_rising & bitmask) { | 153 | __nmk_gpio_irq_modify(nmk_chip, gpio, enable); |
| 155 | reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC); | ||
| 156 | reg |= bitmask; | ||
| 157 | writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC); | ||
| 158 | } | ||
| 159 | if (nmk_chip->edge_falling & bitmask) { | ||
| 160 | reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC); | ||
| 161 | reg |= bitmask; | ||
| 162 | writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC); | ||
| 163 | } | ||
| 164 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 154 | spin_unlock_irqrestore(&nmk_chip->lock, flags); |
| 165 | } | 155 | } |
| 166 | 156 | ||
| 157 | static void nmk_gpio_irq_mask(unsigned int irq) | ||
| 158 | { | ||
| 159 | nmk_gpio_irq_modify(irq, false); | ||
| 160 | }; | ||
| 161 | |||
| 162 | static void nmk_gpio_irq_unmask(unsigned int irq) | ||
| 163 | { | ||
| 164 | nmk_gpio_irq_modify(irq, true); | ||
| 165 | } | ||
| 166 | |||
| 167 | static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) | 167 | static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) |
| 168 | { | 168 | { |
| 169 | bool enabled = !(irq_to_desc(irq)->status & IRQ_DISABLED); | ||
| 169 | int gpio; | 170 | int gpio; |
| 170 | struct nmk_gpio_chip *nmk_chip; | 171 | struct nmk_gpio_chip *nmk_chip; |
| 171 | unsigned long flags; | 172 | unsigned long flags; |
| @@ -184,19 +185,21 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) | |||
| 184 | 185 | ||
| 185 | spin_lock_irqsave(&nmk_chip->lock, flags); | 186 | spin_lock_irqsave(&nmk_chip->lock, flags); |
| 186 | 187 | ||
| 188 | if (enabled) | ||
| 189 | __nmk_gpio_irq_modify(nmk_chip, gpio, false); | ||
| 190 | |||
| 187 | nmk_chip->edge_rising &= ~bitmask; | 191 | nmk_chip->edge_rising &= ~bitmask; |
| 188 | if (type & IRQ_TYPE_EDGE_RISING) | 192 | if (type & IRQ_TYPE_EDGE_RISING) |
| 189 | nmk_chip->edge_rising |= bitmask; | 193 | nmk_chip->edge_rising |= bitmask; |
| 190 | writel(nmk_chip->edge_rising, nmk_chip->addr + NMK_GPIO_RIMSC); | ||
| 191 | 194 | ||
| 192 | nmk_chip->edge_falling &= ~bitmask; | 195 | nmk_chip->edge_falling &= ~bitmask; |
| 193 | if (type & IRQ_TYPE_EDGE_FALLING) | 196 | if (type & IRQ_TYPE_EDGE_FALLING) |
| 194 | nmk_chip->edge_falling |= bitmask; | 197 | nmk_chip->edge_falling |= bitmask; |
| 195 | writel(nmk_chip->edge_falling, nmk_chip->addr + NMK_GPIO_FIMSC); | ||
| 196 | 198 | ||
| 197 | spin_unlock_irqrestore(&nmk_chip->lock, flags); | 199 | if (enabled) |
| 200 | __nmk_gpio_irq_modify(nmk_chip, gpio, true); | ||
| 198 | 201 | ||
| 199 | nmk_gpio_irq_unmask(irq); | 202 | spin_unlock_irqrestore(&nmk_chip->lock, flags); |
| 200 | 203 | ||
| 201 | return 0; | 204 | return 0; |
| 202 | } | 205 | } |
| @@ -212,21 +215,27 @@ static struct irq_chip nmk_gpio_irq_chip = { | |||
| 212 | static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 215 | static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) |
| 213 | { | 216 | { |
| 214 | struct nmk_gpio_chip *nmk_chip; | 217 | struct nmk_gpio_chip *nmk_chip; |
| 215 | struct irq_chip *host_chip; | 218 | struct irq_chip *host_chip = get_irq_chip(irq); |
| 216 | unsigned int gpio_irq; | 219 | unsigned int gpio_irq; |
| 217 | u32 pending; | 220 | u32 pending; |
| 218 | unsigned int first_irq; | 221 | unsigned int first_irq; |
| 219 | 222 | ||
| 223 | if (host_chip->mask_ack) | ||
| 224 | host_chip->mask_ack(irq); | ||
| 225 | else { | ||
| 226 | host_chip->mask(irq); | ||
| 227 | if (host_chip->ack) | ||
| 228 | host_chip->ack(irq); | ||
| 229 | } | ||
| 230 | |||
| 220 | nmk_chip = get_irq_data(irq); | 231 | nmk_chip = get_irq_data(irq); |
| 221 | first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); | 232 | first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); |
| 222 | while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) { | 233 | while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) { |
| 223 | gpio_irq = first_irq + __ffs(pending); | 234 | gpio_irq = first_irq + __ffs(pending); |
| 224 | generic_handle_irq(gpio_irq); | 235 | generic_handle_irq(gpio_irq); |
| 225 | } | 236 | } |
| 226 | if (0) {/* don't ack parent irq, as ack == disable */ | 237 | |
| 227 | host_chip = get_irq_chip(irq); | 238 | host_chip->unmask(irq); |
| 228 | host_chip->ack(irq); | ||
| 229 | } | ||
| 230 | } | 239 | } |
| 231 | 240 | ||
| 232 | static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) | 241 | static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) |
| @@ -240,6 +249,7 @@ static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) | |||
| 240 | set_irq_handler(i, handle_edge_irq); | 249 | set_irq_handler(i, handle_edge_irq); |
| 241 | set_irq_flags(i, IRQF_VALID); | 250 | set_irq_flags(i, IRQF_VALID); |
| 242 | set_irq_chip_data(i, nmk_chip); | 251 | set_irq_chip_data(i, nmk_chip); |
| 252 | set_irq_type(i, IRQ_TYPE_EDGE_FALLING); | ||
| 243 | } | 253 | } |
| 244 | set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler); | 254 | set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler); |
| 245 | set_irq_data(nmk_chip->parent_irq, nmk_chip); | 255 | set_irq_data(nmk_chip->parent_irq, nmk_chip); |
| @@ -298,30 +308,59 @@ static struct gpio_chip nmk_gpio_template = { | |||
| 298 | .can_sleep = 0, | 308 | .can_sleep = 0, |
| 299 | }; | 309 | }; |
| 300 | 310 | ||
| 301 | static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | 311 | static int __init nmk_gpio_probe(struct platform_device *dev) |
| 302 | { | 312 | { |
| 303 | struct nmk_gpio_platform_data *pdata; | 313 | struct nmk_gpio_platform_data *pdata = dev->dev.platform_data; |
| 304 | struct nmk_gpio_chip *nmk_chip; | 314 | struct nmk_gpio_chip *nmk_chip; |
| 305 | struct gpio_chip *chip; | 315 | struct gpio_chip *chip; |
| 316 | struct resource *res; | ||
| 317 | struct clk *clk; | ||
| 318 | int irq; | ||
| 306 | int ret; | 319 | int ret; |
| 307 | 320 | ||
| 308 | pdata = dev->dev.platform_data; | 321 | if (!pdata) |
| 309 | ret = amba_request_regions(dev, pdata->name); | 322 | return -ENODEV; |
| 310 | if (ret) | 323 | |
| 311 | return ret; | 324 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 325 | if (!res) { | ||
| 326 | ret = -ENOENT; | ||
| 327 | goto out; | ||
| 328 | } | ||
| 329 | |||
| 330 | irq = platform_get_irq(dev, 0); | ||
| 331 | if (irq < 0) { | ||
| 332 | ret = irq; | ||
| 333 | goto out; | ||
| 334 | } | ||
| 335 | |||
| 336 | if (request_mem_region(res->start, resource_size(res), | ||
| 337 | dev_name(&dev->dev)) == NULL) { | ||
| 338 | ret = -EBUSY; | ||
| 339 | goto out; | ||
| 340 | } | ||
| 341 | |||
| 342 | clk = clk_get(&dev->dev, NULL); | ||
| 343 | if (IS_ERR(clk)) { | ||
| 344 | ret = PTR_ERR(clk); | ||
| 345 | goto out_release; | ||
| 346 | } | ||
| 347 | |||
| 348 | clk_enable(clk); | ||
| 312 | 349 | ||
| 313 | nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); | 350 | nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); |
| 314 | if (!nmk_chip) { | 351 | if (!nmk_chip) { |
| 315 | ret = -ENOMEM; | 352 | ret = -ENOMEM; |
| 316 | goto out_amba; | 353 | goto out_clk; |
| 317 | } | 354 | } |
| 318 | /* | 355 | /* |
| 319 | * The virt address in nmk_chip->addr is in the nomadik register space, | 356 | * The virt address in nmk_chip->addr is in the nomadik register space, |
| 320 | * so we can simply convert the resource address, without remapping | 357 | * so we can simply convert the resource address, without remapping |
| 321 | */ | 358 | */ |
| 322 | nmk_chip->addr = io_p2v(dev->res.start); | 359 | nmk_chip->clk = clk; |
| 360 | nmk_chip->addr = io_p2v(res->start); | ||
| 323 | nmk_chip->chip = nmk_gpio_template; | 361 | nmk_chip->chip = nmk_gpio_template; |
| 324 | nmk_chip->parent_irq = pdata->parent_irq; | 362 | nmk_chip->parent_irq = irq; |
| 363 | spin_lock_init(&nmk_chip->lock); | ||
| 325 | 364 | ||
| 326 | chip = &nmk_chip->chip; | 365 | chip = &nmk_chip->chip; |
| 327 | chip->base = pdata->first_gpio; | 366 | chip->base = pdata->first_gpio; |
| @@ -333,7 +372,7 @@ static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | |||
| 333 | if (ret) | 372 | if (ret) |
| 334 | goto out_free; | 373 | goto out_free; |
| 335 | 374 | ||
| 336 | amba_set_drvdata(dev, nmk_chip); | 375 | platform_set_drvdata(dev, nmk_chip); |
| 337 | 376 | ||
| 338 | nmk_gpio_init_irq(nmk_chip); | 377 | nmk_gpio_init_irq(nmk_chip); |
| 339 | 378 | ||
| @@ -341,51 +380,50 @@ static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) | |||
| 341 | nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr); | 380 | nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr); |
| 342 | return 0; | 381 | return 0; |
| 343 | 382 | ||
| 344 | out_free: | 383 | out_free: |
| 345 | kfree(nmk_chip); | 384 | kfree(nmk_chip); |
| 346 | out_amba: | 385 | out_clk: |
| 347 | amba_release_regions(dev); | 386 | clk_disable(clk); |
| 387 | clk_put(clk); | ||
| 388 | out_release: | ||
| 389 | release_mem_region(res->start, resource_size(res)); | ||
| 390 | out: | ||
| 348 | dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret, | 391 | dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret, |
| 349 | pdata->first_gpio, pdata->first_gpio+31); | 392 | pdata->first_gpio, pdata->first_gpio+31); |
| 350 | return ret; | 393 | return ret; |
| 351 | } | 394 | } |
| 352 | 395 | ||
| 353 | static int nmk_gpio_remove(struct amba_device *dev) | 396 | static int __exit nmk_gpio_remove(struct platform_device *dev) |
| 354 | { | 397 | { |
| 355 | struct nmk_gpio_chip *nmk_chip; | 398 | struct nmk_gpio_chip *nmk_chip; |
| 399 | struct resource *res; | ||
| 356 | 400 | ||
| 357 | nmk_chip = amba_get_drvdata(dev); | 401 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
| 402 | |||
| 403 | nmk_chip = platform_get_drvdata(dev); | ||
| 358 | gpiochip_remove(&nmk_chip->chip); | 404 | gpiochip_remove(&nmk_chip->chip); |
| 405 | clk_disable(nmk_chip->clk); | ||
| 406 | clk_put(nmk_chip->clk); | ||
| 359 | kfree(nmk_chip); | 407 | kfree(nmk_chip); |
| 360 | amba_release_regions(dev); | 408 | release_mem_region(res->start, resource_size(res)); |
| 361 | return 0; | 409 | return 0; |
| 362 | } | 410 | } |
| 363 | 411 | ||
| 364 | 412 | ||
| 365 | /* We have 0x1f080060 and 0x1f180060, accept both using the mask */ | 413 | static struct platform_driver nmk_gpio_driver = { |
| 366 | static struct amba_id nmk_gpio_ids[] = { | 414 | .driver = { |
| 367 | { | ||
| 368 | .id = 0x1f080060, | ||
| 369 | .mask = 0xffefffff, | ||
| 370 | }, | ||
| 371 | {0, 0}, | ||
| 372 | }; | ||
| 373 | |||
| 374 | static struct amba_driver nmk_gpio_driver = { | ||
| 375 | .drv = { | ||
| 376 | .owner = THIS_MODULE, | 415 | .owner = THIS_MODULE, |
| 377 | .name = "gpio", | 416 | .name = "gpio", |
| 378 | }, | 417 | }, |
| 379 | .probe = nmk_gpio_probe, | 418 | .probe = nmk_gpio_probe, |
| 380 | .remove = nmk_gpio_remove, | 419 | .remove = __exit_p(nmk_gpio_remove), |
| 381 | .suspend = NULL, /* to be done */ | 420 | .suspend = NULL, /* to be done */ |
| 382 | .resume = NULL, | 421 | .resume = NULL, |
| 383 | .id_table = nmk_gpio_ids, | ||
| 384 | }; | 422 | }; |
| 385 | 423 | ||
| 386 | static int __init nmk_gpio_init(void) | 424 | static int __init nmk_gpio_init(void) |
| 387 | { | 425 | { |
| 388 | return amba_driver_register(&nmk_gpio_driver); | 426 | return platform_driver_register(&nmk_gpio_driver); |
| 389 | } | 427 | } |
| 390 | 428 | ||
| 391 | arch_initcall(nmk_gpio_init); | 429 | arch_initcall(nmk_gpio_init); |
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h new file mode 100644 index 000000000000..4200811249ca --- /dev/null +++ b/arch/arm/plat-nomadik/include/plat/gpio.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | /* | ||
| 2 | * Structures and registers for GPIO access in the Nomadik SoC | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 STMicroelectronics | ||
| 5 | * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> | ||
| 6 | * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | #ifndef __ASM_PLAT_GPIO_H | ||
| 13 | #define __ASM_PLAT_GPIO_H | ||
| 14 | |||
| 15 | #include <asm-generic/gpio.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | * These currently cause a function call to happen, they may be optimized | ||
| 19 | * if needed by adding cpu-specific defines to identify blocks | ||
| 20 | * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc) | ||
| 21 | */ | ||
| 22 | #define gpio_get_value __gpio_get_value | ||
| 23 | #define gpio_set_value __gpio_set_value | ||
| 24 | #define gpio_cansleep __gpio_cansleep | ||
| 25 | #define gpio_to_irq __gpio_to_irq | ||
| 26 | |||
| 27 | /* | ||
| 28 | * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving | ||
| 29 | * the "gpio" namespace for generic and cross-machine functions | ||
| 30 | */ | ||
| 31 | |||
| 32 | /* Register in the logic block */ | ||
| 33 | #define NMK_GPIO_DAT 0x00 | ||
| 34 | #define NMK_GPIO_DATS 0x04 | ||
| 35 | #define NMK_GPIO_DATC 0x08 | ||
| 36 | #define NMK_GPIO_PDIS 0x0c | ||
| 37 | #define NMK_GPIO_DIR 0x10 | ||
| 38 | #define NMK_GPIO_DIRS 0x14 | ||
| 39 | #define NMK_GPIO_DIRC 0x18 | ||
| 40 | #define NMK_GPIO_SLPC 0x1c | ||
| 41 | #define NMK_GPIO_AFSLA 0x20 | ||
| 42 | #define NMK_GPIO_AFSLB 0x24 | ||
| 43 | |||
| 44 | #define NMK_GPIO_RIMSC 0x40 | ||
| 45 | #define NMK_GPIO_FIMSC 0x44 | ||
| 46 | #define NMK_GPIO_IS 0x48 | ||
| 47 | #define NMK_GPIO_IC 0x4c | ||
| 48 | #define NMK_GPIO_RWIMSC 0x50 | ||
| 49 | #define NMK_GPIO_FWIMSC 0x54 | ||
| 50 | #define NMK_GPIO_WKS 0x58 | ||
| 51 | |||
| 52 | /* Alternate functions: function C is set in hw by setting both A and B */ | ||
| 53 | #define NMK_GPIO_ALT_GPIO 0 | ||
| 54 | #define NMK_GPIO_ALT_A 1 | ||
| 55 | #define NMK_GPIO_ALT_B 2 | ||
| 56 | #define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) | ||
| 57 | |||
| 58 | extern int nmk_gpio_set_mode(int gpio, int gpio_mode); | ||
| 59 | extern int nmk_gpio_get_mode(int gpio); | ||
| 60 | |||
| 61 | /* | ||
| 62 | * Platform data to register a block: only the initial gpio/irq number. | ||
| 63 | */ | ||
| 64 | struct nmk_gpio_platform_data { | ||
| 65 | char *name; | ||
| 66 | int first_gpio; | ||
| 67 | int first_irq; | ||
| 68 | }; | ||
| 69 | |||
| 70 | #endif /* __ASM_PLAT_GPIO_H */ | ||
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index fa7cb3a57cbf..0ff3798769ab 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * linux/arch/arm/mach-nomadik/timer.c | 2 | * linux/arch/arm/mach-nomadik/timer.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2008 STMicroelectronics | 4 | * Copyright (C) 2008 STMicroelectronics |
| 5 | * Copyright (C) 2009 Alessandro Rubini, somewhat based on at91sam926x | 5 | * Copyright (C) 2010 Alessandro Rubini |
| 6 | * | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2, as | 8 | * it under the terms of the GNU General Public License version 2, as |
| @@ -18,123 +18,150 @@ | |||
| 18 | 18 | ||
| 19 | #include <plat/mtu.h> | 19 | #include <plat/mtu.h> |
| 20 | 20 | ||
| 21 | static u32 nmdk_count; /* accumulated count */ | 21 | void __iomem *mtu_base; /* ssigned by machine code */ |
| 22 | static u32 nmdk_cycle; /* write-once */ | ||
| 23 | |||
| 24 | /* setup by the platform code */ | ||
| 25 | void __iomem *mtu_base; | ||
| 26 | 22 | ||
| 27 | /* | 23 | /* |
| 28 | * clocksource: the MTU device is a decrementing counters, so we negate | 24 | * Kernel assumes that sched_clock can be called early |
| 29 | * the value being read. | 25 | * but the MTU may not yet be initialized. |
| 30 | */ | 26 | */ |
| 31 | static cycle_t nmdk_read_timer(struct clocksource *cs) | 27 | static cycle_t nmdk_read_timer_dummy(struct clocksource *cs) |
| 32 | { | 28 | { |
| 33 | u32 count = readl(mtu_base + MTU_VAL(0)); | 29 | return 0; |
| 34 | return nmdk_count + nmdk_cycle - count; | 30 | } |
| 35 | 31 | ||
| 32 | /* clocksource: MTU decrements, so we negate the value being read. */ | ||
| 33 | static cycle_t nmdk_read_timer(struct clocksource *cs) | ||
| 34 | { | ||
| 35 | return -readl(mtu_base + MTU_VAL(0)); | ||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | static struct clocksource nmdk_clksrc = { | 38 | static struct clocksource nmdk_clksrc = { |
| 39 | .name = "mtu_0", | 39 | .name = "mtu_0", |
| 40 | .rating = 120, | 40 | .rating = 200, |
| 41 | .read = nmdk_read_timer, | 41 | .read = nmdk_read_timer_dummy, |
| 42 | .mask = CLOCKSOURCE_MASK(32), | ||
| 42 | .shift = 20, | 43 | .shift = 20, |
| 43 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 44 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
| 44 | }; | 45 | }; |
| 45 | 46 | ||
| 46 | /* | 47 | /* |
| 47 | * Clockevent device: currently only periodic mode is supported | 48 | * Override the global weak sched_clock symbol with this |
| 49 | * local implementation which uses the clocksource to get some | ||
| 50 | * better resolution when scheduling the kernel. We accept that | ||
| 51 | * this wraps around for now, since it is just a relative time | ||
| 52 | * stamp. (Inspired by OMAP implementation.) | ||
| 48 | */ | 53 | */ |
| 54 | unsigned long long notrace sched_clock(void) | ||
| 55 | { | ||
| 56 | return clocksource_cyc2ns(nmdk_clksrc.read( | ||
| 57 | &nmdk_clksrc), | ||
| 58 | nmdk_clksrc.mult, | ||
| 59 | nmdk_clksrc.shift); | ||
| 60 | } | ||
| 61 | |||
| 62 | /* Clockevent device: use one-shot mode */ | ||
| 49 | static void nmdk_clkevt_mode(enum clock_event_mode mode, | 63 | static void nmdk_clkevt_mode(enum clock_event_mode mode, |
| 50 | struct clock_event_device *dev) | 64 | struct clock_event_device *dev) |
| 51 | { | 65 | { |
| 66 | u32 cr; | ||
| 67 | |||
| 52 | switch (mode) { | 68 | switch (mode) { |
| 53 | case CLOCK_EVT_MODE_PERIODIC: | 69 | case CLOCK_EVT_MODE_PERIODIC: |
| 54 | /* count current value? */ | 70 | pr_err("%s: periodic mode not supported\n", __func__); |
| 55 | writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC); | ||
| 56 | break; | 71 | break; |
| 57 | case CLOCK_EVT_MODE_ONESHOT: | 72 | case CLOCK_EVT_MODE_ONESHOT: |
| 58 | BUG(); /* Not supported, yet */ | 73 | /* Load highest value, enable device, enable interrupts */ |
| 59 | /* FALLTHROUGH */ | 74 | cr = readl(mtu_base + MTU_CR(1)); |
| 75 | writel(0, mtu_base + MTU_LR(1)); | ||
| 76 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1)); | ||
| 77 | writel(0x2, mtu_base + MTU_IMSC); | ||
| 78 | break; | ||
| 60 | case CLOCK_EVT_MODE_SHUTDOWN: | 79 | case CLOCK_EVT_MODE_SHUTDOWN: |
| 61 | case CLOCK_EVT_MODE_UNUSED: | 80 | case CLOCK_EVT_MODE_UNUSED: |
| 62 | writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC); | 81 | /* disable irq */ |
| 82 | writel(0, mtu_base + MTU_IMSC); | ||
| 63 | break; | 83 | break; |
| 64 | case CLOCK_EVT_MODE_RESUME: | 84 | case CLOCK_EVT_MODE_RESUME: |
| 65 | break; | 85 | break; |
| 66 | } | 86 | } |
| 67 | } | 87 | } |
| 68 | 88 | ||
| 89 | static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev) | ||
| 90 | { | ||
| 91 | /* writing the value has immediate effect */ | ||
| 92 | writel(evt, mtu_base + MTU_LR(1)); | ||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | |||
| 69 | static struct clock_event_device nmdk_clkevt = { | 96 | static struct clock_event_device nmdk_clkevt = { |
| 70 | .name = "mtu_0", | 97 | .name = "mtu_1", |
| 71 | .features = CLOCK_EVT_FEAT_PERIODIC, | 98 | .features = CLOCK_EVT_FEAT_ONESHOT, |
| 72 | .shift = 32, | 99 | .shift = 32, |
| 73 | .rating = 100, | 100 | .rating = 200, |
| 74 | .set_mode = nmdk_clkevt_mode, | 101 | .set_mode = nmdk_clkevt_mode, |
| 102 | .set_next_event = nmdk_clkevt_next, | ||
| 75 | }; | 103 | }; |
| 76 | 104 | ||
| 77 | /* | 105 | /* |
| 78 | * IRQ Handler for the timer 0 of the MTU block. The irq is not shared | 106 | * IRQ Handler for timer 1 of the MTU block. |
| 79 | * as we are the only users of mtu0 by now. | ||
| 80 | */ | 107 | */ |
| 81 | static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id) | 108 | static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id) |
| 82 | { | 109 | { |
| 83 | /* ack: "interrupt clear register" */ | 110 | struct clock_event_device *evdev = dev_id; |
| 84 | writel(1 << 0, mtu_base + MTU_ICR); | ||
| 85 | |||
| 86 | /* we can't count lost ticks, unfortunately */ | ||
| 87 | nmdk_count += nmdk_cycle; | ||
| 88 | nmdk_clkevt.event_handler(&nmdk_clkevt); | ||
| 89 | 111 | ||
| 112 | writel(1 << 1, mtu_base + MTU_ICR); /* Interrupt clear reg */ | ||
| 113 | evdev->event_handler(evdev); | ||
| 90 | return IRQ_HANDLED; | 114 | return IRQ_HANDLED; |
| 91 | } | 115 | } |
| 92 | 116 | ||
| 93 | /* | ||
| 94 | * Set up timer interrupt, and return the current time in seconds. | ||
| 95 | */ | ||
| 96 | static struct irqaction nmdk_timer_irq = { | 117 | static struct irqaction nmdk_timer_irq = { |
| 97 | .name = "Nomadik Timer Tick", | 118 | .name = "Nomadik Timer Tick", |
| 98 | .flags = IRQF_DISABLED | IRQF_TIMER, | 119 | .flags = IRQF_DISABLED | IRQF_TIMER, |
| 99 | .handler = nmdk_timer_interrupt, | 120 | .handler = nmdk_timer_interrupt, |
| 121 | .dev_id = &nmdk_clkevt, | ||
| 100 | }; | 122 | }; |
| 101 | 123 | ||
| 102 | static void nmdk_timer_reset(void) | ||
| 103 | { | ||
| 104 | u32 cr; | ||
| 105 | |||
| 106 | writel(0, mtu_base + MTU_CR(0)); /* off */ | ||
| 107 | |||
| 108 | /* configure load and background-load, and fire it up */ | ||
| 109 | writel(nmdk_cycle, mtu_base + MTU_LR(0)); | ||
| 110 | writel(nmdk_cycle, mtu_base + MTU_BGLR(0)); | ||
| 111 | cr = MTU_CRn_PERIODIC | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS; | ||
| 112 | writel(cr, mtu_base + MTU_CR(0)); | ||
| 113 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); | ||
| 114 | } | ||
| 115 | |||
| 116 | void __init nmdk_timer_init(void) | 124 | void __init nmdk_timer_init(void) |
| 117 | { | 125 | { |
| 118 | unsigned long rate; | 126 | unsigned long rate; |
| 119 | int bits; | 127 | u32 cr = MTU_CRn_32BITS;; |
| 120 | 128 | ||
| 121 | rate = CLOCK_TICK_RATE; /* 2.4MHz */ | 129 | /* |
| 122 | nmdk_cycle = (rate + HZ/2) / HZ; | 130 | * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500: |
| 131 | * use a divide-by-16 counter if it's more than 16MHz | ||
| 132 | */ | ||
| 133 | rate = CLOCK_TICK_RATE; | ||
| 134 | if (rate > 16 << 20) { | ||
| 135 | rate /= 16; | ||
| 136 | cr |= MTU_CRn_PRESCALE_16; | ||
| 137 | } else { | ||
| 138 | cr |= MTU_CRn_PRESCALE_1; | ||
| 139 | } | ||
| 123 | 140 | ||
| 124 | /* Init the timer and register clocksource */ | 141 | /* Timer 0 is the free running clocksource */ |
| 125 | nmdk_timer_reset(); | 142 | writel(cr, mtu_base + MTU_CR(0)); |
| 143 | writel(0, mtu_base + MTU_LR(0)); | ||
| 144 | writel(0, mtu_base + MTU_BGLR(0)); | ||
| 145 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); | ||
| 126 | 146 | ||
| 127 | nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift); | 147 | nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift); |
| 128 | bits = 8*sizeof(nmdk_count); | 148 | /* Now the scheduling clock is ready */ |
| 129 | nmdk_clksrc.mask = CLOCKSOURCE_MASK(bits); | 149 | nmdk_clksrc.read = nmdk_read_timer; |
| 130 | 150 | ||
| 131 | if (clocksource_register(&nmdk_clksrc)) | 151 | if (clocksource_register(&nmdk_clksrc)) |
| 132 | printk(KERN_ERR "timer: failed to initialize clock " | 152 | pr_err("timer: failed to initialize clock source %s\n", |
| 133 | "source %s\n", nmdk_clksrc.name); | 153 | nmdk_clksrc.name); |
| 154 | |||
| 155 | /* Timer 1 is used for events, fix according to rate */ | ||
| 156 | writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */ | ||
| 157 | nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift); | ||
| 158 | nmdk_clkevt.max_delta_ns = | ||
| 159 | clockevent_delta2ns(0xffffffff, &nmdk_clkevt); | ||
| 160 | nmdk_clkevt.min_delta_ns = | ||
| 161 | clockevent_delta2ns(0x00000002, &nmdk_clkevt); | ||
| 162 | nmdk_clkevt.cpumask = cpumask_of(0); | ||
| 134 | 163 | ||
| 135 | /* Register irq and clockevents */ | 164 | /* Register irq and clockevents */ |
| 136 | setup_irq(IRQ_MTU0, &nmdk_timer_irq); | 165 | setup_irq(IRQ_MTU0, &nmdk_timer_irq); |
| 137 | nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift); | ||
| 138 | nmdk_clkevt.cpumask = cpumask_of(0); | ||
| 139 | clockevents_register_device(&nmdk_clkevt); | 166 | clockevents_register_device(&nmdk_clkevt); |
| 140 | } | 167 | } |
diff --git a/arch/arm/plat-pxa/Makefile b/arch/arm/plat-pxa/Makefile index 4aacdd12c9cc..6187edfbcb77 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/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 2c9bf9b68327..eed3c2d8dd1c 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/dma-mapping.h> | 38 | #include <linux/dma-mapping.h> |
| 39 | #include <linux/atmel_pdc.h> | 39 | #include <linux/atmel_pdc.h> |
| 40 | #include <linux/atmel_serial.h> | 40 | #include <linux/atmel_serial.h> |
| 41 | #include <linux/uaccess.h> | ||
| 41 | 42 | ||
| 42 | #include <asm/io.h> | 43 | #include <asm/io.h> |
| 43 | 44 | ||
| @@ -59,6 +60,9 @@ | |||
| 59 | 60 | ||
| 60 | #include <linux/serial_core.h> | 61 | #include <linux/serial_core.h> |
| 61 | 62 | ||
| 63 | static void atmel_start_rx(struct uart_port *port); | ||
| 64 | static void atmel_stop_rx(struct uart_port *port); | ||
| 65 | |||
| 62 | #ifdef CONFIG_SERIAL_ATMEL_TTYAT | 66 | #ifdef CONFIG_SERIAL_ATMEL_TTYAT |
| 63 | 67 | ||
| 64 | /* Use device name ttyAT, major 204 and minor 154-169. This is necessary if we | 68 | /* Use device name ttyAT, major 204 and minor 154-169. This is necessary if we |
| @@ -93,6 +97,7 @@ | |||
| 93 | #define UART_GET_BRGR(port) __raw_readl((port)->membase + ATMEL_US_BRGR) | 97 | #define UART_GET_BRGR(port) __raw_readl((port)->membase + ATMEL_US_BRGR) |
| 94 | #define UART_PUT_BRGR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_BRGR) | 98 | #define UART_PUT_BRGR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_BRGR) |
| 95 | #define UART_PUT_RTOR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_RTOR) | 99 | #define UART_PUT_RTOR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_RTOR) |
| 100 | #define UART_PUT_TTGR(port, v) __raw_writel(v, (port)->membase + ATMEL_US_TTGR) | ||
| 96 | 101 | ||
| 97 | /* PDC registers */ | 102 | /* PDC registers */ |
| 98 | #define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) | 103 | #define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) |
| @@ -147,6 +152,9 @@ struct atmel_uart_port { | |||
| 147 | unsigned int irq_status_prev; | 152 | unsigned int irq_status_prev; |
| 148 | 153 | ||
| 149 | struct circ_buf rx_ring; | 154 | struct circ_buf rx_ring; |
| 155 | |||
| 156 | struct serial_rs485 rs485; /* rs485 settings */ | ||
| 157 | unsigned int tx_done_mask; | ||
| 150 | }; | 158 | }; |
| 151 | 159 | ||
| 152 | static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART]; | 160 | static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART]; |
| @@ -187,6 +195,46 @@ static bool atmel_use_dma_tx(struct uart_port *port) | |||
| 187 | } | 195 | } |
| 188 | #endif | 196 | #endif |
| 189 | 197 | ||
| 198 | /* Enable or disable the rs485 support */ | ||
| 199 | void atmel_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf) | ||
| 200 | { | ||
| 201 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | ||
| 202 | unsigned int mode; | ||
| 203 | |||
| 204 | spin_lock(&port->lock); | ||
| 205 | |||
| 206 | /* Disable interrupts */ | ||
| 207 | UART_PUT_IDR(port, atmel_port->tx_done_mask); | ||
| 208 | |||
| 209 | mode = UART_GET_MR(port); | ||
| 210 | |||
| 211 | /* Resetting serial mode to RS232 (0x0) */ | ||
| 212 | mode &= ~ATMEL_US_USMODE; | ||
| 213 | |||
| 214 | atmel_port->rs485 = *rs485conf; | ||
| 215 | |||
| 216 | if (rs485conf->flags & SER_RS485_ENABLED) { | ||
| 217 | dev_dbg(port->dev, "Setting UART to RS485\n"); | ||
| 218 | atmel_port->tx_done_mask = ATMEL_US_TXEMPTY; | ||
| 219 | UART_PUT_TTGR(port, rs485conf->delay_rts_before_send); | ||
| 220 | mode |= ATMEL_US_USMODE_RS485; | ||
| 221 | } else { | ||
| 222 | dev_dbg(port->dev, "Setting UART to RS232\n"); | ||
| 223 | if (atmel_use_dma_tx(port)) | ||
| 224 | atmel_port->tx_done_mask = ATMEL_US_ENDTX | | ||
| 225 | ATMEL_US_TXBUFE; | ||
| 226 | else | ||
| 227 | atmel_port->tx_done_mask = ATMEL_US_TXRDY; | ||
| 228 | } | ||
| 229 | UART_PUT_MR(port, mode); | ||
| 230 | |||
| 231 | /* Enable interrupts */ | ||
| 232 | UART_PUT_IER(port, atmel_port->tx_done_mask); | ||
| 233 | |||
| 234 | spin_unlock(&port->lock); | ||
| 235 | |||
| 236 | } | ||
| 237 | |||
| 190 | /* | 238 | /* |
| 191 | * Return TIOCSER_TEMT when transmitter FIFO and Shift register is empty. | 239 | * Return TIOCSER_TEMT when transmitter FIFO and Shift register is empty. |
| 192 | */ | 240 | */ |
| @@ -202,6 +250,7 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl) | |||
| 202 | { | 250 | { |
| 203 | unsigned int control = 0; | 251 | unsigned int control = 0; |
| 204 | unsigned int mode; | 252 | unsigned int mode; |
| 253 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | ||
| 205 | 254 | ||
| 206 | #ifdef CONFIG_ARCH_AT91RM9200 | 255 | #ifdef CONFIG_ARCH_AT91RM9200 |
| 207 | if (cpu_is_at91rm9200()) { | 256 | if (cpu_is_at91rm9200()) { |
| @@ -236,6 +285,17 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl) | |||
| 236 | mode |= ATMEL_US_CHMODE_LOC_LOOP; | 285 | mode |= ATMEL_US_CHMODE_LOC_LOOP; |
| 237 | else | 286 | else |
| 238 | mode |= ATMEL_US_CHMODE_NORMAL; | 287 | mode |= ATMEL_US_CHMODE_NORMAL; |
| 288 | |||
| 289 | /* Resetting serial mode to RS232 (0x0) */ | ||
| 290 | mode &= ~ATMEL_US_USMODE; | ||
| 291 | |||
| 292 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) { | ||
| 293 | dev_dbg(port->dev, "Setting UART to RS485\n"); | ||
| 294 | UART_PUT_TTGR(port, atmel_port->rs485.delay_rts_before_send); | ||
| 295 | mode |= ATMEL_US_USMODE_RS485; | ||
| 296 | } else { | ||
| 297 | dev_dbg(port->dev, "Setting UART to RS232\n"); | ||
| 298 | } | ||
| 239 | UART_PUT_MR(port, mode); | 299 | UART_PUT_MR(port, mode); |
| 240 | } | 300 | } |
| 241 | 301 | ||
| @@ -268,12 +328,17 @@ static u_int atmel_get_mctrl(struct uart_port *port) | |||
| 268 | */ | 328 | */ |
| 269 | static void atmel_stop_tx(struct uart_port *port) | 329 | static void atmel_stop_tx(struct uart_port *port) |
| 270 | { | 330 | { |
| 331 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | ||
| 332 | |||
| 271 | if (atmel_use_dma_tx(port)) { | 333 | if (atmel_use_dma_tx(port)) { |
| 272 | /* disable PDC transmit */ | 334 | /* disable PDC transmit */ |
| 273 | UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); | 335 | UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); |
| 274 | UART_PUT_IDR(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); | 336 | } |
| 275 | } else | 337 | /* Disable interrupts */ |
| 276 | UART_PUT_IDR(port, ATMEL_US_TXRDY); | 338 | UART_PUT_IDR(port, atmel_port->tx_done_mask); |
| 339 | |||
| 340 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) | ||
| 341 | atmel_start_rx(port); | ||
| 277 | } | 342 | } |
| 278 | 343 | ||
| 279 | /* | 344 | /* |
| @@ -281,17 +346,39 @@ static void atmel_stop_tx(struct uart_port *port) | |||
| 281 | */ | 346 | */ |
| 282 | static void atmel_start_tx(struct uart_port *port) | 347 | static void atmel_start_tx(struct uart_port *port) |
| 283 | { | 348 | { |
| 349 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | ||
| 350 | |||
| 284 | if (atmel_use_dma_tx(port)) { | 351 | if (atmel_use_dma_tx(port)) { |
| 285 | if (UART_GET_PTSR(port) & ATMEL_PDC_TXTEN) | 352 | if (UART_GET_PTSR(port) & ATMEL_PDC_TXTEN) |
| 286 | /* The transmitter is already running. Yes, we | 353 | /* The transmitter is already running. Yes, we |
| 287 | really need this.*/ | 354 | really need this.*/ |
| 288 | return; | 355 | return; |
| 289 | 356 | ||
| 290 | UART_PUT_IER(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); | 357 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) |
| 358 | atmel_stop_rx(port); | ||
| 359 | |||
| 291 | /* re-enable PDC transmit */ | 360 | /* re-enable PDC transmit */ |
| 292 | UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); | 361 | UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); |
| 293 | } else | 362 | } |
| 294 | UART_PUT_IER(port, ATMEL_US_TXRDY); | 363 | /* Enable interrupts */ |
| 364 | UART_PUT_IER(port, atmel_port->tx_done_mask); | ||
| 365 | } | ||
| 366 | |||
| 367 | /* | ||
| 368 | * start receiving - port is in process of being opened. | ||
| 369 | */ | ||
| 370 | static void atmel_start_rx(struct uart_port *port) | ||
| 371 | { | ||
| 372 | UART_PUT_CR(port, ATMEL_US_RSTSTA); /* reset status and receiver */ | ||
| 373 | |||
| 374 | if (atmel_use_dma_rx(port)) { | ||
| 375 | /* enable PDC controller */ | ||
| 376 | UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT | | ||
| 377 | port->read_status_mask); | ||
| 378 | UART_PUT_PTCR(port, ATMEL_PDC_RXTEN); | ||
| 379 | } else { | ||
| 380 | UART_PUT_IER(port, ATMEL_US_RXRDY); | ||
| 381 | } | ||
| 295 | } | 382 | } |
| 296 | 383 | ||
| 297 | /* | 384 | /* |
| @@ -302,9 +389,11 @@ static void atmel_stop_rx(struct uart_port *port) | |||
| 302 | if (atmel_use_dma_rx(port)) { | 389 | if (atmel_use_dma_rx(port)) { |
| 303 | /* disable PDC receive */ | 390 | /* disable PDC receive */ |
| 304 | UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS); | 391 | UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS); |
| 305 | UART_PUT_IDR(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT); | 392 | UART_PUT_IDR(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT | |
| 306 | } else | 393 | port->read_status_mask); |
| 394 | } else { | ||
| 307 | UART_PUT_IDR(port, ATMEL_US_RXRDY); | 395 | UART_PUT_IDR(port, ATMEL_US_RXRDY); |
| 396 | } | ||
| 308 | } | 397 | } |
| 309 | 398 | ||
| 310 | /* | 399 | /* |
| @@ -428,8 +517,9 @@ static void atmel_rx_chars(struct uart_port *port) | |||
| 428 | static void atmel_tx_chars(struct uart_port *port) | 517 | static void atmel_tx_chars(struct uart_port *port) |
| 429 | { | 518 | { |
| 430 | struct circ_buf *xmit = &port->state->xmit; | 519 | struct circ_buf *xmit = &port->state->xmit; |
| 520 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | ||
| 431 | 521 | ||
| 432 | if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) { | 522 | if (port->x_char && UART_GET_CSR(port) & atmel_port->tx_done_mask) { |
| 433 | UART_PUT_CHAR(port, port->x_char); | 523 | UART_PUT_CHAR(port, port->x_char); |
| 434 | port->icount.tx++; | 524 | port->icount.tx++; |
| 435 | port->x_char = 0; | 525 | port->x_char = 0; |
| @@ -437,7 +527,7 @@ static void atmel_tx_chars(struct uart_port *port) | |||
| 437 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) | 527 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) |
| 438 | return; | 528 | return; |
| 439 | 529 | ||
| 440 | while (UART_GET_CSR(port) & ATMEL_US_TXRDY) { | 530 | while (UART_GET_CSR(port) & atmel_port->tx_done_mask) { |
| 441 | UART_PUT_CHAR(port, xmit->buf[xmit->tail]); | 531 | UART_PUT_CHAR(port, xmit->buf[xmit->tail]); |
| 442 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 532 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
| 443 | port->icount.tx++; | 533 | port->icount.tx++; |
| @@ -449,7 +539,8 @@ static void atmel_tx_chars(struct uart_port *port) | |||
| 449 | uart_write_wakeup(port); | 539 | uart_write_wakeup(port); |
| 450 | 540 | ||
| 451 | if (!uart_circ_empty(xmit)) | 541 | if (!uart_circ_empty(xmit)) |
| 452 | UART_PUT_IER(port, ATMEL_US_TXRDY); | 542 | /* Enable interrupts */ |
| 543 | UART_PUT_IER(port, atmel_port->tx_done_mask); | ||
| 453 | } | 544 | } |
| 454 | 545 | ||
| 455 | /* | 546 | /* |
| @@ -501,18 +592,10 @@ atmel_handle_transmit(struct uart_port *port, unsigned int pending) | |||
| 501 | { | 592 | { |
| 502 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | 593 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); |
| 503 | 594 | ||
| 504 | if (atmel_use_dma_tx(port)) { | 595 | if (pending & atmel_port->tx_done_mask) { |
| 505 | /* PDC transmit */ | 596 | /* Either PDC or interrupt transmission */ |
| 506 | if (pending & (ATMEL_US_ENDTX | ATMEL_US_TXBUFE)) { | 597 | UART_PUT_IDR(port, atmel_port->tx_done_mask); |
| 507 | UART_PUT_IDR(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); | 598 | tasklet_schedule(&atmel_port->tasklet); |
| 508 | tasklet_schedule(&atmel_port->tasklet); | ||
| 509 | } | ||
| 510 | } else { | ||
| 511 | /* Interrupt transmit */ | ||
| 512 | if (pending & ATMEL_US_TXRDY) { | ||
| 513 | UART_PUT_IDR(port, ATMEL_US_TXRDY); | ||
| 514 | tasklet_schedule(&atmel_port->tasklet); | ||
| 515 | } | ||
| 516 | } | 599 | } |
| 517 | } | 600 | } |
| 518 | 601 | ||
| @@ -590,9 +673,15 @@ static void atmel_tx_dma(struct uart_port *port) | |||
| 590 | 673 | ||
| 591 | UART_PUT_TPR(port, pdc->dma_addr + xmit->tail); | 674 | UART_PUT_TPR(port, pdc->dma_addr + xmit->tail); |
| 592 | UART_PUT_TCR(port, count); | 675 | UART_PUT_TCR(port, count); |
| 593 | /* re-enable PDC transmit and interrupts */ | 676 | /* re-enable PDC transmit */ |
| 594 | UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); | 677 | UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); |
| 595 | UART_PUT_IER(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); | 678 | /* Enable interrupts */ |
| 679 | UART_PUT_IER(port, atmel_port->tx_done_mask); | ||
| 680 | } else { | ||
| 681 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) { | ||
| 682 | /* DMA done, stop TX, start RX for RS485 */ | ||
| 683 | atmel_start_rx(port); | ||
| 684 | } | ||
| 596 | } | 685 | } |
| 597 | 686 | ||
| 598 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 687 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
| @@ -1017,6 +1106,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
| 1017 | { | 1106 | { |
| 1018 | unsigned long flags; | 1107 | unsigned long flags; |
| 1019 | unsigned int mode, imr, quot, baud; | 1108 | unsigned int mode, imr, quot, baud; |
| 1109 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | ||
| 1020 | 1110 | ||
| 1021 | /* Get current mode register */ | 1111 | /* Get current mode register */ |
| 1022 | mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL | 1112 | mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL |
| @@ -1115,6 +1205,17 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
| 1115 | /* disable receiver and transmitter */ | 1205 | /* disable receiver and transmitter */ |
| 1116 | UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS); | 1206 | UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS); |
| 1117 | 1207 | ||
| 1208 | /* Resetting serial mode to RS232 (0x0) */ | ||
| 1209 | mode &= ~ATMEL_US_USMODE; | ||
| 1210 | |||
| 1211 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) { | ||
| 1212 | dev_dbg(port->dev, "Setting UART to RS485\n"); | ||
| 1213 | UART_PUT_TTGR(port, atmel_port->rs485.delay_rts_before_send); | ||
| 1214 | mode |= ATMEL_US_USMODE_RS485; | ||
| 1215 | } else { | ||
| 1216 | dev_dbg(port->dev, "Setting UART to RS232\n"); | ||
| 1217 | } | ||
| 1218 | |||
| 1118 | /* set the parity, stop bits and data size */ | 1219 | /* set the parity, stop bits and data size */ |
| 1119 | UART_PUT_MR(port, mode); | 1220 | UART_PUT_MR(port, mode); |
| 1120 | 1221 | ||
| @@ -1231,6 +1332,35 @@ static void atmel_poll_put_char(struct uart_port *port, unsigned char ch) | |||
| 1231 | } | 1332 | } |
| 1232 | #endif | 1333 | #endif |
| 1233 | 1334 | ||
| 1335 | static int | ||
| 1336 | atmel_ioctl(struct uart_port *port, unsigned int cmd, unsigned long arg) | ||
| 1337 | { | ||
| 1338 | struct serial_rs485 rs485conf; | ||
| 1339 | |||
| 1340 | switch (cmd) { | ||
| 1341 | case TIOCSRS485: | ||
| 1342 | if (copy_from_user(&rs485conf, (struct serial_rs485 *) arg, | ||
| 1343 | sizeof(rs485conf))) | ||
| 1344 | return -EFAULT; | ||
| 1345 | |||
| 1346 | atmel_config_rs485(port, &rs485conf); | ||
| 1347 | break; | ||
| 1348 | |||
| 1349 | case TIOCGRS485: | ||
| 1350 | if (copy_to_user((struct serial_rs485 *) arg, | ||
| 1351 | &(to_atmel_uart_port(port)->rs485), | ||
| 1352 | sizeof(rs485conf))) | ||
| 1353 | return -EFAULT; | ||
| 1354 | break; | ||
| 1355 | |||
| 1356 | default: | ||
| 1357 | return -ENOIOCTLCMD; | ||
| 1358 | } | ||
| 1359 | return 0; | ||
| 1360 | } | ||
| 1361 | |||
| 1362 | |||
| 1363 | |||
| 1234 | static struct uart_ops atmel_pops = { | 1364 | static struct uart_ops atmel_pops = { |
| 1235 | .tx_empty = atmel_tx_empty, | 1365 | .tx_empty = atmel_tx_empty, |
| 1236 | .set_mctrl = atmel_set_mctrl, | 1366 | .set_mctrl = atmel_set_mctrl, |
| @@ -1250,6 +1380,7 @@ static struct uart_ops atmel_pops = { | |||
| 1250 | .config_port = atmel_config_port, | 1380 | .config_port = atmel_config_port, |
| 1251 | .verify_port = atmel_verify_port, | 1381 | .verify_port = atmel_verify_port, |
| 1252 | .pm = atmel_serial_pm, | 1382 | .pm = atmel_serial_pm, |
| 1383 | .ioctl = atmel_ioctl, | ||
| 1253 | #ifdef CONFIG_CONSOLE_POLL | 1384 | #ifdef CONFIG_CONSOLE_POLL |
| 1254 | .poll_get_char = atmel_poll_get_char, | 1385 | .poll_get_char = atmel_poll_get_char, |
| 1255 | .poll_put_char = atmel_poll_put_char, | 1386 | .poll_put_char = atmel_poll_put_char, |
| @@ -1265,13 +1396,12 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, | |||
| 1265 | struct uart_port *port = &atmel_port->uart; | 1396 | struct uart_port *port = &atmel_port->uart; |
| 1266 | struct atmel_uart_data *data = pdev->dev.platform_data; | 1397 | struct atmel_uart_data *data = pdev->dev.platform_data; |
| 1267 | 1398 | ||
| 1268 | port->iotype = UPIO_MEM; | 1399 | port->iotype = UPIO_MEM; |
| 1269 | port->flags = UPF_BOOT_AUTOCONF; | 1400 | port->flags = UPF_BOOT_AUTOCONF; |
| 1270 | port->ops = &atmel_pops; | 1401 | port->ops = &atmel_pops; |
| 1271 | port->fifosize = 1; | 1402 | port->fifosize = 1; |
| 1272 | port->line = pdev->id; | 1403 | port->line = pdev->id; |
| 1273 | port->dev = &pdev->dev; | 1404 | port->dev = &pdev->dev; |
| 1274 | |||
| 1275 | port->mapbase = pdev->resource[0].start; | 1405 | port->mapbase = pdev->resource[0].start; |
| 1276 | port->irq = pdev->resource[1].start; | 1406 | port->irq = pdev->resource[1].start; |
| 1277 | 1407 | ||
| @@ -1299,8 +1429,16 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, | |||
| 1299 | 1429 | ||
| 1300 | atmel_port->use_dma_rx = data->use_dma_rx; | 1430 | atmel_port->use_dma_rx = data->use_dma_rx; |
| 1301 | atmel_port->use_dma_tx = data->use_dma_tx; | 1431 | atmel_port->use_dma_tx = data->use_dma_tx; |
| 1302 | if (atmel_use_dma_tx(port)) | 1432 | atmel_port->rs485 = data->rs485; |
| 1433 | /* Use TXEMPTY for interrupt when rs485 else TXRDY or ENDTX|TXBUFE */ | ||
| 1434 | if (atmel_port->rs485.flags & SER_RS485_ENABLED) | ||
| 1435 | atmel_port->tx_done_mask = ATMEL_US_TXEMPTY; | ||
| 1436 | else if (atmel_use_dma_tx(port)) { | ||
| 1303 | port->fifosize = PDC_BUFFER_SIZE; | 1437 | port->fifosize = PDC_BUFFER_SIZE; |
| 1438 | atmel_port->tx_done_mask = ATMEL_US_ENDTX | ATMEL_US_TXBUFE; | ||
| 1439 | } else { | ||
| 1440 | atmel_port->tx_done_mask = ATMEL_US_TXRDY; | ||
| 1441 | } | ||
| 1304 | } | 1442 | } |
| 1305 | 1443 | ||
| 1306 | /* | 1444 | /* |
| @@ -1334,6 +1472,7 @@ static void atmel_console_putchar(struct uart_port *port, int ch) | |||
| 1334 | static void atmel_console_write(struct console *co, const char *s, u_int count) | 1472 | static void atmel_console_write(struct console *co, const char *s, u_int count) |
| 1335 | { | 1473 | { |
| 1336 | struct uart_port *port = &atmel_ports[co->index].uart; | 1474 | struct uart_port *port = &atmel_ports[co->index].uart; |
| 1475 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | ||
| 1337 | unsigned int status, imr; | 1476 | unsigned int status, imr; |
| 1338 | unsigned int pdc_tx; | 1477 | unsigned int pdc_tx; |
| 1339 | 1478 | ||
| @@ -1341,7 +1480,7 @@ static void atmel_console_write(struct console *co, const char *s, u_int count) | |||
| 1341 | * First, save IMR and then disable interrupts | 1480 | * First, save IMR and then disable interrupts |
| 1342 | */ | 1481 | */ |
| 1343 | imr = UART_GET_IMR(port); | 1482 | imr = UART_GET_IMR(port); |
| 1344 | UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY); | 1483 | UART_PUT_IDR(port, ATMEL_US_RXRDY | atmel_port->tx_done_mask); |
| 1345 | 1484 | ||
| 1346 | /* Store PDC transmit status and disable it */ | 1485 | /* Store PDC transmit status and disable it */ |
| 1347 | pdc_tx = UART_GET_PTSR(port) & ATMEL_PDC_TXTEN; | 1486 | pdc_tx = UART_GET_PTSR(port) & ATMEL_PDC_TXTEN; |
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index df1bae9b048e..eaa79c8a9b8c 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
| @@ -366,6 +366,13 @@ rescan: | |||
| 366 | if (is_done) | 366 | if (is_done) |
| 367 | done(ep, req, 0); | 367 | done(ep, req, 0); |
| 368 | else if (ep->is_pingpong) { | 368 | else if (ep->is_pingpong) { |
| 369 | /* | ||
| 370 | * One dummy read to delay the code because of a HW glitch: | ||
| 371 | * CSR returns bad RXCOUNT when read too soon after updating | ||
| 372 | * RX_DATA_BK flags. | ||
| 373 | */ | ||
| 374 | csr = __raw_readl(creg); | ||
| 375 | |||
| 369 | bufferspace -= count; | 376 | bufferspace -= count; |
| 370 | buf += count; | 377 | buf += count; |
| 371 | goto rescan; | 378 | goto rescan; |
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; |
