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

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

Pull ARM SoC platform updates from Olof Johansson:
"New or improved SoC support:

- add support for Atmel's SAMA5D2 SoC
- add support for Freescale i.MX6UL
- improved support for TI's DM814x platform
- misc fixes and improvements for RockChip platforms
- Marvell MVEBU suspend/resume support

A few driver changes that ideally would belong in the drivers branch
are also here (acked by appropriate maintainers):

- power key input driver for Freescale platforms (svns)
- RTC driver updates for Freescale platforms (svns/mxc)
- clk fixes for TI DM814/816X

+ a bunch of other changes for various platforms"

* tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (83 commits)
ARM: rockchip: pm: Fix PTR_ERR() argument
ARM: imx: mach-imx6ul: Fix allmodconfig build
clk: ti: fix for definition movement
ARM: uniphier: drop v7_invalidate_l1 call at secondary entry
memory: kill off set_irq_flags usage
rtc: snvs: select option REGMAP_MMIO
ARM: brcmstb: select ARCH_DMA_ADDR_T_64BIT for LPAE
ARM: BCM: Enable ARM erratum 798181 for BRCMSTB
ARM: OMAP2+: Fix power domain operations regression caused by 81xx
ARM: rockchip: enable PMU_GPIOINT_WAKEUP_EN when entering shallow suspend
ARM: rockchip: set correct stabilization thresholds in suspend
ARM: rockchip: rename osc_switch_to_32k variable
ARM: imx6ul: add fec MAC refrence clock and phy fixup init
ARM: imx6ul: add fec bits to GPR syscon definition
rtc: mxc: add support of device tree
dt-binding: document the binding for mxc rtc
rtc: mxc: use a second rtc clock
ARM: davinci: cp_intc: use IRQCHIP_SKIP_SET_WAKE instead of irq_set_wake callback
soc: mediatek: Fix SCPSYS compilation
ARM: at91/soc: add basic support for new sama5d2 SoC
...

