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

Merge tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC cleanups from Olof Johansson:
"A large cleanup branch this release, with a healthy 10k negative line
delta.

Most of this is removal of legacy (non-DT) support of shmobile
platforms. There is also removal of two non-DT platforms on OMAP, and
the plat-samsung directory is cleaned out by moving most of the
previously shared-location-but-not-actually-shared files from there to
the appropriate mach directories instead.

There are other sets of changes in here as well:

- Rob Herring removed use of set_irq_flags under all platforms and
moved to genirq alternatives

- a series of timer API conversions to set-state interface

- ep93xx, nomadik and ux500 cleanups from Linus Walleij

- __init annotation fixes from Nicolas Pitre

+ a bunch of other changes that all add up to a nice set of cleanups"

* tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (108 commits)
ARM/fb: ep93xx: switch framebuffer to use modedb only
ARM: gemini: Setup timer3 as free running timer
ARM: gemini: Use timer1 for clockevent
ARM: gemini: Add missing register definitions for gemini timer
ARM: ep93xx/timer: Migrate to new 'set-state' interface
ARM: nomadik: push accelerometer down to boards
ARM: nomadik: move l2x0 setup to device tree
ARM: nomadik: selectively enable UART0 on boards
ARM: nomadik: move hog code to use DT hogs
ARM: shmobile: Fix mismerges
ARM: ux500: simplify secondary CPU boot
ARM: SAMSUNG: remove keypad-core header in plat-samsung
ARM: SAMSUNG: local watchdog-reset header in mach-s3c64xx
ARM: SAMSUNG: local onenand-core header in mach-s3c64xx
ARM: SAMSUNG: local irq-uart header in mach-s3c64xx
ARM: SAMSUNG: local backlight header in mach-s3c64xx
ARM: SAMSUNG: local ata-core header in mach-s3c64xx
ARM: SAMSUNG: local regs-usb-hsotg-phy header in mach-s3c64xx
ARM: SAMSUNG: local spi-core header in mach-s3c24xx
ARM: SAMSUNG: local nand-core header in mach-s3c24xx
...

+1305 -10507
+4 -4
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt
··· 8 8 - interrupts : The interrupt from the HDA controller. 9 9 - clocks : Must contain an entry for each required entry in clock-names. 10 10 See ../clocks/clock-bindings.txt for details. 11 - - clock-names : Must include the following entries: hda, hdacodec_2x, hda2hdmi 11 + - clock-names : Must include the following entries: hda, hda2hdmi, hda2codec_2x 12 12 - resets : Must contain an entry for each entry in reset-names. 13 13 See ../reset/reset.txt for details. 14 - - reset-names : Must include the following entries: hda, hdacodec_2x, hda2hdmi 14 + - reset-names : Must include the following entries: hda, hda2hdmi, hda2codec_2x 15 15 16 16 Example: 17 17 ··· 24 24 <&tegra_car TEGRA124_CLK_HDA2CODEC_2X>; 25 25 clock-names = "hda", "hda2hdmi", "hda2codec_2x"; 26 26 resets = <&tegra_car 125>, /* hda */ 27 - <&tegra_car 128>; /* hda2hdmi */ 28 - <&tegra_car 111>, /* hda2codec_2x */ 27 + <&tegra_car 128>, /* hda2hdmi */ 28 + <&tegra_car 111>; /* hda2codec_2x */ 29 29 reset-names = "hda", "hda2hdmi", "hda2codec_2x"; 30 30 };
-2
MAINTAINERS
··· 1471 1471 F: arch/arm/boot/dts/r7s* 1472 1472 F: arch/arm/boot/dts/r8a* 1473 1473 F: arch/arm/boot/dts/sh* 1474 - F: arch/arm/configs/armadillo800eva_defconfig 1475 1474 F: arch/arm/configs/bockw_defconfig 1476 - F: arch/arm/configs/kzm9g_defconfig 1477 1475 F: arch/arm/configs/marzen_defconfig 1478 1476 F: arch/arm/configs/shmobile_defconfig 1479 1477 F: arch/arm/include/debug/renesas-scif.S
+5 -6
arch/arm/Kconfig
··· 268 268 depends on !ARM_PATCH_PHYS_VIRT 269 269 default DRAM_BASE if !MMU 270 270 default 0x00000000 if ARCH_EBSA110 || \ 271 - EP93XX_SDCE3_SYNC_PHYS_OFFSET || \ 272 271 ARCH_FOOTBRIDGE || \ 273 272 ARCH_INTEGRATOR || \ 274 273 ARCH_IOP13XX || \ ··· 276 277 default 0x10000000 if ARCH_OMAP1 || ARCH_RPC 277 278 default 0x20000000 if ARCH_S5PV210 278 279 default 0x70000000 if REALVIEW_HIGH_PHYS_OFFSET 279 - default 0xc0000000 if EP93XX_SDCE0_PHYS_OFFSET || ARCH_SA1100 280 - default 0xd0000000 if EP93XX_SDCE1_PHYS_OFFSET 281 - default 0xe0000000 if EP93XX_SDCE2_PHYS_OFFSET 282 - default 0xf0000000 if EP93XX_SDCE3_ASYNC_PHYS_OFFSET 280 + default 0xc0000000 if ARCH_SA1100 283 281 help 284 282 Please provide the physical address corresponding to the 285 283 location of main memory in your system. ··· 414 418 bool "EP93xx-based" 415 419 select ARCH_HAS_HOLES_MEMORYMODEL 416 420 select ARCH_REQUIRE_GPIOLIB 417 - select ARCH_USES_GETTIMEOFFSET 418 421 select ARM_AMBA 422 + select ARM_PATCH_PHYS_VIRT 419 423 select ARM_VIC 424 + select AUTO_ZRELADDR 420 425 select CLKDEV_LOOKUP 426 + select CLKSRC_MMIO 421 427 select CPU_ARM920T 428 + select GENERIC_CLOCKEVENTS 422 429 help 423 430 This enables support for the Cirrus EP93xx series of CPUs. 424 431
-4
arch/arm/boot/compressed/Makefile
··· 51 51 endif 52 52 endif 53 53 54 - ifeq ($(CONFIG_ARCH_SHMOBILE_LEGACY),y) 55 - OBJS += head-shmobile.o 56 - endif 57 - 58 54 # 59 55 # We now have a PIC decompressor implementation. Decompressors running 60 56 # from RAM should not define ZTEXTADDR. Decompressors running directly
-71
arch/arm/boot/compressed/head-shmobile.S
··· 1 - /* 2 - * The head-file for SH-Mobile ARM platforms 3 - * 4 - * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 5 - * Simon Horman <horms@verge.net.au> 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; version 2 of the License. 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 - */ 20 - 21 - #ifdef CONFIG_ZBOOT_ROM 22 - 23 - .section ".start", "ax" 24 - 25 - /* load board-specific initialization code */ 26 - #include <mach/zboot.h> 27 - 28 - adr r0, dtb_info 29 - ldmia r0, {r1, r3, r4, r5, r7} 30 - 31 - sub r0, r0, r1 @ calculate the delta offset 32 - add r5, r5, r0 @ _edata 33 - 34 - ldr lr, [r5, #0] @ check if valid DTB is present 35 - cmp lr, r3 36 - bne 0f 37 - 38 - add r9, r7, #31 @ rounded up to a multiple 39 - bic r9, r9, #31 @ ... of 32 bytes 40 - 41 - add r6, r9, r5 @ copy from _edata 42 - add r9, r9, r4 @ to MEMORY_START 43 - 44 - 1: ldmdb r6!, {r0 - r3, r10 - r12, lr} 45 - cmp r6, r5 46 - stmdb r9!, {r0 - r3, r10 - r12, lr} 47 - bhi 1b 48 - 49 - /* Success: Zero board ID, pointer to start of memory for atag/dtb */ 50 - mov r7, #0 51 - mov r8, r4 52 - b 2f 53 - 54 - .align 2 55 - dtb_info: 56 - .word dtb_info 57 - #ifndef __ARMEB__ 58 - .word 0xedfe0dd0 @ sig is 0xd00dfeed big endian 59 - #else 60 - .word 0xd00dfeed 61 - #endif 62 - .word MEMORY_START 63 - .word _edata 64 - .word 0x4000 @ maximum DTB size 65 - 0: 66 - /* Failure: Zero board ID, NULL atag/dtb */ 67 - mov r7, #0 68 - mov r8, #0 @ pass null pointer as atag 69 - 2 : 70 - 71 - #endif /* CONFIG_ZBOOT_ROM */
+1 -4
arch/arm/boot/dts/Makefile
··· 501 501 s5pv210-smdkv210.dtb \ 502 502 s5pv210-torbreck.dtb 503 503 dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += \ 504 - r8a7740-armadillo800eva.dtb \ 505 504 r8a7778-bockw.dtb \ 506 - r8a7778-bockw-reference.dtb \ 507 - r8a7779-marzen.dtb \ 508 - sh73a0-kzm9g.dtb 505 + r8a7778-bockw-reference.dtb 509 506 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += \ 510 507 emev2-kzm9d.dtb \ 511 508 r7s72100-genmai.dtb \
+31 -8
arch/arm/boot/dts/ste-nomadik-nhk15.dts
··· 17 17 }; 18 18 19 19 aliases { 20 + serial0 = &uart0; 20 21 serial1 = &uart1; 21 22 stmpe-i2c0 = &stmpe0; 22 23 stmpe-i2c1 = &stmpe1; 23 24 }; 24 25 25 26 pinctrl { 27 + uart0 { 28 + uart0_nhk_mode: uart0_mux { 29 + u0_default_mux { 30 + function = "u0"; 31 + groups = "u0txrx_a_1", "u0ctsrts_a_1"; 32 + }; 33 + }; 34 + }; 35 + 26 36 stmpe2401_1 { 27 37 stmpe2401_1_nhk_mode: stmpe2401_1_nhk { 28 38 nhk_cfg1 { ··· 83 73 }; 84 74 85 75 i2c0 { 76 + lis3lv02dl@1d { 77 + /* Accelerometer */ 78 + compatible = "st,lis3lv02dl-accel"; 79 + reg = <0x1d>; 80 + }; 86 81 stmpe0: stmpe2401@43 { 87 82 compatible = "st,stmpe2401"; 88 83 reg = <0x43>; ··· 146 131 #gpio-cells = <2>; 147 132 interrupt-controller; 148 133 #interrupt-cells = <2>; 134 + /* 135 + * This will turn off SATA so that MMC/SD 136 + * can thrive 137 + */ 138 + mmcsd-gpio { 139 + gpio-hog; 140 + gpios = <2 0x0>; 141 + output-low; 142 + line-name = "SATA EN"; 143 + }; 149 144 }; 150 145 }; 151 146 }; 152 147 153 148 amba { 149 + /* Activate RX/TX and CTS/RTS on UART 0 */ 150 + uart0: uart@101fd000 { 151 + pinctrl-names = "default"; 152 + pinctrl-0 = <&uart0_nhk_mode>; 153 + status = "okay"; 154 + }; 154 155 mmcsd: sdi@101f6000 { 155 156 cd-gpios = <&stmpe_gpio44 7 GPIO_ACTIVE_LOW>; 156 157 wp-gpios = <&stmpe_gpio44 18 GPIO_ACTIVE_HIGH>; 157 - }; 158 - }; 159 - 160 - /* Custom board node with GPIO pins to active etc */ 161 - usb-s8815 { 162 - /* This will turn off SATA so that MMC/SD can thrive */ 163 - mmcsd-gpio { 164 - gpios = <&stmpe_gpio44 2 0x1>; 165 158 }; 166 159 }; 167 160 };
+35 -9
arch/arm/boot/dts/ste-nomadik-s8815.dts
··· 16 16 }; 17 17 18 18 aliases { 19 + serial0 = &uart0; 19 20 serial1 = &uart1; 21 + }; 22 + 23 + gpio3: gpio@101e7000 { 24 + /* This hog will bias the MMC/SD card detect line */ 25 + mmcsd-gpio { 26 + gpio-hog; 27 + gpios = <16 0x0>; 28 + output-low; 29 + line-name = "card detect bias"; 30 + }; 20 31 }; 21 32 22 33 src@101e0000 { ··· 41 30 pinctrl-names = "default"; 42 31 pinctrl-0 = <&cd_default_mode>; 43 32 33 + uart0 { 34 + /* Only use RX/TX pins */ 35 + uart0_s8815_mode: uart0_mux { 36 + u0_default_mux { 37 + function = "u0"; 38 + groups = "u0txrx_a_1"; 39 + }; 40 + }; 41 + }; 44 42 mmcsd-cd { 45 43 cd_default_mode: cd_default { 46 44 cd_default_cfg1 { ··· 105 85 }; 106 86 }; 107 87 88 + i2c1 { 89 + lis3lv02dl@1d { 90 + /* Accelerometer */ 91 + compatible = "st,lis3lv02dl-accel"; 92 + reg = <0x1d>; 93 + }; 94 + }; 95 + 108 96 /* GPIO I2C connected to the USB portions of the STw4811 only */ 109 97 gpio-i2c { 110 98 compatible = "i2c-gpio"; ··· 130 102 }; 131 103 132 104 133 - /* Configure card detect for the uSD slot */ 134 105 amba { 106 + /* Activate RXTX on UART 0 */ 107 + uart0: uart@101fd000 { 108 + pinctrl-names = "default"; 109 + pinctrl-0 = <&uart0_s8815_mode>; 110 + status = "okay"; 111 + }; 112 + /* Configure card detect for the uSD slot */ 135 113 mmcsd: sdi@101f6000 { 136 114 cd-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>; 137 - }; 138 - }; 139 - 140 - /* Custom board node with GPIO pins to active etc */ 141 - usb-s8815 { 142 - /* This will bias the MMC/SD card detect line */ 143 - mmcsd-gpio { 144 - gpios = <&gpio3 16 0x1>; 145 115 }; 146 116 }; 147 117
+7 -15
arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
··· 21 21 interrupts = <30>; 22 22 cache-unified; 23 23 cache-level = <2>; 24 + cache-size = <131072>; 25 + cache-sets = <512>; 26 + cache-line-size = <32>; 27 + /* At full speed latency must be >=2 */ 28 + arm,tag-latency = <2>; 29 + arm,data-latency = <2 2>; 30 + arm,dirty-latency = <2>; 24 31 }; 25 32 26 33 mtu0: mtu@101e2000 { ··· 104 97 pinctrl { 105 98 compatible = "stericsson,stn8815-pinctrl"; 106 99 /* Pin configurations */ 107 - uart0 { 108 - uart0_default_mux: uart0_mux { 109 - u0_default_mux { 110 - function = "u0"; 111 - groups = "u0_a_1"; 112 - }; 113 - }; 114 - }; 115 100 uart1 { 116 101 uart1_default_mux: uart1_mux { 117 102 u1_default_mux { ··· 720 721 compatible = "st,stw5095"; 721 722 reg = <0x1a>; 722 723 }; 723 - lis3lv02dl@1d { 724 - /* Accelerometer */ 725 - compatible = "st,lis3lv02dl-accel"; 726 - reg = <0x1d>; 727 - }; 728 724 }; 729 725 730 726 amba { ··· 749 755 interrupts = <12>; 750 756 clocks = <&uart0clk>, <&pclkuart0>; 751 757 clock-names = "uartclk", "apb_pclk"; 752 - pinctrl-names = "default"; 753 - pinctrl-0 = <&uart0_default_mux>; 754 758 status = "disabled"; 755 759 }; 756 760
+1 -1
arch/arm/common/it8152.c
··· 91 91 for (irq = IT8152_IRQ(0); irq <= IT8152_LAST_IRQ; irq++) { 92 92 irq_set_chip_and_handler(irq, &it8152_irq_chip, 93 93 handle_level_irq); 94 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 94 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 95 95 } 96 96 } 97 97
+6 -5
arch/arm/common/locomo.c
··· 138 138 }, 139 139 }; 140 140 141 - static void locomo_handler(unsigned int irq, struct irq_desc *desc) 141 + static void locomo_handler(unsigned int __irq, struct irq_desc *desc) 142 142 { 143 - struct locomo *lchip = irq_get_chip_data(irq); 143 + struct locomo *lchip = irq_desc_get_chip_data(desc); 144 144 int req, i; 145 145 146 146 /* Acknowledge the parent IRQ */ ··· 150 150 req = locomo_readl(lchip->base + LOCOMO_ICR) & 0x0f00; 151 151 152 152 if (req) { 153 + unsigned int irq; 154 + 153 155 /* generate the next interrupt(s) */ 154 156 irq = lchip->irq_base; 155 157 for (i = 0; i <= 3; i++, irq++) { ··· 207 205 for ( ; irq <= lchip->irq_base + 3; irq++) { 208 206 irq_set_chip_and_handler(irq, &locomo_chip, handle_level_irq); 209 207 irq_set_chip_data(irq, lchip); 210 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 208 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 211 209 } 212 210 } 213 211 ··· 477 475 device_for_each_child(lchip->dev, NULL, locomo_remove_child); 478 476 479 477 if (lchip->irq != NO_IRQ) { 480 - irq_set_chained_handler(lchip->irq, NULL); 481 - irq_set_handler_data(lchip->irq, NULL); 478 + irq_set_chained_handler_and_data(lchip->irq, NULL, NULL); 482 479 } 483 480 484 481 iounmap(lchip->base);
+5 -4
arch/arm/common/sa1111.c
··· 197 197 * will call us again if there are more interrupts to process. 198 198 */ 199 199 static void 200 - sa1111_irq_handler(unsigned int irq, struct irq_desc *desc) 200 + sa1111_irq_handler(unsigned int __irq, struct irq_desc *desc) 201 201 { 202 + unsigned int irq = irq_desc_get_irq(desc); 202 203 unsigned int stat0, stat1, i; 203 - struct sa1111 *sachip = irq_get_handler_data(irq); 204 + struct sa1111 *sachip = irq_desc_get_handler_data(desc); 204 205 void __iomem *mapbase = sachip->base + SA1111_INTC; 205 206 206 207 stat0 = sa1111_readl(mapbase + SA1111_INTSTATCLR0); ··· 487 486 irq_set_chip_and_handler(irq, &sa1111_low_chip, 488 487 handle_edge_irq); 489 488 irq_set_chip_data(irq, sachip); 490 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 489 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 491 490 } 492 491 493 492 for (i = AUDXMTDMADONEA; i <= IRQ_S1_BVD1_STSCHG; i++) { ··· 495 494 irq_set_chip_and_handler(irq, &sa1111_high_chip, 496 495 handle_edge_irq); 497 496 irq_set_chip_data(irq, sachip); 498 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 497 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 499 498 } 500 499 501 500 /*
-162
arch/arm/configs/armadillo800eva_defconfig
··· 1 - CONFIG_EXPERIMENTAL=y 2 - CONFIG_SYSVIPC=y 3 - CONFIG_IKCONFIG=y 4 - CONFIG_IKCONFIG_PROC=y 5 - CONFIG_LOG_BUF_SHIFT=16 6 - # CONFIG_UTS_NS is not set 7 - # CONFIG_IPC_NS is not set 8 - # CONFIG_PID_NS is not set 9 - CONFIG_CC_OPTIMIZE_FOR_SIZE=y 10 - CONFIG_PERF_EVENTS=y 11 - CONFIG_SLAB=y 12 - CONFIG_MODULES=y 13 - CONFIG_MODULE_UNLOAD=y 14 - CONFIG_MODULE_FORCE_UNLOAD=y 15 - # CONFIG_BLK_DEV_BSG is not set 16 - # CONFIG_IOSCHED_DEADLINE is not set 17 - # CONFIG_IOSCHED_CFQ is not set 18 - CONFIG_ARCH_SHMOBILE_LEGACY=y 19 - CONFIG_ARCH_R8A7740=y 20 - CONFIG_MACH_ARMADILLO800EVA=y 21 - # CONFIG_SH_TIMER_TMU is not set 22 - CONFIG_ARM_THUMB=y 23 - CONFIG_CACHE_L2X0=y 24 - CONFIG_ARM_ERRATA_430973=y 25 - CONFIG_ARM_ERRATA_458693=y 26 - CONFIG_ARM_ERRATA_460075=y 27 - CONFIG_PL310_ERRATA_588369=y 28 - CONFIG_ARM_ERRATA_720789=y 29 - CONFIG_PL310_ERRATA_727915=y 30 - CONFIG_ARM_ERRATA_743622=y 31 - CONFIG_ARM_ERRATA_751472=y 32 - CONFIG_PL310_ERRATA_753970=y 33 - CONFIG_ARM_ERRATA_754322=y 34 - CONFIG_PL310_ERRATA_769419=y 35 - CONFIG_ARM_ERRATA_775420=y 36 - CONFIG_AEABI=y 37 - # CONFIG_OABI_COMPAT is not set 38 - CONFIG_FORCE_MAX_ZONEORDER=13 39 - CONFIG_ZBOOT_ROM_TEXT=0x0 40 - CONFIG_ZBOOT_ROM_BSS=0x0 41 - CONFIG_ARM_APPENDED_DTB=y 42 - CONFIG_KEXEC=y 43 - CONFIG_VFP=y 44 - CONFIG_NEON=y 45 - # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 46 - CONFIG_PM=y 47 - CONFIG_NET=y 48 - CONFIG_PACKET=y 49 - CONFIG_UNIX=y 50 - CONFIG_INET=y 51 - CONFIG_IP_PNP=y 52 - CONFIG_IP_PNP_DHCP=y 53 - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 54 - # CONFIG_INET_XFRM_MODE_TUNNEL is not set 55 - # CONFIG_INET_XFRM_MODE_BEET is not set 56 - # CONFIG_INET_LRO is not set 57 - # CONFIG_INET_DIAG is not set 58 - # CONFIG_IPV6 is not set 59 - # CONFIG_WIRELESS is not set 60 - CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 61 - CONFIG_DEVTMPFS=y 62 - CONFIG_DEVTMPFS_MOUNT=y 63 - CONFIG_SCSI=y 64 - CONFIG_BLK_DEV_SD=y 65 - CONFIG_MD=y 66 - CONFIG_BLK_DEV_DM=y 67 - CONFIG_NETDEVICES=y 68 - # CONFIG_NET_VENDOR_BROADCOM is not set 69 - # CONFIG_NET_VENDOR_CHELSIO is not set 70 - # CONFIG_NET_VENDOR_CIRRUS is not set 71 - # CONFIG_NET_VENDOR_FARADAY is not set 72 - # CONFIG_NET_VENDOR_INTEL is not set 73 - # CONFIG_NET_VENDOR_MARVELL is not set 74 - # CONFIG_NET_VENDOR_MICREL is not set 75 - # CONFIG_NET_VENDOR_NATSEMI is not set 76 - CONFIG_SH_ETH=y 77 - # CONFIG_NET_VENDOR_SEEQ is not set 78 - # CONFIG_NET_VENDOR_SMSC is not set 79 - # CONFIG_NET_VENDOR_STMICRO is not set 80 - # CONFIG_WLAN is not set 81 - # CONFIG_INPUT_MOUSEDEV_PSAUX is not set 82 - CONFIG_INPUT_EVDEV=y 83 - # CONFIG_KEYBOARD_ATKBD is not set 84 - CONFIG_KEYBOARD_GPIO=y 85 - # CONFIG_INPUT_MOUSE is not set 86 - CONFIG_INPUT_TOUCHSCREEN=y 87 - CONFIG_TOUCHSCREEN_ST1232=y 88 - # CONFIG_SERIO is not set 89 - # CONFIG_LEGACY_PTYS is not set 90 - CONFIG_SERIAL_SH_SCI=y 91 - CONFIG_SERIAL_SH_SCI_NR_UARTS=9 92 - CONFIG_SERIAL_SH_SCI_CONSOLE=y 93 - # CONFIG_HW_RANDOM is not set 94 - CONFIG_I2C=y 95 - CONFIG_I2C_GPIO=y 96 - CONFIG_I2C_SH_MOBILE=y 97 - # CONFIG_HWMON is not set 98 - CONFIG_REGULATOR=y 99 - CONFIG_REGULATOR_GPIO=y 100 - CONFIG_MEDIA_SUPPORT=y 101 - CONFIG_VIDEO_DEV=y 102 - CONFIG_MEDIA_CAMERA_SUPPORT=y 103 - CONFIG_V4L_PLATFORM_DRIVERS=y 104 - CONFIG_SOC_CAMERA=y 105 - CONFIG_SOC_CAMERA_MT9T112=y 106 - CONFIG_VIDEO_SH_MOBILE_CEU=y 107 - CONFIG_FB=y 108 - CONFIG_FB_SH_MOBILE_LCDC=y 109 - CONFIG_FB_SH_MOBILE_HDMI=y 110 - CONFIG_LCD_CLASS_DEVICE=y 111 - CONFIG_BACKLIGHT_PWM=y 112 - CONFIG_FRAMEBUFFER_CONSOLE=y 113 - CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y 114 - CONFIG_LOGO=y 115 - # CONFIG_LOGO_LINUX_MONO is not set 116 - # CONFIG_LOGO_LINUX_VGA16 is not set 117 - # CONFIG_SND_SUPPORT_OLD_API is not set 118 - # CONFIG_SND_VERBOSE_PROCFS is not set 119 - # CONFIG_SND_DRIVERS is not set 120 - # CONFIG_SND_ARM is not set 121 - CONFIG_SND_SOC_SH4_FSI=y 122 - # CONFIG_HID_SUPPORT is not set 123 - CONFIG_USB=y 124 - CONFIG_USB_RENESAS_USBHS=y 125 - CONFIG_USB_GADGET=y 126 - CONFIG_USB_RENESAS_USBHS_UDC=y 127 - CONFIG_USB_ETH=m 128 - CONFIG_MMC=y 129 - CONFIG_MMC_SDHI=y 130 - CONFIG_MMC_SH_MMCIF=y 131 - CONFIG_NEW_LEDS=y 132 - CONFIG_LEDS_CLASS=y 133 - CONFIG_LEDS_GPIO=y 134 - CONFIG_RTC_CLASS=y 135 - CONFIG_RTC_DRV_S35390A=y 136 - CONFIG_DMADEVICES=y 137 - CONFIG_SH_DMAE=y 138 - CONFIG_UIO=y 139 - CONFIG_UIO_PDRV_GENIRQ=y 140 - CONFIG_PWM=y 141 - CONFIG_PWM_RENESAS_TPU=y 142 - # CONFIG_DNOTIFY is not set 143 - CONFIG_MSDOS_FS=y 144 - CONFIG_VFAT_FS=y 145 - CONFIG_TMPFS=y 146 - # CONFIG_MISC_FILESYSTEMS is not set 147 - CONFIG_NFS_FS=y 148 - CONFIG_NFS_V3_ACL=y 149 - CONFIG_NFS_V4=y 150 - CONFIG_NFS_V4_1=y 151 - CONFIG_ROOT_NFS=y 152 - CONFIG_NLS_CODEPAGE_437=y 153 - CONFIG_NLS_ISO8859_1=y 154 - # CONFIG_ENABLE_WARN_DEPRECATED is not set 155 - # CONFIG_ENABLE_MUST_CHECK is not set 156 - # CONFIG_ARM_UNWIND is not set 157 - CONFIG_CRYPTO=y 158 - CONFIG_CRYPTO_CBC=y 159 - CONFIG_CRYPTO_MD5=y 160 - CONFIG_CRYPTO_DES=y 161 - CONFIG_CRYPTO_ANSI_CPRNG=y 162 - CONFIG_XZ_DEC=y
-154
arch/arm/configs/kzm9g_defconfig
··· 1 - # CONFIG_ARM_PATCH_PHYS_VIRT is not set 2 - CONFIG_EXPERIMENTAL=y 3 - # CONFIG_LOCALVERSION_AUTO is not set 4 - CONFIG_SYSVIPC=y 5 - CONFIG_IKCONFIG=y 6 - CONFIG_IKCONFIG_PROC=y 7 - CONFIG_LOG_BUF_SHIFT=16 8 - CONFIG_NAMESPACES=y 9 - # CONFIG_UTS_NS is not set 10 - # CONFIG_IPC_NS is not set 11 - # CONFIG_USER_NS is not set 12 - # CONFIG_PID_NS is not set 13 - # CONFIG_NET_NS is not set 14 - CONFIG_CC_OPTIMIZE_FOR_SIZE=y 15 - CONFIG_SYSCTL_SYSCALL=y 16 - CONFIG_EMBEDDED=y 17 - CONFIG_PERF_EVENTS=y 18 - CONFIG_SLAB=y 19 - CONFIG_MODULES=y 20 - CONFIG_MODULE_FORCE_LOAD=y 21 - CONFIG_MODULE_UNLOAD=y 22 - # CONFIG_BLK_DEV_BSG is not set 23 - # CONFIG_IOSCHED_DEADLINE is not set 24 - # CONFIG_IOSCHED_CFQ is not set 25 - CONFIG_ARCH_SHMOBILE_LEGACY=y 26 - CONFIG_ARCH_SH73A0=y 27 - CONFIG_MACH_KZM9G=y 28 - CONFIG_MEMORY_START=0x41000000 29 - CONFIG_MEMORY_SIZE=0x1f000000 30 - CONFIG_ARM_ERRATA_743622=y 31 - CONFIG_ARM_ERRATA_754322=y 32 - CONFIG_NO_HZ=y 33 - CONFIG_HIGH_RES_TIMERS=y 34 - CONFIG_SMP=y 35 - CONFIG_SCHED_MC=y 36 - CONFIG_AEABI=y 37 - # CONFIG_OABI_COMPAT is not set 38 - CONFIG_HIGHMEM=y 39 - CONFIG_ZBOOT_ROM_TEXT=0x0 40 - CONFIG_ZBOOT_ROM_BSS=0x0 41 - CONFIG_ARM_APPENDED_DTB=y 42 - CONFIG_KEXEC=y 43 - CONFIG_VFP=y 44 - CONFIG_NEON=y 45 - # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 46 - CONFIG_PM=y 47 - CONFIG_NET=y 48 - CONFIG_PACKET=y 49 - CONFIG_UNIX=y 50 - CONFIG_INET=y 51 - CONFIG_IP_PNP=y 52 - CONFIG_IP_PNP_DHCP=y 53 - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 54 - # CONFIG_INET_XFRM_MODE_TUNNEL is not set 55 - # CONFIG_INET_XFRM_MODE_BEET is not set 56 - # CONFIG_INET_LRO is not set 57 - # CONFIG_INET_DIAG is not set 58 - # CONFIG_IPV6 is not set 59 - CONFIG_IRDA=y 60 - CONFIG_SH_IRDA=y 61 - # CONFIG_WIRELESS is not set 62 - CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 63 - CONFIG_DEVTMPFS=y 64 - CONFIG_DEVTMPFS_MOUNT=y 65 - CONFIG_SCSI=y 66 - CONFIG_BLK_DEV_SD=y 67 - CONFIG_NETDEVICES=y 68 - CONFIG_SMSC911X=y 69 - # CONFIG_WLAN is not set 70 - CONFIG_INPUT_SPARSEKMAP=y 71 - # CONFIG_INPUT_MOUSEDEV is not set 72 - CONFIG_INPUT_EVDEV=y 73 - # CONFIG_KEYBOARD_ATKBD is not set 74 - CONFIG_KEYBOARD_GPIO=y 75 - # CONFIG_INPUT_MOUSE is not set 76 - CONFIG_INPUT_TOUCHSCREEN=y 77 - CONFIG_TOUCHSCREEN_ST1232=y 78 - CONFIG_INPUT_MISC=y 79 - CONFIG_INPUT_ADXL34X=y 80 - # CONFIG_LEGACY_PTYS is not set 81 - CONFIG_SERIAL_SH_SCI=y 82 - CONFIG_SERIAL_SH_SCI_NR_UARTS=9 83 - CONFIG_SERIAL_SH_SCI_CONSOLE=y 84 - # CONFIG_HW_RANDOM is not set 85 - CONFIG_I2C_CHARDEV=y 86 - CONFIG_I2C_SH_MOBILE=y 87 - CONFIG_GPIO_PCF857X=y 88 - # CONFIG_HWMON is not set 89 - CONFIG_MFD_AS3711=y 90 - CONFIG_REGULATOR=y 91 - CONFIG_REGULATOR_AS3711=y 92 - CONFIG_FB=y 93 - CONFIG_FB_SH_MOBILE_LCDC=y 94 - CONFIG_BACKLIGHT_AS3711=y 95 - CONFIG_FRAMEBUFFER_CONSOLE=y 96 - CONFIG_LOGO=y 97 - CONFIG_FB_SH_MOBILE_MERAM=y 98 - CONFIG_SOUND=y 99 - CONFIG_SND=y 100 - # CONFIG_SND_SUPPORT_OLD_API is not set 101 - # CONFIG_SND_VERBOSE_PROCFS is not set 102 - # CONFIG_SND_DRIVERS is not set 103 - # CONFIG_SND_ARM is not set 104 - # CONFIG_SND_USB is not set 105 - CONFIG_SND_SOC=y 106 - CONFIG_SND_SOC_SH4_FSI=y 107 - # CONFIG_HID_SUPPORT is not set 108 - CONFIG_USB=y 109 - CONFIG_USB_R8A66597_HCD=y 110 - CONFIG_USB_RENESAS_USBHS=y 111 - CONFIG_USB_STORAGE=y 112 - CONFIG_USB_GADGET=y 113 - CONFIG_USB_RENESAS_USBHS_UDC=y 114 - CONFIG_USB_ETH=m 115 - CONFIG_USB_MASS_STORAGE=m 116 - CONFIG_MMC=y 117 - # CONFIG_MMC_BLOCK_BOUNCE is not set 118 - CONFIG_MMC_SDHI=y 119 - CONFIG_MMC_SH_MMCIF=y 120 - CONFIG_NEW_LEDS=y 121 - CONFIG_LEDS_CLASS=y 122 - CONFIG_LEDS_GPIO=y 123 - CONFIG_RTC_CLASS=y 124 - CONFIG_RTC_DRV_RS5C372=y 125 - CONFIG_DMADEVICES=y 126 - CONFIG_SH_DMAE=y 127 - CONFIG_ASYNC_TX_DMA=y 128 - CONFIG_STAGING=y 129 - CONFIG_IIO=y 130 - CONFIG_AK8975=y 131 - # CONFIG_DNOTIFY is not set 132 - CONFIG_VFAT_FS=y 133 - CONFIG_TMPFS=y 134 - # CONFIG_MISC_FILESYSTEMS is not set 135 - CONFIG_NFS_FS=y 136 - CONFIG_NFS_V3=y 137 - CONFIG_NFS_V3_ACL=y 138 - CONFIG_NFS_V4=y 139 - CONFIG_NFS_V4_1=y 140 - CONFIG_ROOT_NFS=y 141 - CONFIG_NLS_CODEPAGE_437=y 142 - CONFIG_NLS_ISO8859_1=y 143 - # CONFIG_ENABLE_WARN_DEPRECATED is not set 144 - # CONFIG_ENABLE_MUST_CHECK is not set 145 - # CONFIG_SCHED_DEBUG is not set 146 - # CONFIG_DEBUG_PREEMPT is not set 147 - # CONFIG_DEBUG_BUGVERBOSE is not set 148 - # CONFIG_FTRACE is not set 149 - # CONFIG_ARM_UNWIND is not set 150 - CONFIG_CRYPTO=y 151 - CONFIG_CRYPTO_CBC=y 152 - CONFIG_CRYPTO_MD5=y 153 - CONFIG_CRYPTO_DES=y 154 - CONFIG_CRC16=y
+2 -2
arch/arm/kernel/irq.c
··· 140 140 static bool migrate_one_irq(struct irq_desc *desc) 141 141 { 142 142 struct irq_data *d = irq_desc_get_irq_data(desc); 143 - const struct cpumask *affinity = d->affinity; 143 + const struct cpumask *affinity = irq_data_get_affinity_mask(d); 144 144 struct irq_chip *c; 145 145 bool ret = false; 146 146 ··· 160 160 if (!c->irq_set_affinity) 161 161 pr_debug("IRQ%u: unable to set affinity\n", d->irq); 162 162 else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret) 163 - cpumask_copy(d->affinity, affinity); 163 + cpumask_copy(irq_data_get_affinity_mask(d), affinity); 164 164 165 165 return ret; 166 166 }
+1 -1
arch/arm/kernel/psci.c
··· 278 278 return err; 279 279 } 280 280 281 - static const struct of_device_id psci_of_match[] __initconst = { 281 + static const struct of_device_id const psci_of_match[] __initconst = { 282 282 { .compatible = "arm,psci", .data = psci_0_1_init}, 283 283 { .compatible = "arm,psci-0.2", .data = psci_0_2_init}, 284 284 {},
+25 -21
arch/arm/kernel/smp_twd.c
··· 36 36 static struct clock_event_device __percpu *twd_evt; 37 37 static int twd_ppi; 38 38 39 - static void twd_set_mode(enum clock_event_mode mode, 40 - struct clock_event_device *clk) 39 + static int twd_shutdown(struct clock_event_device *clk) 41 40 { 42 - unsigned long ctrl; 41 + writel_relaxed(0, twd_base + TWD_TIMER_CONTROL); 42 + return 0; 43 + } 43 44 44 - switch (mode) { 45 - case CLOCK_EVT_MODE_PERIODIC: 46 - ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE 47 - | TWD_TIMER_CONTROL_PERIODIC; 48 - writel_relaxed(DIV_ROUND_CLOSEST(twd_timer_rate, HZ), 49 - twd_base + TWD_TIMER_LOAD); 50 - break; 51 - case CLOCK_EVT_MODE_ONESHOT: 52 - /* period set, and timer enabled in 'next_event' hook */ 53 - ctrl = TWD_TIMER_CONTROL_IT_ENABLE | TWD_TIMER_CONTROL_ONESHOT; 54 - break; 55 - case CLOCK_EVT_MODE_UNUSED: 56 - case CLOCK_EVT_MODE_SHUTDOWN: 57 - default: 58 - ctrl = 0; 59 - } 45 + static int twd_set_oneshot(struct clock_event_device *clk) 46 + { 47 + /* period set, and timer enabled in 'next_event' hook */ 48 + writel_relaxed(TWD_TIMER_CONTROL_IT_ENABLE | TWD_TIMER_CONTROL_ONESHOT, 49 + twd_base + TWD_TIMER_CONTROL); 50 + return 0; 51 + } 60 52 53 + static int twd_set_periodic(struct clock_event_device *clk) 54 + { 55 + unsigned long ctrl = TWD_TIMER_CONTROL_ENABLE | 56 + TWD_TIMER_CONTROL_IT_ENABLE | 57 + TWD_TIMER_CONTROL_PERIODIC; 58 + 59 + writel_relaxed(DIV_ROUND_CLOSEST(twd_timer_rate, HZ), 60 + twd_base + TWD_TIMER_LOAD); 61 61 writel_relaxed(ctrl, twd_base + TWD_TIMER_CONTROL); 62 + return 0; 62 63 } 63 64 64 65 static int twd_set_next_event(unsigned long evt, ··· 95 94 { 96 95 struct clock_event_device *clk = raw_cpu_ptr(twd_evt); 97 96 98 - twd_set_mode(CLOCK_EVT_MODE_UNUSED, clk); 97 + twd_shutdown(clk); 99 98 disable_percpu_irq(clk->irq); 100 99 } 101 100 ··· 297 296 clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | 298 297 CLOCK_EVT_FEAT_C3STOP; 299 298 clk->rating = 350; 300 - clk->set_mode = twd_set_mode; 299 + clk->set_state_shutdown = twd_shutdown; 300 + clk->set_state_periodic = twd_set_periodic; 301 + clk->set_state_oneshot = twd_set_oneshot; 302 + clk->tick_resume = twd_shutdown; 301 303 clk->set_next_event = twd_set_next_event; 302 304 clk->irq = twd_ppi; 303 305 clk->cpumask = cpumask_of(cpu);
+1 -1
arch/arm/mach-at91/at91rm9200.c
··· 37 37 at91rm9200_pm_init(); 38 38 } 39 39 40 - static const char *at91rm9200_dt_board_compat[] __initconst = { 40 + static const char *const at91rm9200_dt_board_compat[] __initconst = { 41 41 "atmel,at91rm9200", 42 42 NULL 43 43 };
+3 -3
arch/arm/mach-at91/at91sam9.c
··· 72 72 at91sam9260_pm_init(); 73 73 } 74 74 75 - static const char *at91_dt_board_compat[] __initconst = { 75 + static const char *const at91_dt_board_compat[] __initconst = { 76 76 "atmel,at91sam9", 77 77 NULL 78 78 }; ··· 89 89 at91sam9g45_pm_init(); 90 90 } 91 91 92 - static const char *at91sam9g45_board_compat[] __initconst = { 92 + static const char *const at91sam9g45_board_compat[] __initconst = { 93 93 "atmel,at91sam9g45", 94 94 NULL 95 95 }; ··· 106 106 at91sam9x5_pm_init(); 107 107 } 108 108 109 - static const char *at91sam9x5_board_compat[] __initconst = { 109 + static const char *const at91sam9x5_board_compat[] __initconst = { 110 110 "atmel,at91sam9x5", 111 111 "atmel,at91sam9n12", 112 112 NULL
+1 -1
arch/arm/mach-at91/pm.c
··· 311 311 at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1); 312 312 } 313 313 314 - static const struct of_device_id ramc_ids[] __initconst = { 314 + static const struct of_device_id const ramc_ids[] __initconst = { 315 315 { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby }, 316 316 { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby }, 317 317 { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
+2 -2
arch/arm/mach-at91/sama5.c
··· 52 52 at91sam9x5_pm_init(); 53 53 } 54 54 55 - static const char *sama5_dt_board_compat[] __initconst = { 55 + static const char *const sama5_dt_board_compat[] __initconst = { 56 56 "atmel,sama5", 57 57 NULL 58 58 }; ··· 63 63 .dt_compat = sama5_dt_board_compat, 64 64 MACHINE_END 65 65 66 - static const char *sama5_alt_dt_board_compat[] __initconst = { 66 + static const char *const sama5_alt_dt_board_compat[] __initconst = { 67 67 "atmel,sama5d4", 68 68 NULL 69 69 };
+1 -3
arch/arm/mach-bcm/Makefile
··· 39 39 40 40 # BCM63XXx 41 41 ifeq ($(CONFIG_ARCH_BCM_63XX),y) 42 - CFLAGS_bcm63xx_headsmp.o += -march=armv7-a 43 42 obj-y += bcm63xx.o 44 - obj-$(CONFIG_SMP) += bcm63xx_smp.o bcm63xx_headsmp.o \ 45 - bcm63xx_pmb.o 43 + obj-$(CONFIG_SMP) += bcm63xx_smp.o bcm63xx_pmb.o 46 44 endif 47 45 48 46 ifeq ($(CONFIG_ARCH_BRCMSTB),y)
-23
arch/arm/mach-bcm/bcm63xx_headsmp.S
··· 1 - /* 2 - * Copyright (C) 2015, Broadcom Corporation 3 - * 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 version 2 as 7 - * published by the Free Software Foundation. 8 - */ 9 - #include <linux/linkage.h> 10 - #include <linux/init.h> 11 - #include <asm/assembler.h> 12 - 13 - ENTRY(bcm63138_secondary_startup) 14 - ARM_BE8(setend be) 15 - /* 16 - * L1 cache does have unpredictable contents at power-up clean its 17 - * contents without flushing 18 - */ 19 - bl v7_invalidate_l1 20 - nop 21 - 22 - b secondary_startup 23 - ENDPROC(bcm63138_secondary_startup)
+2 -2
arch/arm/mach-bcm/bcm63xx_smp.c
··· 127 127 } 128 128 129 129 /* Locate the secondary CPU node */ 130 - dn = of_get_cpu_node(cpu_logical_map(cpu), NULL); 130 + dn = of_get_cpu_node(cpu, NULL); 131 131 if (!dn) { 132 132 pr_err("SMP: failed to locate secondary CPU%d node\n", cpu); 133 133 ret = -ENODEV; ··· 135 135 } 136 136 137 137 /* Write the secondary init routine to the BootLUT reset vector */ 138 - val = virt_to_phys(bcm63138_secondary_startup); 138 + val = virt_to_phys(secondary_startup); 139 139 writel_relaxed(val, bootlut_base + BOOTLUT_RESET_VECT); 140 140 141 141 /* Power up the core, will jump straight to its reset vector when we
-1
arch/arm/mach-bcm/bcm63xx_smp.h
··· 3 3 4 4 struct device_node; 5 5 6 - extern void bcm63138_secondary_startup(void); 7 6 extern int bcm63xx_pmb_power_on_cpu(struct device_node *dn); 8 7 9 8 #endif /* __BCM63XX_SMP_H */
+1 -1
arch/arm/mach-bcm/bcm_5301x.c
··· 44 44 "imprecise external abort"); 45 45 } 46 46 47 - static const char __initconst *bcm5301x_dt_compat[] = { 47 + static const char *const bcm5301x_dt_compat[] __initconst = { 48 48 "brcm,bcm4708", 49 49 NULL, 50 50 };
+1 -1
arch/arm/mach-bcm/bcm_kona_smc.c
··· 33 33 unsigned result; 34 34 }; 35 35 36 - static const struct of_device_id bcm_kona_smc_ids[] __initconst = { 36 + static const struct of_device_id const bcm_kona_smc_ids[] __initconst = { 37 37 {.compatible = "brcm,kona-smc"}, 38 38 {.compatible = "bcm,kona-smc"}, /* deprecated name */ 39 39 {},
+1 -1
arch/arm/mach-clps711x/board-autcpu12.c
··· 160 160 }, 161 161 }; 162 162 163 - static const struct gpio autcpu12_gpios[] __initconst = { 163 + static const struct gpio const autcpu12_gpios[] __initconst = { 164 164 { AUTCPU12_DPOT_CS, GPIOF_OUT_INIT_HIGH, "DPOT CS" }, 165 165 { AUTCPU12_DPOT_CLK, GPIOF_OUT_INIT_LOW, "DPOT CLK" }, 166 166 { AUTCPU12_DPOT_UD, GPIOF_OUT_INIT_LOW, "DPOT UD" },
+33 -26
arch/arm/mach-cns3xxx/core.c
··· 113 113 */ 114 114 static void __iomem *cns3xxx_tmr1; 115 115 116 - static void cns3xxx_timer_set_mode(enum clock_event_mode mode, 117 - struct clock_event_device *clk) 116 + static int cns3xxx_shutdown(struct clock_event_device *clk) 117 + { 118 + writel(0, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); 119 + return 0; 120 + } 121 + 122 + static int cns3xxx_set_oneshot(struct clock_event_device *clk) 123 + { 124 + unsigned long ctrl = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); 125 + 126 + /* period set, and timer enabled in 'next_event' hook */ 127 + ctrl |= (1 << 2) | (1 << 9); 128 + writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); 129 + return 0; 130 + } 131 + 132 + static int cns3xxx_set_periodic(struct clock_event_device *clk) 118 133 { 119 134 unsigned long ctrl = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); 120 135 int pclk = cns3xxx_cpu_clock() / 8; 121 136 int reload; 122 137 123 - switch (mode) { 124 - case CLOCK_EVT_MODE_PERIODIC: 125 - reload = pclk * 20 / (3 * HZ) * 0x25000; 126 - writel(reload, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); 127 - ctrl |= (1 << 0) | (1 << 2) | (1 << 9); 128 - break; 129 - case CLOCK_EVT_MODE_ONESHOT: 130 - /* period set, and timer enabled in 'next_event' hook */ 131 - ctrl |= (1 << 2) | (1 << 9); 132 - break; 133 - case CLOCK_EVT_MODE_UNUSED: 134 - case CLOCK_EVT_MODE_SHUTDOWN: 135 - default: 136 - ctrl = 0; 137 - } 138 - 138 + reload = pclk * 20 / (3 * HZ) * 0x25000; 139 + writel(reload, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); 140 + ctrl |= (1 << 0) | (1 << 2) | (1 << 9); 139 141 writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); 142 + return 0; 140 143 } 141 144 142 145 static int cns3xxx_timer_set_next_event(unsigned long evt, ··· 154 151 } 155 152 156 153 static struct clock_event_device cns3xxx_tmr1_clockevent = { 157 - .name = "cns3xxx timer1", 158 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 159 - .set_mode = cns3xxx_timer_set_mode, 160 - .set_next_event = cns3xxx_timer_set_next_event, 161 - .rating = 350, 162 - .cpumask = cpu_all_mask, 154 + .name = "cns3xxx timer1", 155 + .features = CLOCK_EVT_FEAT_PERIODIC | 156 + CLOCK_EVT_FEAT_ONESHOT, 157 + .set_state_shutdown = cns3xxx_shutdown, 158 + .set_state_periodic = cns3xxx_set_periodic, 159 + .set_state_oneshot = cns3xxx_set_oneshot, 160 + .tick_resume = cns3xxx_shutdown, 161 + .set_next_event = cns3xxx_timer_set_next_event, 162 + .rating = 350, 163 + .cpumask = cpu_all_mask, 163 164 }; 164 165 165 166 static void __init cns3xxx_clockevents_init(unsigned int timer_irq) ··· 346 339 .power_off = csn3xxx_usb_power_off, 347 340 }; 348 341 349 - static struct of_dev_auxdata cns3xxx_auxdata[] __initconst = { 342 + static const struct of_dev_auxdata const cns3xxx_auxdata[] __initconst = { 350 343 { "intel,usb-ehci", CNS3XXX_USB_BASE, "ehci-platform", &cns3xxx_usb_ehci_pdata }, 351 344 { "intel,usb-ohci", CNS3XXX_USB_OHCI_BASE, "ohci-platform", &cns3xxx_usb_ohci_pdata }, 352 345 { "cavium,cns3420-ahci", CNS3XXX_SATA2_BASE, "ahci", NULL }, ··· 399 392 cns3xxx_auxdata, NULL); 400 393 } 401 394 402 - static const char *cns3xxx_dt_compat[] __initdata = { 395 + static const char *const cns3xxx_dt_compat[] __initconst = { 403 396 "cavium,cns3410", 404 397 "cavium,cns3420", 405 398 NULL,
+1 -1
arch/arm/mach-davinci/cp_intc.c
··· 112 112 pr_debug("cp_intc_host_map(%d, 0x%lx)\n", virq, hw); 113 113 114 114 irq_set_chip(virq, &cp_intc_irq_chip); 115 - set_irq_flags(virq, IRQF_VALID | IRQF_PROBE); 115 + irq_set_probe(virq); 116 116 irq_set_handler(virq, handle_edge_irq); 117 117 return 0; 118 118 }
+2 -2
arch/arm/mach-davinci/da850.c
··· 715 715 -1 716 716 }; 717 717 718 - const short da850_vpif_capture_pins[] __initdata = { 718 + const short da850_vpif_capture_pins[] __initconst = { 719 719 DA850_VPIF_DIN0, DA850_VPIF_DIN1, DA850_VPIF_DIN2, DA850_VPIF_DIN3, 720 720 DA850_VPIF_DIN4, DA850_VPIF_DIN5, DA850_VPIF_DIN6, DA850_VPIF_DIN7, 721 721 DA850_VPIF_DIN8, DA850_VPIF_DIN9, DA850_VPIF_DIN10, DA850_VPIF_DIN11, ··· 725 725 -1 726 726 }; 727 727 728 - const short da850_vpif_display_pins[] __initdata = { 728 + const short da850_vpif_display_pins[] __initconst = { 729 729 DA850_VPIF_DOUT0, DA850_VPIF_DOUT1, DA850_VPIF_DOUT2, DA850_VPIF_DOUT3, 730 730 DA850_VPIF_DOUT4, DA850_VPIF_DOUT5, DA850_VPIF_DOUT6, DA850_VPIF_DOUT7, 731 731 DA850_VPIF_DOUT8, DA850_VPIF_DOUT9, DA850_VPIF_DOUT10,
+2 -2
arch/arm/mach-davinci/da8xx-dt.c
··· 20 20 21 21 #define DA8XX_NUM_UARTS 3 22 22 23 - static const struct of_device_id da8xx_irq_match[] __initconst = { 23 + static const struct of_device_id const da8xx_irq_match[] __initconst = { 24 24 { .compatible = "ti,cp-intc", .data = cp_intc_of_init, }, 25 25 { } 26 26 }; ··· 59 59 60 60 } 61 61 62 - static const char *da850_boards_compat[] __initdata = { 62 + static const char *const da850_boards_compat[] __initconst = { 63 63 "enbw,cmc", 64 64 "ti,da850-evm", 65 65 "ti,da850",
+30 -24
arch/arm/mach-davinci/time.c
··· 303 303 return 0; 304 304 } 305 305 306 - static void davinci_set_mode(enum clock_event_mode mode, 307 - struct clock_event_device *evt) 306 + static int davinci_shutdown(struct clock_event_device *evt) 308 307 { 309 308 struct timer_s *t = &timers[TID_CLOCKEVENT]; 310 309 311 - switch (mode) { 312 - case CLOCK_EVT_MODE_PERIODIC: 313 - t->period = davinci_clock_tick_rate / (HZ); 314 - t->opts &= ~TIMER_OPTS_STATE_MASK; 315 - t->opts |= TIMER_OPTS_PERIODIC; 316 - timer32_config(t); 317 - break; 318 - case CLOCK_EVT_MODE_ONESHOT: 319 - t->opts &= ~TIMER_OPTS_STATE_MASK; 320 - t->opts |= TIMER_OPTS_ONESHOT; 321 - break; 322 - case CLOCK_EVT_MODE_UNUSED: 323 - case CLOCK_EVT_MODE_SHUTDOWN: 324 - t->opts &= ~TIMER_OPTS_STATE_MASK; 325 - t->opts |= TIMER_OPTS_DISABLED; 326 - break; 327 - case CLOCK_EVT_MODE_RESUME: 328 - break; 329 - } 310 + t->opts &= ~TIMER_OPTS_STATE_MASK; 311 + t->opts |= TIMER_OPTS_DISABLED; 312 + return 0; 313 + } 314 + 315 + static int davinci_set_oneshot(struct clock_event_device *evt) 316 + { 317 + struct timer_s *t = &timers[TID_CLOCKEVENT]; 318 + 319 + t->opts &= ~TIMER_OPTS_STATE_MASK; 320 + t->opts |= TIMER_OPTS_ONESHOT; 321 + return 0; 322 + } 323 + 324 + static int davinci_set_periodic(struct clock_event_device *evt) 325 + { 326 + struct timer_s *t = &timers[TID_CLOCKEVENT]; 327 + 328 + t->period = davinci_clock_tick_rate / (HZ); 329 + t->opts &= ~TIMER_OPTS_STATE_MASK; 330 + t->opts |= TIMER_OPTS_PERIODIC; 331 + timer32_config(t); 332 + return 0; 330 333 } 331 334 332 335 static struct clock_event_device clockevent_davinci = { 333 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 334 - .set_next_event = davinci_set_next_event, 335 - .set_mode = davinci_set_mode, 336 + .features = CLOCK_EVT_FEAT_PERIODIC | 337 + CLOCK_EVT_FEAT_ONESHOT, 338 + .set_next_event = davinci_set_next_event, 339 + .set_state_shutdown = davinci_shutdown, 340 + .set_state_periodic = davinci_set_periodic, 341 + .set_state_oneshot = davinci_set_oneshot, 336 342 }; 337 343 338 344
+1 -1
arch/arm/mach-digicolor/digicolor.c
··· 8 8 9 9 #include <asm/mach/arch.h> 10 10 11 - static const char *digicolor_dt_compat[] __initconst = { 11 + static const char *const digicolor_dt_compat[] __initconst = { 12 12 "cnxt,cx92755", 13 13 NULL, 14 14 };
+3 -2
arch/arm/mach-dove/irq.c
··· 69 69 .irq_ack = pmu_irq_ack, 70 70 }; 71 71 72 - static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc) 72 + static void pmu_irq_handler(unsigned int __irq, struct irq_desc *desc) 73 73 { 74 + unsigned int irq = irq_desc_get_irq(desc); 74 75 unsigned long cause = readl(PMU_INTERRUPT_CAUSE); 75 76 76 77 cause &= readl(PMU_INTERRUPT_MASK); ··· 173 172 for (i = IRQ_DOVE_PMU_START; i < NR_IRQS; i++) { 174 173 irq_set_chip_and_handler(i, &pmu_irq_chip, handle_level_irq); 175 174 irq_set_status_flags(i, IRQ_LEVEL); 176 - set_irq_flags(i, IRQF_VALID); 175 + irq_clear_status_flags(i, IRQ_NOREQUEST); 177 176 } 178 177 irq_set_chained_handler(IRQ_DOVE_PMU, pmu_irq_handler); 179 178 }
+1 -1
arch/arm/mach-ebsa110/core.c
··· 65 65 for (irq = 0; irq < NR_IRQS; irq++) { 66 66 irq_set_chip_and_handler(irq, &ebsa110_irq_chip, 67 67 handle_level_irq); 68 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 68 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 69 69 } 70 70 } 71 71
-54
arch/arm/mach-ep93xx/Kconfig
··· 15 15 16 16 comment "EP93xx Platforms" 17 17 18 - choice 19 - prompt "EP93xx first SDRAM bank selection" 20 - default EP93XX_SDCE3_SYNC_PHYS_OFFSET 21 - 22 - config EP93XX_SDCE3_SYNC_PHYS_OFFSET 23 - bool "0x00000000 - SDCE3/SyncBoot" 24 - help 25 - Select this option if you want support for EP93xx boards with the 26 - first SDRAM bank at 0x00000000. 27 - 28 - config EP93XX_SDCE0_PHYS_OFFSET 29 - bool "0xc0000000 - SDCEO" 30 - help 31 - Select this option if you want support for EP93xx boards with the 32 - first SDRAM bank at 0xc0000000. 33 - 34 - config EP93XX_SDCE1_PHYS_OFFSET 35 - bool "0xd0000000 - SDCE1" 36 - help 37 - Select this option if you want support for EP93xx boards with the 38 - first SDRAM bank at 0xd0000000. 39 - 40 - config EP93XX_SDCE2_PHYS_OFFSET 41 - bool "0xe0000000 - SDCE2" 42 - help 43 - Select this option if you want support for EP93xx boards with the 44 - first SDRAM bank at 0xe0000000. 45 - 46 - config EP93XX_SDCE3_ASYNC_PHYS_OFFSET 47 - bool "0xf0000000 - SDCE3/AsyncBoot" 48 - help 49 - Select this option if you want support for EP93xx boards with the 50 - first SDRAM bank at 0xf0000000. 51 - 52 - endchoice 53 - 54 18 config MACH_ADSSPHERE 55 19 bool "Support ADS Sphere" 56 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 57 20 help 58 21 Say 'Y' here if you want your kernel to support the ADS 59 22 Sphere board. ··· 26 63 27 64 config MACH_EDB9301 28 65 bool "Support Cirrus Logic EDB9301" 29 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 30 66 select MACH_EDB93XX 31 67 help 32 68 Say 'Y' here if you want your kernel to support the Cirrus ··· 33 71 34 72 config MACH_EDB9302 35 73 bool "Support Cirrus Logic EDB9302" 36 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 37 74 select MACH_EDB93XX 38 75 help 39 76 Say 'Y' here if you want your kernel to support the Cirrus ··· 40 79 41 80 config MACH_EDB9302A 42 81 bool "Support Cirrus Logic EDB9302A" 43 - depends on EP93XX_SDCE0_PHYS_OFFSET 44 82 select MACH_EDB93XX 45 83 help 46 84 Say 'Y' here if you want your kernel to support the Cirrus ··· 47 87 48 88 config MACH_EDB9307 49 89 bool "Support Cirrus Logic EDB9307" 50 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 51 90 select MACH_EDB93XX 52 91 help 53 92 Say 'Y' here if you want your kernel to support the Cirrus ··· 54 95 55 96 config MACH_EDB9307A 56 97 bool "Support Cirrus Logic EDB9307A" 57 - depends on EP93XX_SDCE0_PHYS_OFFSET 58 98 select MACH_EDB93XX 59 99 help 60 100 Say 'Y' here if you want your kernel to support the Cirrus ··· 61 103 62 104 config MACH_EDB9312 63 105 bool "Support Cirrus Logic EDB9312" 64 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 65 106 select MACH_EDB93XX 66 107 help 67 108 Say 'Y' here if you want your kernel to support the Cirrus ··· 68 111 69 112 config MACH_EDB9315 70 113 bool "Support Cirrus Logic EDB9315" 71 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 72 114 select MACH_EDB93XX 73 115 help 74 116 Say 'Y' here if you want your kernel to support the Cirrus ··· 75 119 76 120 config MACH_EDB9315A 77 121 bool "Support Cirrus Logic EDB9315A" 78 - depends on EP93XX_SDCE0_PHYS_OFFSET 79 122 select MACH_EDB93XX 80 123 help 81 124 Say 'Y' here if you want your kernel to support the Cirrus 82 125 Logic EDB9315A Evaluation Board. 83 126 84 127 config MACH_GESBC9312 85 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 86 128 bool "Support Glomation GESBC-9312-sx" 87 129 help 88 130 Say 'Y' here if you want your kernel to support the Glomation ··· 91 137 92 138 config MACH_MICRO9H 93 139 bool "Support Contec Micro9-High" 94 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 95 140 select MACH_MICRO9 96 141 help 97 142 Say 'Y' here if you want your kernel to support the ··· 98 145 99 146 config MACH_MICRO9M 100 147 bool "Support Contec Micro9-Mid" 101 - depends on EP93XX_SDCE3_ASYNC_PHYS_OFFSET 102 148 select MACH_MICRO9 103 149 help 104 150 Say 'Y' here if you want your kernel to support the ··· 105 153 106 154 config MACH_MICRO9L 107 155 bool "Support Contec Micro9-Lite" 108 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 109 156 select MACH_MICRO9 110 157 help 111 158 Say 'Y' here if you want your kernel to support the ··· 112 161 113 162 config MACH_MICRO9S 114 163 bool "Support Contec Micro9-Slim" 115 - depends on EP93XX_SDCE3_ASYNC_PHYS_OFFSET 116 164 select MACH_MICRO9 117 165 help 118 166 Say 'Y' here if you want your kernel to support the ··· 119 169 120 170 config MACH_SIM_ONE 121 171 bool "Support Simplemachines Sim.One board" 122 - depends on EP93XX_SDCE0_PHYS_OFFSET 123 172 help 124 173 Say 'Y' here if you want your kernel to support the 125 174 Simplemachines Sim.One board. 126 175 127 176 config MACH_SNAPPER_CL15 128 177 bool "Support Bluewater Systems Snapper CL15 Module" 129 - depends on EP93XX_SDCE0_PHYS_OFFSET 130 178 help 131 179 Say 'Y' here if you want your kernel to support the Bluewater 132 180 Systems Snapper CL15 Module. 133 181 134 182 config MACH_TS72XX 135 183 bool "Support Technologic Systems TS-72xx SBC" 136 - depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 137 184 help 138 185 Say 'Y' here if you want your kernel to support the 139 186 Technologic Systems TS-72xx board. 140 187 141 188 config MACH_VISION_EP9307 142 189 bool "Support Vision Engraving Systems EP9307 SoM" 143 - depends on EP93XX_SDCE0_PHYS_OFFSET 144 190 help 145 191 Say 'Y' here if you want your kernel to support the 146 192 Vision Engraving Systems EP9307 SoM.
+1 -1
arch/arm/mach-ep93xx/Makefile
··· 1 1 # 2 2 # Makefile for the linux kernel. 3 3 # 4 - obj-y := core.o clock.o 4 + obj-y := core.o clock.o timer-ep93xx.o 5 5 6 6 obj-$(CONFIG_EP93XX_DMA) += dma.o 7 7
+1 -14
arch/arm/mach-ep93xx/Makefile.boot
··· 1 - zreladdr-$(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET) += 0x00008000 2 - params_phys-$(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET) := 0x00000100 3 - 4 - zreladdr-$(CONFIG_EP93XX_SDCE0_PHYS_OFFSET) += 0xc0008000 5 - params_phys-$(CONFIG_EP93XX_SDCE0_PHYS_OFFSET) := 0xc0000100 6 - 7 - zreladdr-$(CONFIG_EP93XX_SDCE1_PHYS_OFFSET) += 0xd0008000 8 - params_phys-$(CONFIG_EP93XX_SDCE1_PHYS_OFFSET) := 0xd0000100 9 - 10 - zreladdr-$(CONFIG_EP93XX_SDCE2_PHYS_OFFSET) += 0xe0008000 11 - params_phys-$(CONFIG_EP93XX_SDCE2_PHYS_OFFSET) := 0xe0000100 12 - 13 - zreladdr-$(CONFIG_EP93XX_SDCE3_ASYNC_PHYS_OFFSET) += 0xf0008000 14 - params_phys-$(CONFIG_EP93XX_SDCE3_ASYNC_PHYS_OFFSET) := 0xf0000100 1 + # Empty file waiting for deletion once Makefile.boot isn't needed any more.
+7 -109
arch/arm/mach-ep93xx/core.c
··· 22 22 #include <linux/interrupt.h> 23 23 #include <linux/dma-mapping.h> 24 24 #include <linux/sys_soc.h> 25 - #include <linux/timex.h> 26 25 #include <linux/irq.h> 27 26 #include <linux/io.h> 28 27 #include <linux/gpio.h> ··· 37 38 #include <linux/irqchip/arm-vic.h> 38 39 #include <linux/reboot.h> 39 40 #include <linux/usb/ohci_pdriver.h> 41 + #include <linux/random.h> 40 42 41 43 #include <mach/hardware.h> 42 44 #include <linux/platform_data/video-ep93xx.h> ··· 47 47 48 48 #include <asm/mach/arch.h> 49 49 #include <asm/mach/map.h> 50 - #include <asm/mach/time.h> 51 50 52 51 #include "soc.h" 53 52 ··· 71 72 { 72 73 iotable_init(ep93xx_io_desc, ARRAY_SIZE(ep93xx_io_desc)); 73 74 } 74 - 75 - 76 - /************************************************************************* 77 - * Timer handling for EP93xx 78 - ************************************************************************* 79 - * The ep93xx has four internal timers. Timers 1, 2 (both 16 bit) and 80 - * 3 (32 bit) count down at 508 kHz, are self-reloading, and can generate 81 - * an interrupt on underflow. Timer 4 (40 bit) counts down at 983.04 kHz, 82 - * is free-running, and can't generate interrupts. 83 - * 84 - * The 508 kHz timers are ideal for use for the timer interrupt, as the 85 - * most common values of HZ divide 508 kHz nicely. We pick one of the 16 86 - * bit timers (timer 1) since we don't need more than 16 bits of reload 87 - * value as long as HZ >= 8. 88 - * 89 - * The higher clock rate of timer 4 makes it a better choice than the 90 - * other timers for use in gettimeoffset(), while the fact that it can't 91 - * generate interrupts means we don't have to worry about not being able 92 - * to use this timer for something else. We also use timer 4 for keeping 93 - * track of lost jiffies. 94 - */ 95 - #define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x)) 96 - #define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00) 97 - #define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04) 98 - #define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08) 99 - #define EP93XX_TIMER123_CONTROL_ENABLE (1 << 7) 100 - #define EP93XX_TIMER123_CONTROL_MODE (1 << 6) 101 - #define EP93XX_TIMER123_CONTROL_CLKSEL (1 << 3) 102 - #define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c) 103 - #define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20) 104 - #define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24) 105 - #define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28) 106 - #define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c) 107 - #define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60) 108 - #define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64) 109 - #define EP93XX_TIMER4_VALUE_HIGH_ENABLE (1 << 8) 110 - #define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80) 111 - #define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84) 112 - #define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88) 113 - #define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c) 114 - 115 - #define EP93XX_TIMER123_CLOCK 508469 116 - #define EP93XX_TIMER4_CLOCK 983040 117 - 118 - #define TIMER1_RELOAD ((EP93XX_TIMER123_CLOCK / HZ) - 1) 119 - #define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(EP93XX_TIMER4_CLOCK, HZ) 120 - 121 - static unsigned int last_jiffy_time; 122 - 123 - static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id) 124 - { 125 - /* Writing any value clears the timer interrupt */ 126 - __raw_writel(1, EP93XX_TIMER1_CLEAR); 127 - 128 - /* Recover lost jiffies */ 129 - while ((signed long) 130 - (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time) 131 - >= TIMER4_TICKS_PER_JIFFY) { 132 - last_jiffy_time += TIMER4_TICKS_PER_JIFFY; 133 - timer_tick(); 134 - } 135 - 136 - return IRQ_HANDLED; 137 - } 138 - 139 - static struct irqaction ep93xx_timer_irq = { 140 - .name = "ep93xx timer", 141 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 142 - .handler = ep93xx_timer_interrupt, 143 - }; 144 - 145 - static u32 ep93xx_gettimeoffset(void) 146 - { 147 - int offset; 148 - 149 - offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time; 150 - 151 - /* 152 - * Timer 4 is based on a 983.04 kHz reference clock, 153 - * so dividing by 983040 gives the fraction of a second, 154 - * so dividing by 0.983040 converts to uS. 155 - * Refactor the calculation to avoid overflow. 156 - * Finally, multiply by 1000 to give nS. 157 - */ 158 - return (offset + (53 * offset / 3072)) * 1000; 159 - } 160 - 161 - void __init ep93xx_timer_init(void) 162 - { 163 - u32 tmode = EP93XX_TIMER123_CONTROL_MODE | 164 - EP93XX_TIMER123_CONTROL_CLKSEL; 165 - 166 - arch_gettimeoffset = ep93xx_gettimeoffset; 167 - 168 - /* Enable periodic HZ timer. */ 169 - __raw_writel(tmode, EP93XX_TIMER1_CONTROL); 170 - __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD); 171 - __raw_writel(tmode | EP93XX_TIMER123_CONTROL_ENABLE, 172 - EP93XX_TIMER1_CONTROL); 173 - 174 - /* Enable lost jiffy timer. */ 175 - __raw_writel(EP93XX_TIMER4_VALUE_HIGH_ENABLE, 176 - EP93XX_TIMER4_VALUE_HIGH); 177 - 178 - setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); 179 - } 180 - 181 75 182 76 /************************************************************************* 183 77 * EP93xx IRQ handling ··· 862 970 863 971 if (id != id2) 864 972 return "invalid"; 973 + 974 + /* Toss the unique ID into the entropy pool */ 975 + add_device_randomness(&id2, 4); 976 + add_device_randomness(&id3, 4); 977 + add_device_randomness(&id4, 4); 978 + add_device_randomness(&id5, 4); 865 979 866 980 snprintf(ep93xx_soc_id, sizeof(ep93xx_soc_id), 867 981 "%08x%08x%08x%08x", id2, id3, id4, id5);
-2
arch/arm/mach-ep93xx/edb93xx.c
··· 205 205 * EDB93xx framebuffer 206 206 *************************************************************************/ 207 207 static struct ep93xxfb_mach_info __initdata edb93xxfb_info = { 208 - .num_modes = EP93XXFB_USE_MODEDB, 209 - .bpp = 16, 210 208 .flags = 0, 211 209 }; 212 210
+1 -2
arch/arm/mach-ep93xx/simone.c
··· 40 40 }; 41 41 42 42 static struct ep93xxfb_mach_info __initdata simone_fb_info = { 43 - .num_modes = EP93XXFB_USE_MODEDB, 44 - .bpp = 16, 45 43 .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, 46 44 }; 47 45 ··· 167 169 168 170 static struct ep93xx_spi_info simone_spi_info __initdata = { 169 171 .num_chipselect = ARRAY_SIZE(simone_spi_devices), 172 + .use_dma = 1, 170 173 }; 171 174 172 175 static struct i2c_gpio_platform_data __initdata simone_i2c_gpio_data = {
-2
arch/arm/mach-ep93xx/snappercl15.c
··· 144 144 }; 145 145 146 146 static struct ep93xxfb_mach_info __initdata snappercl15_fb_info = { 147 - .num_modes = EP93XXFB_USE_MODEDB, 148 - .bpp = 16, 149 147 }; 150 148 151 149 static struct platform_device snappercl15_audio_device = {
+143
arch/arm/mach-ep93xx/timer-ep93xx.c
··· 1 + #include <linux/kernel.h> 2 + #include <linux/init.h> 3 + #include <linux/clocksource.h> 4 + #include <linux/clockchips.h> 5 + #include <linux/sched_clock.h> 6 + #include <linux/interrupt.h> 7 + #include <linux/irq.h> 8 + #include <linux/io.h> 9 + #include <asm/mach/time.h> 10 + #include "soc.h" 11 + 12 + /************************************************************************* 13 + * Timer handling for EP93xx 14 + ************************************************************************* 15 + * The ep93xx has four internal timers. Timers 1, 2 (both 16 bit) and 16 + * 3 (32 bit) count down at 508 kHz, are self-reloading, and can generate 17 + * an interrupt on underflow. Timer 4 (40 bit) counts down at 983.04 kHz, 18 + * is free-running, and can't generate interrupts. 19 + * 20 + * The 508 kHz timers are ideal for use for the timer interrupt, as the 21 + * most common values of HZ divide 508 kHz nicely. We pick the 32 bit 22 + * timer (timer 3) to get as long sleep intervals as possible when using 23 + * CONFIG_NO_HZ. 24 + * 25 + * The higher clock rate of timer 4 makes it a better choice than the 26 + * other timers for use as clock source and for sched_clock(), providing 27 + * a stable 40 bit time base. 28 + ************************************************************************* 29 + */ 30 + #define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x)) 31 + #define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00) 32 + #define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04) 33 + #define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08) 34 + #define EP93XX_TIMER123_CONTROL_ENABLE (1 << 7) 35 + #define EP93XX_TIMER123_CONTROL_MODE (1 << 6) 36 + #define EP93XX_TIMER123_CONTROL_CLKSEL (1 << 3) 37 + #define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c) 38 + #define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20) 39 + #define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24) 40 + #define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28) 41 + #define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c) 42 + #define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60) 43 + #define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64) 44 + #define EP93XX_TIMER4_VALUE_HIGH_ENABLE (1 << 8) 45 + #define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80) 46 + #define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84) 47 + #define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88) 48 + #define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c) 49 + 50 + #define EP93XX_TIMER123_RATE 508469 51 + #define EP93XX_TIMER4_RATE 983040 52 + 53 + static u64 notrace ep93xx_read_sched_clock(void) 54 + { 55 + u64 ret; 56 + 57 + ret = readl(EP93XX_TIMER4_VALUE_LOW); 58 + ret |= ((u64) (readl(EP93XX_TIMER4_VALUE_HIGH) & 0xff) << 32); 59 + return ret; 60 + } 61 + 62 + cycle_t ep93xx_clocksource_read(struct clocksource *c) 63 + { 64 + u64 ret; 65 + 66 + ret = readl(EP93XX_TIMER4_VALUE_LOW); 67 + ret |= ((u64) (readl(EP93XX_TIMER4_VALUE_HIGH) & 0xff) << 32); 68 + return (cycle_t) ret; 69 + } 70 + 71 + static int ep93xx_clkevt_set_next_event(unsigned long next, 72 + struct clock_event_device *evt) 73 + { 74 + /* Default mode: periodic, off, 508 kHz */ 75 + u32 tmode = EP93XX_TIMER123_CONTROL_MODE | 76 + EP93XX_TIMER123_CONTROL_CLKSEL; 77 + 78 + /* Clear timer */ 79 + writel(tmode, EP93XX_TIMER3_CONTROL); 80 + 81 + /* Set next event */ 82 + writel(next, EP93XX_TIMER3_LOAD); 83 + writel(tmode | EP93XX_TIMER123_CONTROL_ENABLE, 84 + EP93XX_TIMER3_CONTROL); 85 + return 0; 86 + } 87 + 88 + 89 + static int ep93xx_clkevt_shutdown(struct clock_event_device *evt) 90 + { 91 + /* Disable timer */ 92 + writel(0, EP93XX_TIMER3_CONTROL); 93 + 94 + return 0; 95 + } 96 + 97 + static struct clock_event_device ep93xx_clockevent = { 98 + .name = "timer1", 99 + .features = CLOCK_EVT_FEAT_ONESHOT, 100 + .set_state_shutdown = ep93xx_clkevt_shutdown, 101 + .set_state_oneshot = ep93xx_clkevt_shutdown, 102 + .tick_resume = ep93xx_clkevt_shutdown, 103 + .set_next_event = ep93xx_clkevt_set_next_event, 104 + .rating = 300, 105 + }; 106 + 107 + static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id) 108 + { 109 + struct clock_event_device *evt = dev_id; 110 + 111 + /* Writing any value clears the timer interrupt */ 112 + writel(1, EP93XX_TIMER3_CLEAR); 113 + 114 + evt->event_handler(evt); 115 + 116 + return IRQ_HANDLED; 117 + } 118 + 119 + static struct irqaction ep93xx_timer_irq = { 120 + .name = "ep93xx timer", 121 + .flags = IRQF_TIMER | IRQF_IRQPOLL, 122 + .handler = ep93xx_timer_interrupt, 123 + .dev_id = &ep93xx_clockevent, 124 + }; 125 + 126 + void __init ep93xx_timer_init(void) 127 + { 128 + /* Enable and register clocksource and sched_clock on timer 4 */ 129 + writel(EP93XX_TIMER4_VALUE_HIGH_ENABLE, 130 + EP93XX_TIMER4_VALUE_HIGH); 131 + clocksource_mmio_init(NULL, "timer4", 132 + EP93XX_TIMER4_RATE, 200, 40, 133 + ep93xx_clocksource_read); 134 + sched_clock_register(ep93xx_read_sched_clock, 40, 135 + EP93XX_TIMER4_RATE); 136 + 137 + /* Set up clockevent on timer 3 */ 138 + setup_irq(IRQ_EP93XX_TIMER3, &ep93xx_timer_irq); 139 + clockevents_config_and_register(&ep93xx_clockevent, 140 + EP93XX_TIMER123_RATE, 141 + 1, 142 + 0xffffffffU); 143 + }
+58 -5
arch/arm/mach-ep93xx/vision_ep9307.c
··· 29 29 #include <linux/spi/mmc_spi.h> 30 30 #include <linux/mmc/host.h> 31 31 32 + #include <sound/cs4271.h> 33 + 32 34 #include <mach/hardware.h> 33 35 #include <linux/platform_data/video-ep93xx.h> 34 36 #include <linux/platform_data/spi-ep93xx.h> ··· 106 104 } 107 105 108 106 static struct ep93xxfb_mach_info ep93xxfb_info __initdata = { 109 - .num_modes = EP93XXFB_USE_MODEDB, 110 - .bpp = 16, 111 107 .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, 112 108 .setup = vision_lcd_setup, 113 109 .teardown = vision_lcd_teardown, ··· 166 166 I2C_BOARD_INFO("pca9539", 0x77), 167 167 .platform_data = &pca953x_77_gpio_data, 168 168 }, 169 + }; 170 + 171 + /************************************************************************* 172 + * SPI CS4271 Audio Codec 173 + *************************************************************************/ 174 + static struct cs4271_platform_data vision_cs4271_data = { 175 + .gpio_nreset = EP93XX_GPIO_LINE_H(2), 176 + }; 177 + 178 + static int vision_cs4271_hw_setup(struct spi_device *spi) 179 + { 180 + return gpio_request_one(EP93XX_GPIO_LINE_EGPIO6, 181 + GPIOF_OUT_INIT_HIGH, spi->modalias); 182 + } 183 + 184 + static void vision_cs4271_hw_cleanup(struct spi_device *spi) 185 + { 186 + gpio_free(EP93XX_GPIO_LINE_EGPIO6); 187 + } 188 + 189 + static void vision_cs4271_hw_cs_control(struct spi_device *spi, int value) 190 + { 191 + gpio_set_value(EP93XX_GPIO_LINE_EGPIO6, value); 192 + } 193 + 194 + static struct ep93xx_spi_chip_ops vision_cs4271_hw = { 195 + .setup = vision_cs4271_hw_setup, 196 + .cleanup = vision_cs4271_hw_cleanup, 197 + .cs_control = vision_cs4271_hw_cs_control, 169 198 }; 170 199 171 200 /************************************************************************* ··· 291 262 *************************************************************************/ 292 263 static struct spi_board_info vision_spi_board_info[] __initdata = { 293 264 { 265 + .modalias = "cs4271", 266 + .platform_data = &vision_cs4271_data, 267 + .controller_data = &vision_cs4271_hw, 268 + .max_speed_hz = 6000000, 269 + .bus_num = 0, 270 + .chip_select = 0, 271 + .mode = SPI_MODE_3, 272 + }, { 294 273 .modalias = "sst25l", 295 274 .platform_data = &vision_spi_flash_data, 296 275 .controller_data = &vision_spi_flash_hw, 297 276 .max_speed_hz = 20000000, 298 277 .bus_num = 0, 299 - .chip_select = 0, 278 + .chip_select = 1, 300 279 .mode = SPI_MODE_3, 301 280 }, { 302 281 .modalias = "mmc_spi", ··· 312 275 .controller_data = &vision_spi_mmc_hw, 313 276 .max_speed_hz = 20000000, 314 277 .bus_num = 0, 315 - .chip_select = 1, 278 + .chip_select = 2, 316 279 .mode = SPI_MODE_3, 317 280 }, 318 281 }; 319 282 320 283 static struct ep93xx_spi_info vision_spi_master __initdata = { 321 - .num_chipselect = ARRAY_SIZE(vision_spi_board_info), 284 + .num_chipselect = ARRAY_SIZE(vision_spi_board_info), 285 + .use_dma = 1, 322 286 }; 287 + 288 + /************************************************************************* 289 + * I2S Audio 290 + *************************************************************************/ 291 + static struct platform_device vision_audio_device = { 292 + .name = "edb93xx-audio", 293 + .id = -1, 294 + }; 295 + 296 + static void __init vision_register_i2s(void) 297 + { 298 + ep93xx_register_i2s(); 299 + platform_device_register(&vision_audio_device); 300 + } 323 301 324 302 /************************************************************************* 325 303 * Machine Initialization ··· 361 309 ARRAY_SIZE(vision_i2c_info)); 362 310 ep93xx_register_spi(&vision_spi_master, vision_spi_board_info, 363 311 ARRAY_SIZE(vision_spi_board_info)); 312 + vision_register_i2s(); 364 313 } 365 314 366 315 MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
+5
arch/arm/mach-exynos/Kconfig
··· 30 30 31 31 if ARCH_EXYNOS 32 32 33 + config S5P_DEV_MFC 34 + bool 35 + help 36 + Compile in setup memory (init) code for MFC 37 + 33 38 config ARCH_EXYNOS3 34 39 bool "SAMSUNG EXYNOS3" 35 40 select ARM_CPU_SUSPEND if PM
+2
arch/arm/mach-exynos/Makefile
··· 23 23 24 24 obj-$(CONFIG_EXYNOS5420_MCPM) += mcpm-exynos.o 25 25 CFLAGS_mcpm-exynos.o += -march=armv7-a 26 + 27 + obj-$(CONFIG_S5P_DEV_MFC) += s5p-dev-mfc.o
+6
arch/arm/mach-exynos/common.h
··· 128 128 129 129 /* CPU BOOT mode flag for Exynos3250 SoC bootloader */ 130 130 #define C2_STATE (1 << 3) 131 + /* 132 + * Magic values for bootloader indicating chosen low power mode. 133 + * See also Documentation/arm/Samsung/Bootloader-interface.txt 134 + */ 135 + #define EXYNOS_SLEEP_MAGIC 0x00000bad 136 + #define EXYNOS_AFTR_MAGIC 0xfcba0d10 131 137 132 138 void exynos_set_boot_flag(unsigned int cpu, unsigned int mode); 133 139 void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode);
-2
arch/arm/mach-exynos/firmware.c
··· 25 25 #include "common.h" 26 26 #include "smc.h" 27 27 28 - #define EXYNOS_SLEEP_MAGIC 0x00000bad 29 - #define EXYNOS_AFTR_MAGIC 0xfcba0d10 30 28 #define EXYNOS_BOOT_ADDR 0x8 31 29 #define EXYNOS_BOOT_FLAG 0xc 32 30
+1 -2
arch/arm/mach-exynos/pmu.c
··· 698 698 ; 699 699 } 700 700 701 - void exynos5420_powerdown_conf(enum sys_powerdown mode) 701 + static void exynos5420_powerdown_conf(enum sys_powerdown mode) 702 702 { 703 703 u32 this_cluster; 704 704 ··· 991 991 static struct platform_driver exynos_pmu_driver = { 992 992 .driver = { 993 993 .name = "exynos-pmu", 994 - .owner = THIS_MODULE, 995 994 .of_match_table = exynos_pmu_of_device_ids, 996 995 }, 997 996 .probe = exynos_pmu_probe,
+3 -5
arch/arm/mach-exynos/suspend.c
··· 32 32 #include <asm/suspend.h> 33 33 34 34 #include <plat/pm-common.h> 35 - #include <plat/regs-srom.h> 36 35 37 36 #include "common.h" 38 - #include "regs-pmu.h" 39 37 #include "exynos-pmu.h" 40 - 41 - #define S5P_CHECK_SLEEP 0x00000BAD 38 + #include "regs-pmu.h" 39 + #include "regs-srom.h" 42 40 43 41 #define REG_TABLE_END (-1U) 44 42 ··· 329 331 { 330 332 /* Set value of power down register for sleep mode */ 331 333 exynos_sys_powerdown_conf(SYS_SLEEP); 332 - pmu_raw_writel(S5P_CHECK_SLEEP, S5P_INFORM1); 334 + pmu_raw_writel(EXYNOS_SLEEP_MAGIC, S5P_INFORM1); 333 335 } 334 336 335 337 static void exynos_pm_prepare(void)
+1 -1
arch/arm/mach-footbridge/common.c
··· 106 106 107 107 for (irq = _DC21285_IRQ(0); irq < _DC21285_IRQ(20); irq++) { 108 108 irq_set_chip_and_handler(irq, &fb_chip, handle_level_irq); 109 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 109 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 110 110 } 111 111 } 112 112
+22 -24
arch/arm/mach-footbridge/dc21285-timer.c
··· 57 57 return 0; 58 58 } 59 59 60 - static void ckevt_dc21285_set_mode(enum clock_event_mode mode, 61 - struct clock_event_device *c) 60 + static int ckevt_dc21285_shutdown(struct clock_event_device *c) 62 61 { 63 - switch (mode) { 64 - case CLOCK_EVT_MODE_RESUME: 65 - case CLOCK_EVT_MODE_PERIODIC: 66 - *CSR_TIMER1_CLR = 0; 67 - *CSR_TIMER1_LOAD = (mem_fclk_21285 + 8 * HZ) / (16 * HZ); 68 - *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | 69 - TIMER_CNTL_DIV16; 70 - break; 62 + *CSR_TIMER1_CNTL = 0; 63 + return 0; 64 + } 71 65 72 - case CLOCK_EVT_MODE_ONESHOT: 73 - case CLOCK_EVT_MODE_UNUSED: 74 - case CLOCK_EVT_MODE_SHUTDOWN: 75 - *CSR_TIMER1_CNTL = 0; 76 - break; 77 - } 66 + static int ckevt_dc21285_set_periodic(struct clock_event_device *c) 67 + { 68 + *CSR_TIMER1_CLR = 0; 69 + *CSR_TIMER1_LOAD = (mem_fclk_21285 + 8 * HZ) / (16 * HZ); 70 + *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | 71 + TIMER_CNTL_DIV16; 72 + return 0; 78 73 } 79 74 80 75 static struct clock_event_device ckevt_dc21285 = { 81 - .name = "dc21285_timer1", 82 - .features = CLOCK_EVT_FEAT_PERIODIC | 83 - CLOCK_EVT_FEAT_ONESHOT, 84 - .rating = 200, 85 - .irq = IRQ_TIMER1, 86 - .set_next_event = ckevt_dc21285_set_next_event, 87 - .set_mode = ckevt_dc21285_set_mode, 76 + .name = "dc21285_timer1", 77 + .features = CLOCK_EVT_FEAT_PERIODIC | 78 + CLOCK_EVT_FEAT_ONESHOT, 79 + .rating = 200, 80 + .irq = IRQ_TIMER1, 81 + .set_next_event = ckevt_dc21285_set_next_event, 82 + .set_state_shutdown = ckevt_dc21285_shutdown, 83 + .set_state_periodic = ckevt_dc21285_set_periodic, 84 + .set_state_oneshot = ckevt_dc21285_shutdown, 85 + .tick_resume = ckevt_dc21285_set_periodic, 88 86 }; 89 87 90 88 static irqreturn_t timer1_interrupt(int irq, void *dev_id) ··· 92 94 *CSR_TIMER1_CLR = 0; 93 95 94 96 /* Stop the timer if in one-shot mode */ 95 - if (ce->mode == CLOCK_EVT_MODE_ONESHOT) 97 + if (clockevent_state_oneshot(ce)) 96 98 *CSR_TIMER1_CNTL = 0; 97 99 98 100 ce->event_handler(ce);
+4 -4
arch/arm/mach-footbridge/isa-irq.c
··· 153 153 for (irq = _ISA_IRQ(0); irq < _ISA_IRQ(8); irq++) { 154 154 irq_set_chip_and_handler(irq, &isa_lo_chip, 155 155 handle_level_irq); 156 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 156 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 157 157 } 158 158 159 159 for (irq = _ISA_IRQ(8); irq < _ISA_IRQ(16); irq++) { 160 160 irq_set_chip_and_handler(irq, &isa_hi_chip, 161 161 handle_level_irq); 162 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 162 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 163 163 } 164 164 165 165 request_resource(&ioport_resource, &pic1_resource); ··· 175 175 * resistor on this line. 176 176 */ 177 177 if (machine_is_netwinder()) 178 - set_irq_flags(_ISA_IRQ(11), IRQF_VALID | 179 - IRQF_PROBE | IRQF_NOAUTOEN); 178 + irq_modify_status(_ISA_IRQ(11), 179 + IRQ_NOREQUEST | IRQ_NOPROBE, IRQ_NOAUTOEN); 180 180 } 181 181 } 182 182
+1 -1
arch/arm/mach-gemini/gpio.c
··· 220 220 j < GPIO_IRQ_BASE + (i + 1) * 32; j++) { 221 221 irq_set_chip_and_handler(j, &gpio_irq_chip, 222 222 handle_edge_irq); 223 - set_irq_flags(j, IRQF_VALID); 223 + irq_clear_status_flags(j, IRQ_NOREQUEST); 224 224 } 225 225 226 226 irq_set_chained_handler_and_data(IRQ_GPIO(i), gpio_irq_handler,
-3
arch/arm/mach-gemini/include/mach/hardware.h
··· 57 57 #define GEMINI_USB1_BASE 0x69000000 58 58 #define GEMINI_BIG_ENDIAN_BASE 0x80000000 59 59 60 - #define GEMINI_TIMER1_BASE GEMINI_TIMER_BASE 61 - #define GEMINI_TIMER2_BASE (GEMINI_TIMER_BASE + 0x10) 62 - #define GEMINI_TIMER3_BASE (GEMINI_TIMER_BASE + 0x20) 63 60 64 61 /* 65 62 * UART Clock when System clk is 150MHz
+1 -1
arch/arm/mach-gemini/irq.c
··· 92 92 } else { 93 93 irq_set_handler(i, handle_level_irq); 94 94 } 95 - set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 95 + irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE); 96 96 } 97 97 98 98 /* Disable all interrupts */
+143 -74
arch/arm/mach-gemini/time.c
··· 15 15 #include <asm/mach/time.h> 16 16 #include <linux/clockchips.h> 17 17 #include <linux/clocksource.h> 18 + #include <linux/sched_clock.h> 18 19 19 20 /* 20 21 * Register definitions for the timers 21 22 */ 22 - #define TIMER_COUNT(BASE_ADDR) (BASE_ADDR + 0x00) 23 - #define TIMER_LOAD(BASE_ADDR) (BASE_ADDR + 0x04) 24 - #define TIMER_MATCH1(BASE_ADDR) (BASE_ADDR + 0x08) 25 - #define TIMER_MATCH2(BASE_ADDR) (BASE_ADDR + 0x0C) 26 - #define TIMER_CR(BASE_ADDR) (BASE_ADDR + 0x30) 27 23 28 - #define TIMER_1_CR_ENABLE (1 << 0) 29 - #define TIMER_1_CR_CLOCK (1 << 1) 30 - #define TIMER_1_CR_INT (1 << 2) 31 - #define TIMER_2_CR_ENABLE (1 << 3) 32 - #define TIMER_2_CR_CLOCK (1 << 4) 33 - #define TIMER_2_CR_INT (1 << 5) 34 - #define TIMER_3_CR_ENABLE (1 << 6) 35 - #define TIMER_3_CR_CLOCK (1 << 7) 36 - #define TIMER_3_CR_INT (1 << 8) 24 + #define TIMER1_BASE GEMINI_TIMER_BASE 25 + #define TIMER2_BASE (GEMINI_TIMER_BASE + 0x10) 26 + #define TIMER3_BASE (GEMINI_TIMER_BASE + 0x20) 27 + 28 + #define TIMER_COUNT(BASE) (IO_ADDRESS(BASE) + 0x00) 29 + #define TIMER_LOAD(BASE) (IO_ADDRESS(BASE) + 0x04) 30 + #define TIMER_MATCH1(BASE) (IO_ADDRESS(BASE) + 0x08) 31 + #define TIMER_MATCH2(BASE) (IO_ADDRESS(BASE) + 0x0C) 32 + #define TIMER_CR (IO_ADDRESS(GEMINI_TIMER_BASE) + 0x30) 33 + #define TIMER_INTR_STATE (IO_ADDRESS(GEMINI_TIMER_BASE) + 0x34) 34 + #define TIMER_INTR_MASK (IO_ADDRESS(GEMINI_TIMER_BASE) + 0x38) 35 + 36 + #define TIMER_1_CR_ENABLE (1 << 0) 37 + #define TIMER_1_CR_CLOCK (1 << 1) 38 + #define TIMER_1_CR_INT (1 << 2) 39 + #define TIMER_2_CR_ENABLE (1 << 3) 40 + #define TIMER_2_CR_CLOCK (1 << 4) 41 + #define TIMER_2_CR_INT (1 << 5) 42 + #define TIMER_3_CR_ENABLE (1 << 6) 43 + #define TIMER_3_CR_CLOCK (1 << 7) 44 + #define TIMER_3_CR_INT (1 << 8) 45 + #define TIMER_1_CR_UPDOWN (1 << 9) 46 + #define TIMER_2_CR_UPDOWN (1 << 10) 47 + #define TIMER_3_CR_UPDOWN (1 << 11) 48 + #define TIMER_DEFAULT_FLAGS (TIMER_1_CR_UPDOWN | \ 49 + TIMER_3_CR_ENABLE | \ 50 + TIMER_3_CR_UPDOWN) 51 + 52 + #define TIMER_1_INT_MATCH1 (1 << 0) 53 + #define TIMER_1_INT_MATCH2 (1 << 1) 54 + #define TIMER_1_INT_OVERFLOW (1 << 2) 55 + #define TIMER_2_INT_MATCH1 (1 << 3) 56 + #define TIMER_2_INT_MATCH2 (1 << 4) 57 + #define TIMER_2_INT_OVERFLOW (1 << 5) 58 + #define TIMER_3_INT_MATCH1 (1 << 6) 59 + #define TIMER_3_INT_MATCH2 (1 << 7) 60 + #define TIMER_3_INT_OVERFLOW (1 << 8) 61 + #define TIMER_INT_ALL_MASK 0x1ff 62 + 37 63 38 64 static unsigned int tick_rate; 65 + 66 + static u64 notrace gemini_read_sched_clock(void) 67 + { 68 + return readl(TIMER_COUNT(TIMER3_BASE)); 69 + } 39 70 40 71 static int gemini_timer_set_next_event(unsigned long cycles, 41 72 struct clock_event_device *evt) 42 73 { 43 74 u32 cr; 44 75 45 - cr = readl(TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE))); 46 - 47 - /* This may be overdoing it, feel free to test without this */ 48 - cr &= ~TIMER_2_CR_ENABLE; 49 - cr &= ~TIMER_2_CR_INT; 50 - writel(cr, TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE))); 51 - 52 - /* Set next event */ 53 - writel(cycles, TIMER_COUNT(IO_ADDRESS(GEMINI_TIMER2_BASE))); 54 - writel(cycles, TIMER_LOAD(IO_ADDRESS(GEMINI_TIMER2_BASE))); 55 - cr |= TIMER_2_CR_ENABLE; 56 - cr |= TIMER_2_CR_INT; 57 - writel(cr, TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE))); 76 + /* Setup the match register */ 77 + cr = readl(TIMER_COUNT(TIMER1_BASE)); 78 + writel(cr + cycles, TIMER_MATCH1(TIMER1_BASE)); 79 + if (readl(TIMER_COUNT(TIMER1_BASE)) - cr > cycles) 80 + return -ETIME; 58 81 59 82 return 0; 60 83 } 61 84 62 - static void gemini_timer_set_mode(enum clock_event_mode mode, 63 - struct clock_event_device *evt) 85 + static int gemini_timer_shutdown(struct clock_event_device *evt) 86 + { 87 + u32 cr; 88 + 89 + /* 90 + * Disable also for oneshot: the set_next() call will arm the timer 91 + * instead. 92 + */ 93 + /* Stop timer and interrupt. */ 94 + cr = readl(TIMER_CR); 95 + cr &= ~(TIMER_1_CR_ENABLE | TIMER_1_CR_INT); 96 + writel(cr, TIMER_CR); 97 + 98 + /* Setup counter start from 0 */ 99 + writel(0, TIMER_COUNT(TIMER1_BASE)); 100 + writel(0, TIMER_LOAD(TIMER1_BASE)); 101 + 102 + /* enable interrupt */ 103 + cr = readl(TIMER_INTR_MASK); 104 + cr &= ~(TIMER_1_INT_OVERFLOW | TIMER_1_INT_MATCH2); 105 + cr |= TIMER_1_INT_MATCH1; 106 + writel(cr, TIMER_INTR_MASK); 107 + 108 + /* start the timer */ 109 + cr = readl(TIMER_CR); 110 + cr |= TIMER_1_CR_ENABLE; 111 + writel(cr, TIMER_CR); 112 + 113 + return 0; 114 + } 115 + 116 + static int gemini_timer_set_periodic(struct clock_event_device *evt) 64 117 { 65 118 u32 period = DIV_ROUND_CLOSEST(tick_rate, HZ); 66 119 u32 cr; 67 120 68 - switch (mode) { 69 - case CLOCK_EVT_MODE_PERIODIC: 70 - /* Start the timer */ 71 - writel(period, 72 - TIMER_COUNT(IO_ADDRESS(GEMINI_TIMER2_BASE))); 73 - writel(period, 74 - TIMER_LOAD(IO_ADDRESS(GEMINI_TIMER2_BASE))); 75 - cr = readl(TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE))); 76 - cr |= TIMER_2_CR_ENABLE; 77 - cr |= TIMER_2_CR_INT; 78 - writel(cr, TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE))); 79 - break; 80 - case CLOCK_EVT_MODE_ONESHOT: 81 - case CLOCK_EVT_MODE_UNUSED: 82 - case CLOCK_EVT_MODE_SHUTDOWN: 83 - case CLOCK_EVT_MODE_RESUME: 84 - /* 85 - * Disable also for oneshot: the set_next() call will 86 - * arm the timer instead. 87 - */ 88 - cr = readl(TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE))); 89 - cr &= ~TIMER_2_CR_ENABLE; 90 - cr &= ~TIMER_2_CR_INT; 91 - writel(cr, TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE))); 92 - break; 93 - default: 94 - break; 95 - } 121 + /* Stop timer and interrupt */ 122 + cr = readl(TIMER_CR); 123 + cr &= ~(TIMER_1_CR_ENABLE | TIMER_1_CR_INT); 124 + writel(cr, TIMER_CR); 125 + 126 + /* Setup timer to fire at 1/HT intervals. */ 127 + cr = 0xffffffff - (period - 1); 128 + writel(cr, TIMER_COUNT(TIMER1_BASE)); 129 + writel(cr, TIMER_LOAD(TIMER1_BASE)); 130 + 131 + /* enable interrupt on overflow */ 132 + cr = readl(TIMER_INTR_MASK); 133 + cr &= ~(TIMER_1_INT_MATCH1 | TIMER_1_INT_MATCH2); 134 + cr |= TIMER_1_INT_OVERFLOW; 135 + writel(cr, TIMER_INTR_MASK); 136 + 137 + /* Start the timer */ 138 + cr = readl(TIMER_CR); 139 + cr |= TIMER_1_CR_ENABLE; 140 + cr |= TIMER_1_CR_INT; 141 + writel(cr, TIMER_CR); 142 + 143 + return 0; 96 144 } 97 145 98 - /* Use TIMER2 as clock event */ 146 + /* Use TIMER1 as clock event */ 99 147 static struct clock_event_device gemini_clockevent = { 100 - .name = "TIMER2", 101 - .rating = 300, /* Reasonably fast and accurate clock event */ 102 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 103 - .set_next_event = gemini_timer_set_next_event, 104 - .set_mode = gemini_timer_set_mode, 148 + .name = "TIMER1", 149 + /* Reasonably fast and accurate clock event */ 150 + .rating = 300, 151 + .shift = 32, 152 + .features = CLOCK_EVT_FEAT_PERIODIC | 153 + CLOCK_EVT_FEAT_ONESHOT, 154 + .set_next_event = gemini_timer_set_next_event, 155 + .set_state_shutdown = gemini_timer_shutdown, 156 + .set_state_periodic = gemini_timer_set_periodic, 157 + .set_state_oneshot = gemini_timer_shutdown, 158 + .tick_resume = gemini_timer_shutdown, 105 159 }; 106 160 107 161 /* ··· 205 151 } 206 152 207 153 /* 208 - * Make irqs happen for the system timer 154 + * Reset the interrupt mask and status 209 155 */ 210 - setup_irq(IRQ_TIMER2, &gemini_timer_irq); 156 + writel(TIMER_INT_ALL_MASK, TIMER_INTR_MASK); 157 + writel(0, TIMER_INTR_STATE); 158 + writel(TIMER_DEFAULT_FLAGS, TIMER_CR); 211 159 212 - /* Enable and use TIMER1 as clock source */ 213 - writel(0xffffffff, TIMER_COUNT(IO_ADDRESS(GEMINI_TIMER1_BASE))); 214 - writel(0xffffffff, TIMER_LOAD(IO_ADDRESS(GEMINI_TIMER1_BASE))); 215 - writel(TIMER_1_CR_ENABLE, TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE))); 216 - if (clocksource_mmio_init(TIMER_COUNT(IO_ADDRESS(GEMINI_TIMER1_BASE)), 217 - "TIMER1", tick_rate, 300, 32, 218 - clocksource_mmio_readl_up)) 219 - pr_err("timer: failed to initialize gemini clock source\n"); 160 + /* 161 + * Setup free-running clocksource timer (interrupts 162 + * disabled.) 163 + */ 164 + writel(0, TIMER_COUNT(TIMER3_BASE)); 165 + writel(0, TIMER_LOAD(TIMER3_BASE)); 166 + writel(0, TIMER_MATCH1(TIMER3_BASE)); 167 + writel(0, TIMER_MATCH2(TIMER3_BASE)); 168 + clocksource_mmio_init(TIMER_COUNT(TIMER3_BASE), 169 + "gemini_clocksource", tick_rate, 170 + 300, 32, clocksource_mmio_readl_up); 171 + sched_clock_register(gemini_read_sched_clock, 32, tick_rate); 220 172 221 - /* Configure and register the clockevent */ 173 + /* 174 + * Setup clockevent timer (interrupt-driven.) 175 + */ 176 + writel(0, TIMER_COUNT(TIMER1_BASE)); 177 + writel(0, TIMER_LOAD(TIMER1_BASE)); 178 + writel(0, TIMER_MATCH1(TIMER1_BASE)); 179 + writel(0, TIMER_MATCH2(TIMER1_BASE)); 180 + setup_irq(IRQ_TIMER1, &gemini_timer_irq); 181 + gemini_clockevent.cpumask = cpumask_of(0); 222 182 clockevents_config_and_register(&gemini_clockevent, tick_rate, 223 183 1, 0xffffffff); 184 + 224 185 }
+1 -1
arch/arm/mach-imx/3ds_debugboard.c
··· 195 195 196 196 for (i = irq_base; i < irq_base + MXC_MAX_EXP_IO_LINES; i++) { 197 197 irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq); 198 - set_irq_flags(i, IRQF_VALID); 198 + irq_clear_status_flags(i, IRQ_NOREQUEST); 199 199 } 200 200 irq_set_irq_type(p_irq, IRQF_TRIGGER_LOW); 201 201 irq_set_chained_handler(p_irq, mxc_expio_irq_handler);
+35 -32
arch/arm/mach-imx/epit.c
··· 57 57 #include "hardware.h" 58 58 59 59 static struct clock_event_device clockevent_epit; 60 - static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; 61 60 62 61 static void __iomem *timer_base; 63 62 ··· 105 106 return 0; 106 107 } 107 108 108 - static void epit_set_mode(enum clock_event_mode mode, 109 - struct clock_event_device *evt) 109 + /* Left event sources disabled, no more interrupts appear */ 110 + static int epit_shutdown(struct clock_event_device *evt) 110 111 { 111 112 unsigned long flags; 112 113 ··· 119 120 /* Disable interrupt in GPT module */ 120 121 epit_irq_disable(); 121 122 122 - if (mode != clockevent_mode) { 123 - /* Set event time into far-far future */ 123 + /* Clear pending interrupt */ 124 + epit_irq_acknowledge(); 124 125 125 - /* Clear pending interrupt */ 126 - epit_irq_acknowledge(); 127 - } 128 - 129 - /* Remember timer mode */ 130 - clockevent_mode = mode; 131 126 local_irq_restore(flags); 132 127 133 - switch (mode) { 134 - case CLOCK_EVT_MODE_PERIODIC: 135 - printk(KERN_ERR "epit_set_mode: Periodic mode is not " 136 - "supported for i.MX EPIT\n"); 137 - break; 138 - case CLOCK_EVT_MODE_ONESHOT: 128 + return 0; 129 + } 130 + 131 + static int epit_set_oneshot(struct clock_event_device *evt) 132 + { 133 + unsigned long flags; 134 + 135 + /* 136 + * The timer interrupt generation is disabled at least 137 + * for enough time to call epit_set_next_event() 138 + */ 139 + local_irq_save(flags); 140 + 141 + /* Disable interrupt in GPT module */ 142 + epit_irq_disable(); 143 + 144 + /* Clear pending interrupt, only while switching mode */ 145 + if (!clockevent_state_oneshot(evt)) 146 + epit_irq_acknowledge(); 147 + 139 148 /* 140 149 * Do not put overhead of interrupt enable/disable into 141 150 * epit_set_next_event(), the core has about 4 minutes 142 151 * to call epit_set_next_event() or shutdown clock after 143 152 * mode switching 144 153 */ 145 - local_irq_save(flags); 146 - epit_irq_enable(); 147 - local_irq_restore(flags); 148 - break; 149 - case CLOCK_EVT_MODE_SHUTDOWN: 150 - case CLOCK_EVT_MODE_UNUSED: 151 - case CLOCK_EVT_MODE_RESUME: 152 - /* Left event sources disabled, no more interrupts appear */ 153 - break; 154 - } 154 + epit_irq_enable(); 155 + local_irq_restore(flags); 156 + 157 + return 0; 155 158 } 156 159 157 160 /* ··· 177 176 }; 178 177 179 178 static struct clock_event_device clockevent_epit = { 180 - .name = "epit", 181 - .features = CLOCK_EVT_FEAT_ONESHOT, 182 - .set_mode = epit_set_mode, 183 - .set_next_event = epit_set_next_event, 184 - .rating = 200, 179 + .name = "epit", 180 + .features = CLOCK_EVT_FEAT_ONESHOT, 181 + .set_state_shutdown = epit_shutdown, 182 + .tick_resume = epit_shutdown, 183 + .set_state_oneshot = epit_set_oneshot, 184 + .set_next_event = epit_set_next_event, 185 + .rating = 200, 185 186 }; 186 187 187 188 static int __init epit_clockevent_init(struct clk *timer_clk)
+1 -1
arch/arm/mach-imx/mach-imx7d.c
··· 31 31 irqchip_init(); 32 32 } 33 33 34 - static const char *imx7d_dt_compat[] __initconst = { 34 + static const char *const imx7d_dt_compat[] __initconst = { 35 35 "fsl,imx7d", 36 36 NULL, 37 37 };
+1 -1
arch/arm/mach-imx/mach-mx31ads.c
··· 238 238 239 239 for (i = irq_base; i < irq_base + MXC_MAX_EXP_IO_LINES; i++) { 240 240 irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq); 241 - set_irq_flags(i, IRQF_VALID); 241 + irq_clear_status_flags(i, IRQ_NOREQUEST); 242 242 } 243 243 irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_4)); 244 244 irq_set_irq_type(irq, IRQ_TYPE_LEVEL_HIGH);
+1 -1
arch/arm/mach-iop13xx/irq.c
··· 233 233 irq_set_chip(i, &iop13xx_irqchip4); 234 234 235 235 irq_set_handler(i, handle_level_irq); 236 - set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 236 + irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE); 237 237 } 238 238 239 239 iop13xx_msi_init();
+1 -1
arch/arm/mach-iop32x/irq.c
··· 69 69 70 70 for (i = 0; i < NR_IRQS; i++) { 71 71 irq_set_chip_and_handler(i, &ext_chip, handle_level_irq); 72 - set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 72 + irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE); 73 73 } 74 74 }
+1 -1
arch/arm/mach-iop33x/irq.c
··· 113 113 irq_set_chip_and_handler(i, 114 114 (i < 32) ? &iop33x_irqchip1 : &iop33x_irqchip2, 115 115 handle_level_irq); 116 - set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 116 + irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE); 117 117 } 118 118 }
+41 -29
arch/arm/mach-ixp4xx/common.c
··· 296 296 for(i = 0; i < NR_IRQS; i++) { 297 297 irq_set_chip_and_handler(i, &ixp4xx_irq_chip, 298 298 handle_level_irq); 299 - set_irq_flags(i, IRQF_VALID); 299 + irq_clear_status_flags(i, IRQ_NOREQUEST); 300 300 } 301 301 } 302 302 ··· 521 521 return 0; 522 522 } 523 523 524 - static void ixp4xx_set_mode(enum clock_event_mode mode, 525 - struct clock_event_device *evt) 524 + static int ixp4xx_shutdown(struct clock_event_device *evt) 526 525 { 527 526 unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK; 528 527 unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK; 529 528 530 - switch (mode) { 531 - case CLOCK_EVT_MODE_PERIODIC: 532 - osrt = IXP4XX_LATCH & ~IXP4XX_OST_RELOAD_MASK; 533 - opts = IXP4XX_OST_ENABLE; 534 - break; 535 - case CLOCK_EVT_MODE_ONESHOT: 536 - /* period set by 'set next_event' */ 537 - osrt = 0; 538 - opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT; 539 - break; 540 - case CLOCK_EVT_MODE_SHUTDOWN: 541 - opts &= ~IXP4XX_OST_ENABLE; 542 - break; 543 - case CLOCK_EVT_MODE_RESUME: 544 - opts |= IXP4XX_OST_ENABLE; 545 - break; 546 - case CLOCK_EVT_MODE_UNUSED: 547 - default: 548 - osrt = opts = 0; 549 - break; 550 - } 529 + opts &= ~IXP4XX_OST_ENABLE; 530 + *IXP4XX_OSRT1 = osrt | opts; 531 + return 0; 532 + } 533 + 534 + static int ixp4xx_set_oneshot(struct clock_event_device *evt) 535 + { 536 + unsigned long opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT; 537 + unsigned long osrt = 0; 538 + 539 + /* period set by 'set next_event' */ 540 + *IXP4XX_OSRT1 = osrt | opts; 541 + return 0; 542 + } 543 + 544 + static int ixp4xx_set_periodic(struct clock_event_device *evt) 545 + { 546 + unsigned long opts = IXP4XX_OST_ENABLE; 547 + unsigned long osrt = IXP4XX_LATCH & ~IXP4XX_OST_RELOAD_MASK; 551 548 552 549 *IXP4XX_OSRT1 = osrt | opts; 550 + return 0; 551 + } 552 + 553 + static int ixp4xx_resume(struct clock_event_device *evt) 554 + { 555 + unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK; 556 + unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK; 557 + 558 + opts |= IXP4XX_OST_ENABLE; 559 + *IXP4XX_OSRT1 = osrt | opts; 560 + return 0; 553 561 } 554 562 555 563 static struct clock_event_device clockevent_ixp4xx = { 556 - .name = "ixp4xx timer1", 557 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 558 - .rating = 200, 559 - .set_mode = ixp4xx_set_mode, 560 - .set_next_event = ixp4xx_set_next_event, 564 + .name = "ixp4xx timer1", 565 + .features = CLOCK_EVT_FEAT_PERIODIC | 566 + CLOCK_EVT_FEAT_ONESHOT, 567 + .rating = 200, 568 + .set_state_shutdown = ixp4xx_shutdown, 569 + .set_state_periodic = ixp4xx_set_periodic, 570 + .set_state_oneshot = ixp4xx_set_oneshot, 571 + .tick_resume = ixp4xx_resume, 572 + .set_next_event = ixp4xx_set_next_event, 561 573 }; 562 574 563 575 static void __init ixp4xx_clockevent_init(void)
+1 -1
arch/arm/mach-ks8695/irq.c
··· 172 172 handle_edge_irq); 173 173 } 174 174 175 - set_irq_flags(irq, IRQF_VALID); 175 + irq_clear_status_flags(irq, IRQ_NOREQUEST); 176 176 } 177 177 }
+21 -22
arch/arm/mach-ks8695/time.c
··· 54 54 /* Timer0 Timeout Counter Register */ 55 55 #define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */ 56 56 57 - static void ks8695_set_mode(enum clock_event_mode mode, 58 - struct clock_event_device *evt) 57 + static int ks8695_set_periodic(struct clock_event_device *evt) 59 58 { 59 + u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ); 60 + u32 half = DIV_ROUND_CLOSEST(rate, 2); 60 61 u32 tmcon; 61 62 62 - if (mode == CLOCK_EVT_FEAT_PERIODIC) { 63 - u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ); 64 - u32 half = DIV_ROUND_CLOSEST(rate, 2); 63 + /* Disable timer 1 */ 64 + tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON); 65 + tmcon &= ~TMCON_T1EN; 66 + writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); 65 67 66 - /* Disable timer 1 */ 67 - tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON); 68 - tmcon &= ~TMCON_T1EN; 69 - writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); 68 + /* Both registers need to count down */ 69 + writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC); 70 + writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD); 70 71 71 - /* Both registers need to count down */ 72 - writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC); 73 - writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD); 74 - 75 - /* Re-enable timer1 */ 76 - tmcon |= TMCON_T1EN; 77 - writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); 78 - } 72 + /* Re-enable timer1 */ 73 + tmcon |= TMCON_T1EN; 74 + writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON); 75 + return 0; 79 76 } 80 77 81 78 static int ks8695_set_next_event(unsigned long cycles, ··· 99 102 } 100 103 101 104 static struct clock_event_device clockevent_ks8695 = { 102 - .name = "ks8695_t1tc", 103 - .rating = 300, /* Reasonably fast and accurate clock event */ 104 - .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, 105 - .set_next_event = ks8695_set_next_event, 106 - .set_mode = ks8695_set_mode, 105 + .name = "ks8695_t1tc", 106 + /* Reasonably fast and accurate clock event */ 107 + .rating = 300, 108 + .features = CLOCK_EVT_FEAT_ONESHOT | 109 + CLOCK_EVT_FEAT_PERIODIC, 110 + .set_next_event = ks8695_set_next_event, 111 + .set_state_periodic = ks8695_set_periodic, 107 112 }; 108 113 109 114 /*
+5 -5
arch/arm/mach-lpc32xx/irq.c
··· 283 283 case IRQ_TYPE_EDGE_RISING: 284 284 /* Rising edge sensitive */ 285 285 __lpc32xx_set_irq_type(d->hwirq, 1, 1); 286 - __irq_set_handler_locked(d->irq, handle_edge_irq); 286 + irq_set_handler_locked(d, handle_edge_irq); 287 287 break; 288 288 289 289 case IRQ_TYPE_EDGE_FALLING: 290 290 /* Falling edge sensitive */ 291 291 __lpc32xx_set_irq_type(d->hwirq, 0, 1); 292 - __irq_set_handler_locked(d->irq, handle_edge_irq); 292 + irq_set_handler_locked(d, handle_edge_irq); 293 293 break; 294 294 295 295 case IRQ_TYPE_LEVEL_LOW: 296 296 /* Low level sensitive */ 297 297 __lpc32xx_set_irq_type(d->hwirq, 0, 0); 298 - __irq_set_handler_locked(d->irq, handle_level_irq); 298 + irq_set_handler_locked(d, handle_level_irq); 299 299 break; 300 300 301 301 case IRQ_TYPE_LEVEL_HIGH: 302 302 /* High level sensitive */ 303 303 __lpc32xx_set_irq_type(d->hwirq, 1, 0); 304 - __irq_set_handler_locked(d->irq, handle_level_irq); 304 + irq_set_handler_locked(d, handle_level_irq); 305 305 break; 306 306 307 307 /* Other modes are not supported */ ··· 434 434 for (i = 0; i < NR_IRQS; i++) { 435 435 irq_set_chip_and_handler(i, &lpc32xx_irq_chip, 436 436 handle_level_irq); 437 - set_irq_flags(i, IRQF_VALID); 437 + irq_clear_status_flags(i, IRQ_NOREQUEST); 438 438 } 439 439 440 440 /* Set default mappings */
+2 -2
arch/arm/mach-lpc32xx/phy3250.c
··· 212 212 .dma_filter = pl08x_filter_id, 213 213 }; 214 214 215 - static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = { 215 + static const struct of_dev_auxdata const lpc32xx_auxdata_lookup[] __initconst = { 216 216 OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", NULL), 217 217 OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", NULL), 218 218 OF_DEV_AUXDATA("arm,pl110", 0x31040000, "dev:clcd", &lpc32xx_clcd_data), ··· 248 248 lpc32xx_auxdata_lookup, NULL); 249 249 } 250 250 251 - static char const *lpc32xx_dt_compat[] __initdata = { 251 + static const char *const lpc32xx_dt_compat[] __initconst = { 252 252 "nxp,lpc3220", 253 253 "nxp,lpc3230", 254 254 "nxp,lpc3240",
+14 -26
arch/arm/mach-lpc32xx/timer.c
··· 43 43 return 0; 44 44 } 45 45 46 - static void lpc32xx_clkevt_mode(enum clock_event_mode mode, 47 - struct clock_event_device *dev) 46 + static int lpc32xx_shutdown(struct clock_event_device *evt) 48 47 { 49 - switch (mode) { 50 - case CLOCK_EVT_MODE_PERIODIC: 51 - WARN_ON(1); 52 - break; 53 - 54 - case CLOCK_EVT_MODE_ONESHOT: 55 - case CLOCK_EVT_MODE_SHUTDOWN: 56 - /* 57 - * Disable the timer. When using oneshot, we must also 58 - * disable the timer to wait for the first call to 59 - * set_next_event(). 60 - */ 61 - __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE)); 62 - break; 63 - 64 - case CLOCK_EVT_MODE_UNUSED: 65 - case CLOCK_EVT_MODE_RESUME: 66 - break; 67 - } 48 + /* 49 + * Disable the timer. When using oneshot, we must also 50 + * disable the timer to wait for the first call to 51 + * set_next_event(). 52 + */ 53 + __raw_writel(0, LPC32XX_TIMER_TCR(LPC32XX_TIMER0_BASE)); 54 + return 0; 68 55 } 69 56 70 57 static struct clock_event_device lpc32xx_clkevt = { 71 - .name = "lpc32xx_clkevt", 72 - .features = CLOCK_EVT_FEAT_ONESHOT, 73 - .rating = 300, 74 - .set_next_event = lpc32xx_clkevt_next_event, 75 - .set_mode = lpc32xx_clkevt_mode, 58 + .name = "lpc32xx_clkevt", 59 + .features = CLOCK_EVT_FEAT_ONESHOT, 60 + .rating = 300, 61 + .set_next_event = lpc32xx_clkevt_next_event, 62 + .set_state_shutdown = lpc32xx_shutdown, 63 + .set_state_oneshot = lpc32xx_shutdown, 76 64 }; 77 65 78 66 static irqreturn_t lpc32xx_timer_interrupt(int irq, void *dev_id)
+2 -2
arch/arm/mach-mmp/mmp-dt.c
··· 20 20 21 21 extern void __init mmp_dt_init_timer(void); 22 22 23 - static const char *pxa168_dt_board_compat[] __initdata = { 23 + static const char *const pxa168_dt_board_compat[] __initconst = { 24 24 "mrvl,pxa168-aspenite", 25 25 NULL, 26 26 }; 27 27 28 - static const char *pxa910_dt_board_compat[] __initdata = { 28 + static const char *const pxa910_dt_board_compat[] __initconst = { 29 29 "mrvl,pxa910-dkb", 30 30 NULL, 31 31 };
+1 -1
arch/arm/mach-mmp/mmp2-dt.c
··· 30 30 of_clk_init(NULL); 31 31 } 32 32 33 - static const char *mmp2_dt_board_compat[] __initdata = { 33 + static const char *const mmp2_dt_board_compat[] __initconst = { 34 34 "mrvl,mmp2-brownstone", 35 35 NULL, 36 36 };
+11 -18
arch/arm/mach-mmp/time.c
··· 124 124 return 0; 125 125 } 126 126 127 - static void timer_set_mode(enum clock_event_mode mode, 128 - struct clock_event_device *dev) 127 + static int timer_set_shutdown(struct clock_event_device *evt) 129 128 { 130 129 unsigned long flags; 131 130 132 131 local_irq_save(flags); 133 - switch (mode) { 134 - case CLOCK_EVT_MODE_ONESHOT: 135 - case CLOCK_EVT_MODE_UNUSED: 136 - case CLOCK_EVT_MODE_SHUTDOWN: 137 - /* disable the matching interrupt */ 138 - __raw_writel(0x00, mmp_timer_base + TMR_IER(0)); 139 - break; 140 - case CLOCK_EVT_MODE_RESUME: 141 - case CLOCK_EVT_MODE_PERIODIC: 142 - break; 143 - } 132 + /* disable the matching interrupt */ 133 + __raw_writel(0x00, mmp_timer_base + TMR_IER(0)); 144 134 local_irq_restore(flags); 135 + 136 + return 0; 145 137 } 146 138 147 139 static struct clock_event_device ckevt = { 148 - .name = "clockevent", 149 - .features = CLOCK_EVT_FEAT_ONESHOT, 150 - .rating = 200, 151 - .set_next_event = timer_set_next_event, 152 - .set_mode = timer_set_mode, 140 + .name = "clockevent", 141 + .features = CLOCK_EVT_FEAT_ONESHOT, 142 + .rating = 200, 143 + .set_next_event = timer_set_next_event, 144 + .set_state_shutdown = timer_set_shutdown, 145 + .set_state_oneshot = timer_set_shutdown, 153 146 }; 154 147 155 148 static cycle_t clksrc_read(struct clocksource *cs)
+2 -2
arch/arm/mach-mvebu/pmsu.c
··· 415 415 void __iomem *mpsoc_base; 416 416 u32 reg; 417 417 418 - pr_warn("CPU idle is currently broken on Armada 38x: disabling"); 418 + pr_warn("CPU idle is currently broken on Armada 38x: disabling\n"); 419 419 return 0; 420 420 421 421 np = of_find_compatible_node(NULL, NULL, ··· 486 486 */ 487 487 if (of_machine_is_compatible("marvell,armada380")) { 488 488 cpu_hotplug_disable(); 489 - pr_warn("CPU hotplug support is currently broken on Armada 38x: disabling"); 489 + pr_warn("CPU hotplug support is currently broken on Armada 38x: disabling\n"); 490 490 } 491 491 492 492 if (of_machine_is_compatible("marvell,armadaxp"))
+2 -2
arch/arm/mach-mxs/mach-mxs.c
··· 282 282 #define TX28_FEC_PHY_RESET MXS_GPIO_NR(4, 13) 283 283 #define TX28_FEC_nINT MXS_GPIO_NR(4, 5) 284 284 285 - static const struct gpio tx28_gpios[] __initconst = { 285 + static const struct gpio const tx28_gpios[] __initconst = { 286 286 { ENET0_MDC__GPIO_4_0, GPIOF_OUT_INIT_LOW, "GPIO_4_0" }, 287 287 { ENET0_MDIO__GPIO_4_1, GPIOF_OUT_INIT_LOW, "GPIO_4_1" }, 288 288 { ENET0_RX_EN__GPIO_4_2, GPIOF_OUT_INIT_LOW, "GPIO_4_2" }, ··· 528 528 soft_restart(0); 529 529 } 530 530 531 - static const char *mxs_dt_compat[] __initdata = { 531 + static const char *const mxs_dt_compat[] __initconst = { 532 532 "fsl,imx28", 533 533 "fsl,imx23", 534 534 NULL,
+1 -1
arch/arm/mach-netx/generic.c
··· 174 174 for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) { 175 175 irq_set_chip_and_handler(irq, &netx_hif_chip, 176 176 handle_level_irq); 177 - set_irq_flags(irq, IRQF_VALID); 177 + irq_clear_status_flags(irq, IRQ_NOREQUEST); 178 178 } 179 179 180 180 writel(NETX_DPMAS_INT_EN_GLB_EN, NETX_DPMAS_INT_EN);
+30 -27
arch/arm/mach-netx/time.c
··· 34 34 #define TIMER_CLOCKEVENT 0 35 35 #define TIMER_CLOCKSOURCE 1 36 36 37 - static void netx_set_mode(enum clock_event_mode mode, 38 - struct clock_event_device *clk) 37 + static inline void timer_shutdown(struct clock_event_device *evt) 39 38 { 40 - u32 tmode; 41 - 42 39 /* disable timer */ 43 40 writel(0, NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKEVENT)); 41 + } 44 42 45 - switch (mode) { 46 - case CLOCK_EVT_MODE_PERIODIC: 47 - writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 48 - tmode = NETX_GPIO_COUNTER_CTRL_RST_EN | 49 - NETX_GPIO_COUNTER_CTRL_IRQ_EN | 50 - NETX_GPIO_COUNTER_CTRL_RUN; 51 - break; 43 + static int netx_shutdown(struct clock_event_device *evt) 44 + { 45 + timer_shutdown(evt); 52 46 53 - case CLOCK_EVT_MODE_ONESHOT: 54 - writel(0, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 55 - tmode = NETX_GPIO_COUNTER_CTRL_IRQ_EN | 56 - NETX_GPIO_COUNTER_CTRL_RUN; 57 - break; 47 + return 0; 48 + } 58 49 59 - default: 60 - WARN(1, "%s: unhandled mode %d\n", __func__, mode); 61 - /* fall through */ 50 + static int netx_set_oneshot(struct clock_event_device *evt) 51 + { 52 + u32 tmode = NETX_GPIO_COUNTER_CTRL_IRQ_EN | NETX_GPIO_COUNTER_CTRL_RUN; 62 53 63 - case CLOCK_EVT_MODE_SHUTDOWN: 64 - case CLOCK_EVT_MODE_UNUSED: 65 - case CLOCK_EVT_MODE_RESUME: 66 - tmode = 0; 67 - break; 68 - } 69 - 54 + timer_shutdown(evt); 55 + writel(0, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 70 56 writel(tmode, NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKEVENT)); 57 + 58 + return 0; 59 + } 60 + 61 + static int netx_set_periodic(struct clock_event_device *evt) 62 + { 63 + u32 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN | 64 + NETX_GPIO_COUNTER_CTRL_IRQ_EN | NETX_GPIO_COUNTER_CTRL_RUN; 65 + 66 + timer_shutdown(evt); 67 + writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 68 + writel(tmode, NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKEVENT)); 69 + 70 + return 0; 71 71 } 72 72 73 73 static int netx_set_next_event(unsigned long evt, ··· 81 81 .name = "netx-timer" __stringify(TIMER_CLOCKEVENT), 82 82 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 83 83 .set_next_event = netx_set_next_event, 84 - .set_mode = netx_set_mode, 84 + .set_state_shutdown = netx_shutdown, 85 + .set_state_periodic = netx_set_periodic, 86 + .set_state_oneshot = netx_set_oneshot, 87 + .tick_resume = netx_shutdown, 85 88 }; 86 89 87 90 /*
+2 -39
arch/arm/mach-nomadik/cpu-8815.c
··· 26 26 #include <linux/irq.h> 27 27 #include <linux/dma-mapping.h> 28 28 #include <linux/of_irq.h> 29 - #include <linux/of_gpio.h> 30 29 #include <linux/of_address.h> 31 30 #include <linux/of_platform.h> 32 - #include <linux/gpio.h> 33 31 34 32 #include <asm/mach/arch.h> 35 33 #include <asm/mach/map.h> ··· 107 109 writel(1, srcbase + 0x18); 108 110 } 109 111 110 - /* 111 - * This GPIO pin turns on a line that is used to detect card insertion 112 - * on this board. 113 - */ 114 - static int __init cpu8815_mmcsd_init(void) 115 - { 116 - struct device_node *cdbias; 117 - int gpio, err; 118 - 119 - cdbias = of_find_node_by_path("/usb-s8815/mmcsd-gpio"); 120 - if (!cdbias) { 121 - pr_info("could not find MMC/SD card detect bias node\n"); 122 - return 0; 123 - } 124 - gpio = of_get_gpio(cdbias, 0); 125 - if (gpio < 0) { 126 - pr_info("could not obtain MMC/SD card detect bias GPIO\n"); 127 - return 0; 128 - } 129 - err = gpio_request(gpio, "card detect bias"); 130 - if (err) { 131 - pr_info("failed to request card detect bias GPIO %d\n", gpio); 132 - return -ENODEV; 133 - } 134 - err = gpio_direction_output(gpio, 0); 135 - if (err){ 136 - pr_info("failed to set GPIO %d as output, low\n", gpio); 137 - return err; 138 - } 139 - pr_info("enabled USB-S8815 CD bias GPIO %d, low\n", gpio); 140 - return 0; 141 - } 142 - device_initcall(cpu8815_mmcsd_init); 143 - 144 112 static const char * cpu8815_board_compat[] = { 145 113 "st,nomadik-nhk-15", 146 114 "calaosystems,usb-s8815", ··· 114 150 }; 115 151 116 152 DT_MACHINE_START(NOMADIK_DT, "Nomadik STn8815") 117 - /* At full speed latency must be >=2, so 0x249 in low bits */ 118 - .l2c_aux_val = 0x00700249, 119 - .l2c_aux_mask = 0xfe0fefff, 153 + .l2c_aux_val = 0, 154 + .l2c_aux_mask = ~0, 120 155 .map_io = cpu8815_map_io, 121 156 .restart = cpu8815_restart, 122 157 .dt_compat = cpu8815_board_compat,
+1 -1
arch/arm/mach-omap1/fpga.c
··· 169 169 } 170 170 171 171 irq_set_handler(i, handle_edge_irq); 172 - set_irq_flags(i, IRQF_VALID); 172 + irq_clear_status_flags(i, IRQ_NOREQUEST); 173 173 } 174 174 175 175 /*
+1 -1
arch/arm/mach-omap1/irq.c
··· 262 262 263 263 irq_trigger = irq_banks[i].trigger_map >> IRQ_BIT(j); 264 264 omap_irq_set_cfg(j, 0, 0, irq_trigger); 265 - set_irq_flags(j, IRQF_VALID); 265 + irq_clear_status_flags(j, IRQ_NOREQUEST); 266 266 } 267 267 omap_alloc_gc(irq_banks[i].va, irq_base + i * 32, 32); 268 268 }
+16 -19
arch/arm/mach-omap1/time.c
··· 124 124 return 0; 125 125 } 126 126 127 - static void omap_mpu_set_mode(enum clock_event_mode mode, 128 - struct clock_event_device *evt) 127 + static int omap_mpu_set_oneshot(struct clock_event_device *evt) 129 128 { 130 - switch (mode) { 131 - case CLOCK_EVT_MODE_PERIODIC: 132 - omap_mpu_set_autoreset(0); 133 - break; 134 - case CLOCK_EVT_MODE_ONESHOT: 135 - omap_mpu_timer_stop(0); 136 - omap_mpu_remove_autoreset(0); 137 - break; 138 - case CLOCK_EVT_MODE_UNUSED: 139 - case CLOCK_EVT_MODE_SHUTDOWN: 140 - case CLOCK_EVT_MODE_RESUME: 141 - break; 142 - } 129 + omap_mpu_timer_stop(0); 130 + omap_mpu_remove_autoreset(0); 131 + return 0; 132 + } 133 + 134 + static int omap_mpu_set_periodic(struct clock_event_device *evt) 135 + { 136 + omap_mpu_set_autoreset(0); 137 + return 0; 143 138 } 144 139 145 140 static struct clock_event_device clockevent_mpu_timer1 = { 146 - .name = "mpu_timer1", 147 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 148 - .set_next_event = omap_mpu_set_next_event, 149 - .set_mode = omap_mpu_set_mode, 141 + .name = "mpu_timer1", 142 + .features = CLOCK_EVT_FEAT_PERIODIC | 143 + CLOCK_EVT_FEAT_ONESHOT, 144 + .set_next_event = omap_mpu_set_next_event, 145 + .set_state_periodic = omap_mpu_set_periodic, 146 + .set_state_oneshot = omap_mpu_set_oneshot, 150 147 }; 151 148 152 149 static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id)
+16 -17
arch/arm/mach-omap1/timer32k.c
··· 114 114 return 0; 115 115 } 116 116 117 - static void omap_32k_timer_set_mode(enum clock_event_mode mode, 118 - struct clock_event_device *evt) 117 + static int omap_32k_timer_shutdown(struct clock_event_device *evt) 119 118 { 120 119 omap_32k_timer_stop(); 120 + return 0; 121 + } 121 122 122 - switch (mode) { 123 - case CLOCK_EVT_MODE_PERIODIC: 124 - omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); 125 - break; 126 - case CLOCK_EVT_MODE_ONESHOT: 127 - case CLOCK_EVT_MODE_UNUSED: 128 - case CLOCK_EVT_MODE_SHUTDOWN: 129 - break; 130 - case CLOCK_EVT_MODE_RESUME: 131 - break; 132 - } 123 + static int omap_32k_timer_set_periodic(struct clock_event_device *evt) 124 + { 125 + omap_32k_timer_stop(); 126 + omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); 127 + return 0; 133 128 } 134 129 135 130 static struct clock_event_device clockevent_32k_timer = { 136 - .name = "32k-timer", 137 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 138 - .set_next_event = omap_32k_timer_set_next_event, 139 - .set_mode = omap_32k_timer_set_mode, 131 + .name = "32k-timer", 132 + .features = CLOCK_EVT_FEAT_PERIODIC | 133 + CLOCK_EVT_FEAT_ONESHOT, 134 + .set_next_event = omap_32k_timer_set_next_event, 135 + .set_state_shutdown = omap_32k_timer_shutdown, 136 + .set_state_periodic = omap_32k_timer_set_periodic, 137 + .set_state_oneshot = omap_32k_timer_shutdown, 138 + .tick_resume = omap_32k_timer_shutdown, 140 139 }; 141 140 142 141 static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)
-20
arch/arm/mach-omap2/Kconfig
··· 178 178 default y 179 179 select OMAP_PACKAGE_CBB 180 180 181 - config MACH_OMAP3530_LV_SOM 182 - bool "OMAP3 Logic 3530 LV SOM board" 183 - depends on ARCH_OMAP3 184 - default y 185 - select OMAP_PACKAGE_CBB 186 - help 187 - Support for the LogicPD OMAP3530 SOM Development kit 188 - for full description please see the products webpage at 189 - http://www.logicpd.com/products/development-kits/texas-instruments-zoom%E2%84%A2-omap35x-development-kit 190 - 191 - config MACH_OMAP3_TORPEDO 192 - bool "OMAP3 Logic 35x Torpedo board" 193 - depends on ARCH_OMAP3 194 - default y 195 - select OMAP_PACKAGE_CBB 196 - help 197 - Support for the LogicPD OMAP35x Torpedo Development kit 198 - for full description please see the products webpage at 199 - http://www.logicpd.com/products/development-kits/zoom-omap35x-torpedo-development-kit 200 - 201 181 config MACH_OMAP3517EVM 202 182 bool "OMAP3517/ AM3517 EVM board" 203 183 depends on ARCH_OMAP3
-3
arch/arm/mach-omap2/Makefile
··· 235 235 # Specific board support 236 236 obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o pdata-quirks.o 237 237 obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o 238 - obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o 239 - obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o 240 - obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o 241 238 obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o 242 239 obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o sdram-nokia.o 243 240 obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51-peripherals.o
-249
arch/arm/mach-omap2/board-omap3logic.c
··· 1 - /* 2 - * linux/arch/arm/mach-omap2/board-omap3logic.c 3 - * 4 - * Copyright (C) 2010 Li-Pro.Net 5 - * Stephan Linz <linz@li-pro.net> 6 - * 7 - * Copyright (C) 2010-2012 Logic Product Development, Inc. 8 - * Peter Barada <peter.barada@logicpd.com> 9 - * Ashwin BIhari <ashwin.bihari@logicpd.com> 10 - * 11 - * Modified from Beagle, EVM, and RX51 12 - * 13 - * This program is free software; you can redistribute it and/or modify 14 - * it under the terms of the GNU General Public License version 2 as 15 - * published by the Free Software Foundation. 16 - */ 17 - 18 - #include <linux/kernel.h> 19 - #include <linux/init.h> 20 - #include <linux/platform_device.h> 21 - #include <linux/delay.h> 22 - #include <linux/err.h> 23 - #include <linux/clk.h> 24 - #include <linux/io.h> 25 - #include <linux/gpio.h> 26 - 27 - #include <linux/regulator/fixed.h> 28 - #include <linux/regulator/machine.h> 29 - 30 - #include <linux/i2c/twl.h> 31 - #include <linux/mmc/host.h> 32 - #include <linux/usb/phy.h> 33 - 34 - #include <asm/mach-types.h> 35 - #include <asm/mach/arch.h> 36 - #include <asm/mach/map.h> 37 - 38 - #include "common.h" 39 - #include "mux.h" 40 - #include "hsmmc.h" 41 - #include "control.h" 42 - #include "common-board-devices.h" 43 - #include "gpmc.h" 44 - #include "gpmc-smsc911x.h" 45 - 46 - #define OMAP3LOGIC_SMSC911X_CS 1 47 - 48 - #define OMAP3530_LV_SOM_MMC_GPIO_CD 110 49 - #define OMAP3530_LV_SOM_MMC_GPIO_WP 126 50 - #define OMAP3530_LV_SOM_SMSC911X_GPIO_IRQ 152 51 - 52 - #define OMAP3_TORPEDO_MMC_GPIO_CD 127 53 - #define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ 129 54 - 55 - static struct regulator_consumer_supply omap3logic_vmmc1_supply[] = { 56 - REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 57 - }; 58 - 59 - /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ 60 - static struct regulator_init_data omap3logic_vmmc1 = { 61 - .constraints = { 62 - .name = "VMMC1", 63 - .min_uV = 1850000, 64 - .max_uV = 3150000, 65 - .valid_modes_mask = REGULATOR_MODE_NORMAL 66 - | REGULATOR_MODE_STANDBY, 67 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE 68 - | REGULATOR_CHANGE_MODE 69 - | REGULATOR_CHANGE_STATUS, 70 - }, 71 - .num_consumer_supplies = ARRAY_SIZE(omap3logic_vmmc1_supply), 72 - .consumer_supplies = omap3logic_vmmc1_supply, 73 - }; 74 - 75 - static struct twl4030_gpio_platform_data omap3logic_gpio_data = { 76 - .use_leds = true, 77 - .pullups = BIT(1), 78 - .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) 79 - | BIT(13) | BIT(15) | BIT(16) | BIT(17), 80 - }; 81 - 82 - static struct twl4030_usb_data omap3logic_usb_data = { 83 - .usb_mode = T2_USB_MODE_ULPI, 84 - }; 85 - 86 - 87 - static struct twl4030_platform_data omap3logic_twldata = { 88 - /* platform_data for children goes here */ 89 - .gpio = &omap3logic_gpio_data, 90 - .vmmc1 = &omap3logic_vmmc1, 91 - .usb = &omap3logic_usb_data, 92 - }; 93 - 94 - static int __init omap3logic_i2c_init(void) 95 - { 96 - omap3_pmic_init("twl4030", &omap3logic_twldata); 97 - return 0; 98 - } 99 - 100 - static struct omap2_hsmmc_info __initdata board_mmc_info[] = { 101 - { 102 - .name = "external", 103 - .mmc = 1, 104 - .caps = MMC_CAP_4_BIT_DATA, 105 - .gpio_cd = -EINVAL, 106 - .gpio_wp = -EINVAL, 107 - }, 108 - {} /* Terminator */ 109 - }; 110 - 111 - static void __init board_mmc_init(void) 112 - { 113 - if (machine_is_omap3530_lv_som()) { 114 - /* OMAP3530 LV SOM board */ 115 - board_mmc_info[0].gpio_cd = OMAP3530_LV_SOM_MMC_GPIO_CD; 116 - board_mmc_info[0].gpio_wp = OMAP3530_LV_SOM_MMC_GPIO_WP; 117 - omap_mux_init_signal("gpio_110", OMAP_PIN_OUTPUT); 118 - omap_mux_init_signal("gpio_126", OMAP_PIN_OUTPUT); 119 - } else if (machine_is_omap3_torpedo()) { 120 - /* OMAP3 Torpedo board */ 121 - board_mmc_info[0].gpio_cd = OMAP3_TORPEDO_MMC_GPIO_CD; 122 - omap_mux_init_signal("gpio_127", OMAP_PIN_OUTPUT); 123 - } else { 124 - /* unsupported board */ 125 - printk(KERN_ERR "%s(): unknown machine type\n", __func__); 126 - return; 127 - } 128 - 129 - omap_hsmmc_init(board_mmc_info); 130 - } 131 - 132 - static struct omap_smsc911x_platform_data __initdata board_smsc911x_data = { 133 - .cs = OMAP3LOGIC_SMSC911X_CS, 134 - .gpio_irq = -EINVAL, 135 - .gpio_reset = -EINVAL, 136 - }; 137 - 138 - /* TODO/FIXME (comment by Peter Barada, LogicPD): 139 - * Fix the PBIAS voltage for Torpedo MMC1 pins that 140 - * are used for other needs (IRQs, etc). */ 141 - static void omap3torpedo_fix_pbias_voltage(void) 142 - { 143 - u16 control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; 144 - u32 reg; 145 - 146 - if (machine_is_omap3_torpedo()) 147 - { 148 - /* Set the bias for the pin */ 149 - reg = omap_ctrl_readl(control_pbias_offset); 150 - 151 - reg &= ~OMAP343X_PBIASLITEPWRDNZ1; 152 - omap_ctrl_writel(reg, control_pbias_offset); 153 - 154 - /* 100ms delay required for PBIAS configuration */ 155 - msleep(100); 156 - 157 - reg |= OMAP343X_PBIASLITEVMODE1; 158 - reg |= OMAP343X_PBIASLITEPWRDNZ1; 159 - omap_ctrl_writel(reg | 0x300, control_pbias_offset); 160 - } 161 - } 162 - 163 - static inline void __init board_smsc911x_init(void) 164 - { 165 - if (machine_is_omap3530_lv_som()) { 166 - /* OMAP3530 LV SOM board */ 167 - board_smsc911x_data.gpio_irq = 168 - OMAP3530_LV_SOM_SMSC911X_GPIO_IRQ; 169 - omap_mux_init_signal("gpio_152", OMAP_PIN_INPUT); 170 - } else if (machine_is_omap3_torpedo()) { 171 - /* OMAP3 Torpedo board */ 172 - board_smsc911x_data.gpio_irq = OMAP3_TORPEDO_SMSC911X_GPIO_IRQ; 173 - omap_mux_init_signal("gpio_129", OMAP_PIN_INPUT); 174 - } else { 175 - /* unsupported board */ 176 - printk(KERN_ERR "%s(): unknown machine type\n", __func__); 177 - return; 178 - } 179 - 180 - gpmc_smsc911x_init(&board_smsc911x_data); 181 - } 182 - 183 - #ifdef CONFIG_OMAP_MUX 184 - static struct omap_board_mux board_mux[] __initdata = { 185 - /* mUSB */ 186 - OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 187 - OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), 188 - OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 189 - OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 190 - OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 191 - OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 192 - OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 193 - OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 194 - OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 195 - OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 196 - OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 197 - OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT), 198 - 199 - { .reg_offset = OMAP_MUX_TERMINATOR }, 200 - }; 201 - #endif 202 - 203 - static struct regulator_consumer_supply dummy_supplies[] = { 204 - REGULATOR_SUPPLY("vddvario", "smsc911x.0"), 205 - REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), 206 - }; 207 - 208 - static void __init omap3logic_init(void) 209 - { 210 - regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 211 - omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 212 - omap3torpedo_fix_pbias_voltage(); 213 - omap3logic_i2c_init(); 214 - omap_serial_init(); 215 - omap_sdrc_init(NULL, NULL); 216 - board_mmc_init(); 217 - board_smsc911x_init(); 218 - 219 - usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 220 - usb_musb_init(NULL); 221 - 222 - /* Ensure SDRC pins are mux'd for self-refresh */ 223 - omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 224 - omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 225 - } 226 - 227 - MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") 228 - .atag_offset = 0x100, 229 - .reserve = omap_reserve, 230 - .map_io = omap3_map_io, 231 - .init_early = omap35xx_init_early, 232 - .init_irq = omap3_init_irq, 233 - .init_machine = omap3logic_init, 234 - .init_late = omap35xx_init_late, 235 - .init_time = omap3_sync32k_timer_init, 236 - .restart = omap3xxx_restart, 237 - MACHINE_END 238 - 239 - MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") 240 - .atag_offset = 0x100, 241 - .reserve = omap_reserve, 242 - .map_io = omap3_map_io, 243 - .init_early = omap35xx_init_early, 244 - .init_irq = omap3_init_irq, 245 - .init_machine = omap3logic_init, 246 - .init_late = omap35xx_init_late, 247 - .init_time = omap3_sync32k_timer_init, 248 - .restart = omap3xxx_restart, 249 - MACHINE_END
-633
arch/arm/mach-omap2/board-omap3pandora.c
··· 1 - /* 2 - * board-omap3pandora.c (Pandora Handheld Console) 3 - * 4 - * This program is free software; you can redistribute it and/or 5 - * modify it under the terms of the GNU General Public License 6 - * version 2 as published by the Free Software Foundation. 7 - * 8 - * This program is distributed in the hope that it will be useful, but 9 - * WITHOUT ANY WARRANTY; without even the implied warranty of 10 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 - * General Public License for more details. 12 - * 13 - * You should have received a copy of the GNU General Public License 14 - * along with this program; if not, write to the Free Software 15 - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 16 - * 02110-1301 USA 17 - * 18 - */ 19 - 20 - #include <linux/init.h> 21 - #include <linux/kernel.h> 22 - #include <linux/platform_device.h> 23 - 24 - #include <linux/spi/spi.h> 25 - #include <linux/regulator/machine.h> 26 - #include <linux/i2c/twl.h> 27 - #include <linux/omap-gpmc.h> 28 - #include <linux/wl12xx.h> 29 - #include <linux/mtd/partitions.h> 30 - #include <linux/mtd/nand.h> 31 - #include <linux/leds.h> 32 - #include <linux/input.h> 33 - #include <linux/input/matrix_keypad.h> 34 - #include <linux/gpio.h> 35 - #include <linux/gpio_keys.h> 36 - #include <linux/mmc/host.h> 37 - #include <linux/mmc/card.h> 38 - #include <linux/regulator/fixed.h> 39 - #include <linux/usb/phy.h> 40 - #include <linux/platform_data/spi-omap2-mcspi.h> 41 - 42 - #include <asm/mach-types.h> 43 - #include <asm/mach/arch.h> 44 - #include <asm/mach/map.h> 45 - 46 - #include "common.h" 47 - #include <video/omapdss.h> 48 - #include <video/omap-panel-data.h> 49 - #include <linux/platform_data/mtd-nand-omap2.h> 50 - 51 - #include "mux.h" 52 - #include "sdram-micron-mt46h32m32lf-6.h" 53 - #include "hsmmc.h" 54 - #include "common-board-devices.h" 55 - 56 - #define PANDORA_WIFI_IRQ_GPIO 21 57 - #define PANDORA_WIFI_NRESET_GPIO 23 58 - #define OMAP3_PANDORA_TS_GPIO 94 59 - 60 - static struct mtd_partition omap3pandora_nand_partitions[] = { 61 - { 62 - .name = "xloader", 63 - .offset = 0, 64 - .size = 4 * NAND_BLOCK_SIZE, 65 - .mask_flags = MTD_WRITEABLE 66 - }, { 67 - .name = "uboot", 68 - .offset = MTDPART_OFS_APPEND, 69 - .size = 15 * NAND_BLOCK_SIZE, 70 - }, { 71 - .name = "uboot-env", 72 - .offset = MTDPART_OFS_APPEND, 73 - .size = 1 * NAND_BLOCK_SIZE, 74 - }, { 75 - .name = "boot", 76 - .offset = MTDPART_OFS_APPEND, 77 - .size = 80 * NAND_BLOCK_SIZE, 78 - }, { 79 - .name = "rootfs", 80 - .offset = MTDPART_OFS_APPEND, 81 - .size = MTDPART_SIZ_FULL, 82 - }, 83 - }; 84 - 85 - static struct omap_nand_platform_data pandora_nand_data = { 86 - .cs = 0, 87 - .devsize = NAND_BUSWIDTH_16, 88 - .xfer_type = NAND_OMAP_PREFETCH_DMA, 89 - .parts = omap3pandora_nand_partitions, 90 - .nr_parts = ARRAY_SIZE(omap3pandora_nand_partitions), 91 - }; 92 - 93 - static struct gpio_led pandora_gpio_leds[] = { 94 - { 95 - .name = "pandora::sd1", 96 - .default_trigger = "mmc0", 97 - .gpio = 128, 98 - }, { 99 - .name = "pandora::sd2", 100 - .default_trigger = "mmc1", 101 - .gpio = 129, 102 - }, { 103 - .name = "pandora::bluetooth", 104 - .gpio = 158, 105 - }, { 106 - .name = "pandora::wifi", 107 - .gpio = 159, 108 - }, 109 - }; 110 - 111 - static struct gpio_led_platform_data pandora_gpio_led_data = { 112 - .leds = pandora_gpio_leds, 113 - .num_leds = ARRAY_SIZE(pandora_gpio_leds), 114 - }; 115 - 116 - static struct platform_device pandora_leds_gpio = { 117 - .name = "leds-gpio", 118 - .id = -1, 119 - .dev = { 120 - .platform_data = &pandora_gpio_led_data, 121 - }, 122 - }; 123 - 124 - static struct platform_device pandora_backlight = { 125 - .name = "pandora-backlight", 126 - .id = -1, 127 - }; 128 - 129 - #define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \ 130 - { \ 131 - .gpio = gpio_num, \ 132 - .type = ev_type, \ 133 - .code = ev_code, \ 134 - .active_low = act_low, \ 135 - .debounce_interval = 4, \ 136 - .desc = "btn " descr, \ 137 - } 138 - 139 - #define GPIO_BUTTON_LOW(gpio_num, event_code, description) \ 140 - GPIO_BUTTON(gpio_num, EV_KEY, event_code, 1, description) 141 - 142 - static struct gpio_keys_button pandora_gpio_keys[] = { 143 - GPIO_BUTTON_LOW(110, KEY_UP, "up"), 144 - GPIO_BUTTON_LOW(103, KEY_DOWN, "down"), 145 - GPIO_BUTTON_LOW(96, KEY_LEFT, "left"), 146 - GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"), 147 - GPIO_BUTTON_LOW(109, KEY_PAGEUP, "game 1"), 148 - GPIO_BUTTON_LOW(111, KEY_END, "game 2"), 149 - GPIO_BUTTON_LOW(106, KEY_PAGEDOWN, "game 3"), 150 - GPIO_BUTTON_LOW(101, KEY_HOME, "game 4"), 151 - GPIO_BUTTON_LOW(102, KEY_RIGHTSHIFT, "l"), 152 - GPIO_BUTTON_LOW(97, KEY_KPPLUS, "l2"), 153 - GPIO_BUTTON_LOW(105, KEY_RIGHTCTRL, "r"), 154 - GPIO_BUTTON_LOW(107, KEY_KPMINUS, "r2"), 155 - GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"), 156 - GPIO_BUTTON_LOW(99, KEY_MENU, "menu"), 157 - GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"), 158 - GPIO_BUTTON(100, EV_KEY, KEY_LEFTALT, 0, "alt"), 159 - GPIO_BUTTON(108, EV_SW, SW_LID, 1, "lid"), 160 - }; 161 - 162 - static struct gpio_keys_platform_data pandora_gpio_key_info = { 163 - .buttons = pandora_gpio_keys, 164 - .nbuttons = ARRAY_SIZE(pandora_gpio_keys), 165 - }; 166 - 167 - static struct platform_device pandora_keys_gpio = { 168 - .name = "gpio-keys", 169 - .id = -1, 170 - .dev = { 171 - .platform_data = &pandora_gpio_key_info, 172 - }, 173 - }; 174 - 175 - static const uint32_t board_keymap[] = { 176 - /* row, col, code */ 177 - KEY(0, 0, KEY_9), 178 - KEY(0, 1, KEY_8), 179 - KEY(0, 2, KEY_I), 180 - KEY(0, 3, KEY_J), 181 - KEY(0, 4, KEY_N), 182 - KEY(0, 5, KEY_M), 183 - KEY(1, 0, KEY_0), 184 - KEY(1, 1, KEY_7), 185 - KEY(1, 2, KEY_U), 186 - KEY(1, 3, KEY_H), 187 - KEY(1, 4, KEY_B), 188 - KEY(1, 5, KEY_SPACE), 189 - KEY(2, 0, KEY_BACKSPACE), 190 - KEY(2, 1, KEY_6), 191 - KEY(2, 2, KEY_Y), 192 - KEY(2, 3, KEY_G), 193 - KEY(2, 4, KEY_V), 194 - KEY(2, 5, KEY_FN), 195 - KEY(3, 0, KEY_O), 196 - KEY(3, 1, KEY_5), 197 - KEY(3, 2, KEY_T), 198 - KEY(3, 3, KEY_F), 199 - KEY(3, 4, KEY_C), 200 - KEY(4, 0, KEY_P), 201 - KEY(4, 1, KEY_4), 202 - KEY(4, 2, KEY_R), 203 - KEY(4, 3, KEY_D), 204 - KEY(4, 4, KEY_X), 205 - KEY(5, 0, KEY_K), 206 - KEY(5, 1, KEY_3), 207 - KEY(5, 2, KEY_E), 208 - KEY(5, 3, KEY_S), 209 - KEY(5, 4, KEY_Z), 210 - KEY(6, 0, KEY_L), 211 - KEY(6, 1, KEY_2), 212 - KEY(6, 2, KEY_W), 213 - KEY(6, 3, KEY_A), 214 - KEY(6, 4, KEY_DOT), 215 - KEY(7, 0, KEY_ENTER), 216 - KEY(7, 1, KEY_1), 217 - KEY(7, 2, KEY_Q), 218 - KEY(7, 3, KEY_LEFTSHIFT), 219 - KEY(7, 4, KEY_COMMA), 220 - }; 221 - 222 - static struct matrix_keymap_data board_map_data = { 223 - .keymap = board_keymap, 224 - .keymap_size = ARRAY_SIZE(board_keymap), 225 - }; 226 - 227 - static struct twl4030_keypad_data pandora_kp_data = { 228 - .keymap_data = &board_map_data, 229 - .rows = 8, 230 - .cols = 6, 231 - .rep = 1, 232 - }; 233 - 234 - static struct connector_atv_platform_data pandora_tv_pdata = { 235 - .name = "tv", 236 - .source = "venc.0", 237 - .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO, 238 - .invert_polarity = false, 239 - }; 240 - 241 - static struct platform_device pandora_tv_connector_device = { 242 - .name = "connector-analog-tv", 243 - .id = 0, 244 - .dev.platform_data = &pandora_tv_pdata, 245 - }; 246 - 247 - static struct omap_dss_board_info pandora_dss_data = { 248 - .default_display_name = "lcd", 249 - }; 250 - 251 - static void pandora_wl1251_init_card(struct mmc_card *card) 252 - { 253 - /* 254 - * We have TI wl1251 attached to MMC3. Pass this information to 255 - * SDIO core because it can't be probed by normal methods. 256 - */ 257 - if (card->type == MMC_TYPE_SDIO || card->type == MMC_TYPE_SD_COMBO) { 258 - card->quirks |= MMC_QUIRK_NONSTD_SDIO; 259 - card->cccr.wide_bus = 1; 260 - card->cis.vendor = 0x104c; 261 - card->cis.device = 0x9066; 262 - card->cis.blksize = 512; 263 - card->cis.max_dtr = 20000000; 264 - } 265 - } 266 - 267 - static struct omap2_hsmmc_info omap3pandora_mmc[] = { 268 - { 269 - .mmc = 1, 270 - .caps = MMC_CAP_4_BIT_DATA, 271 - .gpio_cd = -EINVAL, 272 - .gpio_wp = 126, 273 - .ext_clock = 0, 274 - .deferred = true, 275 - }, 276 - { 277 - .mmc = 2, 278 - .caps = MMC_CAP_4_BIT_DATA, 279 - .gpio_cd = -EINVAL, 280 - .gpio_wp = 127, 281 - .ext_clock = 1, 282 - .transceiver = true, 283 - .deferred = true, 284 - }, 285 - { 286 - .mmc = 3, 287 - .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, 288 - .gpio_cd = -EINVAL, 289 - .gpio_wp = -EINVAL, 290 - .init_card = pandora_wl1251_init_card, 291 - }, 292 - {} /* Terminator */ 293 - }; 294 - 295 - static int omap3pandora_twl_gpio_setup(struct device *dev, 296 - unsigned gpio, unsigned ngpio) 297 - { 298 - int ret, gpio_32khz; 299 - 300 - /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */ 301 - omap3pandora_mmc[0].gpio_cd = gpio + 0; 302 - omap3pandora_mmc[1].gpio_cd = gpio + 1; 303 - omap_hsmmc_late_init(omap3pandora_mmc); 304 - 305 - /* gpio + 13 drives 32kHz buffer for wifi module */ 306 - gpio_32khz = gpio + 13; 307 - ret = gpio_request_one(gpio_32khz, GPIOF_OUT_INIT_HIGH, "wifi 32kHz"); 308 - if (ret < 0) { 309 - pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret); 310 - return -ENODEV; 311 - } 312 - 313 - return 0; 314 - } 315 - 316 - static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { 317 - .setup = omap3pandora_twl_gpio_setup, 318 - }; 319 - 320 - static struct regulator_consumer_supply pandora_vmmc1_supply[] = { 321 - REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 322 - }; 323 - 324 - static struct regulator_consumer_supply pandora_vmmc2_supply[] = { 325 - REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1") 326 - }; 327 - 328 - static struct regulator_consumer_supply pandora_vmmc3_supply[] = { 329 - REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"), 330 - }; 331 - 332 - static struct regulator_consumer_supply pandora_vdds_supplies[] = { 333 - REGULATOR_SUPPLY("vdds_sdi", "omapdss"), 334 - REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 335 - REGULATOR_SUPPLY("vdds_dsi", "omapdss_dpi.0"), 336 - REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), 337 - }; 338 - 339 - static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = { 340 - REGULATOR_SUPPLY("vcc", "spi1.1"), 341 - }; 342 - 343 - static struct regulator_consumer_supply pandora_usb_phy_supply[] = { 344 - REGULATOR_SUPPLY("vcc", "usb_phy_gen_xceiv.2"), /* hsusb port 2 */ 345 - }; 346 - 347 - /* ads7846 on SPI and 2 nub controllers on I2C */ 348 - static struct regulator_consumer_supply pandora_vaux4_supplies[] = { 349 - REGULATOR_SUPPLY("vcc", "spi1.0"), 350 - REGULATOR_SUPPLY("vcc", "3-0066"), 351 - REGULATOR_SUPPLY("vcc", "3-0067"), 352 - }; 353 - 354 - static struct regulator_consumer_supply pandora_adac_supply[] = { 355 - REGULATOR_SUPPLY("vcc", "soc-audio"), 356 - }; 357 - 358 - /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ 359 - static struct regulator_init_data pandora_vmmc1 = { 360 - .constraints = { 361 - .min_uV = 1850000, 362 - .max_uV = 3150000, 363 - .valid_modes_mask = REGULATOR_MODE_NORMAL 364 - | REGULATOR_MODE_STANDBY, 365 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE 366 - | REGULATOR_CHANGE_MODE 367 - | REGULATOR_CHANGE_STATUS, 368 - }, 369 - .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc1_supply), 370 - .consumer_supplies = pandora_vmmc1_supply, 371 - }; 372 - 373 - /* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */ 374 - static struct regulator_init_data pandora_vmmc2 = { 375 - .constraints = { 376 - .min_uV = 1850000, 377 - .max_uV = 3150000, 378 - .valid_modes_mask = REGULATOR_MODE_NORMAL 379 - | REGULATOR_MODE_STANDBY, 380 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE 381 - | REGULATOR_CHANGE_MODE 382 - | REGULATOR_CHANGE_STATUS, 383 - }, 384 - .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc2_supply), 385 - .consumer_supplies = pandora_vmmc2_supply, 386 - }; 387 - 388 - /* VAUX1 for LCD */ 389 - static struct regulator_init_data pandora_vaux1 = { 390 - .constraints = { 391 - .min_uV = 3000000, 392 - .max_uV = 3000000, 393 - .apply_uV = true, 394 - .valid_modes_mask = REGULATOR_MODE_NORMAL 395 - | REGULATOR_MODE_STANDBY, 396 - .valid_ops_mask = REGULATOR_CHANGE_MODE 397 - | REGULATOR_CHANGE_STATUS, 398 - }, 399 - .num_consumer_supplies = ARRAY_SIZE(pandora_vcc_lcd_supply), 400 - .consumer_supplies = pandora_vcc_lcd_supply, 401 - }; 402 - 403 - /* VAUX2 for USB host PHY */ 404 - static struct regulator_init_data pandora_vaux2 = { 405 - .constraints = { 406 - .min_uV = 1800000, 407 - .max_uV = 1800000, 408 - .apply_uV = true, 409 - .valid_modes_mask = REGULATOR_MODE_NORMAL 410 - | REGULATOR_MODE_STANDBY, 411 - .valid_ops_mask = REGULATOR_CHANGE_MODE 412 - | REGULATOR_CHANGE_STATUS, 413 - }, 414 - .num_consumer_supplies = ARRAY_SIZE(pandora_usb_phy_supply), 415 - .consumer_supplies = pandora_usb_phy_supply, 416 - }; 417 - 418 - /* VAUX4 for ads7846 and nubs */ 419 - static struct regulator_init_data pandora_vaux4 = { 420 - .constraints = { 421 - .min_uV = 2800000, 422 - .max_uV = 2800000, 423 - .apply_uV = true, 424 - .valid_modes_mask = REGULATOR_MODE_NORMAL 425 - | REGULATOR_MODE_STANDBY, 426 - .valid_ops_mask = REGULATOR_CHANGE_MODE 427 - | REGULATOR_CHANGE_STATUS, 428 - }, 429 - .num_consumer_supplies = ARRAY_SIZE(pandora_vaux4_supplies), 430 - .consumer_supplies = pandora_vaux4_supplies, 431 - }; 432 - 433 - /* VSIM for audio DAC */ 434 - static struct regulator_init_data pandora_vsim = { 435 - .constraints = { 436 - .min_uV = 2800000, 437 - .max_uV = 2800000, 438 - .apply_uV = true, 439 - .valid_modes_mask = REGULATOR_MODE_NORMAL 440 - | REGULATOR_MODE_STANDBY, 441 - .valid_ops_mask = REGULATOR_CHANGE_MODE 442 - | REGULATOR_CHANGE_STATUS, 443 - }, 444 - .num_consumer_supplies = ARRAY_SIZE(pandora_adac_supply), 445 - .consumer_supplies = pandora_adac_supply, 446 - }; 447 - 448 - /* Fixed regulator internal to Wifi module */ 449 - static struct regulator_init_data pandora_vmmc3 = { 450 - .constraints = { 451 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 452 - }, 453 - .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc3_supply), 454 - .consumer_supplies = pandora_vmmc3_supply, 455 - }; 456 - 457 - static struct fixed_voltage_config pandora_vwlan = { 458 - .supply_name = "vwlan", 459 - .microvolts = 1800000, /* 1.8V */ 460 - .gpio = PANDORA_WIFI_NRESET_GPIO, 461 - .startup_delay = 50000, /* 50ms */ 462 - .enable_high = 1, 463 - .enabled_at_boot = 0, 464 - .init_data = &pandora_vmmc3, 465 - }; 466 - 467 - static struct platform_device pandora_vwlan_device = { 468 - .name = "reg-fixed-voltage", 469 - .id = 1, 470 - .dev = { 471 - .platform_data = &pandora_vwlan, 472 - }, 473 - }; 474 - 475 - static struct twl4030_bci_platform_data pandora_bci_data; 476 - 477 - static struct twl4030_power_data pandora_power_data = { 478 - .use_poweroff = true, 479 - }; 480 - 481 - static struct twl4030_platform_data omap3pandora_twldata = { 482 - .gpio = &omap3pandora_gpio_data, 483 - .vmmc1 = &pandora_vmmc1, 484 - .vmmc2 = &pandora_vmmc2, 485 - .vaux1 = &pandora_vaux1, 486 - .vaux2 = &pandora_vaux2, 487 - .vaux4 = &pandora_vaux4, 488 - .vsim = &pandora_vsim, 489 - .keypad = &pandora_kp_data, 490 - .bci = &pandora_bci_data, 491 - .power = &pandora_power_data, 492 - }; 493 - 494 - static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = { 495 - { 496 - I2C_BOARD_INFO("bq27500", 0x55), 497 - .flags = I2C_CLIENT_WAKE, 498 - }, 499 - }; 500 - 501 - static int __init omap3pandora_i2c_init(void) 502 - { 503 - omap3_pmic_get_config(&omap3pandora_twldata, 504 - TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO, 505 - TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); 506 - 507 - omap3pandora_twldata.vdac->constraints.apply_uV = true; 508 - 509 - omap3pandora_twldata.vpll2->constraints.apply_uV = true; 510 - omap3pandora_twldata.vpll2->num_consumer_supplies = 511 - ARRAY_SIZE(pandora_vdds_supplies); 512 - omap3pandora_twldata.vpll2->consumer_supplies = pandora_vdds_supplies; 513 - 514 - omap3_pmic_init("tps65950", &omap3pandora_twldata); 515 - /* i2c2 pins are not connected */ 516 - omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo, 517 - ARRAY_SIZE(omap3pandora_i2c3_boardinfo)); 518 - return 0; 519 - } 520 - 521 - static struct panel_tpo_td043mtea1_platform_data pandora_lcd_pdata = { 522 - .name = "lcd", 523 - .source = "dpi.0", 524 - 525 - .data_lines = 24, 526 - .nreset_gpio = 157, 527 - }; 528 - 529 - static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { 530 - { 531 - .modalias = "panel-tpo-td043mtea1", 532 - .bus_num = 1, 533 - .chip_select = 1, 534 - .max_speed_hz = 375000, 535 - .platform_data = &pandora_lcd_pdata, 536 - } 537 - }; 538 - 539 - static void __init pandora_wl1251_init(void) 540 - { 541 - struct wl1251_platform_data pandora_wl1251_pdata; 542 - int ret; 543 - 544 - memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); 545 - 546 - pandora_wl1251_pdata.power_gpio = -1; 547 - 548 - ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq"); 549 - if (ret < 0) 550 - goto fail; 551 - 552 - pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO); 553 - if (pandora_wl1251_pdata.irq < 0) 554 - goto fail_irq; 555 - 556 - pandora_wl1251_pdata.use_eeprom = true; 557 - ret = wl1251_set_platform_data(&pandora_wl1251_pdata); 558 - if (ret < 0) 559 - goto fail_irq; 560 - 561 - return; 562 - 563 - fail_irq: 564 - gpio_free(PANDORA_WIFI_IRQ_GPIO); 565 - fail: 566 - printk(KERN_ERR "wl1251 board initialisation failed\n"); 567 - } 568 - 569 - static struct usbhs_phy_data phy_data[] __initdata = { 570 - { 571 - .port = 2, 572 - .reset_gpio = 16, 573 - .vcc_gpio = -EINVAL, 574 - }, 575 - }; 576 - 577 - static struct platform_device *omap3pandora_devices[] __initdata = { 578 - &pandora_leds_gpio, 579 - &pandora_keys_gpio, 580 - &pandora_vwlan_device, 581 - &pandora_backlight, 582 - &pandora_tv_connector_device, 583 - }; 584 - 585 - static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 586 - .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 587 - }; 588 - 589 - #ifdef CONFIG_OMAP_MUX 590 - static struct omap_board_mux board_mux[] __initdata = { 591 - { .reg_offset = OMAP_MUX_TERMINATOR }, 592 - }; 593 - #endif 594 - 595 - static void __init omap3pandora_init(void) 596 - { 597 - omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 598 - omap_hsmmc_init(omap3pandora_mmc); 599 - omap3pandora_i2c_init(); 600 - pandora_wl1251_init(); 601 - platform_add_devices(omap3pandora_devices, 602 - ARRAY_SIZE(omap3pandora_devices)); 603 - omap_display_init(&pandora_dss_data); 604 - omap_serial_init(); 605 - omap_sdrc_init(mt46h32m32lf6_sdrc_params, 606 - mt46h32m32lf6_sdrc_params); 607 - spi_register_board_info(omap3pandora_spi_board_info, 608 - ARRAY_SIZE(omap3pandora_spi_board_info)); 609 - omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); 610 - 611 - usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); 612 - usbhs_init(&usbhs_bdata); 613 - 614 - usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 615 - usb_musb_init(NULL); 616 - gpmc_nand_init(&pandora_nand_data, NULL); 617 - 618 - /* Ensure SDRC pins are mux'd for self-refresh */ 619 - omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 620 - omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 621 - } 622 - 623 - MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") 624 - .atag_offset = 0x100, 625 - .reserve = omap_reserve, 626 - .map_io = omap3_map_io, 627 - .init_early = omap35xx_init_early, 628 - .init_irq = omap3_init_irq, 629 - .init_machine = omap3pandora_init, 630 - .init_late = omap35xx_init_late, 631 - .init_time = omap3_sync32k_timer_init, 632 - .restart = omap3xxx_restart, 633 - MACHINE_END
+1 -1
arch/arm/mach-omap2/prm_common.c
··· 705 705 }; 706 706 #endif 707 707 708 - static const struct of_device_id omap_prcm_dt_match_table[] __initconst = { 708 + static const struct of_device_id const omap_prcm_dt_match_table[] __initconst = { 709 709 #ifdef CONFIG_SOC_AM33XX 710 710 { .compatible = "ti,am3-prcm", .data = &am3_prm_data }, 711 711 #endif
+24 -24
arch/arm/mach-omap2/timer.c
··· 102 102 return 0; 103 103 } 104 104 105 - static void omap2_gp_timer_set_mode(enum clock_event_mode mode, 106 - struct clock_event_device *evt) 105 + static int omap2_gp_timer_shutdown(struct clock_event_device *evt) 106 + { 107 + __omap_dm_timer_stop(&clkev, OMAP_TIMER_POSTED, clkev.rate); 108 + return 0; 109 + } 110 + 111 + static int omap2_gp_timer_set_periodic(struct clock_event_device *evt) 107 112 { 108 113 u32 period; 109 114 110 115 __omap_dm_timer_stop(&clkev, OMAP_TIMER_POSTED, clkev.rate); 111 116 112 - switch (mode) { 113 - case CLOCK_EVT_MODE_PERIODIC: 114 - period = clkev.rate / HZ; 115 - period -= 1; 116 - /* Looks like we need to first set the load value separately */ 117 - __omap_dm_timer_write(&clkev, OMAP_TIMER_LOAD_REG, 118 - 0xffffffff - period, OMAP_TIMER_POSTED); 119 - __omap_dm_timer_load_start(&clkev, 120 - OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST, 121 - 0xffffffff - period, OMAP_TIMER_POSTED); 122 - break; 123 - case CLOCK_EVT_MODE_ONESHOT: 124 - break; 125 - case CLOCK_EVT_MODE_UNUSED: 126 - case CLOCK_EVT_MODE_SHUTDOWN: 127 - case CLOCK_EVT_MODE_RESUME: 128 - break; 129 - } 117 + period = clkev.rate / HZ; 118 + period -= 1; 119 + /* Looks like we need to first set the load value separately */ 120 + __omap_dm_timer_write(&clkev, OMAP_TIMER_LOAD_REG, 0xffffffff - period, 121 + OMAP_TIMER_POSTED); 122 + __omap_dm_timer_load_start(&clkev, 123 + OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST, 124 + 0xffffffff - period, OMAP_TIMER_POSTED); 125 + return 0; 130 126 } 131 127 132 128 static struct clock_event_device clockevent_gpt = { 133 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 134 - .rating = 300, 135 - .set_next_event = omap2_gp_timer_set_next_event, 136 - .set_mode = omap2_gp_timer_set_mode, 129 + .features = CLOCK_EVT_FEAT_PERIODIC | 130 + CLOCK_EVT_FEAT_ONESHOT, 131 + .rating = 300, 132 + .set_next_event = omap2_gp_timer_set_next_event, 133 + .set_state_shutdown = omap2_gp_timer_shutdown, 134 + .set_state_periodic = omap2_gp_timer_set_periodic, 135 + .set_state_oneshot = omap2_gp_timer_shutdown, 136 + .tick_resume = omap2_gp_timer_shutdown, 137 137 }; 138 138 139 139 static struct property device_disabled = {
+1 -1
arch/arm/mach-omap2/vc.c
··· 563 563 u8 hsscll_12; 564 564 }; 565 565 566 - static const __initdata struct i2c_init_data omap4_i2c_timing_data[] = { 566 + static const struct i2c_init_data const omap4_i2c_timing_data[] __initconst = { 567 567 { 568 568 .load = 50, 569 569 .loadbits = 0x3,
+1 -1
arch/arm/mach-omap2/voltagedomains3xxx_data.c
··· 95 95 }; 96 96 97 97 98 - static const char *sys_clk_name __initdata = "sys_ck"; 98 + static const char *const sys_clk_name __initconst = "sys_ck"; 99 99 100 100 void __init omap3xxx_voltagedomains_init(void) 101 101 {
+1 -1
arch/arm/mach-omap2/voltagedomains44xx_data.c
··· 92 92 NULL, 93 93 }; 94 94 95 - static const char *sys_clk_name __initdata = "sys_clkin_ck"; 95 + static const char *const sys_clk_name __initconst = "sys_clkin_ck"; 96 96 97 97 void __init omap44xx_voltagedomains_init(void) 98 98 {
+1 -1
arch/arm/mach-omap2/voltagedomains54xx_data.c
··· 78 78 NULL, 79 79 }; 80 80 81 - static const char *sys_clk_name __initdata = "sys_clkin"; 81 + static const char *const sys_clk_name __initconst = "sys_clkin"; 82 82 83 83 void __init omap54xx_voltagedomains_init(void) 84 84 {
+1 -3
arch/arm/mach-orion5x/dns323-setup.c
··· 236 236 } 237 237 238 238 iounmap(mac_page); 239 - printk("DNS-323: Found ethernet MAC address: "); 240 - for (i = 0; i < 6; i++) 241 - printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n"); 239 + printk("DNS-323: Found ethernet MAC address: %pM\n", addr); 242 240 243 241 memcpy(dns323_eth_data.mac_addr, addr, 6); 244 242
+1 -3
arch/arm/mach-orion5x/tsx09-common.c
··· 101 101 addr[i] = byte; 102 102 } 103 103 104 - printk(KERN_INFO "tsx09: found ethernet mac address "); 105 - for (i = 0; i < 6; i++) 106 - printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n"); 104 + printk(KERN_INFO "tsx09: found ethernet mac address %pM\n", addr); 107 105 108 106 memcpy(qnap_tsx09_eth_data.mac_addr, addr, 6); 109 107
+8 -8
arch/arm/mach-pxa/balloon3.c
··· 496 496 .irq_unmask = balloon3_unmask_irq, 497 497 }; 498 498 499 - static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc) 499 + static void balloon3_irq_handler(unsigned int __irq, struct irq_desc *desc) 500 500 { 501 501 unsigned long pending = __raw_readl(BALLOON3_INT_CONTROL_REG) & 502 502 balloon3_irq_enabled; 503 503 do { 504 - /* clear useless edge notification */ 505 - if (desc->irq_data.chip->irq_ack) { 506 - struct irq_data *d; 504 + struct irq_data *d = irq_desc_get_irq_data(desc); 505 + struct irq_chip *chip = irq_data_get_chip(d); 506 + unsigned int irq; 507 507 508 - d = irq_get_irq_data(BALLOON3_AUX_NIRQ); 509 - desc->irq_data.chip->irq_ack(d); 510 - } 508 + /* clear useless edge notification */ 509 + if (chip->irq_ack) 510 + chip->irq_ack(d); 511 511 512 512 while (pending) { 513 513 irq = BALLOON3_IRQ(0) + __ffs(pending); ··· 528 528 for (irq = BALLOON3_IRQ(0); irq <= BALLOON3_IRQ(7); irq++) { 529 529 irq_set_chip_and_handler(irq, &balloon3_irq_chip, 530 530 handle_level_irq); 531 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 531 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 532 532 } 533 533 534 534 irq_set_chained_handler(BALLOON3_AUX_NIRQ, balloon3_irq_handler);
+2 -1
arch/arm/mach-pxa/cm-x2xx-pci.c
··· 29 29 void __iomem *it8152_base_address; 30 30 static int cmx2xx_it8152_irq_gpio; 31 31 32 - static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 32 + static void cmx2xx_it8152_irq_demux(unsigned int __irq, struct irq_desc *desc) 33 33 { 34 + unsigned int irq = irq_desc_get_irq(desc); 34 35 /* clear our parent irq */ 35 36 desc->irq_data.chip->irq_ack(&desc->irq_data); 36 37
-1
arch/arm/mach-pxa/irq.c
··· 133 133 irq_set_chip_and_handler(virq, &pxa_internal_irq_chip, 134 134 handle_level_irq); 135 135 irq_set_chip_data(virq, base); 136 - set_irq_flags(virq, IRQF_VALID); 137 136 138 137 return 0; 139 138 }
+3 -2
arch/arm/mach-pxa/lpd270.c
··· 120 120 .irq_unmask = lpd270_unmask_irq, 121 121 }; 122 122 123 - static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc) 123 + static void lpd270_irq_handler(unsigned int __irq, struct irq_desc *desc) 124 124 { 125 + unsigned int irq; 125 126 unsigned long pending; 126 127 127 128 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled; ··· 152 151 for (irq = LPD270_IRQ(2); irq <= LPD270_IRQ(4); irq++) { 153 152 irq_set_chip_and_handler(irq, &lpd270_irq_chip, 154 153 handle_level_irq); 155 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 154 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 156 155 } 157 156 irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lpd270_irq_handler); 158 157 irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
+3 -2
arch/arm/mach-pxa/pcm990-baseboard.c
··· 284 284 .irq_unmask = pcm990_unmask_irq, 285 285 }; 286 286 287 - static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc) 287 + static void pcm990_irq_handler(unsigned int __irq, struct irq_desc *desc) 288 288 { 289 + unsigned int irq; 289 290 unsigned long pending; 290 291 291 292 pending = ~pcm990_cpld_readb(PCM990_CTRL_INTSETCLR); ··· 312 311 for (irq = PCM027_IRQ(0); irq <= PCM027_IRQ(3); irq++) { 313 312 irq_set_chip_and_handler(irq, &pcm990_irq_chip, 314 313 handle_level_irq); 315 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 314 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 316 315 } 317 316 318 317 /* disable all Interrupts */
+2 -2
arch/arm/mach-pxa/pxa-dt.c
··· 19 19 #include "generic.h" 20 20 21 21 #ifdef CONFIG_PXA3xx 22 - static const struct of_dev_auxdata pxa3xx_auxdata_lookup[] __initconst = { 22 + static const struct of_dev_auxdata const pxa3xx_auxdata_lookup[] __initconst = { 23 23 OF_DEV_AUXDATA("mrvl,pxa-uart", 0x40100000, "pxa2xx-uart.0", NULL), 24 24 OF_DEV_AUXDATA("mrvl,pxa-uart", 0x40200000, "pxa2xx-uart.1", NULL), 25 25 OF_DEV_AUXDATA("mrvl,pxa-uart", 0x40700000, "pxa2xx-uart.2", NULL), ··· 39 39 pxa3xx_auxdata_lookup, NULL); 40 40 } 41 41 42 - static const char *pxa3xx_dt_board_compat[] __initdata = { 42 + static const char *const pxa3xx_dt_board_compat[] __initconst = { 43 43 "marvell,pxa300", 44 44 "marvell,pxa310", 45 45 "marvell,pxa320",
+1 -1
arch/arm/mach-pxa/pxa3xx.c
··· 325 325 for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) { 326 326 irq_set_chip_and_handler(irq, &pxa_ext_wakeup_chip, 327 327 handle_edge_irq); 328 - set_irq_flags(irq, IRQF_VALID); 328 + irq_clear_status_flags(irq, IRQ_NOREQUEST); 329 329 } 330 330 331 331 pxa_ext_wakeup_chip.irq_set_wake = fn;
+3 -2
arch/arm/mach-pxa/viper.c
··· 276 276 viper_irq_enabled_mask; 277 277 } 278 278 279 - static void viper_irq_handler(unsigned int irq, struct irq_desc *desc) 279 + static void viper_irq_handler(unsigned int __irq, struct irq_desc *desc) 280 280 { 281 + unsigned int irq; 281 282 unsigned long pending; 282 283 283 284 pending = viper_irq_pending(); ··· 314 313 isa_irq = viper_bit_to_irq(level); 315 314 irq_set_chip_and_handler(isa_irq, &viper_irq_chip, 316 315 handle_edge_irq); 317 - set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE); 316 + irq_clear_status_flags(isa_irq, IRQ_NOREQUEST | IRQ_NOPROBE); 318 317 } 319 318 320 319 irq_set_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO),
+3 -2
arch/arm/mach-pxa/zeus.c
··· 105 105 return __raw_readw(ZEUS_CPLD_ISA_IRQ) & zeus_irq_enabled_mask; 106 106 } 107 107 108 - static void zeus_irq_handler(unsigned int irq, struct irq_desc *desc) 108 + static void zeus_irq_handler(unsigned int __irq, struct irq_desc *desc) 109 109 { 110 + unsigned int irq; 110 111 unsigned long pending; 111 112 112 113 pending = zeus_irq_pending(); ··· 152 151 isa_irq = zeus_bit_to_irq(level); 153 152 irq_set_chip_and_handler(isa_irq, &zeus_irq_chip, 154 153 handle_edge_irq); 155 - set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE); 154 + irq_clear_status_flags(isa_irq, IRQ_NOREQUEST | IRQ_NOPROBE); 156 155 } 157 156 158 157 irq_set_irq_type(gpio_to_irq(ZEUS_ISA_GPIO), IRQ_TYPE_EDGE_RISING);
+1 -1
arch/arm/mach-realview/realview-dt.c
··· 13 13 #include <asm/hardware/cache-l2x0.h> 14 14 #include "core.h" 15 15 16 - static const char *realview_dt_platform_compat[] __initconst = { 16 + static const char *const realview_dt_platform_compat[] __initconst = { 17 17 "arm,realview-eb", 18 18 "arm,realview-pb1176", 19 19 "arm,realview-pb11mp",
+1 -1
arch/arm/mach-rpc/ecard.c
··· 946 946 irq_set_chip_and_handler(ec->irq, &ecard_chip, 947 947 handle_level_irq); 948 948 irq_set_chip_data(ec->irq, ec); 949 - set_irq_flags(ec->irq, IRQF_VALID); 949 + irq_clear_status_flags(ec->irq, IRQ_NOREQUEST); 950 950 } 951 951 952 952 #ifdef CONFIG_ARCH_RPC
+8 -8
arch/arm/mach-rpc/irq.c
··· 117 117 118 118 void __init rpc_init_irq(void) 119 119 { 120 - unsigned int irq, flags; 120 + unsigned int irq, clr, set = 0; 121 121 122 122 iomd_writeb(0, IOMD_IRQMASKA); 123 123 iomd_writeb(0, IOMD_IRQMASKB); ··· 128 128 &rpc_default_fiq_end - &rpc_default_fiq_start); 129 129 130 130 for (irq = 0; irq < NR_IRQS; irq++) { 131 - flags = IRQF_VALID; 131 + clr = IRQ_NOREQUEST; 132 132 133 133 if (irq <= 6 || (irq >= 9 && irq <= 15)) 134 - flags |= IRQF_PROBE; 134 + clr |= IRQ_NOPROBE; 135 135 136 136 if (irq == 21 || (irq >= 16 && irq <= 19) || 137 137 irq == IRQ_KEYBOARDTX) 138 - flags |= IRQF_NOAUTOEN; 138 + set |= IRQ_NOAUTOEN; 139 139 140 140 switch (irq) { 141 141 case 0 ... 7: 142 142 irq_set_chip_and_handler(irq, &iomd_a_chip, 143 143 handle_level_irq); 144 - set_irq_flags(irq, flags); 144 + irq_modify_status(irq, clr, set); 145 145 break; 146 146 147 147 case 8 ... 15: 148 148 irq_set_chip_and_handler(irq, &iomd_b_chip, 149 149 handle_level_irq); 150 - set_irq_flags(irq, flags); 150 + irq_modify_status(irq, clr, set); 151 151 break; 152 152 153 153 case 16 ... 21: 154 154 irq_set_chip_and_handler(irq, &iomd_dma_chip, 155 155 handle_level_irq); 156 - set_irq_flags(irq, flags); 156 + irq_modify_status(irq, clr, set); 157 157 break; 158 158 159 159 case 64 ... 71: 160 160 irq_set_chip(irq, &iomd_fiq_chip); 161 - set_irq_flags(irq, IRQF_VALID); 161 + irq_modify_status(irq, clr, set); 162 162 break; 163 163 } 164 164 }
+5
arch/arm/mach-s3c24xx/Kconfig
··· 124 124 This also means that the PLL tables for the selected CPU(s) will 125 125 be built which may increase the size of the kernel image. 126 126 127 + config S3C_SETUP_CAMIF 128 + bool 129 + help 130 + Compile in common setup code for S3C CAMIF devices 131 + 127 132 # cpu frequency items common between s3c2410 and s3c2440/s3c2442 128 133 129 134 config S3C2410_IOTIMING
+1
arch/arm/mach-s3c24xx/Makefile
··· 99 99 obj-$(CONFIG_S3C2443_SETUP_SPI) += setup-spi.o 100 100 obj-$(CONFIG_ARCH_S3C24XX) += setup-i2c.o 101 101 obj-$(CONFIG_S3C24XX_SETUP_TS) += setup-ts.o 102 + obj-$(CONFIG_S3C_SETUP_CAMIF) += setup-camif.o
+1 -1
arch/arm/mach-s3c24xx/bast-irq.c
··· 147 147 148 148 irq_set_chip_and_handler(irqno, &bast_pc104_chip, 149 149 handle_level_irq); 150 - set_irq_flags(irqno, IRQF_VALID); 150 + irq_clear_status_flags(irqno, IRQ_NOREQUEST); 151 151 } 152 152 } 153 153
+1 -1
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c
··· 39 39 s3c_pm_init(); 40 40 } 41 41 42 - static char const *s3c2416_dt_compat[] __initdata = { 42 + static const char *const s3c2416_dt_compat[] __initconst = { 43 43 "samsung,s3c2416", 44 44 "samsung,s3c2450", 45 45 NULL
+1 -1
arch/arm/mach-s3c24xx/s3c2412.c
··· 40 40 #include <plat/cpu.h> 41 41 #include <plat/cpu-freq.h> 42 42 #include <plat/devs.h> 43 - #include <plat/nand-core.h> 44 43 #include <plat/pm.h> 45 44 #include <plat/regs-spi.h> 46 45 47 46 #include "common.h" 47 + #include "nand-core.h" 48 48 #include "regs-dsc.h" 49 49 #include "s3c2412-power.h" 50 50
+3 -3
arch/arm/mach-s3c24xx/s3c2416.c
··· 59 59 #include <plat/pm.h> 60 60 61 61 #include <plat/iic-core.h> 62 - #include <plat/fb-core.h> 63 - #include <plat/nand-core.h> 64 62 #include <plat/adc-core.h> 65 - #include <plat/spi-core.h> 66 63 67 64 #include "common.h" 65 + #include "fb-core.h" 66 + #include "nand-core.h" 67 + #include "spi-core.h" 68 68 69 69 static struct map_desc s3c2416_iodesc[] __initdata = { 70 70 IODESC_ENT(WATCHDOG),
+4 -3
arch/arm/mach-s3c24xx/s3c2443.c
··· 41 41 #include <plat/gpio-cfg-helpers.h> 42 42 #include <plat/devs.h> 43 43 #include <plat/cpu.h> 44 - #include <plat/fb-core.h> 45 - #include <plat/nand-core.h> 46 44 #include <plat/adc-core.h> 47 - #include <plat/spi-core.h> 45 + 46 + #include "fb-core.h" 47 + #include "nand-core.h" 48 + #include "spi-core.h" 48 49 49 50 static struct map_desc s3c2443_iodesc[] __initdata = { 50 51 IODESC_ENT(WATCHDOG),
+1 -1
arch/arm/mach-s3c24xx/s3c244x.c
··· 41 41 #include <plat/devs.h> 42 42 #include <plat/cpu.h> 43 43 #include <plat/pm.h> 44 - #include <plat/nand-core.h> 45 44 46 45 #include "common.h" 46 + #include "nand-core.h" 47 47 #include "regs-dsc.h" 48 48 49 49 static struct map_desc s3c244x_iodesc[] __initdata = {
+6
arch/arm/mach-s3c64xx/Kconfig
··· 34 34 help 35 35 Compile in platform device definition for OneNAND1 controller 36 36 37 + config SAMSUNG_DEV_BACKLIGHT 38 + bool 39 + depends on SAMSUNG_DEV_PWM 40 + help 41 + Compile in platform device definition LCD backlight with PWM Timer 42 + 37 43 # platform specific device setup 38 44 39 45 config S3C64XX_SETUP_I2C0
+2
arch/arm/mach-s3c64xx/Makefile
··· 40 40 obj-$(CONFIG_S3C64XX_SETUP_SPI) += setup-spi.o 41 41 obj-$(CONFIG_S3C64XX_SETUP_USB_PHY) += setup-usb-phy.o 42 42 43 + obj-$(CONFIG_SAMSUNG_DEV_BACKLIGHT) += dev-backlight.o 44 + 43 45 # Machine support 44 46 45 47 obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o
+3 -3
arch/arm/mach-s3c64xx/common.c
··· 47 47 #include <plat/devs.h> 48 48 #include <plat/pm.h> 49 49 #include <plat/gpio-cfg.h> 50 - #include <plat/irq-uart.h> 51 50 #include <plat/pwm-core.h> 52 51 #include <plat/regs-irqtype.h> 53 - #include <plat/watchdog-reset.h> 54 52 55 53 #include "common.h" 54 + #include "irq-uart.h" 55 + #include "watchdog-reset.h" 56 56 57 57 /* External clock frequency */ 58 58 static unsigned long xtal_f = 12000000, xusbxti_f = 48000000; ··· 419 419 for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { 420 420 irq_set_chip_and_handler(irq, &s3c_irq_eint, handle_level_irq); 421 421 irq_set_chip_data(irq, (void *)eint_irq_to_bit(irq)); 422 - set_irq_flags(irq, IRQF_VALID); 422 + irq_clear_status_flags(irq, IRQ_NOREQUEST); 423 423 } 424 424 425 425 irq_set_chained_handler(IRQ_EINT0_3, s3c_irq_demux_eint0_3);
+2 -3
arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
··· 15 15 #include <asm/system_misc.h> 16 16 17 17 #include <plat/cpu.h> 18 - #include <plat/watchdog-reset.h> 19 - 20 18 #include <mach/map.h> 21 19 22 20 #include "common.h" 21 + #include "watchdog-reset.h" 23 22 24 23 /* 25 24 * IO mapping for shared system controller IP. ··· 60 61 soft_restart(0); 61 62 } 62 63 63 - static char const *s3c64xx_dt_compat[] __initdata = { 64 + static const char *const s3c64xx_dt_compat[] __initconst = { 64 65 "samsung,s3c6400", 65 66 "samsung,s3c6410", 66 67 NULL
+1 -1
arch/arm/mach-s3c64xx/mach-smdk6410.c
··· 68 68 #include <plat/adc.h> 69 69 #include <linux/platform_data/touchscreen-s3c2410.h> 70 70 #include <plat/keypad.h> 71 - #include <plat/backlight.h> 72 71 #include <plat/samsung-time.h> 73 72 73 + #include "backlight.h" 74 74 #include "common.h" 75 75 #include "regs-modem.h" 76 76 #include "regs-srom.h"
+1 -1
arch/arm/mach-s3c64xx/s3c6400.c
··· 41 41 #include <plat/devs.h> 42 42 #include <plat/sdhci.h> 43 43 #include <plat/iic-core.h> 44 - #include <plat/onenand-core.h> 45 44 46 45 #include "common.h" 46 + #include "onenand-core.h" 47 47 48 48 void __init s3c6400_map_io(void) 49 49 {
+2 -2
arch/arm/mach-s3c64xx/s3c6410.c
··· 41 41 #include <plat/cpu.h> 42 42 #include <plat/devs.h> 43 43 #include <plat/sdhci.h> 44 - #include <plat/ata-core.h> 45 44 #include <plat/adc-core.h> 46 45 #include <plat/iic-core.h> 47 - #include <plat/onenand-core.h> 48 46 47 + #include "ata-core.h" 49 48 #include "common.h" 49 + #include "onenand-core.h" 50 50 51 51 void __init s3c6410_map_io(void) 52 52 {
+1 -1
arch/arm/mach-s3c64xx/setup-usb-phy.c
··· 16 16 #include <linux/platform_device.h> 17 17 #include <mach/map.h> 18 18 #include <plat/cpu.h> 19 - #include <plat/regs-usb-hsotg-phy.h> 20 19 #include <plat/usb-phy.h> 21 20 22 21 #include "regs-sys.h" 22 + #include "regs-usb-hsotg-phy.h" 23 23 24 24 static int s3c_usb_otgphy_init(struct platform_device *pdev) 25 25 {
+2 -2
arch/arm/mach-sa1100/neponset.c
··· 320 320 321 321 irq_set_chip_and_handler(d->irq_base + NEP_IRQ_SMC91X, &nochip, 322 322 handle_simple_irq); 323 - set_irq_flags(d->irq_base + NEP_IRQ_SMC91X, IRQF_VALID | IRQF_PROBE); 323 + irq_clear_status_flags(d->irq_base + NEP_IRQ_SMC91X, IRQ_NOREQUEST | IRQ_NOPROBE); 324 324 irq_set_chip_and_handler(d->irq_base + NEP_IRQ_USAR, &nochip, 325 325 handle_simple_irq); 326 - set_irq_flags(d->irq_base + NEP_IRQ_USAR, IRQF_VALID | IRQF_PROBE); 326 + irq_clear_status_flags(d->irq_base + NEP_IRQ_USAR, IRQ_NOREQUEST | IRQ_NOPROBE); 327 327 irq_set_chip(d->irq_base + NEP_IRQ_SA1111, &nochip); 328 328 329 329 irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
-47
arch/arm/mach-shmobile/Kconfig
··· 89 89 select ARCH_RMOBILE 90 90 select RENESAS_INTC_IRQPIN 91 91 92 - comment "Renesas ARM SoCs Board Type" 93 - 94 - config MACH_MARZEN 95 - bool "MARZEN board" 96 - depends on ARCH_R8A7779 97 - select REGULATOR_FIXED_VOLTAGE if REGULATOR 98 - 99 92 comment "Renesas ARM SoCs System Configuration" 100 93 endif 101 94 102 95 if ARCH_SHMOBILE_LEGACY 103 96 104 97 comment "Renesas ARM SoCs System Type" 105 - 106 - config ARCH_SH73A0 107 - bool "SH-Mobile AG5 (R8A73A00)" 108 - select ARCH_RMOBILE 109 - select ARCH_WANT_OPTIONAL_GPIOLIB 110 - select ARM_GIC 111 - select I2C 112 - select SH_INTC 113 - select RENESAS_INTC_IRQPIN 114 - 115 - config ARCH_R8A7740 116 - bool "R-Mobile A1 (R8A77400)" 117 - select ARCH_RMOBILE 118 - select ARCH_WANT_OPTIONAL_GPIOLIB 119 - select ARM_GIC 120 - select RENESAS_INTC_IRQPIN 121 98 122 99 config ARCH_R8A7778 123 100 bool "R-Car M1A (R8A77781)" ··· 109 132 select ARM_GIC 110 133 111 134 comment "Renesas ARM SoCs Board Type" 112 - 113 - config MACH_ARMADILLO800EVA 114 - bool "Armadillo-800 EVA board" 115 - depends on ARCH_R8A7740 116 - select ARCH_REQUIRE_GPIOLIB 117 - select REGULATOR_FIXED_VOLTAGE if REGULATOR 118 - select SMSC_PHY if SH_ETH 119 - select SND_SOC_WM8978 if SND_SIMPLE_CARD && I2C 120 - select USE_OF 121 135 122 136 config MACH_BOCKW 123 137 bool "BOCK-W platform" ··· 131 163 of not supporting a number of devices. 132 164 133 165 This is intended to aid developers 134 - 135 - config MACH_MARZEN 136 - bool "MARZEN board" 137 - depends on ARCH_R8A7779 138 - select ARCH_REQUIRE_GPIOLIB 139 - select REGULATOR_FIXED_VOLTAGE if REGULATOR 140 - select USE_OF 141 - 142 - config MACH_KZM9G 143 - bool "KZM-A9-GT board" 144 - depends on ARCH_SH73A0 145 - select ARCH_REQUIRE_GPIOLIB 146 - select REGULATOR_FIXED_VOLTAGE if REGULATOR 147 - select SND_SOC_AK4642 if SND_SIMPLE_CARD 148 - select USE_OF 149 166 150 167 comment "Renesas ARM SoCs System Configuration" 151 168
+3 -11
arch/arm/mach-shmobile/Makefile
··· 6 6 obj-y := timer.o console.o 7 7 8 8 # CPU objects 9 - obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o pm-sh73a0.o 9 + obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o 10 10 obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o 11 - obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o pm-r8a7740.o 11 + obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o 12 12 obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o 13 13 obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o pm-r8a7779.o 14 14 obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o ··· 20 20 # Clock objects 21 21 ifndef CONFIG_COMMON_CLK 22 22 obj-y += clock.o 23 - obj-$(CONFIG_ARCH_SH73A0) += clock-sh73a0.o 24 - obj-$(CONFIG_ARCH_R8A7740) += clock-r8a7740.o 25 23 obj-$(CONFIG_ARCH_R8A7778) += clock-r8a7778.o 26 - obj-$(CONFIG_ARCH_R8A7779) += clock-r8a7779.o 27 24 endif 28 25 29 26 # CPU reset vector handling objects ··· 48 51 obj-$(CONFIG_ARCH_RCAR_GEN2) += pm-rcar-gen2.o 49 52 50 53 # Board objects 51 - ifdef CONFIG_ARCH_SHMOBILE_MULTI 52 - obj-$(CONFIG_MACH_MARZEN) += board-marzen-reference.o 53 - else 54 + ifndef CONFIG_ARCH_SHMOBILE_MULTI 54 55 obj-$(CONFIG_MACH_BOCKW) += board-bockw.o 55 56 obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o 56 - obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 57 - obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o 58 - obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o intc-sh73a0.o 59 57 endif 60 58 61 59 # Framework support
-3
arch/arm/mach-shmobile/Makefile.boot
··· 1 1 # per-board load address for uImage 2 2 loadaddr-y := 3 - loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000 4 3 loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 5 4 loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000 6 - loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000 7 - loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000 8 5 9 6 __ZRELADDR := $(sort $(loadaddr-y)) 10 7 zreladdr-y += $(__ZRELADDR)
-1365
arch/arm/mach-shmobile/board-armadillo800eva.c
··· 1 - /* 2 - * armadillo 800 eva board support 3 - * 4 - * Copyright (C) 2012 Renesas Solutions Corp. 5 - * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.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 as published by 9 - * the Free Software Foundation; version 2 of the License. 10 - * 11 - * This program is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - * GNU General Public License for more details. 15 - */ 16 - 17 - #include <linux/clk.h> 18 - #include <linux/delay.h> 19 - #include <linux/err.h> 20 - #include <linux/gpio.h> 21 - #include <linux/gpio_keys.h> 22 - #include <linux/i2c-gpio.h> 23 - #include <linux/input.h> 24 - #include <linux/irq.h> 25 - #include <linux/kernel.h> 26 - #include <linux/mfd/tmio.h> 27 - #include <linux/mmc/host.h> 28 - #include <linux/mmc/sh_mmcif.h> 29 - #include <linux/mmc/sh_mobile_sdhi.h> 30 - #include <linux/pinctrl/machine.h> 31 - #include <linux/platform_data/st1232_pdata.h> 32 - #include <linux/platform_device.h> 33 - #include <linux/pwm.h> 34 - #include <linux/pwm_backlight.h> 35 - #include <linux/reboot.h> 36 - #include <linux/regulator/driver.h> 37 - #include <linux/regulator/fixed.h> 38 - #include <linux/regulator/gpio-regulator.h> 39 - #include <linux/regulator/machine.h> 40 - #include <linux/sh_eth.h> 41 - #include <linux/usb/renesas_usbhs.h> 42 - #include <linux/videodev2.h> 43 - 44 - #include <asm/hardware/cache-l2x0.h> 45 - #include <asm/mach-types.h> 46 - #include <asm/mach/arch.h> 47 - #include <asm/mach/map.h> 48 - #include <asm/mach/time.h> 49 - #include <asm/page.h> 50 - #include <media/mt9t112.h> 51 - #include <media/sh_mobile_ceu.h> 52 - #include <media/soc_camera.h> 53 - #include <sound/sh_fsi.h> 54 - #include <sound/simple_card.h> 55 - #include <video/sh_mobile_hdmi.h> 56 - #include <video/sh_mobile_lcdc.h> 57 - 58 - #include "common.h" 59 - #include "irqs.h" 60 - #include "pm-rmobile.h" 61 - #include "r8a7740.h" 62 - #include "sh-gpio.h" 63 - 64 - /* 65 - * CON1 Camera Module 66 - * CON2 Extension Bus 67 - * CON3 HDMI Output 68 - * CON4 Composite Video Output 69 - * CON5 H-UDI JTAG 70 - * CON6 ARM JTAG 71 - * CON7 SD1 72 - * CON8 SD2 73 - * CON9 RTC BackUp 74 - * CON10 Monaural Mic Input 75 - * CON11 Stereo Headphone Output 76 - * CON12 Audio Line Output(L) 77 - * CON13 Audio Line Output(R) 78 - * CON14 AWL13 Module 79 - * CON15 Extension 80 - * CON16 LCD1 81 - * CON17 LCD2 82 - * CON19 Power Input 83 - * CON20 USB1 84 - * CON21 USB2 85 - * CON22 Serial 86 - * CON23 LAN 87 - * CON24 USB3 88 - * LED1 Camera LED(Yellow) 89 - * LED2 Power LED (Green) 90 - * ED3-LED6 User LED(Yellow) 91 - * LED7 LAN link LED(Green) 92 - * LED8 LAN activity LED(Yellow) 93 - */ 94 - 95 - /* 96 - * DipSwitch 97 - * 98 - * SW1 99 - * 100 - * -12345678-+---------------+---------------------------- 101 - * 1 | boot | hermit 102 - * 0 | boot | OS auto boot 103 - * -12345678-+---------------+---------------------------- 104 - * 00 | boot device | eMMC 105 - * 10 | boot device | SDHI0 (CON7) 106 - * 01 | boot device | - 107 - * 11 | boot device | Extension Buss (CS0) 108 - * -12345678-+---------------+---------------------------- 109 - * 0 | Extension Bus | D8-D15 disable, eMMC enable 110 - * 1 | Extension Bus | D8-D15 enable, eMMC disable 111 - * -12345678-+---------------+---------------------------- 112 - * 0 | SDHI1 | COM8 disable, COM14 enable 113 - * 1 | SDHI1 | COM8 enable, COM14 disable 114 - * -12345678-+---------------+---------------------------- 115 - * 0 | USB0 | COM20 enable, COM24 disable 116 - * 1 | USB0 | COM20 disable, COM24 enable 117 - * -12345678-+---------------+---------------------------- 118 - * 00 | JTAG | SH-X2 119 - * 10 | JTAG | ARM 120 - * 01 | JTAG | - 121 - * 11 | JTAG | Boundary Scan 122 - *-----------+---------------+---------------------------- 123 - */ 124 - 125 - /* 126 - * FSI-WM8978 127 - * 128 - * this command is required when playback. 129 - * 130 - * # amixer set "Headphone" 50 131 - * 132 - * this command is required when capture. 133 - * 134 - * # amixer set "Input PGA" 15 135 - * # amixer set "Left Input Mixer MicP" on 136 - * # amixer set "Left Input Mixer MicN" on 137 - * # amixer set "Right Input Mixer MicN" on 138 - * # amixer set "Right Input Mixer MicP" on 139 - */ 140 - 141 - /* 142 - * USB function 143 - * 144 - * When you use USB Function, 145 - * set SW1.6 ON, and connect cable to CN24. 146 - * 147 - * USBF needs workaround on R8A7740 chip. 148 - * These are a little bit complex. 149 - * see 150 - * usbhsf_power_ctrl() 151 - */ 152 - #define IRQ7 irq_pin(7) 153 - #define USBCR1 IOMEM(0xe605810a) 154 - #define USBH 0xC6700000 155 - #define USBH_USBCTR 0x10834 156 - 157 - struct usbhsf_private { 158 - struct clk *phy; 159 - struct clk *usb24; 160 - struct clk *pci; 161 - struct clk *func; 162 - struct clk *host; 163 - void __iomem *usbh_base; 164 - struct renesas_usbhs_platform_info info; 165 - }; 166 - 167 - #define usbhsf_get_priv(pdev) \ 168 - container_of(renesas_usbhs_get_info(pdev), \ 169 - struct usbhsf_private, info) 170 - 171 - static int usbhsf_get_id(struct platform_device *pdev) 172 - { 173 - return USBHS_GADGET; 174 - } 175 - 176 - static int usbhsf_power_ctrl(struct platform_device *pdev, 177 - void __iomem *base, int enable) 178 - { 179 - struct usbhsf_private *priv = usbhsf_get_priv(pdev); 180 - 181 - /* 182 - * Work around for USB Function. 183 - * It needs USB host clock, and settings 184 - */ 185 - if (enable) { 186 - /* 187 - * enable all the related usb clocks 188 - * for usb workaround 189 - */ 190 - clk_enable(priv->usb24); 191 - clk_enable(priv->pci); 192 - clk_enable(priv->host); 193 - clk_enable(priv->func); 194 - clk_enable(priv->phy); 195 - 196 - /* 197 - * set USBCR1 198 - * 199 - * Port1 is driven by USB function, 200 - * Port2 is driven by USB HOST 201 - * One HOST (Port1 or Port2 is HOST) 202 - * USB PLL input clock = 24MHz 203 - */ 204 - __raw_writew(0xd750, USBCR1); 205 - mdelay(1); 206 - 207 - /* 208 - * start USB Host 209 - */ 210 - __raw_writel(0x0000000c, priv->usbh_base + USBH_USBCTR); 211 - __raw_writel(0x00000008, priv->usbh_base + USBH_USBCTR); 212 - mdelay(10); 213 - 214 - /* 215 - * USB PHY Power ON 216 - */ 217 - __raw_writew(0xd770, USBCR1); 218 - __raw_writew(0x4000, base + 0x102); /* USBF :: SUSPMODE */ 219 - 220 - } else { 221 - __raw_writel(0x0000010f, priv->usbh_base + USBH_USBCTR); 222 - __raw_writew(0xd7c0, USBCR1); /* GPIO */ 223 - 224 - clk_disable(priv->phy); 225 - clk_disable(priv->func); /* usb work around */ 226 - clk_disable(priv->host); /* usb work around */ 227 - clk_disable(priv->pci); /* usb work around */ 228 - clk_disable(priv->usb24); /* usb work around */ 229 - } 230 - 231 - return 0; 232 - } 233 - 234 - static int usbhsf_get_vbus(struct platform_device *pdev) 235 - { 236 - return gpio_get_value(209); 237 - } 238 - 239 - static irqreturn_t usbhsf_interrupt(int irq, void *data) 240 - { 241 - struct platform_device *pdev = data; 242 - 243 - renesas_usbhs_call_notify_hotplug(pdev); 244 - 245 - return IRQ_HANDLED; 246 - } 247 - 248 - static int usbhsf_hardware_exit(struct platform_device *pdev) 249 - { 250 - struct usbhsf_private *priv = usbhsf_get_priv(pdev); 251 - 252 - if (!IS_ERR(priv->phy)) 253 - clk_put(priv->phy); 254 - if (!IS_ERR(priv->usb24)) 255 - clk_put(priv->usb24); 256 - if (!IS_ERR(priv->pci)) 257 - clk_put(priv->pci); 258 - if (!IS_ERR(priv->host)) 259 - clk_put(priv->host); 260 - if (!IS_ERR(priv->func)) 261 - clk_put(priv->func); 262 - if (priv->usbh_base) 263 - iounmap(priv->usbh_base); 264 - 265 - priv->phy = NULL; 266 - priv->usb24 = NULL; 267 - priv->pci = NULL; 268 - priv->host = NULL; 269 - priv->func = NULL; 270 - priv->usbh_base = NULL; 271 - 272 - free_irq(IRQ7, pdev); 273 - 274 - return 0; 275 - } 276 - 277 - static int usbhsf_hardware_init(struct platform_device *pdev) 278 - { 279 - struct usbhsf_private *priv = usbhsf_get_priv(pdev); 280 - int ret; 281 - 282 - priv->phy = clk_get(&pdev->dev, "phy"); 283 - priv->usb24 = clk_get(&pdev->dev, "usb24"); 284 - priv->pci = clk_get(&pdev->dev, "pci"); 285 - priv->func = clk_get(&pdev->dev, "func"); 286 - priv->host = clk_get(&pdev->dev, "host"); 287 - priv->usbh_base = ioremap_nocache(USBH, 0x20000); 288 - 289 - if (IS_ERR(priv->phy) || 290 - IS_ERR(priv->usb24) || 291 - IS_ERR(priv->pci) || 292 - IS_ERR(priv->host) || 293 - IS_ERR(priv->func) || 294 - !priv->usbh_base) { 295 - dev_err(&pdev->dev, "USB clock setting failed\n"); 296 - usbhsf_hardware_exit(pdev); 297 - return -EIO; 298 - } 299 - 300 - ret = request_irq(IRQ7, usbhsf_interrupt, IRQF_TRIGGER_NONE, 301 - dev_name(&pdev->dev), pdev); 302 - if (ret) { 303 - dev_err(&pdev->dev, "request_irq err\n"); 304 - return ret; 305 - } 306 - irq_set_irq_type(IRQ7, IRQ_TYPE_EDGE_BOTH); 307 - 308 - /* usb24 use 1/1 of parent clock (= usb24s = 24MHz) */ 309 - clk_set_rate(priv->usb24, 310 - clk_get_rate(clk_get_parent(priv->usb24))); 311 - 312 - return 0; 313 - } 314 - 315 - static struct usbhsf_private usbhsf_private = { 316 - .info = { 317 - .platform_callback = { 318 - .get_id = usbhsf_get_id, 319 - .get_vbus = usbhsf_get_vbus, 320 - .hardware_init = usbhsf_hardware_init, 321 - .hardware_exit = usbhsf_hardware_exit, 322 - .power_ctrl = usbhsf_power_ctrl, 323 - }, 324 - .driver_param = { 325 - .buswait_bwait = 5, 326 - .detection_delay = 5, 327 - .d0_rx_id = SHDMA_SLAVE_USBHS_RX, 328 - .d1_tx_id = SHDMA_SLAVE_USBHS_TX, 329 - }, 330 - } 331 - }; 332 - 333 - static struct resource usbhsf_resources[] = { 334 - { 335 - .name = "USBHS", 336 - .start = 0xe6890000, 337 - .end = 0xe6890104 - 1, 338 - .flags = IORESOURCE_MEM, 339 - }, 340 - { 341 - .start = gic_spi(51), 342 - .flags = IORESOURCE_IRQ, 343 - }, 344 - }; 345 - 346 - static struct platform_device usbhsf_device = { 347 - .name = "renesas_usbhs", 348 - .dev = { 349 - .platform_data = &usbhsf_private.info, 350 - }, 351 - .id = -1, 352 - .num_resources = ARRAY_SIZE(usbhsf_resources), 353 - .resource = usbhsf_resources, 354 - }; 355 - 356 - /* Ether */ 357 - static struct sh_eth_plat_data sh_eth_platdata = { 358 - .phy = 0x00, /* LAN8710A */ 359 - .edmac_endian = EDMAC_LITTLE_ENDIAN, 360 - .phy_interface = PHY_INTERFACE_MODE_MII, 361 - }; 362 - 363 - static struct resource sh_eth_resources[] = { 364 - { 365 - .start = 0xe9a00000, 366 - .end = 0xe9a00800 - 1, 367 - .flags = IORESOURCE_MEM, 368 - }, { 369 - .start = 0xe9a01800, 370 - .end = 0xe9a02000 - 1, 371 - .flags = IORESOURCE_MEM, 372 - }, { 373 - .start = gic_spi(110), 374 - .flags = IORESOURCE_IRQ, 375 - }, 376 - }; 377 - 378 - static struct platform_device sh_eth_device = { 379 - .name = "r8a7740-gether", 380 - .id = -1, 381 - .dev = { 382 - .platform_data = &sh_eth_platdata, 383 - .dma_mask = &sh_eth_device.dev.coherent_dma_mask, 384 - .coherent_dma_mask = DMA_BIT_MASK(32), 385 - }, 386 - .resource = sh_eth_resources, 387 - .num_resources = ARRAY_SIZE(sh_eth_resources), 388 - }; 389 - 390 - /* PWM */ 391 - static struct resource pwm_resources[] = { 392 - [0] = { 393 - .start = 0xe6600000, 394 - .end = 0xe66000ff, 395 - .flags = IORESOURCE_MEM, 396 - }, 397 - }; 398 - 399 - static struct platform_device pwm_device = { 400 - .name = "renesas-tpu-pwm", 401 - .id = -1, 402 - .num_resources = ARRAY_SIZE(pwm_resources), 403 - .resource = pwm_resources, 404 - }; 405 - 406 - static struct pwm_lookup pwm_lookup[] = { 407 - PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL, 408 - 33333, PWM_POLARITY_INVERSED), 409 - }; 410 - 411 - /* LCDC and backlight */ 412 - static struct platform_pwm_backlight_data pwm_backlight_data = { 413 - .lth_brightness = 50, 414 - .max_brightness = 255, 415 - .dft_brightness = 255, 416 - .pwm_period_ns = 33333, /* 30kHz */ 417 - .enable_gpio = 61, 418 - }; 419 - 420 - static struct platform_device pwm_backlight_device = { 421 - .name = "pwm-backlight", 422 - .dev = { 423 - .platform_data = &pwm_backlight_data, 424 - }, 425 - }; 426 - 427 - static struct fb_videomode lcdc0_mode = { 428 - .name = "AMPIER/AM-800480", 429 - .xres = 800, 430 - .yres = 480, 431 - .left_margin = 88, 432 - .right_margin = 40, 433 - .hsync_len = 128, 434 - .upper_margin = 20, 435 - .lower_margin = 5, 436 - .vsync_len = 5, 437 - .sync = 0, 438 - }; 439 - 440 - static struct sh_mobile_lcdc_info lcdc0_info = { 441 - .clock_source = LCDC_CLK_BUS, 442 - .ch[0] = { 443 - .chan = LCDC_CHAN_MAINLCD, 444 - .fourcc = V4L2_PIX_FMT_RGB565, 445 - .interface_type = RGB24, 446 - .clock_divider = 5, 447 - .flags = 0, 448 - .lcd_modes = &lcdc0_mode, 449 - .num_modes = 1, 450 - .panel_cfg = { 451 - .width = 111, 452 - .height = 68, 453 - }, 454 - }, 455 - }; 456 - 457 - static struct resource lcdc0_resources[] = { 458 - [0] = { 459 - .name = "LCD0", 460 - .start = 0xfe940000, 461 - .end = 0xfe943fff, 462 - .flags = IORESOURCE_MEM, 463 - }, 464 - [1] = { 465 - .start = gic_spi(177), 466 - .flags = IORESOURCE_IRQ, 467 - }, 468 - }; 469 - 470 - static struct platform_device lcdc0_device = { 471 - .name = "sh_mobile_lcdc_fb", 472 - .num_resources = ARRAY_SIZE(lcdc0_resources), 473 - .resource = lcdc0_resources, 474 - .id = 0, 475 - .dev = { 476 - .platform_data = &lcdc0_info, 477 - .coherent_dma_mask = DMA_BIT_MASK(32), 478 - }, 479 - }; 480 - 481 - /* 482 - * LCDC1/HDMI 483 - */ 484 - static struct sh_mobile_hdmi_info hdmi_info = { 485 - .flags = HDMI_OUTPUT_PUSH_PULL | 486 - HDMI_OUTPUT_POLARITY_HI | 487 - HDMI_32BIT_REG | 488 - HDMI_HAS_HTOP1 | 489 - HDMI_SND_SRC_SPDIF, 490 - }; 491 - 492 - static struct resource hdmi_resources[] = { 493 - [0] = { 494 - .name = "HDMI", 495 - .start = 0xe6be0000, 496 - .end = 0xe6be03ff, 497 - .flags = IORESOURCE_MEM, 498 - }, 499 - [1] = { 500 - .start = gic_spi(131), 501 - .flags = IORESOURCE_IRQ, 502 - }, 503 - [2] = { 504 - .name = "HDMI emma3pf", 505 - .start = 0xe6be4000, 506 - .end = 0xe6be43ff, 507 - .flags = IORESOURCE_MEM, 508 - }, 509 - }; 510 - 511 - static struct platform_device hdmi_device = { 512 - .name = "sh-mobile-hdmi", 513 - .num_resources = ARRAY_SIZE(hdmi_resources), 514 - .resource = hdmi_resources, 515 - .id = -1, 516 - .dev = { 517 - .platform_data = &hdmi_info, 518 - }, 519 - }; 520 - 521 - static const struct fb_videomode lcdc1_mode = { 522 - .name = "HDMI 720p", 523 - .xres = 1280, 524 - .yres = 720, 525 - .pixclock = 13468, 526 - .left_margin = 220, 527 - .right_margin = 110, 528 - .hsync_len = 40, 529 - .upper_margin = 20, 530 - .lower_margin = 5, 531 - .vsync_len = 5, 532 - .refresh = 60, 533 - .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, 534 - }; 535 - 536 - static struct sh_mobile_lcdc_info hdmi_lcdc_info = { 537 - .clock_source = LCDC_CLK_PERIPHERAL, /* HDMI clock */ 538 - .ch[0] = { 539 - .chan = LCDC_CHAN_MAINLCD, 540 - .fourcc = V4L2_PIX_FMT_RGB565, 541 - .interface_type = RGB24, 542 - .clock_divider = 1, 543 - .flags = LCDC_FLAGS_DWPOL, 544 - .lcd_modes = &lcdc1_mode, 545 - .num_modes = 1, 546 - .tx_dev = &hdmi_device, 547 - .panel_cfg = { 548 - .width = 1280, 549 - .height = 720, 550 - }, 551 - }, 552 - }; 553 - 554 - static struct resource hdmi_lcdc_resources[] = { 555 - [0] = { 556 - .name = "LCDC1", 557 - .start = 0xfe944000, 558 - .end = 0xfe948000 - 1, 559 - .flags = IORESOURCE_MEM, 560 - }, 561 - [1] = { 562 - .start = gic_spi(178), 563 - .flags = IORESOURCE_IRQ, 564 - }, 565 - }; 566 - 567 - static struct platform_device hdmi_lcdc_device = { 568 - .name = "sh_mobile_lcdc_fb", 569 - .num_resources = ARRAY_SIZE(hdmi_lcdc_resources), 570 - .resource = hdmi_lcdc_resources, 571 - .id = 1, 572 - .dev = { 573 - .platform_data = &hdmi_lcdc_info, 574 - .coherent_dma_mask = DMA_BIT_MASK(32), 575 - }, 576 - }; 577 - 578 - /* LEDS */ 579 - static struct gpio_led gpio_leds[] = { 580 - { 581 - .name = "LED3", 582 - .gpio = 102, 583 - .default_state = LEDS_GPIO_DEFSTATE_ON, 584 - }, { 585 - .name = "LED4", 586 - .gpio = 111, 587 - .default_state = LEDS_GPIO_DEFSTATE_ON, 588 - }, { 589 - .name = "LED5", 590 - .gpio = 110, 591 - .default_state = LEDS_GPIO_DEFSTATE_ON, 592 - }, { 593 - .name = "LED6", 594 - .gpio = 177, 595 - .default_state = LEDS_GPIO_DEFSTATE_ON, 596 - }, 597 - }; 598 - 599 - static struct gpio_led_platform_data leds_gpio_info = { 600 - .leds = gpio_leds, 601 - .num_leds = ARRAY_SIZE(gpio_leds), 602 - }; 603 - 604 - static struct platform_device leds_gpio_device = { 605 - .name = "leds-gpio", 606 - .id = -1, 607 - .dev = { 608 - .platform_data = &leds_gpio_info, 609 - }, 610 - }; 611 - 612 - /* GPIO KEY */ 613 - #define GPIO_KEY(c, g, d, ...) \ 614 - { .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ } 615 - 616 - static struct gpio_keys_button gpio_buttons[] = { 617 - GPIO_KEY(KEY_POWER, 99, "SW3", .wakeup = 1), 618 - GPIO_KEY(KEY_BACK, 100, "SW4"), 619 - GPIO_KEY(KEY_MENU, 97, "SW5"), 620 - GPIO_KEY(KEY_HOME, 98, "SW6"), 621 - }; 622 - 623 - static struct gpio_keys_platform_data gpio_key_info = { 624 - .buttons = gpio_buttons, 625 - .nbuttons = ARRAY_SIZE(gpio_buttons), 626 - }; 627 - 628 - static struct platform_device gpio_keys_device = { 629 - .name = "gpio-keys", 630 - .id = -1, 631 - .dev = { 632 - .platform_data = &gpio_key_info, 633 - }, 634 - }; 635 - 636 - /* Fixed 3.3V regulator to be used by SDHI1, MMCIF */ 637 - static struct regulator_consumer_supply fixed3v3_power_consumers[] = { 638 - REGULATOR_SUPPLY("vmmc", "sh_mmcif"), 639 - REGULATOR_SUPPLY("vqmmc", "sh_mmcif"), 640 - }; 641 - 642 - /* Fixed 3.3V regulator used by LCD backlight */ 643 - static struct regulator_consumer_supply fixed5v0_power_consumers[] = { 644 - REGULATOR_SUPPLY("power", "pwm-backlight.0"), 645 - }; 646 - 647 - /* Fixed 3.3V regulator to be used by SDHI0 */ 648 - static struct regulator_consumer_supply vcc_sdhi0_consumers[] = { 649 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 650 - }; 651 - 652 - static struct regulator_init_data vcc_sdhi0_init_data = { 653 - .constraints = { 654 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 655 - }, 656 - .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi0_consumers), 657 - .consumer_supplies = vcc_sdhi0_consumers, 658 - }; 659 - 660 - static struct fixed_voltage_config vcc_sdhi0_info = { 661 - .supply_name = "SDHI0 Vcc", 662 - .microvolts = 3300000, 663 - .gpio = 75, 664 - .enable_high = 1, 665 - .init_data = &vcc_sdhi0_init_data, 666 - }; 667 - 668 - static struct platform_device vcc_sdhi0 = { 669 - .name = "reg-fixed-voltage", 670 - .id = 1, 671 - .dev = { 672 - .platform_data = &vcc_sdhi0_info, 673 - }, 674 - }; 675 - 676 - /* 1.8 / 3.3V SDHI0 VccQ regulator */ 677 - static struct regulator_consumer_supply vccq_sdhi0_consumers[] = { 678 - REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 679 - }; 680 - 681 - static struct regulator_init_data vccq_sdhi0_init_data = { 682 - .constraints = { 683 - .input_uV = 3300000, 684 - .min_uV = 1800000, 685 - .max_uV = 3300000, 686 - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 687 - REGULATOR_CHANGE_STATUS, 688 - }, 689 - .num_consumer_supplies = ARRAY_SIZE(vccq_sdhi0_consumers), 690 - .consumer_supplies = vccq_sdhi0_consumers, 691 - }; 692 - 693 - static struct gpio vccq_sdhi0_gpios[] = { 694 - {17, GPIOF_OUT_INIT_LOW, "vccq-sdhi0" }, 695 - }; 696 - 697 - static struct gpio_regulator_state vccq_sdhi0_states[] = { 698 - { .value = 3300000, .gpios = (0 << 0) }, 699 - { .value = 1800000, .gpios = (1 << 0) }, 700 - }; 701 - 702 - static struct gpio_regulator_config vccq_sdhi0_info = { 703 - .supply_name = "vqmmc", 704 - 705 - .enable_gpio = 74, 706 - .enable_high = 1, 707 - .enabled_at_boot = 0, 708 - 709 - .gpios = vccq_sdhi0_gpios, 710 - .nr_gpios = ARRAY_SIZE(vccq_sdhi0_gpios), 711 - 712 - .states = vccq_sdhi0_states, 713 - .nr_states = ARRAY_SIZE(vccq_sdhi0_states), 714 - 715 - .type = REGULATOR_VOLTAGE, 716 - .init_data = &vccq_sdhi0_init_data, 717 - }; 718 - 719 - static struct platform_device vccq_sdhi0 = { 720 - .name = "gpio-regulator", 721 - .id = -1, 722 - .dev = { 723 - .platform_data = &vccq_sdhi0_info, 724 - }, 725 - }; 726 - 727 - /* Fixed 3.3V regulator to be used by SDHI1 */ 728 - static struct regulator_consumer_supply vcc_sdhi1_consumers[] = { 729 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), 730 - }; 731 - 732 - static struct regulator_init_data vcc_sdhi1_init_data = { 733 - .constraints = { 734 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 735 - }, 736 - .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi1_consumers), 737 - .consumer_supplies = vcc_sdhi1_consumers, 738 - }; 739 - 740 - static struct fixed_voltage_config vcc_sdhi1_info = { 741 - .supply_name = "SDHI1 Vcc", 742 - .microvolts = 3300000, 743 - .gpio = 16, 744 - .enable_high = 1, 745 - .init_data = &vcc_sdhi1_init_data, 746 - }; 747 - 748 - static struct platform_device vcc_sdhi1 = { 749 - .name = "reg-fixed-voltage", 750 - .id = 2, 751 - .dev = { 752 - .platform_data = &vcc_sdhi1_info, 753 - }, 754 - }; 755 - 756 - /* SDHI0 */ 757 - static struct tmio_mmc_data sdhi0_info = { 758 - .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI0_TX, 759 - .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI0_RX, 760 - .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | 761 - MMC_CAP_POWER_OFF_CARD, 762 - .flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD, 763 - .cd_gpio = 167, 764 - }; 765 - 766 - static struct resource sdhi0_resources[] = { 767 - { 768 - .name = "SDHI0", 769 - .start = 0xe6850000, 770 - .end = 0xe6850100 - 1, 771 - .flags = IORESOURCE_MEM, 772 - }, 773 - /* 774 - * no SH_MOBILE_SDHI_IRQ_CARD_DETECT here 775 - */ 776 - { 777 - .name = SH_MOBILE_SDHI_IRQ_SDCARD, 778 - .start = gic_spi(118), 779 - .flags = IORESOURCE_IRQ, 780 - }, 781 - { 782 - .name = SH_MOBILE_SDHI_IRQ_SDIO, 783 - .start = gic_spi(119), 784 - .flags = IORESOURCE_IRQ, 785 - }, 786 - }; 787 - 788 - static struct platform_device sdhi0_device = { 789 - .name = "sh_mobile_sdhi", 790 - .id = 0, 791 - .dev = { 792 - .platform_data = &sdhi0_info, 793 - }, 794 - .num_resources = ARRAY_SIZE(sdhi0_resources), 795 - .resource = sdhi0_resources, 796 - }; 797 - 798 - /* SDHI1 */ 799 - static struct tmio_mmc_data sdhi1_info = { 800 - .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI1_TX, 801 - .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI1_RX, 802 - .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | 803 - MMC_CAP_POWER_OFF_CARD, 804 - .flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD, 805 - /* Port72 cannot generate IRQs, will be used in polling mode. */ 806 - .cd_gpio = 72, 807 - }; 808 - 809 - static struct resource sdhi1_resources[] = { 810 - [0] = { 811 - .name = "SDHI1", 812 - .start = 0xe6860000, 813 - .end = 0xe6860100 - 1, 814 - .flags = IORESOURCE_MEM, 815 - }, 816 - [1] = { 817 - .start = gic_spi(121), 818 - .flags = IORESOURCE_IRQ, 819 - }, 820 - [2] = { 821 - .start = gic_spi(122), 822 - .flags = IORESOURCE_IRQ, 823 - }, 824 - [3] = { 825 - .start = gic_spi(123), 826 - .flags = IORESOURCE_IRQ, 827 - }, 828 - }; 829 - 830 - static struct platform_device sdhi1_device = { 831 - .name = "sh_mobile_sdhi", 832 - .id = 1, 833 - .dev = { 834 - .platform_data = &sdhi1_info, 835 - }, 836 - .num_resources = ARRAY_SIZE(sdhi1_resources), 837 - .resource = sdhi1_resources, 838 - }; 839 - 840 - static const struct pinctrl_map eva_sdhi1_pinctrl_map[] = { 841 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7740", 842 - "sdhi1_data4", "sdhi1"), 843 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7740", 844 - "sdhi1_ctrl", "sdhi1"), 845 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7740", 846 - "sdhi1_cd", "sdhi1"), 847 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7740", 848 - "sdhi1_wp", "sdhi1"), 849 - }; 850 - 851 - /* MMCIF */ 852 - static struct sh_mmcif_plat_data sh_mmcif_plat = { 853 - .sup_pclk = 0, 854 - .caps = MMC_CAP_4_BIT_DATA | 855 - MMC_CAP_8_BIT_DATA | 856 - MMC_CAP_NONREMOVABLE, 857 - .ccs_unsupported = true, 858 - .slave_id_tx = SHDMA_SLAVE_MMCIF_TX, 859 - .slave_id_rx = SHDMA_SLAVE_MMCIF_RX, 860 - }; 861 - 862 - static struct resource sh_mmcif_resources[] = { 863 - [0] = { 864 - .name = "MMCIF", 865 - .start = 0xe6bd0000, 866 - .end = 0xe6bd0100 - 1, 867 - .flags = IORESOURCE_MEM, 868 - }, 869 - [1] = { 870 - /* MMC ERR */ 871 - .start = gic_spi(56), 872 - .flags = IORESOURCE_IRQ, 873 - }, 874 - [2] = { 875 - /* MMC NOR */ 876 - .start = gic_spi(57), 877 - .flags = IORESOURCE_IRQ, 878 - }, 879 - }; 880 - 881 - static struct platform_device sh_mmcif_device = { 882 - .name = "sh_mmcif", 883 - .id = -1, 884 - .dev = { 885 - .platform_data = &sh_mmcif_plat, 886 - }, 887 - .num_resources = ARRAY_SIZE(sh_mmcif_resources), 888 - .resource = sh_mmcif_resources, 889 - }; 890 - 891 - /* Camera */ 892 - static int mt9t111_power(struct device *dev, int mode) 893 - { 894 - struct clk *mclk = clk_get(NULL, "video1"); 895 - 896 - if (IS_ERR(mclk)) { 897 - dev_err(dev, "can't get video1 clock\n"); 898 - return -EINVAL; 899 - } 900 - 901 - if (mode) { 902 - /* video1 (= CON1 camera) expect 24MHz */ 903 - clk_set_rate(mclk, clk_round_rate(mclk, 24000000)); 904 - clk_enable(mclk); 905 - gpio_set_value(158, 1); 906 - } else { 907 - gpio_set_value(158, 0); 908 - clk_disable(mclk); 909 - } 910 - 911 - clk_put(mclk); 912 - 913 - return 0; 914 - } 915 - 916 - static struct i2c_board_info i2c_camera_mt9t111 = { 917 - I2C_BOARD_INFO("mt9t112", 0x3d), 918 - }; 919 - 920 - static struct mt9t112_camera_info mt9t111_info = { 921 - .divider = { 16, 0, 0, 7, 0, 10, 14, 7, 7 }, 922 - }; 923 - 924 - static struct soc_camera_link mt9t111_link = { 925 - .i2c_adapter_id = 0, 926 - .bus_id = 0, 927 - .board_info = &i2c_camera_mt9t111, 928 - .power = mt9t111_power, 929 - .priv = &mt9t111_info, 930 - }; 931 - 932 - static struct platform_device camera_device = { 933 - .name = "soc-camera-pdrv", 934 - .id = 0, 935 - .dev = { 936 - .platform_data = &mt9t111_link, 937 - }, 938 - }; 939 - 940 - /* CEU0 */ 941 - static struct sh_mobile_ceu_info sh_mobile_ceu0_info = { 942 - .flags = SH_CEU_FLAG_LOWER_8BIT, 943 - }; 944 - 945 - static struct resource ceu0_resources[] = { 946 - [0] = { 947 - .name = "CEU", 948 - .start = 0xfe910000, 949 - .end = 0xfe91009f, 950 - .flags = IORESOURCE_MEM, 951 - }, 952 - [1] = { 953 - .start = gic_spi(160), 954 - .flags = IORESOURCE_IRQ, 955 - }, 956 - [2] = { 957 - /* place holder for contiguous memory */ 958 - }, 959 - }; 960 - 961 - static struct platform_device ceu0_device = { 962 - .name = "sh_mobile_ceu", 963 - .id = 0, 964 - .num_resources = ARRAY_SIZE(ceu0_resources), 965 - .resource = ceu0_resources, 966 - .dev = { 967 - .platform_data = &sh_mobile_ceu0_info, 968 - .coherent_dma_mask = 0xffffffff, 969 - }, 970 - }; 971 - 972 - /* FSI */ 973 - static struct sh_fsi_platform_info fsi_info = { 974 - /* FSI-WM8978 */ 975 - .port_a = { 976 - .tx_id = SHDMA_SLAVE_FSIA_TX, 977 - }, 978 - /* FSI-HDMI */ 979 - .port_b = { 980 - .flags = SH_FSI_FMT_SPDIF | 981 - SH_FSI_ENABLE_STREAM_MODE | 982 - SH_FSI_CLK_CPG, 983 - .tx_id = SHDMA_SLAVE_FSIB_TX, 984 - } 985 - }; 986 - 987 - static struct resource fsi_resources[] = { 988 - [0] = { 989 - .name = "FSI", 990 - .start = 0xfe1f0000, 991 - .end = 0xfe1f0400 - 1, 992 - .flags = IORESOURCE_MEM, 993 - }, 994 - [1] = { 995 - .start = gic_spi(9), 996 - .flags = IORESOURCE_IRQ, 997 - }, 998 - }; 999 - 1000 - static struct platform_device fsi_device = { 1001 - .name = "sh_fsi2", 1002 - .id = -1, 1003 - .num_resources = ARRAY_SIZE(fsi_resources), 1004 - .resource = fsi_resources, 1005 - .dev = { 1006 - .platform_data = &fsi_info, 1007 - }, 1008 - }; 1009 - 1010 - /* FSI-WM8978 */ 1011 - static struct asoc_simple_card_info fsi_wm8978_info = { 1012 - .name = "wm8978", 1013 - .card = "FSI2A-WM8978", 1014 - .codec = "wm8978.0-001a", 1015 - .platform = "sh_fsi2", 1016 - .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM, 1017 - .cpu_dai = { 1018 - .name = "fsia-dai", 1019 - }, 1020 - .codec_dai = { 1021 - .name = "wm8978-hifi", 1022 - .sysclk = 12288000, 1023 - }, 1024 - }; 1025 - 1026 - static struct platform_device fsi_wm8978_device = { 1027 - .name = "asoc-simple-card", 1028 - .id = 0, 1029 - .dev = { 1030 - .platform_data = &fsi_wm8978_info, 1031 - .coherent_dma_mask = DMA_BIT_MASK(32), 1032 - .dma_mask = &fsi_wm8978_device.dev.coherent_dma_mask, 1033 - }, 1034 - }; 1035 - 1036 - /* FSI-HDMI */ 1037 - static struct asoc_simple_card_info fsi2_hdmi_info = { 1038 - .name = "HDMI", 1039 - .card = "FSI2B-HDMI", 1040 - .codec = "sh-mobile-hdmi", 1041 - .platform = "sh_fsi2", 1042 - .daifmt = SND_SOC_DAIFMT_CBS_CFS, 1043 - .cpu_dai = { 1044 - .name = "fsib-dai", 1045 - }, 1046 - .codec_dai = { 1047 - .name = "sh_mobile_hdmi-hifi", 1048 - }, 1049 - }; 1050 - 1051 - static struct platform_device fsi_hdmi_device = { 1052 - .name = "asoc-simple-card", 1053 - .id = 1, 1054 - .dev = { 1055 - .platform_data = &fsi2_hdmi_info, 1056 - .coherent_dma_mask = DMA_BIT_MASK(32), 1057 - .dma_mask = &fsi_hdmi_device.dev.coherent_dma_mask, 1058 - }, 1059 - }; 1060 - 1061 - /* RTC: RTC connects i2c-gpio. */ 1062 - static struct i2c_gpio_platform_data i2c_gpio_data = { 1063 - .sda_pin = 208, 1064 - .scl_pin = 91, 1065 - .udelay = 5, /* 100 kHz */ 1066 - }; 1067 - 1068 - static struct platform_device i2c_gpio_device = { 1069 - .name = "i2c-gpio", 1070 - .id = 2, 1071 - .dev = { 1072 - .platform_data = &i2c_gpio_data, 1073 - }, 1074 - }; 1075 - 1076 - /* I2C */ 1077 - static struct st1232_pdata st1232_i2c0_pdata = { 1078 - .reset_gpio = 166, 1079 - }; 1080 - 1081 - static struct i2c_board_info i2c0_devices[] = { 1082 - { 1083 - I2C_BOARD_INFO("st1232-ts", 0x55), 1084 - .irq = irq_pin(10), 1085 - .platform_data = &st1232_i2c0_pdata, 1086 - }, 1087 - { 1088 - I2C_BOARD_INFO("wm8978", 0x1a), 1089 - }, 1090 - }; 1091 - 1092 - static struct i2c_board_info i2c2_devices[] = { 1093 - { 1094 - I2C_BOARD_INFO("s35390a", 0x30), 1095 - .type = "s35390a", 1096 - }, 1097 - }; 1098 - 1099 - /* 1100 - * board devices 1101 - */ 1102 - static struct platform_device *eva_devices[] __initdata = { 1103 - &lcdc0_device, 1104 - &pwm_device, 1105 - &pwm_backlight_device, 1106 - &leds_gpio_device, 1107 - &gpio_keys_device, 1108 - &sh_eth_device, 1109 - &vcc_sdhi0, 1110 - &vccq_sdhi0, 1111 - &sdhi0_device, 1112 - &sh_mmcif_device, 1113 - &hdmi_device, 1114 - &hdmi_lcdc_device, 1115 - &camera_device, 1116 - &ceu0_device, 1117 - &fsi_device, 1118 - &fsi_wm8978_device, 1119 - &fsi_hdmi_device, 1120 - &i2c_gpio_device, 1121 - }; 1122 - 1123 - static const struct pinctrl_map eva_pinctrl_map[] = { 1124 - /* CEU0 */ 1125 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_ceu.0", "pfc-r8a7740", 1126 - "ceu0_data_0_7", "ceu0"), 1127 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_ceu.0", "pfc-r8a7740", 1128 - "ceu0_clk_0", "ceu0"), 1129 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_ceu.0", "pfc-r8a7740", 1130 - "ceu0_sync", "ceu0"), 1131 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_ceu.0", "pfc-r8a7740", 1132 - "ceu0_field", "ceu0"), 1133 - /* FSIA */ 1134 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.0", "pfc-r8a7740", 1135 - "fsia_sclk_in", "fsia"), 1136 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.0", "pfc-r8a7740", 1137 - "fsia_mclk_out", "fsia"), 1138 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.0", "pfc-r8a7740", 1139 - "fsia_data_in_1", "fsia"), 1140 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.0", "pfc-r8a7740", 1141 - "fsia_data_out_0", "fsia"), 1142 - /* FSIB */ 1143 - PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.1", "pfc-r8a7740", 1144 - "fsib_mclk_in", "fsib"), 1145 - /* GETHER */ 1146 - PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740", 1147 - "gether_mii", "gether"), 1148 - PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740", 1149 - "gether_int", "gether"), 1150 - /* HDMI */ 1151 - PIN_MAP_MUX_GROUP_DEFAULT("sh-mobile-hdmi", "pfc-r8a7740", 1152 - "hdmi", "hdmi"), 1153 - /* LCD0 */ 1154 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-r8a7740", 1155 - "lcd0_data24_0", "lcd0"), 1156 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-r8a7740", 1157 - "lcd0_lclk_1", "lcd0"), 1158 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-r8a7740", 1159 - "lcd0_sync", "lcd0"), 1160 - /* MMCIF */ 1161 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a7740", 1162 - "mmc0_data8_1", "mmc0"), 1163 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a7740", 1164 - "mmc0_ctrl_1", "mmc0"), 1165 - /* SCIFA1 */ 1166 - PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.1", "pfc-r8a7740", 1167 - "scifa1_data", "scifa1"), 1168 - /* SDHI0 */ 1169 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7740", 1170 - "sdhi0_data4", "sdhi0"), 1171 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7740", 1172 - "sdhi0_ctrl", "sdhi0"), 1173 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7740", 1174 - "sdhi0_wp", "sdhi0"), 1175 - /* ST1232 */ 1176 - PIN_MAP_MUX_GROUP_DEFAULT("0-0055", "pfc-r8a7740", 1177 - "intc_irq10", "intc"), 1178 - /* TPU0 */ 1179 - PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm", "pfc-r8a7740", 1180 - "tpu0_to2_1", "tpu0"), 1181 - /* USBHS */ 1182 - PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7740", 1183 - "intc_irq7_1", "intc"), 1184 - }; 1185 - 1186 - static void __init eva_clock_init(void) 1187 - { 1188 - struct clk *system = clk_get(NULL, "system_clk"); 1189 - struct clk *xtal1 = clk_get(NULL, "extal1"); 1190 - struct clk *usb24s = clk_get(NULL, "usb24s"); 1191 - struct clk *fsibck = clk_get(NULL, "fsibck"); 1192 - 1193 - if (IS_ERR(system) || 1194 - IS_ERR(xtal1) || 1195 - IS_ERR(usb24s) || 1196 - IS_ERR(fsibck)) { 1197 - pr_err("armadillo800eva board clock init failed\n"); 1198 - goto clock_error; 1199 - } 1200 - 1201 - /* armadillo 800 eva extal1 is 24MHz */ 1202 - clk_set_rate(xtal1, 24000000); 1203 - 1204 - /* usb24s use extal1 (= system) clock (= 24MHz) */ 1205 - clk_set_parent(usb24s, system); 1206 - 1207 - /* FSIBCK is 12.288MHz, and it is parent of FSI-B */ 1208 - clk_set_rate(fsibck, 12288000); 1209 - 1210 - clock_error: 1211 - if (!IS_ERR(system)) 1212 - clk_put(system); 1213 - if (!IS_ERR(xtal1)) 1214 - clk_put(xtal1); 1215 - if (!IS_ERR(usb24s)) 1216 - clk_put(usb24s); 1217 - if (!IS_ERR(fsibck)) 1218 - clk_put(fsibck); 1219 - } 1220 - 1221 - /* 1222 - * board init 1223 - */ 1224 - #define GPIO_PORT7CR IOMEM(0xe6050007) 1225 - #define GPIO_PORT8CR IOMEM(0xe6050008) 1226 - static void __init eva_init(void) 1227 - { 1228 - static struct pm_domain_device domain_devices[] __initdata = { 1229 - { "A4LC", &lcdc0_device }, 1230 - { "A4LC", &hdmi_lcdc_device }, 1231 - { "A4MP", &hdmi_device }, 1232 - { "A4MP", &fsi_device }, 1233 - { "A4R", &ceu0_device }, 1234 - { "A4S", &sh_eth_device }, 1235 - { "A3SP", &pwm_device }, 1236 - { "A3SP", &sdhi0_device }, 1237 - { "A3SP", &sh_mmcif_device }, 1238 - }; 1239 - struct platform_device *usb = NULL, *sdhi1 = NULL; 1240 - 1241 - regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 1242 - ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 1243 - regulator_register_always_on(3, "fixed-5.0V", fixed5v0_power_consumers, 1244 - ARRAY_SIZE(fixed5v0_power_consumers), 5000000); 1245 - 1246 - pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map)); 1247 - pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); 1248 - 1249 - r8a7740_pinmux_init(); 1250 - r8a7740_meram_workaround(); 1251 - 1252 - /* GETHER */ 1253 - gpio_request_one(18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */ 1254 - 1255 - /* USB */ 1256 - gpio_request_one(159, GPIOF_IN, NULL); /* USB_DEVICE_MODE */ 1257 - 1258 - if (gpio_get_value(159)) { 1259 - /* USB Host */ 1260 - } else { 1261 - /* USB Func */ 1262 - /* 1263 - * The USBHS interrupt handlers needs to read the IRQ pin value 1264 - * (HI/LOW) to diffentiate USB connection and disconnection 1265 - * events (usbhsf_get_vbus()). We thus need to select both the 1266 - * intc_irq7_1 pin group and GPIO 209 here. 1267 - */ 1268 - gpio_request_one(209, GPIOF_IN, NULL); 1269 - 1270 - platform_device_register(&usbhsf_device); 1271 - usb = &usbhsf_device; 1272 - } 1273 - 1274 - /* CON1/CON15 Camera */ 1275 - gpio_request_one(173, GPIOF_OUT_INIT_LOW, NULL); /* STANDBY */ 1276 - gpio_request_one(172, GPIOF_OUT_INIT_HIGH, NULL); /* RST */ 1277 - /* see mt9t111_power() */ 1278 - gpio_request_one(158, GPIOF_OUT_INIT_LOW, NULL); /* CAM_PON */ 1279 - 1280 - /* FSI-WM8978 */ 1281 - gpio_request(7, NULL); 1282 - gpio_request(8, NULL); 1283 - gpio_direction_none(GPIO_PORT7CR); /* FSIAOBT needs no direction */ 1284 - gpio_direction_none(GPIO_PORT8CR); /* FSIAOLR needs no direction */ 1285 - 1286 - /* 1287 - * CAUTION 1288 - * 1289 - * DBGMD/LCDC0/FSIA MUX 1290 - * DBGMD_SELECT_B should be set after setting PFC Function. 1291 - */ 1292 - gpio_request_one(176, GPIOF_OUT_INIT_HIGH, NULL); 1293 - 1294 - /* 1295 - * We can switch CON8/CON14 by SW1.5, 1296 - * but it needs after DBGMD_SELECT_B 1297 - */ 1298 - gpio_request_one(6, GPIOF_IN, NULL); 1299 - if (gpio_get_value(6)) { 1300 - /* CON14 enable */ 1301 - } else { 1302 - /* CON8 (SDHI1) enable */ 1303 - pinctrl_register_mappings(eva_sdhi1_pinctrl_map, 1304 - ARRAY_SIZE(eva_sdhi1_pinctrl_map)); 1305 - 1306 - platform_device_register(&vcc_sdhi1); 1307 - platform_device_register(&sdhi1_device); 1308 - sdhi1 = &sdhi1_device; 1309 - } 1310 - 1311 - 1312 - #ifdef CONFIG_CACHE_L2X0 1313 - /* Shared attribute override enable, 32K*8way */ 1314 - l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff); 1315 - #endif 1316 - 1317 - i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); 1318 - i2c_register_board_info(2, i2c2_devices, ARRAY_SIZE(i2c2_devices)); 1319 - 1320 - r8a7740_add_standard_devices(); 1321 - 1322 - platform_add_devices(eva_devices, 1323 - ARRAY_SIZE(eva_devices)); 1324 - 1325 - rmobile_add_devices_to_domains(domain_devices, 1326 - ARRAY_SIZE(domain_devices)); 1327 - if (usb) 1328 - rmobile_add_device_to_domain("A3SP", usb); 1329 - if (sdhi1) 1330 - rmobile_add_device_to_domain("A3SP", sdhi1); 1331 - 1332 - r8a7740_pm_init(); 1333 - } 1334 - 1335 - static void __init eva_earlytimer_init(void) 1336 - { 1337 - r8a7740_clock_init(MD_CK0 | MD_CK2); 1338 - shmobile_earlytimer_init(); 1339 - 1340 - /* the rate of extal1 clock must be set before late_time_init */ 1341 - eva_clock_init(); 1342 - } 1343 - 1344 - #define RESCNT2 IOMEM(0xe6188020) 1345 - static void eva_restart(enum reboot_mode mode, const char *cmd) 1346 - { 1347 - /* Do soft power on reset */ 1348 - writel((1 << 31), RESCNT2); 1349 - } 1350 - 1351 - static const char *eva_boards_compat_dt[] __initdata = { 1352 - "renesas,armadillo800eva", 1353 - NULL, 1354 - }; 1355 - 1356 - DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva") 1357 - .map_io = r8a7740_map_io, 1358 - .init_early = r8a7740_add_early_devices, 1359 - .init_irq = r8a7740_init_irq_of, 1360 - .init_machine = eva_init, 1361 - .init_late = shmobile_init_late, 1362 - .init_time = eva_earlytimer_init, 1363 - .dt_compat = eva_boards_compat_dt, 1364 - .restart = eva_restart, 1365 - MACHINE_END
+1 -1
arch/arm/mach-shmobile/board-bockw-reference.c
··· 72 72 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 73 73 } 74 74 75 - static const char *bockw_boards_compat_dt[] __initdata = { 75 + static const char *const bockw_boards_compat_dt[] __initconst = { 76 76 "renesas,bockw-reference", 77 77 NULL, 78 78 };
+1 -1
arch/arm/mach-shmobile/board-bockw.c
··· 723 723 ADD_USB_FUNC_DEVICE_IF_POSSIBLE(); 724 724 } 725 725 726 - static const char *bockw_boards_compat_dt[] __initdata = { 726 + static const char *const bockw_boards_compat_dt[] __initconst = { 727 727 "renesas,bockw", 728 728 NULL, 729 729 };
-916
arch/arm/mach-shmobile/board-kzm9g.c
··· 1 - /* 2 - * KZM-A9-GT board support 3 - * 4 - * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation; version 2 of the License. 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/delay.h> 17 - #include <linux/gpio.h> 18 - #include <linux/gpio_keys.h> 19 - #include <linux/io.h> 20 - #include <linux/irq.h> 21 - #include <linux/i2c.h> 22 - #include <linux/i2c/pcf857x.h> 23 - #include <linux/input.h> 24 - #include <linux/irqchip/arm-gic.h> 25 - #include <linux/mmc/host.h> 26 - #include <linux/mmc/sh_mmcif.h> 27 - #include <linux/mmc/sh_mobile_sdhi.h> 28 - #include <linux/mfd/as3711.h> 29 - #include <linux/mfd/tmio.h> 30 - #include <linux/pinctrl/machine.h> 31 - #include <linux/pinctrl/pinconf-generic.h> 32 - #include <linux/platform_device.h> 33 - #include <linux/reboot.h> 34 - #include <linux/regulator/fixed.h> 35 - #include <linux/regulator/machine.h> 36 - #include <linux/smsc911x.h> 37 - #include <linux/usb/r8a66597.h> 38 - #include <linux/usb/renesas_usbhs.h> 39 - #include <linux/videodev2.h> 40 - 41 - #include <sound/sh_fsi.h> 42 - #include <sound/simple_card.h> 43 - #include <asm/hardware/cache-l2x0.h> 44 - #include <asm/mach-types.h> 45 - #include <asm/mach/arch.h> 46 - #include <video/sh_mobile_lcdc.h> 47 - 48 - #include "common.h" 49 - #include "intc.h" 50 - #include "irqs.h" 51 - #include "sh73a0.h" 52 - 53 - /* 54 - * external GPIO 55 - */ 56 - #define GPIO_PCF8575_BASE (310) 57 - #define GPIO_PCF8575_PORT10 (GPIO_PCF8575_BASE + 8) 58 - #define GPIO_PCF8575_PORT11 (GPIO_PCF8575_BASE + 9) 59 - #define GPIO_PCF8575_PORT12 (GPIO_PCF8575_BASE + 10) 60 - #define GPIO_PCF8575_PORT13 (GPIO_PCF8575_BASE + 11) 61 - #define GPIO_PCF8575_PORT14 (GPIO_PCF8575_BASE + 12) 62 - #define GPIO_PCF8575_PORT15 (GPIO_PCF8575_BASE + 13) 63 - #define GPIO_PCF8575_PORT16 (GPIO_PCF8575_BASE + 14) 64 - 65 - /* Dummy supplies, where voltage doesn't matter */ 66 - static struct regulator_consumer_supply dummy_supplies[] = { 67 - REGULATOR_SUPPLY("vddvario", "smsc911x.0"), 68 - REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), 69 - }; 70 - 71 - /* 72 - * FSI-AK4648 73 - * 74 - * this command is required when playback. 75 - * 76 - * # amixer set "LINEOUT Mixer DACL" on 77 - */ 78 - 79 - /* SMSC 9221 */ 80 - static struct resource smsc9221_resources[] = { 81 - [0] = { 82 - .start = 0x10000000, /* CS4 */ 83 - .end = 0x100000ff, 84 - .flags = IORESOURCE_MEM, 85 - }, 86 - [1] = { 87 - .start = irq_pin(3), /* IRQ3 */ 88 - .flags = IORESOURCE_IRQ, 89 - }, 90 - }; 91 - 92 - static struct smsc911x_platform_config smsc9221_platdata = { 93 - .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, 94 - .phy_interface = PHY_INTERFACE_MODE_MII, 95 - .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 96 - .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 97 - }; 98 - 99 - static struct platform_device smsc_device = { 100 - .name = "smsc911x", 101 - .dev = { 102 - .platform_data = &smsc9221_platdata, 103 - }, 104 - .resource = smsc9221_resources, 105 - .num_resources = ARRAY_SIZE(smsc9221_resources), 106 - }; 107 - 108 - /* USB external chip */ 109 - static struct r8a66597_platdata usb_host_data = { 110 - .on_chip = 0, 111 - .xtal = R8A66597_PLATDATA_XTAL_48MHZ, 112 - }; 113 - 114 - static struct resource usb_resources[] = { 115 - [0] = { 116 - .start = 0x10010000, 117 - .end = 0x1001ffff - 1, 118 - .flags = IORESOURCE_MEM, 119 - }, 120 - [1] = { 121 - .start = irq_pin(1), /* IRQ1 */ 122 - .flags = IORESOURCE_IRQ, 123 - }, 124 - }; 125 - 126 - static struct platform_device usb_host_device = { 127 - .name = "r8a66597_hcd", 128 - .dev = { 129 - .platform_data = &usb_host_data, 130 - .dma_mask = NULL, 131 - .coherent_dma_mask = 0xffffffff, 132 - }, 133 - .num_resources = ARRAY_SIZE(usb_resources), 134 - .resource = usb_resources, 135 - }; 136 - 137 - /* USB Func CN17 */ 138 - struct usbhs_private { 139 - void __iomem *phy; 140 - void __iomem *cr2; 141 - struct renesas_usbhs_platform_info info; 142 - }; 143 - 144 - #define IRQ15 irq_pin(15) 145 - #define USB_PHY_MODE (1 << 4) 146 - #define USB_PHY_INT_EN ((1 << 3) | (1 << 2)) 147 - #define USB_PHY_ON (1 << 1) 148 - #define USB_PHY_OFF (1 << 0) 149 - #define USB_PHY_INT_CLR (USB_PHY_ON | USB_PHY_OFF) 150 - 151 - #define usbhs_get_priv(pdev) \ 152 - container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info) 153 - 154 - static int usbhs_get_vbus(struct platform_device *pdev) 155 - { 156 - struct usbhs_private *priv = usbhs_get_priv(pdev); 157 - 158 - return !((1 << 7) & __raw_readw(priv->cr2)); 159 - } 160 - 161 - static int usbhs_phy_reset(struct platform_device *pdev) 162 - { 163 - struct usbhs_private *priv = usbhs_get_priv(pdev); 164 - 165 - /* init phy */ 166 - __raw_writew(0x8a0a, priv->cr2); 167 - 168 - return 0; 169 - } 170 - 171 - static int usbhs_get_id(struct platform_device *pdev) 172 - { 173 - return USBHS_GADGET; 174 - } 175 - 176 - static irqreturn_t usbhs_interrupt(int irq, void *data) 177 - { 178 - struct platform_device *pdev = data; 179 - struct usbhs_private *priv = usbhs_get_priv(pdev); 180 - 181 - renesas_usbhs_call_notify_hotplug(pdev); 182 - 183 - /* clear status */ 184 - __raw_writew(__raw_readw(priv->phy) | USB_PHY_INT_CLR, priv->phy); 185 - 186 - return IRQ_HANDLED; 187 - } 188 - 189 - static int usbhs_hardware_init(struct platform_device *pdev) 190 - { 191 - struct usbhs_private *priv = usbhs_get_priv(pdev); 192 - int ret; 193 - 194 - /* clear interrupt status */ 195 - __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->phy); 196 - 197 - ret = request_irq(IRQ15, usbhs_interrupt, IRQF_TRIGGER_HIGH, 198 - dev_name(&pdev->dev), pdev); 199 - if (ret) { 200 - dev_err(&pdev->dev, "request_irq err\n"); 201 - return ret; 202 - } 203 - 204 - /* enable USB phy interrupt */ 205 - __raw_writew(USB_PHY_MODE | USB_PHY_INT_EN, priv->phy); 206 - 207 - return 0; 208 - } 209 - 210 - static int usbhs_hardware_exit(struct platform_device *pdev) 211 - { 212 - struct usbhs_private *priv = usbhs_get_priv(pdev); 213 - 214 - /* clear interrupt status */ 215 - __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->phy); 216 - 217 - free_irq(IRQ15, pdev); 218 - 219 - return 0; 220 - } 221 - 222 - static u32 usbhs_pipe_cfg[] = { 223 - USB_ENDPOINT_XFER_CONTROL, 224 - USB_ENDPOINT_XFER_ISOC, 225 - USB_ENDPOINT_XFER_ISOC, 226 - USB_ENDPOINT_XFER_BULK, 227 - USB_ENDPOINT_XFER_BULK, 228 - USB_ENDPOINT_XFER_BULK, 229 - USB_ENDPOINT_XFER_INT, 230 - USB_ENDPOINT_XFER_INT, 231 - USB_ENDPOINT_XFER_INT, 232 - USB_ENDPOINT_XFER_BULK, 233 - USB_ENDPOINT_XFER_BULK, 234 - USB_ENDPOINT_XFER_BULK, 235 - USB_ENDPOINT_XFER_BULK, 236 - USB_ENDPOINT_XFER_BULK, 237 - USB_ENDPOINT_XFER_BULK, 238 - USB_ENDPOINT_XFER_BULK, 239 - }; 240 - 241 - static struct usbhs_private usbhs_private = { 242 - .phy = IOMEM(0xe60781e0), /* USBPHYINT */ 243 - .cr2 = IOMEM(0xe605810c), /* USBCR2 */ 244 - .info = { 245 - .platform_callback = { 246 - .hardware_init = usbhs_hardware_init, 247 - .hardware_exit = usbhs_hardware_exit, 248 - .get_id = usbhs_get_id, 249 - .phy_reset = usbhs_phy_reset, 250 - .get_vbus = usbhs_get_vbus, 251 - }, 252 - .driver_param = { 253 - .buswait_bwait = 4, 254 - .has_otg = 1, 255 - .pipe_type = usbhs_pipe_cfg, 256 - .pipe_size = ARRAY_SIZE(usbhs_pipe_cfg), 257 - }, 258 - }, 259 - }; 260 - 261 - static struct resource usbhs_resources[] = { 262 - [0] = { 263 - .start = 0xE6890000, 264 - .end = 0xE68900e6 - 1, 265 - .flags = IORESOURCE_MEM, 266 - }, 267 - [1] = { 268 - .start = gic_spi(62), 269 - .end = gic_spi(62), 270 - .flags = IORESOURCE_IRQ, 271 - }, 272 - }; 273 - 274 - static struct platform_device usbhs_device = { 275 - .name = "renesas_usbhs", 276 - .id = -1, 277 - .dev = { 278 - .dma_mask = NULL, 279 - .coherent_dma_mask = 0xffffffff, 280 - .platform_data = &usbhs_private.info, 281 - }, 282 - .num_resources = ARRAY_SIZE(usbhs_resources), 283 - .resource = usbhs_resources, 284 - }; 285 - 286 - /* LCDC */ 287 - static struct fb_videomode kzm_lcdc_mode = { 288 - .name = "WVGA Panel", 289 - .xres = 800, 290 - .yres = 480, 291 - .left_margin = 220, 292 - .right_margin = 110, 293 - .hsync_len = 70, 294 - .upper_margin = 20, 295 - .lower_margin = 5, 296 - .vsync_len = 5, 297 - .sync = 0, 298 - }; 299 - 300 - static struct sh_mobile_lcdc_info lcdc_info = { 301 - .clock_source = LCDC_CLK_BUS, 302 - .ch[0] = { 303 - .chan = LCDC_CHAN_MAINLCD, 304 - .fourcc = V4L2_PIX_FMT_RGB565, 305 - .interface_type = RGB24, 306 - .lcd_modes = &kzm_lcdc_mode, 307 - .num_modes = 1, 308 - .clock_divider = 5, 309 - .flags = 0, 310 - .panel_cfg = { 311 - .width = 152, 312 - .height = 91, 313 - }, 314 - } 315 - }; 316 - 317 - static struct resource lcdc_resources[] = { 318 - [0] = { 319 - .name = "LCDC", 320 - .start = 0xfe940000, 321 - .end = 0xfe943fff, 322 - .flags = IORESOURCE_MEM, 323 - }, 324 - [1] = { 325 - .start = intcs_evt2irq(0x580), 326 - .flags = IORESOURCE_IRQ, 327 - }, 328 - }; 329 - 330 - static struct platform_device lcdc_device = { 331 - .name = "sh_mobile_lcdc_fb", 332 - .num_resources = ARRAY_SIZE(lcdc_resources), 333 - .resource = lcdc_resources, 334 - .dev = { 335 - .platform_data = &lcdc_info, 336 - .coherent_dma_mask = DMA_BIT_MASK(32), 337 - }, 338 - }; 339 - 340 - /* Fixed 1.8V regulator to be used by MMCIF */ 341 - static struct regulator_consumer_supply fixed1v8_power_consumers[] = 342 - { 343 - REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), 344 - REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"), 345 - }; 346 - 347 - /* MMCIF */ 348 - static struct resource sh_mmcif_resources[] = { 349 - [0] = { 350 - .name = "MMCIF", 351 - .start = 0xe6bd0000, 352 - .end = 0xe6bd00ff, 353 - .flags = IORESOURCE_MEM, 354 - }, 355 - [1] = { 356 - .start = gic_spi(140), 357 - .flags = IORESOURCE_IRQ, 358 - }, 359 - [2] = { 360 - .start = gic_spi(141), 361 - .flags = IORESOURCE_IRQ, 362 - }, 363 - }; 364 - 365 - static struct sh_mmcif_plat_data sh_mmcif_platdata = { 366 - .ocr = MMC_VDD_165_195, 367 - .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, 368 - .ccs_unsupported = true, 369 - .slave_id_tx = SHDMA_SLAVE_MMCIF_TX, 370 - .slave_id_rx = SHDMA_SLAVE_MMCIF_RX, 371 - }; 372 - 373 - static struct platform_device mmc_device = { 374 - .name = "sh_mmcif", 375 - .dev = { 376 - .dma_mask = NULL, 377 - .coherent_dma_mask = 0xffffffff, 378 - .platform_data = &sh_mmcif_platdata, 379 - }, 380 - .num_resources = ARRAY_SIZE(sh_mmcif_resources), 381 - .resource = sh_mmcif_resources, 382 - }; 383 - 384 - /* Fixed 3.3V regulators to be used by SDHI0 */ 385 - static struct regulator_consumer_supply vcc_sdhi0_consumers[] = 386 - { 387 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 388 - }; 389 - 390 - static struct regulator_init_data vcc_sdhi0_init_data = { 391 - .constraints = { 392 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 393 - }, 394 - .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi0_consumers), 395 - .consumer_supplies = vcc_sdhi0_consumers, 396 - }; 397 - 398 - static struct fixed_voltage_config vcc_sdhi0_info = { 399 - .supply_name = "SDHI0 Vcc", 400 - .microvolts = 3300000, 401 - .gpio = 15, 402 - .enable_high = 1, 403 - .init_data = &vcc_sdhi0_init_data, 404 - }; 405 - 406 - static struct platform_device vcc_sdhi0 = { 407 - .name = "reg-fixed-voltage", 408 - .id = 0, 409 - .dev = { 410 - .platform_data = &vcc_sdhi0_info, 411 - }, 412 - }; 413 - 414 - /* Fixed 3.3V regulators to be used by SDHI2 */ 415 - static struct regulator_consumer_supply vcc_sdhi2_consumers[] = 416 - { 417 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"), 418 - }; 419 - 420 - static struct regulator_init_data vcc_sdhi2_init_data = { 421 - .constraints = { 422 - .valid_ops_mask = REGULATOR_CHANGE_STATUS, 423 - }, 424 - .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi2_consumers), 425 - .consumer_supplies = vcc_sdhi2_consumers, 426 - }; 427 - 428 - static struct fixed_voltage_config vcc_sdhi2_info = { 429 - .supply_name = "SDHI2 Vcc", 430 - .microvolts = 3300000, 431 - .gpio = 14, 432 - .enable_high = 1, 433 - .init_data = &vcc_sdhi2_init_data, 434 - }; 435 - 436 - static struct platform_device vcc_sdhi2 = { 437 - .name = "reg-fixed-voltage", 438 - .id = 1, 439 - .dev = { 440 - .platform_data = &vcc_sdhi2_info, 441 - }, 442 - }; 443 - 444 - /* SDHI */ 445 - static struct tmio_mmc_data sdhi0_info = { 446 - .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI0_TX, 447 - .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI0_RX, 448 - .flags = TMIO_MMC_HAS_IDLE_WAIT, 449 - .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | 450 - MMC_CAP_POWER_OFF_CARD, 451 - }; 452 - 453 - static struct resource sdhi0_resources[] = { 454 - [0] = { 455 - .name = "SDHI0", 456 - .start = 0xee100000, 457 - .end = 0xee1000ff, 458 - .flags = IORESOURCE_MEM, 459 - }, 460 - [1] = { 461 - .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT, 462 - .start = gic_spi(83), 463 - .flags = IORESOURCE_IRQ, 464 - }, 465 - [2] = { 466 - .name = SH_MOBILE_SDHI_IRQ_SDCARD, 467 - .start = gic_spi(84), 468 - .flags = IORESOURCE_IRQ, 469 - }, 470 - [3] = { 471 - .name = SH_MOBILE_SDHI_IRQ_SDIO, 472 - .start = gic_spi(85), 473 - .flags = IORESOURCE_IRQ, 474 - }, 475 - }; 476 - 477 - static struct platform_device sdhi0_device = { 478 - .name = "sh_mobile_sdhi", 479 - .num_resources = ARRAY_SIZE(sdhi0_resources), 480 - .resource = sdhi0_resources, 481 - .dev = { 482 - .platform_data = &sdhi0_info, 483 - }, 484 - }; 485 - 486 - /* Micro SD */ 487 - static struct tmio_mmc_data sdhi2_info = { 488 - .chan_priv_tx = (void *)SHDMA_SLAVE_SDHI2_TX, 489 - .chan_priv_rx = (void *)SHDMA_SLAVE_SDHI2_RX, 490 - .flags = TMIO_MMC_HAS_IDLE_WAIT | 491 - TMIO_MMC_USE_GPIO_CD | 492 - TMIO_MMC_WRPROTECT_DISABLE, 493 - .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_POWER_OFF_CARD, 494 - .cd_gpio = 13, 495 - }; 496 - 497 - static struct resource sdhi2_resources[] = { 498 - [0] = { 499 - .name = "SDHI2", 500 - .start = 0xee140000, 501 - .end = 0xee1400ff, 502 - .flags = IORESOURCE_MEM, 503 - }, 504 - [1] = { 505 - .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT, 506 - .start = gic_spi(103), 507 - .flags = IORESOURCE_IRQ, 508 - }, 509 - [2] = { 510 - .name = SH_MOBILE_SDHI_IRQ_SDCARD, 511 - .start = gic_spi(104), 512 - .flags = IORESOURCE_IRQ, 513 - }, 514 - [3] = { 515 - .name = SH_MOBILE_SDHI_IRQ_SDIO, 516 - .start = gic_spi(105), 517 - .flags = IORESOURCE_IRQ, 518 - }, 519 - }; 520 - 521 - static struct platform_device sdhi2_device = { 522 - .name = "sh_mobile_sdhi", 523 - .id = 2, 524 - .num_resources = ARRAY_SIZE(sdhi2_resources), 525 - .resource = sdhi2_resources, 526 - .dev = { 527 - .platform_data = &sdhi2_info, 528 - }, 529 - }; 530 - 531 - /* KEY */ 532 - #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 } 533 - 534 - static struct gpio_keys_button gpio_buttons[] = { 535 - GPIO_KEY(KEY_BACK, GPIO_PCF8575_PORT10, "SW3"), 536 - GPIO_KEY(KEY_RIGHT, GPIO_PCF8575_PORT11, "SW2-R"), 537 - GPIO_KEY(KEY_LEFT, GPIO_PCF8575_PORT12, "SW2-L"), 538 - GPIO_KEY(KEY_ENTER, GPIO_PCF8575_PORT13, "SW2-P"), 539 - GPIO_KEY(KEY_UP, GPIO_PCF8575_PORT14, "SW2-U"), 540 - GPIO_KEY(KEY_DOWN, GPIO_PCF8575_PORT15, "SW2-D"), 541 - GPIO_KEY(KEY_HOME, GPIO_PCF8575_PORT16, "SW1"), 542 - }; 543 - 544 - static struct gpio_keys_platform_data gpio_key_info = { 545 - .buttons = gpio_buttons, 546 - .nbuttons = ARRAY_SIZE(gpio_buttons), 547 - }; 548 - 549 - static struct platform_device gpio_keys_device = { 550 - .name = "gpio-keys", 551 - .dev = { 552 - .platform_data = &gpio_key_info, 553 - }, 554 - }; 555 - 556 - /* FSI-AK4648 */ 557 - static struct sh_fsi_platform_info fsi_info = { 558 - .port_a = { 559 - .tx_id = SHDMA_SLAVE_FSI2A_TX, 560 - }, 561 - }; 562 - 563 - static struct resource fsi_resources[] = { 564 - [0] = { 565 - .name = "FSI", 566 - .start = 0xEC230000, 567 - .end = 0xEC230400 - 1, 568 - .flags = IORESOURCE_MEM, 569 - }, 570 - [1] = { 571 - .start = gic_spi(146), 572 - .flags = IORESOURCE_IRQ, 573 - }, 574 - }; 575 - 576 - static struct platform_device fsi_device = { 577 - .name = "sh_fsi2", 578 - .id = -1, 579 - .num_resources = ARRAY_SIZE(fsi_resources), 580 - .resource = fsi_resources, 581 - .dev = { 582 - .platform_data = &fsi_info, 583 - }, 584 - }; 585 - 586 - static struct asoc_simple_card_info fsi2_ak4648_info = { 587 - .name = "AK4648", 588 - .card = "FSI2A-AK4648", 589 - .codec = "ak4642-codec.0-0012", 590 - .platform = "sh_fsi2", 591 - .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM, 592 - .cpu_dai = { 593 - .name = "fsia-dai", 594 - }, 595 - .codec_dai = { 596 - .name = "ak4642-hifi", 597 - .sysclk = 11289600, 598 - }, 599 - }; 600 - 601 - static struct platform_device fsi_ak4648_device = { 602 - .name = "asoc-simple-card", 603 - .dev = { 604 - .platform_data = &fsi2_ak4648_info, 605 - .coherent_dma_mask = DMA_BIT_MASK(32), 606 - .dma_mask = &fsi_ak4648_device.dev.coherent_dma_mask, 607 - }, 608 - }; 609 - 610 - /* I2C */ 611 - 612 - /* StepDown1 is used to supply 1.315V to the CPU */ 613 - static struct regulator_init_data as3711_sd1 = { 614 - .constraints = { 615 - .name = "1.315V CPU", 616 - .boot_on = 1, 617 - .always_on = 1, 618 - .min_uV = 1315000, 619 - .max_uV = 1335000, 620 - }, 621 - }; 622 - 623 - /* StepDown2 is used to supply 1.8V to the CPU and to the board */ 624 - static struct regulator_init_data as3711_sd2 = { 625 - .constraints = { 626 - .name = "1.8V", 627 - .boot_on = 1, 628 - .always_on = 1, 629 - .min_uV = 1800000, 630 - .max_uV = 1800000, 631 - }, 632 - }; 633 - 634 - /* 635 - * StepDown3 is switched in parallel with StepDown2, seems to be off, 636 - * according to read-back pre-set register values 637 - */ 638 - 639 - /* StepDown4 is used to supply 1.215V to the CPU and to the board */ 640 - static struct regulator_init_data as3711_sd4 = { 641 - .constraints = { 642 - .name = "1.215V", 643 - .boot_on = 1, 644 - .always_on = 1, 645 - .min_uV = 1215000, 646 - .max_uV = 1235000, 647 - }, 648 - }; 649 - 650 - /* LDO1 is unused and unconnected */ 651 - 652 - /* LDO2 is used to supply 2.8V to the CPU */ 653 - static struct regulator_init_data as3711_ldo2 = { 654 - .constraints = { 655 - .name = "2.8V CPU", 656 - .boot_on = 1, 657 - .always_on = 1, 658 - .min_uV = 2800000, 659 - .max_uV = 2800000, 660 - }, 661 - }; 662 - 663 - /* LDO3 is used to supply 3.0V to the CPU */ 664 - static struct regulator_init_data as3711_ldo3 = { 665 - .constraints = { 666 - .name = "3.0V CPU", 667 - .boot_on = 1, 668 - .always_on = 1, 669 - .min_uV = 3000000, 670 - .max_uV = 3000000, 671 - }, 672 - }; 673 - 674 - /* LDO4 is used to supply 2.8V to the board */ 675 - static struct regulator_init_data as3711_ldo4 = { 676 - .constraints = { 677 - .name = "2.8V", 678 - .boot_on = 1, 679 - .always_on = 1, 680 - .min_uV = 2800000, 681 - .max_uV = 2800000, 682 - }, 683 - }; 684 - 685 - /* LDO5 is switched parallel to LDO4, also set to 2.8V */ 686 - static struct regulator_init_data as3711_ldo5 = { 687 - .constraints = { 688 - .name = "2.8V #2", 689 - .boot_on = 1, 690 - .always_on = 1, 691 - .min_uV = 2800000, 692 - .max_uV = 2800000, 693 - }, 694 - }; 695 - 696 - /* LDO6 is unused and unconnected */ 697 - 698 - /* LDO7 is used to supply 1.15V to the CPU */ 699 - static struct regulator_init_data as3711_ldo7 = { 700 - .constraints = { 701 - .name = "1.15V CPU", 702 - .boot_on = 1, 703 - .always_on = 1, 704 - .min_uV = 1150000, 705 - .max_uV = 1150000, 706 - }, 707 - }; 708 - 709 - /* LDO8 is switched parallel to LDO7, also set to 1.15V */ 710 - static struct regulator_init_data as3711_ldo8 = { 711 - .constraints = { 712 - .name = "1.15V CPU #2", 713 - .boot_on = 1, 714 - .always_on = 1, 715 - .min_uV = 1150000, 716 - .max_uV = 1150000, 717 - }, 718 - }; 719 - 720 - static struct as3711_platform_data as3711_pdata = { 721 - .regulator = { 722 - .init_data = { 723 - [AS3711_REGULATOR_SD_1] = &as3711_sd1, 724 - [AS3711_REGULATOR_SD_2] = &as3711_sd2, 725 - [AS3711_REGULATOR_SD_4] = &as3711_sd4, 726 - [AS3711_REGULATOR_LDO_2] = &as3711_ldo2, 727 - [AS3711_REGULATOR_LDO_3] = &as3711_ldo3, 728 - [AS3711_REGULATOR_LDO_4] = &as3711_ldo4, 729 - [AS3711_REGULATOR_LDO_5] = &as3711_ldo5, 730 - [AS3711_REGULATOR_LDO_7] = &as3711_ldo7, 731 - [AS3711_REGULATOR_LDO_8] = &as3711_ldo8, 732 - }, 733 - }, 734 - .backlight = { 735 - .su2_fb = "sh_mobile_lcdc_fb.0", 736 - .su2_max_uA = 36000, 737 - .su2_feedback = AS3711_SU2_CURR_AUTO, 738 - .su2_fbprot = AS3711_SU2_GPIO4, 739 - .su2_auto_curr1 = true, 740 - .su2_auto_curr2 = true, 741 - .su2_auto_curr3 = true, 742 - }, 743 - }; 744 - 745 - static struct pcf857x_platform_data pcf8575_pdata = { 746 - .gpio_base = GPIO_PCF8575_BASE, 747 - }; 748 - 749 - static struct i2c_board_info i2c0_devices[] = { 750 - { 751 - I2C_BOARD_INFO("ak4648", 0x12), 752 - }, 753 - { 754 - I2C_BOARD_INFO("r2025sd", 0x32), 755 - }, 756 - { 757 - I2C_BOARD_INFO("ak8975", 0x0c), 758 - .irq = irq_pin(28), /* IRQ28 */ 759 - }, 760 - { 761 - I2C_BOARD_INFO("adxl34x", 0x1d), 762 - .irq = irq_pin(26), /* IRQ26 */ 763 - }, 764 - { 765 - I2C_BOARD_INFO("as3711", 0x40), 766 - .irq = intcs_evt2irq(0x3300), /* IRQ24 */ 767 - .platform_data = &as3711_pdata, 768 - }, 769 - }; 770 - 771 - static struct i2c_board_info i2c1_devices[] = { 772 - { 773 - I2C_BOARD_INFO("st1232-ts", 0x55), 774 - .irq = irq_pin(8), /* IRQ8 */ 775 - }, 776 - }; 777 - 778 - static struct i2c_board_info i2c3_devices[] = { 779 - { 780 - I2C_BOARD_INFO("pcf8575", 0x20), 781 - .irq = irq_pin(19), /* IRQ19 */ 782 - .platform_data = &pcf8575_pdata, 783 - }, 784 - }; 785 - 786 - static struct platform_device *kzm_devices[] __initdata = { 787 - &smsc_device, 788 - &usb_host_device, 789 - &usbhs_device, 790 - &lcdc_device, 791 - &mmc_device, 792 - &vcc_sdhi0, 793 - &vcc_sdhi2, 794 - &sdhi0_device, 795 - &sdhi2_device, 796 - &gpio_keys_device, 797 - &fsi_device, 798 - &fsi_ak4648_device, 799 - }; 800 - 801 - static unsigned long pin_pullup_conf[] = { 802 - PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0), 803 - }; 804 - 805 - static const struct pinctrl_map kzm_pinctrl_map[] = { 806 - /* FSIA (AK4648) */ 807 - PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2", "pfc-sh73a0", 808 - "fsia_mclk_in", "fsia"), 809 - PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2", "pfc-sh73a0", 810 - "fsia_sclk_in", "fsia"), 811 - PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2", "pfc-sh73a0", 812 - "fsia_data_in", "fsia"), 813 - PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2", "pfc-sh73a0", 814 - "fsia_data_out", "fsia"), 815 - /* I2C3 */ 816 - PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0", 817 - "i2c3_1", "i2c3"), 818 - /* LCD */ 819 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-sh73a0", 820 - "lcd_data24", "lcd"), 821 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-sh73a0", 822 - "lcd_sync", "lcd"), 823 - /* MMCIF */ 824 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0", 825 - "mmc0_data8_0", "mmc0"), 826 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0", 827 - "mmc0_ctrl_0", "mmc0"), 828 - PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0", 829 - "PORT279", pin_pullup_conf), 830 - PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0", 831 - "mmc0_data8_0", pin_pullup_conf), 832 - /* SCIFA4 */ 833 - PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0", 834 - "scifa4_data", "scifa4"), 835 - PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0", 836 - "scifa4_ctrl", "scifa4"), 837 - /* SDHI0 */ 838 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0", 839 - "sdhi0_data4", "sdhi0"), 840 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0", 841 - "sdhi0_ctrl", "sdhi0"), 842 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0", 843 - "sdhi0_cd", "sdhi0"), 844 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0", 845 - "sdhi0_wp", "sdhi0"), 846 - /* SDHI2 */ 847 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0", 848 - "sdhi2_data4", "sdhi2"), 849 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0", 850 - "sdhi2_ctrl", "sdhi2"), 851 - /* SMSC */ 852 - PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0", 853 - "bsc_cs4", "bsc"), 854 - /* USB */ 855 - PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-sh73a0", 856 - "usb_vbus", "usb"), 857 - }; 858 - 859 - static void __init kzm_init(void) 860 - { 861 - regulator_register_always_on(2, "fixed-1.8V", fixed1v8_power_consumers, 862 - ARRAY_SIZE(fixed1v8_power_consumers), 1800000); 863 - regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 864 - 865 - pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map)); 866 - 867 - sh73a0_pinmux_init(); 868 - 869 - /* SMSC */ 870 - gpio_request_one(224, GPIOF_IN, NULL); /* IRQ3 */ 871 - 872 - /* LCDC */ 873 - gpio_request_one(222, GPIOF_OUT_INIT_HIGH, NULL); /* LCDCDON */ 874 - gpio_request_one(226, GPIOF_OUT_INIT_HIGH, NULL); /* SC */ 875 - 876 - /* Touchscreen */ 877 - gpio_request_one(223, GPIOF_IN, NULL); /* IRQ8 */ 878 - 879 - #ifdef CONFIG_CACHE_L2X0 880 - /* Shared attribute override enable, 64K*8way */ 881 - l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff); 882 - #endif 883 - 884 - i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); 885 - i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices)); 886 - i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices)); 887 - 888 - sh73a0_add_standard_devices(); 889 - platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices)); 890 - 891 - sh73a0_pm_init(); 892 - } 893 - 894 - static void kzm9g_restart(enum reboot_mode mode, const char *cmd) 895 - { 896 - #define RESCNT2 IOMEM(0xe6188020) 897 - /* Do soft power on reset */ 898 - writel((1 << 31), RESCNT2); 899 - } 900 - 901 - static const char *kzm9g_boards_compat_dt[] __initdata = { 902 - "renesas,kzm9g", 903 - NULL, 904 - }; 905 - 906 - DT_MACHINE_START(KZM9G_DT, "kzm9g") 907 - .smp = smp_ops(sh73a0_smp_ops), 908 - .map_io = sh73a0_map_io, 909 - .init_early = sh73a0_add_early_devices, 910 - .init_irq = sh73a0_init_irq, 911 - .init_machine = kzm_init, 912 - .init_late = shmobile_init_late, 913 - .init_time = sh73a0_earlytimer_init, 914 - .restart = kzm9g_restart, 915 - .dt_compat = kzm9g_boards_compat_dt, 916 - MACHINE_END
-56
arch/arm/mach-shmobile/board-marzen-reference.c
··· 1 - /* 2 - * marzen board support - Reference DT implementation 3 - * 4 - * Copyright (C) 2011 Renesas Solutions Corp. 5 - * Copyright (C) 2011 Magnus Damm 6 - * Copyright (C) 2013 Simon Horman 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; version 2 of the License. 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 - #include <linux/clk/shmobile.h> 19 - #include <linux/clocksource.h> 20 - #include <linux/of_platform.h> 21 - 22 - #include <asm/irq.h> 23 - #include <asm/mach/arch.h> 24 - 25 - #include "common.h" 26 - #include "irqs.h" 27 - #include "r8a7779.h" 28 - 29 - static void __init marzen_init_timer(void) 30 - { 31 - r8a7779_clocks_init(r8a7779_read_mode_pins()); 32 - clocksource_of_init(); 33 - } 34 - 35 - static void __init marzen_init(void) 36 - { 37 - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 38 - r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */ 39 - } 40 - 41 - static const char *marzen_boards_compat_dt[] __initdata = { 42 - "renesas,marzen", 43 - "renesas,marzen-reference", 44 - NULL, 45 - }; 46 - 47 - DT_MACHINE_START(MARZEN, "marzen") 48 - .smp = smp_ops(r8a7779_smp_ops), 49 - .map_io = r8a7779_map_io, 50 - .init_early = shmobile_init_delay, 51 - .init_time = marzen_init_timer, 52 - .init_irq = r8a7779_init_irq_dt, 53 - .init_machine = marzen_init, 54 - .init_late = shmobile_init_late, 55 - .dt_compat = marzen_boards_compat_dt, 56 - MACHINE_END
-347
arch/arm/mach-shmobile/board-marzen.c
··· 1 - /* 2 - * marzen board support 3 - * 4 - * Copyright (C) 2011, 2013 Renesas Solutions Corp. 5 - * Copyright (C) 2011 Magnus Damm 6 - * Copyright (C) 2013 Cogent Embedded, Inc. 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; version 2 of the License. 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 - #include <linux/kernel.h> 19 - #include <linux/init.h> 20 - #include <linux/interrupt.h> 21 - #include <linux/irq.h> 22 - #include <linux/platform_device.h> 23 - #include <linux/delay.h> 24 - #include <linux/io.h> 25 - #include <linux/leds.h> 26 - #include <linux/dma-mapping.h> 27 - #include <linux/pinctrl/machine.h> 28 - #include <linux/platform_data/camera-rcar.h> 29 - #include <linux/platform_data/gpio-rcar.h> 30 - #include <linux/platform_data/usb-rcar-phy.h> 31 - #include <linux/regulator/fixed.h> 32 - #include <linux/regulator/machine.h> 33 - #include <linux/smsc911x.h> 34 - #include <linux/spi/spi.h> 35 - #include <linux/spi/sh_hspi.h> 36 - #include <linux/mmc/host.h> 37 - #include <linux/mmc/sh_mobile_sdhi.h> 38 - #include <linux/mfd/tmio.h> 39 - 40 - #include <media/soc_camera.h> 41 - #include <asm/mach-types.h> 42 - #include <asm/mach/arch.h> 43 - #include <asm/traps.h> 44 - 45 - #include "common.h" 46 - #include "irqs.h" 47 - #include "r8a7779.h" 48 - 49 - /* Fixed 3.3V regulator to be used by SDHI0 */ 50 - static struct regulator_consumer_supply fixed3v3_power_consumers[] = { 51 - REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 52 - REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 53 - }; 54 - 55 - /* Dummy supplies, where voltage doesn't matter */ 56 - static struct regulator_consumer_supply dummy_supplies[] = { 57 - REGULATOR_SUPPLY("vddvario", "smsc911x"), 58 - REGULATOR_SUPPLY("vdd33a", "smsc911x"), 59 - }; 60 - 61 - /* USB PHY */ 62 - static struct resource usb_phy_resources[] = { 63 - [0] = { 64 - .start = 0xffe70800, 65 - .end = 0xffe70900 - 1, 66 - .flags = IORESOURCE_MEM, 67 - }, 68 - }; 69 - 70 - static struct rcar_phy_platform_data usb_phy_platform_data; 71 - 72 - static struct platform_device usb_phy = { 73 - .name = "rcar_usb_phy", 74 - .id = -1, 75 - .dev = { 76 - .platform_data = &usb_phy_platform_data, 77 - }, 78 - .resource = usb_phy_resources, 79 - .num_resources = ARRAY_SIZE(usb_phy_resources), 80 - }; 81 - 82 - /* SMSC LAN89218 */ 83 - static struct resource smsc911x_resources[] = { 84 - [0] = { 85 - .start = 0x18000000, /* ExCS0 */ 86 - .end = 0x180000ff, /* A1->A7 */ 87 - .flags = IORESOURCE_MEM, 88 - }, 89 - [1] = { 90 - .start = irq_pin(1), /* IRQ 1 */ 91 - .flags = IORESOURCE_IRQ, 92 - }, 93 - }; 94 - 95 - static struct smsc911x_platform_config smsc911x_platdata = { 96 - .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */ 97 - .phy_interface = PHY_INTERFACE_MODE_MII, 98 - .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 99 - .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 100 - }; 101 - 102 - static struct platform_device eth_device = { 103 - .name = "smsc911x", 104 - .id = -1, 105 - .dev = { 106 - .platform_data = &smsc911x_platdata, 107 - }, 108 - .resource = smsc911x_resources, 109 - .num_resources = ARRAY_SIZE(smsc911x_resources), 110 - }; 111 - 112 - static struct resource sdhi0_resources[] = { 113 - [0] = { 114 - .name = "sdhi0", 115 - .start = 0xffe4c000, 116 - .end = 0xffe4c0ff, 117 - .flags = IORESOURCE_MEM, 118 - }, 119 - [1] = { 120 - .start = gic_iid(0x88), 121 - .flags = IORESOURCE_IRQ, 122 - }, 123 - }; 124 - 125 - static struct tmio_mmc_data sdhi0_platform_data = { 126 - .chan_priv_tx = (void *)HPBDMA_SLAVE_SDHI0_TX, 127 - .chan_priv_rx = (void *)HPBDMA_SLAVE_SDHI0_RX, 128 - .flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, 129 - .capabilities = MMC_CAP_SD_HIGHSPEED, 130 - }; 131 - 132 - static struct platform_device sdhi0_device = { 133 - .name = "sh_mobile_sdhi", 134 - .num_resources = ARRAY_SIZE(sdhi0_resources), 135 - .resource = sdhi0_resources, 136 - .id = 0, 137 - .dev = { 138 - .platform_data = &sdhi0_platform_data, 139 - } 140 - }; 141 - 142 - /* Thermal */ 143 - static struct resource thermal_resources[] = { 144 - [0] = { 145 - .start = 0xFFC48000, 146 - .end = 0xFFC48038 - 1, 147 - .flags = IORESOURCE_MEM, 148 - }, 149 - }; 150 - 151 - static struct platform_device thermal_device = { 152 - .name = "rcar_thermal", 153 - .resource = thermal_resources, 154 - .num_resources = ARRAY_SIZE(thermal_resources), 155 - }; 156 - 157 - /* HSPI */ 158 - static struct resource hspi_resources[] = { 159 - [0] = { 160 - .start = 0xFFFC7000, 161 - .end = 0xFFFC7018 - 1, 162 - .flags = IORESOURCE_MEM, 163 - }, 164 - }; 165 - 166 - static struct platform_device hspi_device = { 167 - .name = "sh-hspi", 168 - .id = 0, 169 - .resource = hspi_resources, 170 - .num_resources = ARRAY_SIZE(hspi_resources), 171 - }; 172 - 173 - /* LEDS */ 174 - static struct gpio_led marzen_leds[] = { 175 - { 176 - .name = "led2", 177 - .gpio = RCAR_GP_PIN(4, 29), 178 - .default_state = LEDS_GPIO_DEFSTATE_ON, 179 - }, { 180 - .name = "led3", 181 - .gpio = RCAR_GP_PIN(4, 30), 182 - .default_state = LEDS_GPIO_DEFSTATE_ON, 183 - }, { 184 - .name = "led4", 185 - .gpio = RCAR_GP_PIN(4, 31), 186 - .default_state = LEDS_GPIO_DEFSTATE_ON, 187 - }, 188 - }; 189 - 190 - static struct gpio_led_platform_data marzen_leds_pdata = { 191 - .leds = marzen_leds, 192 - .num_leds = ARRAY_SIZE(marzen_leds), 193 - }; 194 - 195 - static struct platform_device leds_device = { 196 - .name = "leds-gpio", 197 - .id = 0, 198 - .dev = { 199 - .platform_data = &marzen_leds_pdata, 200 - }, 201 - }; 202 - 203 - /* VIN */ 204 - static struct rcar_vin_platform_data vin_platform_data __initdata = { 205 - .flags = RCAR_VIN_BT656, 206 - }; 207 - 208 - #define MARZEN_VIN(idx) \ 209 - static struct resource vin##idx##_resources[] __initdata = { \ 210 - DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \ 211 - DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \ 212 - }; \ 213 - \ 214 - static struct platform_device_info vin##idx##_info __initdata = { \ 215 - .name = "r8a7779-vin", \ 216 - .id = idx, \ 217 - .res = vin##idx##_resources, \ 218 - .num_res = ARRAY_SIZE(vin##idx##_resources), \ 219 - .dma_mask = DMA_BIT_MASK(32), \ 220 - .data = &vin_platform_data, \ 221 - .size_data = sizeof(vin_platform_data), \ 222 - } 223 - MARZEN_VIN(1); 224 - MARZEN_VIN(3); 225 - 226 - #define MARZEN_CAMERA(idx) \ 227 - static struct i2c_board_info camera##idx##_info = { \ 228 - I2C_BOARD_INFO("adv7180", 0x20 + (idx)), \ 229 - }; \ 230 - \ 231 - static struct soc_camera_link iclink##idx##_adv7180 = { \ 232 - .bus_id = 1 + 2 * (idx), \ 233 - .i2c_adapter_id = 0, \ 234 - .board_info = &camera##idx##_info, \ 235 - }; \ 236 - \ 237 - static struct platform_device camera##idx##_device = { \ 238 - .name = "soc-camera-pdrv", \ 239 - .id = idx, \ 240 - .dev = { \ 241 - .platform_data = &iclink##idx##_adv7180, \ 242 - }, \ 243 - }; 244 - 245 - MARZEN_CAMERA(0); 246 - MARZEN_CAMERA(1); 247 - 248 - static struct platform_device *marzen_devices[] __initdata = { 249 - &eth_device, 250 - &sdhi0_device, 251 - &thermal_device, 252 - &hspi_device, 253 - &leds_device, 254 - &usb_phy, 255 - &camera0_device, 256 - &camera1_device, 257 - }; 258 - 259 - static const struct pinctrl_map marzen_pinctrl_map[] = { 260 - /* DU (CN10: ARGB0, CN13: LVDS) */ 261 - PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", 262 - "du0_rgb888", "du0"), 263 - PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", 264 - "du0_sync_1", "du0"), 265 - PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", 266 - "du0_clk_out_0", "du0"), 267 - PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", 268 - "du1_rgb666", "du1"), 269 - PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", 270 - "du1_sync_1", "du1"), 271 - PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", 272 - "du1_clk_out", "du1"), 273 - /* HSPI0 */ 274 - PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7779", 275 - "hspi0", "hspi0"), 276 - /* SCIF2 (CN18: DEBUG0) */ 277 - PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-r8a7779", 278 - "scif2_data_c", "scif2"), 279 - /* SCIF4 (CN19: DEBUG1) */ 280 - PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-r8a7779", 281 - "scif4_data", "scif4"), 282 - /* SDHI0 */ 283 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", 284 - "sdhi0_data4", "sdhi0"), 285 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", 286 - "sdhi0_ctrl", "sdhi0"), 287 - PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779", 288 - "sdhi0_cd", "sdhi0"), 289 - /* SMSC */ 290 - PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779", 291 - "intc_irq1_b", "intc"), 292 - PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779", 293 - "lbsc_ex_cs0", "lbsc"), 294 - /* USB0 */ 295 - PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.0", "pfc-r8a7779", 296 - "usb0", "usb0"), 297 - /* USB1 */ 298 - PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.0", "pfc-r8a7779", 299 - "usb1", "usb1"), 300 - /* USB2 */ 301 - PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779", 302 - "usb2", "usb2"), 303 - /* VIN1 */ 304 - PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.1", "pfc-r8a7779", 305 - "vin1_clk", "vin1"), 306 - PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.1", "pfc-r8a7779", 307 - "vin1_data8", "vin1"), 308 - /* VIN3 */ 309 - PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.3", "pfc-r8a7779", 310 - "vin3_clk", "vin3"), 311 - PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.3", "pfc-r8a7779", 312 - "vin3_data8", "vin3"), 313 - }; 314 - 315 - static void __init marzen_init(void) 316 - { 317 - regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 318 - ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 319 - regulator_register_fixed(1, dummy_supplies, 320 - ARRAY_SIZE(dummy_supplies)); 321 - 322 - pinctrl_register_mappings(marzen_pinctrl_map, 323 - ARRAY_SIZE(marzen_pinctrl_map)); 324 - r8a7779_pinmux_init(); 325 - r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */ 326 - 327 - r8a7779_add_standard_devices(); 328 - platform_device_register_full(&vin1_info); 329 - platform_device_register_full(&vin3_info); 330 - platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 331 - } 332 - 333 - static const char *marzen_boards_compat_dt[] __initdata = { 334 - "renesas,marzen", 335 - NULL, 336 - }; 337 - 338 - DT_MACHINE_START(MARZEN, "marzen") 339 - .smp = smp_ops(r8a7779_smp_ops), 340 - .map_io = r8a7779_map_io, 341 - .init_early = r8a7779_add_early_devices, 342 - .init_irq = r8a7779_init_irq_dt, 343 - .init_machine = marzen_init, 344 - .init_late = r8a7779_init_late, 345 - .dt_compat = marzen_boards_compat_dt, 346 - .init_time = r8a7779_earlytimer_init, 347 - MACHINE_END
-675
arch/arm/mach-shmobile/clock-r8a7740.c
··· 1 - /* 2 - * R8A7740 processor support 3 - * 4 - * Copyright (C) 2011 Renesas Solutions Corp. 5 - * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.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 as published by 9 - * the Free Software Foundation; either version 2 of the License 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 - #include <linux/init.h> 17 - #include <linux/kernel.h> 18 - #include <linux/io.h> 19 - #include <linux/sh_clk.h> 20 - #include <linux/clkdev.h> 21 - 22 - #include "clock.h" 23 - #include "common.h" 24 - #include "r8a7740.h" 25 - 26 - /* 27 - * | MDx | XTAL1/EXTAL1 | System | EXTALR | 28 - * Clock |-------+-----------------+ clock | 32.768 | RCLK 29 - * Mode | 2/1/0 | src MHz | source | KHz | source 30 - * -------+-------+-----------------+-----------+--------+---------- 31 - * 0 | 0 0 0 | External 20~50 | XTAL1 | O | EXTALR 32 - * 1 | 0 0 1 | Crystal 20~30 | XTAL1 | O | EXTALR 33 - * 2 | 0 1 0 | External 40~50 | XTAL1 / 2 | O | EXTALR 34 - * 3 | 0 1 1 | Crystal 40~50 | XTAL1 / 2 | O | EXTALR 35 - * 4 | 1 0 0 | External 20~50 | XTAL1 | x | XTAL1 / 1024 36 - * 5 | 1 0 1 | Crystal 20~30 | XTAL1 | x | XTAL1 / 1024 37 - * 6 | 1 1 0 | External 40~50 | XTAL1 / 2 | x | XTAL1 / 2048 38 - * 7 | 1 1 1 | Crystal 40~50 | XTAL1 / 2 | x | XTAL1 / 2048 39 - */ 40 - 41 - /* CPG registers */ 42 - #define FRQCRA IOMEM(0xe6150000) 43 - #define FRQCRB IOMEM(0xe6150004) 44 - #define VCLKCR1 IOMEM(0xE6150008) 45 - #define VCLKCR2 IOMEM(0xE615000c) 46 - #define FRQCRC IOMEM(0xe61500e0) 47 - #define FSIACKCR IOMEM(0xe6150018) 48 - #define PLLC01CR IOMEM(0xe6150028) 49 - 50 - #define SUBCKCR IOMEM(0xe6150080) 51 - #define USBCKCR IOMEM(0xe615008c) 52 - 53 - #define MSTPSR0 IOMEM(0xe6150030) 54 - #define MSTPSR1 IOMEM(0xe6150038) 55 - #define MSTPSR2 IOMEM(0xe6150040) 56 - #define MSTPSR3 IOMEM(0xe6150048) 57 - #define MSTPSR4 IOMEM(0xe615004c) 58 - #define FSIBCKCR IOMEM(0xe6150090) 59 - #define HDMICKCR IOMEM(0xe6150094) 60 - #define SMSTPCR0 IOMEM(0xe6150130) 61 - #define SMSTPCR1 IOMEM(0xe6150134) 62 - #define SMSTPCR2 IOMEM(0xe6150138) 63 - #define SMSTPCR3 IOMEM(0xe615013c) 64 - #define SMSTPCR4 IOMEM(0xe6150140) 65 - 66 - #define FSIDIVA IOMEM(0xFE1F8000) 67 - #define FSIDIVB IOMEM(0xFE1F8008) 68 - 69 - /* Fixed 32 KHz root clock from EXTALR pin */ 70 - static struct clk extalr_clk = { 71 - .rate = 32768, 72 - }; 73 - 74 - /* 75 - * 25MHz default rate for the EXTAL1 root input clock. 76 - * If needed, reset this with clk_set_rate() from the platform code. 77 - */ 78 - static struct clk extal1_clk = { 79 - .rate = 25000000, 80 - }; 81 - 82 - /* 83 - * 48MHz default rate for the EXTAL2 root input clock. 84 - * If needed, reset this with clk_set_rate() from the platform code. 85 - */ 86 - static struct clk extal2_clk = { 87 - .rate = 48000000, 88 - }; 89 - 90 - /* 91 - * 27MHz default rate for the DV_CLKI root input clock. 92 - * If needed, reset this with clk_set_rate() from the platform code. 93 - */ 94 - static struct clk dv_clk = { 95 - .rate = 27000000, 96 - }; 97 - 98 - SH_CLK_RATIO(div2, 1, 2); 99 - SH_CLK_RATIO(div1k, 1, 1024); 100 - 101 - SH_FIXED_RATIO_CLK(extal1_div2_clk, extal1_clk, div2); 102 - SH_FIXED_RATIO_CLK(extal1_div1024_clk, extal1_clk, div1k); 103 - SH_FIXED_RATIO_CLK(extal1_div2048_clk, extal1_div2_clk, div1k); 104 - SH_FIXED_RATIO_CLK(extal2_div2_clk, extal2_clk, div2); 105 - 106 - static struct sh_clk_ops followparent_clk_ops = { 107 - .recalc = followparent_recalc, 108 - }; 109 - 110 - /* Main clock */ 111 - static struct clk system_clk = { 112 - .ops = &followparent_clk_ops, 113 - }; 114 - 115 - SH_FIXED_RATIO_CLK(system_div2_clk, system_clk, div2); 116 - 117 - /* r_clk */ 118 - static struct clk r_clk = { 119 - .ops = &followparent_clk_ops, 120 - }; 121 - 122 - /* PLLC0/PLLC1 */ 123 - static unsigned long pllc01_recalc(struct clk *clk) 124 - { 125 - unsigned long mult = 1; 126 - 127 - if (__raw_readl(PLLC01CR) & (1 << 14)) 128 - mult = ((__raw_readl(clk->enable_reg) >> 24) & 0x7f) + 1; 129 - 130 - return clk->parent->rate * mult; 131 - } 132 - 133 - static struct sh_clk_ops pllc01_clk_ops = { 134 - .recalc = pllc01_recalc, 135 - }; 136 - 137 - static struct clk pllc0_clk = { 138 - .ops = &pllc01_clk_ops, 139 - .flags = CLK_ENABLE_ON_INIT, 140 - .parent = &system_clk, 141 - .enable_reg = (void __iomem *)FRQCRC, 142 - }; 143 - 144 - static struct clk pllc1_clk = { 145 - .ops = &pllc01_clk_ops, 146 - .flags = CLK_ENABLE_ON_INIT, 147 - .parent = &system_div2_clk, 148 - .enable_reg = (void __iomem *)FRQCRA, 149 - }; 150 - 151 - /* PLLC1 / 2 */ 152 - SH_FIXED_RATIO_CLK(pllc1_div2_clk, pllc1_clk, div2); 153 - 154 - /* USB clock */ 155 - /* 156 - * USBCKCR is controlling usb24 clock 157 - * bit[7] : parent clock 158 - * bit[6] : clock divide rate 159 - * And this bit[7] is used as a "usb24s" from other devices. 160 - * (Video clock / Sub clock / SPU clock) 161 - * You can controll this clock as a below. 162 - * 163 - * struct clk *usb24 = clk_get(dev, "usb24"); 164 - * struct clk *usb24s = clk_get(NULL, "usb24s"); 165 - * struct clk *system = clk_get(NULL, "system_clk"); 166 - * int rate = clk_get_rate(system); 167 - * 168 - * clk_set_parent(usb24s, system); // for bit[7] 169 - * clk_set_rate(usb24, rate / 2); // for bit[6] 170 - */ 171 - static struct clk *usb24s_parents[] = { 172 - [0] = &system_clk, 173 - [1] = &extal2_clk 174 - }; 175 - 176 - static int usb24s_enable(struct clk *clk) 177 - { 178 - __raw_writel(__raw_readl(USBCKCR) & ~(1 << 8), USBCKCR); 179 - 180 - return 0; 181 - } 182 - 183 - static void usb24s_disable(struct clk *clk) 184 - { 185 - __raw_writel(__raw_readl(USBCKCR) | (1 << 8), USBCKCR); 186 - } 187 - 188 - static int usb24s_set_parent(struct clk *clk, struct clk *parent) 189 - { 190 - int i, ret; 191 - u32 val; 192 - 193 - if (!clk->parent_table || !clk->parent_num) 194 - return -EINVAL; 195 - 196 - /* Search the parent */ 197 - for (i = 0; i < clk->parent_num; i++) 198 - if (clk->parent_table[i] == parent) 199 - break; 200 - 201 - if (i == clk->parent_num) 202 - return -ENODEV; 203 - 204 - ret = clk_reparent(clk, parent); 205 - if (ret < 0) 206 - return ret; 207 - 208 - val = __raw_readl(USBCKCR); 209 - val &= ~(1 << 7); 210 - val |= i << 7; 211 - __raw_writel(val, USBCKCR); 212 - 213 - return 0; 214 - } 215 - 216 - static struct sh_clk_ops usb24s_clk_ops = { 217 - .recalc = followparent_recalc, 218 - .enable = usb24s_enable, 219 - .disable = usb24s_disable, 220 - .set_parent = usb24s_set_parent, 221 - }; 222 - 223 - static struct clk usb24s_clk = { 224 - .ops = &usb24s_clk_ops, 225 - .parent_table = usb24s_parents, 226 - .parent_num = ARRAY_SIZE(usb24s_parents), 227 - .parent = &system_clk, 228 - }; 229 - 230 - static unsigned long usb24_recalc(struct clk *clk) 231 - { 232 - return clk->parent->rate / 233 - ((__raw_readl(USBCKCR) & (1 << 6)) ? 1 : 2); 234 - }; 235 - 236 - static int usb24_set_rate(struct clk *clk, unsigned long rate) 237 - { 238 - u32 val; 239 - 240 - /* closer to which ? parent->rate or parent->rate/2 */ 241 - val = __raw_readl(USBCKCR); 242 - val &= ~(1 << 6); 243 - val |= (rate > (clk->parent->rate / 4) * 3) << 6; 244 - __raw_writel(val, USBCKCR); 245 - 246 - return 0; 247 - } 248 - 249 - static struct sh_clk_ops usb24_clk_ops = { 250 - .recalc = usb24_recalc, 251 - .set_rate = usb24_set_rate, 252 - }; 253 - 254 - static struct clk usb24_clk = { 255 - .ops = &usb24_clk_ops, 256 - .parent = &usb24s_clk, 257 - }; 258 - 259 - /* External FSIACK/FSIBCK clock */ 260 - static struct clk fsiack_clk = { 261 - }; 262 - 263 - static struct clk fsibck_clk = { 264 - }; 265 - 266 - static struct clk *main_clks[] = { 267 - &extalr_clk, 268 - &extal1_clk, 269 - &extal2_clk, 270 - &extal1_div2_clk, 271 - &extal1_div1024_clk, 272 - &extal1_div2048_clk, 273 - &extal2_div2_clk, 274 - &dv_clk, 275 - &system_clk, 276 - &system_div2_clk, 277 - &r_clk, 278 - &pllc0_clk, 279 - &pllc1_clk, 280 - &pllc1_div2_clk, 281 - &usb24s_clk, 282 - &usb24_clk, 283 - &fsiack_clk, 284 - &fsibck_clk, 285 - }; 286 - 287 - /* DIV4 clocks */ 288 - static void div4_kick(struct clk *clk) 289 - { 290 - unsigned long value; 291 - 292 - /* set KICK bit in FRQCRB to update hardware setting */ 293 - value = __raw_readl(FRQCRB); 294 - value |= (1 << 31); 295 - __raw_writel(value, FRQCRB); 296 - } 297 - 298 - static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 299 - 24, 32, 36, 48, 0, 72, 96, 0 }; 300 - 301 - static struct clk_div_mult_table div4_div_mult_table = { 302 - .divisors = divisors, 303 - .nr_divisors = ARRAY_SIZE(divisors), 304 - }; 305 - 306 - static struct clk_div4_table div4_table = { 307 - .div_mult_table = &div4_div_mult_table, 308 - .kick = div4_kick, 309 - }; 310 - 311 - enum { 312 - DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_HP, 313 - DIV4_HPP, DIV4_USBP, DIV4_S, DIV4_ZB, DIV4_M3, DIV4_CP, 314 - DIV4_NR 315 - }; 316 - 317 - static struct clk div4_clks[DIV4_NR] = { 318 - [DIV4_I] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 20, 0x6fff, CLK_ENABLE_ON_INIT), 319 - [DIV4_ZG] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 16, 0x6fff, CLK_ENABLE_ON_INIT), 320 - [DIV4_B] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 8, 0x6fff, CLK_ENABLE_ON_INIT), 321 - [DIV4_M1] = SH_CLK_DIV4(&pllc1_clk, FRQCRA, 4, 0x6fff, CLK_ENABLE_ON_INIT), 322 - [DIV4_HP] = SH_CLK_DIV4(&pllc1_clk, FRQCRB, 4, 0x6fff, 0), 323 - [DIV4_HPP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 20, 0x6fff, 0), 324 - [DIV4_USBP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 16, 0x6fff, 0), 325 - [DIV4_S] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 12, 0x6fff, 0), 326 - [DIV4_ZB] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 8, 0x6fff, 0), 327 - [DIV4_M3] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 4, 0x6fff, 0), 328 - [DIV4_CP] = SH_CLK_DIV4(&pllc1_clk, FRQCRC, 0, 0x6fff, 0), 329 - }; 330 - 331 - /* DIV6 reparent */ 332 - enum { 333 - DIV6_HDMI, 334 - DIV6_VCLK1, DIV6_VCLK2, 335 - DIV6_FSIA, DIV6_FSIB, 336 - DIV6_REPARENT_NR, 337 - }; 338 - 339 - static struct clk *hdmi_parent[] = { 340 - [0] = &pllc1_div2_clk, 341 - [1] = &system_clk, 342 - [2] = &dv_clk 343 - }; 344 - 345 - static struct clk *vclk_parents[8] = { 346 - [0] = &pllc1_div2_clk, 347 - [2] = &dv_clk, 348 - [3] = &usb24s_clk, 349 - [4] = &extal1_div2_clk, 350 - [5] = &extalr_clk, 351 - }; 352 - 353 - static struct clk *fsia_parents[] = { 354 - [0] = &pllc1_div2_clk, 355 - [1] = &fsiack_clk, /* external clock */ 356 - }; 357 - 358 - static struct clk *fsib_parents[] = { 359 - [0] = &pllc1_div2_clk, 360 - [1] = &fsibck_clk, /* external clock */ 361 - }; 362 - 363 - static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { 364 - [DIV6_HDMI] = SH_CLK_DIV6_EXT(HDMICKCR, 0, 365 - hdmi_parent, ARRAY_SIZE(hdmi_parent), 6, 2), 366 - [DIV6_VCLK1] = SH_CLK_DIV6_EXT(VCLKCR1, 0, 367 - vclk_parents, ARRAY_SIZE(vclk_parents), 12, 3), 368 - [DIV6_VCLK2] = SH_CLK_DIV6_EXT(VCLKCR2, 0, 369 - vclk_parents, ARRAY_SIZE(vclk_parents), 12, 3), 370 - [DIV6_FSIA] = SH_CLK_DIV6_EXT(FSIACKCR, 0, 371 - fsia_parents, ARRAY_SIZE(fsia_parents), 6, 2), 372 - [DIV6_FSIB] = SH_CLK_DIV6_EXT(FSIBCKCR, 0, 373 - fsib_parents, ARRAY_SIZE(fsib_parents), 6, 2), 374 - }; 375 - 376 - /* DIV6 clocks */ 377 - enum { 378 - DIV6_SUB, 379 - DIV6_NR 380 - }; 381 - 382 - static struct clk div6_clks[DIV6_NR] = { 383 - [DIV6_SUB] = SH_CLK_DIV6(&pllc1_div2_clk, SUBCKCR, 0), 384 - }; 385 - 386 - /* HDMI1/2 clock */ 387 - static unsigned long hdmi12_recalc(struct clk *clk) 388 - { 389 - u32 val = __raw_readl(HDMICKCR); 390 - int shift = (int)clk->priv; 391 - 392 - val >>= shift; 393 - val &= 0x3; 394 - 395 - return clk->parent->rate / (1 << val); 396 - }; 397 - 398 - static int hdmi12_set_rate(struct clk *clk, unsigned long rate) 399 - { 400 - u32 val, mask; 401 - int i, shift; 402 - 403 - for (i = 0; i < 3; i++) 404 - if (rate == clk->parent->rate / (1 << i)) 405 - goto find; 406 - return -ENODEV; 407 - 408 - find: 409 - shift = (int)clk->priv; 410 - 411 - val = __raw_readl(HDMICKCR); 412 - mask = ~(0x3 << shift); 413 - val = (val & mask) | i << shift; 414 - __raw_writel(val, HDMICKCR); 415 - 416 - return 0; 417 - }; 418 - 419 - static struct sh_clk_ops hdmi12_clk_ops = { 420 - .recalc = hdmi12_recalc, 421 - .set_rate = hdmi12_set_rate, 422 - }; 423 - 424 - static struct clk hdmi1_clk = { 425 - .ops = &hdmi12_clk_ops, 426 - .priv = (void *)9, 427 - .parent = &div6_reparent_clks[DIV6_HDMI], /* late install */ 428 - }; 429 - 430 - static struct clk hdmi2_clk = { 431 - .ops = &hdmi12_clk_ops, 432 - .priv = (void *)11, 433 - .parent = &div6_reparent_clks[DIV6_HDMI], /* late install */ 434 - }; 435 - 436 - static struct clk *late_main_clks[] = { 437 - &hdmi1_clk, 438 - &hdmi2_clk, 439 - }; 440 - 441 - /* FSI DIV */ 442 - enum { FSIDIV_A, FSIDIV_B, FSIDIV_REPARENT_NR }; 443 - 444 - static struct clk fsidivs[] = { 445 - [FSIDIV_A] = SH_CLK_FSIDIV(FSIDIVA, &div6_reparent_clks[DIV6_FSIA]), 446 - [FSIDIV_B] = SH_CLK_FSIDIV(FSIDIVB, &div6_reparent_clks[DIV6_FSIB]), 447 - }; 448 - 449 - /* MSTP */ 450 - enum { 451 - MSTP128, MSTP127, MSTP125, 452 - MSTP116, MSTP111, MSTP100, MSTP117, 453 - 454 - MSTP230, MSTP229, 455 - MSTP222, 456 - MSTP218, MSTP217, MSTP216, MSTP214, 457 - MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 458 - 459 - MSTP329, MSTP328, MSTP323, MSTP320, 460 - MSTP314, MSTP313, MSTP312, 461 - MSTP309, MSTP304, 462 - 463 - MSTP416, MSTP415, MSTP407, MSTP406, 464 - 465 - MSTP_NR 466 - }; 467 - 468 - static struct clk mstp_clks[MSTP_NR] = { 469 - [MSTP128] = SH_CLK_MSTP32(&div4_clks[DIV4_S], SMSTPCR1, 28, 0), /* CEU21 */ 470 - [MSTP127] = SH_CLK_MSTP32(&div4_clks[DIV4_S], SMSTPCR1, 27, 0), /* CEU20 */ 471 - [MSTP125] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ 472 - [MSTP117] = SH_CLK_MSTP32(&div4_clks[DIV4_B], SMSTPCR1, 17, 0), /* LCDC1 */ 473 - [MSTP116] = SH_CLK_MSTP32(&div4_clks[DIV4_HPP], SMSTPCR1, 16, 0), /* IIC0 */ 474 - [MSTP111] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR1, 11, 0), /* TMU1 */ 475 - [MSTP100] = SH_CLK_MSTP32(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ 476 - 477 - [MSTP230] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 30, 0), /* SCIFA6 */ 478 - [MSTP229] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 29, 0), /* INTCA */ 479 - [MSTP222] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 22, 0), /* SCIFA7 */ 480 - [MSTP218] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ 481 - [MSTP217] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ 482 - [MSTP216] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ 483 - [MSTP214] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */ 484 - [MSTP207] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ 485 - [MSTP206] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ 486 - [MSTP204] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ 487 - [MSTP203] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ 488 - [MSTP202] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ 489 - [MSTP201] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */ 490 - [MSTP200] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ 491 - 492 - [MSTP329] = SH_CLK_MSTP32(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ 493 - [MSTP328] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /* FSI */ 494 - [MSTP323] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */ 495 - [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 20, 0), /* USBF */ 496 - [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */ 497 - [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */ 498 - [MSTP312] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */ 499 - [MSTP309] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 9, 0), /* GEther */ 500 - [MSTP304] = SH_CLK_MSTP32(&div4_clks[DIV4_CP], SMSTPCR3, 4, 0), /* TPU0 */ 501 - 502 - [MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 16, 0), /* USBHOST */ 503 - [MSTP415] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */ 504 - [MSTP407] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 7, 0), /* USB-Func */ 505 - [MSTP406] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 6, 0), /* USB Phy */ 506 - }; 507 - 508 - static struct clk_lookup lookups[] = { 509 - /* main clocks */ 510 - CLKDEV_CON_ID("extalr", &extalr_clk), 511 - CLKDEV_CON_ID("extal1", &extal1_clk), 512 - CLKDEV_CON_ID("extal2", &extal2_clk), 513 - CLKDEV_CON_ID("extal1_div2", &extal1_div2_clk), 514 - CLKDEV_CON_ID("extal1_div1024", &extal1_div1024_clk), 515 - CLKDEV_CON_ID("extal1_div2048", &extal1_div2048_clk), 516 - CLKDEV_CON_ID("extal2_div2", &extal2_div2_clk), 517 - CLKDEV_CON_ID("dv_clk", &dv_clk), 518 - CLKDEV_CON_ID("system_clk", &system_clk), 519 - CLKDEV_CON_ID("system_div2_clk", &system_div2_clk), 520 - CLKDEV_CON_ID("r_clk", &r_clk), 521 - CLKDEV_CON_ID("pllc0_clk", &pllc0_clk), 522 - CLKDEV_CON_ID("pllc1_clk", &pllc1_clk), 523 - CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk), 524 - CLKDEV_CON_ID("usb24s", &usb24s_clk), 525 - CLKDEV_CON_ID("hdmi1", &hdmi1_clk), 526 - CLKDEV_CON_ID("hdmi2", &hdmi2_clk), 527 - CLKDEV_CON_ID("video1", &div6_reparent_clks[DIV6_VCLK1]), 528 - CLKDEV_CON_ID("video2", &div6_reparent_clks[DIV6_VCLK2]), 529 - CLKDEV_CON_ID("fsiack", &fsiack_clk), 530 - CLKDEV_CON_ID("fsibck", &fsibck_clk), 531 - 532 - /* DIV4 clocks */ 533 - CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]), 534 - CLKDEV_CON_ID("zg_clk", &div4_clks[DIV4_ZG]), 535 - CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]), 536 - CLKDEV_CON_ID("m1_clk", &div4_clks[DIV4_M1]), 537 - CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]), 538 - CLKDEV_CON_ID("hpp_clk", &div4_clks[DIV4_HPP]), 539 - CLKDEV_CON_ID("s_clk", &div4_clks[DIV4_S]), 540 - CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]), 541 - CLKDEV_CON_ID("m3_clk", &div4_clks[DIV4_M3]), 542 - CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]), 543 - 544 - /* DIV6 clocks */ 545 - CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]), 546 - 547 - /* MSTP32 clocks */ 548 - CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), 549 - CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), 550 - CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]), 551 - CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), 552 - CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), 553 - CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), 554 - 555 - CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), 556 - CLKDEV_DEV_ID("e6c80000.serial", &mstp_clks[MSTP200]), 557 - CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), 558 - CLKDEV_DEV_ID("e6c70000.serial", &mstp_clks[MSTP201]), 559 - CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), 560 - CLKDEV_DEV_ID("e6c60000.serial", &mstp_clks[MSTP202]), 561 - CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), 562 - CLKDEV_DEV_ID("e6c50000.serial", &mstp_clks[MSTP203]), 563 - CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), 564 - CLKDEV_DEV_ID("e6c40000.serial", &mstp_clks[MSTP204]), 565 - CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), 566 - CLKDEV_DEV_ID("e6c30000.serial", &mstp_clks[MSTP206]), 567 - CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), 568 - CLKDEV_DEV_ID("e6cb0000.serial", &mstp_clks[MSTP207]), 569 - CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), 570 - CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), 571 - CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), 572 - CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), 573 - CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP222]), 574 - CLKDEV_DEV_ID("e6cd0000.serial", &mstp_clks[MSTP222]), 575 - CLKDEV_DEV_ID("renesas_intc_irqpin.0", &mstp_clks[MSTP229]), 576 - CLKDEV_DEV_ID("renesas_intc_irqpin.1", &mstp_clks[MSTP229]), 577 - CLKDEV_DEV_ID("renesas_intc_irqpin.2", &mstp_clks[MSTP229]), 578 - CLKDEV_DEV_ID("renesas_intc_irqpin.3", &mstp_clks[MSTP229]), 579 - CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]), 580 - CLKDEV_DEV_ID("e6cc0000.serial", &mstp_clks[MSTP230]), 581 - 582 - CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), 583 - CLKDEV_DEV_ID("fe1f0000.sound", &mstp_clks[MSTP328]), 584 - CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), 585 - CLKDEV_DEV_ID("e6c20000.i2c", &mstp_clks[MSTP323]), 586 - CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP320]), 587 - CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), 588 - CLKDEV_DEV_ID("e6850000.sd", &mstp_clks[MSTP314]), 589 - CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), 590 - CLKDEV_DEV_ID("e6860000.sd", &mstp_clks[MSTP313]), 591 - CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]), 592 - CLKDEV_DEV_ID("e6bd0000.mmc", &mstp_clks[MSTP312]), 593 - CLKDEV_DEV_ID("r8a7740-gether", &mstp_clks[MSTP309]), 594 - CLKDEV_DEV_ID("e9a00000.ethernet", &mstp_clks[MSTP309]), 595 - CLKDEV_DEV_ID("renesas-tpu-pwm", &mstp_clks[MSTP304]), 596 - CLKDEV_DEV_ID("e6600000.pwm", &mstp_clks[MSTP304]), 597 - 598 - CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), 599 - CLKDEV_DEV_ID("e6870000.sd", &mstp_clks[MSTP415]), 600 - 601 - /* ICK */ 602 - CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP111]), 603 - CLKDEV_ICK_ID("fck", "fff90000.timer", &mstp_clks[MSTP111]), 604 - CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), 605 - CLKDEV_ICK_ID("fck", "fff80000.timer", &mstp_clks[MSTP125]), 606 - CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]), 607 - CLKDEV_ICK_ID("fck", "e6138000.timer", &mstp_clks[MSTP329]), 608 - CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]), 609 - CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]), 610 - CLKDEV_ICK_ID("phy", "renesas_usbhs", &mstp_clks[MSTP406]), 611 - CLKDEV_ICK_ID("pci", "renesas_usbhs", &div4_clks[DIV4_USBP]), 612 - CLKDEV_ICK_ID("usb24", "renesas_usbhs", &usb24_clk), 613 - CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]), 614 - 615 - CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]), 616 - CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]), 617 - CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]), 618 - CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]), 619 - CLKDEV_ICK_ID("xcka", "sh_fsi2", &fsiack_clk), 620 - CLKDEV_ICK_ID("xckb", "sh_fsi2", &fsibck_clk), 621 - }; 622 - 623 - void __init r8a7740_clock_init(u8 md_ck) 624 - { 625 - int k, ret = 0; 626 - 627 - /* detect system clock parent */ 628 - if (md_ck & MD_CK1) 629 - system_clk.parent = &extal1_div2_clk; 630 - else 631 - system_clk.parent = &extal1_clk; 632 - 633 - /* detect RCLK parent */ 634 - switch (md_ck & (MD_CK2 | MD_CK1)) { 635 - case MD_CK2 | MD_CK1: 636 - r_clk.parent = &extal1_div2048_clk; 637 - break; 638 - case MD_CK2: 639 - r_clk.parent = &extal1_div1024_clk; 640 - break; 641 - case MD_CK1: 642 - default: 643 - r_clk.parent = &extalr_clk; 644 - break; 645 - } 646 - 647 - for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 648 - ret = clk_register(main_clks[k]); 649 - 650 - if (!ret) 651 - ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 652 - 653 - if (!ret) 654 - ret = sh_clk_div6_register(div6_clks, DIV6_NR); 655 - 656 - if (!ret) 657 - ret = sh_clk_div6_reparent_register(div6_reparent_clks, 658 - DIV6_REPARENT_NR); 659 - 660 - if (!ret) 661 - ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 662 - 663 - for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++) 664 - ret = clk_register(late_main_clks[k]); 665 - 666 - if (!ret) 667 - ret = sh_clk_fsidiv_register(fsidivs, FSIDIV_REPARENT_NR); 668 - 669 - clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 670 - 671 - if (!ret) 672 - shmobile_clk_init(); 673 - else 674 - panic("failed to setup r8a7740 clocks\n"); 675 - }
-271
arch/arm/mach-shmobile/clock-r8a7779.c
··· 1 - /* 2 - * r8a7779 clock framework support 3 - * 4 - * Copyright (C) 2011 Renesas Solutions Corp. 5 - * Copyright (C) 2011 Magnus Damm 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 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 - #include <linux/bitops.h> 17 - #include <linux/init.h> 18 - #include <linux/kernel.h> 19 - #include <linux/io.h> 20 - #include <linux/sh_clk.h> 21 - #include <linux/clkdev.h> 22 - #include <linux/sh_timer.h> 23 - 24 - #include "clock.h" 25 - #include "common.h" 26 - #include "r8a7779.h" 27 - 28 - /* 29 - * MD1 = 1 MD1 = 0 30 - * (PLLA = 1500) (PLLA = 1600) 31 - * (MHz) (MHz) 32 - *------------------------------------------------+-------------------- 33 - * clkz 1000 (2/3) 800 (1/2) 34 - * clkzs 250 (1/6) 200 (1/8) 35 - * clki 750 (1/2) 800 (1/2) 36 - * clks 250 (1/6) 200 (1/8) 37 - * clks1 125 (1/12) 100 (1/16) 38 - * clks3 187.5 (1/8) 200 (1/8) 39 - * clks4 93.7 (1/16) 100 (1/16) 40 - * clkp 62.5 (1/24) 50 (1/32) 41 - * clkg 62.5 (1/24) 66.6 (1/24) 42 - * clkb, CLKOUT 43 - * (MD2 = 0) 62.5 (1/24) 66.6 (1/24) 44 - * (MD2 = 1) 41.6 (1/36) 50 (1/32) 45 - */ 46 - 47 - #define MD(nr) BIT(nr) 48 - 49 - #define MSTPCR0 IOMEM(0xffc80030) 50 - #define MSTPCR1 IOMEM(0xffc80034) 51 - #define MSTPCR3 IOMEM(0xffc8003c) 52 - #define MSTPSR1 IOMEM(0xffc80044) 53 - 54 - /* ioremap() through clock mapping mandatory to avoid 55 - * collision with ARM coherent DMA virtual memory range. 56 - */ 57 - 58 - static struct clk_mapping cpg_mapping = { 59 - .phys = 0xffc80000, 60 - .len = 0x80, 61 - }; 62 - 63 - /* 64 - * Default rate for the root input clock, reset this with clk_set_rate() 65 - * from the platform code. 66 - */ 67 - static struct clk plla_clk = { 68 - /* .rate will be updated on r8a7779_clock_init() */ 69 - .mapping = &cpg_mapping, 70 - }; 71 - 72 - /* 73 - * clock ratio of these clock will be updated 74 - * on r8a7779_clock_init() 75 - */ 76 - SH_FIXED_RATIO_CLK_SET(clkz_clk, plla_clk, 1, 1); 77 - SH_FIXED_RATIO_CLK_SET(clkzs_clk, plla_clk, 1, 1); 78 - SH_FIXED_RATIO_CLK_SET(clki_clk, plla_clk, 1, 1); 79 - SH_FIXED_RATIO_CLK_SET(clks_clk, plla_clk, 1, 1); 80 - SH_FIXED_RATIO_CLK_SET(clks1_clk, plla_clk, 1, 1); 81 - SH_FIXED_RATIO_CLK_SET(clks3_clk, plla_clk, 1, 1); 82 - SH_FIXED_RATIO_CLK_SET(clks4_clk, plla_clk, 1, 1); 83 - SH_FIXED_RATIO_CLK_SET(clkb_clk, plla_clk, 1, 1); 84 - SH_FIXED_RATIO_CLK_SET(clkout_clk, plla_clk, 1, 1); 85 - SH_FIXED_RATIO_CLK_SET(clkp_clk, plla_clk, 1, 1); 86 - SH_FIXED_RATIO_CLK_SET(clkg_clk, plla_clk, 1, 1); 87 - 88 - static struct clk *main_clks[] = { 89 - &plla_clk, 90 - &clkz_clk, 91 - &clkzs_clk, 92 - &clki_clk, 93 - &clks_clk, 94 - &clks1_clk, 95 - &clks3_clk, 96 - &clks4_clk, 97 - &clkb_clk, 98 - &clkout_clk, 99 - &clkp_clk, 100 - &clkg_clk, 101 - }; 102 - 103 - enum { MSTP323, MSTP322, MSTP321, MSTP320, 104 - MSTP120, 105 - MSTP116, MSTP115, MSTP114, 106 - MSTP110, MSTP109, MSTP108, 107 - MSTP103, MSTP101, MSTP100, 108 - MSTP030, 109 - MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, 110 - MSTP016, MSTP015, MSTP014, 111 - MSTP007, 112 - MSTP_NR }; 113 - 114 - static struct clk mstp_clks[MSTP_NR] = { 115 - [MSTP323] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 23, 0), /* SDHI0 */ 116 - [MSTP322] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 22, 0), /* SDHI1 */ 117 - [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */ 118 - [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */ 119 - [MSTP120] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 20, MSTPSR1, 0), /* VIN3 */ 120 - [MSTP116] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 16, MSTPSR1, 0), /* PCIe */ 121 - [MSTP115] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 15, MSTPSR1, 0), /* SATA */ 122 - [MSTP114] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 14, MSTPSR1, 0), /* Ether */ 123 - [MSTP110] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 10, MSTPSR1, 0), /* VIN0 */ 124 - [MSTP109] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 9, MSTPSR1, 0), /* VIN1 */ 125 - [MSTP108] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 8, MSTPSR1, 0), /* VIN2 */ 126 - [MSTP103] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 3, MSTPSR1, 0), /* DU */ 127 - [MSTP101] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 1, MSTPSR1, 0), /* USB2 */ 128 - [MSTP100] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 0, MSTPSR1, 0), /* USB0/1 */ 129 - [MSTP030] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 30, 0), /* I2C0 */ 130 - [MSTP029] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 29, 0), /* I2C1 */ 131 - [MSTP028] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 28, 0), /* I2C2 */ 132 - [MSTP027] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 27, 0), /* I2C3 */ 133 - [MSTP026] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 26, 0), /* SCIF0 */ 134 - [MSTP025] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 25, 0), /* SCIF1 */ 135 - [MSTP024] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 24, 0), /* SCIF2 */ 136 - [MSTP023] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 23, 0), /* SCIF3 */ 137 - [MSTP022] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 22, 0), /* SCIF4 */ 138 - [MSTP021] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 21, 0), /* SCIF5 */ 139 - [MSTP016] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 16, 0), /* TMU0 */ 140 - [MSTP015] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 15, 0), /* TMU1 */ 141 - [MSTP014] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 14, 0), /* TMU2 */ 142 - [MSTP007] = SH_CLK_MSTP32(&clks_clk, MSTPCR0, 7, 0), /* HSPI */ 143 - }; 144 - 145 - static struct clk_lookup lookups[] = { 146 - /* main clocks */ 147 - CLKDEV_CON_ID("plla_clk", &plla_clk), 148 - CLKDEV_CON_ID("clkz_clk", &clkz_clk), 149 - CLKDEV_CON_ID("clkzs_clk", &clkzs_clk), 150 - 151 - /* DIV4 clocks */ 152 - CLKDEV_CON_ID("shyway_clk", &clks_clk), 153 - CLKDEV_CON_ID("bus_clk", &clkout_clk), 154 - CLKDEV_CON_ID("shyway4_clk", &clks4_clk), 155 - CLKDEV_CON_ID("shyway3_clk", &clks3_clk), 156 - CLKDEV_CON_ID("shyway1_clk", &clks1_clk), 157 - CLKDEV_CON_ID("peripheral_clk", &clkp_clk), 158 - 159 - /* MSTP32 clocks */ 160 - CLKDEV_DEV_ID("r8a7779-vin.3", &mstp_clks[MSTP120]), /* VIN3 */ 161 - CLKDEV_DEV_ID("rcar-pcie", &mstp_clks[MSTP116]), /* PCIe */ 162 - CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */ 163 - CLKDEV_DEV_ID("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */ 164 - CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */ 165 - CLKDEV_DEV_ID("r8a7779-vin.0", &mstp_clks[MSTP110]), /* VIN0 */ 166 - CLKDEV_DEV_ID("r8a7779-vin.1", &mstp_clks[MSTP109]), /* VIN1 */ 167 - CLKDEV_DEV_ID("r8a7779-vin.2", &mstp_clks[MSTP108]), /* VIN2 */ 168 - CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */ 169 - CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */ 170 - CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 171 - CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ 172 - CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]), /* TMU0 */ 173 - CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ 174 - CLKDEV_DEV_ID("ffc70000.i2c", &mstp_clks[MSTP030]), /* I2C0 */ 175 - CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */ 176 - CLKDEV_DEV_ID("ffc71000.i2c", &mstp_clks[MSTP029]), /* I2C1 */ 177 - CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */ 178 - CLKDEV_DEV_ID("ffc72000.i2c", &mstp_clks[MSTP028]), /* I2C2 */ 179 - CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */ 180 - CLKDEV_DEV_ID("ffc73000.i2c", &mstp_clks[MSTP027]), /* I2C3 */ 181 - CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */ 182 - CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */ 183 - CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */ 184 - CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ 185 - CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ 186 - CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ 187 - CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ 188 - CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */ 189 - CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ 190 - CLKDEV_DEV_ID("fffc8000.spi", &mstp_clks[MSTP007]), /* HSPI1 */ 191 - CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */ 192 - CLKDEV_DEV_ID("fffc6000.spi", &mstp_clks[MSTP007]), /* HSPI2 */ 193 - CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */ 194 - CLKDEV_DEV_ID("ffe4c000.sd", &mstp_clks[MSTP323]), /* SDHI0 */ 195 - CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */ 196 - CLKDEV_DEV_ID("ffe4d000.sd", &mstp_clks[MSTP322]), /* SDHI1 */ 197 - CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */ 198 - CLKDEV_DEV_ID("ffe4e000.sd", &mstp_clks[MSTP321]), /* SDHI2 */ 199 - CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP320]), /* SDHI3 */ 200 - CLKDEV_DEV_ID("ffe4f000.sd", &mstp_clks[MSTP320]), /* SDHI3 */ 201 - CLKDEV_DEV_ID("rcar-du-r8a7779", &mstp_clks[MSTP103]), /* DU */ 202 - }; 203 - 204 - void __init r8a7779_clock_init(void) 205 - { 206 - u32 mode = r8a7779_read_mode_pins(); 207 - int k, ret = 0; 208 - 209 - if (mode & MD(1)) { 210 - plla_clk.rate = 1500000000; 211 - 212 - SH_CLK_SET_RATIO(&clkz_clk_ratio, 2, 3); 213 - SH_CLK_SET_RATIO(&clkzs_clk_ratio, 1, 6); 214 - SH_CLK_SET_RATIO(&clki_clk_ratio, 1, 2); 215 - SH_CLK_SET_RATIO(&clks_clk_ratio, 1, 6); 216 - SH_CLK_SET_RATIO(&clks1_clk_ratio, 1, 12); 217 - SH_CLK_SET_RATIO(&clks3_clk_ratio, 1, 8); 218 - SH_CLK_SET_RATIO(&clks4_clk_ratio, 1, 16); 219 - SH_CLK_SET_RATIO(&clkp_clk_ratio, 1, 24); 220 - SH_CLK_SET_RATIO(&clkg_clk_ratio, 1, 24); 221 - if (mode & MD(2)) { 222 - SH_CLK_SET_RATIO(&clkb_clk_ratio, 1, 36); 223 - SH_CLK_SET_RATIO(&clkout_clk_ratio, 1, 36); 224 - } else { 225 - SH_CLK_SET_RATIO(&clkb_clk_ratio, 1, 24); 226 - SH_CLK_SET_RATIO(&clkout_clk_ratio, 1, 24); 227 - } 228 - } else { 229 - plla_clk.rate = 1600000000; 230 - 231 - SH_CLK_SET_RATIO(&clkz_clk_ratio, 1, 2); 232 - SH_CLK_SET_RATIO(&clkzs_clk_ratio, 1, 8); 233 - SH_CLK_SET_RATIO(&clki_clk_ratio, 1, 2); 234 - SH_CLK_SET_RATIO(&clks_clk_ratio, 1, 8); 235 - SH_CLK_SET_RATIO(&clks1_clk_ratio, 1, 16); 236 - SH_CLK_SET_RATIO(&clks3_clk_ratio, 1, 8); 237 - SH_CLK_SET_RATIO(&clks4_clk_ratio, 1, 16); 238 - SH_CLK_SET_RATIO(&clkp_clk_ratio, 1, 32); 239 - SH_CLK_SET_RATIO(&clkg_clk_ratio, 1, 24); 240 - if (mode & MD(2)) { 241 - SH_CLK_SET_RATIO(&clkb_clk_ratio, 1, 32); 242 - SH_CLK_SET_RATIO(&clkout_clk_ratio, 1, 32); 243 - } else { 244 - SH_CLK_SET_RATIO(&clkb_clk_ratio, 1, 24); 245 - SH_CLK_SET_RATIO(&clkout_clk_ratio, 1, 24); 246 - } 247 - } 248 - 249 - for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 250 - ret = clk_register(main_clks[k]); 251 - 252 - if (!ret) 253 - ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 254 - 255 - clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 256 - 257 - if (!ret) 258 - shmobile_clk_init(); 259 - else 260 - panic("failed to setup r8a7779 clocks\n"); 261 - } 262 - 263 - /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 264 - void __init __weak r8a7779_register_twd(void) { } 265 - 266 - void __init r8a7779_earlytimer_init(void) 267 - { 268 - r8a7779_clock_init(); 269 - r8a7779_register_twd(); 270 - shmobile_earlytimer_init(); 271 - }
-752
arch/arm/mach-shmobile/clock-sh73a0.c
··· 1 - /* 2 - * sh73a0 clock framework support 3 - * 4 - * Copyright (C) 2010 Magnus Damm 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 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 - #include <linux/init.h> 16 - #include <linux/kernel.h> 17 - #include <linux/io.h> 18 - #include <linux/sh_clk.h> 19 - #include <linux/clkdev.h> 20 - #include <asm/processor.h> 21 - #include "clock.h" 22 - #include "common.h" 23 - 24 - #define FRQCRA IOMEM(0xe6150000) 25 - #define FRQCRB IOMEM(0xe6150004) 26 - #define FRQCRD IOMEM(0xe61500e4) 27 - #define VCLKCR1 IOMEM(0xe6150008) 28 - #define VCLKCR2 IOMEM(0xe615000C) 29 - #define VCLKCR3 IOMEM(0xe615001C) 30 - #define ZBCKCR IOMEM(0xe6150010) 31 - #define FLCKCR IOMEM(0xe6150014) 32 - #define SD0CKCR IOMEM(0xe6150074) 33 - #define SD1CKCR IOMEM(0xe6150078) 34 - #define SD2CKCR IOMEM(0xe615007C) 35 - #define FSIACKCR IOMEM(0xe6150018) 36 - #define FSIBCKCR IOMEM(0xe6150090) 37 - #define SUBCKCR IOMEM(0xe6150080) 38 - #define SPUACKCR IOMEM(0xe6150084) 39 - #define SPUVCKCR IOMEM(0xe6150094) 40 - #define MSUCKCR IOMEM(0xe6150088) 41 - #define HSICKCR IOMEM(0xe615008C) 42 - #define MFCK1CR IOMEM(0xe6150098) 43 - #define MFCK2CR IOMEM(0xe615009C) 44 - #define DSITCKCR IOMEM(0xe6150060) 45 - #define DSI0PCKCR IOMEM(0xe6150064) 46 - #define DSI1PCKCR IOMEM(0xe6150068) 47 - #define DSI0PHYCR 0xe615006C 48 - #define DSI1PHYCR 0xe6150070 49 - #define PLLECR IOMEM(0xe61500d0) 50 - #define PLL0CR IOMEM(0xe61500d8) 51 - #define PLL1CR IOMEM(0xe6150028) 52 - #define PLL2CR IOMEM(0xe615002c) 53 - #define PLL3CR IOMEM(0xe61500dc) 54 - #define SMSTPCR0 IOMEM(0xe6150130) 55 - #define SMSTPCR1 IOMEM(0xe6150134) 56 - #define SMSTPCR2 IOMEM(0xe6150138) 57 - #define SMSTPCR3 IOMEM(0xe615013c) 58 - #define SMSTPCR4 IOMEM(0xe6150140) 59 - #define SMSTPCR5 IOMEM(0xe6150144) 60 - #define CKSCR IOMEM(0xe61500c0) 61 - 62 - /* Fixed 32 KHz root clock from EXTALR pin */ 63 - static struct clk r_clk = { 64 - .rate = 32768, 65 - }; 66 - 67 - /* 68 - * 26MHz default rate for the EXTAL1 root input clock. 69 - * If needed, reset this with clk_set_rate() from the platform code. 70 - */ 71 - struct clk sh73a0_extal1_clk = { 72 - .rate = 26000000, 73 - }; 74 - 75 - /* 76 - * 48MHz default rate for the EXTAL2 root input clock. 77 - * If needed, reset this with clk_set_rate() from the platform code. 78 - */ 79 - struct clk sh73a0_extal2_clk = { 80 - .rate = 48000000, 81 - }; 82 - 83 - static struct sh_clk_ops main_clk_ops = { 84 - .recalc = followparent_recalc, 85 - }; 86 - 87 - /* Main clock */ 88 - static struct clk main_clk = { 89 - /* .parent wll be set on sh73a0_clock_init() */ 90 - .ops = &main_clk_ops, 91 - }; 92 - 93 - /* PLL0, PLL1, PLL2, PLL3 */ 94 - static unsigned long pll_recalc(struct clk *clk) 95 - { 96 - unsigned long mult = 1; 97 - 98 - if (__raw_readl(PLLECR) & (1 << clk->enable_bit)) { 99 - mult = (((__raw_readl(clk->enable_reg) >> 24) & 0x3f) + 1); 100 - /* handle CFG bit for PLL1 and PLL2 */ 101 - switch (clk->enable_bit) { 102 - case 1: 103 - case 2: 104 - if (__raw_readl(clk->enable_reg) & (1 << 20)) 105 - mult *= 2; 106 - } 107 - } 108 - 109 - return clk->parent->rate * mult; 110 - } 111 - 112 - static struct sh_clk_ops pll_clk_ops = { 113 - .recalc = pll_recalc, 114 - }; 115 - 116 - static struct clk pll0_clk = { 117 - .ops = &pll_clk_ops, 118 - .flags = CLK_ENABLE_ON_INIT, 119 - .parent = &main_clk, 120 - .enable_reg = (void __iomem *)PLL0CR, 121 - .enable_bit = 0, 122 - }; 123 - 124 - static struct clk pll1_clk = { 125 - .ops = &pll_clk_ops, 126 - .flags = CLK_ENABLE_ON_INIT, 127 - .parent = &main_clk, 128 - .enable_reg = (void __iomem *)PLL1CR, 129 - .enable_bit = 1, 130 - }; 131 - 132 - static struct clk pll2_clk = { 133 - .ops = &pll_clk_ops, 134 - .flags = CLK_ENABLE_ON_INIT, 135 - .parent = &main_clk, 136 - .enable_reg = (void __iomem *)PLL2CR, 137 - .enable_bit = 2, 138 - }; 139 - 140 - static struct clk pll3_clk = { 141 - .ops = &pll_clk_ops, 142 - .flags = CLK_ENABLE_ON_INIT, 143 - .parent = &main_clk, 144 - .enable_reg = (void __iomem *)PLL3CR, 145 - .enable_bit = 3, 146 - }; 147 - 148 - /* A fixed divide block */ 149 - SH_CLK_RATIO(div2, 1, 2); 150 - SH_CLK_RATIO(div7, 1, 7); 151 - SH_CLK_RATIO(div13, 1, 13); 152 - 153 - SH_FIXED_RATIO_CLK(extal1_div2_clk, sh73a0_extal1_clk, div2); 154 - SH_FIXED_RATIO_CLK(extal2_div2_clk, sh73a0_extal2_clk, div2); 155 - SH_FIXED_RATIO_CLK(main_div2_clk, main_clk, div2); 156 - SH_FIXED_RATIO_CLK(pll1_div2_clk, pll1_clk, div2); 157 - SH_FIXED_RATIO_CLK(pll1_div7_clk, pll1_clk, div7); 158 - SH_FIXED_RATIO_CLK(pll1_div13_clk, pll1_clk, div13); 159 - 160 - /* External input clock */ 161 - struct clk sh73a0_extcki_clk = { 162 - }; 163 - 164 - struct clk sh73a0_extalr_clk = { 165 - }; 166 - 167 - static struct clk *main_clks[] = { 168 - &r_clk, 169 - &sh73a0_extal1_clk, 170 - &sh73a0_extal2_clk, 171 - &extal1_div2_clk, 172 - &extal2_div2_clk, 173 - &main_clk, 174 - &main_div2_clk, 175 - &pll0_clk, 176 - &pll1_clk, 177 - &pll2_clk, 178 - &pll3_clk, 179 - &pll1_div2_clk, 180 - &pll1_div7_clk, 181 - &pll1_div13_clk, 182 - &sh73a0_extcki_clk, 183 - &sh73a0_extalr_clk, 184 - }; 185 - 186 - static int frqcr_kick(void) 187 - { 188 - int i; 189 - 190 - /* set KICK bit in FRQCRB to update hardware setting, check success */ 191 - __raw_writel(__raw_readl(FRQCRB) | (1 << 31), FRQCRB); 192 - for (i = 1000; i; i--) 193 - if (__raw_readl(FRQCRB) & (1 << 31)) 194 - cpu_relax(); 195 - else 196 - return i; 197 - 198 - return -ETIMEDOUT; 199 - } 200 - 201 - static void div4_kick(struct clk *clk) 202 - { 203 - frqcr_kick(); 204 - } 205 - 206 - static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 207 - 24, 0, 36, 48, 7 }; 208 - 209 - static struct clk_div_mult_table div4_div_mult_table = { 210 - .divisors = divisors, 211 - .nr_divisors = ARRAY_SIZE(divisors), 212 - }; 213 - 214 - static struct clk_div4_table div4_table = { 215 - .div_mult_table = &div4_div_mult_table, 216 - .kick = div4_kick, 217 - }; 218 - 219 - enum { DIV4_I, DIV4_ZG, DIV4_M3, DIV4_B, DIV4_M1, DIV4_M2, 220 - DIV4_Z, DIV4_ZX, DIV4_HP, DIV4_NR }; 221 - 222 - #define DIV4(_reg, _bit, _mask, _flags) \ 223 - SH_CLK_DIV4(&pll1_clk, _reg, _bit, _mask, _flags) 224 - 225 - static struct clk div4_clks[DIV4_NR] = { 226 - [DIV4_I] = DIV4(FRQCRA, 20, 0xdff, CLK_ENABLE_ON_INIT), 227 - /* 228 - * ZG clock is dividing PLL0 frequency to supply SGX. Make sure not to 229 - * exceed maximum frequencies of 201.5MHz for VDD_DVFS=1.175 and 230 - * 239.2MHz for VDD_DVFS=1.315V. 231 - */ 232 - [DIV4_ZG] = SH_CLK_DIV4(&pll0_clk, FRQCRA, 16, 0xd7f, CLK_ENABLE_ON_INIT), 233 - [DIV4_M3] = DIV4(FRQCRA, 12, 0x1dff, CLK_ENABLE_ON_INIT), 234 - [DIV4_B] = DIV4(FRQCRA, 8, 0xdff, CLK_ENABLE_ON_INIT), 235 - [DIV4_M1] = DIV4(FRQCRA, 4, 0x1dff, 0), 236 - [DIV4_M2] = DIV4(FRQCRA, 0, 0x1dff, 0), 237 - [DIV4_Z] = SH_CLK_DIV4(&pll0_clk, FRQCRB, 24, 0x97f, 0), 238 - [DIV4_ZX] = DIV4(FRQCRB, 12, 0xdff, 0), 239 - [DIV4_HP] = DIV4(FRQCRB, 4, 0xdff, 0), 240 - }; 241 - 242 - static unsigned long twd_recalc(struct clk *clk) 243 - { 244 - return clk_get_rate(clk->parent) / 4; 245 - } 246 - 247 - static struct sh_clk_ops twd_clk_ops = { 248 - .recalc = twd_recalc, 249 - }; 250 - 251 - static struct clk twd_clk = { 252 - .parent = &div4_clks[DIV4_Z], 253 - .ops = &twd_clk_ops, 254 - }; 255 - 256 - static struct sh_clk_ops zclk_ops, kicker_ops; 257 - static const struct sh_clk_ops *div4_clk_ops; 258 - 259 - static int zclk_set_rate(struct clk *clk, unsigned long rate) 260 - { 261 - int ret; 262 - 263 - if (!clk->parent || !__clk_get(clk->parent)) 264 - return -ENODEV; 265 - 266 - if (readl(FRQCRB) & (1 << 31)) 267 - return -EBUSY; 268 - 269 - if (rate == clk_get_rate(clk->parent)) { 270 - /* 1:1 - switch off divider */ 271 - __raw_writel(__raw_readl(FRQCRB) & ~(1 << 28), FRQCRB); 272 - /* nullify the divider to prepare for the next time */ 273 - ret = div4_clk_ops->set_rate(clk, rate / 2); 274 - if (!ret) 275 - ret = frqcr_kick(); 276 - if (ret > 0) 277 - ret = 0; 278 - } else { 279 - /* Enable the divider */ 280 - __raw_writel(__raw_readl(FRQCRB) | (1 << 28), FRQCRB); 281 - 282 - ret = frqcr_kick(); 283 - if (ret >= 0) 284 - /* 285 - * set the divider - call the DIV4 method, it will kick 286 - * FRQCRB too 287 - */ 288 - ret = div4_clk_ops->set_rate(clk, rate); 289 - if (ret < 0) 290 - goto esetrate; 291 - } 292 - 293 - esetrate: 294 - __clk_put(clk->parent); 295 - return ret; 296 - } 297 - 298 - static long zclk_round_rate(struct clk *clk, unsigned long rate) 299 - { 300 - unsigned long div_freq = div4_clk_ops->round_rate(clk, rate), 301 - parent_freq = clk_get_rate(clk->parent); 302 - 303 - if (rate > div_freq && abs(parent_freq - rate) < rate - div_freq) 304 - return parent_freq; 305 - 306 - return div_freq; 307 - } 308 - 309 - static unsigned long zclk_recalc(struct clk *clk) 310 - { 311 - /* 312 - * Must recalculate frequencies in case PLL0 has been changed, even if 313 - * the divisor is unused ATM! 314 - */ 315 - unsigned long div_freq = div4_clk_ops->recalc(clk); 316 - 317 - if (__raw_readl(FRQCRB) & (1 << 28)) 318 - return div_freq; 319 - 320 - return clk_get_rate(clk->parent); 321 - } 322 - 323 - static int kicker_set_rate(struct clk *clk, unsigned long rate) 324 - { 325 - if (__raw_readl(FRQCRB) & (1 << 31)) 326 - return -EBUSY; 327 - 328 - return div4_clk_ops->set_rate(clk, rate); 329 - } 330 - 331 - static void div4_clk_extend(void) 332 - { 333 - int i; 334 - 335 - div4_clk_ops = div4_clks[0].ops; 336 - 337 - /* Add a kicker-busy check before changing the rate */ 338 - kicker_ops = *div4_clk_ops; 339 - /* We extend the DIV4 clock with a 1:1 pass-through case */ 340 - zclk_ops = *div4_clk_ops; 341 - 342 - kicker_ops.set_rate = kicker_set_rate; 343 - zclk_ops.set_rate = zclk_set_rate; 344 - zclk_ops.round_rate = zclk_round_rate; 345 - zclk_ops.recalc = zclk_recalc; 346 - 347 - for (i = 0; i < DIV4_NR; i++) 348 - div4_clks[i].ops = i == DIV4_Z ? &zclk_ops : &kicker_ops; 349 - } 350 - 351 - enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_ZB1, 352 - DIV6_FLCTL, DIV6_SDHI0, DIV6_SDHI1, DIV6_SDHI2, 353 - DIV6_FSIA, DIV6_FSIB, DIV6_SUB, 354 - DIV6_SPUA, DIV6_SPUV, DIV6_MSU, 355 - DIV6_HSI, DIV6_MFG1, DIV6_MFG2, 356 - DIV6_DSIT, DIV6_DSI0P, DIV6_DSI1P, 357 - DIV6_NR }; 358 - 359 - static struct clk *vck_parent[8] = { 360 - [0] = &pll1_div2_clk, 361 - [1] = &pll2_clk, 362 - [2] = &sh73a0_extcki_clk, 363 - [3] = &sh73a0_extal2_clk, 364 - [4] = &main_div2_clk, 365 - [5] = &sh73a0_extalr_clk, 366 - [6] = &main_clk, 367 - }; 368 - 369 - static struct clk *pll_parent[4] = { 370 - [0] = &pll1_div2_clk, 371 - [1] = &pll2_clk, 372 - [2] = &pll1_div13_clk, 373 - }; 374 - 375 - static struct clk *hsi_parent[4] = { 376 - [0] = &pll1_div2_clk, 377 - [1] = &pll2_clk, 378 - [2] = &pll1_div7_clk, 379 - }; 380 - 381 - static struct clk *pll_extal2_parent[] = { 382 - [0] = &pll1_div2_clk, 383 - [1] = &pll2_clk, 384 - [2] = &sh73a0_extal2_clk, 385 - [3] = &sh73a0_extal2_clk, 386 - }; 387 - 388 - static struct clk *dsi_parent[8] = { 389 - [0] = &pll1_div2_clk, 390 - [1] = &pll2_clk, 391 - [2] = &main_clk, 392 - [3] = &sh73a0_extal2_clk, 393 - [4] = &sh73a0_extcki_clk, 394 - }; 395 - 396 - static struct clk div6_clks[DIV6_NR] = { 397 - [DIV6_VCK1] = SH_CLK_DIV6_EXT(VCLKCR1, 0, 398 - vck_parent, ARRAY_SIZE(vck_parent), 12, 3), 399 - [DIV6_VCK2] = SH_CLK_DIV6_EXT(VCLKCR2, 0, 400 - vck_parent, ARRAY_SIZE(vck_parent), 12, 3), 401 - [DIV6_VCK3] = SH_CLK_DIV6_EXT(VCLKCR3, 0, 402 - vck_parent, ARRAY_SIZE(vck_parent), 12, 3), 403 - [DIV6_ZB1] = SH_CLK_DIV6_EXT(ZBCKCR, CLK_ENABLE_ON_INIT, 404 - pll_parent, ARRAY_SIZE(pll_parent), 7, 1), 405 - [DIV6_FLCTL] = SH_CLK_DIV6_EXT(FLCKCR, 0, 406 - pll_parent, ARRAY_SIZE(pll_parent), 7, 1), 407 - [DIV6_SDHI0] = SH_CLK_DIV6_EXT(SD0CKCR, 0, 408 - pll_parent, ARRAY_SIZE(pll_parent), 6, 2), 409 - [DIV6_SDHI1] = SH_CLK_DIV6_EXT(SD1CKCR, 0, 410 - pll_parent, ARRAY_SIZE(pll_parent), 6, 2), 411 - [DIV6_SDHI2] = SH_CLK_DIV6_EXT(SD2CKCR, 0, 412 - pll_parent, ARRAY_SIZE(pll_parent), 6, 2), 413 - [DIV6_FSIA] = SH_CLK_DIV6_EXT(FSIACKCR, 0, 414 - pll_parent, ARRAY_SIZE(pll_parent), 6, 1), 415 - [DIV6_FSIB] = SH_CLK_DIV6_EXT(FSIBCKCR, 0, 416 - pll_parent, ARRAY_SIZE(pll_parent), 6, 1), 417 - [DIV6_SUB] = SH_CLK_DIV6_EXT(SUBCKCR, 0, 418 - pll_extal2_parent, ARRAY_SIZE(pll_extal2_parent), 6, 2), 419 - [DIV6_SPUA] = SH_CLK_DIV6_EXT(SPUACKCR, 0, 420 - pll_extal2_parent, ARRAY_SIZE(pll_extal2_parent), 6, 2), 421 - [DIV6_SPUV] = SH_CLK_DIV6_EXT(SPUVCKCR, 0, 422 - pll_extal2_parent, ARRAY_SIZE(pll_extal2_parent), 6, 2), 423 - [DIV6_MSU] = SH_CLK_DIV6_EXT(MSUCKCR, 0, 424 - pll_parent, ARRAY_SIZE(pll_parent), 7, 1), 425 - [DIV6_HSI] = SH_CLK_DIV6_EXT(HSICKCR, 0, 426 - hsi_parent, ARRAY_SIZE(hsi_parent), 6, 2), 427 - [DIV6_MFG1] = SH_CLK_DIV6_EXT(MFCK1CR, 0, 428 - pll_parent, ARRAY_SIZE(pll_parent), 7, 1), 429 - [DIV6_MFG2] = SH_CLK_DIV6_EXT(MFCK2CR, 0, 430 - pll_parent, ARRAY_SIZE(pll_parent), 7, 1), 431 - [DIV6_DSIT] = SH_CLK_DIV6_EXT(DSITCKCR, 0, 432 - pll_parent, ARRAY_SIZE(pll_parent), 7, 1), 433 - [DIV6_DSI0P] = SH_CLK_DIV6_EXT(DSI0PCKCR, 0, 434 - dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3), 435 - [DIV6_DSI1P] = SH_CLK_DIV6_EXT(DSI1PCKCR, 0, 436 - dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3), 437 - }; 438 - 439 - /* DSI DIV */ 440 - static unsigned long dsiphy_recalc(struct clk *clk) 441 - { 442 - u32 value; 443 - 444 - value = __raw_readl(clk->mapping->base); 445 - 446 - /* FIXME */ 447 - if (!(value & 0x000B8000)) 448 - return clk->parent->rate; 449 - 450 - value &= 0x3f; 451 - value += 1; 452 - 453 - if ((value < 12) || 454 - (value > 33)) { 455 - pr_err("DSIPHY has wrong value (%d)", value); 456 - return 0; 457 - } 458 - 459 - return clk->parent->rate / value; 460 - } 461 - 462 - static long dsiphy_round_rate(struct clk *clk, unsigned long rate) 463 - { 464 - return clk_rate_mult_range_round(clk, 12, 33, rate); 465 - } 466 - 467 - static void dsiphy_disable(struct clk *clk) 468 - { 469 - u32 value; 470 - 471 - value = __raw_readl(clk->mapping->base); 472 - value &= ~0x000B8000; 473 - 474 - __raw_writel(value , clk->mapping->base); 475 - } 476 - 477 - static int dsiphy_enable(struct clk *clk) 478 - { 479 - u32 value; 480 - int multi; 481 - 482 - value = __raw_readl(clk->mapping->base); 483 - multi = (value & 0x3f) + 1; 484 - 485 - if ((multi < 12) || (multi > 33)) 486 - return -EIO; 487 - 488 - __raw_writel(value | 0x000B8000, clk->mapping->base); 489 - 490 - return 0; 491 - } 492 - 493 - static int dsiphy_set_rate(struct clk *clk, unsigned long rate) 494 - { 495 - u32 value; 496 - int idx; 497 - 498 - idx = rate / clk->parent->rate; 499 - if ((idx < 12) || (idx > 33)) 500 - return -EINVAL; 501 - 502 - idx += -1; 503 - 504 - value = __raw_readl(clk->mapping->base); 505 - value = (value & ~0x3f) + idx; 506 - 507 - __raw_writel(value, clk->mapping->base); 508 - 509 - return 0; 510 - } 511 - 512 - static struct sh_clk_ops dsiphy_clk_ops = { 513 - .recalc = dsiphy_recalc, 514 - .round_rate = dsiphy_round_rate, 515 - .set_rate = dsiphy_set_rate, 516 - .enable = dsiphy_enable, 517 - .disable = dsiphy_disable, 518 - }; 519 - 520 - static struct clk_mapping dsi0phy_clk_mapping = { 521 - .phys = DSI0PHYCR, 522 - .len = 4, 523 - }; 524 - 525 - static struct clk_mapping dsi1phy_clk_mapping = { 526 - .phys = DSI1PHYCR, 527 - .len = 4, 528 - }; 529 - 530 - static struct clk dsi0phy_clk = { 531 - .ops = &dsiphy_clk_ops, 532 - .parent = &div6_clks[DIV6_DSI0P], /* late install */ 533 - .mapping = &dsi0phy_clk_mapping, 534 - }; 535 - 536 - static struct clk dsi1phy_clk = { 537 - .ops = &dsiphy_clk_ops, 538 - .parent = &div6_clks[DIV6_DSI1P], /* late install */ 539 - .mapping = &dsi1phy_clk_mapping, 540 - }; 541 - 542 - static struct clk *late_main_clks[] = { 543 - &dsi0phy_clk, 544 - &dsi1phy_clk, 545 - &twd_clk, 546 - }; 547 - 548 - enum { MSTP001, 549 - MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP112, MSTP100, 550 - MSTP219, MSTP218, MSTP217, 551 - MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 552 - MSTP331, MSTP329, MSTP328, MSTP325, MSTP323, MSTP322, 553 - MSTP314, MSTP313, MSTP312, MSTP311, 554 - MSTP304, MSTP303, MSTP302, MSTP301, MSTP300, 555 - MSTP411, MSTP410, MSTP403, 556 - MSTP508, 557 - MSTP_NR }; 558 - 559 - #define MSTP(_parent, _reg, _bit, _flags) \ 560 - SH_CLK_MSTP32(_parent, _reg, _bit, _flags) 561 - 562 - static struct clk mstp_clks[MSTP_NR] = { 563 - [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */ 564 - [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* CEU1 */ 565 - [MSTP128] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 28, 0), /* CSI2-RX1 */ 566 - [MSTP127] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 27, 0), /* CEU0 */ 567 - [MSTP126] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 26, 0), /* CSI2-RX0 */ 568 - [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ 569 - [MSTP118] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 18, 0), /* DSITX0 */ 570 - [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */ 571 - [MSTP112] = MSTP(&div4_clks[DIV4_ZG], SMSTPCR1, 12, 0), /* SGX */ 572 - [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ 573 - [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ 574 - [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* SY-DMAC */ 575 - [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* MP-DMAC */ 576 - [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ 577 - [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ 578 - [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ 579 - [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ 580 - [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ 581 - [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */ 582 - [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ 583 - [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */ 584 - [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ 585 - [MSTP328] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /*FSI*/ 586 - [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */ 587 - [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ 588 - [MSTP322] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 22, 0), /* USB */ 589 - [MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */ 590 - [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */ 591 - [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ 592 - [MSTP311] = MSTP(&div6_clks[DIV6_SDHI2], SMSTPCR3, 11, 0), /* SDHI2 */ 593 - [MSTP304] = MSTP(&main_div2_clk, SMSTPCR3, 4, 0), /* TPU0 */ 594 - [MSTP303] = MSTP(&main_div2_clk, SMSTPCR3, 3, 0), /* TPU1 */ 595 - [MSTP302] = MSTP(&main_div2_clk, SMSTPCR3, 2, 0), /* TPU2 */ 596 - [MSTP301] = MSTP(&main_div2_clk, SMSTPCR3, 1, 0), /* TPU3 */ 597 - [MSTP300] = MSTP(&main_div2_clk, SMSTPCR3, 0, 0), /* TPU4 */ 598 - [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ 599 - [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */ 600 - [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ 601 - [MSTP508] = MSTP(&div4_clks[DIV4_HP], SMSTPCR5, 8, 0), /* INTCA0 */ 602 - }; 603 - 604 - /* The lookups structure below includes duplicate entries for some clocks 605 - * with alternate names. 606 - * - The traditional name used when a device is initialised with platform data 607 - * - The name used when a device is initialised using device tree 608 - * The longer-term aim is to remove these duplicates, and indeed the 609 - * lookups table entirely, by describing clocks using device tree. 610 - */ 611 - static struct clk_lookup lookups[] = { 612 - /* main clocks */ 613 - CLKDEV_CON_ID("r_clk", &r_clk), 614 - CLKDEV_DEV_ID("smp_twd", &twd_clk), /* smp_twd */ 615 - 616 - /* DIV4 clocks */ 617 - CLKDEV_DEV_ID("cpu0", &div4_clks[DIV4_Z]), 618 - 619 - /* DIV6 clocks */ 620 - CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]), 621 - CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]), 622 - CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]), 623 - CLKDEV_CON_ID("sdhi0_clk", &div6_clks[DIV6_SDHI0]), 624 - CLKDEV_CON_ID("sdhi1_clk", &div6_clks[DIV6_SDHI1]), 625 - CLKDEV_CON_ID("sdhi2_clk", &div6_clks[DIV6_SDHI2]), 626 - 627 - /* MSTP32 clocks */ 628 - CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ 629 - CLKDEV_DEV_ID("e6824000.i2c", &mstp_clks[MSTP001]), /* I2C2 */ 630 - CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP129]), /* CEU1 */ 631 - CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */ 632 - CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */ 633 - CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2-RX0 */ 634 - CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */ 635 - CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ 636 - CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */ 637 - CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ 638 - CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ 639 - CLKDEV_DEV_ID("e6cd0000.serial", &mstp_clks[MSTP219]), /* SCIFA7 */ 640 - CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */ 641 - CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* MP-DMAC */ 642 - CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 643 - CLKDEV_DEV_ID("e6cb0000.serial", &mstp_clks[MSTP207]), /* SCIFA5 */ 644 - CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ 645 - CLKDEV_DEV_ID("e6c3000.serial", &mstp_clks[MSTP206]), /* SCIFB */ 646 - CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ 647 - CLKDEV_DEV_ID("e6c40000.serial", &mstp_clks[MSTP204]), /* SCIFA0 */ 648 - CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ 649 - CLKDEV_DEV_ID("e6c50000.serial", &mstp_clks[MSTP203]), /* SCIFA1 */ 650 - CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ 651 - CLKDEV_DEV_ID("e6c60000.serial", &mstp_clks[MSTP202]), /* SCIFA2 */ 652 - CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */ 653 - CLKDEV_DEV_ID("e6c70000.serial", &mstp_clks[MSTP201]), /* SCIFA3 */ 654 - CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ 655 - CLKDEV_DEV_ID("e6c80000.serial", &mstp_clks[MSTP200]), /* SCIFA4 */ 656 - CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ 657 - CLKDEV_DEV_ID("e6cc0000.serial", &mstp_clks[MSTP331]), /* SCIFA6 */ 658 - CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */ 659 - CLKDEV_DEV_ID("ec230000.sound", &mstp_clks[MSTP328]), /* FSI */ 660 - CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ 661 - CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ 662 - CLKDEV_DEV_ID("e6822000.i2c", &mstp_clks[MSTP323]), /* I2C1 */ 663 - CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP322]), /* USB */ 664 - CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ 665 - CLKDEV_DEV_ID("ee100000.sd", &mstp_clks[MSTP314]), /* SDHI0 */ 666 - CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ 667 - CLKDEV_DEV_ID("ee120000.sd", &mstp_clks[MSTP313]), /* SDHI1 */ 668 - CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ 669 - CLKDEV_DEV_ID("e6bd0000.mmc", &mstp_clks[MSTP312]), /* MMCIF0 */ 670 - CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */ 671 - CLKDEV_DEV_ID("ee140000.sd", &mstp_clks[MSTP311]), /* SDHI2 */ 672 - CLKDEV_DEV_ID("renesas-tpu-pwm.0", &mstp_clks[MSTP304]), /* TPU0 */ 673 - CLKDEV_DEV_ID("renesas-tpu-pwm.1", &mstp_clks[MSTP303]), /* TPU1 */ 674 - CLKDEV_DEV_ID("renesas-tpu-pwm.2", &mstp_clks[MSTP302]), /* TPU2 */ 675 - CLKDEV_DEV_ID("renesas-tpu-pwm.3", &mstp_clks[MSTP301]), /* TPU3 */ 676 - CLKDEV_DEV_ID("renesas-tpu-pwm.4", &mstp_clks[MSTP300]), /* TPU4 */ 677 - CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ 678 - CLKDEV_DEV_ID("e6826000.i2c", &mstp_clks[MSTP411]), /* I2C3 */ 679 - CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */ 680 - CLKDEV_DEV_ID("e6828000.i2c", &mstp_clks[MSTP410]), /* I2C4 */ 681 - CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ 682 - CLKDEV_DEV_ID("renesas_intc_irqpin.0", &mstp_clks[MSTP508]), /* INTCA0 */ 683 - CLKDEV_DEV_ID("e6900000.irqpin", &mstp_clks[MSTP508]), /* INTCA0 */ 684 - CLKDEV_DEV_ID("renesas_intc_irqpin.1", &mstp_clks[MSTP508]), /* INTCA0 */ 685 - CLKDEV_DEV_ID("e6900004.irqpin", &mstp_clks[MSTP508]), /* INTCA0 */ 686 - CLKDEV_DEV_ID("renesas_intc_irqpin.2", &mstp_clks[MSTP508]), /* INTCA0 */ 687 - CLKDEV_DEV_ID("e6900008.irqpin", &mstp_clks[MSTP508]), /* INTCA0 */ 688 - CLKDEV_DEV_ID("renesas_intc_irqpin.3", &mstp_clks[MSTP508]), /* INTCA0 */ 689 - CLKDEV_DEV_ID("e690000c.irqpin", &mstp_clks[MSTP508]), /* INTCA0 */ 690 - 691 - /* ICK */ 692 - CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), 693 - CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), 694 - CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), 695 - CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), 696 - CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk), 697 - CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk), 698 - CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]), /* CMT1 */ 699 - CLKDEV_ICK_ID("fck", "e6138000.timer", &mstp_clks[MSTP329]), /* CMT1 */ 700 - CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), /* TMU0 */ 701 - }; 702 - 703 - void __init sh73a0_clock_init(void) 704 - { 705 - int k, ret = 0; 706 - 707 - /* Set SDHI clocks to a known state */ 708 - __raw_writel(0x108, SD0CKCR); 709 - __raw_writel(0x108, SD1CKCR); 710 - __raw_writel(0x108, SD2CKCR); 711 - 712 - /* detect main clock parent */ 713 - switch ((__raw_readl(CKSCR) >> 28) & 0x03) { 714 - case 0: 715 - main_clk.parent = &sh73a0_extal1_clk; 716 - break; 717 - case 1: 718 - main_clk.parent = &extal1_div2_clk; 719 - break; 720 - case 2: 721 - main_clk.parent = &sh73a0_extal2_clk; 722 - break; 723 - case 3: 724 - main_clk.parent = &extal2_div2_clk; 725 - break; 726 - } 727 - 728 - for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 729 - ret = clk_register(main_clks[k]); 730 - 731 - if (!ret) { 732 - ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 733 - if (!ret) 734 - div4_clk_extend(); 735 - } 736 - 737 - if (!ret) 738 - ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR); 739 - 740 - if (!ret) 741 - ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 742 - 743 - for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++) 744 - ret = clk_register(late_main_clks[k]); 745 - 746 - clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 747 - 748 - if (!ret) 749 - shmobile_clk_init(); 750 - else 751 - panic("failed to setup sh73a0 clocks\n"); 752 - }
-84
arch/arm/mach-shmobile/dma-register.h
··· 1 - /* 2 - * SH-ARM CPU-specific DMA definitions, used by both DMA drivers 3 - * 4 - * Copyright (C) 2012 Renesas Solutions Corp 5 - * 6 - * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 7 - * 8 - * Based on arch/sh/include/cpu-sh4/cpu/dma-register.h 9 - * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> 10 - * 11 - * This program is free software; you can redistribute it and/or modify 12 - * it under the terms of the GNU General Public License version 2 as 13 - * published by the Free Software Foundation. 14 - */ 15 - 16 - #ifndef DMA_REGISTER_H 17 - #define DMA_REGISTER_H 18 - 19 - /* 20 - * Direct Memory Access Controller 21 - */ 22 - 23 - /* Transmit sizes and respective CHCR register values */ 24 - enum { 25 - XMIT_SZ_8BIT = 0, 26 - XMIT_SZ_16BIT = 1, 27 - XMIT_SZ_32BIT = 2, 28 - XMIT_SZ_64BIT = 7, 29 - XMIT_SZ_128BIT = 3, 30 - XMIT_SZ_256BIT = 4, 31 - XMIT_SZ_512BIT = 5, 32 - }; 33 - 34 - /* log2(size / 8) - used to calculate number of transfers */ 35 - static const unsigned int dma_ts_shift[] = { 36 - [XMIT_SZ_8BIT] = 0, 37 - [XMIT_SZ_16BIT] = 1, 38 - [XMIT_SZ_32BIT] = 2, 39 - [XMIT_SZ_64BIT] = 3, 40 - [XMIT_SZ_128BIT] = 4, 41 - [XMIT_SZ_256BIT] = 5, 42 - [XMIT_SZ_512BIT] = 6, 43 - }; 44 - 45 - #define TS_LOW_BIT 0x3 /* --xx */ 46 - #define TS_HI_BIT 0xc /* xx-- */ 47 - 48 - #define TS_LOW_SHIFT (3) 49 - #define TS_HI_SHIFT (20 - 2) /* 2 bits for shifted low TS */ 50 - 51 - #define TS_INDEX2VAL(i) \ 52 - ((((i) & TS_LOW_BIT) << TS_LOW_SHIFT) |\ 53 - (((i) & TS_HI_BIT) << TS_HI_SHIFT)) 54 - 55 - #define CHCR_TX(xmit_sz) (DM_FIX | SM_INC | RS_ERS | TS_INDEX2VAL((xmit_sz))) 56 - #define CHCR_RX(xmit_sz) (DM_INC | SM_FIX | RS_ERS | TS_INDEX2VAL((xmit_sz))) 57 - 58 - 59 - /* 60 - * USB High-Speed DMAC 61 - */ 62 - /* Transmit sizes and respective CHCR register values */ 63 - enum { 64 - USBTS_XMIT_SZ_8BYTE = 0, 65 - USBTS_XMIT_SZ_16BYTE = 1, 66 - USBTS_XMIT_SZ_32BYTE = 2, 67 - }; 68 - 69 - /* log2(size / 8) - used to calculate number of transfers */ 70 - static const unsigned int dma_usbts_shift[] = { 71 - [USBTS_XMIT_SZ_8BYTE] = 3, 72 - [USBTS_XMIT_SZ_16BYTE] = 4, 73 - [USBTS_XMIT_SZ_32BYTE] = 5, 74 - }; 75 - 76 - #define USBTS_LOW_BIT 0x3 /* --xx */ 77 - #define USBTS_HI_BIT 0x0 /* ---- */ 78 - 79 - #define USBTS_LOW_SHIFT 6 80 - #define USBTS_HI_SHIFT 0 81 - 82 - #define USBTS_INDEX2VAL(i) (((i) & 3) << 6) 83 - 84 - #endif /* DMA_REGISTER_H */
-410
arch/arm/mach-shmobile/include/mach/head-kzm9g.txt
··· 1 - LIST "KZM9G low-level initialization routine." 2 - LIST "Adapted from u-boot KZM9G support code." 3 - 4 - LIST "Copyright (C) 2013 Ulrich Hecht" 5 - 6 - LIST "This program is free software; you can redistribute it and/or modify" 7 - LIST "it under the terms of the GNU General Public License version 2 as" 8 - LIST "published by the Free Software Foundation." 9 - 10 - LIST "This program is distributed in the hope that it will be useful," 11 - LIST "but WITHOUT ANY WARRANTY; without even the implied warranty of" 12 - LIST "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" 13 - LIST "GNU General Public License for more details." 14 - 15 - 16 - LIST "Register definitions:" 17 - 18 - LIST "Secure control register" 19 - #define LIFEC_SEC_SRC (0xE6110008) 20 - 21 - LIST "RWDT" 22 - #define RWDT_BASE (0xE6020000) 23 - #define RWTCSRA0 (RWDT_BASE + 0x04) 24 - 25 - LIST "HPB Semaphore Control Registers" 26 - #define HPBSCR_BASE (0xE6000000) 27 - #define HPBCTRL6 (HPBSCR_BASE + 0x1030) 28 - 29 - #define SBSC1_BASE (0xFE400000) 30 - #define SDCR0A (SBSC1_BASE + 0x0008) 31 - #define SDCR1A (SBSC1_BASE + 0x000C) 32 - #define SDPCRA (SBSC1_BASE + 0x0010) 33 - #define SDCR0SA (SBSC1_BASE + 0x0018) 34 - #define SDCR1SA (SBSC1_BASE + 0x001C) 35 - #define RTCSRA (SBSC1_BASE + 0x0020) 36 - #define RTCORA (SBSC1_BASE + 0x0028) 37 - #define RTCORHA (SBSC1_BASE + 0x002C) 38 - #define SDWCRC0A (SBSC1_BASE + 0x0040) 39 - #define SDWCRC1A (SBSC1_BASE + 0x0044) 40 - #define SDWCR00A (SBSC1_BASE + 0x0048) 41 - #define SDWCR01A (SBSC1_BASE + 0x004C) 42 - #define SDWCR10A (SBSC1_BASE + 0x0050) 43 - #define SDWCR11A (SBSC1_BASE + 0x0054) 44 - #define SDWCR2A (SBSC1_BASE + 0x0060) 45 - #define SDWCRC2A (SBSC1_BASE + 0x0064) 46 - #define ZQCCRA (SBSC1_BASE + 0x0068) 47 - #define SDMRACR0A (SBSC1_BASE + 0x0084) 48 - #define SDMRTMPCRA (SBSC1_BASE + 0x008C) 49 - #define SDMRTMPMSKA (SBSC1_BASE + 0x0094) 50 - #define SDGENCNTA (SBSC1_BASE + 0x009C) 51 - #define SDDRVCR0A (SBSC1_BASE + 0x00B4) 52 - #define DLLCNT0A (SBSC1_BASE + 0x0354) 53 - 54 - #define SDMRA1 (0xFE500000) 55 - #define SDMRA2 (0xFE5C0000) 56 - #define SDMRA3 (0xFE504000) 57 - 58 - #define SBSC2_BASE (0xFB400000) 59 - #define SDCR0B (SBSC2_BASE + 0x0008) 60 - #define SDCR1B (SBSC2_BASE + 0x000C) 61 - #define SDPCRB (SBSC2_BASE + 0x0010) 62 - #define SDCR0SB (SBSC2_BASE + 0x0018) 63 - #define SDCR1SB (SBSC2_BASE + 0x001C) 64 - #define RTCSRB (SBSC2_BASE + 0x0020) 65 - #define RTCORB (SBSC2_BASE + 0x0028) 66 - #define RTCORHB (SBSC2_BASE + 0x002C) 67 - #define SDWCRC0B (SBSC2_BASE + 0x0040) 68 - #define SDWCRC1B (SBSC2_BASE + 0x0044) 69 - #define SDWCR00B (SBSC2_BASE + 0x0048) 70 - #define SDWCR01B (SBSC2_BASE + 0x004C) 71 - #define SDWCR10B (SBSC2_BASE + 0x0050) 72 - #define SDWCR11B (SBSC2_BASE + 0x0054) 73 - #define SDPDCR0B (SBSC2_BASE + 0x0058) 74 - #define SDWCR2B (SBSC2_BASE + 0x0060) 75 - #define SDWCRC2B (SBSC2_BASE + 0x0064) 76 - #define ZQCCRB (SBSC2_BASE + 0x0068) 77 - #define SDMRACR0B (SBSC2_BASE + 0x0084) 78 - #define SDMRTMPCRB (SBSC2_BASE + 0x008C) 79 - #define SDMRTMPMSKB (SBSC2_BASE + 0x0094) 80 - #define SDGENCNTB (SBSC2_BASE + 0x009C) 81 - #define DPHYCNT0B (SBSC2_BASE + 0x00A0) 82 - #define DPHYCNT1B (SBSC2_BASE + 0x00A4) 83 - #define DPHYCNT2B (SBSC2_BASE + 0x00A8) 84 - #define SDDRVCR0B (SBSC2_BASE + 0x00B4) 85 - #define DLLCNT0B (SBSC2_BASE + 0x0354) 86 - 87 - #define SDMRB1 (0xFB500000) 88 - #define SDMRB2 (0xFB5C0000) 89 - #define SDMRB3 (0xFB504000) 90 - 91 - #define CPG_BASE (0xE6150000) 92 - #define FRQCRA (CPG_BASE + 0x0000) 93 - #define FRQCRB (CPG_BASE + 0x0004) 94 - #define FRQCRD (CPG_BASE + 0x00E4) 95 - #define VCLKCR1 (CPG_BASE + 0x0008) 96 - #define VCLKCR2 (CPG_BASE + 0x000C) 97 - #define VCLKCR3 (CPG_BASE + 0x001C) 98 - #define ZBCKCR (CPG_BASE + 0x0010) 99 - #define FLCKCR (CPG_BASE + 0x0014) 100 - #define SD0CKCR (CPG_BASE + 0x0074) 101 - #define SD1CKCR (CPG_BASE + 0x0078) 102 - #define SD2CKCR (CPG_BASE + 0x007C) 103 - #define FSIACKCR (CPG_BASE + 0x0018) 104 - #define SUBCKCR (CPG_BASE + 0x0080) 105 - #define SPUACKCR (CPG_BASE + 0x0084) 106 - #define SPUVCKCR (CPG_BASE + 0x0094) 107 - #define MSUCKCR (CPG_BASE + 0x0088) 108 - #define HSICKCR (CPG_BASE + 0x008C) 109 - #define FSIBCKCR (CPG_BASE + 0x0090) 110 - #define MFCK1CR (CPG_BASE + 0x0098) 111 - #define MFCK2CR (CPG_BASE + 0x009C) 112 - #define DSITCKCR (CPG_BASE + 0x0060) 113 - #define DSI0PCKCR (CPG_BASE + 0x0064) 114 - #define DSI1PCKCR (CPG_BASE + 0x0068) 115 - #define DSI0PHYCR (CPG_BASE + 0x006C) 116 - #define DVFSCR3 (CPG_BASE + 0x0174) 117 - #define DVFSCR4 (CPG_BASE + 0x0178) 118 - #define DVFSCR5 (CPG_BASE + 0x017C) 119 - #define MPMODE (CPG_BASE + 0x00CC) 120 - 121 - #define PLLECR (CPG_BASE + 0x00D0) 122 - #define PLL0CR (CPG_BASE + 0x00D8) 123 - #define PLL1CR (CPG_BASE + 0x0028) 124 - #define PLL2CR (CPG_BASE + 0x002C) 125 - #define PLL3CR (CPG_BASE + 0x00DC) 126 - #define PLL0STPCR (CPG_BASE + 0x00F0) 127 - #define PLL1STPCR (CPG_BASE + 0x00C8) 128 - #define PLL2STPCR (CPG_BASE + 0x00F8) 129 - #define PLL3STPCR (CPG_BASE + 0x00FC) 130 - #define RMSTPCR0 (CPG_BASE + 0x0110) 131 - #define RMSTPCR1 (CPG_BASE + 0x0114) 132 - #define RMSTPCR2 (CPG_BASE + 0x0118) 133 - #define RMSTPCR3 (CPG_BASE + 0x011C) 134 - #define RMSTPCR4 (CPG_BASE + 0x0120) 135 - #define RMSTPCR5 (CPG_BASE + 0x0124) 136 - #define SMSTPCR0 (CPG_BASE + 0x0130) 137 - #define SMSTPCR2 (CPG_BASE + 0x0138) 138 - #define SMSTPCR3 (CPG_BASE + 0x013C) 139 - #define CPGXXCR4 (CPG_BASE + 0x0150) 140 - #define SRCR0 (CPG_BASE + 0x80A0) 141 - #define SRCR2 (CPG_BASE + 0x80B0) 142 - #define SRCR3 (CPG_BASE + 0x80A8) 143 - #define VREFCR (CPG_BASE + 0x00EC) 144 - #define PCLKCR (CPG_BASE + 0x1020) 145 - 146 - #define PORT32CR (0xE6051020) 147 - #define PORT33CR (0xE6051021) 148 - #define PORT34CR (0xE6051022) 149 - #define PORT35CR (0xE6051023) 150 - 151 - LIST "DRAM initialization code:" 152 - 153 - EW RWTCSRA0, 0xA507 154 - 155 - ED_AND LIFEC_SEC_SRC, 0xFFFF7FFF 156 - 157 - ED_AND SMSTPCR3,0xFFFF7FFF 158 - ED_AND SRCR3, 0xFFFF7FFF 159 - ED_AND SMSTPCR2,0xFFFBFFFF 160 - ED_AND SRCR2, 0xFFFBFFFF 161 - ED PLLECR, 0x00000000 162 - 163 - WAIT_MASK PLLECR, 0x00000F00, 0x00000000 164 - WAIT_MASK FRQCRB, 0x80000000, 0x00000000 165 - 166 - ED PLL0CR, 0x2D000000 167 - ED PLL1CR, 0x17100000 168 - ED FRQCRB, 0x96235880 169 - WAIT_MASK FRQCRB, 0x80000000, 0x00000000 170 - 171 - ED FLCKCR, 0x0000000B 172 - ED_AND SMSTPCR0, 0xFFFFFFFD 173 - 174 - ED_AND SRCR0, 0xFFFFFFFD 175 - ED 0xE6001628, 0x514 176 - ED 0xE6001648, 0x514 177 - ED 0xE6001658, 0x514 178 - ED 0xE6001678, 0x514 179 - 180 - ED DVFSCR4, 0x00092000 181 - ED DVFSCR5, 0x000000DC 182 - ED PLLECR, 0x00000000 183 - WAIT_MASK PLLECR, 0x00000F00, 0x00000000 184 - 185 - ED FRQCRA, 0x0012453C 186 - ED FRQCRB, 0x80431350 187 - WAIT_MASK FRQCRB, 0x80000000, 0x00000000 188 - ED FRQCRD, 0x00000B0B 189 - WAIT_MASK FRQCRD, 0x80000000, 0x00000000 190 - 191 - ED PCLKCR, 0x00000003 192 - ED VCLKCR1, 0x0000012F 193 - ED VCLKCR2, 0x00000119 194 - ED VCLKCR3, 0x00000119 195 - ED ZBCKCR, 0x00000002 196 - ED FLCKCR, 0x00000005 197 - ED SD0CKCR, 0x00000080 198 - ED SD1CKCR, 0x00000080 199 - ED SD2CKCR, 0x00000080 200 - ED FSIACKCR, 0x0000003F 201 - ED FSIBCKCR, 0x0000003F 202 - ED SUBCKCR, 0x00000080 203 - ED SPUACKCR, 0x0000000B 204 - ED SPUVCKCR, 0x0000000B 205 - ED MSUCKCR, 0x0000013F 206 - ED HSICKCR, 0x00000080 207 - ED MFCK1CR, 0x0000003F 208 - ED MFCK2CR, 0x0000003F 209 - ED DSITCKCR, 0x00000107 210 - ED DSI0PCKCR, 0x00000313 211 - ED DSI1PCKCR, 0x0000130D 212 - ED DSI0PHYCR, 0x2A800E0E 213 - ED PLL0CR, 0x1E000000 214 - ED PLL0CR, 0x2D000000 215 - ED PLL1CR, 0x17100000 216 - ED PLL2CR, 0x27000080 217 - ED PLL3CR, 0x1D000000 218 - ED PLL0STPCR, 0x00080000 219 - ED PLL1STPCR, 0x000120C0 220 - ED PLL2STPCR, 0x00012000 221 - ED PLL3STPCR, 0x00000030 222 - ED PLLECR, 0x0000000B 223 - WAIT_MASK PLLECR, 0x00000B00, 0x00000B00 224 - 225 - ED DVFSCR3, 0x000120F0 226 - ED MPMODE, 0x00000020 227 - ED VREFCR, 0x0000028A 228 - ED RMSTPCR0, 0xE4628087 229 - ED RMSTPCR1, 0xFFFFFFFF 230 - ED RMSTPCR2, 0x53FFFFFF 231 - ED RMSTPCR3, 0xFFFFFFFF 232 - ED RMSTPCR4, 0x00800D3D 233 - ED RMSTPCR5, 0xFFFFF3FF 234 - ED SMSTPCR2, 0x00000000 235 - ED SRCR2, 0x00040000 236 - ED_AND PLLECR, 0xFFFFFFF7 237 - WAIT_MASK PLLECR, 0x00000800, 0x00000000 238 - 239 - LIST "set SBSC operational" 240 - ED HPBCTRL6, 0x00000001 241 - WAIT_MASK HPBCTRL6, 0x00000001, 0x00000001 242 - 243 - LIST "set SBSC operating frequency" 244 - ED FRQCRD, 0x00001414 245 - WAIT_MASK FRQCRD, 0x80000000, 0x00000000 246 - ED PLL3CR, 0x1D000000 247 - ED_OR PLLECR, 0x00000008 248 - WAIT_MASK PLLECR, 0x00000800, 0x00000800 249 - 250 - LIST "enable DLL oscillation in DDRPHY" 251 - ED_OR DLLCNT0A, 0x00000002 252 - 253 - LIST "wait >= 100 ns" 254 - ED SDGENCNTA, 0x00000005 255 - WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000 256 - 257 - LIST "target LPDDR2 device settings" 258 - ED SDCR0A, 0xACC90159 259 - ED SDCR1A, 0x00010059 260 - ED SDWCRC0A, 0x50874114 261 - ED SDWCRC1A, 0x33199B37 262 - ED SDWCRC2A, 0x008F2313 263 - ED SDWCR00A, 0x31020707 264 - ED SDWCR01A, 0x0017040A 265 - ED SDWCR10A, 0x31020707 266 - ED SDWCR11A, 0x0017040A 267 - 268 - ED SDDRVCR0A, 0x055557ff 269 - 270 - ED SDWCR2A, 0x30000000 271 - 272 - LIST "drive CKE high" 273 - ED_OR SDPCRA, 0x00000080 274 - WAIT_MASK SDPCRA, 0x00000080, 0x00000080 275 - 276 - LIST "wait >= 200 us" 277 - ED SDGENCNTA, 0x00002710 278 - WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000 279 - 280 - LIST "issue reset command to LPDDR2 device" 281 - ED SDMRACR0A, 0x0000003F 282 - ED SDMRA1, 0x00000000 283 - 284 - LIST "wait >= 10 (or 1) us (docs inconsistent)" 285 - ED SDGENCNTA, 0x000001F4 286 - WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000 287 - 288 - LIST "MRW ZS initialization calibration command" 289 - ED SDMRACR0A, 0x0000FF0A 290 - ED SDMRA3, 0x00000000 291 - 292 - LIST "wait >= 1 us" 293 - ED SDGENCNTA, 0x00000032 294 - WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000 295 - 296 - LIST "specify operating mode in LPDDR2" 297 - ED SDMRACR0A, 0x00002201 298 - ED SDMRA1, 0x00000000 299 - ED SDMRACR0A, 0x00000402 300 - ED SDMRA1, 0x00000000 301 - ED SDMRACR0A, 0x00000203 302 - ED SDMRA1, 0x00000000 303 - 304 - LIST "initialize DDR interface" 305 - ED SDMRA2, 0x00000000 306 - 307 - LIST "temperature sensor control" 308 - ED SDMRTMPCRA, 0x88800004 309 - ED SDMRTMPMSKA,0x00000004 310 - 311 - LIST "auto-refreshing control" 312 - ED RTCORA, 0xA55A0032 313 - ED RTCORHA, 0xA55A000C 314 - ED RTCSRA, 0xA55A2048 315 - 316 - ED_OR SDCR0A, 0x00000800 317 - ED_OR SDCR1A, 0x00000400 318 - 319 - LIST "auto ZQ calibration control" 320 - ED ZQCCRA, 0xFFF20000 321 - 322 - ED_OR DLLCNT0B, 0x00000002 323 - ED SDGENCNTB, 0x00000005 324 - WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000 325 - 326 - ED SDCR0B, 0xACC90159 327 - ED SDCR1B, 0x00010059 328 - ED SDWCRC0B, 0x50874114 329 - ED SDWCRC1B, 0x33199B37 330 - ED SDWCRC2B, 0x008F2313 331 - ED SDWCR00B, 0x31020707 332 - ED SDWCR01B, 0x0017040A 333 - ED SDWCR10B, 0x31020707 334 - ED SDWCR11B, 0x0017040A 335 - ED SDDRVCR0B, 0x055557ff 336 - ED SDWCR2B, 0x30000000 337 - ED_OR SDPCRB, 0x00000080 338 - WAIT_MASK SDPCRB, 0x00000080, 0x00000080 339 - 340 - ED SDGENCNTB, 0x00002710 341 - WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000 342 - ED SDMRACR0B, 0x0000003F 343 - 344 - LIST "upstream u-boot writes to SDMRA1A for both SBSC 1 and 2, which does" 345 - LIST "not seem to make a lot of sense..." 346 - ED SDMRB1, 0x00000000 347 - 348 - ED SDGENCNTB, 0x000001F4 349 - WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000 350 - 351 - ED SDMRACR0B, 0x0000FF0A 352 - ED SDMRB3, 0x00000000 353 - ED SDGENCNTB, 0x00000032 354 - WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000 355 - 356 - ED SDMRACR0B, 0x00002201 357 - ED SDMRB1, 0x00000000 358 - ED SDMRACR0B, 0x00000402 359 - ED SDMRB1, 0x00000000 360 - ED SDMRACR0B, 0x00000203 361 - ED SDMRB1, 0x00000000 362 - ED SDMRB2, 0x00000000 363 - ED SDMRTMPCRB, 0x88800004 364 - ED SDMRTMPMSKB, 0x00000004 365 - ED RTCORB, 0xA55A0032 366 - ED RTCORHB, 0xA55A000C 367 - ED RTCSRB, 0xA55A2048 368 - ED_OR SDCR0B, 0x00000800 369 - ED_OR SDCR1B, 0x00000400 370 - ED ZQCCRB, 0xFFF20000 371 - ED_OR SDPDCR0B, 0x00030000 372 - ED DPHYCNT1B, 0xA5390000 373 - ED DPHYCNT0B, 0x00001200 374 - ED DPHYCNT1B, 0x07CE0000 375 - ED DPHYCNT0B, 0x00001247 376 - WAIT_MASK DPHYCNT2B, 0xFFFFFFFF, 0x07CE0000 377 - 378 - ED_AND SDPDCR0B, 0xFFFCFFFF 379 - 380 - ED FRQCRD, 0x00000B0B 381 - WAIT_MASK FRQCRD, 0x80000000, 0x00000000 382 - 383 - ED CPGXXCR4, 0xfffffffc 384 - 385 - LIST "Setup SCIF4 / workaround" 386 - EB PORT32CR, 0x12 387 - EB PORT33CR, 0x22 388 - EB PORT34CR, 0x12 389 - EB PORT35CR, 0x22 390 - 391 - EW 0xE6C80000, 0 392 - EB 0xE6C80004, 0x19 393 - EW 0xE6C80008, 0x0030 394 - EW 0xE6C80018, 0 395 - EW 0xE6C80030, 0x0014 396 - 397 - LIST "Magic to avoid hangs and corruption on DRAM writes." 398 - 399 - LIST "It has been observed that the system would most often hang while" 400 - LIST "decompressing the kernel, and if it didn't it would always write" 401 - LIST "a corrupt image to DRAM." 402 - LIST "This problem does not occur in u-boot, and the reason is that" 403 - LIST "u-boot performs an additional cache invalidation after setting up" 404 - LIST "the DRAM controller. Such an invalidation should not be necessary at" 405 - LIST "this point, and attempts at removing parts of the routine to arrive" 406 - LIST "at the minimal snippet of code necessary to avoid the DRAM stability" 407 - LIST "problem yielded the following:" 408 - 409 - MRC p15, 0, r0, c1, c0, 0 410 - MCR p15, 0, r0, c1, c0, 0
-19
arch/arm/mach-shmobile/include/mach/zboot.h
··· 1 - #ifndef ZBOOT_H 2 - #define ZBOOT_H 3 - 4 - #include <mach/zboot_macros.h> 5 - 6 - /************************************************** 7 - * 8 - * board specific settings 9 - * 10 - **************************************************/ 11 - 12 - #ifdef CONFIG_MACH_KZM9G 13 - #define MEMORY_START 0x43000000 14 - #include "mach/head-kzm9g.txt" 15 - #else 16 - #error "unsupported board." 17 - #endif 18 - 19 - #endif /* ZBOOT_H */
-108
arch/arm/mach-shmobile/include/mach/zboot_macros.h
··· 1 - #ifndef __ZBOOT_MACRO_H 2 - #define __ZBOOT_MACRO_H 3 - 4 - /* The LIST command is used to include comments in the script */ 5 - .macro LIST comment 6 - .endm 7 - 8 - /* The ED command is used to write a 32-bit word */ 9 - .macro ED, addr, data 10 - LDR r0, 1f 11 - LDR r1, 2f 12 - STR r1, [r0] 13 - B 3f 14 - 1 : .long \addr 15 - 2 : .long \data 16 - 3 : 17 - .endm 18 - 19 - /* The EW command is used to write a 16-bit word */ 20 - .macro EW, addr, data 21 - LDR r0, 1f 22 - LDR r1, 2f 23 - STRH r1, [r0] 24 - B 3f 25 - 1 : .long \addr 26 - 2 : .long \data 27 - 3 : 28 - .endm 29 - 30 - /* The EB command is used to write an 8-bit word */ 31 - .macro EB, addr, data 32 - LDR r0, 1f 33 - LDR r1, 2f 34 - STRB r1, [r0] 35 - B 3f 36 - 1 : .long \addr 37 - 2 : .long \data 38 - 3 : 39 - .endm 40 - 41 - /* The WAIT command is used to delay the execution */ 42 - .macro WAIT, time, reg 43 - LDR r1, 1f 44 - LDR r0, 2f 45 - STR r0, [r1] 46 - 10 : 47 - LDR r0, [r1] 48 - CMP r0, #0x00000000 49 - BNE 10b 50 - NOP 51 - B 3f 52 - 1 : .long \reg 53 - 2 : .long \time * 100 54 - 3 : 55 - .endm 56 - 57 - /* The DD command is used to read a 32-bit word */ 58 - .macro DD, start, end 59 - LDR r1, 1f 60 - B 2f 61 - 1 : .long \start 62 - 2 : 63 - .endm 64 - 65 - /* loop until a given value has been read (with mask) */ 66 - .macro WAIT_MASK, addr, data, cmp 67 - LDR r0, 2f 68 - LDR r1, 3f 69 - LDR r2, 4f 70 - 1: 71 - LDR r3, [r0, #0] 72 - AND r3, r1, r3 73 - CMP r2, r3 74 - BNE 1b 75 - B 5f 76 - 2: .long \addr 77 - 3: .long \data 78 - 4: .long \cmp 79 - 5: 80 - .endm 81 - 82 - /* read 32-bit value from addr, "or" an immediate and write back */ 83 - .macro ED_OR, addr, data 84 - LDR r4, 1f 85 - LDR r5, 2f 86 - LDR r6, [r4] 87 - ORR r5, r6, r5 88 - STR r5, [r4] 89 - B 3f 90 - 1: .long \addr 91 - 2: .long \data 92 - 3: 93 - .endm 94 - 95 - /* read 32-bit value from addr, "and" an immediate and write back */ 96 - .macro ED_AND, addr, data 97 - LDR r4, 1f 98 - LDR r5, 2f 99 - LDR r6, [r4] 100 - AND r5, r6, r5 101 - STR r5, [r4] 102 - B 3f 103 - 1: .long \addr 104 - 2: .long \data 105 - 3: 106 - .endm 107 - 108 - #endif /* __ZBOOT_MACRO_H */
-337
arch/arm/mach-shmobile/intc-sh73a0.c
··· 1 - /* 2 - * sh73a0 processor support - INTC hardware block 3 - * 4 - * Copyright (C) 2010 Magnus Damm 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; version 2 of the License. 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 - #include <linux/kernel.h> 16 - #include <linux/init.h> 17 - #include <linux/interrupt.h> 18 - #include <linux/module.h> 19 - #include <linux/irq.h> 20 - #include <linux/io.h> 21 - #include <linux/irqchip.h> 22 - #include <linux/irqchip/arm-gic.h> 23 - 24 - #include <asm/mach-types.h> 25 - #include <asm/mach/arch.h> 26 - 27 - #include "intc.h" 28 - #include "irqs.h" 29 - #include "sh73a0.h" 30 - 31 - enum { 32 - UNUSED = 0, 33 - 34 - /* interrupt sources INTCS */ 35 - PINTCS_PINT1, PINTCS_PINT2, 36 - RTDMAC_0_DEI0, RTDMAC_0_DEI1, RTDMAC_0_DEI2, RTDMAC_0_DEI3, 37 - CEU, MFI, BBIF2, VPU, TSIF1, _3DG_SGX543, _2DDMAC_2DDM0, 38 - RTDMAC_1_DEI4, RTDMAC_1_DEI5, RTDMAC_1_DADERR, 39 - KEYSC_KEY, VINT, MSIOF, 40 - TMU0_TUNI00, TMU0_TUNI01, TMU0_TUNI02, 41 - CMT0, TSIF0, CMT2, LMB, MSUG, MSU_MSU, MSU_MSU2, 42 - CTI, RWDT0, ICB, PEP, ASA, JPU_JPEG, LCDC, LCRC, 43 - RTDMAC_2_DEI6, RTDMAC_2_DEI7, RTDMAC_2_DEI8, RTDMAC_2_DEI9, 44 - RTDMAC_3_DEI10, RTDMAC_3_DEI11, 45 - FRC, GCU, LCDC1, CSIRX, 46 - DSITX0_DSITX00, DSITX0_DSITX01, 47 - SPU2_SPU0, SPU2_SPU1, FSI, 48 - TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12, 49 - TSIF2, CMT4, MFIS2, CPORTS2R, TSG, DMASCH1, SCUW, 50 - VIO60, VIO61, CEU21, CSI21, DSITX1_DSITX10, DSITX1_DSITX11, 51 - DISP, DSRV, EMUX2_EMUX20I, EMUX2_EMUX21I, 52 - MSTIF0_MST00I, MSTIF0_MST01I, MSTIF1_MST10I, MSTIF1_MST11I, 53 - SPUV, 54 - 55 - /* interrupt groups INTCS */ 56 - RTDMAC_0, RTDMAC_1, RTDMAC_2, RTDMAC_3, 57 - DSITX0, SPU2, TMU1, MSU, 58 - }; 59 - 60 - static struct intc_vect intcs_vectors[] = { 61 - INTCS_VECT(PINTCS_PINT1, 0x0600), INTCS_VECT(PINTCS_PINT2, 0x0620), 62 - INTCS_VECT(RTDMAC_0_DEI0, 0x0800), INTCS_VECT(RTDMAC_0_DEI1, 0x0820), 63 - INTCS_VECT(RTDMAC_0_DEI2, 0x0840), INTCS_VECT(RTDMAC_0_DEI3, 0x0860), 64 - INTCS_VECT(CEU, 0x0880), INTCS_VECT(MFI, 0x0900), 65 - INTCS_VECT(BBIF2, 0x0960), INTCS_VECT(VPU, 0x0980), 66 - INTCS_VECT(TSIF1, 0x09a0), INTCS_VECT(_3DG_SGX543, 0x09e0), 67 - INTCS_VECT(_2DDMAC_2DDM0, 0x0a00), 68 - INTCS_VECT(RTDMAC_1_DEI4, 0x0b80), INTCS_VECT(RTDMAC_1_DEI5, 0x0ba0), 69 - INTCS_VECT(RTDMAC_1_DADERR, 0x0bc0), 70 - INTCS_VECT(KEYSC_KEY, 0x0be0), INTCS_VECT(VINT, 0x0c80), 71 - INTCS_VECT(MSIOF, 0x0d20), 72 - INTCS_VECT(TMU0_TUNI00, 0x0e80), INTCS_VECT(TMU0_TUNI01, 0x0ea0), 73 - INTCS_VECT(TMU0_TUNI02, 0x0ec0), 74 - INTCS_VECT(CMT0, 0x0f00), INTCS_VECT(TSIF0, 0x0f20), 75 - INTCS_VECT(CMT2, 0x0f40), INTCS_VECT(LMB, 0x0f60), 76 - INTCS_VECT(MSUG, 0x0f80), 77 - INTCS_VECT(MSU_MSU, 0x0fa0), INTCS_VECT(MSU_MSU2, 0x0fc0), 78 - INTCS_VECT(CTI, 0x0400), INTCS_VECT(RWDT0, 0x0440), 79 - INTCS_VECT(ICB, 0x0480), INTCS_VECT(PEP, 0x04a0), 80 - INTCS_VECT(ASA, 0x04c0), INTCS_VECT(JPU_JPEG, 0x0560), 81 - INTCS_VECT(LCDC, 0x0580), INTCS_VECT(LCRC, 0x05a0), 82 - INTCS_VECT(RTDMAC_2_DEI6, 0x1300), INTCS_VECT(RTDMAC_2_DEI7, 0x1320), 83 - INTCS_VECT(RTDMAC_2_DEI8, 0x1340), INTCS_VECT(RTDMAC_2_DEI9, 0x1360), 84 - INTCS_VECT(RTDMAC_3_DEI10, 0x1380), INTCS_VECT(RTDMAC_3_DEI11, 0x13a0), 85 - INTCS_VECT(FRC, 0x1700), INTCS_VECT(GCU, 0x1760), 86 - INTCS_VECT(LCDC1, 0x1780), INTCS_VECT(CSIRX, 0x17a0), 87 - INTCS_VECT(DSITX0_DSITX00, 0x17c0), INTCS_VECT(DSITX0_DSITX01, 0x17e0), 88 - INTCS_VECT(SPU2_SPU0, 0x1800), INTCS_VECT(SPU2_SPU1, 0x1820), 89 - INTCS_VECT(FSI, 0x1840), 90 - INTCS_VECT(TMU1_TUNI10, 0x1900), INTCS_VECT(TMU1_TUNI11, 0x1920), 91 - INTCS_VECT(TMU1_TUNI12, 0x1940), 92 - INTCS_VECT(TSIF2, 0x1960), INTCS_VECT(CMT4, 0x1980), 93 - INTCS_VECT(MFIS2, 0x1a00), INTCS_VECT(CPORTS2R, 0x1a20), 94 - INTCS_VECT(TSG, 0x1ae0), INTCS_VECT(DMASCH1, 0x1b00), 95 - INTCS_VECT(SCUW, 0x1b40), 96 - INTCS_VECT(VIO60, 0x1b60), INTCS_VECT(VIO61, 0x1b80), 97 - INTCS_VECT(CEU21, 0x1ba0), INTCS_VECT(CSI21, 0x1be0), 98 - INTCS_VECT(DSITX1_DSITX10, 0x1c00), INTCS_VECT(DSITX1_DSITX11, 0x1c20), 99 - INTCS_VECT(DISP, 0x1c40), INTCS_VECT(DSRV, 0x1c60), 100 - INTCS_VECT(EMUX2_EMUX20I, 0x1c80), INTCS_VECT(EMUX2_EMUX21I, 0x1ca0), 101 - INTCS_VECT(MSTIF0_MST00I, 0x1cc0), INTCS_VECT(MSTIF0_MST01I, 0x1ce0), 102 - INTCS_VECT(MSTIF1_MST10I, 0x1d00), INTCS_VECT(MSTIF1_MST11I, 0x1d20), 103 - INTCS_VECT(SPUV, 0x2300), 104 - }; 105 - 106 - static struct intc_group intcs_groups[] __initdata = { 107 - INTC_GROUP(RTDMAC_0, RTDMAC_0_DEI0, RTDMAC_0_DEI1, 108 - RTDMAC_0_DEI2, RTDMAC_0_DEI3), 109 - INTC_GROUP(RTDMAC_1, RTDMAC_1_DEI4, RTDMAC_1_DEI5, RTDMAC_1_DADERR), 110 - INTC_GROUP(RTDMAC_2, RTDMAC_2_DEI6, RTDMAC_2_DEI7, 111 - RTDMAC_2_DEI8, RTDMAC_2_DEI9), 112 - INTC_GROUP(RTDMAC_3, RTDMAC_3_DEI10, RTDMAC_3_DEI11), 113 - INTC_GROUP(TMU1, TMU1_TUNI12, TMU1_TUNI11, TMU1_TUNI10), 114 - INTC_GROUP(DSITX0, DSITX0_DSITX00, DSITX0_DSITX01), 115 - INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1), 116 - INTC_GROUP(MSU, MSU_MSU, MSU_MSU2), 117 - }; 118 - 119 - static struct intc_mask_reg intcs_mask_registers[] = { 120 - { 0xffd20184, 0xffd201c4, 8, /* IMR1SA / IMCR1SA */ 121 - { 0, 0, 0, CEU, 122 - 0, 0, 0, 0 } }, 123 - { 0xffd20188, 0xffd201c8, 8, /* IMR2SA / IMCR2SA */ 124 - { 0, 0, 0, VPU, 125 - BBIF2, 0, 0, MFI } }, 126 - { 0xffd2018c, 0xffd201cc, 8, /* IMR3SA / IMCR3SA */ 127 - { 0, 0, 0, _2DDMAC_2DDM0, 128 - 0, ASA, PEP, ICB } }, 129 - { 0xffd20190, 0xffd201d0, 8, /* IMR4SA / IMCR4SA */ 130 - { 0, 0, 0, CTI, 131 - JPU_JPEG, 0, LCRC, LCDC } }, 132 - { 0xffd20194, 0xffd201d4, 8, /* IMR5SA / IMCR5SA */ 133 - { KEYSC_KEY, RTDMAC_1_DADERR, RTDMAC_1_DEI5, RTDMAC_1_DEI4, 134 - RTDMAC_0_DEI3, RTDMAC_0_DEI2, RTDMAC_0_DEI1, RTDMAC_0_DEI0 } }, 135 - { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */ 136 - { 0, 0, MSIOF, 0, 137 - _3DG_SGX543, 0, 0, 0 } }, 138 - { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */ 139 - { 0, TMU0_TUNI02, TMU0_TUNI01, TMU0_TUNI00, 140 - 0, 0, 0, 0 } }, 141 - { 0xffd201a0, 0xffd201e0, 8, /* IMR8SA / IMCR8SA */ 142 - { 0, 0, 0, 0, 143 - 0, MSU_MSU, MSU_MSU2, MSUG } }, 144 - { 0xffd201a4, 0xffd201e4, 8, /* IMR9SA / IMCR9SA */ 145 - { 0, RWDT0, CMT2, CMT0, 146 - 0, 0, 0, 0 } }, 147 - { 0xffd201ac, 0xffd201ec, 8, /* IMR11SA / IMCR11SA */ 148 - { 0, 0, 0, 0, 149 - 0, TSIF1, LMB, TSIF0 } }, 150 - { 0xffd201b0, 0xffd201f0, 8, /* IMR12SA / IMCR12SA */ 151 - { 0, 0, 0, 0, 152 - 0, 0, PINTCS_PINT2, PINTCS_PINT1 } }, 153 - { 0xffd50180, 0xffd501c0, 8, /* IMR0SA3 / IMCR0SA3 */ 154 - { RTDMAC_2_DEI6, RTDMAC_2_DEI7, RTDMAC_2_DEI8, RTDMAC_2_DEI9, 155 - RTDMAC_3_DEI10, RTDMAC_3_DEI11, 0, 0 } }, 156 - { 0xffd50190, 0xffd501d0, 8, /* IMR4SA3 / IMCR4SA3 */ 157 - { FRC, 0, 0, GCU, 158 - LCDC1, CSIRX, DSITX0_DSITX00, DSITX0_DSITX01 } }, 159 - { 0xffd50194, 0xffd501d4, 8, /* IMR5SA3 / IMCR5SA3 */ 160 - { SPU2_SPU0, SPU2_SPU1, FSI, 0, 161 - 0, 0, 0, 0 } }, 162 - { 0xffd50198, 0xffd501d8, 8, /* IMR6SA3 / IMCR6SA3 */ 163 - { TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12, 0, 164 - TSIF2, CMT4, 0, 0 } }, 165 - { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */ 166 - { MFIS2, CPORTS2R, 0, 0, 167 - 0, 0, 0, TSG } }, 168 - { 0xffd501a0, 0xffd501e0, 8, /* IMR8SA3 / IMCR8SA3 */ 169 - { DMASCH1, 0, SCUW, VIO60, 170 - VIO61, CEU21, 0, CSI21 } }, 171 - { 0xffd501a4, 0xffd501e4, 8, /* IMR9SA3 / IMCR9SA3 */ 172 - { DSITX1_DSITX10, DSITX1_DSITX11, DISP, DSRV, 173 - EMUX2_EMUX20I, EMUX2_EMUX21I, MSTIF0_MST00I, MSTIF0_MST01I } }, 174 - { 0xffd501a8, 0xffd501e8, 8, /* IMR10SA3 / IMCR10SA3 */ 175 - { MSTIF0_MST00I, MSTIF0_MST01I, 0, 0, 176 - 0, 0, 0, 0 } }, 177 - { 0xffd60180, 0xffd601c0, 8, /* IMR0SA4 / IMCR0SA4 */ 178 - { SPUV, 0, 0, 0, 179 - 0, 0, 0, 0 } }, 180 - }; 181 - 182 - /* Priority is needed for INTCA to receive the INTCS interrupt */ 183 - static struct intc_prio_reg intcs_prio_registers[] = { 184 - { 0xffd20000, 0, 16, 4, /* IPRAS */ { CTI, 0, _2DDMAC_2DDM0, ICB } }, 185 - { 0xffd20004, 0, 16, 4, /* IPRBS */ { JPU_JPEG, LCDC, 0, LCRC } }, 186 - { 0xffd20008, 0, 16, 4, /* IPRCS */ { BBIF2, 0, 0, 0 } }, 187 - { 0xffd2000c, 0, 16, 4, /* IPRDS */ { PINTCS_PINT1, PINTCS_PINT2, 188 - 0, 0 } }, 189 - { 0xffd20010, 0, 16, 4, /* IPRES */ { RTDMAC_0, CEU, MFI, VPU } }, 190 - { 0xffd20014, 0, 16, 4, /* IPRFS */ { KEYSC_KEY, RTDMAC_1, 191 - CMT2, CMT0 } }, 192 - { 0xffd20018, 0, 16, 4, /* IPRGS */ { TMU0_TUNI00, TMU0_TUNI01, 193 - TMU0_TUNI02, TSIF1 } }, 194 - { 0xffd2001c, 0, 16, 4, /* IPRHS */ { VINT, 0, 0, 0 } }, 195 - { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, 0 } }, 196 - { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, _3DG_SGX543, MSUG, MSU } }, 197 - { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, ASA, LMB, PEP } }, 198 - { 0xffd20030, 0, 16, 4, /* IPRMS */ { 0, 0, 0, RWDT0 } }, 199 - { 0xffd50000, 0, 16, 4, /* IPRAS3 */ { RTDMAC_2, 0, 0, 0 } }, 200 - { 0xffd50004, 0, 16, 4, /* IPRBS3 */ { RTDMAC_3, 0, 0, 0 } }, 201 - { 0xffd50020, 0, 16, 4, /* IPRIS3 */ { FRC, 0, 0, 0 } }, 202 - { 0xffd50024, 0, 16, 4, /* IPRJS3 */ { LCDC1, CSIRX, DSITX0, 0 } }, 203 - { 0xffd50028, 0, 16, 4, /* IPRKS3 */ { SPU2, 0, FSI, 0 } }, 204 - { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, TSIF2 } }, 205 - { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, 0, 0, 0 } }, 206 - { 0xffd50038, 0, 16, 4, /* IPROS3 */ { MFIS2, CPORTS2R, 0, 0 } }, 207 - { 0xffd50040, 0, 16, 4, /* IPRQS3 */ { DMASCH1, 0, SCUW, VIO60 } }, 208 - { 0xffd50044, 0, 16, 4, /* IPRRS3 */ { VIO61, CEU21, 0, CSI21 } }, 209 - { 0xffd50048, 0, 16, 4, /* IPRSS3 */ { DSITX1_DSITX10, DSITX1_DSITX11, 210 - DISP, DSRV } }, 211 - { 0xffd5004c, 0, 16, 4, /* IPRTS3 */ { EMUX2_EMUX20I, EMUX2_EMUX21I, 212 - MSTIF0_MST00I, MSTIF0_MST01I } }, 213 - { 0xffd50050, 0, 16, 4, /* IPRUS3 */ { MSTIF1_MST10I, MSTIF1_MST11I, 214 - 0, 0 } }, 215 - { 0xffd60000, 0, 16, 4, /* IPRAS4 */ { SPUV, 0, 0, 0 } }, 216 - }; 217 - 218 - static struct resource intcs_resources[] __initdata = { 219 - [0] = { 220 - .start = 0xffd20000, 221 - .end = 0xffd201ff, 222 - .flags = IORESOURCE_MEM, 223 - }, 224 - [1] = { 225 - .start = 0xffd50000, 226 - .end = 0xffd501ff, 227 - .flags = IORESOURCE_MEM, 228 - }, 229 - [2] = { 230 - .start = 0xffd60000, 231 - .end = 0xffd601ff, 232 - .flags = IORESOURCE_MEM, 233 - } 234 - }; 235 - 236 - static struct intc_desc intcs_desc __initdata = { 237 - .name = "sh73a0-intcs", 238 - .resource = intcs_resources, 239 - .num_resources = ARRAY_SIZE(intcs_resources), 240 - .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers, 241 - intcs_prio_registers, NULL, NULL), 242 - }; 243 - 244 - static struct irqaction sh73a0_intcs_cascade; 245 - 246 - static irqreturn_t sh73a0_intcs_demux(int irq, void *dev_id) 247 - { 248 - unsigned int evtcodeas = ioread32((void __iomem *)dev_id); 249 - 250 - generic_handle_irq(intcs_evt2irq(evtcodeas)); 251 - 252 - return IRQ_HANDLED; 253 - } 254 - 255 - #define PINTER0_PHYS 0xe69000a0 256 - #define PINTER1_PHYS 0xe69000a4 257 - #define PINTER0_VIRT IOMEM(0xe69000a0) 258 - #define PINTER1_VIRT IOMEM(0xe69000a4) 259 - #define PINTRR0 IOMEM(0xe69000d0) 260 - #define PINTRR1 IOMEM(0xe69000d4) 261 - 262 - #define PINT0A_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq)) 263 - #define PINT0B_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 8)) 264 - #define PINT0C_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 16)) 265 - #define PINT0D_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT0_IRQ(irq + 24)) 266 - #define PINT1E_IRQ(n, irq) INTC_IRQ((n), SH73A0_PINT1_IRQ(irq)) 267 - 268 - INTC_PINT(intc_pint0, PINTER0_PHYS, 0xe69000b0, "sh73a0-pint0", \ 269 - INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \ 270 - INTC_PINT_V(A, PINT0A_IRQ), INTC_PINT_V(B, PINT0B_IRQ), \ 271 - INTC_PINT_V(C, PINT0C_IRQ), INTC_PINT_V(D, PINT0D_IRQ), \ 272 - INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D), \ 273 - INTC_PINT_E(A), INTC_PINT_E(B), INTC_PINT_E(C), INTC_PINT_E(D)); 274 - 275 - INTC_PINT(intc_pint1, PINTER1_PHYS, 0xe69000c0, "sh73a0-pint1", \ 276 - INTC_PINT_E(E), INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, INTC_PINT_E_EMPTY, \ 277 - INTC_PINT_V(E, PINT1E_IRQ), INTC_PINT_V_NONE, \ 278 - INTC_PINT_V_NONE, INTC_PINT_V_NONE, \ 279 - INTC_PINT_E_NONE, INTC_PINT_E_NONE, INTC_PINT_E_NONE, INTC_PINT_E(E), \ 280 - INTC_PINT_E(E), INTC_PINT_E_NONE, INTC_PINT_E_NONE, INTC_PINT_E_NONE); 281 - 282 - static struct irqaction sh73a0_pint0_cascade; 283 - static struct irqaction sh73a0_pint1_cascade; 284 - 285 - static void pint_demux(void __iomem *rr, void __iomem *er, int base_irq) 286 - { 287 - unsigned long value = ioread32(rr) & ioread32(er); 288 - int k; 289 - 290 - for (k = 0; k < 32; k++) { 291 - if (value & (1 << (31 - k))) { 292 - generic_handle_irq(base_irq + k); 293 - iowrite32(~(1 << (31 - k)), rr); 294 - } 295 - } 296 - } 297 - 298 - static irqreturn_t sh73a0_pint0_demux(int irq, void *dev_id) 299 - { 300 - pint_demux(PINTRR0, PINTER0_VIRT, SH73A0_PINT0_IRQ(0)); 301 - return IRQ_HANDLED; 302 - } 303 - 304 - static irqreturn_t sh73a0_pint1_demux(int irq, void *dev_id) 305 - { 306 - pint_demux(PINTRR1, PINTER1_VIRT, SH73A0_PINT1_IRQ(0)); 307 - return IRQ_HANDLED; 308 - } 309 - 310 - void __init sh73a0_init_irq(void) 311 - { 312 - void __iomem *gic_dist_base = IOMEM(0xf0001000); 313 - void __iomem *gic_cpu_base = IOMEM(0xf0000100); 314 - void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE); 315 - 316 - gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE); 317 - gic_init(0, 29, gic_dist_base, gic_cpu_base); 318 - 319 - register_intc_controller(&intcs_desc); 320 - register_intc_controller(&intc_pint0_desc); 321 - register_intc_controller(&intc_pint1_desc); 322 - 323 - /* demux using INTEVTSA */ 324 - sh73a0_intcs_cascade.name = "INTCS cascade"; 325 - sh73a0_intcs_cascade.handler = sh73a0_intcs_demux; 326 - sh73a0_intcs_cascade.dev_id = intevtsa; 327 - setup_irq(gic_spi(50), &sh73a0_intcs_cascade); 328 - 329 - /* PINT pins are sanely tied to the GIC as SPI */ 330 - sh73a0_pint0_cascade.name = "PINT0 cascade"; 331 - sh73a0_pint0_cascade.handler = sh73a0_pint0_demux; 332 - setup_irq(gic_spi(33), &sh73a0_pint0_cascade); 333 - 334 - sh73a0_pint1_cascade.name = "PINT1 cascade"; 335 - sh73a0_pint1_cascade.handler = sh73a0_pint1_demux; 336 - setup_irq(gic_spi(34), &sh73a0_pint1_cascade); 337 - }
+2 -2
arch/arm/mach-shmobile/platsmp-apmu.c
··· 46 46 return 0; 47 47 } 48 48 49 - static int apmu_power_off(void __iomem *p, int bit) 49 + static int __maybe_unused apmu_power_off(void __iomem *p, int bit) 50 50 { 51 51 /* request Core Standby for next WFI */ 52 52 writel_relaxed(3, p + CPUNCR_OFFS(bit)); ··· 67 67 return 0; 68 68 } 69 69 70 - static int apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu)) 70 + static int __maybe_unused apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu)) 71 71 { 72 72 void __iomem *p = apmu_cpus[cpu].iomem; 73 73
-129
arch/arm/mach-shmobile/pm-r8a7740.c
··· 1 - /* 2 - * r8a7740 power management support 3 - * 4 - * Copyright (C) 2012 Renesas Solutions Corp. 5 - * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 6 - * 7 - * This file is subject to the terms and conditions of the GNU General Public 8 - * License. See the file "COPYING" in the main directory of this archive 9 - * for more details. 10 - */ 11 - #include <linux/console.h> 12 - #include <linux/io.h> 13 - #include <linux/suspend.h> 14 - 15 - #include "common.h" 16 - #include "pm-rmobile.h" 17 - 18 - #define SYSC_BASE IOMEM(0xe6180000) 19 - 20 - #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) 21 - static int r8a7740_pd_a3sm_suspend(void) 22 - { 23 - /* 24 - * The A3SM domain contains the CPU core and therefore it should 25 - * only be turned off if the CPU is not in use. 26 - */ 27 - return -EBUSY; 28 - } 29 - 30 - static int r8a7740_pd_a3sp_suspend(void) 31 - { 32 - /* 33 - * Serial consoles make use of SCIF hardware located in A3SP, 34 - * keep such power domain on if "no_console_suspend" is set. 35 - */ 36 - return console_suspend_enabled ? 0 : -EBUSY; 37 - } 38 - 39 - static int r8a7740_pd_d4_suspend(void) 40 - { 41 - /* 42 - * The D4 domain contains the Coresight-ETM hardware block and 43 - * therefore it should only be turned off if the debug module is 44 - * not in use. 45 - */ 46 - return -EBUSY; 47 - } 48 - 49 - static struct rmobile_pm_domain r8a7740_pm_domains[] = { 50 - { 51 - .genpd.name = "A4LC", 52 - .base = SYSC_BASE, 53 - .bit_shift = 1, 54 - }, { 55 - .genpd.name = "A4MP", 56 - .base = SYSC_BASE, 57 - .bit_shift = 2, 58 - }, { 59 - .genpd.name = "D4", 60 - .base = SYSC_BASE, 61 - .bit_shift = 3, 62 - .gov = &pm_domain_always_on_gov, 63 - .suspend = r8a7740_pd_d4_suspend, 64 - }, { 65 - .genpd.name = "A4R", 66 - .base = SYSC_BASE, 67 - .bit_shift = 5, 68 - }, { 69 - .genpd.name = "A3RV", 70 - .base = SYSC_BASE, 71 - .bit_shift = 6, 72 - }, { 73 - .genpd.name = "A4S", 74 - .base = SYSC_BASE, 75 - .bit_shift = 10, 76 - .no_debug = true, 77 - }, { 78 - .genpd.name = "A3SP", 79 - .base = SYSC_BASE, 80 - .bit_shift = 11, 81 - .gov = &pm_domain_always_on_gov, 82 - .no_debug = true, 83 - .suspend = r8a7740_pd_a3sp_suspend, 84 - }, { 85 - .genpd.name = "A3SM", 86 - .base = SYSC_BASE, 87 - .bit_shift = 12, 88 - .gov = &pm_domain_always_on_gov, 89 - .suspend = r8a7740_pd_a3sm_suspend, 90 - }, { 91 - .genpd.name = "A3SG", 92 - .base = SYSC_BASE, 93 - .bit_shift = 13, 94 - }, { 95 - .genpd.name = "A4SU", 96 - .base = SYSC_BASE, 97 - .bit_shift = 20, 98 - }, 99 - }; 100 - 101 - void __init r8a7740_init_pm_domains(void) 102 - { 103 - rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains)); 104 - pm_genpd_add_subdomain_names("A4R", "A3RV"); 105 - pm_genpd_add_subdomain_names("A4S", "A3SP"); 106 - pm_genpd_add_subdomain_names("A4S", "A3SM"); 107 - pm_genpd_add_subdomain_names("A4S", "A3SG"); 108 - } 109 - #endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */ 110 - 111 - #ifdef CONFIG_SUSPEND 112 - static int r8a7740_enter_suspend(suspend_state_t suspend_state) 113 - { 114 - cpu_do_idle(); 115 - return 0; 116 - } 117 - 118 - static void r8a7740_suspend_init(void) 119 - { 120 - shmobile_suspend_ops.enter = r8a7740_enter_suspend; 121 - } 122 - #else 123 - static void r8a7740_suspend_init(void) {} 124 - #endif 125 - 126 - void __init r8a7740_pm_init(void) 127 - { 128 - r8a7740_suspend_init(); 129 - }
+2 -2
arch/arm/mach-shmobile/pm-r8a7779.c
··· 35 35 struct rcar_sysc_ch ch; 36 36 }; 37 37 38 - static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d) 38 + static inline 39 + const struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d) 39 40 { 40 41 return &container_of(d, struct r8a7779_pm_domain, genpd)->ch; 41 42 } ··· 84 83 { 85 84 struct generic_pm_domain *genpd = &r8a7779_pd->genpd; 86 85 87 - genpd->flags = GENPD_FLAG_PM_CLK; 88 86 pm_genpd_init(genpd, NULL, false); 89 87 genpd->dev_ops.active_wakeup = pd_active_wakeup; 90 88 genpd->power_off = pd_power_down;
+66 -39
arch/arm/mach-shmobile/pm-rcar.c
··· 15 15 #include <asm/io.h> 16 16 #include "pm-rcar.h" 17 17 18 - /* SYSC */ 19 - #define SYSCSR 0x00 20 - #define SYSCISR 0x04 21 - #define SYSCISCR 0x08 18 + /* SYSC Common */ 19 + #define SYSCSR 0x00 /* SYSC Status Register */ 20 + #define SYSCISR 0x04 /* Interrupt Status Register */ 21 + #define SYSCISCR 0x08 /* Interrupt Status Clear Register */ 22 + #define SYSCIER 0x0c /* Interrupt Enable Register */ 23 + #define SYSCIMR 0x10 /* Interrupt Mask Register */ 22 24 23 - #define PWRSR_OFFS 0x00 24 - #define PWROFFCR_OFFS 0x04 25 - #define PWRONCR_OFFS 0x0c 26 - #define PWRER_OFFS 0x14 25 + /* SYSC Status Register */ 26 + #define SYSCSR_PONENB 1 /* Ready for power resume requests */ 27 + #define SYSCSR_POFFENB 0 /* Ready for power shutoff requests */ 27 28 28 - #define SYSCSR_RETRIES 100 29 - #define SYSCSR_DELAY_US 1 29 + /* 30 + * Power Control Register Offsets inside the register block for each domain 31 + * Note: The "CR" registers for ARM cores exist on H1 only 32 + * Use WFI to power off, CPG/APMU to resume ARM cores on R-Car Gen2 33 + */ 34 + #define PWRSR_OFFS 0x00 /* Power Status Register */ 35 + #define PWROFFCR_OFFS 0x04 /* Power Shutoff Control Register */ 36 + #define PWROFFSR_OFFS 0x08 /* Power Shutoff Status Register */ 37 + #define PWRONCR_OFFS 0x0c /* Power Resume Control Register */ 38 + #define PWRONSR_OFFS 0x10 /* Power Resume Status Register */ 39 + #define PWRER_OFFS 0x14 /* Power Shutoff/Resume Error */ 30 40 31 - #define SYSCISR_RETRIES 1000 32 - #define SYSCISR_DELAY_US 1 41 + 42 + #define SYSCSR_RETRIES 100 43 + #define SYSCSR_DELAY_US 1 44 + 45 + #define PWRER_RETRIES 100 46 + #define PWRER_DELAY_US 1 47 + 48 + #define SYSCISR_RETRIES 1000 49 + #define SYSCISR_DELAY_US 1 33 50 34 51 static void __iomem *rcar_sysc_base; 35 52 static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */ 36 53 37 - static int rcar_sysc_pwr_on_off(struct rcar_sysc_ch *sysc_ch, 38 - int sr_bit, int reg_offs) 54 + static int rcar_sysc_pwr_on_off(const struct rcar_sysc_ch *sysc_ch, bool on) 39 55 { 56 + unsigned int sr_bit, reg_offs; 40 57 int k; 41 58 59 + if (on) { 60 + sr_bit = SYSCSR_PONENB; 61 + reg_offs = PWRONCR_OFFS; 62 + } else { 63 + sr_bit = SYSCSR_POFFENB; 64 + reg_offs = PWROFFCR_OFFS; 65 + } 66 + 67 + /* Wait until SYSC is ready to accept a power request */ 42 68 for (k = 0; k < SYSCSR_RETRIES; k++) { 43 - if (ioread32(rcar_sysc_base + SYSCSR) & (1 << sr_bit)) 69 + if (ioread32(rcar_sysc_base + SYSCSR) & BIT(sr_bit)) 44 70 break; 45 71 udelay(SYSCSR_DELAY_US); 46 72 } ··· 74 48 if (k == SYSCSR_RETRIES) 75 49 return -EAGAIN; 76 50 77 - iowrite32(1 << sysc_ch->chan_bit, 51 + /* Submit power shutoff or power resume request */ 52 + iowrite32(BIT(sysc_ch->chan_bit), 78 53 rcar_sysc_base + sysc_ch->chan_offs + reg_offs); 79 54 80 55 return 0; 81 56 } 82 57 83 - static int rcar_sysc_pwr_off(struct rcar_sysc_ch *sysc_ch) 58 + static int rcar_sysc_power(const struct rcar_sysc_ch *sysc_ch, bool on) 84 59 { 85 - return rcar_sysc_pwr_on_off(sysc_ch, 0, PWROFFCR_OFFS); 86 - } 87 - 88 - static int rcar_sysc_pwr_on(struct rcar_sysc_ch *sysc_ch) 89 - { 90 - return rcar_sysc_pwr_on_off(sysc_ch, 1, PWRONCR_OFFS); 91 - } 92 - 93 - static int rcar_sysc_update(struct rcar_sysc_ch *sysc_ch, 94 - int (*on_off_fn)(struct rcar_sysc_ch *)) 95 - { 96 - unsigned int isr_mask = 1 << sysc_ch->isr_bit; 97 - unsigned int chan_mask = 1 << sysc_ch->chan_bit; 60 + unsigned int isr_mask = BIT(sysc_ch->isr_bit); 61 + unsigned int chan_mask = BIT(sysc_ch->chan_bit); 98 62 unsigned int status; 99 63 unsigned long flags; 100 64 int ret = 0; ··· 94 78 95 79 iowrite32(isr_mask, rcar_sysc_base + SYSCISCR); 96 80 97 - do { 98 - ret = on_off_fn(sysc_ch); 81 + /* Submit power shutoff or resume request until it was accepted */ 82 + for (k = 0; k < PWRER_RETRIES; k++) { 83 + ret = rcar_sysc_pwr_on_off(sysc_ch, on); 99 84 if (ret) 100 85 goto out; 101 86 102 87 status = ioread32(rcar_sysc_base + 103 88 sysc_ch->chan_offs + PWRER_OFFS); 104 - } while (status & chan_mask); 89 + if (!(status & chan_mask)) 90 + break; 105 91 92 + udelay(PWRER_DELAY_US); 93 + } 94 + 95 + if (k == PWRER_RETRIES) { 96 + ret = -EIO; 97 + goto out; 98 + } 99 + 100 + /* Wait until the power shutoff or resume request has completed * */ 106 101 for (k = 0; k < SYSCISR_RETRIES; k++) { 107 102 if (ioread32(rcar_sysc_base + SYSCISR) & isr_mask) 108 103 break; ··· 133 106 return ret; 134 107 } 135 108 136 - int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch) 109 + int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch) 137 110 { 138 - return rcar_sysc_update(sysc_ch, rcar_sysc_pwr_off); 111 + return rcar_sysc_power(sysc_ch, false); 139 112 } 140 113 141 - int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch) 114 + int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch) 142 115 { 143 - return rcar_sysc_update(sysc_ch, rcar_sysc_pwr_on); 116 + return rcar_sysc_power(sysc_ch, true); 144 117 } 145 118 146 - bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch) 119 + bool rcar_sysc_power_is_off(const struct rcar_sysc_ch *sysc_ch) 147 120 { 148 121 unsigned int st; 149 122 150 123 st = ioread32(rcar_sysc_base + sysc_ch->chan_offs + PWRSR_OFFS); 151 - if (st & (1 << sysc_ch->chan_bit)) 124 + if (st & BIT(sysc_ch->chan_bit)) 152 125 return true; 153 126 154 127 return false;
+6 -6
arch/arm/mach-shmobile/pm-rcar.h
··· 2 2 #define PM_RCAR_H 3 3 4 4 struct rcar_sysc_ch { 5 - unsigned long chan_offs; 6 - unsigned int chan_bit; 7 - unsigned int isr_bit; 5 + u16 chan_offs; 6 + u8 chan_bit; 7 + u8 isr_bit; 8 8 }; 9 9 10 - int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch); 11 - int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch); 12 - bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch); 10 + int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch); 11 + int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch); 12 + bool rcar_sysc_power_is_off(const struct rcar_sysc_ch *sysc_ch); 13 13 void __iomem *rcar_sysc_init(phys_addr_t base); 14 14 15 15 #endif /* PM_RCAR_H */
+8 -41
arch/arm/mach-shmobile/pm-rmobile.c
··· 34 34 #define PSTR_RETRIES 100 35 35 #define PSTR_DELAY_US 10 36 36 37 + static inline 38 + struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d) 39 + { 40 + return container_of(d, struct rmobile_pm_domain, genpd); 41 + } 42 + 37 43 static int rmobile_pd_power_down(struct generic_pm_domain *genpd) 38 44 { 39 45 struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd); ··· 48 42 if (rmobile_pd->bit_shift == ~0) 49 43 return -EBUSY; 50 44 51 - mask = 1 << rmobile_pd->bit_shift; 45 + mask = BIT(rmobile_pd->bit_shift); 52 46 if (rmobile_pd->suspend) { 53 47 int ret = rmobile_pd->suspend(); 54 48 ··· 85 79 if (rmobile_pd->bit_shift == ~0) 86 80 return 0; 87 81 88 - mask = 1 << rmobile_pd->bit_shift; 82 + mask = BIT(rmobile_pd->bit_shift); 89 83 if (__raw_readl(rmobile_pd->base + PSTR) & mask) 90 84 goto out; 91 85 ··· 168 162 genpd->detach_dev = rmobile_pd_detach_dev; 169 163 __rmobile_pd_power_up(rmobile_pd, false); 170 164 } 171 - 172 - #ifdef CONFIG_ARCH_SHMOBILE_LEGACY 173 - 174 - void rmobile_init_domains(struct rmobile_pm_domain domains[], int num) 175 - { 176 - int j; 177 - 178 - for (j = 0; j < num; j++) 179 - rmobile_init_pm_domain(&domains[j]); 180 - } 181 - 182 - void rmobile_add_device_to_domain_td(const char *domain_name, 183 - struct platform_device *pdev, 184 - struct gpd_timing_data *td) 185 - { 186 - struct device *dev = &pdev->dev; 187 - 188 - __pm_genpd_name_add_device(domain_name, dev, td); 189 - } 190 - 191 - void rmobile_add_devices_to_domains(struct pm_domain_device data[], 192 - int size) 193 - { 194 - struct gpd_timing_data latencies = { 195 - .stop_latency_ns = DEFAULT_DEV_LATENCY_NS, 196 - .start_latency_ns = DEFAULT_DEV_LATENCY_NS, 197 - .save_state_latency_ns = DEFAULT_DEV_LATENCY_NS, 198 - .restore_state_latency_ns = DEFAULT_DEV_LATENCY_NS, 199 - }; 200 - int j; 201 - 202 - for (j = 0; j < size; j++) 203 - rmobile_add_device_to_domain_td(data[j].domain_name, 204 - data[j].pdev, &latencies); 205 - } 206 - 207 - #else /* !CONFIG_ARCH_SHMOBILE_LEGACY */ 208 165 209 166 static int rmobile_pd_suspend_busy(void) 210 167 { ··· 399 430 } 400 431 401 432 core_initcall(rmobile_init_pm_domains); 402 - 403 - #endif /* !CONFIG_ARCH_SHMOBILE_LEGACY */
-30
arch/arm/mach-shmobile/pm-rmobile.h
··· 26 26 bool no_debug; 27 27 }; 28 28 29 - static inline 30 - struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d) 31 - { 32 - return container_of(d, struct rmobile_pm_domain, genpd); 33 - } 34 - 35 29 struct pm_domain_device { 36 30 const char *domain_name; 37 31 struct platform_device *pdev; 38 32 }; 39 - 40 - #if defined(CONFIG_PM_RMOBILE) && defined(CONFIG_ARCH_SHMOBILE_LEGACY) 41 - extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num); 42 - extern void rmobile_add_device_to_domain_td(const char *domain_name, 43 - struct platform_device *pdev, 44 - struct gpd_timing_data *td); 45 - 46 - static inline void rmobile_add_device_to_domain(const char *domain_name, 47 - struct platform_device *pdev) 48 - { 49 - rmobile_add_device_to_domain_td(domain_name, pdev, NULL); 50 - } 51 - 52 - extern void rmobile_add_devices_to_domains(struct pm_domain_device data[], 53 - int size); 54 - #else 55 - 56 - #define rmobile_init_domains(domains, num) do { } while (0) 57 - #define rmobile_add_device_to_domain_td(name, pdev, td) do { } while (0) 58 - #define rmobile_add_device_to_domain(name, pdev) do { } while (0) 59 - 60 - static inline void rmobile_add_devices_to_domains(struct pm_domain_device d[], 61 - int size) {} 62 - #endif /* CONFIG_PM_RMOBILE */ 63 33 64 34 #endif /* PM_RMOBILE_H */
-32
arch/arm/mach-shmobile/pm-sh73a0.c
··· 1 - /* 2 - * sh73a0 Power management support 3 - * 4 - * Copyright (C) 2012 Bastian Hecht <hechtb+renesas@gmail.com> 5 - * 6 - * This file is subject to the terms and conditions of the GNU General Public 7 - * License. See the file "COPYING" in the main directory of this archive 8 - * for more details. 9 - */ 10 - 11 - #include <linux/suspend.h> 12 - #include "common.h" 13 - 14 - #ifdef CONFIG_SUSPEND 15 - static int sh73a0_enter_suspend(suspend_state_t suspend_state) 16 - { 17 - cpu_do_idle(); 18 - return 0; 19 - } 20 - 21 - static void sh73a0_suspend_init(void) 22 - { 23 - shmobile_suspend_ops.enter = sh73a0_enter_suspend; 24 - } 25 - #else 26 - static void sh73a0_suspend_init(void) {} 27 - #endif 28 - 29 - void __init sh73a0_pm_init(void) 30 - { 31 - sh73a0_suspend_init(); 32 - }
-58
arch/arm/mach-shmobile/r8a7740.h
··· 1 - /* 2 - * Copyright (C) 2011 Renesas Solutions Corp. 3 - * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.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 as published by 7 - * the Free Software Foundation; version 2 of the License. 8 - * 9 - * This program is distributed in the hope that it will be useful, 10 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - * GNU General Public License for more details. 13 - */ 14 - 15 - #ifndef __ASM_R8A7740_H__ 16 - #define __ASM_R8A7740_H__ 17 - 18 - /* 19 - * MD_CKx pin 20 - */ 21 - #define MD_CK2 (1 << 2) 22 - #define MD_CK1 (1 << 1) 23 - #define MD_CK0 (1 << 0) 24 - 25 - /* DMA slave IDs */ 26 - enum { 27 - SHDMA_SLAVE_INVALID, 28 - SHDMA_SLAVE_SDHI0_RX, 29 - SHDMA_SLAVE_SDHI0_TX, 30 - SHDMA_SLAVE_SDHI1_RX, 31 - SHDMA_SLAVE_SDHI1_TX, 32 - SHDMA_SLAVE_SDHI2_RX, 33 - SHDMA_SLAVE_SDHI2_TX, 34 - SHDMA_SLAVE_FSIA_RX, 35 - SHDMA_SLAVE_FSIA_TX, 36 - SHDMA_SLAVE_FSIB_TX, 37 - SHDMA_SLAVE_USBHS_TX, 38 - SHDMA_SLAVE_USBHS_RX, 39 - SHDMA_SLAVE_MMCIF_TX, 40 - SHDMA_SLAVE_MMCIF_RX, 41 - }; 42 - 43 - extern void r8a7740_meram_workaround(void); 44 - extern void r8a7740_init_irq_of(void); 45 - extern void r8a7740_map_io(void); 46 - extern void r8a7740_add_early_devices(void); 47 - extern void r8a7740_add_standard_devices(void); 48 - extern void r8a7740_clock_init(u8 md_ck); 49 - extern void r8a7740_pinmux_init(void); 50 - extern void r8a7740_pm_init(void); 51 - 52 - #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) 53 - extern void __init r8a7740_init_pm_domains(void); 54 - #else 55 - static inline void r8a7740_init_pm_domains(void) {} 56 - #endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */ 57 - 58 - #endif /* __ASM_R8A7740_H__ */
-19
arch/arm/mach-shmobile/r8a7779.h
··· 3 3 4 4 #include <linux/sh_clk.h> 5 5 6 - /* HPB-DMA slave IDs */ 7 - enum { 8 - HPBDMA_SLAVE_DUMMY, 9 - HPBDMA_SLAVE_SDHI0_TX, 10 - HPBDMA_SLAVE_SDHI0_RX, 11 - }; 12 - 13 - extern void r8a7779_init_irq_extpin(int irlm); 14 - extern void r8a7779_init_irq_extpin_dt(int irlm); 15 - extern void r8a7779_init_irq_dt(void); 16 - extern void r8a7779_map_io(void); 17 - extern void r8a7779_earlytimer_init(void); 18 - extern void r8a7779_add_early_devices(void); 19 - extern void r8a7779_add_standard_devices(void); 20 - extern void r8a7779_init_late(void); 21 - extern u32 r8a7779_read_mode_pins(void); 22 - extern void r8a7779_clock_init(void); 23 - extern void r8a7779_pinmux_init(void); 24 6 extern void r8a7779_pm_init(void); 25 - extern void r8a7779_register_twd(void); 26 7 27 8 #ifdef CONFIG_PM 28 9 extern void __init r8a7779_init_pm_domains(void);
+1 -1
arch/arm/mach-shmobile/setup-r7s72100.c
··· 20 20 21 21 #include "common.h" 22 22 23 - static const char *r7s72100_boards_compat_dt[] __initdata = { 23 + static const char *const r7s72100_boards_compat_dt[] __initconst = { 24 24 "renesas,r7s72100", 25 25 NULL, 26 26 };
+1 -1
arch/arm/mach-shmobile/setup-r8a73a4.c
··· 20 20 21 21 #include "common.h" 22 22 23 - static const char *r8a73a4_boards_compat_dt[] __initdata = { 23 + static const char *const r8a73a4_boards_compat_dt[] __initconst = { 24 24 "renesas,r8a73a4", 25 25 NULL, 26 26 };
+4 -676
arch/arm/mach-shmobile/setup-r8a7740.c
··· 13 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * GNU General Public License for more details. 15 15 */ 16 - #include <linux/dma-mapping.h> 17 16 #include <linux/kernel.h> 18 17 #include <linux/init.h> 19 18 #include <linux/io.h> 20 19 #include <linux/irqchip.h> 21 20 #include <linux/irqchip/arm-gic.h> 22 - #include <linux/platform_data/irq-renesas-intc-irqpin.h> 23 - #include <linux/platform_device.h> 24 21 #include <linux/of_platform.h> 25 - #include <linux/serial_sci.h> 26 - #include <linux/sh_dma.h> 27 - #include <linux/sh_timer.h> 28 - #include <linux/platform_data/sh_ipmmu.h> 29 22 30 - #include <asm/mach-types.h> 31 23 #include <asm/mach/map.h> 32 24 #include <asm/mach/arch.h> 33 25 #include <asm/mach/time.h> 34 26 #include <asm/hardware/cache-l2x0.h> 35 27 36 28 #include "common.h" 37 - #include "dma-register.h" 38 - #include "irqs.h" 39 - #include "pm-rmobile.h" 40 - #include "r8a7740.h" 41 29 42 30 static struct map_desc r8a7740_io_desc[] __initdata = { 43 31 /* ··· 52 64 #endif 53 65 }; 54 66 55 - void __init r8a7740_map_io(void) 67 + static void __init r8a7740_map_io(void) 56 68 { 57 69 debug_ll_io_init(); 58 70 iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc)); 59 71 } 60 - 61 - /* PFC */ 62 - static const struct resource pfc_resources[] = { 63 - DEFINE_RES_MEM(0xe6050000, 0x8000), 64 - DEFINE_RES_MEM(0xe605800c, 0x0020), 65 - }; 66 - 67 - void __init r8a7740_pinmux_init(void) 68 - { 69 - platform_device_register_simple("pfc-r8a7740", -1, pfc_resources, 70 - ARRAY_SIZE(pfc_resources)); 71 - } 72 - 73 - static struct renesas_intc_irqpin_config irqpin0_platform_data = { 74 - .irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */ 75 - }; 76 - 77 - static struct resource irqpin0_resources[] = { 78 - DEFINE_RES_MEM(0xe6900000, 4), /* ICR1A */ 79 - DEFINE_RES_MEM(0xe6900010, 4), /* INTPRI00A */ 80 - DEFINE_RES_MEM(0xe6900020, 1), /* INTREQ00A */ 81 - DEFINE_RES_MEM(0xe6900040, 1), /* INTMSK00A */ 82 - DEFINE_RES_MEM(0xe6900060, 1), /* INTMSKCLR00A */ 83 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ0 */ 84 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ1 */ 85 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ2 */ 86 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ3 */ 87 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ4 */ 88 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ5 */ 89 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ6 */ 90 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ7 */ 91 - }; 92 - 93 - static struct platform_device irqpin0_device = { 94 - .name = "renesas_intc_irqpin", 95 - .id = 0, 96 - .resource = irqpin0_resources, 97 - .num_resources = ARRAY_SIZE(irqpin0_resources), 98 - .dev = { 99 - .platform_data = &irqpin0_platform_data, 100 - }, 101 - }; 102 - 103 - static struct renesas_intc_irqpin_config irqpin1_platform_data = { 104 - .irq_base = irq_pin(8), /* IRQ8 -> IRQ15 */ 105 - }; 106 - 107 - static struct resource irqpin1_resources[] = { 108 - DEFINE_RES_MEM(0xe6900004, 4), /* ICR2A */ 109 - DEFINE_RES_MEM(0xe6900014, 4), /* INTPRI10A */ 110 - DEFINE_RES_MEM(0xe6900024, 1), /* INTREQ10A */ 111 - DEFINE_RES_MEM(0xe6900044, 1), /* INTMSK10A */ 112 - DEFINE_RES_MEM(0xe6900064, 1), /* INTMSKCLR10A */ 113 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ8 */ 114 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ9 */ 115 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ10 */ 116 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ11 */ 117 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ12 */ 118 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ13 */ 119 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ14 */ 120 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ15 */ 121 - }; 122 - 123 - static struct platform_device irqpin1_device = { 124 - .name = "renesas_intc_irqpin", 125 - .id = 1, 126 - .resource = irqpin1_resources, 127 - .num_resources = ARRAY_SIZE(irqpin1_resources), 128 - .dev = { 129 - .platform_data = &irqpin1_platform_data, 130 - }, 131 - }; 132 - 133 - static struct renesas_intc_irqpin_config irqpin2_platform_data = { 134 - .irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */ 135 - }; 136 - 137 - static struct resource irqpin2_resources[] = { 138 - DEFINE_RES_MEM(0xe6900008, 4), /* ICR3A */ 139 - DEFINE_RES_MEM(0xe6900018, 4), /* INTPRI30A */ 140 - DEFINE_RES_MEM(0xe6900028, 1), /* INTREQ30A */ 141 - DEFINE_RES_MEM(0xe6900048, 1), /* INTMSK30A */ 142 - DEFINE_RES_MEM(0xe6900068, 1), /* INTMSKCLR30A */ 143 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ16 */ 144 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ17 */ 145 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ18 */ 146 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ19 */ 147 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ20 */ 148 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ21 */ 149 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ22 */ 150 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ23 */ 151 - }; 152 - 153 - static struct platform_device irqpin2_device = { 154 - .name = "renesas_intc_irqpin", 155 - .id = 2, 156 - .resource = irqpin2_resources, 157 - .num_resources = ARRAY_SIZE(irqpin2_resources), 158 - .dev = { 159 - .platform_data = &irqpin2_platform_data, 160 - }, 161 - }; 162 - 163 - static struct renesas_intc_irqpin_config irqpin3_platform_data = { 164 - .irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */ 165 - }; 166 - 167 - static struct resource irqpin3_resources[] = { 168 - DEFINE_RES_MEM(0xe690000c, 4), /* ICR3A */ 169 - DEFINE_RES_MEM(0xe690001c, 4), /* INTPRI30A */ 170 - DEFINE_RES_MEM(0xe690002c, 1), /* INTREQ30A */ 171 - DEFINE_RES_MEM(0xe690004c, 1), /* INTMSK30A */ 172 - DEFINE_RES_MEM(0xe690006c, 1), /* INTMSKCLR30A */ 173 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ24 */ 174 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ25 */ 175 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ26 */ 176 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ27 */ 177 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ28 */ 178 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ29 */ 179 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ30 */ 180 - DEFINE_RES_IRQ(gic_spi(149)), /* IRQ31 */ 181 - }; 182 - 183 - static struct platform_device irqpin3_device = { 184 - .name = "renesas_intc_irqpin", 185 - .id = 3, 186 - .resource = irqpin3_resources, 187 - .num_resources = ARRAY_SIZE(irqpin3_resources), 188 - .dev = { 189 - .platform_data = &irqpin3_platform_data, 190 - }, 191 - }; 192 - 193 - /* SCIF */ 194 - #define R8A7740_SCIF(scif_type, index, baseaddr, irq) \ 195 - static struct plat_sci_port scif##index##_platform_data = { \ 196 - .type = scif_type, \ 197 - .flags = UPF_BOOT_AUTOCONF, \ 198 - .scscr = SCSCR_RE | SCSCR_TE, \ 199 - }; \ 200 - \ 201 - static struct resource scif##index##_resources[] = { \ 202 - DEFINE_RES_MEM(baseaddr, 0x100), \ 203 - DEFINE_RES_IRQ(irq), \ 204 - }; \ 205 - \ 206 - static struct platform_device scif##index##_device = { \ 207 - .name = "sh-sci", \ 208 - .id = index, \ 209 - .resource = scif##index##_resources, \ 210 - .num_resources = ARRAY_SIZE(scif##index##_resources), \ 211 - .dev = { \ 212 - .platform_data = &scif##index##_platform_data, \ 213 - }, \ 214 - } 215 - 216 - R8A7740_SCIF(PORT_SCIFA, 0, 0xe6c40000, gic_spi(100)); 217 - R8A7740_SCIF(PORT_SCIFA, 1, 0xe6c50000, gic_spi(101)); 218 - R8A7740_SCIF(PORT_SCIFA, 2, 0xe6c60000, gic_spi(102)); 219 - R8A7740_SCIF(PORT_SCIFA, 3, 0xe6c70000, gic_spi(103)); 220 - R8A7740_SCIF(PORT_SCIFA, 4, 0xe6c80000, gic_spi(104)); 221 - R8A7740_SCIF(PORT_SCIFA, 5, 0xe6cb0000, gic_spi(105)); 222 - R8A7740_SCIF(PORT_SCIFA, 6, 0xe6cc0000, gic_spi(106)); 223 - R8A7740_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(107)); 224 - R8A7740_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(108)); 225 - 226 - /* CMT */ 227 - static struct sh_timer_config cmt1_platform_data = { 228 - .channels_mask = 0x3f, 229 - }; 230 - 231 - static struct resource cmt1_resources[] = { 232 - DEFINE_RES_MEM(0xe6138000, 0x170), 233 - DEFINE_RES_IRQ(gic_spi(58)), 234 - }; 235 - 236 - static struct platform_device cmt1_device = { 237 - .name = "sh-cmt-48", 238 - .id = 1, 239 - .dev = { 240 - .platform_data = &cmt1_platform_data, 241 - }, 242 - .resource = cmt1_resources, 243 - .num_resources = ARRAY_SIZE(cmt1_resources), 244 - }; 245 - 246 - /* TMU */ 247 - static struct sh_timer_config tmu0_platform_data = { 248 - .channels_mask = 7, 249 - }; 250 - 251 - static struct resource tmu0_resources[] = { 252 - DEFINE_RES_MEM(0xfff80000, 0x2c), 253 - DEFINE_RES_IRQ(gic_spi(198)), 254 - DEFINE_RES_IRQ(gic_spi(199)), 255 - DEFINE_RES_IRQ(gic_spi(200)), 256 - }; 257 - 258 - static struct platform_device tmu0_device = { 259 - .name = "sh-tmu", 260 - .id = 0, 261 - .dev = { 262 - .platform_data = &tmu0_platform_data, 263 - }, 264 - .resource = tmu0_resources, 265 - .num_resources = ARRAY_SIZE(tmu0_resources), 266 - }; 267 - 268 - /* IPMMUI (an IPMMU module for ICB/LMB) */ 269 - static struct resource ipmmu_resources[] = { 270 - [0] = { 271 - .name = "IPMMUI", 272 - .start = 0xfe951000, 273 - .end = 0xfe9510ff, 274 - .flags = IORESOURCE_MEM, 275 - }, 276 - }; 277 - 278 - static const char * const ipmmu_dev_names[] = { 279 - "sh_mobile_lcdc_fb.0", 280 - "sh_mobile_lcdc_fb.1", 281 - "sh_mobile_ceu.0", 282 - }; 283 - 284 - static struct shmobile_ipmmu_platform_data ipmmu_platform_data = { 285 - .dev_names = ipmmu_dev_names, 286 - .num_dev_names = ARRAY_SIZE(ipmmu_dev_names), 287 - }; 288 - 289 - static struct platform_device ipmmu_device = { 290 - .name = "ipmmu", 291 - .id = -1, 292 - .dev = { 293 - .platform_data = &ipmmu_platform_data, 294 - }, 295 - .resource = ipmmu_resources, 296 - .num_resources = ARRAY_SIZE(ipmmu_resources), 297 - }; 298 - 299 - static struct platform_device *r8a7740_early_devices[] __initdata = { 300 - &scif0_device, 301 - &scif1_device, 302 - &scif2_device, 303 - &scif3_device, 304 - &scif4_device, 305 - &scif5_device, 306 - &scif6_device, 307 - &scif7_device, 308 - &scif8_device, 309 - &irqpin0_device, 310 - &irqpin1_device, 311 - &irqpin2_device, 312 - &irqpin3_device, 313 - &tmu0_device, 314 - &ipmmu_device, 315 - &cmt1_device, 316 - }; 317 - 318 - /* DMA */ 319 - static const struct sh_dmae_slave_config r8a7740_dmae_slaves[] = { 320 - { 321 - .slave_id = SHDMA_SLAVE_SDHI0_TX, 322 - .addr = 0xe6850030, 323 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 324 - .mid_rid = 0xc1, 325 - }, { 326 - .slave_id = SHDMA_SLAVE_SDHI0_RX, 327 - .addr = 0xe6850030, 328 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 329 - .mid_rid = 0xc2, 330 - }, { 331 - .slave_id = SHDMA_SLAVE_SDHI1_TX, 332 - .addr = 0xe6860030, 333 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 334 - .mid_rid = 0xc9, 335 - }, { 336 - .slave_id = SHDMA_SLAVE_SDHI1_RX, 337 - .addr = 0xe6860030, 338 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 339 - .mid_rid = 0xca, 340 - }, { 341 - .slave_id = SHDMA_SLAVE_SDHI2_TX, 342 - .addr = 0xe6870030, 343 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 344 - .mid_rid = 0xcd, 345 - }, { 346 - .slave_id = SHDMA_SLAVE_SDHI2_RX, 347 - .addr = 0xe6870030, 348 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 349 - .mid_rid = 0xce, 350 - }, { 351 - .slave_id = SHDMA_SLAVE_FSIA_TX, 352 - .addr = 0xfe1f0024, 353 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 354 - .mid_rid = 0xb1, 355 - }, { 356 - .slave_id = SHDMA_SLAVE_FSIA_RX, 357 - .addr = 0xfe1f0020, 358 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 359 - .mid_rid = 0xb2, 360 - }, { 361 - .slave_id = SHDMA_SLAVE_FSIB_TX, 362 - .addr = 0xfe1f0064, 363 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 364 - .mid_rid = 0xb5, 365 - }, { 366 - .slave_id = SHDMA_SLAVE_MMCIF_TX, 367 - .addr = 0xe6bd0034, 368 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 369 - .mid_rid = 0xd1, 370 - }, { 371 - .slave_id = SHDMA_SLAVE_MMCIF_RX, 372 - .addr = 0xe6bd0034, 373 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 374 - .mid_rid = 0xd2, 375 - }, 376 - }; 377 - 378 - #define DMA_CHANNEL(a, b, c) \ 379 - { \ 380 - .offset = a, \ 381 - .dmars = b, \ 382 - .dmars_bit = c, \ 383 - .chclr_offset = (0x220 - 0x20) + a \ 384 - } 385 - 386 - static const struct sh_dmae_channel r8a7740_dmae_channels[] = { 387 - DMA_CHANNEL(0x00, 0, 0), 388 - DMA_CHANNEL(0x10, 0, 8), 389 - DMA_CHANNEL(0x20, 4, 0), 390 - DMA_CHANNEL(0x30, 4, 8), 391 - DMA_CHANNEL(0x50, 8, 0), 392 - DMA_CHANNEL(0x60, 8, 8), 393 - }; 394 - 395 - static struct sh_dmae_pdata dma_platform_data = { 396 - .slave = r8a7740_dmae_slaves, 397 - .slave_num = ARRAY_SIZE(r8a7740_dmae_slaves), 398 - .channel = r8a7740_dmae_channels, 399 - .channel_num = ARRAY_SIZE(r8a7740_dmae_channels), 400 - .ts_low_shift = TS_LOW_SHIFT, 401 - .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT, 402 - .ts_high_shift = TS_HI_SHIFT, 403 - .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT, 404 - .ts_shift = dma_ts_shift, 405 - .ts_shift_num = ARRAY_SIZE(dma_ts_shift), 406 - .dmaor_init = DMAOR_DME, 407 - .chclr_present = 1, 408 - }; 409 - 410 - /* Resource order important! */ 411 - static struct resource r8a7740_dmae0_resources[] = { 412 - { 413 - /* Channel registers and DMAOR */ 414 - .start = 0xfe008020, 415 - .end = 0xfe00828f, 416 - .flags = IORESOURCE_MEM, 417 - }, 418 - { 419 - /* DMARSx */ 420 - .start = 0xfe009000, 421 - .end = 0xfe00900b, 422 - .flags = IORESOURCE_MEM, 423 - }, 424 - { 425 - .name = "error_irq", 426 - .start = gic_spi(34), 427 - .end = gic_spi(34), 428 - .flags = IORESOURCE_IRQ, 429 - }, 430 - { 431 - /* IRQ for channels 0-5 */ 432 - .start = gic_spi(28), 433 - .end = gic_spi(33), 434 - .flags = IORESOURCE_IRQ, 435 - }, 436 - }; 437 - 438 - /* Resource order important! */ 439 - static struct resource r8a7740_dmae1_resources[] = { 440 - { 441 - /* Channel registers and DMAOR */ 442 - .start = 0xfe018020, 443 - .end = 0xfe01828f, 444 - .flags = IORESOURCE_MEM, 445 - }, 446 - { 447 - /* DMARSx */ 448 - .start = 0xfe019000, 449 - .end = 0xfe01900b, 450 - .flags = IORESOURCE_MEM, 451 - }, 452 - { 453 - .name = "error_irq", 454 - .start = gic_spi(41), 455 - .end = gic_spi(41), 456 - .flags = IORESOURCE_IRQ, 457 - }, 458 - { 459 - /* IRQ for channels 0-5 */ 460 - .start = gic_spi(35), 461 - .end = gic_spi(40), 462 - .flags = IORESOURCE_IRQ, 463 - }, 464 - }; 465 - 466 - /* Resource order important! */ 467 - static struct resource r8a7740_dmae2_resources[] = { 468 - { 469 - /* Channel registers and DMAOR */ 470 - .start = 0xfe028020, 471 - .end = 0xfe02828f, 472 - .flags = IORESOURCE_MEM, 473 - }, 474 - { 475 - /* DMARSx */ 476 - .start = 0xfe029000, 477 - .end = 0xfe02900b, 478 - .flags = IORESOURCE_MEM, 479 - }, 480 - { 481 - .name = "error_irq", 482 - .start = gic_spi(48), 483 - .end = gic_spi(48), 484 - .flags = IORESOURCE_IRQ, 485 - }, 486 - { 487 - /* IRQ for channels 0-5 */ 488 - .start = gic_spi(42), 489 - .end = gic_spi(47), 490 - .flags = IORESOURCE_IRQ, 491 - }, 492 - }; 493 - 494 - static struct platform_device dma0_device = { 495 - .name = "sh-dma-engine", 496 - .id = 0, 497 - .resource = r8a7740_dmae0_resources, 498 - .num_resources = ARRAY_SIZE(r8a7740_dmae0_resources), 499 - .dev = { 500 - .platform_data = &dma_platform_data, 501 - }, 502 - }; 503 - 504 - static struct platform_device dma1_device = { 505 - .name = "sh-dma-engine", 506 - .id = 1, 507 - .resource = r8a7740_dmae1_resources, 508 - .num_resources = ARRAY_SIZE(r8a7740_dmae1_resources), 509 - .dev = { 510 - .platform_data = &dma_platform_data, 511 - }, 512 - }; 513 - 514 - static struct platform_device dma2_device = { 515 - .name = "sh-dma-engine", 516 - .id = 2, 517 - .resource = r8a7740_dmae2_resources, 518 - .num_resources = ARRAY_SIZE(r8a7740_dmae2_resources), 519 - .dev = { 520 - .platform_data = &dma_platform_data, 521 - }, 522 - }; 523 - 524 - /* USB-DMAC */ 525 - static const struct sh_dmae_channel r8a7740_usb_dma_channels[] = { 526 - { 527 - .offset = 0, 528 - }, { 529 - .offset = 0x20, 530 - }, 531 - }; 532 - 533 - static const struct sh_dmae_slave_config r8a7740_usb_dma_slaves[] = { 534 - { 535 - .slave_id = SHDMA_SLAVE_USBHS_TX, 536 - .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE), 537 - }, { 538 - .slave_id = SHDMA_SLAVE_USBHS_RX, 539 - .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE), 540 - }, 541 - }; 542 - 543 - static struct sh_dmae_pdata usb_dma_platform_data = { 544 - .slave = r8a7740_usb_dma_slaves, 545 - .slave_num = ARRAY_SIZE(r8a7740_usb_dma_slaves), 546 - .channel = r8a7740_usb_dma_channels, 547 - .channel_num = ARRAY_SIZE(r8a7740_usb_dma_channels), 548 - .ts_low_shift = USBTS_LOW_SHIFT, 549 - .ts_low_mask = USBTS_LOW_BIT << USBTS_LOW_SHIFT, 550 - .ts_high_shift = USBTS_HI_SHIFT, 551 - .ts_high_mask = USBTS_HI_BIT << USBTS_HI_SHIFT, 552 - .ts_shift = dma_usbts_shift, 553 - .ts_shift_num = ARRAY_SIZE(dma_usbts_shift), 554 - .dmaor_init = DMAOR_DME, 555 - .chcr_offset = 0x14, 556 - .chcr_ie_bit = 1 << 5, 557 - .dmaor_is_32bit = 1, 558 - .needs_tend_set = 1, 559 - .no_dmars = 1, 560 - .slave_only = 1, 561 - }; 562 - 563 - static struct resource r8a7740_usb_dma_resources[] = { 564 - { 565 - /* Channel registers and DMAOR */ 566 - .start = 0xe68a0020, 567 - .end = 0xe68a0064 - 1, 568 - .flags = IORESOURCE_MEM, 569 - }, 570 - { 571 - /* VCR/SWR/DMICR */ 572 - .start = 0xe68a0000, 573 - .end = 0xe68a0014 - 1, 574 - .flags = IORESOURCE_MEM, 575 - }, 576 - { 577 - /* IRQ for channels */ 578 - .start = gic_spi(49), 579 - .end = gic_spi(49), 580 - .flags = IORESOURCE_IRQ, 581 - }, 582 - }; 583 - 584 - static struct platform_device usb_dma_device = { 585 - .name = "sh-dma-engine", 586 - .id = 3, 587 - .resource = r8a7740_usb_dma_resources, 588 - .num_resources = ARRAY_SIZE(r8a7740_usb_dma_resources), 589 - .dev = { 590 - .platform_data = &usb_dma_platform_data, 591 - }, 592 - }; 593 - 594 - /* I2C */ 595 - static struct resource i2c0_resources[] = { 596 - [0] = { 597 - .name = "IIC0", 598 - .start = 0xfff20000, 599 - .end = 0xfff20425 - 1, 600 - .flags = IORESOURCE_MEM, 601 - }, 602 - [1] = { 603 - .start = gic_spi(201), 604 - .end = gic_spi(204), 605 - .flags = IORESOURCE_IRQ, 606 - }, 607 - }; 608 - 609 - static struct resource i2c1_resources[] = { 610 - [0] = { 611 - .name = "IIC1", 612 - .start = 0xe6c20000, 613 - .end = 0xe6c20425 - 1, 614 - .flags = IORESOURCE_MEM, 615 - }, 616 - [1] = { 617 - .start = gic_spi(70), /* IIC1_ALI1 */ 618 - .end = gic_spi(73), /* IIC1_DTEI1 */ 619 - .flags = IORESOURCE_IRQ, 620 - }, 621 - }; 622 - 623 - static struct platform_device i2c0_device = { 624 - .name = "i2c-sh_mobile", 625 - .id = 0, 626 - .resource = i2c0_resources, 627 - .num_resources = ARRAY_SIZE(i2c0_resources), 628 - }; 629 - 630 - static struct platform_device i2c1_device = { 631 - .name = "i2c-sh_mobile", 632 - .id = 1, 633 - .resource = i2c1_resources, 634 - .num_resources = ARRAY_SIZE(i2c1_resources), 635 - }; 636 - 637 - static struct resource pmu_resources[] = { 638 - [0] = { 639 - .start = gic_spi(83), 640 - .end = gic_spi(83), 641 - .flags = IORESOURCE_IRQ, 642 - }, 643 - }; 644 - 645 - static struct platform_device pmu_device = { 646 - .name = "armv7-pmu", 647 - .id = -1, 648 - .num_resources = ARRAY_SIZE(pmu_resources), 649 - .resource = pmu_resources, 650 - }; 651 - 652 - static struct platform_device *r8a7740_late_devices[] __initdata = { 653 - &i2c0_device, 654 - &i2c1_device, 655 - &dma0_device, 656 - &dma1_device, 657 - &dma2_device, 658 - &usb_dma_device, 659 - &pmu_device, 660 - }; 661 72 662 73 /* 663 74 * r8a7740 chip has lasting errata on MERAM buffer. ··· 65 678 * "Media RAM (MERAM)" on r8a7740 documentation 66 679 */ 67 680 #define MEBUFCNTR 0xFE950098 68 - void __init r8a7740_meram_workaround(void) 681 + static void __init r8a7740_meram_workaround(void) 69 682 { 70 683 void __iomem *reg; 71 684 ··· 76 689 } 77 690 } 78 691 79 - void __init r8a7740_add_standard_devices(void) 80 - { 81 - static struct pm_domain_device domain_devices[] __initdata = { 82 - { "A4R", &tmu0_device }, 83 - { "A4R", &i2c0_device }, 84 - { "A4S", &irqpin0_device }, 85 - { "A4S", &irqpin1_device }, 86 - { "A4S", &irqpin2_device }, 87 - { "A4S", &irqpin3_device }, 88 - { "A3SP", &scif0_device }, 89 - { "A3SP", &scif1_device }, 90 - { "A3SP", &scif2_device }, 91 - { "A3SP", &scif3_device }, 92 - { "A3SP", &scif4_device }, 93 - { "A3SP", &scif5_device }, 94 - { "A3SP", &scif6_device }, 95 - { "A3SP", &scif7_device }, 96 - { "A3SP", &scif8_device }, 97 - { "A3SP", &i2c1_device }, 98 - { "A3SP", &ipmmu_device }, 99 - { "A3SP", &dma0_device }, 100 - { "A3SP", &dma1_device }, 101 - { "A3SP", &dma2_device }, 102 - { "A3SP", &usb_dma_device }, 103 - }; 104 - 105 - r8a7740_init_pm_domains(); 106 - 107 - /* add devices */ 108 - platform_add_devices(r8a7740_early_devices, 109 - ARRAY_SIZE(r8a7740_early_devices)); 110 - platform_add_devices(r8a7740_late_devices, 111 - ARRAY_SIZE(r8a7740_late_devices)); 112 - 113 - /* add devices to PM domain */ 114 - rmobile_add_devices_to_domains(domain_devices, 115 - ARRAY_SIZE(domain_devices)); 116 - } 117 - 118 - void __init r8a7740_add_early_devices(void) 119 - { 120 - early_platform_add_devices(r8a7740_early_devices, 121 - ARRAY_SIZE(r8a7740_early_devices)); 122 - 123 - /* setup early console here as well */ 124 - shmobile_setup_console(); 125 - } 126 - 127 - #ifdef CONFIG_USE_OF 128 - 129 - void __init r8a7740_init_irq_of(void) 692 + static void __init r8a7740_init_irq_of(void) 130 693 { 131 694 void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10); 132 695 void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10); 133 696 void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4); 134 697 135 - #ifdef CONFIG_ARCH_SHMOBILE_LEGACY 136 - void __iomem *gic_dist_base = ioremap_nocache(0xc2800000, 0x1000); 137 - void __iomem *gic_cpu_base = ioremap_nocache(0xc2000000, 0x1000); 138 - 139 - gic_init(0, 29, gic_dist_base, gic_cpu_base); 140 - #else 141 698 irqchip_init(); 142 - #endif 143 699 144 700 /* route signals to GIC */ 145 701 iowrite32(0x0, pfc_inta_ctrl); ··· 117 787 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 118 788 } 119 789 120 - static const char *r8a7740_boards_compat_dt[] __initdata = { 790 + static const char *const r8a7740_boards_compat_dt[] __initconst = { 121 791 "renesas,r8a7740", 122 792 NULL, 123 793 }; ··· 130 800 .init_late = shmobile_init_late, 131 801 .dt_compat = r8a7740_boards_compat_dt, 132 802 MACHINE_END 133 - 134 - #endif /* CONFIG_USE_OF */
+1 -1
arch/arm/mach-shmobile/setup-r8a7778.c
··· 615 615 iounmap(base); 616 616 } 617 617 618 - static const char *r8a7778_compat_dt[] __initdata = { 618 + static const char *const r8a7778_compat_dt[] __initconst = { 619 619 "renesas,r8a7778", 620 620 NULL, 621 621 };
+15 -668
arch/arm/mach-shmobile/setup-r8a7779.c
··· 14 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 * GNU General Public License for more details. 16 16 */ 17 - #include <linux/kernel.h> 17 + #include <linux/clk/shmobile.h> 18 + #include <linux/clocksource.h> 18 19 #include <linux/init.h> 19 - #include <linux/interrupt.h> 20 20 #include <linux/irq.h> 21 21 #include <linux/irqchip.h> 22 22 #include <linux/irqchip/arm-gic.h> 23 - #include <linux/of_platform.h> 24 - #include <linux/platform_data/dma-rcar-hpbdma.h> 25 - #include <linux/platform_data/gpio-rcar.h> 26 - #include <linux/platform_data/irq-renesas-intc-irqpin.h> 27 - #include <linux/platform_device.h> 28 - #include <linux/delay.h> 29 - #include <linux/input.h> 30 - #include <linux/io.h> 31 - #include <linux/serial_sci.h> 32 - #include <linux/sh_timer.h> 33 - #include <linux/dma-mapping.h> 34 - #include <linux/usb/otg.h> 35 - #include <linux/usb/hcd.h> 36 - #include <linux/usb/ehci_pdriver.h> 37 - #include <linux/usb/ohci_pdriver.h> 38 - #include <linux/pm_runtime.h> 39 23 40 - #include <asm/mach-types.h> 41 24 #include <asm/mach/arch.h> 42 - #include <asm/mach/time.h> 43 25 #include <asm/mach/map.h> 44 - #include <asm/hardware/cache-l2x0.h> 45 26 46 27 #include "common.h" 47 - #include "irqs.h" 48 28 #include "r8a7779.h" 49 29 50 30 static struct map_desc r8a7779_io_desc[] __initdata = { ··· 44 64 }, 45 65 }; 46 66 47 - void __init r8a7779_map_io(void) 67 + static void __init r8a7779_map_io(void) 48 68 { 49 69 debug_ll_io_init(); 50 70 iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc)); ··· 60 80 #define INT2NTSR0 IOMEM(0xfe700060) 61 81 #define INT2NTSR1 IOMEM(0xfe700064) 62 82 63 - static struct renesas_intc_irqpin_config irqpin0_platform_data __initdata = { 64 - .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ 65 - .sense_bitfield_width = 2, 66 - }; 67 - 68 - static struct resource irqpin0_resources[] __initdata = { 69 - DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */ 70 - DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */ 71 - DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */ 72 - DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */ 73 - DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */ 74 - DEFINE_RES_IRQ(gic_spi(27)), /* IRQ0 */ 75 - DEFINE_RES_IRQ(gic_spi(28)), /* IRQ1 */ 76 - DEFINE_RES_IRQ(gic_spi(29)), /* IRQ2 */ 77 - DEFINE_RES_IRQ(gic_spi(30)), /* IRQ3 */ 78 - }; 79 - 80 - void __init r8a7779_init_irq_extpin_dt(int irlm) 83 + static void __init r8a7779_init_irq_dt(void) 81 84 { 82 - void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE); 83 - u32 tmp; 84 - 85 - if (!icr0) { 86 - pr_warn("r8a7779: unable to setup external irq pin mode\n"); 87 - return; 88 - } 89 - 90 - tmp = ioread32(icr0); 91 - if (irlm) 92 - tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */ 93 - else 94 - tmp &= ~(1 << 23); /* IRL mode - not supported */ 95 - tmp |= (1 << 21); /* LVLMODE = 1 */ 96 - iowrite32(tmp, icr0); 97 - iounmap(icr0); 98 - } 99 - 100 - void __init r8a7779_init_irq_extpin(int irlm) 101 - { 102 - r8a7779_init_irq_extpin_dt(irlm); 103 - if (irlm) 104 - platform_device_register_resndata( 105 - NULL, "renesas_intc_irqpin", -1, 106 - irqpin0_resources, ARRAY_SIZE(irqpin0_resources), 107 - &irqpin0_platform_data, sizeof(irqpin0_platform_data)); 108 - } 109 - 110 - /* PFC/GPIO */ 111 - static struct resource r8a7779_pfc_resources[] = { 112 - DEFINE_RES_MEM(0xfffc0000, 0x023c), 113 - }; 114 - 115 - static struct platform_device r8a7779_pfc_device = { 116 - .name = "pfc-r8a7779", 117 - .id = -1, 118 - .resource = r8a7779_pfc_resources, 119 - .num_resources = ARRAY_SIZE(r8a7779_pfc_resources), 120 - }; 121 - 122 - #define R8A7779_GPIO(idx, npins) \ 123 - static struct resource r8a7779_gpio##idx##_resources[] = { \ 124 - DEFINE_RES_MEM(0xffc40000 + (0x1000 * (idx)), 0x002c), \ 125 - DEFINE_RES_IRQ(gic_iid(0xad + (idx))), \ 126 - }; \ 127 - \ 128 - static struct gpio_rcar_config r8a7779_gpio##idx##_platform_data = { \ 129 - .gpio_base = 32 * (idx), \ 130 - .irq_base = 0, \ 131 - .number_of_pins = npins, \ 132 - .pctl_name = "pfc-r8a7779", \ 133 - }; \ 134 - \ 135 - static struct platform_device r8a7779_gpio##idx##_device = { \ 136 - .name = "gpio_rcar", \ 137 - .id = idx, \ 138 - .resource = r8a7779_gpio##idx##_resources, \ 139 - .num_resources = ARRAY_SIZE(r8a7779_gpio##idx##_resources), \ 140 - .dev = { \ 141 - .platform_data = &r8a7779_gpio##idx##_platform_data, \ 142 - }, \ 143 - } 144 - 145 - R8A7779_GPIO(0, 32); 146 - R8A7779_GPIO(1, 32); 147 - R8A7779_GPIO(2, 32); 148 - R8A7779_GPIO(3, 32); 149 - R8A7779_GPIO(4, 32); 150 - R8A7779_GPIO(5, 32); 151 - R8A7779_GPIO(6, 9); 152 - 153 - static struct platform_device *r8a7779_pinctrl_devices[] __initdata = { 154 - &r8a7779_pfc_device, 155 - &r8a7779_gpio0_device, 156 - &r8a7779_gpio1_device, 157 - &r8a7779_gpio2_device, 158 - &r8a7779_gpio3_device, 159 - &r8a7779_gpio4_device, 160 - &r8a7779_gpio5_device, 161 - &r8a7779_gpio6_device, 162 - }; 163 - 164 - void __init r8a7779_pinmux_init(void) 165 - { 166 - platform_add_devices(r8a7779_pinctrl_devices, 167 - ARRAY_SIZE(r8a7779_pinctrl_devices)); 168 - } 169 - 170 - /* SCIF */ 171 - #define R8A7779_SCIF(index, baseaddr, irq) \ 172 - static struct plat_sci_port scif##index##_platform_data = { \ 173 - .type = PORT_SCIF, \ 174 - .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \ 175 - .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, \ 176 - }; \ 177 - \ 178 - static struct resource scif##index##_resources[] = { \ 179 - DEFINE_RES_MEM(baseaddr, 0x100), \ 180 - DEFINE_RES_IRQ(irq), \ 181 - }; \ 182 - \ 183 - static struct platform_device scif##index##_device = { \ 184 - .name = "sh-sci", \ 185 - .id = index, \ 186 - .resource = scif##index##_resources, \ 187 - .num_resources = ARRAY_SIZE(scif##index##_resources), \ 188 - .dev = { \ 189 - .platform_data = &scif##index##_platform_data, \ 190 - }, \ 191 - } 192 - 193 - R8A7779_SCIF(0, 0xffe40000, gic_iid(0x78)); 194 - R8A7779_SCIF(1, 0xffe41000, gic_iid(0x79)); 195 - R8A7779_SCIF(2, 0xffe42000, gic_iid(0x7a)); 196 - R8A7779_SCIF(3, 0xffe43000, gic_iid(0x7b)); 197 - R8A7779_SCIF(4, 0xffe44000, gic_iid(0x7c)); 198 - R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d)); 199 - 200 - /* TMU */ 201 - static struct sh_timer_config tmu0_platform_data = { 202 - .channels_mask = 7, 203 - }; 204 - 205 - static struct resource tmu0_resources[] = { 206 - DEFINE_RES_MEM(0xffd80000, 0x30), 207 - DEFINE_RES_IRQ(gic_iid(0x40)), 208 - DEFINE_RES_IRQ(gic_iid(0x41)), 209 - DEFINE_RES_IRQ(gic_iid(0x42)), 210 - }; 211 - 212 - static struct platform_device tmu0_device = { 213 - .name = "sh-tmu", 214 - .id = 0, 215 - .dev = { 216 - .platform_data = &tmu0_platform_data, 217 - }, 218 - .resource = tmu0_resources, 219 - .num_resources = ARRAY_SIZE(tmu0_resources), 220 - }; 221 - 222 - /* I2C */ 223 - static struct resource rcar_i2c0_res[] = { 224 - { 225 - .start = 0xffc70000, 226 - .end = 0xffc70fff, 227 - .flags = IORESOURCE_MEM, 228 - }, { 229 - .start = gic_iid(0x6f), 230 - .flags = IORESOURCE_IRQ, 231 - }, 232 - }; 233 - 234 - static struct platform_device i2c0_device = { 235 - .name = "i2c-rcar", 236 - .id = 0, 237 - .resource = rcar_i2c0_res, 238 - .num_resources = ARRAY_SIZE(rcar_i2c0_res), 239 - }; 240 - 241 - static struct resource rcar_i2c1_res[] = { 242 - { 243 - .start = 0xffc71000, 244 - .end = 0xffc71fff, 245 - .flags = IORESOURCE_MEM, 246 - }, { 247 - .start = gic_iid(0x72), 248 - .flags = IORESOURCE_IRQ, 249 - }, 250 - }; 251 - 252 - static struct platform_device i2c1_device = { 253 - .name = "i2c-rcar", 254 - .id = 1, 255 - .resource = rcar_i2c1_res, 256 - .num_resources = ARRAY_SIZE(rcar_i2c1_res), 257 - }; 258 - 259 - static struct resource rcar_i2c2_res[] = { 260 - { 261 - .start = 0xffc72000, 262 - .end = 0xffc72fff, 263 - .flags = IORESOURCE_MEM, 264 - }, { 265 - .start = gic_iid(0x70), 266 - .flags = IORESOURCE_IRQ, 267 - }, 268 - }; 269 - 270 - static struct platform_device i2c2_device = { 271 - .name = "i2c-rcar", 272 - .id = 2, 273 - .resource = rcar_i2c2_res, 274 - .num_resources = ARRAY_SIZE(rcar_i2c2_res), 275 - }; 276 - 277 - static struct resource rcar_i2c3_res[] = { 278 - { 279 - .start = 0xffc73000, 280 - .end = 0xffc73fff, 281 - .flags = IORESOURCE_MEM, 282 - }, { 283 - .start = gic_iid(0x71), 284 - .flags = IORESOURCE_IRQ, 285 - }, 286 - }; 287 - 288 - static struct platform_device i2c3_device = { 289 - .name = "i2c-rcar", 290 - .id = 3, 291 - .resource = rcar_i2c3_res, 292 - .num_resources = ARRAY_SIZE(rcar_i2c3_res), 293 - }; 294 - 295 - static struct resource sata_resources[] = { 296 - [0] = { 297 - .name = "rcar-sata", 298 - .start = 0xfc600000, 299 - .end = 0xfc601fff, 300 - .flags = IORESOURCE_MEM, 301 - }, 302 - [1] = { 303 - .start = gic_iid(0x84), 304 - .flags = IORESOURCE_IRQ, 305 - }, 306 - }; 307 - 308 - static struct platform_device sata_device = { 309 - .name = "sata_rcar", 310 - .id = -1, 311 - .resource = sata_resources, 312 - .num_resources = ARRAY_SIZE(sata_resources), 313 - .dev = { 314 - .dma_mask = &sata_device.dev.coherent_dma_mask, 315 - .coherent_dma_mask = DMA_BIT_MASK(32), 316 - }, 317 - }; 318 - 319 - /* USB */ 320 - static struct usb_phy *phy; 321 - 322 - static int usb_power_on(struct platform_device *pdev) 323 - { 324 - if (IS_ERR(phy)) 325 - return PTR_ERR(phy); 326 - 327 - pm_runtime_enable(&pdev->dev); 328 - pm_runtime_get_sync(&pdev->dev); 329 - 330 - usb_phy_init(phy); 331 - 332 - return 0; 333 - } 334 - 335 - static void usb_power_off(struct platform_device *pdev) 336 - { 337 - if (IS_ERR(phy)) 338 - return; 339 - 340 - usb_phy_shutdown(phy); 341 - 342 - pm_runtime_put_sync(&pdev->dev); 343 - pm_runtime_disable(&pdev->dev); 344 - } 345 - 346 - static int ehci_init_internal_buffer(struct usb_hcd *hcd) 347 - { 348 - /* 349 - * Below are recommended values from the datasheet; 350 - * see [USB :: Setting of EHCI Internal Buffer]. 351 - */ 352 - /* EHCI IP internal buffer setting */ 353 - iowrite32(0x00ff0040, hcd->regs + 0x0094); 354 - /* EHCI IP internal buffer enable */ 355 - iowrite32(0x00000001, hcd->regs + 0x009C); 356 - 357 - return 0; 358 - } 359 - 360 - static struct usb_ehci_pdata ehcix_pdata = { 361 - .power_on = usb_power_on, 362 - .power_off = usb_power_off, 363 - .power_suspend = usb_power_off, 364 - .pre_setup = ehci_init_internal_buffer, 365 - }; 366 - 367 - static struct resource ehci0_resources[] = { 368 - [0] = { 369 - .start = 0xffe70000, 370 - .end = 0xffe70400 - 1, 371 - .flags = IORESOURCE_MEM, 372 - }, 373 - [1] = { 374 - .start = gic_iid(0x4c), 375 - .flags = IORESOURCE_IRQ, 376 - }, 377 - }; 378 - 379 - static struct platform_device ehci0_device = { 380 - .name = "ehci-platform", 381 - .id = 0, 382 - .dev = { 383 - .dma_mask = &ehci0_device.dev.coherent_dma_mask, 384 - .coherent_dma_mask = 0xffffffff, 385 - .platform_data = &ehcix_pdata, 386 - }, 387 - .num_resources = ARRAY_SIZE(ehci0_resources), 388 - .resource = ehci0_resources, 389 - }; 390 - 391 - static struct resource ehci1_resources[] = { 392 - [0] = { 393 - .start = 0xfff70000, 394 - .end = 0xfff70400 - 1, 395 - .flags = IORESOURCE_MEM, 396 - }, 397 - [1] = { 398 - .start = gic_iid(0x4d), 399 - .flags = IORESOURCE_IRQ, 400 - }, 401 - }; 402 - 403 - static struct platform_device ehci1_device = { 404 - .name = "ehci-platform", 405 - .id = 1, 406 - .dev = { 407 - .dma_mask = &ehci1_device.dev.coherent_dma_mask, 408 - .coherent_dma_mask = 0xffffffff, 409 - .platform_data = &ehcix_pdata, 410 - }, 411 - .num_resources = ARRAY_SIZE(ehci1_resources), 412 - .resource = ehci1_resources, 413 - }; 414 - 415 - static struct usb_ohci_pdata ohcix_pdata = { 416 - .power_on = usb_power_on, 417 - .power_off = usb_power_off, 418 - .power_suspend = usb_power_off, 419 - }; 420 - 421 - static struct resource ohci0_resources[] = { 422 - [0] = { 423 - .start = 0xffe70400, 424 - .end = 0xffe70800 - 1, 425 - .flags = IORESOURCE_MEM, 426 - }, 427 - [1] = { 428 - .start = gic_iid(0x4c), 429 - .flags = IORESOURCE_IRQ, 430 - }, 431 - }; 432 - 433 - static struct platform_device ohci0_device = { 434 - .name = "ohci-platform", 435 - .id = 0, 436 - .dev = { 437 - .dma_mask = &ohci0_device.dev.coherent_dma_mask, 438 - .coherent_dma_mask = 0xffffffff, 439 - .platform_data = &ohcix_pdata, 440 - }, 441 - .num_resources = ARRAY_SIZE(ohci0_resources), 442 - .resource = ohci0_resources, 443 - }; 444 - 445 - static struct resource ohci1_resources[] = { 446 - [0] = { 447 - .start = 0xfff70400, 448 - .end = 0xfff70800 - 1, 449 - .flags = IORESOURCE_MEM, 450 - }, 451 - [1] = { 452 - .start = gic_iid(0x4d), 453 - .flags = IORESOURCE_IRQ, 454 - }, 455 - }; 456 - 457 - static struct platform_device ohci1_device = { 458 - .name = "ohci-platform", 459 - .id = 1, 460 - .dev = { 461 - .dma_mask = &ohci1_device.dev.coherent_dma_mask, 462 - .coherent_dma_mask = 0xffffffff, 463 - .platform_data = &ohcix_pdata, 464 - }, 465 - .num_resources = ARRAY_SIZE(ohci1_resources), 466 - .resource = ohci1_resources, 467 - }; 468 - 469 - /* HPB-DMA */ 470 - 471 - /* Asynchronous mode register bits */ 472 - #define HPB_DMAE_ASYNCMDR_ASMD43_MASK BIT(23) /* MMC1 */ 473 - #define HPB_DMAE_ASYNCMDR_ASMD43_SINGLE BIT(23) /* MMC1 */ 474 - #define HPB_DMAE_ASYNCMDR_ASMD43_MULTI 0 /* MMC1 */ 475 - #define HPB_DMAE_ASYNCMDR_ASBTMD43_MASK BIT(22) /* MMC1 */ 476 - #define HPB_DMAE_ASYNCMDR_ASBTMD43_BURST BIT(22) /* MMC1 */ 477 - #define HPB_DMAE_ASYNCMDR_ASBTMD43_NBURST 0 /* MMC1 */ 478 - #define HPB_DMAE_ASYNCMDR_ASMD24_MASK BIT(21) /* MMC0 */ 479 - #define HPB_DMAE_ASYNCMDR_ASMD24_SINGLE BIT(21) /* MMC0 */ 480 - #define HPB_DMAE_ASYNCMDR_ASMD24_MULTI 0 /* MMC0 */ 481 - #define HPB_DMAE_ASYNCMDR_ASBTMD24_MASK BIT(20) /* MMC0 */ 482 - #define HPB_DMAE_ASYNCMDR_ASBTMD24_BURST BIT(20) /* MMC0 */ 483 - #define HPB_DMAE_ASYNCMDR_ASBTMD24_NBURST 0 /* MMC0 */ 484 - #define HPB_DMAE_ASYNCMDR_ASMD41_MASK BIT(19) /* SDHI3 */ 485 - #define HPB_DMAE_ASYNCMDR_ASMD41_SINGLE BIT(19) /* SDHI3 */ 486 - #define HPB_DMAE_ASYNCMDR_ASMD41_MULTI 0 /* SDHI3 */ 487 - #define HPB_DMAE_ASYNCMDR_ASBTMD41_MASK BIT(18) /* SDHI3 */ 488 - #define HPB_DMAE_ASYNCMDR_ASBTMD41_BURST BIT(18) /* SDHI3 */ 489 - #define HPB_DMAE_ASYNCMDR_ASBTMD41_NBURST 0 /* SDHI3 */ 490 - #define HPB_DMAE_ASYNCMDR_ASMD40_MASK BIT(17) /* SDHI3 */ 491 - #define HPB_DMAE_ASYNCMDR_ASMD40_SINGLE BIT(17) /* SDHI3 */ 492 - #define HPB_DMAE_ASYNCMDR_ASMD40_MULTI 0 /* SDHI3 */ 493 - #define HPB_DMAE_ASYNCMDR_ASBTMD40_MASK BIT(16) /* SDHI3 */ 494 - #define HPB_DMAE_ASYNCMDR_ASBTMD40_BURST BIT(16) /* SDHI3 */ 495 - #define HPB_DMAE_ASYNCMDR_ASBTMD40_NBURST 0 /* SDHI3 */ 496 - #define HPB_DMAE_ASYNCMDR_ASMD39_MASK BIT(15) /* SDHI3 */ 497 - #define HPB_DMAE_ASYNCMDR_ASMD39_SINGLE BIT(15) /* SDHI3 */ 498 - #define HPB_DMAE_ASYNCMDR_ASMD39_MULTI 0 /* SDHI3 */ 499 - #define HPB_DMAE_ASYNCMDR_ASBTMD39_MASK BIT(14) /* SDHI3 */ 500 - #define HPB_DMAE_ASYNCMDR_ASBTMD39_BURST BIT(14) /* SDHI3 */ 501 - #define HPB_DMAE_ASYNCMDR_ASBTMD39_NBURST 0 /* SDHI3 */ 502 - #define HPB_DMAE_ASYNCMDR_ASMD27_MASK BIT(13) /* SDHI2 */ 503 - #define HPB_DMAE_ASYNCMDR_ASMD27_SINGLE BIT(13) /* SDHI2 */ 504 - #define HPB_DMAE_ASYNCMDR_ASMD27_MULTI 0 /* SDHI2 */ 505 - #define HPB_DMAE_ASYNCMDR_ASBTMD27_MASK BIT(12) /* SDHI2 */ 506 - #define HPB_DMAE_ASYNCMDR_ASBTMD27_BURST BIT(12) /* SDHI2 */ 507 - #define HPB_DMAE_ASYNCMDR_ASBTMD27_NBURST 0 /* SDHI2 */ 508 - #define HPB_DMAE_ASYNCMDR_ASMD26_MASK BIT(11) /* SDHI2 */ 509 - #define HPB_DMAE_ASYNCMDR_ASMD26_SINGLE BIT(11) /* SDHI2 */ 510 - #define HPB_DMAE_ASYNCMDR_ASMD26_MULTI 0 /* SDHI2 */ 511 - #define HPB_DMAE_ASYNCMDR_ASBTMD26_MASK BIT(10) /* SDHI2 */ 512 - #define HPB_DMAE_ASYNCMDR_ASBTMD26_BURST BIT(10) /* SDHI2 */ 513 - #define HPB_DMAE_ASYNCMDR_ASBTMD26_NBURST 0 /* SDHI2 */ 514 - #define HPB_DMAE_ASYNCMDR_ASMD25_MASK BIT(9) /* SDHI2 */ 515 - #define HPB_DMAE_ASYNCMDR_ASMD25_SINGLE BIT(9) /* SDHI2 */ 516 - #define HPB_DMAE_ASYNCMDR_ASMD25_MULTI 0 /* SDHI2 */ 517 - #define HPB_DMAE_ASYNCMDR_ASBTMD25_MASK BIT(8) /* SDHI2 */ 518 - #define HPB_DMAE_ASYNCMDR_ASBTMD25_BURST BIT(8) /* SDHI2 */ 519 - #define HPB_DMAE_ASYNCMDR_ASBTMD25_NBURST 0 /* SDHI2 */ 520 - #define HPB_DMAE_ASYNCMDR_ASMD23_MASK BIT(7) /* SDHI0 */ 521 - #define HPB_DMAE_ASYNCMDR_ASMD23_SINGLE BIT(7) /* SDHI0 */ 522 - #define HPB_DMAE_ASYNCMDR_ASMD23_MULTI 0 /* SDHI0 */ 523 - #define HPB_DMAE_ASYNCMDR_ASBTMD23_MASK BIT(6) /* SDHI0 */ 524 - #define HPB_DMAE_ASYNCMDR_ASBTMD23_BURST BIT(6) /* SDHI0 */ 525 - #define HPB_DMAE_ASYNCMDR_ASBTMD23_NBURST 0 /* SDHI0 */ 526 - #define HPB_DMAE_ASYNCMDR_ASMD22_MASK BIT(5) /* SDHI0 */ 527 - #define HPB_DMAE_ASYNCMDR_ASMD22_SINGLE BIT(5) /* SDHI0 */ 528 - #define HPB_DMAE_ASYNCMDR_ASMD22_MULTI 0 /* SDHI0 */ 529 - #define HPB_DMAE_ASYNCMDR_ASBTMD22_MASK BIT(4) /* SDHI0 */ 530 - #define HPB_DMAE_ASYNCMDR_ASBTMD22_BURST BIT(4) /* SDHI0 */ 531 - #define HPB_DMAE_ASYNCMDR_ASBTMD22_NBURST 0 /* SDHI0 */ 532 - #define HPB_DMAE_ASYNCMDR_ASMD21_MASK BIT(3) /* SDHI0 */ 533 - #define HPB_DMAE_ASYNCMDR_ASMD21_SINGLE BIT(3) /* SDHI0 */ 534 - #define HPB_DMAE_ASYNCMDR_ASMD21_MULTI 0 /* SDHI0 */ 535 - #define HPB_DMAE_ASYNCMDR_ASBTMD21_MASK BIT(2) /* SDHI0 */ 536 - #define HPB_DMAE_ASYNCMDR_ASBTMD21_BURST BIT(2) /* SDHI0 */ 537 - #define HPB_DMAE_ASYNCMDR_ASBTMD21_NBURST 0 /* SDHI0 */ 538 - #define HPB_DMAE_ASYNCMDR_ASMD20_MASK BIT(1) /* SDHI1 */ 539 - #define HPB_DMAE_ASYNCMDR_ASMD20_SINGLE BIT(1) /* SDHI1 */ 540 - #define HPB_DMAE_ASYNCMDR_ASMD20_MULTI 0 /* SDHI1 */ 541 - #define HPB_DMAE_ASYNCMDR_ASBTMD20_MASK BIT(0) /* SDHI1 */ 542 - #define HPB_DMAE_ASYNCMDR_ASBTMD20_BURST BIT(0) /* SDHI1 */ 543 - #define HPB_DMAE_ASYNCMDR_ASBTMD20_NBURST 0 /* SDHI1 */ 544 - 545 - static const struct hpb_dmae_slave_config hpb_dmae_slaves[] = { 546 - { 547 - .id = HPBDMA_SLAVE_SDHI0_TX, 548 - .addr = 0xffe4c000 + 0x30, 549 - .dcr = HPB_DMAE_DCR_SPDS_16BIT | 550 - HPB_DMAE_DCR_DMDL | 551 - HPB_DMAE_DCR_DPDS_16BIT, 552 - .rstr = HPB_DMAE_ASYNCRSTR_ASRST21 | 553 - HPB_DMAE_ASYNCRSTR_ASRST22 | 554 - HPB_DMAE_ASYNCRSTR_ASRST23, 555 - .mdr = HPB_DMAE_ASYNCMDR_ASMD21_SINGLE | 556 - HPB_DMAE_ASYNCMDR_ASBTMD21_NBURST, 557 - .mdm = HPB_DMAE_ASYNCMDR_ASMD21_MASK | 558 - HPB_DMAE_ASYNCMDR_ASBTMD21_MASK, 559 - .port = 0x0D0C, 560 - .flags = HPB_DMAE_SET_ASYNC_RESET | HPB_DMAE_SET_ASYNC_MODE, 561 - .dma_ch = 21, 562 - }, { 563 - .id = HPBDMA_SLAVE_SDHI0_RX, 564 - .addr = 0xffe4c000 + 0x30, 565 - .dcr = HPB_DMAE_DCR_SMDL | 566 - HPB_DMAE_DCR_SPDS_16BIT | 567 - HPB_DMAE_DCR_DPDS_16BIT, 568 - .rstr = HPB_DMAE_ASYNCRSTR_ASRST21 | 569 - HPB_DMAE_ASYNCRSTR_ASRST22 | 570 - HPB_DMAE_ASYNCRSTR_ASRST23, 571 - .mdr = HPB_DMAE_ASYNCMDR_ASMD22_SINGLE | 572 - HPB_DMAE_ASYNCMDR_ASBTMD22_NBURST, 573 - .mdm = HPB_DMAE_ASYNCMDR_ASMD22_MASK | 574 - HPB_DMAE_ASYNCMDR_ASBTMD22_MASK, 575 - .port = 0x0D0C, 576 - .flags = HPB_DMAE_SET_ASYNC_RESET | HPB_DMAE_SET_ASYNC_MODE, 577 - .dma_ch = 22, 578 - }, 579 - }; 580 - 581 - static const struct hpb_dmae_channel hpb_dmae_channels[] = { 582 - HPB_DMAE_CHANNEL(0x93, HPBDMA_SLAVE_SDHI0_TX), /* ch. 21 */ 583 - HPB_DMAE_CHANNEL(0x93, HPBDMA_SLAVE_SDHI0_RX), /* ch. 22 */ 584 - }; 585 - 586 - static struct hpb_dmae_pdata dma_platform_data __initdata = { 587 - .slaves = hpb_dmae_slaves, 588 - .num_slaves = ARRAY_SIZE(hpb_dmae_slaves), 589 - .channels = hpb_dmae_channels, 590 - .num_channels = ARRAY_SIZE(hpb_dmae_channels), 591 - .ts_shift = { 592 - [XMIT_SZ_8BIT] = 0, 593 - [XMIT_SZ_16BIT] = 1, 594 - [XMIT_SZ_32BIT] = 2, 595 - }, 596 - .num_hw_channels = 44, 597 - }; 598 - 599 - static struct resource hpb_dmae_resources[] __initdata = { 600 - /* Channel registers */ 601 - DEFINE_RES_MEM(0xffc08000, 0x1000), 602 - /* Common registers */ 603 - DEFINE_RES_MEM(0xffc09000, 0x170), 604 - /* Asynchronous reset registers */ 605 - DEFINE_RES_MEM(0xffc00300, 4), 606 - /* Asynchronous mode registers */ 607 - DEFINE_RES_MEM(0xffc00400, 4), 608 - /* IRQ for DMA channels */ 609 - DEFINE_RES_NAMED(gic_iid(0x8e), 12, NULL, IORESOURCE_IRQ), 610 - }; 611 - 612 - static void __init r8a7779_register_hpb_dmae(void) 613 - { 614 - platform_device_register_resndata(NULL, "hpb-dma-engine", 615 - -1, hpb_dmae_resources, 616 - ARRAY_SIZE(hpb_dmae_resources), 617 - &dma_platform_data, 618 - sizeof(dma_platform_data)); 619 - } 620 - 621 - static struct platform_device *r8a7779_early_devices[] __initdata = { 622 - &tmu0_device, 623 - }; 624 - 625 - static struct platform_device *r8a7779_standard_devices[] __initdata = { 626 - &scif0_device, 627 - &scif1_device, 628 - &scif2_device, 629 - &scif3_device, 630 - &scif4_device, 631 - &scif5_device, 632 - &i2c0_device, 633 - &i2c1_device, 634 - &i2c2_device, 635 - &i2c3_device, 636 - &sata_device, 637 - }; 638 - 639 - void __init r8a7779_add_standard_devices(void) 640 - { 641 - #ifdef CONFIG_CACHE_L2X0 642 - /* Shared attribute override enable, 64K*16way */ 643 - l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff); 644 - #endif 645 - r8a7779_pm_init(); 646 - 647 - r8a7779_init_pm_domains(); 648 - 649 - platform_add_devices(r8a7779_early_devices, 650 - ARRAY_SIZE(r8a7779_early_devices)); 651 - platform_add_devices(r8a7779_standard_devices, 652 - ARRAY_SIZE(r8a7779_standard_devices)); 653 - r8a7779_register_hpb_dmae(); 654 - } 655 - 656 - void __init r8a7779_add_early_devices(void) 657 - { 658 - early_platform_add_devices(r8a7779_early_devices, 659 - ARRAY_SIZE(r8a7779_early_devices)); 660 - 661 - /* Early serial console setup is not included here due to 662 - * memory map collisions. The SCIF serial ports in r8a7779 663 - * are difficult to identity map 1:1 due to collision with the 664 - * virtual memory range used by the coherent DMA code on ARM. 665 - * 666 - * Anyone wanting to debug early can remove UPF_IOREMAP from 667 - * the sh-sci serial console platform data, adjust mapbase 668 - * to a static M:N virt:phys mapping that needs to be added to 669 - * the mappings passed with iotable_init() above. 670 - * 671 - * Then add a call to shmobile_setup_console() from this function. 672 - * 673 - * As a final step pass earlyprint=sh-sci.2,115200 on the kernel 674 - * command line in case of the marzen board. 675 - */ 676 - } 677 - 678 - static struct platform_device *r8a7779_late_devices[] __initdata = { 679 - &ehci0_device, 680 - &ehci1_device, 681 - &ohci0_device, 682 - &ohci1_device, 683 - }; 684 - 685 - void __init r8a7779_init_late(void) 686 - { 687 - /* get USB PHY */ 688 - phy = usb_get_phy(USB_PHY_TYPE_USB2); 689 - 690 - shmobile_init_late(); 691 - platform_add_devices(r8a7779_late_devices, 692 - ARRAY_SIZE(r8a7779_late_devices)); 693 - } 694 - 695 - #ifdef CONFIG_USE_OF 696 - void __init r8a7779_init_irq_dt(void) 697 - { 698 - #ifdef CONFIG_ARCH_SHMOBILE_LEGACY 699 - void __iomem *gic_dist_base = ioremap_nocache(0xf0001000, 0x1000); 700 - void __iomem *gic_cpu_base = ioremap_nocache(0xf0000100, 0x1000); 701 - #endif 702 85 gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE); 703 86 704 - #ifdef CONFIG_ARCH_SHMOBILE_LEGACY 705 - gic_init(0, 29, gic_dist_base, gic_cpu_base); 706 - #else 707 87 irqchip_init(); 708 - #endif 88 + 709 89 /* route all interrupts to ARM */ 710 90 __raw_writel(0xffffffff, INT2NTSR0); 711 91 __raw_writel(0x3fffffff, INT2NTSR1); ··· 80 740 81 741 #define MODEMR 0xffcc0020 82 742 83 - u32 __init r8a7779_read_mode_pins(void) 743 + static u32 __init r8a7779_read_mode_pins(void) 84 744 { 85 745 static u32 mode; 86 746 static bool mode_valid; ··· 96 756 return mode; 97 757 } 98 758 99 - static const char *r8a7779_compat_dt[] __initdata = { 759 + static void __init r8a7779_init_time(void) 760 + { 761 + r8a7779_clocks_init(r8a7779_read_mode_pins()); 762 + clocksource_of_init(); 763 + } 764 + 765 + static const char *const r8a7779_compat_dt[] __initconst = { 100 766 "renesas,r8a7779", 101 767 NULL, 102 768 }; 103 769 104 770 DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)") 771 + .smp = smp_ops(r8a7779_smp_ops), 105 772 .map_io = r8a7779_map_io, 106 773 .init_early = shmobile_init_delay, 774 + .init_time = r8a7779_init_time, 107 775 .init_irq = r8a7779_init_irq_dt, 108 776 .init_late = shmobile_init_late, 109 777 .dt_compat = r8a7779_compat_dt, 110 778 MACHINE_END 111 - #endif /* CONFIG_USE_OF */
+1 -1
arch/arm/mach-shmobile/setup-r8a7791.c
··· 23 23 #include "r8a7791.h" 24 24 #include "rcar-gen2.h" 25 25 26 - static const char *r8a7791_boards_compat_dt[] __initdata = { 26 + static const char *const r8a7791_boards_compat_dt[] __initconst = { 27 27 "renesas,r8a7791", 28 28 NULL, 29 29 };
-2
arch/arm/mach-shmobile/setup-rcar-gen2.c
··· 128 128 #endif /* CONFIG_ARM_ARCH_TIMER */ 129 129 130 130 rcar_gen2_clocks_init(mode); 131 - #ifdef CONFIG_ARCH_SHMOBILE_MULTI 132 131 clocksource_of_init(); 133 - #endif 134 132 } 135 133 136 134 struct memory_reserve_config {
+2 -739
arch/arm/mach-shmobile/setup-sh73a0.c
··· 18 18 #include <linux/init.h> 19 19 #include <linux/interrupt.h> 20 20 #include <linux/irq.h> 21 - #include <linux/platform_device.h> 22 21 #include <linux/of_platform.h> 23 22 #include <linux/delay.h> 24 23 #include <linux/input.h> 25 - #include <linux/i2c/i2c-sh_mobile.h> 26 24 #include <linux/io.h> 27 - #include <linux/serial_sci.h> 28 - #include <linux/sh_dma.h> 29 - #include <linux/sh_timer.h> 30 - #include <linux/platform_data/sh_ipmmu.h> 31 - #include <linux/platform_data/irq-renesas-intc-irqpin.h> 32 25 33 26 #include <asm/hardware/cache-l2x0.h> 34 - #include <asm/mach-types.h> 35 27 #include <asm/mach/map.h> 36 28 #include <asm/mach/arch.h> 37 29 #include <asm/mach/time.h> 38 30 39 31 #include "common.h" 40 - #include "dma-register.h" 41 - #include "intc.h" 42 - #include "irqs.h" 43 32 #include "sh73a0.h" 44 33 45 34 static struct map_desc sh73a0_io_desc[] __initdata = { ··· 43 54 }, 44 55 }; 45 56 46 - void __init sh73a0_map_io(void) 57 + static void __init sh73a0_map_io(void) 47 58 { 48 59 debug_ll_io_init(); 49 60 iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc)); 50 61 } 51 - 52 - /* PFC */ 53 - static struct resource pfc_resources[] __initdata = { 54 - DEFINE_RES_MEM(0xe6050000, 0x8000), 55 - DEFINE_RES_MEM(0xe605801c, 0x000c), 56 - }; 57 - 58 - void __init sh73a0_pinmux_init(void) 59 - { 60 - platform_device_register_simple("pfc-sh73a0", -1, pfc_resources, 61 - ARRAY_SIZE(pfc_resources)); 62 - } 63 - 64 - /* SCIF */ 65 - #define SH73A0_SCIF(scif_type, index, baseaddr, irq) \ 66 - static struct plat_sci_port scif##index##_platform_data = { \ 67 - .type = scif_type, \ 68 - .flags = UPF_BOOT_AUTOCONF, \ 69 - .scscr = SCSCR_RE | SCSCR_TE, \ 70 - }; \ 71 - \ 72 - static struct resource scif##index##_resources[] = { \ 73 - DEFINE_RES_MEM(baseaddr, 0x100), \ 74 - DEFINE_RES_IRQ(irq), \ 75 - }; \ 76 - \ 77 - static struct platform_device scif##index##_device = { \ 78 - .name = "sh-sci", \ 79 - .id = index, \ 80 - .resource = scif##index##_resources, \ 81 - .num_resources = ARRAY_SIZE(scif##index##_resources), \ 82 - .dev = { \ 83 - .platform_data = &scif##index##_platform_data, \ 84 - }, \ 85 - } 86 - 87 - SH73A0_SCIF(PORT_SCIFA, 0, 0xe6c40000, gic_spi(72)); 88 - SH73A0_SCIF(PORT_SCIFA, 1, 0xe6c50000, gic_spi(73)); 89 - SH73A0_SCIF(PORT_SCIFA, 2, 0xe6c60000, gic_spi(74)); 90 - SH73A0_SCIF(PORT_SCIFA, 3, 0xe6c70000, gic_spi(75)); 91 - SH73A0_SCIF(PORT_SCIFA, 4, 0xe6c80000, gic_spi(78)); 92 - SH73A0_SCIF(PORT_SCIFA, 5, 0xe6cb0000, gic_spi(79)); 93 - SH73A0_SCIF(PORT_SCIFA, 6, 0xe6cc0000, gic_spi(156)); 94 - SH73A0_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(143)); 95 - SH73A0_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(80)); 96 - 97 - static struct sh_timer_config cmt1_platform_data = { 98 - .channels_mask = 0x3f, 99 - }; 100 - 101 - static struct resource cmt1_resources[] = { 102 - DEFINE_RES_MEM(0xe6138000, 0x200), 103 - DEFINE_RES_IRQ(gic_spi(65)), 104 - }; 105 - 106 - static struct platform_device cmt1_device = { 107 - .name = "sh-cmt-48", 108 - .id = 1, 109 - .dev = { 110 - .platform_data = &cmt1_platform_data, 111 - }, 112 - .resource = cmt1_resources, 113 - .num_resources = ARRAY_SIZE(cmt1_resources), 114 - }; 115 - 116 - /* TMU */ 117 - static struct sh_timer_config tmu0_platform_data = { 118 - .channels_mask = 7, 119 - }; 120 - 121 - static struct resource tmu0_resources[] = { 122 - DEFINE_RES_MEM(0xfff60000, 0x2c), 123 - DEFINE_RES_IRQ(intcs_evt2irq(0xe80)), 124 - DEFINE_RES_IRQ(intcs_evt2irq(0xea0)), 125 - DEFINE_RES_IRQ(intcs_evt2irq(0xec0)), 126 - }; 127 - 128 - static struct platform_device tmu0_device = { 129 - .name = "sh-tmu", 130 - .id = 0, 131 - .dev = { 132 - .platform_data = &tmu0_platform_data, 133 - }, 134 - .resource = tmu0_resources, 135 - .num_resources = ARRAY_SIZE(tmu0_resources), 136 - }; 137 - 138 - static struct resource i2c0_resources[] = { 139 - [0] = DEFINE_RES_MEM(0xe6820000, 0x426), 140 - [1] = { 141 - .start = gic_spi(167), 142 - .end = gic_spi(170), 143 - .flags = IORESOURCE_IRQ, 144 - }, 145 - }; 146 - 147 - static struct resource i2c1_resources[] = { 148 - [0] = DEFINE_RES_MEM(0xe6822000, 0x426), 149 - [1] = { 150 - .start = gic_spi(51), 151 - .end = gic_spi(54), 152 - .flags = IORESOURCE_IRQ, 153 - }, 154 - }; 155 - 156 - static struct resource i2c2_resources[] = { 157 - [0] = DEFINE_RES_MEM(0xe6824000, 0x426), 158 - [1] = { 159 - .start = gic_spi(171), 160 - .end = gic_spi(174), 161 - .flags = IORESOURCE_IRQ, 162 - }, 163 - }; 164 - 165 - static struct resource i2c3_resources[] = { 166 - [0] = DEFINE_RES_MEM(0xe6826000, 0x426), 167 - [1] = { 168 - .start = gic_spi(183), 169 - .end = gic_spi(186), 170 - .flags = IORESOURCE_IRQ, 171 - }, 172 - }; 173 - 174 - static struct resource i2c4_resources[] = { 175 - [0] = DEFINE_RES_MEM(0xe6828000, 0x426), 176 - [1] = { 177 - .start = gic_spi(187), 178 - .end = gic_spi(190), 179 - .flags = IORESOURCE_IRQ, 180 - }, 181 - }; 182 - 183 - static struct i2c_sh_mobile_platform_data i2c_platform_data = { 184 - .clks_per_count = 2, 185 - }; 186 - 187 - static struct platform_device i2c0_device = { 188 - .name = "i2c-sh_mobile", 189 - .id = 0, 190 - .resource = i2c0_resources, 191 - .num_resources = ARRAY_SIZE(i2c0_resources), 192 - .dev = { 193 - .platform_data = &i2c_platform_data, 194 - }, 195 - }; 196 - 197 - static struct platform_device i2c1_device = { 198 - .name = "i2c-sh_mobile", 199 - .id = 1, 200 - .resource = i2c1_resources, 201 - .num_resources = ARRAY_SIZE(i2c1_resources), 202 - .dev = { 203 - .platform_data = &i2c_platform_data, 204 - }, 205 - }; 206 - 207 - static struct platform_device i2c2_device = { 208 - .name = "i2c-sh_mobile", 209 - .id = 2, 210 - .resource = i2c2_resources, 211 - .num_resources = ARRAY_SIZE(i2c2_resources), 212 - .dev = { 213 - .platform_data = &i2c_platform_data, 214 - }, 215 - }; 216 - 217 - static struct platform_device i2c3_device = { 218 - .name = "i2c-sh_mobile", 219 - .id = 3, 220 - .resource = i2c3_resources, 221 - .num_resources = ARRAY_SIZE(i2c3_resources), 222 - .dev = { 223 - .platform_data = &i2c_platform_data, 224 - }, 225 - }; 226 - 227 - static struct platform_device i2c4_device = { 228 - .name = "i2c-sh_mobile", 229 - .id = 4, 230 - .resource = i2c4_resources, 231 - .num_resources = ARRAY_SIZE(i2c4_resources), 232 - .dev = { 233 - .platform_data = &i2c_platform_data, 234 - }, 235 - }; 236 - 237 - static const struct sh_dmae_slave_config sh73a0_dmae_slaves[] = { 238 - { 239 - .slave_id = SHDMA_SLAVE_SCIF0_TX, 240 - .addr = 0xe6c40020, 241 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 242 - .mid_rid = 0x21, 243 - }, { 244 - .slave_id = SHDMA_SLAVE_SCIF0_RX, 245 - .addr = 0xe6c40024, 246 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 247 - .mid_rid = 0x22, 248 - }, { 249 - .slave_id = SHDMA_SLAVE_SCIF1_TX, 250 - .addr = 0xe6c50020, 251 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 252 - .mid_rid = 0x25, 253 - }, { 254 - .slave_id = SHDMA_SLAVE_SCIF1_RX, 255 - .addr = 0xe6c50024, 256 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 257 - .mid_rid = 0x26, 258 - }, { 259 - .slave_id = SHDMA_SLAVE_SCIF2_TX, 260 - .addr = 0xe6c60020, 261 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 262 - .mid_rid = 0x29, 263 - }, { 264 - .slave_id = SHDMA_SLAVE_SCIF2_RX, 265 - .addr = 0xe6c60024, 266 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 267 - .mid_rid = 0x2a, 268 - }, { 269 - .slave_id = SHDMA_SLAVE_SCIF3_TX, 270 - .addr = 0xe6c70020, 271 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 272 - .mid_rid = 0x2d, 273 - }, { 274 - .slave_id = SHDMA_SLAVE_SCIF3_RX, 275 - .addr = 0xe6c70024, 276 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 277 - .mid_rid = 0x2e, 278 - }, { 279 - .slave_id = SHDMA_SLAVE_SCIF4_TX, 280 - .addr = 0xe6c80020, 281 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 282 - .mid_rid = 0x39, 283 - }, { 284 - .slave_id = SHDMA_SLAVE_SCIF4_RX, 285 - .addr = 0xe6c80024, 286 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 287 - .mid_rid = 0x3a, 288 - }, { 289 - .slave_id = SHDMA_SLAVE_SCIF5_TX, 290 - .addr = 0xe6cb0020, 291 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 292 - .mid_rid = 0x35, 293 - }, { 294 - .slave_id = SHDMA_SLAVE_SCIF5_RX, 295 - .addr = 0xe6cb0024, 296 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 297 - .mid_rid = 0x36, 298 - }, { 299 - .slave_id = SHDMA_SLAVE_SCIF6_TX, 300 - .addr = 0xe6cc0020, 301 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 302 - .mid_rid = 0x1d, 303 - }, { 304 - .slave_id = SHDMA_SLAVE_SCIF6_RX, 305 - .addr = 0xe6cc0024, 306 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 307 - .mid_rid = 0x1e, 308 - }, { 309 - .slave_id = SHDMA_SLAVE_SCIF7_TX, 310 - .addr = 0xe6cd0020, 311 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 312 - .mid_rid = 0x19, 313 - }, { 314 - .slave_id = SHDMA_SLAVE_SCIF7_RX, 315 - .addr = 0xe6cd0024, 316 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 317 - .mid_rid = 0x1a, 318 - }, { 319 - .slave_id = SHDMA_SLAVE_SCIF8_TX, 320 - .addr = 0xe6c30040, 321 - .chcr = CHCR_TX(XMIT_SZ_8BIT), 322 - .mid_rid = 0x3d, 323 - }, { 324 - .slave_id = SHDMA_SLAVE_SCIF8_RX, 325 - .addr = 0xe6c30060, 326 - .chcr = CHCR_RX(XMIT_SZ_8BIT), 327 - .mid_rid = 0x3e, 328 - }, { 329 - .slave_id = SHDMA_SLAVE_SDHI0_TX, 330 - .addr = 0xee100030, 331 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 332 - .mid_rid = 0xc1, 333 - }, { 334 - .slave_id = SHDMA_SLAVE_SDHI0_RX, 335 - .addr = 0xee100030, 336 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 337 - .mid_rid = 0xc2, 338 - }, { 339 - .slave_id = SHDMA_SLAVE_SDHI1_TX, 340 - .addr = 0xee120030, 341 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 342 - .mid_rid = 0xc9, 343 - }, { 344 - .slave_id = SHDMA_SLAVE_SDHI1_RX, 345 - .addr = 0xee120030, 346 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 347 - .mid_rid = 0xca, 348 - }, { 349 - .slave_id = SHDMA_SLAVE_SDHI2_TX, 350 - .addr = 0xee140030, 351 - .chcr = CHCR_TX(XMIT_SZ_16BIT), 352 - .mid_rid = 0xcd, 353 - }, { 354 - .slave_id = SHDMA_SLAVE_SDHI2_RX, 355 - .addr = 0xee140030, 356 - .chcr = CHCR_RX(XMIT_SZ_16BIT), 357 - .mid_rid = 0xce, 358 - }, { 359 - .slave_id = SHDMA_SLAVE_MMCIF_TX, 360 - .addr = 0xe6bd0034, 361 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 362 - .mid_rid = 0xd1, 363 - }, { 364 - .slave_id = SHDMA_SLAVE_MMCIF_RX, 365 - .addr = 0xe6bd0034, 366 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 367 - .mid_rid = 0xd2, 368 - }, 369 - }; 370 - 371 - #define DMAE_CHANNEL(_offset) \ 372 - { \ 373 - .offset = _offset - 0x20, \ 374 - .dmars = _offset - 0x20 + 0x40, \ 375 - } 376 - 377 - static const struct sh_dmae_channel sh73a0_dmae_channels[] = { 378 - DMAE_CHANNEL(0x8000), 379 - DMAE_CHANNEL(0x8080), 380 - DMAE_CHANNEL(0x8100), 381 - DMAE_CHANNEL(0x8180), 382 - DMAE_CHANNEL(0x8200), 383 - DMAE_CHANNEL(0x8280), 384 - DMAE_CHANNEL(0x8300), 385 - DMAE_CHANNEL(0x8380), 386 - DMAE_CHANNEL(0x8400), 387 - DMAE_CHANNEL(0x8480), 388 - DMAE_CHANNEL(0x8500), 389 - DMAE_CHANNEL(0x8580), 390 - DMAE_CHANNEL(0x8600), 391 - DMAE_CHANNEL(0x8680), 392 - DMAE_CHANNEL(0x8700), 393 - DMAE_CHANNEL(0x8780), 394 - DMAE_CHANNEL(0x8800), 395 - DMAE_CHANNEL(0x8880), 396 - DMAE_CHANNEL(0x8900), 397 - DMAE_CHANNEL(0x8980), 398 - }; 399 - 400 - static struct sh_dmae_pdata sh73a0_dmae_platform_data = { 401 - .slave = sh73a0_dmae_slaves, 402 - .slave_num = ARRAY_SIZE(sh73a0_dmae_slaves), 403 - .channel = sh73a0_dmae_channels, 404 - .channel_num = ARRAY_SIZE(sh73a0_dmae_channels), 405 - .ts_low_shift = TS_LOW_SHIFT, 406 - .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT, 407 - .ts_high_shift = TS_HI_SHIFT, 408 - .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT, 409 - .ts_shift = dma_ts_shift, 410 - .ts_shift_num = ARRAY_SIZE(dma_ts_shift), 411 - .dmaor_init = DMAOR_DME, 412 - }; 413 - 414 - static struct resource sh73a0_dmae_resources[] = { 415 - DEFINE_RES_MEM(0xfe000020, 0x89e0), 416 - { 417 - .name = "error_irq", 418 - .start = gic_spi(129), 419 - .end = gic_spi(129), 420 - .flags = IORESOURCE_IRQ, 421 - }, 422 - { 423 - /* IRQ for channels 0-19 */ 424 - .start = gic_spi(109), 425 - .end = gic_spi(128), 426 - .flags = IORESOURCE_IRQ, 427 - }, 428 - }; 429 - 430 - static struct platform_device dma0_device = { 431 - .name = "sh-dma-engine", 432 - .id = 0, 433 - .resource = sh73a0_dmae_resources, 434 - .num_resources = ARRAY_SIZE(sh73a0_dmae_resources), 435 - .dev = { 436 - .platform_data = &sh73a0_dmae_platform_data, 437 - }, 438 - }; 439 - 440 - /* MPDMAC */ 441 - static const struct sh_dmae_slave_config sh73a0_mpdma_slaves[] = { 442 - { 443 - .slave_id = SHDMA_SLAVE_FSI2A_RX, 444 - .addr = 0xec230020, 445 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 446 - .mid_rid = 0xd6, /* CHECK ME */ 447 - }, { 448 - .slave_id = SHDMA_SLAVE_FSI2A_TX, 449 - .addr = 0xec230024, 450 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 451 - .mid_rid = 0xd5, /* CHECK ME */ 452 - }, { 453 - .slave_id = SHDMA_SLAVE_FSI2C_RX, 454 - .addr = 0xec230060, 455 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 456 - .mid_rid = 0xda, /* CHECK ME */ 457 - }, { 458 - .slave_id = SHDMA_SLAVE_FSI2C_TX, 459 - .addr = 0xec230064, 460 - .chcr = CHCR_TX(XMIT_SZ_32BIT), 461 - .mid_rid = 0xd9, /* CHECK ME */ 462 - }, { 463 - .slave_id = SHDMA_SLAVE_FSI2B_RX, 464 - .addr = 0xec240020, 465 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 466 - .mid_rid = 0x8e, /* CHECK ME */ 467 - }, { 468 - .slave_id = SHDMA_SLAVE_FSI2B_TX, 469 - .addr = 0xec240024, 470 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 471 - .mid_rid = 0x8d, /* CHECK ME */ 472 - }, { 473 - .slave_id = SHDMA_SLAVE_FSI2D_RX, 474 - .addr = 0xec240060, 475 - .chcr = CHCR_RX(XMIT_SZ_32BIT), 476 - .mid_rid = 0x9a, /* CHECK ME */ 477 - }, 478 - }; 479 - 480 - #define MPDMA_CHANNEL(a, b, c) \ 481 - { \ 482 - .offset = a, \ 483 - .dmars = b, \ 484 - .dmars_bit = c, \ 485 - .chclr_offset = (0x220 - 0x20) + a \ 486 - } 487 - 488 - static const struct sh_dmae_channel sh73a0_mpdma_channels[] = { 489 - MPDMA_CHANNEL(0x00, 0, 0), 490 - MPDMA_CHANNEL(0x10, 0, 8), 491 - MPDMA_CHANNEL(0x20, 4, 0), 492 - MPDMA_CHANNEL(0x30, 4, 8), 493 - MPDMA_CHANNEL(0x50, 8, 0), 494 - MPDMA_CHANNEL(0x70, 8, 8), 495 - }; 496 - 497 - static struct sh_dmae_pdata sh73a0_mpdma_platform_data = { 498 - .slave = sh73a0_mpdma_slaves, 499 - .slave_num = ARRAY_SIZE(sh73a0_mpdma_slaves), 500 - .channel = sh73a0_mpdma_channels, 501 - .channel_num = ARRAY_SIZE(sh73a0_mpdma_channels), 502 - .ts_low_shift = TS_LOW_SHIFT, 503 - .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT, 504 - .ts_high_shift = TS_HI_SHIFT, 505 - .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT, 506 - .ts_shift = dma_ts_shift, 507 - .ts_shift_num = ARRAY_SIZE(dma_ts_shift), 508 - .dmaor_init = DMAOR_DME, 509 - .chclr_present = 1, 510 - }; 511 - 512 - /* Resource order important! */ 513 - static struct resource sh73a0_mpdma_resources[] = { 514 - /* Channel registers and DMAOR */ 515 - DEFINE_RES_MEM(0xec618020, 0x270), 516 - /* DMARSx */ 517 - DEFINE_RES_MEM(0xec619000, 0xc), 518 - { 519 - .name = "error_irq", 520 - .start = gic_spi(181), 521 - .end = gic_spi(181), 522 - .flags = IORESOURCE_IRQ, 523 - }, 524 - { 525 - /* IRQ for channels 0-5 */ 526 - .start = gic_spi(175), 527 - .end = gic_spi(180), 528 - .flags = IORESOURCE_IRQ, 529 - }, 530 - }; 531 - 532 - static struct platform_device mpdma0_device = { 533 - .name = "sh-dma-engine", 534 - .id = 1, 535 - .resource = sh73a0_mpdma_resources, 536 - .num_resources = ARRAY_SIZE(sh73a0_mpdma_resources), 537 - .dev = { 538 - .platform_data = &sh73a0_mpdma_platform_data, 539 - }, 540 - }; 541 - 542 - static struct resource pmu_resources[] = { 543 - [0] = { 544 - .start = gic_spi(55), 545 - .end = gic_spi(55), 546 - .flags = IORESOURCE_IRQ, 547 - }, 548 - [1] = { 549 - .start = gic_spi(56), 550 - .end = gic_spi(56), 551 - .flags = IORESOURCE_IRQ, 552 - }, 553 - }; 554 - 555 - static struct platform_device pmu_device = { 556 - .name = "armv7-pmu", 557 - .id = -1, 558 - .num_resources = ARRAY_SIZE(pmu_resources), 559 - .resource = pmu_resources, 560 - }; 561 - 562 - /* an IPMMU module for ICB */ 563 - static struct resource ipmmu_resources[] = { 564 - DEFINE_RES_MEM(0xfe951000, 0x100), 565 - }; 566 - 567 - static const char * const ipmmu_dev_names[] = { 568 - "sh_mobile_lcdc_fb.0", 569 - }; 570 - 571 - static struct shmobile_ipmmu_platform_data ipmmu_platform_data = { 572 - .dev_names = ipmmu_dev_names, 573 - .num_dev_names = ARRAY_SIZE(ipmmu_dev_names), 574 - }; 575 - 576 - static struct platform_device ipmmu_device = { 577 - .name = "ipmmu", 578 - .id = -1, 579 - .dev = { 580 - .platform_data = &ipmmu_platform_data, 581 - }, 582 - .resource = ipmmu_resources, 583 - .num_resources = ARRAY_SIZE(ipmmu_resources), 584 - }; 585 - 586 - static struct renesas_intc_irqpin_config irqpin0_platform_data = { 587 - .irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */ 588 - .control_parent = true, 589 - }; 590 - 591 - static struct resource irqpin0_resources[] = { 592 - DEFINE_RES_MEM(0xe6900000, 4), /* ICR1A */ 593 - DEFINE_RES_MEM(0xe6900010, 4), /* INTPRI00A */ 594 - DEFINE_RES_MEM(0xe6900020, 1), /* INTREQ00A */ 595 - DEFINE_RES_MEM(0xe6900040, 1), /* INTMSK00A */ 596 - DEFINE_RES_MEM(0xe6900060, 1), /* INTMSKCLR00A */ 597 - DEFINE_RES_IRQ(gic_spi(1)), /* IRQ0 */ 598 - DEFINE_RES_IRQ(gic_spi(2)), /* IRQ1 */ 599 - DEFINE_RES_IRQ(gic_spi(3)), /* IRQ2 */ 600 - DEFINE_RES_IRQ(gic_spi(4)), /* IRQ3 */ 601 - DEFINE_RES_IRQ(gic_spi(5)), /* IRQ4 */ 602 - DEFINE_RES_IRQ(gic_spi(6)), /* IRQ5 */ 603 - DEFINE_RES_IRQ(gic_spi(7)), /* IRQ6 */ 604 - DEFINE_RES_IRQ(gic_spi(8)), /* IRQ7 */ 605 - }; 606 - 607 - static struct platform_device irqpin0_device = { 608 - .name = "renesas_intc_irqpin", 609 - .id = 0, 610 - .resource = irqpin0_resources, 611 - .num_resources = ARRAY_SIZE(irqpin0_resources), 612 - .dev = { 613 - .platform_data = &irqpin0_platform_data, 614 - }, 615 - }; 616 - 617 - static struct renesas_intc_irqpin_config irqpin1_platform_data = { 618 - .irq_base = irq_pin(8), /* IRQ8 -> IRQ15 */ 619 - .control_parent = true, /* Disable spurious IRQ10 */ 620 - }; 621 - 622 - static struct resource irqpin1_resources[] = { 623 - DEFINE_RES_MEM(0xe6900004, 4), /* ICR2A */ 624 - DEFINE_RES_MEM(0xe6900014, 4), /* INTPRI10A */ 625 - DEFINE_RES_MEM(0xe6900024, 1), /* INTREQ10A */ 626 - DEFINE_RES_MEM(0xe6900044, 1), /* INTMSK10A */ 627 - DEFINE_RES_MEM(0xe6900064, 1), /* INTMSKCLR10A */ 628 - DEFINE_RES_IRQ(gic_spi(9)), /* IRQ8 */ 629 - DEFINE_RES_IRQ(gic_spi(10)), /* IRQ9 */ 630 - DEFINE_RES_IRQ(gic_spi(11)), /* IRQ10 */ 631 - DEFINE_RES_IRQ(gic_spi(12)), /* IRQ11 */ 632 - DEFINE_RES_IRQ(gic_spi(13)), /* IRQ12 */ 633 - DEFINE_RES_IRQ(gic_spi(14)), /* IRQ13 */ 634 - DEFINE_RES_IRQ(gic_spi(15)), /* IRQ14 */ 635 - DEFINE_RES_IRQ(gic_spi(16)), /* IRQ15 */ 636 - }; 637 - 638 - static struct platform_device irqpin1_device = { 639 - .name = "renesas_intc_irqpin", 640 - .id = 1, 641 - .resource = irqpin1_resources, 642 - .num_resources = ARRAY_SIZE(irqpin1_resources), 643 - .dev = { 644 - .platform_data = &irqpin1_platform_data, 645 - }, 646 - }; 647 - 648 - static struct renesas_intc_irqpin_config irqpin2_platform_data = { 649 - .irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */ 650 - .control_parent = true, 651 - }; 652 - 653 - static struct resource irqpin2_resources[] = { 654 - DEFINE_RES_MEM(0xe6900008, 4), /* ICR3A */ 655 - DEFINE_RES_MEM(0xe6900018, 4), /* INTPRI20A */ 656 - DEFINE_RES_MEM(0xe6900028, 1), /* INTREQ20A */ 657 - DEFINE_RES_MEM(0xe6900048, 1), /* INTMSK20A */ 658 - DEFINE_RES_MEM(0xe6900068, 1), /* INTMSKCLR20A */ 659 - DEFINE_RES_IRQ(gic_spi(17)), /* IRQ16 */ 660 - DEFINE_RES_IRQ(gic_spi(18)), /* IRQ17 */ 661 - DEFINE_RES_IRQ(gic_spi(19)), /* IRQ18 */ 662 - DEFINE_RES_IRQ(gic_spi(20)), /* IRQ19 */ 663 - DEFINE_RES_IRQ(gic_spi(21)), /* IRQ20 */ 664 - DEFINE_RES_IRQ(gic_spi(22)), /* IRQ21 */ 665 - DEFINE_RES_IRQ(gic_spi(23)), /* IRQ22 */ 666 - DEFINE_RES_IRQ(gic_spi(24)), /* IRQ23 */ 667 - }; 668 - 669 - static struct platform_device irqpin2_device = { 670 - .name = "renesas_intc_irqpin", 671 - .id = 2, 672 - .resource = irqpin2_resources, 673 - .num_resources = ARRAY_SIZE(irqpin2_resources), 674 - .dev = { 675 - .platform_data = &irqpin2_platform_data, 676 - }, 677 - }; 678 - 679 - static struct renesas_intc_irqpin_config irqpin3_platform_data = { 680 - .irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */ 681 - .control_parent = true, 682 - }; 683 - 684 - static struct resource irqpin3_resources[] = { 685 - DEFINE_RES_MEM(0xe690000c, 4), /* ICR4A */ 686 - DEFINE_RES_MEM(0xe690001c, 4), /* INTPRI30A */ 687 - DEFINE_RES_MEM(0xe690002c, 1), /* INTREQ30A */ 688 - DEFINE_RES_MEM(0xe690004c, 1), /* INTMSK30A */ 689 - DEFINE_RES_MEM(0xe690006c, 1), /* INTMSKCLR30A */ 690 - DEFINE_RES_IRQ(gic_spi(25)), /* IRQ24 */ 691 - DEFINE_RES_IRQ(gic_spi(26)), /* IRQ25 */ 692 - DEFINE_RES_IRQ(gic_spi(27)), /* IRQ26 */ 693 - DEFINE_RES_IRQ(gic_spi(28)), /* IRQ27 */ 694 - DEFINE_RES_IRQ(gic_spi(29)), /* IRQ28 */ 695 - DEFINE_RES_IRQ(gic_spi(30)), /* IRQ29 */ 696 - DEFINE_RES_IRQ(gic_spi(31)), /* IRQ30 */ 697 - DEFINE_RES_IRQ(gic_spi(32)), /* IRQ31 */ 698 - }; 699 - 700 - static struct platform_device irqpin3_device = { 701 - .name = "renesas_intc_irqpin", 702 - .id = 3, 703 - .resource = irqpin3_resources, 704 - .num_resources = ARRAY_SIZE(irqpin3_resources), 705 - .dev = { 706 - .platform_data = &irqpin3_platform_data, 707 - }, 708 - }; 709 - 710 - static struct platform_device *sh73a0_early_devices[] __initdata = { 711 - &scif0_device, 712 - &scif1_device, 713 - &scif2_device, 714 - &scif3_device, 715 - &scif4_device, 716 - &scif5_device, 717 - &scif6_device, 718 - &scif7_device, 719 - &scif8_device, 720 - &tmu0_device, 721 - &ipmmu_device, 722 - &cmt1_device, 723 - }; 724 - 725 - static struct platform_device *sh73a0_late_devices[] __initdata = { 726 - &i2c0_device, 727 - &i2c1_device, 728 - &i2c2_device, 729 - &i2c3_device, 730 - &i2c4_device, 731 - &dma0_device, 732 - &mpdma0_device, 733 - &pmu_device, 734 - &irqpin0_device, 735 - &irqpin1_device, 736 - &irqpin2_device, 737 - &irqpin3_device, 738 - }; 739 - 740 - #define SRCR2 IOMEM(0xe61580b0) 741 - 742 - void __init sh73a0_add_standard_devices(void) 743 - { 744 - /* Clear software reset bit on SY-DMAC module */ 745 - __raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2); 746 - 747 - platform_add_devices(sh73a0_early_devices, 748 - ARRAY_SIZE(sh73a0_early_devices)); 749 - platform_add_devices(sh73a0_late_devices, 750 - ARRAY_SIZE(sh73a0_late_devices)); 751 - } 752 - 753 - /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 754 - void __init __weak sh73a0_register_twd(void) { } 755 - 756 - void __init sh73a0_earlytimer_init(void) 757 - { 758 - shmobile_init_delay(); 759 - #ifndef CONFIG_COMMON_CLK 760 - sh73a0_clock_init(); 761 - #endif 762 - shmobile_earlytimer_init(); 763 - sh73a0_register_twd(); 764 - } 765 - 766 - void __init sh73a0_add_early_devices(void) 767 - { 768 - early_platform_add_devices(sh73a0_early_devices, 769 - ARRAY_SIZE(sh73a0_early_devices)); 770 - 771 - /* setup early console here as well */ 772 - shmobile_setup_console(); 773 - } 774 - 775 - #ifdef CONFIG_USE_OF 776 62 777 63 static void __init sh73a0_generic_init(void) 778 64 { ··· 58 794 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 59 795 } 60 796 61 - static const char *sh73a0_boards_compat_dt[] __initdata = { 797 + static const char *const sh73a0_boards_compat_dt[] __initconst = { 62 798 "renesas,sh73a0", 63 799 NULL, 64 800 }; ··· 71 807 .init_late = shmobile_init_late, 72 808 .dt_compat = sh73a0_boards_compat_dt, 73 809 MACHINE_END 74 - #endif /* CONFIG_USE_OF */
-83
arch/arm/mach-shmobile/sh73a0.h
··· 1 1 #ifndef __ASM_SH73A0_H__ 2 2 #define __ASM_SH73A0_H__ 3 3 4 - /* DMA slave IDs */ 5 - enum { 6 - SHDMA_SLAVE_INVALID, 7 - SHDMA_SLAVE_SCIF0_TX, 8 - SHDMA_SLAVE_SCIF0_RX, 9 - SHDMA_SLAVE_SCIF1_TX, 10 - SHDMA_SLAVE_SCIF1_RX, 11 - SHDMA_SLAVE_SCIF2_TX, 12 - SHDMA_SLAVE_SCIF2_RX, 13 - SHDMA_SLAVE_SCIF3_TX, 14 - SHDMA_SLAVE_SCIF3_RX, 15 - SHDMA_SLAVE_SCIF4_TX, 16 - SHDMA_SLAVE_SCIF4_RX, 17 - SHDMA_SLAVE_SCIF5_TX, 18 - SHDMA_SLAVE_SCIF5_RX, 19 - SHDMA_SLAVE_SCIF6_TX, 20 - SHDMA_SLAVE_SCIF6_RX, 21 - SHDMA_SLAVE_SCIF7_TX, 22 - SHDMA_SLAVE_SCIF7_RX, 23 - SHDMA_SLAVE_SCIF8_TX, 24 - SHDMA_SLAVE_SCIF8_RX, 25 - SHDMA_SLAVE_SDHI0_TX, 26 - SHDMA_SLAVE_SDHI0_RX, 27 - SHDMA_SLAVE_SDHI1_TX, 28 - SHDMA_SLAVE_SDHI1_RX, 29 - SHDMA_SLAVE_SDHI2_TX, 30 - SHDMA_SLAVE_SDHI2_RX, 31 - SHDMA_SLAVE_MMCIF_TX, 32 - SHDMA_SLAVE_MMCIF_RX, 33 - SHDMA_SLAVE_FSI2A_TX, 34 - SHDMA_SLAVE_FSI2A_RX, 35 - SHDMA_SLAVE_FSI2B_TX, 36 - SHDMA_SLAVE_FSI2B_RX, 37 - SHDMA_SLAVE_FSI2C_TX, 38 - SHDMA_SLAVE_FSI2C_RX, 39 - SHDMA_SLAVE_FSI2D_RX, 40 - }; 41 - 42 - /* 43 - * SH73A0 IRQ LOCATION TABLE 44 - * 45 - * 416 ----------------------------------------- 46 - * IRQ0-IRQ15 47 - * 431 ----------------------------------------- 48 - * ... 49 - * 448 ----------------------------------------- 50 - * sh73a0-intcs 51 - * sh73a0-intca-irq-pins 52 - * 680 ----------------------------------------- 53 - * ... 54 - * 700 ----------------------------------------- 55 - * sh73a0-pint0 56 - * 731 ----------------------------------------- 57 - * 732 ----------------------------------------- 58 - * sh73a0-pint1 59 - * 739 ----------------------------------------- 60 - * ... 61 - * 800 ----------------------------------------- 62 - * IRQ16-IRQ31 63 - * 815 ----------------------------------------- 64 - * ... 65 - * 928 ----------------------------------------- 66 - * sh73a0-intca-irq-pins 67 - * 943 ----------------------------------------- 68 - */ 69 - 70 - /* PINT interrupts are located at Linux IRQ 700 and up */ 71 - #define SH73A0_PINT0_IRQ(irq) ((irq) + 700) 72 - #define SH73A0_PINT1_IRQ(irq) ((irq) + 732) 73 - 74 - extern void sh73a0_init_irq(void); 75 - extern void sh73a0_init_irq_dt(void); 76 - extern void sh73a0_map_io(void); 77 - extern void sh73a0_earlytimer_init(void); 78 - extern void sh73a0_add_early_devices(void); 79 - extern void sh73a0_add_standard_devices(void); 80 - extern void sh73a0_clock_init(void); 81 - extern void sh73a0_pinmux_init(void); 82 - extern void sh73a0_pm_init(void); 83 - extern struct clk sh73a0_extal1_clk; 84 - extern struct clk sh73a0_extal2_clk; 85 - extern struct clk sh73a0_extcki_clk; 86 - extern struct clk sh73a0_extalr_clk; 87 4 extern struct smp_operations sh73a0_smp_ops; 88 5 89 6 #endif /* __ASM_SH73A0_H__ */
+6 -15
arch/arm/mach-shmobile/smp-r8a7779.c
··· 23 23 #include <asm/cacheflush.h> 24 24 #include <asm/smp_plat.h> 25 25 #include <asm/smp_scu.h> 26 - #include <asm/smp_twd.h> 27 26 28 27 #include "common.h" 29 28 #include "pm-rcar.h" ··· 31 32 #define AVECR IOMEM(0xfe700040) 32 33 #define R8A7779_SCU_BASE 0xf0000000 33 34 34 - static struct rcar_sysc_ch r8a7779_ch_cpu1 = { 35 + static const struct rcar_sysc_ch r8a7779_ch_cpu1 = { 35 36 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ 36 37 .chan_bit = 1, /* ARM1 */ 37 38 .isr_bit = 1, /* ARM1 */ 38 39 }; 39 40 40 - static struct rcar_sysc_ch r8a7779_ch_cpu2 = { 41 + static const struct rcar_sysc_ch r8a7779_ch_cpu2 = { 41 42 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ 42 43 .chan_bit = 2, /* ARM2 */ 43 44 .isr_bit = 2, /* ARM2 */ 44 45 }; 45 46 46 - static struct rcar_sysc_ch r8a7779_ch_cpu3 = { 47 + static const struct rcar_sysc_ch r8a7779_ch_cpu3 = { 47 48 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ 48 49 .chan_bit = 3, /* ARM3 */ 49 50 .isr_bit = 3, /* ARM3 */ 50 51 }; 51 52 52 - static struct rcar_sysc_ch *r8a7779_ch_cpu[4] = { 53 + static const struct rcar_sysc_ch * const r8a7779_ch_cpu[4] = { 53 54 [1] = &r8a7779_ch_cpu1, 54 55 [2] = &r8a7779_ch_cpu2, 55 56 [3] = &r8a7779_ch_cpu3, 56 57 }; 57 58 58 - #if defined(CONFIG_HAVE_ARM_TWD) && !defined(CONFIG_ARCH_MULTIPLATFORM) 59 - static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, R8A7779_SCU_BASE + 0x600, 29); 60 - void __init r8a7779_register_twd(void) 61 - { 62 - twd_local_timer_register(&twd_local_timer); 63 - } 64 - #endif 65 - 66 59 static int r8a7779_platform_cpu_kill(unsigned int cpu) 67 60 { 68 - struct rcar_sysc_ch *ch = NULL; 61 + const struct rcar_sysc_ch *ch = NULL; 69 62 int ret = -EIO; 70 63 71 64 cpu = cpu_logical_map(cpu); ··· 73 82 74 83 static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) 75 84 { 76 - struct rcar_sysc_ch *ch = NULL; 85 + const struct rcar_sysc_ch *ch = NULL; 77 86 unsigned int lcpu = cpu_logical_map(cpu); 78 87 int ret; 79 88
+2 -2
arch/arm/mach-shmobile/smp-r8a7790.c
··· 26 26 #include "rcar-gen2.h" 27 27 #include "r8a7790.h" 28 28 29 - static struct rcar_sysc_ch r8a7790_ca15_scu = { 29 + static const struct rcar_sysc_ch r8a7790_ca15_scu = { 30 30 .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */ 31 31 .isr_bit = 12, /* CA15-SCU */ 32 32 }; 33 33 34 - static struct rcar_sysc_ch r8a7790_ca7_scu = { 34 + static const struct rcar_sysc_ch r8a7790_ca7_scu = { 35 35 .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */ 36 36 .isr_bit = 21, /* CA7-SCU */ 37 37 };
-8
arch/arm/mach-shmobile/smp-sh73a0.c
··· 33 33 34 34 #define SH73A0_SCU_BASE 0xf0000000 35 35 36 - #if defined(CONFIG_HAVE_ARM_TWD) && !defined(CONFIG_ARCH_MULTIPLATFORM) 37 - static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, SH73A0_SCU_BASE + 0x600, 29); 38 - void __init sh73a0_register_twd(void) 39 - { 40 - twd_local_timer_register(&twd_local_timer); 41 - } 42 - #endif 43 - 44 36 static int sh73a0_boot_secondary(unsigned int cpu, struct task_struct *idle) 45 37 { 46 38 unsigned int lcpu = cpu_logical_map(cpu);
-12
arch/arm/mach-shmobile/timer.c
··· 70 70 if (!max_freq) 71 71 return; 72 72 73 - #ifdef CONFIG_ARCH_SHMOBILE_LEGACY 74 - /* Non-multiplatform r8a73a4 SoC cannot use arch timer due 75 - * to GIC being initialized from C and arch timer via DT */ 76 - if (of_machine_is_compatible("renesas,r8a73a4")) 77 - has_arch_timer = false; 78 - 79 - /* Non-multiplatform r8a7790 SoC cannot use arch timer due 80 - * to GIC being initialized from C and arch timer via DT */ 81 - if (of_machine_is_compatible("renesas,r8a7790")) 82 - has_arch_timer = false; 83 - #endif 84 - 85 73 if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { 86 74 if (is_a7_a8_a9) 87 75 shmobile_setup_delay_hz(max_freq, 1, 3);
+51 -40
arch/arm/mach-spear/time.c
··· 66 66 static __iomem void *gpt_base; 67 67 static struct clk *gpt_clk; 68 68 69 - static void clockevent_set_mode(enum clock_event_mode mode, 70 - struct clock_event_device *clk_event_dev); 71 69 static int clockevent_next_event(unsigned long evt, 72 70 struct clock_event_device *clk_event_dev); 73 71 ··· 93 95 200, 16, clocksource_mmio_readw_up); 94 96 } 95 97 96 - static struct clock_event_device clkevt = { 97 - .name = "tmr0", 98 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 99 - .set_mode = clockevent_set_mode, 100 - .set_next_event = clockevent_next_event, 101 - .shift = 0, /* to be computed */ 102 - }; 98 + static inline void timer_shutdown(struct clock_event_device *evt) 99 + { 100 + u16 val = readw(gpt_base + CR(CLKEVT)); 103 101 104 - static void clockevent_set_mode(enum clock_event_mode mode, 105 - struct clock_event_device *clk_event_dev) 102 + /* stop the timer */ 103 + val &= ~CTRL_ENABLE; 104 + writew(val, gpt_base + CR(CLKEVT)); 105 + } 106 + 107 + static int spear_shutdown(struct clock_event_device *evt) 108 + { 109 + timer_shutdown(evt); 110 + 111 + return 0; 112 + } 113 + 114 + static int spear_set_oneshot(struct clock_event_device *evt) 115 + { 116 + u16 val; 117 + 118 + /* stop the timer */ 119 + timer_shutdown(evt); 120 + 121 + val = readw(gpt_base + CR(CLKEVT)); 122 + val |= CTRL_ONE_SHOT; 123 + writew(val, gpt_base + CR(CLKEVT)); 124 + 125 + return 0; 126 + } 127 + 128 + static int spear_set_periodic(struct clock_event_device *evt) 106 129 { 107 130 u32 period; 108 131 u16 val; 109 132 110 133 /* stop the timer */ 134 + timer_shutdown(evt); 135 + 136 + period = clk_get_rate(gpt_clk) / HZ; 137 + period >>= CTRL_PRESCALER16; 138 + writew(period, gpt_base + LOAD(CLKEVT)); 139 + 111 140 val = readw(gpt_base + CR(CLKEVT)); 112 - val &= ~CTRL_ENABLE; 141 + val &= ~CTRL_ONE_SHOT; 142 + val |= CTRL_ENABLE | CTRL_INT_ENABLE; 113 143 writew(val, gpt_base + CR(CLKEVT)); 114 144 115 - switch (mode) { 116 - case CLOCK_EVT_MODE_PERIODIC: 117 - period = clk_get_rate(gpt_clk) / HZ; 118 - period >>= CTRL_PRESCALER16; 119 - writew(period, gpt_base + LOAD(CLKEVT)); 120 - 121 - val = readw(gpt_base + CR(CLKEVT)); 122 - val &= ~CTRL_ONE_SHOT; 123 - val |= CTRL_ENABLE | CTRL_INT_ENABLE; 124 - writew(val, gpt_base + CR(CLKEVT)); 125 - 126 - break; 127 - case CLOCK_EVT_MODE_ONESHOT: 128 - val = readw(gpt_base + CR(CLKEVT)); 129 - val |= CTRL_ONE_SHOT; 130 - writew(val, gpt_base + CR(CLKEVT)); 131 - 132 - break; 133 - case CLOCK_EVT_MODE_UNUSED: 134 - case CLOCK_EVT_MODE_SHUTDOWN: 135 - case CLOCK_EVT_MODE_RESUME: 136 - 137 - break; 138 - default: 139 - pr_err("Invalid mode requested\n"); 140 - break; 141 - } 145 + return 0; 142 146 } 147 + 148 + static struct clock_event_device clkevt = { 149 + .name = "tmr0", 150 + .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 151 + .set_state_shutdown = spear_shutdown, 152 + .set_state_periodic = spear_set_periodic, 153 + .set_state_oneshot = spear_set_oneshot, 154 + .tick_resume = spear_shutdown, 155 + .set_next_event = clockevent_next_event, 156 + .shift = 0, /* to be computed */ 157 + }; 143 158 144 159 static int clockevent_next_event(unsigned long cycles, 145 160 struct clock_event_device *clk_event_dev) ··· 204 193 setup_irq(irq, &spear_timer_irq); 205 194 } 206 195 207 - const static struct of_device_id timer_of_match[] __initconst = { 196 + static const struct of_device_id const timer_of_match[] __initconst = { 208 197 { .compatible = "st,spear-timer", }, 209 198 { }, 210 199 };
+1 -1
arch/arm/mach-sti/board-dt.c
··· 14 14 15 15 #include "smp.h" 16 16 17 - static const char *stih41x_dt_match[] __initdata = { 17 + static const char *const stih41x_dt_match[] __initconst = { 18 18 "st,stih415", 19 19 "st,stih416", 20 20 "st,stih407",
+1 -1
arch/arm/mach-ux500/Makefile
··· 7 7 obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o 8 8 obj-$(CONFIG_MACH_MOP500) += board-mop500-regulators.o \ 9 9 board-mop500-audio.o 10 - obj-$(CONFIG_SMP) += platsmp.o headsmp.o 10 + obj-$(CONFIG_SMP) += platsmp.o 11 11 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 12 12 obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o 13 13
-1
arch/arm/mach-ux500/cpu-db8500.c
··· 154 154 }; 155 155 156 156 DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)") 157 - .smp = smp_ops(ux500_smp_ops), 158 157 .map_io = u8500_map_io, 159 158 .init_irq = ux500_init_irq, 160 159 /* we re-use nomadik timer here */
-37
arch/arm/mach-ux500/headsmp.S
··· 1 - /* 2 - * Copyright (c) 2009 ST-Ericsson 3 - * This file is based ARM Realview platform 4 - * Copyright (c) 2003 ARM Limited 5 - * All Rights Reserved 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 11 - #include <linux/linkage.h> 12 - #include <linux/init.h> 13 - 14 - /* 15 - * U8500 specific entry point for secondary CPUs. 16 - */ 17 - ENTRY(u8500_secondary_startup) 18 - mrc p15, 0, r0, c0, c0, 5 19 - and r0, r0, #15 20 - adr r4, 1f 21 - ldmia r4, {r5, r6} 22 - sub r4, r4, r5 23 - add r6, r6, r4 24 - pen: ldr r7, [r6] 25 - cmp r7, r0 26 - bne pen 27 - 28 - /* 29 - * we've been released from the holding pen: secondary_stack 30 - * should now contain the SVC stack for this core 31 - */ 32 - b secondary_startup 33 - ENDPROC(u8500_secondary_startup) 34 - 35 - .align 2 36 - 1: .long . 37 - .long pen_release
+50 -104
arch/arm/mach-ux500/platsmp.c
··· 28 28 #include "db8500-regs.h" 29 29 #include "id.h" 30 30 31 - static void __iomem *scu_base; 32 - static void __iomem *backupram; 31 + /* Magic triggers in backup RAM */ 32 + #define UX500_CPU1_JUMPADDR_OFFSET 0x1FF4 33 + #define UX500_CPU1_WAKEMAGIC_OFFSET 0x1FF0 33 34 34 - /* This is called from headsmp.S to wakeup the secondary core */ 35 - extern void u8500_secondary_startup(void); 36 - 37 - /* 38 - * Write pen_release in a way that is guaranteed to be visible to all 39 - * observers, irrespective of whether they're taking part in coherency 40 - * or not. This is necessary for the hotplug code to work reliably. 41 - */ 42 - static void write_pen_release(int val) 35 + static void wakeup_secondary(void) 43 36 { 44 - pen_release = val; 45 - smp_wmb(); 46 - sync_cache_w(&pen_release); 47 - } 37 + struct device_node *np; 38 + static void __iomem *backupram; 48 39 49 - static DEFINE_SPINLOCK(boot_lock); 50 - 51 - static void ux500_secondary_init(unsigned int cpu) 52 - { 53 - /* 54 - * let the primary processor know we're out of the 55 - * pen, then head off into the C entry point 56 - */ 57 - write_pen_release(-1); 58 - 59 - /* 60 - * Synchronise with the boot thread. 61 - */ 62 - spin_lock(&boot_lock); 63 - spin_unlock(&boot_lock); 64 - } 65 - 66 - static int ux500_boot_secondary(unsigned int cpu, struct task_struct *idle) 67 - { 68 - unsigned long timeout; 69 - 70 - /* 71 - * set synchronisation state between this boot processor 72 - * and the secondary one 73 - */ 74 - spin_lock(&boot_lock); 75 - 76 - /* 77 - * The secondary processor is waiting to be released from 78 - * the holding pen - release it, then wait for it to flag 79 - * that it has been released by resetting pen_release. 80 - */ 81 - write_pen_release(cpu_logical_map(cpu)); 82 - 83 - arch_send_wakeup_ipi_mask(cpumask_of(cpu)); 84 - 85 - timeout = jiffies + (1 * HZ); 86 - while (time_before(jiffies, timeout)) { 87 - if (pen_release == -1) 88 - break; 40 + np = of_find_compatible_node(NULL, NULL, "ste,dbx500-backupram"); 41 + if (!np) { 42 + pr_err("No backupram base address\n"); 43 + return; 44 + } 45 + backupram = of_iomap(np, 0); 46 + of_node_put(np); 47 + if (!backupram) { 48 + pr_err("No backupram remap\n"); 49 + return; 89 50 } 90 51 91 - /* 92 - * now the secondary core is starting up let it run its 93 - * calibrations, then wait for it to finish 94 - */ 95 - spin_unlock(&boot_lock); 96 - 97 - return pen_release != -1 ? -ENOSYS : 0; 98 - } 99 - 100 - static void __init wakeup_secondary(void) 101 - { 102 52 /* 103 53 * write the address of secondary startup into the backup ram register 104 54 * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the 105 55 * backup ram register at offset 0x1FF0, which is what boot rom code 106 - * is waiting for. This would wake up the secondary core from WFE 56 + * is waiting for. This will wake up the secondary core from WFE. 107 57 */ 108 - #define UX500_CPU1_JUMPADDR_OFFSET 0x1FF4 109 - __raw_writel(virt_to_phys(u8500_secondary_startup), 110 - backupram + UX500_CPU1_JUMPADDR_OFFSET); 111 - 112 - #define UX500_CPU1_WAKEMAGIC_OFFSET 0x1FF0 113 - __raw_writel(0xA1FEED01, 114 - backupram + UX500_CPU1_WAKEMAGIC_OFFSET); 58 + writel(virt_to_phys(secondary_startup), 59 + backupram + UX500_CPU1_JUMPADDR_OFFSET); 60 + writel(0xA1FEED01, 61 + backupram + UX500_CPU1_WAKEMAGIC_OFFSET); 115 62 116 63 /* make sure write buffer is drained */ 117 64 mb(); 118 - } 119 - 120 - /* 121 - * Initialise the CPU possible map early - this describes the CPUs 122 - * which may be present or become present in the system. 123 - */ 124 - static void __init ux500_smp_init_cpus(void) 125 - { 126 - unsigned int i, ncores; 127 - struct device_node *np; 128 - 129 - np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); 130 - scu_base = of_iomap(np, 0); 131 - of_node_put(np); 132 - if (!scu_base) 133 - return; 134 - backupram = ioremap(U8500_BACKUPRAM0_BASE, SZ_8K); 135 - ncores = scu_get_core_count(scu_base); 136 - 137 - /* sanity check */ 138 - if (ncores > nr_cpu_ids) { 139 - pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 140 - ncores, nr_cpu_ids); 141 - ncores = nr_cpu_ids; 142 - } 143 - 144 - for (i = 0; i < ncores; i++) 145 - set_cpu_possible(i, true); 65 + iounmap(backupram); 146 66 } 147 67 148 68 static void __init ux500_smp_prepare_cpus(unsigned int max_cpus) 149 69 { 70 + struct device_node *np; 71 + static void __iomem *scu_base; 72 + unsigned int ncores; 73 + int i; 74 + 75 + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); 76 + if (!np) { 77 + pr_err("No SCU base address\n"); 78 + return; 79 + } 80 + scu_base = of_iomap(np, 0); 81 + of_node_put(np); 82 + if (!scu_base) { 83 + pr_err("No SCU remap\n"); 84 + return; 85 + } 86 + 150 87 scu_enable(scu_base); 88 + ncores = scu_get_core_count(scu_base); 89 + for (i = 0; i < ncores; i++) 90 + set_cpu_possible(i, true); 91 + iounmap(scu_base); 92 + } 93 + 94 + static int ux500_boot_secondary(unsigned int cpu, struct task_struct *idle) 95 + { 151 96 wakeup_secondary(); 97 + arch_send_wakeup_ipi_mask(cpumask_of(cpu)); 98 + return 0; 152 99 } 153 100 154 101 struct smp_operations ux500_smp_ops __initdata = { 155 - .smp_init_cpus = ux500_smp_init_cpus, 156 102 .smp_prepare_cpus = ux500_smp_prepare_cpus, 157 - .smp_secondary_init = ux500_secondary_init, 158 103 .smp_boot_secondary = ux500_boot_secondary, 159 104 #ifdef CONFIG_HOTPLUG_CPU 160 105 .cpu_die = ux500_cpu_die, 161 106 #endif 162 107 }; 108 + CPU_METHOD_OF_DECLARE(ux500_smp, "ste,dbx500-smp", &ux500_smp_ops);
-1
arch/arm/mach-ux500/setup.h
··· 26 26 27 27 extern void ux500_timer_init(void); 28 28 29 - extern struct smp_operations ux500_smp_ops; 30 29 extern void ux500_cpu_die(unsigned int cpu); 31 30 32 31 #endif /* __ASM_ARCH_SETUP_H */
+1 -1
arch/arm/mach-w90x900/irq.c
··· 211 211 for (irqno = IRQ_WDT; irqno <= IRQ_ADC; irqno++) { 212 212 irq_set_chip_and_handler(irqno, &nuc900_irq_chip, 213 213 handle_level_irq); 214 - set_irq_flags(irqno, IRQF_VALID); 214 + irq_clear_status_flags(irqno, IRQ_NOREQUEST); 215 215 } 216 216 }
+32 -27
arch/arm/mach-w90x900/time.c
··· 48 48 49 49 static unsigned int timer0_load; 50 50 51 - static void nuc900_clockevent_setmode(enum clock_event_mode mode, 52 - struct clock_event_device *clk) 51 + static int nuc900_clockevent_shutdown(struct clock_event_device *evt) 53 52 { 54 - unsigned int val; 55 - 56 - val = __raw_readl(REG_TCSR0); 57 - val &= ~(0x03 << 27); 58 - 59 - switch (mode) { 60 - case CLOCK_EVT_MODE_PERIODIC: 61 - __raw_writel(timer0_load, REG_TICR0); 62 - val |= (PERIOD | COUNTEN | INTEN | PRESCALE); 63 - break; 64 - 65 - case CLOCK_EVT_MODE_ONESHOT: 66 - val |= (ONESHOT | COUNTEN | INTEN | PRESCALE); 67 - break; 68 - 69 - case CLOCK_EVT_MODE_UNUSED: 70 - case CLOCK_EVT_MODE_SHUTDOWN: 71 - case CLOCK_EVT_MODE_RESUME: 72 - break; 73 - } 53 + unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27); 74 54 75 55 __raw_writel(val, REG_TCSR0); 56 + return 0; 57 + } 58 + 59 + static int nuc900_clockevent_set_oneshot(struct clock_event_device *evt) 60 + { 61 + unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27); 62 + 63 + val |= (ONESHOT | COUNTEN | INTEN | PRESCALE); 64 + 65 + __raw_writel(val, REG_TCSR0); 66 + return 0; 67 + } 68 + 69 + static int nuc900_clockevent_set_periodic(struct clock_event_device *evt) 70 + { 71 + unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27); 72 + 73 + __raw_writel(timer0_load, REG_TICR0); 74 + val |= (PERIOD | COUNTEN | INTEN | PRESCALE); 75 + __raw_writel(val, REG_TCSR0); 76 + return 0; 76 77 } 77 78 78 79 static int nuc900_clockevent_setnextevent(unsigned long evt, ··· 91 90 } 92 91 93 92 static struct clock_event_device nuc900_clockevent_device = { 94 - .name = "nuc900-timer0", 95 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 96 - .set_mode = nuc900_clockevent_setmode, 97 - .set_next_event = nuc900_clockevent_setnextevent, 98 - .rating = 300, 93 + .name = "nuc900-timer0", 94 + .features = CLOCK_EVT_FEAT_PERIODIC | 95 + CLOCK_EVT_FEAT_ONESHOT, 96 + .set_state_shutdown = nuc900_clockevent_shutdown, 97 + .set_state_periodic = nuc900_clockevent_set_periodic, 98 + .set_state_oneshot = nuc900_clockevent_set_oneshot, 99 + .tick_resume = nuc900_clockevent_shutdown, 100 + .set_next_event = nuc900_clockevent_setnextevent, 101 + .rating = 300, 99 102 }; 100 103 101 104 /*IRQ handler for the timer*/
+1 -1
arch/arm/mach-zx/zx296702.c
··· 13 13 #include <linux/of_address.h> 14 14 #include <linux/of_platform.h> 15 15 16 - static const char *zx296702_dt_compat[] __initconst = { 16 + static const char *const zx296702_dt_compat[] __initconst = { 17 17 "zte,zx296702", 18 18 NULL, 19 19 };
+43 -27
arch/arm/plat-iop/time.c
··· 77 77 78 78 static unsigned long ticks_per_jiffy; 79 79 80 - static void iop_set_mode(enum clock_event_mode mode, 81 - struct clock_event_device *unused) 80 + static int iop_set_periodic(struct clock_event_device *evt) 82 81 { 83 82 u32 tmr = read_tmr0(); 84 83 85 - switch (mode) { 86 - case CLOCK_EVT_MODE_PERIODIC: 87 - write_tmr0(tmr & ~IOP_TMR_EN); 88 - write_tcr0(ticks_per_jiffy - 1); 89 - write_trr0(ticks_per_jiffy - 1); 90 - tmr |= (IOP_TMR_RELOAD | IOP_TMR_EN); 91 - break; 92 - case CLOCK_EVT_MODE_ONESHOT: 93 - /* ->set_next_event sets period and enables timer */ 94 - tmr &= ~(IOP_TMR_RELOAD | IOP_TMR_EN); 95 - break; 96 - case CLOCK_EVT_MODE_RESUME: 97 - tmr |= IOP_TMR_EN; 98 - break; 99 - case CLOCK_EVT_MODE_SHUTDOWN: 100 - case CLOCK_EVT_MODE_UNUSED: 101 - default: 102 - tmr &= ~IOP_TMR_EN; 103 - break; 104 - } 84 + write_tmr0(tmr & ~IOP_TMR_EN); 85 + write_tcr0(ticks_per_jiffy - 1); 86 + write_trr0(ticks_per_jiffy - 1); 87 + tmr |= (IOP_TMR_RELOAD | IOP_TMR_EN); 105 88 106 89 write_tmr0(tmr); 90 + return 0; 91 + } 92 + 93 + static int iop_set_oneshot(struct clock_event_device *evt) 94 + { 95 + u32 tmr = read_tmr0(); 96 + 97 + /* ->set_next_event sets period and enables timer */ 98 + tmr &= ~(IOP_TMR_RELOAD | IOP_TMR_EN); 99 + write_tmr0(tmr); 100 + return 0; 101 + } 102 + 103 + static int iop_shutdown(struct clock_event_device *evt) 104 + { 105 + u32 tmr = read_tmr0(); 106 + 107 + tmr &= ~IOP_TMR_EN; 108 + write_tmr0(tmr); 109 + return 0; 110 + } 111 + 112 + static int iop_resume(struct clock_event_device *evt) 113 + { 114 + u32 tmr = read_tmr0(); 115 + 116 + tmr |= IOP_TMR_EN; 117 + write_tmr0(tmr); 118 + return 0; 107 119 } 108 120 109 121 static struct clock_event_device iop_clockevent = { 110 - .name = "iop_timer0", 111 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 112 - .rating = 300, 113 - .set_next_event = iop_set_next_event, 114 - .set_mode = iop_set_mode, 122 + .name = "iop_timer0", 123 + .features = CLOCK_EVT_FEAT_PERIODIC | 124 + CLOCK_EVT_FEAT_ONESHOT, 125 + .rating = 300, 126 + .set_next_event = iop_set_next_event, 127 + .set_state_shutdown = iop_shutdown, 128 + .set_state_periodic = iop_set_periodic, 129 + .tick_resume = iop_resume, 130 + .set_state_oneshot = iop_set_oneshot, 115 131 }; 116 132 117 133 static irqreturn_t
+5 -4
arch/arm/plat-orion/gpio.c
··· 407 407 return 0; 408 408 } 409 409 410 - static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) 410 + static void gpio_irq_handler(unsigned __irq, struct irq_desc *desc) 411 411 { 412 - struct orion_gpio_chip *ochip = irq_get_handler_data(irq); 412 + struct orion_gpio_chip *ochip = irq_desc_get_handler_data(desc); 413 413 u32 cause, type; 414 414 int i; 415 415 ··· 582 582 583 583 for (i = 0; i < 4; i++) { 584 584 if (irqs[i]) { 585 - irq_set_handler_data(irqs[i], ochip); 586 - irq_set_chained_handler(irqs[i], gpio_irq_handler); 585 + irq_set_chained_handler_and_data(irqs[i], 586 + gpio_irq_handler, 587 + ochip); 587 588 } 588 589 } 589 590
+44 -41
arch/arm/plat-orion/time.c
··· 106 106 return 0; 107 107 } 108 108 109 - static void 110 - orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev) 109 + static int orion_clkevt_shutdown(struct clock_event_device *evt) 111 110 { 112 111 unsigned long flags; 113 112 u32 u; 114 113 115 114 local_irq_save(flags); 116 - if (mode == CLOCK_EVT_MODE_PERIODIC) { 117 - /* 118 - * Setup timer to fire at 1/HZ intervals. 119 - */ 120 - writel(ticks_per_jiffy - 1, timer_base + TIMER1_RELOAD_OFF); 121 - writel(ticks_per_jiffy - 1, timer_base + TIMER1_VAL_OFF); 122 115 123 - /* 124 - * Enable timer interrupt. 125 - */ 126 - u = readl(bridge_base + BRIDGE_MASK_OFF); 127 - writel(u | BRIDGE_INT_TIMER1, bridge_base + BRIDGE_MASK_OFF); 116 + /* Disable timer */ 117 + u = readl(timer_base + TIMER_CTRL_OFF); 118 + writel(u & ~TIMER1_EN, timer_base + TIMER_CTRL_OFF); 128 119 129 - /* 130 - * Enable timer. 131 - */ 132 - u = readl(timer_base + TIMER_CTRL_OFF); 133 - writel(u | TIMER1_EN | TIMER1_RELOAD_EN, 134 - timer_base + TIMER_CTRL_OFF); 135 - } else { 136 - /* 137 - * Disable timer. 138 - */ 139 - u = readl(timer_base + TIMER_CTRL_OFF); 140 - writel(u & ~TIMER1_EN, timer_base + TIMER_CTRL_OFF); 120 + /* Disable timer interrupt */ 121 + u = readl(bridge_base + BRIDGE_MASK_OFF); 122 + writel(u & ~BRIDGE_INT_TIMER1, bridge_base + BRIDGE_MASK_OFF); 141 123 142 - /* 143 - * Disable timer interrupt. 144 - */ 145 - u = readl(bridge_base + BRIDGE_MASK_OFF); 146 - writel(u & ~BRIDGE_INT_TIMER1, bridge_base + BRIDGE_MASK_OFF); 124 + /* ACK pending timer interrupt */ 125 + writel(bridge_timer1_clr_mask, bridge_base + BRIDGE_CAUSE_OFF); 147 126 148 - /* 149 - * ACK pending timer interrupt. 150 - */ 151 - writel(bridge_timer1_clr_mask, bridge_base + BRIDGE_CAUSE_OFF); 152 - 153 - } 154 127 local_irq_restore(flags); 128 + 129 + return 0; 130 + } 131 + 132 + static int orion_clkevt_set_periodic(struct clock_event_device *evt) 133 + { 134 + unsigned long flags; 135 + u32 u; 136 + 137 + local_irq_save(flags); 138 + 139 + /* Setup timer to fire at 1/HZ intervals */ 140 + writel(ticks_per_jiffy - 1, timer_base + TIMER1_RELOAD_OFF); 141 + writel(ticks_per_jiffy - 1, timer_base + TIMER1_VAL_OFF); 142 + 143 + /* Enable timer interrupt */ 144 + u = readl(bridge_base + BRIDGE_MASK_OFF); 145 + writel(u | BRIDGE_INT_TIMER1, bridge_base + BRIDGE_MASK_OFF); 146 + 147 + /* Enable timer */ 148 + u = readl(timer_base + TIMER_CTRL_OFF); 149 + writel(u | TIMER1_EN | TIMER1_RELOAD_EN, timer_base + TIMER_CTRL_OFF); 150 + 151 + local_irq_restore(flags); 152 + 153 + return 0; 155 154 } 156 155 157 156 static struct clock_event_device orion_clkevt = { 158 - .name = "orion_tick", 159 - .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, 160 - .rating = 300, 161 - .set_next_event = orion_clkevt_next_event, 162 - .set_mode = orion_clkevt_mode, 157 + .name = "orion_tick", 158 + .features = CLOCK_EVT_FEAT_ONESHOT | 159 + CLOCK_EVT_FEAT_PERIODIC, 160 + .rating = 300, 161 + .set_next_event = orion_clkevt_next_event, 162 + .set_state_shutdown = orion_clkevt_shutdown, 163 + .set_state_periodic = orion_clkevt_set_periodic, 164 + .set_state_oneshot = orion_clkevt_shutdown, 165 + .tick_resume = orion_clkevt_shutdown, 163 166 }; 164 167 165 168 static irqreturn_t orion_timer_interrupt(int irq, void *dev_id)
-17
arch/arm/plat-samsung/Kconfig
··· 217 217 help 218 218 Compile in platform device definition for PWM Timer 219 219 220 - config SAMSUNG_DEV_BACKLIGHT 221 - bool 222 - depends on SAMSUNG_DEV_PWM 223 - help 224 - Compile in platform device definition LCD backlight with PWM Timer 225 - 226 220 config S3C24XX_PWM 227 221 bool "PWM device support" 228 222 select PWM ··· 225 231 Support for exporting the PWM timer blocks via the pwm device 226 232 system 227 233 228 - config S3C_SETUP_CAMIF 229 - bool 230 - help 231 - Compile in common setup code for S3C CAMIF devices 232 - 233 234 config SAMSUNG_PM_GPIO 234 235 bool 235 236 default y if GPIO_SAMSUNG && PM 236 237 help 237 238 Include legacy GPIO power management code for platforms not using 238 239 pinctrl-samsung driver. 239 - 240 240 endif 241 - 242 - config S5P_DEV_MFC 243 - bool 244 - help 245 - Compile in setup memory (init) code for MFC 246 241 247 242 comment "Power management" 248 243
-5
arch/arm/plat-samsung/Makefile
··· 20 20 21 21 obj-$(CONFIG_SAMSUNG_ATAGS) += devs.o 22 22 obj-$(CONFIG_SAMSUNG_ATAGS) += dev-uart.o 23 - obj-$(CONFIG_S5P_DEV_MFC) += s5p-dev-mfc.o 24 - 25 - obj-$(CONFIG_SAMSUNG_DEV_BACKLIGHT) += dev-backlight.o 26 - 27 - obj-$(CONFIG_S3C_SETUP_CAMIF) += setup-camif.o 28 23 29 24 # PM support 30 25
+3 -3
arch/arm/plat-samsung/dev-backlight.c arch/arm/mach-s3c64xx/dev-backlight.c
··· 1 - /* linux/arch/arm/plat-samsung/dev-backlight.c 2 - * 1 + /* 3 2 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 4 3 * http://www.samsung.com 5 4 * ··· 17 18 18 19 #include <plat/devs.h> 19 20 #include <plat/gpio-cfg.h> 20 - #include <plat/backlight.h> 21 + 22 + #include "backlight.h" 21 23 22 24 struct samsung_bl_drvdata { 23 25 struct platform_pwm_backlight_data plat_data;
+10 -11
arch/arm/plat-samsung/include/plat/ata-core.h arch/arm/mach-s3c24xx/nand-core.h
··· 1 - /* linux/arch/arm/plat-samsung/include/plat/ata-core.h 2 - * 1 + /* 3 2 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 - * http://www.samsung.com 3 + * http://www.samsung.com/ 5 4 * 6 - * Samsung CF-ATA Controller core functions 5 + * S3C - Nand Controller core functions 7 6 * 8 7 * This program is free software; you can redistribute it and/or modify 9 8 * it under the terms of the GNU General Public License version 2 as 10 9 * published by the Free Software Foundation. 11 10 */ 12 11 13 - #ifndef __ASM_PLAT_ATA_CORE_H 14 - #define __ASM_PLAT_ATA_CORE_H __FILE__ 12 + #ifndef __ASM_ARCH_NAND_CORE_H 13 + #define __ASM_ARCH_NAND_CORE_H __FILE__ 15 14 16 15 /* These functions are only for use with the core support code, such as 17 16 * the cpu specific initialisation code 18 - */ 17 + */ 19 18 20 19 /* re-define device name depending on support. */ 21 - static inline void s3c_cfcon_setname(char *name) 20 + static inline void s3c_nand_setname(char *name) 22 21 { 23 - #ifdef CONFIG_SAMSUNG_DEV_IDE 24 - s3c_device_cfcon.name = name; 22 + #ifdef CONFIG_S3C_DEV_NAND 23 + s3c_device_nand.name = name; 25 24 #endif 26 25 } 27 26 28 - #endif /* __ASM_PLAT_ATA_CORE_H */ 27 + #endif /* __ASM_ARCH_NAND_CORE_H */
+1 -2
arch/arm/plat-samsung/include/plat/backlight.h arch/arm/mach-s3c64xx/backlight.h
··· 1 - /* linux/arch/arm/plat-samsung/include/plat/backlight.h 2 - * 1 + /* 3 2 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 4 3 * http://www.samsung.com 5 4 *
-2
arch/arm/plat-samsung/include/plat/fb-core.h arch/arm/mach-s3c24xx/fb-core.h
··· 1 1 /* 2 - * arch/arm/plat-samsung/include/plat/fb-core.h 3 - * 4 2 * Copyright 2010 Samsung Electronics Co., Ltd. 5 3 * Pawel Osciak <p.osciak@samsung.com> 6 4 *
+1 -2
arch/arm/plat-samsung/include/plat/irq-uart.h arch/arm/mach-s3c64xx/irq-uart.h
··· 1 - /* arch/arm/plat-samsung/include/plat/irq-uart.h 2 - * 1 + /* 3 2 * Copyright (c) 2010 Simtec Electronics 4 3 * Ben Dooks <ben@simtec.co.uk> 5 4 *
-31
arch/arm/plat-samsung/include/plat/keypad-core.h
··· 1 - /* 2 - * linux/arch/arm/plat-samsung/include/plat/keypad-core.h 3 - * 4 - * Copyright (C) 2010 Samsung Electronics Co.Ltd 5 - * Author: Joonyoung Shim <jy0922.shim@samsung.com> 6 - * 7 - * Samsung keypad controller core function 8 - * 9 - * This program is free software; you can redistribute it and/or modify it 10 - * under the terms of the GNU General Public License as published by the 11 - * Free Software Foundation; either version 2 of the License, or (at your 12 - * option) any later version. 13 - * 14 - */ 15 - 16 - #ifndef __ASM_ARCH_KEYPAD_CORE_H 17 - #define __ASM_ARCH_KEYPAD_CORE_H 18 - 19 - /* These function are only for use with the core support code, such as 20 - * the cpu specific initialisation code 21 - */ 22 - 23 - /* re-define device name depending on support. */ 24 - static inline void samsung_keypad_setname(char *name) 25 - { 26 - #ifdef CONFIG_SAMSUNG_DEV_KEYPAD 27 - samsung_device_keypad.name = name; 28 - #endif 29 - } 30 - 31 - #endif /* __ASM_ARCH_KEYPAD_CORE_H */
+10 -11
arch/arm/plat-samsung/include/plat/nand-core.h arch/arm/mach-s3c64xx/ata-core.h
··· 1 - /* arch/arm/plat-samsung/include/plat/nand-core.h 2 - * 1 + /* 3 2 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 - * http://www.samsung.com/ 3 + * http://www.samsung.com 5 4 * 6 - * S3C - Nand Controller core functions 5 + * Samsung CF-ATA Controller core functions 7 6 * 8 7 * This program is free software; you can redistribute it and/or modify 9 8 * it under the terms of the GNU General Public License version 2 as 10 9 * published by the Free Software Foundation. 11 10 */ 12 11 13 - #ifndef __ASM_ARCH_NAND_CORE_H 14 - #define __ASM_ARCH_NAND_CORE_H __FILE__ 12 + #ifndef __ASM_PLAT_ATA_CORE_H 13 + #define __ASM_PLAT_ATA_CORE_H __FILE__ 15 14 16 15 /* These functions are only for use with the core support code, such as 17 16 * the cpu specific initialisation code 18 - */ 17 + */ 19 18 20 19 /* re-define device name depending on support. */ 21 - static inline void s3c_nand_setname(char *name) 20 + static inline void s3c_cfcon_setname(char *name) 22 21 { 23 - #ifdef CONFIG_S3C_DEV_NAND 24 - s3c_device_nand.name = name; 22 + #ifdef CONFIG_SAMSUNG_DEV_IDE 23 + s3c_device_cfcon.name = name; 25 24 #endif 26 25 } 27 26 28 - #endif /* __ASM_ARCH_NAND_CORE_H */ 27 + #endif /* __ASM_PLAT_ATA_CORE_H */
-2
arch/arm/plat-samsung/include/plat/onenand-core.h arch/arm/mach-s3c64xx/onenand-core.h
··· 1 1 /* 2 - * linux/arch/arm/plat-samsung/onenand-core.h 3 - * 4 2 * Copyright (c) 2010 Samsung Electronics 5 3 * Kyungmin Park <kyungmin.park@samsung.com> 6 4 * Marek Szyprowski <m.szyprowski@samsung.com>
+1 -2
arch/arm/plat-samsung/include/plat/regs-srom.h arch/arm/mach-exynos/regs-srom.h
··· 1 - /* linux/arch/arm/plat-samsung/include/plat/regs-srom.h 2 - * 1 + /* 3 2 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 3 * http://www.samsung.com 5 4 *
+1 -2
arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h arch/arm/mach-s3c64xx/regs-usb-hsotg-phy.h
··· 1 - /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h 2 - * 1 + /* 3 2 * Copyright 2008 Openmoko, Inc. 4 3 * Copyright 2008 Simtec Electronics 5 4 * http://armlinux.simtec.co.uk/
arch/arm/plat-samsung/include/plat/spi-core.h arch/arm/mach-s3c24xx/spi-core.h
+1 -2
arch/arm/plat-samsung/include/plat/watchdog-reset.h arch/arm/mach-s3c64xx/watchdog-reset.h
··· 1 - /* arch/arm/plat-s3c/include/plat/watchdog-reset.h 2 - * 1 + /* 3 2 * Copyright (c) 2008 Simtec Electronics 4 3 * Ben Dooks <ben@simtec.co.uk> 5 4 *
arch/arm/plat-samsung/s5p-dev-mfc.c arch/arm/mach-exynos/s5p-dev-mfc.c
arch/arm/plat-samsung/setup-camif.c arch/arm/mach-s3c24xx/setup-camif.c
-1
drivers/irqchip/irq-sa11x0.c
··· 70 70 { 71 71 irq_set_chip_and_handler(irq, &sa1100_normal_chip, 72 72 handle_level_irq); 73 - set_irq_flags(irq, IRQF_VALID); 74 73 75 74 return 0; 76 75 }
+4 -26
drivers/video/fbdev/ep93xx-fb.c
··· 419 419 .fb_mmap = ep93xxfb_mmap, 420 420 }; 421 421 422 - static int ep93xxfb_calc_fbsize(struct ep93xxfb_mach_info *mach_info) 423 - { 424 - int i, fb_size = 0; 425 - 426 - if (mach_info->num_modes == EP93XXFB_USE_MODEDB) { 427 - fb_size = EP93XXFB_MAX_XRES * EP93XXFB_MAX_YRES * 428 - mach_info->bpp / 8; 429 - } else { 430 - for (i = 0; i < mach_info->num_modes; i++) { 431 - const struct fb_videomode *mode; 432 - int size; 433 - 434 - mode = &mach_info->modes[i]; 435 - size = mode->xres * mode->yres * mach_info->bpp / 8; 436 - if (size > fb_size) 437 - fb_size = size; 438 - } 439 - } 440 - 441 - return fb_size; 442 - } 443 - 444 422 static int ep93xxfb_alloc_videomem(struct fb_info *info) 445 423 { 446 - struct ep93xx_fbi *fbi = info->par; 447 424 char __iomem *virt_addr; 448 425 dma_addr_t phys_addr; 449 426 unsigned int fb_size; 450 427 451 - fb_size = ep93xxfb_calc_fbsize(fbi->mach_info); 428 + /* Maximum 16bpp -> used memory is maximum x*y*2 bytes */ 429 + fb_size = EP93XXFB_MAX_XRES * EP93XXFB_MAX_YRES * 2; 430 + 452 431 virt_addr = dma_alloc_writecombine(info->dev, fb_size, 453 432 &phys_addr, GFP_KERNEL); 454 433 if (!virt_addr) ··· 529 550 530 551 fb_get_options("ep93xx-fb", &video_mode); 531 552 err = fb_find_mode(&info->var, info, video_mode, 532 - fbi->mach_info->modes, fbi->mach_info->num_modes, 533 - fbi->mach_info->default_mode, fbi->mach_info->bpp); 553 + NULL, 0, NULL, 16); 534 554 if (err == 0) { 535 555 dev_err(info->dev, "No suitable video mode found\n"); 536 556 err = -EINVAL;
-8
include/linux/platform_data/video-ep93xx.h
··· 2 2 #define __VIDEO_EP93XX_H 3 3 4 4 struct platform_device; 5 - struct fb_videomode; 6 5 struct fb_info; 7 - 8 - #define EP93XXFB_USE_MODEDB 0 9 6 10 7 /* VideoAttributes flags */ 11 8 #define EP93XXFB_STATE_MACHINE_ENABLE (1 << 0) ··· 35 38 EP93XXFB_PIXEL_DATA_ENABLE) 36 39 37 40 struct ep93xxfb_mach_info { 38 - unsigned int num_modes; 39 - const struct fb_videomode *modes; 40 - const struct fb_videomode *default_mode; 41 - int bpp; 42 41 unsigned int flags; 43 - 44 42 int (*setup)(struct platform_device *pdev); 45 43 void (*teardown)(struct platform_device *pdev); 46 44 void (*blank)(int blank_mode, struct fb_info *info);