Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'multiplatform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC multiplatform updates from Olof Johansson:
"More multiplatform enablement for ARM platforms. The ones converted
in this branch are:

- bcm2835
- cns3xxx
- sirf
- nomadik
- msx
- spear
- tegra
- ux500

We're getting close to having most of them converted!

One of the larger platforms remaining is Samsung Exynos, and there are
a bunch of supporting patches in this merge window for it. There was
a patch in this branch to a early version of multiplatform conversion,
but it ended up being reverted due to need of more bake time. The
revert commit is part of the branch since it would have required
rebasing multiple dependent branches and they were stable by then"

* tag 'multiplatform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (70 commits)
mmc: sdhci-s3c: Fix operation on non-single image Samsung platforms
clocksource: nomadik-mtu: fix up clocksource/timer
Revert "ARM: exynos: enable multiplatform support"
ARM: SPEAr13xx: Fix typo "ARCH_HAVE_CPUFREQ"
ARM: exynos: enable multiplatform support
rtc: s3c: make header file local
mtd: onenand/samsung: make regs-onenand.h file local
thermal/exynos: remove unnecessary header inclusions
mmc: sdhci-s3c: remove platform dependencies
ARM: samsung: move mfc device definition to s5p-dev-mfc.c
ARM: exynos: move debug-macro.S to include/debug/
ARM: exynos: prepare for sparse IRQ
ARM: exynos: introduce EXYNOS_ATAGS symbol
ARM: tegra: build assembly files with -march=armv7-a
ARM: Push selects for TWD/SCU into machine entries
ARM: ux500: build hotplug.o for ARMv7-a
ARM: ux500: move to multiplatform
ARM: ux500: make remaining headers local
ARM: ux500: make irqs.h local to platform
ARM: ux500: get rid of <mach/[hardware|db8500-regs].h>
...

+5747 -6800
+5 -130
arch/arm/Kconfig
··· 362 362 This enables support for systems based on Atmel 363 363 AT91RM9200 and AT91SAM9* processors. 364 364 365 - config ARCH_BCM2835 366 - bool "Broadcom BCM2835 family" 367 - select ARCH_REQUIRE_GPIOLIB 368 - select ARM_AMBA 369 - select ARM_ERRATA_411920 370 - select ARM_TIMER_SP804 371 - select CLKDEV_LOOKUP 372 - select CLKSRC_OF 373 - select COMMON_CLK 374 - select CPU_V6 375 - select GENERIC_CLOCKEVENTS 376 - select MULTI_IRQ_HANDLER 377 - select PINCTRL 378 - select PINCTRL_BCM2835 379 - select SPARSE_IRQ 380 - select USE_OF 381 - help 382 - This enables support for the Broadcom BCM2835 SoC. This SoC is 383 - use in the Raspberry Pi, and Roku 2 devices. 384 - 385 - config ARCH_CNS3XXX 386 - bool "Cavium Networks CNS3XXX family" 387 - select ARM_GIC 388 - select CPU_V6K 389 - select GENERIC_CLOCKEVENTS 390 - select MIGHT_HAVE_CACHE_L2X0 391 - select MIGHT_HAVE_PCI 392 - select PCI_DOMAINS if PCI 393 - help 394 - Support for Cavium Networks CNS3XXX platform. 395 - 396 365 config ARCH_CLPS711X 397 366 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" 398 367 select ARCH_REQUIRE_GPIOLIB ··· 384 415 select CPU_FA526 385 416 help 386 417 Support for the Cortina Systems Gemini family SoCs 387 - 388 - config ARCH_SIRF 389 - bool "CSR SiRF" 390 - select ARCH_REQUIRE_GPIOLIB 391 - select AUTO_ZRELADDR 392 - select COMMON_CLK 393 - select GENERIC_CLOCKEVENTS 394 - select GENERIC_IRQ_CHIP 395 - select MIGHT_HAVE_CACHE_L2X0 396 - select NO_IOPORT 397 - select PINCTRL 398 - select PINCTRL_SIRF 399 - select USE_OF 400 - help 401 - Support for CSR SiRFprimaII/Marco/Polo platforms 402 418 403 419 config ARCH_EBSA110 404 420 bool "EBSA-110" ··· 423 469 help 424 470 Support for systems based on the DC21285 companion chip 425 471 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. 426 - 427 - config ARCH_MXS 428 - bool "Freescale MXS-based" 429 - select ARCH_REQUIRE_GPIOLIB 430 - select CLKDEV_LOOKUP 431 - select CLKSRC_MMIO 432 - select CLKSRC_OF 433 - select COMMON_CLK 434 - select GENERIC_CLOCKEVENTS 435 - select HAVE_CLK_PREPARE 436 - select MULTI_IRQ_HANDLER 437 - select PINCTRL 438 - select SPARSE_IRQ 439 - select STMP_DEVICE 440 - select USE_OF 441 - help 442 - Support for Freescale MXS-based family of processors 443 472 444 473 config ARCH_NETX 445 474 bool "Hilscher NetX based" ··· 596 659 help 597 660 Support for the NXP LPC32XX family of processors 598 661 599 - config ARCH_TEGRA 600 - bool "NVIDIA Tegra" 601 - select ARCH_HAS_CPUFREQ 602 - select ARCH_REQUIRE_GPIOLIB 603 - select CLKDEV_LOOKUP 604 - select CLKSRC_MMIO 605 - select CLKSRC_OF 606 - select COMMON_CLK 607 - select GENERIC_CLOCKEVENTS 608 - select HAVE_CLK 609 - select HAVE_SMP 610 - select MIGHT_HAVE_CACHE_L2X0 611 - select SOC_BUS 612 - select SPARSE_IRQ 613 - select USE_OF 614 - help 615 - This enables support for NVIDIA Tegra based systems (Tegra APX, 616 - Tegra 6xx and Tegra 2 series). 617 - 618 662 config ARCH_PXA 619 663 bool "PXA2xx/PXA3xx-based" 620 664 depends on MMU ··· 633 715 bool "Renesas SH-Mobile / R-Mobile" 634 716 select CLKDEV_LOOKUP 635 717 select GENERIC_CLOCKEVENTS 718 + select HAVE_ARM_SCU if SMP 719 + select HAVE_ARM_TWD if LOCAL_TIMERS 636 720 select HAVE_CLK 637 721 select HAVE_MACH_CLKDEV 638 722 select HAVE_SMP ··· 820 900 help 821 901 Support for ST-Ericsson U300 series mobile platforms. 822 902 823 - config ARCH_U8500 824 - bool "ST-Ericsson U8500 Series" 825 - depends on MMU 826 - select ARCH_HAS_CPUFREQ 827 - select ARCH_REQUIRE_GPIOLIB 828 - select ARM_AMBA 829 - select CLKDEV_LOOKUP 830 - select CPU_V7 831 - select GENERIC_CLOCKEVENTS 832 - select HAVE_SMP 833 - select MIGHT_HAVE_CACHE_L2X0 834 - select SPARSE_IRQ 835 - help 836 - Support for ST-Ericsson's Ux500 architecture 837 - 838 - config ARCH_NOMADIK 839 - bool "STMicroelectronics Nomadik" 840 - select ARCH_REQUIRE_GPIOLIB 841 - select ARM_AMBA 842 - select ARM_VIC 843 - select CLKSRC_NOMADIK_MTU 844 - select COMMON_CLK 845 - select CPU_ARM926T 846 - select GENERIC_CLOCKEVENTS 847 - select MIGHT_HAVE_CACHE_L2X0 848 - select USE_OF 849 - select PINCTRL 850 - select PINCTRL_STN8815 851 - select SPARSE_IRQ 852 - help 853 - Support for the Nomadik platform by ST-Ericsson 854 - 855 - config PLAT_SPEAR 856 - bool "ST SPEAr" 857 - select ARCH_HAS_CPUFREQ 858 - select ARCH_REQUIRE_GPIOLIB 859 - select ARM_AMBA 860 - select CLKDEV_LOOKUP 861 - select CLKSRC_MMIO 862 - select COMMON_CLK 863 - select GENERIC_CLOCKEVENTS 864 - select HAVE_CLK 865 - help 866 - Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). 867 - 868 903 config ARCH_DAVINCI 869 904 bool "TI DaVinci" 870 905 select ARCH_HAS_HOLES_MEMORYMODEL ··· 911 1036 912 1037 source "arch/arm/mach-bcm/Kconfig" 913 1038 1039 + source "arch/arm/mach-bcm2835/Kconfig" 1040 + 914 1041 source "arch/arm/mach-clps711x/Kconfig" 915 1042 916 1043 source "arch/arm/mach-cns3xxx/Kconfig" ··· 978 1101 979 1102 source "arch/arm/mach-socfpga/Kconfig" 980 1103 981 - source "arch/arm/plat-spear/Kconfig" 1104 + source "arch/arm/mach-spear/Kconfig" 982 1105 983 1106 source "arch/arm/mach-s3c24xx/Kconfig" 984 1107 ··· 1405 1528 depends on GENERIC_CLOCKEVENTS 1406 1529 depends on HAVE_SMP 1407 1530 depends on MMU 1408 - select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP 1409 1531 select USE_GENERIC_SMP_HELPERS 1410 1532 help 1411 1533 This enables support for systems with more than one CPU. If you have ··· 1529 1653 bool "Use local timer interrupts" 1530 1654 depends on SMP 1531 1655 default y 1532 - select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !EXYNOS4_MCT) 1533 1656 help 1534 1657 Enable support for local timers on SMP platforms, rather then the 1535 1658 legacy IPI broadcast method. Local timers allows the system
+39
arch/arm/Kconfig.debug
··· 89 89 bool "Kernel low-level debugging on 9263 and 9g45" 90 90 depends on HAVE_AT91_DBGU1 91 91 92 + config DEBUG_BCM2835 93 + bool "Kernel low-level debugging on BCM2835 PL011 UART" 94 + depends on ARCH_BCM2835 95 + 92 96 config DEBUG_CLPS711X_UART1 93 97 bool "Kernel low-level debugging messages via UART1" 94 98 depends on ARCH_CLPS711X ··· 106 102 help 107 103 Say Y here if you want the debug print routines to direct 108 104 their output to the second serial port on these devices. 105 + 106 + config DEBUG_CNS3XXX 107 + bool "Kernel Kernel low-level debugging on Cavium Networks CNS3xxx" 108 + depends on ARCH_CNS3XXX 109 + help 110 + Say Y here if you want the debug print routines to direct 111 + their output to the CNS3xxx UART0. 109 112 110 113 config DEBUG_DAVINCI_DA8XX_UART1 111 114 bool "Kernel low-level debugging on DaVinci DA8XX using UART1" ··· 309 298 Say Y here if you want kernel low-level debugging support 310 299 on MVEBU based platforms. 311 300 301 + config DEBUG_NOMADIK_UART 302 + bool "Kernel low-level debugging messages via NOMADIK UART" 303 + depends on ARCH_NOMADIK 304 + help 305 + Say Y here if you want kernel low-level debugging support 306 + on NOMADIK based platforms. 307 + 312 308 config DEBUG_OMAP2PLUS_UART 313 309 bool "Kernel low-level debugging messages via OMAP2PLUS UART" 314 310 depends on ARCH_OMAP2PLUS ··· 348 330 349 331 config DEBUG_S3C_UART0 350 332 depends on PLAT_SAMSUNG 333 + select DEBUG_EXYNOS_UART if ARCH_EXYNOS 351 334 bool "Use S3C UART 0 for low-level debug" 352 335 help 353 336 Say Y here if you want the debug print routines to direct ··· 360 341 361 342 config DEBUG_S3C_UART1 362 343 depends on PLAT_SAMSUNG 344 + select DEBUG_EXYNOS_UART if ARCH_EXYNOS 363 345 bool "Use S3C UART 1 for low-level debug" 364 346 help 365 347 Say Y here if you want the debug print routines to direct ··· 372 352 373 353 config DEBUG_S3C_UART2 374 354 depends on PLAT_SAMSUNG 355 + select DEBUG_EXYNOS_UART if ARCH_EXYNOS 375 356 bool "Use S3C UART 2 for low-level debug" 376 357 help 377 358 Say Y here if you want the debug print routines to direct ··· 384 363 385 364 config DEBUG_S3C_UART3 386 365 depends on PLAT_SAMSUNG && ARCH_EXYNOS 366 + select DEBUG_EXYNOS_UART 387 367 bool "Use S3C UART 3 for low-level debug" 388 368 help 389 369 Say Y here if you want the debug print routines to direct ··· 435 413 help 436 414 Say Y here if you want the debug print routines to direct 437 415 their output to the uart1 port on SiRFmarco devices. 416 + 417 + config DEBUG_UX500_UART 418 + depends on ARCH_U8500 419 + bool "Use Ux500 UART for low-level debug" 420 + help 421 + Say Y here if you want kernel low-level debugging support 422 + on Ux500 based platforms. 438 423 439 424 config DEBUG_VEXPRESS_UART0_DETECT 440 425 bool "Autodetect UART0 on Versatile Express Cortex-A core tiles" ··· 513 484 chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd. 514 485 515 486 endchoice 487 + 488 + config DEBUG_EXYNOS_UART 489 + bool 516 490 517 491 config DEBUG_IMX_UART_PORT 518 492 int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \ ··· 612 580 613 581 config DEBUG_LL_INCLUDE 614 582 string 583 + default "debug/bcm2835.S" if DEBUG_BCM2835 584 + default "debug/cns3xxx.S" if DEBUG_CNS3XXX 585 + default "debug/exynos.S" if DEBUG_EXYNOS_UART 615 586 default "debug/icedcc.S" if DEBUG_ICEDCC 616 587 default "debug/imx.S" if DEBUG_IMX1_UART || \ 617 588 DEBUG_IMX25_UART || \ ··· 626 591 DEBUG_IMX6Q_UART 627 592 default "debug/highbank.S" if DEBUG_HIGHBANK_UART 628 593 default "debug/mvebu.S" if DEBUG_MVEBU_UART 594 + default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART 595 + default "debug/nomadik.S" if DEBUG_NOMADIK_UART 629 596 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART 630 597 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART 598 + default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 631 599 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART 632 600 default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1 633 601 default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \ 634 602 DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1 635 603 default "debug/vt8500.S" if DEBUG_VT8500_UART0 636 604 default "debug/tegra.S" if DEBUG_TEGRA_UART 605 + default "debug/ux500.S" if DEBUG_UX500_UART 637 606 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 638 607 default "mach/debug-macro.S" 639 608
+1 -4
arch/arm/Makefile
··· 190 190 machine-$(CONFIG_ARCH_W90X900) += w90x900 191 191 machine-$(CONFIG_FOOTBRIDGE) += footbridge 192 192 machine-$(CONFIG_ARCH_SOCFPGA) += socfpga 193 - machine-$(CONFIG_ARCH_SPEAR13XX) += spear13xx 194 - machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx 195 - machine-$(CONFIG_MACH_SPEAR600) += spear6xx 193 + machine-$(CONFIG_PLAT_SPEAR) += spear 196 194 machine-$(CONFIG_ARCH_VIRT) += virt 197 195 machine-$(CONFIG_ARCH_ZYNQ) += zynq 198 196 machine-$(CONFIG_ARCH_SUNXI) += sunxi ··· 204 206 plat-$(CONFIG_PLAT_PXA) += pxa 205 207 plat-$(CONFIG_PLAT_S3C24XX) += samsung 206 208 plat-$(CONFIG_PLAT_S5P) += samsung 207 - plat-$(CONFIG_PLAT_SPEAR) += spear 208 209 plat-$(CONFIG_PLAT_VERSATILE) += versatile 209 210 210 211 ifeq ($(CONFIG_ARCH_EBSA110),y)
+2
arch/arm/configs/bcm2835_defconfig
··· 29 29 CONFIG_PROFILING=y 30 30 CONFIG_OPROFILE=y 31 31 CONFIG_JUMP_LABEL=y 32 + CONFIG_ARCH_MULTI_V6=y 33 + # CONFIG_ARCH_MULTI_V7 is not set 32 34 CONFIG_ARCH_BCM2835=y 33 35 CONFIG_PREEMPT_VOLUNTARY=y 34 36 CONFIG_AEABI=y
+3
arch/arm/configs/cns3420vb_defconfig
··· 19 19 CONFIG_MODVERSIONS=y 20 20 # CONFIG_BLK_DEV_BSG is not set 21 21 CONFIG_IOSCHED_CFQ=m 22 + CONFIG_ARCH_MULTI_V6=y 23 + #CONFIG_ARCH_MULTI_V7 is not set 22 24 CONFIG_ARCH_CNS3XXX=y 23 25 CONFIG_MACH_CNS3420VB=y 26 + CONFIG_DEBUG_CNS3XXX=y 24 27 CONFIG_AEABI=y 25 28 CONFIG_ZBOOT_ROM_TEXT=0x0 26 29 CONFIG_ZBOOT_ROM_BSS=0x0
+23
arch/arm/configs/multi_v7_defconfig
··· 3 3 CONFIG_HIGH_RES_TIMERS=y 4 4 CONFIG_ARCH_MVEBU=y 5 5 CONFIG_MACH_ARMADA_370=y 6 + CONFIG_ARCH_SIRF=y 6 7 CONFIG_MACH_ARMADA_XP=y 7 8 CONFIG_ARCH_HIGHBANK=y 8 9 CONFIG_ARCH_SOCFPGA=y 9 10 CONFIG_ARCH_SUNXI=y 11 + CONFIG_ARCH_WM8850=y 10 12 # CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set 11 13 CONFIG_ARCH_ZYNQ=y 12 14 CONFIG_ARM_ERRATA_754322=y 15 + CONFIG_PLAT_SPEAR=y 16 + CONFIG_ARCH_SPEAR13XX=y 17 + CONFIG_MACH_SPEAR1310=y 18 + CONFIG_MACH_SPEAR1340=y 13 19 CONFIG_SMP=y 14 20 CONFIG_ARM_ARCH_TIMER=y 15 21 CONFIG_AEABI=y ··· 29 23 CONFIG_ATA=y 30 24 CONFIG_SATA_HIGHBANK=y 31 25 CONFIG_SATA_MV=y 26 + CONFIG_SATA_AHCI_PLATFORM=y 32 27 CONFIG_NETDEVICES=y 33 28 CONFIG_NET_CALXEDA_XGMAC=y 34 29 CONFIG_SMSC911X=y ··· 38 31 CONFIG_SERIAL_8250=y 39 32 CONFIG_SERIAL_8250_CONSOLE=y 40 33 CONFIG_SERIAL_8250_DW=y 34 + CONFIG_KEYBOARD_SPEAR=y 41 35 CONFIG_SERIAL_AMBA_PL011=y 42 36 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 43 37 CONFIG_SERIAL_OF_PLATFORM=y 38 + CONFIG_SERIAL_SIRFSOC=y 39 + CONFIG_SERIAL_SIRFSOC_CONSOLE=y 40 + CONFIG_SERIAL_VT8500=y 41 + CONFIG_SERIAL_VT8500_CONSOLE=y 44 42 CONFIG_IPMI_HANDLER=y 45 43 CONFIG_IPMI_SI=y 46 44 CONFIG_I2C=y 47 45 CONFIG_I2C_DESIGNWARE_PLATFORM=y 46 + CONFIG_I2C_SIRF=y 48 47 CONFIG_SPI=y 49 48 CONFIG_SPI_PL022=y 49 + CONFIG_SPI_SIRF=y 50 + CONFIG_GPIO_PL061=y 50 51 CONFIG_FB=y 51 52 CONFIG_FB_ARMCLCD=y 53 + CONFIG_FB_WM8505=y 52 54 CONFIG_FRAMEBUFFER_CONSOLE=y 53 55 CONFIG_USB=y 54 56 CONFIG_USB_ISP1760_HCD=y ··· 66 50 CONFIG_MMC_ARMMMCI=y 67 51 CONFIG_MMC_SDHCI=y 68 52 CONFIG_MMC_SDHCI_PLTFM=y 53 + CONFIG_MMC_SDHCI_SPEAR=y 54 + CONFIG_MMC_WMT=y 69 55 CONFIG_EDAC=y 70 56 CONFIG_EDAC_MM_EDAC=y 71 57 CONFIG_EDAC_HIGHBANK_MC=y 72 58 CONFIG_EDAC_HIGHBANK_L2=y 73 59 CONFIG_RTC_CLASS=y 74 60 CONFIG_RTC_DRV_PL031=y 61 + CONFIG_RTC_DRV_VT8500=y 62 + CONFIG_PWM=y 63 + CONFIG_PWM_VT8500=y 75 64 CONFIG_DMADEVICES=y 76 65 CONFIG_PL330_DMA=y 66 + CONFIG_SIRF_DMA=y 67 + CONFIG_DW_DMAC=y
+1 -1
arch/arm/configs/mxs_defconfig
··· 22 22 CONFIG_BLK_DEV_INTEGRITY=y 23 23 # CONFIG_IOSCHED_DEADLINE is not set 24 24 # CONFIG_IOSCHED_CFQ is not set 25 + # CONFIG_ARCH_MULTI_V7 is not set 25 26 CONFIG_ARCH_MXS=y 26 - CONFIG_MACH_MXS_DT=y 27 27 # CONFIG_ARM_THUMB is not set 28 28 CONFIG_PREEMPT_VOLUNTARY=y 29 29 CONFIG_AEABI=y
+19 -23
arch/arm/configs/nhk8815_defconfig
··· 1 - CONFIG_EXPERIMENTAL=y 2 1 # CONFIG_LOCALVERSION_AUTO is not set 3 2 # CONFIG_SWAP is not set 4 3 CONFIG_SYSVIPC=y 5 4 CONFIG_IKCONFIG=y 6 5 CONFIG_IKCONFIG_PROC=y 7 6 CONFIG_LOG_BUF_SHIFT=14 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 7 CONFIG_BLK_DEV_INITRD=y 10 8 CONFIG_EXPERT=y 11 9 CONFIG_KALLSYMS_ALL=y ··· 11 13 CONFIG_MODULES=y 12 14 CONFIG_MODULE_UNLOAD=y 13 15 # CONFIG_BLK_DEV_BSG is not set 16 + # CONFIG_ARCH_MULTI_V7 is not set 14 17 CONFIG_ARCH_NOMADIK=y 15 18 CONFIG_MACH_NOMADIK_8815NHK=y 16 19 CONFIG_PREEMPT=y ··· 19 20 CONFIG_ZBOOT_ROM_TEXT=0x0 20 21 CONFIG_ZBOOT_ROM_BSS=0x0 21 22 CONFIG_FPE_NWFPE=y 22 - CONFIG_PM=y 23 23 CONFIG_NET=y 24 24 CONFIG_PACKET=y 25 25 CONFIG_UNIX=y ··· 30 32 CONFIG_IP_PNP_DHCP=y 31 33 CONFIG_IP_PNP_BOOTP=y 32 34 CONFIG_NET_IPIP=y 33 - CONFIG_NET_IPGRE=y 34 - CONFIG_NET_IPGRE_BROADCAST=y 35 35 CONFIG_IP_MROUTE=y 36 36 # CONFIG_INET_LRO is not set 37 37 # CONFIG_IPV6 is not set 38 38 CONFIG_BT=m 39 - CONFIG_BT_L2CAP=m 40 - CONFIG_BT_SCO=m 41 39 CONFIG_BT_RFCOMM=m 42 40 CONFIG_BT_RFCOMM_TTY=y 43 41 CONFIG_BT_BNEP=m ··· 47 53 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 48 54 CONFIG_MTD=y 49 55 CONFIG_MTD_TESTS=m 56 + CONFIG_MTD_CMDLINE_PARTS=y 50 57 CONFIG_MTD_CHAR=y 51 58 CONFIG_MTD_BLOCK=y 52 - CONFIG_MTD_NAND=y 53 59 CONFIG_MTD_NAND_ECC_SMC=y 60 + CONFIG_MTD_NAND=y 54 61 CONFIG_MTD_NAND_FSMC=y 55 62 CONFIG_MTD_ONENAND=y 56 63 CONFIG_MTD_ONENAND_VERIFY_WRITE=y 57 64 CONFIG_MTD_ONENAND_GENERIC=y 65 + CONFIG_PROC_DEVICETREE=y 58 66 CONFIG_BLK_DEV_LOOP=y 59 67 CONFIG_BLK_DEV_CRYPTOLOOP=y 60 68 CONFIG_BLK_DEV_RAM=y ··· 68 72 CONFIG_SCSI_LOGGING=y 69 73 CONFIG_SCSI_SCAN_ASYNC=y 70 74 CONFIG_NETDEVICES=y 75 + CONFIG_NETCONSOLE=m 71 76 CONFIG_TUN=y 72 - CONFIG_NET_ETHERNET=y 73 77 CONFIG_SMC91X=y 74 78 CONFIG_PPP=m 75 - CONFIG_PPP_ASYNC=m 76 - CONFIG_PPP_SYNC_TTY=m 77 - CONFIG_PPP_DEFLATE=m 78 79 CONFIG_PPP_BSDCOMP=m 80 + CONFIG_PPP_DEFLATE=m 79 81 CONFIG_PPP_MPPE=m 80 82 CONFIG_PPPOE=m 81 - CONFIG_NETCONSOLE=m 83 + CONFIG_PPP_ASYNC=m 84 + CONFIG_PPP_SYNC_TTY=m 82 85 # CONFIG_INPUT_MOUSEDEV is not set 83 86 CONFIG_INPUT_EVDEV=y 84 87 # CONFIG_KEYBOARD_ATKBD is not set 85 88 # CONFIG_MOUSE_PS2 is not set 86 89 # CONFIG_SERIO is not set 90 + # CONFIG_LEGACY_PTYS is not set 87 91 CONFIG_SERIAL_AMBA_PL011=y 88 92 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 89 - # CONFIG_LEGACY_PTYS is not set 90 - # CONFIG_HW_RANDOM is not set 91 - CONFIG_I2C=y 93 + CONFIG_HW_RANDOM=y 94 + CONFIG_HW_RANDOM_NOMADIK=y 92 95 CONFIG_I2C_CHARDEV=y 93 96 CONFIG_I2C_GPIO=y 97 + CONFIG_I2C_NOMADIK=y 94 98 CONFIG_DEBUG_GPIO=y 95 - CONFIG_PINCTRL_NOMADIK=y 96 99 # CONFIG_HWMON is not set 97 - # CONFIG_VGA_CONSOLE is not set 100 + CONFIG_MMC=y 101 + CONFIG_MMC_CLKGATE=y 102 + CONFIG_MMC_ARMMMCI=y 98 103 CONFIG_RTC_CLASS=y 104 + CONFIG_RTC_DRV_PL031=y 105 + CONFIG_DMADEVICES=y 106 + CONFIG_AMBA_PL08X=y 99 107 CONFIG_EXT2_FS=y 100 108 CONFIG_EXT3_FS=y 101 - CONFIG_INOTIFY=y 102 109 CONFIG_FUSE_FS=y 103 110 CONFIG_MSDOS_FS=y 104 111 CONFIG_VFAT_FS=y 105 112 CONFIG_TMPFS=y 106 113 CONFIG_JFFS2_FS=y 107 114 CONFIG_NFS_FS=y 108 - CONFIG_NFS_V3=y 109 115 CONFIG_NFS_V3_ACL=y 110 116 CONFIG_ROOT_NFS=y 111 - CONFIG_SMB_FS=m 112 117 CONFIG_CIFS=m 113 118 CONFIG_CIFS_WEAK_PW_HASH=y 114 119 CONFIG_NLS_CODEPAGE_437=y ··· 117 120 CONFIG_NLS_ISO8859_1=y 118 121 CONFIG_NLS_ISO8859_15=y 119 122 # CONFIG_ENABLE_MUST_CHECK is not set 120 - CONFIG_DEBUG_KERNEL=y 123 + CONFIG_DEBUG_FS=y 121 124 # CONFIG_SCHED_DEBUG is not set 122 125 # CONFIG_DEBUG_PREEMPT is not set 123 126 # CONFIG_DEBUG_BUGVERBOSE is not set 124 127 CONFIG_DEBUG_INFO=y 125 - # CONFIG_RCU_CPU_STALL_DETECTOR is not set 126 128 CONFIG_CRYPTO_MD5=y 127 129 CONFIG_CRYPTO_SHA1=y 128 130 CONFIG_CRYPTO_DES=y
+2
arch/arm/configs/spear3xx_defconfig
··· 6 6 CONFIG_MODULE_UNLOAD=y 7 7 CONFIG_MODVERSIONS=y 8 8 CONFIG_PARTITION_ADVANCED=y 9 + # CONFIG_ARCH_MULTI_V7 is not set 9 10 CONFIG_PLAT_SPEAR=y 11 + CONFIG_ARCH_SPEAR3XX=y 10 12 CONFIG_MACH_SPEAR300=y 11 13 CONFIG_MACH_SPEAR310=y 12 14 CONFIG_MACH_SPEAR320=y
+1
arch/arm/configs/spear6xx_defconfig
··· 6 6 CONFIG_MODULE_UNLOAD=y 7 7 CONFIG_MODVERSIONS=y 8 8 CONFIG_PARTITION_ADVANCED=y 9 + # CONFIG_ARCH_MULTI_V7 is not set 9 10 CONFIG_PLAT_SPEAR=y 10 11 CONFIG_ARCH_SPEAR6XX=y 11 12 CONFIG_BINFMT_MISC=y
+22
arch/arm/include/debug/bcm2835.S
··· 1 + /* 2 + * Debugging macro include header 3 + * 4 + * Copyright (C) 2010 Broadcom 5 + * Copyright (C) 1994-1999 Russell King 6 + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + * 12 + */ 13 + 14 + #define BCM2835_DEBUG_PHYS 0x20201000 15 + #define BCM2835_DEBUG_VIRT 0xf0201000 16 + 17 + .macro addruart, rp, rv, tmp 18 + ldr \rp, =BCM2835_DEBUG_PHYS 19 + ldr \rv, =BCM2835_DEBUG_VIRT 20 + .endm 21 + 22 + #include <asm/hardware/debug-pl01x.S>
+39
arch/arm/include/debug/exynos.S
··· 1 + /* 2 + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 3 + * http://www.samsung.com 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 + /* pull in the relevant register and map files. */ 11 + 12 + #define S3C_ADDR_BASE 0xF6000000 13 + #define S3C_VA_UART S3C_ADDR_BASE + 0x01000000 14 + #define EXYNOS4_PA_UART 0x13800000 15 + #define EXYNOS5_PA_UART 0x12C00000 16 + 17 + /* note, for the boot process to work we have to keep the UART 18 + * virtual address aligned to an 1MiB boundary for the L1 19 + * mapping the head code makes. We keep the UART virtual address 20 + * aligned and add in the offset when we load the value here. 21 + */ 22 + 23 + .macro addruart, rp, rv, tmp 24 + mrc p15, 0, \tmp, c0, c0, 0 25 + and \tmp, \tmp, #0xf0 26 + teq \tmp, #0xf0 @@ A15 27 + ldreq \rp, =EXYNOS5_PA_UART 28 + movne \rp, #EXYNOS4_PA_UART @@ EXYNOS4 29 + ldr \rv, =S3C_VA_UART 30 + #if CONFIG_DEBUG_S3C_UART != 0 31 + add \rp, \rp, #(0x10000 * CONFIG_DEBUG_S3C_UART) 32 + add \rv, \rv, #(0x10000 * CONFIG_DEBUG_S3C_UART) 33 + #endif 34 + .endm 35 + 36 + #define fifo_full fifo_full_s5pv210 37 + #define fifo_level fifo_level_s5pv210 38 + 39 + #include <debug/samsung.S>
+42
arch/arm/include/debug/sirf.S
··· 1 + /* 2 + * arch/arm/mach-prima2/include/mach/debug-macro.S 3 + * 4 + * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 + * 6 + * Licensed under GPLv2 or later. 7 + */ 8 + 9 + #if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1) 10 + #define SIRFSOC_UART1_PA_BASE 0xb0060000 11 + #elif defined(CONFIG_DEBUG_SIRFMARCO_UART1) 12 + #define SIRFSOC_UART1_PA_BASE 0xcc060000 13 + #else 14 + #define SIRFSOC_UART1_PA_BASE 0 15 + #endif 16 + 17 + #define SIRFSOC_UART1_VA_BASE 0xFEC60000 18 + 19 + #define SIRFSOC_UART_TXFIFO_STATUS 0x0114 20 + #define SIRFSOC_UART_TXFIFO_DATA 0x0118 21 + 22 + #define SIRFSOC_UART1_TXFIFO_FULL (1 << 5) 23 + #define SIRFSOC_UART1_TXFIFO_EMPTY (1 << 6) 24 + 25 + .macro addruart, rp, rv, tmp 26 + ldr \rp, =SIRFSOC_UART1_PA_BASE @ physical 27 + ldr \rv, =SIRFSOC_UART1_VA_BASE @ virtual 28 + .endm 29 + 30 + .macro senduart,rd,rx 31 + str \rd, [\rx, #SIRFSOC_UART_TXFIFO_DATA] 32 + .endm 33 + 34 + .macro busyuart,rd,rx 35 + .endm 36 + 37 + .macro waituart,rd,rx 38 + 1001: ldr \rd, [\rx, #SIRFSOC_UART_TXFIFO_STATUS] 39 + tst \rd, #SIRFSOC_UART1_TXFIFO_EMPTY 40 + beq 1001b 41 + .endm 42 +
+48
arch/arm/include/debug/ux500.S
··· 1 + /* 2 + * Debugging macro include header 3 + * 4 + * Copyright (C) 2009 ST-Ericsson 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + * 10 + */ 11 + 12 + 13 + #if CONFIG_UX500_DEBUG_UART > 2 14 + #error Invalid Ux500 debug UART 15 + #endif 16 + 17 + /* 18 + * DEBUG_LL only works if only one SOC is built in. We don't use #else below 19 + * in order to get "__UX500_UART redefined" warnings if more than one SOC is 20 + * built, so that there's some hint during the build that something is wrong. 21 + */ 22 + 23 + #ifdef CONFIG_UX500_SOC_DB8500 24 + #define U8500_UART0_PHYS_BASE (0x80120000) 25 + #define U8500_UART1_PHYS_BASE (0x80121000) 26 + #define U8500_UART2_PHYS_BASE (0x80007000) 27 + #define U8500_UART0_VIRT_BASE (0xa8120000) 28 + #define U8500_UART1_VIRT_BASE (0xa8121000) 29 + #define U8500_UART2_VIRT_BASE (0xa8007000) 30 + #define __UX500_PHYS_UART(n) U8500_UART##n##_PHYS_BASE 31 + #define __UX500_VIRT_UART(n) U8500_UART##n##_VIRT_BASE 32 + #endif 33 + 34 + #if !defined(__UX500_PHYS_UART) || !defined(__UX500_VIRT_UART) 35 + #error Unknown SOC 36 + #endif 37 + 38 + #define UX500_PHYS_UART(n) __UX500_PHYS_UART(n) 39 + #define UX500_VIRT_UART(n) __UX500_VIRT_UART(n) 40 + #define UART_PHYS_BASE UX500_PHYS_UART(CONFIG_UX500_DEBUG_UART) 41 + #define UART_VIRT_BASE UX500_VIRT_UART(CONFIG_UX500_DEBUG_UART) 42 + 43 + .macro addruart, rp, rv, tmp 44 + ldr \rp, =UART_PHYS_BASE @ no, physical address 45 + ldr \rv, =UART_VIRT_BASE @ yes, virtual address 46 + .endm 47 + 48 + #include <asm/hardware/debug-pl01x.S>
+15
arch/arm/mach-bcm2835/Kconfig
··· 1 + config ARCH_BCM2835 2 + bool "Broadcom BCM2835 family" if ARCH_MULTI_V6 3 + select ARCH_REQUIRE_GPIOLIB 4 + select ARM_AMBA 5 + select ARM_ERRATA_411920 6 + select ARM_TIMER_SP804 7 + select CLKDEV_LOOKUP 8 + select CLKSRC_OF 9 + select CPU_V6 10 + select GENERIC_CLOCKEVENTS 11 + select PINCTRL 12 + select PINCTRL_BCM2835 13 + help 14 + This enables support for the Broadcom BCM2835 SoC. This SoC is 15 + use in the Raspberry Pi, and Roku 2 devices.
-1
arch/arm/mach-bcm2835/Makefile.boot
··· 1 - zreladdr-y := 0x00008000
+4 -2
arch/arm/mach-bcm2835/bcm2835.c
··· 23 23 #include <asm/mach/arch.h> 24 24 #include <asm/mach/map.h> 25 25 26 - #include <mach/bcm2835_soc.h> 27 - 28 26 #define PM_RSTC 0x1c 29 27 #define PM_RSTS 0x20 30 28 #define PM_WDOG 0x24 ··· 31 33 #define PM_RSTC_WRCFG_MASK 0x00000030 32 34 #define PM_RSTC_WRCFG_FULL_RESET 0x00000020 33 35 #define PM_RSTS_HADWRH_SET 0x00000040 36 + 37 + #define BCM2835_PERIPH_PHYS 0x20000000 38 + #define BCM2835_PERIPH_VIRT 0xf0000000 39 + #define BCM2835_PERIPH_SIZE SZ_16M 34 40 35 41 static void __iomem *wdt_regs; 36 42
-29
arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h
··· 1 - /* 2 - * Copyright (C) 2012 Stephen Warren 3 - * 4 - * Derived from code: 5 - * Copyright (C) 2010 Broadcom 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 - 18 - #ifndef __MACH_BCM2835_BCM2835_SOC_H__ 19 - #define __MACH_BCM2835_BCM2835_SOC_H__ 20 - 21 - #include <asm/sizes.h> 22 - 23 - #define BCM2835_PERIPH_PHYS 0x20000000 24 - #define BCM2835_PERIPH_VIRT 0xf0000000 25 - #define BCM2835_PERIPH_SIZE SZ_16M 26 - #define BCM2835_DEBUG_PHYS 0x20201000 27 - #define BCM2835_DEBUG_VIRT 0xf0201000 28 - 29 - #endif
-21
arch/arm/mach-bcm2835/include/mach/debug-macro.S
··· 1 - /* 2 - * Debugging macro include header 3 - * 4 - * Copyright (C) 2010 Broadcom 5 - * Copyright (C) 1994-1999 Russell King 6 - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - * 12 - */ 13 - 14 - #include <mach/bcm2835_soc.h> 15 - 16 - .macro addruart, rp, rv, tmp 17 - ldr \rp, =BCM2835_DEBUG_PHYS 18 - ldr \rv, =BCM2835_DEBUG_VIRT 19 - .endm 20 - 21 - #include <asm/hardware/debug-pl01x.S>
-1
arch/arm/mach-bcm2835/include/mach/gpio.h
··· 1 - /* empty */
-26
arch/arm/mach-bcm2835/include/mach/timex.h
··· 1 - /* 2 - * BCM2835 system clock frequency 3 - * 4 - * Copyright (C) 2010 Broadcom 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation; either version 2 of the License, or 9 - * (at your option) any later version. 10 - * 11 - * This program is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - * GNU General Public License for more details. 15 - * 16 - * You should have received a copy of the GNU General Public License 17 - * along with this program; if not, write to the Free Software 18 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 - */ 20 - 21 - #ifndef __ASM_ARCH_TIMEX_H 22 - #define __ASM_ARCH_TIMEX_H 23 - 24 - #define CLOCK_TICK_RATE (1000000) 25 - 26 - #endif
-44
arch/arm/mach-bcm2835/include/mach/uncompress.h
··· 1 - /* 2 - * Copyright (C) 2010 Broadcom 3 - * Copyright (C) 2003 ARM Limited 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 - 16 - #include <linux/io.h> 17 - #include <linux/amba/serial.h> 18 - #include <mach/bcm2835_soc.h> 19 - 20 - #define UART0_BASE BCM2835_DEBUG_PHYS 21 - 22 - #define BCM2835_UART_DR IOMEM(UART0_BASE + UART01x_DR) 23 - #define BCM2835_UART_FR IOMEM(UART0_BASE + UART01x_FR) 24 - #define BCM2835_UART_CR IOMEM(UART0_BASE + UART011_CR) 25 - 26 - static inline void putc(int c) 27 - { 28 - while (__raw_readl(BCM2835_UART_FR) & UART01x_FR_TXFF) 29 - barrier(); 30 - 31 - __raw_writel(c, BCM2835_UART_DR); 32 - } 33 - 34 - static inline void flush(void) 35 - { 36 - int fr; 37 - 38 - do { 39 - fr = __raw_readl(BCM2835_UART_FR); 40 - barrier(); 41 - } while ((fr & (UART011_FR_TXFE | UART01x_FR_BUSY)) != UART011_FR_TXFE); 42 - } 43 - 44 - #define arch_decomp_setup()
+12
arch/arm/mach-cns3xxx/Kconfig
··· 1 + config ARCH_CNS3XXX 2 + bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6 3 + select ARM_GIC 4 + select CPU_V6K 5 + select GENERIC_CLOCKEVENTS 6 + select MIGHT_HAVE_CACHE_L2X0 7 + select MIGHT_HAVE_PCI 8 + select PCI_DOMAINS if PCI 9 + help 10 + Support for Cavium Networks CNS3XXX platform. 11 + 1 12 menu "CNS3XXX platform type" 2 13 depends on ARCH_CNS3XXX 3 14 4 15 config MACH_CNS3420VB 5 16 bool "Support for CNS3420 Validation Board" 17 + depends on ATAGS 6 18 help 7 19 Include support for the Cavium Networks CNS3420 MPCore Platform 8 20 Baseboard.
+5 -3
arch/arm/mach-cns3xxx/Makefile
··· 1 - obj-$(CONFIG_ARCH_CNS3XXX) += core.o pm.o devices.o 2 - obj-$(CONFIG_PCI) += pcie.o 3 - obj-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o 1 + obj-$(CONFIG_ARCH_CNS3XXX) += cns3xxx.o 2 + cns3xxx-y += core.o pm.o 3 + cns3xxx-$(CONFIG_ATAGS) += devices.o 4 + cns3xxx-$(CONFIG_PCI) += pcie.o 5 + cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o
+3 -3
arch/arm/mach-cns3xxx/cns3420vb.c
··· 31 31 #include <asm/mach/arch.h> 32 32 #include <asm/mach/map.h> 33 33 #include <asm/mach/time.h> 34 - #include <mach/cns3xxx.h> 35 - #include <mach/irqs.h> 36 - #include <mach/pm.h> 34 + #include "cns3xxx.h" 35 + #include "pm.h" 37 36 #include "core.h" 38 37 #include "devices.h" 39 38 ··· 246 247 247 248 MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board") 248 249 .atag_offset = 0x100, 250 + .nr_irqs = NR_IRQS_CNS3XXX, 249 251 .map_io = cns3420_map_io, 250 252 .init_irq = cns3xxx_init_irq, 251 253 .init_time = cns3xxx_timer_init,
+602
arch/arm/mach-cns3xxx/cns3xxx.h
··· 1 + /* 2 + * Copyright 2008 Cavium Networks 3 + * 4 + * This file is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License, Version 2, as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #ifndef __MACH_BOARD_CNS3XXXH 10 + #define __MACH_BOARD_CNS3XXXH 11 + 12 + /* 13 + * Memory map 14 + */ 15 + #define CNS3XXX_FLASH_BASE 0x10000000 /* Flash/SRAM Memory Bank 0 */ 16 + #define CNS3XXX_FLASH_SIZE SZ_256M 17 + 18 + #define CNS3XXX_DDR2SDRAM_BASE 0x20000000 /* DDR2 SDRAM Memory */ 19 + 20 + #define CNS3XXX_SPI_FLASH_BASE 0x60000000 /* SPI Serial Flash Memory */ 21 + 22 + #define CNS3XXX_SWITCH_BASE 0x70000000 /* Switch and HNAT Control */ 23 + 24 + #define CNS3XXX_PPE_BASE 0x70001000 /* HANT */ 25 + 26 + #define CNS3XXX_EMBEDDED_SRAM_BASE 0x70002000 /* HANT Embedded SRAM */ 27 + 28 + #define CNS3XXX_SSP_BASE 0x71000000 /* Synchronous Serial Port - SPI/PCM/I2C */ 29 + 30 + #define CNS3XXX_DMC_BASE 0x72000000 /* DMC Control (DDR2 SDRAM) */ 31 + 32 + #define CNS3XXX_SMC_BASE 0x73000000 /* SMC Control */ 33 + 34 + #define SMC_MEMC_STATUS_OFFSET 0x000 35 + #define SMC_MEMIF_CFG_OFFSET 0x004 36 + #define SMC_MEMC_CFG_SET_OFFSET 0x008 37 + #define SMC_MEMC_CFG_CLR_OFFSET 0x00C 38 + #define SMC_DIRECT_CMD_OFFSET 0x010 39 + #define SMC_SET_CYCLES_OFFSET 0x014 40 + #define SMC_SET_OPMODE_OFFSET 0x018 41 + #define SMC_REFRESH_PERIOD_0_OFFSET 0x020 42 + #define SMC_REFRESH_PERIOD_1_OFFSET 0x024 43 + #define SMC_SRAM_CYCLES0_0_OFFSET 0x100 44 + #define SMC_NAND_CYCLES0_0_OFFSET 0x100 45 + #define SMC_OPMODE0_0_OFFSET 0x104 46 + #define SMC_SRAM_CYCLES0_1_OFFSET 0x120 47 + #define SMC_NAND_CYCLES0_1_OFFSET 0x120 48 + #define SMC_OPMODE0_1_OFFSET 0x124 49 + #define SMC_USER_STATUS_OFFSET 0x200 50 + #define SMC_USER_CONFIG_OFFSET 0x204 51 + #define SMC_ECC_STATUS_OFFSET 0x300 52 + #define SMC_ECC_MEMCFG_OFFSET 0x304 53 + #define SMC_ECC_MEMCOMMAND1_OFFSET 0x308 54 + #define SMC_ECC_MEMCOMMAND2_OFFSET 0x30C 55 + #define SMC_ECC_ADDR0_OFFSET 0x310 56 + #define SMC_ECC_ADDR1_OFFSET 0x314 57 + #define SMC_ECC_VALUE0_OFFSET 0x318 58 + #define SMC_ECC_VALUE1_OFFSET 0x31C 59 + #define SMC_ECC_VALUE2_OFFSET 0x320 60 + #define SMC_ECC_VALUE3_OFFSET 0x324 61 + #define SMC_PERIPH_ID_0_OFFSET 0xFE0 62 + #define SMC_PERIPH_ID_1_OFFSET 0xFE4 63 + #define SMC_PERIPH_ID_2_OFFSET 0xFE8 64 + #define SMC_PERIPH_ID_3_OFFSET 0xFEC 65 + #define SMC_PCELL_ID_0_OFFSET 0xFF0 66 + #define SMC_PCELL_ID_1_OFFSET 0xFF4 67 + #define SMC_PCELL_ID_2_OFFSET 0xFF8 68 + #define SMC_PCELL_ID_3_OFFSET 0xFFC 69 + 70 + #define CNS3XXX_GPIOA_BASE 0x74000000 /* GPIO port A */ 71 + 72 + #define CNS3XXX_GPIOB_BASE 0x74800000 /* GPIO port B */ 73 + 74 + #define CNS3XXX_RTC_BASE 0x75000000 /* Real Time Clock */ 75 + 76 + #define RTC_SEC_OFFSET 0x00 77 + #define RTC_MIN_OFFSET 0x04 78 + #define RTC_HOUR_OFFSET 0x08 79 + #define RTC_DAY_OFFSET 0x0C 80 + #define RTC_SEC_ALM_OFFSET 0x10 81 + #define RTC_MIN_ALM_OFFSET 0x14 82 + #define RTC_HOUR_ALM_OFFSET 0x18 83 + #define RTC_REC_OFFSET 0x1C 84 + #define RTC_CTRL_OFFSET 0x20 85 + #define RTC_INTR_STS_OFFSET 0x34 86 + 87 + #define CNS3XXX_MISC_BASE 0x76000000 /* Misc Control */ 88 + #define CNS3XXX_MISC_BASE_VIRT 0xFB000000 /* Misc Control */ 89 + 90 + #define CNS3XXX_PM_BASE 0x77000000 /* Power Management Control */ 91 + #define CNS3XXX_PM_BASE_VIRT 0xFB001000 92 + 93 + #define PM_CLK_GATE_OFFSET 0x00 94 + #define PM_SOFT_RST_OFFSET 0x04 95 + #define PM_HS_CFG_OFFSET 0x08 96 + #define PM_CACTIVE_STA_OFFSET 0x0C 97 + #define PM_PWR_STA_OFFSET 0x10 98 + #define PM_SYS_CLK_CTRL_OFFSET 0x14 99 + #define PM_PLL_LCD_I2S_CTRL_OFFSET 0x18 100 + #define PM_PLL_HM_PD_OFFSET 0x1C 101 + 102 + #define CNS3XXX_UART0_BASE 0x78000000 /* UART 0 */ 103 + #define CNS3XXX_UART0_BASE_VIRT 0xFB002000 104 + 105 + #define CNS3XXX_UART1_BASE 0x78400000 /* UART 1 */ 106 + 107 + #define CNS3XXX_UART2_BASE 0x78800000 /* UART 2 */ 108 + 109 + #define CNS3XXX_DMAC_BASE 0x79000000 /* Generic DMA Control */ 110 + 111 + #define CNS3XXX_CORESIGHT_BASE 0x7A000000 /* CoreSight */ 112 + 113 + #define CNS3XXX_CRYPTO_BASE 0x7B000000 /* Crypto */ 114 + 115 + #define CNS3XXX_I2S_BASE 0x7C000000 /* I2S */ 116 + 117 + #define CNS3XXX_TIMER1_2_3_BASE 0x7C800000 /* Timer */ 118 + #define CNS3XXX_TIMER1_2_3_BASE_VIRT 0xFB003000 119 + 120 + #define TIMER1_COUNTER_OFFSET 0x00 121 + #define TIMER1_AUTO_RELOAD_OFFSET 0x04 122 + #define TIMER1_MATCH_V1_OFFSET 0x08 123 + #define TIMER1_MATCH_V2_OFFSET 0x0C 124 + 125 + #define TIMER2_COUNTER_OFFSET 0x10 126 + #define TIMER2_AUTO_RELOAD_OFFSET 0x14 127 + #define TIMER2_MATCH_V1_OFFSET 0x18 128 + #define TIMER2_MATCH_V2_OFFSET 0x1C 129 + 130 + #define TIMER1_2_CONTROL_OFFSET 0x30 131 + #define TIMER1_2_INTERRUPT_STATUS_OFFSET 0x34 132 + #define TIMER1_2_INTERRUPT_MASK_OFFSET 0x38 133 + 134 + #define TIMER_FREERUN_OFFSET 0x40 135 + #define TIMER_FREERUN_CONTROL_OFFSET 0x44 136 + 137 + #define CNS3XXX_HCIE_BASE 0x7D000000 /* HCIE Control */ 138 + 139 + #define CNS3XXX_RAID_BASE 0x7E000000 /* RAID Control */ 140 + 141 + #define CNS3XXX_AXI_IXC_BASE 0x7F000000 /* AXI IXC */ 142 + 143 + #define CNS3XXX_CLCD_BASE 0x80000000 /* LCD Control */ 144 + 145 + #define CNS3XXX_USBOTG_BASE 0x81000000 /* USB OTG Control */ 146 + 147 + #define CNS3XXX_USB_BASE 0x82000000 /* USB Host Control */ 148 + 149 + #define CNS3XXX_SATA2_BASE 0x83000000 /* SATA */ 150 + #define CNS3XXX_SATA2_SIZE SZ_16M 151 + 152 + #define CNS3XXX_CAMERA_BASE 0x84000000 /* Camera Interface */ 153 + 154 + #define CNS3XXX_SDIO_BASE 0x85000000 /* SDIO */ 155 + 156 + #define CNS3XXX_I2S_TDM_BASE 0x86000000 /* I2S TDM */ 157 + 158 + #define CNS3XXX_2DG_BASE 0x87000000 /* 2D Graphic Control */ 159 + 160 + #define CNS3XXX_USB_OHCI_BASE 0x88000000 /* USB OHCI */ 161 + 162 + #define CNS3XXX_L2C_BASE 0x92000000 /* L2 Cache Control */ 163 + 164 + #define CNS3XXX_PCIE0_MEM_BASE 0xA0000000 /* PCIe Port 0 IO/Memory Space */ 165 + #define CNS3XXX_PCIE0_MEM_BASE_VIRT 0xE0000000 166 + 167 + #define CNS3XXX_PCIE0_HOST_BASE 0xAB000000 /* PCIe Port 0 RC Base */ 168 + #define CNS3XXX_PCIE0_HOST_BASE_VIRT 0xE1000000 169 + 170 + #define CNS3XXX_PCIE0_IO_BASE 0xAC000000 /* PCIe Port 0 */ 171 + #define CNS3XXX_PCIE0_IO_BASE_VIRT 0xE2000000 172 + 173 + #define CNS3XXX_PCIE0_CFG0_BASE 0xAD000000 /* PCIe Port 0 CFG Type 0 */ 174 + #define CNS3XXX_PCIE0_CFG0_BASE_VIRT 0xE3000000 175 + 176 + #define CNS3XXX_PCIE0_CFG1_BASE 0xAE000000 /* PCIe Port 0 CFG Type 1 */ 177 + #define CNS3XXX_PCIE0_CFG1_BASE_VIRT 0xE4000000 178 + 179 + #define CNS3XXX_PCIE0_MSG_BASE 0xAF000000 /* PCIe Port 0 Message Space */ 180 + #define CNS3XXX_PCIE0_MSG_BASE_VIRT 0xE5000000 181 + 182 + #define CNS3XXX_PCIE1_MEM_BASE 0xB0000000 /* PCIe Port 1 IO/Memory Space */ 183 + #define CNS3XXX_PCIE1_MEM_BASE_VIRT 0xE8000000 184 + 185 + #define CNS3XXX_PCIE1_HOST_BASE 0xBB000000 /* PCIe Port 1 RC Base */ 186 + #define CNS3XXX_PCIE1_HOST_BASE_VIRT 0xE9000000 187 + 188 + #define CNS3XXX_PCIE1_IO_BASE 0xBC000000 /* PCIe Port 1 */ 189 + #define CNS3XXX_PCIE1_IO_BASE_VIRT 0xEA000000 190 + 191 + #define CNS3XXX_PCIE1_CFG0_BASE 0xBD000000 /* PCIe Port 1 CFG Type 0 */ 192 + #define CNS3XXX_PCIE1_CFG0_BASE_VIRT 0xEB000000 193 + 194 + #define CNS3XXX_PCIE1_CFG1_BASE 0xBE000000 /* PCIe Port 1 CFG Type 1 */ 195 + #define CNS3XXX_PCIE1_CFG1_BASE_VIRT 0xEC000000 196 + 197 + #define CNS3XXX_PCIE1_MSG_BASE 0xBF000000 /* PCIe Port 1 Message Space */ 198 + #define CNS3XXX_PCIE1_MSG_BASE_VIRT 0xED000000 199 + 200 + /* 201 + * Testchip peripheral and fpga gic regions 202 + */ 203 + #define CNS3XXX_TC11MP_SCU_BASE 0x90000000 /* IRQ, Test chip */ 204 + #define CNS3XXX_TC11MP_SCU_BASE_VIRT 0xFB004000 205 + 206 + #define CNS3XXX_TC11MP_GIC_CPU_BASE 0x90000100 /* Test chip interrupt controller CPU interface */ 207 + #define CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x100) 208 + 209 + #define CNS3XXX_TC11MP_TWD_BASE 0x90000600 210 + #define CNS3XXX_TC11MP_TWD_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x600) 211 + 212 + #define CNS3XXX_TC11MP_GIC_DIST_BASE 0x90001000 /* Test chip interrupt controller distributor */ 213 + #define CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x1000) 214 + 215 + #define CNS3XXX_TC11MP_L220_BASE 0x92002000 /* L220 registers */ 216 + 217 + /* 218 + * Misc block 219 + */ 220 + #define MISC_MEM_MAP(offs) (void __iomem *)(CNS3XXX_MISC_BASE_VIRT + (offs)) 221 + 222 + #define MISC_MEMORY_REMAP_REG MISC_MEM_MAP(0x00) 223 + #define MISC_CHIP_CONFIG_REG MISC_MEM_MAP(0x04) 224 + #define MISC_DEBUG_PROBE_DATA_REG MISC_MEM_MAP(0x08) 225 + #define MISC_DEBUG_PROBE_SELECTION_REG MISC_MEM_MAP(0x0C) 226 + #define MISC_IO_PIN_FUNC_SELECTION_REG MISC_MEM_MAP(0x10) 227 + #define MISC_GPIOA_PIN_ENABLE_REG MISC_MEM_MAP(0x14) 228 + #define MISC_GPIOB_PIN_ENABLE_REG MISC_MEM_MAP(0x18) 229 + #define MISC_IO_PAD_DRIVE_STRENGTH_CTRL_A MISC_MEM_MAP(0x1C) 230 + #define MISC_IO_PAD_DRIVE_STRENGTH_CTRL_B MISC_MEM_MAP(0x20) 231 + #define MISC_GPIOA_15_0_PULL_CTRL_REG MISC_MEM_MAP(0x24) 232 + #define MISC_GPIOA_16_31_PULL_CTRL_REG MISC_MEM_MAP(0x28) 233 + #define MISC_GPIOB_15_0_PULL_CTRL_REG MISC_MEM_MAP(0x2C) 234 + #define MISC_GPIOB_16_31_PULL_CTRL_REG MISC_MEM_MAP(0x30) 235 + #define MISC_IO_PULL_CTRL_REG MISC_MEM_MAP(0x34) 236 + #define MISC_E_FUSE_31_0_REG MISC_MEM_MAP(0x40) 237 + #define MISC_E_FUSE_63_32_REG MISC_MEM_MAP(0x44) 238 + #define MISC_E_FUSE_95_64_REG MISC_MEM_MAP(0x48) 239 + #define MISC_E_FUSE_127_96_REG MISC_MEM_MAP(0x4C) 240 + #define MISC_SOFTWARE_TEST_1_REG MISC_MEM_MAP(0x50) 241 + #define MISC_SOFTWARE_TEST_2_REG MISC_MEM_MAP(0x54) 242 + 243 + #define MISC_SATA_POWER_MODE MISC_MEM_MAP(0x310) 244 + 245 + #define MISC_USB_CFG_REG MISC_MEM_MAP(0x800) 246 + #define MISC_USB_STS_REG MISC_MEM_MAP(0x804) 247 + #define MISC_USBPHY00_CFG_REG MISC_MEM_MAP(0x808) 248 + #define MISC_USBPHY01_CFG_REG MISC_MEM_MAP(0x80c) 249 + #define MISC_USBPHY10_CFG_REG MISC_MEM_MAP(0x810) 250 + #define MISC_USBPHY11_CFG_REG MISC_MEM_MAP(0x814) 251 + 252 + #define MISC_PCIEPHY_CMCTL(x) MISC_MEM_MAP(0x900 + (x) * 0x004) 253 + #define MISC_PCIEPHY_CTL(x) MISC_MEM_MAP(0x940 + (x) * 0x100) 254 + #define MISC_PCIE_AXIS_AWMISC(x) MISC_MEM_MAP(0x944 + (x) * 0x100) 255 + #define MISC_PCIE_AXIS_ARMISC(x) MISC_MEM_MAP(0x948 + (x) * 0x100) 256 + #define MISC_PCIE_AXIS_RMISC(x) MISC_MEM_MAP(0x94C + (x) * 0x100) 257 + #define MISC_PCIE_AXIS_BMISC(x) MISC_MEM_MAP(0x950 + (x) * 0x100) 258 + #define MISC_PCIE_AXIM_RMISC(x) MISC_MEM_MAP(0x954 + (x) * 0x100) 259 + #define MISC_PCIE_AXIM_BMISC(x) MISC_MEM_MAP(0x958 + (x) * 0x100) 260 + #define MISC_PCIE_CTRL(x) MISC_MEM_MAP(0x95C + (x) * 0x100) 261 + #define MISC_PCIE_PM_DEBUG(x) MISC_MEM_MAP(0x960 + (x) * 0x100) 262 + #define MISC_PCIE_RFC_DEBUG(x) MISC_MEM_MAP(0x964 + (x) * 0x100) 263 + #define MISC_PCIE_CXPL_DEBUGL(x) MISC_MEM_MAP(0x968 + (x) * 0x100) 264 + #define MISC_PCIE_CXPL_DEBUGH(x) MISC_MEM_MAP(0x96C + (x) * 0x100) 265 + #define MISC_PCIE_DIAG_DEBUGH(x) MISC_MEM_MAP(0x970 + (x) * 0x100) 266 + #define MISC_PCIE_W1CLR(x) MISC_MEM_MAP(0x974 + (x) * 0x100) 267 + #define MISC_PCIE_INT_MASK(x) MISC_MEM_MAP(0x978 + (x) * 0x100) 268 + #define MISC_PCIE_INT_STATUS(x) MISC_MEM_MAP(0x97C + (x) * 0x100) 269 + 270 + /* 271 + * Power management and clock control 272 + */ 273 + #define PMU_MEM_MAP(offs) (void __iomem *)(CNS3XXX_PM_BASE_VIRT + (offs)) 274 + 275 + #define PM_CLK_GATE_REG PMU_MEM_MAP(0x000) 276 + #define PM_SOFT_RST_REG PMU_MEM_MAP(0x004) 277 + #define PM_HS_CFG_REG PMU_MEM_MAP(0x008) 278 + #define PM_CACTIVE_STA_REG PMU_MEM_MAP(0x00C) 279 + #define PM_PWR_STA_REG PMU_MEM_MAP(0x010) 280 + #define PM_CLK_CTRL_REG PMU_MEM_MAP(0x014) 281 + #define PM_PLL_LCD_I2S_CTRL_REG PMU_MEM_MAP(0x018) 282 + #define PM_PLL_HM_PD_CTRL_REG PMU_MEM_MAP(0x01C) 283 + #define PM_REGULAT_CTRL_REG PMU_MEM_MAP(0x020) 284 + #define PM_WDT_CTRL_REG PMU_MEM_MAP(0x024) 285 + #define PM_WU_CTRL0_REG PMU_MEM_MAP(0x028) 286 + #define PM_WU_CTRL1_REG PMU_MEM_MAP(0x02C) 287 + #define PM_CSR_REG PMU_MEM_MAP(0x030) 288 + 289 + /* PM_CLK_GATE_REG */ 290 + #define PM_CLK_GATE_REG_OFFSET_SDIO (25) 291 + #define PM_CLK_GATE_REG_OFFSET_GPU (24) 292 + #define PM_CLK_GATE_REG_OFFSET_CIM (23) 293 + #define PM_CLK_GATE_REG_OFFSET_LCDC (22) 294 + #define PM_CLK_GATE_REG_OFFSET_I2S (21) 295 + #define PM_CLK_GATE_REG_OFFSET_RAID (20) 296 + #define PM_CLK_GATE_REG_OFFSET_SATA (19) 297 + #define PM_CLK_GATE_REG_OFFSET_PCIE(x) (17 + (x)) 298 + #define PM_CLK_GATE_REG_OFFSET_USB_HOST (16) 299 + #define PM_CLK_GATE_REG_OFFSET_USB_OTG (15) 300 + #define PM_CLK_GATE_REG_OFFSET_TIMER (14) 301 + #define PM_CLK_GATE_REG_OFFSET_CRYPTO (13) 302 + #define PM_CLK_GATE_REG_OFFSET_HCIE (12) 303 + #define PM_CLK_GATE_REG_OFFSET_SWITCH (11) 304 + #define PM_CLK_GATE_REG_OFFSET_GPIO (10) 305 + #define PM_CLK_GATE_REG_OFFSET_UART3 (9) 306 + #define PM_CLK_GATE_REG_OFFSET_UART2 (8) 307 + #define PM_CLK_GATE_REG_OFFSET_UART1 (7) 308 + #define PM_CLK_GATE_REG_OFFSET_RTC (5) 309 + #define PM_CLK_GATE_REG_OFFSET_GDMA (4) 310 + #define PM_CLK_GATE_REG_OFFSET_SPI_PCM_I2C (3) 311 + #define PM_CLK_GATE_REG_OFFSET_SMC_NFI (1) 312 + #define PM_CLK_GATE_REG_MASK (0x03FFFFBA) 313 + 314 + /* PM_SOFT_RST_REG */ 315 + #define PM_SOFT_RST_REG_OFFST_WARM_RST_FLAG (31) 316 + #define PM_SOFT_RST_REG_OFFST_CPU1 (29) 317 + #define PM_SOFT_RST_REG_OFFST_CPU0 (28) 318 + #define PM_SOFT_RST_REG_OFFST_SDIO (25) 319 + #define PM_SOFT_RST_REG_OFFST_GPU (24) 320 + #define PM_SOFT_RST_REG_OFFST_CIM (23) 321 + #define PM_SOFT_RST_REG_OFFST_LCDC (22) 322 + #define PM_SOFT_RST_REG_OFFST_I2S (21) 323 + #define PM_SOFT_RST_REG_OFFST_RAID (20) 324 + #define PM_SOFT_RST_REG_OFFST_SATA (19) 325 + #define PM_SOFT_RST_REG_OFFST_PCIE(x) (17 + (x)) 326 + #define PM_SOFT_RST_REG_OFFST_USB_HOST (16) 327 + #define PM_SOFT_RST_REG_OFFST_USB_OTG (15) 328 + #define PM_SOFT_RST_REG_OFFST_TIMER (14) 329 + #define PM_SOFT_RST_REG_OFFST_CRYPTO (13) 330 + #define PM_SOFT_RST_REG_OFFST_HCIE (12) 331 + #define PM_SOFT_RST_REG_OFFST_SWITCH (11) 332 + #define PM_SOFT_RST_REG_OFFST_GPIO (10) 333 + #define PM_SOFT_RST_REG_OFFST_UART3 (9) 334 + #define PM_SOFT_RST_REG_OFFST_UART2 (8) 335 + #define PM_SOFT_RST_REG_OFFST_UART1 (7) 336 + #define PM_SOFT_RST_REG_OFFST_RTC (5) 337 + #define PM_SOFT_RST_REG_OFFST_GDMA (4) 338 + #define PM_SOFT_RST_REG_OFFST_SPI_PCM_I2C (3) 339 + #define PM_SOFT_RST_REG_OFFST_DMC (2) 340 + #define PM_SOFT_RST_REG_OFFST_SMC_NFI (1) 341 + #define PM_SOFT_RST_REG_OFFST_GLOBAL (0) 342 + #define PM_SOFT_RST_REG_MASK (0xF3FFFFBF) 343 + 344 + /* PMHS_CFG_REG */ 345 + #define PM_HS_CFG_REG_OFFSET_SDIO (25) 346 + #define PM_HS_CFG_REG_OFFSET_GPU (24) 347 + #define PM_HS_CFG_REG_OFFSET_CIM (23) 348 + #define PM_HS_CFG_REG_OFFSET_LCDC (22) 349 + #define PM_HS_CFG_REG_OFFSET_I2S (21) 350 + #define PM_HS_CFG_REG_OFFSET_RAID (20) 351 + #define PM_HS_CFG_REG_OFFSET_SATA (19) 352 + #define PM_HS_CFG_REG_OFFSET_PCIE1 (18) 353 + #define PM_HS_CFG_REG_OFFSET_PCIE0 (17) 354 + #define PM_HS_CFG_REG_OFFSET_USB_HOST (16) 355 + #define PM_HS_CFG_REG_OFFSET_USB_OTG (15) 356 + #define PM_HS_CFG_REG_OFFSET_TIMER (14) 357 + #define PM_HS_CFG_REG_OFFSET_CRYPTO (13) 358 + #define PM_HS_CFG_REG_OFFSET_HCIE (12) 359 + #define PM_HS_CFG_REG_OFFSET_SWITCH (11) 360 + #define PM_HS_CFG_REG_OFFSET_GPIO (10) 361 + #define PM_HS_CFG_REG_OFFSET_UART3 (9) 362 + #define PM_HS_CFG_REG_OFFSET_UART2 (8) 363 + #define PM_HS_CFG_REG_OFFSET_UART1 (7) 364 + #define PM_HS_CFG_REG_OFFSET_RTC (5) 365 + #define PM_HS_CFG_REG_OFFSET_GDMA (4) 366 + #define PM_HS_CFG_REG_OFFSET_SPI_PCM_I2S (3) 367 + #define PM_HS_CFG_REG_OFFSET_DMC (2) 368 + #define PM_HS_CFG_REG_OFFSET_SMC_NFI (1) 369 + #define PM_HS_CFG_REG_MASK (0x03FFFFBE) 370 + #define PM_HS_CFG_REG_MASK_SUPPORT (0x01100806) 371 + 372 + /* PM_CACTIVE_STA_REG */ 373 + #define PM_CACTIVE_STA_REG_OFFSET_SDIO (25) 374 + #define PM_CACTIVE_STA_REG_OFFSET_GPU (24) 375 + #define PM_CACTIVE_STA_REG_OFFSET_CIM (23) 376 + #define PM_CACTIVE_STA_REG_OFFSET_LCDC (22) 377 + #define PM_CACTIVE_STA_REG_OFFSET_I2S (21) 378 + #define PM_CACTIVE_STA_REG_OFFSET_RAID (20) 379 + #define PM_CACTIVE_STA_REG_OFFSET_SATA (19) 380 + #define PM_CACTIVE_STA_REG_OFFSET_PCIE1 (18) 381 + #define PM_CACTIVE_STA_REG_OFFSET_PCIE0 (17) 382 + #define PM_CACTIVE_STA_REG_OFFSET_USB_HOST (16) 383 + #define PM_CACTIVE_STA_REG_OFFSET_USB_OTG (15) 384 + #define PM_CACTIVE_STA_REG_OFFSET_TIMER (14) 385 + #define PM_CACTIVE_STA_REG_OFFSET_CRYPTO (13) 386 + #define PM_CACTIVE_STA_REG_OFFSET_HCIE (12) 387 + #define PM_CACTIVE_STA_REG_OFFSET_SWITCH (11) 388 + #define PM_CACTIVE_STA_REG_OFFSET_GPIO (10) 389 + #define PM_CACTIVE_STA_REG_OFFSET_UART3 (9) 390 + #define PM_CACTIVE_STA_REG_OFFSET_UART2 (8) 391 + #define PM_CACTIVE_STA_REG_OFFSET_UART1 (7) 392 + #define PM_CACTIVE_STA_REG_OFFSET_RTC (5) 393 + #define PM_CACTIVE_STA_REG_OFFSET_GDMA (4) 394 + #define PM_CACTIVE_STA_REG_OFFSET_SPI_PCM_I2S (3) 395 + #define PM_CACTIVE_STA_REG_OFFSET_DMC (2) 396 + #define PM_CACTIVE_STA_REG_OFFSET_SMC_NFI (1) 397 + #define PM_CACTIVE_STA_REG_MASK (0x03FFFFBE) 398 + 399 + /* PM_PWR_STA_REG */ 400 + #define PM_PWR_STA_REG_REG_OFFSET_SDIO (25) 401 + #define PM_PWR_STA_REG_REG_OFFSET_GPU (24) 402 + #define PM_PWR_STA_REG_REG_OFFSET_CIM (23) 403 + #define PM_PWR_STA_REG_REG_OFFSET_LCDC (22) 404 + #define PM_PWR_STA_REG_REG_OFFSET_I2S (21) 405 + #define PM_PWR_STA_REG_REG_OFFSET_RAID (20) 406 + #define PM_PWR_STA_REG_REG_OFFSET_SATA (19) 407 + #define PM_PWR_STA_REG_REG_OFFSET_PCIE1 (18) 408 + #define PM_PWR_STA_REG_REG_OFFSET_PCIE0 (17) 409 + #define PM_PWR_STA_REG_REG_OFFSET_USB_HOST (16) 410 + #define PM_PWR_STA_REG_REG_OFFSET_USB_OTG (15) 411 + #define PM_PWR_STA_REG_REG_OFFSET_TIMER (14) 412 + #define PM_PWR_STA_REG_REG_OFFSET_CRYPTO (13) 413 + #define PM_PWR_STA_REG_REG_OFFSET_HCIE (12) 414 + #define PM_PWR_STA_REG_REG_OFFSET_SWITCH (11) 415 + #define PM_PWR_STA_REG_REG_OFFSET_GPIO (10) 416 + #define PM_PWR_STA_REG_REG_OFFSET_UART3 (9) 417 + #define PM_PWR_STA_REG_REG_OFFSET_UART2 (8) 418 + #define PM_PWR_STA_REG_REG_OFFSET_UART1 (7) 419 + #define PM_PWR_STA_REG_REG_OFFSET_RTC (5) 420 + #define PM_PWR_STA_REG_REG_OFFSET_GDMA (4) 421 + #define PM_PWR_STA_REG_REG_OFFSET_SPI_PCM_I2S (3) 422 + #define PM_PWR_STA_REG_REG_OFFSET_DMC (2) 423 + #define PM_PWR_STA_REG_REG_OFFSET_SMC_NFI (1) 424 + #define PM_PWR_STA_REG_REG_MASK (0x03FFFFBE) 425 + 426 + /* PM_CLK_CTRL_REG */ 427 + #define PM_CLK_CTRL_REG_OFFSET_I2S_MCLK (31) 428 + #define PM_CLK_CTRL_REG_OFFSET_DDR2_CHG_EN (30) 429 + #define PM_CLK_CTRL_REG_OFFSET_PCIE_REF1_EN (29) 430 + #define PM_CLK_CTRL_REG_OFFSET_PCIE_REF0_EN (28) 431 + #define PM_CLK_CTRL_REG_OFFSET_TIMER_SIM_MODE (27) 432 + #define PM_CLK_CTRL_REG_OFFSET_I2SCLK_DIV (24) 433 + #define PM_CLK_CTRL_REG_OFFSET_I2SCLK_SEL (22) 434 + #define PM_CLK_CTRL_REG_OFFSET_CLKOUT_DIV (20) 435 + #define PM_CLK_CTRL_REG_OFFSET_CLKOUT_SEL (16) 436 + #define PM_CLK_CTRL_REG_OFFSET_MDC_DIV (14) 437 + #define PM_CLK_CTRL_REG_OFFSET_CRYPTO_CLK_SEL (12) 438 + #define PM_CLK_CTRL_REG_OFFSET_CPU_PWR_MODE (9) 439 + #define PM_CLK_CTRL_REG_OFFSET_PLL_DDR2_SEL (7) 440 + #define PM_CLK_CTRL_REG_OFFSET_DIV_IMMEDIATE (6) 441 + #define PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV (4) 442 + #define PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL (0) 443 + 444 + #define PM_CPU_CLK_DIV(DIV) { \ 445 + PM_CLK_CTRL_REG &= ~((0x3) << PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV); \ 446 + PM_CLK_CTRL_REG |= (((DIV)&0x3) << PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV); \ 447 + } 448 + 449 + #define PM_PLL_CPU_SEL(CPU) { \ 450 + PM_CLK_CTRL_REG &= ~((0xF) << PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL); \ 451 + PM_CLK_CTRL_REG |= (((CPU)&0xF) << PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL); \ 452 + } 453 + 454 + /* PM_PLL_LCD_I2S_CTRL_REG */ 455 + #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_MCLK_SMC_DIV (22) 456 + #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_R_SEL (17) 457 + #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_P (11) 458 + #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_M (3) 459 + #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_S (0) 460 + 461 + /* PM_PLL_HM_PD_CTRL_REG */ 462 + #define PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY1 (11) 463 + #define PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY0 (10) 464 + #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_I2SCD (6) 465 + #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_I2S (5) 466 + #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_LCD (4) 467 + #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB (3) 468 + #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_RGMII (2) 469 + #define PM_PLL_HM_PD_CTRL_REG_MASK (0x00000C7C) 470 + 471 + /* PM_WDT_CTRL_REG */ 472 + #define PM_WDT_CTRL_REG_OFFSET_RESET_CPU_ONLY (0) 473 + 474 + /* PM_CSR_REG - Clock Scaling Register*/ 475 + #define PM_CSR_REG_OFFSET_CSR_EN (30) 476 + #define PM_CSR_REG_OFFSET_CSR_NUM (0) 477 + 478 + #define CNS3XXX_PWR_CLK_EN(BLOCK) (0x1<<PM_CLK_GATE_REG_OFFSET_##BLOCK) 479 + 480 + /* Software reset*/ 481 + #define CNS3XXX_PWR_SOFTWARE_RST(BLOCK) (0x1<<PM_SOFT_RST_REG_OFFST_##BLOCK) 482 + 483 + /* 484 + * CNS3XXX support several power saving mode as following, 485 + * DFS, IDLE, HALT, DOZE, SLEEP, Hibernate 486 + */ 487 + #define CNS3XXX_PWR_CPU_MODE_DFS (0) 488 + #define CNS3XXX_PWR_CPU_MODE_IDLE (1) 489 + #define CNS3XXX_PWR_CPU_MODE_HALT (2) 490 + #define CNS3XXX_PWR_CPU_MODE_DOZE (3) 491 + #define CNS3XXX_PWR_CPU_MODE_SLEEP (4) 492 + #define CNS3XXX_PWR_CPU_MODE_HIBERNATE (5) 493 + 494 + #define CNS3XXX_PWR_PLL(BLOCK) (0x1<<PM_PLL_HM_PD_CTRL_REG_OFFSET_##BLOCK) 495 + #define CNS3XXX_PWR_PLL_ALL PM_PLL_HM_PD_CTRL_REG_MASK 496 + 497 + /* Change CPU frequency and divider */ 498 + #define CNS3XXX_PWR_PLL_CPU_300MHZ (0) 499 + #define CNS3XXX_PWR_PLL_CPU_333MHZ (1) 500 + #define CNS3XXX_PWR_PLL_CPU_366MHZ (2) 501 + #define CNS3XXX_PWR_PLL_CPU_400MHZ (3) 502 + #define CNS3XXX_PWR_PLL_CPU_433MHZ (4) 503 + #define CNS3XXX_PWR_PLL_CPU_466MHZ (5) 504 + #define CNS3XXX_PWR_PLL_CPU_500MHZ (6) 505 + #define CNS3XXX_PWR_PLL_CPU_533MHZ (7) 506 + #define CNS3XXX_PWR_PLL_CPU_566MHZ (8) 507 + #define CNS3XXX_PWR_PLL_CPU_600MHZ (9) 508 + #define CNS3XXX_PWR_PLL_CPU_633MHZ (10) 509 + #define CNS3XXX_PWR_PLL_CPU_666MHZ (11) 510 + #define CNS3XXX_PWR_PLL_CPU_700MHZ (12) 511 + 512 + #define CNS3XXX_PWR_CPU_CLK_DIV_BY1 (0) 513 + #define CNS3XXX_PWR_CPU_CLK_DIV_BY2 (1) 514 + #define CNS3XXX_PWR_CPU_CLK_DIV_BY4 (2) 515 + 516 + /* Change DDR2 frequency */ 517 + #define CNS3XXX_PWR_PLL_DDR2_200MHZ (0) 518 + #define CNS3XXX_PWR_PLL_DDR2_266MHZ (1) 519 + #define CNS3XXX_PWR_PLL_DDR2_333MHZ (2) 520 + #define CNS3XXX_PWR_PLL_DDR2_400MHZ (3) 521 + 522 + void cns3xxx_pwr_soft_rst(unsigned int block); 523 + void cns3xxx_pwr_clk_en(unsigned int block); 524 + int cns3xxx_cpu_clock(void); 525 + 526 + /* 527 + * ARM11 MPCore interrupt sources (primary GIC) 528 + */ 529 + #define IRQ_TC11MP_GIC_START 32 530 + 531 + #define IRQ_CNS3XXX_PMU (IRQ_TC11MP_GIC_START + 0) 532 + #define IRQ_CNS3XXX_SDIO (IRQ_TC11MP_GIC_START + 1) 533 + #define IRQ_CNS3XXX_L2CC (IRQ_TC11MP_GIC_START + 2) 534 + #define IRQ_CNS3XXX_RTC (IRQ_TC11MP_GIC_START + 3) 535 + #define IRQ_CNS3XXX_I2S (IRQ_TC11MP_GIC_START + 4) 536 + #define IRQ_CNS3XXX_PCM (IRQ_TC11MP_GIC_START + 5) 537 + #define IRQ_CNS3XXX_SPI (IRQ_TC11MP_GIC_START + 6) 538 + #define IRQ_CNS3XXX_I2C (IRQ_TC11MP_GIC_START + 7) 539 + #define IRQ_CNS3XXX_CIM (IRQ_TC11MP_GIC_START + 8) 540 + #define IRQ_CNS3XXX_GPU (IRQ_TC11MP_GIC_START + 9) 541 + #define IRQ_CNS3XXX_LCD (IRQ_TC11MP_GIC_START + 10) 542 + #define IRQ_CNS3XXX_GPIOA (IRQ_TC11MP_GIC_START + 11) 543 + #define IRQ_CNS3XXX_GPIOB (IRQ_TC11MP_GIC_START + 12) 544 + #define IRQ_CNS3XXX_UART0 (IRQ_TC11MP_GIC_START + 13) 545 + #define IRQ_CNS3XXX_UART1 (IRQ_TC11MP_GIC_START + 14) 546 + #define IRQ_CNS3XXX_UART2 (IRQ_TC11MP_GIC_START + 15) 547 + #define IRQ_CNS3XXX_ARM11 (IRQ_TC11MP_GIC_START + 16) 548 + 549 + #define IRQ_CNS3XXX_SW_STATUS (IRQ_TC11MP_GIC_START + 17) 550 + #define IRQ_CNS3XXX_SW_R0TXC (IRQ_TC11MP_GIC_START + 18) 551 + #define IRQ_CNS3XXX_SW_R0RXC (IRQ_TC11MP_GIC_START + 19) 552 + #define IRQ_CNS3XXX_SW_R0QE (IRQ_TC11MP_GIC_START + 20) 553 + #define IRQ_CNS3XXX_SW_R0QF (IRQ_TC11MP_GIC_START + 21) 554 + #define IRQ_CNS3XXX_SW_R1TXC (IRQ_TC11MP_GIC_START + 22) 555 + #define IRQ_CNS3XXX_SW_R1RXC (IRQ_TC11MP_GIC_START + 23) 556 + #define IRQ_CNS3XXX_SW_R1QE (IRQ_TC11MP_GIC_START + 24) 557 + #define IRQ_CNS3XXX_SW_R1QF (IRQ_TC11MP_GIC_START + 25) 558 + #define IRQ_CNS3XXX_SW_PPE (IRQ_TC11MP_GIC_START + 26) 559 + 560 + #define IRQ_CNS3XXX_CRYPTO (IRQ_TC11MP_GIC_START + 27) 561 + #define IRQ_CNS3XXX_HCIE (IRQ_TC11MP_GIC_START + 28) 562 + #define IRQ_CNS3XXX_PCIE0_DEVICE (IRQ_TC11MP_GIC_START + 29) 563 + #define IRQ_CNS3XXX_PCIE1_DEVICE (IRQ_TC11MP_GIC_START + 30) 564 + #define IRQ_CNS3XXX_USB_OTG (IRQ_TC11MP_GIC_START + 31) 565 + #define IRQ_CNS3XXX_USB_EHCI (IRQ_TC11MP_GIC_START + 32) 566 + #define IRQ_CNS3XXX_SATA (IRQ_TC11MP_GIC_START + 33) 567 + #define IRQ_CNS3XXX_RAID (IRQ_TC11MP_GIC_START + 34) 568 + #define IRQ_CNS3XXX_SMC (IRQ_TC11MP_GIC_START + 35) 569 + 570 + #define IRQ_CNS3XXX_DMAC_ABORT (IRQ_TC11MP_GIC_START + 36) 571 + #define IRQ_CNS3XXX_DMAC0 (IRQ_TC11MP_GIC_START + 37) 572 + #define IRQ_CNS3XXX_DMAC1 (IRQ_TC11MP_GIC_START + 38) 573 + #define IRQ_CNS3XXX_DMAC2 (IRQ_TC11MP_GIC_START + 39) 574 + #define IRQ_CNS3XXX_DMAC3 (IRQ_TC11MP_GIC_START + 40) 575 + #define IRQ_CNS3XXX_DMAC4 (IRQ_TC11MP_GIC_START + 41) 576 + #define IRQ_CNS3XXX_DMAC5 (IRQ_TC11MP_GIC_START + 42) 577 + #define IRQ_CNS3XXX_DMAC6 (IRQ_TC11MP_GIC_START + 43) 578 + #define IRQ_CNS3XXX_DMAC7 (IRQ_TC11MP_GIC_START + 44) 579 + #define IRQ_CNS3XXX_DMAC8 (IRQ_TC11MP_GIC_START + 45) 580 + #define IRQ_CNS3XXX_DMAC9 (IRQ_TC11MP_GIC_START + 46) 581 + #define IRQ_CNS3XXX_DMAC10 (IRQ_TC11MP_GIC_START + 47) 582 + #define IRQ_CNS3XXX_DMAC11 (IRQ_TC11MP_GIC_START + 48) 583 + #define IRQ_CNS3XXX_DMAC12 (IRQ_TC11MP_GIC_START + 49) 584 + #define IRQ_CNS3XXX_DMAC13 (IRQ_TC11MP_GIC_START + 50) 585 + #define IRQ_CNS3XXX_DMAC14 (IRQ_TC11MP_GIC_START + 51) 586 + #define IRQ_CNS3XXX_DMAC15 (IRQ_TC11MP_GIC_START + 52) 587 + #define IRQ_CNS3XXX_DMAC16 (IRQ_TC11MP_GIC_START + 53) 588 + #define IRQ_CNS3XXX_DMAC17 (IRQ_TC11MP_GIC_START + 54) 589 + 590 + #define IRQ_CNS3XXX_PCIE0_RC (IRQ_TC11MP_GIC_START + 55) 591 + #define IRQ_CNS3XXX_PCIE1_RC (IRQ_TC11MP_GIC_START + 56) 592 + #define IRQ_CNS3XXX_TIMER0 (IRQ_TC11MP_GIC_START + 57) 593 + #define IRQ_CNS3XXX_TIMER1 (IRQ_TC11MP_GIC_START + 58) 594 + #define IRQ_CNS3XXX_USB_OHCI (IRQ_TC11MP_GIC_START + 59) 595 + #define IRQ_CNS3XXX_TIMER2 (IRQ_TC11MP_GIC_START + 60) 596 + #define IRQ_CNS3XXX_EXTERNAL_PIN0 (IRQ_TC11MP_GIC_START + 61) 597 + #define IRQ_CNS3XXX_EXTERNAL_PIN1 (IRQ_TC11MP_GIC_START + 62) 598 + #define IRQ_CNS3XXX_EXTERNAL_PIN2 (IRQ_TC11MP_GIC_START + 63) 599 + 600 + #define NR_IRQS_CNS3XXX (IRQ_TC11MP_GIC_START + 64) 601 + 602 + #endif /* __MACH_BOARD_CNS3XXX_H */
+120 -1
arch/arm/mach-cns3xxx/core.c
··· 13 13 #include <linux/clockchips.h> 14 14 #include <linux/io.h> 15 15 #include <linux/irqchip/arm-gic.h> 16 + #include <linux/of_platform.h> 17 + #include <linux/platform_device.h> 18 + #include <linux/usb/ehci_pdriver.h> 19 + #include <linux/usb/ohci_pdriver.h> 20 + #include <asm/mach/arch.h> 16 21 #include <asm/mach/map.h> 17 22 #include <asm/mach/time.h> 18 23 #include <asm/mach/irq.h> 19 24 #include <asm/hardware/cache-l2x0.h> 20 - #include <mach/cns3xxx.h> 25 + #include "cns3xxx.h" 21 26 #include "core.h" 27 + #include "pm.h" 22 28 23 29 static struct map_desc cns3xxx_io_desc[] __initdata = { 24 30 { ··· 262 256 } 263 257 264 258 #endif /* CONFIG_CACHE_L2X0 */ 259 + 260 + static int csn3xxx_usb_power_on(struct platform_device *pdev) 261 + { 262 + /* 263 + * EHCI and OHCI share the same clock and power, 264 + * resetting twice would cause the 1st controller been reset. 265 + * Therefore only do power up at the first up device, and 266 + * power down at the last down device. 267 + * 268 + * Set USB AHB INCR length to 16 269 + */ 270 + if (atomic_inc_return(&usb_pwr_ref) == 1) { 271 + cns3xxx_pwr_power_up(1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB); 272 + cns3xxx_pwr_clk_en(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); 273 + cns3xxx_pwr_soft_rst(1 << PM_SOFT_RST_REG_OFFST_USB_HOST); 274 + __raw_writel((__raw_readl(MISC_CHIP_CONFIG_REG) | (0X2 << 24)), 275 + MISC_CHIP_CONFIG_REG); 276 + } 277 + 278 + return 0; 279 + } 280 + 281 + static void csn3xxx_usb_power_off(struct platform_device *pdev) 282 + { 283 + /* 284 + * EHCI and OHCI share the same clock and power, 285 + * resetting twice would cause the 1st controller been reset. 286 + * Therefore only do power up at the first up device, and 287 + * power down at the last down device. 288 + */ 289 + if (atomic_dec_return(&usb_pwr_ref) == 0) 290 + cns3xxx_pwr_clk_dis(1 << PM_CLK_GATE_REG_OFFSET_USB_HOST); 291 + } 292 + 293 + static struct usb_ehci_pdata cns3xxx_usb_ehci_pdata = { 294 + .power_on = csn3xxx_usb_power_on, 295 + .power_off = csn3xxx_usb_power_off, 296 + }; 297 + 298 + static struct usb_ohci_pdata cns3xxx_usb_ohci_pdata = { 299 + .num_ports = 1, 300 + .power_on = csn3xxx_usb_power_on, 301 + .power_off = csn3xxx_usb_power_off, 302 + }; 303 + 304 + static struct of_dev_auxdata cns3xxx_auxdata[] __initconst = { 305 + { "intel,usb-ehci", CNS3XXX_USB_BASE, "ehci-platform", &cns3xxx_usb_ehci_pdata }, 306 + { "intel,usb-ohci", CNS3XXX_USB_OHCI_BASE, "ohci-platform", &cns3xxx_usb_ohci_pdata }, 307 + { "cavium,cns3420-ahci", CNS3XXX_SATA2_BASE, "ahci", NULL }, 308 + { "cavium,cns3420-sdhci", CNS3XXX_SDIO_BASE, "ahci", NULL }, 309 + {}, 310 + }; 311 + 312 + static void __init cns3xxx_init(void) 313 + { 314 + struct device_node *dn; 315 + 316 + cns3xxx_l2x0_init(); 317 + 318 + dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-ahci"); 319 + if (of_device_is_available(dn)) { 320 + u32 tmp; 321 + 322 + tmp = __raw_readl(MISC_SATA_POWER_MODE); 323 + tmp |= 0x1 << 16; /* Disable SATA PHY 0 from SLUMBER Mode */ 324 + tmp |= 0x1 << 17; /* Disable SATA PHY 1 from SLUMBER Mode */ 325 + __raw_writel(tmp, MISC_SATA_POWER_MODE); 326 + 327 + /* Enable SATA PHY */ 328 + cns3xxx_pwr_power_up(0x1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY0); 329 + cns3xxx_pwr_power_up(0x1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY1); 330 + 331 + /* Enable SATA Clock */ 332 + cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_SATA); 333 + 334 + /* De-Asscer SATA Reset */ 335 + cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA)); 336 + } 337 + 338 + dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci"); 339 + if (of_device_is_available(dn)) { 340 + u32 __iomem *gpioa = IOMEM(CNS3XXX_MISC_BASE_VIRT + 0x0014); 341 + u32 gpioa_pins = __raw_readl(gpioa); 342 + 343 + /* MMC/SD pins share with GPIOA */ 344 + gpioa_pins |= 0x1fff0004; 345 + __raw_writel(gpioa_pins, gpioa); 346 + 347 + cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO)); 348 + cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO)); 349 + } 350 + 351 + pm_power_off = cns3xxx_power_off; 352 + 353 + of_platform_populate(NULL, of_default_bus_match_table, 354 + cns3xxx_auxdata, NULL); 355 + } 356 + 357 + static const char *cns3xxx_dt_compat[] __initdata = { 358 + "cavium,cns3410", 359 + "cavium,cns3420", 360 + NULL, 361 + }; 362 + 363 + DT_MACHINE_START(CNS3XXX_DT, "Cavium Networks CNS3xxx") 364 + .dt_compat = cns3xxx_dt_compat, 365 + .nr_irqs = NR_IRQS_CNS3XXX, 366 + .map_io = cns3xxx_map_io, 367 + .init_irq = cns3xxx_init_irq, 368 + .init_time = cns3xxx_timer_init, 369 + .init_machine = cns3xxx_init, 370 + .restart = cns3xxx_restart, 371 + MACHINE_END
+2 -3
arch/arm/mach-cns3xxx/devices.c
··· 16 16 #include <linux/compiler.h> 17 17 #include <linux/dma-mapping.h> 18 18 #include <linux/platform_device.h> 19 - #include <mach/cns3xxx.h> 20 - #include <mach/irqs.h> 21 - #include <mach/pm.h> 19 + #include "cns3xxx.h" 20 + #include "pm.h" 22 21 #include "core.h" 23 22 #include "devices.h" 24 23
-605
arch/arm/mach-cns3xxx/include/mach/cns3xxx.h
··· 1 - /* 2 - * Copyright 2008 Cavium Networks 3 - * 4 - * This file is free software; you can redistribute it and/or modify 5 - * it under the terms of the GNU General Public License, Version 2, as 6 - * published by the Free Software Foundation. 7 - */ 8 - 9 - #ifndef __MACH_BOARD_CNS3XXXH 10 - #define __MACH_BOARD_CNS3XXXH 11 - 12 - /* 13 - * Memory map 14 - */ 15 - #define CNS3XXX_FLASH_BASE 0x10000000 /* Flash/SRAM Memory Bank 0 */ 16 - #define CNS3XXX_FLASH_SIZE SZ_256M 17 - 18 - #define CNS3XXX_DDR2SDRAM_BASE 0x20000000 /* DDR2 SDRAM Memory */ 19 - 20 - #define CNS3XXX_SPI_FLASH_BASE 0x60000000 /* SPI Serial Flash Memory */ 21 - 22 - #define CNS3XXX_SWITCH_BASE 0x70000000 /* Switch and HNAT Control */ 23 - 24 - #define CNS3XXX_PPE_BASE 0x70001000 /* HANT */ 25 - 26 - #define CNS3XXX_EMBEDDED_SRAM_BASE 0x70002000 /* HANT Embedded SRAM */ 27 - 28 - #define CNS3XXX_SSP_BASE 0x71000000 /* Synchronous Serial Port - SPI/PCM/I2C */ 29 - 30 - #define CNS3XXX_DMC_BASE 0x72000000 /* DMC Control (DDR2 SDRAM) */ 31 - 32 - #define CNS3XXX_SMC_BASE 0x73000000 /* SMC Control */ 33 - 34 - #define SMC_MEMC_STATUS_OFFSET 0x000 35 - #define SMC_MEMIF_CFG_OFFSET 0x004 36 - #define SMC_MEMC_CFG_SET_OFFSET 0x008 37 - #define SMC_MEMC_CFG_CLR_OFFSET 0x00C 38 - #define SMC_DIRECT_CMD_OFFSET 0x010 39 - #define SMC_SET_CYCLES_OFFSET 0x014 40 - #define SMC_SET_OPMODE_OFFSET 0x018 41 - #define SMC_REFRESH_PERIOD_0_OFFSET 0x020 42 - #define SMC_REFRESH_PERIOD_1_OFFSET 0x024 43 - #define SMC_SRAM_CYCLES0_0_OFFSET 0x100 44 - #define SMC_NAND_CYCLES0_0_OFFSET 0x100 45 - #define SMC_OPMODE0_0_OFFSET 0x104 46 - #define SMC_SRAM_CYCLES0_1_OFFSET 0x120 47 - #define SMC_NAND_CYCLES0_1_OFFSET 0x120 48 - #define SMC_OPMODE0_1_OFFSET 0x124 49 - #define SMC_USER_STATUS_OFFSET 0x200 50 - #define SMC_USER_CONFIG_OFFSET 0x204 51 - #define SMC_ECC_STATUS_OFFSET 0x300 52 - #define SMC_ECC_MEMCFG_OFFSET 0x304 53 - #define SMC_ECC_MEMCOMMAND1_OFFSET 0x308 54 - #define SMC_ECC_MEMCOMMAND2_OFFSET 0x30C 55 - #define SMC_ECC_ADDR0_OFFSET 0x310 56 - #define SMC_ECC_ADDR1_OFFSET 0x314 57 - #define SMC_ECC_VALUE0_OFFSET 0x318 58 - #define SMC_ECC_VALUE1_OFFSET 0x31C 59 - #define SMC_ECC_VALUE2_OFFSET 0x320 60 - #define SMC_ECC_VALUE3_OFFSET 0x324 61 - #define SMC_PERIPH_ID_0_OFFSET 0xFE0 62 - #define SMC_PERIPH_ID_1_OFFSET 0xFE4 63 - #define SMC_PERIPH_ID_2_OFFSET 0xFE8 64 - #define SMC_PERIPH_ID_3_OFFSET 0xFEC 65 - #define SMC_PCELL_ID_0_OFFSET 0xFF0 66 - #define SMC_PCELL_ID_1_OFFSET 0xFF4 67 - #define SMC_PCELL_ID_2_OFFSET 0xFF8 68 - #define SMC_PCELL_ID_3_OFFSET 0xFFC 69 - 70 - #define CNS3XXX_GPIOA_BASE 0x74000000 /* GPIO port A */ 71 - 72 - #define CNS3XXX_GPIOB_BASE 0x74800000 /* GPIO port B */ 73 - 74 - #define CNS3XXX_RTC_BASE 0x75000000 /* Real Time Clock */ 75 - 76 - #define RTC_SEC_OFFSET 0x00 77 - #define RTC_MIN_OFFSET 0x04 78 - #define RTC_HOUR_OFFSET 0x08 79 - #define RTC_DAY_OFFSET 0x0C 80 - #define RTC_SEC_ALM_OFFSET 0x10 81 - #define RTC_MIN_ALM_OFFSET 0x14 82 - #define RTC_HOUR_ALM_OFFSET 0x18 83 - #define RTC_REC_OFFSET 0x1C 84 - #define RTC_CTRL_OFFSET 0x20 85 - #define RTC_INTR_STS_OFFSET 0x34 86 - 87 - #define CNS3XXX_MISC_BASE 0x76000000 /* Misc Control */ 88 - #define CNS3XXX_MISC_BASE_VIRT 0xFB000000 /* Misc Control */ 89 - 90 - #define CNS3XXX_PM_BASE 0x77000000 /* Power Management Control */ 91 - #define CNS3XXX_PM_BASE_VIRT 0xFB001000 92 - 93 - #define PM_CLK_GATE_OFFSET 0x00 94 - #define PM_SOFT_RST_OFFSET 0x04 95 - #define PM_HS_CFG_OFFSET 0x08 96 - #define PM_CACTIVE_STA_OFFSET 0x0C 97 - #define PM_PWR_STA_OFFSET 0x10 98 - #define PM_SYS_CLK_CTRL_OFFSET 0x14 99 - #define PM_PLL_LCD_I2S_CTRL_OFFSET 0x18 100 - #define PM_PLL_HM_PD_OFFSET 0x1C 101 - 102 - #define CNS3XXX_UART0_BASE 0x78000000 /* UART 0 */ 103 - #define CNS3XXX_UART0_BASE_VIRT 0xFB002000 104 - 105 - #define CNS3XXX_UART1_BASE 0x78400000 /* UART 1 */ 106 - 107 - #define CNS3XXX_UART2_BASE 0x78800000 /* UART 2 */ 108 - 109 - #define CNS3XXX_DMAC_BASE 0x79000000 /* Generic DMA Control */ 110 - 111 - #define CNS3XXX_CORESIGHT_BASE 0x7A000000 /* CoreSight */ 112 - 113 - #define CNS3XXX_CRYPTO_BASE 0x7B000000 /* Crypto */ 114 - 115 - #define CNS3XXX_I2S_BASE 0x7C000000 /* I2S */ 116 - 117 - #define CNS3XXX_TIMER1_2_3_BASE 0x7C800000 /* Timer */ 118 - #define CNS3XXX_TIMER1_2_3_BASE_VIRT 0xFB003000 119 - 120 - #define TIMER1_COUNTER_OFFSET 0x00 121 - #define TIMER1_AUTO_RELOAD_OFFSET 0x04 122 - #define TIMER1_MATCH_V1_OFFSET 0x08 123 - #define TIMER1_MATCH_V2_OFFSET 0x0C 124 - 125 - #define TIMER2_COUNTER_OFFSET 0x10 126 - #define TIMER2_AUTO_RELOAD_OFFSET 0x14 127 - #define TIMER2_MATCH_V1_OFFSET 0x18 128 - #define TIMER2_MATCH_V2_OFFSET 0x1C 129 - 130 - #define TIMER1_2_CONTROL_OFFSET 0x30 131 - #define TIMER1_2_INTERRUPT_STATUS_OFFSET 0x34 132 - #define TIMER1_2_INTERRUPT_MASK_OFFSET 0x38 133 - 134 - #define TIMER_FREERUN_OFFSET 0x40 135 - #define TIMER_FREERUN_CONTROL_OFFSET 0x44 136 - 137 - #define CNS3XXX_HCIE_BASE 0x7D000000 /* HCIE Control */ 138 - 139 - #define CNS3XXX_RAID_BASE 0x7E000000 /* RAID Control */ 140 - 141 - #define CNS3XXX_AXI_IXC_BASE 0x7F000000 /* AXI IXC */ 142 - 143 - #define CNS3XXX_CLCD_BASE 0x80000000 /* LCD Control */ 144 - 145 - #define CNS3XXX_USBOTG_BASE 0x81000000 /* USB OTG Control */ 146 - 147 - #define CNS3XXX_USB_BASE 0x82000000 /* USB Host Control */ 148 - 149 - #define CNS3XXX_SATA2_BASE 0x83000000 /* SATA */ 150 - #define CNS3XXX_SATA2_SIZE SZ_16M 151 - 152 - #define CNS3XXX_CAMERA_BASE 0x84000000 /* Camera Interface */ 153 - 154 - #define CNS3XXX_SDIO_BASE 0x85000000 /* SDIO */ 155 - 156 - #define CNS3XXX_I2S_TDM_BASE 0x86000000 /* I2S TDM */ 157 - 158 - #define CNS3XXX_2DG_BASE 0x87000000 /* 2D Graphic Control */ 159 - 160 - #define CNS3XXX_USB_OHCI_BASE 0x88000000 /* USB OHCI */ 161 - 162 - #define CNS3XXX_L2C_BASE 0x92000000 /* L2 Cache Control */ 163 - 164 - #define CNS3XXX_PCIE0_MEM_BASE 0xA0000000 /* PCIe Port 0 IO/Memory Space */ 165 - #define CNS3XXX_PCIE0_MEM_BASE_VIRT 0xE0000000 166 - 167 - #define CNS3XXX_PCIE0_HOST_BASE 0xAB000000 /* PCIe Port 0 RC Base */ 168 - #define CNS3XXX_PCIE0_HOST_BASE_VIRT 0xE1000000 169 - 170 - #define CNS3XXX_PCIE0_IO_BASE 0xAC000000 /* PCIe Port 0 */ 171 - #define CNS3XXX_PCIE0_IO_BASE_VIRT 0xE2000000 172 - 173 - #define CNS3XXX_PCIE0_CFG0_BASE 0xAD000000 /* PCIe Port 0 CFG Type 0 */ 174 - #define CNS3XXX_PCIE0_CFG0_BASE_VIRT 0xE3000000 175 - 176 - #define CNS3XXX_PCIE0_CFG1_BASE 0xAE000000 /* PCIe Port 0 CFG Type 1 */ 177 - #define CNS3XXX_PCIE0_CFG1_BASE_VIRT 0xE4000000 178 - 179 - #define CNS3XXX_PCIE0_MSG_BASE 0xAF000000 /* PCIe Port 0 Message Space */ 180 - #define CNS3XXX_PCIE0_MSG_BASE_VIRT 0xE5000000 181 - 182 - #define CNS3XXX_PCIE1_MEM_BASE 0xB0000000 /* PCIe Port 1 IO/Memory Space */ 183 - #define CNS3XXX_PCIE1_MEM_BASE_VIRT 0xE8000000 184 - 185 - #define CNS3XXX_PCIE1_HOST_BASE 0xBB000000 /* PCIe Port 1 RC Base */ 186 - #define CNS3XXX_PCIE1_HOST_BASE_VIRT 0xE9000000 187 - 188 - #define CNS3XXX_PCIE1_IO_BASE 0xBC000000 /* PCIe Port 1 */ 189 - #define CNS3XXX_PCIE1_IO_BASE_VIRT 0xEA000000 190 - 191 - #define CNS3XXX_PCIE1_CFG0_BASE 0xBD000000 /* PCIe Port 1 CFG Type 0 */ 192 - #define CNS3XXX_PCIE1_CFG0_BASE_VIRT 0xEB000000 193 - 194 - #define CNS3XXX_PCIE1_CFG1_BASE 0xBE000000 /* PCIe Port 1 CFG Type 1 */ 195 - #define CNS3XXX_PCIE1_CFG1_BASE_VIRT 0xEC000000 196 - 197 - #define CNS3XXX_PCIE1_MSG_BASE 0xBF000000 /* PCIe Port 1 Message Space */ 198 - #define CNS3XXX_PCIE1_MSG_BASE_VIRT 0xED000000 199 - 200 - /* 201 - * Testchip peripheral and fpga gic regions 202 - */ 203 - #define CNS3XXX_TC11MP_SCU_BASE 0x90000000 /* IRQ, Test chip */ 204 - #define CNS3XXX_TC11MP_SCU_BASE_VIRT 0xFB004000 205 - 206 - #define CNS3XXX_TC11MP_GIC_CPU_BASE 0x90000100 /* Test chip interrupt controller CPU interface */ 207 - #define CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x100) 208 - 209 - #define CNS3XXX_TC11MP_TWD_BASE 0x90000600 210 - #define CNS3XXX_TC11MP_TWD_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x600) 211 - 212 - #define CNS3XXX_TC11MP_GIC_DIST_BASE 0x90001000 /* Test chip interrupt controller distributor */ 213 - #define CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT (CNS3XXX_TC11MP_SCU_BASE_VIRT + 0x1000) 214 - 215 - #define CNS3XXX_TC11MP_L220_BASE 0x92002000 /* L220 registers */ 216 - 217 - /* 218 - * Misc block 219 - */ 220 - #define MISC_MEM_MAP(offs) (void __iomem *)(CNS3XXX_MISC_BASE_VIRT + (offs)) 221 - 222 - #define MISC_MEMORY_REMAP_REG MISC_MEM_MAP(0x00) 223 - #define MISC_CHIP_CONFIG_REG MISC_MEM_MAP(0x04) 224 - #define MISC_DEBUG_PROBE_DATA_REG MISC_MEM_MAP(0x08) 225 - #define MISC_DEBUG_PROBE_SELECTION_REG MISC_MEM_MAP(0x0C) 226 - #define MISC_IO_PIN_FUNC_SELECTION_REG MISC_MEM_MAP(0x10) 227 - #define MISC_GPIOA_PIN_ENABLE_REG MISC_MEM_MAP(0x14) 228 - #define MISC_GPIOB_PIN_ENABLE_REG MISC_MEM_MAP(0x18) 229 - #define MISC_IO_PAD_DRIVE_STRENGTH_CTRL_A MISC_MEM_MAP(0x1C) 230 - #define MISC_IO_PAD_DRIVE_STRENGTH_CTRL_B MISC_MEM_MAP(0x20) 231 - #define MISC_GPIOA_15_0_PULL_CTRL_REG MISC_MEM_MAP(0x24) 232 - #define MISC_GPIOA_16_31_PULL_CTRL_REG MISC_MEM_MAP(0x28) 233 - #define MISC_GPIOB_15_0_PULL_CTRL_REG MISC_MEM_MAP(0x2C) 234 - #define MISC_GPIOB_16_31_PULL_CTRL_REG MISC_MEM_MAP(0x30) 235 - #define MISC_IO_PULL_CTRL_REG MISC_MEM_MAP(0x34) 236 - #define MISC_E_FUSE_31_0_REG MISC_MEM_MAP(0x40) 237 - #define MISC_E_FUSE_63_32_REG MISC_MEM_MAP(0x44) 238 - #define MISC_E_FUSE_95_64_REG MISC_MEM_MAP(0x48) 239 - #define MISC_E_FUSE_127_96_REG MISC_MEM_MAP(0x4C) 240 - #define MISC_SOFTWARE_TEST_1_REG MISC_MEM_MAP(0x50) 241 - #define MISC_SOFTWARE_TEST_2_REG MISC_MEM_MAP(0x54) 242 - 243 - #define MISC_SATA_POWER_MODE MISC_MEM_MAP(0x310) 244 - 245 - #define MISC_USB_CFG_REG MISC_MEM_MAP(0x800) 246 - #define MISC_USB_STS_REG MISC_MEM_MAP(0x804) 247 - #define MISC_USBPHY00_CFG_REG MISC_MEM_MAP(0x808) 248 - #define MISC_USBPHY01_CFG_REG MISC_MEM_MAP(0x80c) 249 - #define MISC_USBPHY10_CFG_REG MISC_MEM_MAP(0x810) 250 - #define MISC_USBPHY11_CFG_REG MISC_MEM_MAP(0x814) 251 - 252 - #define MISC_PCIEPHY_CMCTL(x) MISC_MEM_MAP(0x900 + (x) * 0x004) 253 - #define MISC_PCIEPHY_CTL(x) MISC_MEM_MAP(0x940 + (x) * 0x100) 254 - #define MISC_PCIE_AXIS_AWMISC(x) MISC_MEM_MAP(0x944 + (x) * 0x100) 255 - #define MISC_PCIE_AXIS_ARMISC(x) MISC_MEM_MAP(0x948 + (x) * 0x100) 256 - #define MISC_PCIE_AXIS_RMISC(x) MISC_MEM_MAP(0x94C + (x) * 0x100) 257 - #define MISC_PCIE_AXIS_BMISC(x) MISC_MEM_MAP(0x950 + (x) * 0x100) 258 - #define MISC_PCIE_AXIM_RMISC(x) MISC_MEM_MAP(0x954 + (x) * 0x100) 259 - #define MISC_PCIE_AXIM_BMISC(x) MISC_MEM_MAP(0x958 + (x) * 0x100) 260 - #define MISC_PCIE_CTRL(x) MISC_MEM_MAP(0x95C + (x) * 0x100) 261 - #define MISC_PCIE_PM_DEBUG(x) MISC_MEM_MAP(0x960 + (x) * 0x100) 262 - #define MISC_PCIE_RFC_DEBUG(x) MISC_MEM_MAP(0x964 + (x) * 0x100) 263 - #define MISC_PCIE_CXPL_DEBUGL(x) MISC_MEM_MAP(0x968 + (x) * 0x100) 264 - #define MISC_PCIE_CXPL_DEBUGH(x) MISC_MEM_MAP(0x96C + (x) * 0x100) 265 - #define MISC_PCIE_DIAG_DEBUGH(x) MISC_MEM_MAP(0x970 + (x) * 0x100) 266 - #define MISC_PCIE_W1CLR(x) MISC_MEM_MAP(0x974 + (x) * 0x100) 267 - #define MISC_PCIE_INT_MASK(x) MISC_MEM_MAP(0x978 + (x) * 0x100) 268 - #define MISC_PCIE_INT_STATUS(x) MISC_MEM_MAP(0x97C + (x) * 0x100) 269 - 270 - /* 271 - * Power management and clock control 272 - */ 273 - #define PMU_MEM_MAP(offs) (void __iomem *)(CNS3XXX_PM_BASE_VIRT + (offs)) 274 - 275 - #define PM_CLK_GATE_REG PMU_MEM_MAP(0x000) 276 - #define PM_SOFT_RST_REG PMU_MEM_MAP(0x004) 277 - #define PM_HS_CFG_REG PMU_MEM_MAP(0x008) 278 - #define PM_CACTIVE_STA_REG PMU_MEM_MAP(0x00C) 279 - #define PM_PWR_STA_REG PMU_MEM_MAP(0x010) 280 - #define PM_CLK_CTRL_REG PMU_MEM_MAP(0x014) 281 - #define PM_PLL_LCD_I2S_CTRL_REG PMU_MEM_MAP(0x018) 282 - #define PM_PLL_HM_PD_CTRL_REG PMU_MEM_MAP(0x01C) 283 - #define PM_REGULAT_CTRL_REG PMU_MEM_MAP(0x020) 284 - #define PM_WDT_CTRL_REG PMU_MEM_MAP(0x024) 285 - #define PM_WU_CTRL0_REG PMU_MEM_MAP(0x028) 286 - #define PM_WU_CTRL1_REG PMU_MEM_MAP(0x02C) 287 - #define PM_CSR_REG PMU_MEM_MAP(0x030) 288 - 289 - /* PM_CLK_GATE_REG */ 290 - #define PM_CLK_GATE_REG_OFFSET_SDIO (25) 291 - #define PM_CLK_GATE_REG_OFFSET_GPU (24) 292 - #define PM_CLK_GATE_REG_OFFSET_CIM (23) 293 - #define PM_CLK_GATE_REG_OFFSET_LCDC (22) 294 - #define PM_CLK_GATE_REG_OFFSET_I2S (21) 295 - #define PM_CLK_GATE_REG_OFFSET_RAID (20) 296 - #define PM_CLK_GATE_REG_OFFSET_SATA (19) 297 - #define PM_CLK_GATE_REG_OFFSET_PCIE(x) (17 + (x)) 298 - #define PM_CLK_GATE_REG_OFFSET_USB_HOST (16) 299 - #define PM_CLK_GATE_REG_OFFSET_USB_OTG (15) 300 - #define PM_CLK_GATE_REG_OFFSET_TIMER (14) 301 - #define PM_CLK_GATE_REG_OFFSET_CRYPTO (13) 302 - #define PM_CLK_GATE_REG_OFFSET_HCIE (12) 303 - #define PM_CLK_GATE_REG_OFFSET_SWITCH (11) 304 - #define PM_CLK_GATE_REG_OFFSET_GPIO (10) 305 - #define PM_CLK_GATE_REG_OFFSET_UART3 (9) 306 - #define PM_CLK_GATE_REG_OFFSET_UART2 (8) 307 - #define PM_CLK_GATE_REG_OFFSET_UART1 (7) 308 - #define PM_CLK_GATE_REG_OFFSET_RTC (5) 309 - #define PM_CLK_GATE_REG_OFFSET_GDMA (4) 310 - #define PM_CLK_GATE_REG_OFFSET_SPI_PCM_I2C (3) 311 - #define PM_CLK_GATE_REG_OFFSET_SMC_NFI (1) 312 - #define PM_CLK_GATE_REG_MASK (0x03FFFFBA) 313 - 314 - /* PM_SOFT_RST_REG */ 315 - #define PM_SOFT_RST_REG_OFFST_WARM_RST_FLAG (31) 316 - #define PM_SOFT_RST_REG_OFFST_CPU1 (29) 317 - #define PM_SOFT_RST_REG_OFFST_CPU0 (28) 318 - #define PM_SOFT_RST_REG_OFFST_SDIO (25) 319 - #define PM_SOFT_RST_REG_OFFST_GPU (24) 320 - #define PM_SOFT_RST_REG_OFFST_CIM (23) 321 - #define PM_SOFT_RST_REG_OFFST_LCDC (22) 322 - #define PM_SOFT_RST_REG_OFFST_I2S (21) 323 - #define PM_SOFT_RST_REG_OFFST_RAID (20) 324 - #define PM_SOFT_RST_REG_OFFST_SATA (19) 325 - #define PM_SOFT_RST_REG_OFFST_PCIE(x) (17 + (x)) 326 - #define PM_SOFT_RST_REG_OFFST_USB_HOST (16) 327 - #define PM_SOFT_RST_REG_OFFST_USB_OTG (15) 328 - #define PM_SOFT_RST_REG_OFFST_TIMER (14) 329 - #define PM_SOFT_RST_REG_OFFST_CRYPTO (13) 330 - #define PM_SOFT_RST_REG_OFFST_HCIE (12) 331 - #define PM_SOFT_RST_REG_OFFST_SWITCH (11) 332 - #define PM_SOFT_RST_REG_OFFST_GPIO (10) 333 - #define PM_SOFT_RST_REG_OFFST_UART3 (9) 334 - #define PM_SOFT_RST_REG_OFFST_UART2 (8) 335 - #define PM_SOFT_RST_REG_OFFST_UART1 (7) 336 - #define PM_SOFT_RST_REG_OFFST_RTC (5) 337 - #define PM_SOFT_RST_REG_OFFST_GDMA (4) 338 - #define PM_SOFT_RST_REG_OFFST_SPI_PCM_I2C (3) 339 - #define PM_SOFT_RST_REG_OFFST_DMC (2) 340 - #define PM_SOFT_RST_REG_OFFST_SMC_NFI (1) 341 - #define PM_SOFT_RST_REG_OFFST_GLOBAL (0) 342 - #define PM_SOFT_RST_REG_MASK (0xF3FFFFBF) 343 - 344 - /* PMHS_CFG_REG */ 345 - #define PM_HS_CFG_REG_OFFSET_SDIO (25) 346 - #define PM_HS_CFG_REG_OFFSET_GPU (24) 347 - #define PM_HS_CFG_REG_OFFSET_CIM (23) 348 - #define PM_HS_CFG_REG_OFFSET_LCDC (22) 349 - #define PM_HS_CFG_REG_OFFSET_I2S (21) 350 - #define PM_HS_CFG_REG_OFFSET_RAID (20) 351 - #define PM_HS_CFG_REG_OFFSET_SATA (19) 352 - #define PM_HS_CFG_REG_OFFSET_PCIE1 (18) 353 - #define PM_HS_CFG_REG_OFFSET_PCIE0 (17) 354 - #define PM_HS_CFG_REG_OFFSET_USB_HOST (16) 355 - #define PM_HS_CFG_REG_OFFSET_USB_OTG (15) 356 - #define PM_HS_CFG_REG_OFFSET_TIMER (14) 357 - #define PM_HS_CFG_REG_OFFSET_CRYPTO (13) 358 - #define PM_HS_CFG_REG_OFFSET_HCIE (12) 359 - #define PM_HS_CFG_REG_OFFSET_SWITCH (11) 360 - #define PM_HS_CFG_REG_OFFSET_GPIO (10) 361 - #define PM_HS_CFG_REG_OFFSET_UART3 (9) 362 - #define PM_HS_CFG_REG_OFFSET_UART2 (8) 363 - #define PM_HS_CFG_REG_OFFSET_UART1 (7) 364 - #define PM_HS_CFG_REG_OFFSET_RTC (5) 365 - #define PM_HS_CFG_REG_OFFSET_GDMA (4) 366 - #define PM_HS_CFG_REG_OFFSET_SPI_PCM_I2S (3) 367 - #define PM_HS_CFG_REG_OFFSET_DMC (2) 368 - #define PM_HS_CFG_REG_OFFSET_SMC_NFI (1) 369 - #define PM_HS_CFG_REG_MASK (0x03FFFFBE) 370 - #define PM_HS_CFG_REG_MASK_SUPPORT (0x01100806) 371 - 372 - /* PM_CACTIVE_STA_REG */ 373 - #define PM_CACTIVE_STA_REG_OFFSET_SDIO (25) 374 - #define PM_CACTIVE_STA_REG_OFFSET_GPU (24) 375 - #define PM_CACTIVE_STA_REG_OFFSET_CIM (23) 376 - #define PM_CACTIVE_STA_REG_OFFSET_LCDC (22) 377 - #define PM_CACTIVE_STA_REG_OFFSET_I2S (21) 378 - #define PM_CACTIVE_STA_REG_OFFSET_RAID (20) 379 - #define PM_CACTIVE_STA_REG_OFFSET_SATA (19) 380 - #define PM_CACTIVE_STA_REG_OFFSET_PCIE1 (18) 381 - #define PM_CACTIVE_STA_REG_OFFSET_PCIE0 (17) 382 - #define PM_CACTIVE_STA_REG_OFFSET_USB_HOST (16) 383 - #define PM_CACTIVE_STA_REG_OFFSET_USB_OTG (15) 384 - #define PM_CACTIVE_STA_REG_OFFSET_TIMER (14) 385 - #define PM_CACTIVE_STA_REG_OFFSET_CRYPTO (13) 386 - #define PM_CACTIVE_STA_REG_OFFSET_HCIE (12) 387 - #define PM_CACTIVE_STA_REG_OFFSET_SWITCH (11) 388 - #define PM_CACTIVE_STA_REG_OFFSET_GPIO (10) 389 - #define PM_CACTIVE_STA_REG_OFFSET_UART3 (9) 390 - #define PM_CACTIVE_STA_REG_OFFSET_UART2 (8) 391 - #define PM_CACTIVE_STA_REG_OFFSET_UART1 (7) 392 - #define PM_CACTIVE_STA_REG_OFFSET_RTC (5) 393 - #define PM_CACTIVE_STA_REG_OFFSET_GDMA (4) 394 - #define PM_CACTIVE_STA_REG_OFFSET_SPI_PCM_I2S (3) 395 - #define PM_CACTIVE_STA_REG_OFFSET_DMC (2) 396 - #define PM_CACTIVE_STA_REG_OFFSET_SMC_NFI (1) 397 - #define PM_CACTIVE_STA_REG_MASK (0x03FFFFBE) 398 - 399 - /* PM_PWR_STA_REG */ 400 - #define PM_PWR_STA_REG_REG_OFFSET_SDIO (25) 401 - #define PM_PWR_STA_REG_REG_OFFSET_GPU (24) 402 - #define PM_PWR_STA_REG_REG_OFFSET_CIM (23) 403 - #define PM_PWR_STA_REG_REG_OFFSET_LCDC (22) 404 - #define PM_PWR_STA_REG_REG_OFFSET_I2S (21) 405 - #define PM_PWR_STA_REG_REG_OFFSET_RAID (20) 406 - #define PM_PWR_STA_REG_REG_OFFSET_SATA (19) 407 - #define PM_PWR_STA_REG_REG_OFFSET_PCIE1 (18) 408 - #define PM_PWR_STA_REG_REG_OFFSET_PCIE0 (17) 409 - #define PM_PWR_STA_REG_REG_OFFSET_USB_HOST (16) 410 - #define PM_PWR_STA_REG_REG_OFFSET_USB_OTG (15) 411 - #define PM_PWR_STA_REG_REG_OFFSET_TIMER (14) 412 - #define PM_PWR_STA_REG_REG_OFFSET_CRYPTO (13) 413 - #define PM_PWR_STA_REG_REG_OFFSET_HCIE (12) 414 - #define PM_PWR_STA_REG_REG_OFFSET_SWITCH (11) 415 - #define PM_PWR_STA_REG_REG_OFFSET_GPIO (10) 416 - #define PM_PWR_STA_REG_REG_OFFSET_UART3 (9) 417 - #define PM_PWR_STA_REG_REG_OFFSET_UART2 (8) 418 - #define PM_PWR_STA_REG_REG_OFFSET_UART1 (7) 419 - #define PM_PWR_STA_REG_REG_OFFSET_RTC (5) 420 - #define PM_PWR_STA_REG_REG_OFFSET_GDMA (4) 421 - #define PM_PWR_STA_REG_REG_OFFSET_SPI_PCM_I2S (3) 422 - #define PM_PWR_STA_REG_REG_OFFSET_DMC (2) 423 - #define PM_PWR_STA_REG_REG_OFFSET_SMC_NFI (1) 424 - #define PM_PWR_STA_REG_REG_MASK (0x03FFFFBE) 425 - 426 - /* PM_CLK_CTRL_REG */ 427 - #define PM_CLK_CTRL_REG_OFFSET_I2S_MCLK (31) 428 - #define PM_CLK_CTRL_REG_OFFSET_DDR2_CHG_EN (30) 429 - #define PM_CLK_CTRL_REG_OFFSET_PCIE_REF1_EN (29) 430 - #define PM_CLK_CTRL_REG_OFFSET_PCIE_REF0_EN (28) 431 - #define PM_CLK_CTRL_REG_OFFSET_TIMER_SIM_MODE (27) 432 - #define PM_CLK_CTRL_REG_OFFSET_I2SCLK_DIV (24) 433 - #define PM_CLK_CTRL_REG_OFFSET_I2SCLK_SEL (22) 434 - #define PM_CLK_CTRL_REG_OFFSET_CLKOUT_DIV (20) 435 - #define PM_CLK_CTRL_REG_OFFSET_CLKOUT_SEL (16) 436 - #define PM_CLK_CTRL_REG_OFFSET_MDC_DIV (14) 437 - #define PM_CLK_CTRL_REG_OFFSET_CRYPTO_CLK_SEL (12) 438 - #define PM_CLK_CTRL_REG_OFFSET_CPU_PWR_MODE (9) 439 - #define PM_CLK_CTRL_REG_OFFSET_PLL_DDR2_SEL (7) 440 - #define PM_CLK_CTRL_REG_OFFSET_DIV_IMMEDIATE (6) 441 - #define PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV (4) 442 - #define PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL (0) 443 - 444 - #define PM_CPU_CLK_DIV(DIV) { \ 445 - PM_CLK_CTRL_REG &= ~((0x3) << PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV); \ 446 - PM_CLK_CTRL_REG |= (((DIV)&0x3) << PM_CLK_CTRL_REG_OFFSET_CPU_CLK_DIV); \ 447 - } 448 - 449 - #define PM_PLL_CPU_SEL(CPU) { \ 450 - PM_CLK_CTRL_REG &= ~((0xF) << PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL); \ 451 - PM_CLK_CTRL_REG |= (((CPU)&0xF) << PM_CLK_CTRL_REG_OFFSET_PLL_CPU_SEL); \ 452 - } 453 - 454 - /* PM_PLL_LCD_I2S_CTRL_REG */ 455 - #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_MCLK_SMC_DIV (22) 456 - #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_R_SEL (17) 457 - #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_P (11) 458 - #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_M (3) 459 - #define PM_PLL_LCD_I2S_CTRL_REG_OFFSET_PLL_LCD_S (0) 460 - 461 - /* PM_PLL_HM_PD_CTRL_REG */ 462 - #define PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY1 (11) 463 - #define PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY0 (10) 464 - #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_I2SCD (6) 465 - #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_I2S (5) 466 - #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_LCD (4) 467 - #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB (3) 468 - #define PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_RGMII (2) 469 - #define PM_PLL_HM_PD_CTRL_REG_MASK (0x00000C7C) 470 - 471 - /* PM_WDT_CTRL_REG */ 472 - #define PM_WDT_CTRL_REG_OFFSET_RESET_CPU_ONLY (0) 473 - 474 - /* PM_CSR_REG - Clock Scaling Register*/ 475 - #define PM_CSR_REG_OFFSET_CSR_EN (30) 476 - #define PM_CSR_REG_OFFSET_CSR_NUM (0) 477 - 478 - #define CNS3XXX_PWR_CLK_EN(BLOCK) (0x1<<PM_CLK_GATE_REG_OFFSET_##BLOCK) 479 - 480 - /* Software reset*/ 481 - #define CNS3XXX_PWR_SOFTWARE_RST(BLOCK) (0x1<<PM_SOFT_RST_REG_OFFST_##BLOCK) 482 - 483 - /* 484 - * CNS3XXX support several power saving mode as following, 485 - * DFS, IDLE, HALT, DOZE, SLEEP, Hibernate 486 - */ 487 - #define CNS3XXX_PWR_CPU_MODE_DFS (0) 488 - #define CNS3XXX_PWR_CPU_MODE_IDLE (1) 489 - #define CNS3XXX_PWR_CPU_MODE_HALT (2) 490 - #define CNS3XXX_PWR_CPU_MODE_DOZE (3) 491 - #define CNS3XXX_PWR_CPU_MODE_SLEEP (4) 492 - #define CNS3XXX_PWR_CPU_MODE_HIBERNATE (5) 493 - 494 - #define CNS3XXX_PWR_PLL(BLOCK) (0x1<<PM_PLL_HM_PD_CTRL_REG_OFFSET_##BLOCK) 495 - #define CNS3XXX_PWR_PLL_ALL PM_PLL_HM_PD_CTRL_REG_MASK 496 - 497 - /* Change CPU frequency and divider */ 498 - #define CNS3XXX_PWR_PLL_CPU_300MHZ (0) 499 - #define CNS3XXX_PWR_PLL_CPU_333MHZ (1) 500 - #define CNS3XXX_PWR_PLL_CPU_366MHZ (2) 501 - #define CNS3XXX_PWR_PLL_CPU_400MHZ (3) 502 - #define CNS3XXX_PWR_PLL_CPU_433MHZ (4) 503 - #define CNS3XXX_PWR_PLL_CPU_466MHZ (5) 504 - #define CNS3XXX_PWR_PLL_CPU_500MHZ (6) 505 - #define CNS3XXX_PWR_PLL_CPU_533MHZ (7) 506 - #define CNS3XXX_PWR_PLL_CPU_566MHZ (8) 507 - #define CNS3XXX_PWR_PLL_CPU_600MHZ (9) 508 - #define CNS3XXX_PWR_PLL_CPU_633MHZ (10) 509 - #define CNS3XXX_PWR_PLL_CPU_666MHZ (11) 510 - #define CNS3XXX_PWR_PLL_CPU_700MHZ (12) 511 - 512 - #define CNS3XXX_PWR_CPU_CLK_DIV_BY1 (0) 513 - #define CNS3XXX_PWR_CPU_CLK_DIV_BY2 (1) 514 - #define CNS3XXX_PWR_CPU_CLK_DIV_BY4 (2) 515 - 516 - /* Change DDR2 frequency */ 517 - #define CNS3XXX_PWR_PLL_DDR2_200MHZ (0) 518 - #define CNS3XXX_PWR_PLL_DDR2_266MHZ (1) 519 - #define CNS3XXX_PWR_PLL_DDR2_333MHZ (2) 520 - #define CNS3XXX_PWR_PLL_DDR2_400MHZ (3) 521 - 522 - void cns3xxx_pwr_soft_rst(unsigned int block); 523 - void cns3xxx_pwr_clk_en(unsigned int block); 524 - int cns3xxx_cpu_clock(void); 525 - 526 - /* 527 - * ARM11 MPCore interrupt sources (primary GIC) 528 - */ 529 - #define IRQ_CNS3XXX_PMU (IRQ_TC11MP_GIC_START + 0) 530 - #define IRQ_CNS3XXX_SDIO (IRQ_TC11MP_GIC_START + 1) 531 - #define IRQ_CNS3XXX_L2CC (IRQ_TC11MP_GIC_START + 2) 532 - #define IRQ_CNS3XXX_RTC (IRQ_TC11MP_GIC_START + 3) 533 - #define IRQ_CNS3XXX_I2S (IRQ_TC11MP_GIC_START + 4) 534 - #define IRQ_CNS3XXX_PCM (IRQ_TC11MP_GIC_START + 5) 535 - #define IRQ_CNS3XXX_SPI (IRQ_TC11MP_GIC_START + 6) 536 - #define IRQ_CNS3XXX_I2C (IRQ_TC11MP_GIC_START + 7) 537 - #define IRQ_CNS3XXX_CIM (IRQ_TC11MP_GIC_START + 8) 538 - #define IRQ_CNS3XXX_GPU (IRQ_TC11MP_GIC_START + 9) 539 - #define IRQ_CNS3XXX_LCD (IRQ_TC11MP_GIC_START + 10) 540 - #define IRQ_CNS3XXX_GPIOA (IRQ_TC11MP_GIC_START + 11) 541 - #define IRQ_CNS3XXX_GPIOB (IRQ_TC11MP_GIC_START + 12) 542 - #define IRQ_CNS3XXX_UART0 (IRQ_TC11MP_GIC_START + 13) 543 - #define IRQ_CNS3XXX_UART1 (IRQ_TC11MP_GIC_START + 14) 544 - #define IRQ_CNS3XXX_UART2 (IRQ_TC11MP_GIC_START + 15) 545 - #define IRQ_CNS3XXX_ARM11 (IRQ_TC11MP_GIC_START + 16) 546 - 547 - #define IRQ_CNS3XXX_SW_STATUS (IRQ_TC11MP_GIC_START + 17) 548 - #define IRQ_CNS3XXX_SW_R0TXC (IRQ_TC11MP_GIC_START + 18) 549 - #define IRQ_CNS3XXX_SW_R0RXC (IRQ_TC11MP_GIC_START + 19) 550 - #define IRQ_CNS3XXX_SW_R0QE (IRQ_TC11MP_GIC_START + 20) 551 - #define IRQ_CNS3XXX_SW_R0QF (IRQ_TC11MP_GIC_START + 21) 552 - #define IRQ_CNS3XXX_SW_R1TXC (IRQ_TC11MP_GIC_START + 22) 553 - #define IRQ_CNS3XXX_SW_R1RXC (IRQ_TC11MP_GIC_START + 23) 554 - #define IRQ_CNS3XXX_SW_R1QE (IRQ_TC11MP_GIC_START + 24) 555 - #define IRQ_CNS3XXX_SW_R1QF (IRQ_TC11MP_GIC_START + 25) 556 - #define IRQ_CNS3XXX_SW_PPE (IRQ_TC11MP_GIC_START + 26) 557 - 558 - #define IRQ_CNS3XXX_CRYPTO (IRQ_TC11MP_GIC_START + 27) 559 - #define IRQ_CNS3XXX_HCIE (IRQ_TC11MP_GIC_START + 28) 560 - #define IRQ_CNS3XXX_PCIE0_DEVICE (IRQ_TC11MP_GIC_START + 29) 561 - #define IRQ_CNS3XXX_PCIE1_DEVICE (IRQ_TC11MP_GIC_START + 30) 562 - #define IRQ_CNS3XXX_USB_OTG (IRQ_TC11MP_GIC_START + 31) 563 - #define IRQ_CNS3XXX_USB_EHCI (IRQ_TC11MP_GIC_START + 32) 564 - #define IRQ_CNS3XXX_SATA (IRQ_TC11MP_GIC_START + 33) 565 - #define IRQ_CNS3XXX_RAID (IRQ_TC11MP_GIC_START + 34) 566 - #define IRQ_CNS3XXX_SMC (IRQ_TC11MP_GIC_START + 35) 567 - 568 - #define IRQ_CNS3XXX_DMAC_ABORT (IRQ_TC11MP_GIC_START + 36) 569 - #define IRQ_CNS3XXX_DMAC0 (IRQ_TC11MP_GIC_START + 37) 570 - #define IRQ_CNS3XXX_DMAC1 (IRQ_TC11MP_GIC_START + 38) 571 - #define IRQ_CNS3XXX_DMAC2 (IRQ_TC11MP_GIC_START + 39) 572 - #define IRQ_CNS3XXX_DMAC3 (IRQ_TC11MP_GIC_START + 40) 573 - #define IRQ_CNS3XXX_DMAC4 (IRQ_TC11MP_GIC_START + 41) 574 - #define IRQ_CNS3XXX_DMAC5 (IRQ_TC11MP_GIC_START + 42) 575 - #define IRQ_CNS3XXX_DMAC6 (IRQ_TC11MP_GIC_START + 43) 576 - #define IRQ_CNS3XXX_DMAC7 (IRQ_TC11MP_GIC_START + 44) 577 - #define IRQ_CNS3XXX_DMAC8 (IRQ_TC11MP_GIC_START + 45) 578 - #define IRQ_CNS3XXX_DMAC9 (IRQ_TC11MP_GIC_START + 46) 579 - #define IRQ_CNS3XXX_DMAC10 (IRQ_TC11MP_GIC_START + 47) 580 - #define IRQ_CNS3XXX_DMAC11 (IRQ_TC11MP_GIC_START + 48) 581 - #define IRQ_CNS3XXX_DMAC12 (IRQ_TC11MP_GIC_START + 49) 582 - #define IRQ_CNS3XXX_DMAC13 (IRQ_TC11MP_GIC_START + 50) 583 - #define IRQ_CNS3XXX_DMAC14 (IRQ_TC11MP_GIC_START + 51) 584 - #define IRQ_CNS3XXX_DMAC15 (IRQ_TC11MP_GIC_START + 52) 585 - #define IRQ_CNS3XXX_DMAC16 (IRQ_TC11MP_GIC_START + 53) 586 - #define IRQ_CNS3XXX_DMAC17 (IRQ_TC11MP_GIC_START + 54) 587 - 588 - #define IRQ_CNS3XXX_PCIE0_RC (IRQ_TC11MP_GIC_START + 55) 589 - #define IRQ_CNS3XXX_PCIE1_RC (IRQ_TC11MP_GIC_START + 56) 590 - #define IRQ_CNS3XXX_TIMER0 (IRQ_TC11MP_GIC_START + 57) 591 - #define IRQ_CNS3XXX_TIMER1 (IRQ_TC11MP_GIC_START + 58) 592 - #define IRQ_CNS3XXX_USB_OHCI (IRQ_TC11MP_GIC_START + 59) 593 - #define IRQ_CNS3XXX_TIMER2 (IRQ_TC11MP_GIC_START + 60) 594 - #define IRQ_CNS3XXX_EXTERNAL_PIN0 (IRQ_TC11MP_GIC_START + 61) 595 - #define IRQ_CNS3XXX_EXTERNAL_PIN1 (IRQ_TC11MP_GIC_START + 62) 596 - #define IRQ_CNS3XXX_EXTERNAL_PIN2 (IRQ_TC11MP_GIC_START + 63) 597 - 598 - #define NR_IRQS_CNS3XXX (IRQ_TC11MP_GIC_START + 64) 599 - 600 - #if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_CNS3XXX) 601 - #undef NR_IRQS 602 - #define NR_IRQS NR_IRQS_CNS3XXX 603 - #endif 604 - 605 - #endif /* __MACH_BOARD_CNS3XXX_H */
arch/arm/mach-cns3xxx/include/mach/debug-macro.S arch/arm/include/debug/cns3xxx.S
-24
arch/arm/mach-cns3xxx/include/mach/irqs.h
··· 1 - /* 2 - * Copyright 2000 Deep Blue Solutions Ltd. 3 - * Copyright 2003 ARM Limited 4 - * Copyright 2008 Cavium Networks 5 - * 6 - * This file is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License, Version 2, as 8 - * published by the Free Software Foundation. 9 - */ 10 - 11 - #ifndef __MACH_IRQS_H 12 - #define __MACH_IRQS_H 13 - 14 - #define IRQ_LOCALTIMER 29 15 - #define IRQ_LOCALWDOG 30 16 - #define IRQ_TC11MP_GIC_START 32 17 - 18 - #include <mach/cns3xxx.h> 19 - 20 - #ifndef NR_IRQS 21 - #error "NR_IRQS not defined by the board-specific files" 22 - #endif 23 - 24 - #endif
arch/arm/mach-cns3xxx/include/mach/pm.h arch/arm/mach-cns3xxx/pm.h
-12
arch/arm/mach-cns3xxx/include/mach/timex.h
··· 1 - /* 2 - * Cavium Networks architecture timex specifications 3 - * 4 - * Copyright 2003 ARM Limited 5 - * Copyright 2008 Cavium Networks 6 - * 7 - * This file is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License, Version 2, as 9 - * published by the Free Software Foundation. 10 - */ 11 - 12 - #define CLOCK_TICK_RATE (50000000 / 16)
-53
arch/arm/mach-cns3xxx/include/mach/uncompress.h
··· 1 - /* 2 - * Copyright 2003 ARM Limited 3 - * Copyright 2008 Cavium Networks 4 - * 5 - * This file is free software; you can redistribute it and/or modify 6 - * it under the terms of the GNU General Public License, Version 2, as 7 - * published by the Free Software Foundation. 8 - */ 9 - 10 - #include <asm/mach-types.h> 11 - #include <mach/cns3xxx.h> 12 - 13 - #define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) 14 - #define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c)) 15 - #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) 16 - #define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18)) 17 - 18 - /* 19 - * Return the UART base address 20 - */ 21 - static inline unsigned long get_uart_base(void) 22 - { 23 - if (machine_is_cns3420vb()) 24 - return CNS3XXX_UART0_BASE; 25 - else 26 - return 0; 27 - } 28 - 29 - /* 30 - * This does not append a newline 31 - */ 32 - static inline void putc(int c) 33 - { 34 - unsigned long base = get_uart_base(); 35 - 36 - while (AMBA_UART_FR(base) & (1 << 5)) 37 - barrier(); 38 - 39 - AMBA_UART_DR(base) = c; 40 - } 41 - 42 - static inline void flush(void) 43 - { 44 - unsigned long base = get_uart_base(); 45 - 46 - while (AMBA_UART_FR(base) & (1 << 3)) 47 - barrier(); 48 - } 49 - 50 - /* 51 - * nothing to do 52 - */ 53 - #define arch_decomp_setup()
+1 -1
arch/arm/mach-cns3xxx/pcie.c
··· 20 20 #include <linux/interrupt.h> 21 21 #include <linux/ptrace.h> 22 22 #include <asm/mach/map.h> 23 - #include <mach/cns3xxx.h> 23 + #include "cns3xxx.h" 24 24 #include "core.h" 25 25 26 26 enum cns3xxx_access_type {
+2 -2
arch/arm/mach-cns3xxx/pm.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/delay.h> 13 13 #include <linux/atomic.h> 14 - #include <mach/cns3xxx.h> 15 - #include <mach/pm.h> 14 + #include "cns3xxx.h" 15 + #include "pm.h" 16 16 #include "core.h" 17 17 18 18 void cns3xxx_pwr_clk_en(unsigned int block)
+17
arch/arm/mach-exynos/Kconfig
··· 14 14 config ARCH_EXYNOS4 15 15 bool "SAMSUNG EXYNOS4" 16 16 default y 17 + select HAVE_ARM_SCU if SMP 17 18 select HAVE_SMP 18 19 select MIGHT_HAVE_CACHE_L2X0 19 20 help ··· 22 21 23 22 config ARCH_EXYNOS5 24 23 bool "SAMSUNG EXYNOS5" 24 + select HAVE_ARM_SCU if SMP 25 25 select HAVE_SMP 26 26 help 27 27 Samsung EXYNOS5 (Cortex-A15) SoC based systems ··· 88 86 default y 89 87 help 90 88 Use MCT (Multi Core Timer) as kernel timers 89 + 90 + config EXYNOS_ATAGS 91 + bool "ATAGS based boot for EXYNOS (deprecated)" 92 + depends on !ARCH_MULTIPLATFORM 93 + depends on ATAGS 94 + default y 95 + help 96 + The EXYNOS platform is moving towards being completely probed 97 + through device tree. This enables support for board files using 98 + the traditional ATAGS boot format. 99 + Note that this option is not available for multiplatform builds. 100 + 101 + if EXYNOS_ATAGS 91 102 92 103 config EXYNOS_DEV_DMA 93 104 bool ··· 404 389 select SOC_EXYNOS4412 405 390 help 406 391 Machine support for Samsung SMDK4412 392 + endif 393 + 407 394 endif 408 395 409 396 comment "Flattened Device Tree based board for EXYNOS SoCs"
+1
arch/arm/mach-exynos/dev-uart.c
··· 20 20 #include <asm/mach/irq.h> 21 21 #include <mach/hardware.h> 22 22 #include <mach/map.h> 23 + #include <mach/irqs.h> 23 24 24 25 #include <plat/devs.h> 25 26
-39
arch/arm/mach-exynos/include/mach/debug-macro.S
··· 1 - /* linux/arch/arm/mach-exynos4/include/mach/debug-macro.S 2 - * 3 - * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 4 - * http://www.samsung.com 5 - * 6 - * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S 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 - /* pull in the relevant register and map files. */ 14 - 15 - #include <mach/map.h> 16 - 17 - /* note, for the boot process to work we have to keep the UART 18 - * virtual address aligned to an 1MiB boundary for the L1 19 - * mapping the head code makes. We keep the UART virtual address 20 - * aligned and add in the offset when we load the value here. 21 - */ 22 - 23 - .macro addruart, rp, rv, tmp 24 - mrc p15, 0, \tmp, c0, c0, 0 25 - and \tmp, \tmp, #0xf0 26 - teq \tmp, #0xf0 @@ A15 27 - ldreq \rp, =EXYNOS5_PA_UART 28 - movne \rp, #EXYNOS4_PA_UART @@ EXYNOS4 29 - ldr \rv, =S3C_VA_UART 30 - #if CONFIG_DEBUG_S3C_UART != 0 31 - add \rp, \rp, #(0x10000 * CONFIG_DEBUG_S3C_UART) 32 - add \rv, \rv, #(0x10000 * CONFIG_DEBUG_S3C_UART) 33 - #endif 34 - .endm 35 - 36 - #define fifo_full fifo_full_s5pv210 37 - #define fifo_level fifo_level_s5pv210 38 - 39 - #include <plat/debug-macro.S>
+4 -1
arch/arm/mach-exynos/include/mach/irqs.h
··· 466 466 #define IRQ_TIMER_BASE (IRQ_GPIO_END + 64) 467 467 468 468 /* Set the default NR_IRQS */ 469 + #define EXYNOS_NR_IRQS (IRQ_TIMER_BASE + IRQ_TIMER_COUNT) 469 470 470 - #define NR_IRQS (IRQ_TIMER_BASE + IRQ_TIMER_COUNT) 471 + #ifndef CONFIG_SPARSE_IRQ 472 + #define NR_IRQS EXYNOS_NR_IRQS 473 + #endif 471 474 472 475 #endif /* __ASM_ARCH_IRQS_H */
+1
arch/arm/mach-exynos/mach-armlex4210.c
··· 25 25 #include <plat/regs-srom.h> 26 26 #include <plat/sdhci.h> 27 27 28 + #include <mach/irqs.h> 28 29 #include <mach/map.h> 29 30 30 31 #include "common.h"
+1
arch/arm/mach-exynos/mach-nuri.c
··· 53 53 #include <plat/fimc-core.h> 54 54 #include <plat/camport.h> 55 55 56 + #include <mach/irqs.h> 56 57 #include <mach/map.h> 57 58 58 59 #include "common.h"
+1
arch/arm/mach-exynos/mach-origen.c
··· 46 46 #include <plat/hdmi.h> 47 47 48 48 #include <mach/map.h> 49 + #include <mach/irqs.h> 49 50 50 51 #include <drm/exynos_drm.h> 51 52 #include "common.h"
+1
arch/arm/mach-exynos/mach-smdk4x12.c
··· 39 39 #include <plat/regs-serial.h> 40 40 #include <plat/sdhci.h> 41 41 42 + #include <mach/irqs.h> 42 43 #include <mach/map.h> 43 44 44 45 #include <drm/exynos_drm.h>
+1
arch/arm/mach-exynos/mach-smdkv310.c
··· 43 43 #include <plat/clock.h> 44 44 #include <plat/hdmi.h> 45 45 46 + #include <mach/irqs.h> 46 47 #include <mach/map.h> 47 48 48 49 #include <drm/exynos_drm.h>
+1 -1
arch/arm/mach-exynos/setup-sdhci-gpio.c
··· 19 19 #include <linux/mmc/host.h> 20 20 #include <linux/mmc/card.h> 21 21 22 + #include <mach/gpio.h> 22 23 #include <plat/gpio-cfg.h> 23 - #include <plat/regs-sdhci.h> 24 24 #include <plat/sdhci.h> 25 25 26 26 void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
+1
arch/arm/mach-highbank/Kconfig
··· 12 12 select CPU_V7 13 13 select GENERIC_CLOCKEVENTS 14 14 select HAVE_ARM_SCU 15 + select HAVE_ARM_TWD if LOCAL_TIMERS 15 16 select HAVE_SMP 16 17 select MAILBOX 17 18 select PL320_MBOX
+2 -1
arch/arm/mach-imx/Kconfig
··· 795 795 select ARM_GIC 796 796 select COMMON_CLK 797 797 select CPU_V7 798 - select HAVE_ARM_SCU 798 + select HAVE_ARM_SCU if SMP 799 + select HAVE_ARM_TWD if LOCAL_TIMERS 799 800 select HAVE_CAN_FLEXCAN if CAN 800 801 select HAVE_IMX_GPC 801 802 select HAVE_IMX_MMDC
+2 -5
arch/arm/mach-msm/Kconfig
··· 44 44 45 45 config ARCH_MSM8X60 46 46 bool "MSM8X60" 47 - select ARCH_MSM_SCORPIONMP 48 47 select ARM_GIC 49 48 select CPU_V7 50 49 select GPIO_MSM_V2 50 + select HAVE_SMP 51 51 select MSM_GPIOMUX 52 52 select MSM_SCM if SMP 53 53 select MSM_V2_TLMM ··· 55 55 56 56 config ARCH_MSM8960 57 57 bool "MSM8960" 58 - select ARCH_MSM_SCORPIONMP 59 58 select ARM_GIC 60 59 select CPU_V7 60 + select HAVE_SMP 61 61 select MSM_GPIOMUX 62 62 select MSM_SCM if SMP 63 63 select MSM_V2_TLMM ··· 68 68 69 69 config MSM_SOC_REV_A 70 70 bool 71 - config ARCH_MSM_SCORPIONMP 72 - bool 73 - select HAVE_SMP 74 71 75 72 config ARCH_MSM_ARM11 76 73 bool
+12 -10
arch/arm/mach-mxs/Kconfig
··· 1 - if ARCH_MXS 2 - 3 1 config SOC_IMX23 4 2 bool 5 3 select ARM_AMBA ··· 15 17 select HAVE_PWM 16 18 select PINCTRL_IMX28 17 19 18 - comment "MXS platforms:" 19 - 20 - config MACH_MXS_DT 21 - bool "Support MXS platforms from device tree" 20 + config ARCH_MXS 21 + bool "Freescale MXS (i.MX23, i.MX28) support" 22 + depends on ARCH_MULTI_V5 23 + select ARCH_REQUIRE_GPIOLIB 24 + select CLKDEV_LOOKUP 25 + select CLKSRC_MMIO 26 + select CLKSRC_OF 27 + select GENERIC_CLOCKEVENTS 28 + select HAVE_CLK_PREPARE 29 + select PINCTRL 22 30 select SOC_IMX23 23 31 select SOC_IMX28 32 + select STMP_DEVICE 24 33 help 25 - Include support for Freescale MXS platforms(i.MX23 and i.MX28) 26 - using the device tree for discovery 27 - 28 - endif 34 + Support for Freescale MXS-based family of processors
+1 -1
arch/arm/mach-mxs/Makefile
··· 1 1 obj-$(CONFIG_PM) += pm.o 2 - obj-$(CONFIG_MACH_MXS_DT) += mach-mxs.o 2 + obj-$(CONFIG_ARCH_MXS) += mach-mxs.o
-1
arch/arm/mach-mxs/Makefile.boot
··· 1 - zreladdr-y += 0x40008000
arch/arm/mach-mxs/include/mach/debug-macro.S arch/arm/include/debug/mxs.S
-21
arch/arm/mach-mxs/include/mach/timex.h
··· 1 - /* 2 - * Copyright (C) 1999 ARM Limited 3 - * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. 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 - 16 - #ifndef __MACH_MXS_TIMEX_H__ 17 - #define __MACH_MXS_TIMEX_H__ 18 - 19 - #define CLOCK_TICK_RATE 32000 /* 32K */ 20 - 21 - #endif /* __MACH_MXS_TIMEX_H__ */
-76
arch/arm/mach-mxs/include/mach/uncompress.h
··· 1 - /* 2 - * arch/arm/mach-mxs/include/mach/uncompress.h 3 - * 4 - * Copyright (C) 1999 ARM Limited 5 - * Copyright (C) Shane Nay (shane@minirl.com) 6 - * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. 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 - #ifndef __MACH_MXS_UNCOMPRESS_H__ 19 - #define __MACH_MXS_UNCOMPRESS_H__ 20 - 21 - unsigned long mxs_duart_base; 22 - 23 - #define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x))) 24 - 25 - #define MXS_DUART_DR 0x00 26 - #define MXS_DUART_FR 0x18 27 - #define MXS_DUART_FR_TXFE (1 << 7) 28 - #define MXS_DUART_CR 0x30 29 - #define MXS_DUART_CR_UARTEN (1 << 0) 30 - 31 - /* 32 - * The following code assumes the serial port has already been 33 - * initialized by the bootloader. If it's not, the output is 34 - * simply discarded. 35 - */ 36 - 37 - static void putc(int ch) 38 - { 39 - if (!mxs_duart_base) 40 - return; 41 - if (!(MXS_DUART(MXS_DUART_CR) & MXS_DUART_CR_UARTEN)) 42 - return; 43 - 44 - while (!(MXS_DUART(MXS_DUART_FR) & MXS_DUART_FR_TXFE)) 45 - barrier(); 46 - 47 - MXS_DUART(MXS_DUART_DR) = ch; 48 - } 49 - 50 - static inline void flush(void) 51 - { 52 - } 53 - 54 - #define MX23_DUART_BASE_ADDR 0x80070000 55 - #define MX28_DUART_BASE_ADDR 0x80074000 56 - #define MXS_DIGCTL_CHIPID 0x8001c310 57 - 58 - static inline void __arch_decomp_setup(unsigned long arch_id) 59 - { 60 - u16 chipid = (*(volatile unsigned long *) MXS_DIGCTL_CHIPID) >> 16; 61 - 62 - switch (chipid) { 63 - case 0x3780: 64 - mxs_duart_base = MX23_DUART_BASE_ADDR; 65 - break; 66 - case 0x2800: 67 - mxs_duart_base = MX28_DUART_BASE_ADDR; 68 - break; 69 - default: 70 - break; 71 - } 72 - } 73 - 74 - #define arch_decomp_setup() __arch_decomp_setup(arch_id) 75 - 76 - #endif /* __MACH_MXS_UNCOMPRESS_H__ */
+3
arch/arm/mach-mxs/mach-mxs.c
··· 32 32 #include <asm/mach/time.h> 33 33 #include <asm/system_misc.h> 34 34 35 + #include "pm.h" 36 + 35 37 /* MXS DIGCTL SAIF CLKMUX */ 36 38 #define MXS_DIGCTL_SAIF_CLKMUX_DIRECT 0x0 37 39 #define MXS_DIGCTL_SAIF_CLKMUX_CROSSINPUT 0x1 ··· 609 607 .handle_irq = icoll_handle_irq, 610 608 .init_time = mxs_timer_init, 611 609 .init_machine = mxs_machine_init, 610 + .init_late = mxs_pm_init, 612 611 .dt_compat = mxs_dt_compat, 613 612 .restart = mxs_restart, 614 613 MACHINE_END
+1 -3
arch/arm/mach-mxs/pm.c
··· 34 34 .valid = suspend_valid_only_mem, 35 35 }; 36 36 37 - static int __init mxs_pm_init(void) 37 + void __init mxs_pm_init(void) 38 38 { 39 39 suspend_set_ops(&mxs_suspend_ops); 40 - return 0; 41 40 } 42 - device_initcall(mxs_pm_init);
+14
arch/arm/mach-mxs/pm.h
··· 1 + /* 2 + * Copyright (C) 2013 Freescale Semiconductor, Inc. 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #ifndef __ARCH_MXS_PM_H 10 + #define __ARCH_MXS_PM_H 11 + 12 + void mxs_pm_init(void); 13 + 14 + #endif
+22 -3
arch/arm/mach-nomadik/Kconfig
··· 1 - if ARCH_NOMADIK 1 + config ARCH_NOMADIK 2 + bool "ST-Ericsson Nomadik" 3 + depends on ARCH_MULTI_V5 4 + select ARCH_REQUIRE_GPIOLIB 5 + select ARM_AMBA 6 + select ARM_VIC 7 + select CLKSRC_NOMADIK_MTU 8 + select CLKSRC_NOMADIK_MTU_SCHED_CLOCK 9 + select COMMON_CLK 10 + select CPU_ARM926T 11 + select GENERIC_CLOCKEVENTS 12 + select MIGHT_HAVE_CACHE_L2X0 13 + select PINCTRL 14 + select PINCTRL_NOMADIK 15 + select PINCTRL_STN8815 16 + select SPARSE_IRQ 17 + select USE_OF 18 + help 19 + Support for the Nomadik platform by ST-Ericsson 2 20 21 + if ARCH_NOMADIK 3 22 menu "Nomadik boards" 4 23 5 24 config MACH_NOMADIK_8815NHK ··· 28 9 select I2C_ALGOBIT 29 10 30 11 endmenu 12 + endif 31 13 32 14 config NOMADIK_8815 15 + depends on ARCH_NOMADIK 33 16 bool 34 - 35 - endif
-4
arch/arm/mach-nomadik/Makefile.boot
··· 1 - zreladdr-y += 0x00008000 2 - params_phys-y := 0x00000100 3 - initrd_phys-y := 0x00800000 4 -
-1
arch/arm/mach-nomadik/cpu-8815.c
··· 38 38 #include <linux/gpio.h> 39 39 #include <linux/amba/mmci.h> 40 40 41 - #include <mach/irqs.h> 42 41 #include <asm/mach/arch.h> 43 42 #include <asm/mach/map.h> 44 43 #include <asm/mach/time.h>
arch/arm/mach-nomadik/include/mach/debug-macro.S arch/arm/include/debug/nomadik.S
-79
arch/arm/mach-nomadik/include/mach/irqs.h
··· 1 - /* 2 - * mach-nomadik/include/mach/irqs.h 3 - * 4 - * Copyright (C) ST Microelectronics 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_IRQS_H 21 - #define __ASM_ARCH_IRQS_H 22 - 23 - #define IRQ_VIC_START 32 /* first VIC interrupt is 1 */ 24 - 25 - /* 26 - * Interrupt numbers generic for all Nomadik Chip cuts 27 - */ 28 - #define IRQ_WATCHDOG (IRQ_VIC_START+0) 29 - #define IRQ_SOFTINT (IRQ_VIC_START+1) 30 - #define IRQ_CRYPTO (IRQ_VIC_START+2) 31 - #define IRQ_OWM (IRQ_VIC_START+3) 32 - #define IRQ_MTU0 (IRQ_VIC_START+4) 33 - #define IRQ_MTU1 (IRQ_VIC_START+5) 34 - #define IRQ_GPIO0 (IRQ_VIC_START+6) 35 - #define IRQ_GPIO1 (IRQ_VIC_START+7) 36 - #define IRQ_GPIO2 (IRQ_VIC_START+8) 37 - #define IRQ_GPIO3 (IRQ_VIC_START+9) 38 - #define IRQ_RTC_RTT (IRQ_VIC_START+10) 39 - #define IRQ_SSP (IRQ_VIC_START+11) 40 - #define IRQ_UART0 (IRQ_VIC_START+12) 41 - #define IRQ_DMA1 (IRQ_VIC_START+13) 42 - #define IRQ_CLCD_MDIF (IRQ_VIC_START+14) 43 - #define IRQ_DMA0 (IRQ_VIC_START+15) 44 - #define IRQ_PWRFAIL (IRQ_VIC_START+16) 45 - #define IRQ_UART1 (IRQ_VIC_START+17) 46 - #define IRQ_FIRDA (IRQ_VIC_START+18) 47 - #define IRQ_MSP0 (IRQ_VIC_START+19) 48 - #define IRQ_I2C0 (IRQ_VIC_START+20) 49 - #define IRQ_I2C1 (IRQ_VIC_START+21) 50 - #define IRQ_SDMMC (IRQ_VIC_START+22) 51 - #define IRQ_USBOTG (IRQ_VIC_START+23) 52 - #define IRQ_SVA_IT0 (IRQ_VIC_START+24) 53 - #define IRQ_SVA_IT1 (IRQ_VIC_START+25) 54 - #define IRQ_SAA_IT0 (IRQ_VIC_START+26) 55 - #define IRQ_SAA_IT1 (IRQ_VIC_START+27) 56 - #define IRQ_UART2 (IRQ_VIC_START+28) 57 - #define IRQ_MSP2 (IRQ_VIC_START+29) 58 - #define IRQ_L2CC (IRQ_VIC_START+30) 59 - #define IRQ_HPI (IRQ_VIC_START+31) 60 - #define IRQ_SKE (IRQ_VIC_START+32) 61 - #define IRQ_KP (IRQ_VIC_START+33) 62 - #define IRQ_MEMST (IRQ_VIC_START+34) 63 - #define IRQ_SGA_IT (IRQ_VIC_START+35) 64 - #define IRQ_USBM (IRQ_VIC_START+36) 65 - #define IRQ_MSP1 (IRQ_VIC_START+37) 66 - 67 - #define NOMADIK_GPIO_OFFSET (IRQ_VIC_START+64) 68 - 69 - /* After chip-specific IRQ numbers we have the GPIO ones */ 70 - #define NOMADIK_NR_GPIO 128 /* last 4 not wired to pins */ 71 - #define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + NOMADIK_GPIO_OFFSET) 72 - #define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - NOMADIK_GPIO_OFFSET) 73 - #define NOMADIK_NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) 74 - 75 - /* Following two are used by entry_macro.S, to access our dual-vic */ 76 - #define VIC_REG_IRQSR0 0 77 - #define VIC_REG_IRQSR1 0x20 78 - 79 - #endif /* __ASM_ARCH_IRQS_H */
-6
arch/arm/mach-nomadik/include/mach/timex.h
··· 1 - #ifndef __ASM_ARCH_TIMEX_H 2 - #define __ASM_ARCH_TIMEX_H 3 - 4 - #define CLOCK_TICK_RATE 2400000 5 - 6 - #endif
-60
arch/arm/mach-nomadik/include/mach/uncompress.h
··· 1 - /* 2 - * Copyright (C) 2008 STMicroelectronics 3 - * 4 - * This program is free software; you can redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; either version 2 of the License, or 7 - * (at your option) any later version. 8 - * 9 - * This program is distributed in the hope that it will be useful, 10 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - * GNU General Public License for more details. 13 - * 14 - * You should have received a copy of the GNU General Public License 15 - * along with this program; if not, write to the Free Software 16 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 - */ 18 - 19 - #ifndef __ASM_ARCH_UNCOMPRESS_H 20 - #define __ASM_ARCH_UNCOMPRESS_H 21 - 22 - #include <asm/setup.h> 23 - #include <asm/io.h> 24 - 25 - /* we need the constants in amba/serial.h, but it refers to amba_device */ 26 - struct amba_device; 27 - #include <linux/amba/serial.h> 28 - 29 - #define NOMADIK_UART_DR (void __iomem *)0x101FB000 30 - #define NOMADIK_UART_LCRH (void __iomem *)0x101FB02c 31 - #define NOMADIK_UART_CR (void __iomem *)0x101FB030 32 - #define NOMADIK_UART_FR (void __iomem *)0x101FB018 33 - 34 - static void putc(const char c) 35 - { 36 - /* Do nothing if the UART is not enabled. */ 37 - if (!(readb(NOMADIK_UART_CR) & UART01x_CR_UARTEN)) 38 - return; 39 - 40 - if (c == '\n') 41 - putc('\r'); 42 - 43 - while (readb(NOMADIK_UART_FR) & UART01x_FR_TXFF) 44 - barrier(); 45 - writeb(c, NOMADIK_UART_DR); 46 - } 47 - 48 - static void flush(void) 49 - { 50 - if (!(readb(NOMADIK_UART_CR) & UART01x_CR_UARTEN)) 51 - return; 52 - while (readb(NOMADIK_UART_FR) & UART01x_FR_BUSY) 53 - barrier(); 54 - } 55 - 56 - static inline void arch_decomp_setup(void) 57 - { 58 - } 59 - 60 - #endif /* __ASM_ARCH_UNCOMPRESS_H */
+2
arch/arm/mach-omap2/Kconfig
··· 91 91 select ARM_GIC 92 92 select CACHE_L2X0 93 93 select CPU_V7 94 + select HAVE_ARM_SCU if SMP 95 + select HAVE_ARM_TWD if LOCAL_TIMERS 94 96 select HAVE_SMP 95 97 select LOCAL_TIMERS if SMP 96 98 select OMAP_INTERCONNECT
+13
arch/arm/mach-prima2/Kconfig
··· 1 + config ARCH_SIRF 2 + bool "CSR SiRF" if ARCH_MULTI_V7 3 + select ARCH_REQUIRE_GPIOLIB 4 + select GENERIC_CLOCKEVENTS 5 + select GENERIC_IRQ_CHIP 6 + select MIGHT_HAVE_CACHE_L2X0 7 + select NO_IOPORT 8 + select PINCTRL 9 + select PINCTRL_SIRF 10 + help 11 + Support for CSR SiRFprimaII/Marco/Polo platforms 12 + 1 13 if ARCH_SIRF 2 14 3 15 menu "CSR SiRF atlas6/primaII/Marco/Polo Specific Features" ··· 36 24 default y 37 25 select ARM_GIC 38 26 select CPU_V7 27 + select HAVE_ARM_SCU if SMP 39 28 select HAVE_SMP 40 29 select SMP_ON_UP 41 30 help
+2 -3
arch/arm/mach-prima2/Makefile
··· 4 4 obj-$(CONFIG_DEBUG_LL) += lluart.o 5 5 obj-$(CONFIG_CACHE_L2X0) += l2x0.o 6 6 obj-$(CONFIG_SUSPEND) += pm.o sleep.o 7 - obj-$(CONFIG_SIRF_IRQ) += irq.o 8 7 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 9 8 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 10 - obj-$(CONFIG_ARCH_PRIMA2) += timer-prima2.o 11 - obj-$(CONFIG_ARCH_MARCO) += timer-marco.o 9 + 10 + CFLAGS_hotplug.o += -march=armv7-a
+15 -11
arch/arm/mach-prima2/common.c
··· 6 6 * Licensed under GPLv2 or later. 7 7 */ 8 8 9 + #include <linux/clocksource.h> 9 10 #include <linux/init.h> 10 11 #include <linux/kernel.h> 11 12 #include <linux/irqchip.h> ··· 32 31 sirfsoc_pm_init(); 33 32 } 34 33 34 + static __init void sirfsoc_init_time(void) 35 + { 36 + /* initialize clocking early, we want to set the OS timer */ 37 + sirfsoc_of_clk_init(); 38 + clocksource_of_init(); 39 + } 40 + 35 41 static __init void sirfsoc_map_io(void) 36 42 { 37 43 sirfsoc_map_lluart(); ··· 53 45 54 46 DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)") 55 47 /* Maintainer: Barry Song <baohua.song@csr.com> */ 48 + .nr_irqs = 128, 56 49 .map_io = sirfsoc_map_io, 57 - .init_irq = sirfsoc_of_irq_init, 58 - .init_time = sirfsoc_prima2_timer_init, 59 - #ifdef CONFIG_MULTI_IRQ_HANDLER 60 - .handle_irq = sirfsoc_handle_irq, 61 - #endif 50 + .init_irq = irqchip_init, 51 + .init_time = sirfsoc_init_time, 62 52 .init_machine = sirfsoc_mach_init, 63 53 .init_late = sirfsoc_init_late, 64 54 .dt_compat = atlas6_dt_match, ··· 72 66 73 67 DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)") 74 68 /* Maintainer: Barry Song <baohua.song@csr.com> */ 69 + .nr_irqs = 128, 75 70 .map_io = sirfsoc_map_io, 76 - .init_irq = sirfsoc_of_irq_init, 77 - .init_time = sirfsoc_prima2_timer_init, 78 - #ifdef CONFIG_MULTI_IRQ_HANDLER 79 - .handle_irq = sirfsoc_handle_irq, 80 - #endif 71 + .init_irq = irqchip_init, 72 + .init_time = sirfsoc_init_time, 81 73 .dma_zone_size = SZ_256M, 82 74 .init_machine = sirfsoc_mach_init, 83 75 .init_late = sirfsoc_init_late, ··· 95 91 .smp = smp_ops(sirfsoc_smp_ops), 96 92 .map_io = sirfsoc_map_io, 97 93 .init_irq = irqchip_init, 98 - .init_time = sirfsoc_marco_timer_init, 94 + .init_time = sirfsoc_init_time, 99 95 .init_machine = sirfsoc_mach_init, 100 96 .init_late = sirfsoc_init_late, 101 97 .dt_compat = marco_dt_match,
+2 -2
arch/arm/mach-prima2/common.h
··· 13 13 #include <asm/mach/time.h> 14 14 #include <asm/exception.h> 15 15 16 - extern void sirfsoc_prima2_timer_init(void); 17 - extern void sirfsoc_marco_timer_init(void); 16 + #define SIRFSOC_VA_BASE _AC(0xFEC00000, UL) 17 + #define SIRFSOC_VA(x) (SIRFSOC_VA_BASE + ((x) & 0x00FFF000)) 18 18 19 19 extern struct smp_operations sirfsoc_smp_ops; 20 20 extern void sirfsoc_secondary_startup(void);
-15
arch/arm/mach-prima2/include/mach/clkdev.h
··· 1 - /* 2 - * arch/arm/mach-prima2/include/mach/clkdev.h 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #ifndef __MACH_CLKDEV_H 10 - #define __MACH_CLKDEV_H 11 - 12 - #define __clk_get(clk) ({ 1; }) 13 - #define __clk_put(clk) do { } while (0) 14 - 15 - #endif
-29
arch/arm/mach-prima2/include/mach/debug-macro.S
··· 1 - /* 2 - * arch/arm/mach-prima2/include/mach/debug-macro.S 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #include <mach/hardware.h> 10 - #include <mach/uart.h> 11 - 12 - .macro addruart, rp, rv, tmp 13 - ldr \rp, =SIRFSOC_UART1_PA_BASE @ physical 14 - ldr \rv, =SIRFSOC_UART1_VA_BASE @ virtual 15 - .endm 16 - 17 - .macro senduart,rd,rx 18 - str \rd, [\rx, #SIRFSOC_UART_TXFIFO_DATA] 19 - .endm 20 - 21 - .macro busyuart,rd,rx 22 - .endm 23 - 24 - .macro waituart,rd,rx 25 - 1001: ldr \rd, [\rx, #SIRFSOC_UART_TXFIFO_STATUS] 26 - tst \rd, #SIRFSOC_UART1_TXFIFO_EMPTY 27 - beq 1001b 28 - .endm 29 -
-22
arch/arm/mach-prima2/include/mach/entry-macro.S
··· 1 - /* 2 - * arch/arm/mach-prima2/include/mach/entry-macro.S 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #include <mach/hardware.h> 10 - 11 - #define SIRFSOC_INT_ID 0x38 12 - 13 - .macro get_irqnr_preamble, base, tmp 14 - ldr \base, =sirfsoc_intc_base 15 - ldr \base, [\base] 16 - .endm 17 - 18 - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 19 - ldr \irqnr, [\base, #SIRFSOC_INT_ID] @ Get the highest priority irq 20 - cmp \irqnr, #0x40 @ the irq num can't be larger than 0x3f 21 - movges \irqnr, #0 22 - .endm
-15
arch/arm/mach-prima2/include/mach/hardware.h
··· 1 - /* 2 - * arch/arm/mach-prima2/include/mach/hardware.h 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #ifndef __MACH_HARDWARE_H__ 10 - #define __MACH_HARDWARE_H__ 11 - 12 - #include <asm/sizes.h> 13 - #include <mach/map.h> 14 - 15 - #endif
-17
arch/arm/mach-prima2/include/mach/irqs.h
··· 1 - /* 2 - * arch/arm/mach-prima2/include/mach/irqs.h 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #ifndef __ASM_ARCH_IRQS_H 10 - #define __ASM_ARCH_IRQS_H 11 - 12 - #define SIRFSOC_INTENAL_IRQ_START 0 13 - #define SIRFSOC_INTENAL_IRQ_END 127 14 - #define SIRFSOC_GPIO_IRQ_START (SIRFSOC_INTENAL_IRQ_END + 1) 15 - #define NR_IRQS 288 16 - 17 - #endif
-18
arch/arm/mach-prima2/include/mach/map.h
··· 1 - /* 2 - * memory & I/O static mapping definitions for CSR SiRFprimaII 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #ifndef __MACH_PRIMA2_MAP_H__ 10 - #define __MACH_PRIMA2_MAP_H__ 11 - 12 - #include <linux/const.h> 13 - 14 - #define SIRFSOC_VA_BASE _AC(0xFEC00000, UL) 15 - 16 - #define SIRFSOC_VA(x) (SIRFSOC_VA_BASE + ((x) & 0x00FFF000)) 17 - 18 - #endif
-14
arch/arm/mach-prima2/include/mach/timex.h
··· 1 - /* 2 - * arch/arm/mach-prima2/include/mach/timex.h 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #ifndef __MACH_TIMEX_H__ 10 - #define __MACH_TIMEX_H__ 11 - 12 - #define CLOCK_TICK_RATE 1000000 13 - 14 - #endif
-29
arch/arm/mach-prima2/include/mach/uart.h
··· 1 - /* 2 - * arch/arm/mach-prima2/include/mach/uart.h 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #ifndef __MACH_PRIMA2_SIRFSOC_UART_H 10 - #define __MACH_PRIMA2_SIRFSOC_UART_H 11 - 12 - /* UART-1: used as serial debug port */ 13 - #if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1) 14 - #define SIRFSOC_UART1_PA_BASE 0xb0060000 15 - #elif defined(CONFIG_DEBUG_SIRFMARCO_UART1) 16 - #define SIRFSOC_UART1_PA_BASE 0xcc060000 17 - #else 18 - #define SIRFSOC_UART1_PA_BASE 0 19 - #endif 20 - #define SIRFSOC_UART1_VA_BASE SIRFSOC_VA(0x060000) 21 - #define SIRFSOC_UART1_SIZE SZ_4K 22 - 23 - #define SIRFSOC_UART_TXFIFO_STATUS 0x0114 24 - #define SIRFSOC_UART_TXFIFO_DATA 0x0118 25 - 26 - #define SIRFSOC_UART1_TXFIFO_FULL (1 << 5) 27 - #define SIRFSOC_UART1_TXFIFO_EMPTY (1 << 6) 28 - 29 - #endif
-41
arch/arm/mach-prima2/include/mach/uncompress.h
··· 1 - /* 2 - * arch/arm/mach-prima2/include/mach/uncompress.h 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #ifndef __ASM_ARCH_UNCOMPRESS_H 10 - #define __ASM_ARCH_UNCOMPRESS_H 11 - 12 - #include <linux/io.h> 13 - #include <mach/hardware.h> 14 - #include <mach/uart.h> 15 - 16 - void arch_decomp_setup(void) 17 - { 18 - } 19 - 20 - static __inline__ void putc(char c) 21 - { 22 - /* 23 - * during kernel decompression, all mappings are flat: 24 - * virt_addr == phys_addr 25 - */ 26 - if (!SIRFSOC_UART1_PA_BASE) 27 - return; 28 - 29 - while (__raw_readl((void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS) 30 - & SIRFSOC_UART1_TXFIFO_FULL) 31 - barrier(); 32 - 33 - __raw_writel(c, (void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_DATA); 34 - } 35 - 36 - static inline void flush(void) 37 - { 38 - } 39 - 40 - #endif 41 -
-129
arch/arm/mach-prima2/irq.c
··· 1 - /* 2 - * interrupt controller support for CSR SiRFprimaII 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #include <linux/init.h> 10 - #include <linux/io.h> 11 - #include <linux/irq.h> 12 - #include <linux/of.h> 13 - #include <linux/of_address.h> 14 - #include <linux/irqdomain.h> 15 - #include <linux/syscore_ops.h> 16 - #include <asm/mach/irq.h> 17 - #include <asm/exception.h> 18 - #include <mach/hardware.h> 19 - 20 - #define SIRFSOC_INT_RISC_MASK0 0x0018 21 - #define SIRFSOC_INT_RISC_MASK1 0x001C 22 - #define SIRFSOC_INT_RISC_LEVEL0 0x0020 23 - #define SIRFSOC_INT_RISC_LEVEL1 0x0024 24 - #define SIRFSOC_INIT_IRQ_ID 0x0038 25 - 26 - void __iomem *sirfsoc_intc_base; 27 - 28 - static __init void 29 - sirfsoc_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) 30 - { 31 - struct irq_chip_generic *gc; 32 - struct irq_chip_type *ct; 33 - 34 - gc = irq_alloc_generic_chip("SIRFINTC", 1, irq_start, base, handle_level_irq); 35 - ct = gc->chip_types; 36 - 37 - ct->chip.irq_mask = irq_gc_mask_clr_bit; 38 - ct->chip.irq_unmask = irq_gc_mask_set_bit; 39 - ct->regs.mask = SIRFSOC_INT_RISC_MASK0; 40 - 41 - irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST, 0); 42 - } 43 - 44 - static __init void sirfsoc_irq_init(void) 45 - { 46 - sirfsoc_alloc_gc(sirfsoc_intc_base, 0, 32); 47 - sirfsoc_alloc_gc(sirfsoc_intc_base + 4, 32, 48 - SIRFSOC_INTENAL_IRQ_END + 1 - 32); 49 - 50 - writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL0); 51 - writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL1); 52 - 53 - writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK0); 54 - writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK1); 55 - } 56 - 57 - asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs) 58 - { 59 - u32 irqstat, irqnr; 60 - 61 - irqstat = readl_relaxed(sirfsoc_intc_base + SIRFSOC_INIT_IRQ_ID); 62 - irqnr = irqstat & 0xff; 63 - 64 - handle_IRQ(irqnr, regs); 65 - } 66 - 67 - static struct of_device_id intc_ids[] = { 68 - { .compatible = "sirf,prima2-intc" }, 69 - {}, 70 - }; 71 - 72 - void __init sirfsoc_of_irq_init(void) 73 - { 74 - struct device_node *np; 75 - 76 - np = of_find_matching_node(NULL, intc_ids); 77 - if (!np) 78 - return; 79 - 80 - sirfsoc_intc_base = of_iomap(np, 0); 81 - if (!sirfsoc_intc_base) 82 - panic("unable to map intc cpu registers\n"); 83 - 84 - irq_domain_add_legacy(np, SIRFSOC_INTENAL_IRQ_END + 1, 0, 0, 85 - &irq_domain_simple_ops, NULL); 86 - 87 - of_node_put(np); 88 - 89 - sirfsoc_irq_init(); 90 - } 91 - 92 - struct sirfsoc_irq_status { 93 - u32 mask0; 94 - u32 mask1; 95 - u32 level0; 96 - u32 level1; 97 - }; 98 - 99 - static struct sirfsoc_irq_status sirfsoc_irq_st; 100 - 101 - static int sirfsoc_irq_suspend(void) 102 - { 103 - sirfsoc_irq_st.mask0 = readl_relaxed(sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK0); 104 - sirfsoc_irq_st.mask1 = readl_relaxed(sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK1); 105 - sirfsoc_irq_st.level0 = readl_relaxed(sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL0); 106 - sirfsoc_irq_st.level1 = readl_relaxed(sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL1); 107 - 108 - return 0; 109 - } 110 - 111 - static void sirfsoc_irq_resume(void) 112 - { 113 - writel_relaxed(sirfsoc_irq_st.mask0, sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK0); 114 - writel_relaxed(sirfsoc_irq_st.mask1, sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK1); 115 - writel_relaxed(sirfsoc_irq_st.level0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL0); 116 - writel_relaxed(sirfsoc_irq_st.level1, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL1); 117 - } 118 - 119 - static struct syscore_ops sirfsoc_irq_syscore_ops = { 120 - .suspend = sirfsoc_irq_suspend, 121 - .resume = sirfsoc_irq_resume, 122 - }; 123 - 124 - static int __init sirfsoc_irq_pm_init(void) 125 - { 126 - register_syscore_ops(&sirfsoc_irq_syscore_ops); 127 - return 0; 128 - } 129 - device_initcall(sirfsoc_irq_pm_init);
+12 -2
arch/arm/mach-prima2/lluart.c
··· 9 9 #include <linux/kernel.h> 10 10 #include <asm/page.h> 11 11 #include <asm/mach/map.h> 12 - #include <mach/map.h> 13 - #include <mach/uart.h> 12 + #include "common.h" 13 + 14 + #if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1) 15 + #define SIRFSOC_UART1_PA_BASE 0xb0060000 16 + #elif defined(CONFIG_DEBUG_SIRFMARCO_UART1) 17 + #define SIRFSOC_UART1_PA_BASE 0xcc060000 18 + #else 19 + #define SIRFSOC_UART1_PA_BASE 0 20 + #endif 21 + 22 + #define SIRFSOC_UART1_VA_BASE SIRFSOC_VA(0x060000) 23 + #define SIRFSOC_UART1_SIZE SZ_4K 14 24 15 25 void __init sirfsoc_map_lluart(void) 16 26 {
-1
arch/arm/mach-prima2/platsmp.c
··· 17 17 #include <asm/smp_scu.h> 18 18 #include <asm/cacheflush.h> 19 19 #include <asm/cputype.h> 20 - #include <mach/map.h> 21 20 22 21 #include "common.h" 23 22
-316
arch/arm/mach-prima2/timer-marco.c
··· 1 - /* 2 - * System timer for CSR SiRFprimaII 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #include <linux/kernel.h> 10 - #include <linux/interrupt.h> 11 - #include <linux/clockchips.h> 12 - #include <linux/clocksource.h> 13 - #include <linux/bitops.h> 14 - #include <linux/irq.h> 15 - #include <linux/clk.h> 16 - #include <linux/slab.h> 17 - #include <linux/of.h> 18 - #include <linux/of_irq.h> 19 - #include <linux/of_address.h> 20 - #include <asm/sched_clock.h> 21 - #include <asm/localtimer.h> 22 - #include <asm/mach/time.h> 23 - 24 - #include "common.h" 25 - 26 - #define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000 27 - #define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004 28 - #define SIRFSOC_TIMER_MATCH_0 0x0018 29 - #define SIRFSOC_TIMER_MATCH_1 0x001c 30 - #define SIRFSOC_TIMER_COUNTER_0 0x0048 31 - #define SIRFSOC_TIMER_COUNTER_1 0x004c 32 - #define SIRFSOC_TIMER_INTR_STATUS 0x0060 33 - #define SIRFSOC_TIMER_WATCHDOG_EN 0x0064 34 - #define SIRFSOC_TIMER_64COUNTER_CTRL 0x0068 35 - #define SIRFSOC_TIMER_64COUNTER_LO 0x006c 36 - #define SIRFSOC_TIMER_64COUNTER_HI 0x0070 37 - #define SIRFSOC_TIMER_64COUNTER_LOAD_LO 0x0074 38 - #define SIRFSOC_TIMER_64COUNTER_LOAD_HI 0x0078 39 - #define SIRFSOC_TIMER_64COUNTER_RLATCHED_LO 0x007c 40 - #define SIRFSOC_TIMER_64COUNTER_RLATCHED_HI 0x0080 41 - 42 - #define SIRFSOC_TIMER_REG_CNT 6 43 - 44 - static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = { 45 - SIRFSOC_TIMER_WATCHDOG_EN, 46 - SIRFSOC_TIMER_32COUNTER_0_CTRL, 47 - SIRFSOC_TIMER_32COUNTER_1_CTRL, 48 - SIRFSOC_TIMER_64COUNTER_CTRL, 49 - SIRFSOC_TIMER_64COUNTER_RLATCHED_LO, 50 - SIRFSOC_TIMER_64COUNTER_RLATCHED_HI, 51 - }; 52 - 53 - static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT]; 54 - 55 - static void __iomem *sirfsoc_timer_base; 56 - static void __init sirfsoc_of_timer_map(void); 57 - 58 - /* disable count and interrupt */ 59 - static inline void sirfsoc_timer_count_disable(int idx) 60 - { 61 - writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) & ~0x7, 62 - sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx); 63 - } 64 - 65 - /* enable count and interrupt */ 66 - static inline void sirfsoc_timer_count_enable(int idx) 67 - { 68 - writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) | 0x7, 69 - sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx); 70 - } 71 - 72 - /* timer interrupt handler */ 73 - static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id) 74 - { 75 - struct clock_event_device *ce = dev_id; 76 - int cpu = smp_processor_id(); 77 - 78 - /* clear timer interrupt */ 79 - writel_relaxed(BIT(cpu), sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); 80 - 81 - if (ce->mode == CLOCK_EVT_MODE_ONESHOT) 82 - sirfsoc_timer_count_disable(cpu); 83 - 84 - ce->event_handler(ce); 85 - 86 - return IRQ_HANDLED; 87 - } 88 - 89 - /* read 64-bit timer counter */ 90 - static cycle_t sirfsoc_timer_read(struct clocksource *cs) 91 - { 92 - u64 cycles; 93 - 94 - writel_relaxed((readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | 95 - BIT(0)) & ~BIT(1), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 96 - 97 - cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_HI); 98 - cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_LO); 99 - 100 - return cycles; 101 - } 102 - 103 - static int sirfsoc_timer_set_next_event(unsigned long delta, 104 - struct clock_event_device *ce) 105 - { 106 - int cpu = smp_processor_id(); 107 - 108 - writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0 + 109 - 4 * cpu); 110 - writel_relaxed(delta, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0 + 111 - 4 * cpu); 112 - 113 - /* enable the tick */ 114 - sirfsoc_timer_count_enable(cpu); 115 - 116 - return 0; 117 - } 118 - 119 - static void sirfsoc_timer_set_mode(enum clock_event_mode mode, 120 - struct clock_event_device *ce) 121 - { 122 - switch (mode) { 123 - case CLOCK_EVT_MODE_ONESHOT: 124 - /* enable in set_next_event */ 125 - break; 126 - default: 127 - break; 128 - } 129 - 130 - sirfsoc_timer_count_disable(smp_processor_id()); 131 - } 132 - 133 - static void sirfsoc_clocksource_suspend(struct clocksource *cs) 134 - { 135 - int i; 136 - 137 - for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++) 138 - sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); 139 - } 140 - 141 - static void sirfsoc_clocksource_resume(struct clocksource *cs) 142 - { 143 - int i; 144 - 145 - for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++) 146 - writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); 147 - 148 - writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2], 149 - sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO); 150 - writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1], 151 - sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI); 152 - 153 - writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | 154 - BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 155 - } 156 - 157 - static struct clock_event_device sirfsoc_clockevent = { 158 - .name = "sirfsoc_clockevent", 159 - .rating = 200, 160 - .features = CLOCK_EVT_FEAT_ONESHOT, 161 - .set_mode = sirfsoc_timer_set_mode, 162 - .set_next_event = sirfsoc_timer_set_next_event, 163 - }; 164 - 165 - static struct clocksource sirfsoc_clocksource = { 166 - .name = "sirfsoc_clocksource", 167 - .rating = 200, 168 - .mask = CLOCKSOURCE_MASK(64), 169 - .flags = CLOCK_SOURCE_IS_CONTINUOUS, 170 - .read = sirfsoc_timer_read, 171 - .suspend = sirfsoc_clocksource_suspend, 172 - .resume = sirfsoc_clocksource_resume, 173 - }; 174 - 175 - static struct irqaction sirfsoc_timer_irq = { 176 - .name = "sirfsoc_timer0", 177 - .flags = IRQF_TIMER | IRQF_NOBALANCING, 178 - .handler = sirfsoc_timer_interrupt, 179 - .dev_id = &sirfsoc_clockevent, 180 - }; 181 - 182 - #ifdef CONFIG_LOCAL_TIMERS 183 - 184 - static struct irqaction sirfsoc_timer1_irq = { 185 - .name = "sirfsoc_timer1", 186 - .flags = IRQF_TIMER | IRQF_NOBALANCING, 187 - .handler = sirfsoc_timer_interrupt, 188 - }; 189 - 190 - static int __cpuinit sirfsoc_local_timer_setup(struct clock_event_device *ce) 191 - { 192 - /* Use existing clock_event for cpu 0 */ 193 - if (!smp_processor_id()) 194 - return 0; 195 - 196 - ce->irq = sirfsoc_timer1_irq.irq; 197 - ce->name = "local_timer"; 198 - ce->features = sirfsoc_clockevent.features; 199 - ce->rating = sirfsoc_clockevent.rating; 200 - ce->set_mode = sirfsoc_timer_set_mode; 201 - ce->set_next_event = sirfsoc_timer_set_next_event; 202 - ce->shift = sirfsoc_clockevent.shift; 203 - ce->mult = sirfsoc_clockevent.mult; 204 - ce->max_delta_ns = sirfsoc_clockevent.max_delta_ns; 205 - ce->min_delta_ns = sirfsoc_clockevent.min_delta_ns; 206 - 207 - sirfsoc_timer1_irq.dev_id = ce; 208 - BUG_ON(setup_irq(ce->irq, &sirfsoc_timer1_irq)); 209 - irq_set_affinity(sirfsoc_timer1_irq.irq, cpumask_of(1)); 210 - 211 - clockevents_register_device(ce); 212 - return 0; 213 - } 214 - 215 - static void sirfsoc_local_timer_stop(struct clock_event_device *ce) 216 - { 217 - sirfsoc_timer_count_disable(1); 218 - 219 - remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq); 220 - } 221 - 222 - static struct local_timer_ops sirfsoc_local_timer_ops __cpuinitdata = { 223 - .setup = sirfsoc_local_timer_setup, 224 - .stop = sirfsoc_local_timer_stop, 225 - }; 226 - #endif /* CONFIG_LOCAL_TIMERS */ 227 - 228 - static void __init sirfsoc_clockevent_init(void) 229 - { 230 - clockevents_calc_mult_shift(&sirfsoc_clockevent, CLOCK_TICK_RATE, 60); 231 - 232 - sirfsoc_clockevent.max_delta_ns = 233 - clockevent_delta2ns(-2, &sirfsoc_clockevent); 234 - sirfsoc_clockevent.min_delta_ns = 235 - clockevent_delta2ns(2, &sirfsoc_clockevent); 236 - 237 - sirfsoc_clockevent.cpumask = cpumask_of(0); 238 - clockevents_register_device(&sirfsoc_clockevent); 239 - #ifdef CONFIG_LOCAL_TIMERS 240 - local_timer_register(&sirfsoc_local_timer_ops); 241 - #endif 242 - } 243 - 244 - /* initialize the kernel jiffy timer source */ 245 - void __init sirfsoc_marco_timer_init(void) 246 - { 247 - unsigned long rate; 248 - u32 timer_div; 249 - struct clk *clk; 250 - 251 - /* initialize clocking early, we want to set the OS timer */ 252 - sirfsoc_of_clk_init(); 253 - 254 - /* timer's input clock is io clock */ 255 - clk = clk_get_sys("io", NULL); 256 - 257 - BUG_ON(IS_ERR(clk)); 258 - rate = clk_get_rate(clk); 259 - 260 - BUG_ON(rate < CLOCK_TICK_RATE); 261 - BUG_ON(rate % CLOCK_TICK_RATE); 262 - 263 - sirfsoc_of_timer_map(); 264 - 265 - /* Initialize the timer dividers */ 266 - timer_div = rate / CLOCK_TICK_RATE - 1; 267 - writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 268 - writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL); 269 - writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL); 270 - 271 - /* Initialize timer counters to 0 */ 272 - writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO); 273 - writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI); 274 - writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | 275 - BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 276 - writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0); 277 - writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_1); 278 - 279 - /* Clear all interrupts */ 280 - writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); 281 - 282 - BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); 283 - 284 - BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq)); 285 - 286 - sirfsoc_clockevent_init(); 287 - } 288 - 289 - static struct of_device_id timer_ids[] = { 290 - { .compatible = "sirf,marco-tick" }, 291 - {}, 292 - }; 293 - 294 - static void __init sirfsoc_of_timer_map(void) 295 - { 296 - struct device_node *np; 297 - 298 - np = of_find_matching_node(NULL, timer_ids); 299 - if (!np) 300 - return; 301 - sirfsoc_timer_base = of_iomap(np, 0); 302 - if (!sirfsoc_timer_base) 303 - panic("unable to map timer cpu registers\n"); 304 - 305 - sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0); 306 - if (!sirfsoc_timer_irq.irq) 307 - panic("No irq passed for timer0 via DT\n"); 308 - 309 - #ifdef CONFIG_LOCAL_TIMERS 310 - sirfsoc_timer1_irq.irq = irq_of_parse_and_map(np, 1); 311 - if (!sirfsoc_timer1_irq.irq) 312 - panic("No irq passed for timer1 via DT\n"); 313 - #endif 314 - 315 - of_node_put(np); 316 - }
-241
arch/arm/mach-prima2/timer-prima2.c
··· 1 - /* 2 - * System timer for CSR SiRFprimaII 3 - * 4 - * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 - * 6 - * Licensed under GPLv2 or later. 7 - */ 8 - 9 - #include <linux/kernel.h> 10 - #include <linux/interrupt.h> 11 - #include <linux/clockchips.h> 12 - #include <linux/clocksource.h> 13 - #include <linux/bitops.h> 14 - #include <linux/irq.h> 15 - #include <linux/clk.h> 16 - #include <linux/err.h> 17 - #include <linux/slab.h> 18 - #include <linux/of.h> 19 - #include <linux/of_address.h> 20 - #include <mach/map.h> 21 - #include <asm/sched_clock.h> 22 - #include <asm/mach/time.h> 23 - 24 - #include "common.h" 25 - 26 - #define SIRFSOC_TIMER_COUNTER_LO 0x0000 27 - #define SIRFSOC_TIMER_COUNTER_HI 0x0004 28 - #define SIRFSOC_TIMER_MATCH_0 0x0008 29 - #define SIRFSOC_TIMER_MATCH_1 0x000C 30 - #define SIRFSOC_TIMER_MATCH_2 0x0010 31 - #define SIRFSOC_TIMER_MATCH_3 0x0014 32 - #define SIRFSOC_TIMER_MATCH_4 0x0018 33 - #define SIRFSOC_TIMER_MATCH_5 0x001C 34 - #define SIRFSOC_TIMER_STATUS 0x0020 35 - #define SIRFSOC_TIMER_INT_EN 0x0024 36 - #define SIRFSOC_TIMER_WATCHDOG_EN 0x0028 37 - #define SIRFSOC_TIMER_DIV 0x002C 38 - #define SIRFSOC_TIMER_LATCH 0x0030 39 - #define SIRFSOC_TIMER_LATCHED_LO 0x0034 40 - #define SIRFSOC_TIMER_LATCHED_HI 0x0038 41 - 42 - #define SIRFSOC_TIMER_WDT_INDEX 5 43 - 44 - #define SIRFSOC_TIMER_LATCH_BIT BIT(0) 45 - 46 - #define SIRFSOC_TIMER_REG_CNT 11 47 - 48 - static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = { 49 - SIRFSOC_TIMER_MATCH_0, SIRFSOC_TIMER_MATCH_1, SIRFSOC_TIMER_MATCH_2, 50 - SIRFSOC_TIMER_MATCH_3, SIRFSOC_TIMER_MATCH_4, SIRFSOC_TIMER_MATCH_5, 51 - SIRFSOC_TIMER_INT_EN, SIRFSOC_TIMER_WATCHDOG_EN, SIRFSOC_TIMER_DIV, 52 - SIRFSOC_TIMER_LATCHED_LO, SIRFSOC_TIMER_LATCHED_HI, 53 - }; 54 - 55 - static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT]; 56 - 57 - static void __iomem *sirfsoc_timer_base; 58 - static void __init sirfsoc_of_timer_map(void); 59 - 60 - /* timer0 interrupt handler */ 61 - static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id) 62 - { 63 - struct clock_event_device *ce = dev_id; 64 - 65 - WARN_ON(!(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_STATUS) & BIT(0))); 66 - 67 - /* clear timer0 interrupt */ 68 - writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS); 69 - 70 - ce->event_handler(ce); 71 - 72 - return IRQ_HANDLED; 73 - } 74 - 75 - /* read 64-bit timer counter */ 76 - static cycle_t sirfsoc_timer_read(struct clocksource *cs) 77 - { 78 - u64 cycles; 79 - 80 - /* latch the 64-bit timer counter */ 81 - writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH); 82 - cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_HI); 83 - cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO); 84 - 85 - return cycles; 86 - } 87 - 88 - static int sirfsoc_timer_set_next_event(unsigned long delta, 89 - struct clock_event_device *ce) 90 - { 91 - unsigned long now, next; 92 - 93 - writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH); 94 - now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO); 95 - next = now + delta; 96 - writel_relaxed(next, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0); 97 - writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH); 98 - now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO); 99 - 100 - return next - now > delta ? -ETIME : 0; 101 - } 102 - 103 - static void sirfsoc_timer_set_mode(enum clock_event_mode mode, 104 - struct clock_event_device *ce) 105 - { 106 - u32 val = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN); 107 - switch (mode) { 108 - case CLOCK_EVT_MODE_PERIODIC: 109 - WARN_ON(1); 110 - break; 111 - case CLOCK_EVT_MODE_ONESHOT: 112 - writel_relaxed(val | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN); 113 - break; 114 - case CLOCK_EVT_MODE_SHUTDOWN: 115 - writel_relaxed(val & ~BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN); 116 - break; 117 - case CLOCK_EVT_MODE_UNUSED: 118 - case CLOCK_EVT_MODE_RESUME: 119 - break; 120 - } 121 - } 122 - 123 - static void sirfsoc_clocksource_suspend(struct clocksource *cs) 124 - { 125 - int i; 126 - 127 - writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH); 128 - 129 - for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++) 130 - sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); 131 - } 132 - 133 - static void sirfsoc_clocksource_resume(struct clocksource *cs) 134 - { 135 - int i; 136 - 137 - for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++) 138 - writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); 139 - 140 - writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO); 141 - writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI); 142 - } 143 - 144 - static struct clock_event_device sirfsoc_clockevent = { 145 - .name = "sirfsoc_clockevent", 146 - .rating = 200, 147 - .features = CLOCK_EVT_FEAT_ONESHOT, 148 - .set_mode = sirfsoc_timer_set_mode, 149 - .set_next_event = sirfsoc_timer_set_next_event, 150 - }; 151 - 152 - static struct clocksource sirfsoc_clocksource = { 153 - .name = "sirfsoc_clocksource", 154 - .rating = 200, 155 - .mask = CLOCKSOURCE_MASK(64), 156 - .flags = CLOCK_SOURCE_IS_CONTINUOUS, 157 - .read = sirfsoc_timer_read, 158 - .suspend = sirfsoc_clocksource_suspend, 159 - .resume = sirfsoc_clocksource_resume, 160 - }; 161 - 162 - static struct irqaction sirfsoc_timer_irq = { 163 - .name = "sirfsoc_timer0", 164 - .flags = IRQF_TIMER, 165 - .irq = 0, 166 - .handler = sirfsoc_timer_interrupt, 167 - .dev_id = &sirfsoc_clockevent, 168 - }; 169 - 170 - /* Overwrite weak default sched_clock with more precise one */ 171 - static u32 notrace sirfsoc_read_sched_clock(void) 172 - { 173 - return (u32)(sirfsoc_timer_read(NULL) & 0xffffffff); 174 - } 175 - 176 - static void __init sirfsoc_clockevent_init(void) 177 - { 178 - sirfsoc_clockevent.cpumask = cpumask_of(0); 179 - clockevents_config_and_register(&sirfsoc_clockevent, CLOCK_TICK_RATE, 180 - 2, -2); 181 - } 182 - 183 - /* initialize the kernel jiffy timer source */ 184 - void __init sirfsoc_prima2_timer_init(void) 185 - { 186 - unsigned long rate; 187 - struct clk *clk; 188 - 189 - /* initialize clocking early, we want to set the OS timer */ 190 - sirfsoc_of_clk_init(); 191 - 192 - /* timer's input clock is io clock */ 193 - clk = clk_get_sys("io", NULL); 194 - 195 - BUG_ON(IS_ERR(clk)); 196 - 197 - rate = clk_get_rate(clk); 198 - 199 - BUG_ON(rate < CLOCK_TICK_RATE); 200 - BUG_ON(rate % CLOCK_TICK_RATE); 201 - 202 - sirfsoc_of_timer_map(); 203 - 204 - writel_relaxed(rate / CLOCK_TICK_RATE / 2 - 1, sirfsoc_timer_base + SIRFSOC_TIMER_DIV); 205 - writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO); 206 - writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI); 207 - writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS); 208 - 209 - BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); 210 - 211 - setup_sched_clock(sirfsoc_read_sched_clock, 32, CLOCK_TICK_RATE); 212 - 213 - BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq)); 214 - 215 - sirfsoc_clockevent_init(); 216 - } 217 - 218 - static struct of_device_id timer_ids[] = { 219 - { .compatible = "sirf,prima2-tick" }, 220 - {}, 221 - }; 222 - 223 - static void __init sirfsoc_of_timer_map(void) 224 - { 225 - struct device_node *np; 226 - const unsigned int *intspec; 227 - 228 - np = of_find_matching_node(NULL, timer_ids); 229 - if (!np) 230 - return; 231 - sirfsoc_timer_base = of_iomap(np, 0); 232 - if (!sirfsoc_timer_base) 233 - panic("unable to map timer cpu registers\n"); 234 - 235 - /* Get the interrupts property */ 236 - intspec = of_get_property(np, "interrupts", NULL); 237 - BUG_ON(!intspec); 238 - sirfsoc_timer_irq.irq = be32_to_cpup(intspec); 239 - 240 - of_node_put(np); 241 - }
+8
arch/arm/mach-realview/Kconfig
··· 12 12 bool "Support Multicore Cortex-A9 Tile" 13 13 depends on MACH_REALVIEW_EB 14 14 select CPU_V7 15 + select HAVE_ARM_SCU if SMP 16 + select HAVE_ARM_TWD if LOCAL_TIMERS 15 17 select HAVE_SMP 16 18 select MIGHT_HAVE_CACHE_L2X0 17 19 help ··· 25 23 depends on MACH_REALVIEW_EB 26 24 select ARCH_HAS_BARRIERS if SMP 27 25 select CPU_V6K 26 + select HAVE_ARM_SCU if SMP 27 + select HAVE_ARM_TWD if LOCAL_TIMERS 28 28 select HAVE_SMP 29 29 select MIGHT_HAVE_CACHE_L2X0 30 30 help ··· 47 43 select ARCH_HAS_BARRIERS if SMP 48 44 select ARM_GIC 49 45 select CPU_V6K 46 + select HAVE_ARM_SCU if SMP 47 + select HAVE_ARM_TWD if LOCAL_TIMERS 50 48 select HAVE_PATA_PLATFORM 51 49 select HAVE_SMP 52 50 select MIGHT_HAVE_CACHE_L2X0 ··· 91 85 bool "Support RealView(R) Platform Baseboard Explore" 92 86 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET 93 87 select ARM_GIC 88 + select HAVE_ARM_SCU if SMP 89 + select HAVE_ARM_TWD if LOCAL_TIMERS 94 90 select HAVE_PATA_PLATFORM 95 91 select HAVE_SMP 96 92 select MIGHT_HAVE_CACHE_L2X0
+1 -1
arch/arm/mach-s3c24xx/include/mach/debug-macro.S
··· 98 98 99 99 /* include the reset of the code which will do the work */ 100 100 101 - #include <plat/debug-macro.S> 101 + #include <debug/samsung.S>
+1 -1
arch/arm/mach-s3c64xx/include/mach/debug-macro.S
··· 35 35 * will be fine with us. 36 36 */ 37 37 38 - #include <plat/debug-macro.S> 38 + #include <debug/samsung.S>
+1 -1
arch/arm/mach-s5p64x0/include/mach/debug-macro.S
··· 30 30 #endif 31 31 .endm 32 32 33 - #include <plat/debug-macro.S> 33 + #include <debug/samsung.S>
+1 -1
arch/arm/mach-s5pc100/include/mach/debug-macro.S
··· 36 36 * will be fine with us. 37 37 */ 38 38 39 - #include <plat/debug-macro.S> 39 + #include <debug/samsung.S>
-1
arch/arm/mach-s5pc100/setup-sdhci-gpio.c
··· 19 19 #include <linux/mmc/card.h> 20 20 21 21 #include <plat/gpio-cfg.h> 22 - #include <plat/regs-sdhci.h> 23 22 #include <plat/sdhci.h> 24 23 25 24 void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
+1 -1
arch/arm/mach-s5pv210/include/mach/debug-macro.S
··· 38 38 * will be fine with us. 39 39 */ 40 40 41 - #include <plat/debug-macro.S> 41 + #include <debug/samsung.S>
-1
arch/arm/mach-s5pv210/setup-sdhci-gpio.c
··· 20 20 #include <linux/mmc/card.h> 21 21 22 22 #include <plat/gpio-cfg.h> 23 - #include <plat/regs-sdhci.h> 24 23 #include <plat/sdhci.h> 25 24 26 25 void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
+105
arch/arm/mach-spear/Kconfig
··· 1 + # 2 + # SPEAr Platform configuration file 3 + # 4 + 5 + menuconfig PLAT_SPEAR 6 + bool "ST SPEAr Family" if ARCH_MULTI_V7 || ARCH_MULTI_V5 7 + default PLAT_SPEAR_SINGLE 8 + select ARCH_REQUIRE_GPIOLIB 9 + select ARM_AMBA 10 + select CLKDEV_LOOKUP 11 + select CLKSRC_MMIO 12 + select COMMON_CLK 13 + select GENERIC_CLOCKEVENTS 14 + select HAVE_CLK 15 + 16 + if PLAT_SPEAR 17 + 18 + config ARCH_SPEAR13XX 19 + bool "ST SPEAr13xx" 20 + depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE 21 + select ARCH_HAS_CPUFREQ 22 + select ARM_GIC 23 + select CPU_V7 24 + select GPIO_SPEAR_SPICS 25 + select HAVE_ARM_SCU if SMP 26 + select HAVE_ARM_TWD if LOCAL_TIMERS 27 + select HAVE_SMP 28 + select MIGHT_HAVE_CACHE_L2X0 29 + select PINCTRL 30 + select USE_OF 31 + help 32 + Supports for ARM's SPEAR13XX family 33 + 34 + if ARCH_SPEAR13XX 35 + 36 + config MACH_SPEAR1310 37 + bool "SPEAr1310 Machine support with Device Tree" 38 + select PINCTRL_SPEAR1310 39 + help 40 + Supports ST SPEAr1310 machine configured via the device-tree 41 + 42 + config MACH_SPEAR1340 43 + bool "SPEAr1340 Machine support with Device Tree" 44 + select PINCTRL_SPEAR1340 45 + help 46 + Supports ST SPEAr1340 machine configured via the device-tree 47 + 48 + endif #ARCH_SPEAR13XX 49 + 50 + config ARCH_SPEAR3XX 51 + bool "ST SPEAr3xx" 52 + depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE 53 + depends on !ARCH_SPEAR13XX 54 + select ARM_VIC 55 + select CPU_ARM926T 56 + select PINCTRL 57 + select USE_OF 58 + help 59 + Supports for ARM's SPEAR3XX family 60 + 61 + if ARCH_SPEAR3XX 62 + 63 + config MACH_SPEAR300 64 + bool "SPEAr300 Machine support with Device Tree" 65 + select PINCTRL_SPEAR300 66 + help 67 + Supports ST SPEAr300 machine configured via the device-tree 68 + 69 + config MACH_SPEAR310 70 + bool "SPEAr310 Machine support with Device Tree" 71 + select PINCTRL_SPEAR310 72 + help 73 + Supports ST SPEAr310 machine configured via the device-tree 74 + 75 + config MACH_SPEAR320 76 + bool "SPEAr320 Machine support with Device Tree" 77 + select PINCTRL_SPEAR320 78 + help 79 + Supports ST SPEAr320 machine configured via the device-tree 80 + 81 + endif 82 + 83 + config ARCH_SPEAR6XX 84 + bool "ST SPEAr6XX" 85 + depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE 86 + depends on !ARCH_SPEAR13XX 87 + select ARM_VIC 88 + select CPU_ARM926T 89 + help 90 + Supports for ARM's SPEAR6XX family 91 + 92 + config MACH_SPEAR600 93 + def_bool y 94 + depends on ARCH_SPEAR6XX 95 + select USE_OF 96 + help 97 + Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig" 98 + 99 + config ARCH_SPEAR_AUTO 100 + def_bool PLAT_SPEAR_SINGLE 101 + depends on !ARCH_SPEAR13XX && !ARCH_SPEAR6XX 102 + select ARCH_SPEAR3XX 103 + 104 + endif 105 +
+26
arch/arm/mach-spear/Makefile
··· 1 + # 2 + # SPEAr Platform specific Makefile 3 + # 4 + 5 + ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include 6 + 7 + # Common support 8 + obj-y := restart.o time.o 9 + 10 + obj-$(CONFIG_SMP) += headsmp.o platsmp.o 11 + obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 12 + 13 + obj-$(CONFIG_ARCH_SPEAR13XX) += spear13xx.o 14 + obj-$(CONFIG_MACH_SPEAR1310) += spear1310.o 15 + obj-$(CONFIG_MACH_SPEAR1340) += spear1340.o 16 + 17 + obj-$(CONFIG_ARCH_SPEAR3XX) += spear3xx.o 18 + obj-$(CONFIG_ARCH_SPEAR3XX) += pl080.o 19 + obj-$(CONFIG_MACH_SPEAR300) += spear300.o 20 + obj-$(CONFIG_MACH_SPEAR310) += spear310.o 21 + obj-$(CONFIG_MACH_SPEAR320) += spear320.o 22 + 23 + obj-$(CONFIG_ARCH_SPEAR6XX) += spear6xx.o 24 + obj-$(CONFIG_ARCH_SPEAR6XX) += pl080.o 25 + 26 + CFLAGS_hotplug.o += -march=armv7-a
+59
arch/arm/mach-spear/generic.h
··· 1 + /* 2 + * spear machine family generic header file 3 + * 4 + * Copyright (C) 2009-2012 ST Microelectronics 5 + * Rajeev Kumar <rajeev-dlh.kumar@st.com> 6 + * Viresh Kumar <viresh.linux@gmail.com> 7 + * 8 + * This file is licensed under the terms of the GNU General Public 9 + * License version 2. This program is licensed "as is" without any 10 + * warranty of any kind, whether express or implied. 11 + */ 12 + 13 + #ifndef __MACH_GENERIC_H 14 + #define __MACH_GENERIC_H 15 + 16 + #include <linux/dmaengine.h> 17 + #include <linux/amba/pl08x.h> 18 + #include <linux/init.h> 19 + #include <asm/mach/time.h> 20 + 21 + extern void spear13xx_timer_init(void); 22 + extern void spear3xx_timer_init(void); 23 + extern struct pl022_ssp_controller pl022_plat_data; 24 + extern struct pl08x_platform_data pl080_plat_data; 25 + extern struct dw_dma_platform_data dmac_plat_data; 26 + extern struct dw_dma_slave cf_dma_priv; 27 + extern struct dw_dma_slave nand_read_dma_priv; 28 + extern struct dw_dma_slave nand_write_dma_priv; 29 + bool dw_dma_filter(struct dma_chan *chan, void *slave); 30 + 31 + void __init spear_setup_of_timer(void); 32 + void __init spear3xx_clk_init(void __iomem *misc_base, 33 + void __iomem *soc_config_base); 34 + void __init spear3xx_map_io(void); 35 + void __init spear3xx_dt_init_irq(void); 36 + void __init spear6xx_clk_init(void __iomem *misc_base); 37 + void __init spear13xx_map_io(void); 38 + void __init spear13xx_l2x0_init(void); 39 + 40 + void spear_restart(char, const char *); 41 + 42 + void spear13xx_secondary_startup(void); 43 + void __cpuinit spear13xx_cpu_die(unsigned int cpu); 44 + 45 + extern struct smp_operations spear13xx_smp_ops; 46 + 47 + #ifdef CONFIG_MACH_SPEAR1310 48 + void __init spear1310_clk_init(void __iomem *misc_base, void __iomem *ras_base); 49 + #else 50 + static inline void spear1310_clk_init(void __iomem *misc_base, void __iomem *ras_base) {} 51 + #endif 52 + 53 + #ifdef CONFIG_MACH_SPEAR1340 54 + void __init spear1340_clk_init(void __iomem *misc_base); 55 + #else 56 + static inline void spear1340_clk_init(void __iomem *misc_base) {} 57 + #endif 58 + 59 + #endif /* __MACH_GENERIC_H */
+35
arch/arm/mach-spear/include/mach/irqs.h
··· 1 + /* 2 + * IRQ helper macros for spear machine family 3 + * 4 + * Copyright (C) 2009-2012 ST Microelectronics 5 + * Rajeev Kumar <rajeev-dlh.kumar@st.com> 6 + * Viresh Kumar <viresh.linux@gmail.com> 7 + * 8 + * This file is licensed under the terms of the GNU General Public 9 + * License version 2. This program is licensed "as is" without any 10 + * warranty of any kind, whether express or implied. 11 + */ 12 + 13 + #ifndef __MACH_IRQS_H 14 + #define __MACH_IRQS_H 15 + 16 + #ifdef CONFIG_ARCH_SPEAR3XX 17 + #define NR_IRQS 256 18 + #endif 19 + 20 + #ifdef CONFIG_ARCH_SPEAR6XX 21 + /* IRQ definitions */ 22 + /* VIC 1 */ 23 + #define IRQ_VIC_END 64 24 + 25 + /* GPIO pins virtual irqs */ 26 + #define VIRTUAL_IRQS 24 27 + #define NR_IRQS (IRQ_VIC_END + VIRTUAL_IRQS) 28 + #endif 29 + 30 + #ifdef CONFIG_ARCH_SPEAR13XX 31 + #define IRQ_GIC_END 160 32 + #define NR_IRQS IRQ_GIC_END 33 + #endif 34 + 35 + #endif /* __MACH_IRQS_H */
+22
arch/arm/mach-spear/include/mach/misc_regs.h
··· 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.linux@gmail.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_SPEAR_ICM3_MISC_REG_BASE) 20 + #define DMA_CHN_CFG (MISC_BASE + 0x0A0) 21 + 22 + #endif /* __MACH_MISC_REGS_H */
+95
arch/arm/mach-spear/include/mach/spear.h
··· 1 + /* 2 + * SPEAr3xx/6xx Machine family specific definition 3 + * 4 + * Copyright (C) 2009,2012 ST Microelectronics 5 + * Rajeev Kumar<rajeev-dlh.kumar@st.com> 6 + * Viresh Kumar <viresh.linux@gmail.com> 7 + * 8 + * This file is licensed under the terms of the GNU General Public 9 + * License version 2. This program is licensed "as is" without any 10 + * warranty of any kind, whether express or implied. 11 + */ 12 + 13 + #ifndef __MACH_SPEAR_H 14 + #define __MACH_SPEAR_H 15 + 16 + #include <asm/memory.h> 17 + 18 + #if defined(CONFIG_ARCH_SPEAR3XX) || defined (CONFIG_ARCH_SPEAR6XX) 19 + 20 + /* ICM1 - Low speed connection */ 21 + #define SPEAR_ICM1_2_BASE UL(0xD0000000) 22 + #define VA_SPEAR_ICM1_2_BASE IOMEM(0xFD000000) 23 + #define SPEAR_ICM1_UART_BASE UL(0xD0000000) 24 + #define VA_SPEAR_ICM1_UART_BASE (VA_SPEAR_ICM1_2_BASE - SPEAR_ICM1_2_BASE + SPEAR_ICM1_UART_BASE) 25 + #define SPEAR3XX_ICM1_SSP_BASE UL(0xD0100000) 26 + 27 + /* ML-1, 2 - Multi Layer CPU Subsystem */ 28 + #define SPEAR_ICM3_ML1_2_BASE UL(0xF0000000) 29 + #define VA_SPEAR6XX_ML_CPU_BASE IOMEM(0xF0000000) 30 + 31 + /* ICM3 - Basic Subsystem */ 32 + #define SPEAR_ICM3_SMI_CTRL_BASE UL(0xFC000000) 33 + #define VA_SPEAR_ICM3_SMI_CTRL_BASE IOMEM(0xFC000000) 34 + #define SPEAR_ICM3_DMA_BASE UL(0xFC400000) 35 + #define SPEAR_ICM3_SYS_CTRL_BASE UL(0xFCA00000) 36 + #define VA_SPEAR_ICM3_SYS_CTRL_BASE (VA_SPEAR_ICM3_SMI_CTRL_BASE - SPEAR_ICM3_SMI_CTRL_BASE + SPEAR_ICM3_SYS_CTRL_BASE) 37 + #define SPEAR_ICM3_MISC_REG_BASE UL(0xFCA80000) 38 + #define VA_SPEAR_ICM3_MISC_REG_BASE (VA_SPEAR_ICM3_SMI_CTRL_BASE - SPEAR_ICM3_SMI_CTRL_BASE + SPEAR_ICM3_MISC_REG_BASE) 39 + 40 + /* Debug uart for linux, will be used for debug and uncompress messages */ 41 + #define SPEAR_DBG_UART_BASE SPEAR_ICM1_UART_BASE 42 + #define VA_SPEAR_DBG_UART_BASE VA_SPEAR_ICM1_UART_BASE 43 + 44 + /* Sysctl base for spear platform */ 45 + #define SPEAR_SYS_CTRL_BASE SPEAR_ICM3_SYS_CTRL_BASE 46 + #define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR_ICM3_SYS_CTRL_BASE 47 + #endif /* SPEAR3xx || SPEAR6XX */ 48 + 49 + /* SPEAr320 Macros */ 50 + #define SPEAR320_SOC_CONFIG_BASE UL(0xB3000000) 51 + #define VA_SPEAR320_SOC_CONFIG_BASE IOMEM(0xFE000000) 52 + 53 + #ifdef CONFIG_ARCH_SPEAR13XX 54 + 55 + #define PERIP_GRP2_BASE UL(0xB3000000) 56 + #define VA_PERIP_GRP2_BASE IOMEM(0xFE000000) 57 + #define MCIF_SDHCI_BASE UL(0xB3000000) 58 + #define SYSRAM0_BASE UL(0xB3800000) 59 + #define VA_SYSRAM0_BASE IOMEM(0xFE800000) 60 + #define SYS_LOCATION (VA_SYSRAM0_BASE + 0x600) 61 + 62 + #define PERIP_GRP1_BASE UL(0xE0000000) 63 + #define VA_PERIP_GRP1_BASE IOMEM(0xFD000000) 64 + #define UART_BASE UL(0xE0000000) 65 + #define VA_UART_BASE IOMEM(0xFD000000) 66 + #define SSP_BASE UL(0xE0100000) 67 + #define MISC_BASE UL(0xE0700000) 68 + #define VA_MISC_BASE IOMEM(0xFD700000) 69 + 70 + #define A9SM_AND_MPMC_BASE UL(0xEC000000) 71 + #define VA_A9SM_AND_MPMC_BASE IOMEM(0xFC000000) 72 + 73 + #define SPEAR1310_RAS_BASE UL(0xD8400000) 74 + #define VA_SPEAR1310_RAS_BASE IOMEM(UL(0xFA400000)) 75 + 76 + /* A9SM peripheral offsets */ 77 + #define A9SM_PERIP_BASE UL(0xEC800000) 78 + #define VA_A9SM_PERIP_BASE IOMEM(0xFC800000) 79 + #define VA_SCU_BASE (VA_A9SM_PERIP_BASE + 0x00) 80 + 81 + #define L2CC_BASE UL(0xED000000) 82 + #define VA_L2CC_BASE IOMEM(UL(0xFB000000)) 83 + 84 + /* others */ 85 + #define DMAC0_BASE UL(0xEA800000) 86 + #define DMAC1_BASE UL(0xEB000000) 87 + #define MCIF_CF_BASE UL(0xB2800000) 88 + 89 + /* Debug uart for linux, will be used for debug and uncompress messages */ 90 + #define SPEAR_DBG_UART_BASE UART_BASE 91 + #define VA_SPEAR_DBG_UART_BASE VA_UART_BASE 92 + 93 + #endif /* SPEAR13XX */ 94 + 95 + #endif /* __MACH_SPEAR_H */
+122
arch/arm/mach-spear/platsmp.c
··· 1 + /* 2 + * arch/arm/mach-spear13xx/platsmp.c 3 + * 4 + * based upon linux/arch/arm/mach-realview/platsmp.c 5 + * 6 + * Copyright (C) 2012 ST Microelectronics Ltd. 7 + * Shiraz Hashim <shiraz.hashim@st.com> 8 + * 9 + * This program is free software; you can redistribute it and/or modify 10 + * it under the terms of the GNU General Public License version 2 as 11 + * published by the Free Software Foundation. 12 + */ 13 + 14 + #include <linux/delay.h> 15 + #include <linux/jiffies.h> 16 + #include <linux/io.h> 17 + #include <linux/smp.h> 18 + #include <asm/cacheflush.h> 19 + #include <asm/smp_scu.h> 20 + #include <mach/spear.h> 21 + #include "generic.h" 22 + 23 + static DEFINE_SPINLOCK(boot_lock); 24 + 25 + static void __iomem *scu_base = IOMEM(VA_SCU_BASE); 26 + 27 + static void __cpuinit spear13xx_secondary_init(unsigned int cpu) 28 + { 29 + /* 30 + * let the primary processor know we're out of the 31 + * pen, then head off into the C entry point 32 + */ 33 + pen_release = -1; 34 + smp_wmb(); 35 + 36 + /* 37 + * Synchronise with the boot thread. 38 + */ 39 + spin_lock(&boot_lock); 40 + spin_unlock(&boot_lock); 41 + } 42 + 43 + static int __cpuinit spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) 44 + { 45 + unsigned long timeout; 46 + 47 + /* 48 + * set synchronisation state between this boot processor 49 + * and the secondary one 50 + */ 51 + spin_lock(&boot_lock); 52 + 53 + /* 54 + * The secondary processor is waiting to be released from 55 + * the holding pen - release it, then wait for it to flag 56 + * that it has been released by resetting pen_release. 57 + * 58 + * Note that "pen_release" is the hardware CPU ID, whereas 59 + * "cpu" is Linux's internal ID. 60 + */ 61 + pen_release = cpu; 62 + flush_cache_all(); 63 + outer_flush_all(); 64 + 65 + timeout = jiffies + (1 * HZ); 66 + while (time_before(jiffies, timeout)) { 67 + smp_rmb(); 68 + if (pen_release == -1) 69 + break; 70 + 71 + udelay(10); 72 + } 73 + 74 + /* 75 + * now the secondary core is starting up let it run its 76 + * calibrations, then wait for it to finish 77 + */ 78 + spin_unlock(&boot_lock); 79 + 80 + return pen_release != -1 ? -ENOSYS : 0; 81 + } 82 + 83 + /* 84 + * Initialise the CPU possible map early - this describes the CPUs 85 + * which may be present or become present in the system. 86 + */ 87 + static void __init spear13xx_smp_init_cpus(void) 88 + { 89 + unsigned int i, ncores = scu_get_core_count(scu_base); 90 + 91 + if (ncores > nr_cpu_ids) { 92 + pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 93 + ncores, nr_cpu_ids); 94 + ncores = nr_cpu_ids; 95 + } 96 + 97 + for (i = 0; i < ncores; i++) 98 + set_cpu_possible(i, true); 99 + } 100 + 101 + static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus) 102 + { 103 + 104 + scu_enable(scu_base); 105 + 106 + /* 107 + * Write the address of secondary startup into the system-wide location 108 + * (presently it is in SRAM). The BootMonitor waits until it receives a 109 + * soft interrupt, and then the secondary CPU branches to this address. 110 + */ 111 + __raw_writel(virt_to_phys(spear13xx_secondary_startup), SYS_LOCATION); 112 + } 113 + 114 + struct smp_operations spear13xx_smp_ops __initdata = { 115 + .smp_init_cpus = spear13xx_smp_init_cpus, 116 + .smp_prepare_cpus = spear13xx_smp_prepare_cpus, 117 + .smp_secondary_init = spear13xx_secondary_init, 118 + .smp_boot_secondary = spear13xx_boot_secondary, 119 + #ifdef CONFIG_HOTPLUG_CPU 120 + .cpu_die = spear13xx_cpu_die, 121 + #endif 122 + };
+34
arch/arm/mach-spear/restart.c
··· 1 + /* 2 + * arch/arm/plat-spear/restart.c 3 + * 4 + * SPEAr platform specific restart functions 5 + * 6 + * Copyright (C) 2009 ST Microelectronics 7 + * Viresh Kumar <viresh.linux@gmail.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 + #include <linux/io.h> 14 + #include <linux/amba/sp810.h> 15 + #include <asm/system_misc.h> 16 + #include <mach/spear.h> 17 + #include "generic.h" 18 + 19 + #define SPEAR13XX_SYS_SW_RES (VA_MISC_BASE + 0x204) 20 + void spear_restart(char mode, const char *cmd) 21 + { 22 + if (mode == 's') { 23 + /* software reset, Jump into ROM at address 0 */ 24 + soft_restart(0); 25 + } else { 26 + /* hardware reset, Use on-chip reset capability */ 27 + #ifdef CONFIG_ARCH_SPEAR13XX 28 + writel_relaxed(0x01, SPEAR13XX_SYS_SW_RES); 29 + #endif 30 + #if defined(CONFIG_ARCH_SPEAR3XX) || defined(CONFIG_ARCH_SPEAR6XX) 31 + sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE); 32 + #endif 33 + } 34 + }
+96
arch/arm/mach-spear/spear1310.c
··· 1 + /* 2 + * arch/arm/mach-spear13xx/spear1310.c 3 + * 4 + * SPEAr1310 machine source file 5 + * 6 + * Copyright (C) 2012 ST Microelectronics 7 + * Viresh Kumar <viresh.linux@gmail.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 + #define pr_fmt(fmt) "SPEAr1310: " fmt 15 + 16 + #include <linux/amba/pl022.h> 17 + #include <linux/irqchip.h> 18 + #include <linux/of_platform.h> 19 + #include <linux/pata_arasan_cf_data.h> 20 + #include <asm/mach/arch.h> 21 + #include <asm/mach/map.h> 22 + #include "generic.h" 23 + #include <mach/spear.h> 24 + 25 + /* Base addresses */ 26 + #define SPEAR1310_SSP1_BASE UL(0x5D400000) 27 + #define SPEAR1310_SATA0_BASE UL(0xB1000000) 28 + #define SPEAR1310_SATA1_BASE UL(0xB1800000) 29 + #define SPEAR1310_SATA2_BASE UL(0xB4000000) 30 + 31 + #define SPEAR1310_RAS_GRP1_BASE UL(0xD8000000) 32 + #define VA_SPEAR1310_RAS_GRP1_BASE UL(0xFA000000) 33 + 34 + static struct arasan_cf_pdata cf_pdata = { 35 + .cf_if_clk = CF_IF_CLK_166M, 36 + .quirk = CF_BROKEN_UDMA, 37 + .dma_priv = &cf_dma_priv, 38 + }; 39 + 40 + /* ssp device registration */ 41 + static struct pl022_ssp_controller ssp1_plat_data = { 42 + .enable_dma = 0, 43 + }; 44 + 45 + /* Add SPEAr1310 auxdata to pass platform data */ 46 + static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = { 47 + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_pdata), 48 + OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data), 49 + OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data), 50 + OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data), 51 + 52 + OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data), 53 + {} 54 + }; 55 + 56 + static void __init spear1310_dt_init(void) 57 + { 58 + of_platform_populate(NULL, of_default_bus_match_table, 59 + spear1310_auxdata_lookup, NULL); 60 + } 61 + 62 + static const char * const spear1310_dt_board_compat[] = { 63 + "st,spear1310", 64 + "st,spear1310-evb", 65 + NULL, 66 + }; 67 + 68 + /* 69 + * Following will create 16MB static virtual/physical mappings 70 + * PHYSICAL VIRTUAL 71 + * 0xD8000000 0xFA000000 72 + */ 73 + struct map_desc spear1310_io_desc[] __initdata = { 74 + { 75 + .virtual = VA_SPEAR1310_RAS_GRP1_BASE, 76 + .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE), 77 + .length = SZ_16M, 78 + .type = MT_DEVICE 79 + }, 80 + }; 81 + 82 + static void __init spear1310_map_io(void) 83 + { 84 + iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc)); 85 + spear13xx_map_io(); 86 + } 87 + 88 + DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree") 89 + .smp = smp_ops(spear13xx_smp_ops), 90 + .map_io = spear1310_map_io, 91 + .init_irq = irqchip_init, 92 + .init_time = spear13xx_timer_init, 93 + .init_machine = spear1310_dt_init, 94 + .restart = spear_restart, 95 + .dt_compat = spear1310_dt_board_compat, 96 + MACHINE_END
+193
arch/arm/mach-spear/spear1340.c
··· 1 + /* 2 + * arch/arm/mach-spear13xx/spear1340.c 3 + * 4 + * SPEAr1340 machine source file 5 + * 6 + * Copyright (C) 2012 ST Microelectronics 7 + * Viresh Kumar <viresh.linux@gmail.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 + #define pr_fmt(fmt) "SPEAr1340: " fmt 15 + 16 + #include <linux/ahci_platform.h> 17 + #include <linux/amba/serial.h> 18 + #include <linux/delay.h> 19 + #include <linux/dw_dmac.h> 20 + #include <linux/of_platform.h> 21 + #include <linux/irqchip.h> 22 + #include <asm/mach/arch.h> 23 + #include "generic.h" 24 + #include <mach/spear.h> 25 + 26 + #include "spear13xx-dma.h" 27 + 28 + /* Base addresses */ 29 + #define SPEAR1340_SATA_BASE UL(0xB1000000) 30 + #define SPEAR1340_UART1_BASE UL(0xB4100000) 31 + 32 + /* Power Management Registers */ 33 + #define SPEAR1340_PCM_CFG (VA_MISC_BASE + 0x100) 34 + #define SPEAR1340_PCM_WKUP_CFG (VA_MISC_BASE + 0x104) 35 + #define SPEAR1340_SWITCH_CTR (VA_MISC_BASE + 0x108) 36 + 37 + #define SPEAR1340_PERIP1_SW_RST (VA_MISC_BASE + 0x318) 38 + #define SPEAR1340_PERIP2_SW_RST (VA_MISC_BASE + 0x31C) 39 + #define SPEAR1340_PERIP3_SW_RST (VA_MISC_BASE + 0x320) 40 + 41 + /* PCIE - SATA configuration registers */ 42 + #define SPEAR1340_PCIE_SATA_CFG (VA_MISC_BASE + 0x424) 43 + /* PCIE CFG MASks */ 44 + #define SPEAR1340_PCIE_CFG_DEVICE_PRESENT (1 << 11) 45 + #define SPEAR1340_PCIE_CFG_POWERUP_RESET (1 << 10) 46 + #define SPEAR1340_PCIE_CFG_CORE_CLK_EN (1 << 9) 47 + #define SPEAR1340_PCIE_CFG_AUX_CLK_EN (1 << 8) 48 + #define SPEAR1340_SATA_CFG_TX_CLK_EN (1 << 4) 49 + #define SPEAR1340_SATA_CFG_RX_CLK_EN (1 << 3) 50 + #define SPEAR1340_SATA_CFG_POWERUP_RESET (1 << 2) 51 + #define SPEAR1340_SATA_CFG_PM_CLK_EN (1 << 1) 52 + #define SPEAR1340_PCIE_SATA_SEL_PCIE (0) 53 + #define SPEAR1340_PCIE_SATA_SEL_SATA (1) 54 + #define SPEAR1340_SATA_PCIE_CFG_MASK 0xF1F 55 + #define SPEAR1340_PCIE_CFG_VAL (SPEAR1340_PCIE_SATA_SEL_PCIE | \ 56 + SPEAR1340_PCIE_CFG_AUX_CLK_EN | \ 57 + SPEAR1340_PCIE_CFG_CORE_CLK_EN | \ 58 + SPEAR1340_PCIE_CFG_POWERUP_RESET | \ 59 + SPEAR1340_PCIE_CFG_DEVICE_PRESENT) 60 + #define SPEAR1340_SATA_CFG_VAL (SPEAR1340_PCIE_SATA_SEL_SATA | \ 61 + SPEAR1340_SATA_CFG_PM_CLK_EN | \ 62 + SPEAR1340_SATA_CFG_POWERUP_RESET | \ 63 + SPEAR1340_SATA_CFG_RX_CLK_EN | \ 64 + SPEAR1340_SATA_CFG_TX_CLK_EN) 65 + 66 + #define SPEAR1340_PCIE_MIPHY_CFG (VA_MISC_BASE + 0x428) 67 + #define SPEAR1340_MIPHY_OSC_BYPASS_EXT (1 << 31) 68 + #define SPEAR1340_MIPHY_CLK_REF_DIV2 (1 << 27) 69 + #define SPEAR1340_MIPHY_CLK_REF_DIV4 (2 << 27) 70 + #define SPEAR1340_MIPHY_CLK_REF_DIV8 (3 << 27) 71 + #define SPEAR1340_MIPHY_PLL_RATIO_TOP(x) (x << 0) 72 + #define SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA \ 73 + (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \ 74 + SPEAR1340_MIPHY_CLK_REF_DIV2 | \ 75 + SPEAR1340_MIPHY_PLL_RATIO_TOP(60)) 76 + #define SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA_25M_CRYSTAL_CLK \ 77 + (SPEAR1340_MIPHY_PLL_RATIO_TOP(120)) 78 + #define SPEAR1340_PCIE_SATA_MIPHY_CFG_PCIE \ 79 + (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \ 80 + SPEAR1340_MIPHY_PLL_RATIO_TOP(25)) 81 + 82 + static struct dw_dma_slave uart1_dma_param[] = { 83 + { 84 + /* Tx */ 85 + .cfg_hi = DWC_CFGH_DST_PER(SPEAR1340_DMA_REQ_UART1_TX), 86 + .cfg_lo = 0, 87 + .src_master = DMA_MASTER_MEMORY, 88 + .dst_master = SPEAR1340_DMA_MASTER_UART1, 89 + }, { 90 + /* Rx */ 91 + .cfg_hi = DWC_CFGH_SRC_PER(SPEAR1340_DMA_REQ_UART1_RX), 92 + .cfg_lo = 0, 93 + .src_master = SPEAR1340_DMA_MASTER_UART1, 94 + .dst_master = DMA_MASTER_MEMORY, 95 + } 96 + }; 97 + 98 + static struct amba_pl011_data uart1_data = { 99 + .dma_filter = dw_dma_filter, 100 + .dma_tx_param = &uart1_dma_param[0], 101 + .dma_rx_param = &uart1_dma_param[1], 102 + }; 103 + 104 + /* SATA device registration */ 105 + static int sata_miphy_init(struct device *dev, void __iomem *addr) 106 + { 107 + writel(SPEAR1340_SATA_CFG_VAL, SPEAR1340_PCIE_SATA_CFG); 108 + writel(SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA_25M_CRYSTAL_CLK, 109 + SPEAR1340_PCIE_MIPHY_CFG); 110 + /* Switch on sata power domain */ 111 + writel((readl(SPEAR1340_PCM_CFG) | (0x800)), SPEAR1340_PCM_CFG); 112 + msleep(20); 113 + /* Disable PCIE SATA Controller reset */ 114 + writel((readl(SPEAR1340_PERIP1_SW_RST) & (~0x1000)), 115 + SPEAR1340_PERIP1_SW_RST); 116 + msleep(20); 117 + 118 + return 0; 119 + } 120 + 121 + void sata_miphy_exit(struct device *dev) 122 + { 123 + writel(0, SPEAR1340_PCIE_SATA_CFG); 124 + writel(0, SPEAR1340_PCIE_MIPHY_CFG); 125 + 126 + /* Enable PCIE SATA Controller reset */ 127 + writel((readl(SPEAR1340_PERIP1_SW_RST) | (0x1000)), 128 + SPEAR1340_PERIP1_SW_RST); 129 + msleep(20); 130 + /* Switch off sata power domain */ 131 + writel((readl(SPEAR1340_PCM_CFG) & (~0x800)), SPEAR1340_PCM_CFG); 132 + msleep(20); 133 + } 134 + 135 + int sata_suspend(struct device *dev) 136 + { 137 + if (dev->power.power_state.event == PM_EVENT_FREEZE) 138 + return 0; 139 + 140 + sata_miphy_exit(dev); 141 + 142 + return 0; 143 + } 144 + 145 + int sata_resume(struct device *dev) 146 + { 147 + if (dev->power.power_state.event == PM_EVENT_THAW) 148 + return 0; 149 + 150 + return sata_miphy_init(dev, NULL); 151 + } 152 + 153 + static struct ahci_platform_data sata_pdata = { 154 + .init = sata_miphy_init, 155 + .exit = sata_miphy_exit, 156 + .suspend = sata_suspend, 157 + .resume = sata_resume, 158 + }; 159 + 160 + /* Add SPEAr1340 auxdata to pass platform data */ 161 + static struct of_dev_auxdata spear1340_auxdata_lookup[] __initdata = { 162 + OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv), 163 + OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data), 164 + OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data), 165 + OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data), 166 + 167 + OF_DEV_AUXDATA("snps,spear-ahci", SPEAR1340_SATA_BASE, NULL, 168 + &sata_pdata), 169 + OF_DEV_AUXDATA("arm,pl011", SPEAR1340_UART1_BASE, NULL, &uart1_data), 170 + {} 171 + }; 172 + 173 + static void __init spear1340_dt_init(void) 174 + { 175 + of_platform_populate(NULL, of_default_bus_match_table, 176 + spear1340_auxdata_lookup, NULL); 177 + } 178 + 179 + static const char * const spear1340_dt_board_compat[] = { 180 + "st,spear1340", 181 + "st,spear1340-evb", 182 + NULL, 183 + }; 184 + 185 + DT_MACHINE_START(SPEAR1340_DT, "ST SPEAr1340 SoC with Flattened Device Tree") 186 + .smp = smp_ops(spear13xx_smp_ops), 187 + .map_io = spear13xx_map_io, 188 + .init_irq = irqchip_init, 189 + .init_time = spear13xx_timer_init, 190 + .init_machine = spear1340_dt_init, 191 + .restart = spear_restart, 192 + .dt_compat = spear1340_dt_board_compat, 193 + MACHINE_END
+184
arch/arm/mach-spear/spear13xx.c
··· 1 + /* 2 + * arch/arm/mach-spear13xx/spear13xx.c 3 + * 4 + * SPEAr13XX machines common source file 5 + * 6 + * Copyright (C) 2012 ST Microelectronics 7 + * Viresh Kumar <viresh.linux@gmail.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 + #define pr_fmt(fmt) "SPEAr13xx: " fmt 15 + 16 + #include <linux/amba/pl022.h> 17 + #include <linux/clk.h> 18 + #include <linux/clocksource.h> 19 + #include <linux/dw_dmac.h> 20 + #include <linux/err.h> 21 + #include <linux/of.h> 22 + #include <asm/hardware/cache-l2x0.h> 23 + #include <asm/mach/map.h> 24 + #include "generic.h" 25 + #include <mach/spear.h> 26 + 27 + #include "spear13xx-dma.h" 28 + 29 + /* common dw_dma filter routine to be used by peripherals */ 30 + bool dw_dma_filter(struct dma_chan *chan, void *slave) 31 + { 32 + struct dw_dma_slave *dws = (struct dw_dma_slave *)slave; 33 + 34 + if (chan->device->dev == dws->dma_dev) { 35 + chan->private = slave; 36 + return true; 37 + } else { 38 + return false; 39 + } 40 + } 41 + 42 + /* ssp device registration */ 43 + static struct dw_dma_slave ssp_dma_param[] = { 44 + { 45 + /* Tx */ 46 + .cfg_hi = DWC_CFGH_DST_PER(DMA_REQ_SSP0_TX), 47 + .cfg_lo = 0, 48 + .src_master = DMA_MASTER_MEMORY, 49 + .dst_master = DMA_MASTER_SSP0, 50 + }, { 51 + /* Rx */ 52 + .cfg_hi = DWC_CFGH_SRC_PER(DMA_REQ_SSP0_RX), 53 + .cfg_lo = 0, 54 + .src_master = DMA_MASTER_SSP0, 55 + .dst_master = DMA_MASTER_MEMORY, 56 + } 57 + }; 58 + 59 + struct pl022_ssp_controller pl022_plat_data = { 60 + .enable_dma = 1, 61 + .dma_filter = dw_dma_filter, 62 + .dma_rx_param = &ssp_dma_param[1], 63 + .dma_tx_param = &ssp_dma_param[0], 64 + }; 65 + 66 + /* CF device registration */ 67 + struct dw_dma_slave cf_dma_priv = { 68 + .cfg_hi = 0, 69 + .cfg_lo = 0, 70 + .src_master = 0, 71 + .dst_master = 0, 72 + }; 73 + 74 + /* dmac device registeration */ 75 + struct dw_dma_platform_data dmac_plat_data = { 76 + .nr_channels = 8, 77 + .chan_allocation_order = CHAN_ALLOCATION_DESCENDING, 78 + .chan_priority = CHAN_PRIORITY_DESCENDING, 79 + .block_size = 4095U, 80 + .nr_masters = 2, 81 + .data_width = { 3, 3, 0, 0 }, 82 + }; 83 + 84 + void __init spear13xx_l2x0_init(void) 85 + { 86 + /* 87 + * 512KB (64KB/way), 8-way associativity, parity supported 88 + * 89 + * FIXME: 9th bit, of Auxillary Controller register must be set 90 + * for some spear13xx devices for stable L2 operation. 91 + * 92 + * Enable Early BRESP, L2 prefetch for Instruction and Data, 93 + * write alloc and 'Full line of zero' options 94 + * 95 + */ 96 + 97 + writel_relaxed(0x06, VA_L2CC_BASE + L2X0_PREFETCH_CTRL); 98 + 99 + /* 100 + * Program following latencies in order to make 101 + * SPEAr1340 work at 600 MHz 102 + */ 103 + writel_relaxed(0x221, VA_L2CC_BASE + L2X0_TAG_LATENCY_CTRL); 104 + writel_relaxed(0x441, VA_L2CC_BASE + L2X0_DATA_LATENCY_CTRL); 105 + l2x0_init(VA_L2CC_BASE, 0x70A60001, 0xfe00ffff); 106 + } 107 + 108 + /* 109 + * Following will create 16MB static virtual/physical mappings 110 + * PHYSICAL VIRTUAL 111 + * 0xB3000000 0xFE000000 112 + * 0xE0000000 0xFD000000 113 + * 0xEC000000 0xFC000000 114 + * 0xED000000 0xFB000000 115 + */ 116 + struct map_desc spear13xx_io_desc[] __initdata = { 117 + { 118 + .virtual = (unsigned long)VA_PERIP_GRP2_BASE, 119 + .pfn = __phys_to_pfn(PERIP_GRP2_BASE), 120 + .length = SZ_16M, 121 + .type = MT_DEVICE 122 + }, { 123 + .virtual = (unsigned long)VA_PERIP_GRP1_BASE, 124 + .pfn = __phys_to_pfn(PERIP_GRP1_BASE), 125 + .length = SZ_16M, 126 + .type = MT_DEVICE 127 + }, { 128 + .virtual = (unsigned long)VA_A9SM_AND_MPMC_BASE, 129 + .pfn = __phys_to_pfn(A9SM_AND_MPMC_BASE), 130 + .length = SZ_16M, 131 + .type = MT_DEVICE 132 + }, { 133 + .virtual = (unsigned long)VA_L2CC_BASE, 134 + .pfn = __phys_to_pfn(L2CC_BASE), 135 + .length = SZ_4K, 136 + .type = MT_DEVICE 137 + }, 138 + }; 139 + 140 + /* This will create static memory mapping for selected devices */ 141 + void __init spear13xx_map_io(void) 142 + { 143 + iotable_init(spear13xx_io_desc, ARRAY_SIZE(spear13xx_io_desc)); 144 + } 145 + 146 + static void __init spear13xx_clk_init(void) 147 + { 148 + if (of_machine_is_compatible("st,spear1310")) 149 + spear1310_clk_init(VA_MISC_BASE, VA_SPEAR1310_RAS_BASE); 150 + else if (of_machine_is_compatible("st,spear1340")) 151 + spear1340_clk_init(VA_MISC_BASE); 152 + else 153 + pr_err("%s: Unknown machine\n", __func__); 154 + } 155 + 156 + void __init spear13xx_timer_init(void) 157 + { 158 + char pclk_name[] = "osc_24m_clk"; 159 + struct clk *gpt_clk, *pclk; 160 + 161 + spear13xx_clk_init(); 162 + 163 + /* get the system timer clock */ 164 + gpt_clk = clk_get_sys("gpt0", NULL); 165 + if (IS_ERR(gpt_clk)) { 166 + pr_err("%s:couldn't get clk for gpt\n", __func__); 167 + BUG(); 168 + } 169 + 170 + /* get the suitable parent clock for timer*/ 171 + pclk = clk_get(NULL, pclk_name); 172 + if (IS_ERR(pclk)) { 173 + pr_err("%s:couldn't get %s as parent for gpt\n", __func__, 174 + pclk_name); 175 + BUG(); 176 + } 177 + 178 + clk_set_parent(gpt_clk, pclk); 179 + clk_put(gpt_clk); 180 + clk_put(pclk); 181 + 182 + spear_setup_of_timer(); 183 + clocksource_of_init(); 184 + }
+220
arch/arm/mach-spear/spear300.c
··· 1 + /* 2 + * arch/arm/mach-spear3xx/spear300.c 3 + * 4 + * SPEAr300 machine source file 5 + * 6 + * Copyright (C) 2009-2012 ST Microelectronics 7 + * Viresh Kumar <viresh.linux@gmail.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 + #define pr_fmt(fmt) "SPEAr300: " fmt 15 + 16 + #include <linux/amba/pl08x.h> 17 + #include <linux/irqchip.h> 18 + #include <linux/of_platform.h> 19 + #include <asm/mach/arch.h> 20 + #include "generic.h" 21 + #include <mach/spear.h> 22 + 23 + /* DMAC platform data's slave info */ 24 + struct pl08x_channel_data spear300_dma_info[] = { 25 + { 26 + .bus_id = "uart0_rx", 27 + .min_signal = 2, 28 + .max_signal = 2, 29 + .muxval = 0, 30 + .periph_buses = PL08X_AHB1, 31 + }, { 32 + .bus_id = "uart0_tx", 33 + .min_signal = 3, 34 + .max_signal = 3, 35 + .muxval = 0, 36 + .periph_buses = PL08X_AHB1, 37 + }, { 38 + .bus_id = "ssp0_rx", 39 + .min_signal = 8, 40 + .max_signal = 8, 41 + .muxval = 0, 42 + .periph_buses = PL08X_AHB1, 43 + }, { 44 + .bus_id = "ssp0_tx", 45 + .min_signal = 9, 46 + .max_signal = 9, 47 + .muxval = 0, 48 + .periph_buses = PL08X_AHB1, 49 + }, { 50 + .bus_id = "i2c_rx", 51 + .min_signal = 10, 52 + .max_signal = 10, 53 + .muxval = 0, 54 + .periph_buses = PL08X_AHB1, 55 + }, { 56 + .bus_id = "i2c_tx", 57 + .min_signal = 11, 58 + .max_signal = 11, 59 + .muxval = 0, 60 + .periph_buses = PL08X_AHB1, 61 + }, { 62 + .bus_id = "irda", 63 + .min_signal = 12, 64 + .max_signal = 12, 65 + .muxval = 0, 66 + .periph_buses = PL08X_AHB1, 67 + }, { 68 + .bus_id = "adc", 69 + .min_signal = 13, 70 + .max_signal = 13, 71 + .muxval = 0, 72 + .periph_buses = PL08X_AHB1, 73 + }, { 74 + .bus_id = "to_jpeg", 75 + .min_signal = 14, 76 + .max_signal = 14, 77 + .muxval = 0, 78 + .periph_buses = PL08X_AHB1, 79 + }, { 80 + .bus_id = "from_jpeg", 81 + .min_signal = 15, 82 + .max_signal = 15, 83 + .muxval = 0, 84 + .periph_buses = PL08X_AHB1, 85 + }, { 86 + .bus_id = "ras0_rx", 87 + .min_signal = 0, 88 + .max_signal = 0, 89 + .muxval = 1, 90 + .periph_buses = PL08X_AHB1, 91 + }, { 92 + .bus_id = "ras0_tx", 93 + .min_signal = 1, 94 + .max_signal = 1, 95 + .muxval = 1, 96 + .periph_buses = PL08X_AHB1, 97 + }, { 98 + .bus_id = "ras1_rx", 99 + .min_signal = 2, 100 + .max_signal = 2, 101 + .muxval = 1, 102 + .periph_buses = PL08X_AHB1, 103 + }, { 104 + .bus_id = "ras1_tx", 105 + .min_signal = 3, 106 + .max_signal = 3, 107 + .muxval = 1, 108 + .periph_buses = PL08X_AHB1, 109 + }, { 110 + .bus_id = "ras2_rx", 111 + .min_signal = 4, 112 + .max_signal = 4, 113 + .muxval = 1, 114 + .periph_buses = PL08X_AHB1, 115 + }, { 116 + .bus_id = "ras2_tx", 117 + .min_signal = 5, 118 + .max_signal = 5, 119 + .muxval = 1, 120 + .periph_buses = PL08X_AHB1, 121 + }, { 122 + .bus_id = "ras3_rx", 123 + .min_signal = 6, 124 + .max_signal = 6, 125 + .muxval = 1, 126 + .periph_buses = PL08X_AHB1, 127 + }, { 128 + .bus_id = "ras3_tx", 129 + .min_signal = 7, 130 + .max_signal = 7, 131 + .muxval = 1, 132 + .periph_buses = PL08X_AHB1, 133 + }, { 134 + .bus_id = "ras4_rx", 135 + .min_signal = 8, 136 + .max_signal = 8, 137 + .muxval = 1, 138 + .periph_buses = PL08X_AHB1, 139 + }, { 140 + .bus_id = "ras4_tx", 141 + .min_signal = 9, 142 + .max_signal = 9, 143 + .muxval = 1, 144 + .periph_buses = PL08X_AHB1, 145 + }, { 146 + .bus_id = "ras5_rx", 147 + .min_signal = 10, 148 + .max_signal = 10, 149 + .muxval = 1, 150 + .periph_buses = PL08X_AHB1, 151 + }, { 152 + .bus_id = "ras5_tx", 153 + .min_signal = 11, 154 + .max_signal = 11, 155 + .muxval = 1, 156 + .periph_buses = PL08X_AHB1, 157 + }, { 158 + .bus_id = "ras6_rx", 159 + .min_signal = 12, 160 + .max_signal = 12, 161 + .muxval = 1, 162 + .periph_buses = PL08X_AHB1, 163 + }, { 164 + .bus_id = "ras6_tx", 165 + .min_signal = 13, 166 + .max_signal = 13, 167 + .muxval = 1, 168 + .periph_buses = PL08X_AHB1, 169 + }, { 170 + .bus_id = "ras7_rx", 171 + .min_signal = 14, 172 + .max_signal = 14, 173 + .muxval = 1, 174 + .periph_buses = PL08X_AHB1, 175 + }, { 176 + .bus_id = "ras7_tx", 177 + .min_signal = 15, 178 + .max_signal = 15, 179 + .muxval = 1, 180 + .periph_buses = PL08X_AHB1, 181 + }, 182 + }; 183 + 184 + /* Add SPEAr300 auxdata to pass platform data */ 185 + static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = { 186 + OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, 187 + &pl022_plat_data), 188 + OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL, 189 + &pl080_plat_data), 190 + {} 191 + }; 192 + 193 + static void __init spear300_dt_init(void) 194 + { 195 + pl080_plat_data.slave_channels = spear300_dma_info; 196 + pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info); 197 + 198 + of_platform_populate(NULL, of_default_bus_match_table, 199 + spear300_auxdata_lookup, NULL); 200 + } 201 + 202 + static const char * const spear300_dt_board_compat[] = { 203 + "st,spear300", 204 + "st,spear300-evb", 205 + NULL, 206 + }; 207 + 208 + static void __init spear300_map_io(void) 209 + { 210 + spear3xx_map_io(); 211 + } 212 + 213 + DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree") 214 + .map_io = spear300_map_io, 215 + .init_irq = irqchip_init, 216 + .init_time = spear3xx_timer_init, 217 + .init_machine = spear300_dt_init, 218 + .restart = spear_restart, 219 + .dt_compat = spear300_dt_board_compat, 220 + MACHINE_END
+262
arch/arm/mach-spear/spear310.c
··· 1 + /* 2 + * arch/arm/mach-spear3xx/spear310.c 3 + * 4 + * SPEAr310 machine source file 5 + * 6 + * Copyright (C) 2009-2012 ST Microelectronics 7 + * Viresh Kumar <viresh.linux@gmail.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 + #define pr_fmt(fmt) "SPEAr310: " fmt 15 + 16 + #include <linux/amba/pl08x.h> 17 + #include <linux/amba/serial.h> 18 + #include <linux/irqchip.h> 19 + #include <linux/of_platform.h> 20 + #include <asm/mach/arch.h> 21 + #include "generic.h" 22 + #include <mach/spear.h> 23 + 24 + #define SPEAR310_UART1_BASE UL(0xB2000000) 25 + #define SPEAR310_UART2_BASE UL(0xB2080000) 26 + #define SPEAR310_UART3_BASE UL(0xB2100000) 27 + #define SPEAR310_UART4_BASE UL(0xB2180000) 28 + #define SPEAR310_UART5_BASE UL(0xB2200000) 29 + 30 + /* DMAC platform data's slave info */ 31 + struct pl08x_channel_data spear310_dma_info[] = { 32 + { 33 + .bus_id = "uart0_rx", 34 + .min_signal = 2, 35 + .max_signal = 2, 36 + .muxval = 0, 37 + .periph_buses = PL08X_AHB1, 38 + }, { 39 + .bus_id = "uart0_tx", 40 + .min_signal = 3, 41 + .max_signal = 3, 42 + .muxval = 0, 43 + .periph_buses = PL08X_AHB1, 44 + }, { 45 + .bus_id = "ssp0_rx", 46 + .min_signal = 8, 47 + .max_signal = 8, 48 + .muxval = 0, 49 + .periph_buses = PL08X_AHB1, 50 + }, { 51 + .bus_id = "ssp0_tx", 52 + .min_signal = 9, 53 + .max_signal = 9, 54 + .muxval = 0, 55 + .periph_buses = PL08X_AHB1, 56 + }, { 57 + .bus_id = "i2c_rx", 58 + .min_signal = 10, 59 + .max_signal = 10, 60 + .muxval = 0, 61 + .periph_buses = PL08X_AHB1, 62 + }, { 63 + .bus_id = "i2c_tx", 64 + .min_signal = 11, 65 + .max_signal = 11, 66 + .muxval = 0, 67 + .periph_buses = PL08X_AHB1, 68 + }, { 69 + .bus_id = "irda", 70 + .min_signal = 12, 71 + .max_signal = 12, 72 + .muxval = 0, 73 + .periph_buses = PL08X_AHB1, 74 + }, { 75 + .bus_id = "adc", 76 + .min_signal = 13, 77 + .max_signal = 13, 78 + .muxval = 0, 79 + .periph_buses = PL08X_AHB1, 80 + }, { 81 + .bus_id = "to_jpeg", 82 + .min_signal = 14, 83 + .max_signal = 14, 84 + .muxval = 0, 85 + .periph_buses = PL08X_AHB1, 86 + }, { 87 + .bus_id = "from_jpeg", 88 + .min_signal = 15, 89 + .max_signal = 15, 90 + .muxval = 0, 91 + .periph_buses = PL08X_AHB1, 92 + }, { 93 + .bus_id = "uart1_rx", 94 + .min_signal = 0, 95 + .max_signal = 0, 96 + .muxval = 1, 97 + .periph_buses = PL08X_AHB1, 98 + }, { 99 + .bus_id = "uart1_tx", 100 + .min_signal = 1, 101 + .max_signal = 1, 102 + .muxval = 1, 103 + .periph_buses = PL08X_AHB1, 104 + }, { 105 + .bus_id = "uart2_rx", 106 + .min_signal = 2, 107 + .max_signal = 2, 108 + .muxval = 1, 109 + .periph_buses = PL08X_AHB1, 110 + }, { 111 + .bus_id = "uart2_tx", 112 + .min_signal = 3, 113 + .max_signal = 3, 114 + .muxval = 1, 115 + .periph_buses = PL08X_AHB1, 116 + }, { 117 + .bus_id = "uart3_rx", 118 + .min_signal = 4, 119 + .max_signal = 4, 120 + .muxval = 1, 121 + .periph_buses = PL08X_AHB1, 122 + }, { 123 + .bus_id = "uart3_tx", 124 + .min_signal = 5, 125 + .max_signal = 5, 126 + .muxval = 1, 127 + .periph_buses = PL08X_AHB1, 128 + }, { 129 + .bus_id = "uart4_rx", 130 + .min_signal = 6, 131 + .max_signal = 6, 132 + .muxval = 1, 133 + .periph_buses = PL08X_AHB1, 134 + }, { 135 + .bus_id = "uart4_tx", 136 + .min_signal = 7, 137 + .max_signal = 7, 138 + .muxval = 1, 139 + .periph_buses = PL08X_AHB1, 140 + }, { 141 + .bus_id = "uart5_rx", 142 + .min_signal = 8, 143 + .max_signal = 8, 144 + .muxval = 1, 145 + .periph_buses = PL08X_AHB1, 146 + }, { 147 + .bus_id = "uart5_tx", 148 + .min_signal = 9, 149 + .max_signal = 9, 150 + .muxval = 1, 151 + .periph_buses = PL08X_AHB1, 152 + }, { 153 + .bus_id = "ras5_rx", 154 + .min_signal = 10, 155 + .max_signal = 10, 156 + .muxval = 1, 157 + .periph_buses = PL08X_AHB1, 158 + }, { 159 + .bus_id = "ras5_tx", 160 + .min_signal = 11, 161 + .max_signal = 11, 162 + .muxval = 1, 163 + .periph_buses = PL08X_AHB1, 164 + }, { 165 + .bus_id = "ras6_rx", 166 + .min_signal = 12, 167 + .max_signal = 12, 168 + .muxval = 1, 169 + .periph_buses = PL08X_AHB1, 170 + }, { 171 + .bus_id = "ras6_tx", 172 + .min_signal = 13, 173 + .max_signal = 13, 174 + .muxval = 1, 175 + .periph_buses = PL08X_AHB1, 176 + }, { 177 + .bus_id = "ras7_rx", 178 + .min_signal = 14, 179 + .max_signal = 14, 180 + .muxval = 1, 181 + .periph_buses = PL08X_AHB1, 182 + }, { 183 + .bus_id = "ras7_tx", 184 + .min_signal = 15, 185 + .max_signal = 15, 186 + .muxval = 1, 187 + .periph_buses = PL08X_AHB1, 188 + }, 189 + }; 190 + 191 + /* uart devices plat data */ 192 + static struct amba_pl011_data spear310_uart_data[] = { 193 + { 194 + .dma_filter = pl08x_filter_id, 195 + .dma_tx_param = "uart1_tx", 196 + .dma_rx_param = "uart1_rx", 197 + }, { 198 + .dma_filter = pl08x_filter_id, 199 + .dma_tx_param = "uart2_tx", 200 + .dma_rx_param = "uart2_rx", 201 + }, { 202 + .dma_filter = pl08x_filter_id, 203 + .dma_tx_param = "uart3_tx", 204 + .dma_rx_param = "uart3_rx", 205 + }, { 206 + .dma_filter = pl08x_filter_id, 207 + .dma_tx_param = "uart4_tx", 208 + .dma_rx_param = "uart4_rx", 209 + }, { 210 + .dma_filter = pl08x_filter_id, 211 + .dma_tx_param = "uart5_tx", 212 + .dma_rx_param = "uart5_rx", 213 + }, 214 + }; 215 + 216 + /* Add SPEAr310 auxdata to pass platform data */ 217 + static struct of_dev_auxdata spear310_auxdata_lookup[] __initdata = { 218 + OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, 219 + &pl022_plat_data), 220 + OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL, 221 + &pl080_plat_data), 222 + OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART1_BASE, NULL, 223 + &spear310_uart_data[0]), 224 + OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART2_BASE, NULL, 225 + &spear310_uart_data[1]), 226 + OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART3_BASE, NULL, 227 + &spear310_uart_data[2]), 228 + OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART4_BASE, NULL, 229 + &spear310_uart_data[3]), 230 + OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART5_BASE, NULL, 231 + &spear310_uart_data[4]), 232 + {} 233 + }; 234 + 235 + static void __init spear310_dt_init(void) 236 + { 237 + pl080_plat_data.slave_channels = spear310_dma_info; 238 + pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear310_dma_info); 239 + 240 + of_platform_populate(NULL, of_default_bus_match_table, 241 + spear310_auxdata_lookup, NULL); 242 + } 243 + 244 + static const char * const spear310_dt_board_compat[] = { 245 + "st,spear310", 246 + "st,spear310-evb", 247 + NULL, 248 + }; 249 + 250 + static void __init spear310_map_io(void) 251 + { 252 + spear3xx_map_io(); 253 + } 254 + 255 + DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree") 256 + .map_io = spear310_map_io, 257 + .init_irq = irqchip_init, 258 + .init_time = spear3xx_timer_init, 259 + .init_machine = spear310_dt_init, 260 + .restart = spear_restart, 261 + .dt_compat = spear310_dt_board_compat, 262 + MACHINE_END
+277
arch/arm/mach-spear/spear320.c
··· 1 + /* 2 + * arch/arm/mach-spear3xx/spear320.c 3 + * 4 + * SPEAr320 machine source file 5 + * 6 + * Copyright (C) 2009-2012 ST Microelectronics 7 + * Viresh Kumar <viresh.linux@gmail.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 + #define pr_fmt(fmt) "SPEAr320: " fmt 15 + 16 + #include <linux/amba/pl022.h> 17 + #include <linux/amba/pl08x.h> 18 + #include <linux/amba/serial.h> 19 + #include <linux/irqchip.h> 20 + #include <linux/of_platform.h> 21 + #include <asm/mach/arch.h> 22 + #include <asm/mach/map.h> 23 + #include "generic.h" 24 + #include <mach/spear.h> 25 + 26 + #define SPEAR320_UART1_BASE UL(0xA3000000) 27 + #define SPEAR320_UART2_BASE UL(0xA4000000) 28 + #define SPEAR320_SSP0_BASE UL(0xA5000000) 29 + #define SPEAR320_SSP1_BASE UL(0xA6000000) 30 + 31 + /* DMAC platform data's slave info */ 32 + struct pl08x_channel_data spear320_dma_info[] = { 33 + { 34 + .bus_id = "uart0_rx", 35 + .min_signal = 2, 36 + .max_signal = 2, 37 + .muxval = 0, 38 + .periph_buses = PL08X_AHB1, 39 + }, { 40 + .bus_id = "uart0_tx", 41 + .min_signal = 3, 42 + .max_signal = 3, 43 + .muxval = 0, 44 + .periph_buses = PL08X_AHB1, 45 + }, { 46 + .bus_id = "ssp0_rx", 47 + .min_signal = 8, 48 + .max_signal = 8, 49 + .muxval = 0, 50 + .periph_buses = PL08X_AHB1, 51 + }, { 52 + .bus_id = "ssp0_tx", 53 + .min_signal = 9, 54 + .max_signal = 9, 55 + .muxval = 0, 56 + .periph_buses = PL08X_AHB1, 57 + }, { 58 + .bus_id = "i2c0_rx", 59 + .min_signal = 10, 60 + .max_signal = 10, 61 + .muxval = 0, 62 + .periph_buses = PL08X_AHB1, 63 + }, { 64 + .bus_id = "i2c0_tx", 65 + .min_signal = 11, 66 + .max_signal = 11, 67 + .muxval = 0, 68 + .periph_buses = PL08X_AHB1, 69 + }, { 70 + .bus_id = "irda", 71 + .min_signal = 12, 72 + .max_signal = 12, 73 + .muxval = 0, 74 + .periph_buses = PL08X_AHB1, 75 + }, { 76 + .bus_id = "adc", 77 + .min_signal = 13, 78 + .max_signal = 13, 79 + .muxval = 0, 80 + .periph_buses = PL08X_AHB1, 81 + }, { 82 + .bus_id = "to_jpeg", 83 + .min_signal = 14, 84 + .max_signal = 14, 85 + .muxval = 0, 86 + .periph_buses = PL08X_AHB1, 87 + }, { 88 + .bus_id = "from_jpeg", 89 + .min_signal = 15, 90 + .max_signal = 15, 91 + .muxval = 0, 92 + .periph_buses = PL08X_AHB1, 93 + }, { 94 + .bus_id = "ssp1_rx", 95 + .min_signal = 0, 96 + .max_signal = 0, 97 + .muxval = 1, 98 + .periph_buses = PL08X_AHB2, 99 + }, { 100 + .bus_id = "ssp1_tx", 101 + .min_signal = 1, 102 + .max_signal = 1, 103 + .muxval = 1, 104 + .periph_buses = PL08X_AHB2, 105 + }, { 106 + .bus_id = "ssp2_rx", 107 + .min_signal = 2, 108 + .max_signal = 2, 109 + .muxval = 1, 110 + .periph_buses = PL08X_AHB2, 111 + }, { 112 + .bus_id = "ssp2_tx", 113 + .min_signal = 3, 114 + .max_signal = 3, 115 + .muxval = 1, 116 + .periph_buses = PL08X_AHB2, 117 + }, { 118 + .bus_id = "uart1_rx", 119 + .min_signal = 4, 120 + .max_signal = 4, 121 + .muxval = 1, 122 + .periph_buses = PL08X_AHB2, 123 + }, { 124 + .bus_id = "uart1_tx", 125 + .min_signal = 5, 126 + .max_signal = 5, 127 + .muxval = 1, 128 + .periph_buses = PL08X_AHB2, 129 + }, { 130 + .bus_id = "uart2_rx", 131 + .min_signal = 6, 132 + .max_signal = 6, 133 + .muxval = 1, 134 + .periph_buses = PL08X_AHB2, 135 + }, { 136 + .bus_id = "uart2_tx", 137 + .min_signal = 7, 138 + .max_signal = 7, 139 + .muxval = 1, 140 + .periph_buses = PL08X_AHB2, 141 + }, { 142 + .bus_id = "i2c1_rx", 143 + .min_signal = 8, 144 + .max_signal = 8, 145 + .muxval = 1, 146 + .periph_buses = PL08X_AHB2, 147 + }, { 148 + .bus_id = "i2c1_tx", 149 + .min_signal = 9, 150 + .max_signal = 9, 151 + .muxval = 1, 152 + .periph_buses = PL08X_AHB2, 153 + }, { 154 + .bus_id = "i2c2_rx", 155 + .min_signal = 10, 156 + .max_signal = 10, 157 + .muxval = 1, 158 + .periph_buses = PL08X_AHB2, 159 + }, { 160 + .bus_id = "i2c2_tx", 161 + .min_signal = 11, 162 + .max_signal = 11, 163 + .muxval = 1, 164 + .periph_buses = PL08X_AHB2, 165 + }, { 166 + .bus_id = "i2s_rx", 167 + .min_signal = 12, 168 + .max_signal = 12, 169 + .muxval = 1, 170 + .periph_buses = PL08X_AHB2, 171 + }, { 172 + .bus_id = "i2s_tx", 173 + .min_signal = 13, 174 + .max_signal = 13, 175 + .muxval = 1, 176 + .periph_buses = PL08X_AHB2, 177 + }, { 178 + .bus_id = "rs485_rx", 179 + .min_signal = 14, 180 + .max_signal = 14, 181 + .muxval = 1, 182 + .periph_buses = PL08X_AHB2, 183 + }, { 184 + .bus_id = "rs485_tx", 185 + .min_signal = 15, 186 + .max_signal = 15, 187 + .muxval = 1, 188 + .periph_buses = PL08X_AHB2, 189 + }, 190 + }; 191 + 192 + static struct pl022_ssp_controller spear320_ssp_data[] = { 193 + { 194 + .bus_id = 1, 195 + .enable_dma = 1, 196 + .dma_filter = pl08x_filter_id, 197 + .dma_tx_param = "ssp1_tx", 198 + .dma_rx_param = "ssp1_rx", 199 + .num_chipselect = 2, 200 + }, { 201 + .bus_id = 2, 202 + .enable_dma = 1, 203 + .dma_filter = pl08x_filter_id, 204 + .dma_tx_param = "ssp2_tx", 205 + .dma_rx_param = "ssp2_rx", 206 + .num_chipselect = 2, 207 + } 208 + }; 209 + 210 + static struct amba_pl011_data spear320_uart_data[] = { 211 + { 212 + .dma_filter = pl08x_filter_id, 213 + .dma_tx_param = "uart1_tx", 214 + .dma_rx_param = "uart1_rx", 215 + }, { 216 + .dma_filter = pl08x_filter_id, 217 + .dma_tx_param = "uart2_tx", 218 + .dma_rx_param = "uart2_rx", 219 + }, 220 + }; 221 + 222 + /* Add SPEAr310 auxdata to pass platform data */ 223 + static struct of_dev_auxdata spear320_auxdata_lookup[] __initdata = { 224 + OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, 225 + &pl022_plat_data), 226 + OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL, 227 + &pl080_plat_data), 228 + OF_DEV_AUXDATA("arm,pl022", SPEAR320_SSP0_BASE, NULL, 229 + &spear320_ssp_data[0]), 230 + OF_DEV_AUXDATA("arm,pl022", SPEAR320_SSP1_BASE, NULL, 231 + &spear320_ssp_data[1]), 232 + OF_DEV_AUXDATA("arm,pl011", SPEAR320_UART1_BASE, NULL, 233 + &spear320_uart_data[0]), 234 + OF_DEV_AUXDATA("arm,pl011", SPEAR320_UART2_BASE, NULL, 235 + &spear320_uart_data[1]), 236 + {} 237 + }; 238 + 239 + static void __init spear320_dt_init(void) 240 + { 241 + pl080_plat_data.slave_channels = spear320_dma_info; 242 + pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear320_dma_info); 243 + 244 + of_platform_populate(NULL, of_default_bus_match_table, 245 + spear320_auxdata_lookup, NULL); 246 + } 247 + 248 + static const char * const spear320_dt_board_compat[] = { 249 + "st,spear320", 250 + "st,spear320-evb", 251 + "st,spear320-hmi", 252 + NULL, 253 + }; 254 + 255 + struct map_desc spear320_io_desc[] __initdata = { 256 + { 257 + .virtual = (unsigned long)VA_SPEAR320_SOC_CONFIG_BASE, 258 + .pfn = __phys_to_pfn(SPEAR320_SOC_CONFIG_BASE), 259 + .length = SZ_16M, 260 + .type = MT_DEVICE 261 + }, 262 + }; 263 + 264 + static void __init spear320_map_io(void) 265 + { 266 + iotable_init(spear320_io_desc, ARRAY_SIZE(spear320_io_desc)); 267 + spear3xx_map_io(); 268 + } 269 + 270 + DT_MACHINE_START(SPEAR320_DT, "ST SPEAr320 SoC with Flattened Device Tree") 271 + .map_io = spear320_map_io, 272 + .init_irq = irqchip_init, 273 + .init_time = spear3xx_timer_init, 274 + .init_machine = spear320_dt_init, 275 + .restart = spear_restart, 276 + .dt_compat = spear320_dt_board_compat, 277 + MACHINE_END
+116
arch/arm/mach-spear/spear3xx.c
··· 1 + /* 2 + * arch/arm/mach-spear3xx/spear3xx.c 3 + * 4 + * SPEAr3XX machines common source file 5 + * 6 + * Copyright (C) 2009-2012 ST Microelectronics 7 + * Viresh Kumar <viresh.linux@gmail.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 + #define pr_fmt(fmt) "SPEAr3xx: " fmt 15 + 16 + #include <linux/amba/pl022.h> 17 + #include <linux/amba/pl080.h> 18 + #include <linux/clk.h> 19 + #include <linux/io.h> 20 + #include <asm/mach/map.h> 21 + #include "pl080.h" 22 + #include "generic.h" 23 + #include <mach/spear.h> 24 + #include <mach/misc_regs.h> 25 + 26 + /* ssp device registration */ 27 + struct pl022_ssp_controller pl022_plat_data = { 28 + .bus_id = 0, 29 + .enable_dma = 1, 30 + .dma_filter = pl08x_filter_id, 31 + .dma_tx_param = "ssp0_tx", 32 + .dma_rx_param = "ssp0_rx", 33 + /* 34 + * This is number of spi devices that can be connected to spi. There are 35 + * two type of chipselects on which slave devices can work. One is chip 36 + * select provided by spi masters other is controlled through external 37 + * gpio's. We can't use chipselect provided from spi master (because as 38 + * soon as FIFO becomes empty, CS is disabled and transfer ends). So 39 + * this number now depends on number of gpios available for spi. each 40 + * slave on each master requires a separate gpio pin. 41 + */ 42 + .num_chipselect = 2, 43 + }; 44 + 45 + /* dmac device registration */ 46 + struct pl08x_platform_data pl080_plat_data = { 47 + .memcpy_channel = { 48 + .bus_id = "memcpy", 49 + .cctl_memcpy = 50 + (PL080_BSIZE_16 << PL080_CONTROL_SB_SIZE_SHIFT | \ 51 + PL080_BSIZE_16 << PL080_CONTROL_DB_SIZE_SHIFT | \ 52 + PL080_WIDTH_32BIT << PL080_CONTROL_SWIDTH_SHIFT | \ 53 + PL080_WIDTH_32BIT << PL080_CONTROL_DWIDTH_SHIFT | \ 54 + PL080_CONTROL_PROT_BUFF | PL080_CONTROL_PROT_CACHE | \ 55 + PL080_CONTROL_PROT_SYS), 56 + }, 57 + .lli_buses = PL08X_AHB1, 58 + .mem_buses = PL08X_AHB1, 59 + .get_signal = pl080_get_signal, 60 + .put_signal = pl080_put_signal, 61 + }; 62 + 63 + /* 64 + * Following will create 16MB static virtual/physical mappings 65 + * PHYSICAL VIRTUAL 66 + * 0xD0000000 0xFD000000 67 + * 0xFC000000 0xFC000000 68 + */ 69 + struct map_desc spear3xx_io_desc[] __initdata = { 70 + { 71 + .virtual = (unsigned long)VA_SPEAR_ICM1_2_BASE, 72 + .pfn = __phys_to_pfn(SPEAR_ICM1_2_BASE), 73 + .length = SZ_16M, 74 + .type = MT_DEVICE 75 + }, { 76 + .virtual = (unsigned long)VA_SPEAR_ICM3_SMI_CTRL_BASE, 77 + .pfn = __phys_to_pfn(SPEAR_ICM3_SMI_CTRL_BASE), 78 + .length = SZ_16M, 79 + .type = MT_DEVICE 80 + }, 81 + }; 82 + 83 + /* This will create static memory mapping for selected devices */ 84 + void __init spear3xx_map_io(void) 85 + { 86 + iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc)); 87 + } 88 + 89 + void __init spear3xx_timer_init(void) 90 + { 91 + char pclk_name[] = "pll3_clk"; 92 + struct clk *gpt_clk, *pclk; 93 + 94 + spear3xx_clk_init(MISC_BASE, VA_SPEAR320_SOC_CONFIG_BASE); 95 + 96 + /* get the system timer clock */ 97 + gpt_clk = clk_get_sys("gpt0", NULL); 98 + if (IS_ERR(gpt_clk)) { 99 + pr_err("%s:couldn't get clk for gpt\n", __func__); 100 + BUG(); 101 + } 102 + 103 + /* get the suitable parent clock for timer*/ 104 + pclk = clk_get(NULL, pclk_name); 105 + if (IS_ERR(pclk)) { 106 + pr_err("%s:couldn't get %s as parent for gpt\n", 107 + __func__, pclk_name); 108 + BUG(); 109 + } 110 + 111 + clk_set_parent(gpt_clk, pclk); 112 + clk_put(gpt_clk); 113 + clk_put(pclk); 114 + 115 + spear_setup_of_timer(); 116 + }
+431
arch/arm/mach-spear/spear6xx.c
··· 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 + * Copyright 2012 Stefan Roese <sr@denx.de> 10 + * 11 + * This file is licensed under the terms of the GNU General Public 12 + * License version 2. This program is licensed "as is" without any 13 + * warranty of any kind, whether express or implied. 14 + */ 15 + 16 + #include <linux/amba/pl08x.h> 17 + #include <linux/clk.h> 18 + #include <linux/err.h> 19 + #include <linux/irqchip.h> 20 + #include <linux/of.h> 21 + #include <linux/of_address.h> 22 + #include <linux/of_platform.h> 23 + #include <linux/amba/pl080.h> 24 + #include <asm/mach/arch.h> 25 + #include <asm/mach/time.h> 26 + #include <asm/mach/map.h> 27 + #include "pl080.h" 28 + #include "generic.h" 29 + #include <mach/spear.h> 30 + #include <mach/misc_regs.h> 31 + 32 + /* dmac device registration */ 33 + static struct pl08x_channel_data spear600_dma_info[] = { 34 + { 35 + .bus_id = "ssp1_rx", 36 + .min_signal = 0, 37 + .max_signal = 0, 38 + .muxval = 0, 39 + .periph_buses = PL08X_AHB1, 40 + }, { 41 + .bus_id = "ssp1_tx", 42 + .min_signal = 1, 43 + .max_signal = 1, 44 + .muxval = 0, 45 + .periph_buses = PL08X_AHB1, 46 + }, { 47 + .bus_id = "uart0_rx", 48 + .min_signal = 2, 49 + .max_signal = 2, 50 + .muxval = 0, 51 + .periph_buses = PL08X_AHB1, 52 + }, { 53 + .bus_id = "uart0_tx", 54 + .min_signal = 3, 55 + .max_signal = 3, 56 + .muxval = 0, 57 + .periph_buses = PL08X_AHB1, 58 + }, { 59 + .bus_id = "uart1_rx", 60 + .min_signal = 4, 61 + .max_signal = 4, 62 + .muxval = 0, 63 + .periph_buses = PL08X_AHB1, 64 + }, { 65 + .bus_id = "uart1_tx", 66 + .min_signal = 5, 67 + .max_signal = 5, 68 + .muxval = 0, 69 + .periph_buses = PL08X_AHB1, 70 + }, { 71 + .bus_id = "ssp2_rx", 72 + .min_signal = 6, 73 + .max_signal = 6, 74 + .muxval = 0, 75 + .periph_buses = PL08X_AHB2, 76 + }, { 77 + .bus_id = "ssp2_tx", 78 + .min_signal = 7, 79 + .max_signal = 7, 80 + .muxval = 0, 81 + .periph_buses = PL08X_AHB2, 82 + }, { 83 + .bus_id = "ssp0_rx", 84 + .min_signal = 8, 85 + .max_signal = 8, 86 + .muxval = 0, 87 + .periph_buses = PL08X_AHB1, 88 + }, { 89 + .bus_id = "ssp0_tx", 90 + .min_signal = 9, 91 + .max_signal = 9, 92 + .muxval = 0, 93 + .periph_buses = PL08X_AHB1, 94 + }, { 95 + .bus_id = "i2c_rx", 96 + .min_signal = 10, 97 + .max_signal = 10, 98 + .muxval = 0, 99 + .periph_buses = PL08X_AHB1, 100 + }, { 101 + .bus_id = "i2c_tx", 102 + .min_signal = 11, 103 + .max_signal = 11, 104 + .muxval = 0, 105 + .periph_buses = PL08X_AHB1, 106 + }, { 107 + .bus_id = "irda", 108 + .min_signal = 12, 109 + .max_signal = 12, 110 + .muxval = 0, 111 + .periph_buses = PL08X_AHB1, 112 + }, { 113 + .bus_id = "adc", 114 + .min_signal = 13, 115 + .max_signal = 13, 116 + .muxval = 0, 117 + .periph_buses = PL08X_AHB2, 118 + }, { 119 + .bus_id = "to_jpeg", 120 + .min_signal = 14, 121 + .max_signal = 14, 122 + .muxval = 0, 123 + .periph_buses = PL08X_AHB1, 124 + }, { 125 + .bus_id = "from_jpeg", 126 + .min_signal = 15, 127 + .max_signal = 15, 128 + .muxval = 0, 129 + .periph_buses = PL08X_AHB1, 130 + }, { 131 + .bus_id = "ras0_rx", 132 + .min_signal = 0, 133 + .max_signal = 0, 134 + .muxval = 1, 135 + .periph_buses = PL08X_AHB1, 136 + }, { 137 + .bus_id = "ras0_tx", 138 + .min_signal = 1, 139 + .max_signal = 1, 140 + .muxval = 1, 141 + .periph_buses = PL08X_AHB1, 142 + }, { 143 + .bus_id = "ras1_rx", 144 + .min_signal = 2, 145 + .max_signal = 2, 146 + .muxval = 1, 147 + .periph_buses = PL08X_AHB1, 148 + }, { 149 + .bus_id = "ras1_tx", 150 + .min_signal = 3, 151 + .max_signal = 3, 152 + .muxval = 1, 153 + .periph_buses = PL08X_AHB1, 154 + }, { 155 + .bus_id = "ras2_rx", 156 + .min_signal = 4, 157 + .max_signal = 4, 158 + .muxval = 1, 159 + .periph_buses = PL08X_AHB1, 160 + }, { 161 + .bus_id = "ras2_tx", 162 + .min_signal = 5, 163 + .max_signal = 5, 164 + .muxval = 1, 165 + .periph_buses = PL08X_AHB1, 166 + }, { 167 + .bus_id = "ras3_rx", 168 + .min_signal = 6, 169 + .max_signal = 6, 170 + .muxval = 1, 171 + .periph_buses = PL08X_AHB1, 172 + }, { 173 + .bus_id = "ras3_tx", 174 + .min_signal = 7, 175 + .max_signal = 7, 176 + .muxval = 1, 177 + .periph_buses = PL08X_AHB1, 178 + }, { 179 + .bus_id = "ras4_rx", 180 + .min_signal = 8, 181 + .max_signal = 8, 182 + .muxval = 1, 183 + .periph_buses = PL08X_AHB1, 184 + }, { 185 + .bus_id = "ras4_tx", 186 + .min_signal = 9, 187 + .max_signal = 9, 188 + .muxval = 1, 189 + .periph_buses = PL08X_AHB1, 190 + }, { 191 + .bus_id = "ras5_rx", 192 + .min_signal = 10, 193 + .max_signal = 10, 194 + .muxval = 1, 195 + .periph_buses = PL08X_AHB1, 196 + }, { 197 + .bus_id = "ras5_tx", 198 + .min_signal = 11, 199 + .max_signal = 11, 200 + .muxval = 1, 201 + .periph_buses = PL08X_AHB1, 202 + }, { 203 + .bus_id = "ras6_rx", 204 + .min_signal = 12, 205 + .max_signal = 12, 206 + .muxval = 1, 207 + .periph_buses = PL08X_AHB1, 208 + }, { 209 + .bus_id = "ras6_tx", 210 + .min_signal = 13, 211 + .max_signal = 13, 212 + .muxval = 1, 213 + .periph_buses = PL08X_AHB1, 214 + }, { 215 + .bus_id = "ras7_rx", 216 + .min_signal = 14, 217 + .max_signal = 14, 218 + .muxval = 1, 219 + .periph_buses = PL08X_AHB1, 220 + }, { 221 + .bus_id = "ras7_tx", 222 + .min_signal = 15, 223 + .max_signal = 15, 224 + .muxval = 1, 225 + .periph_buses = PL08X_AHB1, 226 + }, { 227 + .bus_id = "ext0_rx", 228 + .min_signal = 0, 229 + .max_signal = 0, 230 + .muxval = 2, 231 + .periph_buses = PL08X_AHB2, 232 + }, { 233 + .bus_id = "ext0_tx", 234 + .min_signal = 1, 235 + .max_signal = 1, 236 + .muxval = 2, 237 + .periph_buses = PL08X_AHB2, 238 + }, { 239 + .bus_id = "ext1_rx", 240 + .min_signal = 2, 241 + .max_signal = 2, 242 + .muxval = 2, 243 + .periph_buses = PL08X_AHB2, 244 + }, { 245 + .bus_id = "ext1_tx", 246 + .min_signal = 3, 247 + .max_signal = 3, 248 + .muxval = 2, 249 + .periph_buses = PL08X_AHB2, 250 + }, { 251 + .bus_id = "ext2_rx", 252 + .min_signal = 4, 253 + .max_signal = 4, 254 + .muxval = 2, 255 + .periph_buses = PL08X_AHB2, 256 + }, { 257 + .bus_id = "ext2_tx", 258 + .min_signal = 5, 259 + .max_signal = 5, 260 + .muxval = 2, 261 + .periph_buses = PL08X_AHB2, 262 + }, { 263 + .bus_id = "ext3_rx", 264 + .min_signal = 6, 265 + .max_signal = 6, 266 + .muxval = 2, 267 + .periph_buses = PL08X_AHB2, 268 + }, { 269 + .bus_id = "ext3_tx", 270 + .min_signal = 7, 271 + .max_signal = 7, 272 + .muxval = 2, 273 + .periph_buses = PL08X_AHB2, 274 + }, { 275 + .bus_id = "ext4_rx", 276 + .min_signal = 8, 277 + .max_signal = 8, 278 + .muxval = 2, 279 + .periph_buses = PL08X_AHB2, 280 + }, { 281 + .bus_id = "ext4_tx", 282 + .min_signal = 9, 283 + .max_signal = 9, 284 + .muxval = 2, 285 + .periph_buses = PL08X_AHB2, 286 + }, { 287 + .bus_id = "ext5_rx", 288 + .min_signal = 10, 289 + .max_signal = 10, 290 + .muxval = 2, 291 + .periph_buses = PL08X_AHB2, 292 + }, { 293 + .bus_id = "ext5_tx", 294 + .min_signal = 11, 295 + .max_signal = 11, 296 + .muxval = 2, 297 + .periph_buses = PL08X_AHB2, 298 + }, { 299 + .bus_id = "ext6_rx", 300 + .min_signal = 12, 301 + .max_signal = 12, 302 + .muxval = 2, 303 + .periph_buses = PL08X_AHB2, 304 + }, { 305 + .bus_id = "ext6_tx", 306 + .min_signal = 13, 307 + .max_signal = 13, 308 + .muxval = 2, 309 + .periph_buses = PL08X_AHB2, 310 + }, { 311 + .bus_id = "ext7_rx", 312 + .min_signal = 14, 313 + .max_signal = 14, 314 + .muxval = 2, 315 + .periph_buses = PL08X_AHB2, 316 + }, { 317 + .bus_id = "ext7_tx", 318 + .min_signal = 15, 319 + .max_signal = 15, 320 + .muxval = 2, 321 + .periph_buses = PL08X_AHB2, 322 + }, 323 + }; 324 + 325 + static struct pl08x_platform_data spear6xx_pl080_plat_data = { 326 + .memcpy_channel = { 327 + .bus_id = "memcpy", 328 + .cctl_memcpy = 329 + (PL080_BSIZE_16 << PL080_CONTROL_SB_SIZE_SHIFT | \ 330 + PL080_BSIZE_16 << PL080_CONTROL_DB_SIZE_SHIFT | \ 331 + PL080_WIDTH_32BIT << PL080_CONTROL_SWIDTH_SHIFT | \ 332 + PL080_WIDTH_32BIT << PL080_CONTROL_DWIDTH_SHIFT | \ 333 + PL080_CONTROL_PROT_BUFF | PL080_CONTROL_PROT_CACHE | \ 334 + PL080_CONTROL_PROT_SYS), 335 + }, 336 + .lli_buses = PL08X_AHB1, 337 + .mem_buses = PL08X_AHB1, 338 + .get_signal = pl080_get_signal, 339 + .put_signal = pl080_put_signal, 340 + .slave_channels = spear600_dma_info, 341 + .num_slave_channels = ARRAY_SIZE(spear600_dma_info), 342 + }; 343 + 344 + /* 345 + * Following will create 16MB static virtual/physical mappings 346 + * PHYSICAL VIRTUAL 347 + * 0xF0000000 0xF0000000 348 + * 0xF1000000 0xF1000000 349 + * 0xD0000000 0xFD000000 350 + * 0xFC000000 0xFC000000 351 + */ 352 + struct map_desc spear6xx_io_desc[] __initdata = { 353 + { 354 + .virtual = (unsigned long)VA_SPEAR6XX_ML_CPU_BASE, 355 + .pfn = __phys_to_pfn(SPEAR_ICM3_ML1_2_BASE), 356 + .length = 2 * SZ_16M, 357 + .type = MT_DEVICE 358 + }, { 359 + .virtual = (unsigned long)VA_SPEAR_ICM1_2_BASE, 360 + .pfn = __phys_to_pfn(SPEAR_ICM1_2_BASE), 361 + .length = SZ_16M, 362 + .type = MT_DEVICE 363 + }, { 364 + .virtual = (unsigned long)VA_SPEAR_ICM3_SMI_CTRL_BASE, 365 + .pfn = __phys_to_pfn(SPEAR_ICM3_SMI_CTRL_BASE), 366 + .length = SZ_16M, 367 + .type = MT_DEVICE 368 + }, 369 + }; 370 + 371 + /* This will create static memory mapping for selected devices */ 372 + void __init spear6xx_map_io(void) 373 + { 374 + iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); 375 + } 376 + 377 + void __init spear6xx_timer_init(void) 378 + { 379 + char pclk_name[] = "pll3_clk"; 380 + struct clk *gpt_clk, *pclk; 381 + 382 + spear6xx_clk_init(MISC_BASE); 383 + 384 + /* get the system timer clock */ 385 + gpt_clk = clk_get_sys("gpt0", NULL); 386 + if (IS_ERR(gpt_clk)) { 387 + pr_err("%s:couldn't get clk for gpt\n", __func__); 388 + BUG(); 389 + } 390 + 391 + /* get the suitable parent clock for timer*/ 392 + pclk = clk_get(NULL, pclk_name); 393 + if (IS_ERR(pclk)) { 394 + pr_err("%s:couldn't get %s as parent for gpt\n", 395 + __func__, pclk_name); 396 + BUG(); 397 + } 398 + 399 + clk_set_parent(gpt_clk, pclk); 400 + clk_put(gpt_clk); 401 + clk_put(pclk); 402 + 403 + spear_setup_of_timer(); 404 + } 405 + 406 + /* Add auxdata to pass platform data */ 407 + struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = { 408 + OF_DEV_AUXDATA("arm,pl080", SPEAR_ICM3_DMA_BASE, NULL, 409 + &spear6xx_pl080_plat_data), 410 + {} 411 + }; 412 + 413 + static void __init spear600_dt_init(void) 414 + { 415 + of_platform_populate(NULL, of_default_bus_match_table, 416 + spear6xx_auxdata_lookup, NULL); 417 + } 418 + 419 + static const char *spear600_dt_board_compat[] = { 420 + "st,spear600", 421 + NULL 422 + }; 423 + 424 + DT_MACHINE_START(SPEAR600_DT, "ST SPEAr600 (Flattened Device Tree)") 425 + .map_io = spear6xx_map_io, 426 + .init_irq = irqchip_init, 427 + .init_time = spear6xx_timer_init, 428 + .init_machine = spear600_dt_init, 429 + .restart = spear_restart, 430 + .dt_compat = spear600_dt_board_compat, 431 + MACHINE_END
+245
arch/arm/mach-spear/time.c
··· 1 + /* 2 + * arch/arm/plat-spear/time.c 3 + * 4 + * Copyright (C) 2010 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/ioport.h> 19 + #include <linux/io.h> 20 + #include <linux/kernel.h> 21 + #include <linux/of_irq.h> 22 + #include <linux/of_address.h> 23 + #include <linux/time.h> 24 + #include <linux/irq.h> 25 + #include <asm/mach/time.h> 26 + #include "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 + /* 62 + * Minimum clocksource/clockevent timer range in seconds 63 + */ 64 + #define SPEAR_MIN_RANGE 4 65 + 66 + static __iomem void *gpt_base; 67 + static struct clk *gpt_clk; 68 + 69 + static void clockevent_set_mode(enum clock_event_mode mode, 70 + struct clock_event_device *clk_event_dev); 71 + static int clockevent_next_event(unsigned long evt, 72 + struct clock_event_device *clk_event_dev); 73 + 74 + static void spear_clocksource_init(void) 75 + { 76 + u32 tick_rate; 77 + u16 val; 78 + 79 + /* program the prescaler (/256)*/ 80 + writew(CTRL_PRESCALER256, gpt_base + CR(CLKSRC)); 81 + 82 + /* find out actual clock driving Timer */ 83 + tick_rate = clk_get_rate(gpt_clk); 84 + tick_rate >>= CTRL_PRESCALER256; 85 + 86 + writew(0xFFFF, gpt_base + LOAD(CLKSRC)); 87 + 88 + val = readw(gpt_base + CR(CLKSRC)); 89 + val &= ~CTRL_ONE_SHOT; /* autoreload mode */ 90 + val |= CTRL_ENABLE ; 91 + writew(val, gpt_base + CR(CLKSRC)); 92 + 93 + /* register the clocksource */ 94 + clocksource_mmio_init(gpt_base + COUNT(CLKSRC), "tmr1", tick_rate, 95 + 200, 16, clocksource_mmio_readw_up); 96 + } 97 + 98 + static struct clock_event_device clkevt = { 99 + .name = "tmr0", 100 + .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 101 + .set_mode = clockevent_set_mode, 102 + .set_next_event = clockevent_next_event, 103 + .shift = 0, /* to be computed */ 104 + }; 105 + 106 + static void clockevent_set_mode(enum clock_event_mode mode, 107 + struct clock_event_device *clk_event_dev) 108 + { 109 + u32 period; 110 + u16 val; 111 + 112 + /* stop the timer */ 113 + val = readw(gpt_base + CR(CLKEVT)); 114 + val &= ~CTRL_ENABLE; 115 + writew(val, gpt_base + CR(CLKEVT)); 116 + 117 + switch (mode) { 118 + case CLOCK_EVT_MODE_PERIODIC: 119 + period = clk_get_rate(gpt_clk) / HZ; 120 + period >>= CTRL_PRESCALER16; 121 + writew(period, gpt_base + LOAD(CLKEVT)); 122 + 123 + val = readw(gpt_base + CR(CLKEVT)); 124 + val &= ~CTRL_ONE_SHOT; 125 + val |= CTRL_ENABLE | CTRL_INT_ENABLE; 126 + writew(val, gpt_base + CR(CLKEVT)); 127 + 128 + break; 129 + case CLOCK_EVT_MODE_ONESHOT: 130 + val = readw(gpt_base + CR(CLKEVT)); 131 + val |= CTRL_ONE_SHOT; 132 + writew(val, gpt_base + CR(CLKEVT)); 133 + 134 + break; 135 + case CLOCK_EVT_MODE_UNUSED: 136 + case CLOCK_EVT_MODE_SHUTDOWN: 137 + case CLOCK_EVT_MODE_RESUME: 138 + 139 + break; 140 + default: 141 + pr_err("Invalid mode requested\n"); 142 + break; 143 + } 144 + } 145 + 146 + static int clockevent_next_event(unsigned long cycles, 147 + struct clock_event_device *clk_event_dev) 148 + { 149 + u16 val = readw(gpt_base + CR(CLKEVT)); 150 + 151 + if (val & CTRL_ENABLE) 152 + writew(val & ~CTRL_ENABLE, gpt_base + CR(CLKEVT)); 153 + 154 + writew(cycles, gpt_base + LOAD(CLKEVT)); 155 + 156 + val |= CTRL_ENABLE | CTRL_INT_ENABLE; 157 + writew(val, gpt_base + CR(CLKEVT)); 158 + 159 + return 0; 160 + } 161 + 162 + static irqreturn_t spear_timer_interrupt(int irq, void *dev_id) 163 + { 164 + struct clock_event_device *evt = &clkevt; 165 + 166 + writew(INT_STATUS, gpt_base + IR(CLKEVT)); 167 + 168 + evt->event_handler(evt); 169 + 170 + return IRQ_HANDLED; 171 + } 172 + 173 + static struct irqaction spear_timer_irq = { 174 + .name = "timer", 175 + .flags = IRQF_DISABLED | IRQF_TIMER, 176 + .handler = spear_timer_interrupt 177 + }; 178 + 179 + static void __init spear_clockevent_init(int irq) 180 + { 181 + u32 tick_rate; 182 + 183 + /* program the prescaler */ 184 + writew(CTRL_PRESCALER16, gpt_base + CR(CLKEVT)); 185 + 186 + tick_rate = clk_get_rate(gpt_clk); 187 + tick_rate >>= CTRL_PRESCALER16; 188 + 189 + clkevt.cpumask = cpumask_of(0); 190 + 191 + clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0); 192 + 193 + setup_irq(irq, &spear_timer_irq); 194 + } 195 + 196 + const static struct of_device_id timer_of_match[] __initconst = { 197 + { .compatible = "st,spear-timer", }, 198 + { }, 199 + }; 200 + 201 + void __init spear_setup_of_timer(void) 202 + { 203 + struct device_node *np; 204 + int irq, ret; 205 + 206 + np = of_find_matching_node(NULL, timer_of_match); 207 + if (!np) { 208 + pr_err("%s: No timer passed via DT\n", __func__); 209 + return; 210 + } 211 + 212 + irq = irq_of_parse_and_map(np, 0); 213 + if (!irq) { 214 + pr_err("%s: No irq passed for timer via DT\n", __func__); 215 + return; 216 + } 217 + 218 + gpt_base = of_iomap(np, 0); 219 + if (!gpt_base) { 220 + pr_err("%s: of iomap failed\n", __func__); 221 + return; 222 + } 223 + 224 + gpt_clk = clk_get_sys("gpt0", NULL); 225 + if (!gpt_clk) { 226 + pr_err("%s:couldn't get clk for gpt\n", __func__); 227 + goto err_iomap; 228 + } 229 + 230 + ret = clk_prepare_enable(gpt_clk); 231 + if (ret < 0) { 232 + pr_err("%s:couldn't prepare-enable gpt clock\n", __func__); 233 + goto err_prepare_enable_clk; 234 + } 235 + 236 + spear_clockevent_init(irq); 237 + spear_clocksource_init(); 238 + 239 + return; 240 + 241 + err_prepare_enable_clk: 242 + clk_put(gpt_clk); 243 + err_iomap: 244 + iounmap(gpt_base); 245 + }
-20
arch/arm/mach-spear13xx/Kconfig
··· 1 - # 2 - # SPEAr13XX Machine configuration file 3 - # 4 - 5 - if ARCH_SPEAR13XX 6 - 7 - menu "SPEAr13xx Implementations" 8 - config MACH_SPEAR1310 9 - bool "SPEAr1310 Machine support with Device Tree" 10 - select PINCTRL_SPEAR1310 11 - help 12 - Supports ST SPEAr1310 machine configured via the device-tree 13 - 14 - config MACH_SPEAR1340 15 - bool "SPEAr1340 Machine support with Device Tree" 16 - select PINCTRL_SPEAR1340 17 - help 18 - Supports ST SPEAr1340 machine configured via the device-tree 19 - endmenu 20 - endif #ARCH_SPEAR13XX
-10
arch/arm/mach-spear13xx/Makefile
··· 1 - # 2 - # Makefile for SPEAr13XX machine series 3 - # 4 - 5 - obj-$(CONFIG_SMP) += headsmp.o platsmp.o 6 - obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 7 - 8 - obj-$(CONFIG_ARCH_SPEAR13XX) += spear13xx.o 9 - obj-$(CONFIG_MACH_SPEAR1310) += spear1310.o 10 - obj-$(CONFIG_MACH_SPEAR1340) += spear1340.o
arch/arm/mach-spear13xx/Makefile.boot arch/arm/mach-spear/Makefile.boot
arch/arm/mach-spear13xx/headsmp.S arch/arm/mach-spear/headsmp.S
arch/arm/mach-spear13xx/hotplug.c arch/arm/mach-spear/hotplug.c
-14
arch/arm/mach-spear13xx/include/mach/debug-macro.S
··· 1 - /* 2 - * arch/arm/mach-spear13xx/include/mach/debug-macro.S 3 - * 4 - * Debugging macro include header spear13xx machine family 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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>
arch/arm/mach-spear13xx/include/mach/dma.h arch/arm/mach-spear/spear13xx-dma.h
-51
arch/arm/mach-spear13xx/include/mach/generic.h
··· 1 - /* 2 - * arch/arm/mach-spear13xx/include/mach/generic.h 3 - * 4 - * spear13xx machine family generic header file 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 <linux/dmaengine.h> 18 - #include <asm/mach/time.h> 19 - 20 - /* Add spear13xx structure declarations here */ 21 - extern void spear13xx_timer_init(void); 22 - extern struct pl022_ssp_controller pl022_plat_data; 23 - extern struct dw_dma_platform_data dmac_plat_data; 24 - extern struct dw_dma_slave cf_dma_priv; 25 - extern struct dw_dma_slave nand_read_dma_priv; 26 - extern struct dw_dma_slave nand_write_dma_priv; 27 - 28 - /* Add spear13xx family function declarations here */ 29 - void __init spear_setup_of_timer(void); 30 - void __init spear13xx_map_io(void); 31 - void __init spear13xx_l2x0_init(void); 32 - bool dw_dma_filter(struct dma_chan *chan, void *slave); 33 - void spear_restart(char, const char *); 34 - void spear13xx_secondary_startup(void); 35 - void __cpuinit spear13xx_cpu_die(unsigned int cpu); 36 - 37 - extern struct smp_operations spear13xx_smp_ops; 38 - 39 - #ifdef CONFIG_MACH_SPEAR1310 40 - void __init spear1310_clk_init(void); 41 - #else 42 - static inline void spear1310_clk_init(void) {} 43 - #endif 44 - 45 - #ifdef CONFIG_MACH_SPEAR1340 46 - void __init spear1340_clk_init(void); 47 - #else 48 - static inline void spear1340_clk_init(void) {} 49 - #endif 50 - 51 - #endif /* __MACH_GENERIC_H */
-1
arch/arm/mach-spear13xx/include/mach/hardware.h
··· 1 - /* empty */
-20
arch/arm/mach-spear13xx/include/mach/irqs.h
··· 1 - /* 2 - * arch/arm/mach-spear13xx/include/mach/irqs.h 3 - * 4 - * IRQ helper macros for spear13xx machine family 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #define IRQ_GIC_END 160 18 - #define NR_IRQS IRQ_GIC_END 19 - 20 - #endif /* __MACH_IRQS_H */
-54
arch/arm/mach-spear13xx/include/mach/spear.h
··· 1 - /* 2 - * arch/arm/mach-spear13xx/include/mach/spear.h 3 - * 4 - * spear13xx Machine family specific definition 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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_SPEAR13XX_H 15 - #define __MACH_SPEAR13XX_H 16 - 17 - #include <asm/memory.h> 18 - 19 - #define PERIP_GRP2_BASE UL(0xB3000000) 20 - #define VA_PERIP_GRP2_BASE IOMEM(0xFE000000) 21 - #define MCIF_SDHCI_BASE UL(0xB3000000) 22 - #define SYSRAM0_BASE UL(0xB3800000) 23 - #define VA_SYSRAM0_BASE IOMEM(0xFE800000) 24 - #define SYS_LOCATION (VA_SYSRAM0_BASE + 0x600) 25 - 26 - #define PERIP_GRP1_BASE UL(0xE0000000) 27 - #define VA_PERIP_GRP1_BASE IOMEM(0xFD000000) 28 - #define UART_BASE UL(0xE0000000) 29 - #define VA_UART_BASE IOMEM(0xFD000000) 30 - #define SSP_BASE UL(0xE0100000) 31 - #define MISC_BASE UL(0xE0700000) 32 - #define VA_MISC_BASE IOMEM(0xFD700000) 33 - 34 - #define A9SM_AND_MPMC_BASE UL(0xEC000000) 35 - #define VA_A9SM_AND_MPMC_BASE IOMEM(0xFC000000) 36 - 37 - /* A9SM peripheral offsets */ 38 - #define A9SM_PERIP_BASE UL(0xEC800000) 39 - #define VA_A9SM_PERIP_BASE IOMEM(0xFC800000) 40 - #define VA_SCU_BASE (VA_A9SM_PERIP_BASE + 0x00) 41 - 42 - #define L2CC_BASE UL(0xED000000) 43 - #define VA_L2CC_BASE IOMEM(UL(0xFB000000)) 44 - 45 - /* others */ 46 - #define DMAC0_BASE UL(0xEA800000) 47 - #define DMAC1_BASE UL(0xEB000000) 48 - #define MCIF_CF_BASE UL(0xB2800000) 49 - 50 - /* Debug uart for linux, will be used for debug and uncompress messages */ 51 - #define SPEAR_DBG_UART_BASE UART_BASE 52 - #define VA_SPEAR_DBG_UART_BASE VA_UART_BASE 53 - 54 - #endif /* __MACH_SPEAR13XX_H */
-19
arch/arm/mach-spear13xx/include/mach/timex.h
··· 1 - /* 2 - * arch/arm/mach-spear3xx/include/mach/timex.h 3 - * 4 - * SPEAr3XX machine family specific timex definitions 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 */
-19
arch/arm/mach-spear13xx/include/mach/uncompress.h
··· 1 - /* 2 - * arch/arm/mach-spear13xx/include/mach/uncompress.h 3 - * 4 - * Serial port stubs for kernel decompress status messages 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 */
-122
arch/arm/mach-spear13xx/platsmp.c
··· 1 - /* 2 - * arch/arm/mach-spear13xx/platsmp.c 3 - * 4 - * based upon linux/arch/arm/mach-realview/platsmp.c 5 - * 6 - * Copyright (C) 2012 ST Microelectronics Ltd. 7 - * Shiraz Hashim <shiraz.hashim@st.com> 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License version 2 as 11 - * published by the Free Software Foundation. 12 - */ 13 - 14 - #include <linux/delay.h> 15 - #include <linux/jiffies.h> 16 - #include <linux/io.h> 17 - #include <linux/smp.h> 18 - #include <asm/cacheflush.h> 19 - #include <asm/smp_scu.h> 20 - #include <mach/spear.h> 21 - #include <mach/generic.h> 22 - 23 - static DEFINE_SPINLOCK(boot_lock); 24 - 25 - static void __iomem *scu_base = IOMEM(VA_SCU_BASE); 26 - 27 - static void __cpuinit spear13xx_secondary_init(unsigned int cpu) 28 - { 29 - /* 30 - * let the primary processor know we're out of the 31 - * pen, then head off into the C entry point 32 - */ 33 - pen_release = -1; 34 - smp_wmb(); 35 - 36 - /* 37 - * Synchronise with the boot thread. 38 - */ 39 - spin_lock(&boot_lock); 40 - spin_unlock(&boot_lock); 41 - } 42 - 43 - static int __cpuinit spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle) 44 - { 45 - unsigned long timeout; 46 - 47 - /* 48 - * set synchronisation state between this boot processor 49 - * and the secondary one 50 - */ 51 - spin_lock(&boot_lock); 52 - 53 - /* 54 - * The secondary processor is waiting to be released from 55 - * the holding pen - release it, then wait for it to flag 56 - * that it has been released by resetting pen_release. 57 - * 58 - * Note that "pen_release" is the hardware CPU ID, whereas 59 - * "cpu" is Linux's internal ID. 60 - */ 61 - pen_release = cpu; 62 - flush_cache_all(); 63 - outer_flush_all(); 64 - 65 - timeout = jiffies + (1 * HZ); 66 - while (time_before(jiffies, timeout)) { 67 - smp_rmb(); 68 - if (pen_release == -1) 69 - break; 70 - 71 - udelay(10); 72 - } 73 - 74 - /* 75 - * now the secondary core is starting up let it run its 76 - * calibrations, then wait for it to finish 77 - */ 78 - spin_unlock(&boot_lock); 79 - 80 - return pen_release != -1 ? -ENOSYS : 0; 81 - } 82 - 83 - /* 84 - * Initialise the CPU possible map early - this describes the CPUs 85 - * which may be present or become present in the system. 86 - */ 87 - static void __init spear13xx_smp_init_cpus(void) 88 - { 89 - unsigned int i, ncores = scu_get_core_count(scu_base); 90 - 91 - if (ncores > nr_cpu_ids) { 92 - pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 93 - ncores, nr_cpu_ids); 94 - ncores = nr_cpu_ids; 95 - } 96 - 97 - for (i = 0; i < ncores; i++) 98 - set_cpu_possible(i, true); 99 - } 100 - 101 - static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus) 102 - { 103 - 104 - scu_enable(scu_base); 105 - 106 - /* 107 - * Write the address of secondary startup into the system-wide location 108 - * (presently it is in SRAM). The BootMonitor waits until it receives a 109 - * soft interrupt, and then the secondary CPU branches to this address. 110 - */ 111 - __raw_writel(virt_to_phys(spear13xx_secondary_startup), SYS_LOCATION); 112 - } 113 - 114 - struct smp_operations spear13xx_smp_ops __initdata = { 115 - .smp_init_cpus = spear13xx_smp_init_cpus, 116 - .smp_prepare_cpus = spear13xx_smp_prepare_cpus, 117 - .smp_secondary_init = spear13xx_secondary_init, 118 - .smp_boot_secondary = spear13xx_boot_secondary, 119 - #ifdef CONFIG_HOTPLUG_CPU 120 - .cpu_die = spear13xx_cpu_die, 121 - #endif 122 - };
-98
arch/arm/mach-spear13xx/spear1310.c
··· 1 - /* 2 - * arch/arm/mach-spear13xx/spear1310.c 3 - * 4 - * SPEAr1310 machine source file 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #define pr_fmt(fmt) "SPEAr1310: " fmt 15 - 16 - #include <linux/amba/pl022.h> 17 - #include <linux/irqchip.h> 18 - #include <linux/of_platform.h> 19 - #include <linux/pata_arasan_cf_data.h> 20 - #include <asm/mach/arch.h> 21 - #include <asm/mach/map.h> 22 - #include <mach/generic.h> 23 - #include <mach/spear.h> 24 - 25 - /* Base addresses */ 26 - #define SPEAR1310_SSP1_BASE UL(0x5D400000) 27 - #define SPEAR1310_SATA0_BASE UL(0xB1000000) 28 - #define SPEAR1310_SATA1_BASE UL(0xB1800000) 29 - #define SPEAR1310_SATA2_BASE UL(0xB4000000) 30 - 31 - #define SPEAR1310_RAS_GRP1_BASE UL(0xD8000000) 32 - #define VA_SPEAR1310_RAS_GRP1_BASE UL(0xFA000000) 33 - #define SPEAR1310_RAS_BASE UL(0xD8400000) 34 - #define VA_SPEAR1310_RAS_BASE IOMEM(UL(0xFA400000)) 35 - 36 - static struct arasan_cf_pdata cf_pdata = { 37 - .cf_if_clk = CF_IF_CLK_166M, 38 - .quirk = CF_BROKEN_UDMA, 39 - .dma_priv = &cf_dma_priv, 40 - }; 41 - 42 - /* ssp device registration */ 43 - static struct pl022_ssp_controller ssp1_plat_data = { 44 - .enable_dma = 0, 45 - }; 46 - 47 - /* Add SPEAr1310 auxdata to pass platform data */ 48 - static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = { 49 - OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_pdata), 50 - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data), 51 - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data), 52 - OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data), 53 - 54 - OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data), 55 - {} 56 - }; 57 - 58 - static void __init spear1310_dt_init(void) 59 - { 60 - of_platform_populate(NULL, of_default_bus_match_table, 61 - spear1310_auxdata_lookup, NULL); 62 - } 63 - 64 - static const char * const spear1310_dt_board_compat[] = { 65 - "st,spear1310", 66 - "st,spear1310-evb", 67 - NULL, 68 - }; 69 - 70 - /* 71 - * Following will create 16MB static virtual/physical mappings 72 - * PHYSICAL VIRTUAL 73 - * 0xD8000000 0xFA000000 74 - */ 75 - struct map_desc spear1310_io_desc[] __initdata = { 76 - { 77 - .virtual = VA_SPEAR1310_RAS_GRP1_BASE, 78 - .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE), 79 - .length = SZ_16M, 80 - .type = MT_DEVICE 81 - }, 82 - }; 83 - 84 - static void __init spear1310_map_io(void) 85 - { 86 - iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc)); 87 - spear13xx_map_io(); 88 - } 89 - 90 - DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree") 91 - .smp = smp_ops(spear13xx_smp_ops), 92 - .map_io = spear1310_map_io, 93 - .init_irq = irqchip_init, 94 - .init_time = spear13xx_timer_init, 95 - .init_machine = spear1310_dt_init, 96 - .restart = spear_restart, 97 - .dt_compat = spear1310_dt_board_compat, 98 - MACHINE_END
-192
arch/arm/mach-spear13xx/spear1340.c
··· 1 - /* 2 - * arch/arm/mach-spear13xx/spear1340.c 3 - * 4 - * SPEAr1340 machine source file 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #define pr_fmt(fmt) "SPEAr1340: " fmt 15 - 16 - #include <linux/ahci_platform.h> 17 - #include <linux/amba/serial.h> 18 - #include <linux/delay.h> 19 - #include <linux/dw_dmac.h> 20 - #include <linux/of_platform.h> 21 - #include <linux/irqchip.h> 22 - #include <asm/mach/arch.h> 23 - #include <mach/dma.h> 24 - #include <mach/generic.h> 25 - #include <mach/spear.h> 26 - 27 - /* Base addresses */ 28 - #define SPEAR1340_SATA_BASE UL(0xB1000000) 29 - #define SPEAR1340_UART1_BASE UL(0xB4100000) 30 - 31 - /* Power Management Registers */ 32 - #define SPEAR1340_PCM_CFG (VA_MISC_BASE + 0x100) 33 - #define SPEAR1340_PCM_WKUP_CFG (VA_MISC_BASE + 0x104) 34 - #define SPEAR1340_SWITCH_CTR (VA_MISC_BASE + 0x108) 35 - 36 - #define SPEAR1340_PERIP1_SW_RST (VA_MISC_BASE + 0x318) 37 - #define SPEAR1340_PERIP2_SW_RST (VA_MISC_BASE + 0x31C) 38 - #define SPEAR1340_PERIP3_SW_RST (VA_MISC_BASE + 0x320) 39 - 40 - /* PCIE - SATA configuration registers */ 41 - #define SPEAR1340_PCIE_SATA_CFG (VA_MISC_BASE + 0x424) 42 - /* PCIE CFG MASks */ 43 - #define SPEAR1340_PCIE_CFG_DEVICE_PRESENT (1 << 11) 44 - #define SPEAR1340_PCIE_CFG_POWERUP_RESET (1 << 10) 45 - #define SPEAR1340_PCIE_CFG_CORE_CLK_EN (1 << 9) 46 - #define SPEAR1340_PCIE_CFG_AUX_CLK_EN (1 << 8) 47 - #define SPEAR1340_SATA_CFG_TX_CLK_EN (1 << 4) 48 - #define SPEAR1340_SATA_CFG_RX_CLK_EN (1 << 3) 49 - #define SPEAR1340_SATA_CFG_POWERUP_RESET (1 << 2) 50 - #define SPEAR1340_SATA_CFG_PM_CLK_EN (1 << 1) 51 - #define SPEAR1340_PCIE_SATA_SEL_PCIE (0) 52 - #define SPEAR1340_PCIE_SATA_SEL_SATA (1) 53 - #define SPEAR1340_SATA_PCIE_CFG_MASK 0xF1F 54 - #define SPEAR1340_PCIE_CFG_VAL (SPEAR1340_PCIE_SATA_SEL_PCIE | \ 55 - SPEAR1340_PCIE_CFG_AUX_CLK_EN | \ 56 - SPEAR1340_PCIE_CFG_CORE_CLK_EN | \ 57 - SPEAR1340_PCIE_CFG_POWERUP_RESET | \ 58 - SPEAR1340_PCIE_CFG_DEVICE_PRESENT) 59 - #define SPEAR1340_SATA_CFG_VAL (SPEAR1340_PCIE_SATA_SEL_SATA | \ 60 - SPEAR1340_SATA_CFG_PM_CLK_EN | \ 61 - SPEAR1340_SATA_CFG_POWERUP_RESET | \ 62 - SPEAR1340_SATA_CFG_RX_CLK_EN | \ 63 - SPEAR1340_SATA_CFG_TX_CLK_EN) 64 - 65 - #define SPEAR1340_PCIE_MIPHY_CFG (VA_MISC_BASE + 0x428) 66 - #define SPEAR1340_MIPHY_OSC_BYPASS_EXT (1 << 31) 67 - #define SPEAR1340_MIPHY_CLK_REF_DIV2 (1 << 27) 68 - #define SPEAR1340_MIPHY_CLK_REF_DIV4 (2 << 27) 69 - #define SPEAR1340_MIPHY_CLK_REF_DIV8 (3 << 27) 70 - #define SPEAR1340_MIPHY_PLL_RATIO_TOP(x) (x << 0) 71 - #define SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA \ 72 - (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \ 73 - SPEAR1340_MIPHY_CLK_REF_DIV2 | \ 74 - SPEAR1340_MIPHY_PLL_RATIO_TOP(60)) 75 - #define SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA_25M_CRYSTAL_CLK \ 76 - (SPEAR1340_MIPHY_PLL_RATIO_TOP(120)) 77 - #define SPEAR1340_PCIE_SATA_MIPHY_CFG_PCIE \ 78 - (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \ 79 - SPEAR1340_MIPHY_PLL_RATIO_TOP(25)) 80 - 81 - static struct dw_dma_slave uart1_dma_param[] = { 82 - { 83 - /* Tx */ 84 - .cfg_hi = DWC_CFGH_DST_PER(SPEAR1340_DMA_REQ_UART1_TX), 85 - .cfg_lo = 0, 86 - .src_master = DMA_MASTER_MEMORY, 87 - .dst_master = SPEAR1340_DMA_MASTER_UART1, 88 - }, { 89 - /* Rx */ 90 - .cfg_hi = DWC_CFGH_SRC_PER(SPEAR1340_DMA_REQ_UART1_RX), 91 - .cfg_lo = 0, 92 - .src_master = SPEAR1340_DMA_MASTER_UART1, 93 - .dst_master = DMA_MASTER_MEMORY, 94 - } 95 - }; 96 - 97 - static struct amba_pl011_data uart1_data = { 98 - .dma_filter = dw_dma_filter, 99 - .dma_tx_param = &uart1_dma_param[0], 100 - .dma_rx_param = &uart1_dma_param[1], 101 - }; 102 - 103 - /* SATA device registration */ 104 - static int sata_miphy_init(struct device *dev, void __iomem *addr) 105 - { 106 - writel(SPEAR1340_SATA_CFG_VAL, SPEAR1340_PCIE_SATA_CFG); 107 - writel(SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA_25M_CRYSTAL_CLK, 108 - SPEAR1340_PCIE_MIPHY_CFG); 109 - /* Switch on sata power domain */ 110 - writel((readl(SPEAR1340_PCM_CFG) | (0x800)), SPEAR1340_PCM_CFG); 111 - msleep(20); 112 - /* Disable PCIE SATA Controller reset */ 113 - writel((readl(SPEAR1340_PERIP1_SW_RST) & (~0x1000)), 114 - SPEAR1340_PERIP1_SW_RST); 115 - msleep(20); 116 - 117 - return 0; 118 - } 119 - 120 - void sata_miphy_exit(struct device *dev) 121 - { 122 - writel(0, SPEAR1340_PCIE_SATA_CFG); 123 - writel(0, SPEAR1340_PCIE_MIPHY_CFG); 124 - 125 - /* Enable PCIE SATA Controller reset */ 126 - writel((readl(SPEAR1340_PERIP1_SW_RST) | (0x1000)), 127 - SPEAR1340_PERIP1_SW_RST); 128 - msleep(20); 129 - /* Switch off sata power domain */ 130 - writel((readl(SPEAR1340_PCM_CFG) & (~0x800)), SPEAR1340_PCM_CFG); 131 - msleep(20); 132 - } 133 - 134 - int sata_suspend(struct device *dev) 135 - { 136 - if (dev->power.power_state.event == PM_EVENT_FREEZE) 137 - return 0; 138 - 139 - sata_miphy_exit(dev); 140 - 141 - return 0; 142 - } 143 - 144 - int sata_resume(struct device *dev) 145 - { 146 - if (dev->power.power_state.event == PM_EVENT_THAW) 147 - return 0; 148 - 149 - return sata_miphy_init(dev, NULL); 150 - } 151 - 152 - static struct ahci_platform_data sata_pdata = { 153 - .init = sata_miphy_init, 154 - .exit = sata_miphy_exit, 155 - .suspend = sata_suspend, 156 - .resume = sata_resume, 157 - }; 158 - 159 - /* Add SPEAr1340 auxdata to pass platform data */ 160 - static struct of_dev_auxdata spear1340_auxdata_lookup[] __initdata = { 161 - OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv), 162 - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data), 163 - OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data), 164 - OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data), 165 - 166 - OF_DEV_AUXDATA("snps,spear-ahci", SPEAR1340_SATA_BASE, NULL, 167 - &sata_pdata), 168 - OF_DEV_AUXDATA("arm,pl011", SPEAR1340_UART1_BASE, NULL, &uart1_data), 169 - {} 170 - }; 171 - 172 - static void __init spear1340_dt_init(void) 173 - { 174 - of_platform_populate(NULL, of_default_bus_match_table, 175 - spear1340_auxdata_lookup, NULL); 176 - } 177 - 178 - static const char * const spear1340_dt_board_compat[] = { 179 - "st,spear1340", 180 - "st,spear1340-evb", 181 - NULL, 182 - }; 183 - 184 - DT_MACHINE_START(SPEAR1340_DT, "ST SPEAr1340 SoC with Flattened Device Tree") 185 - .smp = smp_ops(spear13xx_smp_ops), 186 - .map_io = spear13xx_map_io, 187 - .init_irq = irqchip_init, 188 - .init_time = spear13xx_timer_init, 189 - .init_machine = spear1340_dt_init, 190 - .restart = spear_restart, 191 - .dt_compat = spear1340_dt_board_compat, 192 - MACHINE_END
-183
arch/arm/mach-spear13xx/spear13xx.c
··· 1 - /* 2 - * arch/arm/mach-spear13xx/spear13xx.c 3 - * 4 - * SPEAr13XX machines common source file 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #define pr_fmt(fmt) "SPEAr13xx: " fmt 15 - 16 - #include <linux/amba/pl022.h> 17 - #include <linux/clk.h> 18 - #include <linux/clocksource.h> 19 - #include <linux/dw_dmac.h> 20 - #include <linux/err.h> 21 - #include <linux/of.h> 22 - #include <asm/hardware/cache-l2x0.h> 23 - #include <asm/mach/map.h> 24 - #include <mach/dma.h> 25 - #include <mach/generic.h> 26 - #include <mach/spear.h> 27 - 28 - /* common dw_dma filter routine to be used by peripherals */ 29 - bool dw_dma_filter(struct dma_chan *chan, void *slave) 30 - { 31 - struct dw_dma_slave *dws = (struct dw_dma_slave *)slave; 32 - 33 - if (chan->device->dev == dws->dma_dev) { 34 - chan->private = slave; 35 - return true; 36 - } else { 37 - return false; 38 - } 39 - } 40 - 41 - /* ssp device registration */ 42 - static struct dw_dma_slave ssp_dma_param[] = { 43 - { 44 - /* Tx */ 45 - .cfg_hi = DWC_CFGH_DST_PER(DMA_REQ_SSP0_TX), 46 - .cfg_lo = 0, 47 - .src_master = DMA_MASTER_MEMORY, 48 - .dst_master = DMA_MASTER_SSP0, 49 - }, { 50 - /* Rx */ 51 - .cfg_hi = DWC_CFGH_SRC_PER(DMA_REQ_SSP0_RX), 52 - .cfg_lo = 0, 53 - .src_master = DMA_MASTER_SSP0, 54 - .dst_master = DMA_MASTER_MEMORY, 55 - } 56 - }; 57 - 58 - struct pl022_ssp_controller pl022_plat_data = { 59 - .enable_dma = 1, 60 - .dma_filter = dw_dma_filter, 61 - .dma_rx_param = &ssp_dma_param[1], 62 - .dma_tx_param = &ssp_dma_param[0], 63 - }; 64 - 65 - /* CF device registration */ 66 - struct dw_dma_slave cf_dma_priv = { 67 - .cfg_hi = 0, 68 - .cfg_lo = 0, 69 - .src_master = 0, 70 - .dst_master = 0, 71 - }; 72 - 73 - /* dmac device registeration */ 74 - struct dw_dma_platform_data dmac_plat_data = { 75 - .nr_channels = 8, 76 - .chan_allocation_order = CHAN_ALLOCATION_DESCENDING, 77 - .chan_priority = CHAN_PRIORITY_DESCENDING, 78 - .block_size = 4095U, 79 - .nr_masters = 2, 80 - .data_width = { 3, 3, 0, 0 }, 81 - }; 82 - 83 - void __init spear13xx_l2x0_init(void) 84 - { 85 - /* 86 - * 512KB (64KB/way), 8-way associativity, parity supported 87 - * 88 - * FIXME: 9th bit, of Auxillary Controller register must be set 89 - * for some spear13xx devices for stable L2 operation. 90 - * 91 - * Enable Early BRESP, L2 prefetch for Instruction and Data, 92 - * write alloc and 'Full line of zero' options 93 - * 94 - */ 95 - 96 - writel_relaxed(0x06, VA_L2CC_BASE + L2X0_PREFETCH_CTRL); 97 - 98 - /* 99 - * Program following latencies in order to make 100 - * SPEAr1340 work at 600 MHz 101 - */ 102 - writel_relaxed(0x221, VA_L2CC_BASE + L2X0_TAG_LATENCY_CTRL); 103 - writel_relaxed(0x441, VA_L2CC_BASE + L2X0_DATA_LATENCY_CTRL); 104 - l2x0_init(VA_L2CC_BASE, 0x70A60001, 0xfe00ffff); 105 - } 106 - 107 - /* 108 - * Following will create 16MB static virtual/physical mappings 109 - * PHYSICAL VIRTUAL 110 - * 0xB3000000 0xFE000000 111 - * 0xE0000000 0xFD000000 112 - * 0xEC000000 0xFC000000 113 - * 0xED000000 0xFB000000 114 - */ 115 - struct map_desc spear13xx_io_desc[] __initdata = { 116 - { 117 - .virtual = (unsigned long)VA_PERIP_GRP2_BASE, 118 - .pfn = __phys_to_pfn(PERIP_GRP2_BASE), 119 - .length = SZ_16M, 120 - .type = MT_DEVICE 121 - }, { 122 - .virtual = (unsigned long)VA_PERIP_GRP1_BASE, 123 - .pfn = __phys_to_pfn(PERIP_GRP1_BASE), 124 - .length = SZ_16M, 125 - .type = MT_DEVICE 126 - }, { 127 - .virtual = (unsigned long)VA_A9SM_AND_MPMC_BASE, 128 - .pfn = __phys_to_pfn(A9SM_AND_MPMC_BASE), 129 - .length = SZ_16M, 130 - .type = MT_DEVICE 131 - }, { 132 - .virtual = (unsigned long)VA_L2CC_BASE, 133 - .pfn = __phys_to_pfn(L2CC_BASE), 134 - .length = SZ_4K, 135 - .type = MT_DEVICE 136 - }, 137 - }; 138 - 139 - /* This will create static memory mapping for selected devices */ 140 - void __init spear13xx_map_io(void) 141 - { 142 - iotable_init(spear13xx_io_desc, ARRAY_SIZE(spear13xx_io_desc)); 143 - } 144 - 145 - static void __init spear13xx_clk_init(void) 146 - { 147 - if (of_machine_is_compatible("st,spear1310")) 148 - spear1310_clk_init(); 149 - else if (of_machine_is_compatible("st,spear1340")) 150 - spear1340_clk_init(); 151 - else 152 - pr_err("%s: Unknown machine\n", __func__); 153 - } 154 - 155 - void __init spear13xx_timer_init(void) 156 - { 157 - char pclk_name[] = "osc_24m_clk"; 158 - struct clk *gpt_clk, *pclk; 159 - 160 - spear13xx_clk_init(); 161 - 162 - /* get the system timer clock */ 163 - gpt_clk = clk_get_sys("gpt0", NULL); 164 - if (IS_ERR(gpt_clk)) { 165 - pr_err("%s:couldn't get clk for gpt\n", __func__); 166 - BUG(); 167 - } 168 - 169 - /* get the suitable parent clock for timer*/ 170 - pclk = clk_get(NULL, pclk_name); 171 - if (IS_ERR(pclk)) { 172 - pr_err("%s:couldn't get %s as parent for gpt\n", __func__, 173 - pclk_name); 174 - BUG(); 175 - } 176 - 177 - clk_set_parent(gpt_clk, pclk); 178 - clk_put(gpt_clk); 179 - clk_put(pclk); 180 - 181 - spear_setup_of_timer(); 182 - clocksource_of_init(); 183 - }
-26
arch/arm/mach-spear3xx/Kconfig
··· 1 - # 2 - # SPEAr3XX Machine configuration file 3 - # 4 - 5 - if ARCH_SPEAR3XX 6 - 7 - menu "SPEAr3xx Implementations" 8 - config MACH_SPEAR300 9 - bool "SPEAr300 Machine support with Device Tree" 10 - select PINCTRL_SPEAR300 11 - help 12 - Supports ST SPEAr300 machine configured via the device-tree 13 - 14 - config MACH_SPEAR310 15 - bool "SPEAr310 Machine support with Device Tree" 16 - select PINCTRL_SPEAR310 17 - help 18 - Supports ST SPEAr310 machine configured via the device-tree 19 - 20 - config MACH_SPEAR320 21 - bool "SPEAr320 Machine support with Device Tree" 22 - select PINCTRL_SPEAR320 23 - help 24 - Supports ST SPEAr320 machine configured via the device-tree 25 - endmenu 26 - endif #ARCH_SPEAR3XX
-15
arch/arm/mach-spear3xx/Makefile
··· 1 - # 2 - # Makefile for SPEAr3XX machine series 3 - # 4 - 5 - # common files 6 - obj-$(CONFIG_ARCH_SPEAR3XX) += spear3xx.o 7 - 8 - # spear300 specific files 9 - obj-$(CONFIG_MACH_SPEAR300) += spear300.o 10 - 11 - # spear310 specific files 12 - obj-$(CONFIG_MACH_SPEAR310) += spear310.o 13 - 14 - # spear320 specific files 15 - obj-$(CONFIG_MACH_SPEAR320) += spear320.o
-3
arch/arm/mach-spear3xx/Makefile.boot
··· 1 - zreladdr-y += 0x00008000 2 - params_phys-y := 0x00000100 3 - initrd_phys-y := 0x00800000
-14
arch/arm/mach-spear3xx/include/mach/debug-macro.S
··· 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.linux@gmail.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>
-36
arch/arm/mach-spear3xx/include/mach/generic.h
··· 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.linux@gmail.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 <linux/amba/pl08x.h> 18 - #include <linux/init.h> 19 - #include <linux/platform_device.h> 20 - #include <linux/amba/bus.h> 21 - #include <asm/mach/time.h> 22 - #include <asm/mach/map.h> 23 - 24 - /* Add spear3xx family device structure declarations here */ 25 - extern void spear3xx_timer_init(void); 26 - extern struct pl022_ssp_controller pl022_plat_data; 27 - extern struct pl08x_platform_data pl080_plat_data; 28 - 29 - /* Add spear3xx family function declarations here */ 30 - void __init spear_setup_of_timer(void); 31 - void __init spear3xx_clk_init(void); 32 - void __init spear3xx_map_io(void); 33 - 34 - void spear_restart(char, const char *); 35 - 36 - #endif /* __MACH_GENERIC_H */
-1
arch/arm/mach-spear3xx/include/mach/hardware.h
··· 1 - /* empty */
-19
arch/arm/mach-spear3xx/include/mach/irqs.h
··· 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.linux@gmail.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 - #define NR_IRQS 256 18 - 19 - #endif /* __MACH_IRQS_H */
-22
arch/arm/mach-spear3xx/include/mach/misc_regs.h
··· 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.linux@gmail.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 IOMEM(VA_SPEAR3XX_ICM3_MISC_REG_BASE) 20 - #define DMA_CHN_CFG (MISC_BASE + 0x0A0) 21 - 22 - #endif /* __MACH_MISC_REGS_H */
-60
arch/arm/mach-spear3xx/include/mach/spear.h
··· 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.linux@gmail.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 <asm/memory.h> 18 - 19 - /* ICM1 - Low speed connection */ 20 - #define SPEAR3XX_ICM1_2_BASE UL(0xD0000000) 21 - #define VA_SPEAR3XX_ICM1_2_BASE UL(0xFD000000) 22 - #define SPEAR3XX_ICM1_UART_BASE UL(0xD0000000) 23 - #define VA_SPEAR3XX_ICM1_UART_BASE (VA_SPEAR3XX_ICM1_2_BASE | SPEAR3XX_ICM1_UART_BASE) 24 - #define SPEAR3XX_ICM1_SSP_BASE UL(0xD0100000) 25 - 26 - /* ML1 - Multi Layer CPU Subsystem */ 27 - #define SPEAR3XX_ICM3_ML1_2_BASE UL(0xF0000000) 28 - #define VA_SPEAR6XX_ML_CPU_BASE UL(0xF0000000) 29 - 30 - /* ICM3 - Basic Subsystem */ 31 - #define SPEAR3XX_ICM3_SMI_CTRL_BASE UL(0xFC000000) 32 - #define VA_SPEAR3XX_ICM3_SMI_CTRL_BASE UL(0xFC000000) 33 - #define SPEAR3XX_ICM3_DMA_BASE UL(0xFC400000) 34 - #define SPEAR3XX_ICM3_SYS_CTRL_BASE UL(0xFCA00000) 35 - #define VA_SPEAR3XX_ICM3_SYS_CTRL_BASE (VA_SPEAR3XX_ICM3_SMI_CTRL_BASE | SPEAR3XX_ICM3_SYS_CTRL_BASE) 36 - #define SPEAR3XX_ICM3_MISC_REG_BASE UL(0xFCA80000) 37 - #define VA_SPEAR3XX_ICM3_MISC_REG_BASE (VA_SPEAR3XX_ICM3_SMI_CTRL_BASE | SPEAR3XX_ICM3_MISC_REG_BASE) 38 - 39 - /* Debug uart for linux, will be used for debug and uncompress messages */ 40 - #define SPEAR_DBG_UART_BASE SPEAR3XX_ICM1_UART_BASE 41 - #define VA_SPEAR_DBG_UART_BASE VA_SPEAR3XX_ICM1_UART_BASE 42 - 43 - /* Sysctl base for spear platform */ 44 - #define SPEAR_SYS_CTRL_BASE SPEAR3XX_ICM3_SYS_CTRL_BASE 45 - #define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR3XX_ICM3_SYS_CTRL_BASE 46 - 47 - /* SPEAr320 Macros */ 48 - #define SPEAR320_SOC_CONFIG_BASE UL(0xB3000000) 49 - #define VA_SPEAR320_SOC_CONFIG_BASE UL(0xFE000000) 50 - #define SPEAR320_CONTROL_REG IOMEM(VA_SPEAR320_SOC_CONFIG_BASE) 51 - #define SPEAR320_EXT_CTRL_REG IOMEM(VA_SPEAR320_SOC_CONFIG_BASE + 0x0018) 52 - #define SPEAR320_UARTX_PCLK_MASK 0x1 53 - #define SPEAR320_UART2_PCLK_SHIFT 8 54 - #define SPEAR320_UART3_PCLK_SHIFT 9 55 - #define SPEAR320_UART4_PCLK_SHIFT 10 56 - #define SPEAR320_UART5_PCLK_SHIFT 11 57 - #define SPEAR320_UART6_PCLK_SHIFT 12 58 - #define SPEAR320_RS485_PCLK_SHIFT 13 59 - 60 - #endif /* __MACH_SPEAR3XX_H */
-19
arch/arm/mach-spear3xx/include/mach/timex.h
··· 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.linux@gmail.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 */
-19
arch/arm/mach-spear3xx/include/mach/uncompress.h
··· 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.linux@gmail.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 */
-220
arch/arm/mach-spear3xx/spear300.c
··· 1 - /* 2 - * arch/arm/mach-spear3xx/spear300.c 3 - * 4 - * SPEAr300 machine source file 5 - * 6 - * Copyright (C) 2009-2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #define pr_fmt(fmt) "SPEAr300: " fmt 15 - 16 - #include <linux/amba/pl08x.h> 17 - #include <linux/irqchip.h> 18 - #include <linux/of_platform.h> 19 - #include <asm/mach/arch.h> 20 - #include <mach/generic.h> 21 - #include <mach/spear.h> 22 - 23 - /* DMAC platform data's slave info */ 24 - struct pl08x_channel_data spear300_dma_info[] = { 25 - { 26 - .bus_id = "uart0_rx", 27 - .min_signal = 2, 28 - .max_signal = 2, 29 - .muxval = 0, 30 - .periph_buses = PL08X_AHB1, 31 - }, { 32 - .bus_id = "uart0_tx", 33 - .min_signal = 3, 34 - .max_signal = 3, 35 - .muxval = 0, 36 - .periph_buses = PL08X_AHB1, 37 - }, { 38 - .bus_id = "ssp0_rx", 39 - .min_signal = 8, 40 - .max_signal = 8, 41 - .muxval = 0, 42 - .periph_buses = PL08X_AHB1, 43 - }, { 44 - .bus_id = "ssp0_tx", 45 - .min_signal = 9, 46 - .max_signal = 9, 47 - .muxval = 0, 48 - .periph_buses = PL08X_AHB1, 49 - }, { 50 - .bus_id = "i2c_rx", 51 - .min_signal = 10, 52 - .max_signal = 10, 53 - .muxval = 0, 54 - .periph_buses = PL08X_AHB1, 55 - }, { 56 - .bus_id = "i2c_tx", 57 - .min_signal = 11, 58 - .max_signal = 11, 59 - .muxval = 0, 60 - .periph_buses = PL08X_AHB1, 61 - }, { 62 - .bus_id = "irda", 63 - .min_signal = 12, 64 - .max_signal = 12, 65 - .muxval = 0, 66 - .periph_buses = PL08X_AHB1, 67 - }, { 68 - .bus_id = "adc", 69 - .min_signal = 13, 70 - .max_signal = 13, 71 - .muxval = 0, 72 - .periph_buses = PL08X_AHB1, 73 - }, { 74 - .bus_id = "to_jpeg", 75 - .min_signal = 14, 76 - .max_signal = 14, 77 - .muxval = 0, 78 - .periph_buses = PL08X_AHB1, 79 - }, { 80 - .bus_id = "from_jpeg", 81 - .min_signal = 15, 82 - .max_signal = 15, 83 - .muxval = 0, 84 - .periph_buses = PL08X_AHB1, 85 - }, { 86 - .bus_id = "ras0_rx", 87 - .min_signal = 0, 88 - .max_signal = 0, 89 - .muxval = 1, 90 - .periph_buses = PL08X_AHB1, 91 - }, { 92 - .bus_id = "ras0_tx", 93 - .min_signal = 1, 94 - .max_signal = 1, 95 - .muxval = 1, 96 - .periph_buses = PL08X_AHB1, 97 - }, { 98 - .bus_id = "ras1_rx", 99 - .min_signal = 2, 100 - .max_signal = 2, 101 - .muxval = 1, 102 - .periph_buses = PL08X_AHB1, 103 - }, { 104 - .bus_id = "ras1_tx", 105 - .min_signal = 3, 106 - .max_signal = 3, 107 - .muxval = 1, 108 - .periph_buses = PL08X_AHB1, 109 - }, { 110 - .bus_id = "ras2_rx", 111 - .min_signal = 4, 112 - .max_signal = 4, 113 - .muxval = 1, 114 - .periph_buses = PL08X_AHB1, 115 - }, { 116 - .bus_id = "ras2_tx", 117 - .min_signal = 5, 118 - .max_signal = 5, 119 - .muxval = 1, 120 - .periph_buses = PL08X_AHB1, 121 - }, { 122 - .bus_id = "ras3_rx", 123 - .min_signal = 6, 124 - .max_signal = 6, 125 - .muxval = 1, 126 - .periph_buses = PL08X_AHB1, 127 - }, { 128 - .bus_id = "ras3_tx", 129 - .min_signal = 7, 130 - .max_signal = 7, 131 - .muxval = 1, 132 - .periph_buses = PL08X_AHB1, 133 - }, { 134 - .bus_id = "ras4_rx", 135 - .min_signal = 8, 136 - .max_signal = 8, 137 - .muxval = 1, 138 - .periph_buses = PL08X_AHB1, 139 - }, { 140 - .bus_id = "ras4_tx", 141 - .min_signal = 9, 142 - .max_signal = 9, 143 - .muxval = 1, 144 - .periph_buses = PL08X_AHB1, 145 - }, { 146 - .bus_id = "ras5_rx", 147 - .min_signal = 10, 148 - .max_signal = 10, 149 - .muxval = 1, 150 - .periph_buses = PL08X_AHB1, 151 - }, { 152 - .bus_id = "ras5_tx", 153 - .min_signal = 11, 154 - .max_signal = 11, 155 - .muxval = 1, 156 - .periph_buses = PL08X_AHB1, 157 - }, { 158 - .bus_id = "ras6_rx", 159 - .min_signal = 12, 160 - .max_signal = 12, 161 - .muxval = 1, 162 - .periph_buses = PL08X_AHB1, 163 - }, { 164 - .bus_id = "ras6_tx", 165 - .min_signal = 13, 166 - .max_signal = 13, 167 - .muxval = 1, 168 - .periph_buses = PL08X_AHB1, 169 - }, { 170 - .bus_id = "ras7_rx", 171 - .min_signal = 14, 172 - .max_signal = 14, 173 - .muxval = 1, 174 - .periph_buses = PL08X_AHB1, 175 - }, { 176 - .bus_id = "ras7_tx", 177 - .min_signal = 15, 178 - .max_signal = 15, 179 - .muxval = 1, 180 - .periph_buses = PL08X_AHB1, 181 - }, 182 - }; 183 - 184 - /* Add SPEAr300 auxdata to pass platform data */ 185 - static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = { 186 - OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, 187 - &pl022_plat_data), 188 - OF_DEV_AUXDATA("arm,pl080", SPEAR3XX_ICM3_DMA_BASE, NULL, 189 - &pl080_plat_data), 190 - {} 191 - }; 192 - 193 - static void __init spear300_dt_init(void) 194 - { 195 - pl080_plat_data.slave_channels = spear300_dma_info; 196 - pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info); 197 - 198 - of_platform_populate(NULL, of_default_bus_match_table, 199 - spear300_auxdata_lookup, NULL); 200 - } 201 - 202 - static const char * const spear300_dt_board_compat[] = { 203 - "st,spear300", 204 - "st,spear300-evb", 205 - NULL, 206 - }; 207 - 208 - static void __init spear300_map_io(void) 209 - { 210 - spear3xx_map_io(); 211 - } 212 - 213 - DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree") 214 - .map_io = spear300_map_io, 215 - .init_irq = irqchip_init, 216 - .init_time = spear3xx_timer_init, 217 - .init_machine = spear300_dt_init, 218 - .restart = spear_restart, 219 - .dt_compat = spear300_dt_board_compat, 220 - MACHINE_END
-262
arch/arm/mach-spear3xx/spear310.c
··· 1 - /* 2 - * arch/arm/mach-spear3xx/spear310.c 3 - * 4 - * SPEAr310 machine source file 5 - * 6 - * Copyright (C) 2009-2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #define pr_fmt(fmt) "SPEAr310: " fmt 15 - 16 - #include <linux/amba/pl08x.h> 17 - #include <linux/amba/serial.h> 18 - #include <linux/irqchip.h> 19 - #include <linux/of_platform.h> 20 - #include <asm/mach/arch.h> 21 - #include <mach/generic.h> 22 - #include <mach/spear.h> 23 - 24 - #define SPEAR310_UART1_BASE UL(0xB2000000) 25 - #define SPEAR310_UART2_BASE UL(0xB2080000) 26 - #define SPEAR310_UART3_BASE UL(0xB2100000) 27 - #define SPEAR310_UART4_BASE UL(0xB2180000) 28 - #define SPEAR310_UART5_BASE UL(0xB2200000) 29 - 30 - /* DMAC platform data's slave info */ 31 - struct pl08x_channel_data spear310_dma_info[] = { 32 - { 33 - .bus_id = "uart0_rx", 34 - .min_signal = 2, 35 - .max_signal = 2, 36 - .muxval = 0, 37 - .periph_buses = PL08X_AHB1, 38 - }, { 39 - .bus_id = "uart0_tx", 40 - .min_signal = 3, 41 - .max_signal = 3, 42 - .muxval = 0, 43 - .periph_buses = PL08X_AHB1, 44 - }, { 45 - .bus_id = "ssp0_rx", 46 - .min_signal = 8, 47 - .max_signal = 8, 48 - .muxval = 0, 49 - .periph_buses = PL08X_AHB1, 50 - }, { 51 - .bus_id = "ssp0_tx", 52 - .min_signal = 9, 53 - .max_signal = 9, 54 - .muxval = 0, 55 - .periph_buses = PL08X_AHB1, 56 - }, { 57 - .bus_id = "i2c_rx", 58 - .min_signal = 10, 59 - .max_signal = 10, 60 - .muxval = 0, 61 - .periph_buses = PL08X_AHB1, 62 - }, { 63 - .bus_id = "i2c_tx", 64 - .min_signal = 11, 65 - .max_signal = 11, 66 - .muxval = 0, 67 - .periph_buses = PL08X_AHB1, 68 - }, { 69 - .bus_id = "irda", 70 - .min_signal = 12, 71 - .max_signal = 12, 72 - .muxval = 0, 73 - .periph_buses = PL08X_AHB1, 74 - }, { 75 - .bus_id = "adc", 76 - .min_signal = 13, 77 - .max_signal = 13, 78 - .muxval = 0, 79 - .periph_buses = PL08X_AHB1, 80 - }, { 81 - .bus_id = "to_jpeg", 82 - .min_signal = 14, 83 - .max_signal = 14, 84 - .muxval = 0, 85 - .periph_buses = PL08X_AHB1, 86 - }, { 87 - .bus_id = "from_jpeg", 88 - .min_signal = 15, 89 - .max_signal = 15, 90 - .muxval = 0, 91 - .periph_buses = PL08X_AHB1, 92 - }, { 93 - .bus_id = "uart1_rx", 94 - .min_signal = 0, 95 - .max_signal = 0, 96 - .muxval = 1, 97 - .periph_buses = PL08X_AHB1, 98 - }, { 99 - .bus_id = "uart1_tx", 100 - .min_signal = 1, 101 - .max_signal = 1, 102 - .muxval = 1, 103 - .periph_buses = PL08X_AHB1, 104 - }, { 105 - .bus_id = "uart2_rx", 106 - .min_signal = 2, 107 - .max_signal = 2, 108 - .muxval = 1, 109 - .periph_buses = PL08X_AHB1, 110 - }, { 111 - .bus_id = "uart2_tx", 112 - .min_signal = 3, 113 - .max_signal = 3, 114 - .muxval = 1, 115 - .periph_buses = PL08X_AHB1, 116 - }, { 117 - .bus_id = "uart3_rx", 118 - .min_signal = 4, 119 - .max_signal = 4, 120 - .muxval = 1, 121 - .periph_buses = PL08X_AHB1, 122 - }, { 123 - .bus_id = "uart3_tx", 124 - .min_signal = 5, 125 - .max_signal = 5, 126 - .muxval = 1, 127 - .periph_buses = PL08X_AHB1, 128 - }, { 129 - .bus_id = "uart4_rx", 130 - .min_signal = 6, 131 - .max_signal = 6, 132 - .muxval = 1, 133 - .periph_buses = PL08X_AHB1, 134 - }, { 135 - .bus_id = "uart4_tx", 136 - .min_signal = 7, 137 - .max_signal = 7, 138 - .muxval = 1, 139 - .periph_buses = PL08X_AHB1, 140 - }, { 141 - .bus_id = "uart5_rx", 142 - .min_signal = 8, 143 - .max_signal = 8, 144 - .muxval = 1, 145 - .periph_buses = PL08X_AHB1, 146 - }, { 147 - .bus_id = "uart5_tx", 148 - .min_signal = 9, 149 - .max_signal = 9, 150 - .muxval = 1, 151 - .periph_buses = PL08X_AHB1, 152 - }, { 153 - .bus_id = "ras5_rx", 154 - .min_signal = 10, 155 - .max_signal = 10, 156 - .muxval = 1, 157 - .periph_buses = PL08X_AHB1, 158 - }, { 159 - .bus_id = "ras5_tx", 160 - .min_signal = 11, 161 - .max_signal = 11, 162 - .muxval = 1, 163 - .periph_buses = PL08X_AHB1, 164 - }, { 165 - .bus_id = "ras6_rx", 166 - .min_signal = 12, 167 - .max_signal = 12, 168 - .muxval = 1, 169 - .periph_buses = PL08X_AHB1, 170 - }, { 171 - .bus_id = "ras6_tx", 172 - .min_signal = 13, 173 - .max_signal = 13, 174 - .muxval = 1, 175 - .periph_buses = PL08X_AHB1, 176 - }, { 177 - .bus_id = "ras7_rx", 178 - .min_signal = 14, 179 - .max_signal = 14, 180 - .muxval = 1, 181 - .periph_buses = PL08X_AHB1, 182 - }, { 183 - .bus_id = "ras7_tx", 184 - .min_signal = 15, 185 - .max_signal = 15, 186 - .muxval = 1, 187 - .periph_buses = PL08X_AHB1, 188 - }, 189 - }; 190 - 191 - /* uart devices plat data */ 192 - static struct amba_pl011_data spear310_uart_data[] = { 193 - { 194 - .dma_filter = pl08x_filter_id, 195 - .dma_tx_param = "uart1_tx", 196 - .dma_rx_param = "uart1_rx", 197 - }, { 198 - .dma_filter = pl08x_filter_id, 199 - .dma_tx_param = "uart2_tx", 200 - .dma_rx_param = "uart2_rx", 201 - }, { 202 - .dma_filter = pl08x_filter_id, 203 - .dma_tx_param = "uart3_tx", 204 - .dma_rx_param = "uart3_rx", 205 - }, { 206 - .dma_filter = pl08x_filter_id, 207 - .dma_tx_param = "uart4_tx", 208 - .dma_rx_param = "uart4_rx", 209 - }, { 210 - .dma_filter = pl08x_filter_id, 211 - .dma_tx_param = "uart5_tx", 212 - .dma_rx_param = "uart5_rx", 213 - }, 214 - }; 215 - 216 - /* Add SPEAr310 auxdata to pass platform data */ 217 - static struct of_dev_auxdata spear310_auxdata_lookup[] __initdata = { 218 - OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, 219 - &pl022_plat_data), 220 - OF_DEV_AUXDATA("arm,pl080", SPEAR3XX_ICM3_DMA_BASE, NULL, 221 - &pl080_plat_data), 222 - OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART1_BASE, NULL, 223 - &spear310_uart_data[0]), 224 - OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART2_BASE, NULL, 225 - &spear310_uart_data[1]), 226 - OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART3_BASE, NULL, 227 - &spear310_uart_data[2]), 228 - OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART4_BASE, NULL, 229 - &spear310_uart_data[3]), 230 - OF_DEV_AUXDATA("arm,pl011", SPEAR310_UART5_BASE, NULL, 231 - &spear310_uart_data[4]), 232 - {} 233 - }; 234 - 235 - static void __init spear310_dt_init(void) 236 - { 237 - pl080_plat_data.slave_channels = spear310_dma_info; 238 - pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear310_dma_info); 239 - 240 - of_platform_populate(NULL, of_default_bus_match_table, 241 - spear310_auxdata_lookup, NULL); 242 - } 243 - 244 - static const char * const spear310_dt_board_compat[] = { 245 - "st,spear310", 246 - "st,spear310-evb", 247 - NULL, 248 - }; 249 - 250 - static void __init spear310_map_io(void) 251 - { 252 - spear3xx_map_io(); 253 - } 254 - 255 - DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree") 256 - .map_io = spear310_map_io, 257 - .init_irq = irqchip_init, 258 - .init_time = spear3xx_timer_init, 259 - .init_machine = spear310_dt_init, 260 - .restart = spear_restart, 261 - .dt_compat = spear310_dt_board_compat, 262 - MACHINE_END
-276
arch/arm/mach-spear3xx/spear320.c
··· 1 - /* 2 - * arch/arm/mach-spear3xx/spear320.c 3 - * 4 - * SPEAr320 machine source file 5 - * 6 - * Copyright (C) 2009-2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #define pr_fmt(fmt) "SPEAr320: " fmt 15 - 16 - #include <linux/amba/pl022.h> 17 - #include <linux/amba/pl08x.h> 18 - #include <linux/amba/serial.h> 19 - #include <linux/irqchip.h> 20 - #include <linux/of_platform.h> 21 - #include <asm/mach/arch.h> 22 - #include <mach/generic.h> 23 - #include <mach/spear.h> 24 - 25 - #define SPEAR320_UART1_BASE UL(0xA3000000) 26 - #define SPEAR320_UART2_BASE UL(0xA4000000) 27 - #define SPEAR320_SSP0_BASE UL(0xA5000000) 28 - #define SPEAR320_SSP1_BASE UL(0xA6000000) 29 - 30 - /* DMAC platform data's slave info */ 31 - struct pl08x_channel_data spear320_dma_info[] = { 32 - { 33 - .bus_id = "uart0_rx", 34 - .min_signal = 2, 35 - .max_signal = 2, 36 - .muxval = 0, 37 - .periph_buses = PL08X_AHB1, 38 - }, { 39 - .bus_id = "uart0_tx", 40 - .min_signal = 3, 41 - .max_signal = 3, 42 - .muxval = 0, 43 - .periph_buses = PL08X_AHB1, 44 - }, { 45 - .bus_id = "ssp0_rx", 46 - .min_signal = 8, 47 - .max_signal = 8, 48 - .muxval = 0, 49 - .periph_buses = PL08X_AHB1, 50 - }, { 51 - .bus_id = "ssp0_tx", 52 - .min_signal = 9, 53 - .max_signal = 9, 54 - .muxval = 0, 55 - .periph_buses = PL08X_AHB1, 56 - }, { 57 - .bus_id = "i2c0_rx", 58 - .min_signal = 10, 59 - .max_signal = 10, 60 - .muxval = 0, 61 - .periph_buses = PL08X_AHB1, 62 - }, { 63 - .bus_id = "i2c0_tx", 64 - .min_signal = 11, 65 - .max_signal = 11, 66 - .muxval = 0, 67 - .periph_buses = PL08X_AHB1, 68 - }, { 69 - .bus_id = "irda", 70 - .min_signal = 12, 71 - .max_signal = 12, 72 - .muxval = 0, 73 - .periph_buses = PL08X_AHB1, 74 - }, { 75 - .bus_id = "adc", 76 - .min_signal = 13, 77 - .max_signal = 13, 78 - .muxval = 0, 79 - .periph_buses = PL08X_AHB1, 80 - }, { 81 - .bus_id = "to_jpeg", 82 - .min_signal = 14, 83 - .max_signal = 14, 84 - .muxval = 0, 85 - .periph_buses = PL08X_AHB1, 86 - }, { 87 - .bus_id = "from_jpeg", 88 - .min_signal = 15, 89 - .max_signal = 15, 90 - .muxval = 0, 91 - .periph_buses = PL08X_AHB1, 92 - }, { 93 - .bus_id = "ssp1_rx", 94 - .min_signal = 0, 95 - .max_signal = 0, 96 - .muxval = 1, 97 - .periph_buses = PL08X_AHB2, 98 - }, { 99 - .bus_id = "ssp1_tx", 100 - .min_signal = 1, 101 - .max_signal = 1, 102 - .muxval = 1, 103 - .periph_buses = PL08X_AHB2, 104 - }, { 105 - .bus_id = "ssp2_rx", 106 - .min_signal = 2, 107 - .max_signal = 2, 108 - .muxval = 1, 109 - .periph_buses = PL08X_AHB2, 110 - }, { 111 - .bus_id = "ssp2_tx", 112 - .min_signal = 3, 113 - .max_signal = 3, 114 - .muxval = 1, 115 - .periph_buses = PL08X_AHB2, 116 - }, { 117 - .bus_id = "uart1_rx", 118 - .min_signal = 4, 119 - .max_signal = 4, 120 - .muxval = 1, 121 - .periph_buses = PL08X_AHB2, 122 - }, { 123 - .bus_id = "uart1_tx", 124 - .min_signal = 5, 125 - .max_signal = 5, 126 - .muxval = 1, 127 - .periph_buses = PL08X_AHB2, 128 - }, { 129 - .bus_id = "uart2_rx", 130 - .min_signal = 6, 131 - .max_signal = 6, 132 - .muxval = 1, 133 - .periph_buses = PL08X_AHB2, 134 - }, { 135 - .bus_id = "uart2_tx", 136 - .min_signal = 7, 137 - .max_signal = 7, 138 - .muxval = 1, 139 - .periph_buses = PL08X_AHB2, 140 - }, { 141 - .bus_id = "i2c1_rx", 142 - .min_signal = 8, 143 - .max_signal = 8, 144 - .muxval = 1, 145 - .periph_buses = PL08X_AHB2, 146 - }, { 147 - .bus_id = "i2c1_tx", 148 - .min_signal = 9, 149 - .max_signal = 9, 150 - .muxval = 1, 151 - .periph_buses = PL08X_AHB2, 152 - }, { 153 - .bus_id = "i2c2_rx", 154 - .min_signal = 10, 155 - .max_signal = 10, 156 - .muxval = 1, 157 - .periph_buses = PL08X_AHB2, 158 - }, { 159 - .bus_id = "i2c2_tx", 160 - .min_signal = 11, 161 - .max_signal = 11, 162 - .muxval = 1, 163 - .periph_buses = PL08X_AHB2, 164 - }, { 165 - .bus_id = "i2s_rx", 166 - .min_signal = 12, 167 - .max_signal = 12, 168 - .muxval = 1, 169 - .periph_buses = PL08X_AHB2, 170 - }, { 171 - .bus_id = "i2s_tx", 172 - .min_signal = 13, 173 - .max_signal = 13, 174 - .muxval = 1, 175 - .periph_buses = PL08X_AHB2, 176 - }, { 177 - .bus_id = "rs485_rx", 178 - .min_signal = 14, 179 - .max_signal = 14, 180 - .muxval = 1, 181 - .periph_buses = PL08X_AHB2, 182 - }, { 183 - .bus_id = "rs485_tx", 184 - .min_signal = 15, 185 - .max_signal = 15, 186 - .muxval = 1, 187 - .periph_buses = PL08X_AHB2, 188 - }, 189 - }; 190 - 191 - static struct pl022_ssp_controller spear320_ssp_data[] = { 192 - { 193 - .bus_id = 1, 194 - .enable_dma = 1, 195 - .dma_filter = pl08x_filter_id, 196 - .dma_tx_param = "ssp1_tx", 197 - .dma_rx_param = "ssp1_rx", 198 - .num_chipselect = 2, 199 - }, { 200 - .bus_id = 2, 201 - .enable_dma = 1, 202 - .dma_filter = pl08x_filter_id, 203 - .dma_tx_param = "ssp2_tx", 204 - .dma_rx_param = "ssp2_rx", 205 - .num_chipselect = 2, 206 - } 207 - }; 208 - 209 - static struct amba_pl011_data spear320_uart_data[] = { 210 - { 211 - .dma_filter = pl08x_filter_id, 212 - .dma_tx_param = "uart1_tx", 213 - .dma_rx_param = "uart1_rx", 214 - }, { 215 - .dma_filter = pl08x_filter_id, 216 - .dma_tx_param = "uart2_tx", 217 - .dma_rx_param = "uart2_rx", 218 - }, 219 - }; 220 - 221 - /* Add SPEAr310 auxdata to pass platform data */ 222 - static struct of_dev_auxdata spear320_auxdata_lookup[] __initdata = { 223 - OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, 224 - &pl022_plat_data), 225 - OF_DEV_AUXDATA("arm,pl080", SPEAR3XX_ICM3_DMA_BASE, NULL, 226 - &pl080_plat_data), 227 - OF_DEV_AUXDATA("arm,pl022", SPEAR320_SSP0_BASE, NULL, 228 - &spear320_ssp_data[0]), 229 - OF_DEV_AUXDATA("arm,pl022", SPEAR320_SSP1_BASE, NULL, 230 - &spear320_ssp_data[1]), 231 - OF_DEV_AUXDATA("arm,pl011", SPEAR320_UART1_BASE, NULL, 232 - &spear320_uart_data[0]), 233 - OF_DEV_AUXDATA("arm,pl011", SPEAR320_UART2_BASE, NULL, 234 - &spear320_uart_data[1]), 235 - {} 236 - }; 237 - 238 - static void __init spear320_dt_init(void) 239 - { 240 - pl080_plat_data.slave_channels = spear320_dma_info; 241 - pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear320_dma_info); 242 - 243 - of_platform_populate(NULL, of_default_bus_match_table, 244 - spear320_auxdata_lookup, NULL); 245 - } 246 - 247 - static const char * const spear320_dt_board_compat[] = { 248 - "st,spear320", 249 - "st,spear320-evb", 250 - "st,spear320-hmi", 251 - NULL, 252 - }; 253 - 254 - struct map_desc spear320_io_desc[] __initdata = { 255 - { 256 - .virtual = VA_SPEAR320_SOC_CONFIG_BASE, 257 - .pfn = __phys_to_pfn(SPEAR320_SOC_CONFIG_BASE), 258 - .length = SZ_16M, 259 - .type = MT_DEVICE 260 - }, 261 - }; 262 - 263 - static void __init spear320_map_io(void) 264 - { 265 - iotable_init(spear320_io_desc, ARRAY_SIZE(spear320_io_desc)); 266 - spear3xx_map_io(); 267 - } 268 - 269 - DT_MACHINE_START(SPEAR320_DT, "ST SPEAr320 SoC with Flattened Device Tree") 270 - .map_io = spear320_map_io, 271 - .init_irq = irqchip_init, 272 - .init_time = spear3xx_timer_init, 273 - .init_machine = spear320_dt_init, 274 - .restart = spear_restart, 275 - .dt_compat = spear320_dt_board_compat, 276 - MACHINE_END
-113
arch/arm/mach-spear3xx/spear3xx.c
··· 1 - /* 2 - * arch/arm/mach-spear3xx/spear3xx.c 3 - * 4 - * SPEAr3XX machines common source file 5 - * 6 - * Copyright (C) 2009-2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #define pr_fmt(fmt) "SPEAr3xx: " fmt 15 - 16 - #include <linux/amba/pl022.h> 17 - #include <linux/amba/pl080.h> 18 - #include <linux/io.h> 19 - #include <plat/pl080.h> 20 - #include <mach/generic.h> 21 - #include <mach/spear.h> 22 - 23 - /* ssp device registration */ 24 - struct pl022_ssp_controller pl022_plat_data = { 25 - .bus_id = 0, 26 - .enable_dma = 1, 27 - .dma_filter = pl08x_filter_id, 28 - .dma_tx_param = "ssp0_tx", 29 - .dma_rx_param = "ssp0_rx", 30 - /* 31 - * This is number of spi devices that can be connected to spi. There are 32 - * two type of chipselects on which slave devices can work. One is chip 33 - * select provided by spi masters other is controlled through external 34 - * gpio's. We can't use chipselect provided from spi master (because as 35 - * soon as FIFO becomes empty, CS is disabled and transfer ends). So 36 - * this number now depends on number of gpios available for spi. each 37 - * slave on each master requires a separate gpio pin. 38 - */ 39 - .num_chipselect = 2, 40 - }; 41 - 42 - /* dmac device registration */ 43 - struct pl08x_platform_data pl080_plat_data = { 44 - .memcpy_channel = { 45 - .bus_id = "memcpy", 46 - .cctl_memcpy = 47 - (PL080_BSIZE_16 << PL080_CONTROL_SB_SIZE_SHIFT | \ 48 - PL080_BSIZE_16 << PL080_CONTROL_DB_SIZE_SHIFT | \ 49 - PL080_WIDTH_32BIT << PL080_CONTROL_SWIDTH_SHIFT | \ 50 - PL080_WIDTH_32BIT << PL080_CONTROL_DWIDTH_SHIFT | \ 51 - PL080_CONTROL_PROT_BUFF | PL080_CONTROL_PROT_CACHE | \ 52 - PL080_CONTROL_PROT_SYS), 53 - }, 54 - .lli_buses = PL08X_AHB1, 55 - .mem_buses = PL08X_AHB1, 56 - .get_signal = pl080_get_signal, 57 - .put_signal = pl080_put_signal, 58 - }; 59 - 60 - /* 61 - * Following will create 16MB static virtual/physical mappings 62 - * PHYSICAL VIRTUAL 63 - * 0xD0000000 0xFD000000 64 - * 0xFC000000 0xFC000000 65 - */ 66 - struct map_desc spear3xx_io_desc[] __initdata = { 67 - { 68 - .virtual = VA_SPEAR3XX_ICM1_2_BASE, 69 - .pfn = __phys_to_pfn(SPEAR3XX_ICM1_2_BASE), 70 - .length = SZ_16M, 71 - .type = MT_DEVICE 72 - }, { 73 - .virtual = VA_SPEAR3XX_ICM3_SMI_CTRL_BASE, 74 - .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SMI_CTRL_BASE), 75 - .length = SZ_16M, 76 - .type = MT_DEVICE 77 - }, 78 - }; 79 - 80 - /* This will create static memory mapping for selected devices */ 81 - void __init spear3xx_map_io(void) 82 - { 83 - iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc)); 84 - } 85 - 86 - void __init spear3xx_timer_init(void) 87 - { 88 - char pclk_name[] = "pll3_clk"; 89 - struct clk *gpt_clk, *pclk; 90 - 91 - spear3xx_clk_init(); 92 - 93 - /* get the system timer clock */ 94 - gpt_clk = clk_get_sys("gpt0", NULL); 95 - if (IS_ERR(gpt_clk)) { 96 - pr_err("%s:couldn't get clk for gpt\n", __func__); 97 - BUG(); 98 - } 99 - 100 - /* get the suitable parent clock for timer*/ 101 - pclk = clk_get(NULL, pclk_name); 102 - if (IS_ERR(pclk)) { 103 - pr_err("%s:couldn't get %s as parent for gpt\n", 104 - __func__, pclk_name); 105 - BUG(); 106 - } 107 - 108 - clk_set_parent(gpt_clk, pclk); 109 - clk_put(gpt_clk); 110 - clk_put(pclk); 111 - 112 - spear_setup_of_timer(); 113 - }
-10
arch/arm/mach-spear6xx/Kconfig
··· 1 - # 2 - # SPEAr6XX Machine configuration file 3 - # 4 - 5 - config MACH_SPEAR600 6 - def_bool y 7 - depends on ARCH_SPEAR6XX 8 - select USE_OF 9 - help 10 - Supports ST SPEAr600 boards configured via the device-tree
-6
arch/arm/mach-spear6xx/Makefile
··· 1 - # 2 - # Makefile for SPEAr6XX machine series 3 - # 4 - 5 - # common files 6 - obj-y += spear6xx.o
-3
arch/arm/mach-spear6xx/Makefile.boot
··· 1 - zreladdr-y += 0x00008000 2 - params_phys-y := 0x00000100 3 - initrd_phys-y := 0x00800000
-14
arch/arm/mach-spear6xx/include/mach/debug-macro.S
··· 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>
-23
arch/arm/mach-spear6xx/include/mach/generic.h
··· 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 <linux/init.h> 18 - 19 - void __init spear_setup_of_timer(void); 20 - void spear_restart(char, const char *); 21 - void __init spear6xx_clk_init(void); 22 - 23 - #endif /* __MACH_GENERIC_H */
-1
arch/arm/mach-spear6xx/include/mach/hardware.h
··· 1 - /* empty */
-25
arch/arm/mach-spear6xx/include/mach/irqs.h
··· 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_VIC_END 64 20 - 21 - /* GPIO pins virtual irqs */ 22 - #define VIRTUAL_IRQS 24 23 - #define NR_IRQS (IRQ_VIC_END + VIRTUAL_IRQS) 24 - 25 - #endif /* __MACH_IRQS_H */
-22
arch/arm/mach-spear6xx/include/mach/misc_regs.h
··· 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.linux@gmail.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 IOMEM(VA_SPEAR6XX_ICM3_MISC_REG_BASE) 20 - #define DMA_CHN_CFG (MISC_BASE + 0x0A0) 21 - 22 - #endif /* __MACH_MISC_REGS_H */
-46
arch/arm/mach-spear6xx/include/mach/spear.h
··· 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 <asm/memory.h> 18 - 19 - /* ICM1 - Low speed connection */ 20 - #define SPEAR6XX_ICM1_BASE UL(0xD0000000) 21 - #define VA_SPEAR6XX_ICM1_BASE UL(0xFD000000) 22 - #define SPEAR6XX_ICM1_UART0_BASE UL(0xD0000000) 23 - #define VA_SPEAR6XX_ICM1_UART0_BASE (VA_SPEAR6XX_ICM1_2_BASE | SPEAR6XX_ICM1_UART0_BASE) 24 - 25 - /* ML-1, 2 - Multi Layer CPU Subsystem */ 26 - #define SPEAR6XX_ML_CPU_BASE UL(0xF0000000) 27 - #define VA_SPEAR6XX_ML_CPU_BASE UL(0xF0000000) 28 - 29 - /* ICM3 - Basic Subsystem */ 30 - #define SPEAR6XX_ICM3_SMI_CTRL_BASE UL(0xFC000000) 31 - #define VA_SPEAR6XX_ICM3_SMI_CTRL_BASE UL(0xFC000000) 32 - #define SPEAR6XX_ICM3_DMA_BASE UL(0xFC400000) 33 - #define SPEAR6XX_ICM3_SYS_CTRL_BASE UL(0xFCA00000) 34 - #define VA_SPEAR6XX_ICM3_SYS_CTRL_BASE (VA_SPEAR6XX_ICM3_SMI_CTRL_BASE | SPEAR6XX_ICM3_SYS_CTRL_BASE) 35 - #define SPEAR6XX_ICM3_MISC_REG_BASE UL(0xFCA80000) 36 - #define VA_SPEAR6XX_ICM3_MISC_REG_BASE (VA_SPEAR6XX_ICM3_SMI_CTRL_BASE | SPEAR6XX_ICM3_MISC_REG_BASE) 37 - 38 - /* Debug uart for linux, will be used for debug and uncompress messages */ 39 - #define SPEAR_DBG_UART_BASE SPEAR6XX_ICM1_UART0_BASE 40 - #define VA_SPEAR_DBG_UART_BASE VA_SPEAR6XX_ICM1_UART0_BASE 41 - 42 - /* Sysctl base for spear platform */ 43 - #define SPEAR_SYS_CTRL_BASE SPEAR6XX_ICM3_SYS_CTRL_BASE 44 - #define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR6XX_ICM3_SYS_CTRL_BASE 45 - 46 - #endif /* __MACH_SPEAR6XX_H */
-19
arch/arm/mach-spear6xx/include/mach/timex.h
··· 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 */
-19
arch/arm/mach-spear6xx/include/mach/uncompress.h
··· 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 */
-430
arch/arm/mach-spear6xx/spear6xx.c
··· 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 - * Copyright 2012 Stefan Roese <sr@denx.de> 10 - * 11 - * This file is licensed under the terms of the GNU General Public 12 - * License version 2. This program is licensed "as is" without any 13 - * warranty of any kind, whether express or implied. 14 - */ 15 - 16 - #include <linux/amba/pl08x.h> 17 - #include <linux/clk.h> 18 - #include <linux/err.h> 19 - #include <linux/irqchip.h> 20 - #include <linux/of.h> 21 - #include <linux/of_address.h> 22 - #include <linux/of_platform.h> 23 - #include <linux/amba/pl080.h> 24 - #include <asm/mach/arch.h> 25 - #include <asm/mach/time.h> 26 - #include <asm/mach/map.h> 27 - #include <plat/pl080.h> 28 - #include <mach/generic.h> 29 - #include <mach/spear.h> 30 - 31 - /* dmac device registration */ 32 - static struct pl08x_channel_data spear600_dma_info[] = { 33 - { 34 - .bus_id = "ssp1_rx", 35 - .min_signal = 0, 36 - .max_signal = 0, 37 - .muxval = 0, 38 - .periph_buses = PL08X_AHB1, 39 - }, { 40 - .bus_id = "ssp1_tx", 41 - .min_signal = 1, 42 - .max_signal = 1, 43 - .muxval = 0, 44 - .periph_buses = PL08X_AHB1, 45 - }, { 46 - .bus_id = "uart0_rx", 47 - .min_signal = 2, 48 - .max_signal = 2, 49 - .muxval = 0, 50 - .periph_buses = PL08X_AHB1, 51 - }, { 52 - .bus_id = "uart0_tx", 53 - .min_signal = 3, 54 - .max_signal = 3, 55 - .muxval = 0, 56 - .periph_buses = PL08X_AHB1, 57 - }, { 58 - .bus_id = "uart1_rx", 59 - .min_signal = 4, 60 - .max_signal = 4, 61 - .muxval = 0, 62 - .periph_buses = PL08X_AHB1, 63 - }, { 64 - .bus_id = "uart1_tx", 65 - .min_signal = 5, 66 - .max_signal = 5, 67 - .muxval = 0, 68 - .periph_buses = PL08X_AHB1, 69 - }, { 70 - .bus_id = "ssp2_rx", 71 - .min_signal = 6, 72 - .max_signal = 6, 73 - .muxval = 0, 74 - .periph_buses = PL08X_AHB2, 75 - }, { 76 - .bus_id = "ssp2_tx", 77 - .min_signal = 7, 78 - .max_signal = 7, 79 - .muxval = 0, 80 - .periph_buses = PL08X_AHB2, 81 - }, { 82 - .bus_id = "ssp0_rx", 83 - .min_signal = 8, 84 - .max_signal = 8, 85 - .muxval = 0, 86 - .periph_buses = PL08X_AHB1, 87 - }, { 88 - .bus_id = "ssp0_tx", 89 - .min_signal = 9, 90 - .max_signal = 9, 91 - .muxval = 0, 92 - .periph_buses = PL08X_AHB1, 93 - }, { 94 - .bus_id = "i2c_rx", 95 - .min_signal = 10, 96 - .max_signal = 10, 97 - .muxval = 0, 98 - .periph_buses = PL08X_AHB1, 99 - }, { 100 - .bus_id = "i2c_tx", 101 - .min_signal = 11, 102 - .max_signal = 11, 103 - .muxval = 0, 104 - .periph_buses = PL08X_AHB1, 105 - }, { 106 - .bus_id = "irda", 107 - .min_signal = 12, 108 - .max_signal = 12, 109 - .muxval = 0, 110 - .periph_buses = PL08X_AHB1, 111 - }, { 112 - .bus_id = "adc", 113 - .min_signal = 13, 114 - .max_signal = 13, 115 - .muxval = 0, 116 - .periph_buses = PL08X_AHB2, 117 - }, { 118 - .bus_id = "to_jpeg", 119 - .min_signal = 14, 120 - .max_signal = 14, 121 - .muxval = 0, 122 - .periph_buses = PL08X_AHB1, 123 - }, { 124 - .bus_id = "from_jpeg", 125 - .min_signal = 15, 126 - .max_signal = 15, 127 - .muxval = 0, 128 - .periph_buses = PL08X_AHB1, 129 - }, { 130 - .bus_id = "ras0_rx", 131 - .min_signal = 0, 132 - .max_signal = 0, 133 - .muxval = 1, 134 - .periph_buses = PL08X_AHB1, 135 - }, { 136 - .bus_id = "ras0_tx", 137 - .min_signal = 1, 138 - .max_signal = 1, 139 - .muxval = 1, 140 - .periph_buses = PL08X_AHB1, 141 - }, { 142 - .bus_id = "ras1_rx", 143 - .min_signal = 2, 144 - .max_signal = 2, 145 - .muxval = 1, 146 - .periph_buses = PL08X_AHB1, 147 - }, { 148 - .bus_id = "ras1_tx", 149 - .min_signal = 3, 150 - .max_signal = 3, 151 - .muxval = 1, 152 - .periph_buses = PL08X_AHB1, 153 - }, { 154 - .bus_id = "ras2_rx", 155 - .min_signal = 4, 156 - .max_signal = 4, 157 - .muxval = 1, 158 - .periph_buses = PL08X_AHB1, 159 - }, { 160 - .bus_id = "ras2_tx", 161 - .min_signal = 5, 162 - .max_signal = 5, 163 - .muxval = 1, 164 - .periph_buses = PL08X_AHB1, 165 - }, { 166 - .bus_id = "ras3_rx", 167 - .min_signal = 6, 168 - .max_signal = 6, 169 - .muxval = 1, 170 - .periph_buses = PL08X_AHB1, 171 - }, { 172 - .bus_id = "ras3_tx", 173 - .min_signal = 7, 174 - .max_signal = 7, 175 - .muxval = 1, 176 - .periph_buses = PL08X_AHB1, 177 - }, { 178 - .bus_id = "ras4_rx", 179 - .min_signal = 8, 180 - .max_signal = 8, 181 - .muxval = 1, 182 - .periph_buses = PL08X_AHB1, 183 - }, { 184 - .bus_id = "ras4_tx", 185 - .min_signal = 9, 186 - .max_signal = 9, 187 - .muxval = 1, 188 - .periph_buses = PL08X_AHB1, 189 - }, { 190 - .bus_id = "ras5_rx", 191 - .min_signal = 10, 192 - .max_signal = 10, 193 - .muxval = 1, 194 - .periph_buses = PL08X_AHB1, 195 - }, { 196 - .bus_id = "ras5_tx", 197 - .min_signal = 11, 198 - .max_signal = 11, 199 - .muxval = 1, 200 - .periph_buses = PL08X_AHB1, 201 - }, { 202 - .bus_id = "ras6_rx", 203 - .min_signal = 12, 204 - .max_signal = 12, 205 - .muxval = 1, 206 - .periph_buses = PL08X_AHB1, 207 - }, { 208 - .bus_id = "ras6_tx", 209 - .min_signal = 13, 210 - .max_signal = 13, 211 - .muxval = 1, 212 - .periph_buses = PL08X_AHB1, 213 - }, { 214 - .bus_id = "ras7_rx", 215 - .min_signal = 14, 216 - .max_signal = 14, 217 - .muxval = 1, 218 - .periph_buses = PL08X_AHB1, 219 - }, { 220 - .bus_id = "ras7_tx", 221 - .min_signal = 15, 222 - .max_signal = 15, 223 - .muxval = 1, 224 - .periph_buses = PL08X_AHB1, 225 - }, { 226 - .bus_id = "ext0_rx", 227 - .min_signal = 0, 228 - .max_signal = 0, 229 - .muxval = 2, 230 - .periph_buses = PL08X_AHB2, 231 - }, { 232 - .bus_id = "ext0_tx", 233 - .min_signal = 1, 234 - .max_signal = 1, 235 - .muxval = 2, 236 - .periph_buses = PL08X_AHB2, 237 - }, { 238 - .bus_id = "ext1_rx", 239 - .min_signal = 2, 240 - .max_signal = 2, 241 - .muxval = 2, 242 - .periph_buses = PL08X_AHB2, 243 - }, { 244 - .bus_id = "ext1_tx", 245 - .min_signal = 3, 246 - .max_signal = 3, 247 - .muxval = 2, 248 - .periph_buses = PL08X_AHB2, 249 - }, { 250 - .bus_id = "ext2_rx", 251 - .min_signal = 4, 252 - .max_signal = 4, 253 - .muxval = 2, 254 - .periph_buses = PL08X_AHB2, 255 - }, { 256 - .bus_id = "ext2_tx", 257 - .min_signal = 5, 258 - .max_signal = 5, 259 - .muxval = 2, 260 - .periph_buses = PL08X_AHB2, 261 - }, { 262 - .bus_id = "ext3_rx", 263 - .min_signal = 6, 264 - .max_signal = 6, 265 - .muxval = 2, 266 - .periph_buses = PL08X_AHB2, 267 - }, { 268 - .bus_id = "ext3_tx", 269 - .min_signal = 7, 270 - .max_signal = 7, 271 - .muxval = 2, 272 - .periph_buses = PL08X_AHB2, 273 - }, { 274 - .bus_id = "ext4_rx", 275 - .min_signal = 8, 276 - .max_signal = 8, 277 - .muxval = 2, 278 - .periph_buses = PL08X_AHB2, 279 - }, { 280 - .bus_id = "ext4_tx", 281 - .min_signal = 9, 282 - .max_signal = 9, 283 - .muxval = 2, 284 - .periph_buses = PL08X_AHB2, 285 - }, { 286 - .bus_id = "ext5_rx", 287 - .min_signal = 10, 288 - .max_signal = 10, 289 - .muxval = 2, 290 - .periph_buses = PL08X_AHB2, 291 - }, { 292 - .bus_id = "ext5_tx", 293 - .min_signal = 11, 294 - .max_signal = 11, 295 - .muxval = 2, 296 - .periph_buses = PL08X_AHB2, 297 - }, { 298 - .bus_id = "ext6_rx", 299 - .min_signal = 12, 300 - .max_signal = 12, 301 - .muxval = 2, 302 - .periph_buses = PL08X_AHB2, 303 - }, { 304 - .bus_id = "ext6_tx", 305 - .min_signal = 13, 306 - .max_signal = 13, 307 - .muxval = 2, 308 - .periph_buses = PL08X_AHB2, 309 - }, { 310 - .bus_id = "ext7_rx", 311 - .min_signal = 14, 312 - .max_signal = 14, 313 - .muxval = 2, 314 - .periph_buses = PL08X_AHB2, 315 - }, { 316 - .bus_id = "ext7_tx", 317 - .min_signal = 15, 318 - .max_signal = 15, 319 - .muxval = 2, 320 - .periph_buses = PL08X_AHB2, 321 - }, 322 - }; 323 - 324 - struct pl08x_platform_data pl080_plat_data = { 325 - .memcpy_channel = { 326 - .bus_id = "memcpy", 327 - .cctl_memcpy = 328 - (PL080_BSIZE_16 << PL080_CONTROL_SB_SIZE_SHIFT | \ 329 - PL080_BSIZE_16 << PL080_CONTROL_DB_SIZE_SHIFT | \ 330 - PL080_WIDTH_32BIT << PL080_CONTROL_SWIDTH_SHIFT | \ 331 - PL080_WIDTH_32BIT << PL080_CONTROL_DWIDTH_SHIFT | \ 332 - PL080_CONTROL_PROT_BUFF | PL080_CONTROL_PROT_CACHE | \ 333 - PL080_CONTROL_PROT_SYS), 334 - }, 335 - .lli_buses = PL08X_AHB1, 336 - .mem_buses = PL08X_AHB1, 337 - .get_signal = pl080_get_signal, 338 - .put_signal = pl080_put_signal, 339 - .slave_channels = spear600_dma_info, 340 - .num_slave_channels = ARRAY_SIZE(spear600_dma_info), 341 - }; 342 - 343 - /* 344 - * Following will create 16MB static virtual/physical mappings 345 - * PHYSICAL VIRTUAL 346 - * 0xF0000000 0xF0000000 347 - * 0xF1000000 0xF1000000 348 - * 0xD0000000 0xFD000000 349 - * 0xFC000000 0xFC000000 350 - */ 351 - struct map_desc spear6xx_io_desc[] __initdata = { 352 - { 353 - .virtual = VA_SPEAR6XX_ML_CPU_BASE, 354 - .pfn = __phys_to_pfn(SPEAR6XX_ML_CPU_BASE), 355 - .length = 2 * SZ_16M, 356 - .type = MT_DEVICE 357 - }, { 358 - .virtual = VA_SPEAR6XX_ICM1_BASE, 359 - .pfn = __phys_to_pfn(SPEAR6XX_ICM1_BASE), 360 - .length = SZ_16M, 361 - .type = MT_DEVICE 362 - }, { 363 - .virtual = VA_SPEAR6XX_ICM3_SMI_CTRL_BASE, 364 - .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SMI_CTRL_BASE), 365 - .length = SZ_16M, 366 - .type = MT_DEVICE 367 - }, 368 - }; 369 - 370 - /* This will create static memory mapping for selected devices */ 371 - void __init spear6xx_map_io(void) 372 - { 373 - iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); 374 - } 375 - 376 - void __init spear6xx_timer_init(void) 377 - { 378 - char pclk_name[] = "pll3_clk"; 379 - struct clk *gpt_clk, *pclk; 380 - 381 - spear6xx_clk_init(); 382 - 383 - /* get the system timer clock */ 384 - gpt_clk = clk_get_sys("gpt0", NULL); 385 - if (IS_ERR(gpt_clk)) { 386 - pr_err("%s:couldn't get clk for gpt\n", __func__); 387 - BUG(); 388 - } 389 - 390 - /* get the suitable parent clock for timer*/ 391 - pclk = clk_get(NULL, pclk_name); 392 - if (IS_ERR(pclk)) { 393 - pr_err("%s:couldn't get %s as parent for gpt\n", 394 - __func__, pclk_name); 395 - BUG(); 396 - } 397 - 398 - clk_set_parent(gpt_clk, pclk); 399 - clk_put(gpt_clk); 400 - clk_put(pclk); 401 - 402 - spear_setup_of_timer(); 403 - } 404 - 405 - /* Add auxdata to pass platform data */ 406 - struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = { 407 - OF_DEV_AUXDATA("arm,pl080", SPEAR6XX_ICM3_DMA_BASE, NULL, 408 - &pl080_plat_data), 409 - {} 410 - }; 411 - 412 - static void __init spear600_dt_init(void) 413 - { 414 - of_platform_populate(NULL, of_default_bus_match_table, 415 - spear6xx_auxdata_lookup, NULL); 416 - } 417 - 418 - static const char *spear600_dt_board_compat[] = { 419 - "st,spear600", 420 - NULL 421 - }; 422 - 423 - DT_MACHINE_START(SPEAR600_DT, "ST SPEAr600 (Flattened Device Tree)") 424 - .map_io = spear6xx_map_io, 425 - .init_irq = irqchip_init, 426 - .init_time = spear6xx_timer_init, 427 - .init_machine = spear600_dt_init, 428 - .restart = spear_restart, 429 - .dt_compat = spear600_dt_board_compat, 430 - MACHINE_END
+22 -7
arch/arm/mach-tegra/Kconfig
··· 1 - if ARCH_TEGRA 1 + config ARCH_TEGRA 2 + bool "NVIDIA Tegra" if ARCH_MULTI_V7 3 + select ARCH_HAS_CPUFREQ 4 + select ARCH_REQUIRE_GPIOLIB 5 + select CLKDEV_LOOKUP 6 + select CLKSRC_MMIO 7 + select CLKSRC_OF 8 + select COMMON_CLK 9 + select GENERIC_CLOCKEVENTS 10 + select HAVE_ARM_SCU if SMP 11 + select HAVE_ARM_TWD if LOCAL_TIMERS 12 + select HAVE_CLK 13 + select HAVE_SMP 14 + select MIGHT_HAVE_CACHE_L2X0 15 + select SOC_BUS 16 + select SPARSE_IRQ 17 + select USE_OF 18 + help 19 + This enables support for NVIDIA Tegra based systems. 2 20 3 - comment "NVIDIA Tegra options" 21 + menu "NVIDIA Tegra options" 22 + depends on ARCH_TEGRA 4 23 5 24 config ARCH_TEGRA_2x_SOC 6 25 bool "Enable support for Tegra20 family" 7 26 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP 8 27 select ARM_ERRATA_720789 9 - select ARM_ERRATA_742230 if SMP 10 - select ARM_ERRATA_751472 11 28 select ARM_ERRATA_754327 if SMP 12 29 select ARM_ERRATA_764369 if SMP 13 30 select ARM_GIC ··· 43 26 44 27 config ARCH_TEGRA_3x_SOC 45 28 bool "Enable support for Tegra30 family" 46 - select ARM_ERRATA_743622 47 - select ARM_ERRATA_751472 48 29 select ARM_ERRATA_754322 49 30 select ARM_ERRATA_764369 if SMP 50 31 select ARM_GIC ··· 86 71 config TEGRA_EMC_SCALING_ENABLE 87 72 bool "Enable scaling the memory frequency" 88 73 89 - endif 74 + endmenu
+2
arch/arm/mach-tegra/Makefile
··· 1 + asflags-y += -march=armv7-a 2 + 1 3 obj-y += common.o 2 4 obj-y += io.o 3 5 obj-y += irq.o
-3
arch/arm/mach-tegra/Makefile.boot
··· 1 - zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC) += 0x00008000 2 - params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00000100 3 - initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00800000
+1
arch/arm/mach-tegra/board.h
··· 40 40 static inline int tegra_clk_debugfs_init(void) { return 0; } 41 41 #endif 42 42 43 + int __init tegra_powergate_init(void); 43 44 #if defined(CONFIG_ARCH_TEGRA_2x_SOC) && defined(CONFIG_DEBUG_FS) 44 45 int __init tegra_powergate_debugfs_init(void); 45 46 #else
-2
arch/arm/mach-tegra/common.c
··· 27 27 28 28 #include <asm/hardware/cache-l2x0.h> 29 29 30 - #include <mach/powergate.h> 31 - 32 30 #include "board.h" 33 31 #include "common.h" 34 32 #include "fuse.h"
-54
arch/arm/mach-tegra/include/mach/powergate.h
··· 1 - /* 2 - * drivers/regulator/tegra-regulator.c 3 - * 4 - * Copyright (c) 2010 Google, Inc 5 - * 6 - * Author: 7 - * Colin Cross <ccross@google.com> 8 - * 9 - * This software is licensed under the terms of the GNU General Public 10 - * License version 2, as published by the Free Software Foundation, and 11 - * may be copied, distributed, and modified under those terms. 12 - * 13 - * This program is distributed in the hope that it will be useful, 14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 - * GNU General Public License for more details. 17 - * 18 - */ 19 - 20 - #ifndef _MACH_TEGRA_POWERGATE_H_ 21 - #define _MACH_TEGRA_POWERGATE_H_ 22 - 23 - struct clk; 24 - 25 - #define TEGRA_POWERGATE_CPU 0 26 - #define TEGRA_POWERGATE_3D 1 27 - #define TEGRA_POWERGATE_VENC 2 28 - #define TEGRA_POWERGATE_PCIE 3 29 - #define TEGRA_POWERGATE_VDEC 4 30 - #define TEGRA_POWERGATE_L2 5 31 - #define TEGRA_POWERGATE_MPE 6 32 - #define TEGRA_POWERGATE_HEG 7 33 - #define TEGRA_POWERGATE_SATA 8 34 - #define TEGRA_POWERGATE_CPU1 9 35 - #define TEGRA_POWERGATE_CPU2 10 36 - #define TEGRA_POWERGATE_CPU3 11 37 - #define TEGRA_POWERGATE_CELP 12 38 - #define TEGRA_POWERGATE_3D1 13 39 - 40 - #define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU 41 - #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 42 - 43 - int __init tegra_powergate_init(void); 44 - 45 - int tegra_cpu_powergate_id(int cpuid); 46 - int tegra_powergate_is_powered(int id); 47 - int tegra_powergate_power_on(int id); 48 - int tegra_powergate_power_off(int id); 49 - int tegra_powergate_remove_clamping(int id); 50 - 51 - /* Must be called with clk disabled, and returns with clk enabled */ 52 - int tegra_powergate_sequence_power_up(int id, struct clk *clk); 53 - 54 - #endif /* _MACH_TEGRA_POWERGATE_H_ */
-26
arch/arm/mach-tegra/include/mach/timex.h
··· 1 - /* 2 - * arch/arm/mach-tegra/include/mach/timex.h 3 - * 4 - * Copyright (C) 2010 Google, Inc. 5 - * 6 - * Author: 7 - * Colin Cross <ccross@google.com> 8 - * Erik Gilling <konkers@google.com> 9 - * 10 - * This software is licensed under the terms of the GNU General Public 11 - * License version 2, as published by the Free Software Foundation, and 12 - * may be copied, distributed, and modified under those terms. 13 - * 14 - * This program is distributed in the hope that it will be useful, 15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 - * GNU General Public License for more details. 18 - * 19 - */ 20 - 21 - #ifndef __MACH_TEGRA_TIMEX_H 22 - #define __MACH_TEGRA_TIMEX_H 23 - 24 - #define CLOCK_TICK_RATE 1000000 25 - 26 - #endif
-175
arch/arm/mach-tegra/include/mach/uncompress.h
··· 1 - /* 2 - * arch/arm/mach-tegra/include/mach/uncompress.h 3 - * 4 - * Copyright (C) 2010 Google, Inc. 5 - * Copyright (C) 2011 Google, Inc. 6 - * Copyright (C) 2011-2012 NVIDIA CORPORATION. All Rights Reserved. 7 - * 8 - * Author: 9 - * Colin Cross <ccross@google.com> 10 - * Erik Gilling <konkers@google.com> 11 - * Doug Anderson <dianders@chromium.org> 12 - * Stephen Warren <swarren@nvidia.com> 13 - * 14 - * This software is licensed under the terms of the GNU General Public 15 - * License version 2, as published by the Free Software Foundation, and 16 - * may be copied, distributed, and modified under those terms. 17 - * 18 - * This program is distributed in the hope that it will be useful, 19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 - * GNU General Public License for more details. 22 - * 23 - */ 24 - 25 - #ifndef __MACH_TEGRA_UNCOMPRESS_H 26 - #define __MACH_TEGRA_UNCOMPRESS_H 27 - 28 - #include <linux/types.h> 29 - #include <linux/serial_reg.h> 30 - 31 - #include "../../iomap.h" 32 - 33 - #define BIT(x) (1 << (x)) 34 - #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) 35 - 36 - #define DEBUG_UART_SHIFT 2 37 - 38 - volatile u8 *uart; 39 - 40 - static void putc(int c) 41 - { 42 - if (uart == NULL) 43 - return; 44 - 45 - while (!(uart[UART_LSR << DEBUG_UART_SHIFT] & UART_LSR_THRE)) 46 - barrier(); 47 - uart[UART_TX << DEBUG_UART_SHIFT] = c; 48 - } 49 - 50 - static inline void flush(void) 51 - { 52 - } 53 - 54 - static const struct { 55 - u32 base; 56 - u32 reset_reg; 57 - u32 clock_reg; 58 - u32 bit; 59 - } uarts[] = { 60 - { 61 - TEGRA_UARTA_BASE, 62 - TEGRA_CLK_RESET_BASE + 0x04, 63 - TEGRA_CLK_RESET_BASE + 0x10, 64 - 6, 65 - }, 66 - { 67 - TEGRA_UARTB_BASE, 68 - TEGRA_CLK_RESET_BASE + 0x04, 69 - TEGRA_CLK_RESET_BASE + 0x10, 70 - 7, 71 - }, 72 - { 73 - TEGRA_UARTC_BASE, 74 - TEGRA_CLK_RESET_BASE + 0x08, 75 - TEGRA_CLK_RESET_BASE + 0x14, 76 - 23, 77 - }, 78 - { 79 - TEGRA_UARTD_BASE, 80 - TEGRA_CLK_RESET_BASE + 0x0c, 81 - TEGRA_CLK_RESET_BASE + 0x18, 82 - 1, 83 - }, 84 - { 85 - TEGRA_UARTE_BASE, 86 - TEGRA_CLK_RESET_BASE + 0x0c, 87 - TEGRA_CLK_RESET_BASE + 0x18, 88 - 2, 89 - }, 90 - }; 91 - 92 - static inline bool uart_clocked(int i) 93 - { 94 - if (*(u8 *)uarts[i].reset_reg & BIT(uarts[i].bit)) 95 - return false; 96 - 97 - if (!(*(u8 *)uarts[i].clock_reg & BIT(uarts[i].bit))) 98 - return false; 99 - 100 - return true; 101 - } 102 - 103 - #ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA 104 - int auto_odmdata(void) 105 - { 106 - volatile u32 *pmc = (volatile u32 *)TEGRA_PMC_BASE; 107 - u32 odmdata = pmc[0xa0 / 4]; 108 - 109 - /* 110 - * Bits 19:18 are the console type: 0=default, 1=none, 2==DCC, 3==UART 111 - * Some boards apparently swap the last two values, but we don't have 112 - * any way of catering for that here, so we just accept either. If this 113 - * doesn't make sense for your board, just don't enable this feature. 114 - * 115 - * Bits 17:15 indicate the UART to use, 0/1/2/3/4 are UART A/B/C/D/E. 116 - */ 117 - 118 - switch ((odmdata >> 18) & 3) { 119 - case 2: 120 - case 3: 121 - break; 122 - default: 123 - return -1; 124 - } 125 - 126 - return (odmdata >> 15) & 7; 127 - } 128 - #endif 129 - 130 - /* 131 - * Setup before decompression. This is where we do UART selection for 132 - * earlyprintk and init the uart_base register. 133 - */ 134 - static inline void arch_decomp_setup(void) 135 - { 136 - int uart_id; 137 - volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE; 138 - u32 chip, div; 139 - 140 - #if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) 141 - uart_id = auto_odmdata(); 142 - #elif defined(CONFIG_TEGRA_DEBUG_UARTA) 143 - uart_id = 0; 144 - #elif defined(CONFIG_TEGRA_DEBUG_UARTB) 145 - uart_id = 1; 146 - #elif defined(CONFIG_TEGRA_DEBUG_UARTC) 147 - uart_id = 2; 148 - #elif defined(CONFIG_TEGRA_DEBUG_UARTD) 149 - uart_id = 3; 150 - #elif defined(CONFIG_TEGRA_DEBUG_UARTE) 151 - uart_id = 4; 152 - #endif 153 - 154 - if (uart_id < 0 || uart_id >= ARRAY_SIZE(uarts) || 155 - !uart_clocked(uart_id)) 156 - uart = NULL; 157 - else 158 - uart = (volatile u8 *)uarts[uart_id].base; 159 - 160 - if (uart == NULL) 161 - return; 162 - 163 - chip = (apb_misc[0x804 / 4] >> 8) & 0xff; 164 - if (chip == 0x20) 165 - div = 0x0075; 166 - else 167 - div = 0x00dd; 168 - 169 - uart[UART_LCR << DEBUG_UART_SHIFT] |= UART_LCR_DLAB; 170 - uart[UART_DLL << DEBUG_UART_SHIFT] = div & 0xff; 171 - uart[UART_DLM << DEBUG_UART_SHIFT] = div >> 8; 172 - uart[UART_LCR << DEBUG_UART_SHIFT] = 3; 173 - } 174 - 175 - #endif
+1 -2
arch/arm/mach-tegra/pcie.c
··· 34 34 #include <linux/delay.h> 35 35 #include <linux/export.h> 36 36 #include <linux/clk/tegra.h> 37 + #include <linux/tegra-powergate.h> 37 38 38 39 #include <asm/sizes.h> 39 40 #include <asm/mach/pci.h> 40 - 41 - #include <mach/powergate.h> 42 41 43 42 #include "board.h" 44 43 #include "iomap.h"
+1 -2
arch/arm/mach-tegra/powergate.c
··· 28 28 #include <linux/seq_file.h> 29 29 #include <linux/spinlock.h> 30 30 #include <linux/clk/tegra.h> 31 - 32 - #include <mach/powergate.h> 31 + #include <linux/tegra-powergate.h> 33 32 34 33 #include "fuse.h" 35 34 #include "iomap.h"
+16
arch/arm/mach-ux500/Kconfig
··· 1 + config ARCH_U8500 2 + bool "ST-Ericsson U8500 Series" if ARCH_MULTI_V7 3 + depends on MMU 4 + select ARCH_HAS_CPUFREQ 5 + select ARCH_REQUIRE_GPIOLIB 6 + select ARM_AMBA 7 + select CLKDEV_LOOKUP 8 + select CPU_V7 9 + select GENERIC_CLOCKEVENTS 10 + select HAVE_ARM_SCU if SMP 11 + select HAVE_ARM_TWD if LOCAL_TIMERS 12 + select HAVE_SMP 13 + select MIGHT_HAVE_CACHE_L2X0 14 + help 15 + Support for ST-Ericsson's Ux500 architecture 16 + 1 17 if ARCH_U8500 2 18 3 19 config UX500_SOC_COMMON
+3 -1
arch/arm/mach-ux500/Makefile
··· 3 3 # 4 4 5 5 obj-y := cpu.o devices.o devices-common.o \ 6 - id.o usb.o timer.o 6 + id.o usb.o timer.o pm.o 7 7 obj-$(CONFIG_CPU_IDLE) += cpuidle.o 8 8 obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 9 9 obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o ··· 15 15 board-mop500-audio.o 16 16 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 17 17 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 18 + 19 + CFLAGS_hotplug.o += -march=armv7-a
+3 -4
arch/arm/mach-ux500/board-mop500-audio.c
··· 10 10 #include <linux/platform_data/pinctrl-nomadik.h> 11 11 #include <linux/platform_data/dma-ste-dma40.h> 12 12 13 - #include <mach/devices.h> 14 - #include <mach/hardware.h> 15 - #include <mach/irqs.h> 16 - #include <mach/msp.h> 13 + #include "devices.h" 14 + #include "irqs.h" 15 + #include <linux/platform_data/asoc-ux500-msp.h> 17 16 18 17 #include "ste-dma40-db8500.h" 19 18 #include "board-mop500.h"
-2
arch/arm/mach-ux500/board-mop500-pins.c
··· 13 13 14 14 #include <asm/mach-types.h> 15 15 16 - #include <mach/hardware.h> 17 - 18 16 #include "pins-db8500.h" 19 17 #include "board-mop500.h" 20 18
+2 -2
arch/arm/mach-ux500/board-mop500-sdi.c
··· 14 14 #include <linux/platform_data/dma-ste-dma40.h> 15 15 16 16 #include <asm/mach-types.h> 17 - #include <mach/devices.h> 18 - #include <mach/hardware.h> 17 + #include "devices.h" 19 18 19 + #include "db8500-regs.h" 20 20 #include "devices-db8500.h" 21 21 #include "board-mop500.h" 22 22 #include "ste-dma40-db8500.h"
+6 -3
arch/arm/mach-ux500/board-mop500-u8500uib.c
··· 12 12 #include <linux/mfd/tc3589x.h> 13 13 #include <linux/input/matrix_keypad.h> 14 14 15 - #include <mach/irqs.h> 15 + #include "irqs.h" 16 16 17 17 #include "board-mop500.h" 18 18 19 - /* Dummy data that can be overridden by staging driver */ 20 - struct i2c_board_info __initdata __weak mop500_i2c3_devices_u8500[] = { 19 + static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = { 20 + { 21 + I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B), 22 + .irq = NOMADIK_GPIO_TO_IRQ(84), 23 + }, 21 24 }; 22 25 23 26 /*
-1
arch/arm/mach-ux500/board-mop500-uib.c
··· 11 11 #include <linux/init.h> 12 12 #include <linux/i2c.h> 13 13 14 - #include <mach/hardware.h> 15 14 #include "board-mop500.h" 16 15 #include "id.h" 17 16
+4 -62
arch/arm/mach-ux500/board-mop500.c
··· 44 44 #include <asm/mach-types.h> 45 45 #include <asm/mach/arch.h> 46 46 47 - #include <mach/hardware.h> 48 - #include <mach/setup.h> 49 - #include <mach/devices.h> 50 - #include <mach/irqs.h> 47 + #include "setup.h" 48 + #include "devices.h" 49 + #include "irqs.h" 51 50 #include <linux/platform_data/crypto-ux500.h> 52 51 53 52 #include "ste-dma40-db8500.h" 53 + #include "db8500-regs.h" 54 54 #include "devices-db8500.h" 55 55 #include "board-mop500.h" 56 56 #include "board-mop500-regulators.h" ··· 235 235 .regulator = &ab8500_regulator_plat_data, 236 236 .gpio = &ab8500_gpio_pdata, 237 237 .codec = &ab8500_codec_pdata, 238 - }; 239 - 240 - /* 241 - * Thermal Sensor 242 - */ 243 - 244 - static struct resource db8500_thsens_resources[] = { 245 - { 246 - .name = "IRQ_HOTMON_LOW", 247 - .start = IRQ_PRCMU_HOTMON_LOW, 248 - .end = IRQ_PRCMU_HOTMON_LOW, 249 - .flags = IORESOURCE_IRQ, 250 - }, 251 - { 252 - .name = "IRQ_HOTMON_HIGH", 253 - .start = IRQ_PRCMU_HOTMON_HIGH, 254 - .end = IRQ_PRCMU_HOTMON_HIGH, 255 - .flags = IORESOURCE_IRQ, 256 - }, 257 - }; 258 - 259 - static struct db8500_thsens_platform_data db8500_thsens_data = { 260 - .trip_points[0] = { 261 - .temp = 70000, 262 - .type = THERMAL_TRIP_ACTIVE, 263 - .cdev_name = { 264 - [0] = "thermal-cpufreq-0", 265 - }, 266 - }, 267 - .trip_points[1] = { 268 - .temp = 75000, 269 - .type = THERMAL_TRIP_ACTIVE, 270 - .cdev_name = { 271 - [0] = "thermal-cpufreq-0", 272 - }, 273 - }, 274 - .trip_points[2] = { 275 - .temp = 80000, 276 - .type = THERMAL_TRIP_ACTIVE, 277 - .cdev_name = { 278 - [0] = "thermal-cpufreq-0", 279 - }, 280 - }, 281 - .trip_points[3] = { 282 - .temp = 85000, 283 - .type = THERMAL_TRIP_CRITICAL, 284 - }, 285 - .num_trips = 4, 286 - }; 287 - 288 - static struct platform_device u8500_thsens_device = { 289 - .name = "db8500-thermal", 290 - .resource = db8500_thsens_resources, 291 - .num_resources = ARRAY_SIZE(db8500_thsens_resources), 292 - .dev = { 293 - .platform_data = &db8500_thsens_data, 294 - }, 295 238 }; 296 239 297 240 static struct platform_device u8500_cpufreq_cooling_device = { ··· 606 663 &snowball_key_dev, 607 664 &snowball_sbnet_dev, 608 665 &snowball_gpio_en_3v3_regulator_dev, 609 - &u8500_thsens_device, 610 666 &u8500_cpufreq_cooling_device, 611 667 &sdi0_regulator, 612 668 };
+2 -2
arch/arm/mach-ux500/board-mop500.h
··· 8 8 #define __BOARD_MOP500_H 9 9 10 10 /* For NOMADIK_NR_GPIO */ 11 - #include <mach/irqs.h> 12 - #include <mach/msp.h> 11 + #include "irqs.h" 12 + #include <linux/platform_data/asoc-ux500-msp.h> 13 13 #include <linux/amba/mmci.h> 14 14 15 15 /* Snowball specific GPIO assignments, this board has no GPIO expander */
+1 -1
arch/arm/mach-ux500/cache-l2x0.c
··· 9 9 10 10 #include <asm/cacheflush.h> 11 11 #include <asm/hardware/cache-l2x0.h> 12 - #include <mach/hardware.h> 13 12 13 + #include "db8500-regs.h" 14 14 #include "id.h" 15 15 16 16 static void __iomem *l2x0_base;
+4 -8
arch/arm/mach-ux500/cpu-db8500.c
··· 28 28 #include <asm/mach/map.h> 29 29 #include <asm/mach/arch.h> 30 30 31 - #include <mach/hardware.h> 32 - #include <mach/setup.h> 33 - #include <mach/devices.h> 34 - #include <mach/db8500-regs.h> 35 - #include <mach/irqs.h> 31 + #include "setup.h" 32 + #include "devices.h" 33 + #include "irqs.h" 36 34 37 35 #include "devices-db8500.h" 38 36 #include "ste-dma40-db8500.h" 39 - 37 + #include "db8500-regs.h" 40 38 #include "board-mop500.h" 41 39 #include "id.h" 42 40 ··· 92 94 iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc)); 93 95 else 94 96 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); 95 - 96 - _PRCMU_BASE = __io_address(U8500_PRCMU_BASE); 97 97 } 98 98 99 99 static struct resource db8500_pmu_resources[] = {
+21 -12
arch/arm/mach-ux500/cpu.c
··· 8 8 9 9 #include <linux/platform_device.h> 10 10 #include <linux/io.h> 11 - #include <linux/mfd/db8500-prcmu.h> 11 + #include <linux/mfd/dbx500-prcmu.h> 12 12 #include <linux/clksrc-dbx500-prcmu.h> 13 13 #include <linux/sys_soc.h> 14 14 #include <linux/err.h> ··· 20 20 #include <linux/irqchip.h> 21 21 #include <linux/irqchip/arm-gic.h> 22 22 #include <linux/platform_data/clk-ux500.h> 23 + #include <linux/platform_data/arm-ux500-pm.h> 23 24 24 25 #include <asm/mach/map.h> 25 26 26 - #include <mach/hardware.h> 27 - #include <mach/setup.h> 28 - #include <mach/devices.h> 27 + #include "setup.h" 28 + #include "devices.h" 29 29 30 30 #include "board-mop500.h" 31 + #include "db8500-regs.h" 31 32 #include "id.h" 32 - 33 - void __iomem *_PRCMU_BASE; 34 33 35 34 /* 36 35 * FIXME: Should we set up the GPIO domain here? ··· 67 68 * Init clocks here so that they are available for system timer 68 69 * initialization. 69 70 */ 70 - if (cpu_is_u8500_family() || cpu_is_u9540()) 71 - db8500_prcmu_early_init(); 72 - 73 - if (cpu_is_u8500_family() || cpu_is_u9540()) 74 - u8500_clk_init(); 75 - else if (cpu_is_u8540()) 71 + if (cpu_is_u8500_family()) { 72 + prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1); 73 + ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1); 74 + u8500_clk_init(U8500_CLKRST1_BASE, U8500_CLKRST2_BASE, 75 + U8500_CLKRST3_BASE, U8500_CLKRST5_BASE, 76 + U8500_CLKRST6_BASE); 77 + } else if (cpu_is_u9540()) { 78 + prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1); 79 + ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1); 80 + u8500_clk_init(U8500_CLKRST1_BASE, U8500_CLKRST2_BASE, 81 + U8500_CLKRST3_BASE, U8500_CLKRST5_BASE, 82 + U8500_CLKRST6_BASE); 83 + } else if (cpu_is_u8540()) { 84 + prcmu_early_init(U8500_PRCMU_BASE, SZ_8K + SZ_4K - 1); 85 + ux500_pm_init(U8500_PRCMU_BASE, SZ_8K + SZ_4K - 1); 76 86 u8540_clk_init(); 87 + } 77 88 } 78 89 79 90 void __init ux500_init_late(void)
+4 -1
arch/arm/mach-ux500/cpuidle.c
··· 15 15 #include <linux/atomic.h> 16 16 #include <linux/smp.h> 17 17 #include <linux/mfd/dbx500-prcmu.h> 18 + #include <linux/platform_data/arm-ux500-pm.h> 18 19 19 20 #include <asm/cpuidle.h> 20 21 #include <asm/proc-fns.h> 22 + 23 + #include "db8500-regs.h" 21 24 22 25 static atomic_t master = ATOMIC_INIT(0); 23 26 static DEFINE_SPINLOCK(master_lock); ··· 114 111 115 112 int __init ux500_idle_init(void) 116 113 { 117 - /* Configure wake up reasons */ 114 + /* Configure wake up reasons */ 118 115 prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | 119 116 PRCMU_WAKEUP(ABB)); 120 117
+201
arch/arm/mach-ux500/db8500-regs.h
··· 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 + /* Base address and bank offsets for ESRAM */ 11 + #define U8500_ESRAM_BASE 0x40000000 12 + #define U8500_ESRAM_BANK_SIZE 0x00020000 13 + #define U8500_ESRAM_BANK0 U8500_ESRAM_BASE 14 + #define U8500_ESRAM_BANK1 (U8500_ESRAM_BASE + U8500_ESRAM_BANK_SIZE) 15 + #define U8500_ESRAM_BANK2 (U8500_ESRAM_BANK1 + U8500_ESRAM_BANK_SIZE) 16 + #define U8500_ESRAM_BANK3 (U8500_ESRAM_BANK2 + U8500_ESRAM_BANK_SIZE) 17 + #define U8500_ESRAM_BANK4 (U8500_ESRAM_BANK3 + U8500_ESRAM_BANK_SIZE) 18 + /* 19 + * on V1 DMA uses 4KB for logical parameters position is right after the 64KB 20 + * reserved for security 21 + */ 22 + #define U8500_ESRAM_DMA_LCPA_OFFSET 0x10000 23 + 24 + #define U8500_DMA_LCPA_BASE (U8500_ESRAM_BANK0 + U8500_ESRAM_DMA_LCPA_OFFSET) 25 + 26 + /* This address fulfills the 256k alignment requirement of the lcla base */ 27 + #define U8500_DMA_LCLA_BASE U8500_ESRAM_BANK4 28 + 29 + #define U8500_PER3_BASE 0x80000000 30 + #define U8500_STM_BASE 0x80100000 31 + #define U8500_STM_REG_BASE (U8500_STM_BASE + 0xF000) 32 + #define U8500_PER2_BASE 0x80110000 33 + #define U8500_PER1_BASE 0x80120000 34 + #define U8500_B2R2_BASE 0x80130000 35 + #define U8500_HSEM_BASE 0x80140000 36 + #define U8500_PER4_BASE 0x80150000 37 + #define U8500_TPIU_BASE 0x80190000 38 + #define U8500_ICN_BASE 0x81000000 39 + 40 + #define U8500_BOOT_ROM_BASE 0x90000000 41 + /* ASIC ID is at 0xbf4 offset within this region */ 42 + #define U8500_ASIC_ID_BASE 0x9001D000 43 + 44 + #define U9540_BOOT_ROM_BASE 0xFFFE0000 45 + /* ASIC ID is at 0xbf4 offset within this region */ 46 + #define U9540_ASIC_ID_BASE 0xFFFFD000 47 + 48 + #define U8500_PER6_BASE 0xa03c0000 49 + #define U8500_PER7_BASE 0xa03d0000 50 + #define U8500_PER5_BASE 0xa03e0000 51 + 52 + #define U8500_SVA_BASE 0xa0100000 53 + #define U8500_SIA_BASE 0xa0200000 54 + 55 + #define U8500_SGA_BASE 0xa0300000 56 + #define U8500_MCDE_BASE 0xa0350000 57 + #define U8500_DMA_BASE 0x801C0000 /* v1 */ 58 + 59 + #define U8500_SBAG_BASE 0xa0390000 60 + 61 + #define U8500_SCU_BASE 0xa0410000 62 + #define U8500_GIC_CPU_BASE 0xa0410100 63 + #define U8500_TWD_BASE 0xa0410600 64 + #define U8500_GIC_DIST_BASE 0xa0411000 65 + #define U8500_L2CC_BASE 0xa0412000 66 + 67 + #define U8500_MODEM_I2C 0xb7e02000 68 + 69 + #define U8500_GPIO0_BASE (U8500_PER1_BASE + 0xE000) 70 + #define U8500_GPIO1_BASE (U8500_PER3_BASE + 0xE000) 71 + #define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xE000) 72 + #define U8500_GPIO3_BASE (U8500_PER5_BASE + 0x1E000) 73 + 74 + #define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000) 75 + #define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000) 76 + 77 + /* per6 base addresses */ 78 + #define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000) 79 + #define U8500_HASH0_BASE (U8500_PER6_BASE + 0x1000) 80 + #define U8500_HASH1_BASE (U8500_PER6_BASE + 0x2000) 81 + #define U8500_PKA_BASE (U8500_PER6_BASE + 0x4000) 82 + #define U8500_PKAM_BASE (U8500_PER6_BASE + 0x5100) 83 + #define U8500_MTU0_BASE (U8500_PER6_BASE + 0x6000) /* v1 */ 84 + #define U8500_MTU1_BASE (U8500_PER6_BASE + 0x7000) /* v1 */ 85 + #define U8500_CR_BASE (U8500_PER6_BASE + 0x8000) /* v1 */ 86 + #define U8500_CRYP0_BASE (U8500_PER6_BASE + 0xa000) 87 + #define U8500_CRYP1_BASE (U8500_PER6_BASE + 0xb000) 88 + #define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000) 89 + 90 + /* per5 base addresses */ 91 + #define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000) 92 + #define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000) 93 + 94 + /* per4 base addresses */ 95 + #define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x00000) 96 + #define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x01000) 97 + #define U8500_RTT0_BASE (U8500_PER4_BASE + 0x02000) 98 + #define U8500_RTT1_BASE (U8500_PER4_BASE + 0x03000) 99 + #define U8500_RTC_BASE (U8500_PER4_BASE + 0x04000) 100 + #define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) 101 + #define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) 102 + #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) 103 + #define U9540_DMC1_BASE (U8500_PER4_BASE + 0x0A000) 104 + #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000) 105 + #define U9540_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x6A000) 106 + #define U8500_PRCMU_TCPM_BASE (U8500_PER4_BASE + 0x60000) 107 + #define U8500_PRCMU_TIMER_3_BASE (U8500_PER4_BASE + 0x07338) 108 + #define U8500_PRCMU_TIMER_4_BASE (U8500_PER4_BASE + 0x07450) 109 + 110 + /* per3 base addresses */ 111 + #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) 112 + #define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000) 113 + #define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000) 114 + #define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000) 115 + #define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000) 116 + #define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000) 117 + #define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000) 118 + #define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000) 119 + #define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000) 120 + 121 + /* per2 base addresses */ 122 + #define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000) 123 + #define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000) 124 + #define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000) 125 + #define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000) 126 + #define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000) 127 + #define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000) 128 + #define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000) 129 + #define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000) 130 + #define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000) 131 + #define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000) 132 + #define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000) 133 + #define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000) 134 + 135 + /* per1 base addresses */ 136 + #define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000) 137 + #define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000) 138 + #define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000) 139 + #define U8500_MSP3_BASE (U8500_PER1_BASE + 0x5000) 140 + #define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000) 141 + #define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000) 142 + #define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000) 143 + #define U8500_I2C4_BASE (U8500_PER1_BASE + 0xa000) 144 + #define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xb000) 145 + #define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000) 146 + 147 + #define U8500_SHRM_GOP_INTERRUPT_BASE 0xB7C00040 148 + 149 + #define U8500_GPIOBANK0_BASE U8500_GPIO0_BASE 150 + #define U8500_GPIOBANK1_BASE (U8500_GPIO0_BASE + 0x80) 151 + #define U8500_GPIOBANK2_BASE U8500_GPIO1_BASE 152 + #define U8500_GPIOBANK3_BASE (U8500_GPIO1_BASE + 0x80) 153 + #define U8500_GPIOBANK4_BASE (U8500_GPIO1_BASE + 0x100) 154 + #define U8500_GPIOBANK5_BASE (U8500_GPIO1_BASE + 0x180) 155 + #define U8500_GPIOBANK6_BASE U8500_GPIO2_BASE 156 + #define U8500_GPIOBANK7_BASE (U8500_GPIO2_BASE + 0x80) 157 + #define U8500_GPIOBANK8_BASE U8500_GPIO3_BASE 158 + 159 + #define U8500_MCDE_SIZE 0x1000 160 + #define U8500_DSI_LINK_SIZE 0x1000 161 + #define U8500_DSI_LINK1_BASE (U8500_MCDE_BASE + U8500_MCDE_SIZE) 162 + #define U8500_DSI_LINK2_BASE (U8500_DSI_LINK1_BASE + U8500_DSI_LINK_SIZE) 163 + #define U8500_DSI_LINK3_BASE (U8500_DSI_LINK2_BASE + U8500_DSI_LINK_SIZE) 164 + #define U8500_DSI_LINK_COUNT 0x3 165 + 166 + /* Modem and APE physical addresses */ 167 + #define U8500_MODEM_BASE 0xe000000 168 + #define U8500_APE_BASE 0x6000000 169 + 170 + /* SoC identification number information */ 171 + #define U8500_BB_UID_BASE (U8500_BACKUPRAM1_BASE + 0xFC0) 172 + 173 + /* Offsets to specific addresses in some IP blocks for DMA */ 174 + #define MSP_TX_RX_REG_OFFSET 0 175 + #define CRYP1_RX_REG_OFFSET 0x10 176 + #define CRYP1_TX_REG_OFFSET 0x8 177 + #define HASH1_TX_REG_OFFSET 0x4 178 + 179 + /* 180 + * Macros to get at IO space when running virtually 181 + * We dont map all the peripherals, let ioremap do 182 + * this for us. We map only very basic peripherals here. 183 + */ 184 + #define U8500_IO_VIRTUAL 0xf0000000 185 + #define U8500_IO_PHYSICAL 0xa0000000 186 + /* This is where we map in the ROM to check ASIC IDs */ 187 + #define UX500_VIRT_ROM 0xf0000000 188 + 189 + /* This macro is used in assembly, so no cast */ 190 + #define IO_ADDRESS(x) \ 191 + (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL) 192 + 193 + /* typesafe io address */ 194 + #define __io_address(n) IOMEM(IO_ADDRESS(n)) 195 + 196 + /* Used by some plat-nomadik code */ 197 + #define io_p2v(n) __io_address(n) 198 + 199 + #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 200 + 201 + #endif
+1 -2
arch/arm/mach-ux500/devices-common.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/platform_data/pinctrl-nomadik.h> 15 15 16 - #include <mach/hardware.h> 17 - #include <mach/irqs.h> 16 + #include "irqs.h" 18 17 19 18 #include "devices-common.h" 20 19
+5 -3
arch/arm/mach-ux500/devices-db8500.c
··· 15 15 #include <linux/platform_data/dma-ste-dma40.h> 16 16 #include <linux/mfd/dbx500-prcmu.h> 17 17 18 - #include <mach/hardware.h> 19 - #include <mach/setup.h> 20 - #include <mach/irqs.h> 18 + #include "setup.h" 19 + #include "irqs.h" 21 20 21 + #include "db8500-regs.h" 22 22 #include "devices-db8500.h" 23 23 #include "ste-dma40-db8500.h" 24 24 ··· 199 199 200 200 struct prcmu_pdata db8500_prcmu_pdata = { 201 201 .ab_platdata = &ab8500_platdata, 202 + .ab_irq = IRQ_DB8500_AB8500, 203 + .irq_base = IRQ_PRCMU_BASE, 202 204 .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET, 203 205 .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET, 204 206 };
+2 -1
arch/arm/mach-ux500/devices-db8500.h
··· 9 9 #define __DEVICES_DB8500_H 10 10 11 11 #include <linux/platform_data/usb-musb-ux500.h> 12 - #include <mach/irqs.h> 12 + #include "irqs.h" 13 + #include "db8500-regs.h" 13 14 #include "devices-common.h" 14 15 15 16 struct ske_keypad_platform_data;
+3 -2
arch/arm/mach-ux500/devices.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/amba/bus.h> 13 13 14 - #include <mach/hardware.h> 15 - #include <mach/setup.h> 14 + #include "setup.h" 15 + 16 + #include "db8500-regs.h" 16 17 17 18 void __init amba_add_devices(struct amba_device *devs[], int num) 18 19 {
+1 -1
arch/arm/mach-ux500/hotplug.c
··· 15 15 #include <asm/cacheflush.h> 16 16 #include <asm/smp_plat.h> 17 17 18 - #include <mach/setup.h> 18 + #include "setup.h" 19 19 20 20 /* 21 21 * platform-specific code to shutdown a CPU
+2 -2
arch/arm/mach-ux500/id.c
··· 14 14 #include <asm/cacheflush.h> 15 15 #include <asm/mach/map.h> 16 16 17 - #include <mach/hardware.h> 18 - #include <mach/setup.h> 17 + #include "setup.h" 19 18 19 + #include "db8500-regs.h" 20 20 #include "id.h" 21 21 22 22 struct dbx500_asic_id dbx500_id;
-173
arch/arm/mach-ux500/include/mach/db8500-regs.h
··· 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 - /* Base address and bank offsets for ESRAM */ 11 - #define U8500_ESRAM_BASE 0x40000000 12 - #define U8500_ESRAM_BANK_SIZE 0x00020000 13 - #define U8500_ESRAM_BANK0 U8500_ESRAM_BASE 14 - #define U8500_ESRAM_BANK1 (U8500_ESRAM_BASE + U8500_ESRAM_BANK_SIZE) 15 - #define U8500_ESRAM_BANK2 (U8500_ESRAM_BANK1 + U8500_ESRAM_BANK_SIZE) 16 - #define U8500_ESRAM_BANK3 (U8500_ESRAM_BANK2 + U8500_ESRAM_BANK_SIZE) 17 - #define U8500_ESRAM_BANK4 (U8500_ESRAM_BANK3 + U8500_ESRAM_BANK_SIZE) 18 - /* 19 - * on V1 DMA uses 4KB for logical parameters position is right after the 64KB 20 - * reserved for security 21 - */ 22 - #define U8500_ESRAM_DMA_LCPA_OFFSET 0x10000 23 - 24 - #define U8500_DMA_LCPA_BASE (U8500_ESRAM_BANK0 + U8500_ESRAM_DMA_LCPA_OFFSET) 25 - 26 - /* This address fulfills the 256k alignment requirement of the lcla base */ 27 - #define U8500_DMA_LCLA_BASE U8500_ESRAM_BANK4 28 - 29 - #define U8500_PER3_BASE 0x80000000 30 - #define U8500_STM_BASE 0x80100000 31 - #define U8500_STM_REG_BASE (U8500_STM_BASE + 0xF000) 32 - #define U8500_PER2_BASE 0x80110000 33 - #define U8500_PER1_BASE 0x80120000 34 - #define U8500_B2R2_BASE 0x80130000 35 - #define U8500_HSEM_BASE 0x80140000 36 - #define U8500_PER4_BASE 0x80150000 37 - #define U8500_TPIU_BASE 0x80190000 38 - #define U8500_ICN_BASE 0x81000000 39 - 40 - #define U8500_BOOT_ROM_BASE 0x90000000 41 - /* ASIC ID is at 0xbf4 offset within this region */ 42 - #define U8500_ASIC_ID_BASE 0x9001D000 43 - 44 - #define U9540_BOOT_ROM_BASE 0xFFFE0000 45 - /* ASIC ID is at 0xbf4 offset within this region */ 46 - #define U9540_ASIC_ID_BASE 0xFFFFD000 47 - 48 - #define U8500_PER6_BASE 0xa03c0000 49 - #define U8500_PER7_BASE 0xa03d0000 50 - #define U8500_PER5_BASE 0xa03e0000 51 - 52 - #define U8500_SVA_BASE 0xa0100000 53 - #define U8500_SIA_BASE 0xa0200000 54 - 55 - #define U8500_SGA_BASE 0xa0300000 56 - #define U8500_MCDE_BASE 0xa0350000 57 - #define U8500_DMA_BASE 0x801C0000 /* v1 */ 58 - 59 - #define U8500_SBAG_BASE 0xa0390000 60 - 61 - #define U8500_SCU_BASE 0xa0410000 62 - #define U8500_GIC_CPU_BASE 0xa0410100 63 - #define U8500_TWD_BASE 0xa0410600 64 - #define U8500_GIC_DIST_BASE 0xa0411000 65 - #define U8500_L2CC_BASE 0xa0412000 66 - 67 - #define U8500_MODEM_I2C 0xb7e02000 68 - 69 - #define U8500_GPIO0_BASE (U8500_PER1_BASE + 0xE000) 70 - #define U8500_GPIO1_BASE (U8500_PER3_BASE + 0xE000) 71 - #define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xE000) 72 - #define U8500_GPIO3_BASE (U8500_PER5_BASE + 0x1E000) 73 - 74 - #define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000) 75 - #define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000) 76 - 77 - /* per6 base addresses */ 78 - #define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000) 79 - #define U8500_HASH0_BASE (U8500_PER6_BASE + 0x1000) 80 - #define U8500_HASH1_BASE (U8500_PER6_BASE + 0x2000) 81 - #define U8500_PKA_BASE (U8500_PER6_BASE + 0x4000) 82 - #define U8500_PKAM_BASE (U8500_PER6_BASE + 0x5100) 83 - #define U8500_MTU0_BASE (U8500_PER6_BASE + 0x6000) /* v1 */ 84 - #define U8500_MTU1_BASE (U8500_PER6_BASE + 0x7000) /* v1 */ 85 - #define U8500_CR_BASE (U8500_PER6_BASE + 0x8000) /* v1 */ 86 - #define U8500_CRYP0_BASE (U8500_PER6_BASE + 0xa000) 87 - #define U8500_CRYP1_BASE (U8500_PER6_BASE + 0xb000) 88 - #define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000) 89 - 90 - /* per5 base addresses */ 91 - #define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000) 92 - #define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000) 93 - 94 - /* per4 base addresses */ 95 - #define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x00000) 96 - #define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x01000) 97 - #define U8500_RTT0_BASE (U8500_PER4_BASE + 0x02000) 98 - #define U8500_RTT1_BASE (U8500_PER4_BASE + 0x03000) 99 - #define U8500_RTC_BASE (U8500_PER4_BASE + 0x04000) 100 - #define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) 101 - #define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) 102 - #define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) 103 - #define U9540_DMC1_BASE (U8500_PER4_BASE + 0x0A000) 104 - #define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000) 105 - #define U9540_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x6A000) 106 - #define U8500_PRCMU_TCPM_BASE (U8500_PER4_BASE + 0x60000) 107 - #define U8500_PRCMU_TIMER_3_BASE (U8500_PER4_BASE + 0x07338) 108 - #define U8500_PRCMU_TIMER_4_BASE (U8500_PER4_BASE + 0x07450) 109 - 110 - /* per3 base addresses */ 111 - #define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) 112 - #define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000) 113 - #define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000) 114 - #define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000) 115 - #define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000) 116 - #define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000) 117 - #define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000) 118 - #define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000) 119 - #define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000) 120 - 121 - /* per2 base addresses */ 122 - #define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000) 123 - #define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000) 124 - #define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000) 125 - #define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000) 126 - #define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000) 127 - #define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000) 128 - #define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000) 129 - #define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000) 130 - #define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000) 131 - #define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000) 132 - #define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000) 133 - #define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000) 134 - 135 - /* per1 base addresses */ 136 - #define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000) 137 - #define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000) 138 - #define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000) 139 - #define U8500_MSP3_BASE (U8500_PER1_BASE + 0x5000) 140 - #define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000) 141 - #define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000) 142 - #define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000) 143 - #define U8500_I2C4_BASE (U8500_PER1_BASE + 0xa000) 144 - #define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xb000) 145 - #define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000) 146 - 147 - #define U8500_SHRM_GOP_INTERRUPT_BASE 0xB7C00040 148 - 149 - #define U8500_GPIOBANK0_BASE U8500_GPIO0_BASE 150 - #define U8500_GPIOBANK1_BASE (U8500_GPIO0_BASE + 0x80) 151 - #define U8500_GPIOBANK2_BASE U8500_GPIO1_BASE 152 - #define U8500_GPIOBANK3_BASE (U8500_GPIO1_BASE + 0x80) 153 - #define U8500_GPIOBANK4_BASE (U8500_GPIO1_BASE + 0x100) 154 - #define U8500_GPIOBANK5_BASE (U8500_GPIO1_BASE + 0x180) 155 - #define U8500_GPIOBANK6_BASE U8500_GPIO2_BASE 156 - #define U8500_GPIOBANK7_BASE (U8500_GPIO2_BASE + 0x80) 157 - #define U8500_GPIOBANK8_BASE U8500_GPIO3_BASE 158 - 159 - #define U8500_MCDE_SIZE 0x1000 160 - #define U8500_DSI_LINK_SIZE 0x1000 161 - #define U8500_DSI_LINK1_BASE (U8500_MCDE_BASE + U8500_MCDE_SIZE) 162 - #define U8500_DSI_LINK2_BASE (U8500_DSI_LINK1_BASE + U8500_DSI_LINK_SIZE) 163 - #define U8500_DSI_LINK3_BASE (U8500_DSI_LINK2_BASE + U8500_DSI_LINK_SIZE) 164 - #define U8500_DSI_LINK_COUNT 0x3 165 - 166 - /* Modem and APE physical addresses */ 167 - #define U8500_MODEM_BASE 0xe000000 168 - #define U8500_APE_BASE 0x6000000 169 - 170 - /* SoC identification number information */ 171 - #define U8500_BB_UID_BASE (U8500_BACKUPRAM1_BASE + 0xFC0) 172 - 173 - #endif
-39
arch/arm/mach-ux500/include/mach/debug-macro.S
··· 1 - /* 2 - * Debugging macro include header 3 - * 4 - * Copyright (C) 2009 ST-Ericsson 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License version 2 as 8 - * published by the Free Software Foundation. 9 - * 10 - */ 11 - #include <mach/hardware.h> 12 - 13 - #if CONFIG_UX500_DEBUG_UART > 2 14 - #error Invalid Ux500 debug UART 15 - #endif 16 - 17 - /* 18 - * DEBUG_LL only works if only one SOC is built in. We don't use #else below 19 - * in order to get "__UX500_UART redefined" warnings if more than one SOC is 20 - * built, so that there's some hint during the build that something is wrong. 21 - */ 22 - 23 - #ifdef CONFIG_UX500_SOC_DB8500 24 - #define __UX500_UART(n) U8500_UART##n##_BASE 25 - #endif 26 - 27 - #ifndef __UX500_UART 28 - #error Unknown SOC 29 - #endif 30 - 31 - #define UX500_UART(n) __UX500_UART(n) 32 - #define UART_BASE UX500_UART(CONFIG_UX500_DEBUG_UART) 33 - 34 - .macro addruart, rp, rv, tmp 35 - ldr \rp, =UART_BASE @ no, physical address 36 - ldr \rv, =IO_ADDRESS(UART_BASE) @ yes, virtual address 37 - .endm 38 - 39 - #include <asm/hardware/debug-pl01x.S>
arch/arm/mach-ux500/include/mach/devices.h arch/arm/mach-ux500/devices.h
-47
arch/arm/mach-ux500/include/mach/hardware.h
··· 1 - /* 2 - * Copyright (C) 2009 ST-Ericsson. 3 - * 4 - * U8500 hardware definitions 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without any 8 - * warranty of any kind, whether express or implied. 9 - */ 10 - #ifndef __MACH_HARDWARE_H 11 - #define __MACH_HARDWARE_H 12 - 13 - /* 14 - * Macros to get at IO space when running virtually 15 - * We dont map all the peripherals, let ioremap do 16 - * this for us. We map only very basic peripherals here. 17 - */ 18 - #define U8500_IO_VIRTUAL 0xf0000000 19 - #define U8500_IO_PHYSICAL 0xa0000000 20 - /* This is where we map in the ROM to check ASIC IDs */ 21 - #define UX500_VIRT_ROM 0xf0000000 22 - 23 - /* This macro is used in assembly, so no cast */ 24 - #define IO_ADDRESS(x) \ 25 - (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL) 26 - 27 - /* typesafe io address */ 28 - #define __io_address(n) IOMEM(IO_ADDRESS(n)) 29 - 30 - /* Used by some plat-nomadik code */ 31 - #define io_p2v(n) __io_address(n) 32 - 33 - #include <mach/db8500-regs.h> 34 - 35 - #define MSP_TX_RX_REG_OFFSET 0 36 - #define CRYP1_RX_REG_OFFSET 0x10 37 - #define CRYP1_TX_REG_OFFSET 0x8 38 - #define HASH1_TX_REG_OFFSET 0x4 39 - 40 - #ifndef __ASSEMBLY__ 41 - 42 - extern void __iomem *_PRCMU_BASE; 43 - 44 - #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 45 - 46 - #endif /* __ASSEMBLY__ */ 47 - #endif /* __MACH_HARDWARE_H */
arch/arm/mach-ux500/include/mach/irqs-board-mop500.h arch/arm/mach-ux500/irqs-board-mop500.h
-150
arch/arm/mach-ux500/include/mach/irqs-db8500.h
··· 1 - /* 2 - * Copyright (C) ST-Ericsson SA 2010 3 - * 4 - * Author: Rabin Vincent <rabin.vincent@stericsson.com> 5 - * License terms: GNU General Public License (GPL) version 2 6 - */ 7 - 8 - #ifndef __MACH_IRQS_DB8500_H 9 - #define __MACH_IRQS_DB8500_H 10 - 11 - #define IRQ_DB8500_MTU0 (IRQ_SHPI_START + 4) 12 - #define IRQ_DB8500_SPI2 (IRQ_SHPI_START + 6) 13 - #define IRQ_DB8500_PMU (IRQ_SHPI_START + 7) 14 - #define IRQ_DB8500_SPI0 (IRQ_SHPI_START + 8) 15 - #define IRQ_DB8500_RTT (IRQ_SHPI_START + 9) 16 - #define IRQ_DB8500_PKA (IRQ_SHPI_START + 10) 17 - #define IRQ_DB8500_UART0 (IRQ_SHPI_START + 11) 18 - #define IRQ_DB8500_I2C3 (IRQ_SHPI_START + 12) 19 - #define IRQ_DB8500_L2CC (IRQ_SHPI_START + 13) 20 - #define IRQ_DB8500_SSP0 (IRQ_SHPI_START + 14) 21 - #define IRQ_DB8500_CRYP1 (IRQ_SHPI_START + 15) 22 - #define IRQ_DB8500_MSP1_RX (IRQ_SHPI_START + 16) 23 - #define IRQ_DB8500_MTU1 (IRQ_SHPI_START + 17) 24 - #define IRQ_DB8500_RTC (IRQ_SHPI_START + 18) 25 - #define IRQ_DB8500_UART1 (IRQ_SHPI_START + 19) 26 - #define IRQ_DB8500_USB_WAKEUP (IRQ_SHPI_START + 20) 27 - #define IRQ_DB8500_I2C0 (IRQ_SHPI_START + 21) 28 - #define IRQ_DB8500_I2C1 (IRQ_SHPI_START + 22) 29 - #define IRQ_DB8500_USBOTG (IRQ_SHPI_START + 23) 30 - #define IRQ_DB8500_DMA_SECURE (IRQ_SHPI_START + 24) 31 - #define IRQ_DB8500_DMA (IRQ_SHPI_START + 25) 32 - #define IRQ_DB8500_UART2 (IRQ_SHPI_START + 26) 33 - #define IRQ_DB8500_ICN_PMU1 (IRQ_SHPI_START + 27) 34 - #define IRQ_DB8500_ICN_PMU2 (IRQ_SHPI_START + 28) 35 - #define IRQ_DB8500_HSIR_EXCEP (IRQ_SHPI_START + 29) 36 - #define IRQ_DB8500_MSP0 (IRQ_SHPI_START + 31) 37 - #define IRQ_DB8500_HSIR_CH0_OVRRUN (IRQ_SHPI_START + 32) 38 - #define IRQ_DB8500_HSIR_CH1_OVRRUN (IRQ_SHPI_START + 33) 39 - #define IRQ_DB8500_HSIR_CH2_OVRRUN (IRQ_SHPI_START + 34) 40 - #define IRQ_DB8500_HSIR_CH3_OVRRUN (IRQ_SHPI_START + 35) 41 - #define IRQ_DB8500_HSIR_CH4_OVRRUN (IRQ_SHPI_START + 36) 42 - #define IRQ_DB8500_HSIR_CH5_OVRRUN (IRQ_SHPI_START + 37) 43 - #define IRQ_DB8500_HSIR_CH6_OVRRUN (IRQ_SHPI_START + 38) 44 - #define IRQ_DB8500_HSIR_CH7_OVRRUN (IRQ_SHPI_START + 39) 45 - #define IRQ_DB8500_AB8500 (IRQ_SHPI_START + 40) 46 - #define IRQ_DB8500_SDMMC2 (IRQ_SHPI_START + 41) 47 - #define IRQ_DB8500_SIA (IRQ_SHPI_START + 42) 48 - #define IRQ_DB8500_SIA2 (IRQ_SHPI_START + 43) 49 - #define IRQ_DB8500_SVA (IRQ_SHPI_START + 44) 50 - #define IRQ_DB8500_SVA2 (IRQ_SHPI_START + 45) 51 - #define IRQ_DB8500_PRCMU0 (IRQ_SHPI_START + 46) 52 - #define IRQ_DB8500_PRCMU1 (IRQ_SHPI_START + 47) 53 - #define IRQ_DB8500_DISP (IRQ_SHPI_START + 48) 54 - #define IRQ_DB8500_SPI3 (IRQ_SHPI_START + 49) 55 - #define IRQ_DB8500_SDMMC1 (IRQ_SHPI_START + 50) 56 - #define IRQ_DB8500_I2C4 (IRQ_SHPI_START + 51) 57 - #define IRQ_DB8500_SSP1 (IRQ_SHPI_START + 52) 58 - #define IRQ_DB8500_SKE (IRQ_SHPI_START + 53) 59 - #define IRQ_DB8500_KB (IRQ_SHPI_START + 54) 60 - #define IRQ_DB8500_I2C2 (IRQ_SHPI_START + 55) 61 - #define IRQ_DB8500_B2R2 (IRQ_SHPI_START + 56) 62 - #define IRQ_DB8500_CRYP0 (IRQ_SHPI_START + 57) 63 - #define IRQ_DB8500_SDMMC3 (IRQ_SHPI_START + 59) 64 - #define IRQ_DB8500_SDMMC0 (IRQ_SHPI_START + 60) 65 - #define IRQ_DB8500_HSEM (IRQ_SHPI_START + 61) 66 - #define IRQ_DB8500_MSP1 (IRQ_SHPI_START + 62) 67 - #define IRQ_DB8500_SBAG (IRQ_SHPI_START + 63) 68 - #define IRQ_DB8500_SPI1 (IRQ_SHPI_START + 96) 69 - #define IRQ_DB8500_SRPTIMER (IRQ_SHPI_START + 97) 70 - #define IRQ_DB8500_MSP2 (IRQ_SHPI_START + 98) 71 - #define IRQ_DB8500_SDMMC4 (IRQ_SHPI_START + 99) 72 - #define IRQ_DB8500_SDMMC5 (IRQ_SHPI_START + 100) 73 - #define IRQ_DB8500_HSIRD0 (IRQ_SHPI_START + 104) 74 - #define IRQ_DB8500_HSIRD1 (IRQ_SHPI_START + 105) 75 - #define IRQ_DB8500_HSITD0 (IRQ_SHPI_START + 106) 76 - #define IRQ_DB8500_HSITD1 (IRQ_SHPI_START + 107) 77 - #define IRQ_DB8500_CTI0 (IRQ_SHPI_START + 108) 78 - #define IRQ_DB8500_CTI1 (IRQ_SHPI_START + 109) 79 - #define IRQ_DB8500_ICN_ERR (IRQ_SHPI_START + 110) 80 - #define IRQ_DB8500_MALI_PPMMU (IRQ_SHPI_START + 112) 81 - #define IRQ_DB8500_MALI_PP (IRQ_SHPI_START + 113) 82 - #define IRQ_DB8500_MALI_GPMMU (IRQ_SHPI_START + 114) 83 - #define IRQ_DB8500_MALI_GP (IRQ_SHPI_START + 115) 84 - #define IRQ_DB8500_MALI (IRQ_SHPI_START + 116) 85 - #define IRQ_DB8500_PRCMU_SEM (IRQ_SHPI_START + 118) 86 - #define IRQ_DB8500_GPIO0 (IRQ_SHPI_START + 119) 87 - #define IRQ_DB8500_GPIO1 (IRQ_SHPI_START + 120) 88 - #define IRQ_DB8500_GPIO2 (IRQ_SHPI_START + 121) 89 - #define IRQ_DB8500_GPIO3 (IRQ_SHPI_START + 122) 90 - #define IRQ_DB8500_GPIO4 (IRQ_SHPI_START + 123) 91 - #define IRQ_DB8500_GPIO5 (IRQ_SHPI_START + 124) 92 - #define IRQ_DB8500_GPIO6 (IRQ_SHPI_START + 125) 93 - #define IRQ_DB8500_GPIO7 (IRQ_SHPI_START + 126) 94 - #define IRQ_DB8500_GPIO8 (IRQ_SHPI_START + 127) 95 - 96 - #define IRQ_CA_WAKE_REQ_ED (IRQ_SHPI_START + 71) 97 - #define IRQ_AC_READ_NOTIFICATION_0_ED (IRQ_SHPI_START + 66) 98 - #define IRQ_AC_READ_NOTIFICATION_1_ED (IRQ_SHPI_START + 64) 99 - #define IRQ_CA_MSG_PEND_NOTIFICATION_0_ED (IRQ_SHPI_START + 67) 100 - #define IRQ_CA_MSG_PEND_NOTIFICATION_1_ED (IRQ_SHPI_START + 65) 101 - 102 - #define IRQ_CA_WAKE_REQ_V1 (IRQ_SHPI_START + 83) 103 - #define IRQ_AC_READ_NOTIFICATION_0_V1 (IRQ_SHPI_START + 78) 104 - #define IRQ_AC_READ_NOTIFICATION_1_V1 (IRQ_SHPI_START + 76) 105 - #define IRQ_CA_MSG_PEND_NOTIFICATION_0_V1 (IRQ_SHPI_START + 79) 106 - #define IRQ_CA_MSG_PEND_NOTIFICATION_1_V1 (IRQ_SHPI_START + 77) 107 - 108 - #ifdef CONFIG_UX500_SOC_DB8500 109 - 110 - /* Virtual interrupts corresponding to the PRCMU wakeups. */ 111 - #define IRQ_PRCMU_BASE IRQ_SOC_START 112 - #define NUM_PRCMU_WAKEUPS (IRQ_PRCMU_END - IRQ_PRCMU_BASE) 113 - 114 - #define IRQ_PRCMU_RTC (IRQ_PRCMU_BASE) 115 - #define IRQ_PRCMU_RTT0 (IRQ_PRCMU_BASE + 1) 116 - #define IRQ_PRCMU_RTT1 (IRQ_PRCMU_BASE + 2) 117 - #define IRQ_PRCMU_HSI0 (IRQ_PRCMU_BASE + 3) 118 - #define IRQ_PRCMU_HSI1 (IRQ_PRCMU_BASE + 4) 119 - #define IRQ_PRCMU_CA_WAKE (IRQ_PRCMU_BASE + 5) 120 - #define IRQ_PRCMU_USB (IRQ_PRCMU_BASE + 6) 121 - #define IRQ_PRCMU_ABB (IRQ_PRCMU_BASE + 7) 122 - #define IRQ_PRCMU_ABB_FIFO (IRQ_PRCMU_BASE + 8) 123 - #define IRQ_PRCMU_ARM (IRQ_PRCMU_BASE + 9) 124 - #define IRQ_PRCMU_MODEM_SW_RESET_REQ (IRQ_PRCMU_BASE + 10) 125 - #define IRQ_PRCMU_GPIO0 (IRQ_PRCMU_BASE + 11) 126 - #define IRQ_PRCMU_GPIO1 (IRQ_PRCMU_BASE + 12) 127 - #define IRQ_PRCMU_GPIO2 (IRQ_PRCMU_BASE + 13) 128 - #define IRQ_PRCMU_GPIO3 (IRQ_PRCMU_BASE + 14) 129 - #define IRQ_PRCMU_GPIO4 (IRQ_PRCMU_BASE + 15) 130 - #define IRQ_PRCMU_GPIO5 (IRQ_PRCMU_BASE + 16) 131 - #define IRQ_PRCMU_GPIO6 (IRQ_PRCMU_BASE + 17) 132 - #define IRQ_PRCMU_GPIO7 (IRQ_PRCMU_BASE + 18) 133 - #define IRQ_PRCMU_GPIO8 (IRQ_PRCMU_BASE + 19) 134 - #define IRQ_PRCMU_CA_SLEEP (IRQ_PRCMU_BASE + 20) 135 - #define IRQ_PRCMU_HOTMON_LOW (IRQ_PRCMU_BASE + 21) 136 - #define IRQ_PRCMU_HOTMON_HIGH (IRQ_PRCMU_BASE + 22) 137 - #define IRQ_PRCMU_END (IRQ_PRCMU_BASE + 23) 138 - 139 - /* 140 - * We may have several SoCs, but only one will run at a 141 - * time, so the one with most IRQs will bump this ahead, 142 - * but the IRQ_SOC_START remains the same for either SoC. 143 - */ 144 - #if IRQ_SOC_END < IRQ_PRCMU_END 145 - #undef IRQ_SOC_END 146 - #define IRQ_SOC_END IRQ_PRCMU_END 147 - #endif 148 - 149 - #endif /* CONFIG_UX500_SOC_DB8500 */ 150 - #endif
-51
arch/arm/mach-ux500/include/mach/irqs.h
··· 1 - /* 2 - * Copyright (C) 2008 STMicroelectronics 3 - * Copyright (C) 2009 ST-Ericsson. 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 - #ifndef ASM_ARCH_IRQS_H 11 - #define ASM_ARCH_IRQS_H 12 - 13 - #include <mach/hardware.h> 14 - 15 - #define IRQ_LOCALTIMER 29 16 - #define IRQ_LOCALWDOG 30 17 - 18 - /* Shared Peripheral Interrupt (SHPI) */ 19 - #define IRQ_SHPI_START 32 20 - 21 - /* 22 - * MTU0 preserved for now until plat-nomadik is taught not to use it. Don't 23 - * add any other IRQs here, use the irqs-dbx500.h files. 24 - */ 25 - #define IRQ_MTU0 (IRQ_SHPI_START + 4) 26 - 27 - #define DBX500_NR_INTERNAL_IRQS 166 28 - 29 - /* After chip-specific IRQ numbers we have the GPIO ones */ 30 - #define NOMADIK_NR_GPIO 288 31 - #define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + DBX500_NR_INTERNAL_IRQS) 32 - #define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - DBX500_NR_INTERNAL_IRQS) 33 - #define IRQ_GPIO_END NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) 34 - 35 - #define IRQ_SOC_START IRQ_GPIO_END 36 - /* This will be overridden by SoC-specific irq headers */ 37 - #define IRQ_SOC_END IRQ_SOC_START 38 - 39 - #include <mach/irqs-db8500.h> 40 - 41 - #define IRQ_BOARD_START IRQ_SOC_END 42 - /* This will be overridden by board-specific irq headers */ 43 - #define IRQ_BOARD_END IRQ_BOARD_START 44 - 45 - #ifdef CONFIG_MACH_MOP500 46 - #include <mach/irqs-board-mop500.h> 47 - #endif 48 - 49 - #define UX500_NR_IRQS IRQ_BOARD_END 50 - 51 - #endif /* ASM_ARCH_IRQS_H */
arch/arm/mach-ux500/include/mach/msp.h include/linux/platform_data/asoc-ux500-msp.h
arch/arm/mach-ux500/include/mach/setup.h arch/arm/mach-ux500/setup.h
-6
arch/arm/mach-ux500/include/mach/timex.h
··· 1 - #ifndef __ASM_ARCH_TIMEX_H 2 - #define __ASM_ARCH_TIMEX_H 3 - 4 - #define CLOCK_TICK_RATE 110000000 5 - 6 - #endif
-57
arch/arm/mach-ux500/include/mach/uncompress.h
··· 1 - /* 2 - * Copyright (C) 2009 ST-Ericsson 3 - * 4 - * This program is free software; you can redistribute it and/or modify 5 - * it under the terms of the GNU General Public License as published by 6 - * the Free Software Foundation; either version 2 of the License, or 7 - * (at your option) any later version. 8 - * 9 - * This program is distributed in the hope that it will be useful, 10 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - * GNU General Public License for more details. 13 - * 14 - * You should have received a copy of the GNU General Public License 15 - * along with this program; if not, write to the Free Software 16 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 - */ 18 - #ifndef __ASM_ARCH_UNCOMPRESS_H 19 - #define __ASM_ARCH_UNCOMPRESS_H 20 - 21 - #include <asm/setup.h> 22 - #include <asm/mach-types.h> 23 - #include <linux/io.h> 24 - #include <linux/amba/serial.h> 25 - #include <mach/hardware.h> 26 - 27 - void __iomem *ux500_uart_base; 28 - 29 - static void putc(const char c) 30 - { 31 - /* Do nothing if the UART is not enabled. */ 32 - if (!(__raw_readb(ux500_uart_base + UART011_CR) & 0x1)) 33 - return; 34 - 35 - if (c == '\n') 36 - putc('\r'); 37 - 38 - while (__raw_readb(ux500_uart_base + UART01x_FR) & (1 << 5)) 39 - barrier(); 40 - __raw_writeb(c, ux500_uart_base + UART01x_DR); 41 - } 42 - 43 - static void flush(void) 44 - { 45 - if (!(__raw_readb(ux500_uart_base + UART011_CR) & 0x1)) 46 - return; 47 - while (__raw_readb(ux500_uart_base + UART01x_FR) & (1 << 3)) 48 - barrier(); 49 - } 50 - 51 - static inline void arch_decomp_setup(void) 52 - { 53 - /* Use machine_is_foo() macro if you need to switch base someday */ 54 - ux500_uart_base = (void __iomem *)U8500_UART2_BASE; 55 - } 56 - 57 - #endif /* __ASM_ARCH_UNCOMPRESS_H */
+125
arch/arm/mach-ux500/irqs-db8500.h
··· 1 + /* 2 + * Copyright (C) ST-Ericsson SA 2010 3 + * 4 + * Author: Rabin Vincent <rabin.vincent@stericsson.com> 5 + * License terms: GNU General Public License (GPL) version 2 6 + */ 7 + 8 + #ifndef __MACH_IRQS_DB8500_H 9 + #define __MACH_IRQS_DB8500_H 10 + 11 + #define IRQ_DB8500_MTU0 (IRQ_SHPI_START + 4) 12 + #define IRQ_DB8500_SPI2 (IRQ_SHPI_START + 6) 13 + #define IRQ_DB8500_PMU (IRQ_SHPI_START + 7) 14 + #define IRQ_DB8500_SPI0 (IRQ_SHPI_START + 8) 15 + #define IRQ_DB8500_RTT (IRQ_SHPI_START + 9) 16 + #define IRQ_DB8500_PKA (IRQ_SHPI_START + 10) 17 + #define IRQ_DB8500_UART0 (IRQ_SHPI_START + 11) 18 + #define IRQ_DB8500_I2C3 (IRQ_SHPI_START + 12) 19 + #define IRQ_DB8500_L2CC (IRQ_SHPI_START + 13) 20 + #define IRQ_DB8500_SSP0 (IRQ_SHPI_START + 14) 21 + #define IRQ_DB8500_CRYP1 (IRQ_SHPI_START + 15) 22 + #define IRQ_DB8500_MSP1_RX (IRQ_SHPI_START + 16) 23 + #define IRQ_DB8500_MTU1 (IRQ_SHPI_START + 17) 24 + #define IRQ_DB8500_RTC (IRQ_SHPI_START + 18) 25 + #define IRQ_DB8500_UART1 (IRQ_SHPI_START + 19) 26 + #define IRQ_DB8500_USB_WAKEUP (IRQ_SHPI_START + 20) 27 + #define IRQ_DB8500_I2C0 (IRQ_SHPI_START + 21) 28 + #define IRQ_DB8500_I2C1 (IRQ_SHPI_START + 22) 29 + #define IRQ_DB8500_USBOTG (IRQ_SHPI_START + 23) 30 + #define IRQ_DB8500_DMA_SECURE (IRQ_SHPI_START + 24) 31 + #define IRQ_DB8500_DMA (IRQ_SHPI_START + 25) 32 + #define IRQ_DB8500_UART2 (IRQ_SHPI_START + 26) 33 + #define IRQ_DB8500_ICN_PMU1 (IRQ_SHPI_START + 27) 34 + #define IRQ_DB8500_ICN_PMU2 (IRQ_SHPI_START + 28) 35 + #define IRQ_DB8500_HSIR_EXCEP (IRQ_SHPI_START + 29) 36 + #define IRQ_DB8500_MSP0 (IRQ_SHPI_START + 31) 37 + #define IRQ_DB8500_HSIR_CH0_OVRRUN (IRQ_SHPI_START + 32) 38 + #define IRQ_DB8500_HSIR_CH1_OVRRUN (IRQ_SHPI_START + 33) 39 + #define IRQ_DB8500_HSIR_CH2_OVRRUN (IRQ_SHPI_START + 34) 40 + #define IRQ_DB8500_HSIR_CH3_OVRRUN (IRQ_SHPI_START + 35) 41 + #define IRQ_DB8500_HSIR_CH4_OVRRUN (IRQ_SHPI_START + 36) 42 + #define IRQ_DB8500_HSIR_CH5_OVRRUN (IRQ_SHPI_START + 37) 43 + #define IRQ_DB8500_HSIR_CH6_OVRRUN (IRQ_SHPI_START + 38) 44 + #define IRQ_DB8500_HSIR_CH7_OVRRUN (IRQ_SHPI_START + 39) 45 + #define IRQ_DB8500_AB8500 (IRQ_SHPI_START + 40) 46 + #define IRQ_DB8500_SDMMC2 (IRQ_SHPI_START + 41) 47 + #define IRQ_DB8500_SIA (IRQ_SHPI_START + 42) 48 + #define IRQ_DB8500_SIA2 (IRQ_SHPI_START + 43) 49 + #define IRQ_DB8500_SVA (IRQ_SHPI_START + 44) 50 + #define IRQ_DB8500_SVA2 (IRQ_SHPI_START + 45) 51 + #define IRQ_DB8500_PRCMU0 (IRQ_SHPI_START + 46) 52 + #define IRQ_DB8500_PRCMU1 (IRQ_SHPI_START + 47) 53 + #define IRQ_DB8500_DISP (IRQ_SHPI_START + 48) 54 + #define IRQ_DB8500_SPI3 (IRQ_SHPI_START + 49) 55 + #define IRQ_DB8500_SDMMC1 (IRQ_SHPI_START + 50) 56 + #define IRQ_DB8500_I2C4 (IRQ_SHPI_START + 51) 57 + #define IRQ_DB8500_SSP1 (IRQ_SHPI_START + 52) 58 + #define IRQ_DB8500_SKE (IRQ_SHPI_START + 53) 59 + #define IRQ_DB8500_KB (IRQ_SHPI_START + 54) 60 + #define IRQ_DB8500_I2C2 (IRQ_SHPI_START + 55) 61 + #define IRQ_DB8500_B2R2 (IRQ_SHPI_START + 56) 62 + #define IRQ_DB8500_CRYP0 (IRQ_SHPI_START + 57) 63 + #define IRQ_DB8500_SDMMC3 (IRQ_SHPI_START + 59) 64 + #define IRQ_DB8500_SDMMC0 (IRQ_SHPI_START + 60) 65 + #define IRQ_DB8500_HSEM (IRQ_SHPI_START + 61) 66 + #define IRQ_DB8500_MSP1 (IRQ_SHPI_START + 62) 67 + #define IRQ_DB8500_SBAG (IRQ_SHPI_START + 63) 68 + #define IRQ_DB8500_SPI1 (IRQ_SHPI_START + 96) 69 + #define IRQ_DB8500_SRPTIMER (IRQ_SHPI_START + 97) 70 + #define IRQ_DB8500_MSP2 (IRQ_SHPI_START + 98) 71 + #define IRQ_DB8500_SDMMC4 (IRQ_SHPI_START + 99) 72 + #define IRQ_DB8500_SDMMC5 (IRQ_SHPI_START + 100) 73 + #define IRQ_DB8500_HSIRD0 (IRQ_SHPI_START + 104) 74 + #define IRQ_DB8500_HSIRD1 (IRQ_SHPI_START + 105) 75 + #define IRQ_DB8500_HSITD0 (IRQ_SHPI_START + 106) 76 + #define IRQ_DB8500_HSITD1 (IRQ_SHPI_START + 107) 77 + #define IRQ_DB8500_CTI0 (IRQ_SHPI_START + 108) 78 + #define IRQ_DB8500_CTI1 (IRQ_SHPI_START + 109) 79 + #define IRQ_DB8500_ICN_ERR (IRQ_SHPI_START + 110) 80 + #define IRQ_DB8500_MALI_PPMMU (IRQ_SHPI_START + 112) 81 + #define IRQ_DB8500_MALI_PP (IRQ_SHPI_START + 113) 82 + #define IRQ_DB8500_MALI_GPMMU (IRQ_SHPI_START + 114) 83 + #define IRQ_DB8500_MALI_GP (IRQ_SHPI_START + 115) 84 + #define IRQ_DB8500_MALI (IRQ_SHPI_START + 116) 85 + #define IRQ_DB8500_PRCMU_SEM (IRQ_SHPI_START + 118) 86 + #define IRQ_DB8500_GPIO0 (IRQ_SHPI_START + 119) 87 + #define IRQ_DB8500_GPIO1 (IRQ_SHPI_START + 120) 88 + #define IRQ_DB8500_GPIO2 (IRQ_SHPI_START + 121) 89 + #define IRQ_DB8500_GPIO3 (IRQ_SHPI_START + 122) 90 + #define IRQ_DB8500_GPIO4 (IRQ_SHPI_START + 123) 91 + #define IRQ_DB8500_GPIO5 (IRQ_SHPI_START + 124) 92 + #define IRQ_DB8500_GPIO6 (IRQ_SHPI_START + 125) 93 + #define IRQ_DB8500_GPIO7 (IRQ_SHPI_START + 126) 94 + #define IRQ_DB8500_GPIO8 (IRQ_SHPI_START + 127) 95 + 96 + #define IRQ_CA_WAKE_REQ_ED (IRQ_SHPI_START + 71) 97 + #define IRQ_AC_READ_NOTIFICATION_0_ED (IRQ_SHPI_START + 66) 98 + #define IRQ_AC_READ_NOTIFICATION_1_ED (IRQ_SHPI_START + 64) 99 + #define IRQ_CA_MSG_PEND_NOTIFICATION_0_ED (IRQ_SHPI_START + 67) 100 + #define IRQ_CA_MSG_PEND_NOTIFICATION_1_ED (IRQ_SHPI_START + 65) 101 + 102 + #define IRQ_CA_WAKE_REQ_V1 (IRQ_SHPI_START + 83) 103 + #define IRQ_AC_READ_NOTIFICATION_0_V1 (IRQ_SHPI_START + 78) 104 + #define IRQ_AC_READ_NOTIFICATION_1_V1 (IRQ_SHPI_START + 76) 105 + #define IRQ_CA_MSG_PEND_NOTIFICATION_0_V1 (IRQ_SHPI_START + 79) 106 + #define IRQ_CA_MSG_PEND_NOTIFICATION_1_V1 (IRQ_SHPI_START + 77) 107 + 108 + #ifdef CONFIG_UX500_SOC_DB8500 109 + 110 + /* Virtual interrupts corresponding to the PRCMU wakeups. */ 111 + #define IRQ_PRCMU_BASE IRQ_SOC_START 112 + #define IRQ_PRCMU_END (IRQ_PRCMU_BASE + 23) 113 + 114 + /* 115 + * We may have several SoCs, but only one will run at a 116 + * time, so the one with most IRQs will bump this ahead, 117 + * but the IRQ_SOC_START remains the same for either SoC. 118 + */ 119 + #if IRQ_SOC_END < IRQ_PRCMU_END 120 + #undef IRQ_SOC_END 121 + #define IRQ_SOC_END IRQ_PRCMU_END 122 + #endif 123 + 124 + #endif /* CONFIG_UX500_SOC_DB8500 */ 125 + #endif
+49
arch/arm/mach-ux500/irqs.h
··· 1 + /* 2 + * Copyright (C) 2008 STMicroelectronics 3 + * Copyright (C) 2009 ST-Ericsson. 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 + #ifndef ASM_ARCH_IRQS_H 11 + #define ASM_ARCH_IRQS_H 12 + 13 + #define IRQ_LOCALTIMER 29 14 + #define IRQ_LOCALWDOG 30 15 + 16 + /* Shared Peripheral Interrupt (SHPI) */ 17 + #define IRQ_SHPI_START 32 18 + 19 + /* 20 + * MTU0 preserved for now until plat-nomadik is taught not to use it. Don't 21 + * add any other IRQs here, use the irqs-dbx500.h files. 22 + */ 23 + #define IRQ_MTU0 (IRQ_SHPI_START + 4) 24 + 25 + #define DBX500_NR_INTERNAL_IRQS 166 26 + 27 + /* After chip-specific IRQ numbers we have the GPIO ones */ 28 + #define NOMADIK_NR_GPIO 288 29 + #define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + DBX500_NR_INTERNAL_IRQS) 30 + #define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - DBX500_NR_INTERNAL_IRQS) 31 + #define IRQ_GPIO_END NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO) 32 + 33 + #define IRQ_SOC_START IRQ_GPIO_END 34 + /* This will be overridden by SoC-specific irq headers */ 35 + #define IRQ_SOC_END IRQ_SOC_START 36 + 37 + #include "irqs-db8500.h" 38 + 39 + #define IRQ_BOARD_START IRQ_SOC_END 40 + /* This will be overridden by board-specific irq headers */ 41 + #define IRQ_BOARD_END IRQ_BOARD_START 42 + 43 + #ifdef CONFIG_MACH_MOP500 44 + #include "irqs-board-mop500.h" 45 + #endif 46 + 47 + #define UX500_NR_IRQS IRQ_BOARD_END 48 + 49 + #endif /* ASM_ARCH_IRQS_H */
+2 -2
arch/arm/mach-ux500/platsmp.c
··· 21 21 #include <asm/smp_plat.h> 22 22 #include <asm/smp_scu.h> 23 23 24 - #include <mach/hardware.h> 25 - #include <mach/setup.h> 24 + #include "setup.h" 26 25 26 + #include "db8500-regs.h" 27 27 #include "id.h" 28 28 29 29 /* This is called from headsmp.S to wakeup the secondary core */
+167
arch/arm/mach-ux500/pm.c
··· 1 + /* 2 + * Copyright (C) ST-Ericsson SA 2010-2013 3 + * Author: Rickard Andersson <rickard.andersson@stericsson.com> for 4 + * ST-Ericsson. 5 + * Author: Daniel Lezcano <daniel.lezcano@linaro.org> for Linaro. 6 + * License terms: GNU General Public License (GPL) version 2 7 + * 8 + */ 9 + 10 + #include <linux/kernel.h> 11 + #include <linux/irqchip/arm-gic.h> 12 + #include <linux/delay.h> 13 + #include <linux/io.h> 14 + #include <linux/platform_data/arm-ux500-pm.h> 15 + 16 + #include "db8500-regs.h" 17 + 18 + /* ARM WFI Standby signal register */ 19 + #define PRCM_ARM_WFI_STANDBY (prcmu_base + 0x130) 20 + #define PRCM_ARM_WFI_STANDBY_WFI0 0x08 21 + #define PRCM_ARM_WFI_STANDBY_WFI1 0x10 22 + #define PRCM_IOCR (prcmu_base + 0x310) 23 + #define PRCM_IOCR_IOFORCE 0x1 24 + 25 + /* Dual A9 core interrupt management unit registers */ 26 + #define PRCM_A9_MASK_REQ (prcmu_base + 0x328) 27 + #define PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ 0x1 28 + 29 + #define PRCM_A9_MASK_ACK (prcmu_base + 0x32c) 30 + #define PRCM_ARMITMSK31TO0 (prcmu_base + 0x11c) 31 + #define PRCM_ARMITMSK63TO32 (prcmu_base + 0x120) 32 + #define PRCM_ARMITMSK95TO64 (prcmu_base + 0x124) 33 + #define PRCM_ARMITMSK127TO96 (prcmu_base + 0x128) 34 + #define PRCM_POWER_STATE_VAL (prcmu_base + 0x25C) 35 + #define PRCM_ARMITVAL31TO0 (prcmu_base + 0x260) 36 + #define PRCM_ARMITVAL63TO32 (prcmu_base + 0x264) 37 + #define PRCM_ARMITVAL95TO64 (prcmu_base + 0x268) 38 + #define PRCM_ARMITVAL127TO96 (prcmu_base + 0x26C) 39 + 40 + static void __iomem *prcmu_base; 41 + 42 + /* This function decouple the gic from the prcmu */ 43 + int prcmu_gic_decouple(void) 44 + { 45 + u32 val = readl(PRCM_A9_MASK_REQ); 46 + 47 + /* Set bit 0 register value to 1 */ 48 + writel(val | PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ, 49 + PRCM_A9_MASK_REQ); 50 + 51 + /* Make sure the register is updated */ 52 + readl(PRCM_A9_MASK_REQ); 53 + 54 + /* Wait a few cycles for the gic mask completion */ 55 + udelay(1); 56 + 57 + return 0; 58 + } 59 + 60 + /* This function recouple the gic with the prcmu */ 61 + int prcmu_gic_recouple(void) 62 + { 63 + u32 val = readl(PRCM_A9_MASK_REQ); 64 + 65 + /* Set bit 0 register value to 0 */ 66 + writel(val & ~PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ, PRCM_A9_MASK_REQ); 67 + 68 + return 0; 69 + } 70 + 71 + #define PRCMU_GIC_NUMBER_REGS 5 72 + 73 + /* 74 + * This function checks if there are pending irq on the gic. It only 75 + * makes sense if the gic has been decoupled before with the 76 + * db8500_prcmu_gic_decouple function. Disabling an interrupt only 77 + * disables the forwarding of the interrupt to any CPU interface. It 78 + * does not prevent the interrupt from changing state, for example 79 + * becoming pending, or active and pending if it is already 80 + * active. Hence, we have to check the interrupt is pending *and* is 81 + * active. 82 + */ 83 + bool prcmu_gic_pending_irq(void) 84 + { 85 + u32 pr; /* Pending register */ 86 + u32 er; /* Enable register */ 87 + void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE); 88 + int i; 89 + 90 + /* 5 registers. STI & PPI not skipped */ 91 + for (i = 0; i < PRCMU_GIC_NUMBER_REGS; i++) { 92 + 93 + pr = readl_relaxed(dist_base + GIC_DIST_PENDING_SET + i * 4); 94 + er = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4); 95 + 96 + if (pr & er) 97 + return true; /* There is a pending interrupt */ 98 + } 99 + 100 + return false; 101 + } 102 + 103 + /* 104 + * This function checks if there are pending interrupt on the 105 + * prcmu which has been delegated to monitor the irqs with the 106 + * db8500_prcmu_copy_gic_settings function. 107 + */ 108 + bool prcmu_pending_irq(void) 109 + { 110 + u32 it, im; 111 + int i; 112 + 113 + for (i = 0; i < PRCMU_GIC_NUMBER_REGS - 1; i++) { 114 + it = readl(PRCM_ARMITVAL31TO0 + i * 4); 115 + im = readl(PRCM_ARMITMSK31TO0 + i * 4); 116 + if (it & im) 117 + return true; /* There is a pending interrupt */ 118 + } 119 + 120 + return false; 121 + } 122 + 123 + /* 124 + * This function checks if the specified cpu is in in WFI. It's usage 125 + * makes sense only if the gic is decoupled with the db8500_prcmu_gic_decouple 126 + * function. Of course passing smp_processor_id() to this function will 127 + * always return false... 128 + */ 129 + bool prcmu_is_cpu_in_wfi(int cpu) 130 + { 131 + return readl(PRCM_ARM_WFI_STANDBY) & cpu ? PRCM_ARM_WFI_STANDBY_WFI1 : 132 + PRCM_ARM_WFI_STANDBY_WFI0; 133 + } 134 + 135 + /* 136 + * This function copies the gic SPI settings to the prcmu in order to 137 + * monitor them and abort/finish the retention/off sequence or state. 138 + */ 139 + int prcmu_copy_gic_settings(void) 140 + { 141 + u32 er; /* Enable register */ 142 + void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE); 143 + int i; 144 + 145 + /* We skip the STI and PPI */ 146 + for (i = 0; i < PRCMU_GIC_NUMBER_REGS - 1; i++) { 147 + er = readl_relaxed(dist_base + 148 + GIC_DIST_ENABLE_SET + (i + 1) * 4); 149 + writel(er, PRCM_ARMITMSK31TO0 + i * 4); 150 + } 151 + 152 + return 0; 153 + } 154 + 155 + void __init ux500_pm_init(u32 phy_base, u32 size) 156 + { 157 + prcmu_base = ioremap(phy_base, size); 158 + if (!prcmu_base) { 159 + pr_err("could not remap PRCMU for PM functions\n"); 160 + return; 161 + } 162 + /* 163 + * On watchdog reboot the GIC is in some cases decoupled. 164 + * This will make sure that the GIC is correctly configured. 165 + */ 166 + prcmu_gic_recouple(); 167 + }
+3 -3
arch/arm/mach-ux500/timer.c
··· 14 14 15 15 #include <asm/smp_twd.h> 16 16 17 - #include <mach/setup.h> 18 - #include <mach/hardware.h> 19 - #include <mach/irqs.h> 17 + #include "setup.h" 18 + #include "irqs.h" 20 19 20 + #include "db8500-regs.h" 21 21 #include "id.h" 22 22 23 23 #ifdef CONFIG_HAVE_ARM_TWD
+1 -1
arch/arm/mach-ux500/usb.c
··· 10 10 #include <linux/platform_data/usb-musb-ux500.h> 11 11 #include <linux/platform_data/dma-ste-dma40.h> 12 12 13 - #include <mach/hardware.h> 13 + #include "db8500-regs.h" 14 14 15 15 #define MUSB_DMA40_RX_CH { \ 16 16 .mode = STEDMA40_MODE_LOGICAL, \
+2
arch/arm/mach-vexpress/Kconfig
··· 9 9 select COMMON_CLK_VERSATILE 10 10 select CPU_V7 11 11 select GENERIC_CLOCKEVENTS 12 + select HAVE_ARM_SCU if SMP 13 + select HAVE_ARM_TWD if LOCAL_TIMERS 12 14 select HAVE_CLK 13 15 select HAVE_PATA_PLATFORM 14 16 select HAVE_SMP
+2
arch/arm/mach-zynq/Kconfig
··· 5 5 select COMMON_CLK 6 6 select CPU_V7 7 7 select GENERIC_CLOCKEVENTS 8 + select HAVE_ARM_SCU if SMP 9 + select HAVE_ARM_TWD if LOCAL_TIMERS 8 10 select ICST 9 11 select MIGHT_HAVE_CACHE_L2X0 10 12 select USE_OF
-45
arch/arm/plat-samsung/devs.c
··· 879 879 } 880 880 #endif /* CONFIG_PLAT_S3C24XX */ 881 881 882 - /* MFC */ 883 - 884 - #ifdef CONFIG_S5P_DEV_MFC 885 - static struct resource s5p_mfc_resource[] = { 886 - [0] = DEFINE_RES_MEM(S5P_PA_MFC, SZ_64K), 887 - [1] = DEFINE_RES_IRQ(IRQ_MFC), 888 - }; 889 - 890 - struct platform_device s5p_device_mfc = { 891 - .name = "s5p-mfc", 892 - .id = -1, 893 - .num_resources = ARRAY_SIZE(s5p_mfc_resource), 894 - .resource = s5p_mfc_resource, 895 - }; 896 - 897 - /* 898 - * MFC hardware has 2 memory interfaces which are modelled as two separate 899 - * platform devices to let dma-mapping distinguish between them. 900 - * 901 - * MFC parent device (s5p_device_mfc) must be registered before memory 902 - * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r). 903 - */ 904 - 905 - struct platform_device s5p_device_mfc_l = { 906 - .name = "s5p-mfc-l", 907 - .id = -1, 908 - .dev = { 909 - .parent = &s5p_device_mfc.dev, 910 - .dma_mask = &samsung_device_dma_mask, 911 - .coherent_dma_mask = DMA_BIT_MASK(32), 912 - }, 913 - }; 914 - 915 - struct platform_device s5p_device_mfc_r = { 916 - .name = "s5p-mfc-r", 917 - .id = -1, 918 - .dev = { 919 - .parent = &s5p_device_mfc.dev, 920 - .dma_mask = &samsung_device_dma_mask, 921 - .coherent_dma_mask = DMA_BIT_MASK(32), 922 - }, 923 - }; 924 - 925 - #endif /* CONFIG_S5P_DEV_MFC */ 926 - 927 882 /* MIPI CSIS */ 928 883 929 884 #ifdef CONFIG_S5P_DEV_CSIS0
arch/arm/plat-samsung/include/plat/debug-macro.S arch/arm/include/debug/samsung.S
-63
arch/arm/plat-samsung/include/plat/regs-onenand.h
··· 1 - /* 2 - * linux/arch/arm/plat-s3c/include/plat/regs-onenand.h 3 - * 4 - * Copyright (C) 2008-2010 Samsung Electronics 5 - * Kyungmin Park <kyungmin.park@samsung.com> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 11 - #ifndef __SAMSUNG_ONENAND_H__ 12 - #define __SAMSUNG_ONENAND_H__ 13 - 14 - #include <mach/hardware.h> 15 - 16 - /* 17 - * OneNAND Controller 18 - */ 19 - #define MEM_CFG_OFFSET 0x0000 20 - #define BURST_LEN_OFFSET 0x0010 21 - #define MEM_RESET_OFFSET 0x0020 22 - #define INT_ERR_STAT_OFFSET 0x0030 23 - #define INT_ERR_MASK_OFFSET 0x0040 24 - #define INT_ERR_ACK_OFFSET 0x0050 25 - #define ECC_ERR_STAT_OFFSET 0x0060 26 - #define MANUFACT_ID_OFFSET 0x0070 27 - #define DEVICE_ID_OFFSET 0x0080 28 - #define DATA_BUF_SIZE_OFFSET 0x0090 29 - #define BOOT_BUF_SIZE_OFFSET 0x00A0 30 - #define BUF_AMOUNT_OFFSET 0x00B0 31 - #define TECH_OFFSET 0x00C0 32 - #define FBA_WIDTH_OFFSET 0x00D0 33 - #define FPA_WIDTH_OFFSET 0x00E0 34 - #define FSA_WIDTH_OFFSET 0x00F0 35 - #define TRANS_SPARE_OFFSET 0x0140 36 - #define DBS_DFS_WIDTH_OFFSET 0x0160 37 - #define INT_PIN_ENABLE_OFFSET 0x01A0 38 - #define ACC_CLOCK_OFFSET 0x01C0 39 - #define FLASH_VER_ID_OFFSET 0x01F0 40 - #define FLASH_AUX_CNTRL_OFFSET 0x0300 /* s3c64xx only */ 41 - 42 - #define ONENAND_MEM_RESET_HOT 0x3 43 - #define ONENAND_MEM_RESET_COLD 0x2 44 - #define ONENAND_MEM_RESET_WARM 0x1 45 - 46 - #define CACHE_OP_ERR (1 << 13) 47 - #define RST_CMP (1 << 12) 48 - #define RDY_ACT (1 << 11) 49 - #define INT_ACT (1 << 10) 50 - #define UNSUP_CMD (1 << 9) 51 - #define LOCKED_BLK (1 << 8) 52 - #define BLK_RW_CMP (1 << 7) 53 - #define ERS_CMP (1 << 6) 54 - #define PGM_CMP (1 << 5) 55 - #define LOAD_CMP (1 << 4) 56 - #define ERS_FAIL (1 << 3) 57 - #define PGM_FAIL (1 << 2) 58 - #define INT_TO (1 << 1) 59 - #define LD_FAIL_ECC_ERR (1 << 0) 60 - 61 - #define TSRF (1 << 0) 62 - 63 - #endif
-71
arch/arm/plat-samsung/include/plat/regs-rtc.h
··· 1 - /* arch/arm/mach-s3c2410/include/mach/regs-rtc.h 2 - * 3 - * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> 4 - * http://www.simtec.co.uk/products/SWLINUX/ 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License version 2 as 8 - * published by the Free Software Foundation. 9 - * 10 - * S3C2410 Internal RTC register definition 11 - */ 12 - 13 - #ifndef __ASM_ARCH_REGS_RTC_H 14 - #define __ASM_ARCH_REGS_RTC_H __FILE__ 15 - 16 - #define S3C2410_RTCREG(x) (x) 17 - #define S3C2410_INTP S3C2410_RTCREG(0x30) 18 - #define S3C2410_INTP_ALM (1 << 1) 19 - #define S3C2410_INTP_TIC (1 << 0) 20 - 21 - #define S3C2410_RTCCON S3C2410_RTCREG(0x40) 22 - #define S3C2410_RTCCON_RTCEN (1 << 0) 23 - #define S3C2410_RTCCON_CNTSEL (1 << 2) 24 - #define S3C2410_RTCCON_CLKRST (1 << 3) 25 - #define S3C2443_RTCCON_TICSEL (1 << 4) 26 - #define S3C64XX_RTCCON_TICEN (1 << 8) 27 - 28 - #define S3C2410_TICNT S3C2410_RTCREG(0x44) 29 - #define S3C2410_TICNT_ENABLE (1 << 7) 30 - 31 - /* S3C2443: tick count is 15 bit wide 32 - * TICNT[6:0] contains upper 7 bits 33 - * TICNT1[7:0] contains lower 8 bits 34 - */ 35 - #define S3C2443_TICNT_PART(x) ((x & 0x7f00) >> 8) 36 - #define S3C2443_TICNT1 S3C2410_RTCREG(0x4C) 37 - #define S3C2443_TICNT1_PART(x) (x & 0xff) 38 - 39 - /* S3C2416: tick count is 32 bit wide 40 - * TICNT[6:0] contains bits [14:8] 41 - * TICNT1[7:0] contains lower 8 bits 42 - * TICNT2[16:0] contains upper 17 bits 43 - */ 44 - #define S3C2416_TICNT2 S3C2410_RTCREG(0x48) 45 - #define S3C2416_TICNT2_PART(x) ((x & 0xffff8000) >> 15) 46 - 47 - #define S3C2410_RTCALM S3C2410_RTCREG(0x50) 48 - #define S3C2410_RTCALM_ALMEN (1 << 6) 49 - #define S3C2410_RTCALM_YEAREN (1 << 5) 50 - #define S3C2410_RTCALM_MONEN (1 << 4) 51 - #define S3C2410_RTCALM_DAYEN (1 << 3) 52 - #define S3C2410_RTCALM_HOUREN (1 << 2) 53 - #define S3C2410_RTCALM_MINEN (1 << 1) 54 - #define S3C2410_RTCALM_SECEN (1 << 0) 55 - 56 - #define S3C2410_ALMSEC S3C2410_RTCREG(0x54) 57 - #define S3C2410_ALMMIN S3C2410_RTCREG(0x58) 58 - #define S3C2410_ALMHOUR S3C2410_RTCREG(0x5c) 59 - 60 - #define S3C2410_ALMDATE S3C2410_RTCREG(0x60) 61 - #define S3C2410_ALMMON S3C2410_RTCREG(0x64) 62 - #define S3C2410_ALMYEAR S3C2410_RTCREG(0x68) 63 - 64 - #define S3C2410_RTCSEC S3C2410_RTCREG(0x70) 65 - #define S3C2410_RTCMIN S3C2410_RTCREG(0x74) 66 - #define S3C2410_RTCHOUR S3C2410_RTCREG(0x78) 67 - #define S3C2410_RTCDATE S3C2410_RTCREG(0x7c) 68 - #define S3C2410_RTCMON S3C2410_RTCREG(0x84) 69 - #define S3C2410_RTCYEAR S3C2410_RTCREG(0x88) 70 - 71 - #endif /* __ASM_ARCH_REGS_RTC_H */
arch/arm/plat-samsung/include/plat/regs-sdhci.h drivers/mmc/host/sdhci-s3c-regs.h
+1 -55
arch/arm/plat-samsung/include/plat/sdhci.h
··· 18 18 #ifndef __PLAT_S3C_SDHCI_H 19 19 #define __PLAT_S3C_SDHCI_H __FILE__ 20 20 21 + #include <linux/platform_data/mmc-sdhci-s3c.h> 21 22 #include <plat/devs.h> 22 - 23 - struct platform_device; 24 - struct mmc_host; 25 - struct mmc_card; 26 - struct mmc_ios; 27 - 28 - enum cd_types { 29 - S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */ 30 - S3C_SDHCI_CD_EXTERNAL, /* use external callback */ 31 - S3C_SDHCI_CD_GPIO, /* use external gpio pin for CD line */ 32 - S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */ 33 - S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */ 34 - }; 35 - 36 - /** 37 - * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI 38 - * @max_width: The maximum number of data bits supported. 39 - * @host_caps: Standard MMC host capabilities bit field. 40 - * @host_caps2: The second standard MMC host capabilities bit field. 41 - * @cd_type: Type of Card Detection method (see cd_types enum above) 42 - * @ext_cd_init: Initialize external card detect subsystem. Called on 43 - * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL. 44 - * notify_func argument is a callback to the sdhci-s3c driver 45 - * that triggers the card detection event. Callback arguments: 46 - * dev is pointer to platform device of the host controller, 47 - * state is new state of the card (0 - removed, 1 - inserted). 48 - * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on 49 - * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL. 50 - * notify_func argument is the same callback as for ext_cd_init. 51 - * @ext_cd_gpio: gpio pin used for external CD line, valid only if 52 - * cd_type == S3C_SDHCI_CD_GPIO 53 - * @ext_cd_gpio_invert: invert values for external CD gpio line 54 - * @cfg_gpio: Configure the GPIO for a specific card bit-width 55 - * 56 - * Initialisation data specific to either the machine or the platform 57 - * for the device driver to use or call-back when configuring gpio or 58 - * card speed information. 59 - */ 60 - struct s3c_sdhci_platdata { 61 - unsigned int max_width; 62 - unsigned int host_caps; 63 - unsigned int host_caps2; 64 - unsigned int pm_caps; 65 - enum cd_types cd_type; 66 - 67 - int ext_cd_gpio; 68 - bool ext_cd_gpio_invert; 69 - int (*ext_cd_init)(void (*notify_func)(struct platform_device *, 70 - int state)); 71 - int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *, 72 - int state)); 73 - 74 - void (*cfg_gpio)(struct platform_device *dev, int width); 75 - }; 76 23 77 24 /* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data 78 25 * @pd: The default platform data for this device. ··· 325 378 break; 326 379 } 327 380 } 328 - 329 381 #endif /* __PLAT_S3C_SDHCI_H */
+1
arch/arm/plat-samsung/irq-vic-timer.c
··· 20 20 #include <linux/io.h> 21 21 22 22 #include <mach/map.h> 23 + #include <mach/irqs.h> 23 24 #include <plat/cpu.h> 24 25 #include <plat/irq-vic-timer.h> 25 26 #include <plat/regs-timer.h>
+1
arch/arm/plat-samsung/pm.c
··· 27 27 #include <plat/regs-serial.h> 28 28 #include <mach/regs-clock.h> 29 29 #include <mach/regs-irq.h> 30 + #include <mach/irqs.h> 30 31 #include <asm/irq.h> 31 32 32 33 #include <plat/pm.h>
+41 -1
arch/arm/plat-samsung/s5p-dev-mfc.c
··· 18 18 #include <linux/of.h> 19 19 20 20 #include <mach/map.h> 21 + #include <mach/irqs.h> 21 22 #include <plat/devs.h> 22 - #include <plat/irqs.h> 23 23 #include <plat/mfc.h> 24 + 25 + static struct resource s5p_mfc_resource[] = { 26 + [0] = DEFINE_RES_MEM(S5P_PA_MFC, SZ_64K), 27 + [1] = DEFINE_RES_IRQ(IRQ_MFC), 28 + }; 29 + 30 + struct platform_device s5p_device_mfc = { 31 + .name = "s5p-mfc", 32 + .id = -1, 33 + .num_resources = ARRAY_SIZE(s5p_mfc_resource), 34 + .resource = s5p_mfc_resource, 35 + }; 36 + 37 + /* 38 + * MFC hardware has 2 memory interfaces which are modelled as two separate 39 + * platform devices to let dma-mapping distinguish between them. 40 + * 41 + * MFC parent device (s5p_device_mfc) must be registered before memory 42 + * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r). 43 + */ 44 + 45 + struct platform_device s5p_device_mfc_l = { 46 + .name = "s5p-mfc-l", 47 + .id = -1, 48 + .dev = { 49 + .parent = &s5p_device_mfc.dev, 50 + .dma_mask = &s5p_device_mfc_l.dev.coherent_dma_mask, 51 + .coherent_dma_mask = DMA_BIT_MASK(32), 52 + }, 53 + }; 54 + 55 + struct platform_device s5p_device_mfc_r = { 56 + .name = "s5p-mfc-r", 57 + .id = -1, 58 + .dev = { 59 + .parent = &s5p_device_mfc.dev, 60 + .dma_mask = &s5p_device_mfc_r.dev.coherent_dma_mask, 61 + .coherent_dma_mask = DMA_BIT_MASK(32), 62 + }, 63 + }; 24 64 25 65 struct s5p_mfc_reserved_mem { 26 66 phys_addr_t base;
+1
arch/arm/plat-samsung/s5p-irq.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/irqchip/arm-vic.h> 17 17 18 + #include <mach/irqs.h> 18 19 #include <mach/map.h> 19 20 #include <plat/regs-timer.h> 20 21 #include <plat/cpu.h>
-47
arch/arm/plat-spear/Kconfig
··· 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_SPEAR13XX 12 - bool "ST SPEAr13xx with Device Tree" 13 - select ARCH_HAS_CPUFREQ 14 - select ARM_GIC 15 - select CPU_V7 16 - select GPIO_SPEAR_SPICS 17 - select HAVE_SMP 18 - select MIGHT_HAVE_CACHE_L2X0 19 - select PINCTRL 20 - select USE_OF 21 - help 22 - Supports for ARM's SPEAR13XX family 23 - 24 - config ARCH_SPEAR3XX 25 - bool "ST SPEAr3xx with Device Tree" 26 - select ARM_VIC 27 - select CPU_ARM926T 28 - select PINCTRL 29 - select USE_OF 30 - help 31 - Supports for ARM's SPEAR3XX family 32 - 33 - config ARCH_SPEAR6XX 34 - bool "SPEAr6XX" 35 - select ARM_VIC 36 - select CPU_ARM926T 37 - help 38 - Supports for ARM's SPEAR6XX family 39 - 40 - endchoice 41 - 42 - # Adding SPEAr machine specific configuration files 43 - source "arch/arm/mach-spear13xx/Kconfig" 44 - source "arch/arm/mach-spear3xx/Kconfig" 45 - source "arch/arm/mach-spear6xx/Kconfig" 46 - 47 - endif
-9
arch/arm/plat-spear/Makefile
··· 1 - # 2 - # SPEAr Platform specific Makefile 3 - # 4 - 5 - # Common support 6 - obj-y := restart.o time.o 7 - 8 - obj-$(CONFIG_ARCH_SPEAR3XX) += pl080.o 9 - obj-$(CONFIG_ARCH_SPEAR6XX) += pl080.o
arch/arm/plat-spear/include/plat/debug-macro.S arch/arm/mach-spear/include/mach/debug-macro.S
arch/arm/plat-spear/include/plat/pl080.h arch/arm/mach-spear/pl080.h
arch/arm/plat-spear/include/plat/timex.h arch/arm/mach-spear/include/mach/timex.h
arch/arm/plat-spear/include/plat/uncompress.h arch/arm/mach-spear/include/mach/uncompress.h
arch/arm/plat-spear/pl080.c arch/arm/mach-spear/pl080.c
-33
arch/arm/plat-spear/restart.c
··· 1 - /* 2 - * arch/arm/plat-spear/restart.c 3 - * 4 - * SPEAr platform specific restart functions 5 - * 6 - * Copyright (C) 2009 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.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 - #include <linux/io.h> 14 - #include <linux/amba/sp810.h> 15 - #include <asm/system_misc.h> 16 - #include <mach/spear.h> 17 - #include <mach/generic.h> 18 - 19 - #define SPEAR13XX_SYS_SW_RES (VA_MISC_BASE + 0x204) 20 - void spear_restart(char mode, const char *cmd) 21 - { 22 - if (mode == 's') { 23 - /* software reset, Jump into ROM at address 0 */ 24 - soft_restart(0); 25 - } else { 26 - /* hardware reset, Use on-chip reset capability */ 27 - #ifdef CONFIG_ARCH_SPEAR13XX 28 - writel_relaxed(0x01, SPEAR13XX_SYS_SW_RES); 29 - #else 30 - sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE); 31 - #endif 32 - } 33 - }
-245
arch/arm/plat-spear/time.c
··· 1 - /* 2 - * arch/arm/plat-spear/time.c 3 - * 4 - * Copyright (C) 2010 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/ioport.h> 19 - #include <linux/io.h> 20 - #include <linux/kernel.h> 21 - #include <linux/of_irq.h> 22 - #include <linux/of_address.h> 23 - #include <linux/time.h> 24 - #include <linux/irq.h> 25 - #include <asm/mach/time.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 - /* 62 - * Minimum clocksource/clockevent timer range in seconds 63 - */ 64 - #define SPEAR_MIN_RANGE 4 65 - 66 - static __iomem void *gpt_base; 67 - static struct clk *gpt_clk; 68 - 69 - static void clockevent_set_mode(enum clock_event_mode mode, 70 - struct clock_event_device *clk_event_dev); 71 - static int clockevent_next_event(unsigned long evt, 72 - struct clock_event_device *clk_event_dev); 73 - 74 - static void spear_clocksource_init(void) 75 - { 76 - u32 tick_rate; 77 - u16 val; 78 - 79 - /* program the prescaler (/256)*/ 80 - writew(CTRL_PRESCALER256, gpt_base + CR(CLKSRC)); 81 - 82 - /* find out actual clock driving Timer */ 83 - tick_rate = clk_get_rate(gpt_clk); 84 - tick_rate >>= CTRL_PRESCALER256; 85 - 86 - writew(0xFFFF, gpt_base + LOAD(CLKSRC)); 87 - 88 - val = readw(gpt_base + CR(CLKSRC)); 89 - val &= ~CTRL_ONE_SHOT; /* autoreload mode */ 90 - val |= CTRL_ENABLE ; 91 - writew(val, gpt_base + CR(CLKSRC)); 92 - 93 - /* register the clocksource */ 94 - clocksource_mmio_init(gpt_base + COUNT(CLKSRC), "tmr1", tick_rate, 95 - 200, 16, clocksource_mmio_readw_up); 96 - } 97 - 98 - static struct clock_event_device clkevt = { 99 - .name = "tmr0", 100 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 101 - .set_mode = clockevent_set_mode, 102 - .set_next_event = clockevent_next_event, 103 - .shift = 0, /* to be computed */ 104 - }; 105 - 106 - static void clockevent_set_mode(enum clock_event_mode mode, 107 - struct clock_event_device *clk_event_dev) 108 - { 109 - u32 period; 110 - u16 val; 111 - 112 - /* stop the timer */ 113 - val = readw(gpt_base + CR(CLKEVT)); 114 - val &= ~CTRL_ENABLE; 115 - writew(val, gpt_base + CR(CLKEVT)); 116 - 117 - switch (mode) { 118 - case CLOCK_EVT_MODE_PERIODIC: 119 - period = clk_get_rate(gpt_clk) / HZ; 120 - period >>= CTRL_PRESCALER16; 121 - writew(period, gpt_base + LOAD(CLKEVT)); 122 - 123 - val = readw(gpt_base + CR(CLKEVT)); 124 - val &= ~CTRL_ONE_SHOT; 125 - val |= CTRL_ENABLE | CTRL_INT_ENABLE; 126 - writew(val, gpt_base + CR(CLKEVT)); 127 - 128 - break; 129 - case CLOCK_EVT_MODE_ONESHOT: 130 - val = readw(gpt_base + CR(CLKEVT)); 131 - val |= CTRL_ONE_SHOT; 132 - writew(val, gpt_base + CR(CLKEVT)); 133 - 134 - break; 135 - case CLOCK_EVT_MODE_UNUSED: 136 - case CLOCK_EVT_MODE_SHUTDOWN: 137 - case CLOCK_EVT_MODE_RESUME: 138 - 139 - break; 140 - default: 141 - pr_err("Invalid mode requested\n"); 142 - break; 143 - } 144 - } 145 - 146 - static int clockevent_next_event(unsigned long cycles, 147 - struct clock_event_device *clk_event_dev) 148 - { 149 - u16 val = readw(gpt_base + CR(CLKEVT)); 150 - 151 - if (val & CTRL_ENABLE) 152 - writew(val & ~CTRL_ENABLE, gpt_base + CR(CLKEVT)); 153 - 154 - writew(cycles, gpt_base + LOAD(CLKEVT)); 155 - 156 - val |= CTRL_ENABLE | CTRL_INT_ENABLE; 157 - writew(val, gpt_base + CR(CLKEVT)); 158 - 159 - return 0; 160 - } 161 - 162 - static irqreturn_t spear_timer_interrupt(int irq, void *dev_id) 163 - { 164 - struct clock_event_device *evt = &clkevt; 165 - 166 - writew(INT_STATUS, gpt_base + IR(CLKEVT)); 167 - 168 - evt->event_handler(evt); 169 - 170 - return IRQ_HANDLED; 171 - } 172 - 173 - static struct irqaction spear_timer_irq = { 174 - .name = "timer", 175 - .flags = IRQF_DISABLED | IRQF_TIMER, 176 - .handler = spear_timer_interrupt 177 - }; 178 - 179 - static void __init spear_clockevent_init(int irq) 180 - { 181 - u32 tick_rate; 182 - 183 - /* program the prescaler */ 184 - writew(CTRL_PRESCALER16, gpt_base + CR(CLKEVT)); 185 - 186 - tick_rate = clk_get_rate(gpt_clk); 187 - tick_rate >>= CTRL_PRESCALER16; 188 - 189 - clkevt.cpumask = cpumask_of(0); 190 - 191 - clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0); 192 - 193 - setup_irq(irq, &spear_timer_irq); 194 - } 195 - 196 - const static struct of_device_id timer_of_match[] __initconst = { 197 - { .compatible = "st,spear-timer", }, 198 - { }, 199 - }; 200 - 201 - void __init spear_setup_of_timer(void) 202 - { 203 - struct device_node *np; 204 - int irq, ret; 205 - 206 - np = of_find_matching_node(NULL, timer_of_match); 207 - if (!np) { 208 - pr_err("%s: No timer passed via DT\n", __func__); 209 - return; 210 - } 211 - 212 - irq = irq_of_parse_and_map(np, 0); 213 - if (!irq) { 214 - pr_err("%s: No irq passed for timer via DT\n", __func__); 215 - return; 216 - } 217 - 218 - gpt_base = of_iomap(np, 0); 219 - if (!gpt_base) { 220 - pr_err("%s: of iomap failed\n", __func__); 221 - return; 222 - } 223 - 224 - gpt_clk = clk_get_sys("gpt0", NULL); 225 - if (!gpt_clk) { 226 - pr_err("%s:couldn't get clk for gpt\n", __func__); 227 - goto err_iomap; 228 - } 229 - 230 - ret = clk_prepare_enable(gpt_clk); 231 - if (ret < 0) { 232 - pr_err("%s:couldn't prepare-enable gpt clock\n", __func__); 233 - goto err_prepare_enable_clk; 234 - } 235 - 236 - spear_clockevent_init(irq); 237 - spear_clocksource_init(); 238 - 239 - return; 240 - 241 - err_prepare_enable_clk: 242 - clk_put(gpt_clk); 243 - err_iomap: 244 - iounmap(gpt_base); 245 - }
+31 -33
drivers/clk/spear/spear1310_clock.c
··· 17 17 #include <linux/io.h> 18 18 #include <linux/of_platform.h> 19 19 #include <linux/spinlock_types.h> 20 - #include <mach/spear.h> 21 20 #include "clk.h" 22 21 23 - #define VA_SPEAR1310_RAS_BASE IOMEM(UL(0xFA400000)) 24 22 /* PLL related registers and bit values */ 25 - #define SPEAR1310_PLL_CFG (VA_MISC_BASE + 0x210) 23 + #define SPEAR1310_PLL_CFG (misc_base + 0x210) 26 24 /* PLL_CFG bit values */ 27 25 #define SPEAR1310_CLCD_SYNT_CLK_MASK 1 28 26 #define SPEAR1310_CLCD_SYNT_CLK_SHIFT 31 ··· 33 35 #define SPEAR1310_PLL2_CLK_SHIFT 22 34 36 #define SPEAR1310_PLL1_CLK_SHIFT 20 35 37 36 - #define SPEAR1310_PLL1_CTR (VA_MISC_BASE + 0x214) 37 - #define SPEAR1310_PLL1_FRQ (VA_MISC_BASE + 0x218) 38 - #define SPEAR1310_PLL2_CTR (VA_MISC_BASE + 0x220) 39 - #define SPEAR1310_PLL2_FRQ (VA_MISC_BASE + 0x224) 40 - #define SPEAR1310_PLL3_CTR (VA_MISC_BASE + 0x22C) 41 - #define SPEAR1310_PLL3_FRQ (VA_MISC_BASE + 0x230) 42 - #define SPEAR1310_PLL4_CTR (VA_MISC_BASE + 0x238) 43 - #define SPEAR1310_PLL4_FRQ (VA_MISC_BASE + 0x23C) 44 - #define SPEAR1310_PERIP_CLK_CFG (VA_MISC_BASE + 0x244) 38 + #define SPEAR1310_PLL1_CTR (misc_base + 0x214) 39 + #define SPEAR1310_PLL1_FRQ (misc_base + 0x218) 40 + #define SPEAR1310_PLL2_CTR (misc_base + 0x220) 41 + #define SPEAR1310_PLL2_FRQ (misc_base + 0x224) 42 + #define SPEAR1310_PLL3_CTR (misc_base + 0x22C) 43 + #define SPEAR1310_PLL3_FRQ (misc_base + 0x230) 44 + #define SPEAR1310_PLL4_CTR (misc_base + 0x238) 45 + #define SPEAR1310_PLL4_FRQ (misc_base + 0x23C) 46 + #define SPEAR1310_PERIP_CLK_CFG (misc_base + 0x244) 45 47 /* PERIP_CLK_CFG bit values */ 46 48 #define SPEAR1310_GPT_OSC24_VAL 0 47 49 #define SPEAR1310_GPT_APB_VAL 1 ··· 63 65 #define SPEAR1310_C3_CLK_MASK 1 64 66 #define SPEAR1310_C3_CLK_SHIFT 1 65 67 66 - #define SPEAR1310_GMAC_CLK_CFG (VA_MISC_BASE + 0x248) 68 + #define SPEAR1310_GMAC_CLK_CFG (misc_base + 0x248) 67 69 #define SPEAR1310_GMAC_PHY_IF_SEL_MASK 3 68 70 #define SPEAR1310_GMAC_PHY_IF_SEL_SHIFT 4 69 71 #define SPEAR1310_GMAC_PHY_CLK_MASK 1 ··· 71 73 #define SPEAR1310_GMAC_PHY_INPUT_CLK_MASK 2 72 74 #define SPEAR1310_GMAC_PHY_INPUT_CLK_SHIFT 1 73 75 74 - #define SPEAR1310_I2S_CLK_CFG (VA_MISC_BASE + 0x24C) 76 + #define SPEAR1310_I2S_CLK_CFG (misc_base + 0x24C) 75 77 /* I2S_CLK_CFG register mask */ 76 78 #define SPEAR1310_I2S_SCLK_X_MASK 0x1F 77 79 #define SPEAR1310_I2S_SCLK_X_SHIFT 27 ··· 89 91 #define SPEAR1310_I2S_SRC_CLK_MASK 2 90 92 #define SPEAR1310_I2S_SRC_CLK_SHIFT 0 91 93 92 - #define SPEAR1310_C3_CLK_SYNT (VA_MISC_BASE + 0x250) 93 - #define SPEAR1310_UART_CLK_SYNT (VA_MISC_BASE + 0x254) 94 - #define SPEAR1310_GMAC_CLK_SYNT (VA_MISC_BASE + 0x258) 95 - #define SPEAR1310_SDHCI_CLK_SYNT (VA_MISC_BASE + 0x25C) 96 - #define SPEAR1310_CFXD_CLK_SYNT (VA_MISC_BASE + 0x260) 97 - #define SPEAR1310_ADC_CLK_SYNT (VA_MISC_BASE + 0x264) 98 - #define SPEAR1310_AMBA_CLK_SYNT (VA_MISC_BASE + 0x268) 99 - #define SPEAR1310_CLCD_CLK_SYNT (VA_MISC_BASE + 0x270) 100 - #define SPEAR1310_RAS_CLK_SYNT0 (VA_MISC_BASE + 0x280) 101 - #define SPEAR1310_RAS_CLK_SYNT1 (VA_MISC_BASE + 0x288) 102 - #define SPEAR1310_RAS_CLK_SYNT2 (VA_MISC_BASE + 0x290) 103 - #define SPEAR1310_RAS_CLK_SYNT3 (VA_MISC_BASE + 0x298) 94 + #define SPEAR1310_C3_CLK_SYNT (misc_base + 0x250) 95 + #define SPEAR1310_UART_CLK_SYNT (misc_base + 0x254) 96 + #define SPEAR1310_GMAC_CLK_SYNT (misc_base + 0x258) 97 + #define SPEAR1310_SDHCI_CLK_SYNT (misc_base + 0x25C) 98 + #define SPEAR1310_CFXD_CLK_SYNT (misc_base + 0x260) 99 + #define SPEAR1310_ADC_CLK_SYNT (misc_base + 0x264) 100 + #define SPEAR1310_AMBA_CLK_SYNT (misc_base + 0x268) 101 + #define SPEAR1310_CLCD_CLK_SYNT (misc_base + 0x270) 102 + #define SPEAR1310_RAS_CLK_SYNT0 (misc_base + 0x280) 103 + #define SPEAR1310_RAS_CLK_SYNT1 (misc_base + 0x288) 104 + #define SPEAR1310_RAS_CLK_SYNT2 (misc_base + 0x290) 105 + #define SPEAR1310_RAS_CLK_SYNT3 (misc_base + 0x298) 104 106 /* Check Fractional synthesizer reg masks */ 105 107 106 - #define SPEAR1310_PERIP1_CLK_ENB (VA_MISC_BASE + 0x300) 108 + #define SPEAR1310_PERIP1_CLK_ENB (misc_base + 0x300) 107 109 /* PERIP1_CLK_ENB register masks */ 108 110 #define SPEAR1310_RTC_CLK_ENB 31 109 111 #define SPEAR1310_ADC_CLK_ENB 30 ··· 136 138 #define SPEAR1310_SYSROM_CLK_ENB 1 137 139 #define SPEAR1310_BUS_CLK_ENB 0 138 140 139 - #define SPEAR1310_PERIP2_CLK_ENB (VA_MISC_BASE + 0x304) 141 + #define SPEAR1310_PERIP2_CLK_ENB (misc_base + 0x304) 140 142 /* PERIP2_CLK_ENB register masks */ 141 143 #define SPEAR1310_THSENS_CLK_ENB 8 142 144 #define SPEAR1310_I2S_REF_PAD_CLK_ENB 7 ··· 148 150 #define SPEAR1310_DDR_CORE_CLK_ENB 1 149 151 #define SPEAR1310_DDR_CTRL_CLK_ENB 0 150 152 151 - #define SPEAR1310_RAS_CLK_ENB (VA_MISC_BASE + 0x310) 153 + #define SPEAR1310_RAS_CLK_ENB (misc_base + 0x310) 152 154 /* RAS_CLK_ENB register masks */ 153 155 #define SPEAR1310_SYNT3_CLK_ENB 17 154 156 #define SPEAR1310_SYNT2_CLK_ENB 16 ··· 170 172 #define SPEAR1310_ACLK_CLK_ENB 0 171 173 172 174 /* RAS Area Control Register */ 173 - #define SPEAR1310_RAS_CTRL_REG0 (VA_SPEAR1310_RAS_BASE + 0x000) 175 + #define SPEAR1310_RAS_CTRL_REG0 (ras_base + 0x000) 174 176 #define SPEAR1310_SSP1_CLK_MASK 3 175 177 #define SPEAR1310_SSP1_CLK_SHIFT 26 176 178 #define SPEAR1310_TDM_CLK_MASK 1 ··· 195 197 #define SPEAR1310_PCI_CLK_MASK 1 196 198 #define SPEAR1310_PCI_CLK_SHIFT 0 197 199 198 - #define SPEAR1310_RAS_CTRL_REG1 (VA_SPEAR1310_RAS_BASE + 0x004) 200 + #define SPEAR1310_RAS_CTRL_REG1 (ras_base + 0x004) 199 201 #define SPEAR1310_PHY_CLK_MASK 0x3 200 202 #define SPEAR1310_RMII_PHY_CLK_SHIFT 0 201 203 #define SPEAR1310_SMII_RGMII_PHY_CLK_SHIFT 2 202 204 203 - #define SPEAR1310_RAS_SW_CLK_CTRL (VA_SPEAR1310_RAS_BASE + 0x0148) 205 + #define SPEAR1310_RAS_SW_CLK_CTRL (ras_base + 0x0148) 204 206 #define SPEAR1310_CAN1_CLK_ENB 25 205 207 #define SPEAR1310_CAN0_CLK_ENB 24 206 208 #define SPEAR1310_GPT64_CLK_ENB 23 ··· 383 385 static const char *pci_parents[] = { "ras_pll3_clk", "gen_syn2_clk", }; 384 386 static const char *tdm_parents[] = { "ras_pll3_clk", "gen_syn1_clk", }; 385 387 386 - void __init spear1310_clk_init(void) 388 + void __init spear1310_clk_init(void __iomem *misc_base, void __iomem *ras_base) 387 389 { 388 390 struct clk *clk, *clk1; 389 391
+31 -32
drivers/clk/spear/spear1340_clock.c
··· 17 17 #include <linux/io.h> 18 18 #include <linux/of_platform.h> 19 19 #include <linux/spinlock_types.h> 20 - #include <mach/spear.h> 21 20 #include "clk.h" 22 21 23 22 /* Clock Configuration Registers */ 24 - #define SPEAR1340_SYS_CLK_CTRL (VA_MISC_BASE + 0x200) 23 + #define SPEAR1340_SYS_CLK_CTRL (misc_base + 0x200) 25 24 #define SPEAR1340_HCLK_SRC_SEL_SHIFT 27 26 25 #define SPEAR1340_HCLK_SRC_SEL_MASK 1 27 26 #define SPEAR1340_SCLK_SRC_SEL_SHIFT 23 28 27 #define SPEAR1340_SCLK_SRC_SEL_MASK 3 29 28 30 29 /* PLL related registers and bit values */ 31 - #define SPEAR1340_PLL_CFG (VA_MISC_BASE + 0x210) 30 + #define SPEAR1340_PLL_CFG (misc_base + 0x210) 32 31 /* PLL_CFG bit values */ 33 32 #define SPEAR1340_CLCD_SYNT_CLK_MASK 1 34 33 #define SPEAR1340_CLCD_SYNT_CLK_SHIFT 31 ··· 39 40 #define SPEAR1340_PLL2_CLK_SHIFT 22 40 41 #define SPEAR1340_PLL1_CLK_SHIFT 20 41 42 42 - #define SPEAR1340_PLL1_CTR (VA_MISC_BASE + 0x214) 43 - #define SPEAR1340_PLL1_FRQ (VA_MISC_BASE + 0x218) 44 - #define SPEAR1340_PLL2_CTR (VA_MISC_BASE + 0x220) 45 - #define SPEAR1340_PLL2_FRQ (VA_MISC_BASE + 0x224) 46 - #define SPEAR1340_PLL3_CTR (VA_MISC_BASE + 0x22C) 47 - #define SPEAR1340_PLL3_FRQ (VA_MISC_BASE + 0x230) 48 - #define SPEAR1340_PLL4_CTR (VA_MISC_BASE + 0x238) 49 - #define SPEAR1340_PLL4_FRQ (VA_MISC_BASE + 0x23C) 50 - #define SPEAR1340_PERIP_CLK_CFG (VA_MISC_BASE + 0x244) 43 + #define SPEAR1340_PLL1_CTR (misc_base + 0x214) 44 + #define SPEAR1340_PLL1_FRQ (misc_base + 0x218) 45 + #define SPEAR1340_PLL2_CTR (misc_base + 0x220) 46 + #define SPEAR1340_PLL2_FRQ (misc_base + 0x224) 47 + #define SPEAR1340_PLL3_CTR (misc_base + 0x22C) 48 + #define SPEAR1340_PLL3_FRQ (misc_base + 0x230) 49 + #define SPEAR1340_PLL4_CTR (misc_base + 0x238) 50 + #define SPEAR1340_PLL4_FRQ (misc_base + 0x23C) 51 + #define SPEAR1340_PERIP_CLK_CFG (misc_base + 0x244) 51 52 /* PERIP_CLK_CFG bit values */ 52 53 #define SPEAR1340_SPDIF_CLK_MASK 1 53 54 #define SPEAR1340_SPDIF_OUT_CLK_SHIFT 15 ··· 65 66 #define SPEAR1340_C3_CLK_MASK 1 66 67 #define SPEAR1340_C3_CLK_SHIFT 1 67 68 68 - #define SPEAR1340_GMAC_CLK_CFG (VA_MISC_BASE + 0x248) 69 + #define SPEAR1340_GMAC_CLK_CFG (misc_base + 0x248) 69 70 #define SPEAR1340_GMAC_PHY_CLK_MASK 1 70 71 #define SPEAR1340_GMAC_PHY_CLK_SHIFT 2 71 72 #define SPEAR1340_GMAC_PHY_INPUT_CLK_MASK 2 72 73 #define SPEAR1340_GMAC_PHY_INPUT_CLK_SHIFT 0 73 74 74 - #define SPEAR1340_I2S_CLK_CFG (VA_MISC_BASE + 0x24C) 75 + #define SPEAR1340_I2S_CLK_CFG (misc_base + 0x24C) 75 76 /* I2S_CLK_CFG register mask */ 76 77 #define SPEAR1340_I2S_SCLK_X_MASK 0x1F 77 78 #define SPEAR1340_I2S_SCLK_X_SHIFT 27 ··· 89 90 #define SPEAR1340_I2S_SRC_CLK_MASK 2 90 91 #define SPEAR1340_I2S_SRC_CLK_SHIFT 0 91 92 92 - #define SPEAR1340_C3_CLK_SYNT (VA_MISC_BASE + 0x250) 93 - #define SPEAR1340_UART0_CLK_SYNT (VA_MISC_BASE + 0x254) 94 - #define SPEAR1340_UART1_CLK_SYNT (VA_MISC_BASE + 0x258) 95 - #define SPEAR1340_GMAC_CLK_SYNT (VA_MISC_BASE + 0x25C) 96 - #define SPEAR1340_SDHCI_CLK_SYNT (VA_MISC_BASE + 0x260) 97 - #define SPEAR1340_CFXD_CLK_SYNT (VA_MISC_BASE + 0x264) 98 - #define SPEAR1340_ADC_CLK_SYNT (VA_MISC_BASE + 0x270) 99 - #define SPEAR1340_AMBA_CLK_SYNT (VA_MISC_BASE + 0x274) 100 - #define SPEAR1340_CLCD_CLK_SYNT (VA_MISC_BASE + 0x27C) 101 - #define SPEAR1340_SYS_CLK_SYNT (VA_MISC_BASE + 0x284) 102 - #define SPEAR1340_GEN_CLK_SYNT0 (VA_MISC_BASE + 0x28C) 103 - #define SPEAR1340_GEN_CLK_SYNT1 (VA_MISC_BASE + 0x294) 104 - #define SPEAR1340_GEN_CLK_SYNT2 (VA_MISC_BASE + 0x29C) 105 - #define SPEAR1340_GEN_CLK_SYNT3 (VA_MISC_BASE + 0x304) 106 - #define SPEAR1340_PERIP1_CLK_ENB (VA_MISC_BASE + 0x30C) 93 + #define SPEAR1340_C3_CLK_SYNT (misc_base + 0x250) 94 + #define SPEAR1340_UART0_CLK_SYNT (misc_base + 0x254) 95 + #define SPEAR1340_UART1_CLK_SYNT (misc_base + 0x258) 96 + #define SPEAR1340_GMAC_CLK_SYNT (misc_base + 0x25C) 97 + #define SPEAR1340_SDHCI_CLK_SYNT (misc_base + 0x260) 98 + #define SPEAR1340_CFXD_CLK_SYNT (misc_base + 0x264) 99 + #define SPEAR1340_ADC_CLK_SYNT (misc_base + 0x270) 100 + #define SPEAR1340_AMBA_CLK_SYNT (misc_base + 0x274) 101 + #define SPEAR1340_CLCD_CLK_SYNT (misc_base + 0x27C) 102 + #define SPEAR1340_SYS_CLK_SYNT (misc_base + 0x284) 103 + #define SPEAR1340_GEN_CLK_SYNT0 (misc_base + 0x28C) 104 + #define SPEAR1340_GEN_CLK_SYNT1 (misc_base + 0x294) 105 + #define SPEAR1340_GEN_CLK_SYNT2 (misc_base + 0x29C) 106 + #define SPEAR1340_GEN_CLK_SYNT3 (misc_base + 0x304) 107 + #define SPEAR1340_PERIP1_CLK_ENB (misc_base + 0x30C) 107 108 #define SPEAR1340_RTC_CLK_ENB 31 108 109 #define SPEAR1340_ADC_CLK_ENB 30 109 110 #define SPEAR1340_C3_CLK_ENB 29 ··· 132 133 #define SPEAR1340_SYSROM_CLK_ENB 1 133 134 #define SPEAR1340_BUS_CLK_ENB 0 134 135 135 - #define SPEAR1340_PERIP2_CLK_ENB (VA_MISC_BASE + 0x310) 136 + #define SPEAR1340_PERIP2_CLK_ENB (misc_base + 0x310) 136 137 #define SPEAR1340_THSENS_CLK_ENB 8 137 138 #define SPEAR1340_I2S_REF_PAD_CLK_ENB 7 138 139 #define SPEAR1340_ACP_CLK_ENB 6 ··· 143 144 #define SPEAR1340_DDR_CORE_CLK_ENB 1 144 145 #define SPEAR1340_DDR_CTRL_CLK_ENB 0 145 146 146 - #define SPEAR1340_PERIP3_CLK_ENB (VA_MISC_BASE + 0x314) 147 + #define SPEAR1340_PERIP3_CLK_ENB (misc_base + 0x314) 147 148 #define SPEAR1340_PLGPIO_CLK_ENB 18 148 149 #define SPEAR1340_VIDEO_DEC_CLK_ENB 16 149 150 #define SPEAR1340_VIDEO_ENC_CLK_ENB 15 ··· 440 441 static const char *gen_synth2_3_parents[] = { "vco1div4_clk", "vco2div2_clk", 441 442 "pll2_clk", }; 442 443 443 - void __init spear1340_clk_init(void) 444 + void __init spear1340_clk_init(void __iomem *misc_base) 444 445 { 445 446 struct clk *clk, *clk1; 446 447
+35 -25
drivers/clk/spear/spear3xx_clock.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/of_platform.h> 17 17 #include <linux/spinlock_types.h> 18 - #include <mach/misc_regs.h> 19 18 #include "clk.h" 20 19 21 20 static DEFINE_SPINLOCK(_lock); 22 21 23 - #define PLL1_CTR (MISC_BASE + 0x008) 24 - #define PLL1_FRQ (MISC_BASE + 0x00C) 25 - #define PLL2_CTR (MISC_BASE + 0x014) 26 - #define PLL2_FRQ (MISC_BASE + 0x018) 27 - #define PLL_CLK_CFG (MISC_BASE + 0x020) 22 + #define PLL1_CTR (misc_base + 0x008) 23 + #define PLL1_FRQ (misc_base + 0x00C) 24 + #define PLL2_CTR (misc_base + 0x014) 25 + #define PLL2_FRQ (misc_base + 0x018) 26 + #define PLL_CLK_CFG (misc_base + 0x020) 28 27 /* PLL_CLK_CFG register masks */ 29 28 #define MCTR_CLK_SHIFT 28 30 29 #define MCTR_CLK_MASK 3 31 30 32 - #define CORE_CLK_CFG (MISC_BASE + 0x024) 31 + #define CORE_CLK_CFG (misc_base + 0x024) 33 32 /* CORE CLK CFG register masks */ 34 33 #define GEN_SYNTH2_3_CLK_SHIFT 18 35 34 #define GEN_SYNTH2_3_CLK_MASK 1 ··· 38 39 #define PCLK_RATIO_SHIFT 8 39 40 #define PCLK_RATIO_MASK 2 40 41 41 - #define PERIP_CLK_CFG (MISC_BASE + 0x028) 42 + #define PERIP_CLK_CFG (misc_base + 0x028) 42 43 /* PERIP_CLK_CFG register masks */ 43 44 #define UART_CLK_SHIFT 4 44 45 #define UART_CLK_MASK 1 ··· 49 50 #define GPT2_CLK_SHIFT 12 50 51 #define GPT_CLK_MASK 1 51 52 52 - #define PERIP1_CLK_ENB (MISC_BASE + 0x02C) 53 + #define PERIP1_CLK_ENB (misc_base + 0x02C) 53 54 /* PERIP1_CLK_ENB register masks */ 54 55 #define UART_CLK_ENB 3 55 56 #define SSP_CLK_ENB 5 ··· 68 69 #define USBH_CLK_ENB 25 69 70 #define C3_CLK_ENB 31 70 71 71 - #define RAS_CLK_ENB (MISC_BASE + 0x034) 72 + #define RAS_CLK_ENB (misc_base + 0x034) 72 73 #define RAS_AHB_CLK_ENB 0 73 74 #define RAS_PLL1_CLK_ENB 1 74 75 #define RAS_APB_CLK_ENB 2 ··· 81 82 #define RAS_SYNT2_CLK_ENB 10 82 83 #define RAS_SYNT3_CLK_ENB 11 83 84 84 - #define PRSC0_CLK_CFG (MISC_BASE + 0x044) 85 - #define PRSC1_CLK_CFG (MISC_BASE + 0x048) 86 - #define PRSC2_CLK_CFG (MISC_BASE + 0x04C) 87 - #define AMEM_CLK_CFG (MISC_BASE + 0x050) 85 + #define PRSC0_CLK_CFG (misc_base + 0x044) 86 + #define PRSC1_CLK_CFG (misc_base + 0x048) 87 + #define PRSC2_CLK_CFG (misc_base + 0x04C) 88 + #define AMEM_CLK_CFG (misc_base + 0x050) 88 89 #define AMEM_CLK_ENB 0 89 90 90 - #define CLCD_CLK_SYNT (MISC_BASE + 0x05C) 91 - #define FIRDA_CLK_SYNT (MISC_BASE + 0x060) 92 - #define UART_CLK_SYNT (MISC_BASE + 0x064) 93 - #define GMAC_CLK_SYNT (MISC_BASE + 0x068) 94 - #define GEN0_CLK_SYNT (MISC_BASE + 0x06C) 95 - #define GEN1_CLK_SYNT (MISC_BASE + 0x070) 96 - #define GEN2_CLK_SYNT (MISC_BASE + 0x074) 97 - #define GEN3_CLK_SYNT (MISC_BASE + 0x078) 91 + #define CLCD_CLK_SYNT (misc_base + 0x05C) 92 + #define FIRDA_CLK_SYNT (misc_base + 0x060) 93 + #define UART_CLK_SYNT (misc_base + 0x064) 94 + #define GMAC_CLK_SYNT (misc_base + 0x068) 95 + #define GEN0_CLK_SYNT (misc_base + 0x06C) 96 + #define GEN1_CLK_SYNT (misc_base + 0x070) 97 + #define GEN2_CLK_SYNT (misc_base + 0x074) 98 + #define GEN3_CLK_SYNT (misc_base + 0x078) 98 99 99 100 /* pll rate configuration table, in ascending order of rates */ 100 101 static struct pll_rate_tbl pll_rtbl[] = { ··· 210 211 211 212 /* array of all spear 320 clock lookups */ 212 213 #ifdef CONFIG_MACH_SPEAR320 214 + 215 + #define SPEAR320_CONTROL_REG (soc_config_base + 0x0000) 216 + #define SPEAR320_EXT_CTRL_REG (soc_config_base + 0x0018) 217 + 218 + #define SPEAR320_UARTX_PCLK_MASK 0x1 219 + #define SPEAR320_UART2_PCLK_SHIFT 8 220 + #define SPEAR320_UART3_PCLK_SHIFT 9 221 + #define SPEAR320_UART4_PCLK_SHIFT 10 222 + #define SPEAR320_UART5_PCLK_SHIFT 11 223 + #define SPEAR320_UART6_PCLK_SHIFT 12 224 + #define SPEAR320_RS485_PCLK_SHIFT 13 213 225 #define SMII_PCLK_SHIFT 18 214 226 #define SMII_PCLK_MASK 2 215 227 #define SMII_PCLK_VAL_PAD 0x0 ··· 245 235 "ras_syn0_gclk", }; 246 236 static const char *uartx_parents[] = { "ras_syn1_gclk", "ras_apb_clk", }; 247 237 248 - static void __init spear320_clk_init(void) 238 + static void __init spear320_clk_init(void __iomem *soc_config_base) 249 239 { 250 240 struct clk *clk; 251 241 ··· 372 362 static inline void spear320_clk_init(void) { } 373 363 #endif 374 364 375 - void __init spear3xx_clk_init(void) 365 + void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_base) 376 366 { 377 367 struct clk *clk, *clk1; 378 368 ··· 644 634 else if (of_machine_is_compatible("st,spear310")) 645 635 spear310_clk_init(); 646 636 else if (of_machine_is_compatible("st,spear320")) 647 - spear320_clk_init(); 637 + spear320_clk_init(soc_config_base); 648 638 }
+15 -16
drivers/clk/spear/spear6xx_clock.c
··· 13 13 #include <linux/clkdev.h> 14 14 #include <linux/io.h> 15 15 #include <linux/spinlock_types.h> 16 - #include <mach/misc_regs.h> 17 16 #include "clk.h" 18 17 19 18 static DEFINE_SPINLOCK(_lock); 20 19 21 - #define PLL1_CTR (MISC_BASE + 0x008) 22 - #define PLL1_FRQ (MISC_BASE + 0x00C) 23 - #define PLL2_CTR (MISC_BASE + 0x014) 24 - #define PLL2_FRQ (MISC_BASE + 0x018) 25 - #define PLL_CLK_CFG (MISC_BASE + 0x020) 20 + #define PLL1_CTR (misc_base + 0x008) 21 + #define PLL1_FRQ (misc_base + 0x00C) 22 + #define PLL2_CTR (misc_base + 0x014) 23 + #define PLL2_FRQ (misc_base + 0x018) 24 + #define PLL_CLK_CFG (misc_base + 0x020) 26 25 /* PLL_CLK_CFG register masks */ 27 26 #define MCTR_CLK_SHIFT 28 28 27 #define MCTR_CLK_MASK 3 29 28 30 - #define CORE_CLK_CFG (MISC_BASE + 0x024) 29 + #define CORE_CLK_CFG (misc_base + 0x024) 31 30 /* CORE CLK CFG register masks */ 32 31 #define HCLK_RATIO_SHIFT 10 33 32 #define HCLK_RATIO_MASK 2 34 33 #define PCLK_RATIO_SHIFT 8 35 34 #define PCLK_RATIO_MASK 2 36 35 37 - #define PERIP_CLK_CFG (MISC_BASE + 0x028) 36 + #define PERIP_CLK_CFG (misc_base + 0x028) 38 37 /* PERIP_CLK_CFG register masks */ 39 38 #define CLCD_CLK_SHIFT 2 40 39 #define CLCD_CLK_MASK 2 ··· 47 48 #define GPT3_CLK_SHIFT 12 48 49 #define GPT_CLK_MASK 1 49 50 50 - #define PERIP1_CLK_ENB (MISC_BASE + 0x02C) 51 + #define PERIP1_CLK_ENB (misc_base + 0x02C) 51 52 /* PERIP1_CLK_ENB register masks */ 52 53 #define UART0_CLK_ENB 3 53 54 #define UART1_CLK_ENB 4 ··· 73 74 #define USBH0_CLK_ENB 25 74 75 #define USBH1_CLK_ENB 26 75 76 76 - #define PRSC0_CLK_CFG (MISC_BASE + 0x044) 77 - #define PRSC1_CLK_CFG (MISC_BASE + 0x048) 78 - #define PRSC2_CLK_CFG (MISC_BASE + 0x04C) 77 + #define PRSC0_CLK_CFG (misc_base + 0x044) 78 + #define PRSC1_CLK_CFG (misc_base + 0x048) 79 + #define PRSC2_CLK_CFG (misc_base + 0x04C) 79 80 80 - #define CLCD_CLK_SYNT (MISC_BASE + 0x05C) 81 - #define FIRDA_CLK_SYNT (MISC_BASE + 0x060) 82 - #define UART_CLK_SYNT (MISC_BASE + 0x064) 81 + #define CLCD_CLK_SYNT (misc_base + 0x05C) 82 + #define FIRDA_CLK_SYNT (misc_base + 0x060) 83 + #define UART_CLK_SYNT (misc_base + 0x064) 83 84 84 85 /* vco rate configuration table, in ascending order of rates */ 85 86 static struct pll_rate_tbl pll_rtbl[] = { ··· 114 115 {.mscale = 1, .nscale = 0}, /* 83 MHz */ 115 116 }; 116 117 117 - void __init spear6xx_clk_init(void) 118 + void __init spear6xx_clk_init(void __iomem *misc_base) 118 119 { 119 120 struct clk *clk, *clk1; 120 121
+1 -2
drivers/clk/tegra/clk-tegra30.c
··· 22 22 #include <linux/of.h> 23 23 #include <linux/of_address.h> 24 24 #include <linux/clk/tegra.h> 25 - 26 - #include <mach/powergate.h> 25 + #include <linux/tegra-powergate.h> 27 26 28 27 #include "clk.h" 29 28
-1
drivers/clk/ux500/clk-prcc.c
··· 13 13 #include <linux/io.h> 14 14 #include <linux/err.h> 15 15 #include <linux/types.h> 16 - #include <mach/hardware.h> 17 16 18 17 #include "clk.h" 19 18
+71 -71
drivers/clk/ux500/u8500_clk.c
··· 12 12 #include <linux/clk-provider.h> 13 13 #include <linux/mfd/dbx500-prcmu.h> 14 14 #include <linux/platform_data/clk-ux500.h> 15 - #include <mach/db8500-regs.h> 16 15 #include "clk.h" 17 16 18 - void u8500_clk_init(void) 17 + void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, 18 + u32 clkrst5_base, u32 clkrst6_base) 19 19 { 20 20 struct prcmu_fw_version *fw_version; 21 21 const char *sgaclk_parent = NULL; ··· 215 215 */ 216 216 217 217 /* PRCC P-clocks */ 218 - clk = clk_reg_prcc_pclk("p1_pclk0", "per1clk", U8500_CLKRST1_BASE, 218 + clk = clk_reg_prcc_pclk("p1_pclk0", "per1clk", clkrst1_base, 219 219 BIT(0), 0); 220 220 clk_register_clkdev(clk, "apb_pclk", "uart0"); 221 221 222 - clk = clk_reg_prcc_pclk("p1_pclk1", "per1clk", U8500_CLKRST1_BASE, 222 + clk = clk_reg_prcc_pclk("p1_pclk1", "per1clk", clkrst1_base, 223 223 BIT(1), 0); 224 224 clk_register_clkdev(clk, "apb_pclk", "uart1"); 225 225 226 - clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", U8500_CLKRST1_BASE, 226 + clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", clkrst1_base, 227 227 BIT(2), 0); 228 228 clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.1"); 229 229 230 - clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", U8500_CLKRST1_BASE, 230 + clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", clkrst1_base, 231 231 BIT(3), 0); 232 232 clk_register_clkdev(clk, "apb_pclk", "msp0"); 233 233 clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.0"); 234 234 235 - clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", U8500_CLKRST1_BASE, 235 + clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", clkrst1_base, 236 236 BIT(4), 0); 237 237 clk_register_clkdev(clk, "apb_pclk", "msp1"); 238 238 clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.1"); 239 239 240 - clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", U8500_CLKRST1_BASE, 240 + clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", clkrst1_base, 241 241 BIT(5), 0); 242 242 clk_register_clkdev(clk, "apb_pclk", "sdi0"); 243 243 244 - clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", U8500_CLKRST1_BASE, 244 + clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", clkrst1_base, 245 245 BIT(6), 0); 246 246 clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.2"); 247 247 248 - clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", U8500_CLKRST1_BASE, 248 + clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", clkrst1_base, 249 249 BIT(7), 0); 250 250 clk_register_clkdev(clk, NULL, "spi3"); 251 251 252 - clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", U8500_CLKRST1_BASE, 252 + clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", clkrst1_base, 253 253 BIT(8), 0); 254 254 clk_register_clkdev(clk, "apb_pclk", "slimbus0"); 255 255 256 - clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", U8500_CLKRST1_BASE, 256 + clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", clkrst1_base, 257 257 BIT(9), 0); 258 258 clk_register_clkdev(clk, NULL, "gpio.0"); 259 259 clk_register_clkdev(clk, NULL, "gpio.1"); 260 260 clk_register_clkdev(clk, NULL, "gpioblock0"); 261 261 262 - clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", U8500_CLKRST1_BASE, 262 + clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", clkrst1_base, 263 263 BIT(10), 0); 264 264 clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.4"); 265 265 266 - clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", U8500_CLKRST1_BASE, 266 + clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", clkrst1_base, 267 267 BIT(11), 0); 268 268 clk_register_clkdev(clk, "apb_pclk", "msp3"); 269 269 clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.3"); 270 270 271 - clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", U8500_CLKRST2_BASE, 271 + clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", clkrst2_base, 272 272 BIT(0), 0); 273 273 clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.3"); 274 274 275 - clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", U8500_CLKRST2_BASE, 275 + clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", clkrst2_base, 276 276 BIT(1), 0); 277 277 clk_register_clkdev(clk, NULL, "spi2"); 278 278 279 - clk = clk_reg_prcc_pclk("p2_pclk2", "per2clk", U8500_CLKRST2_BASE, 279 + clk = clk_reg_prcc_pclk("p2_pclk2", "per2clk", clkrst2_base, 280 280 BIT(2), 0); 281 281 clk_register_clkdev(clk, NULL, "spi1"); 282 282 283 - clk = clk_reg_prcc_pclk("p2_pclk3", "per2clk", U8500_CLKRST2_BASE, 283 + clk = clk_reg_prcc_pclk("p2_pclk3", "per2clk", clkrst2_base, 284 284 BIT(3), 0); 285 285 clk_register_clkdev(clk, NULL, "pwl"); 286 286 287 - clk = clk_reg_prcc_pclk("p2_pclk4", "per2clk", U8500_CLKRST2_BASE, 287 + clk = clk_reg_prcc_pclk("p2_pclk4", "per2clk", clkrst2_base, 288 288 BIT(4), 0); 289 289 clk_register_clkdev(clk, "apb_pclk", "sdi4"); 290 290 291 - clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", U8500_CLKRST2_BASE, 291 + clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", clkrst2_base, 292 292 BIT(5), 0); 293 293 clk_register_clkdev(clk, "apb_pclk", "msp2"); 294 294 clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.2"); 295 295 296 - clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", U8500_CLKRST2_BASE, 296 + clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", clkrst2_base, 297 297 BIT(6), 0); 298 298 clk_register_clkdev(clk, "apb_pclk", "sdi1"); 299 299 300 - clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", U8500_CLKRST2_BASE, 300 + clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", clkrst2_base, 301 301 BIT(7), 0); 302 302 clk_register_clkdev(clk, "apb_pclk", "sdi3"); 303 303 304 - clk = clk_reg_prcc_pclk("p2_pclk8", "per2clk", U8500_CLKRST2_BASE, 304 + clk = clk_reg_prcc_pclk("p2_pclk8", "per2clk", clkrst2_base, 305 305 BIT(8), 0); 306 306 clk_register_clkdev(clk, NULL, "spi0"); 307 307 308 - clk = clk_reg_prcc_pclk("p2_pclk9", "per2clk", U8500_CLKRST2_BASE, 308 + clk = clk_reg_prcc_pclk("p2_pclk9", "per2clk", clkrst2_base, 309 309 BIT(9), 0); 310 310 clk_register_clkdev(clk, "hsir_hclk", "ste_hsi.0"); 311 311 312 - clk = clk_reg_prcc_pclk("p2_pclk10", "per2clk", U8500_CLKRST2_BASE, 312 + clk = clk_reg_prcc_pclk("p2_pclk10", "per2clk", clkrst2_base, 313 313 BIT(10), 0); 314 314 clk_register_clkdev(clk, "hsit_hclk", "ste_hsi.0"); 315 315 316 - clk = clk_reg_prcc_pclk("p2_pclk11", "per2clk", U8500_CLKRST2_BASE, 316 + clk = clk_reg_prcc_pclk("p2_pclk11", "per2clk", clkrst2_base, 317 317 BIT(11), 0); 318 318 clk_register_clkdev(clk, NULL, "gpio.6"); 319 319 clk_register_clkdev(clk, NULL, "gpio.7"); 320 320 clk_register_clkdev(clk, NULL, "gpioblock1"); 321 321 322 - clk = clk_reg_prcc_pclk("p2_pclk12", "per2clk", U8500_CLKRST2_BASE, 322 + clk = clk_reg_prcc_pclk("p2_pclk12", "per2clk", clkrst2_base, 323 323 BIT(12), 0); 324 324 325 - clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", U8500_CLKRST3_BASE, 325 + clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", clkrst3_base, 326 326 BIT(0), 0); 327 327 clk_register_clkdev(clk, "fsmc", NULL); 328 328 clk_register_clkdev(clk, NULL, "smsc911x"); 329 329 330 - clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", U8500_CLKRST3_BASE, 330 + clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", clkrst3_base, 331 331 BIT(1), 0); 332 332 clk_register_clkdev(clk, "apb_pclk", "ssp0"); 333 333 334 - clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", U8500_CLKRST3_BASE, 334 + clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", clkrst3_base, 335 335 BIT(2), 0); 336 336 clk_register_clkdev(clk, "apb_pclk", "ssp1"); 337 337 338 - clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", U8500_CLKRST3_BASE, 338 + clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", clkrst3_base, 339 339 BIT(3), 0); 340 340 clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.0"); 341 341 342 - clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", U8500_CLKRST3_BASE, 342 + clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", clkrst3_base, 343 343 BIT(4), 0); 344 344 clk_register_clkdev(clk, "apb_pclk", "sdi2"); 345 345 346 - clk = clk_reg_prcc_pclk("p3_pclk5", "per3clk", U8500_CLKRST3_BASE, 346 + clk = clk_reg_prcc_pclk("p3_pclk5", "per3clk", clkrst3_base, 347 347 BIT(5), 0); 348 348 clk_register_clkdev(clk, "apb_pclk", "ske"); 349 349 clk_register_clkdev(clk, "apb_pclk", "nmk-ske-keypad"); 350 350 351 - clk = clk_reg_prcc_pclk("p3_pclk6", "per3clk", U8500_CLKRST3_BASE, 351 + clk = clk_reg_prcc_pclk("p3_pclk6", "per3clk", clkrst3_base, 352 352 BIT(6), 0); 353 353 clk_register_clkdev(clk, "apb_pclk", "uart2"); 354 354 355 - clk = clk_reg_prcc_pclk("p3_pclk7", "per3clk", U8500_CLKRST3_BASE, 355 + clk = clk_reg_prcc_pclk("p3_pclk7", "per3clk", clkrst3_base, 356 356 BIT(7), 0); 357 357 clk_register_clkdev(clk, "apb_pclk", "sdi5"); 358 358 359 - clk = clk_reg_prcc_pclk("p3_pclk8", "per3clk", U8500_CLKRST3_BASE, 359 + clk = clk_reg_prcc_pclk("p3_pclk8", "per3clk", clkrst3_base, 360 360 BIT(8), 0); 361 361 clk_register_clkdev(clk, NULL, "gpio.2"); 362 362 clk_register_clkdev(clk, NULL, "gpio.3"); ··· 364 364 clk_register_clkdev(clk, NULL, "gpio.5"); 365 365 clk_register_clkdev(clk, NULL, "gpioblock2"); 366 366 367 - clk = clk_reg_prcc_pclk("p5_pclk0", "per5clk", U8500_CLKRST5_BASE, 367 + clk = clk_reg_prcc_pclk("p5_pclk0", "per5clk", clkrst5_base, 368 368 BIT(0), 0); 369 369 clk_register_clkdev(clk, "usb", "musb-ux500.0"); 370 370 371 - clk = clk_reg_prcc_pclk("p5_pclk1", "per5clk", U8500_CLKRST5_BASE, 371 + clk = clk_reg_prcc_pclk("p5_pclk1", "per5clk", clkrst5_base, 372 372 BIT(1), 0); 373 373 clk_register_clkdev(clk, NULL, "gpio.8"); 374 374 clk_register_clkdev(clk, NULL, "gpioblock3"); 375 375 376 - clk = clk_reg_prcc_pclk("p6_pclk0", "per6clk", U8500_CLKRST6_BASE, 376 + clk = clk_reg_prcc_pclk("p6_pclk0", "per6clk", clkrst6_base, 377 377 BIT(0), 0); 378 378 clk_register_clkdev(clk, "apb_pclk", "rng"); 379 379 380 - clk = clk_reg_prcc_pclk("p6_pclk1", "per6clk", U8500_CLKRST6_BASE, 380 + clk = clk_reg_prcc_pclk("p6_pclk1", "per6clk", clkrst6_base, 381 381 BIT(1), 0); 382 382 clk_register_clkdev(clk, NULL, "cryp0"); 383 383 clk_register_clkdev(clk, NULL, "cryp1"); 384 384 385 - clk = clk_reg_prcc_pclk("p6_pclk2", "per6clk", U8500_CLKRST6_BASE, 385 + clk = clk_reg_prcc_pclk("p6_pclk2", "per6clk", clkrst6_base, 386 386 BIT(2), 0); 387 387 clk_register_clkdev(clk, NULL, "hash0"); 388 388 389 - clk = clk_reg_prcc_pclk("p6_pclk3", "per6clk", U8500_CLKRST6_BASE, 389 + clk = clk_reg_prcc_pclk("p6_pclk3", "per6clk", clkrst6_base, 390 390 BIT(3), 0); 391 391 clk_register_clkdev(clk, NULL, "pka"); 392 392 393 - clk = clk_reg_prcc_pclk("p6_pclk4", "per6clk", U8500_CLKRST6_BASE, 393 + clk = clk_reg_prcc_pclk("p6_pclk4", "per6clk", clkrst6_base, 394 394 BIT(4), 0); 395 395 clk_register_clkdev(clk, NULL, "hash1"); 396 396 397 - clk = clk_reg_prcc_pclk("p6_pclk5", "per6clk", U8500_CLKRST6_BASE, 397 + clk = clk_reg_prcc_pclk("p6_pclk5", "per6clk", clkrst6_base, 398 398 BIT(5), 0); 399 399 clk_register_clkdev(clk, NULL, "cfgreg"); 400 400 401 - clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", U8500_CLKRST6_BASE, 401 + clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", clkrst6_base, 402 402 BIT(6), 0); 403 403 clk_register_clkdev(clk, "apb_pclk", "mtu0"); 404 404 405 - clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", U8500_CLKRST6_BASE, 405 + clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", clkrst6_base, 406 406 BIT(7), 0); 407 407 clk_register_clkdev(clk, "apb_pclk", "mtu1"); 408 408 ··· 416 416 417 417 /* Periph1 */ 418 418 clk = clk_reg_prcc_kclk("p1_uart0_kclk", "uartclk", 419 - U8500_CLKRST1_BASE, BIT(0), CLK_SET_RATE_GATE); 419 + clkrst1_base, BIT(0), CLK_SET_RATE_GATE); 420 420 clk_register_clkdev(clk, NULL, "uart0"); 421 421 422 422 clk = clk_reg_prcc_kclk("p1_uart1_kclk", "uartclk", 423 - U8500_CLKRST1_BASE, BIT(1), CLK_SET_RATE_GATE); 423 + clkrst1_base, BIT(1), CLK_SET_RATE_GATE); 424 424 clk_register_clkdev(clk, NULL, "uart1"); 425 425 426 426 clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk", 427 - U8500_CLKRST1_BASE, BIT(2), CLK_SET_RATE_GATE); 427 + clkrst1_base, BIT(2), CLK_SET_RATE_GATE); 428 428 clk_register_clkdev(clk, NULL, "nmk-i2c.1"); 429 429 430 430 clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk", 431 - U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE); 431 + clkrst1_base, BIT(3), CLK_SET_RATE_GATE); 432 432 clk_register_clkdev(clk, NULL, "msp0"); 433 433 clk_register_clkdev(clk, NULL, "ux500-msp-i2s.0"); 434 434 435 435 clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk", 436 - U8500_CLKRST1_BASE, BIT(4), CLK_SET_RATE_GATE); 436 + clkrst1_base, BIT(4), CLK_SET_RATE_GATE); 437 437 clk_register_clkdev(clk, NULL, "msp1"); 438 438 clk_register_clkdev(clk, NULL, "ux500-msp-i2s.1"); 439 439 440 440 clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmcclk", 441 - U8500_CLKRST1_BASE, BIT(5), CLK_SET_RATE_GATE); 441 + clkrst1_base, BIT(5), CLK_SET_RATE_GATE); 442 442 clk_register_clkdev(clk, NULL, "sdi0"); 443 443 444 444 clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk", 445 - U8500_CLKRST1_BASE, BIT(6), CLK_SET_RATE_GATE); 445 + clkrst1_base, BIT(6), CLK_SET_RATE_GATE); 446 446 clk_register_clkdev(clk, NULL, "nmk-i2c.2"); 447 447 448 448 clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk", 449 - U8500_CLKRST1_BASE, BIT(8), CLK_SET_RATE_GATE); 449 + clkrst1_base, BIT(8), CLK_SET_RATE_GATE); 450 450 clk_register_clkdev(clk, NULL, "slimbus0"); 451 451 452 452 clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk", 453 - U8500_CLKRST1_BASE, BIT(9), CLK_SET_RATE_GATE); 453 + clkrst1_base, BIT(9), CLK_SET_RATE_GATE); 454 454 clk_register_clkdev(clk, NULL, "nmk-i2c.4"); 455 455 456 456 clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk", 457 - U8500_CLKRST1_BASE, BIT(10), CLK_SET_RATE_GATE); 457 + clkrst1_base, BIT(10), CLK_SET_RATE_GATE); 458 458 clk_register_clkdev(clk, NULL, "msp3"); 459 459 clk_register_clkdev(clk, NULL, "ux500-msp-i2s.3"); 460 460 461 461 /* Periph2 */ 462 462 clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk", 463 - U8500_CLKRST2_BASE, BIT(0), CLK_SET_RATE_GATE); 463 + clkrst2_base, BIT(0), CLK_SET_RATE_GATE); 464 464 clk_register_clkdev(clk, NULL, "nmk-i2c.3"); 465 465 466 466 clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk", 467 - U8500_CLKRST2_BASE, BIT(2), CLK_SET_RATE_GATE); 467 + clkrst2_base, BIT(2), CLK_SET_RATE_GATE); 468 468 clk_register_clkdev(clk, NULL, "sdi4"); 469 469 470 470 clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk", 471 - U8500_CLKRST2_BASE, BIT(3), CLK_SET_RATE_GATE); 471 + clkrst2_base, BIT(3), CLK_SET_RATE_GATE); 472 472 clk_register_clkdev(clk, NULL, "msp2"); 473 473 clk_register_clkdev(clk, NULL, "ux500-msp-i2s.2"); 474 474 475 475 clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmcclk", 476 - U8500_CLKRST2_BASE, BIT(4), CLK_SET_RATE_GATE); 476 + clkrst2_base, BIT(4), CLK_SET_RATE_GATE); 477 477 clk_register_clkdev(clk, NULL, "sdi1"); 478 478 479 479 clk = clk_reg_prcc_kclk("p2_sdi3_kclk", "sdmmcclk", 480 - U8500_CLKRST2_BASE, BIT(5), CLK_SET_RATE_GATE); 480 + clkrst2_base, BIT(5), CLK_SET_RATE_GATE); 481 481 clk_register_clkdev(clk, NULL, "sdi3"); 482 482 483 483 /* Note that rate is received from parent. */ 484 484 clk = clk_reg_prcc_kclk("p2_ssirx_kclk", "hsirxclk", 485 - U8500_CLKRST2_BASE, BIT(6), 485 + clkrst2_base, BIT(6), 486 486 CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT); 487 487 clk = clk_reg_prcc_kclk("p2_ssitx_kclk", "hsitxclk", 488 - U8500_CLKRST2_BASE, BIT(7), 488 + clkrst2_base, BIT(7), 489 489 CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT); 490 490 491 491 /* Periph3 */ 492 492 clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk", 493 - U8500_CLKRST3_BASE, BIT(1), CLK_SET_RATE_GATE); 493 + clkrst3_base, BIT(1), CLK_SET_RATE_GATE); 494 494 clk_register_clkdev(clk, NULL, "ssp0"); 495 495 496 496 clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk", 497 - U8500_CLKRST3_BASE, BIT(2), CLK_SET_RATE_GATE); 497 + clkrst3_base, BIT(2), CLK_SET_RATE_GATE); 498 498 clk_register_clkdev(clk, NULL, "ssp1"); 499 499 500 500 clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk", 501 - U8500_CLKRST3_BASE, BIT(3), CLK_SET_RATE_GATE); 501 + clkrst3_base, BIT(3), CLK_SET_RATE_GATE); 502 502 clk_register_clkdev(clk, NULL, "nmk-i2c.0"); 503 503 504 504 clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk", 505 - U8500_CLKRST3_BASE, BIT(4), CLK_SET_RATE_GATE); 505 + clkrst3_base, BIT(4), CLK_SET_RATE_GATE); 506 506 clk_register_clkdev(clk, NULL, "sdi2"); 507 507 508 508 clk = clk_reg_prcc_kclk("p3_ske_kclk", "rtc32k", 509 - U8500_CLKRST3_BASE, BIT(5), CLK_SET_RATE_GATE); 509 + clkrst3_base, BIT(5), CLK_SET_RATE_GATE); 510 510 clk_register_clkdev(clk, NULL, "ske"); 511 511 clk_register_clkdev(clk, NULL, "nmk-ske-keypad"); 512 512 513 513 clk = clk_reg_prcc_kclk("p3_uart2_kclk", "uartclk", 514 - U8500_CLKRST3_BASE, BIT(6), CLK_SET_RATE_GATE); 514 + clkrst3_base, BIT(6), CLK_SET_RATE_GATE); 515 515 clk_register_clkdev(clk, NULL, "uart2"); 516 516 517 517 clk = clk_reg_prcc_kclk("p3_sdi5_kclk", "sdmmcclk", 518 - U8500_CLKRST3_BASE, BIT(7), CLK_SET_RATE_GATE); 518 + clkrst3_base, BIT(7), CLK_SET_RATE_GATE); 519 519 clk_register_clkdev(clk, NULL, "sdi5"); 520 520 521 521 /* Periph6 */ 522 522 clk = clk_reg_prcc_kclk("p3_rng_kclk", "rngclk", 523 - U8500_CLKRST6_BASE, BIT(0), CLK_SET_RATE_GATE); 523 + clkrst6_base, BIT(0), CLK_SET_RATE_GATE); 524 524 clk_register_clkdev(clk, NULL, "rng"); 525 525 }
+2
drivers/clocksource/Makefile
··· 16 16 obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o 17 17 obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o 18 18 obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o 19 + obj-$(CONFIG_ARCH_MARCO) += timer-marco.o 19 20 obj-$(CONFIG_ARCH_MXS) += mxs_timer.o 21 + obj-$(CONFIG_ARCH_PRIMA2) += timer-prima2.o 20 22 obj-$(CONFIG_SUN4I_TIMER) += sun4i_timer.o 21 23 obj-$(CONFIG_ARCH_TEGRA) += tegra20_timer.o 22 24 obj-$(CONFIG_VT8500_TIMER) += vt8500_timer.o
-3
drivers/clocksource/clksrc-dbx500-prcmu.c
··· 17 17 18 18 #include <asm/sched_clock.h> 19 19 20 - #include <mach/setup.h> 21 - #include <mach/hardware.h> 22 - 23 20 #define RATE_32K 32768 24 21 25 22 #define TIMER_MODE_CONTINOUS 0x1
+2 -2
drivers/clocksource/nomadik-mtu.c
··· 67 67 static u32 nmdk_cycle; /* write-once */ 68 68 static struct delay_timer mtu_delay_timer; 69 69 70 - #ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK 70 + #ifdef CONFIG_CLKSRC_NOMADIK_MTU_SCHED_CLOCK 71 71 /* 72 72 * Override the global weak sched_clock symbol with this 73 73 * local implementation which uses the clocksource to get some ··· 233 233 pr_err("timer: failed to initialize clock source %s\n", 234 234 "mtu_0"); 235 235 236 - #ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK 236 + #ifdef CONFIG_CLKSRC_NOMADIK_MTU_SCHED_CLOCK 237 237 setup_sched_clock(nomadik_read_sched_clock, 32, rate); 238 238 #endif 239 239
+299
drivers/clocksource/timer-marco.c
··· 1 + /* 2 + * System timer for CSR SiRFprimaII 3 + * 4 + * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 + * 6 + * Licensed under GPLv2 or later. 7 + */ 8 + 9 + #include <linux/kernel.h> 10 + #include <linux/interrupt.h> 11 + #include <linux/clockchips.h> 12 + #include <linux/clocksource.h> 13 + #include <linux/bitops.h> 14 + #include <linux/irq.h> 15 + #include <linux/clk.h> 16 + #include <linux/slab.h> 17 + #include <linux/of.h> 18 + #include <linux/of_irq.h> 19 + #include <linux/of_address.h> 20 + #include <asm/sched_clock.h> 21 + #include <asm/localtimer.h> 22 + #include <asm/mach/time.h> 23 + 24 + #define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000 25 + #define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004 26 + #define SIRFSOC_TIMER_MATCH_0 0x0018 27 + #define SIRFSOC_TIMER_MATCH_1 0x001c 28 + #define SIRFSOC_TIMER_COUNTER_0 0x0048 29 + #define SIRFSOC_TIMER_COUNTER_1 0x004c 30 + #define SIRFSOC_TIMER_INTR_STATUS 0x0060 31 + #define SIRFSOC_TIMER_WATCHDOG_EN 0x0064 32 + #define SIRFSOC_TIMER_64COUNTER_CTRL 0x0068 33 + #define SIRFSOC_TIMER_64COUNTER_LO 0x006c 34 + #define SIRFSOC_TIMER_64COUNTER_HI 0x0070 35 + #define SIRFSOC_TIMER_64COUNTER_LOAD_LO 0x0074 36 + #define SIRFSOC_TIMER_64COUNTER_LOAD_HI 0x0078 37 + #define SIRFSOC_TIMER_64COUNTER_RLATCHED_LO 0x007c 38 + #define SIRFSOC_TIMER_64COUNTER_RLATCHED_HI 0x0080 39 + 40 + #define SIRFSOC_TIMER_REG_CNT 6 41 + 42 + static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = { 43 + SIRFSOC_TIMER_WATCHDOG_EN, 44 + SIRFSOC_TIMER_32COUNTER_0_CTRL, 45 + SIRFSOC_TIMER_32COUNTER_1_CTRL, 46 + SIRFSOC_TIMER_64COUNTER_CTRL, 47 + SIRFSOC_TIMER_64COUNTER_RLATCHED_LO, 48 + SIRFSOC_TIMER_64COUNTER_RLATCHED_HI, 49 + }; 50 + 51 + static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT]; 52 + 53 + static void __iomem *sirfsoc_timer_base; 54 + 55 + /* disable count and interrupt */ 56 + static inline void sirfsoc_timer_count_disable(int idx) 57 + { 58 + writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) & ~0x7, 59 + sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx); 60 + } 61 + 62 + /* enable count and interrupt */ 63 + static inline void sirfsoc_timer_count_enable(int idx) 64 + { 65 + writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) | 0x7, 66 + sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx); 67 + } 68 + 69 + /* timer interrupt handler */ 70 + static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id) 71 + { 72 + struct clock_event_device *ce = dev_id; 73 + int cpu = smp_processor_id(); 74 + 75 + /* clear timer interrupt */ 76 + writel_relaxed(BIT(cpu), sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); 77 + 78 + if (ce->mode == CLOCK_EVT_MODE_ONESHOT) 79 + sirfsoc_timer_count_disable(cpu); 80 + 81 + ce->event_handler(ce); 82 + 83 + return IRQ_HANDLED; 84 + } 85 + 86 + /* read 64-bit timer counter */ 87 + static cycle_t sirfsoc_timer_read(struct clocksource *cs) 88 + { 89 + u64 cycles; 90 + 91 + writel_relaxed((readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | 92 + BIT(0)) & ~BIT(1), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 93 + 94 + cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_HI); 95 + cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_LO); 96 + 97 + return cycles; 98 + } 99 + 100 + static int sirfsoc_timer_set_next_event(unsigned long delta, 101 + struct clock_event_device *ce) 102 + { 103 + int cpu = smp_processor_id(); 104 + 105 + writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0 + 106 + 4 * cpu); 107 + writel_relaxed(delta, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0 + 108 + 4 * cpu); 109 + 110 + /* enable the tick */ 111 + sirfsoc_timer_count_enable(cpu); 112 + 113 + return 0; 114 + } 115 + 116 + static void sirfsoc_timer_set_mode(enum clock_event_mode mode, 117 + struct clock_event_device *ce) 118 + { 119 + switch (mode) { 120 + case CLOCK_EVT_MODE_ONESHOT: 121 + /* enable in set_next_event */ 122 + break; 123 + default: 124 + break; 125 + } 126 + 127 + sirfsoc_timer_count_disable(smp_processor_id()); 128 + } 129 + 130 + static void sirfsoc_clocksource_suspend(struct clocksource *cs) 131 + { 132 + int i; 133 + 134 + for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++) 135 + sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); 136 + } 137 + 138 + static void sirfsoc_clocksource_resume(struct clocksource *cs) 139 + { 140 + int i; 141 + 142 + for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++) 143 + writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); 144 + 145 + writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2], 146 + sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO); 147 + writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1], 148 + sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI); 149 + 150 + writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | 151 + BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 152 + } 153 + 154 + static struct clock_event_device sirfsoc_clockevent = { 155 + .name = "sirfsoc_clockevent", 156 + .rating = 200, 157 + .features = CLOCK_EVT_FEAT_ONESHOT, 158 + .set_mode = sirfsoc_timer_set_mode, 159 + .set_next_event = sirfsoc_timer_set_next_event, 160 + }; 161 + 162 + static struct clocksource sirfsoc_clocksource = { 163 + .name = "sirfsoc_clocksource", 164 + .rating = 200, 165 + .mask = CLOCKSOURCE_MASK(64), 166 + .flags = CLOCK_SOURCE_IS_CONTINUOUS, 167 + .read = sirfsoc_timer_read, 168 + .suspend = sirfsoc_clocksource_suspend, 169 + .resume = sirfsoc_clocksource_resume, 170 + }; 171 + 172 + static struct irqaction sirfsoc_timer_irq = { 173 + .name = "sirfsoc_timer0", 174 + .flags = IRQF_TIMER | IRQF_NOBALANCING, 175 + .handler = sirfsoc_timer_interrupt, 176 + .dev_id = &sirfsoc_clockevent, 177 + }; 178 + 179 + #ifdef CONFIG_LOCAL_TIMERS 180 + 181 + static struct irqaction sirfsoc_timer1_irq = { 182 + .name = "sirfsoc_timer1", 183 + .flags = IRQF_TIMER | IRQF_NOBALANCING, 184 + .handler = sirfsoc_timer_interrupt, 185 + }; 186 + 187 + static int __cpuinit sirfsoc_local_timer_setup(struct clock_event_device *ce) 188 + { 189 + /* Use existing clock_event for cpu 0 */ 190 + if (!smp_processor_id()) 191 + return 0; 192 + 193 + ce->irq = sirfsoc_timer1_irq.irq; 194 + ce->name = "local_timer"; 195 + ce->features = sirfsoc_clockevent.features; 196 + ce->rating = sirfsoc_clockevent.rating; 197 + ce->set_mode = sirfsoc_timer_set_mode; 198 + ce->set_next_event = sirfsoc_timer_set_next_event; 199 + ce->shift = sirfsoc_clockevent.shift; 200 + ce->mult = sirfsoc_clockevent.mult; 201 + ce->max_delta_ns = sirfsoc_clockevent.max_delta_ns; 202 + ce->min_delta_ns = sirfsoc_clockevent.min_delta_ns; 203 + 204 + sirfsoc_timer1_irq.dev_id = ce; 205 + BUG_ON(setup_irq(ce->irq, &sirfsoc_timer1_irq)); 206 + irq_set_affinity(sirfsoc_timer1_irq.irq, cpumask_of(1)); 207 + 208 + clockevents_register_device(ce); 209 + return 0; 210 + } 211 + 212 + static void sirfsoc_local_timer_stop(struct clock_event_device *ce) 213 + { 214 + sirfsoc_timer_count_disable(1); 215 + 216 + remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq); 217 + } 218 + 219 + static struct local_timer_ops sirfsoc_local_timer_ops __cpuinitdata = { 220 + .setup = sirfsoc_local_timer_setup, 221 + .stop = sirfsoc_local_timer_stop, 222 + }; 223 + #endif /* CONFIG_LOCAL_TIMERS */ 224 + 225 + static void __init sirfsoc_clockevent_init(void) 226 + { 227 + clockevents_calc_mult_shift(&sirfsoc_clockevent, CLOCK_TICK_RATE, 60); 228 + 229 + sirfsoc_clockevent.max_delta_ns = 230 + clockevent_delta2ns(-2, &sirfsoc_clockevent); 231 + sirfsoc_clockevent.min_delta_ns = 232 + clockevent_delta2ns(2, &sirfsoc_clockevent); 233 + 234 + sirfsoc_clockevent.cpumask = cpumask_of(0); 235 + clockevents_register_device(&sirfsoc_clockevent); 236 + #ifdef CONFIG_LOCAL_TIMERS 237 + local_timer_register(&sirfsoc_local_timer_ops); 238 + #endif 239 + } 240 + 241 + /* initialize the kernel jiffy timer source */ 242 + static void __init sirfsoc_marco_timer_init(void) 243 + { 244 + unsigned long rate; 245 + u32 timer_div; 246 + struct clk *clk; 247 + 248 + /* timer's input clock is io clock */ 249 + clk = clk_get_sys("io", NULL); 250 + 251 + BUG_ON(IS_ERR(clk)); 252 + rate = clk_get_rate(clk); 253 + 254 + BUG_ON(rate < CLOCK_TICK_RATE); 255 + BUG_ON(rate % CLOCK_TICK_RATE); 256 + 257 + /* Initialize the timer dividers */ 258 + timer_div = rate / CLOCK_TICK_RATE - 1; 259 + writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 260 + writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL); 261 + writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL); 262 + 263 + /* Initialize timer counters to 0 */ 264 + writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO); 265 + writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI); 266 + writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) | 267 + BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 268 + writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0); 269 + writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_1); 270 + 271 + /* Clear all interrupts */ 272 + writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); 273 + 274 + BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); 275 + 276 + BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq)); 277 + 278 + sirfsoc_clockevent_init(); 279 + } 280 + 281 + static void __init sirfsoc_of_timer_init(struct device_node *np) 282 + { 283 + sirfsoc_timer_base = of_iomap(np, 0); 284 + if (!sirfsoc_timer_base) 285 + panic("unable to map timer cpu registers\n"); 286 + 287 + sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0); 288 + if (!sirfsoc_timer_irq.irq) 289 + panic("No irq passed for timer0 via DT\n"); 290 + 291 + #ifdef CONFIG_LOCAL_TIMERS 292 + sirfsoc_timer1_irq.irq = irq_of_parse_and_map(np, 1); 293 + if (!sirfsoc_timer1_irq.irq) 294 + panic("No irq passed for timer1 via DT\n"); 295 + #endif 296 + 297 + sirfsoc_marco_timer_init(); 298 + } 299 + CLOCKSOURCE_OF_DECLARE(sirfsoc_marco_timer, "sirf,marco-tick", sirfsoc_of_timer_init );
+215
drivers/clocksource/timer-prima2.c
··· 1 + /* 2 + * System timer for CSR SiRFprimaII 3 + * 4 + * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 + * 6 + * Licensed under GPLv2 or later. 7 + */ 8 + 9 + #include <linux/kernel.h> 10 + #include <linux/interrupt.h> 11 + #include <linux/clockchips.h> 12 + #include <linux/clocksource.h> 13 + #include <linux/bitops.h> 14 + #include <linux/irq.h> 15 + #include <linux/clk.h> 16 + #include <linux/err.h> 17 + #include <linux/slab.h> 18 + #include <linux/of.h> 19 + #include <linux/of_irq.h> 20 + #include <linux/of_address.h> 21 + #include <asm/sched_clock.h> 22 + #include <asm/mach/time.h> 23 + 24 + #define SIRFSOC_TIMER_COUNTER_LO 0x0000 25 + #define SIRFSOC_TIMER_COUNTER_HI 0x0004 26 + #define SIRFSOC_TIMER_MATCH_0 0x0008 27 + #define SIRFSOC_TIMER_MATCH_1 0x000C 28 + #define SIRFSOC_TIMER_MATCH_2 0x0010 29 + #define SIRFSOC_TIMER_MATCH_3 0x0014 30 + #define SIRFSOC_TIMER_MATCH_4 0x0018 31 + #define SIRFSOC_TIMER_MATCH_5 0x001C 32 + #define SIRFSOC_TIMER_STATUS 0x0020 33 + #define SIRFSOC_TIMER_INT_EN 0x0024 34 + #define SIRFSOC_TIMER_WATCHDOG_EN 0x0028 35 + #define SIRFSOC_TIMER_DIV 0x002C 36 + #define SIRFSOC_TIMER_LATCH 0x0030 37 + #define SIRFSOC_TIMER_LATCHED_LO 0x0034 38 + #define SIRFSOC_TIMER_LATCHED_HI 0x0038 39 + 40 + #define SIRFSOC_TIMER_WDT_INDEX 5 41 + 42 + #define SIRFSOC_TIMER_LATCH_BIT BIT(0) 43 + 44 + #define SIRFSOC_TIMER_REG_CNT 11 45 + 46 + static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = { 47 + SIRFSOC_TIMER_MATCH_0, SIRFSOC_TIMER_MATCH_1, SIRFSOC_TIMER_MATCH_2, 48 + SIRFSOC_TIMER_MATCH_3, SIRFSOC_TIMER_MATCH_4, SIRFSOC_TIMER_MATCH_5, 49 + SIRFSOC_TIMER_INT_EN, SIRFSOC_TIMER_WATCHDOG_EN, SIRFSOC_TIMER_DIV, 50 + SIRFSOC_TIMER_LATCHED_LO, SIRFSOC_TIMER_LATCHED_HI, 51 + }; 52 + 53 + static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT]; 54 + 55 + static void __iomem *sirfsoc_timer_base; 56 + 57 + /* timer0 interrupt handler */ 58 + static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id) 59 + { 60 + struct clock_event_device *ce = dev_id; 61 + 62 + WARN_ON(!(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_STATUS) & BIT(0))); 63 + 64 + /* clear timer0 interrupt */ 65 + writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS); 66 + 67 + ce->event_handler(ce); 68 + 69 + return IRQ_HANDLED; 70 + } 71 + 72 + /* read 64-bit timer counter */ 73 + static cycle_t sirfsoc_timer_read(struct clocksource *cs) 74 + { 75 + u64 cycles; 76 + 77 + /* latch the 64-bit timer counter */ 78 + writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH); 79 + cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_HI); 80 + cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO); 81 + 82 + return cycles; 83 + } 84 + 85 + static int sirfsoc_timer_set_next_event(unsigned long delta, 86 + struct clock_event_device *ce) 87 + { 88 + unsigned long now, next; 89 + 90 + writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH); 91 + now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO); 92 + next = now + delta; 93 + writel_relaxed(next, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0); 94 + writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH); 95 + now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO); 96 + 97 + return next - now > delta ? -ETIME : 0; 98 + } 99 + 100 + static void sirfsoc_timer_set_mode(enum clock_event_mode mode, 101 + struct clock_event_device *ce) 102 + { 103 + u32 val = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN); 104 + switch (mode) { 105 + case CLOCK_EVT_MODE_PERIODIC: 106 + WARN_ON(1); 107 + break; 108 + case CLOCK_EVT_MODE_ONESHOT: 109 + writel_relaxed(val | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN); 110 + break; 111 + case CLOCK_EVT_MODE_SHUTDOWN: 112 + writel_relaxed(val & ~BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN); 113 + break; 114 + case CLOCK_EVT_MODE_UNUSED: 115 + case CLOCK_EVT_MODE_RESUME: 116 + break; 117 + } 118 + } 119 + 120 + static void sirfsoc_clocksource_suspend(struct clocksource *cs) 121 + { 122 + int i; 123 + 124 + writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH); 125 + 126 + for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++) 127 + sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); 128 + } 129 + 130 + static void sirfsoc_clocksource_resume(struct clocksource *cs) 131 + { 132 + int i; 133 + 134 + for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++) 135 + writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]); 136 + 137 + writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO); 138 + writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI); 139 + } 140 + 141 + static struct clock_event_device sirfsoc_clockevent = { 142 + .name = "sirfsoc_clockevent", 143 + .rating = 200, 144 + .features = CLOCK_EVT_FEAT_ONESHOT, 145 + .set_mode = sirfsoc_timer_set_mode, 146 + .set_next_event = sirfsoc_timer_set_next_event, 147 + }; 148 + 149 + static struct clocksource sirfsoc_clocksource = { 150 + .name = "sirfsoc_clocksource", 151 + .rating = 200, 152 + .mask = CLOCKSOURCE_MASK(64), 153 + .flags = CLOCK_SOURCE_IS_CONTINUOUS, 154 + .read = sirfsoc_timer_read, 155 + .suspend = sirfsoc_clocksource_suspend, 156 + .resume = sirfsoc_clocksource_resume, 157 + }; 158 + 159 + static struct irqaction sirfsoc_timer_irq = { 160 + .name = "sirfsoc_timer0", 161 + .flags = IRQF_TIMER, 162 + .irq = 0, 163 + .handler = sirfsoc_timer_interrupt, 164 + .dev_id = &sirfsoc_clockevent, 165 + }; 166 + 167 + /* Overwrite weak default sched_clock with more precise one */ 168 + static u32 notrace sirfsoc_read_sched_clock(void) 169 + { 170 + return (u32)(sirfsoc_timer_read(NULL) & 0xffffffff); 171 + } 172 + 173 + static void __init sirfsoc_clockevent_init(void) 174 + { 175 + sirfsoc_clockevent.cpumask = cpumask_of(0); 176 + clockevents_config_and_register(&sirfsoc_clockevent, CLOCK_TICK_RATE, 177 + 2, -2); 178 + } 179 + 180 + /* initialize the kernel jiffy timer source */ 181 + static void __init sirfsoc_prima2_timer_init(struct device_node *np) 182 + { 183 + unsigned long rate; 184 + struct clk *clk; 185 + 186 + /* timer's input clock is io clock */ 187 + clk = clk_get_sys("io", NULL); 188 + 189 + BUG_ON(IS_ERR(clk)); 190 + 191 + rate = clk_get_rate(clk); 192 + 193 + BUG_ON(rate < CLOCK_TICK_RATE); 194 + BUG_ON(rate % CLOCK_TICK_RATE); 195 + 196 + sirfsoc_timer_base = of_iomap(np, 0); 197 + if (!sirfsoc_timer_base) 198 + panic("unable to map timer cpu registers\n"); 199 + 200 + sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0); 201 + 202 + writel_relaxed(rate / CLOCK_TICK_RATE / 2 - 1, sirfsoc_timer_base + SIRFSOC_TIMER_DIV); 203 + writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO); 204 + writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI); 205 + writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS); 206 + 207 + BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); 208 + 209 + setup_sched_clock(sirfsoc_read_sched_clock, 32, CLOCK_TICK_RATE); 210 + 211 + BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq)); 212 + 213 + sirfsoc_clockevent_init(); 214 + } 215 + CLOCKSOURCE_OF_DECLARE(sirfsoc_prima2_timer, "sirf,prima2-tick", sirfsoc_prima2_timer_init);
-2
drivers/crypto/ux500/cryp/cryp.c
··· 12 12 #include <linux/kernel.h> 13 13 #include <linux/types.h> 14 14 15 - #include <mach/hardware.h> 16 - 17 15 #include "cryp_p.h" 18 16 #include "cryp.h" 19 17
-1
drivers/crypto/ux500/cryp/cryp_core.c
··· 32 32 #include <crypto/scatterwalk.h> 33 33 34 34 #include <linux/platform_data/crypto-ux500.h> 35 - #include <mach/hardware.h> 36 35 37 36 #include "cryp_p.h" 38 37 #include "cryp.h"
-1
drivers/crypto/ux500/hash/hash_core.c
··· 32 32 #include <crypto/algapi.h> 33 33 34 34 #include <linux/platform_data/crypto-ux500.h> 35 - #include <mach/hardware.h> 36 35 37 36 #include "hash_alg.h" 38 37
+1
drivers/irqchip/Makefile
··· 9 9 obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o 10 10 obj-$(CONFIG_ARM_GIC) += irq-gic.o 11 11 obj-$(CONFIG_ARM_VIC) += irq-vic.o 12 + obj-$(CONFIG_SIRF_IRQ) += irq-sirfsoc.o 12 13 obj-$(CONFIG_VERSATILE_FPGA_IRQ) += irq-versatile-fpga.o
+126
drivers/irqchip/irq-sirfsoc.c
··· 1 + /* 2 + * interrupt controller support for CSR SiRFprimaII 3 + * 4 + * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. 5 + * 6 + * Licensed under GPLv2 or later. 7 + */ 8 + 9 + #include <linux/init.h> 10 + #include <linux/io.h> 11 + #include <linux/irq.h> 12 + #include <linux/of.h> 13 + #include <linux/of_address.h> 14 + #include <linux/irqdomain.h> 15 + #include <linux/syscore_ops.h> 16 + #include <asm/mach/irq.h> 17 + #include <asm/exception.h> 18 + #include "irqchip.h" 19 + 20 + #define SIRFSOC_INT_RISC_MASK0 0x0018 21 + #define SIRFSOC_INT_RISC_MASK1 0x001C 22 + #define SIRFSOC_INT_RISC_LEVEL0 0x0020 23 + #define SIRFSOC_INT_RISC_LEVEL1 0x0024 24 + #define SIRFSOC_INIT_IRQ_ID 0x0038 25 + 26 + #define SIRFSOC_NUM_IRQS 128 27 + 28 + static struct irq_domain *sirfsoc_irqdomain; 29 + 30 + static __init void 31 + sirfsoc_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) 32 + { 33 + struct irq_chip_generic *gc; 34 + struct irq_chip_type *ct; 35 + 36 + gc = irq_alloc_generic_chip("SIRFINTC", 1, irq_start, base, handle_level_irq); 37 + ct = gc->chip_types; 38 + 39 + ct->chip.irq_mask = irq_gc_mask_clr_bit; 40 + ct->chip.irq_unmask = irq_gc_mask_set_bit; 41 + ct->regs.mask = SIRFSOC_INT_RISC_MASK0; 42 + 43 + irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST, 0); 44 + } 45 + 46 + static asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs) 47 + { 48 + void __iomem *base = sirfsoc_irqdomain->host_data; 49 + u32 irqstat, irqnr; 50 + 51 + irqstat = readl_relaxed(base + SIRFSOC_INIT_IRQ_ID); 52 + irqnr = irq_find_mapping(sirfsoc_irqdomain, irqstat & 0xff); 53 + 54 + handle_IRQ(irqnr, regs); 55 + } 56 + 57 + static int __init sirfsoc_irq_init(struct device_node *np, struct device_node *parent) 58 + { 59 + void __iomem *base = of_iomap(np, 0); 60 + if (!base) 61 + panic("unable to map intc cpu registers\n"); 62 + 63 + /* using legacy because irqchip_generic does not work with linear */ 64 + sirfsoc_irqdomain = irq_domain_add_legacy(np, SIRFSOC_NUM_IRQS, 0, 0, 65 + &irq_domain_simple_ops, base); 66 + 67 + sirfsoc_alloc_gc(base, 0, 32); 68 + sirfsoc_alloc_gc(base + 4, 32, SIRFSOC_NUM_IRQS - 32); 69 + 70 + writel_relaxed(0, base + SIRFSOC_INT_RISC_LEVEL0); 71 + writel_relaxed(0, base + SIRFSOC_INT_RISC_LEVEL1); 72 + 73 + writel_relaxed(0, base + SIRFSOC_INT_RISC_MASK0); 74 + writel_relaxed(0, base + SIRFSOC_INT_RISC_MASK1); 75 + 76 + set_handle_irq(sirfsoc_handle_irq); 77 + 78 + return 0; 79 + } 80 + IRQCHIP_DECLARE(sirfsoc_intc, "sirf,prima2-intc", sirfsoc_irq_init); 81 + 82 + struct sirfsoc_irq_status { 83 + u32 mask0; 84 + u32 mask1; 85 + u32 level0; 86 + u32 level1; 87 + }; 88 + 89 + static struct sirfsoc_irq_status sirfsoc_irq_st; 90 + 91 + static int sirfsoc_irq_suspend(void) 92 + { 93 + void __iomem *base = sirfsoc_irqdomain->host_data; 94 + 95 + sirfsoc_irq_st.mask0 = readl_relaxed(base + SIRFSOC_INT_RISC_MASK0); 96 + sirfsoc_irq_st.mask1 = readl_relaxed(base + SIRFSOC_INT_RISC_MASK1); 97 + sirfsoc_irq_st.level0 = readl_relaxed(base + SIRFSOC_INT_RISC_LEVEL0); 98 + sirfsoc_irq_st.level1 = readl_relaxed(base + SIRFSOC_INT_RISC_LEVEL1); 99 + 100 + return 0; 101 + } 102 + 103 + static void sirfsoc_irq_resume(void) 104 + { 105 + void __iomem *base = sirfsoc_irqdomain->host_data; 106 + 107 + writel_relaxed(sirfsoc_irq_st.mask0, base + SIRFSOC_INT_RISC_MASK0); 108 + writel_relaxed(sirfsoc_irq_st.mask1, base + SIRFSOC_INT_RISC_MASK1); 109 + writel_relaxed(sirfsoc_irq_st.level0, base + SIRFSOC_INT_RISC_LEVEL0); 110 + writel_relaxed(sirfsoc_irq_st.level1, base + SIRFSOC_INT_RISC_LEVEL1); 111 + } 112 + 113 + static struct syscore_ops sirfsoc_irq_syscore_ops = { 114 + .suspend = sirfsoc_irq_suspend, 115 + .resume = sirfsoc_irq_resume, 116 + }; 117 + 118 + static int __init sirfsoc_irq_pm_init(void) 119 + { 120 + if (!sirfsoc_irqdomain) 121 + return 0; 122 + 123 + register_syscore_ops(&sirfsoc_irq_syscore_ops); 124 + return 0; 125 + } 126 + device_initcall(sirfsoc_irq_pm_init);
+152 -164
drivers/mfd/db8500-prcmu.c
··· 26 26 #include <linux/fs.h> 27 27 #include <linux/platform_device.h> 28 28 #include <linux/uaccess.h> 29 - #include <linux/irqchip/arm-gic.h> 30 29 #include <linux/mfd/core.h> 31 30 #include <linux/mfd/dbx500-prcmu.h> 32 31 #include <linux/mfd/abx500/ab8500.h> ··· 33 34 #include <linux/regulator/machine.h> 34 35 #include <linux/cpufreq.h> 35 36 #include <linux/platform_data/ux500_wdt.h> 36 - #include <mach/hardware.h> 37 - #include <mach/irqs.h> 38 - #include <mach/db8500-regs.h> 37 + #include <linux/platform_data/db8500_thermal.h> 39 38 #include "dbx500-prcmu-regs.h" 40 39 41 40 /* Index of different voltages to be used when accessing AVSData */ ··· 273 276 * the bits in the bit field are not. (The bits also have a tendency to move 274 277 * around, to further complicate matters.) 275 278 */ 276 - #define IRQ_INDEX(_name) ((IRQ_PRCMU_##_name) - IRQ_PRCMU_BASE) 279 + #define IRQ_INDEX(_name) ((IRQ_PRCMU_##_name)) 277 280 #define IRQ_ENTRY(_name)[IRQ_INDEX(_name)] = (WAKEUP_BIT_##_name) 281 + 282 + #define IRQ_PRCMU_RTC 0 283 + #define IRQ_PRCMU_RTT0 1 284 + #define IRQ_PRCMU_RTT1 2 285 + #define IRQ_PRCMU_HSI0 3 286 + #define IRQ_PRCMU_HSI1 4 287 + #define IRQ_PRCMU_CA_WAKE 5 288 + #define IRQ_PRCMU_USB 6 289 + #define IRQ_PRCMU_ABB 7 290 + #define IRQ_PRCMU_ABB_FIFO 8 291 + #define IRQ_PRCMU_ARM 9 292 + #define IRQ_PRCMU_MODEM_SW_RESET_REQ 10 293 + #define IRQ_PRCMU_GPIO0 11 294 + #define IRQ_PRCMU_GPIO1 12 295 + #define IRQ_PRCMU_GPIO2 13 296 + #define IRQ_PRCMU_GPIO3 14 297 + #define IRQ_PRCMU_GPIO4 15 298 + #define IRQ_PRCMU_GPIO5 16 299 + #define IRQ_PRCMU_GPIO6 17 300 + #define IRQ_PRCMU_GPIO7 18 301 + #define IRQ_PRCMU_GPIO8 19 302 + #define IRQ_PRCMU_CA_SLEEP 20 303 + #define IRQ_PRCMU_HOTMON_LOW 21 304 + #define IRQ_PRCMU_HOTMON_HIGH 22 305 + #define NUM_PRCMU_WAKEUPS 23 306 + 278 307 static u32 prcmu_irq_bit[NUM_PRCMU_WAKEUPS] = { 279 308 IRQ_ENTRY(RTC), 280 309 IRQ_ENTRY(RTT0), ··· 445 422 446 423 /* Global var to runtime determine TCDM base for v2 or v1 */ 447 424 static __iomem void *tcdm_base; 425 + static __iomem void *prcmu_base; 448 426 449 427 struct clk_mgt { 450 - void __iomem *reg; 428 + u32 offset; 451 429 u32 pllsw; 452 430 int branch; 453 431 bool clk38div; ··· 623 599 while ((readl(PRCM_SEM) & PRCM_SEM_PRCM_SEM) != 0) 624 600 cpu_relax(); 625 601 626 - writel(PRCMU_DSI_CLOCK_SETTING, PRCM_HDMICLK_MGT); 627 - writel(PRCMU_DSI_LP_CLOCK_SETTING, PRCM_TVCLK_MGT); 628 - writel(PRCMU_DPI_CLOCK_SETTING, PRCM_LCDCLK_MGT); 602 + writel(PRCMU_DSI_CLOCK_SETTING, prcmu_base + PRCM_HDMICLK_MGT); 603 + writel(PRCMU_DSI_LP_CLOCK_SETTING, prcmu_base + PRCM_TVCLK_MGT); 604 + writel(PRCMU_DPI_CLOCK_SETTING, prcmu_base + PRCM_LCDCLK_MGT); 629 605 630 606 /* Release the HW semaphore. */ 631 607 writel(0, PRCM_SEM); ··· 637 613 638 614 u32 db8500_prcmu_read(unsigned int reg) 639 615 { 640 - return readl(_PRCMU_BASE + reg); 616 + return readl(prcmu_base + reg); 641 617 } 642 618 643 619 void db8500_prcmu_write(unsigned int reg, u32 value) ··· 645 621 unsigned long flags; 646 622 647 623 spin_lock_irqsave(&prcmu_lock, flags); 648 - writel(value, (_PRCMU_BASE + reg)); 624 + writel(value, (prcmu_base + reg)); 649 625 spin_unlock_irqrestore(&prcmu_lock, flags); 650 626 } 651 627 ··· 655 631 unsigned long flags; 656 632 657 633 spin_lock_irqsave(&prcmu_lock, flags); 658 - val = readl(_PRCMU_BASE + reg); 634 + val = readl(prcmu_base + reg); 659 635 val = ((val & ~mask) | (value & mask)); 660 - writel(val, (_PRCMU_BASE + reg)); 636 + writel(val, (prcmu_base + reg)); 661 637 spin_unlock_irqrestore(&prcmu_lock, flags); 662 638 } 663 639 ··· 817 793 return readb(tcdm_base + PRCM_ACK_MB0_AP_PWRSTTR_STATUS); 818 794 } 819 795 820 - /* This function decouple the gic from the prcmu */ 821 - int db8500_prcmu_gic_decouple(void) 822 - { 823 - u32 val = readl(PRCM_A9_MASK_REQ); 824 - 825 - /* Set bit 0 register value to 1 */ 826 - writel(val | PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ, 827 - PRCM_A9_MASK_REQ); 828 - 829 - /* Make sure the register is updated */ 830 - readl(PRCM_A9_MASK_REQ); 831 - 832 - /* Wait a few cycles for the gic mask completion */ 833 - udelay(1); 834 - 835 - return 0; 836 - } 837 - 838 - /* This function recouple the gic with the prcmu */ 839 - int db8500_prcmu_gic_recouple(void) 840 - { 841 - u32 val = readl(PRCM_A9_MASK_REQ); 842 - 843 - /* Set bit 0 register value to 0 */ 844 - writel(val & ~PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ, PRCM_A9_MASK_REQ); 845 - 846 - return 0; 847 - } 848 - 849 - #define PRCMU_GIC_NUMBER_REGS 5 850 - 851 - /* 852 - * This function checks if there are pending irq on the gic. It only 853 - * makes sense if the gic has been decoupled before with the 854 - * db8500_prcmu_gic_decouple function. Disabling an interrupt only 855 - * disables the forwarding of the interrupt to any CPU interface. It 856 - * does not prevent the interrupt from changing state, for example 857 - * becoming pending, or active and pending if it is already 858 - * active. Hence, we have to check the interrupt is pending *and* is 859 - * active. 860 - */ 861 - bool db8500_prcmu_gic_pending_irq(void) 862 - { 863 - u32 pr; /* Pending register */ 864 - u32 er; /* Enable register */ 865 - void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE); 866 - int i; 867 - 868 - /* 5 registers. STI & PPI not skipped */ 869 - for (i = 0; i < PRCMU_GIC_NUMBER_REGS; i++) { 870 - 871 - pr = readl_relaxed(dist_base + GIC_DIST_PENDING_SET + i * 4); 872 - er = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4); 873 - 874 - if (pr & er) 875 - return true; /* There is a pending interrupt */ 876 - } 877 - 878 - return false; 879 - } 880 - 881 - /* 882 - * This function checks if there are pending interrupt on the 883 - * prcmu which has been delegated to monitor the irqs with the 884 - * db8500_prcmu_copy_gic_settings function. 885 - */ 886 - bool db8500_prcmu_pending_irq(void) 887 - { 888 - u32 it, im; 889 - int i; 890 - 891 - for (i = 0; i < PRCMU_GIC_NUMBER_REGS - 1; i++) { 892 - it = readl(PRCM_ARMITVAL31TO0 + i * 4); 893 - im = readl(PRCM_ARMITMSK31TO0 + i * 4); 894 - if (it & im) 895 - return true; /* There is a pending interrupt */ 896 - } 897 - 898 - return false; 899 - } 900 - 901 - /* 902 - * This function checks if the specified cpu is in in WFI. It's usage 903 - * makes sense only if the gic is decoupled with the db8500_prcmu_gic_decouple 904 - * function. Of course passing smp_processor_id() to this function will 905 - * always return false... 906 - */ 907 - bool db8500_prcmu_is_cpu_in_wfi(int cpu) 908 - { 909 - return readl(PRCM_ARM_WFI_STANDBY) & cpu ? PRCM_ARM_WFI_STANDBY_WFI1 : 910 - PRCM_ARM_WFI_STANDBY_WFI0; 911 - } 912 - 913 - /* 914 - * This function copies the gic SPI settings to the prcmu in order to 915 - * monitor them and abort/finish the retention/off sequence or state. 916 - */ 917 - int db8500_prcmu_copy_gic_settings(void) 918 - { 919 - u32 er; /* Enable register */ 920 - void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE); 921 - int i; 922 - 923 - /* We skip the STI and PPI */ 924 - for (i = 0; i < PRCMU_GIC_NUMBER_REGS - 1; i++) { 925 - er = readl_relaxed(dist_base + 926 - GIC_DIST_ENABLE_SET + (i + 1) * 4); 927 - writel(er, PRCM_ARMITMSK31TO0 + i * 4); 928 - } 929 - 930 - return 0; 931 - } 932 - 933 796 /* This function should only be called while mb0_transfer.lock is held. */ 934 797 static void config_wakeups(void) 935 798 { ··· 970 1059 /* Divide the frequency of certain clocks by 2 for APE_50_PARTLY_25_OPP. */ 971 1060 static void request_even_slower_clocks(bool enable) 972 1061 { 973 - void __iomem *clock_reg[] = { 1062 + u32 clock_reg[] = { 974 1063 PRCM_ACLK_MGT, 975 1064 PRCM_DMACLK_MGT 976 1065 }; ··· 987 1076 u32 val; 988 1077 u32 div; 989 1078 990 - val = readl(clock_reg[i]); 1079 + val = readl(prcmu_base + clock_reg[i]); 991 1080 div = (val & PRCM_CLK_MGT_CLKPLLDIV_MASK); 992 1081 if (enable) { 993 1082 if ((div <= 1) || (div > 15)) { ··· 1003 1092 } 1004 1093 val = ((val & ~PRCM_CLK_MGT_CLKPLLDIV_MASK) | 1005 1094 (div & PRCM_CLK_MGT_CLKPLLDIV_MASK)); 1006 - writel(val, clock_reg[i]); 1095 + writel(val, prcmu_base + clock_reg[i]); 1007 1096 } 1008 1097 1009 1098 unlock_and_return: ··· 1357 1446 while ((readl(PRCM_SEM) & PRCM_SEM_PRCM_SEM) != 0) 1358 1447 cpu_relax(); 1359 1448 1360 - val = readl(clk_mgt[clock].reg); 1449 + val = readl(prcmu_base + clk_mgt[clock].offset); 1361 1450 if (enable) { 1362 1451 val |= (PRCM_CLK_MGT_CLKEN | clk_mgt[clock].pllsw); 1363 1452 } else { 1364 1453 clk_mgt[clock].pllsw = (val & PRCM_CLK_MGT_CLKPLLSW_MASK); 1365 1454 val &= ~(PRCM_CLK_MGT_CLKEN | PRCM_CLK_MGT_CLKPLLSW_MASK); 1366 1455 } 1367 - writel(val, clk_mgt[clock].reg); 1456 + writel(val, prcmu_base + clk_mgt[clock].offset); 1368 1457 1369 1458 /* Release the HW semaphore. */ 1370 1459 writel(0, PRCM_SEM); ··· 1540 1629 u32 pllsw; 1541 1630 unsigned long rate = ROOT_CLOCK_RATE; 1542 1631 1543 - val = readl(clk_mgt[clock].reg); 1632 + val = readl(prcmu_base + clk_mgt[clock].offset); 1544 1633 1545 1634 if (val & PRCM_CLK_MGT_CLK38) { 1546 1635 if (clk_mgt[clock].clk38div && (val & PRCM_CLK_MGT_CLK38DIV)) ··· 1696 1785 unsigned long src_rate; 1697 1786 long rounded_rate; 1698 1787 1699 - val = readl(clk_mgt[clock].reg); 1788 + val = readl(prcmu_base + clk_mgt[clock].offset); 1700 1789 src_rate = clock_source_rate((val | clk_mgt[clock].pllsw), 1701 1790 clk_mgt[clock].branch); 1702 1791 div = clock_divider(src_rate, rate); ··· 1844 1933 while ((readl(PRCM_SEM) & PRCM_SEM_PRCM_SEM) != 0) 1845 1934 cpu_relax(); 1846 1935 1847 - val = readl(clk_mgt[clock].reg); 1936 + val = readl(prcmu_base + clk_mgt[clock].offset); 1848 1937 src_rate = clock_source_rate((val | clk_mgt[clock].pllsw), 1849 1938 clk_mgt[clock].branch); 1850 1939 div = clock_divider(src_rate, rate); ··· 1872 1961 val &= ~PRCM_CLK_MGT_CLKPLLDIV_MASK; 1873 1962 val |= min(div, (u32)31); 1874 1963 } 1875 - writel(val, clk_mgt[clock].reg); 1964 + writel(val, prcmu_base + clk_mgt[clock].offset); 1876 1965 1877 1966 /* Release the HW semaphore. */ 1878 1967 writel(0, PRCM_SEM); ··· 2675 2764 .xlate = irq_domain_xlate_twocell, 2676 2765 }; 2677 2766 2678 - static int db8500_irq_init(struct device_node *np) 2767 + static int db8500_irq_init(struct device_node *np, int irq_base) 2679 2768 { 2680 - int irq_base = 0; 2681 2769 int i; 2682 2770 2683 2771 /* In the device tree case, just take some IRQs */ 2684 - if (!np) 2685 - irq_base = IRQ_PRCMU_BASE; 2772 + if (np) 2773 + irq_base = 0; 2686 2774 2687 2775 db8500_irq_domain = irq_domain_add_simple( 2688 2776 np, NUM_PRCMU_WAKEUPS, irq_base, ··· 2735 2825 } 2736 2826 } 2737 2827 2738 - void __init db8500_prcmu_early_init(void) 2828 + void __init db8500_prcmu_early_init(u32 phy_base, u32 size) 2739 2829 { 2830 + /* 2831 + * This is a temporary remap to bring up the clocks. It is 2832 + * subsequently replaces with a real remap. After the merge of 2833 + * the mailbox subsystem all of this early code goes away, and the 2834 + * clock driver can probe independently. An early initcall will 2835 + * still be needed, but it can be diverted into drivers/clk/ux500. 2836 + */ 2837 + prcmu_base = ioremap(phy_base, size); 2838 + if (!prcmu_base) 2839 + pr_err("%s: ioremap() of prcmu registers failed!\n", __func__); 2840 + 2740 2841 spin_lock_init(&mb0_transfer.lock); 2741 2842 spin_lock_init(&mb0_transfer.dbb_irqs_lock); 2742 2843 mutex_init(&mb0_transfer.ac_wake_lock); ··· 3013 3092 }, 3014 3093 }; 3015 3094 3016 - static struct resource ab8500_resources[] = { 3017 - [0] = { 3018 - .start = IRQ_DB8500_AB8500, 3019 - .end = IRQ_DB8500_AB8500, 3020 - .flags = IORESOURCE_IRQ 3021 - } 3022 - }; 3023 - 3024 3095 static struct ux500_wdt_data db8500_wdt_pdata = { 3025 3096 .timeout = 600, /* 10 minutes */ 3026 3097 .has_28_bits_resolution = true, 3098 + }; 3099 + /* 3100 + * Thermal Sensor 3101 + */ 3102 + 3103 + static struct resource db8500_thsens_resources[] = { 3104 + { 3105 + .name = "IRQ_HOTMON_LOW", 3106 + .start = IRQ_PRCMU_HOTMON_LOW, 3107 + .end = IRQ_PRCMU_HOTMON_LOW, 3108 + .flags = IORESOURCE_IRQ, 3109 + }, 3110 + { 3111 + .name = "IRQ_HOTMON_HIGH", 3112 + .start = IRQ_PRCMU_HOTMON_HIGH, 3113 + .end = IRQ_PRCMU_HOTMON_HIGH, 3114 + .flags = IORESOURCE_IRQ, 3115 + }, 3116 + }; 3117 + 3118 + static struct db8500_thsens_platform_data db8500_thsens_data = { 3119 + .trip_points[0] = { 3120 + .temp = 70000, 3121 + .type = THERMAL_TRIP_ACTIVE, 3122 + .cdev_name = { 3123 + [0] = "thermal-cpufreq-0", 3124 + }, 3125 + }, 3126 + .trip_points[1] = { 3127 + .temp = 75000, 3128 + .type = THERMAL_TRIP_ACTIVE, 3129 + .cdev_name = { 3130 + [0] = "thermal-cpufreq-0", 3131 + }, 3132 + }, 3133 + .trip_points[2] = { 3134 + .temp = 80000, 3135 + .type = THERMAL_TRIP_ACTIVE, 3136 + .cdev_name = { 3137 + [0] = "thermal-cpufreq-0", 3138 + }, 3139 + }, 3140 + .trip_points[3] = { 3141 + .temp = 85000, 3142 + .type = THERMAL_TRIP_CRITICAL, 3143 + }, 3144 + .num_trips = 4, 3027 3145 }; 3028 3146 3029 3147 static struct mfd_cell db8500_prcmu_devs[] = { ··· 3085 3125 .id = -1, 3086 3126 }, 3087 3127 { 3088 - .name = "ab8500-core", 3089 - .of_compatible = "stericsson,ab8500", 3090 - .num_resources = ARRAY_SIZE(ab8500_resources), 3091 - .resources = ab8500_resources, 3092 - .id = AB8500_VERSION_AB8500, 3128 + .name = "db8500-thermal", 3129 + .num_resources = ARRAY_SIZE(db8500_thsens_resources), 3130 + .resources = db8500_thsens_resources, 3131 + .platform_data = &db8500_thsens_data, 3093 3132 }, 3094 3133 }; 3095 3134 ··· 3100 3141 } 3101 3142 } 3102 3143 3144 + static int db8500_prcmu_register_ab8500(struct device *parent, 3145 + struct ab8500_platform_data *pdata, 3146 + int irq) 3147 + { 3148 + struct resource ab8500_resource = DEFINE_RES_IRQ(irq); 3149 + struct mfd_cell ab8500_cell = { 3150 + .name = "ab8500-core", 3151 + .of_compatible = "stericsson,ab8500", 3152 + .id = AB8500_VERSION_AB8500, 3153 + .platform_data = pdata, 3154 + .pdata_size = sizeof(struct ab8500_platform_data), 3155 + .resources = &ab8500_resource, 3156 + .num_resources = 1, 3157 + }; 3158 + 3159 + return mfd_add_devices(parent, 0, &ab8500_cell, 1, NULL, 0, NULL); 3160 + } 3161 + 3103 3162 /** 3104 3163 * prcmu_fw_init - arch init call for the Linux PRCMU fw init logic 3105 3164 * ··· 3126 3149 { 3127 3150 struct device_node *np = pdev->dev.of_node; 3128 3151 struct prcmu_pdata *pdata = dev_get_platdata(&pdev->dev); 3129 - int irq = 0, err = 0, i; 3152 + int irq = 0, err = 0; 3130 3153 struct resource *res; 3131 3154 3155 + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu"); 3156 + if (!res) { 3157 + dev_err(&pdev->dev, "no prcmu memory region provided\n"); 3158 + return -ENOENT; 3159 + } 3160 + prcmu_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); 3161 + if (!prcmu_base) { 3162 + dev_err(&pdev->dev, 3163 + "failed to ioremap prcmu register memory\n"); 3164 + return -ENOENT; 3165 + } 3132 3166 init_prcm_registers(); 3133 - 3134 3167 dbx500_fw_version_init(pdev, pdata->version_offset); 3135 3168 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu-tcdm"); 3136 3169 if (!res) { ··· 3167 3180 goto no_irq_return; 3168 3181 } 3169 3182 3170 - db8500_irq_init(np); 3171 - 3172 - for (i = 0; i < ARRAY_SIZE(db8500_prcmu_devs); i++) { 3173 - if (!strcmp(db8500_prcmu_devs[i].name, "ab8500-core")) { 3174 - db8500_prcmu_devs[i].platform_data = pdata->ab_platdata; 3175 - db8500_prcmu_devs[i].pdata_size = sizeof(struct ab8500_platform_data); 3176 - } 3177 - } 3183 + db8500_irq_init(np, pdata->irq_base); 3178 3184 3179 3185 prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET); 3180 3186 3181 3187 db8500_prcmu_update_cpufreq(); 3182 3188 3183 3189 err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, 3184 - ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL); 3190 + ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, db8500_irq_domain); 3185 3191 if (err) { 3186 3192 pr_err("prcmu: Failed to add subdevices\n"); 3187 3193 return err; 3194 + } 3195 + 3196 + err = db8500_prcmu_register_ab8500(&pdev->dev, pdata->ab_platdata, 3197 + pdata->ab_irq); 3198 + if (err) { 3199 + mfd_remove_devices(&pdev->dev); 3200 + pr_err("prcmu: Failed to add ab8500 subdevice\n"); 3201 + goto no_irq_return; 3188 3202 } 3189 3203 3190 3204 pr_info("DB8500 PRCMU initialized\n");
+87 -113
drivers/mfd/dbx500-prcmu-regs.h
··· 13 13 #ifndef __DB8500_PRCMU_REGS_H 14 14 #define __DB8500_PRCMU_REGS_H 15 15 16 - #include <mach/hardware.h> 17 - 18 16 #define BITS(_start, _end) ((BIT(_end) - BIT(_start)) + BIT(_end)) 19 17 20 - #define PRCM_CLK_MGT(_offset) (void __iomem *)(IO_ADDRESS(U8500_PRCMU_BASE) \ 21 - + _offset) 22 - #define PRCM_ACLK_MGT PRCM_CLK_MGT(0x004) 23 - #define PRCM_SVACLK_MGT PRCM_CLK_MGT(0x008) 24 - #define PRCM_SIACLK_MGT PRCM_CLK_MGT(0x00C) 25 - #define PRCM_SGACLK_MGT PRCM_CLK_MGT(0x014) 26 - #define PRCM_UARTCLK_MGT PRCM_CLK_MGT(0x018) 27 - #define PRCM_MSP02CLK_MGT PRCM_CLK_MGT(0x01C) 28 - #define PRCM_I2CCLK_MGT PRCM_CLK_MGT(0x020) 29 - #define PRCM_SDMMCCLK_MGT PRCM_CLK_MGT(0x024) 30 - #define PRCM_SLIMCLK_MGT PRCM_CLK_MGT(0x028) 31 - #define PRCM_PER1CLK_MGT PRCM_CLK_MGT(0x02C) 32 - #define PRCM_PER2CLK_MGT PRCM_CLK_MGT(0x030) 33 - #define PRCM_PER3CLK_MGT PRCM_CLK_MGT(0x034) 34 - #define PRCM_PER5CLK_MGT PRCM_CLK_MGT(0x038) 35 - #define PRCM_PER6CLK_MGT PRCM_CLK_MGT(0x03C) 36 - #define PRCM_PER7CLK_MGT PRCM_CLK_MGT(0x040) 37 - #define PRCM_LCDCLK_MGT PRCM_CLK_MGT(0x044) 38 - #define PRCM_BMLCLK_MGT PRCM_CLK_MGT(0x04C) 39 - #define PRCM_HSITXCLK_MGT PRCM_CLK_MGT(0x050) 40 - #define PRCM_HSIRXCLK_MGT PRCM_CLK_MGT(0x054) 41 - #define PRCM_HDMICLK_MGT PRCM_CLK_MGT(0x058) 42 - #define PRCM_APEATCLK_MGT PRCM_CLK_MGT(0x05C) 43 - #define PRCM_APETRACECLK_MGT PRCM_CLK_MGT(0x060) 44 - #define PRCM_MCDECLK_MGT PRCM_CLK_MGT(0x064) 45 - #define PRCM_IPI2CCLK_MGT PRCM_CLK_MGT(0x068) 46 - #define PRCM_DSIALTCLK_MGT PRCM_CLK_MGT(0x06C) 47 - #define PRCM_DMACLK_MGT PRCM_CLK_MGT(0x074) 48 - #define PRCM_B2R2CLK_MGT PRCM_CLK_MGT(0x078) 49 - #define PRCM_TVCLK_MGT PRCM_CLK_MGT(0x07C) 50 - #define PRCM_UNIPROCLK_MGT PRCM_CLK_MGT(0x278) 51 - #define PRCM_SSPCLK_MGT PRCM_CLK_MGT(0x280) 52 - #define PRCM_RNGCLK_MGT PRCM_CLK_MGT(0x284) 53 - #define PRCM_UICCCLK_MGT PRCM_CLK_MGT(0x27C) 54 - #define PRCM_MSP1CLK_MGT PRCM_CLK_MGT(0x288) 18 + #define PRCM_ACLK_MGT (0x004) 19 + #define PRCM_SVACLK_MGT (0x008) 20 + #define PRCM_SIACLK_MGT (0x00C) 21 + #define PRCM_SGACLK_MGT (0x014) 22 + #define PRCM_UARTCLK_MGT (0x018) 23 + #define PRCM_MSP02CLK_MGT (0x01C) 24 + #define PRCM_I2CCLK_MGT (0x020) 25 + #define PRCM_SDMMCCLK_MGT (0x024) 26 + #define PRCM_SLIMCLK_MGT (0x028) 27 + #define PRCM_PER1CLK_MGT (0x02C) 28 + #define PRCM_PER2CLK_MGT (0x030) 29 + #define PRCM_PER3CLK_MGT (0x034) 30 + #define PRCM_PER5CLK_MGT (0x038) 31 + #define PRCM_PER6CLK_MGT (0x03C) 32 + #define PRCM_PER7CLK_MGT (0x040) 33 + #define PRCM_LCDCLK_MGT (0x044) 34 + #define PRCM_BMLCLK_MGT (0x04C) 35 + #define PRCM_HSITXCLK_MGT (0x050) 36 + #define PRCM_HSIRXCLK_MGT (0x054) 37 + #define PRCM_HDMICLK_MGT (0x058) 38 + #define PRCM_APEATCLK_MGT (0x05C) 39 + #define PRCM_APETRACECLK_MGT (0x060) 40 + #define PRCM_MCDECLK_MGT (0x064) 41 + #define PRCM_IPI2CCLK_MGT (0x068) 42 + #define PRCM_DSIALTCLK_MGT (0x06C) 43 + #define PRCM_DMACLK_MGT (0x074) 44 + #define PRCM_B2R2CLK_MGT (0x078) 45 + #define PRCM_TVCLK_MGT (0x07C) 46 + #define PRCM_UNIPROCLK_MGT (0x278) 47 + #define PRCM_SSPCLK_MGT (0x280) 48 + #define PRCM_RNGCLK_MGT (0x284) 49 + #define PRCM_UICCCLK_MGT (0x27C) 50 + #define PRCM_MSP1CLK_MGT (0x288) 55 51 56 - #define PRCM_ARM_PLLDIVPS (_PRCMU_BASE + 0x118) 52 + #define PRCM_ARM_PLLDIVPS (prcmu_base + 0x118) 57 53 #define PRCM_ARM_PLLDIVPS_ARM_BRM_RATE 0x3f 58 54 #define PRCM_ARM_PLLDIVPS_MAX_MASK 0xf 59 55 60 - #define PRCM_PLLARM_LOCKP (_PRCMU_BASE + 0x0a8) 56 + #define PRCM_PLLARM_LOCKP (prcmu_base + 0x0a8) 61 57 #define PRCM_PLLARM_LOCKP_PRCM_PLLARM_LOCKP3 0x2 62 58 63 - #define PRCM_ARM_CHGCLKREQ (_PRCMU_BASE + 0x114) 59 + #define PRCM_ARM_CHGCLKREQ (prcmu_base + 0x114) 64 60 #define PRCM_ARM_CHGCLKREQ_PRCM_ARM_CHGCLKREQ BIT(0) 65 61 #define PRCM_ARM_CHGCLKREQ_PRCM_ARM_DIVSEL BIT(16) 66 62 67 - #define PRCM_PLLARM_ENABLE (_PRCMU_BASE + 0x98) 63 + #define PRCM_PLLARM_ENABLE (prcmu_base + 0x98) 68 64 #define PRCM_PLLARM_ENABLE_PRCM_PLLARM_ENABLE 0x1 69 65 #define PRCM_PLLARM_ENABLE_PRCM_PLLARM_COUNTON 0x100 70 66 71 - #define PRCM_ARMCLKFIX_MGT (_PRCMU_BASE + 0x0) 72 - #define PRCM_A9PL_FORCE_CLKEN (_PRCMU_BASE + 0x19C) 73 - #define PRCM_A9_RESETN_CLR (_PRCMU_BASE + 0x1f4) 74 - #define PRCM_A9_RESETN_SET (_PRCMU_BASE + 0x1f0) 75 - #define PRCM_ARM_LS_CLAMP (_PRCMU_BASE + 0x30c) 76 - #define PRCM_SRAM_A9 (_PRCMU_BASE + 0x308) 67 + #define PRCM_ARMCLKFIX_MGT (prcmu_base + 0x0) 68 + #define PRCM_A9PL_FORCE_CLKEN (prcmu_base + 0x19C) 69 + #define PRCM_A9_RESETN_CLR (prcmu_base + 0x1f4) 70 + #define PRCM_A9_RESETN_SET (prcmu_base + 0x1f0) 71 + #define PRCM_ARM_LS_CLAMP (prcmu_base + 0x30c) 72 + #define PRCM_SRAM_A9 (prcmu_base + 0x308) 77 73 78 74 #define PRCM_A9PL_FORCE_CLKEN_PRCM_A9PL_FORCE_CLKEN BIT(0) 79 75 #define PRCM_A9PL_FORCE_CLKEN_PRCM_A9AXI_FORCE_CLKEN BIT(1) 80 76 81 - /* ARM WFI Standby signal register */ 82 - #define PRCM_ARM_WFI_STANDBY (_PRCMU_BASE + 0x130) 83 - #define PRCM_ARM_WFI_STANDBY_WFI0 0x08 84 - #define PRCM_ARM_WFI_STANDBY_WFI1 0x10 85 - #define PRCM_IOCR (_PRCMU_BASE + 0x310) 86 - #define PRCM_IOCR_IOFORCE 0x1 87 - 88 77 /* CPU mailbox registers */ 89 - #define PRCM_MBOX_CPU_VAL (_PRCMU_BASE + 0x0fc) 90 - #define PRCM_MBOX_CPU_SET (_PRCMU_BASE + 0x100) 91 - #define PRCM_MBOX_CPU_CLR (_PRCMU_BASE + 0x104) 78 + #define PRCM_MBOX_CPU_VAL (prcmu_base + 0x0fc) 79 + #define PRCM_MBOX_CPU_SET (prcmu_base + 0x100) 80 + #define PRCM_MBOX_CPU_CLR (prcmu_base + 0x104) 92 81 93 - /* Dual A9 core interrupt management unit registers */ 94 - #define PRCM_A9_MASK_REQ (_PRCMU_BASE + 0x328) 95 - #define PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ 0x1 96 - 97 - #define PRCM_A9_MASK_ACK (_PRCMU_BASE + 0x32c) 98 - #define PRCM_ARMITMSK31TO0 (_PRCMU_BASE + 0x11c) 99 - #define PRCM_ARMITMSK63TO32 (_PRCMU_BASE + 0x120) 100 - #define PRCM_ARMITMSK95TO64 (_PRCMU_BASE + 0x124) 101 - #define PRCM_ARMITMSK127TO96 (_PRCMU_BASE + 0x128) 102 - #define PRCM_POWER_STATE_VAL (_PRCMU_BASE + 0x25C) 103 - #define PRCM_ARMITVAL31TO0 (_PRCMU_BASE + 0x260) 104 - #define PRCM_ARMITVAL63TO32 (_PRCMU_BASE + 0x264) 105 - #define PRCM_ARMITVAL95TO64 (_PRCMU_BASE + 0x268) 106 - #define PRCM_ARMITVAL127TO96 (_PRCMU_BASE + 0x26C) 107 - 108 - #define PRCM_HOSTACCESS_REQ (_PRCMU_BASE + 0x334) 82 + #define PRCM_HOSTACCESS_REQ (prcmu_base + 0x334) 109 83 #define PRCM_HOSTACCESS_REQ_HOSTACCESS_REQ 0x1 110 84 #define PRCM_HOSTACCESS_REQ_WAKE_REQ BIT(16) 111 85 #define ARM_WAKEUP_MODEM 0x1 112 86 113 - #define PRCM_ARM_IT1_CLR (_PRCMU_BASE + 0x48C) 114 - #define PRCM_ARM_IT1_VAL (_PRCMU_BASE + 0x494) 115 - #define PRCM_HOLD_EVT (_PRCMU_BASE + 0x174) 87 + #define PRCM_ARM_IT1_CLR (prcmu_base + 0x48C) 88 + #define PRCM_ARM_IT1_VAL (prcmu_base + 0x494) 89 + #define PRCM_HOLD_EVT (prcmu_base + 0x174) 116 90 117 - #define PRCM_MOD_AWAKE_STATUS (_PRCMU_BASE + 0x4A0) 91 + #define PRCM_MOD_AWAKE_STATUS (prcmu_base + 0x4A0) 118 92 #define PRCM_MOD_AWAKE_STATUS_PRCM_MOD_COREPD_AWAKE BIT(0) 119 93 #define PRCM_MOD_AWAKE_STATUS_PRCM_MOD_AAPD_AWAKE BIT(1) 120 94 #define PRCM_MOD_AWAKE_STATUS_PRCM_MOD_VMODEM_OFF_ISO BIT(2) 121 95 122 - #define PRCM_ITSTATUS0 (_PRCMU_BASE + 0x148) 123 - #define PRCM_ITSTATUS1 (_PRCMU_BASE + 0x150) 124 - #define PRCM_ITSTATUS2 (_PRCMU_BASE + 0x158) 125 - #define PRCM_ITSTATUS3 (_PRCMU_BASE + 0x160) 126 - #define PRCM_ITSTATUS4 (_PRCMU_BASE + 0x168) 127 - #define PRCM_ITSTATUS5 (_PRCMU_BASE + 0x484) 128 - #define PRCM_ITCLEAR5 (_PRCMU_BASE + 0x488) 129 - #define PRCM_ARMIT_MASKXP70_IT (_PRCMU_BASE + 0x1018) 96 + #define PRCM_ITSTATUS0 (prcmu_base + 0x148) 97 + #define PRCM_ITSTATUS1 (prcmu_base + 0x150) 98 + #define PRCM_ITSTATUS2 (prcmu_base + 0x158) 99 + #define PRCM_ITSTATUS3 (prcmu_base + 0x160) 100 + #define PRCM_ITSTATUS4 (prcmu_base + 0x168) 101 + #define PRCM_ITSTATUS5 (prcmu_base + 0x484) 102 + #define PRCM_ITCLEAR5 (prcmu_base + 0x488) 103 + #define PRCM_ARMIT_MASKXP70_IT (prcmu_base + 0x1018) 130 104 131 105 /* System reset register */ 132 - #define PRCM_APE_SOFTRST (_PRCMU_BASE + 0x228) 106 + #define PRCM_APE_SOFTRST (prcmu_base + 0x228) 133 107 134 108 /* Level shifter and clamp control registers */ 135 - #define PRCM_MMIP_LS_CLAMP_SET (_PRCMU_BASE + 0x420) 136 - #define PRCM_MMIP_LS_CLAMP_CLR (_PRCMU_BASE + 0x424) 109 + #define PRCM_MMIP_LS_CLAMP_SET (prcmu_base + 0x420) 110 + #define PRCM_MMIP_LS_CLAMP_CLR (prcmu_base + 0x424) 137 111 138 112 #define PRCM_MMIP_LS_CLAMP_DSIPLL_CLAMP BIT(11) 139 113 #define PRCM_MMIP_LS_CLAMP_DSIPLL_CLAMPI BIT(22) 140 114 141 115 /* PRCMU clock/PLL/reset registers */ 142 - #define PRCM_PLLSOC0_FREQ (_PRCMU_BASE + 0x080) 143 - #define PRCM_PLLSOC1_FREQ (_PRCMU_BASE + 0x084) 144 - #define PRCM_PLLARM_FREQ (_PRCMU_BASE + 0x088) 145 - #define PRCM_PLLDDR_FREQ (_PRCMU_BASE + 0x08C) 116 + #define PRCM_PLLSOC0_FREQ (prcmu_base + 0x080) 117 + #define PRCM_PLLSOC1_FREQ (prcmu_base + 0x084) 118 + #define PRCM_PLLARM_FREQ (prcmu_base + 0x088) 119 + #define PRCM_PLLDDR_FREQ (prcmu_base + 0x08C) 146 120 #define PRCM_PLL_FREQ_D_SHIFT 0 147 121 #define PRCM_PLL_FREQ_D_MASK BITS(0, 7) 148 122 #define PRCM_PLL_FREQ_N_SHIFT 8 ··· 126 152 #define PRCM_PLL_FREQ_SELDIV2 BIT(24) 127 153 #define PRCM_PLL_FREQ_DIV2EN BIT(25) 128 154 129 - #define PRCM_PLLDSI_FREQ (_PRCMU_BASE + 0x500) 130 - #define PRCM_PLLDSI_ENABLE (_PRCMU_BASE + 0x504) 131 - #define PRCM_PLLDSI_LOCKP (_PRCMU_BASE + 0x508) 132 - #define PRCM_DSI_PLLOUT_SEL (_PRCMU_BASE + 0x530) 133 - #define PRCM_DSITVCLK_DIV (_PRCMU_BASE + 0x52C) 134 - #define PRCM_PLLDSI_LOCKP (_PRCMU_BASE + 0x508) 135 - #define PRCM_APE_RESETN_SET (_PRCMU_BASE + 0x1E4) 136 - #define PRCM_APE_RESETN_CLR (_PRCMU_BASE + 0x1E8) 155 + #define PRCM_PLLDSI_FREQ (prcmu_base + 0x500) 156 + #define PRCM_PLLDSI_ENABLE (prcmu_base + 0x504) 157 + #define PRCM_PLLDSI_LOCKP (prcmu_base + 0x508) 158 + #define PRCM_DSI_PLLOUT_SEL (prcmu_base + 0x530) 159 + #define PRCM_DSITVCLK_DIV (prcmu_base + 0x52C) 160 + #define PRCM_PLLDSI_LOCKP (prcmu_base + 0x508) 161 + #define PRCM_APE_RESETN_SET (prcmu_base + 0x1E4) 162 + #define PRCM_APE_RESETN_CLR (prcmu_base + 0x1E8) 137 163 138 164 #define PRCM_PLLDSI_ENABLE_PRCM_PLLDSI_ENABLE BIT(0) 139 165 ··· 162 188 163 189 #define PRCM_APE_RESETN_DSIPLL_RESETN BIT(14) 164 190 165 - #define PRCM_CLKOCR (_PRCMU_BASE + 0x1CC) 191 + #define PRCM_CLKOCR (prcmu_base + 0x1CC) 166 192 #define PRCM_CLKOCR_CLKOUT0_REF_CLK (1 << 0) 167 193 #define PRCM_CLKOCR_CLKOUT0_MASK BITS(0, 13) 168 194 #define PRCM_CLKOCR_CLKOUT1_REF_CLK (1 << 16) 169 195 #define PRCM_CLKOCR_CLKOUT1_MASK BITS(16, 29) 170 196 171 197 /* ePOD and memory power signal control registers */ 172 - #define PRCM_EPOD_C_SET (_PRCMU_BASE + 0x410) 173 - #define PRCM_SRAM_LS_SLEEP (_PRCMU_BASE + 0x304) 198 + #define PRCM_EPOD_C_SET (prcmu_base + 0x410) 199 + #define PRCM_SRAM_LS_SLEEP (prcmu_base + 0x304) 174 200 175 201 /* Debug power control unit registers */ 176 - #define PRCM_POWER_STATE_SET (_PRCMU_BASE + 0x254) 202 + #define PRCM_POWER_STATE_SET (prcmu_base + 0x254) 177 203 178 204 /* Miscellaneous unit registers */ 179 - #define PRCM_DSI_SW_RESET (_PRCMU_BASE + 0x324) 180 - #define PRCM_GPIOCR (_PRCMU_BASE + 0x138) 205 + #define PRCM_DSI_SW_RESET (prcmu_base + 0x324) 206 + #define PRCM_GPIOCR (prcmu_base + 0x138) 181 207 #define PRCM_GPIOCR_DBG_STM_MOD_CMD1 0x800 182 208 #define PRCM_GPIOCR_DBG_UARTMOD_CMD0 0x1 183 209 184 210 /* PRCMU HW semaphore */ 185 - #define PRCM_SEM (_PRCMU_BASE + 0x400) 211 + #define PRCM_SEM (prcmu_base + 0x400) 186 212 #define PRCM_SEM_PRCM_SEM BIT(0) 187 213 188 - #define PRCM_TCR (_PRCMU_BASE + 0x1C8) 214 + #define PRCM_TCR (prcmu_base + 0x1C8) 189 215 #define PRCM_TCR_TENSEL_MASK BITS(0, 7) 190 216 #define PRCM_TCR_STOP_TIMERS BIT(16) 191 217 #define PRCM_TCR_DOZE_MODE BIT(17) ··· 213 239 /* GPIOCR register */ 214 240 #define PRCM_GPIOCR_SPI2_SELECT BIT(23) 215 241 216 - #define PRCM_DDR_SUBSYS_APE_MINBW (_PRCMU_BASE + 0x438) 217 - #define PRCM_CGATING_BYPASS (_PRCMU_BASE + 0x134) 242 + #define PRCM_DDR_SUBSYS_APE_MINBW (prcmu_base + 0x438) 243 + #define PRCM_CGATING_BYPASS (prcmu_base + 0x134) 218 244 #define PRCM_CGATING_BYPASS_ICN2 BIT(6) 219 245 220 246 /* Miscellaneous unit registers */ 221 - #define PRCM_RESOUTN_SET (_PRCMU_BASE + 0x214) 222 - #define PRCM_RESOUTN_CLR (_PRCMU_BASE + 0x218) 247 + #define PRCM_RESOUTN_SET (prcmu_base + 0x214) 248 + #define PRCM_RESOUTN_CLR (prcmu_base + 0x218) 223 249 224 250 /* System reset register */ 225 - #define PRCM_APE_SOFTRST (_PRCMU_BASE + 0x228) 251 + #define PRCM_APE_SOFTRST (prcmu_base + 0x228) 226 252 227 253 #endif /* __DB8500_PRCMU_REGS_H */
-1
drivers/mmc/host/sdhci-cns3xxx.c
··· 16 16 #include <linux/device.h> 17 17 #include <linux/mmc/host.h> 18 18 #include <linux/module.h> 19 - #include <mach/cns3xxx.h> 20 19 #include "sdhci-pltfm.h" 21 20 22 21 static unsigned int sdhci_cns3xxx_get_max_clk(struct sdhci_host *host)
+2 -3
drivers/mmc/host/sdhci-s3c.c
··· 15 15 #include <linux/delay.h> 16 16 #include <linux/dma-mapping.h> 17 17 #include <linux/platform_device.h> 18 + #include <linux/platform_data/mmc-sdhci-s3c.h> 18 19 #include <linux/slab.h> 19 20 #include <linux/clk.h> 20 21 #include <linux/io.h> ··· 29 28 30 29 #include <linux/mmc/host.h> 31 30 32 - #include <plat/sdhci.h> 33 - #include <plat/regs-sdhci.h> 34 - 31 + #include "sdhci-s3c-regs.h" 35 32 #include "sdhci.h" 36 33 37 34 #define MAX_BUS_CLK (4)
+2 -2
drivers/mtd/onenand/samsung.c
··· 23 23 #include <linux/mtd/partitions.h> 24 24 #include <linux/dma-mapping.h> 25 25 #include <linux/interrupt.h> 26 + #include <linux/io.h> 26 27 27 28 #include <asm/mach/flash.h> 28 - #include <plat/regs-onenand.h> 29 29 30 - #include <linux/io.h> 30 + #include "samsung.h" 31 31 32 32 enum soc_type { 33 33 TYPE_S3C6400,
+61
drivers/mtd/onenand/samsung.h
··· 1 + /* 2 + * linux/arch/arm/plat-s3c/include/plat/regs-onenand.h 3 + * 4 + * Copyright (C) 2008-2010 Samsung Electronics 5 + * Kyungmin Park <kyungmin.park@samsung.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * published by the Free Software Foundation. 10 + */ 11 + #ifndef __SAMSUNG_ONENAND_H__ 12 + #define __SAMSUNG_ONENAND_H__ 13 + 14 + /* 15 + * OneNAND Controller 16 + */ 17 + #define MEM_CFG_OFFSET 0x0000 18 + #define BURST_LEN_OFFSET 0x0010 19 + #define MEM_RESET_OFFSET 0x0020 20 + #define INT_ERR_STAT_OFFSET 0x0030 21 + #define INT_ERR_MASK_OFFSET 0x0040 22 + #define INT_ERR_ACK_OFFSET 0x0050 23 + #define ECC_ERR_STAT_OFFSET 0x0060 24 + #define MANUFACT_ID_OFFSET 0x0070 25 + #define DEVICE_ID_OFFSET 0x0080 26 + #define DATA_BUF_SIZE_OFFSET 0x0090 27 + #define BOOT_BUF_SIZE_OFFSET 0x00A0 28 + #define BUF_AMOUNT_OFFSET 0x00B0 29 + #define TECH_OFFSET 0x00C0 30 + #define FBA_WIDTH_OFFSET 0x00D0 31 + #define FPA_WIDTH_OFFSET 0x00E0 32 + #define FSA_WIDTH_OFFSET 0x00F0 33 + #define TRANS_SPARE_OFFSET 0x0140 34 + #define DBS_DFS_WIDTH_OFFSET 0x0160 35 + #define INT_PIN_ENABLE_OFFSET 0x01A0 36 + #define ACC_CLOCK_OFFSET 0x01C0 37 + #define FLASH_VER_ID_OFFSET 0x01F0 38 + #define FLASH_AUX_CNTRL_OFFSET 0x0300 /* s3c64xx only */ 39 + 40 + #define ONENAND_MEM_RESET_HOT 0x3 41 + #define ONENAND_MEM_RESET_COLD 0x2 42 + #define ONENAND_MEM_RESET_WARM 0x1 43 + 44 + #define CACHE_OP_ERR (1 << 13) 45 + #define RST_CMP (1 << 12) 46 + #define RDY_ACT (1 << 11) 47 + #define INT_ACT (1 << 10) 48 + #define UNSUP_CMD (1 << 9) 49 + #define LOCKED_BLK (1 << 8) 50 + #define BLK_RW_CMP (1 << 7) 51 + #define ERS_CMP (1 << 6) 52 + #define PGM_CMP (1 << 5) 53 + #define LOAD_CMP (1 << 4) 54 + #define ERS_FAIL (1 << 3) 55 + #define PGM_FAIL (1 << 2) 56 + #define INT_TO (1 << 1) 57 + #define LD_FAIL_ECC_ERR (1 << 0) 58 + 59 + #define TSRF (1 << 0) 60 + 61 + #endif
+4 -8
drivers/pinctrl/pinctrl-sirf.c
··· 1347 1347 struct sirfsoc_gpio_bank *bank = container_of(to_of_mm_gpio_chip(chip), 1348 1348 struct sirfsoc_gpio_bank, chip); 1349 1349 1350 - return irq_find_mapping(bank->domain, offset); 1350 + return irq_create_mapping(bank->domain, offset); 1351 1351 } 1352 1352 1353 1353 static inline int sirfsoc_gpio_to_offset(unsigned int gpio) ··· 1485 1485 struct sirfsoc_gpio_bank *bank = irq_get_handler_data(irq); 1486 1486 u32 status, ctrl; 1487 1487 int idx = 0; 1488 - unsigned int first_irq; 1489 1488 struct irq_chip *chip = irq_get_chip(irq); 1490 1489 1491 1490 chained_irq_enter(chip, desc); ··· 1498 1499 return; 1499 1500 } 1500 1501 1501 - first_irq = bank->domain->revmap_data.legacy.first_irq; 1502 - 1503 1502 while (status) { 1504 1503 ctrl = readl(bank->chip.regs + SIRFSOC_GPIO_CTRL(bank->id, idx)); 1505 1504 ··· 1508 1511 if ((status & 0x1) && (ctrl & SIRFSOC_GPIO_CTL_INTR_EN_MASK)) { 1509 1512 pr_debug("%s: gpio id %d idx %d happens\n", 1510 1513 __func__, bank->id, idx); 1511 - generic_handle_irq(first_irq + idx); 1514 + generic_handle_irq(irq_find_mapping(bank->domain, idx)); 1512 1515 } 1513 1516 1514 1517 idx++; ··· 1761 1764 goto out; 1762 1765 } 1763 1766 1764 - bank->domain = irq_domain_add_legacy(np, SIRFSOC_GPIO_BANK_SIZE, 1765 - SIRFSOC_GPIO_IRQ_START + i * SIRFSOC_GPIO_BANK_SIZE, 0, 1766 - &sirfsoc_gpio_irq_simple_ops, bank); 1767 + bank->domain = irq_domain_add_linear(np, SIRFSOC_GPIO_BANK_SIZE, 1768 + &sirfsoc_gpio_irq_simple_ops, bank); 1767 1769 1768 1770 if (!bank->domain) { 1769 1771 pr_err("%s: Failed to create irqdomain\n", np->full_name);
+1 -2
drivers/rtc/rtc-s3c.c
··· 29 29 #include <linux/uaccess.h> 30 30 #include <linux/io.h> 31 31 32 - #include <mach/hardware.h> 33 32 #include <asm/irq.h> 34 - #include <plat/regs-rtc.h> 33 + #include "rtc-s3c.h" 35 34 36 35 enum s3c_cpu_type { 37 36 TYPE_S3C2410,
+70
drivers/rtc/rtc-s3c.h
··· 1 + /* 2 + * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> 3 + * http://www.simtec.co.uk/products/SWLINUX/ 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 + * S3C2410 Internal RTC register definition 10 + */ 11 + 12 + #ifndef __ASM_ARCH_REGS_RTC_H 13 + #define __ASM_ARCH_REGS_RTC_H __FILE__ 14 + 15 + #define S3C2410_RTCREG(x) (x) 16 + #define S3C2410_INTP S3C2410_RTCREG(0x30) 17 + #define S3C2410_INTP_ALM (1 << 1) 18 + #define S3C2410_INTP_TIC (1 << 0) 19 + 20 + #define S3C2410_RTCCON S3C2410_RTCREG(0x40) 21 + #define S3C2410_RTCCON_RTCEN (1 << 0) 22 + #define S3C2410_RTCCON_CNTSEL (1 << 2) 23 + #define S3C2410_RTCCON_CLKRST (1 << 3) 24 + #define S3C2443_RTCCON_TICSEL (1 << 4) 25 + #define S3C64XX_RTCCON_TICEN (1 << 8) 26 + 27 + #define S3C2410_TICNT S3C2410_RTCREG(0x44) 28 + #define S3C2410_TICNT_ENABLE (1 << 7) 29 + 30 + /* S3C2443: tick count is 15 bit wide 31 + * TICNT[6:0] contains upper 7 bits 32 + * TICNT1[7:0] contains lower 8 bits 33 + */ 34 + #define S3C2443_TICNT_PART(x) ((x & 0x7f00) >> 8) 35 + #define S3C2443_TICNT1 S3C2410_RTCREG(0x4C) 36 + #define S3C2443_TICNT1_PART(x) (x & 0xff) 37 + 38 + /* S3C2416: tick count is 32 bit wide 39 + * TICNT[6:0] contains bits [14:8] 40 + * TICNT1[7:0] contains lower 8 bits 41 + * TICNT2[16:0] contains upper 17 bits 42 + */ 43 + #define S3C2416_TICNT2 S3C2410_RTCREG(0x48) 44 + #define S3C2416_TICNT2_PART(x) ((x & 0xffff8000) >> 15) 45 + 46 + #define S3C2410_RTCALM S3C2410_RTCREG(0x50) 47 + #define S3C2410_RTCALM_ALMEN (1 << 6) 48 + #define S3C2410_RTCALM_YEAREN (1 << 5) 49 + #define S3C2410_RTCALM_MONEN (1 << 4) 50 + #define S3C2410_RTCALM_DAYEN (1 << 3) 51 + #define S3C2410_RTCALM_HOUREN (1 << 2) 52 + #define S3C2410_RTCALM_MINEN (1 << 1) 53 + #define S3C2410_RTCALM_SECEN (1 << 0) 54 + 55 + #define S3C2410_ALMSEC S3C2410_RTCREG(0x54) 56 + #define S3C2410_ALMMIN S3C2410_RTCREG(0x58) 57 + #define S3C2410_ALMHOUR S3C2410_RTCREG(0x5c) 58 + 59 + #define S3C2410_ALMDATE S3C2410_RTCREG(0x60) 60 + #define S3C2410_ALMMON S3C2410_RTCREG(0x64) 61 + #define S3C2410_ALMYEAR S3C2410_RTCREG(0x68) 62 + 63 + #define S3C2410_RTCSEC S3C2410_RTCREG(0x70) 64 + #define S3C2410_RTCMIN S3C2410_RTCREG(0x74) 65 + #define S3C2410_RTCHOUR S3C2410_RTCREG(0x78) 66 + #define S3C2410_RTCDATE S3C2410_RTCREG(0x7c) 67 + #define S3C2410_RTCMON S3C2410_RTCREG(0x84) 68 + #define S3C2410_RTCYEAR S3C2410_RTCREG(0x88) 69 + 70 + #endif /* __ASM_ARCH_REGS_RTC_H */
-1
drivers/staging/ste_rmi4/Makefile
··· 2 2 # Makefile for the RMI4 touchscreen driver. 3 3 # 4 4 obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += synaptics_i2c_rmi4.o 5 - obj-$(CONFIG_MACH_MOP500) += board-mop500-u8500uib-rmi4.o
-31
drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c
··· 1 - /* 2 - * Some platform data for the RMI4 touchscreen that will override the __weak 3 - * platform data in the Ux500 machine if this driver is activated. 4 - */ 5 - #include <linux/i2c.h> 6 - #include <linux/gpio.h> 7 - #include <linux/interrupt.h> 8 - #include <mach/irqs.h> 9 - #include "synaptics_i2c_rmi4.h" 10 - 11 - /* 12 - * Synaptics RMI4 touchscreen interface on the U8500 UIB 13 - */ 14 - 15 - /* 16 - * Descriptor structure. 17 - * Describes the number of i2c devices on the bus that speak RMI. 18 - */ 19 - static struct synaptics_rmi4_platform_data rmi4_i2c_dev_platformdata = { 20 - .irq_number = NOMADIK_GPIO_TO_IRQ(84), 21 - .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED), 22 - .x_flip = false, 23 - .y_flip = true, 24 - }; 25 - 26 - struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = { 27 - { 28 - I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B), 29 - .platform_data = &rmi4_i2c_dev_platformdata, 30 - }, 31 - };
+18 -13
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
··· 864 864 return 0; 865 865 } 866 866 867 + /* 868 + * Descriptor structure. 869 + * Describes the number of i2c devices on the bus that speak RMI. 870 + */ 871 + static struct synaptics_rmi4_platform_data synaptics_rmi4_platformdata = { 872 + .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED), 873 + .x_flip = false, 874 + .y_flip = true, 875 + }; 876 + 867 877 /** 868 878 * synaptics_rmi4_probe() - Initialze the i2c-client touchscreen driver 869 879 * @i2c: i2c client structure pointer ··· 900 890 return -EIO; 901 891 } 902 892 903 - if (!platformdata) { 904 - dev_err(&client->dev, "%s: no platform data\n", __func__); 905 - return -EINVAL; 906 - } 893 + if (!platformdata) 894 + platformdata = &synaptics_rmi4_platformdata; 907 895 908 896 /* Allocate and initialize the instance data for this client */ 909 897 rmi4_data = kcalloc(2, sizeof(struct synaptics_rmi4_data), ··· 985 977 synaptics_rmi4_i2c_block_read(rmi4_data, 986 978 rmi4_data->fn01_data_base_addr + 1, intr_status, 987 979 rmi4_data->number_of_interrupt_register); 988 - retval = request_threaded_irq(platformdata->irq_number, NULL, 980 + retval = request_threaded_irq(client->irq, NULL, 989 981 synaptics_rmi4_irq, 990 982 platformdata->irq_type, 991 983 DRIVER_NAME, rmi4_data); 992 984 if (retval) { 993 985 dev_err(&client->dev, "%s:Unable to get attn irq %d\n", 994 - __func__, platformdata->irq_number); 986 + __func__, client->irq); 995 987 goto err_query_dev; 996 988 } 997 989 ··· 1004 996 return retval; 1005 997 1006 998 err_free_irq: 1007 - free_irq(platformdata->irq_number, rmi4_data); 999 + free_irq(client->irq, rmi4_data); 1008 1000 err_query_dev: 1009 1001 regulator_disable(rmi4_data->regulator); 1010 1002 err_regulator_enable: ··· 1027 1019 static int synaptics_rmi4_remove(struct i2c_client *client) 1028 1020 { 1029 1021 struct synaptics_rmi4_data *rmi4_data = i2c_get_clientdata(client); 1030 - const struct synaptics_rmi4_platform_data *pdata = rmi4_data->board; 1031 1022 1032 1023 rmi4_data->touch_stopped = true; 1033 1024 wake_up(&rmi4_data->wait); 1034 - free_irq(pdata->irq_number, rmi4_data); 1025 + free_irq(client->irq, rmi4_data); 1035 1026 input_unregister_device(rmi4_data->input_dev); 1036 1027 regulator_disable(rmi4_data->regulator); 1037 1028 regulator_put(rmi4_data->regulator); ··· 1053 1046 int retval; 1054 1047 unsigned char intr_status; 1055 1048 struct synaptics_rmi4_data *rmi4_data = dev_get_drvdata(dev); 1056 - const struct synaptics_rmi4_platform_data *pdata = rmi4_data->board; 1057 1049 1058 1050 rmi4_data->touch_stopped = true; 1059 - disable_irq(pdata->irq_number); 1051 + disable_irq(rmi4_data->i2c_client->irq); 1060 1052 1061 1053 retval = synaptics_rmi4_i2c_block_read(rmi4_data, 1062 1054 rmi4_data->fn01_data_base_addr + 1, ··· 1086 1080 int retval; 1087 1081 unsigned char intr_status; 1088 1082 struct synaptics_rmi4_data *rmi4_data = dev_get_drvdata(dev); 1089 - const struct synaptics_rmi4_platform_data *pdata = rmi4_data->board; 1090 1083 1091 1084 regulator_enable(rmi4_data->regulator); 1092 1085 1093 - enable_irq(pdata->irq_number); 1086 + enable_irq(rmi4_data->i2c_client->irq); 1094 1087 rmi4_data->touch_stopped = false; 1095 1088 1096 1089 retval = synaptics_rmi4_i2c_block_read(rmi4_data,
-1
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h
··· 38 38 * This structure gives platform data for rmi4. 39 39 */ 40 40 struct synaptics_rmi4_platform_data { 41 - int irq_number; 42 41 int irq_type; 43 42 bool x_flip; 44 43 bool y_flip;
-2
drivers/thermal/exynos_thermal.c
··· 39 39 #include <linux/cpu_cooling.h> 40 40 #include <linux/of.h> 41 41 42 - #include <plat/cpu.h> 43 - 44 42 /* Exynos generic registers */ 45 43 #define EXYNOS_TMU_REG_TRIMINFO 0x0 46 44 #define EXYNOS_TMU_REG_CONTROL 0x20
+2 -8
include/linux/mfd/db8500-prcmu.h
··· 489 489 490 490 #ifdef CONFIG_MFD_DB8500_PRCMU 491 491 492 - void db8500_prcmu_early_init(void); 492 + void db8500_prcmu_early_init(u32 phy_base, u32 size); 493 493 int prcmu_set_rc_a2p(enum romcode_write); 494 494 enum romcode_read prcmu_get_rc_p2a(void); 495 495 enum ap_pwrst prcmu_get_xp70_current_state(void); ··· 522 522 void db8500_prcmu_system_reset(u16 reset_code); 523 523 int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); 524 524 u8 db8500_prcmu_get_power_state_result(void); 525 - int db8500_prcmu_gic_decouple(void); 526 - int db8500_prcmu_gic_recouple(void); 527 - int db8500_prcmu_copy_gic_settings(void); 528 - bool db8500_prcmu_gic_pending_irq(void); 529 - bool db8500_prcmu_pending_irq(void); 530 - bool db8500_prcmu_is_cpu_in_wfi(int cpu); 531 525 void db8500_prcmu_enable_wakeups(u32 wakeups); 532 526 int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); 533 527 int db8500_prcmu_request_clock(u8 clock, bool enable); ··· 547 553 548 554 #else /* !CONFIG_MFD_DB8500_PRCMU */ 549 555 550 - static inline void db8500_prcmu_early_init(void) {} 556 + static inline void db8500_prcmu_early_init(u32 phy_base, u32 size) {} 551 557 552 558 static inline int prcmu_set_rc_a2p(enum romcode_write code) 553 559 {
+5 -33
include/linux/mfd/dbx500-prcmu.h
··· 237 237 bool enable_set_ddr_opp; 238 238 bool enable_ape_opp_100_voltage; 239 239 struct ab8500_platform_data *ab_platdata; 240 + int ab_irq; 241 + int irq_base; 240 242 u32 version_offset; 241 243 u32 legacy_offset; 242 244 u32 adt_offset; ··· 278 276 279 277 #if defined(CONFIG_UX500_SOC_DB8500) 280 278 281 - static inline void __init prcmu_early_init(void) 279 + static inline void prcmu_early_init(u32 phy_base, u32 size) 282 280 { 283 - return db8500_prcmu_early_init(); 281 + return db8500_prcmu_early_init(phy_base, size); 284 282 } 285 283 286 284 static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, ··· 293 291 static inline u8 prcmu_get_power_state_result(void) 294 292 { 295 293 return db8500_prcmu_get_power_state_result(); 296 - } 297 - 298 - static inline int prcmu_gic_decouple(void) 299 - { 300 - return db8500_prcmu_gic_decouple(); 301 - } 302 - 303 - static inline int prcmu_gic_recouple(void) 304 - { 305 - return db8500_prcmu_gic_recouple(); 306 - } 307 - 308 - static inline bool prcmu_gic_pending_irq(void) 309 - { 310 - return db8500_prcmu_gic_pending_irq(); 311 - } 312 - 313 - static inline bool prcmu_is_cpu_in_wfi(int cpu) 314 - { 315 - return db8500_prcmu_is_cpu_in_wfi(cpu); 316 - } 317 - 318 - static inline int prcmu_copy_gic_settings(void) 319 - { 320 - return db8500_prcmu_copy_gic_settings(); 321 - } 322 - 323 - static inline bool prcmu_pending_irq(void) 324 - { 325 - return db8500_prcmu_pending_irq(); 326 294 } 327 295 328 296 static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) ··· 472 500 } 473 501 #else 474 502 475 - static inline void __init prcmu_early_init(void) {} 503 + static inline void prcmu_early_init(u32 phy_base, u32 size) {} 476 504 477 505 static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, 478 506 bool keep_ap_pll)
+21
include/linux/platform_data/arm-ux500-pm.h
··· 1 + /* 2 + * Copyright (C) ST-Ericsson SA 2010-2013 3 + * Author: Rickard Andersson <rickard.andersson@stericsson.com> for 4 + * ST-Ericsson. 5 + * Author: Daniel Lezcano <daniel.lezcano@linaro.org> for Linaro. 6 + * License terms: GNU General Public License (GPL) version 2 7 + * 8 + */ 9 + 10 + #ifndef ARM_UX500_PM_H 11 + #define ARM_UX500_PM_H 12 + 13 + int prcmu_gic_decouple(void); 14 + int prcmu_gic_recouple(void); 15 + bool prcmu_gic_pending_irq(void); 16 + bool prcmu_pending_irq(void); 17 + bool prcmu_is_cpu_in_wfi(int cpu); 18 + int prcmu_copy_gic_settings(void); 19 + void ux500_pm_init(u32 phy_base, u32 size); 20 + 21 + #endif /* ARM_UX500_PM_H */
+2 -1
include/linux/platform_data/clk-ux500.h
··· 10 10 #ifndef __CLK_UX500_H 11 11 #define __CLK_UX500_H 12 12 13 - void u8500_clk_init(void); 13 + void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, 14 + u32 clkrst5_base, u32 clkrst6_base); 14 15 void u9540_clk_init(void); 15 16 void u8540_clk_init(void); 16 17
+56
include/linux/platform_data/mmc-sdhci-s3c.h
··· 1 + #ifndef __PLATFORM_DATA_SDHCI_S3C_H 2 + #define __PLATFORM_DATA_SDHCI_S3C_H 3 + 4 + struct platform_device; 5 + 6 + enum cd_types { 7 + S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */ 8 + S3C_SDHCI_CD_EXTERNAL, /* use external callback */ 9 + S3C_SDHCI_CD_GPIO, /* use external gpio pin for CD line */ 10 + S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */ 11 + S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */ 12 + }; 13 + 14 + /** 15 + * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI 16 + * @max_width: The maximum number of data bits supported. 17 + * @host_caps: Standard MMC host capabilities bit field. 18 + * @host_caps2: The second standard MMC host capabilities bit field. 19 + * @cd_type: Type of Card Detection method (see cd_types enum above) 20 + * @ext_cd_init: Initialize external card detect subsystem. Called on 21 + * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL. 22 + * notify_func argument is a callback to the sdhci-s3c driver 23 + * that triggers the card detection event. Callback arguments: 24 + * dev is pointer to platform device of the host controller, 25 + * state is new state of the card (0 - removed, 1 - inserted). 26 + * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on 27 + * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL. 28 + * notify_func argument is the same callback as for ext_cd_init. 29 + * @ext_cd_gpio: gpio pin used for external CD line, valid only if 30 + * cd_type == S3C_SDHCI_CD_GPIO 31 + * @ext_cd_gpio_invert: invert values for external CD gpio line 32 + * @cfg_gpio: Configure the GPIO for a specific card bit-width 33 + * 34 + * Initialisation data specific to either the machine or the platform 35 + * for the device driver to use or call-back when configuring gpio or 36 + * card speed information. 37 + */ 38 + struct s3c_sdhci_platdata { 39 + unsigned int max_width; 40 + unsigned int host_caps; 41 + unsigned int host_caps2; 42 + unsigned int pm_caps; 43 + enum cd_types cd_type; 44 + 45 + int ext_cd_gpio; 46 + bool ext_cd_gpio_invert; 47 + int (*ext_cd_init)(void (*notify_func)(struct platform_device *, 48 + int state)); 49 + int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *, 50 + int state)); 51 + 52 + void (*cfg_gpio)(struct platform_device *dev, int width); 53 + }; 54 + 55 + 56 + #endif /* __PLATFORM_DATA_SDHCI_S3C_H */
+49
include/linux/tegra-powergate.h
··· 1 + /* 2 + * Copyright (c) 2010 Google, Inc 3 + * 4 + * Author: 5 + * Colin Cross <ccross@google.com> 6 + * 7 + * This software is licensed under the terms of the GNU General Public 8 + * License version 2, as published by the Free Software Foundation, and 9 + * may be copied, distributed, and modified under those terms. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + */ 17 + 18 + #ifndef _MACH_TEGRA_POWERGATE_H_ 19 + #define _MACH_TEGRA_POWERGATE_H_ 20 + 21 + struct clk; 22 + 23 + #define TEGRA_POWERGATE_CPU 0 24 + #define TEGRA_POWERGATE_3D 1 25 + #define TEGRA_POWERGATE_VENC 2 26 + #define TEGRA_POWERGATE_PCIE 3 27 + #define TEGRA_POWERGATE_VDEC 4 28 + #define TEGRA_POWERGATE_L2 5 29 + #define TEGRA_POWERGATE_MPE 6 30 + #define TEGRA_POWERGATE_HEG 7 31 + #define TEGRA_POWERGATE_SATA 8 32 + #define TEGRA_POWERGATE_CPU1 9 33 + #define TEGRA_POWERGATE_CPU2 10 34 + #define TEGRA_POWERGATE_CPU3 11 35 + #define TEGRA_POWERGATE_CELP 12 36 + #define TEGRA_POWERGATE_3D1 13 37 + 38 + #define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU 39 + #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 40 + 41 + int tegra_powergate_is_powered(int id); 42 + int tegra_powergate_power_on(int id); 43 + int tegra_powergate_power_off(int id); 44 + int tegra_powergate_remove_clamping(int id); 45 + 46 + /* Must be called with clk disabled, and returns with clk enabled */ 47 + int tegra_powergate_sequence_power_up(int id, struct clk *clk); 48 + 49 + #endif /* _MACH_TEGRA_POWERGATE_H_ */
-2
sound/soc/ux500/mop500_ab8500.c
··· 17 17 #include <linux/io.h> 18 18 #include <linux/clk.h> 19 19 20 - #include <mach/hardware.h> 21 - 22 20 #include <sound/soc.h> 23 21 #include <sound/soc-dapm.h> 24 22 #include <sound/pcm.h>
+1 -3
sound/soc/ux500/ux500_msp_dai.c
··· 19 19 #include <linux/clk.h> 20 20 #include <linux/regulator/consumer.h> 21 21 #include <linux/mfd/dbx500-prcmu.h> 22 - 23 - #include <mach/hardware.h> 24 - #include <mach/msp.h> 22 + #include <linux/platform_data/asoc-ux500-msp.h> 25 23 26 24 #include <sound/soc.h> 27 25 #include <sound/soc-dai.h>
+1 -3
sound/soc/ux500/ux500_msp_i2s.c
··· 20 20 #include <linux/slab.h> 21 21 #include <linux/io.h> 22 22 #include <linux/of.h> 23 - 24 - #include <mach/hardware.h> 25 - #include <mach/msp.h> 23 + #include <linux/platform_data/asoc-ux500-msp.h> 26 24 27 25 #include <sound/soc.h> 28 26
-2
sound/soc/ux500/ux500_msp_i2s.h
··· 17 17 18 18 #include <linux/platform_device.h> 19 19 20 - #include <mach/msp.h> 21 - 22 20 #define MSP_INPUT_FREQ_APB 48000000 23 21 24 22 /*** Stereo mode. Used for APB data accesses as 16 bits accesses (mono),