+2728 -517
+5
Documentation/arm/Atmel/README
··· 90 90 + Datasheet 91 91 http://www.atmel.com/Images/Atmel-11238-32-bit-Cortex-A5-Microcontroller-SAMA5D4_Datasheet.pdf 92 92 93 + - sama5d2 family 94 + - sama5d27 95 + + Datasheet 96 + Coming soon 97 + 93 98 94 99 Linux kernel information 95 100 ------------------------
+2
Documentation/devicetree/bindings/arm/atmel-at91.txt
··· 27 27 o "atmel,at91sam9xe" 28 28 * "atmel,sama5" for SoCs using a Cortex-A5, shall be extended with the specific 29 29 SoC family: 30 + o "atmel,sama5d2" shall be extended with the specific SoC compatible: 31 + - "atmel,sama5d27" 30 32 o "atmel,sama5d3" shall be extended with the specific SoC compatible: 31 33 - "atmel,sama5d31" 32 34 - "atmel,sama5d33"
+78 -13
Documentation/devicetree/bindings/crypto/fsl-sec4.txt
··· 305 305 Node defines address range and the associated 306 306 interrupt for the SNVS function. This function 307 307 monitors security state information & reports 308 - security violations. 308 + security violations. This also included rtc, 309 + system power off and ON/OFF key. 309 310 310 311 - compatible 311 312 Usage: required 312 313 Value type: <string> 313 - Definition: Must include "fsl,sec-v4.0-mon". 314 + Definition: Must include "fsl,sec-v4.0-mon" and "syscon". 314 315 315 316 - reg 316 317 Usage: required ··· 342 341 the child address, parent address, & length. 343 342 344 343 - interrupts 345 - Usage: required 344 + Usage: optional 346 345 Value type: <prop_encoded-array> 347 346 Definition: Specifies the interrupts generated by this 348 347 device. The value of the interrupts property ··· 359 358 360 359 EXAMPLE 361 360 sec_mon@314000 { 362 - compatible = "fsl,sec-v4.0-mon"; 361 + compatible = "fsl,sec-v4.0-mon", "syscon"; 363 362 reg = <0x314000 0x1000>; 364 363 ranges = <0 0x314000 0x1000>; 365 364 interrupt-parent = <&mpic>; ··· 376 375 Value type: <string> 377 376 Definition: Must include "fsl,sec-v4.0-mon-rtc-lp". 378 377 379 - - reg 378 + - interrupts 380 379 Usage: required 381 - Value type: <prop-encoded-array> 382 - Definition: A standard property. Specifies the physical 383 - address and length of the SNVS LP configuration registers. 380 + Value type: <prop_encoded-array> 381 + Definition: Specifies the interrupts generated by this 382 + device. The value of the interrupts property 383 + consists of one interrupt specifier. The format 384 + of the specifier is defined by the binding document 385 + describing the node's interrupt parent. 386 + 387 + - regmap 388 + Usage: required 389 + Value type: <phandle> 390 + Definition: this is phandle to the register map node. 391 + 392 + - offset 393 + Usage: option 394 + value type: <u32> 395 + Definition: LP register offset. default it is 0x34. 384 396 385 397 EXAMPLE 386 - sec_mon_rtc_lp@314000 { 398 + sec_mon_rtc_lp@1 { 387 399 compatible = "fsl,sec-v4.0-mon-rtc-lp"; 388 - reg = <0x34 0x58>; 400 + interrupts = <93 2>; 401 + regmap = <&snvs>; 402 + offset = <0x34>; 403 + }; 404 + 405 + ===================================================================== 406 + System ON/OFF key driver 407 + 408 + The snvs-pwrkey is designed to enable POWER key function which controlled 409 + by SNVS ONOFF, the driver can report the status of POWER key and wakeup 410 + system if pressed after system suspend. 411 + 412 + - compatible: 413 + Usage: required 414 + Value type: <string> 415 + Definition: Mush include "fsl,sec-v4.0-pwrkey". 416 + 417 + - interrupts: 418 + Usage: required 419 + Value type: <prop_encoded-array> 420 + Definition: The SNVS ON/OFF interrupt number to the CPU(s). 421 + 422 + - linux,keycode: 423 + Usage: option 424 + Value type: <int> 425 + Definition: Keycode to emit, KEY_POWER by default. 426 + 427 + - wakeup-source: 428 + Usage: option 429 + Value type: <boo> 430 + Definition: Button can wake-up the system. 431 + 432 + - regmap: 433 + Usage: required: 434 + Value type: <phandle> 435 + Definition: this is phandle to the register map node. 436 + 437 + EXAMPLE: 438 + snvs-pwrkey@0x020cc000 { 439 + compatible = "fsl,sec-v4.0-pwrkey"; 440 + regmap = <&snvs>; 441 + interrupts = <0 4 0x4> 442 + linux,keycode = <116>; /* KEY_POWER */ 443 + wakeup; 389 444 }; 390 445 391 446 ===================================================================== ··· 517 460 compatible = "fsl,sec-v4.0-mon"; 518 461 reg = <0x314000 0x1000>; 519 462 ranges = <0 0x314000 0x1000>; 520 - interrupt-parent = <&mpic>; 521 - interrupts = <93 2>; 522 463 523 464 sec_mon_rtc_lp@34 { 524 465 compatible = "fsl,sec-v4.0-mon-rtc-lp"; 525 - reg = <0x34 0x58>; 466 + regmap = <&sec_mon>; 467 + offset = <0x34>; 468 + interrupts = <93 2>; 469 + }; 470 + 471 + snvs-pwrkey@0x020cc000 { 472 + compatible = "fsl,sec-v4.0-pwrkey"; 473 + regmap = <&sec_mon>; 474 + interrupts = <0 4 0x4>; 475 + linux,keycode = <116>; /* KEY_POWER */ 476 + wakeup; 526 477 }; 527 478 }; 528 479
+1
Documentation/devicetree/bindings/input/snvs-pwrkey.txt
··· 1 + See Documentation/devicetree/bindings/crypto/fsl-sec4.txt
+26
Documentation/devicetree/bindings/rtc/rtc-mxc.txt
··· 1 + * Real Time Clock of the i.MX SoCs 2 + 3 + RTC controller for the i.MX SoCs 4 + 5 + Required properties: 6 + - compatible: Should be "fsl,imx1-rtc" or "fsl,imx21-rtc". 7 + - reg: physical base address of the controller and length of memory mapped 8 + region. 9 + - interrupts: IRQ line for the RTC. 10 + - clocks: should contain two entries: 11 + * one for the input reference 12 + * one for the the SoC RTC 13 + - clock-names: should contain: 14 + * "ref" for the input reference clock 15 + * "ipg" for the SoC RTC clock 16 + 17 + Example: 18 + 19 + rtc@10007000 { 20 + compatible = "fsl,imx21-rtc"; 21 + reg = <0x10007000 0x1000>; 22 + interrupts = <22>; 23 + clocks = <&clks IMX27_CLK_CKIL>, 24 + <&clks IMX27_CLK_RTC_IPG_GATE>; 25 + clock-names = "ref", "ipg"; 26 + };
+41
Documentation/devicetree/bindings/soc/mediatek/scpsys.txt
··· 1 + MediaTek SCPSYS 2 + =============== 3 + 4 + The System Control Processor System (SCPSYS) has several power management 5 + related tasks in the system. The tasks include thermal measurement, dynamic 6 + voltage frequency scaling (DVFS), interrupt filter and lowlevel sleep control. 7 + The System Power Manager (SPM) inside the SCPSYS is for the MTCMOS power 8 + domain control. 9 + 10 + The driver implements the Generic PM domain bindings described in 11 + power/power_domain.txt. It provides the power domains defined in 12 + include/dt-bindings/power/mt8173-power.h. 13 + 14 + Required properties: 15 + - compatible: Must be "mediatek,mt8173-scpsys" 16 + - #power-domain-cells: Must be 1 17 + - reg: Address range of the SCPSYS unit 18 + - infracfg: must contain a phandle to the infracfg controller 19 + - clock, clock-names: clocks according to the common clock binding. 20 + The clocks needed "mm" and "mfg". These are the 21 + clocks which hardware needs to be enabled before 22 + enabling certain power domains. 23 + 24 + Example: 25 + 26 + scpsys: scpsys@10006000 { 27 + #power-domain-cells = <1>; 28 + compatible = "mediatek,mt8173-scpsys"; 29 + reg = <0 0x10006000 0 0x1000>; 30 + infracfg = <&infracfg>; 31 + clocks = <&clk26m>, 32 + <&topckgen CLK_TOP_MM_SEL>; 33 + clock-names = "mfg", "mm"; 34 + }; 35 + 36 + Example consumer: 37 + 38 + afe: mt8173-afe-pcm@11220000 { 39 + compatible = "mediatek,mt8173-afe-pcm"; 40 + power-domains = <&scpsys MT8173_POWER_DOMAIN_AUDIO>; 41 + };
+4 -1
MAINTAINERS
··· 1583 1583 M: Masahiro Yamada <yamada.masahiro@socionext.com> 1584 1584 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1585 1585 S: Maintained 1586 + F: arch/arm/boot/dts/uniphier* 1586 1587 F: arch/arm/mach-uniphier/ 1588 + F: drivers/pinctrl/uniphier/ 1589 + F: drivers/tty/serial/8250/8250_uniphier.c 1587 1590 N: uniphier 1588 1591 1589 1592 ARM/Ux500 ARM ARCHITECTURE ··· 1681 1678 R: Sören Brinkmann <soren.brinkmann@xilinx.com> 1682 1679 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1683 1680 W: http://wiki.xilinx.com 1684 - T: git git://git.xilinx.com/linux-xlnx.git 1681 + T: git https://github.com/Xilinx/linux-xlnx.git 1685 1682 S: Supported 1686 1683 F: arch/arm/mach-zynq/ 1687 1684 F: drivers/cpuidle/cpuidle-zynq.c
+15
arch/arm/Kconfig.debug
··· 141 141 depends on ARCH_AT91 142 142 depends on SOC_SAMA5 143 143 144 + config AT91_DEBUG_LL_DBGU3 145 + bool "Kernel low-level debugging on sama5d2" 146 + select DEBUG_AT91_UART 147 + depends on ARCH_AT91 148 + depends on SOC_SAMA5 149 + 144 150 config DEBUG_BCM2835 145 151 bool "Kernel low-level debugging on BCM2835 PL011 UART" 146 152 depends on ARCH_BCM2835 ··· 416 410 help 417 411 Say Y here if you want kernel low-level debugging support 418 412 on i.MX6SX. 413 + 414 + config DEBUG_IMX6UL_UART 415 + bool "i.MX6UL Debug UART" 416 + depends on SOC_IMX6UL 417 + help 418 + Say Y here if you want kernel low-level debugging support 419 + on i.MX6UL. 419 420 420 421 config DEBUG_IMX7D_UART 421 422 bool "i.MX7D Debug UART" ··· 1282 1269 DEBUG_IMX6Q_UART || \ 1283 1270 DEBUG_IMX6SL_UART || \ 1284 1271 DEBUG_IMX6SX_UART || \ 1272 + DEBUG_IMX6UL_UART || \ 1285 1273 DEBUG_IMX7D_UART 1286 1274 default 1 1287 1275 depends on ARCH_MXC ··· 1334 1320 DEBUG_IMX6Q_UART || \ 1335 1321 DEBUG_IMX6SL_UART || \ 1336 1322 DEBUG_IMX6SX_UART || \ 1323 + DEBUG_IMX6UL_UART || \ 1337 1324 DEBUG_IMX7D_UART 1338 1325 default "debug/ks8695.S" if DEBUG_KS8695_UART 1339 1326 default "debug/msm.S" if DEBUG_QCOM_UARTDM
+1
arch/arm/boot/dts/am4372.dtsi
··· 86 86 prcm: prcm@1f0000 { 87 87 compatible = "ti,am4-prcm"; 88 88 reg = <0x1f0000 0x11000>; 89 + interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; 89 90 90 91 prcm_clocks: clocks { 91 92 #address-cells = <1>;
+4 -1
arch/arm/include/debug/at91.S
··· 13 13 #define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */ 14 14 #elif defined(CONFIG_AT91_DEBUG_LL_DBGU1) 15 15 #define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */ 16 - #else 16 + #elif defined(CONFIG_AT91_DEBUG_LL_DBGU2) 17 17 /* On sama5d4, use USART3 as low level serial console */ 18 18 #define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */ 19 + #else 20 + /* On sama5d2, use UART1 as low level serial console */ 21 + #define AT91_DBGU 0xf8020000 19 22 #endif 20 23 21 24 #ifdef CONFIG_MMU
+13
arch/arm/include/debug/imx-uart.h
··· 90 90 #define IMX6SX_UART_BASE_ADDR(n) IMX6SX_UART##n##_BASE_ADDR 91 91 #define IMX6SX_UART_BASE(n) IMX6SX_UART_BASE_ADDR(n) 92 92 93 + #define IMX6UL_UART1_BASE_ADDR 0x02020000 94 + #define IMX6UL_UART2_BASE_ADDR 0x021e8000 95 + #define IMX6UL_UART3_BASE_ADDR 0x021ec000 96 + #define IMX6UL_UART4_BASE_ADDR 0x021f0000 97 + #define IMX6UL_UART5_BASE_ADDR 0x021f4000 98 + #define IMX6UL_UART6_BASE_ADDR 0x021fc000 99 + #define IMX6UL_UART7_BASE_ADDR 0x02018000 100 + #define IMX6UL_UART8_BASE_ADDR 0x02024000 101 + #define IMX6UL_UART_BASE_ADDR(n) IMX6UL_UART##n##_BASE_ADDR 102 + #define IMX6UL_UART_BASE(n) IMX6UL_UART_BASE_ADDR(n) 103 + 93 104 #define IMX7D_UART1_BASE_ADDR 0x30860000 94 105 #define IMX7D_UART2_BASE_ADDR 0x30890000 95 106 #define IMX7D_UART3_BASE_ADDR 0x30880000 ··· 135 124 #define UART_PADDR IMX_DEBUG_UART_BASE(IMX6SL) 136 125 #elif defined(CONFIG_DEBUG_IMX6SX_UART) 137 126 #define UART_PADDR IMX_DEBUG_UART_BASE(IMX6SX) 127 + #elif defined(CONFIG_DEBUG_IMX6UL_UART) 128 + #define UART_PADDR IMX_DEBUG_UART_BASE(IMX6UL) 138 129 #elif defined(CONFIG_DEBUG_IMX7D_UART) 139 130 #define UART_PADDR IMX_DEBUG_UART_BASE(IMX7D) 140 131
+1 -1
arch/arm/include/debug/zynq.S
··· 38 38 .endm 39 39 40 40 .macro senduart,rd,rx 41 - str \rd, [\rx, #UART_FIFO_OFFSET] @ TXDATA 41 + strb \rd, [\rx, #UART_FIFO_OFFSET] @ TXDATA 42 42 .endm 43 43 44 44 .macro waituart,rd,rx
+12
arch/arm/mach-at91/Kconfig
··· 8 8 select SOC_BUS 9 9 10 10 if ARCH_AT91 11 + config SOC_SAMA5D2 12 + bool "SAMA5D2 family" if ARCH_MULTI_V7 13 + select SOC_SAMA5 14 + select CACHE_L2X0 15 + select HAVE_FB_ATMEL 16 + select HAVE_AT91_UTMI 17 + select HAVE_AT91_USB_CLK 18 + select HAVE_AT91_H32MX 19 + select HAVE_AT91_GENERATED_CLK 20 + help 21 + Select this if ou are using one of Atmel's SAMA5D2 family SoC. 22 + 11 23 config SOC_SAMA5D3 12 24 bool "SAMA5D3 family" if ARCH_MULTI_V7 13 25 select SOC_SAMA5
+3
arch/arm/mach-at91/sama5.c
··· 18 18 #include "soc.h" 19 19 20 20 static const struct at91_soc sama5_socs[] = { 21 + AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D27_EXID_MATCH, 22 + "sama5d27", "sama5d2"), 21 23 AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D31_EXID_MATCH, 22 24 "sama5d31", "sama5d3"), 23 25 AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D33_EXID_MATCH, ··· 66 64 MACHINE_END 67 65 68 66 static const char *const sama5_alt_dt_board_compat[] __initconst = { 67 + "atmel,sama5d2", 69 68 "atmel,sama5d4", 70 69 NULL 71 70 };
+3
arch/arm/mach-at91/soc.h
··· 62 62 #define AT91SAM9XE256_CIDR_MATCH 0x329a93a0 63 63 #define AT91SAM9XE512_CIDR_MATCH 0x329aa3a0 64 64 65 + #define SAMA5D2_CIDR_MATCH 0x0a5c08c0 66 + #define SAMA5D27_EXID_MATCH 0x00000021 67 + 65 68 #define SAMA5D3_CIDR_MATCH 0x0a5c07c0 66 69 #define SAMA5D31_EXID_MATCH 0x00444300 67 70 #define SAMA5D33_EXID_MATCH 0x00414300
+2
arch/arm/mach-bcm/Kconfig
··· 140 140 config ARCH_BRCMSTB 141 141 bool "Broadcom BCM7XXX based boards" if ARCH_MULTI_V7 142 142 select ARM_GIC 143 + select ARM_ERRATA_798181 if SMP 143 144 select HAVE_ARM_ARCH_TIMER 144 145 select BRCMSTB_GISB_ARB 145 146 select BRCMSTB_L2_IRQ 146 147 select BCM7120_L2_IRQ 148 + select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE 147 149 select ARCH_WANT_OPTIONAL_GPIOLIB 148 150 help 149 151 Say Y if you intend to run the kernel on a Broadcom ARM-based STB
+1 -11
arch/arm/mach-davinci/cp_intc.c
··· 85 85 return 0; 86 86 } 87 87 88 - /* 89 - * Faking this allows us to to work with suspend functions of 90 - * generic drivers which call {enable|disable}_irq_wake for 91 - * wake up interrupt sources (eg RTC on DA850). 92 - */ 93 - static int cp_intc_set_wake(struct irq_data *d, unsigned int on) 94 - { 95 - return 0; 96 - } 97 - 98 88 static struct irq_chip cp_intc_irq_chip = { 99 89 .name = "cp_intc", 100 90 .irq_ack = cp_intc_ack_irq, 101 91 .irq_mask = cp_intc_mask_irq, 102 92 .irq_unmask = cp_intc_unmask_irq, 103 93 .irq_set_type = cp_intc_set_irq_type, 104 - .irq_set_wake = cp_intc_set_wake, 94 + .flags = IRQCHIP_SKIP_SET_WAKE, 105 95 }; 106 96 107 97 static struct irq_domain *cp_intc_domain;
+8
arch/arm/mach-imx/Kconfig
··· 548 548 help 549 549 This enables support for Freescale i.MX6 SoloX processor. 550 550 551 + config SOC_IMX6UL 552 + bool "i.MX6 UltraLite support" 553 + select PINCTRL_IMX6UL 554 + select SOC_IMX6 555 + 556 + help 557 + This enables support for Freescale i.MX6 UltraLite processor. 558 + 551 559 config SOC_IMX7D 552 560 bool "i.MX7 Dual support" 553 561 select PINCTRL_IMX7D
+1
arch/arm/mach-imx/Makefile
··· 83 83 obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o 84 84 obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o 85 85 obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o 86 + obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o 86 87 obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o 87 88 88 89 ifeq ($(CONFIG_SUSPEND),y)
+3
arch/arm/mach-imx/cpu.c
··· 130 130 case MXC_CPU_IMX6Q: 131 131 soc_id = "i.MX6Q"; 132 132 break; 133 + case MXC_CPU_IMX6UL: 134 + soc_id = "i.MX6UL"; 135 + break; 133 136 case MXC_CPU_IMX7D: 134 137 soc_id = "i.MX7D"; 135 138 break;
+88
arch/arm/mach-imx/mach-imx6ul.c
··· 1 + /* 2 + * Copyright (C) 2015 Freescale Semiconductor, Inc. 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + #include <linux/irqchip.h> 9 + #include <linux/mfd/syscon.h> 10 + #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> 11 + #include <linux/micrel_phy.h> 12 + #include <linux/of_platform.h> 13 + #include <linux/phy.h> 14 + #include <linux/regmap.h> 15 + #include <asm/mach/arch.h> 16 + #include <asm/mach/map.h> 17 + 18 + #include "common.h" 19 + 20 + static void __init imx6ul_enet_clk_init(void) 21 + { 22 + struct regmap *gpr; 23 + 24 + gpr = syscon_regmap_lookup_by_compatible("fsl,imx6ul-iomuxc-gpr"); 25 + if (!IS_ERR(gpr)) 26 + regmap_update_bits(gpr, IOMUXC_GPR1, IMX6UL_GPR1_ENET_CLK_DIR, 27 + IMX6UL_GPR1_ENET_CLK_OUTPUT); 28 + else 29 + pr_err("failed to find fsl,imx6ul-iomux-gpr regmap\n"); 30 + 31 + } 32 + 33 + static int ksz8081_phy_fixup(struct phy_device *dev) 34 + { 35 + if (dev && dev->interface == PHY_INTERFACE_MODE_MII) { 36 + phy_write(dev, 0x1f, 0x8110); 37 + phy_write(dev, 0x16, 0x201); 38 + } else if (dev && dev->interface == PHY_INTERFACE_MODE_RMII) { 39 + phy_write(dev, 0x1f, 0x8190); 40 + phy_write(dev, 0x16, 0x202); 41 + } 42 + 43 + return 0; 44 + } 45 + 46 + static void __init imx6ul_enet_phy_init(void) 47 + { 48 + if (IS_BUILTIN(CONFIG_PHYLIB)) 49 + phy_register_fixup_for_uid(PHY_ID_KSZ8081, 0xffffffff, 50 + ksz8081_phy_fixup); 51 + } 52 + 53 + static inline void imx6ul_enet_init(void) 54 + { 55 + imx6ul_enet_clk_init(); 56 + imx6ul_enet_phy_init(); 57 + } 58 + 59 + static void __init imx6ul_init_machine(void) 60 + { 61 + struct device *parent; 62 + 63 + parent = imx_soc_device_init(); 64 + if (parent == NULL) 65 + pr_warn("failed to initialize soc device\n"); 66 + 67 + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 68 + imx6ul_enet_init(); 69 + imx_anatop_init(); 70 + } 71 + 72 + static void __init imx6ul_init_irq(void) 73 + { 74 + imx_init_revision_from_anatop(); 75 + imx_src_init(); 76 + irqchip_init(); 77 + } 78 + 79 + static const char *imx6ul_dt_compat[] __initconst = { 80 + "fsl,imx6ul", 81 + NULL, 82 + }; 83 + 84 + DT_MACHINE_START(IMX6UL, "Freescale i.MX6 Ultralite (Device Tree)") 85 + .init_irq = imx6ul_init_irq, 86 + .init_machine = imx6ul_init_machine, 87 + .dt_compat = imx6ul_dt_compat, 88 + MACHINE_END
+6
arch/arm/mach-imx/mxc.h
··· 38 38 #define MXC_CPU_IMX6DL 0x61 39 39 #define MXC_CPU_IMX6SX 0x62 40 40 #define MXC_CPU_IMX6Q 0x63 41 + #define MXC_CPU_IMX6UL 0x64 41 42 #define MXC_CPU_IMX7D 0x72 42 43 43 44 #define IMX_DDR_TYPE_LPDDR2 1 ··· 164 163 static inline bool cpu_is_imx6sx(void) 165 164 { 166 165 return __mxc_cpu_type == MXC_CPU_IMX6SX; 166 + } 167 + 168 + static inline bool cpu_is_imx6ul(void) 169 + { 170 + return __mxc_cpu_type == MXC_CPU_IMX6UL; 167 171 } 168 172 169 173 static inline bool cpu_is_imx6q(void)
+1
arch/arm/mach-mediatek/Kconfig
··· 3 3 select ARM_GIC 4 4 select PINCTRL 5 5 select MTK_TIMER 6 + select MFD_SYSCON 6 7 help 7 8 Support for Mediatek MT65xx & MT81xx SoCs 8 9
+17 -12
arch/arm/mach-mvebu/coherency.c
··· 65 65 int ll_enable_coherency(void); 66 66 void ll_add_cpu_to_smp_group(void); 67 67 68 - int set_cpu_coherent(void) 69 - { 70 - if (!coherency_base) { 71 - pr_warn("Can't make current CPU cache coherent.\n"); 72 - pr_warn("Coherency fabric is not initialized\n"); 73 - return 1; 74 - } 75 - 76 - ll_add_cpu_to_smp_group(); 77 - return ll_enable_coherency(); 78 - } 79 - 80 68 static int mvebu_hwcc_notifier(struct notifier_block *nb, 81 69 unsigned long event, void *__dev) 82 70 { ··· 192 204 of_node_put(np); 193 205 194 206 return type; 207 + } 208 + 209 + int set_cpu_coherent(void) 210 + { 211 + int type = coherency_type(); 212 + 213 + if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) { 214 + if (!coherency_base) { 215 + pr_warn("Can't make current CPU cache coherent.\n"); 216 + pr_warn("Coherency fabric is not initialized\n"); 217 + return 1; 218 + } 219 + ll_add_cpu_to_smp_group(); 220 + return ll_enable_coherency(); 221 + } 222 + 223 + return 0; 195 224 } 196 225 197 226 int coherency_available(void)
+2 -2
arch/arm/mach-mvebu/common.h
··· 25 25 26 26 void __iomem *mvebu_get_scu_base(void); 27 27 28 - int mvebu_pm_init(void (*board_pm_enter)(void __iomem *sdram_reg, u32 srcmd)); 29 - 28 + int mvebu_pm_suspend_init(void (*board_pm_enter)(void __iomem *sdram_reg, 29 + u32 srcmd)); 30 30 #endif
+19 -11
arch/arm/mach-mvebu/pm-board.c
··· 1 1 /* 2 2 * Board-level suspend/resume support. 3 3 * 4 - * Copyright (C) 2014 Marvell 4 + * Copyright (C) 2014-2015 Marvell 5 5 * 6 6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 7 7 * ··· 20 20 #include <linux/slab.h> 21 21 #include "common.h" 22 22 23 - #define ARMADA_XP_GP_PIC_NR_GPIOS 3 23 + #define ARMADA_PIC_NR_GPIOS 3 24 24 25 25 static void __iomem *gpio_ctrl; 26 - static int pic_gpios[ARMADA_XP_GP_PIC_NR_GPIOS]; 27 - static int pic_raw_gpios[ARMADA_XP_GP_PIC_NR_GPIOS]; 26 + static int pic_gpios[ARMADA_PIC_NR_GPIOS]; 27 + static int pic_raw_gpios[ARMADA_PIC_NR_GPIOS]; 28 28 29 - static void mvebu_armada_xp_gp_pm_enter(void __iomem *sdram_reg, u32 srcmd) 29 + static void mvebu_armada_pm_enter(void __iomem *sdram_reg, u32 srcmd) 30 30 { 31 31 u32 reg, ackcmd; 32 32 int i; 33 33 34 34 /* Put 001 as value on the GPIOs */ 35 35 reg = readl(gpio_ctrl); 36 - for (i = 0; i < ARMADA_XP_GP_PIC_NR_GPIOS; i++) 36 + for (i = 0; i < ARMADA_PIC_NR_GPIOS; i++) 37 37 reg &= ~BIT(pic_raw_gpios[i]); 38 38 reg |= BIT(pic_raw_gpios[0]); 39 39 writel(reg, gpio_ctrl); 40 40 41 41 /* Prepare writing 111 to the GPIOs */ 42 42 ackcmd = readl(gpio_ctrl); 43 - for (i = 0; i < ARMADA_XP_GP_PIC_NR_GPIOS; i++) 43 + for (i = 0; i < ARMADA_PIC_NR_GPIOS; i++) 44 44 ackcmd |= BIT(pic_raw_gpios[i]); 45 45 46 46 srcmd = cpu_to_le32(srcmd); ··· 76 76 [ackcmd] "r" (ackcmd), [gpio_ctrl] "r" (gpio_ctrl) : "r1"); 77 77 } 78 78 79 - static int mvebu_armada_xp_gp_pm_init(void) 79 + static int __init mvebu_armada_pm_init(void) 80 80 { 81 81 struct device_node *np; 82 82 struct device_node *gpio_ctrl_np; ··· 89 89 if (!np) 90 90 return -ENODEV; 91 91 92 - for (i = 0; i < ARMADA_XP_GP_PIC_NR_GPIOS; i++) { 92 + for (i = 0; i < ARMADA_PIC_NR_GPIOS; i++) { 93 93 char *name; 94 94 struct of_phandle_args args; 95 95 ··· 134 134 if (!gpio_ctrl) 135 135 return -ENOMEM; 136 136 137 - mvebu_pm_init(mvebu_armada_xp_gp_pm_enter); 137 + mvebu_pm_suspend_init(mvebu_armada_pm_enter); 138 138 139 139 out: 140 140 of_node_put(np); 141 141 return ret; 142 142 } 143 143 144 - late_initcall(mvebu_armada_xp_gp_pm_init); 144 + /* 145 + * Registering the mvebu_board_pm_enter callback must be done before 146 + * the platform_suspend_ops will be registered. In the same time we 147 + * also need to have the gpio devices registered. That's why we use a 148 + * device_initcall_sync which is called after all the device_initcall 149 + * (used by the gpio device) but before the late_initcall (used to 150 + * register the platform_suspend_ops) 151 + */ 152 + device_initcall_sync(mvebu_armada_pm_init);
+65 -14
arch/arm/mach-mvebu/pm.c
··· 105 105 return of_translate_address(np, in_addr); 106 106 } 107 107 108 - static void mvebu_pm_store_bootinfo(void) 108 + static void mvebu_pm_store_armadaxp_bootinfo(u32 *store_addr) 109 109 { 110 - u32 *store_addr; 111 110 phys_addr_t resume_pc; 112 111 113 - store_addr = phys_to_virt(BOOT_INFO_ADDR); 114 112 resume_pc = virt_to_phys(armada_370_xp_cpu_resume); 115 113 116 114 /* ··· 149 151 writel(BOOT_MAGIC_LIST_END, store_addr); 150 152 } 151 153 152 - static int mvebu_pm_enter(suspend_state_t state) 154 + static int mvebu_pm_store_bootinfo(void) 153 155 { 154 - if (state != PM_SUSPEND_MEM) 155 - return -EINVAL; 156 + u32 *store_addr; 157 + 158 + store_addr = phys_to_virt(BOOT_INFO_ADDR); 159 + 160 + if (of_machine_is_compatible("marvell,armadaxp")) 161 + mvebu_pm_store_armadaxp_bootinfo(store_addr); 162 + else 163 + return -ENODEV; 164 + 165 + return 0; 166 + } 167 + 168 + static int mvebu_enter_suspend(void) 169 + { 170 + int ret; 171 + 172 + ret = mvebu_pm_store_bootinfo(); 173 + if (ret) 174 + return ret; 156 175 157 176 cpu_pm_enter(); 158 177 159 - mvebu_pm_store_bootinfo(); 160 178 cpu_suspend(0, mvebu_pm_powerdown); 161 179 162 180 outer_resume(); ··· 182 168 set_cpu_coherent(); 183 169 184 170 cpu_pm_exit(); 171 + return 0; 172 + } 173 + 174 + static int mvebu_pm_enter(suspend_state_t state) 175 + { 176 + switch (state) { 177 + case PM_SUSPEND_STANDBY: 178 + cpu_do_idle(); 179 + break; 180 + case PM_SUSPEND_MEM: 181 + pr_warn("Entering suspend to RAM. Only special wake-up sources will resume the system\n"); 182 + return mvebu_enter_suspend(); 183 + default: 184 + return -EINVAL; 185 + } 186 + return 0; 187 + } 188 + 189 + static int mvebu_pm_valid(suspend_state_t state) 190 + { 191 + if (state == PM_SUSPEND_STANDBY) 192 + return 1; 193 + 194 + if (state == PM_SUSPEND_MEM && mvebu_board_pm_enter != NULL) 195 + return 1; 185 196 186 197 return 0; 187 198 } 188 199 189 200 static const struct platform_suspend_ops mvebu_pm_ops = { 190 201 .enter = mvebu_pm_enter, 191 - .valid = suspend_valid_only_mem, 202 + .valid = mvebu_pm_valid, 192 203 }; 193 204 194 - int mvebu_pm_init(void (*board_pm_enter)(void __iomem *sdram_reg, u32 srcmd)) 205 + static int __init mvebu_pm_init(void) 206 + { 207 + if (!of_machine_is_compatible("marvell,armadaxp") && 208 + !of_machine_is_compatible("marvell,armada370") && 209 + !of_machine_is_compatible("marvell,armada380") && 210 + !of_machine_is_compatible("marvell,armada390")) 211 + return -ENODEV; 212 + 213 + suspend_set_ops(&mvebu_pm_ops); 214 + 215 + return 0; 216 + } 217 + 218 + 219 + late_initcall(mvebu_pm_init); 220 + 221 + int __init mvebu_pm_suspend_init(void (*board_pm_enter)(void __iomem *sdram_reg, 222 + u32 srcmd)) 195 223 { 196 224 struct device_node *np; 197 225 struct resource res; 198 - 199 - if (!of_machine_is_compatible("marvell,armadaxp")) 200 - return -ENODEV; 201 226 202 227 np = of_find_compatible_node(NULL, NULL, 203 228 "marvell,armada-xp-sdram-controller"); ··· 264 211 of_node_put(np); 265 212 266 213 mvebu_board_pm_enter = board_pm_enter; 267 - 268 - suspend_set_ops(&mvebu_pm_ops); 269 214 270 215 return 0; 271 216 }
+1 -2
arch/arm/mach-omap2/Makefile
··· 226 226 # EMU peripherals 227 227 obj-$(CONFIG_HW_PERF_EVENTS) += pmu.o 228 228 229 - iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o 230 - obj-y += $(iommu-m) $(iommu-y) 229 + obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o 231 230 232 231 # OMAP2420 MSDI controller integration support ("MMC") 233 232 obj-$(CONFIG_SOC_OMAP2420) += msdi.o
+3 -3
arch/arm/mach-omap2/board-generic.c
··· 169 169 NULL, 170 170 }; 171 171 172 - DT_MACHINE_START(TI81XX_DT, "Generic ti814x (Flattened Device Tree)") 172 + DT_MACHINE_START(TI814X_DT, "Generic ti814x (Flattened Device Tree)") 173 173 .reserve = omap_reserve, 174 174 .map_io = ti81xx_map_io, 175 175 .init_early = ti814x_init_early, ··· 297 297 DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)") 298 298 .reserve = omap_reserve, 299 299 .smp = smp_ops(omap4_smp_ops), 300 - .map_io = omap5_map_io, 300 + .map_io = dra7xx_map_io, 301 301 .init_early = dra7xx_init_early, 302 302 .init_late = dra7xx_init_late, 303 303 .init_irq = omap_gic_of_init, ··· 316 316 317 317 DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)") 318 318 .reserve = omap_reserve, 319 - .map_io = omap5_map_io, 319 + .map_io = dra7xx_map_io, 320 320 .init_early = dra7xx_init_early, 321 321 .init_late = dra7xx_init_late, 322 322 .init_irq = omap_gic_of_init,
+2 -1
arch/arm/mach-omap2/clockdomain.h
··· 216 216 extern void __init omap243x_clockdomains_init(void); 217 217 extern void __init omap3xxx_clockdomains_init(void); 218 218 extern void __init am33xx_clockdomains_init(void); 219 - extern void __init ti81xx_clockdomains_init(void); 219 + extern void __init ti814x_clockdomains_init(void); 220 + extern void __init ti816x_clockdomains_init(void); 220 221 extern void __init omap44xx_clockdomains_init(void); 221 222 extern void __init omap54xx_clockdomains_init(void); 222 223 extern void __init dra7xx_clockdomains_init(void);
+1 -1
arch/arm/mach-omap2/clockdomains7xx_data.c
··· 331 331 .dep_bit = DRA7XX_L4PER2_STATDEP_SHIFT, 332 332 .wkdep_srcs = l4per2_wkup_sleep_deps, 333 333 .sleepdep_srcs = l4per2_wkup_sleep_deps, 334 - .flags = CLKDM_CAN_HWSUP_SWSUP, 334 + .flags = CLKDM_CAN_SWSUP, 335 335 }; 336 336 337 337 static struct clockdomain mpu0_7xx_clkdm = {
+20 -3
arch/arm/mach-omap2/clockdomains81xx_data.c
··· 165 165 .flags = CLKDM_CAN_SWSUP, 166 166 }; 167 167 168 - static struct clockdomain *clockdomains_ti81xx[] __initdata = { 168 + static struct clockdomain *clockdomains_ti814x[] __initdata = { 169 + &alwon_l3_slow_81xx_clkdm, 170 + &alwon_l3_med_81xx_clkdm, 171 + &alwon_l3_fast_81xx_clkdm, 172 + &alwon_ethernet_81xx_clkdm, 173 + &mmu_81xx_clkdm, 174 + &mmu_cfg_81xx_clkdm, 175 + NULL, 176 + }; 177 + 178 + void __init ti814x_clockdomains_init(void) 179 + { 180 + clkdm_register_platform_funcs(&am33xx_clkdm_operations); 181 + clkdm_register_clkdms(clockdomains_ti814x); 182 + clkdm_complete_init(); 183 + } 184 + 185 + static struct clockdomain *clockdomains_ti816x[] __initdata = { 169 186 &alwon_mpu_816x_clkdm, 170 187 &alwon_l3_slow_81xx_clkdm, 171 188 &alwon_l3_med_81xx_clkdm, ··· 202 185 NULL, 203 186 }; 204 187 205 - void __init ti81xx_clockdomains_init(void) 188 + void __init ti816x_clockdomains_init(void) 206 189 { 207 190 clkdm_register_platform_funcs(&am33xx_clkdm_operations); 208 - clkdm_register_clkdms(clockdomains_ti81xx); 191 + clkdm_register_clkdms(clockdomains_ti816x); 209 192 clkdm_complete_init(); 210 193 } 211 194 #endif
+1
arch/arm/mach-omap2/common.h
··· 198 198 void __init am33xx_map_io(void); 199 199 void __init omap4_map_io(void); 200 200 void __init omap5_map_io(void); 201 + void __init dra7xx_map_io(void); 201 202 void __init ti81xx_map_io(void); 202 203 203 204 /**
+1
arch/arm/mach-omap2/control.c
··· 652 652 { .compatible = "ti,am4-scm", .data = &ctrl_data }, 653 653 { .compatible = "ti,omap2-scm", .data = &omap2_ctrl_data }, 654 654 { .compatible = "ti,omap3-scm", .data = &omap2_ctrl_data }, 655 + { .compatible = "ti,dm814-scm", .data = &ctrl_data }, 655 656 { .compatible = "ti,dm816-scrm", .data = &ctrl_data }, 656 657 { .compatible = "ti,omap4-scm-core", .data = &ctrl_data }, 657 658 { .compatible = "ti,omap5-scm-core", .data = &ctrl_data },
+62 -8
arch/arm/mach-omap2/io.c
··· 235 235 }; 236 236 #endif 237 237 238 - #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX) 238 + #ifdef CONFIG_SOC_OMAP5 239 239 static struct map_desc omap54xx_io_desc[] __initdata = { 240 240 { 241 241 .virtual = L3_54XX_VIRT, ··· 259 259 .virtual = L4_PER_54XX_VIRT, 260 260 .pfn = __phys_to_pfn(L4_PER_54XX_PHYS), 261 261 .length = L4_PER_54XX_SIZE, 262 + .type = MT_DEVICE, 263 + }, 264 + }; 265 + #endif 266 + 267 + #ifdef CONFIG_SOC_DRA7XX 268 + static struct map_desc dra7xx_io_desc[] __initdata = { 269 + { 270 + .virtual = L4_CFG_MPU_DRA7XX_VIRT, 271 + .pfn = __phys_to_pfn(L4_CFG_MPU_DRA7XX_PHYS), 272 + .length = L4_CFG_MPU_DRA7XX_SIZE, 273 + .type = MT_DEVICE, 274 + }, 275 + { 276 + .virtual = L3_MAIN_SN_DRA7XX_VIRT, 277 + .pfn = __phys_to_pfn(L3_MAIN_SN_DRA7XX_PHYS), 278 + .length = L3_MAIN_SN_DRA7XX_SIZE, 279 + .type = MT_DEVICE, 280 + }, 281 + { 282 + .virtual = L4_PER1_DRA7XX_VIRT, 283 + .pfn = __phys_to_pfn(L4_PER1_DRA7XX_PHYS), 284 + .length = L4_PER1_DRA7XX_SIZE, 285 + .type = MT_DEVICE, 286 + }, 287 + { 288 + .virtual = L4_PER2_DRA7XX_VIRT, 289 + .pfn = __phys_to_pfn(L4_PER2_DRA7XX_PHYS), 290 + .length = L4_PER2_DRA7XX_SIZE, 291 + .type = MT_DEVICE, 292 + }, 293 + { 294 + .virtual = L4_PER3_DRA7XX_VIRT, 295 + .pfn = __phys_to_pfn(L4_PER3_DRA7XX_PHYS), 296 + .length = L4_PER3_DRA7XX_SIZE, 297 + .type = MT_DEVICE, 298 + }, 299 + { 300 + .virtual = L4_CFG_DRA7XX_VIRT, 301 + .pfn = __phys_to_pfn(L4_CFG_DRA7XX_PHYS), 302 + .length = L4_CFG_DRA7XX_SIZE, 303 + .type = MT_DEVICE, 304 + }, 305 + { 306 + .virtual = L4_WKUP_DRA7XX_VIRT, 307 + .pfn = __phys_to_pfn(L4_WKUP_DRA7XX_PHYS), 308 + .length = L4_WKUP_DRA7XX_SIZE, 262 309 .type = MT_DEVICE, 263 310 }, 264 311 }; ··· 355 308 } 356 309 #endif 357 310 358 - #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX) 311 + #ifdef CONFIG_SOC_OMAP5 359 312 void __init omap5_map_io(void) 360 313 { 361 314 iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc)); 315 + } 316 + #endif 317 + 318 + #ifdef CONFIG_SOC_DRA7XX 319 + void __init dra7xx_map_io(void) 320 + { 321 + iotable_init(dra7xx_io_desc, ARRAY_SIZE(dra7xx_io_desc)); 362 322 } 363 323 #endif 364 324 /* ··· 607 553 omap2_prcm_base_init(); 608 554 omap3xxx_voltagedomains_init(); 609 555 omap3xxx_powerdomains_init(); 610 - ti81xx_clockdomains_init(); 611 - ti81xx_hwmod_init(); 556 + ti814x_clockdomains_init(); 557 + dm814x_hwmod_init(); 612 558 omap_hwmod_init_postsetup(); 613 559 if (of_have_populated_dt()) 614 - omap_clk_soc_init = ti81xx_dt_clk_init; 560 + omap_clk_soc_init = dm814x_dt_clk_init; 615 561 } 616 562 617 563 void __init ti816x_init_early(void) ··· 624 570 omap2_prcm_base_init(); 625 571 omap3xxx_voltagedomains_init(); 626 572 omap3xxx_powerdomains_init(); 627 - ti81xx_clockdomains_init(); 628 - ti81xx_hwmod_init(); 573 + ti816x_clockdomains_init(); 574 + dm816x_hwmod_init(); 629 575 omap_hwmod_init_postsetup(); 630 576 if (of_have_populated_dt()) 631 - omap_clk_soc_init = ti81xx_dt_clk_init; 577 + omap_clk_soc_init = dm816x_dt_clk_init; 632 578 } 633 579 #endif 634 580
+63
arch/arm/mach-omap2/iomap.h
··· 194 194 #define L4_PER_54XX_PHYS L4_PER_54XX_BASE /* 0x48000000 --> 0xfa000000 */ 195 195 #define L4_PER_54XX_VIRT (L4_PER_54XX_PHYS + OMAP2_L4_IO_OFFSET) 196 196 #define L4_PER_54XX_SIZE SZ_4M 197 + 198 + /* 199 + * ---------------------------------------------------------------------------- 200 + * DRA7xx specific IO mapping 201 + * ---------------------------------------------------------------------------- 202 + */ 203 + /* 204 + * L3_MAIN_SN_DRA7XX_PHYS 0x44000000 --> 0xf8000000 205 + * The overall space is 24MiB (0x4400_0000<->0x457F_FFFF), but mapping 206 + * everything is just inefficient, since, there are too many address holes. 207 + */ 208 + #define L3_MAIN_SN_DRA7XX_PHYS L3_MAIN_SN_DRA7XX_BASE 209 + #define L3_MAIN_SN_DRA7XX_VIRT (L3_MAIN_SN_DRA7XX_PHYS + OMAP4_L3_IO_OFFSET) 210 + #define L3_MAIN_SN_DRA7XX_SIZE SZ_1M 211 + 212 + /* 213 + * L4_PER1_DRA7XX_PHYS (0x4800_000<>0x480D_2FFF) -> 0.82MiB (alloc 1MiB) 214 + * (0x48000000<->0x48100000) <=> (0xFA000000<->0xFA100000) 215 + */ 216 + #define L4_PER1_DRA7XX_PHYS L4_PER1_DRA7XX_BASE 217 + #define L4_PER1_DRA7XX_VIRT (L4_PER1_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) 218 + #define L4_PER1_DRA7XX_SIZE SZ_1M 219 + 220 + /* 221 + * L4_CFG_MPU_DRA7XX_PHYS (0x48210000<>0x482A_F2FF) -> 0.62MiB (alloc 1MiB) 222 + * (0x48210000<->0x48310000) <=> (0xFA210000<->0xFA310000) 223 + * NOTE: This is a bit of an orphan memory map sitting isolated in TRM 224 + */ 225 + #define L4_CFG_MPU_DRA7XX_PHYS L4_CFG_MPU_DRA7XX_BASE 226 + #define L4_CFG_MPU_DRA7XX_VIRT (L4_CFG_MPU_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) 227 + #define L4_CFG_MPU_DRA7XX_SIZE SZ_1M 228 + 229 + /* 230 + * L4_PER2_DRA7XX_PHYS (0x4840_0000<>0x4848_8FFF) -> .53MiB (alloc 1MiB) 231 + * (0x48400000<->0x48500000) <=> (0xFA400000<->0xFA500000) 232 + */ 233 + #define L4_PER2_DRA7XX_PHYS L4_PER2_DRA7XX_BASE 234 + #define L4_PER2_DRA7XX_VIRT (L4_PER2_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) 235 + #define L4_PER2_DRA7XX_SIZE SZ_1M 236 + 237 + /* 238 + * L4_PER3_DRA7XX_PHYS (0x4880_0000<>0x489E_0FFF) -> 1.87MiB (alloc 2MiB) 239 + * (0x48800000<->0x48A00000) <=> (0xFA800000<->0xFAA00000) 240 + */ 241 + #define L4_PER3_DRA7XX_PHYS L4_PER3_DRA7XX_BASE 242 + #define L4_PER3_DRA7XX_VIRT (L4_PER3_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) 243 + #define L4_PER3_DRA7XX_SIZE SZ_2M 244 + 245 + /* 246 + * L4_CFG_DRA7XX_PHYS (0x4A00_0000<>0x4A22_BFFF) ->2.17MiB (alloc 3MiB)? 247 + * (0x4A000000<->0x4A300000) <=> (0xFC000000<->0xFC300000) 248 + */ 249 + #define L4_CFG_DRA7XX_PHYS L4_CFG_DRA7XX_BASE 250 + #define L4_CFG_DRA7XX_VIRT (L4_CFG_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) 251 + #define L4_CFG_DRA7XX_SIZE (SZ_1M + SZ_2M) 252 + 253 + /* 254 + * L4_WKUP_DRA7XX_PHYS (0x4AE0_0000<>0x4AE3_EFFF) -> .24 mb (alloc 1MiB)? 255 + * (0x4AE00000<->4AF00000) <=> (0xFCE00000<->0xFCF00000) 256 + */ 257 + #define L4_WKUP_DRA7XX_PHYS L4_WKUP_DRA7XX_BASE 258 + #define L4_WKUP_DRA7XX_VIRT (L4_WKUP_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) 259 + #define L4_WKUP_DRA7XX_SIZE SZ_1M
+1 -12
arch/arm/mach-omap2/omap-iommu.c
··· 11 11 */ 12 12 13 13 #include <linux/of.h> 14 - #include <linux/module.h> 15 14 #include <linux/platform_device.h> 16 15 #include <linux/err.h> 17 16 #include <linux/slab.h> ··· 62 63 63 64 return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL); 64 65 } 65 - /* must be ready before omap3isp is probed */ 66 66 omap_subsys_initcall(omap_iommu_init); 67 - 68 - static void __exit omap_iommu_exit(void) 69 - { 70 - /* Do nothing */ 71 - } 72 - module_exit(omap_iommu_exit); 73 - 74 - MODULE_AUTHOR("Hiroshi DOYU"); 75 - MODULE_DESCRIPTION("omap iommu: omap device registration"); 76 - MODULE_LICENSE("GPL v2"); 67 + /* must be ready before omap3isp is probed */
+1 -1
arch/arm/mach-omap2/omap-mpuss-lowpower.c
··· 105 105 static void dummy_scu_prepare(unsigned int cpu_id, unsigned int cpu_state) 106 106 {} 107 107 108 - struct cpu_pm_ops omap_pm_ops = { 108 + static struct cpu_pm_ops omap_pm_ops = { 109 109 .finish_suspend = default_finish_suspend, 110 110 .resume = dummy_cpu_resume, 111 111 .scu_prepare = dummy_scu_prepare,
+1
arch/arm/mach-omap2/omap3-restart.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/reboot.h> 16 16 17 + #include "common.h" 17 18 #include "control.h" 18 19 #include "prm.h" 19 20
+1
arch/arm/mach-omap2/omap4-restart.c
··· 9 9 10 10 #include <linux/types.h> 11 11 #include <linux/reboot.h> 12 + #include "common.h" 12 13 #include "prm.h" 13 14 14 15 /**
+8
arch/arm/mach-omap2/omap54xx.h
··· 30 30 #define OMAP54XX_CTRL_BASE 0x4a002800 31 31 #define OMAP54XX_SAR_RAM_BASE 0x4ae26000 32 32 33 + /* DRA7 specific base addresses */ 34 + #define L3_MAIN_SN_DRA7XX_BASE 0x44000000 35 + #define L4_PER1_DRA7XX_BASE 0x48000000 36 + #define L4_CFG_MPU_DRA7XX_BASE 0x48210000 37 + #define L4_PER2_DRA7XX_BASE 0x48400000 38 + #define L4_PER3_DRA7XX_BASE 0x48800000 39 + #define L4_CFG_DRA7XX_BASE 0x4A000000 40 + #define L4_WKUP_DRA7XX_BASE 0x4ae00000 33 41 #define DRA7XX_CM_CORE_AON_BASE 0x4a005000 34 42 #define DRA7XX_CTRL_BASE 0x4a003400 35 43 #define DRA7XX_TAP_BASE 0x4ae0c000
+15 -1
arch/arm/mach-omap2/omap_hwmod.c
··· 300 300 301 301 /* Module might have lost context, always update cache and register */ 302 302 oh->_sysc_cache = v; 303 + 304 + /* 305 + * Some IP blocks (such as RTC) require unlocking of IP before 306 + * accessing its registers. If a function pointer is present 307 + * to unlock, then call it before accessing sysconfig and 308 + * call lock after writing sysconfig. 309 + */ 310 + if (oh->class->unlock) 311 + oh->class->unlock(oh); 312 + 303 313 omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs); 314 + 315 + if (oh->class->lock) 316 + oh->class->lock(oh); 304 317 } 305 318 306 319 /** ··· 3900 3887 soc_ops.init_clkdm = _init_clkdm; 3901 3888 soc_ops.update_context_lost = _omap4_update_context_lost; 3902 3889 soc_ops.get_context_lost = _omap4_get_context_lost; 3903 - } else if (cpu_is_ti816x() || soc_is_am33xx() || soc_is_am43xx()) { 3890 + } else if (cpu_is_ti814x() || cpu_is_ti816x() || soc_is_am33xx() || 3891 + soc_is_am43xx()) { 3904 3892 soc_ops.enable_module = _omap4_enable_module; 3905 3893 soc_ops.disable_module = _omap4_disable_module; 3906 3894 soc_ops.wait_target_ready = _omap4_wait_target_ready;
+6 -1
arch/arm/mach-omap2/omap_hwmod.h
··· 576 576 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown 577 577 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn 578 578 * @enable_preprogram: ptr to fn to be executed during device enable 579 + * @lock: ptr to fn to be executed to lock IP registers 580 + * @unlock: ptr to fn to be executed to unlock IP registers 579 581 * 580 582 * Represent the class of a OMAP hardware "modules" (e.g. timer, 581 583 * smartreflex, gpio, uart...) ··· 602 600 int (*pre_shutdown)(struct omap_hwmod *oh); 603 601 int (*reset)(struct omap_hwmod *oh); 604 602 int (*enable_preprogram)(struct omap_hwmod *oh); 603 + void (*lock)(struct omap_hwmod *oh); 604 + void (*unlock)(struct omap_hwmod *oh); 605 605 }; 606 606 607 607 /** ··· 759 755 extern int omap44xx_hwmod_init(void); 760 756 extern int omap54xx_hwmod_init(void); 761 757 extern int am33xx_hwmod_init(void); 762 - extern int ti81xx_hwmod_init(void); 758 + extern int dm814x_hwmod_init(void); 759 + extern int dm816x_hwmod_init(void); 763 760 extern int dra7xx_hwmod_init(void); 764 761 int am43xx_hwmod_init(void); 765 762
+1 -1
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
··· 20 20 #include "prm-regbits-24xx.h" 21 21 #include "wd_timer.h" 22 22 23 - struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = { 23 + static struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = { 24 24 { .name = "dispc", .dma_req = 5 }, 25 25 { .dma_req = -1, }, 26 26 };
+1 -1
arch/arm/mach-omap2/omap_hwmod_43xx_data.c
··· 480 480 481 481 /* dispc */ 482 482 483 - struct omap_dss_dispc_dev_attr am43xx_dss_dispc_dev_attr = { 483 + static struct omap_dss_dispc_dev_attr am43xx_dss_dispc_dev_attr = { 484 484 .manager_count = 1, 485 485 .has_framedonetv_irq = 0 486 486 };
+376 -195
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
··· 32 32 */ 33 33 34 34 /* 35 - * The alwon .clkctrl_offs field is offset from the CM_ALWON, that's 36 - * TRM 18.7.17 CM_ALWON device register values minus 0x1400. 35 + * Common alwon .clkctrl_offs from dm814x TRM "Table 2-278. CM_ALWON REGISTERS" 36 + * also dm816x TRM 18.7.17 CM_ALWON device register values minus 0x1400. 37 37 */ 38 + #define DM81XX_CM_ALWON_MCASP0_CLKCTRL 0x140 39 + #define DM81XX_CM_ALWON_MCASP1_CLKCTRL 0x144 40 + #define DM81XX_CM_ALWON_MCASP2_CLKCTRL 0x148 41 + #define DM81XX_CM_ALWON_MCBSP_CLKCTRL 0x14c 42 + #define DM81XX_CM_ALWON_UART_0_CLKCTRL 0x150 43 + #define DM81XX_CM_ALWON_UART_1_CLKCTRL 0x154 44 + #define DM81XX_CM_ALWON_UART_2_CLKCTRL 0x158 45 + #define DM81XX_CM_ALWON_GPIO_0_CLKCTRL 0x15c 46 + #define DM81XX_CM_ALWON_GPIO_1_CLKCTRL 0x160 47 + #define DM81XX_CM_ALWON_I2C_0_CLKCTRL 0x164 48 + #define DM81XX_CM_ALWON_I2C_1_CLKCTRL 0x168 49 + #define DM81XX_CM_ALWON_WDTIMER_CLKCTRL 0x18c 50 + #define DM81XX_CM_ALWON_SPI_CLKCTRL 0x190 51 + #define DM81XX_CM_ALWON_MAILBOX_CLKCTRL 0x194 52 + #define DM81XX_CM_ALWON_SPINBOX_CLKCTRL 0x198 53 + #define DM81XX_CM_ALWON_MMUDATA_CLKCTRL 0x19c 54 + #define DM81XX_CM_ALWON_MMUCFG_CLKCTRL 0x1a8 55 + #define DM81XX_CM_ALWON_CONTROL_CLKCTRL 0x1c4 56 + #define DM81XX_CM_ALWON_GPMC_CLKCTRL 0x1d0 57 + #define DM81XX_CM_ALWON_ETHERNET_0_CLKCTRL 0x1d4 58 + #define DM81XX_CM_ALWON_L3_CLKCTRL 0x1e4 59 + #define DM81XX_CM_ALWON_L4HS_CLKCTRL 0x1e8 60 + #define DM81XX_CM_ALWON_L4LS_CLKCTRL 0x1ec 61 + #define DM81XX_CM_ALWON_RTC_CLKCTRL 0x1f0 62 + #define DM81XX_CM_ALWON_TPCC_CLKCTRL 0x1f4 63 + #define DM81XX_CM_ALWON_TPTC0_CLKCTRL 0x1f8 64 + #define DM81XX_CM_ALWON_TPTC1_CLKCTRL 0x1fc 65 + #define DM81XX_CM_ALWON_TPTC2_CLKCTRL 0x200 66 + #define DM81XX_CM_ALWON_TPTC3_CLKCTRL 0x204 67 + 68 + /* Registers specific to dm814x */ 69 + #define DM814X_CM_ALWON_MCASP_3_4_5_CLKCTRL 0x16c 70 + #define DM814X_CM_ALWON_ATL_CLKCTRL 0x170 71 + #define DM814X_CM_ALWON_MLB_CLKCTRL 0x174 72 + #define DM814X_CM_ALWON_PATA_CLKCTRL 0x178 73 + #define DM814X_CM_ALWON_UART_3_CLKCTRL 0x180 74 + #define DM814X_CM_ALWON_UART_4_CLKCTRL 0x184 75 + #define DM814X_CM_ALWON_UART_5_CLKCTRL 0x188 76 + #define DM814X_CM_ALWON_OCM_0_CLKCTRL 0x1b4 77 + #define DM814X_CM_ALWON_VCP_CLKCTRL 0x1b8 78 + #define DM814X_CM_ALWON_MPU_CLKCTRL 0x1dc 79 + #define DM814X_CM_ALWON_DEBUGSS_CLKCTRL 0x1e0 80 + #define DM814X_CM_ALWON_DCAN_0_1_CLKCTRL 0x218 81 + #define DM814X_CM_ALWON_MMCHS_0_CLKCTRL 0x21c 82 + #define DM814X_CM_ALWON_MMCHS_1_CLKCTRL 0x220 83 + #define DM814X_CM_ALWON_MMCHS_2_CLKCTRL 0x224 84 + #define DM814X_CM_ALWON_CUST_EFUSE_CLKCTRL 0x228 85 + 86 + /* Registers specific to dm816x */ 38 87 #define DM816X_DM_ALWON_BASE 0x1400 39 - #define DM816X_CM_ALWON_MCASP0_CLKCTRL (0x1540 - DM816X_DM_ALWON_BASE) 40 - #define DM816X_CM_ALWON_MCASP1_CLKCTRL (0x1544 - DM816X_DM_ALWON_BASE) 41 - #define DM816X_CM_ALWON_MCASP2_CLKCTRL (0x1548 - DM816X_DM_ALWON_BASE) 42 - #define DM816X_CM_ALWON_MCBSP_CLKCTRL (0x154c - DM816X_DM_ALWON_BASE) 43 - #define DM816X_CM_ALWON_UART_0_CLKCTRL (0x1550 - DM816X_DM_ALWON_BASE) 44 - #define DM816X_CM_ALWON_UART_1_CLKCTRL (0x1554 - DM816X_DM_ALWON_BASE) 45 - #define DM816X_CM_ALWON_UART_2_CLKCTRL (0x1558 - DM816X_DM_ALWON_BASE) 46 - #define DM816X_CM_ALWON_GPIO_0_CLKCTRL (0x155c - DM816X_DM_ALWON_BASE) 47 - #define DM816X_CM_ALWON_GPIO_1_CLKCTRL (0x1560 - DM816X_DM_ALWON_BASE) 48 - #define DM816X_CM_ALWON_I2C_0_CLKCTRL (0x1564 - DM816X_DM_ALWON_BASE) 49 - #define DM816X_CM_ALWON_I2C_1_CLKCTRL (0x1568 - DM816X_DM_ALWON_BASE) 50 88 #define DM816X_CM_ALWON_TIMER_1_CLKCTRL (0x1570 - DM816X_DM_ALWON_BASE) 51 89 #define DM816X_CM_ALWON_TIMER_2_CLKCTRL (0x1574 - DM816X_DM_ALWON_BASE) 52 90 #define DM816X_CM_ALWON_TIMER_3_CLKCTRL (0x1578 - DM816X_DM_ALWON_BASE) ··· 92 54 #define DM816X_CM_ALWON_TIMER_5_CLKCTRL (0x1580 - DM816X_DM_ALWON_BASE) 93 55 #define DM816X_CM_ALWON_TIMER_6_CLKCTRL (0x1584 - DM816X_DM_ALWON_BASE) 94 56 #define DM816X_CM_ALWON_TIMER_7_CLKCTRL (0x1588 - DM816X_DM_ALWON_BASE) 95 - #define DM816X_CM_ALWON_WDTIMER_CLKCTRL (0x158c - DM816X_DM_ALWON_BASE) 96 - #define DM816X_CM_ALWON_SPI_CLKCTRL (0x1590 - DM816X_DM_ALWON_BASE) 97 - #define DM816X_CM_ALWON_MAILBOX_CLKCTRL (0x1594 - DM816X_DM_ALWON_BASE) 98 - #define DM816X_CM_ALWON_SPINBOX_CLKCTRL (0x1598 - DM816X_DM_ALWON_BASE) 99 - #define DM816X_CM_ALWON_MMUDATA_CLKCTRL (0x159c - DM816X_DM_ALWON_BASE) 100 - #define DM816X_CM_ALWON_MMUCFG_CLKCTRL (0x15a8 - DM816X_DM_ALWON_BASE) 101 57 #define DM816X_CM_ALWON_SDIO_CLKCTRL (0x15b0 - DM816X_DM_ALWON_BASE) 102 58 #define DM816X_CM_ALWON_OCMC_0_CLKCTRL (0x15b4 - DM816X_DM_ALWON_BASE) 103 59 #define DM816X_CM_ALWON_OCMC_1_CLKCTRL (0x15b8 - DM816X_DM_ALWON_BASE) 104 - #define DM816X_CM_ALWON_CONTRL_CLKCTRL (0x15c4 - DM816X_DM_ALWON_BASE) 105 - #define DM816X_CM_ALWON_GPMC_CLKCTRL (0x15d0 - DM816X_DM_ALWON_BASE) 106 - #define DM816X_CM_ALWON_ETHERNET_0_CLKCTRL (0x15d4 - DM816X_DM_ALWON_BASE) 107 60 #define DM816X_CM_ALWON_ETHERNET_1_CLKCTRL (0x15d8 - DM816X_DM_ALWON_BASE) 108 61 #define DM816X_CM_ALWON_MPU_CLKCTRL (0x15dc - DM816X_DM_ALWON_BASE) 109 - #define DM816X_CM_ALWON_L3_CLKCTRL (0x15e4 - DM816X_DM_ALWON_BASE) 110 - #define DM816X_CM_ALWON_L4HS_CLKCTRL (0x15e8 - DM816X_DM_ALWON_BASE) 111 - #define DM816X_CM_ALWON_L4LS_CLKCTRL (0x15ec - DM816X_DM_ALWON_BASE) 112 - #define DM816X_CM_ALWON_RTC_CLKCTRL (0x15f0 - DM816X_DM_ALWON_BASE) 113 - #define DM816X_CM_ALWON_TPCC_CLKCTRL (0x15f4 - DM816X_DM_ALWON_BASE) 114 - #define DM816X_CM_ALWON_TPTC0_CLKCTRL (0x15f8 - DM816X_DM_ALWON_BASE) 115 - #define DM816X_CM_ALWON_TPTC1_CLKCTRL (0x15fc - DM816X_DM_ALWON_BASE) 116 - #define DM816X_CM_ALWON_TPTC2_CLKCTRL (0x1600 - DM816X_DM_ALWON_BASE) 117 - #define DM816X_CM_ALWON_TPTC3_CLKCTRL (0x1604 - DM816X_DM_ALWON_BASE) 118 62 #define DM816X_CM_ALWON_SR_0_CLKCTRL (0x1608 - DM816X_DM_ALWON_BASE) 119 63 #define DM816X_CM_ALWON_SR_1_CLKCTRL (0x160c - DM816X_DM_ALWON_BASE) 120 64 ··· 108 88 #define DM816X_CM_DEFAULT_USB_CLKCTRL (0x558 - DM816X_CM_DEFAULT_OFFSET) 109 89 110 90 /* L3 Interconnect entries clocked at 125, 250 and 500MHz */ 111 - static struct omap_hwmod dm816x_alwon_l3_slow_hwmod = { 91 + static struct omap_hwmod dm81xx_alwon_l3_slow_hwmod = { 112 92 .name = "alwon_l3_slow", 113 93 .clkdm_name = "alwon_l3s_clkdm", 114 94 .class = &l3_hwmod_class, 115 95 .flags = HWMOD_NO_IDLEST, 116 96 }; 117 97 118 - static struct omap_hwmod dm816x_default_l3_slow_hwmod = { 98 + static struct omap_hwmod dm81xx_default_l3_slow_hwmod = { 119 99 .name = "default_l3_slow", 120 100 .clkdm_name = "default_l3_slow_clkdm", 121 101 .class = &l3_hwmod_class, 122 102 .flags = HWMOD_NO_IDLEST, 123 103 }; 124 104 125 - static struct omap_hwmod dm816x_alwon_l3_med_hwmod = { 105 + static struct omap_hwmod dm81xx_alwon_l3_med_hwmod = { 126 106 .name = "l3_med", 127 107 .clkdm_name = "alwon_l3_med_clkdm", 128 108 .class = &l3_hwmod_class, 129 109 .flags = HWMOD_NO_IDLEST, 130 110 }; 131 111 132 - static struct omap_hwmod dm816x_alwon_l3_fast_hwmod = { 112 + static struct omap_hwmod dm81xx_alwon_l3_fast_hwmod = { 133 113 .name = "l3_fast", 134 114 .clkdm_name = "alwon_l3_fast_clkdm", 135 115 .class = &l3_hwmod_class, ··· 140 120 * L4 standard peripherals, see TRM table 1-12 for devices using this. 141 121 * See TRM table 1-73 for devices using the 125MHz SYSCLK6 clock. 142 122 */ 143 - static struct omap_hwmod dm816x_l4_ls_hwmod = { 123 + static struct omap_hwmod dm81xx_l4_ls_hwmod = { 144 124 .name = "l4_ls", 145 125 .clkdm_name = "alwon_l3s_clkdm", 146 126 .class = &l4_hwmod_class, ··· 151 131 * table 1-13. On dm816x, only EMAC, MDIO and SATA use this. See also TRM 152 132 * table 1-73 for devices using 250MHz SYSCLK5 clock. 153 133 */ 154 - static struct omap_hwmod dm816x_l4_hs_hwmod = { 134 + static struct omap_hwmod dm81xx_l4_hs_hwmod = { 155 135 .name = "l4_hs", 156 136 .clkdm_name = "alwon_l3_med_clkdm", 157 137 .class = &l4_hwmod_class, 158 138 }; 159 139 160 140 /* L3 slow -> L4 ls peripheral interface running at 125MHz */ 161 - static struct omap_hwmod_ocp_if dm816x_alwon_l3_slow__l4_ls = { 162 - .master = &dm816x_alwon_l3_slow_hwmod, 163 - .slave = &dm816x_l4_ls_hwmod, 141 + static struct omap_hwmod_ocp_if dm81xx_alwon_l3_slow__l4_ls = { 142 + .master = &dm81xx_alwon_l3_slow_hwmod, 143 + .slave = &dm81xx_l4_ls_hwmod, 164 144 .user = OCP_USER_MPU, 165 145 }; 166 146 167 147 /* L3 med -> L4 fast peripheral interface running at 250MHz */ 168 - static struct omap_hwmod_ocp_if dm816x_alwon_l3_slow__l4_hs = { 169 - .master = &dm816x_alwon_l3_med_hwmod, 170 - .slave = &dm816x_l4_hs_hwmod, 148 + static struct omap_hwmod_ocp_if dm81xx_alwon_l3_slow__l4_hs = { 149 + .master = &dm81xx_alwon_l3_med_hwmod, 150 + .slave = &dm81xx_l4_hs_hwmod, 171 151 .user = OCP_USER_MPU, 172 152 }; 173 153 174 154 /* MPU */ 155 + static struct omap_hwmod dm814x_mpu_hwmod = { 156 + .name = "mpu", 157 + .clkdm_name = "alwon_l3s_clkdm", 158 + .class = &mpu_hwmod_class, 159 + .flags = HWMOD_INIT_NO_IDLE, 160 + .main_clk = "mpu_ck", 161 + .prcm = { 162 + .omap4 = { 163 + .clkctrl_offs = DM814X_CM_ALWON_MPU_CLKCTRL, 164 + .modulemode = MODULEMODE_SWCTRL, 165 + }, 166 + }, 167 + }; 168 + 169 + static struct omap_hwmod_ocp_if dm814x_mpu__alwon_l3_slow = { 170 + .master = &dm814x_mpu_hwmod, 171 + .slave = &dm81xx_alwon_l3_slow_hwmod, 172 + .user = OCP_USER_MPU, 173 + }; 174 + 175 + /* L3 med peripheral interface running at 200MHz */ 176 + static struct omap_hwmod_ocp_if dm814x_mpu__alwon_l3_med = { 177 + .master = &dm814x_mpu_hwmod, 178 + .slave = &dm81xx_alwon_l3_med_hwmod, 179 + .user = OCP_USER_MPU, 180 + }; 181 + 175 182 static struct omap_hwmod dm816x_mpu_hwmod = { 176 183 .name = "mpu", 177 184 .clkdm_name = "alwon_mpu_clkdm", ··· 215 168 216 169 static struct omap_hwmod_ocp_if dm816x_mpu__alwon_l3_slow = { 217 170 .master = &dm816x_mpu_hwmod, 218 - .slave = &dm816x_alwon_l3_slow_hwmod, 171 + .slave = &dm81xx_alwon_l3_slow_hwmod, 219 172 .user = OCP_USER_MPU, 220 173 }; 221 174 222 175 /* L3 med peripheral interface running at 250MHz */ 223 176 static struct omap_hwmod_ocp_if dm816x_mpu__alwon_l3_med = { 224 177 .master = &dm816x_mpu_hwmod, 225 - .slave = &dm816x_alwon_l3_med_hwmod, 178 + .slave = &dm81xx_alwon_l3_med_hwmod, 226 179 .user = OCP_USER_MPU, 227 180 }; 228 181 ··· 244 197 .sysc = &uart_sysc, 245 198 }; 246 199 247 - static struct omap_hwmod dm816x_uart1_hwmod = { 200 + static struct omap_hwmod dm81xx_uart1_hwmod = { 248 201 .name = "uart1", 249 202 .clkdm_name = "alwon_l3s_clkdm", 250 203 .main_clk = "sysclk10_ck", 251 204 .prcm = { 252 205 .omap4 = { 253 - .clkctrl_offs = DM816X_CM_ALWON_UART_0_CLKCTRL, 206 + .clkctrl_offs = DM81XX_CM_ALWON_UART_0_CLKCTRL, 254 207 .modulemode = MODULEMODE_SWCTRL, 255 208 }, 256 209 }, ··· 258 211 .flags = DEBUG_TI81XXUART1_FLAGS, 259 212 }; 260 213 261 - static struct omap_hwmod_ocp_if dm816x_l4_ls__uart1 = { 262 - .master = &dm816x_l4_ls_hwmod, 263 - .slave = &dm816x_uart1_hwmod, 214 + static struct omap_hwmod_ocp_if dm81xx_l4_ls__uart1 = { 215 + .master = &dm81xx_l4_ls_hwmod, 216 + .slave = &dm81xx_uart1_hwmod, 264 217 .clk = "sysclk6_ck", 265 218 .user = OCP_USER_MPU, 266 219 }; 267 220 268 - static struct omap_hwmod dm816x_uart2_hwmod = { 221 + static struct omap_hwmod dm81xx_uart2_hwmod = { 269 222 .name = "uart2", 270 223 .clkdm_name = "alwon_l3s_clkdm", 271 224 .main_clk = "sysclk10_ck", 272 225 .prcm = { 273 226 .omap4 = { 274 - .clkctrl_offs = DM816X_CM_ALWON_UART_1_CLKCTRL, 227 + .clkctrl_offs = DM81XX_CM_ALWON_UART_1_CLKCTRL, 275 228 .modulemode = MODULEMODE_SWCTRL, 276 229 }, 277 230 }, ··· 279 232 .flags = DEBUG_TI81XXUART2_FLAGS, 280 233 }; 281 234 282 - static struct omap_hwmod_ocp_if dm816x_l4_ls__uart2 = { 283 - .master = &dm816x_l4_ls_hwmod, 284 - .slave = &dm816x_uart2_hwmod, 235 + static struct omap_hwmod_ocp_if dm81xx_l4_ls__uart2 = { 236 + .master = &dm81xx_l4_ls_hwmod, 237 + .slave = &dm81xx_uart2_hwmod, 285 238 .clk = "sysclk6_ck", 286 239 .user = OCP_USER_MPU, 287 240 }; 288 241 289 - static struct omap_hwmod dm816x_uart3_hwmod = { 242 + static struct omap_hwmod dm81xx_uart3_hwmod = { 290 243 .name = "uart3", 291 244 .clkdm_name = "alwon_l3s_clkdm", 292 245 .main_clk = "sysclk10_ck", 293 246 .prcm = { 294 247 .omap4 = { 295 - .clkctrl_offs = DM816X_CM_ALWON_UART_2_CLKCTRL, 248 + .clkctrl_offs = DM81XX_CM_ALWON_UART_2_CLKCTRL, 296 249 .modulemode = MODULEMODE_SWCTRL, 297 250 }, 298 251 }, ··· 300 253 .flags = DEBUG_TI81XXUART3_FLAGS, 301 254 }; 302 255 303 - static struct omap_hwmod_ocp_if dm816x_l4_ls__uart3 = { 304 - .master = &dm816x_l4_ls_hwmod, 305 - .slave = &dm816x_uart3_hwmod, 256 + static struct omap_hwmod_ocp_if dm81xx_l4_ls__uart3 = { 257 + .master = &dm81xx_l4_ls_hwmod, 258 + .slave = &dm81xx_uart3_hwmod, 306 259 .clk = "sysclk6_ck", 307 260 .user = OCP_USER_MPU, 308 261 }; ··· 323 276 .reset = &omap2_wd_timer_reset, 324 277 }; 325 278 326 - static struct omap_hwmod dm816x_wd_timer_hwmod = { 279 + static struct omap_hwmod dm81xx_wd_timer_hwmod = { 327 280 .name = "wd_timer", 328 281 .clkdm_name = "alwon_l3s_clkdm", 329 282 .main_clk = "sysclk18_ck", 330 283 .flags = HWMOD_NO_IDLEST, 331 284 .prcm = { 332 285 .omap4 = { 333 - .clkctrl_offs = DM816X_CM_ALWON_WDTIMER_CLKCTRL, 286 + .clkctrl_offs = DM81XX_CM_ALWON_WDTIMER_CLKCTRL, 334 287 .modulemode = MODULEMODE_SWCTRL, 335 288 }, 336 289 }, 337 290 .class = &wd_timer_class, 338 291 }; 339 292 340 - static struct omap_hwmod_ocp_if dm816x_l4_ls__wd_timer1 = { 341 - .master = &dm816x_l4_ls_hwmod, 342 - .slave = &dm816x_wd_timer_hwmod, 293 + static struct omap_hwmod_ocp_if dm81xx_l4_ls__wd_timer1 = { 294 + .master = &dm81xx_l4_ls_hwmod, 295 + .slave = &dm81xx_wd_timer_hwmod, 343 296 .clk = "sysclk6_ck", 344 297 .user = OCP_USER_MPU, 345 298 }; ··· 367 320 .main_clk = "sysclk10_ck", 368 321 .prcm = { 369 322 .omap4 = { 370 - .clkctrl_offs = DM816X_CM_ALWON_I2C_0_CLKCTRL, 323 + .clkctrl_offs = DM81XX_CM_ALWON_I2C_0_CLKCTRL, 371 324 .modulemode = MODULEMODE_SWCTRL, 372 325 }, 373 326 }, 374 327 .class = &i2c_class, 375 328 }; 376 329 377 - static struct omap_hwmod_ocp_if dm816x_l4_ls__i2c1 = { 378 - .master = &dm816x_l4_ls_hwmod, 330 + static struct omap_hwmod_ocp_if dm81xx_l4_ls__i2c1 = { 331 + .master = &dm81xx_l4_ls_hwmod, 379 332 .slave = &dm81xx_i2c1_hwmod, 380 333 .clk = "sysclk6_ck", 381 334 .user = OCP_USER_MPU, 382 335 }; 383 336 384 - static struct omap_hwmod dm816x_i2c2_hwmod = { 337 + static struct omap_hwmod dm81xx_i2c2_hwmod = { 385 338 .name = "i2c2", 386 339 .clkdm_name = "alwon_l3s_clkdm", 387 340 .main_clk = "sysclk10_ck", 388 341 .prcm = { 389 342 .omap4 = { 390 - .clkctrl_offs = DM816X_CM_ALWON_I2C_1_CLKCTRL, 343 + .clkctrl_offs = DM81XX_CM_ALWON_I2C_1_CLKCTRL, 391 344 .modulemode = MODULEMODE_SWCTRL, 392 345 }, 393 346 }, ··· 405 358 .sysc_fields = &omap_hwmod_sysc_type1, 406 359 }; 407 360 408 - static struct omap_hwmod_ocp_if dm816x_l4_ls__i2c2 = { 409 - .master = &dm816x_l4_ls_hwmod, 410 - .slave = &dm816x_i2c2_hwmod, 361 + static struct omap_hwmod_ocp_if dm81xx_l4_ls__i2c2 = { 362 + .master = &dm81xx_l4_ls_hwmod, 363 + .slave = &dm81xx_i2c2_hwmod, 411 364 .clk = "sysclk6_ck", 412 365 .user = OCP_USER_MPU, 413 366 }; ··· 425 378 }; 426 379 427 380 static struct omap_hwmod_ocp_if dm81xx_l4_ls__elm = { 428 - .master = &dm816x_l4_ls_hwmod, 381 + .master = &dm81xx_l4_ls_hwmod, 429 382 .slave = &dm81xx_elm_hwmod, 430 383 .user = OCP_USER_MPU, 431 384 }; ··· 464 417 .main_clk = "sysclk6_ck", 465 418 .prcm = { 466 419 .omap4 = { 467 - .clkctrl_offs = DM816X_CM_ALWON_GPIO_0_CLKCTRL, 420 + .clkctrl_offs = DM81XX_CM_ALWON_GPIO_0_CLKCTRL, 468 421 .modulemode = MODULEMODE_SWCTRL, 469 422 }, 470 423 }, ··· 474 427 }; 475 428 476 429 static struct omap_hwmod_ocp_if dm81xx_l4_ls__gpio1 = { 477 - .master = &dm816x_l4_ls_hwmod, 430 + .master = &dm81xx_l4_ls_hwmod, 478 431 .slave = &dm81xx_gpio1_hwmod, 479 432 .user = OCP_USER_MPU, 480 433 }; ··· 490 443 .main_clk = "sysclk6_ck", 491 444 .prcm = { 492 445 .omap4 = { 493 - .clkctrl_offs = DM816X_CM_ALWON_GPIO_1_CLKCTRL, 446 + .clkctrl_offs = DM81XX_CM_ALWON_GPIO_1_CLKCTRL, 494 447 .modulemode = MODULEMODE_SWCTRL, 495 448 }, 496 449 }, ··· 500 453 }; 501 454 502 455 static struct omap_hwmod_ocp_if dm81xx_l4_ls__gpio2 = { 503 - .master = &dm816x_l4_ls_hwmod, 456 + .master = &dm81xx_l4_ls_hwmod, 504 457 .slave = &dm81xx_gpio2_hwmod, 505 458 .user = OCP_USER_MPU, 506 459 }; ··· 529 482 .flags = DEBUG_OMAP_GPMC_HWMOD_FLAGS, 530 483 .prcm = { 531 484 .omap4 = { 532 - .clkctrl_offs = DM816X_CM_ALWON_GPMC_CLKCTRL, 485 + .clkctrl_offs = DM81XX_CM_ALWON_GPMC_CLKCTRL, 533 486 .modulemode = MODULEMODE_SWCTRL, 534 487 }, 535 488 }, 536 489 }; 537 490 538 - struct omap_hwmod_ocp_if dm81xx_alwon_l3_slow__gpmc = { 539 - .master = &dm816x_alwon_l3_slow_hwmod, 491 + static struct omap_hwmod_ocp_if dm81xx_alwon_l3_slow__gpmc = { 492 + .master = &dm81xx_alwon_l3_slow_hwmod, 540 493 .slave = &dm81xx_gpmc_hwmod, 541 494 .user = OCP_USER_MPU, 542 495 }; ··· 569 522 }; 570 523 571 524 static struct omap_hwmod_ocp_if dm81xx_default_l3_slow__usbss = { 572 - .master = &dm816x_default_l3_slow_hwmod, 525 + .master = &dm81xx_default_l3_slow_hwmod, 573 526 .slave = &dm81xx_usbss_hwmod, 574 527 .clk = "sysclk6_ck", 575 528 .user = OCP_USER_MPU, ··· 594 547 .timer_capability = OMAP_TIMER_ALWON, 595 548 }; 596 549 550 + static struct omap_hwmod dm814x_timer1_hwmod = { 551 + .name = "timer1", 552 + .clkdm_name = "alwon_l3s_clkdm", 553 + .main_clk = "timer_sys_ck", 554 + .dev_attr = &capability_alwon_dev_attr, 555 + .class = &dm816x_timer_hwmod_class, 556 + .flags = HWMOD_NO_IDLEST, 557 + }; 558 + 559 + static struct omap_hwmod_ocp_if dm814x_l4_ls__timer1 = { 560 + .master = &dm81xx_l4_ls_hwmod, 561 + .slave = &dm814x_timer1_hwmod, 562 + .clk = "timer_sys_ck", 563 + .user = OCP_USER_MPU, 564 + }; 565 + 597 566 static struct omap_hwmod dm816x_timer1_hwmod = { 598 567 .name = "timer1", 599 568 .clkdm_name = "alwon_l3s_clkdm", ··· 625 562 }; 626 563 627 564 static struct omap_hwmod_ocp_if dm816x_l4_ls__timer1 = { 628 - .master = &dm816x_l4_ls_hwmod, 565 + .master = &dm81xx_l4_ls_hwmod, 629 566 .slave = &dm816x_timer1_hwmod, 630 567 .clk = "sysclk6_ck", 568 + .user = OCP_USER_MPU, 569 + }; 570 + 571 + static struct omap_hwmod dm814x_timer2_hwmod = { 572 + .name = "timer2", 573 + .clkdm_name = "alwon_l3s_clkdm", 574 + .main_clk = "timer_sys_ck", 575 + .dev_attr = &capability_alwon_dev_attr, 576 + .class = &dm816x_timer_hwmod_class, 577 + .flags = HWMOD_NO_IDLEST, 578 + }; 579 + 580 + static struct omap_hwmod_ocp_if dm814x_l4_ls__timer2 = { 581 + .master = &dm81xx_l4_ls_hwmod, 582 + .slave = &dm814x_timer2_hwmod, 583 + .clk = "timer_sys_ck", 631 584 .user = OCP_USER_MPU, 632 585 }; 633 586 ··· 662 583 }; 663 584 664 585 static struct omap_hwmod_ocp_if dm816x_l4_ls__timer2 = { 665 - .master = &dm816x_l4_ls_hwmod, 586 + .master = &dm81xx_l4_ls_hwmod, 666 587 .slave = &dm816x_timer2_hwmod, 667 588 .clk = "sysclk6_ck", 668 589 .user = OCP_USER_MPU, ··· 683 604 }; 684 605 685 606 static struct omap_hwmod_ocp_if dm816x_l4_ls__timer3 = { 686 - .master = &dm816x_l4_ls_hwmod, 607 + .master = &dm81xx_l4_ls_hwmod, 687 608 .slave = &dm816x_timer3_hwmod, 688 609 .clk = "sysclk6_ck", 689 610 .user = OCP_USER_MPU, ··· 704 625 }; 705 626 706 627 static struct omap_hwmod_ocp_if dm816x_l4_ls__timer4 = { 707 - .master = &dm816x_l4_ls_hwmod, 628 + .master = &dm81xx_l4_ls_hwmod, 708 629 .slave = &dm816x_timer4_hwmod, 709 630 .clk = "sysclk6_ck", 710 631 .user = OCP_USER_MPU, ··· 725 646 }; 726 647 727 648 static struct omap_hwmod_ocp_if dm816x_l4_ls__timer5 = { 728 - .master = &dm816x_l4_ls_hwmod, 649 + .master = &dm81xx_l4_ls_hwmod, 729 650 .slave = &dm816x_timer5_hwmod, 730 651 .clk = "sysclk6_ck", 731 652 .user = OCP_USER_MPU, ··· 746 667 }; 747 668 748 669 static struct omap_hwmod_ocp_if dm816x_l4_ls__timer6 = { 749 - .master = &dm816x_l4_ls_hwmod, 670 + .master = &dm81xx_l4_ls_hwmod, 750 671 .slave = &dm816x_timer6_hwmod, 751 672 .clk = "sysclk6_ck", 752 673 .user = OCP_USER_MPU, ··· 767 688 }; 768 689 769 690 static struct omap_hwmod_ocp_if dm816x_l4_ls__timer7 = { 770 - .master = &dm816x_l4_ls_hwmod, 691 + .master = &dm81xx_l4_ls_hwmod, 771 692 .slave = &dm816x_timer7_hwmod, 772 693 .clk = "sysclk6_ck", 773 694 .user = OCP_USER_MPU, 695 + }; 696 + 697 + /* CPSW on dm814x */ 698 + static struct omap_hwmod_class_sysconfig dm814x_cpgmac_sysc = { 699 + .rev_offs = 0x0, 700 + .sysc_offs = 0x8, 701 + .syss_offs = 0x4, 702 + .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE | 703 + SYSS_HAS_RESET_STATUS, 704 + .idlemodes = SIDLE_FORCE | SIDLE_NO | MSTANDBY_FORCE | 705 + MSTANDBY_NO, 706 + .sysc_fields = &omap_hwmod_sysc_type3, 707 + }; 708 + 709 + static struct omap_hwmod_class dm814x_cpgmac0_hwmod_class = { 710 + .name = "cpgmac0", 711 + .sysc = &dm814x_cpgmac_sysc, 712 + }; 713 + 714 + static struct omap_hwmod dm814x_cpgmac0_hwmod = { 715 + .name = "cpgmac0", 716 + .class = &dm814x_cpgmac0_hwmod_class, 717 + .clkdm_name = "alwon_ethernet_clkdm", 718 + .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY, 719 + .main_clk = "cpsw_125mhz_gclk", 720 + .prcm = { 721 + .omap4 = { 722 + .clkctrl_offs = DM81XX_CM_ALWON_ETHERNET_0_CLKCTRL, 723 + .modulemode = MODULEMODE_SWCTRL, 724 + }, 725 + }, 726 + }; 727 + 728 + static struct omap_hwmod_class dm814x_mdio_hwmod_class = { 729 + .name = "davinci_mdio", 730 + }; 731 + 732 + static struct omap_hwmod dm814x_mdio_hwmod = { 733 + .name = "davinci_mdio", 734 + .class = &dm814x_mdio_hwmod_class, 735 + .clkdm_name = "alwon_ethernet_clkdm", 736 + .main_clk = "cpsw_125mhz_gclk", 737 + }; 738 + 739 + static struct omap_hwmod_ocp_if dm814x_l4_hs__cpgmac0 = { 740 + .master = &dm81xx_l4_hs_hwmod, 741 + .slave = &dm814x_cpgmac0_hwmod, 742 + .clk = "cpsw_125mhz_gclk", 743 + .user = OCP_USER_MPU, 744 + }; 745 + 746 + static struct omap_hwmod_ocp_if dm814x_cpgmac0__mdio = { 747 + .master = &dm814x_cpgmac0_hwmod, 748 + .slave = &dm814x_mdio_hwmod, 749 + .user = OCP_USER_MPU, 750 + .flags = HWMOD_NO_IDLEST, 774 751 }; 775 752 776 753 /* EMAC Ethernet */ ··· 852 717 .class = &dm816x_emac_hwmod_class, 853 718 }; 854 719 855 - static struct omap_hwmod_ocp_if dm816x_l4_hs__emac0 = { 856 - .master = &dm816x_l4_hs_hwmod, 720 + static struct omap_hwmod_ocp_if dm81xx_l4_hs__emac0 = { 721 + .master = &dm81xx_l4_hs_hwmod, 857 722 .slave = &dm816x_emac0_hwmod, 858 723 .clk = "sysclk5_ck", 859 724 .user = OCP_USER_MPU, 860 725 }; 861 726 862 - static struct omap_hwmod_class dm816x_mdio_hwmod_class = { 727 + static struct omap_hwmod_class dm81xx_mdio_hwmod_class = { 863 728 .name = "davinci_mdio", 864 729 .sysc = &dm816x_emac_sysc, 865 730 }; 866 731 867 - struct omap_hwmod dm816x_emac0_mdio_hwmod = { 732 + static struct omap_hwmod dm81xx_emac0_mdio_hwmod = { 868 733 .name = "davinci_mdio", 869 - .class = &dm816x_mdio_hwmod_class, 734 + .class = &dm81xx_mdio_hwmod_class, 870 735 .clkdm_name = "alwon_ethernet_clkdm", 871 736 .main_clk = "sysclk24_ck", 872 737 .flags = HWMOD_NO_IDLEST, ··· 876 741 */ 877 742 .prcm = { 878 743 .omap4 = { 879 - .clkctrl_offs = DM816X_CM_ALWON_ETHERNET_0_CLKCTRL, 744 + .clkctrl_offs = DM81XX_CM_ALWON_ETHERNET_0_CLKCTRL, 880 745 .modulemode = MODULEMODE_SWCTRL, 881 746 }, 882 747 }, 883 748 }; 884 749 885 - struct omap_hwmod_ocp_if dm816x_emac0__mdio = { 886 - .master = &dm816x_l4_hs_hwmod, 887 - .slave = &dm816x_emac0_mdio_hwmod, 750 + static struct omap_hwmod_ocp_if dm81xx_emac0__mdio = { 751 + .master = &dm81xx_l4_hs_hwmod, 752 + .slave = &dm81xx_emac0_mdio_hwmod, 888 753 .user = OCP_USER_MPU, 889 754 }; 890 755 ··· 903 768 }; 904 769 905 770 static struct omap_hwmod_ocp_if dm816x_l4_hs__emac1 = { 906 - .master = &dm816x_l4_hs_hwmod, 771 + .master = &dm81xx_l4_hs_hwmod, 907 772 .slave = &dm816x_emac1_hwmod, 908 773 .clk = "sysclk5_ck", 909 774 .user = OCP_USER_MPU, ··· 950 815 }; 951 816 952 817 static struct omap_hwmod_ocp_if dm816x_l4_ls__mmc1 = { 953 - .master = &dm816x_l4_ls_hwmod, 818 + .master = &dm81xx_l4_ls_hwmod, 954 819 .slave = &dm816x_mmc1_hwmod, 955 820 .clk = "sysclk6_ck", 956 821 .user = OCP_USER_MPU, ··· 978 843 .num_chipselect = 4, 979 844 }; 980 845 981 - static struct omap_hwmod dm816x_mcspi1_hwmod = { 846 + static struct omap_hwmod dm81xx_mcspi1_hwmod = { 982 847 .name = "mcspi1", 983 848 .clkdm_name = "alwon_l3s_clkdm", 984 849 .main_clk = "sysclk10_ck", 985 850 .prcm = { 986 851 .omap4 = { 987 - .clkctrl_offs = DM816X_CM_ALWON_SPI_CLKCTRL, 852 + .clkctrl_offs = DM81XX_CM_ALWON_SPI_CLKCTRL, 988 853 .modulemode = MODULEMODE_SWCTRL, 989 854 }, 990 855 }, ··· 992 857 .dev_attr = &dm816x_mcspi1_dev_attr, 993 858 }; 994 859 995 - static struct omap_hwmod_ocp_if dm816x_l4_ls__mcspi1 = { 996 - .master = &dm816x_l4_ls_hwmod, 997 - .slave = &dm816x_mcspi1_hwmod, 860 + static struct omap_hwmod_ocp_if dm81xx_l4_ls__mcspi1 = { 861 + .master = &dm81xx_l4_ls_hwmod, 862 + .slave = &dm81xx_mcspi1_hwmod, 998 863 .clk = "sysclk6_ck", 999 864 .user = OCP_USER_MPU, 1000 865 }; 1001 866 1002 - static struct omap_hwmod_class_sysconfig dm816x_mailbox_sysc = { 867 + static struct omap_hwmod_class_sysconfig dm81xx_mailbox_sysc = { 1003 868 .rev_offs = 0x000, 1004 869 .sysc_offs = 0x010, 1005 870 .syss_offs = 0x014, ··· 1009 874 .sysc_fields = &omap_hwmod_sysc_type1, 1010 875 }; 1011 876 1012 - static struct omap_hwmod_class dm816x_mailbox_hwmod_class = { 877 + static struct omap_hwmod_class dm81xx_mailbox_hwmod_class = { 1013 878 .name = "mailbox", 1014 - .sysc = &dm816x_mailbox_sysc, 879 + .sysc = &dm81xx_mailbox_sysc, 1015 880 }; 1016 881 1017 - static struct omap_hwmod dm816x_mailbox_hwmod = { 882 + static struct omap_hwmod dm81xx_mailbox_hwmod = { 1018 883 .name = "mailbox", 1019 884 .clkdm_name = "alwon_l3s_clkdm", 1020 - .class = &dm816x_mailbox_hwmod_class, 885 + .class = &dm81xx_mailbox_hwmod_class, 1021 886 .main_clk = "sysclk6_ck", 1022 887 .prcm = { 1023 888 .omap4 = { 1024 - .clkctrl_offs = DM816X_CM_ALWON_MAILBOX_CLKCTRL, 889 + .clkctrl_offs = DM81XX_CM_ALWON_MAILBOX_CLKCTRL, 1025 890 .modulemode = MODULEMODE_SWCTRL, 1026 891 }, 1027 892 }, 1028 893 }; 1029 894 1030 - static struct omap_hwmod_ocp_if dm816x_l4_ls__mailbox = { 1031 - .master = &dm816x_l4_ls_hwmod, 1032 - .slave = &dm816x_mailbox_hwmod, 895 + static struct omap_hwmod_ocp_if dm81xx_l4_ls__mailbox = { 896 + .master = &dm81xx_l4_ls_hwmod, 897 + .slave = &dm81xx_mailbox_hwmod, 1033 898 .user = OCP_USER_MPU, 1034 899 }; 1035 900 1036 - static struct omap_hwmod_class dm816x_tpcc_hwmod_class = { 901 + static struct omap_hwmod_class dm81xx_tpcc_hwmod_class = { 1037 902 .name = "tpcc", 1038 903 }; 1039 904 1040 - struct omap_hwmod dm816x_tpcc_hwmod = { 905 + static struct omap_hwmod dm81xx_tpcc_hwmod = { 1041 906 .name = "tpcc", 1042 - .class = &dm816x_tpcc_hwmod_class, 907 + .class = &dm81xx_tpcc_hwmod_class, 1043 908 .clkdm_name = "alwon_l3s_clkdm", 1044 909 .main_clk = "sysclk4_ck", 1045 910 .prcm = { 1046 911 .omap4 = { 1047 - .clkctrl_offs = DM816X_CM_ALWON_TPCC_CLKCTRL, 912 + .clkctrl_offs = DM81XX_CM_ALWON_TPCC_CLKCTRL, 1048 913 .modulemode = MODULEMODE_SWCTRL, 1049 914 }, 1050 915 }, 1051 916 }; 1052 917 1053 - struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tpcc = { 1054 - .master = &dm816x_alwon_l3_fast_hwmod, 1055 - .slave = &dm816x_tpcc_hwmod, 918 + static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tpcc = { 919 + .master = &dm81xx_alwon_l3_fast_hwmod, 920 + .slave = &dm81xx_tpcc_hwmod, 1056 921 .clk = "sysclk4_ck", 1057 922 .user = OCP_USER_MPU, 1058 923 }; 1059 924 1060 - static struct omap_hwmod_addr_space dm816x_tptc0_addr_space[] = { 925 + static struct omap_hwmod_addr_space dm81xx_tptc0_addr_space[] = { 1061 926 { 1062 927 .pa_start = 0x49800000, 1063 928 .pa_end = 0x49800000 + SZ_8K - 1, ··· 1066 931 { }, 1067 932 }; 1068 933 1069 - static struct omap_hwmod_class dm816x_tptc0_hwmod_class = { 934 + static struct omap_hwmod_class dm81xx_tptc0_hwmod_class = { 1070 935 .name = "tptc0", 1071 936 }; 1072 937 1073 - struct omap_hwmod dm816x_tptc0_hwmod = { 938 + static struct omap_hwmod dm81xx_tptc0_hwmod = { 1074 939 .name = "tptc0", 1075 - .class = &dm816x_tptc0_hwmod_class, 940 + .class = &dm81xx_tptc0_hwmod_class, 1076 941 .clkdm_name = "alwon_l3s_clkdm", 1077 942 .main_clk = "sysclk4_ck", 1078 943 .prcm = { 1079 944 .omap4 = { 1080 - .clkctrl_offs = DM816X_CM_ALWON_TPTC0_CLKCTRL, 945 + .clkctrl_offs = DM81XX_CM_ALWON_TPTC0_CLKCTRL, 1081 946 .modulemode = MODULEMODE_SWCTRL, 1082 947 }, 1083 948 }, 1084 949 }; 1085 950 1086 - struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tptc0 = { 1087 - .master = &dm816x_alwon_l3_fast_hwmod, 1088 - .slave = &dm816x_tptc0_hwmod, 951 + static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc0 = { 952 + .master = &dm81xx_alwon_l3_fast_hwmod, 953 + .slave = &dm81xx_tptc0_hwmod, 1089 954 .clk = "sysclk4_ck", 1090 - .addr = dm816x_tptc0_addr_space, 955 + .addr = dm81xx_tptc0_addr_space, 1091 956 .user = OCP_USER_MPU, 1092 957 }; 1093 958 1094 - struct omap_hwmod_ocp_if dm816x_tptc0__alwon_l3_fast = { 1095 - .master = &dm816x_tptc0_hwmod, 1096 - .slave = &dm816x_alwon_l3_fast_hwmod, 959 + static struct omap_hwmod_ocp_if dm81xx_tptc0__alwon_l3_fast = { 960 + .master = &dm81xx_tptc0_hwmod, 961 + .slave = &dm81xx_alwon_l3_fast_hwmod, 1097 962 .clk = "sysclk4_ck", 1098 - .addr = dm816x_tptc0_addr_space, 963 + .addr = dm81xx_tptc0_addr_space, 1099 964 .user = OCP_USER_MPU, 1100 965 }; 1101 966 1102 - static struct omap_hwmod_addr_space dm816x_tptc1_addr_space[] = { 967 + static struct omap_hwmod_addr_space dm81xx_tptc1_addr_space[] = { 1103 968 { 1104 969 .pa_start = 0x49900000, 1105 970 .pa_end = 0x49900000 + SZ_8K - 1, ··· 1108 973 { }, 1109 974 }; 1110 975 1111 - static struct omap_hwmod_class dm816x_tptc1_hwmod_class = { 976 + static struct omap_hwmod_class dm81xx_tptc1_hwmod_class = { 1112 977 .name = "tptc1", 1113 978 }; 1114 979 1115 - struct omap_hwmod dm816x_tptc1_hwmod = { 980 + static struct omap_hwmod dm81xx_tptc1_hwmod = { 1116 981 .name = "tptc1", 1117 - .class = &dm816x_tptc1_hwmod_class, 982 + .class = &dm81xx_tptc1_hwmod_class, 1118 983 .clkdm_name = "alwon_l3s_clkdm", 1119 984 .main_clk = "sysclk4_ck", 1120 985 .prcm = { 1121 986 .omap4 = { 1122 - .clkctrl_offs = DM816X_CM_ALWON_TPTC1_CLKCTRL, 987 + .clkctrl_offs = DM81XX_CM_ALWON_TPTC1_CLKCTRL, 1123 988 .modulemode = MODULEMODE_SWCTRL, 1124 989 }, 1125 990 }, 1126 991 }; 1127 992 1128 - struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tptc1 = { 1129 - .master = &dm816x_alwon_l3_fast_hwmod, 1130 - .slave = &dm816x_tptc1_hwmod, 993 + static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc1 = { 994 + .master = &dm81xx_alwon_l3_fast_hwmod, 995 + .slave = &dm81xx_tptc1_hwmod, 1131 996 .clk = "sysclk4_ck", 1132 - .addr = dm816x_tptc1_addr_space, 997 + .addr = dm81xx_tptc1_addr_space, 1133 998 .user = OCP_USER_MPU, 1134 999 }; 1135 1000 1136 - struct omap_hwmod_ocp_if dm816x_tptc1__alwon_l3_fast = { 1137 - .master = &dm816x_tptc1_hwmod, 1138 - .slave = &dm816x_alwon_l3_fast_hwmod, 1001 + static struct omap_hwmod_ocp_if dm81xx_tptc1__alwon_l3_fast = { 1002 + .master = &dm81xx_tptc1_hwmod, 1003 + .slave = &dm81xx_alwon_l3_fast_hwmod, 1139 1004 .clk = "sysclk4_ck", 1140 - .addr = dm816x_tptc1_addr_space, 1005 + .addr = dm81xx_tptc1_addr_space, 1141 1006 .user = OCP_USER_MPU, 1142 1007 }; 1143 1008 1144 - static struct omap_hwmod_addr_space dm816x_tptc2_addr_space[] = { 1009 + static struct omap_hwmod_addr_space dm81xx_tptc2_addr_space[] = { 1145 1010 { 1146 1011 .pa_start = 0x49a00000, 1147 1012 .pa_end = 0x49a00000 + SZ_8K - 1, ··· 1150 1015 { }, 1151 1016 }; 1152 1017 1153 - static struct omap_hwmod_class dm816x_tptc2_hwmod_class = { 1018 + static struct omap_hwmod_class dm81xx_tptc2_hwmod_class = { 1154 1019 .name = "tptc2", 1155 1020 }; 1156 1021 1157 - struct omap_hwmod dm816x_tptc2_hwmod = { 1022 + static struct omap_hwmod dm81xx_tptc2_hwmod = { 1158 1023 .name = "tptc2", 1159 - .class = &dm816x_tptc2_hwmod_class, 1024 + .class = &dm81xx_tptc2_hwmod_class, 1160 1025 .clkdm_name = "alwon_l3s_clkdm", 1161 1026 .main_clk = "sysclk4_ck", 1162 1027 .prcm = { 1163 1028 .omap4 = { 1164 - .clkctrl_offs = DM816X_CM_ALWON_TPTC2_CLKCTRL, 1029 + .clkctrl_offs = DM81XX_CM_ALWON_TPTC2_CLKCTRL, 1165 1030 .modulemode = MODULEMODE_SWCTRL, 1166 1031 }, 1167 1032 }, 1168 1033 }; 1169 1034 1170 - struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tptc2 = { 1171 - .master = &dm816x_alwon_l3_fast_hwmod, 1172 - .slave = &dm816x_tptc2_hwmod, 1035 + static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc2 = { 1036 + .master = &dm81xx_alwon_l3_fast_hwmod, 1037 + .slave = &dm81xx_tptc2_hwmod, 1173 1038 .clk = "sysclk4_ck", 1174 - .addr = dm816x_tptc2_addr_space, 1039 + .addr = dm81xx_tptc2_addr_space, 1175 1040 .user = OCP_USER_MPU, 1176 1041 }; 1177 1042 1178 - struct omap_hwmod_ocp_if dm816x_tptc2__alwon_l3_fast = { 1179 - .master = &dm816x_tptc2_hwmod, 1180 - .slave = &dm816x_alwon_l3_fast_hwmod, 1043 + static struct omap_hwmod_ocp_if dm81xx_tptc2__alwon_l3_fast = { 1044 + .master = &dm81xx_tptc2_hwmod, 1045 + .slave = &dm81xx_alwon_l3_fast_hwmod, 1181 1046 .clk = "sysclk4_ck", 1182 - .addr = dm816x_tptc2_addr_space, 1047 + .addr = dm81xx_tptc2_addr_space, 1183 1048 .user = OCP_USER_MPU, 1184 1049 }; 1185 1050 1186 - static struct omap_hwmod_addr_space dm816x_tptc3_addr_space[] = { 1051 + static struct omap_hwmod_addr_space dm81xx_tptc3_addr_space[] = { 1187 1052 { 1188 1053 .pa_start = 0x49b00000, 1189 1054 .pa_end = 0x49b00000 + SZ_8K - 1, ··· 1192 1057 { }, 1193 1058 }; 1194 1059 1195 - static struct omap_hwmod_class dm816x_tptc3_hwmod_class = { 1060 + static struct omap_hwmod_class dm81xx_tptc3_hwmod_class = { 1196 1061 .name = "tptc3", 1197 1062 }; 1198 1063 1199 - struct omap_hwmod dm816x_tptc3_hwmod = { 1064 + static struct omap_hwmod dm81xx_tptc3_hwmod = { 1200 1065 .name = "tptc3", 1201 - .class = &dm816x_tptc3_hwmod_class, 1066 + .class = &dm81xx_tptc3_hwmod_class, 1202 1067 .clkdm_name = "alwon_l3s_clkdm", 1203 1068 .main_clk = "sysclk4_ck", 1204 1069 .prcm = { 1205 1070 .omap4 = { 1206 - .clkctrl_offs = DM816X_CM_ALWON_TPTC3_CLKCTRL, 1071 + .clkctrl_offs = DM81XX_CM_ALWON_TPTC3_CLKCTRL, 1207 1072 .modulemode = MODULEMODE_SWCTRL, 1208 1073 }, 1209 1074 }, 1210 1075 }; 1211 1076 1212 - struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tptc3 = { 1213 - .master = &dm816x_alwon_l3_fast_hwmod, 1214 - .slave = &dm816x_tptc3_hwmod, 1077 + static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc3 = { 1078 + .master = &dm81xx_alwon_l3_fast_hwmod, 1079 + .slave = &dm81xx_tptc3_hwmod, 1215 1080 .clk = "sysclk4_ck", 1216 - .addr = dm816x_tptc3_addr_space, 1081 + .addr = dm81xx_tptc3_addr_space, 1217 1082 .user = OCP_USER_MPU, 1218 1083 }; 1219 1084 1220 - struct omap_hwmod_ocp_if dm816x_tptc3__alwon_l3_fast = { 1221 - .master = &dm816x_tptc3_hwmod, 1222 - .slave = &dm816x_alwon_l3_fast_hwmod, 1085 + static struct omap_hwmod_ocp_if dm81xx_tptc3__alwon_l3_fast = { 1086 + .master = &dm81xx_tptc3_hwmod, 1087 + .slave = &dm81xx_alwon_l3_fast_hwmod, 1223 1088 .clk = "sysclk4_ck", 1224 - .addr = dm816x_tptc3_addr_space, 1089 + .addr = dm81xx_tptc3_addr_space, 1225 1090 .user = OCP_USER_MPU, 1226 1091 }; 1092 + 1093 + /* 1094 + * REVISIT: Test and enable the following once clocks work: 1095 + * dm81xx_l4_ls__gpio1 1096 + * dm81xx_l4_ls__gpio2 1097 + * dm81xx_l4_ls__mailbox 1098 + * dm81xx_alwon_l3_slow__gpmc 1099 + * dm81xx_default_l3_slow__usbss 1100 + * 1101 + * Also note that some devices share a single clkctrl_offs.. 1102 + * For example, i2c1 and 3 share one, and i2c2 and 4 share one. 1103 + */ 1104 + static struct omap_hwmod_ocp_if *dm814x_hwmod_ocp_ifs[] __initdata = { 1105 + &dm814x_mpu__alwon_l3_slow, 1106 + &dm814x_mpu__alwon_l3_med, 1107 + &dm81xx_alwon_l3_slow__l4_ls, 1108 + &dm81xx_alwon_l3_slow__l4_hs, 1109 + &dm81xx_l4_ls__uart1, 1110 + &dm81xx_l4_ls__uart2, 1111 + &dm81xx_l4_ls__uart3, 1112 + &dm81xx_l4_ls__wd_timer1, 1113 + &dm81xx_l4_ls__i2c1, 1114 + &dm81xx_l4_ls__i2c2, 1115 + &dm81xx_l4_ls__elm, 1116 + &dm81xx_l4_ls__mcspi1, 1117 + &dm81xx_alwon_l3_fast__tpcc, 1118 + &dm81xx_alwon_l3_fast__tptc0, 1119 + &dm81xx_alwon_l3_fast__tptc1, 1120 + &dm81xx_alwon_l3_fast__tptc2, 1121 + &dm81xx_alwon_l3_fast__tptc3, 1122 + &dm81xx_tptc0__alwon_l3_fast, 1123 + &dm81xx_tptc1__alwon_l3_fast, 1124 + &dm81xx_tptc2__alwon_l3_fast, 1125 + &dm81xx_tptc3__alwon_l3_fast, 1126 + &dm814x_l4_ls__timer1, 1127 + &dm814x_l4_ls__timer2, 1128 + &dm814x_l4_hs__cpgmac0, 1129 + &dm814x_cpgmac0__mdio, 1130 + NULL, 1131 + }; 1132 + 1133 + int __init dm814x_hwmod_init(void) 1134 + { 1135 + omap_hwmod_init(); 1136 + return omap_hwmod_register_links(dm814x_hwmod_ocp_ifs); 1137 + } 1227 1138 1228 1139 static struct omap_hwmod_ocp_if *dm816x_hwmod_ocp_ifs[] __initdata = { 1229 1140 &dm816x_mpu__alwon_l3_slow, 1230 1141 &dm816x_mpu__alwon_l3_med, 1231 - &dm816x_alwon_l3_slow__l4_ls, 1232 - &dm816x_alwon_l3_slow__l4_hs, 1233 - &dm816x_l4_ls__uart1, 1234 - &dm816x_l4_ls__uart2, 1235 - &dm816x_l4_ls__uart3, 1236 - &dm816x_l4_ls__wd_timer1, 1237 - &dm816x_l4_ls__i2c1, 1238 - &dm816x_l4_ls__i2c2, 1142 + &dm81xx_alwon_l3_slow__l4_ls, 1143 + &dm81xx_alwon_l3_slow__l4_hs, 1144 + &dm81xx_l4_ls__uart1, 1145 + &dm81xx_l4_ls__uart2, 1146 + &dm81xx_l4_ls__uart3, 1147 + &dm81xx_l4_ls__wd_timer1, 1148 + &dm81xx_l4_ls__i2c1, 1149 + &dm81xx_l4_ls__i2c2, 1239 1150 &dm81xx_l4_ls__gpio1, 1240 1151 &dm81xx_l4_ls__gpio2, 1241 1152 &dm81xx_l4_ls__elm, ··· 1293 1112 &dm816x_l4_ls__timer5, 1294 1113 &dm816x_l4_ls__timer6, 1295 1114 &dm816x_l4_ls__timer7, 1296 - &dm816x_l4_ls__mcspi1, 1297 - &dm816x_l4_ls__mailbox, 1298 - &dm816x_l4_hs__emac0, 1299 - &dm816x_emac0__mdio, 1115 + &dm81xx_l4_ls__mcspi1, 1116 + &dm81xx_l4_ls__mailbox, 1117 + &dm81xx_l4_hs__emac0, 1118 + &dm81xx_emac0__mdio, 1300 1119 &dm816x_l4_hs__emac1, 1301 - &dm816x_alwon_l3_fast__tpcc, 1302 - &dm816x_alwon_l3_fast__tptc0, 1303 - &dm816x_alwon_l3_fast__tptc1, 1304 - &dm816x_alwon_l3_fast__tptc2, 1305 - &dm816x_alwon_l3_fast__tptc3, 1306 - &dm816x_tptc0__alwon_l3_fast, 1307 - &dm816x_tptc1__alwon_l3_fast, 1308 - &dm816x_tptc2__alwon_l3_fast, 1309 - &dm816x_tptc3__alwon_l3_fast, 1120 + &dm81xx_alwon_l3_fast__tpcc, 1121 + &dm81xx_alwon_l3_fast__tptc0, 1122 + &dm81xx_alwon_l3_fast__tptc1, 1123 + &dm81xx_alwon_l3_fast__tptc2, 1124 + &dm81xx_alwon_l3_fast__tptc3, 1125 + &dm81xx_tptc0__alwon_l3_fast, 1126 + &dm81xx_tptc1__alwon_l3_fast, 1127 + &dm81xx_tptc2__alwon_l3_fast, 1128 + &dm81xx_tptc3__alwon_l3_fast, 1310 1129 &dm81xx_alwon_l3_slow__gpmc, 1311 1130 &dm81xx_default_l3_slow__usbss, 1312 1131 NULL, 1313 1132 }; 1314 1133 1315 - int __init ti81xx_hwmod_init(void) 1134 + int __init dm816x_hwmod_init(void) 1316 1135 { 1317 1136 omap_hwmod_init(); 1318 1137 return omap_hwmod_register_links(dm816x_hwmod_ocp_ifs);
+3 -3
arch/arm/mach-omap2/pdata-quirks.c
··· 31 31 void (*fn)(void); 32 32 }; 33 33 34 - struct of_dev_auxdata omap_auxdata_lookup[]; 34 + static struct of_dev_auxdata omap_auxdata_lookup[]; 35 35 static struct twl4030_gpio_platform_data twl_gpio_auxdata; 36 36 37 37 #ifdef CONFIG_MACH_NOKIA_N8X0 ··· 128 128 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub"); 129 129 } 130 130 131 - struct ti_st_plat_data wilink_pdata = { 131 + static struct ti_st_plat_data wilink_pdata = { 132 132 .nshutdown_gpio = 137, 133 133 .dev_name = "/dev/ttyO1", 134 134 .flow_cntrl = 1, ··· 323 323 { /* sentinel */ }, 324 324 }; 325 325 326 - struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { 326 + static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { 327 327 #ifdef CONFIG_MACH_NOKIA_N8X0 328 328 OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), 329 329 OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data),
+123 -3
arch/arm/mach-omap2/powerdomains3xxx_data.c
··· 349 349 .voltdm = { .name = "core" }, 350 350 }; 351 351 352 + static struct powerdomain gem_814x_pwrdm = { 353 + .name = "gem_pwrdm", 354 + .prcm_offs = TI814X_PRM_DSP_MOD, 355 + .pwrsts = PWRSTS_OFF_ON, 356 + .voltdm = { .name = "dsp" }, 357 + }; 358 + 359 + static struct powerdomain ivahd_814x_pwrdm = { 360 + .name = "ivahd_pwrdm", 361 + .prcm_offs = TI814X_PRM_HDVICP_MOD, 362 + .pwrsts = PWRSTS_OFF_ON, 363 + .voltdm = { .name = "iva" }, 364 + }; 365 + 366 + static struct powerdomain hdvpss_814x_pwrdm = { 367 + .name = "hdvpss_pwrdm", 368 + .prcm_offs = TI814X_PRM_HDVPSS_MOD, 369 + .pwrsts = PWRSTS_OFF_ON, 370 + .voltdm = { .name = "dsp" }, 371 + }; 372 + 373 + static struct powerdomain sgx_814x_pwrdm = { 374 + .name = "sgx_pwrdm", 375 + .prcm_offs = TI814X_PRM_GFX_MOD, 376 + .pwrsts = PWRSTS_OFF_ON, 377 + .voltdm = { .name = "core" }, 378 + }; 379 + 380 + static struct powerdomain isp_814x_pwrdm = { 381 + .name = "isp_pwrdm", 382 + .prcm_offs = TI814X_PRM_ISP_MOD, 383 + .pwrsts = PWRSTS_OFF_ON, 384 + .voltdm = { .name = "core" }, 385 + }; 386 + 352 387 static struct powerdomain active_816x_pwrdm = { 353 388 .name = "active_pwrdm", 354 389 .prcm_offs = TI816X_PRM_ACTIVE_MOD, ··· 483 448 NULL 484 449 }; 485 450 486 - static struct powerdomain *powerdomains_ti81xx[] __initdata = { 451 + static struct powerdomain *powerdomains_ti814x[] __initdata = { 452 + &alwon_81xx_pwrdm, 453 + &device_81xx_pwrdm, 454 + &gem_814x_pwrdm, 455 + &ivahd_814x_pwrdm, 456 + &hdvpss_814x_pwrdm, 457 + &sgx_814x_pwrdm, 458 + &isp_814x_pwrdm, 459 + NULL 460 + }; 461 + 462 + static struct powerdomain *powerdomains_ti816x[] __initdata = { 487 463 &alwon_81xx_pwrdm, 488 464 &device_81xx_pwrdm, 489 465 &active_816x_pwrdm, ··· 506 460 NULL 507 461 }; 508 462 463 + /* TI81XX specific ops */ 464 + #define TI81XX_PM_PWSTCTRL 0x0000 465 + #define TI81XX_RM_RSTCTRL 0x0010 466 + #define TI81XX_PM_PWSTST 0x0004 467 + 468 + static int ti81xx_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) 469 + { 470 + omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, 471 + (pwrst << OMAP_POWERSTATE_SHIFT), 472 + pwrdm->prcm_offs, TI81XX_PM_PWSTCTRL); 473 + return 0; 474 + } 475 + 476 + static int ti81xx_pwrdm_read_next_pwrst(struct powerdomain *pwrdm) 477 + { 478 + return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, 479 + TI81XX_PM_PWSTCTRL, 480 + OMAP_POWERSTATE_MASK); 481 + } 482 + 483 + static int ti81xx_pwrdm_read_pwrst(struct powerdomain *pwrdm) 484 + { 485 + return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, 486 + (pwrdm->prcm_offs == TI814X_PRM_GFX_MOD) ? TI81XX_RM_RSTCTRL : 487 + TI81XX_PM_PWSTST, 488 + OMAP_POWERSTATEST_MASK); 489 + } 490 + 491 + static int ti81xx_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm) 492 + { 493 + return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, 494 + (pwrdm->prcm_offs == TI814X_PRM_GFX_MOD) ? TI81XX_RM_RSTCTRL : 495 + TI81XX_PM_PWSTST, 496 + OMAP3430_LOGICSTATEST_MASK); 497 + } 498 + 499 + static int ti81xx_pwrdm_wait_transition(struct powerdomain *pwrdm) 500 + { 501 + u32 c = 0; 502 + 503 + while ((omap2_prm_read_mod_reg(pwrdm->prcm_offs, 504 + (pwrdm->prcm_offs == TI814X_PRM_GFX_MOD) ? TI81XX_RM_RSTCTRL : 505 + TI81XX_PM_PWSTST) & 506 + OMAP_INTRANSITION_MASK) && 507 + (c++ < PWRDM_TRANSITION_BAILOUT)) 508 + udelay(1); 509 + 510 + if (c > PWRDM_TRANSITION_BAILOUT) { 511 + pr_err("powerdomain: %s timeout waiting for transition\n", 512 + pwrdm->name); 513 + return -EAGAIN; 514 + } 515 + 516 + pr_debug("powerdomain: completed transition in %d loops\n", c); 517 + 518 + return 0; 519 + } 520 + 521 + /* For dm814x we need to fix up fix GFX pwstst and rstctrl reg offsets */ 522 + static struct pwrdm_ops ti81xx_pwrdm_operations = { 523 + .pwrdm_set_next_pwrst = ti81xx_pwrdm_set_next_pwrst, 524 + .pwrdm_read_next_pwrst = ti81xx_pwrdm_read_next_pwrst, 525 + .pwrdm_read_pwrst = ti81xx_pwrdm_read_pwrst, 526 + .pwrdm_read_logic_pwrst = ti81xx_pwrdm_read_logic_pwrst, 527 + .pwrdm_wait_transition = ti81xx_pwrdm_wait_transition, 528 + }; 529 + 509 530 void __init omap3xxx_powerdomains_init(void) 510 531 { 511 532 unsigned int rev; ··· 580 467 if (!cpu_is_omap34xx() && !cpu_is_ti81xx()) 581 468 return; 582 469 583 - pwrdm_register_platform_funcs(&omap3_pwrdm_operations); 470 + /* Only 81xx needs custom pwrdm_operations */ 471 + if (!cpu_is_ti81xx()) 472 + pwrdm_register_platform_funcs(&omap3_pwrdm_operations);; 584 473 585 474 rev = omap_rev(); 586 475 587 476 if (rev == AM35XX_REV_ES1_0 || rev == AM35XX_REV_ES1_1) { 588 477 pwrdm_register_pwrdms(powerdomains_am35x); 478 + } else if (rev == TI8148_REV_ES1_0 || rev == TI8148_REV_ES2_0 || 479 + rev == TI8148_REV_ES2_1) { 480 + pwrdm_register_platform_funcs(&ti81xx_pwrdm_operations); 481 + pwrdm_register_pwrdms(powerdomains_ti814x); 589 482 } else if (rev == TI8168_REV_ES1_0 || rev == TI8168_REV_ES1_1 590 483 || rev == TI8168_REV_ES2_0 || rev == TI8168_REV_ES2_1) { 591 - pwrdm_register_pwrdms(powerdomains_ti81xx); 484 + pwrdm_register_platform_funcs(&ti81xx_pwrdm_operations); 485 + pwrdm_register_pwrdms(powerdomains_ti816x); 592 486 } else { 593 487 pwrdm_register_pwrdms(powerdomains_omap3430_common); 594 488
+8
arch/arm/mach-omap2/prcm-common.h
··· 51 51 /* 52 52 * TI81XX PRM module offsets 53 53 */ 54 + #define TI814X_PRM_DSP_MOD 0x0a00 55 + #define TI814X_PRM_HDVICP_MOD 0x0c00 56 + #define TI814X_PRM_ISP_MOD 0x0d00 57 + #define TI814X_PRM_HDVPSS_MOD 0x0e00 58 + #define TI814X_PRM_GFX_MOD 0x0f00 59 + 54 60 #define TI81XX_PRM_DEVICE_MOD 0x0000 55 61 #define TI816X_PRM_ACTIVE_MOD 0x0a00 56 62 #define TI81XX_PRM_DEFAULT_MOD 0x0b00 ··· 478 472 * struct omap_prcm_irq_setup - PRCM interrupt controller details 479 473 * @ack: PRM register offset for the first PRM_IRQSTATUS_MPU register 480 474 * @mask: PRM register offset for the first PRM_IRQENABLE_MPU register 475 + * @pm_ctrl: PRM register offset for the PRM_IO_PMCTRL register 481 476 * @nr_regs: number of PRM_IRQ{STATUS,ENABLE}_MPU* registers 482 477 * @nr_irqs: number of entries in the @irqs array 483 478 * @irqs: ptr to an array of PRCM interrupt bits (see @nr_irqs) ··· 501 494 struct omap_prcm_irq_setup { 502 495 u16 ack; 503 496 u16 mask; 497 + u16 pm_ctrl; 504 498 u8 nr_regs; 505 499 u8 nr_irqs; 506 500 const struct omap_prcm_irq *irqs;
+7
arch/arm/mach-omap2/prcm43xx.h
··· 25 25 #define AM43XX_PRM_WKUP_INST 0x2000 26 26 #define AM43XX_PRM_DEVICE_INST 0x4000 27 27 28 + /* PRM_IRQ offsets */ 29 + #define AM43XX_PRM_IRQSTATUS_MPU_OFFSET 0x0004 30 + #define AM43XX_PRM_IRQENABLE_MPU_OFFSET 0x0008 31 + 32 + /* Other PRM offsets */ 33 + #define AM43XX_PRM_IO_PMCTRL_OFFSET 0x0024 34 + 28 35 /* RM RSTCTRL offsets */ 29 36 #define AM43XX_RM_PER_RSTCTRL_OFFSET 0x0010 30 37 #define AM43XX_RM_GFX_RSTCTRL_OFFSET 0x0010
+37 -24
arch/arm/mach-omap2/prm44xx.c
··· 18 18 #include <linux/err.h> 19 19 #include <linux/io.h> 20 20 #include <linux/of_irq.h> 21 - 21 + #include <linux/of.h> 22 22 23 23 #include "soc.h" 24 24 #include "iomap.h" 25 25 #include "common.h" 26 26 #include "vp.h" 27 27 #include "prm44xx.h" 28 + #include "prcm43xx.h" 28 29 #include "prm-regbits-44xx.h" 29 30 #include "prcm44xx.h" 30 31 #include "prminst44xx.h" ··· 46 45 static struct omap_prcm_irq_setup omap4_prcm_irq_setup = { 47 46 .ack = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, 48 47 .mask = OMAP4_PRM_IRQENABLE_MPU_OFFSET, 48 + .pm_ctrl = OMAP4_PRM_IO_PMCTRL_OFFSET, 49 49 .nr_regs = 2, 50 50 .irqs = omap4_prcm_irqs, 51 51 .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs), ··· 218 216 */ 219 217 static void omap44xx_prm_read_pending_irqs(unsigned long *events) 220 218 { 221 - events[0] = _read_pending_irq_reg(OMAP4_PRM_IRQENABLE_MPU_OFFSET, 222 - OMAP4_PRM_IRQSTATUS_MPU_OFFSET); 219 + int i; 223 220 224 - events[1] = _read_pending_irq_reg(OMAP4_PRM_IRQENABLE_MPU_2_OFFSET, 225 - OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET); 221 + for (i = 0; i < omap4_prcm_irq_setup.nr_regs; i++) 222 + events[i] = _read_pending_irq_reg(omap4_prcm_irq_setup.mask + 223 + i * 4, omap4_prcm_irq_setup.ack + i * 4); 226 224 } 227 225 228 226 /** ··· 252 250 */ 253 251 static void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask) 254 252 { 255 - saved_mask[0] = 256 - omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, 257 - OMAP4_PRM_IRQENABLE_MPU_OFFSET); 258 - saved_mask[1] = 259 - omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, 260 - OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); 253 + int i; 254 + u16 reg; 261 255 262 - omap4_prm_write_inst_reg(0, OMAP4430_PRM_OCP_SOCKET_INST, 263 - OMAP4_PRM_IRQENABLE_MPU_OFFSET); 264 - omap4_prm_write_inst_reg(0, OMAP4430_PRM_OCP_SOCKET_INST, 265 - OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); 256 + for (i = 0; i < omap4_prcm_irq_setup.nr_regs; i++) { 257 + reg = omap4_prcm_irq_setup.mask + i * 4; 258 + 259 + saved_mask[i] = 260 + omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, 261 + reg); 262 + omap4_prm_write_inst_reg(0, OMAP4430_PRM_OCP_SOCKET_INST, reg); 263 + } 266 264 267 265 /* OCP barrier */ 268 266 omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, ··· 281 279 */ 282 280 static void omap44xx_prm_restore_irqen(u32 *saved_mask) 283 281 { 284 - omap4_prm_write_inst_reg(saved_mask[0], OMAP4430_PRM_OCP_SOCKET_INST, 285 - OMAP4_PRM_IRQENABLE_MPU_OFFSET); 286 - omap4_prm_write_inst_reg(saved_mask[1], OMAP4430_PRM_OCP_SOCKET_INST, 287 - OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); 282 + int i; 283 + 284 + for (i = 0; i < omap4_prcm_irq_setup.nr_regs; i++) 285 + omap4_prm_write_inst_reg(saved_mask[i], 286 + OMAP4430_PRM_OCP_SOCKET_INST, 287 + omap4_prcm_irq_setup.mask + i * 4); 288 288 } 289 289 290 290 /** ··· 310 306 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 311 307 OMAP4430_WUCLK_CTRL_MASK, 312 308 inst, 313 - OMAP4_PRM_IO_PMCTRL_OFFSET); 309 + omap4_prcm_irq_setup.pm_ctrl); 314 310 omap_test_timeout( 315 311 (((omap4_prm_read_inst_reg(inst, 316 - OMAP4_PRM_IO_PMCTRL_OFFSET) & 312 + omap4_prcm_irq_setup.pm_ctrl) & 317 313 OMAP4430_WUCLK_STATUS_MASK) >> 318 314 OMAP4430_WUCLK_STATUS_SHIFT) == 1), 319 315 MAX_IOPAD_LATCH_TIME, i); ··· 323 319 /* Trigger WUCLKIN disable */ 324 320 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0, 325 321 inst, 326 - OMAP4_PRM_IO_PMCTRL_OFFSET); 322 + omap4_prcm_irq_setup.pm_ctrl); 327 323 omap_test_timeout( 328 324 (((omap4_prm_read_inst_reg(inst, 329 - OMAP4_PRM_IO_PMCTRL_OFFSET) & 325 + omap4_prcm_irq_setup.pm_ctrl) & 330 326 OMAP4430_WUCLK_STATUS_MASK) >> 331 327 OMAP4430_WUCLK_STATUS_SHIFT) == 0), 332 328 MAX_IOPAD_LATCH_TIME, i); ··· 354 350 omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK, 355 351 OMAP4430_GLOBAL_WUEN_MASK, 356 352 inst, 357 - OMAP4_PRM_IO_PMCTRL_OFFSET); 353 + omap4_prcm_irq_setup.pm_ctrl); 358 354 } 359 355 360 356 /** ··· 722 718 prm_features |= PRM_HAS_VOLTAGE; 723 719 724 720 omap4_prminst_set_prm_dev_inst(data->device_inst_offset); 721 + 722 + /* Add AM437X specific differences */ 723 + if (of_device_is_compatible(data->np, "ti,am4-prcm")) { 724 + omap4_prcm_irq_setup.nr_irqs = 1; 725 + omap4_prcm_irq_setup.nr_regs = 1; 726 + omap4_prcm_irq_setup.pm_ctrl = AM43XX_PRM_IO_PMCTRL_OFFSET; 727 + omap4_prcm_irq_setup.ack = AM43XX_PRM_IRQSTATUS_MPU_OFFSET; 728 + omap4_prcm_irq_setup.mask = AM43XX_PRM_IRQENABLE_MPU_OFFSET; 729 + } 725 730 726 731 return prm_register(&omap44xx_prm_ll_data); 727 732 }
+1
arch/arm/mach-omap2/prm_common.c
··· 696 696 .index = TI_CLKM_PRM, 697 697 .init = omap44xx_prm_init, 698 698 .device_inst_offset = AM43XX_PRM_DEVICE_INST, 699 + .flags = PRM_HAS_IO_WAKEUP, 699 700 }; 700 701 #endif 701 702
+2 -16
arch/arm/mach-omap2/timer.c
··· 208 208 /* If we are a secure device, remove any secure timer nodes */ 209 209 if ((omap_type() != OMAP2_DEVICE_TYPE_GP)) { 210 210 np = omap_get_timer_dt(omap_timer_match, "ti,timer-secure"); 211 - if (np) 212 - of_node_put(np); 211 + of_node_put(np); 213 212 } 214 213 } 215 214 ··· 648 649 649 650 #ifdef CONFIG_ARCH_OMAP4 650 651 #ifdef CONFIG_HAVE_ARM_TWD 651 - static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29); 652 652 void __init omap4_local_timer_init(void) 653 653 { 654 654 omap4_sync32k_timer_init(); 655 - /* Local timers are not supprted on OMAP4430 ES1.0 */ 656 - if (omap_rev() != OMAP4430_REV_ES1_0) { 657 - int err; 658 - 659 - if (of_have_populated_dt()) { 660 - clocksource_of_init(); 661 - return; 662 - } 663 - 664 - err = twd_local_timer_register(&twd_local_timer); 665 - if (err) 666 - pr_err("twd_local_timer_register failed %d\n", err); 667 - } 655 + clocksource_of_init(); 668 656 } 669 657 #else 670 658 void __init omap4_local_timer_init(void)
+37
arch/arm/mach-pxa/devices.c
··· 17 17 #include <linux/platform_data/camera-pxa.h> 18 18 #include <mach/audio.h> 19 19 #include <mach/hardware.h> 20 + #include <linux/platform_data/mmp_dma.h> 20 21 #include <linux/platform_data/mtd-nand-pxa3xx.h> 21 22 22 23 #include "devices.h" ··· 1193 1192 1194 1193 pd->dev.platform_data = info; 1195 1194 platform_device_add(pd); 1195 + } 1196 + 1197 + static struct mmp_dma_platdata pxa_dma_pdata = { 1198 + .dma_channels = 0, 1199 + }; 1200 + 1201 + static struct resource pxa_dma_resource[] = { 1202 + [0] = { 1203 + .start = 0x40000000, 1204 + .end = 0x4000ffff, 1205 + .flags = IORESOURCE_MEM, 1206 + }, 1207 + [1] = { 1208 + .start = IRQ_DMA, 1209 + .end = IRQ_DMA, 1210 + .flags = IORESOURCE_IRQ, 1211 + }, 1212 + }; 1213 + 1214 + static u64 pxadma_dmamask = 0xffffffffUL; 1215 + 1216 + static struct platform_device pxa2xx_pxa_dma = { 1217 + .name = "pxa-dma", 1218 + .id = 0, 1219 + .dev = { 1220 + .dma_mask = &pxadma_dmamask, 1221 + .coherent_dma_mask = 0xffffffff, 1222 + }, 1223 + .num_resources = ARRAY_SIZE(pxa_dma_resource), 1224 + .resource = pxa_dma_resource, 1225 + }; 1226 + 1227 + void __init pxa2xx_set_dmac_info(int nb_channels) 1228 + { 1229 + pxa_dma_pdata.dma_channels = nb_channels; 1230 + pxa_register_device(&pxa2xx_pxa_dma, &pxa_dma_pdata); 1196 1231 }
+1
arch/arm/mach-pxa/pxa25x.c
··· 206 206 register_syscore_ops(&pxa_irq_syscore_ops); 207 207 register_syscore_ops(&pxa2xx_mfp_syscore_ops); 208 208 209 + pxa2xx_set_dmac_info(16); 209 210 pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info); 210 211 ret = platform_add_devices(pxa25x_devices, 211 212 ARRAY_SIZE(pxa25x_devices));
+1
arch/arm/mach-pxa/pxa27x.c
··· 310 310 if (!of_have_populated_dt()) { 311 311 pxa_register_device(&pxa27x_device_gpio, 312 312 &pxa27x_gpio_info); 313 + pxa2xx_set_dmac_info(32); 313 314 ret = platform_add_devices(devices, 314 315 ARRAY_SIZE(devices)); 315 316 }
+1
arch/arm/mach-pxa/pxa3xx.c
··· 431 431 if (of_have_populated_dt()) 432 432 return 0; 433 433 434 + pxa2xx_set_dmac_info(32); 434 435 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 435 436 if (ret) 436 437 return ret;
+2 -4
arch/arm/mach-pxa/sharpsl_pm.c
··· 841 841 sharpsl_pm.charge_mode = CHRG_OFF; 842 842 sharpsl_pm.flags = 0; 843 843 844 - init_timer(&sharpsl_pm.ac_timer); 845 - sharpsl_pm.ac_timer.function = sharpsl_ac_timer; 844 + setup_timer(&sharpsl_pm.ac_timer, sharpsl_ac_timer, 0UL); 846 845 847 - init_timer(&sharpsl_pm.chrg_full_timer); 848 - sharpsl_pm.chrg_full_timer.function = sharpsl_chrg_full_timer; 846 + setup_timer(&sharpsl_pm.chrg_full_timer, sharpsl_chrg_full_timer, 0UL); 849 847 850 848 led_trigger_register_simple("sharpsl-charge", &sharpsl_charge_led_trigger); 851 849
+1 -14
arch/arm/mach-pxa/tosa-bt.c
··· 131 131 .name = "tosa-bt", 132 132 }, 133 133 }; 134 - 135 - 136 - static int __init tosa_bt_init(void) 137 - { 138 - return platform_driver_register(&tosa_bt_driver); 139 - } 140 - 141 - static void __exit tosa_bt_exit(void) 142 - { 143 - platform_driver_unregister(&tosa_bt_driver); 144 - } 145 - 146 - module_init(tosa_bt_init); 147 - module_exit(tosa_bt_exit); 134 + module_platform_driver(tosa_bt_driver);
+34 -22
arch/arm/mach-rockchip/platsmp.c
··· 72 72 static int pmu_set_power_domain(int pd, bool on) 73 73 { 74 74 u32 val = (on) ? 0 : BIT(pd); 75 + struct reset_control *rstc = rockchip_get_core_reset(pd); 75 76 int ret; 77 + 78 + if (IS_ERR(rstc) && read_cpuid_part() != ARM_CPU_PART_CORTEX_A9) { 79 + pr_err("%s: could not get reset control for core %d\n", 80 + __func__, pd); 81 + return PTR_ERR(rstc); 82 + } 76 83 77 84 /* 78 85 * We need to soft reset the cpu when we turn off the cpu power domain, 79 86 * or else the active processors might be stalled when the individual 80 87 * processor is powered down. 81 88 */ 82 - if (read_cpuid_part() != ARM_CPU_PART_CORTEX_A9) { 83 - struct reset_control *rstc = rockchip_get_core_reset(pd); 84 - 85 - if (IS_ERR(rstc)) { 86 - pr_err("%s: could not get reset control for core %d\n", 87 - __func__, pd); 88 - return PTR_ERR(rstc); 89 - } 90 - 91 - if (on) 92 - reset_control_deassert(rstc); 93 - else 94 - reset_control_assert(rstc); 95 - 96 - reset_control_put(rstc); 97 - } 89 + if (!IS_ERR(rstc) && !on) 90 + reset_control_assert(rstc); 98 91 99 92 ret = regmap_update_bits(pmu, PMU_PWRDN_CON, BIT(pd), val); 100 93 if (ret < 0) { ··· 100 107 ret = pmu_power_domain_is_on(pd); 101 108 if (ret < 0) { 102 109 pr_err("%s: could not read power domain state\n", 103 - __func__); 110 + __func__); 104 111 return ret; 105 112 } 113 + } 114 + 115 + if (!IS_ERR(rstc)) { 116 + if (on) 117 + reset_control_deassert(rstc); 118 + reset_control_put(rstc); 106 119 } 107 120 108 121 return 0; ··· 129 130 130 131 if (cpu >= ncores) { 131 132 pr_err("%s: cpu %d outside maximum number of cpus %d\n", 132 - __func__, cpu, ncores); 133 + __func__, cpu, ncores); 133 134 return -ENXIO; 134 135 } 135 136 ··· 139 140 return ret; 140 141 141 142 if (read_cpuid_part() != ARM_CPU_PART_CORTEX_A9) { 142 - /* We communicate with the bootrom to active the cpus other 143 + /* 144 + * We communicate with the bootrom to active the cpus other 143 145 * than cpu0, after a blob of initialize code, they will 144 146 * stay at wfe state, once they are actived, they will check 145 147 * the mailbox: 146 148 * sram_base_addr + 4: 0xdeadbeaf 147 149 * sram_base_addr + 8: start address for pc 148 - * */ 149 - udelay(10); 150 + * The cpu0 need to wait the other cpus other than cpu0 entering 151 + * the wfe state.The wait time is affected by many aspects. 152 + * (e.g: cpu frequency, bootrom frequency, sram frequency, ...) 153 + */ 154 + mdelay(1); /* ensure the cpus other than cpu0 to startup */ 155 + 150 156 writel(virt_to_phys(secondary_startup), sram_base_addr + 8); 151 157 writel(0xDEADBEAF, sram_base_addr + 4); 152 158 dsb_sev(); ··· 321 317 #ifdef CONFIG_HOTPLUG_CPU 322 318 static int rockchip_cpu_kill(unsigned int cpu) 323 319 { 320 + /* 321 + * We need a delay here to ensure that the dying CPU can finish 322 + * executing v7_coherency_exit() and reach the WFI/WFE state 323 + * prior to having the power domain disabled. 324 + */ 325 + mdelay(1); 326 + 324 327 pmu_set_power_domain(0 + cpu, false); 325 328 return 1; 326 329 } ··· 335 324 static void rockchip_cpu_die(unsigned int cpu) 336 325 { 337 326 v7_exit_coherency_flush(louis); 338 - while(1) 327 + while (1) 339 328 cpu_do_idle(); 340 329 } 341 330 #endif ··· 348 337 .cpu_die = rockchip_cpu_die, 349 338 #endif 350 339 }; 340 + 351 341 CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", &rockchip_smp_ops);
+69 -9
arch/arm/mach-rockchip/pm.c
··· 45 45 46 46 static struct regmap *pmu_regmap; 47 47 static struct regmap *sgrf_regmap; 48 + static struct regmap *grf_regmap; 48 49 49 50 static u32 rk3288_pmu_pwr_mode_con; 50 51 static u32 rk3288_sgrf_soc_con0; 52 + static u32 rk3288_sgrf_cpu_con0; 51 53 52 54 static inline u32 rk3288_l2_config(void) 53 55 { ··· 68 66 rkpm_bootdata_l2ctlr = rk3288_l2_config(); 69 67 } 70 68 69 + #define GRF_UOC0_CON0 0x320 70 + #define GRF_UOC1_CON0 0x334 71 + #define GRF_UOC2_CON0 0x348 72 + #define GRF_SIDDQ BIT(13) 73 + 74 + static bool rk3288_slp_disable_osc(void) 75 + { 76 + static const u32 reg_offset[] = { GRF_UOC0_CON0, GRF_UOC1_CON0, 77 + GRF_UOC2_CON0 }; 78 + u32 reg, i; 79 + 80 + /* 81 + * if any usb phy is still on(GRF_SIDDQ==0), that means we need the 82 + * function of usb wakeup, so do not switch to 32khz, since the usb phy 83 + * clk does not connect to 32khz osc 84 + */ 85 + for (i = 0; i < ARRAY_SIZE(reg_offset); i++) { 86 + regmap_read(grf_regmap, reg_offset[i], &reg); 87 + if (!(reg & GRF_SIDDQ)) 88 + return false; 89 + } 90 + 91 + return true; 92 + } 93 + 71 94 static void rk3288_slp_mode_set(int level) 72 95 { 73 96 u32 mode_set, mode_set1; 97 + bool osc_disable = rk3288_slp_disable_osc(); 74 98 99 + regmap_read(sgrf_regmap, RK3288_SGRF_CPU_CON0, &rk3288_sgrf_cpu_con0); 75 100 regmap_read(sgrf_regmap, RK3288_SGRF_SOC_CON0, &rk3288_sgrf_soc_con0); 76 101 77 102 regmap_read(pmu_regmap, RK3288_PMU_PWRMODE_CON, ··· 123 94 regmap_write(sgrf_regmap, RK3288_SGRF_FAST_BOOT_ADDR, 124 95 rk3288_bootram_phy); 125 96 126 - regmap_write(pmu_regmap, RK3288_PMU_WAKEUP_CFG1, 127 - PMU_ARMINT_WAKEUP_EN); 128 - 129 97 mode_set = BIT(PMU_GLOBAL_INT_DISABLE) | BIT(PMU_L2FLUSH_EN) | 130 98 BIT(PMU_SREF0_ENTER_EN) | BIT(PMU_SREF1_ENTER_EN) | 131 99 BIT(PMU_DDR0_GATING_EN) | BIT(PMU_DDR1_GATING_EN) | ··· 133 107 134 108 if (level == ROCKCHIP_ARM_OFF_LOGIC_DEEP) { 135 109 /* arm off, logic deep sleep */ 136 - mode_set |= BIT(PMU_BUS_PD_EN) | 110 + mode_set |= BIT(PMU_BUS_PD_EN) | BIT(PMU_PMU_USE_LF) | 137 111 BIT(PMU_DDR1IO_RET_EN) | BIT(PMU_DDR0IO_RET_EN) | 138 - BIT(PMU_OSC_24M_DIS) | BIT(PMU_PMU_USE_LF) | 139 112 BIT(PMU_ALIVE_USE_LF) | BIT(PMU_PLL_PD_EN); 113 + 114 + if (osc_disable) 115 + mode_set |= BIT(PMU_OSC_24M_DIS); 140 116 141 117 mode_set1 |= BIT(PMU_CLR_ALIVE) | BIT(PMU_CLR_BUS) | 142 118 BIT(PMU_CLR_PERI) | BIT(PMU_CLR_DMA); 119 + 120 + regmap_write(pmu_regmap, RK3288_PMU_WAKEUP_CFG1, 121 + PMU_ARMINT_WAKEUP_EN); 122 + 123 + /* 124 + * In deep suspend we use PMU_PMU_USE_LF to let the rk3288 125 + * switch its main clock supply to the alternative 32kHz 126 + * source. Therefore set 30ms on a 32kHz clock for pmic 127 + * stabilization. Similar 30ms on 24MHz for the other 128 + * mode below. 129 + */ 130 + regmap_write(pmu_regmap, RK3288_PMU_STABL_CNT, 32 * 30); 131 + 132 + /* only wait for stabilization, if we turned the osc off */ 133 + regmap_write(pmu_regmap, RK3288_PMU_OSC_CNT, 134 + osc_disable ? 32 * 30 : 0); 143 135 } else { 144 136 /* 145 137 * arm off, logic normal ··· 165 121 * wakeup will be error 166 122 */ 167 123 mode_set |= BIT(PMU_CLK_CORE_SRC_GATE_EN); 124 + 125 + regmap_write(pmu_regmap, RK3288_PMU_WAKEUP_CFG1, 126 + PMU_ARMINT_WAKEUP_EN | PMU_GPIOINT_WAKEUP_EN); 127 + 128 + /* 30ms on a 24MHz clock for pmic stabilization */ 129 + regmap_write(pmu_regmap, RK3288_PMU_STABL_CNT, 24000 * 30); 130 + 131 + /* oscillator is still running, so no need to wait */ 132 + regmap_write(pmu_regmap, RK3288_PMU_OSC_CNT, 0); 168 133 } 169 134 170 135 regmap_write(pmu_regmap, RK3288_PMU_PWRMODE_CON, mode_set); ··· 182 129 183 130 static void rk3288_slp_mode_set_resume(void) 184 131 { 132 + regmap_write(sgrf_regmap, RK3288_SGRF_CPU_CON0, 133 + rk3288_sgrf_cpu_con0 | SGRF_DAPDEVICEEN_WRITE); 134 + 185 135 regmap_write(pmu_regmap, RK3288_PMU_PWRMODE_CON, 186 136 rk3288_pmu_pwr_mode_con); 187 137 ··· 246 190 "rockchip,rk3288-sgrf"); 247 191 if (IS_ERR(sgrf_regmap)) { 248 192 pr_err("%s: could not find sgrf regmap\n", __func__); 249 - return PTR_ERR(pmu_regmap); 193 + return PTR_ERR(sgrf_regmap); 194 + } 195 + 196 + grf_regmap = syscon_regmap_lookup_by_compatible( 197 + "rockchip,rk3288-grf"); 198 + if (IS_ERR(grf_regmap)) { 199 + pr_err("%s: could not find grf regmap\n", __func__); 200 + return PTR_ERR(grf_regmap); 250 201 } 251 202 252 203 sram_np = of_find_compatible_node(NULL, NULL, ··· 283 220 /* copy resume code and data to bootsram */ 284 221 memcpy(rk3288_bootram_base, rockchip_slp_cpu_resume, 285 222 rk3288_bootram_sz); 286 - 287 - regmap_write(pmu_regmap, RK3288_PMU_OSC_CNT, OSC_STABL_CNT_THRESH); 288 - regmap_write(pmu_regmap, RK3288_PMU_STABL_CNT, PMU_STABL_CNT_THRESH); 289 223 290 224 return 0; 291 225 }
+1 -11
arch/arm/mach-rockchip/pm.h
··· 59 59 #define SGRF_DAPDEVICEEN BIT(0) 60 60 #define SGRF_DAPDEVICEEN_WRITE BIT(16) 61 61 62 - #define RK3288_CRU_MODE_CON 0x50 63 - #define RK3288_CRU_SEL0_CON 0x60 64 - #define RK3288_CRU_SEL1_CON 0x64 65 - #define RK3288_CRU_SEL10_CON 0x88 66 - #define RK3288_CRU_SEL33_CON 0xe4 67 - #define RK3288_CRU_SEL37_CON 0xf4 68 - 69 62 /* PMU_WAKEUP_CFG1 bits */ 70 63 #define PMU_ARMINT_WAKEUP_EN BIT(0) 71 - 72 - /* wait 30ms for OSC stable and 30ms for pmic stable */ 73 - #define OSC_STABL_CNT_THRESH (32 * 30) 74 - #define PMU_STABL_CNT_THRESH (32 * 30) 64 + #define PMU_GPIOINT_WAKEUP_EN BIT(3) 75 65 76 66 enum rk3288_pwr_mode_con { 77 67 PMU_PWR_MODE_EN = 0,
+5
arch/arm/mach-shmobile/Kconfig
··· 80 80 select ARCH_RCAR_GEN2 81 81 select I2C 82 82 83 + config ARCH_R8A7793 84 + bool "R-Car M2-N (R8A7793)" 85 + select ARCH_RCAR_GEN2 86 + select I2C 87 + 83 88 config ARCH_R8A7794 84 89 bool "R-Car E2 (R8A77940)" 85 90 select ARCH_RCAR_GEN2
+2
arch/arm/mach-shmobile/Makefile
··· 13 13 obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o pm-r8a7779.o 14 14 obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o 15 15 obj-$(CONFIG_ARCH_R8A7791) += setup-r8a7791.o 16 + obj-$(CONFIG_ARCH_R8A7793) += setup-r8a7793.o 16 17 obj-$(CONFIG_ARCH_R8A7794) += setup-r8a7794.o 17 18 obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o 18 19 obj-$(CONFIG_ARCH_R7S72100) += setup-r7s72100.o ··· 32 31 CFLAGS_setup-rcar-gen2.o += -march=armv7-a 33 32 obj-$(CONFIG_ARCH_R8A7790) += regulator-quirk-rcar-gen2.o 34 33 obj-$(CONFIG_ARCH_R8A7791) += regulator-quirk-rcar-gen2.o 34 + obj-$(CONFIG_ARCH_R8A7793) += regulator-quirk-rcar-gen2.o 35 35 36 36 # SMP objects 37 37 smp-y := $(cpu-y)
+2 -1
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
··· 123 123 u32 mon; 124 124 125 125 if (!of_machine_is_compatible("renesas,koelsch") && 126 - !of_machine_is_compatible("renesas,lager")) 126 + !of_machine_is_compatible("renesas,lager") && 127 + !of_machine_is_compatible("renesas,gose")) 127 128 return -ENODEV; 128 129 129 130 irqc = ioremap(IRQC_BASE, PAGE_SIZE);
+33
arch/arm/mach-shmobile/setup-r8a7793.c
··· 1 + /* 2 + * r8a7793 processor support 3 + * 4 + * Copyright (C) 2015 Ulrich Hecht 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/init.h> 17 + #include <asm/mach/arch.h> 18 + 19 + #include "common.h" 20 + #include "rcar-gen2.h" 21 + 22 + static const char *r8a7793_boards_compat_dt[] __initconst = { 23 + "renesas,r8a7793", 24 + NULL, 25 + }; 26 + 27 + DT_MACHINE_START(R8A7793_DT, "Generic R8A7793 (Flattened Device Tree)") 28 + .init_early = shmobile_init_delay, 29 + .init_time = rcar_gen2_timer_init, 30 + .init_late = shmobile_init_late, 31 + .reserve = rcar_gen2_reserve, 32 + .dt_compat = r8a7793_boards_compat_dt, 33 + MACHINE_END
+1
arch/arm/mach-socfpga/core.h
··· 25 25 #define SOCFPGA_RSTMGR_MODPERRST 0x14 26 26 #define SOCFPGA_RSTMGR_BRGMODRST 0x1c 27 27 28 + #define SOCFPGA_A10_RSTMGR_CTRL 0xC 28 29 #define SOCFPGA_A10_RSTMGR_MODMPURST 0x20 29 30 30 31 /* System Manager bits */
+13
arch/arm/mach-socfpga/platsmp.c
··· 106 106 cpu_do_idle(); 107 107 } 108 108 109 + /* 110 + * We need a dummy function so that platform_can_cpu_hotplug() knows 111 + * we support CPU hotplug. However, the function does not need to do 112 + * anything, because CPUs going offline just do WFI. We could reset 113 + * the CPUs but it would increase power consumption. 114 + */ 115 + static int socfpga_cpu_kill(unsigned int cpu) 116 + { 117 + return 1; 118 + } 119 + 109 120 static struct smp_operations socfpga_smp_ops __initdata = { 110 121 .smp_prepare_cpus = socfpga_smp_prepare_cpus, 111 122 .smp_boot_secondary = socfpga_boot_secondary, 112 123 #ifdef CONFIG_HOTPLUG_CPU 113 124 .cpu_die = socfpga_cpu_die, 125 + .cpu_kill = socfpga_cpu_kill, 114 126 #endif 115 127 }; 116 128 ··· 131 119 .smp_boot_secondary = socfpga_a10_boot_secondary, 132 120 #ifdef CONFIG_HOTPLUG_CPU 133 121 .cpu_die = socfpga_cpu_die, 122 + .cpu_kill = socfpga_cpu_kill, 134 123 #endif 135 124 }; 136 125
+26
arch/arm/mach-socfpga/socfpga.c
··· 74 74 writel(temp, rst_manager_base_addr + SOCFPGA_RSTMGR_CTRL); 75 75 } 76 76 77 + static void socfpga_arria10_restart(enum reboot_mode mode, const char *cmd) 78 + { 79 + u32 temp; 80 + 81 + temp = readl(rst_manager_base_addr + SOCFPGA_A10_RSTMGR_CTRL); 82 + 83 + if (mode == REBOOT_HARD) 84 + temp |= RSTMGR_CTRL_SWCOLDRSTREQ; 85 + else 86 + temp |= RSTMGR_CTRL_SWWARMRSTREQ; 87 + writel(temp, rst_manager_base_addr + SOCFPGA_A10_RSTMGR_CTRL); 88 + } 89 + 77 90 static const char *altera_dt_match[] = { 78 91 "altr,socfpga", 79 92 NULL ··· 98 85 .init_irq = socfpga_init_irq, 99 86 .restart = socfpga_cyclone5_restart, 100 87 .dt_compat = altera_dt_match, 88 + MACHINE_END 89 + 90 + static const char *altera_a10_dt_match[] = { 91 + "altr,socfpga-arria10", 92 + NULL 93 + }; 94 + 95 + DT_MACHINE_START(SOCFPGA_A10, "Altera SOCFPGA Arria10") 96 + .l2c_aux_val = 0, 97 + .l2c_aux_mask = ~0, 98 + .init_irq = socfpga_init_irq, 99 + .restart = socfpga_arria10_restart, 100 + .dt_compat = altera_a10_dt_match, 101 101 MACHINE_END
+1
arch/arm/mach-sti/headsmp.S
··· 37 37 * should now contain the SVC stack for this core 38 38 */ 39 39 b secondary_startup 40 + ENDPROC(sti_secondary_startup) 40 41 41 42 1: .long . 42 43 .long pen_release
+52 -5
arch/arm/mach-sti/platsmp.c
··· 20 20 #include <linux/io.h> 21 21 #include <linux/of.h> 22 22 #include <linux/of_address.h> 23 + #include <linux/memblock.h> 23 24 24 25 #include <asm/cacheflush.h> 25 26 #include <asm/smp_plat.h> ··· 39 38 40 39 static void sti_secondary_init(unsigned int cpu) 41 40 { 42 - trace_hardirqs_off(); 43 - 44 41 /* 45 42 * let the primary processor know we're out of the 46 43 * pen, then head off into the C entry point ··· 98 99 99 100 static void __init sti_smp_prepare_cpus(unsigned int max_cpus) 100 101 { 101 - void __iomem *scu_base = NULL; 102 - struct device_node *np = of_find_compatible_node( 103 - NULL, NULL, "arm,cortex-a9-scu"); 102 + struct device_node *np; 103 + void __iomem *scu_base; 104 + u32 __iomem *cpu_strt_ptr; 105 + u32 release_phys; 106 + int cpu; 107 + unsigned long entry_pa = virt_to_phys(sti_secondary_startup); 108 + 109 + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); 110 + 104 111 if (np) { 105 112 scu_base = of_iomap(np, 0); 106 113 scu_enable(scu_base); 107 114 of_node_put(np); 115 + } 116 + 117 + if (max_cpus <= 1) 118 + return; 119 + 120 + for_each_possible_cpu(cpu) { 121 + 122 + np = of_get_cpu_node(cpu, NULL); 123 + 124 + if (!np) 125 + continue; 126 + 127 + if (of_property_read_u32(np, "cpu-release-addr", 128 + &release_phys)) { 129 + pr_err("CPU %d: missing or invalid cpu-release-addr " 130 + "property\n", cpu); 131 + continue; 132 + } 133 + 134 + /* 135 + * holding pen is usually configured in SBC DMEM but can also be 136 + * in RAM. 137 + */ 138 + 139 + if (!memblock_is_memory(release_phys)) 140 + cpu_strt_ptr = 141 + ioremap(release_phys, sizeof(release_phys)); 142 + else 143 + cpu_strt_ptr = 144 + (u32 __iomem *)phys_to_virt(release_phys); 145 + 146 + __raw_writel(entry_pa, cpu_strt_ptr); 147 + 148 + /* 149 + * wmb so that data is actually written 150 + * before cache flush is done 151 + */ 152 + smp_wmb(); 153 + sync_cache_w(cpu_strt_ptr); 154 + 155 + if (!memblock_is_memory(release_phys)) 156 + iounmap(cpu_strt_ptr); 108 157 } 109 158 } 110 159
+2
arch/arm/mach-sti/smp.h
··· 14 14 15 15 extern struct smp_operations sti_smp_ops; 16 16 17 + void sti_secondary_startup(void); 18 + 17 19 #endif
+1 -7
arch/arm/mach-uniphier/platsmp.c
··· 60 60 sbcm_regmap = NULL; 61 61 } 62 62 63 - static void __naked uniphier_secondary_startup(void) 64 - { 65 - asm("bl v7_invalidate_l1\n" 66 - "b secondary_startup\n"); 67 - }; 68 - 69 63 static int uniphier_boot_secondary(unsigned int cpu, 70 64 struct task_struct *idle) 71 65 { ··· 69 75 return -ENODEV; 70 76 71 77 ret = regmap_write(sbcm_regmap, 0x1208, 72 - virt_to_phys(uniphier_secondary_startup)); 78 + virt_to_phys(secondary_startup)); 73 79 if (!ret) 74 80 asm("sev"); /* wake up secondary CPU */ 75 81
+1
arch/arm/mach-zx/Kconfig
··· 13 13 select ARM_GLOBAL_TIMER 14 14 select HAVE_ARM_SCU if SMP 15 15 select HAVE_ARM_TWD if SMP 16 + select PM_GENERIC_DOMAINS 16 17 help 17 18 Support for ZTE ZX296702 SoC which is a dual core CortexA9MP 18 19 endif
+1 -1
arch/arm/mach-zx/Makefile
··· 1 - obj-$(CONFIG_SOC_ZX296702) += zx296702.o 1 + obj-$(CONFIG_SOC_ZX296702) += zx296702.o zx296702-pm-domain.o 2 2 obj-$(CONFIG_SMP) += headsmp.o platsmp.o
+202
arch/arm/mach-zx/zx296702-pm-domain.c
··· 1 + /* 2 + * Copyright (C) 2015 Linaro Ltd. 3 + * 4 + * Author: Jun Nie <jun.nie@linaro.org> 5 + * License terms: GNU General Public License (GPL) version 2 6 + */ 7 + #include <linux/delay.h> 8 + #include <linux/err.h> 9 + #include <linux/io.h> 10 + #include <linux/of.h> 11 + #include <linux/platform_device.h> 12 + #include <linux/pm_domain.h> 13 + #include <linux/slab.h> 14 + 15 + #define PCU_DM_CLKEN 0x18 16 + #define PCU_DM_RSTEN 0x1C 17 + #define PCU_DM_ISOEN 0x20 18 + #define PCU_DM_PWRDN 0x24 19 + #define PCU_DM_ACK_SYNC 0x28 20 + 21 + enum { 22 + PCU_DM_NEON0 = 0, 23 + PCU_DM_NEON1, 24 + PCU_DM_GPU, 25 + PCU_DM_DECPPU, 26 + PCU_DM_VOU, 27 + PCU_DM_R2D, 28 + PCU_DM_TOP, 29 + }; 30 + 31 + static void __iomem *pcubase; 32 + 33 + struct zx_pm_domain { 34 + struct generic_pm_domain dm; 35 + unsigned int bit; 36 + }; 37 + 38 + static int normal_power_off(struct generic_pm_domain *domain) 39 + { 40 + struct zx_pm_domain *zpd = (struct zx_pm_domain *)domain; 41 + unsigned long loop = 1000; 42 + u32 tmp; 43 + 44 + tmp = readl_relaxed(pcubase + PCU_DM_CLKEN); 45 + tmp &= ~BIT(zpd->bit); 46 + writel_relaxed(tmp, pcubase + PCU_DM_CLKEN); 47 + udelay(5); 48 + 49 + tmp = readl_relaxed(pcubase + PCU_DM_ISOEN); 50 + tmp &= ~BIT(zpd->bit); 51 + writel_relaxed(tmp | BIT(zpd->bit), pcubase + PCU_DM_ISOEN); 52 + udelay(5); 53 + 54 + tmp = readl_relaxed(pcubase + PCU_DM_RSTEN); 55 + tmp &= ~BIT(zpd->bit); 56 + writel_relaxed(tmp, pcubase + PCU_DM_RSTEN); 57 + udelay(5); 58 + 59 + tmp = readl_relaxed(pcubase + PCU_DM_PWRDN); 60 + tmp &= ~BIT(zpd->bit); 61 + writel_relaxed(tmp | BIT(zpd->bit), pcubase + PCU_DM_PWRDN); 62 + do { 63 + tmp = readl_relaxed(pcubase + PCU_DM_ACK_SYNC) & BIT(zpd->bit); 64 + } while (--loop && !tmp); 65 + 66 + if (!loop) { 67 + pr_err("Error: %s %s fail\n", __func__, domain->name); 68 + return -EIO; 69 + } 70 + 71 + return 0; 72 + } 73 + 74 + static int normal_power_on(struct generic_pm_domain *domain) 75 + { 76 + struct zx_pm_domain *zpd = (struct zx_pm_domain *)domain; 77 + unsigned long loop = 10000; 78 + u32 tmp; 79 + 80 + tmp = readl_relaxed(pcubase + PCU_DM_PWRDN); 81 + tmp &= ~BIT(zpd->bit); 82 + writel_relaxed(tmp, pcubase + PCU_DM_PWRDN); 83 + do { 84 + tmp = readl_relaxed(pcubase + PCU_DM_ACK_SYNC) & BIT(zpd->bit); 85 + } while (--loop && tmp); 86 + 87 + if (!loop) { 88 + pr_err("Error: %s %s fail\n", __func__, domain->name); 89 + return -EIO; 90 + } 91 + 92 + tmp = readl_relaxed(pcubase + PCU_DM_RSTEN); 93 + tmp &= ~BIT(zpd->bit); 94 + writel_relaxed(tmp | BIT(zpd->bit), pcubase + PCU_DM_RSTEN); 95 + udelay(5); 96 + 97 + tmp = readl_relaxed(pcubase + PCU_DM_ISOEN); 98 + tmp &= ~BIT(zpd->bit); 99 + writel_relaxed(tmp, pcubase + PCU_DM_ISOEN); 100 + udelay(5); 101 + 102 + tmp = readl_relaxed(pcubase + PCU_DM_CLKEN); 103 + tmp &= ~BIT(zpd->bit); 104 + writel_relaxed(tmp | BIT(zpd->bit), pcubase + PCU_DM_CLKEN); 105 + udelay(5); 106 + return 0; 107 + } 108 + 109 + static struct zx_pm_domain gpu_domain = { 110 + .dm = { 111 + .name = "gpu_domain", 112 + .power_off = normal_power_off, 113 + .power_on = normal_power_on, 114 + }, 115 + .bit = PCU_DM_GPU, 116 + }; 117 + 118 + static struct zx_pm_domain decppu_domain = { 119 + .dm = { 120 + .name = "decppu_domain", 121 + .power_off = normal_power_off, 122 + .power_on = normal_power_on, 123 + }, 124 + .bit = PCU_DM_DECPPU, 125 + }; 126 + 127 + static struct zx_pm_domain vou_domain = { 128 + .dm = { 129 + .name = "vou_domain", 130 + .power_off = normal_power_off, 131 + .power_on = normal_power_on, 132 + }, 133 + .bit = PCU_DM_VOU, 134 + }; 135 + 136 + static struct zx_pm_domain r2d_domain = { 137 + .dm = { 138 + .name = "r2d_domain", 139 + .power_off = normal_power_off, 140 + .power_on = normal_power_on, 141 + }, 142 + .bit = PCU_DM_R2D, 143 + }; 144 + 145 + static struct generic_pm_domain *zx296702_pm_domains[] = { 146 + &vou_domain.dm, 147 + &gpu_domain.dm, 148 + &decppu_domain.dm, 149 + &r2d_domain.dm, 150 + }; 151 + 152 + static int zx296702_pd_probe(struct platform_device *pdev) 153 + { 154 + struct genpd_onecell_data *genpd_data; 155 + struct resource *res; 156 + int i; 157 + 158 + genpd_data = devm_kzalloc(&pdev->dev, sizeof(*genpd_data), GFP_KERNEL); 159 + if (!genpd_data) 160 + return -ENOMEM; 161 + 162 + genpd_data->domains = zx296702_pm_domains; 163 + genpd_data->num_domains = ARRAY_SIZE(zx296702_pm_domains); 164 + 165 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 166 + if (!res) { 167 + dev_err(&pdev->dev, "no memory resource defined\n"); 168 + return -ENODEV; 169 + } 170 + 171 + pcubase = devm_ioremap_resource(&pdev->dev, res); 172 + if (!pcubase) { 173 + dev_err(&pdev->dev, "ioremap fail.\n"); 174 + return -EIO; 175 + } 176 + 177 + for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i) 178 + pm_genpd_init(zx296702_pm_domains[i], NULL, false); 179 + 180 + of_genpd_add_provider_onecell(pdev->dev.of_node, genpd_data); 181 + return 0; 182 + } 183 + 184 + static const struct of_device_id zx296702_pm_domain_matches[] __initconst = { 185 + { .compatible = "zte,zx296702-pcu", }, 186 + { }, 187 + }; 188 + 189 + static struct platform_driver zx296702_pd_driver __initdata = { 190 + .driver = { 191 + .name = "zx-powerdomain", 192 + .owner = THIS_MODULE, 193 + .of_match_table = zx296702_pm_domain_matches, 194 + }, 195 + .probe = zx296702_pd_probe, 196 + }; 197 + 198 + static int __init zx296702_pd_init(void) 199 + { 200 + return platform_driver_register(&zx296702_pd_driver); 201 + } 202 + subsys_initcall(zx296702_pd_init);
+2 -2
arch/arm/mach-zynq/common.c
··· 197 197 198 198 DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") 199 199 /* 64KB way size, 8-way associativity, parity disabled */ 200 - .l2c_aux_val = 0x00000000, 201 - .l2c_aux_mask = 0xffffffff, 200 + .l2c_aux_val = 0x00400000, 201 + .l2c_aux_mask = 0xffbfffff, 202 202 .smp = smp_ops(zynq_smp_ops), 203 203 .map_io = zynq_map_io, 204 204 .init_irq = zynq_irq_init,
+1 -1
arch/arm/mach-zynq/headsmp.S
··· 18 18 .globl zynq_secondary_trampoline_jump 19 19 zynq_secondary_trampoline_jump: 20 20 /* Space for jumping address */ 21 - .word /* cpu 1 */ 21 + .word 0 /* cpu 1 */ 22 22 .globl zynq_secondary_trampoline_end 23 23 zynq_secondary_trampoline_end: 24 24 ENDPROC(zynq_secondary_trampoline)
+11 -11
arch/arm/plat-pxa/dma.c
··· 289 289 /* try grabbing a DMA channel with the requested priority */ 290 290 for (i = 0; i < num_dma_channels; i++) { 291 291 if ((dma_channels[i].prio == prio) && 292 - !dma_channels[i].name) { 292 + !dma_channels[i].name && 293 + !pxad_toggle_reserved_channel(i)) { 293 294 found = 1; 294 295 break; 295 296 } ··· 327 326 local_irq_save(flags); 328 327 DCSR(dma_ch) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; 329 328 dma_channels[dma_ch].name = NULL; 329 + pxad_toggle_reserved_channel(dma_ch); 330 330 local_irq_restore(flags); 331 331 } 332 332 EXPORT_SYMBOL(pxa_free_dma); 333 333 334 334 static irqreturn_t dma_irq_handler(int irq, void *dev_id) 335 335 { 336 - int i, dint = DINT; 336 + int i, dint = DINT, done = 0; 337 337 struct dma_channel *channel; 338 338 339 339 while (dint) { ··· 343 341 channel = &dma_channels[i]; 344 342 if (channel->name && channel->irq_handler) { 345 343 channel->irq_handler(i, channel->data); 346 - } else { 347 - /* 348 - * IRQ for an unregistered DMA channel: 349 - * let's clear the interrupts and disable it. 350 - */ 351 - printk (KERN_WARNING "spurious IRQ for DMA channel %d\n", i); 352 - DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; 344 + done++; 353 345 } 354 346 } 355 - return IRQ_HANDLED; 347 + if (done) 348 + return IRQ_HANDLED; 349 + else 350 + return IRQ_NONE; 356 351 } 357 352 358 353 int __init pxa_init_dma(int irq, int num_ch) ··· 371 372 spin_lock_init(&dma_channels[i].lock); 372 373 } 373 374 374 - ret = request_irq(irq, dma_irq_handler, 0, "DMA", NULL); 375 + ret = request_irq(irq, dma_irq_handler, IRQF_SHARED, "DMA", 376 + dma_channels); 375 377 if (ret) { 376 378 printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n"); 377 379 kfree(dma_channels);
+15
arch/arm/plat-pxa/include/plat/dma.h
··· 82 82 83 83 void pxa_free_dma (int dma_ch); 84 84 85 + /* 86 + * Cooperation with pxa_dma + dmaengine while there remains at least one pxa 87 + * driver not converted to dmaengine. 88 + */ 89 + #if defined(CONFIG_PXA_DMA) 90 + extern int pxad_toggle_reserved_channel(int legacy_channel); 91 + #else 92 + static inline int pxad_toggle_reserved_channel(int legacy_channel) 93 + { 94 + return 0; 95 + } 96 + #endif 97 + 98 + extern void __init pxa2xx_set_dmac_info(int nb_channels); 99 + 85 100 #endif /* __PLAT_DMA_H */
+1 -1
drivers/clk/ti/Makefile
··· 3 3 fixed-factor.o mux.o apll.o \ 4 4 clkt_dpll.o clkt_iclk.o clkt_dflt.o 5 5 obj-$(CONFIG_SOC_AM33XX) += $(clk-common) clk-33xx.o dpll3xxx.o 6 - obj-$(CONFIG_SOC_TI81XX) += $(clk-common) fapll.o clk-816x.o 6 + obj-$(CONFIG_SOC_TI81XX) += $(clk-common) fapll.o clk-814x.o clk-816x.o 7 7 obj-$(CONFIG_ARCH_OMAP2) += $(clk-common) interface.o clk-2xxx.o 8 8 obj-$(CONFIG_ARCH_OMAP3) += $(clk-common) interface.o \ 9 9 clk-3xxx.o dpll3xxx.o
+33
drivers/clk/ti/clk-814x.c
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or 3 + * modify it under the terms of the GNU General Public License as 4 + * published by the Free Software Foundation version 2. 5 + */ 6 + 7 + #include <linux/kernel.h> 8 + #include <linux/clk-provider.h> 9 + #include <linux/clk/ti.h> 10 + 11 + #include "clock.h" 12 + 13 + static struct ti_dt_clk dm814_clks[] = { 14 + DT_CLK(NULL, "devosc_ck", "devosc_ck"), 15 + DT_CLK(NULL, "mpu_ck", "mpu_ck"), 16 + DT_CLK(NULL, "sysclk4_ck", "sysclk4_ck"), 17 + DT_CLK(NULL, "sysclk6_ck", "sysclk6_ck"), 18 + DT_CLK(NULL, "sysclk10_ck", "sysclk10_ck"), 19 + DT_CLK(NULL, "sysclk18_ck", "sysclk18_ck"), 20 + DT_CLK(NULL, "timer_sys_ck", "devosc_ck"), 21 + DT_CLK(NULL, "cpsw_125mhz_gclk", "cpsw_125mhz_gclk"), 22 + DT_CLK(NULL, "cpsw_cpts_rft_clk", "cpsw_cpts_rft_clk"), 23 + { .node_name = NULL }, 24 + }; 25 + 26 + int __init dm814x_dt_clk_init(void) 27 + { 28 + ti_dt_clocks_register(dm814_clks); 29 + omap2_clk_disable_autoidle_all(); 30 + omap2_clk_enable_init_clocks(NULL, 0); 31 + 32 + return 0; 33 + }
+1 -1
drivers/clk/ti/clk-816x.c
··· 44 44 "ddr_pll_clk3", 45 45 }; 46 46 47 - int __init ti81xx_dt_clk_init(void) 47 + int __init dm816x_dt_clk_init(void) 48 48 { 49 49 ti_dt_clocks_register(dm816x_clks); 50 50 omap2_clk_disable_autoidle_all();
+1 -1
drivers/clk/zynq/Makefile
··· 1 1 # Zynq clock specific Makefile 2 2 3 - obj-$(CONFIG_ARCH_ZYNQ) += clkc.o pll.o 3 + obj-y += clkc.o pll.o
+11
drivers/input/keyboard/Kconfig
··· 401 401 To compile this driver as a module, choose M here: the 402 402 module will be called mpr121_touchkey. 403 403 404 + config KEYBOARD_SNVS_PWRKEY 405 + tristate "IMX SNVS Power Key Driver" 406 + depends on SOC_IMX6SX 407 + depends on OF 408 + help 409 + This is the snvs powerkey driver for the Freescale i.MX application 410 + processors that are newer than i.MX6 SX. 411 + 412 + To compile this driver as a module, choose M here; the 413 + module will be called snvs_pwrkey. 414 + 404 415 config KEYBOARD_IMX 405 416 tristate "IMX keypad support" 406 417 depends on ARCH_MXC
+1
drivers/input/keyboard/Makefile
··· 51 51 obj-$(CONFIG_KEYBOARD_QT2160) += qt2160.o 52 52 obj-$(CONFIG_KEYBOARD_SAMSUNG) += samsung-keypad.o 53 53 obj-$(CONFIG_KEYBOARD_SH_KEYSC) += sh_keysc.o 54 + obj-$(CONFIG_KEYBOARD_SNVS_PWRKEY) += snvs_pwrkey.o 54 55 obj-$(CONFIG_KEYBOARD_SPEAR) += spear-keyboard.o 55 56 obj-$(CONFIG_KEYBOARD_STMPE) += stmpe-keypad.o 56 57 obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
+227
drivers/input/keyboard/snvs_pwrkey.c
··· 1 + /* 2 + * Driver for the IMX SNVS ON/OFF Power Key 3 + * Copyright (C) 2015 Freescale Semiconductor, Inc. All Rights Reserved. 4 + * 5 + * The code contained herein is licensed under the GNU General Public 6 + * License. You may obtain a copy of the GNU General Public License 7 + * Version 2 or later at the following locations: 8 + * 9 + * http://www.opensource.org/licenses/gpl-license.html 10 + * http://www.gnu.org/copyleft/gpl.html 11 + */ 12 + 13 + #include <linux/device.h> 14 + #include <linux/err.h> 15 + #include <linux/init.h> 16 + #include <linux/input.h> 17 + #include <linux/interrupt.h> 18 + #include <linux/io.h> 19 + #include <linux/jiffies.h> 20 + #include <linux/kernel.h> 21 + #include <linux/module.h> 22 + #include <linux/of.h> 23 + #include <linux/of_address.h> 24 + #include <linux/platform_device.h> 25 + #include <linux/mfd/syscon.h> 26 + #include <linux/regmap.h> 27 + 28 + #define SNVS_LPSR_REG 0x4C /* LP Status Register */ 29 + #define SNVS_LPCR_REG 0x38 /* LP Control Register */ 30 + #define SNVS_HPSR_REG 0x14 31 + #define SNVS_HPSR_BTN BIT(6) 32 + #define SNVS_LPSR_SPO BIT(18) 33 + #define SNVS_LPCR_DEP_EN BIT(5) 34 + 35 + #define DEBOUNCE_TIME 30 36 + #define REPEAT_INTERVAL 60 37 + 38 + struct pwrkey_drv_data { 39 + struct regmap *snvs; 40 + int irq; 41 + int keycode; 42 + int keystate; /* 1:pressed */ 43 + int wakeup; 44 + struct timer_list check_timer; 45 + struct input_dev *input; 46 + }; 47 + 48 + static void imx_imx_snvs_check_for_events(unsigned long data) 49 + { 50 + struct pwrkey_drv_data *pdata = (struct pwrkey_drv_data *) data; 51 + struct input_dev *input = pdata->input; 52 + u32 state; 53 + 54 + regmap_read(pdata->snvs, SNVS_HPSR_REG, &state); 55 + state = state & SNVS_HPSR_BTN ? 1 : 0; 56 + 57 + /* only report new event if status changed */ 58 + if (state ^ pdata->keystate) { 59 + pdata->keystate = state; 60 + input_event(input, EV_KEY, pdata->keycode, state); 61 + input_sync(input); 62 + pm_relax(pdata->input->dev.parent); 63 + } 64 + 65 + /* repeat check if pressed long */ 66 + if (state) { 67 + mod_timer(&pdata->check_timer, 68 + jiffies + msecs_to_jiffies(REPEAT_INTERVAL)); 69 + } 70 + } 71 + 72 + static irqreturn_t imx_snvs_pwrkey_interrupt(int irq, void *dev_id) 73 + { 74 + struct platform_device *pdev = dev_id; 75 + struct pwrkey_drv_data *pdata = platform_get_drvdata(pdev); 76 + u32 lp_status; 77 + 78 + pm_wakeup_event(pdata->input->dev.parent, 0); 79 + 80 + regmap_read(pdata->snvs, SNVS_LPSR_REG, &lp_status); 81 + if (lp_status & SNVS_LPSR_SPO) 82 + mod_timer(&pdata->check_timer, jiffies + msecs_to_jiffies(DEBOUNCE_TIME)); 83 + 84 + /* clear SPO status */ 85 + regmap_write(pdata->snvs, SNVS_LPSR_REG, SNVS_LPSR_SPO); 86 + 87 + return IRQ_HANDLED; 88 + } 89 + 90 + static void imx_snvs_pwrkey_act(void *pdata) 91 + { 92 + struct pwrkey_drv_data *pd = pdata; 93 + 94 + del_timer_sync(&pd->check_timer); 95 + } 96 + 97 + static int imx_snvs_pwrkey_probe(struct platform_device *pdev) 98 + { 99 + struct pwrkey_drv_data *pdata = NULL; 100 + struct input_dev *input = NULL; 101 + struct device_node *np; 102 + int error; 103 + 104 + /* Get SNVS register Page */ 105 + np = pdev->dev.of_node; 106 + if (!np) 107 + return -ENODEV; 108 + 109 + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 110 + if (!pdata) 111 + return -ENOMEM; 112 + 113 + pdata->snvs = syscon_regmap_lookup_by_phandle(np, "regmap");; 114 + 115 + if (!pdata->snvs) { 116 + dev_err(&pdev->dev, "Can't get snvs syscon\n"); 117 + return -ENODEV; 118 + } 119 + 120 + if (of_property_read_u32(np, "linux,keycode", &pdata->keycode)) { 121 + pdata->keycode = KEY_POWER; 122 + dev_warn(&pdev->dev, "KEY_POWER without setting in dts\n"); 123 + } 124 + 125 + pdata->wakeup = of_property_read_bool(np, "wakeup-source"); 126 + 127 + pdata->irq = platform_get_irq(pdev, 0); 128 + if (pdata->irq < 0) { 129 + dev_err(&pdev->dev, "no irq defined in platform data\n"); 130 + return -EINVAL; 131 + } 132 + 133 + regmap_update_bits(pdata->snvs, SNVS_LPCR_REG, SNVS_LPCR_DEP_EN, SNVS_LPCR_DEP_EN); 134 + 135 + /* clear the unexpected interrupt before driver ready */ 136 + regmap_write(pdata->snvs, SNVS_LPSR_REG, SNVS_LPSR_SPO); 137 + 138 + setup_timer(&pdata->check_timer, 139 + imx_imx_snvs_check_for_events, (unsigned long) pdata); 140 + 141 + input = devm_input_allocate_device(&pdev->dev); 142 + if (!input) { 143 + dev_err(&pdev->dev, "failed to allocate the input device\n"); 144 + return -ENOMEM; 145 + } 146 + 147 + input->name = pdev->name; 148 + input->phys = "snvs-pwrkey/input0"; 149 + input->id.bustype = BUS_HOST; 150 + 151 + input_set_capability(input, EV_KEY, pdata->keycode); 152 + 153 + /* input customer action to cancel release timer */ 154 + error = devm_add_action(&pdev->dev, imx_snvs_pwrkey_act, pdata); 155 + if (error) { 156 + dev_err(&pdev->dev, "failed to register remove action\n"); 157 + return error; 158 + } 159 + 160 + error = devm_request_irq(&pdev->dev, pdata->irq, 161 + imx_snvs_pwrkey_interrupt, 162 + 0, pdev->name, pdev); 163 + 164 + if (error) { 165 + dev_err(&pdev->dev, "interrupt not available.\n"); 166 + return error; 167 + } 168 + 169 + error = input_register_device(input); 170 + if (error < 0) { 171 + dev_err(&pdev->dev, "failed to register input device\n"); 172 + input_free_device(input); 173 + return error; 174 + } 175 + 176 + pdata->input = input; 177 + platform_set_drvdata(pdev, pdata); 178 + 179 + device_init_wakeup(&pdev->dev, pdata->wakeup); 180 + 181 + return 0; 182 + } 183 + 184 + static int imx_snvs_pwrkey_suspend(struct device *dev) 185 + { 186 + struct platform_device *pdev = to_platform_device(dev); 187 + struct pwrkey_drv_data *pdata = platform_get_drvdata(pdev); 188 + 189 + if (device_may_wakeup(&pdev->dev)) 190 + enable_irq_wake(pdata->irq); 191 + 192 + return 0; 193 + } 194 + 195 + static int imx_snvs_pwrkey_resume(struct device *dev) 196 + { 197 + struct platform_device *pdev = to_platform_device(dev); 198 + struct pwrkey_drv_data *pdata = platform_get_drvdata(pdev); 199 + 200 + if (device_may_wakeup(&pdev->dev)) 201 + disable_irq_wake(pdata->irq); 202 + 203 + return 0; 204 + } 205 + 206 + static const struct of_device_id imx_snvs_pwrkey_ids[] = { 207 + { .compatible = "fsl,sec-v4.0-pwrkey" }, 208 + { /* sentinel */ } 209 + }; 210 + MODULE_DEVICE_TABLE(of, imx_snvs_pwrkey_ids); 211 + 212 + static SIMPLE_DEV_PM_OPS(imx_snvs_pwrkey_pm_ops, imx_snvs_pwrkey_suspend, 213 + imx_snvs_pwrkey_resume); 214 + 215 + static struct platform_driver imx_snvs_pwrkey_driver = { 216 + .driver = { 217 + .name = "snvs_pwrkey", 218 + .pm = &imx_snvs_pwrkey_pm_ops, 219 + .of_match_table = imx_snvs_pwrkey_ids, 220 + }, 221 + .probe = imx_snvs_pwrkey_probe, 222 + }; 223 + module_platform_driver(imx_snvs_pwrkey_driver); 224 + 225 + MODULE_AUTHOR("Freescale Semiconductor"); 226 + MODULE_DESCRIPTION("i.MX snvs power key Driver"); 227 + MODULE_LICENSE("GPL");
+2 -3
drivers/memory/omap-gpmc.c
··· 1176 1176 gpmc_client_irq[i].irq = gpmc_irq_start + i; 1177 1177 irq_set_chip_and_handler(gpmc_client_irq[i].irq, 1178 1178 &gpmc_irq_chip, handle_simple_irq); 1179 - set_irq_flags(gpmc_client_irq[i].irq, 1180 - IRQF_VALID | IRQF_NOAUTOEN); 1179 + irq_modify_status(gpmc_client_irq[i].irq, IRQ_NOREQUEST, 1180 + IRQ_NOAUTOEN); 1181 1181 } 1182 1182 1183 1183 /* Disable interrupts */ ··· 1200 1200 for (i = 0; i < GPMC_NR_IRQ; i++) { 1201 1201 irq_set_handler(gpmc_client_irq[i].irq, NULL); 1202 1202 irq_set_chip(gpmc_client_irq[i].irq, &no_irq_chip); 1203 - irq_modify_status(gpmc_client_irq[i].irq, 0, 0); 1204 1203 } 1205 1204 1206 1205 irq_free_descs(gpmc_irq_start, GPMC_NR_IRQ);
+1
drivers/rtc/Kconfig
··· 1523 1523 1524 1524 config RTC_DRV_SNVS 1525 1525 tristate "Freescale SNVS RTC support" 1526 + select REGMAP_MMIO 1526 1527 depends on HAS_IOMEM 1527 1528 depends on OF 1528 1529 help
+46 -14
drivers/rtc/rtc-mxc.c
··· 16 16 #include <linux/interrupt.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/clk.h> 19 + #include <linux/of.h> 20 + #include <linux/of_device.h> 19 21 20 22 #define RTC_INPUT_CLK_32768HZ (0x00 << 5) 21 23 #define RTC_INPUT_CLK_32000HZ (0x01 << 5) ··· 81 79 struct rtc_device *rtc; 82 80 void __iomem *ioaddr; 83 81 int irq; 84 - struct clk *clk; 82 + struct clk *clk_ref; 83 + struct clk *clk_ipg; 85 84 struct rtc_time g_rtc_alarm; 86 85 enum imx_rtc_type devtype; 87 86 }; ··· 99 96 } 100 97 }; 101 98 MODULE_DEVICE_TABLE(platform, imx_rtc_devtype); 99 + 100 + #ifdef CONFIG_OF 101 + static const struct of_device_id imx_rtc_dt_ids[] = { 102 + { .compatible = "fsl,imx1-rtc", .data = (const void *)IMX1_RTC }, 103 + { .compatible = "fsl,imx21-rtc", .data = (const void *)IMX21_RTC }, 104 + {} 105 + }; 106 + MODULE_DEVICE_TABLE(of, imx_rtc_dt_ids); 107 + #endif 102 108 103 109 static inline int is_imx1_rtc(struct rtc_plat_data *data) 104 110 { ··· 373 361 u32 reg; 374 362 unsigned long rate; 375 363 int ret; 364 + const struct of_device_id *of_id; 376 365 377 366 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 378 367 if (!pdata) 379 368 return -ENOMEM; 380 369 381 - pdata->devtype = pdev->id_entry->driver_data; 370 + of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev); 371 + if (of_id) 372 + pdata->devtype = (enum imx_rtc_type)of_id->data; 373 + else 374 + pdata->devtype = pdev->id_entry->driver_data; 382 375 383 376 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 384 377 pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res); 385 378 if (IS_ERR(pdata->ioaddr)) 386 379 return PTR_ERR(pdata->ioaddr); 387 380 388 - pdata->clk = devm_clk_get(&pdev->dev, NULL); 389 - if (IS_ERR(pdata->clk)) { 390 - dev_err(&pdev->dev, "unable to get clock!\n"); 391 - return PTR_ERR(pdata->clk); 381 + pdata->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); 382 + if (IS_ERR(pdata->clk_ipg)) { 383 + dev_err(&pdev->dev, "unable to get ipg clock!\n"); 384 + return PTR_ERR(pdata->clk_ipg); 392 385 } 393 386 394 - ret = clk_prepare_enable(pdata->clk); 387 + ret = clk_prepare_enable(pdata->clk_ipg); 395 388 if (ret) 396 389 return ret; 397 390 398 - rate = clk_get_rate(pdata->clk); 391 + pdata->clk_ref = devm_clk_get(&pdev->dev, "ref"); 392 + if (IS_ERR(pdata->clk_ref)) { 393 + dev_err(&pdev->dev, "unable to get ref clock!\n"); 394 + ret = PTR_ERR(pdata->clk_ref); 395 + goto exit_put_clk_ipg; 396 + } 397 + 398 + ret = clk_prepare_enable(pdata->clk_ref); 399 + if (ret) 400 + goto exit_put_clk_ipg; 401 + 402 + rate = clk_get_rate(pdata->clk_ref); 399 403 400 404 if (rate == 32768) 401 405 reg = RTC_INPUT_CLK_32768HZ; ··· 422 394 else { 423 395 dev_err(&pdev->dev, "rtc clock is not valid (%lu)\n", rate); 424 396 ret = -EINVAL; 425 - goto exit_put_clk; 397 + goto exit_put_clk_ref; 426 398 } 427 399 428 400 reg |= RTC_ENABLE_BIT; ··· 430 402 if (((readw(pdata->ioaddr + RTC_RTCCTL)) & RTC_ENABLE_BIT) == 0) { 431 403 dev_err(&pdev->dev, "hardware module can't be enabled!\n"); 432 404 ret = -EIO; 433 - goto exit_put_clk; 405 + goto exit_put_clk_ref; 434 406 } 435 407 436 408 platform_set_drvdata(pdev, pdata); ··· 452 424 THIS_MODULE); 453 425 if (IS_ERR(rtc)) { 454 426 ret = PTR_ERR(rtc); 455 - goto exit_put_clk; 427 + goto exit_put_clk_ref; 456 428 } 457 429 458 430 pdata->rtc = rtc; 459 431 460 432 return 0; 461 433 462 - exit_put_clk: 463 - clk_disable_unprepare(pdata->clk); 434 + exit_put_clk_ref: 435 + clk_disable_unprepare(pdata->clk_ref); 436 + exit_put_clk_ipg: 437 + clk_disable_unprepare(pdata->clk_ipg); 464 438 465 439 return ret; 466 440 } ··· 471 441 { 472 442 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 473 443 474 - clk_disable_unprepare(pdata->clk); 444 + clk_disable_unprepare(pdata->clk_ref); 445 + clk_disable_unprepare(pdata->clk_ipg); 475 446 476 447 return 0; 477 448 } ··· 504 473 static struct platform_driver mxc_rtc_driver = { 505 474 .driver = { 506 475 .name = "mxc_rtc", 476 + .of_match_table = of_match_ptr(imx_rtc_dt_ids), 507 477 .pm = &mxc_rtc_pm_ops, 508 478 }, 509 479 .id_table = imx_rtc_devtype,
+67 -65
drivers/rtc/rtc-snvs.c
··· 18 18 #include <linux/platform_device.h> 19 19 #include <linux/rtc.h> 20 20 #include <linux/clk.h> 21 + #include <linux/mfd/syscon.h> 22 + #include <linux/regmap.h> 23 + 24 + #define SNVS_LPREGISTER_OFFSET 0x34 21 25 22 26 /* These register offsets are relative to LP (Low Power) range */ 23 27 #define SNVS_LPCR 0x04 ··· 41 37 42 38 struct snvs_rtc_data { 43 39 struct rtc_device *rtc; 44 - void __iomem *ioaddr; 40 + struct regmap *regmap; 41 + int offset; 45 42 int irq; 46 - spinlock_t lock; 47 43 struct clk *clk; 48 44 }; 49 45 50 - static u32 rtc_read_lp_counter(void __iomem *ioaddr) 46 + static u32 rtc_read_lp_counter(struct snvs_rtc_data *data) 51 47 { 52 48 u64 read1, read2; 49 + u32 val; 53 50 54 51 do { 55 - read1 = readl(ioaddr + SNVS_LPSRTCMR); 52 + regmap_read(data->regmap, data->offset + SNVS_LPSRTCMR, &val); 53 + read1 = val; 56 54 read1 <<= 32; 57 - read1 |= readl(ioaddr + SNVS_LPSRTCLR); 55 + regmap_read(data->regmap, data->offset + SNVS_LPSRTCLR, &val); 56 + read1 |= val; 58 57 59 - read2 = readl(ioaddr + SNVS_LPSRTCMR); 58 + regmap_read(data->regmap, data->offset + SNVS_LPSRTCMR, &val); 59 + read2 = val; 60 60 read2 <<= 32; 61 - read2 |= readl(ioaddr + SNVS_LPSRTCLR); 61 + regmap_read(data->regmap, data->offset + SNVS_LPSRTCLR, &val); 62 + read2 |= val; 62 63 } while (read1 != read2); 63 64 64 65 /* Convert 47-bit counter to 32-bit raw second count */ 65 66 return (u32) (read1 >> CNTR_TO_SECS_SH); 66 67 } 67 68 68 - static void rtc_write_sync_lp(void __iomem *ioaddr) 69 + static void rtc_write_sync_lp(struct snvs_rtc_data *data) 69 70 { 70 71 u32 count1, count2, count3; 71 72 int i; ··· 78 69 /* Wait for 3 CKIL cycles */ 79 70 for (i = 0; i < 3; i++) { 80 71 do { 81 - count1 = readl(ioaddr + SNVS_LPSRTCLR); 82 - count2 = readl(ioaddr + SNVS_LPSRTCLR); 72 + regmap_read(data->regmap, data->offset + SNVS_LPSRTCLR, &count1); 73 + regmap_read(data->regmap, data->offset + SNVS_LPSRTCLR, &count2); 83 74 } while (count1 != count2); 84 75 85 76 /* Now wait until counter value changes */ 86 77 do { 87 78 do { 88 - count2 = readl(ioaddr + SNVS_LPSRTCLR); 89 - count3 = readl(ioaddr + SNVS_LPSRTCLR); 79 + regmap_read(data->regmap, data->offset + SNVS_LPSRTCLR, &count2); 80 + regmap_read(data->regmap, data->offset + SNVS_LPSRTCLR, &count3); 90 81 } while (count2 != count3); 91 82 } while (count3 == count1); 92 83 } ··· 94 85 95 86 static int snvs_rtc_enable(struct snvs_rtc_data *data, bool enable) 96 87 { 97 - unsigned long flags; 98 88 int timeout = 1000; 99 89 u32 lpcr; 100 90 101 - spin_lock_irqsave(&data->lock, flags); 102 - 103 - lpcr = readl(data->ioaddr + SNVS_LPCR); 104 - if (enable) 105 - lpcr |= SNVS_LPCR_SRTC_ENV; 106 - else 107 - lpcr &= ~SNVS_LPCR_SRTC_ENV; 108 - writel(lpcr, data->ioaddr + SNVS_LPCR); 109 - 110 - spin_unlock_irqrestore(&data->lock, flags); 91 + regmap_update_bits(data->regmap, data->offset + SNVS_LPCR, SNVS_LPCR_SRTC_ENV, 92 + enable ? SNVS_LPCR_SRTC_ENV : 0); 111 93 112 94 while (--timeout) { 113 - lpcr = readl(data->ioaddr + SNVS_LPCR); 95 + regmap_read(data->regmap, data->offset + SNVS_LPCR, &lpcr); 114 96 115 97 if (enable) { 116 98 if (lpcr & SNVS_LPCR_SRTC_ENV) ··· 121 121 static int snvs_rtc_read_time(struct device *dev, struct rtc_time *tm) 122 122 { 123 123 struct snvs_rtc_data *data = dev_get_drvdata(dev); 124 - unsigned long time = rtc_read_lp_counter(data->ioaddr); 124 + unsigned long time = rtc_read_lp_counter(data); 125 125 126 126 rtc_time_to_tm(time, tm); 127 127 ··· 139 139 snvs_rtc_enable(data, false); 140 140 141 141 /* Write 32-bit time to 47-bit timer, leaving 15 LSBs blank */ 142 - writel(time << CNTR_TO_SECS_SH, data->ioaddr + SNVS_LPSRTCLR); 143 - writel(time >> (32 - CNTR_TO_SECS_SH), data->ioaddr + SNVS_LPSRTCMR); 142 + regmap_write(data->regmap, data->offset + SNVS_LPSRTCLR, time << CNTR_TO_SECS_SH); 143 + regmap_write(data->regmap, data->offset + SNVS_LPSRTCMR, time >> (32 - CNTR_TO_SECS_SH)); 144 144 145 145 /* Enable RTC again */ 146 146 snvs_rtc_enable(data, true); ··· 153 153 struct snvs_rtc_data *data = dev_get_drvdata(dev); 154 154 u32 lptar, lpsr; 155 155 156 - lptar = readl(data->ioaddr + SNVS_LPTAR); 156 + regmap_read(data->regmap, data->offset + SNVS_LPTAR, &lptar); 157 157 rtc_time_to_tm(lptar, &alrm->time); 158 158 159 - lpsr = readl(data->ioaddr + SNVS_LPSR); 159 + regmap_read(data->regmap, data->offset + SNVS_LPSR, &lpsr); 160 160 alrm->pending = (lpsr & SNVS_LPSR_LPTA) ? 1 : 0; 161 161 162 162 return 0; ··· 165 165 static int snvs_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) 166 166 { 167 167 struct snvs_rtc_data *data = dev_get_drvdata(dev); 168 - u32 lpcr; 169 - unsigned long flags; 170 168 171 - spin_lock_irqsave(&data->lock, flags); 169 + regmap_update_bits(data->regmap, data->offset + SNVS_LPCR, 170 + (SNVS_LPCR_LPTA_EN | SNVS_LPCR_LPWUI_EN), 171 + enable ? (SNVS_LPCR_LPTA_EN | SNVS_LPCR_LPWUI_EN) : 0); 172 172 173 - lpcr = readl(data->ioaddr + SNVS_LPCR); 174 - if (enable) 175 - lpcr |= (SNVS_LPCR_LPTA_EN | SNVS_LPCR_LPWUI_EN); 176 - else 177 - lpcr &= ~(SNVS_LPCR_LPTA_EN | SNVS_LPCR_LPWUI_EN); 178 - writel(lpcr, data->ioaddr + SNVS_LPCR); 179 - 180 - spin_unlock_irqrestore(&data->lock, flags); 181 - 182 - rtc_write_sync_lp(data->ioaddr); 173 + rtc_write_sync_lp(data); 183 174 184 175 return 0; 185 176 } ··· 180 189 struct snvs_rtc_data *data = dev_get_drvdata(dev); 181 190 struct rtc_time *alrm_tm = &alrm->time; 182 191 unsigned long time; 183 - unsigned long flags; 184 - u32 lpcr; 185 192 186 193 rtc_tm_to_time(alrm_tm, &time); 187 194 188 - spin_lock_irqsave(&data->lock, flags); 189 - 190 - /* Have to clear LPTA_EN before programming new alarm time in LPTAR */ 191 - lpcr = readl(data->ioaddr + SNVS_LPCR); 192 - lpcr &= ~SNVS_LPCR_LPTA_EN; 193 - writel(lpcr, data->ioaddr + SNVS_LPCR); 194 - 195 - spin_unlock_irqrestore(&data->lock, flags); 196 - 197 - writel(time, data->ioaddr + SNVS_LPTAR); 195 + regmap_update_bits(data->regmap, data->offset + SNVS_LPCR, SNVS_LPCR_LPTA_EN, 0); 196 + regmap_write(data->regmap, data->offset + SNVS_LPTAR, time); 198 197 199 198 /* Clear alarm interrupt status bit */ 200 - writel(SNVS_LPSR_LPTA, data->ioaddr + SNVS_LPSR); 199 + regmap_write(data->regmap, data->offset + SNVS_LPSR, SNVS_LPSR_LPTA); 201 200 202 201 return snvs_rtc_alarm_irq_enable(dev, alrm->enabled); 203 202 } ··· 207 226 u32 lpsr; 208 227 u32 events = 0; 209 228 210 - lpsr = readl(data->ioaddr + SNVS_LPSR); 229 + regmap_read(data->regmap, data->offset + SNVS_LPSR, &lpsr); 211 230 212 231 if (lpsr & SNVS_LPSR_LPTA) { 213 232 events |= (RTC_AF | RTC_IRQF); ··· 219 238 } 220 239 221 240 /* clear interrupt status */ 222 - writel(lpsr, data->ioaddr + SNVS_LPSR); 241 + regmap_write(data->regmap, data->offset + SNVS_LPSR, lpsr); 223 242 224 243 return events ? IRQ_HANDLED : IRQ_NONE; 225 244 } 245 + 246 + static const struct regmap_config snvs_rtc_config = { 247 + .reg_bits = 32, 248 + .val_bits = 32, 249 + .reg_stride = 4, 250 + }; 226 251 227 252 static int snvs_rtc_probe(struct platform_device *pdev) 228 253 { 229 254 struct snvs_rtc_data *data; 230 255 struct resource *res; 231 256 int ret; 257 + void __iomem *mmio; 232 258 233 259 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 234 260 if (!data) 235 261 return -ENOMEM; 236 262 237 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 238 - data->ioaddr = devm_ioremap_resource(&pdev->dev, res); 239 - if (IS_ERR(data->ioaddr)) 240 - return PTR_ERR(data->ioaddr); 263 + data->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "regmap"); 264 + 265 + if (IS_ERR(data->regmap)) { 266 + dev_warn(&pdev->dev, "snvs rtc: you use old dts file, please update it\n"); 267 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 268 + 269 + mmio = devm_ioremap_resource(&pdev->dev, res); 270 + if (IS_ERR(mmio)) 271 + return PTR_ERR(mmio); 272 + 273 + data->regmap = devm_regmap_init_mmio(&pdev->dev, mmio, &snvs_rtc_config); 274 + } else { 275 + data->offset = SNVS_LPREGISTER_OFFSET; 276 + of_property_read_u32(pdev->dev.of_node, "offset", &data->offset); 277 + } 278 + 279 + if (!data->regmap) { 280 + dev_err(&pdev->dev, "Can't find snvs syscon\n"); 281 + return -ENODEV; 282 + } 241 283 242 284 data->irq = platform_get_irq(pdev, 0); 243 285 if (data->irq < 0) ··· 280 276 281 277 platform_set_drvdata(pdev, data); 282 278 283 - spin_lock_init(&data->lock); 284 - 285 279 /* Initialize glitch detect */ 286 - writel(SNVS_LPPGDR_INIT, data->ioaddr + SNVS_LPPGDR); 280 + regmap_write(data->regmap, data->offset + SNVS_LPPGDR, SNVS_LPPGDR_INIT); 287 281 288 282 /* Clear interrupt status */ 289 - writel(0xffffffff, data->ioaddr + SNVS_LPSR); 283 + regmap_write(data->regmap, data->offset + SNVS_LPSR, 0xffffffff); 290 284 291 285 /* Enable RTC */ 292 286 snvs_rtc_enable(data, true);
+19
drivers/soc/mediatek/Kconfig
··· 1 1 # 2 2 # MediaTek SoC drivers 3 3 # 4 + config MTK_INFRACFG 5 + bool "MediaTek INFRACFG Support" 6 + depends on ARCH_MEDIATEK || COMPILE_TEST 7 + select REGMAP 8 + help 9 + Say yes here to add support for the MediaTek INFRACFG controller. The 10 + INFRACFG controller contains various infrastructure registers not 11 + directly associated to any device. 12 + 4 13 config MTK_PMIC_WRAP 5 14 tristate "MediaTek PMIC Wrapper Support" 6 15 depends on ARCH_MEDIATEK ··· 19 10 Say yes here to add support for MediaTek PMIC Wrapper found 20 11 on different MediaTek SoCs. The PMIC wrapper is a proprietary 21 12 hardware to connect the PMIC. 13 + 14 + config MTK_SCPSYS 15 + bool "MediaTek SCPSYS Support" 16 + depends on ARCH_MEDIATEK || COMPILE_TEST 17 + select REGMAP 18 + select MTK_INFRACFG 19 + select PM_GENERIC_DOMAINS if PM 20 + help 21 + Say yes here to add support for the MediaTek SCPSYS power domain 22 + driver.
+2
drivers/soc/mediatek/Makefile
··· 1 + obj-$(CONFIG_MTK_INFRACFG) += mtk-infracfg.o 1 2 obj-$(CONFIG_MTK_PMIC_WRAP) += mtk-pmic-wrap.o 3 + obj-$(CONFIG_MTK_SCPSYS) += mtk-scpsys.o
+91
drivers/soc/mediatek/mtk-infracfg.c
··· 1 + /* 2 + * Copyright (c) 2015 Pengutronix, Sascha Hauer <kernel@pengutronix.de> 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope that it will be useful, 9 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + */ 13 + 14 + #include <linux/export.h> 15 + #include <linux/jiffies.h> 16 + #include <linux/regmap.h> 17 + #include <linux/soc/mediatek/infracfg.h> 18 + #include <asm/processor.h> 19 + 20 + #define INFRA_TOPAXI_PROTECTEN 0x0220 21 + #define INFRA_TOPAXI_PROTECTSTA1 0x0228 22 + 23 + /** 24 + * mtk_infracfg_set_bus_protection - enable bus protection 25 + * @regmap: The infracfg regmap 26 + * @mask: The mask containing the protection bits to be enabled. 27 + * 28 + * This function enables the bus protection bits for disabled power 29 + * domains so that the system does not hang when some unit accesses the 30 + * bus while in power down. 31 + */ 32 + int mtk_infracfg_set_bus_protection(struct regmap *infracfg, u32 mask) 33 + { 34 + unsigned long expired; 35 + u32 val; 36 + int ret; 37 + 38 + regmap_update_bits(infracfg, INFRA_TOPAXI_PROTECTEN, mask, mask); 39 + 40 + expired = jiffies + HZ; 41 + 42 + while (1) { 43 + ret = regmap_read(infracfg, INFRA_TOPAXI_PROTECTSTA1, &val); 44 + if (ret) 45 + return ret; 46 + 47 + if ((val & mask) == mask) 48 + break; 49 + 50 + cpu_relax(); 51 + if (time_after(jiffies, expired)) 52 + return -EIO; 53 + } 54 + 55 + return 0; 56 + } 57 + 58 + /** 59 + * mtk_infracfg_clear_bus_protection - disable bus protection 60 + * @regmap: The infracfg regmap 61 + * @mask: The mask containing the protection bits to be disabled. 62 + * 63 + * This function disables the bus protection bits previously enabled with 64 + * mtk_infracfg_set_bus_protection. 65 + */ 66 + int mtk_infracfg_clear_bus_protection(struct regmap *infracfg, u32 mask) 67 + { 68 + unsigned long expired; 69 + int ret; 70 + 71 + regmap_update_bits(infracfg, INFRA_TOPAXI_PROTECTEN, mask, 0); 72 + 73 + expired = jiffies + HZ; 74 + 75 + while (1) { 76 + u32 val; 77 + 78 + ret = regmap_read(infracfg, INFRA_TOPAXI_PROTECTSTA1, &val); 79 + if (ret) 80 + return ret; 81 + 82 + if (!(val & mask)) 83 + break; 84 + 85 + cpu_relax(); 86 + if (time_after(jiffies, expired)) 87 + return -EIO; 88 + } 89 + 90 + return 0; 91 + }
-1
drivers/soc/mediatek/mtk-pmic-wrap.c
··· 926 926 static struct platform_driver pwrap_drv = { 927 927 .driver = { 928 928 .name = "mt-pmic-pwrap", 929 - .owner = THIS_MODULE, 930 929 .of_match_table = of_match_ptr(of_pwrap_match_tbl), 931 930 }, 932 931 .probe = pwrap_probe,
+488
drivers/soc/mediatek/mtk-scpsys.c
··· 1 + /* 2 + * Copyright (c) 2015 Pengutronix, Sascha Hauer <kernel@pengutronix.de> 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope that it will be useful, 9 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + */ 13 + #include <linux/clk.h> 14 + #include <linux/delay.h> 15 + #include <linux/io.h> 16 + #include <linux/kernel.h> 17 + #include <linux/mfd/syscon.h> 18 + #include <linux/module.h> 19 + #include <linux/of_device.h> 20 + #include <linux/platform_device.h> 21 + #include <linux/pm_domain.h> 22 + #include <linux/regmap.h> 23 + #include <linux/soc/mediatek/infracfg.h> 24 + #include <dt-bindings/power/mt8173-power.h> 25 + 26 + #define SPM_VDE_PWR_CON 0x0210 27 + #define SPM_MFG_PWR_CON 0x0214 28 + #define SPM_VEN_PWR_CON 0x0230 29 + #define SPM_ISP_PWR_CON 0x0238 30 + #define SPM_DIS_PWR_CON 0x023c 31 + #define SPM_VEN2_PWR_CON 0x0298 32 + #define SPM_AUDIO_PWR_CON 0x029c 33 + #define SPM_MFG_2D_PWR_CON 0x02c0 34 + #define SPM_MFG_ASYNC_PWR_CON 0x02c4 35 + #define SPM_USB_PWR_CON 0x02cc 36 + #define SPM_PWR_STATUS 0x060c 37 + #define SPM_PWR_STATUS_2ND 0x0610 38 + 39 + #define PWR_RST_B_BIT BIT(0) 40 + #define PWR_ISO_BIT BIT(1) 41 + #define PWR_ON_BIT BIT(2) 42 + #define PWR_ON_2ND_BIT BIT(3) 43 + #define PWR_CLK_DIS_BIT BIT(4) 44 + 45 + #define PWR_STATUS_DISP BIT(3) 46 + #define PWR_STATUS_MFG BIT(4) 47 + #define PWR_STATUS_ISP BIT(5) 48 + #define PWR_STATUS_VDEC BIT(7) 49 + #define PWR_STATUS_VENC_LT BIT(20) 50 + #define PWR_STATUS_VENC BIT(21) 51 + #define PWR_STATUS_MFG_2D BIT(22) 52 + #define PWR_STATUS_MFG_ASYNC BIT(23) 53 + #define PWR_STATUS_AUDIO BIT(24) 54 + #define PWR_STATUS_USB BIT(25) 55 + 56 + enum clk_id { 57 + MT8173_CLK_MM, 58 + MT8173_CLK_MFG, 59 + MT8173_CLK_NONE, 60 + MT8173_CLK_MAX = MT8173_CLK_NONE, 61 + }; 62 + 63 + struct scp_domain_data { 64 + const char *name; 65 + u32 sta_mask; 66 + int ctl_offs; 67 + u32 sram_pdn_bits; 68 + u32 sram_pdn_ack_bits; 69 + u32 bus_prot_mask; 70 + enum clk_id clk_id; 71 + }; 72 + 73 + static const struct scp_domain_data scp_domain_data[] __initconst = { 74 + [MT8173_POWER_DOMAIN_VDEC] = { 75 + .name = "vdec", 76 + .sta_mask = PWR_STATUS_VDEC, 77 + .ctl_offs = SPM_VDE_PWR_CON, 78 + .sram_pdn_bits = GENMASK(11, 8), 79 + .sram_pdn_ack_bits = GENMASK(12, 12), 80 + .clk_id = MT8173_CLK_MM, 81 + }, 82 + [MT8173_POWER_DOMAIN_VENC] = { 83 + .name = "venc", 84 + .sta_mask = PWR_STATUS_VENC, 85 + .ctl_offs = SPM_VEN_PWR_CON, 86 + .sram_pdn_bits = GENMASK(11, 8), 87 + .sram_pdn_ack_bits = GENMASK(15, 12), 88 + .clk_id = MT8173_CLK_MM, 89 + }, 90 + [MT8173_POWER_DOMAIN_ISP] = { 91 + .name = "isp", 92 + .sta_mask = PWR_STATUS_ISP, 93 + .ctl_offs = SPM_ISP_PWR_CON, 94 + .sram_pdn_bits = GENMASK(11, 8), 95 + .sram_pdn_ack_bits = GENMASK(13, 12), 96 + .clk_id = MT8173_CLK_MM, 97 + }, 98 + [MT8173_POWER_DOMAIN_MM] = { 99 + .name = "mm", 100 + .sta_mask = PWR_STATUS_DISP, 101 + .ctl_offs = SPM_DIS_PWR_CON, 102 + .sram_pdn_bits = GENMASK(11, 8), 103 + .sram_pdn_ack_bits = GENMASK(12, 12), 104 + .clk_id = MT8173_CLK_MM, 105 + .bus_prot_mask = MT8173_TOP_AXI_PROT_EN_MM_M0 | 106 + MT8173_TOP_AXI_PROT_EN_MM_M1, 107 + }, 108 + [MT8173_POWER_DOMAIN_VENC_LT] = { 109 + .name = "venc_lt", 110 + .sta_mask = PWR_STATUS_VENC_LT, 111 + .ctl_offs = SPM_VEN2_PWR_CON, 112 + .sram_pdn_bits = GENMASK(11, 8), 113 + .sram_pdn_ack_bits = GENMASK(15, 12), 114 + .clk_id = MT8173_CLK_MM, 115 + }, 116 + [MT8173_POWER_DOMAIN_AUDIO] = { 117 + .name = "audio", 118 + .sta_mask = PWR_STATUS_AUDIO, 119 + .ctl_offs = SPM_AUDIO_PWR_CON, 120 + .sram_pdn_bits = GENMASK(11, 8), 121 + .sram_pdn_ack_bits = GENMASK(15, 12), 122 + .clk_id = MT8173_CLK_NONE, 123 + }, 124 + [MT8173_POWER_DOMAIN_USB] = { 125 + .name = "usb", 126 + .sta_mask = PWR_STATUS_USB, 127 + .ctl_offs = SPM_USB_PWR_CON, 128 + .sram_pdn_bits = GENMASK(11, 8), 129 + .sram_pdn_ack_bits = GENMASK(15, 12), 130 + .clk_id = MT8173_CLK_NONE, 131 + }, 132 + [MT8173_POWER_DOMAIN_MFG_ASYNC] = { 133 + .name = "mfg_async", 134 + .sta_mask = PWR_STATUS_MFG_ASYNC, 135 + .ctl_offs = SPM_MFG_ASYNC_PWR_CON, 136 + .sram_pdn_bits = GENMASK(11, 8), 137 + .sram_pdn_ack_bits = 0, 138 + .clk_id = MT8173_CLK_MFG, 139 + }, 140 + [MT8173_POWER_DOMAIN_MFG_2D] = { 141 + .name = "mfg_2d", 142 + .sta_mask = PWR_STATUS_MFG_2D, 143 + .ctl_offs = SPM_MFG_2D_PWR_CON, 144 + .sram_pdn_bits = GENMASK(11, 8), 145 + .sram_pdn_ack_bits = GENMASK(13, 12), 146 + .clk_id = MT8173_CLK_NONE, 147 + }, 148 + [MT8173_POWER_DOMAIN_MFG] = { 149 + .name = "mfg", 150 + .sta_mask = PWR_STATUS_MFG, 151 + .ctl_offs = SPM_MFG_PWR_CON, 152 + .sram_pdn_bits = GENMASK(13, 8), 153 + .sram_pdn_ack_bits = GENMASK(21, 16), 154 + .clk_id = MT8173_CLK_NONE, 155 + .bus_prot_mask = MT8173_TOP_AXI_PROT_EN_MFG_S | 156 + MT8173_TOP_AXI_PROT_EN_MFG_M0 | 157 + MT8173_TOP_AXI_PROT_EN_MFG_M1 | 158 + MT8173_TOP_AXI_PROT_EN_MFG_SNOOP_OUT, 159 + }, 160 + }; 161 + 162 + #define NUM_DOMAINS ARRAY_SIZE(scp_domain_data) 163 + 164 + struct scp; 165 + 166 + struct scp_domain { 167 + struct generic_pm_domain genpd; 168 + struct scp *scp; 169 + struct clk *clk; 170 + u32 sta_mask; 171 + void __iomem *ctl_addr; 172 + u32 sram_pdn_bits; 173 + u32 sram_pdn_ack_bits; 174 + u32 bus_prot_mask; 175 + }; 176 + 177 + struct scp { 178 + struct scp_domain domains[NUM_DOMAINS]; 179 + struct genpd_onecell_data pd_data; 180 + struct device *dev; 181 + void __iomem *base; 182 + struct regmap *infracfg; 183 + }; 184 + 185 + static int scpsys_domain_is_on(struct scp_domain *scpd) 186 + { 187 + struct scp *scp = scpd->scp; 188 + 189 + u32 status = readl(scp->base + SPM_PWR_STATUS) & scpd->sta_mask; 190 + u32 status2 = readl(scp->base + SPM_PWR_STATUS_2ND) & scpd->sta_mask; 191 + 192 + /* 193 + * A domain is on when both status bits are set. If only one is set 194 + * return an error. This happens while powering up a domain 195 + */ 196 + 197 + if (status && status2) 198 + return true; 199 + if (!status && !status2) 200 + return false; 201 + 202 + return -EINVAL; 203 + } 204 + 205 + static int scpsys_power_on(struct generic_pm_domain *genpd) 206 + { 207 + struct scp_domain *scpd = container_of(genpd, struct scp_domain, genpd); 208 + struct scp *scp = scpd->scp; 209 + unsigned long timeout; 210 + bool expired; 211 + void __iomem *ctl_addr = scpd->ctl_addr; 212 + u32 sram_pdn_ack = scpd->sram_pdn_ack_bits; 213 + u32 val; 214 + int ret; 215 + 216 + if (scpd->clk) { 217 + ret = clk_prepare_enable(scpd->clk); 218 + if (ret) 219 + goto err_clk; 220 + } 221 + 222 + val = readl(ctl_addr); 223 + val |= PWR_ON_BIT; 224 + writel(val, ctl_addr); 225 + val |= PWR_ON_2ND_BIT; 226 + writel(val, ctl_addr); 227 + 228 + /* wait until PWR_ACK = 1 */ 229 + timeout = jiffies + HZ; 230 + expired = false; 231 + while (1) { 232 + ret = scpsys_domain_is_on(scpd); 233 + if (ret > 0) 234 + break; 235 + 236 + if (expired) { 237 + ret = -ETIMEDOUT; 238 + goto err_pwr_ack; 239 + } 240 + 241 + cpu_relax(); 242 + 243 + if (time_after(jiffies, timeout)) 244 + expired = true; 245 + } 246 + 247 + val &= ~PWR_CLK_DIS_BIT; 248 + writel(val, ctl_addr); 249 + 250 + val &= ~PWR_ISO_BIT; 251 + writel(val, ctl_addr); 252 + 253 + val |= PWR_RST_B_BIT; 254 + writel(val, ctl_addr); 255 + 256 + val &= ~scpd->sram_pdn_bits; 257 + writel(val, ctl_addr); 258 + 259 + /* wait until SRAM_PDN_ACK all 0 */ 260 + timeout = jiffies + HZ; 261 + expired = false; 262 + while (sram_pdn_ack && (readl(ctl_addr) & sram_pdn_ack)) { 263 + 264 + if (expired) { 265 + ret = -ETIMEDOUT; 266 + goto err_pwr_ack; 267 + } 268 + 269 + cpu_relax(); 270 + 271 + if (time_after(jiffies, timeout)) 272 + expired = true; 273 + } 274 + 275 + if (scpd->bus_prot_mask) { 276 + ret = mtk_infracfg_clear_bus_protection(scp->infracfg, 277 + scpd->bus_prot_mask); 278 + if (ret) 279 + goto err_pwr_ack; 280 + } 281 + 282 + return 0; 283 + 284 + err_pwr_ack: 285 + clk_disable_unprepare(scpd->clk); 286 + err_clk: 287 + dev_err(scp->dev, "Failed to power on domain %s\n", genpd->name); 288 + 289 + return ret; 290 + } 291 + 292 + static int scpsys_power_off(struct generic_pm_domain *genpd) 293 + { 294 + struct scp_domain *scpd = container_of(genpd, struct scp_domain, genpd); 295 + struct scp *scp = scpd->scp; 296 + unsigned long timeout; 297 + bool expired; 298 + void __iomem *ctl_addr = scpd->ctl_addr; 299 + u32 pdn_ack = scpd->sram_pdn_ack_bits; 300 + u32 val; 301 + int ret; 302 + 303 + if (scpd->bus_prot_mask) { 304 + ret = mtk_infracfg_set_bus_protection(scp->infracfg, 305 + scpd->bus_prot_mask); 306 + if (ret) 307 + goto out; 308 + } 309 + 310 + val = readl(ctl_addr); 311 + val |= scpd->sram_pdn_bits; 312 + writel(val, ctl_addr); 313 + 314 + /* wait until SRAM_PDN_ACK all 1 */ 315 + timeout = jiffies + HZ; 316 + expired = false; 317 + while (pdn_ack && (readl(ctl_addr) & pdn_ack) != pdn_ack) { 318 + if (expired) { 319 + ret = -ETIMEDOUT; 320 + goto out; 321 + } 322 + 323 + cpu_relax(); 324 + 325 + if (time_after(jiffies, timeout)) 326 + expired = true; 327 + } 328 + 329 + val |= PWR_ISO_BIT; 330 + writel(val, ctl_addr); 331 + 332 + val &= ~PWR_RST_B_BIT; 333 + writel(val, ctl_addr); 334 + 335 + val |= PWR_CLK_DIS_BIT; 336 + writel(val, ctl_addr); 337 + 338 + val &= ~PWR_ON_BIT; 339 + writel(val, ctl_addr); 340 + 341 + val &= ~PWR_ON_2ND_BIT; 342 + writel(val, ctl_addr); 343 + 344 + /* wait until PWR_ACK = 0 */ 345 + timeout = jiffies + HZ; 346 + expired = false; 347 + while (1) { 348 + ret = scpsys_domain_is_on(scpd); 349 + if (ret == 0) 350 + break; 351 + 352 + if (expired) { 353 + ret = -ETIMEDOUT; 354 + goto out; 355 + } 356 + 357 + cpu_relax(); 358 + 359 + if (time_after(jiffies, timeout)) 360 + expired = true; 361 + } 362 + 363 + if (scpd->clk) 364 + clk_disable_unprepare(scpd->clk); 365 + 366 + return 0; 367 + 368 + out: 369 + dev_err(scp->dev, "Failed to power off domain %s\n", genpd->name); 370 + 371 + return ret; 372 + } 373 + 374 + static int __init scpsys_probe(struct platform_device *pdev) 375 + { 376 + struct genpd_onecell_data *pd_data; 377 + struct resource *res; 378 + int i, ret; 379 + struct scp *scp; 380 + struct clk *clk[MT8173_CLK_MAX]; 381 + 382 + scp = devm_kzalloc(&pdev->dev, sizeof(*scp), GFP_KERNEL); 383 + if (!scp) 384 + return -ENOMEM; 385 + 386 + scp->dev = &pdev->dev; 387 + 388 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 389 + scp->base = devm_ioremap_resource(&pdev->dev, res); 390 + if (IS_ERR(scp->base)) 391 + return PTR_ERR(scp->base); 392 + 393 + pd_data = &scp->pd_data; 394 + 395 + pd_data->domains = devm_kzalloc(&pdev->dev, 396 + sizeof(*pd_data->domains) * NUM_DOMAINS, GFP_KERNEL); 397 + if (!pd_data->domains) 398 + return -ENOMEM; 399 + 400 + clk[MT8173_CLK_MM] = devm_clk_get(&pdev->dev, "mm"); 401 + if (IS_ERR(clk[MT8173_CLK_MM])) 402 + return PTR_ERR(clk[MT8173_CLK_MM]); 403 + 404 + clk[MT8173_CLK_MFG] = devm_clk_get(&pdev->dev, "mfg"); 405 + if (IS_ERR(clk[MT8173_CLK_MFG])) 406 + return PTR_ERR(clk[MT8173_CLK_MFG]); 407 + 408 + scp->infracfg = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, 409 + "infracfg"); 410 + if (IS_ERR(scp->infracfg)) { 411 + dev_err(&pdev->dev, "Cannot find infracfg controller: %ld\n", 412 + PTR_ERR(scp->infracfg)); 413 + return PTR_ERR(scp->infracfg); 414 + } 415 + 416 + pd_data->num_domains = NUM_DOMAINS; 417 + 418 + for (i = 0; i < NUM_DOMAINS; i++) { 419 + struct scp_domain *scpd = &scp->domains[i]; 420 + struct generic_pm_domain *genpd = &scpd->genpd; 421 + const struct scp_domain_data *data = &scp_domain_data[i]; 422 + 423 + pd_data->domains[i] = genpd; 424 + scpd->scp = scp; 425 + 426 + scpd->sta_mask = data->sta_mask; 427 + scpd->ctl_addr = scp->base + data->ctl_offs; 428 + scpd->sram_pdn_bits = data->sram_pdn_bits; 429 + scpd->sram_pdn_ack_bits = data->sram_pdn_ack_bits; 430 + scpd->bus_prot_mask = data->bus_prot_mask; 431 + if (data->clk_id != MT8173_CLK_NONE) 432 + scpd->clk = clk[data->clk_id]; 433 + 434 + genpd->name = data->name; 435 + genpd->power_off = scpsys_power_off; 436 + genpd->power_on = scpsys_power_on; 437 + 438 + /* 439 + * Initially turn on all domains to make the domains usable 440 + * with !CONFIG_PM and to get the hardware in sync with the 441 + * software. The unused domains will be switched off during 442 + * late_init time. 443 + */ 444 + genpd->power_on(genpd); 445 + 446 + pm_genpd_init(genpd, NULL, false); 447 + } 448 + 449 + /* 450 + * We are not allowed to fail here since there is no way to unregister 451 + * a power domain. Once registered above we have to keep the domains 452 + * valid. 453 + */ 454 + 455 + ret = pm_genpd_add_subdomain(pd_data->domains[MT8173_POWER_DOMAIN_MFG_ASYNC], 456 + pd_data->domains[MT8173_POWER_DOMAIN_MFG_2D]); 457 + if (ret && IS_ENABLED(CONFIG_PM)) 458 + dev_err(&pdev->dev, "Failed to add subdomain: %d\n", ret); 459 + 460 + ret = pm_genpd_add_subdomain(pd_data->domains[MT8173_POWER_DOMAIN_MFG_2D], 461 + pd_data->domains[MT8173_POWER_DOMAIN_MFG]); 462 + if (ret && IS_ENABLED(CONFIG_PM)) 463 + dev_err(&pdev->dev, "Failed to add subdomain: %d\n", ret); 464 + 465 + ret = of_genpd_add_provider_onecell(pdev->dev.of_node, pd_data); 466 + if (ret) 467 + dev_err(&pdev->dev, "Failed to add OF provider: %d\n", ret); 468 + 469 + return 0; 470 + } 471 + 472 + static const struct of_device_id of_scpsys_match_tbl[] = { 473 + { 474 + .compatible = "mediatek,mt8173-scpsys", 475 + }, { 476 + /* sentinel */ 477 + } 478 + }; 479 + 480 + static struct platform_driver scpsys_drv = { 481 + .driver = { 482 + .name = "mtk-scpsys", 483 + .owner = THIS_MODULE, 484 + .of_match_table = of_match_ptr(of_scpsys_match_tbl), 485 + }, 486 + }; 487 + 488 + module_platform_driver_probe(scpsys_drv, scpsys_probe);
+15
include/dt-bindings/power/mt8173-power.h
··· 1 + #ifndef _DT_BINDINGS_POWER_MT8183_POWER_H 2 + #define _DT_BINDINGS_POWER_MT8183_POWER_H 3 + 4 + #define MT8173_POWER_DOMAIN_VDEC 0 5 + #define MT8173_POWER_DOMAIN_VENC 1 6 + #define MT8173_POWER_DOMAIN_ISP 2 7 + #define MT8173_POWER_DOMAIN_MM 3 8 + #define MT8173_POWER_DOMAIN_VENC_LT 4 9 + #define MT8173_POWER_DOMAIN_AUDIO 5 10 + #define MT8173_POWER_DOMAIN_USB 6 11 + #define MT8173_POWER_DOMAIN_MFG_ASYNC 7 12 + #define MT8173_POWER_DOMAIN_MFG_2D 8 13 + #define MT8173_POWER_DOMAIN_MFG 9 14 + 15 + #endif /* _DT_BINDINGS_POWER_MT8183_POWER_H */
+2 -1
include/linux/clk/ti.h
··· 263 263 int omap3430_dt_clk_init(void); 264 264 int omap3630_dt_clk_init(void); 265 265 int am35xx_dt_clk_init(void); 266 - int ti81xx_dt_clk_init(void); 266 + int dm814x_dt_clk_init(void); 267 + int dm816x_dt_clk_init(void); 267 268 int omap4xxx_dt_clk_init(void); 268 269 int omap5xxx_dt_clk_init(void); 269 270 int dra7xx_dt_clk_init(void);
+8
include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
··· 435 435 #define IMX6SX_GPR5_DISP_MUX_DCIC1_LVDS (0x1 << 1) 436 436 #define IMX6SX_GPR5_DISP_MUX_DCIC1_MASK (0x1 << 1) 437 437 438 + /* For imx6ul iomux gpr register field define */ 439 + #define IMX6UL_GPR1_ENET1_CLK_DIR (0x1 << 17) 440 + #define IMX6UL_GPR1_ENET2_CLK_DIR (0x1 << 18) 441 + #define IMX6UL_GPR1_ENET1_CLK_OUTPUT (0x1 << 17) 442 + #define IMX6UL_GPR1_ENET2_CLK_OUTPUT (0x1 << 18) 443 + #define IMX6UL_GPR1_ENET_CLK_DIR (0x3 << 17) 444 + #define IMX6UL_GPR1_ENET_CLK_OUTPUT (0x3 << 17) 445 + 438 446 #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */
+26
include/linux/soc/mediatek/infracfg.h
··· 1 + #ifndef __SOC_MEDIATEK_INFRACFG_H 2 + #define __SOC_MEDIATEK_INFRACFG_H 3 + 4 + #define MT8173_TOP_AXI_PROT_EN_MCI_M2 BIT(0) 5 + #define MT8173_TOP_AXI_PROT_EN_MM_M0 BIT(1) 6 + #define MT8173_TOP_AXI_PROT_EN_MM_M1 BIT(2) 7 + #define MT8173_TOP_AXI_PROT_EN_MMAPB_S BIT(6) 8 + #define MT8173_TOP_AXI_PROT_EN_L2C_M2 BIT(9) 9 + #define MT8173_TOP_AXI_PROT_EN_L2SS_SMI BIT(11) 10 + #define MT8173_TOP_AXI_PROT_EN_L2SS_ADD BIT(12) 11 + #define MT8173_TOP_AXI_PROT_EN_CCI_M2 BIT(13) 12 + #define MT8173_TOP_AXI_PROT_EN_MFG_S BIT(14) 13 + #define MT8173_TOP_AXI_PROT_EN_PERI_M0 BIT(15) 14 + #define MT8173_TOP_AXI_PROT_EN_PERI_M1 BIT(16) 15 + #define MT8173_TOP_AXI_PROT_EN_DEBUGSYS BIT(17) 16 + #define MT8173_TOP_AXI_PROT_EN_CQ_DMA BIT(18) 17 + #define MT8173_TOP_AXI_PROT_EN_GCPU BIT(19) 18 + #define MT8173_TOP_AXI_PROT_EN_IOMMU BIT(20) 19 + #define MT8173_TOP_AXI_PROT_EN_MFG_M0 BIT(21) 20 + #define MT8173_TOP_AXI_PROT_EN_MFG_M1 BIT(22) 21 + #define MT8173_TOP_AXI_PROT_EN_MFG_SNOOP_OUT BIT(23) 22 + 23 + int mtk_infracfg_set_bus_protection(struct regmap *infracfg, u32 mask); 24 + int mtk_infracfg_clear_bus_protection(struct regmap *infracfg, u32 mask); 25 + 26 + #endif /* __SOC_MEDIATEK_INFRACFG_H */