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/soc/soc

Pull ARM SoC platform updates from Olof Johansson:
"SoC updates, mostly refactorings and cleanups of old legacy platforms.

Major themes this release:

- Conversion of ixp4xx to a modern platform (drivers, DT, bindings)

- Moving some of the ep93xx headers around to get it closer to
multiplatform enabled.

- Cleanups of Davinci

This also contains a few patches that were queued up as fixes before
5.1 but I didn't get sent in before release"

* tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (123 commits)
ARM: debug-ll: add default address for digicolor
ARM: u300: regulator: add MODULE_LICENSE()
ARM: ep93xx: move private headers out of mach/*
ARM: ep93xx: move pinctrl interfaces into include/linux/soc
ARM: ep93xx: keypad: stop using mach/platform.h
ARM: ep93xx: move network platform data to separate header
ARM: stm32: add AMBA support for stm32 family
MAINTAINERS: update arch/arm/mach-davinci
ARM: rockchip: add missing of_node_put in rockchip_smp_prepare_pmu
ARM: dts: Add queue manager and NPE to the IXP4xx DTSI
soc: ixp4xx: qmgr: Add DT probe code
soc: ixp4xx: qmgr: Add DT bindings for IXP4xx qmgr
soc: ixp4xx: npe: Add DT probe code
soc: ixp4xx: Add DT bindings for IXP4xx NPE
soc: ixp4xx: qmgr: Pass resources
soc: ixp4xx: Remove unused functions
soc: ixp4xx: Uninline several functions
soc: ixp4xx: npe: Pass addresses as resources
ARM: ixp4xx: Turn the QMGR into a platform device
ARM: ixp4xx: Turn the NPE into a platform device
...

+3798 -4251
+22
Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/intel-ixp4xx.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Intel IXP4xx Device Tree Bindings 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + 12 + properties: 13 + compatible: 14 + oneOf: 15 + - items: 16 + - enum: 17 + - linksys,nslu2 18 + - const: intel,ixp42x 19 + - items: 20 + - enum: 21 + - gateworks,gw2358 22 + - const: intel,ixp43x
+4 -2
Documentation/devicetree/bindings/bus/ti-sysc.txt
··· 94 94 95 95 - ti,no-idle-on-init interconnect target module should not be idled at init 96 96 97 + - ti,no-idle interconnect target module should not be idled 98 + 97 99 Example: Single instance of MUSB controller on omap4 using interconnect ranges 98 100 using offsets from l4_cfg second segment (0x4a000000 + 0x80000 = 0x4a0ab000): 99 101 ··· 133 131 }; 134 132 }; 135 133 136 - Note that other SoCs, such as am335x can have multipe child devices. On am335x 134 + Note that other SoCs, such as am335x can have multiple child devices. On am335x 137 135 there are two MUSB instances, two USB PHY instances, and a single CPPI41 DMA 138 - instance as children of a single interconnet target module. 136 + instance as children of a single interconnect target module.
+44
Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + # Copyright 2019 Linaro Ltd. 3 + %YAML 1.2 4 + --- 5 + $id: "http://devicetree.org/schemas/firmware/intel-ixp4xx-network-processing-engine.yaml#" 6 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 7 + 8 + title: Intel IXP4xx Network Processing Engine 9 + 10 + maintainers: 11 + - Linus Walleij <linus.walleij@linaro.org> 12 + 13 + description: | 14 + On the IXP4xx SoCs, the Network Processing Engine (NPE) is a small 15 + processor that can load a firmware to perform offloading of networking 16 + and crypto tasks. It also manages the MDIO bus to the ethernet PHYs 17 + on the IXP4xx platform. All IXP4xx platforms have three NPEs at 18 + consecutive memory locations. They are all included in the same 19 + device node since they are not independent of each other. 20 + 21 + properties: 22 + compatible: 23 + oneOf: 24 + - items: 25 + - const: intel,ixp4xx-network-processing-engine 26 + 27 + reg: 28 + minItems: 3 29 + maxItems: 3 30 + items: 31 + - description: NPE0 register range 32 + - description: NPE1 register range 33 + - description: NPE2 register range 34 + 35 + required: 36 + - compatible 37 + - reg 38 + 39 + examples: 40 + - | 41 + npe@c8006000 { 42 + compatible = "intel,ixp4xx-network-processing-engine"; 43 + reg = <0xc8006000 0x1000>, <0xc8007000 0x1000>, <0xc8008000 0x1000>; 44 + };
+54
Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + # Copyright 2018 Linaro Ltd. 3 + %YAML 1.2 4 + --- 5 + $id: "http://devicetree.org/schemas/interrupt/intel-ixp4xx-interrupt.yaml#" 6 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 7 + 8 + title: Intel IXP4xx XScale Networking Processors Interrupt Controller 9 + 10 + maintainers: 11 + - Linus Walleij <linus.walleij@linaro.org> 12 + 13 + description: | 14 + This interrupt controller is found in the Intel IXP4xx processors. 15 + Some processors have 32 interrupts, some have up to 64 interrupts. 16 + The exact number of interrupts is determined from the compatible 17 + string. 18 + 19 + The distinct IXP4xx families with different interrupt controller 20 + variations are IXP42x, IXP43x, IXP45x and IXP46x. Those four 21 + families were the only ones to reach the developer and consumer 22 + market. 23 + 24 + properties: 25 + compatible: 26 + items: 27 + - enum: 28 + - intel,ixp42x-interrupt 29 + - intel,ixp43x-interrupt 30 + - intel,ixp45x-interrupt 31 + - intel,ixp46x-interrupt 32 + 33 + reg: 34 + maxItems: 1 35 + 36 + interrupt-controller: true 37 + 38 + '#interrupt-cells': 39 + const: 2 40 + 41 + required: 42 + - compatible 43 + - reg 44 + - interrupt-controller 45 + - '#interrupt-cells' 46 + 47 + examples: 48 + - | 49 + intcon: interrupt-controller@c8003000 { 50 + compatible = "intel,ixp43x-interrupt"; 51 + reg = <0xc8003000 0x100>; 52 + interrupt-controller; 53 + #interrupt-cells = <2>; 54 + };
+49
Documentation/devicetree/bindings/misc/intel,ixp4xx-queue-manager.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + # Copyright 2019 Linaro Ltd. 3 + %YAML 1.2 4 + --- 5 + $id: "http://devicetree.org/schemas/misc/intel-ixp4xx-ahb-queue-manager.yaml#" 6 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 7 + 8 + title: Intel IXP4xx AHB Queue Manager 9 + 10 + maintainers: 11 + - Linus Walleij <linus.walleij@linaro.org> 12 + 13 + description: | 14 + The IXP4xx AHB Queue Manager maintains queues as circular buffers in 15 + an 8KB embedded SRAM along with hardware pointers. It is used by both 16 + the XScale processor and the NPEs (Network Processing Units) in the 17 + IXP4xx for accelerating queues, especially for networking. Clients pick 18 + queues from the queue manager with foo-queue = <&qmgr N> where the 19 + &qmgr is a phandle to the queue manager and N is the queue resource 20 + number. The queue resources available and their specific purpose 21 + on a certain IXP4xx system will vary. 22 + 23 + properties: 24 + compatible: 25 + items: 26 + - const: intel,ixp4xx-ahb-queue-manager 27 + 28 + reg: 29 + maxItems: 1 30 + 31 + interrupts: 32 + items: 33 + - description: Interrupt for queues 0-31 34 + - description: Interrupt for queues 32-63 35 + 36 + required: 37 + - compatible 38 + - reg 39 + - interrupts 40 + 41 + examples: 42 + - | 43 + #include <dt-bindings/interrupt-controller/irq.h> 44 + 45 + qmgr: queue-manager@60000000 { 46 + compatible = "intel,ixp4xx-ahb-queue-manager"; 47 + reg = <0x60000000 0x4000>; 48 + interrupts = <3 IRQ_TYPE_LEVEL_HIGH>, <4 IRQ_TYPE_LEVEL_HIGH>; 49 + };
+42
Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + # Copyright 2018 Linaro Ltd. 3 + %YAML 1.2 4 + --- 5 + $id: "http://devicetree.org/schemas/timer/intel-ixp4xx-timer.yaml#" 6 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 7 + 8 + title: Intel IXP4xx XScale Networking Processors Timers 9 + 10 + maintainers: 11 + - Linus Walleij <linus.walleij@linaro.org> 12 + 13 + description: This timer is found in the Intel IXP4xx processors. 14 + 15 + properties: 16 + compatible: 17 + items: 18 + - const: intel,ixp4xx-timer 19 + 20 + reg: 21 + description: Should contain registers location and length 22 + 23 + interrupts: 24 + minItems: 1 25 + maxItems: 2 26 + items: 27 + - description: Timer 1 interrupt 28 + - description: Timer 2 interrupt 29 + 30 + required: 31 + - compatible 32 + - reg 33 + - interrupts 34 + 35 + examples: 36 + - | 37 + #include <dt-bindings/interrupt-controller/irq.h> 38 + timer@c8005000 { 39 + compatible = "intel,ixp4xx-timer"; 40 + reg = <0xc8005000 0x100>; 41 + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; 42 + };
+16 -5
MAINTAINERS
··· 1733 1733 S: Maintained 1734 1734 1735 1735 ARM/INTEL IXP4XX ARM ARCHITECTURE 1736 + M: Linus Walleij <linusw@kernel.org> 1736 1737 M: Imre Kaloz <kaloz@openwrt.org> 1737 1738 M: Krzysztof Halasa <khalasa@piap.pl> 1738 1739 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1739 1740 S: Maintained 1741 + F: Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml 1742 + F: Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt 1743 + F: Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml 1744 + F: Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml 1740 1745 F: arch/arm/mach-ixp4xx/ 1746 + F: drivers/clocksource/timer-ixp4xx.c 1747 + F: drivers/gpio/gpio-ixp4xx.c 1748 + F: drivers/irqchip/irq-ixp4xx.c 1749 + F: include/linux/irqchip/irq-ixp4xx.h 1750 + F: include/linux/platform_data/timer-ixp4xx.h 1741 1751 1742 1752 ARM/INTEL RESEARCH IMOTE/STARGATE 2 MACHINE SUPPORT 1743 1753 M: Jonathan Cameron <jic23@cam.ac.uk> ··· 2248 2238 F: arch/arm/boot/dts/socfpga* 2249 2239 F: arch/arm/configs/socfpga_defconfig 2250 2240 F: arch/arm64/boot/dts/altera/ 2241 + F: arch/arm64/boot/dts/intel/ 2251 2242 W: http://www.rocketboards.org 2252 2243 T: git git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git 2253 2244 ··· 8001 7990 INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT 8002 7991 M: Krzysztof Halasa <khalasa@piap.pl> 8003 7992 S: Maintained 8004 - F: arch/arm/mach-ixp4xx/include/mach/qmgr.h 8005 - F: arch/arm/mach-ixp4xx/include/mach/npe.h 8006 - F: arch/arm/mach-ixp4xx/ixp4xx_qmgr.c 8007 - F: arch/arm/mach-ixp4xx/ixp4xx_npe.c 7993 + F: include/linux/soc/ixp4xx/qmgr.h 7994 + F: include/linux/soc/ixp4xx/npe.h 7995 + F: drivers/soc/ixp4xx/ixp4xx-qmgr.c 7996 + F: drivers/soc/ixp4xx/ixp4xx-npe.c 8008 7997 F: drivers/net/ethernet/xscale/ixp4xx_eth.c 8009 7998 F: drivers/net/wan/ixp4xx_hss.c 8010 7999 ··· 15665 15654 15666 15655 TI DAVINCI MACHINE SUPPORT 15667 15656 M: Sekhar Nori <nsekhar@ti.com> 15668 - M: Kevin Hilman <khilman@kernel.org> 15657 + R: Bartosz Golaszewski <bgolaszewski@baylibre.com> 15669 15658 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 15670 15659 T: git git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git 15671 15660 S: Supported
+4 -3
arch/arm/Kconfig
··· 426 426 depends on MMU 427 427 select ARCH_HAS_DMA_SET_COHERENT_MASK 428 428 select ARCH_SUPPORTS_BIG_ENDIAN 429 - select CLKSRC_MMIO 430 429 select CPU_XSCALE 431 430 select DMABOUNCE if PCI 432 431 select GENERIC_CLOCKEVENTS 432 + select GENERIC_IRQ_MULTI_HANDLER 433 + select GPIO_IXP4XX 433 434 select GPIOLIB 434 435 select HAVE_PCI 436 + select IXP4XX_IRQ 437 + select IXP4XX_TIMER 435 438 select NEED_MACH_IO_H 436 439 select USB_EHCI_BIG_ENDIAN_DESC 437 440 select USB_EHCI_BIG_ENDIAN_MMIO ··· 899 896 900 897 config PLAT_VERSATILE 901 898 bool 902 - 903 - source "arch/arm/firmware/Kconfig" 904 899 905 900 source "arch/arm/mm/Kconfig" 906 901
+2
arch/arm/Kconfig.debug
··· 1676 1676 default 0xe6e68000 if DEBUG_RCAR_GEN2_SCIF1 1677 1677 default 0xe6ee0000 if DEBUG_RCAR_GEN2_SCIF4 1678 1678 default 0xe8008000 if DEBUG_R7S72100_SCIF2 1679 + default 0xf0000000 if DEBUG_DIGICOLOR_UA0 1679 1680 default 0xf0000be0 if ARCH_EBSA110 1680 1681 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE 1681 1682 default 0xf1012100 if DEBUG_MVEBU_UART1_ALTERNATE ··· 1728 1727 default 0xe0010fe0 if ARCH_RPC 1729 1728 default 0xf0000be0 if ARCH_EBSA110 1730 1729 default 0xf0010000 if DEBUG_ASM9260_UART 1730 + default 0xf0100000 if DEBUG_DIGICOLOR_UA0 1731 1731 default 0xf01fb000 if DEBUG_NOMADIK_UART 1732 1732 default 0xf0201000 if DEBUG_BCM2835 || DEBUG_BCM2836 1733 1733 default 0xf1000300 if DEBUG_BCM_5301X
-1
arch/arm/Makefile
··· 290 290 core-y += arch/arm/probes/ 291 291 core-y += arch/arm/net/ 292 292 core-y += arch/arm/crypto/ 293 - core-y += arch/arm/firmware/ 294 293 core-y += $(machdirs) $(platdirs) 295 294 296 295 drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
+3
arch/arm/boot/dts/Makefile
··· 229 229 dtb-$(CONFIG_ARCH_INTEGRATOR) += \ 230 230 integratorap.dtb \ 231 231 integratorcp.dtb 232 + dtb-$(CONFIG_ARCH_IXP4XX) += \ 233 + intel-ixp42x-linksys-nslu2.dtb \ 234 + intel-ixp43x-gateworks-gw2358.dtb 232 235 dtb-$(CONFIG_ARCH_KEYSTONE) += \ 233 236 keystone-k2hk-evm.dtb \ 234 237 keystone-k2l-evm.dtb \
+3 -1
arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi
··· 88 88 regulator-min-microvolt = <5000000>; 89 89 regulator-max-microvolt = <5000000>; 90 90 gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>; 91 + startup-delay-us = <70000>; 91 92 enable-active-high; 92 93 }; 93 94 ··· 100 99 regulator-min-microvolt = <3300000>; 101 100 regulator-max-microvolt = <3300000>; 102 101 gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>; 102 + startup-delay-us = <70000>; 103 103 enable-active-high; 104 104 regulator-always-on; 105 105 }; ··· 218 216 &fec { 219 217 pinctrl-names = "default"; 220 218 pinctrl-0 = <&pinctrl_enet>; 221 - phy-mode = "rgmii"; 219 + phy-mode = "rgmii-id"; 222 220 phy-reset-duration = <10>; 223 221 phy-reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; 224 222 phy-supply = <&reg_enet>;
+1 -1
arch/arm/boot/dts/imx6dl-riotboard.dts
··· 92 92 &fec { 93 93 pinctrl-names = "default"; 94 94 pinctrl-0 = <&pinctrl_enet>; 95 - phy-mode = "rgmii"; 95 + phy-mode = "rgmii-id"; 96 96 phy-reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; 97 97 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>, 98 98 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
+1 -1
arch/arm/boot/dts/imx6q-ba16.dtsi
··· 171 171 &fec { 172 172 pinctrl-names = "default"; 173 173 pinctrl-0 = <&pinctrl_enet>; 174 - phy-mode = "rgmii"; 174 + phy-mode = "rgmii-id"; 175 175 status = "okay"; 176 176 }; 177 177
+1 -1
arch/arm/boot/dts/imx6q-marsboard.dts
··· 110 110 &fec { 111 111 pinctrl-names = "default"; 112 112 pinctrl-0 = <&pinctrl_enet>; 113 - phy-mode = "rgmii"; 113 + phy-mode = "rgmii-id"; 114 114 phy-reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; 115 115 status = "okay"; 116 116 };
+1 -1
arch/arm/boot/dts/imx6q-tbs2910.dts
··· 98 98 &fec { 99 99 pinctrl-names = "default"; 100 100 pinctrl-0 = <&pinctrl_enet>; 101 - phy-mode = "rgmii"; 101 + phy-mode = "rgmii-id"; 102 102 phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; 103 103 status = "okay"; 104 104 };
+1 -1
arch/arm/boot/dts/imx6qdl-apf6.dtsi
··· 51 51 &fec { 52 52 pinctrl-names = "default"; 53 53 pinctrl-0 = <&pinctrl_enet>; 54 - phy-mode = "rgmii"; 54 + phy-mode = "rgmii-id"; 55 55 phy-reset-duration = <10>; 56 56 phy-reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; 57 57 status = "okay";
+1 -1
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
··· 292 292 &fec { 293 293 pinctrl-names = "default"; 294 294 pinctrl-0 = <&pinctrl_enet>; 295 - phy-mode = "rgmii"; 295 + phy-mode = "rgmii-id"; 296 296 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>, 297 297 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>; 298 298 fsl,err006687-workaround-present;
+1 -1
arch/arm/boot/dts/imx6qdl-sabresd.dtsi
··· 202 202 &fec { 203 203 pinctrl-names = "default"; 204 204 pinctrl-0 = <&pinctrl_enet>; 205 - phy-mode = "rgmii"; 205 + phy-mode = "rgmii-id"; 206 206 phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; 207 207 status = "okay"; 208 208 };
+1 -1
arch/arm/boot/dts/imx6qdl-sr-som.dtsi
··· 53 53 &fec { 54 54 pinctrl-names = "default"; 55 55 pinctrl-0 = <&pinctrl_microsom_enet_ar8035>; 56 - phy-mode = "rgmii"; 56 + phy-mode = "rgmii-id"; 57 57 phy-reset-duration = <2>; 58 58 phy-reset-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>; 59 59 status = "okay";
+1 -1
arch/arm/boot/dts/imx6qdl-wandboard.dtsi
··· 224 224 &fec { 225 225 pinctrl-names = "default"; 226 226 pinctrl-0 = <&pinctrl_enet>; 227 - phy-mode = "rgmii"; 227 + phy-mode = "rgmii-id"; 228 228 phy-reset-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>; 229 229 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>, 230 230 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
+1 -1
arch/arm/boot/dts/imx6sx-sabreauto.dts
··· 75 75 &fec1 { 76 76 pinctrl-names = "default"; 77 77 pinctrl-0 = <&pinctrl_enet1>; 78 - phy-mode = "rgmii"; 78 + phy-mode = "rgmii-id"; 79 79 phy-handle = <&ethphy1>; 80 80 fsl,magic-packet; 81 81 status = "okay";
+1 -1
arch/arm/boot/dts/imx6sx-sdb.dtsi
··· 191 191 pinctrl-names = "default"; 192 192 pinctrl-0 = <&pinctrl_enet1>; 193 193 phy-supply = <&reg_enet_3v3>; 194 - phy-mode = "rgmii"; 194 + phy-mode = "rgmii-id"; 195 195 phy-handle = <&ethphy1>; 196 196 phy-reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; 197 197 status = "okay";
+1 -1
arch/arm/boot/dts/imx7d-pico.dtsi
··· 92 92 <&clks IMX7D_ENET1_TIME_ROOT_CLK>; 93 93 assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>; 94 94 assigned-clock-rates = <0>, <100000000>; 95 - phy-mode = "rgmii"; 95 + phy-mode = "rgmii-id"; 96 96 phy-handle = <&ethphy0>; 97 97 fsl,magic-packet; 98 98 phy-reset-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
+109
arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts
··· 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Device Tree file for Linksys NSLU2 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include "intel-ixp42x.dtsi" 9 + #include <dt-bindings/input/input.h> 10 + 11 + / { 12 + model = "Linksys NSLU2 (Network Storage Link for USB 2.0 Disk Drives)"; 13 + compatible = "linksys,nslu2", "intel,ixp42x"; 14 + #address-cells = <1>; 15 + #size-cells = <1>; 16 + 17 + memory@0 { 18 + /* 32 MB SDRAM */ 19 + device_type = "memory"; 20 + reg = <0x00000000 0x2000000>; 21 + }; 22 + 23 + chosen { 24 + bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait"; 25 + stdout-path = "uart0:115200n8"; 26 + }; 27 + 28 + aliases { 29 + serial0 = &uart0; 30 + }; 31 + 32 + leds { 33 + compatible = "gpio-leds"; 34 + led-status { 35 + label = "nslu2:red:status"; 36 + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; 37 + default-state = "on"; 38 + linux,default-trigger = "heartbeat"; 39 + }; 40 + led-ready { 41 + label = "nslu2:green:ready"; 42 + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; 43 + default-state = "on"; 44 + }; 45 + led-disk-1 { 46 + label = "nslu2:green:disk-1"; 47 + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; 48 + default-state = "off"; 49 + }; 50 + led-disk-2 { 51 + label = "nslu2:green:disk-2"; 52 + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; 53 + default-state = "off"; 54 + }; 55 + }; 56 + 57 + gpio_keys { 58 + compatible = "gpio-keys"; 59 + 60 + button-power { 61 + wakeup-source; 62 + linux,code = <KEY_POWER>; 63 + label = "power"; 64 + gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; 65 + }; 66 + button-reset { 67 + wakeup-source; 68 + linux,code = <KEY_ESC>; 69 + label = "reset"; 70 + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; 71 + }; 72 + }; 73 + 74 + i2c { 75 + compatible = "i2c-gpio"; 76 + sda-gpios = <&gpio0 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 77 + scl-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 78 + #address-cells = <1>; 79 + #size-cells = <0>; 80 + 81 + rtc@6f { 82 + compatible = "xicor,x1205"; 83 + reg = <0x6f>; 84 + }; 85 + }; 86 + 87 + gpio-poweroff { 88 + compatible = "gpio-poweroff"; 89 + gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; 90 + timeout-ms = <5000>; 91 + }; 92 + 93 + /* The first 16MB region on the expansion bus */ 94 + flash@50000000 { 95 + compatible = "intel,ixp4xx-flash", "cfi-flash"; 96 + bank-width = <2>; 97 + /* 98 + * 8 MB of Flash in 0x20000 byte blocks 99 + * mapped in at 0x50000000 100 + */ 101 + reg = <0x50000000 0x800000>; 102 + 103 + partitions { 104 + compatible = "redboot-fis"; 105 + /* Eraseblock at 0x7e0000 */ 106 + fis-index-block = <0x3f>; 107 + }; 108 + }; 109 + };
+25
arch/arm/boot/dts/intel-ixp42x.dtsi
··· 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Device Tree file for Intel XScale Network Processors 4 + * in the IXP 42x series. This series has 32 interrupts. 5 + */ 6 + #include "intel-ixp4xx.dtsi" 7 + 8 + / { 9 + soc { 10 + interrupt-controller@c8003000 { 11 + compatible = "intel,ixp42x-interrupt"; 12 + }; 13 + 14 + /* 15 + * This is the USB Device Mode (UDC) controller, which is used 16 + * to present the IXP4xx as a device on a USB bus. 17 + */ 18 + usb@c800b000 { 19 + compatible = "intel,ixp4xx-udc"; 20 + reg = <0xc800b000 0x1000>; 21 + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; 22 + status = "disabled"; 23 + }; 24 + }; 25 + };
+94
arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts
··· 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Device Tree file for Gateworks IXP43x-based Cambria GW2358 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include "intel-ixp43x.dtsi" 9 + 10 + / { 11 + model = "Gateworks Cambria GW2358"; 12 + compatible = "gateworks,gw2358", "intel,ixp43x"; 13 + #address-cells = <1>; 14 + #size-cells = <1>; 15 + 16 + memory@0 { 17 + /* 128 MB SDRAM */ 18 + device_type = "memory"; 19 + reg = <0x00000000 0x8000000>; 20 + }; 21 + 22 + chosen { 23 + bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait"; 24 + stdout-path = "uart0:115200n8"; 25 + }; 26 + 27 + aliases { 28 + serial0 = &uart0; 29 + }; 30 + 31 + leds { 32 + compatible = "gpio-leds"; 33 + led-user { 34 + label = "gw2358:green:LED"; 35 + gpios = <&pld1 0 GPIO_ACTIVE_LOW>; 36 + default-state = "on"; 37 + linux,default-trigger = "heartbeat"; 38 + }; 39 + }; 40 + 41 + 42 + i2c { 43 + compatible = "i2c-gpio"; 44 + sda-gpios = <&gpio0 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 45 + scl-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 46 + #address-cells = <1>; 47 + #size-cells = <0>; 48 + 49 + hwmon@28 { 50 + compatible = "adi,ad7418"; 51 + reg = <0x28>; 52 + }; 53 + rtc: ds1672@68 { 54 + compatible = "dallas,ds1672"; 55 + reg = <0x68>; 56 + }; 57 + eeprom@51 { 58 + compatible = "atmel,24c08"; 59 + reg = <0x51>; 60 + pagesize = <16>; 61 + size = <1024>; 62 + read-only; 63 + }; 64 + pld0: pld@56 { 65 + compatible = "gateworks,pld-gpio"; 66 + reg = <0x56>; 67 + gpio-controller; 68 + #gpio-cells = <2>; 69 + }; 70 + /* This PLD just handles the LED and user button */ 71 + pld1: pld@57 { 72 + compatible = "gateworks,pld-gpio"; 73 + reg = <0x57>; 74 + gpio-controller; 75 + #gpio-cells = <2>; 76 + }; 77 + }; 78 + 79 + flash@50000000 { 80 + compatible = "intel,ixp4xx-flash", "cfi-flash"; 81 + bank-width = <2>; 82 + /* 83 + * 32 MB of Flash in 0x20000 byte blocks 84 + * mapped in at 0x50000000 85 + */ 86 + reg = <0x50000000 0x2000000>; 87 + 88 + partitions { 89 + compatible = "redboot-fis"; 90 + /* Eraseblock at 0x1fe0000 */ 91 + fis-index-block = <0xff>; 92 + }; 93 + }; 94 + };
+15
arch/arm/boot/dts/intel-ixp43x.dtsi
··· 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Device Tree file for Intel XScale Network Processors 4 + * in the IXP 43x series. This series has 64 interrupts and adds a few more 5 + * peripherals over the 42x series. 6 + */ 7 + #include "intel-ixp4xx.dtsi" 8 + 9 + / { 10 + soc { 11 + interrupt-controller@c8003000 { 12 + compatible = "intel,ixp43x-interrupt"; 13 + }; 14 + }; 15 + };
+34
arch/arm/boot/dts/intel-ixp45x-ixp46x.dtsi
··· 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Device Tree file for Intel XScale Network Processors 4 + * in the IXP45x and IXP46x series. This series has 64 interrupts and adds a 5 + * few more peripherals over the 42x and 43x series so this extends the 6 + * basic IXP4xx DTSI. 7 + */ 8 + #include "intel-ixp4xx.dtsi" 9 + 10 + / { 11 + soc { 12 + interrupt-controller@c8003000 { 13 + compatible = "intel,ixp43x-interrupt"; 14 + }; 15 + 16 + /* 17 + * This is the USB Device Mode (UDC) controller, which is used 18 + * to present the IXP4xx as a device on a USB bus. 19 + */ 20 + usb@c800b000 { 21 + compatible = "intel,ixp4xx-udc"; 22 + reg = <0xc800b000 0x1000>; 23 + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; 24 + status = "disabled"; 25 + }; 26 + 27 + i2c@c8011000 { 28 + compatible = "intel,ixp4xx-i2c"; 29 + reg = <0xc8011000 0x18>; 30 + interrupts = <33 IRQ_TYPE_LEVEL_HIGH>; 31 + status = "disabled"; 32 + }; 33 + }; 34 + };
+69
arch/arm/boot/dts/intel-ixp4xx.dtsi
··· 1 + // SPDX-License-Identifier: ISC 2 + /* 3 + * Device Tree file for Intel XScale Network Processors 4 + * in the IXP 4xx series. 5 + */ 6 + #include <dt-bindings/interrupt-controller/irq.h> 7 + #include <dt-bindings/gpio/gpio.h> 8 + 9 + / { 10 + soc { 11 + #address-cells = <1>; 12 + #size-cells = <1>; 13 + ranges; 14 + compatible = "simple-bus"; 15 + interrupt-parent = <&intcon>; 16 + 17 + qmgr: queue-manager@60000000 { 18 + compatible = "intel,ixp4xx-ahb-queue-manager"; 19 + reg = <0x60000000 0x4000>; 20 + interrupts = <3 IRQ_TYPE_LEVEL_HIGH>, <4 IRQ_TYPE_LEVEL_HIGH>; 21 + }; 22 + 23 + uart0: serial@c8000000 { 24 + compatible = "intel,xscale-uart"; 25 + reg = <0xc8000000 0x1000>; 26 + /* 27 + * The reg-offset and reg-shift is a side effect 28 + * of running the platform in big endian mode. 29 + */ 30 + reg-offset = <3>; 31 + reg-shift = <2>; 32 + interrupts = <15 IRQ_TYPE_LEVEL_HIGH>; 33 + clock-frequency = <14745600>; 34 + no-loopback-test; 35 + }; 36 + 37 + gpio0: gpio@c8004000 { 38 + compatible = "intel,ixp4xx-gpio"; 39 + reg = <0xc8004000 0x1000>; 40 + gpio-controller; 41 + #gpio-cells = <2>; 42 + interrupt-controller; 43 + #interrupt-cells = <2>; 44 + }; 45 + 46 + intcon: interrupt-controller@c8003000 { 47 + /* 48 + * Note: no compatible string. The subvariant of the 49 + * chip needs to define what version it is. The 50 + * location of the interrupt controller is fixed in 51 + * memory across all variants. 52 + */ 53 + reg = <0xc8003000 0x100>; 54 + interrupt-controller; 55 + #interrupt-cells = <2>; 56 + }; 57 + 58 + timer@c8005000 { 59 + compatible = "intel,ixp4xx-timer"; 60 + reg = <0xc8005000 0x100>; 61 + interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; 62 + }; 63 + 64 + npe@c8006000 { 65 + compatible = "intel,ixp4xx-network-processing-engine"; 66 + reg = <0xc8006000 0x1000>, <0xc8007000 0x1000>, <0xc8008000 0x1000>; 67 + }; 68 + }; 69 + };
+8 -1
arch/arm/boot/dts/ls1021a-twr.dts
··· 145 145 }; 146 146 147 147 &enet0 { 148 - tbi-handle = <&tbi1>; 148 + tbi-handle = <&tbi0>; 149 149 phy-handle = <&sgmii_phy2>; 150 150 phy-connection-type = "sgmii"; 151 151 status = "okay"; ··· 225 225 sgmii_phy2: ethernet-phy@2 { 226 226 reg = <0x2>; 227 227 }; 228 + tbi0: tbi-phy@1f { 229 + reg = <0x1f>; 230 + device_type = "tbi-phy"; 231 + }; 232 + }; 233 + 234 + &mdio1 { 228 235 tbi1: tbi-phy@1f { 229 236 reg = <0x1f>; 230 237 device_type = "tbi-phy";
+10 -1
arch/arm/boot/dts/ls1021a.dtsi
··· 729 729 }; 730 730 731 731 mdio0: mdio@2d24000 { 732 - compatible = "gianfar"; 732 + compatible = "fsl,etsec2-mdio"; 733 733 device_type = "mdio"; 734 734 #address-cells = <1>; 735 735 #size-cells = <0>; 736 736 reg = <0x0 0x2d24000 0x0 0x4000>, 737 737 <0x0 0x2d10030 0x0 0x4>; 738 + }; 739 + 740 + mdio1: mdio@2d64000 { 741 + compatible = "fsl,etsec2-mdio"; 742 + device_type = "mdio"; 743 + #address-cells = <1>; 744 + #size-cells = <0>; 745 + reg = <0x0 0x2d64000 0x0 0x4000>, 746 + <0x0 0x2d50030 0x0 0x4>; 738 747 }; 739 748 740 749 ptp_clock@2d10e00 {
+2
arch/arm/boot/dts/sun8i-a23-a33.dtsi
··· 169 169 clock-names = "ahb", "mod"; 170 170 resets = <&ccu RST_BUS_NAND>; 171 171 reset-names = "ahb"; 172 + pinctrl-names = "default"; 173 + pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>; 172 174 status = "disabled"; 173 175 #address-cells = <1>; 174 176 #size-cells = <0>;
-1
arch/arm/configs/exynos_defconfig
··· 9 9 CONFIG_PARTITION_ADVANCED=y 10 10 CONFIG_ARCH_EXYNOS=y 11 11 CONFIG_ARCH_EXYNOS3=y 12 - CONFIG_EXYNOS5420_MCPM=y 13 12 CONFIG_SMP=y 14 13 CONFIG_BIG_LITTLE=y 15 14 CONFIG_NR_CPUS=8
-1
arch/arm/configs/multi_v7_defconfig
··· 33 33 CONFIG_MACH_BERLIN_BG2Q=y 34 34 CONFIG_ARCH_DIGICOLOR=y 35 35 CONFIG_ARCH_EXYNOS=y 36 - CONFIG_EXYNOS5420_MCPM=y 37 36 CONFIG_ARCH_HIGHBANK=y 38 37 CONFIG_ARCH_HISI=y 39 38 CONFIG_ARCH_HI3xxx=y
-29
arch/arm/firmware/Kconfig
··· 1 - config ARCH_SUPPORTS_FIRMWARE 2 - bool 3 - 4 - config ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 5 - bool 6 - select ARCH_SUPPORTS_FIRMWARE 7 - 8 - menu "Firmware options" 9 - depends on ARCH_SUPPORTS_FIRMWARE 10 - 11 - config TRUSTED_FOUNDATIONS 12 - bool "Trusted Foundations secure monitor support" 13 - depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 14 - default y 15 - help 16 - Some devices (including most Tegra-based consumer devices on the 17 - market) are booted with the Trusted Foundations secure monitor 18 - active, requiring some core operations to be performed by the secure 19 - monitor instead of the kernel. 20 - 21 - This option allows the kernel to invoke the secure monitor whenever 22 - required on devices using Trusted Foundations. See 23 - arch/arm/include/asm/trusted_foundations.h or the 24 - tlm,trusted-foundations device tree binding documentation for details 25 - on how to use it. 26 - 27 - Say n if you don't know what this is about. 28 - 29 - endmenu
-4
arch/arm/firmware/Makefile
··· 1 - obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o 2 - 3 - # tf_generic_smc() fails to build with -fsanitize-coverage=trace-pc 4 - KCOV_INSTRUMENT := n
+76 -3
arch/arm/firmware/trusted_foundations.c drivers/firmware/trusted_foundations.c
··· 17 17 #include <linux/kernel.h> 18 18 #include <linux/init.h> 19 19 #include <linux/of.h> 20 + 21 + #include <linux/firmware/trusted_foundations.h> 22 + 20 23 #include <asm/firmware.h> 21 - #include <asm/trusted_foundations.h> 24 + #include <asm/hardware/cache-l2x0.h> 25 + #include <asm/outercache.h> 26 + 27 + #define TF_CACHE_MAINT 0xfffff100 28 + 29 + #define TF_CACHE_ENABLE 1 30 + #define TF_CACHE_DISABLE 2 22 31 23 32 #define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200 24 33 ··· 69 60 return 0; 70 61 } 71 62 72 - static int tf_prepare_idle(void) 63 + static int tf_prepare_idle(unsigned long mode) 73 64 { 74 - tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S1_NOFLUSH_L2, cpu_boot_addr); 65 + switch (mode) { 66 + case TF_PM_MODE_LP0: 67 + tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S3, cpu_boot_addr); 68 + break; 69 + 70 + case TF_PM_MODE_LP1: 71 + tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S2, cpu_boot_addr); 72 + break; 73 + 74 + case TF_PM_MODE_LP1_NO_MC_CLK: 75 + tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S2_NO_MC_CLK, 76 + cpu_boot_addr); 77 + break; 78 + 79 + case TF_PM_MODE_LP2: 80 + tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S1, cpu_boot_addr); 81 + break; 82 + 83 + case TF_PM_MODE_LP2_NOFLUSH_L2: 84 + tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S1_NOFLUSH_L2, 85 + cpu_boot_addr); 86 + break; 87 + 88 + default: 89 + return -EINVAL; 90 + } 75 91 76 92 return 0; 77 93 } 78 94 95 + #ifdef CONFIG_CACHE_L2X0 96 + static void tf_cache_write_sec(unsigned long val, unsigned int reg) 97 + { 98 + u32 l2x0_way_mask = 0xff; 99 + 100 + switch (reg) { 101 + case L2X0_CTRL: 102 + if (l2x0_saved_regs.aux_ctrl & L310_AUX_CTRL_ASSOCIATIVITY_16) 103 + l2x0_way_mask = 0xffff; 104 + 105 + if (val == L2X0_CTRL_EN) 106 + tf_generic_smc(TF_CACHE_MAINT, TF_CACHE_ENABLE, 107 + l2x0_saved_regs.aux_ctrl); 108 + else 109 + tf_generic_smc(TF_CACHE_MAINT, TF_CACHE_DISABLE, 110 + l2x0_way_mask); 111 + break; 112 + 113 + default: 114 + break; 115 + } 116 + } 117 + 118 + static int tf_init_cache(void) 119 + { 120 + outer_cache.write_sec = tf_cache_write_sec; 121 + 122 + return 0; 123 + } 124 + #endif /* CONFIG_CACHE_L2X0 */ 125 + 79 126 static const struct firmware_ops trusted_foundations_ops = { 80 127 .set_cpu_boot_addr = tf_set_cpu_boot_addr, 81 128 .prepare_idle = tf_prepare_idle, 129 + #ifdef CONFIG_CACHE_L2X0 130 + .l2x0_init = tf_init_cache, 131 + #endif 82 132 }; 83 133 84 134 void register_trusted_foundations(struct trusted_foundations_platform_data *pd) ··· 168 100 if (err != 0) 169 101 panic("Trusted Foundation: missing version-minor property\n"); 170 102 register_trusted_foundations(&pdata); 103 + } 104 + 105 + bool trusted_foundations_registered(void) 106 + { 107 + return firmware_ops == &trusted_foundations_ops; 171 108 }
+1 -1
arch/arm/include/asm/firmware.h
··· 24 24 /* 25 25 * Inform the firmware we intend to enter CPU idle mode 26 26 */ 27 - int (*prepare_idle)(void); 27 + int (*prepare_idle)(unsigned long mode); 28 28 /* 29 29 * Enters CPU idle mode 30 30 */
+25 -2
arch/arm/include/asm/trusted_foundations.h include/linux/firmware/trusted_foundations.h
··· 23 23 * PSCI standard. 24 24 */ 25 25 26 - #ifndef __ASM_ARM_TRUSTED_FOUNDATIONS_H 27 - #define __ASM_ARM_TRUSTED_FOUNDATIONS_H 26 + #ifndef __FIRMWARE_TRUSTED_FOUNDATIONS_H 27 + #define __FIRMWARE_TRUSTED_FOUNDATIONS_H 28 28 29 29 #include <linux/printk.h> 30 30 #include <linux/bug.h> 31 31 #include <linux/of.h> 32 32 #include <linux/cpu.h> 33 33 #include <linux/smp.h> 34 + #include <linux/types.h> 35 + 36 + #include <asm/hardware/cache-l2x0.h> 37 + #include <asm/outercache.h> 38 + 39 + #define TF_PM_MODE_LP0 0 40 + #define TF_PM_MODE_LP1 1 41 + #define TF_PM_MODE_LP1_NO_MC_CLK 2 42 + #define TF_PM_MODE_LP2 3 43 + #define TF_PM_MODE_LP2_NOFLUSH_L2 4 34 44 35 45 struct trusted_foundations_platform_data { 36 46 unsigned int version_major; ··· 51 41 52 42 void register_trusted_foundations(struct trusted_foundations_platform_data *pd); 53 43 void of_register_trusted_foundations(void); 44 + bool trusted_foundations_registered(void); 54 45 55 46 #else /* CONFIG_TRUSTED_FOUNDATIONS */ 47 + static inline void tf_dummy_write_sec(unsigned long val, unsigned int reg) 48 + { 49 + } 56 50 57 51 static inline void register_trusted_foundations( 58 52 struct trusted_foundations_platform_data *pd) ··· 67 53 */ 68 54 pr_err("No support for Trusted Foundations, continuing in degraded mode.\n"); 69 55 pr_err("Secondary processors as well as CPU PM will be disabled.\n"); 56 + #if IS_ENABLED(CONFIG_CACHE_L2X0) 57 + pr_err("L2X0 cache will be kept disabled.\n"); 58 + outer_cache.write_sec = tf_dummy_write_sec; 59 + #endif 70 60 #if IS_ENABLED(CONFIG_SMP) 71 61 setup_max_cpus = 0; 72 62 #endif ··· 85 67 */ 86 68 if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations")) 87 69 register_trusted_foundations(NULL); 70 + } 71 + 72 + static inline bool trusted_foundations_registered(void) 73 + { 74 + return false; 88 75 } 89 76 #endif /* CONFIG_TRUSTED_FOUNDATIONS */ 90 77
+48 -3
arch/arm/mach-davinci/board-da830-evm.c
··· 29 29 #include <linux/platform_data/spi-davinci.h> 30 30 #include <linux/platform_data/usb-davinci.h> 31 31 #include <linux/platform_data/ti-aemif.h> 32 + #include <linux/regulator/fixed.h> 32 33 #include <linux/regulator/machine.h> 33 34 #include <linux/nvmem-provider.h> 34 35 ··· 54 53 -1 55 54 }; 56 55 57 - static struct gpiod_lookup_table da830_evm_usb_gpio_lookup = { 56 + static struct regulator_consumer_supply da830_evm_usb_supplies[] = { 57 + REGULATOR_SUPPLY("vbus", NULL), 58 + }; 59 + 60 + static struct regulator_init_data da830_evm_usb_vbus_data = { 61 + .consumer_supplies = da830_evm_usb_supplies, 62 + .num_consumer_supplies = ARRAY_SIZE(da830_evm_usb_supplies), 63 + }; 64 + 65 + static struct fixed_voltage_config da830_evm_usb_vbus = { 66 + .supply_name = "vbus", 67 + .microvolts = 33000000, 68 + .init_data = &da830_evm_usb_vbus_data, 69 + }; 70 + 71 + static struct platform_device da830_evm_usb_vbus_device = { 72 + .name = "reg-fixed-voltage", 73 + .id = 0, 74 + .dev = { 75 + .platform_data = &da830_evm_usb_vbus, 76 + }, 77 + }; 78 + 79 + static struct gpiod_lookup_table da830_evm_usb_oc_gpio_lookup = { 58 80 .dev_id = "ohci-da8xx", 59 81 .table = { 60 - GPIO_LOOKUP("davinci_gpio", ON_BD_USB_DRV, "vbus", 0), 61 82 GPIO_LOOKUP("davinci_gpio", ON_BD_USB_OVC, "oc", 0), 83 + { } 62 84 }, 85 + }; 86 + 87 + static struct gpiod_lookup_table da830_evm_usb_vbus_gpio_lookup = { 88 + .dev_id = "reg-fixed-voltage.0", 89 + .table = { 90 + GPIO_LOOKUP("davinci_gpio", ON_BD_USB_DRV, "vbus", 0), 91 + { } 92 + }, 93 + }; 94 + 95 + static struct gpiod_lookup_table *da830_evm_usb_gpio_lookups[] = { 96 + &da830_evm_usb_oc_gpio_lookup, 97 + &da830_evm_usb_vbus_gpio_lookup, 63 98 }; 64 99 65 100 static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = { ··· 111 74 if (ret) 112 75 pr_warn("%s: USB PHY CLK registration failed: %d\n", 113 76 __func__, ret); 77 + 78 + gpiod_add_lookup_tables(da830_evm_usb_gpio_lookups, 79 + ARRAY_SIZE(da830_evm_usb_gpio_lookups)); 114 80 115 81 ret = da8xx_register_usb_phy(); 116 82 if (ret) ··· 140 100 return; 141 101 } 142 102 143 - gpiod_add_lookup_table(&da830_evm_usb_gpio_lookup); 103 + ret = platform_device_register(&da830_evm_usb_vbus_device); 104 + if (ret) { 105 + pr_warn("%s: Unable to register the vbus supply\n", __func__); 106 + return; 107 + } 144 108 145 109 ret = da8xx_register_usb11(&da830_evm_usb11_pdata); 146 110 if (ret) ··· 200 156 GPIO_ACTIVE_LOW), 201 157 GPIO_LOOKUP("davinci_gpio", DA830_MMCSD_WP_PIN, "wp", 202 158 GPIO_ACTIVE_LOW), 159 + { } 203 160 }, 204 161 }; 205 162
+1
arch/arm/mach-davinci/board-da850-evm.c
··· 784 784 GPIO_ACTIVE_LOW), 785 785 GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_WP_PIN, "wp", 786 786 GPIO_ACTIVE_HIGH), 787 + { } 787 788 }, 788 789 }; 789 790
+1
arch/arm/mach-davinci/board-dm355-evm.c
··· 121 121 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), 122 122 GPIO_LOOKUP("davinci_gpio", DM355_I2C_SCL_PIN, "scl", 123 123 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), 124 + { } 124 125 }, 125 126 }; 126 127
+1
arch/arm/mach-davinci/board-dm644x-evm.c
··· 663 663 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), 664 664 GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SCL_PIN, "scl", 665 665 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), 666 + { } 666 667 }, 667 668 }; 668 669
+47 -3
arch/arm/mach-davinci/board-omapl138-hawk.c
··· 21 21 #include <linux/platform_data/mtd-davinci.h> 22 22 #include <linux/platform_data/mtd-davinci-aemif.h> 23 23 #include <linux/platform_data/ti-aemif.h> 24 + #include <linux/regulator/fixed.h> 24 25 #include <linux/regulator/machine.h> 25 26 26 27 #include <asm/mach-types.h> ··· 299 298 -1 300 299 }; 301 300 302 - static struct gpiod_lookup_table hawk_usb_gpio_lookup = { 301 + static struct regulator_consumer_supply hawk_usb_supplies[] = { 302 + REGULATOR_SUPPLY("vbus", NULL), 303 + }; 304 + 305 + static struct regulator_init_data hawk_usb_vbus_data = { 306 + .consumer_supplies = hawk_usb_supplies, 307 + .num_consumer_supplies = ARRAY_SIZE(hawk_usb_supplies), 308 + }; 309 + 310 + static struct fixed_voltage_config hawk_usb_vbus = { 311 + .supply_name = "vbus", 312 + .microvolts = 3300000, 313 + .init_data = &hawk_usb_vbus_data, 314 + }; 315 + 316 + static struct platform_device hawk_usb_vbus_device = { 317 + .name = "reg-fixed-voltage", 318 + .id = 0, 319 + .dev = { 320 + .platform_data = &hawk_usb_vbus, 321 + }, 322 + }; 323 + 324 + static struct gpiod_lookup_table hawk_usb_oc_gpio_lookup = { 303 325 .dev_id = "ohci-da8xx", 304 326 .table = { 305 - GPIO_LOOKUP("davinci_gpio", DA850_USB1_VBUS_PIN, "vbus", 0), 306 327 GPIO_LOOKUP("davinci_gpio", DA850_USB1_OC_PIN, "oc", 0), 328 + { } 307 329 }, 330 + }; 331 + 332 + static struct gpiod_lookup_table hawk_usb_vbus_gpio_lookup = { 333 + .dev_id = "reg-fixed-voltage.0", 334 + .table = { 335 + GPIO_LOOKUP("davinci_gpio", DA850_USB1_VBUS_PIN, NULL, 0), 336 + { } 337 + }, 338 + }; 339 + 340 + static struct gpiod_lookup_table *hawk_usb_gpio_lookups[] = { 341 + &hawk_usb_oc_gpio_lookup, 342 + &hawk_usb_vbus_gpio_lookup, 308 343 }; 309 344 310 345 static struct da8xx_ohci_root_hub omapl138_hawk_usb11_pdata = { ··· 363 326 pr_warn("%s: USB PHY CLK registration failed: %d\n", 364 327 __func__, ret); 365 328 329 + gpiod_add_lookup_tables(hawk_usb_gpio_lookups, 330 + ARRAY_SIZE(hawk_usb_gpio_lookups)); 331 + 366 332 ret = da8xx_register_usb_phy(); 367 333 if (ret) 368 334 pr_warn("%s: USB PHY registration failed: %d\n", 369 335 __func__, ret); 370 336 371 - gpiod_add_lookup_table(&hawk_usb_gpio_lookup); 337 + ret = platform_device_register(&hawk_usb_vbus_device); 338 + if (ret) { 339 + pr_warn("%s: Unable to register the vbus supply\n", __func__); 340 + return; 341 + } 372 342 373 343 ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata); 374 344 if (ret)
+1 -1
arch/arm/mach-ep93xx/adssphere.c
··· 15 15 #include <linux/platform_device.h> 16 16 #include <linux/sizes.h> 17 17 18 - #include <mach/hardware.h> 18 + #include "hardware.h" 19 19 20 20 #include <asm/mach-types.h> 21 21 #include <asm/mach/arch.h>
+2 -1
arch/arm/mach-ep93xx/clock.c
··· 20 20 #include <linux/io.h> 21 21 #include <linux/spinlock.h> 22 22 #include <linux/clkdev.h> 23 + #include <linux/soc/cirrus/ep93xx.h> 23 24 24 - #include <mach/hardware.h> 25 + #include "hardware.h" 25 26 26 27 #include <asm/div64.h> 27 28
+5 -3
arch/arm/mach-ep93xx/core.c
··· 39 39 #include <linux/usb/ohci_pdriver.h> 40 40 #include <linux/random.h> 41 41 42 - #include <mach/hardware.h> 42 + #include "hardware.h" 43 43 #include <linux/platform_data/video-ep93xx.h> 44 44 #include <linux/platform_data/keypad-ep93xx.h> 45 45 #include <linux/platform_data/spi-ep93xx.h> 46 - #include <mach/gpio-ep93xx.h> 46 + #include <linux/soc/cirrus/ep93xx.h> 47 + 48 + #include "gpio-ep93xx.h" 47 49 48 50 #include <asm/mach/arch.h> 49 51 #include <asm/mach/map.h> ··· 125 123 /** 126 124 * ep93xx_chip_revision() - returns the EP93xx chip revision 127 125 * 128 - * See <mach/platform.h> for more information. 126 + * See "platform.h" for more information. 129 127 */ 130 128 unsigned int ep93xx_chip_revision(void) 131 129 {
+1 -1
arch/arm/mach-ep93xx/dma.c
··· 26 26 #include <linux/platform_device.h> 27 27 28 28 #include <linux/platform_data/dma-ep93xx.h> 29 - #include <mach/hardware.h> 29 + #include "hardware.h" 30 30 31 31 #include "soc.h" 32 32
+2 -2
arch/arm/mach-ep93xx/edb93xx.c
··· 33 33 34 34 #include <sound/cs4271.h> 35 35 36 - #include <mach/hardware.h> 36 + #include "hardware.h" 37 37 #include <linux/platform_data/video-ep93xx.h> 38 38 #include <linux/platform_data/spi-ep93xx.h> 39 - #include <mach/gpio-ep93xx.h> 39 + #include "gpio-ep93xx.h" 40 40 41 41 #include <asm/mach-types.h> 42 42 #include <asm/mach/arch.h>
+1 -1
arch/arm/mach-ep93xx/gesbc9312.c
··· 15 15 #include <linux/platform_device.h> 16 16 #include <linux/sizes.h> 17 17 18 - #include <mach/hardware.h> 18 + #include "hardware.h" 19 19 20 20 #include <asm/mach-types.h> 21 21 #include <asm/mach/arch.h>
arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h arch/arm/mach-ep93xx/gpio-ep93xx.h
+1 -1
arch/arm/mach-ep93xx/include/mach/hardware.h arch/arm/mach-ep93xx/hardware.h
··· 6 6 #ifndef __ASM_ARCH_HARDWARE_H 7 7 #define __ASM_ARCH_HARDWARE_H 8 8 9 - #include <mach/platform.h> 9 + #include "platform.h" 10 10 11 11 /* 12 12 * The EP93xx has two external crystal oscillators. To generate the
+1 -22
arch/arm/mach-ep93xx/include/mach/platform.h arch/arm/mach-ep93xx/platform.h
··· 5 5 6 6 #ifndef __ASSEMBLY__ 7 7 8 + #include <linux/platform_data/eth-ep93xx.h> 8 9 #include <linux/reboot.h> 9 10 10 11 struct device; ··· 16 15 struct ep93xx_keypad_platform_data; 17 16 struct ep93xx_spi_info; 18 17 19 - struct ep93xx_eth_data 20 - { 21 - unsigned char dev_addr[6]; 22 - unsigned char phy_id; 23 - }; 24 - 25 18 void ep93xx_map_io(void); 26 19 void ep93xx_init_irq(void); 27 - 28 - #define EP93XX_CHIP_REV_D0 3 29 - #define EP93XX_CHIP_REV_D1 4 30 - #define EP93XX_CHIP_REV_E0 5 31 - #define EP93XX_CHIP_REV_E1 6 32 - #define EP93XX_CHIP_REV_E2 7 33 - 34 - unsigned int ep93xx_chip_revision(void); 35 20 36 21 void ep93xx_register_flash(unsigned int width, 37 22 resource_size_t start, resource_size_t size); ··· 28 41 struct spi_board_info *devices, int num); 29 42 void ep93xx_register_fb(struct ep93xxfb_mach_info *data); 30 43 void ep93xx_register_pwm(int pwm0, int pwm1); 31 - int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); 32 - void ep93xx_pwm_release_gpio(struct platform_device *pdev); 33 44 void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data); 34 - int ep93xx_keypad_acquire_gpio(struct platform_device *pdev); 35 - void ep93xx_keypad_release_gpio(struct platform_device *pdev); 36 45 void ep93xx_register_i2s(void); 37 - int ep93xx_i2s_acquire(void); 38 - void ep93xx_i2s_release(void); 39 46 void ep93xx_register_ac97(void); 40 47 void ep93xx_register_ide(void); 41 48 void ep93xx_register_adc(void); 42 - int ep93xx_ide_acquire_gpio(struct platform_device *pdev); 43 - void ep93xx_ide_release_gpio(struct platform_device *pdev); 44 49 45 50 struct device *ep93xx_init_devices(void); 46 51 extern void ep93xx_timer_init(void);
+1 -1
arch/arm/mach-ep93xx/micro9.c
··· 16 16 #include <linux/platform_device.h> 17 17 #include <linux/io.h> 18 18 19 - #include <mach/hardware.h> 19 + #include "hardware.h" 20 20 21 21 #include <asm/mach-types.h> 22 22 #include <asm/mach/arch.h>
+2 -2
arch/arm/mach-ep93xx/simone.c
··· 27 27 #include <linux/gpio.h> 28 28 #include <linux/gpio/machine.h> 29 29 30 - #include <mach/hardware.h> 31 - #include <mach/gpio-ep93xx.h> 30 + #include "hardware.h" 31 + #include "gpio-ep93xx.h" 32 32 33 33 #include <asm/mach-types.h> 34 34 #include <asm/mach/arch.h>
+2 -2
arch/arm/mach-ep93xx/snappercl15.c
··· 25 25 26 26 #include <linux/mtd/platnand.h> 27 27 28 - #include <mach/hardware.h> 28 + #include "hardware.h" 29 29 #include <linux/platform_data/video-ep93xx.h> 30 - #include <mach/gpio-ep93xx.h> 30 + #include "gpio-ep93xx.h" 31 31 32 32 #include <asm/mach-types.h> 33 33 #include <asm/mach/arch.h>
+2 -2
arch/arm/mach-ep93xx/ts72xx.c
··· 24 24 #include <linux/platform_data/spi-ep93xx.h> 25 25 #include <linux/gpio/machine.h> 26 26 27 - #include <mach/gpio-ep93xx.h> 28 - #include <mach/hardware.h> 27 + #include "gpio-ep93xx.h" 28 + #include "hardware.h" 29 29 #include <mach/irqs.h> 30 30 31 31 #include <asm/mach-types.h>
+2 -2
arch/arm/mach-ep93xx/vision_ep9307.c
··· 31 31 32 32 #include <sound/cs4271.h> 33 33 34 - #include <mach/hardware.h> 34 + #include "hardware.h" 35 35 #include <linux/platform_data/video-ep93xx.h> 36 36 #include <linux/platform_data/spi-ep93xx.h> 37 - #include <mach/gpio-ep93xx.h> 37 + #include "gpio-ep93xx.h" 38 38 39 39 #include <asm/mach-types.h> 40 40 #include <asm/mach/map.h>
+3 -9
arch/arm/mach-exynos/Kconfig
··· 106 106 bool "SAMSUNG EXYNOS5420" 107 107 default y 108 108 depends on ARCH_EXYNOS5 109 + select MCPM if SMP 110 + select ARM_CCI400_PORT_CTRL 111 + select ARM_CPU_SUSPEND 109 112 110 113 config SOC_EXYNOS5800 111 114 bool "SAMSUNG EXYNOS5800" 112 115 default y 113 116 depends on SOC_EXYNOS5420 114 - 115 - config EXYNOS5420_MCPM 116 - bool "Exynos5420 Multi-Cluster PM support" 117 - depends on MCPM && SOC_EXYNOS5420 118 - select ARM_CCI400_PORT_CTRL 119 - select ARM_CPU_SUSPEND 120 - help 121 - This is needed to provide CPU and cluster power management 122 - on Exynos5420 implementing big.LITTLE. 123 117 124 118 config EXYNOS_CPU_SUSPEND 125 119 bool
+1 -1
arch/arm/mach-exynos/Makefile
··· 18 18 AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec) 19 19 AFLAGS_sleep.o :=-Wa,-march=armv7-a$(plus_sec) 20 20 21 - obj-$(CONFIG_EXYNOS5420_MCPM) += mcpm-exynos.o 21 + obj-$(CONFIG_MCPM) += mcpm-exynos.o 22 22 CFLAGS_mcpm-exynos.o += -march=armv7-a
+1
arch/arm/mach-exynos/common.h
··· 91 91 92 92 extern void __iomem *sysram_ns_base_addr; 93 93 extern void __iomem *sysram_base_addr; 94 + extern phys_addr_t sysram_base_phys; 94 95 extern void __iomem *pmu_base_addr; 95 96 void exynos_sysram_init(void); 96 97
+3
arch/arm/mach-exynos/exynos.c
··· 33 33 }; 34 34 35 35 void __iomem *sysram_base_addr __ro_after_init; 36 + phys_addr_t sysram_base_phys __ro_after_init; 36 37 void __iomem *sysram_ns_base_addr __ro_after_init; 37 38 38 39 void __init exynos_sysram_init(void) ··· 44 43 if (!of_device_is_available(node)) 45 44 continue; 46 45 sysram_base_addr = of_iomap(node, 0); 46 + sysram_base_phys = of_translate_address(node, 47 + of_get_address(node, 0, NULL, NULL)); 47 48 break; 48 49 } 49 50
+1
arch/arm/mach-exynos/firmware.c
··· 196 196 return false; 197 197 198 198 addr = of_get_address(nd, 0, NULL, NULL); 199 + of_node_put(nd); 199 200 if (!addr) { 200 201 pr_err("%s: No address specified.\n", __func__); 201 202 return false;
+12 -1
arch/arm/mach-exynos/mcpm-exynos.c
··· 75 75 */ 76 76 if (cluster && 77 77 cluster == MPIDR_AFFINITY_LEVEL(cpu_logical_map(0), 1)) { 78 + unsigned int timeout = 16; 79 + 78 80 /* 79 81 * Before we reset the Little cores, we should wait 80 82 * the SPARE2 register is set to 1 because the init 81 83 * codes of the iROM will set the register after 82 84 * initialization. 83 85 */ 84 - while (!pmu_raw_readl(S5P_PMU_SPARE2)) 86 + while (timeout && !pmu_raw_readl(S5P_PMU_SPARE2)) { 87 + timeout--; 85 88 udelay(10); 89 + } 90 + 91 + if (timeout == 0) { 92 + pr_err("cpu %u cluster %u powerup failed\n", 93 + cpu, cluster); 94 + exynos_cpu_power_down(cpunr); 95 + return -ETIMEDOUT; 96 + } 86 97 87 98 pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu), 88 99 EXYNOS_SWRESET);
+8 -1
arch/arm/mach-exynos/platsmp.c
··· 214 214 */ 215 215 void exynos_core_restart(u32 core_id) 216 216 { 217 + unsigned int timeout = 16; 217 218 u32 val; 218 219 219 220 if (!of_machine_is_compatible("samsung,exynos3250")) 220 221 return; 221 222 222 - while (!pmu_raw_readl(S5P_PMU_SPARE2)) 223 + while (timeout && !pmu_raw_readl(S5P_PMU_SPARE2)) { 224 + timeout--; 223 225 udelay(10); 226 + } 227 + if (timeout == 0) { 228 + pr_err("cpu core %u restart failed\n", core_id); 229 + return; 230 + } 224 231 udelay(10); 225 232 226 233 val = pmu_raw_readl(EXYNOS_ARM_CORE_STATUS(core_id));
+7
arch/arm/mach-exynos/smc.h
··· 25 25 #define SMC_CMD_L2X0INVALL (-24) 26 26 #define SMC_CMD_L2X0DEBUG (-25) 27 27 28 + /* For Accessing CP15/SFR (General) */ 29 + #define SMC_CMD_REG (-101) 30 + 31 + /* defines for SMC_CMD_REG */ 32 + #define SMC_REG_CLASS_SFR_W (0x1 << 30) 33 + #define SMC_REG_ID_SFR_W(addr) (SMC_REG_CLASS_SFR_W | ((addr) >> 2)) 34 + 28 35 #ifndef __ASSEMBLY__ 29 36 30 37 extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3);
+42 -7
arch/arm/mach-exynos/suspend.c
··· 31 31 #include <asm/suspend.h> 32 32 33 33 #include "common.h" 34 + #include "smc.h" 34 35 35 36 #define REG_TABLE_END (-1U) 36 37 ··· 63 62 int cpu_state; 64 63 unsigned int pmu_spare3; 65 64 void __iomem *sysram_base; 65 + phys_addr_t sysram_phys; 66 + bool secure_firmware; 66 67 }; 67 68 68 69 static const struct exynos_pm_data *pm_data __ro_after_init; ··· 268 265 unsigned int cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 269 266 unsigned int cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 270 267 271 - writel_relaxed(0x0, pm_state.sysram_base + EXYNOS5420_CPU_STATE); 272 - 273 - if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) { 268 + if (IS_ENABLED(CONFIG_MCPM)) { 274 269 mcpm_set_entry_vector(cpu, cluster, exynos_cpu_resume); 275 270 mcpm_cpu_suspend(); 276 271 } ··· 342 341 */ 343 342 pm_state.cpu_state = readl_relaxed(pm_state.sysram_base + 344 343 EXYNOS5420_CPU_STATE); 344 + writel_relaxed(0x0, pm_state.sysram_base + EXYNOS5420_CPU_STATE); 345 + if (pm_state.secure_firmware) 346 + exynos_smc(SMC_CMD_REG, SMC_REG_ID_SFR_W(pm_state.sysram_phys + 347 + EXYNOS5420_CPU_STATE), 348 + 0, 0); 345 349 346 350 exynos_pm_enter_sleep_mode(); 347 351 348 352 /* ensure at least INFORM0 has the resume address */ 349 - if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) 353 + if (IS_ENABLED(CONFIG_MCPM)) 350 354 pmu_raw_writel(__pa_symbol(mcpm_entry_point), S5P_INFORM0); 351 355 352 356 tmp = pmu_raw_readl(EXYNOS_L2_OPTION(0)); ··· 450 444 451 445 static void exynos5420_prepare_pm_resume(void) 452 446 { 453 - if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) 447 + unsigned int mpidr, cluster; 448 + 449 + mpidr = read_cpuid_mpidr(); 450 + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 451 + 452 + if (IS_ENABLED(CONFIG_MCPM)) 454 453 WARN_ON(mcpm_cpu_powered_up()); 454 + 455 + if (IS_ENABLED(CONFIG_HW_PERF_EVENTS) && cluster != 0) { 456 + /* 457 + * When system is resumed on the LITTLE/KFC core (cluster 1), 458 + * the DSCR is not properly updated until the power is turned 459 + * on also for the cluster 0. Enable it for a while to 460 + * propagate the SPNIDEN and SPIDEN signals from Secure JTAG 461 + * block and avoid undefined instruction issue on CP14 reset. 462 + */ 463 + pmu_raw_writel(S5P_CORE_LOCAL_PWR_EN, 464 + EXYNOS_COMMON_CONFIGURATION(0)); 465 + pmu_raw_writel(0, 466 + EXYNOS_COMMON_CONFIGURATION(0)); 467 + } 455 468 } 456 469 457 470 static void exynos5420_pm_resume(void) ··· 485 460 /* Restore the sysram cpu state register */ 486 461 writel_relaxed(pm_state.cpu_state, 487 462 pm_state.sysram_base + EXYNOS5420_CPU_STATE); 463 + if (pm_state.secure_firmware) 464 + exynos_smc(SMC_CMD_REG, 465 + SMC_REG_ID_SFR_W(pm_state.sysram_phys + 466 + EXYNOS5420_CPU_STATE), 467 + EXYNOS_AFTR_MAGIC, 0); 488 468 489 469 pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL, 490 470 S5P_CENTRAL_SEQ_OPTION); ··· 669 639 670 640 if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) { 671 641 pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); 642 + of_node_put(np); 672 643 return; 673 644 } 645 + of_node_put(np); 674 646 675 647 pm_data = (const struct exynos_pm_data *) match->data; 676 648 ··· 691 659 * Applicable as of now only to Exynos542x. If booted under secure 692 660 * firmware, the non-secure region of sysram should be used. 693 661 */ 694 - if (exynos_secure_firmware_available()) 662 + if (exynos_secure_firmware_available()) { 663 + pm_state.sysram_phys = sysram_base_phys; 695 664 pm_state.sysram_base = sysram_ns_base_addr; 696 - else 665 + pm_state.secure_firmware = true; 666 + } else { 697 667 pm_state.sysram_base = sysram_base_addr; 668 + } 698 669 }
+4 -2
arch/arm/mach-imx/pm-imx6.c
··· 354 354 * 355 355 * Note that IRQ #32 is GIC SPI #0. 356 356 */ 357 - imx_gpc_hwirq_unmask(0); 357 + if (mode != WAIT_CLOCKED) 358 + imx_gpc_hwirq_unmask(0); 358 359 writel_relaxed(val, ccm_base + CLPCR); 359 - imx_gpc_hwirq_mask(0); 360 + if (mode != WAIT_CLOCKED) 361 + imx_gpc_hwirq_mask(0); 360 362 361 363 return 0; 362 364 }
+14 -13
arch/arm/mach-ixp4xx/Kconfig
··· 4 4 5 5 comment "IXP4xx Platforms" 6 6 7 + config MACH_IXP4XX_OF 8 + bool 9 + prompt "Devce Tree IXP4xx boards" 10 + default y 11 + select ARM_APPENDED_DTB # Old Redboot bootloaders deployed 12 + select I2C 13 + select I2C_IOP3XX 14 + select PCI 15 + select SERIAL_OF_PLATFORM 16 + select TIMER_OF 17 + select USE_OF 18 + help 19 + Say 'Y' here to support Device Tree-based IXP4xx platforms. 20 + 7 21 config MACH_NSLU2 8 22 bool 9 23 prompt "Linksys NSLU2" ··· 235 221 By default, the direct method is used. Choose this option if you 236 222 need to use the indirect method instead. If you don't know 237 223 what you need, leave this option unselected. 238 - 239 - config IXP4XX_QMGR 240 - tristate "IXP4xx Queue Manager support" 241 - help 242 - This driver supports IXP4xx built-in hardware queue manager 243 - and is automatically selected by Ethernet and HSS drivers. 244 - 245 - config IXP4XX_NPE 246 - tristate "IXP4xx Network Processor Engine support" 247 - select FW_LOADER 248 - help 249 - This driver supports IXP4xx built-in network coprocessors 250 - and is automatically selected by Ethernet and HSS drivers. 251 224 252 225 endmenu 253 226
+3 -2
arch/arm/mach-ixp4xx/Makefile
··· 6 6 obj-pci-y := 7 7 obj-pci-n := 8 8 9 + # Device tree platform 10 + obj-pci-$(CONFIG_MACH_IXP4XX_OF) += ixp4xx-of.o 11 + 9 12 obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o 10 13 obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o 11 14 obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o ··· 43 40 obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o 44 41 45 42 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o 46 - obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o 47 - obj-$(CONFIG_IXP4XX_NPE) += ixp4xx_npe.o
+2
arch/arm/mach-ixp4xx/avila-pci.c
··· 27 27 #include <mach/hardware.h> 28 28 #include <asm/mach-types.h> 29 29 30 + #include "irqs.h" 31 + 30 32 #define AVILA_MAX_DEV 4 31 33 #define LOFT_MAX_DEV 6 32 34 #define IRQ_LINES 4
+2
arch/arm/mach-ixp4xx/avila-setup.c
··· 28 28 #include <asm/mach/arch.h> 29 29 #include <asm/mach/flash.h> 30 30 31 + #include "irqs.h" 32 + 31 33 #define AVILA_SDA_PIN 7 32 34 #define AVILA_SCL_PIN 6 33 35
+83 -401
arch/arm/mach-ixp4xx/common.c
··· 22 22 #include <linux/serial_core.h> 23 23 #include <linux/interrupt.h> 24 24 #include <linux/bitops.h> 25 - #include <linux/time.h> 26 - #include <linux/clocksource.h> 27 - #include <linux/clockchips.h> 28 25 #include <linux/io.h> 29 26 #include <linux/export.h> 30 - #include <linux/gpio/driver.h> 31 27 #include <linux/cpu.h> 32 28 #include <linux/pci.h> 33 29 #include <linux/sched_clock.h> 30 + #include <linux/bitops.h> 31 + #include <linux/irqchip/irq-ixp4xx.h> 32 + #include <linux/platform_data/timer-ixp4xx.h> 34 33 #include <mach/udc.h> 35 34 #include <mach/hardware.h> 36 35 #include <mach/io.h> 37 36 #include <linux/uaccess.h> 38 37 #include <asm/pgtable.h> 39 38 #include <asm/page.h> 39 + #include <asm/exception.h> 40 40 #include <asm/irq.h> 41 41 #include <asm/system_misc.h> 42 42 #include <asm/mach/map.h> 43 43 #include <asm/mach/irq.h> 44 44 #include <asm/mach/time.h> 45 45 46 + #include "irqs.h" 47 + 46 48 #define IXP4XX_TIMER_FREQ 66666000 47 - 48 - /* 49 - * The timer register doesn't allow to specify the two least significant bits of 50 - * the timeout value and assumes them being zero. So make sure IXP4XX_LATCH is 51 - * the best value with the two least significant bits unset. 52 - */ 53 - #define IXP4XX_LATCH DIV_ROUND_CLOSEST(IXP4XX_TIMER_FREQ, \ 54 - (IXP4XX_OST_RELOAD_MASK + 1) * HZ) * \ 55 - (IXP4XX_OST_RELOAD_MASK + 1) 56 - 57 - static void __init ixp4xx_clocksource_init(void); 58 - static void __init ixp4xx_clockevent_init(void); 59 - static struct clock_event_device clockevent_ixp4xx; 60 49 61 50 /************************************************************************* 62 51 * IXP4xx chipset I/O mapping ··· 66 77 .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS), 67 78 .length = IXP4XX_PCI_CFG_REGION_SIZE, 68 79 .type = MT_DEVICE 69 - }, { /* Queue Manager */ 70 - .virtual = (unsigned long)IXP4XX_QMGR_BASE_VIRT, 71 - .pfn = __phys_to_pfn(IXP4XX_QMGR_BASE_PHYS), 72 - .length = IXP4XX_QMGR_REGION_SIZE, 73 - .type = MT_DEVICE 74 80 }, 75 81 }; 76 82 ··· 74 90 iotable_init(ixp4xx_io_desc, ARRAY_SIZE(ixp4xx_io_desc)); 75 91 } 76 92 77 - /* 78 - * GPIO-functions 79 - */ 80 - /* 81 - * The following converted to the real HW bits the gpio_line_config 82 - */ 83 - /* GPIO pin types */ 84 - #define IXP4XX_GPIO_OUT 0x1 85 - #define IXP4XX_GPIO_IN 0x2 86 - 87 - /* GPIO signal types */ 88 - #define IXP4XX_GPIO_LOW 0 89 - #define IXP4XX_GPIO_HIGH 1 90 - 91 - /* GPIO Clocks */ 92 - #define IXP4XX_GPIO_CLK_0 14 93 - #define IXP4XX_GPIO_CLK_1 15 94 - 95 - static void gpio_line_config(u8 line, u32 direction) 96 - { 97 - if (direction == IXP4XX_GPIO_IN) 98 - *IXP4XX_GPIO_GPOER |= (1 << line); 99 - else 100 - *IXP4XX_GPIO_GPOER &= ~(1 << line); 101 - } 102 - 103 - static void gpio_line_get(u8 line, int *value) 104 - { 105 - *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1; 106 - } 107 - 108 - static void gpio_line_set(u8 line, int value) 109 - { 110 - if (value == IXP4XX_GPIO_HIGH) 111 - *IXP4XX_GPIO_GPOUTR |= (1 << line); 112 - else if (value == IXP4XX_GPIO_LOW) 113 - *IXP4XX_GPIO_GPOUTR &= ~(1 << line); 114 - } 115 - 116 - /************************************************************************* 117 - * IXP4xx chipset IRQ handling 118 - * 119 - * TODO: GPIO IRQs should be marked invalid until the user of the IRQ 120 - * (be it PCI or something else) configures that GPIO line 121 - * as an IRQ. 122 - **************************************************************************/ 123 - enum ixp4xx_irq_type { 124 - IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE 125 - }; 126 - 127 - /* Each bit represents an IRQ: 1: edge-triggered, 0: level triggered */ 128 - static unsigned long long ixp4xx_irq_edge = 0; 129 - 130 - /* 131 - * IRQ -> GPIO mapping table 132 - */ 133 - static signed char irq2gpio[32] = { 134 - -1, -1, -1, -1, -1, -1, 0, 1, 135 - -1, -1, -1, -1, -1, -1, -1, -1, 136 - -1, -1, -1, 2, 3, 4, 5, 6, 137 - 7, 8, 9, 10, 11, 12, -1, -1, 138 - }; 139 - 140 - static int ixp4xx_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) 141 - { 142 - int irq; 143 - 144 - for (irq = 0; irq < 32; irq++) { 145 - if (irq2gpio[irq] == gpio) 146 - return irq; 147 - } 148 - return -EINVAL; 149 - } 150 - 151 - static int ixp4xx_set_irq_type(struct irq_data *d, unsigned int type) 152 - { 153 - int line = irq2gpio[d->irq]; 154 - u32 int_style; 155 - enum ixp4xx_irq_type irq_type; 156 - volatile u32 *int_reg; 157 - 158 - /* 159 - * Only for GPIO IRQs 160 - */ 161 - if (line < 0) 162 - return -EINVAL; 163 - 164 - switch (type){ 165 - case IRQ_TYPE_EDGE_BOTH: 166 - int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL; 167 - irq_type = IXP4XX_IRQ_EDGE; 168 - break; 169 - case IRQ_TYPE_EDGE_RISING: 170 - int_style = IXP4XX_GPIO_STYLE_RISING_EDGE; 171 - irq_type = IXP4XX_IRQ_EDGE; 172 - break; 173 - case IRQ_TYPE_EDGE_FALLING: 174 - int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE; 175 - irq_type = IXP4XX_IRQ_EDGE; 176 - break; 177 - case IRQ_TYPE_LEVEL_HIGH: 178 - int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH; 179 - irq_type = IXP4XX_IRQ_LEVEL; 180 - break; 181 - case IRQ_TYPE_LEVEL_LOW: 182 - int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW; 183 - irq_type = IXP4XX_IRQ_LEVEL; 184 - break; 185 - default: 186 - return -EINVAL; 187 - } 188 - 189 - if (irq_type == IXP4XX_IRQ_EDGE) 190 - ixp4xx_irq_edge |= (1 << d->irq); 191 - else 192 - ixp4xx_irq_edge &= ~(1 << d->irq); 193 - 194 - if (line >= 8) { /* pins 8-15 */ 195 - line -= 8; 196 - int_reg = IXP4XX_GPIO_GPIT2R; 197 - } else { /* pins 0-7 */ 198 - int_reg = IXP4XX_GPIO_GPIT1R; 199 - } 200 - 201 - /* Clear the style for the appropriate pin */ 202 - *int_reg &= ~(IXP4XX_GPIO_STYLE_CLEAR << 203 - (line * IXP4XX_GPIO_STYLE_SIZE)); 204 - 205 - *IXP4XX_GPIO_GPISR = (1 << line); 206 - 207 - /* Set the new style */ 208 - *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE)); 209 - 210 - /* Configure the line as an input */ 211 - gpio_line_config(irq2gpio[d->irq], IXP4XX_GPIO_IN); 212 - 213 - return 0; 214 - } 215 - 216 - static void ixp4xx_irq_mask(struct irq_data *d) 217 - { 218 - if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && d->irq >= 32) 219 - *IXP4XX_ICMR2 &= ~(1 << (d->irq - 32)); 220 - else 221 - *IXP4XX_ICMR &= ~(1 << d->irq); 222 - } 223 - 224 - static void ixp4xx_irq_ack(struct irq_data *d) 225 - { 226 - int line = (d->irq < 32) ? irq2gpio[d->irq] : -1; 227 - 228 - if (line >= 0) 229 - *IXP4XX_GPIO_GPISR = (1 << line); 230 - } 231 - 232 - /* 233 - * Level triggered interrupts on GPIO lines can only be cleared when the 234 - * interrupt condition disappears. 235 - */ 236 - static void ixp4xx_irq_unmask(struct irq_data *d) 237 - { 238 - if (!(ixp4xx_irq_edge & (1 << d->irq))) 239 - ixp4xx_irq_ack(d); 240 - 241 - if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && d->irq >= 32) 242 - *IXP4XX_ICMR2 |= (1 << (d->irq - 32)); 243 - else 244 - *IXP4XX_ICMR |= (1 << d->irq); 245 - } 246 - 247 - static struct irq_chip ixp4xx_irq_chip = { 248 - .name = "IXP4xx", 249 - .irq_ack = ixp4xx_irq_ack, 250 - .irq_mask = ixp4xx_irq_mask, 251 - .irq_unmask = ixp4xx_irq_unmask, 252 - .irq_set_type = ixp4xx_set_irq_type, 253 - }; 254 - 255 93 void __init ixp4xx_init_irq(void) 256 94 { 257 - int i = 0; 258 - 259 95 /* 260 96 * ixp4xx does not implement the XScale PWRMODE register 261 97 * so it must not call cpu_do_idle(). 262 98 */ 263 99 cpu_idle_poll_ctrl(true); 264 100 265 - /* Route all sources to IRQ instead of FIQ */ 266 - *IXP4XX_ICLR = 0x0; 267 - 268 - /* Disable all interrupt */ 269 - *IXP4XX_ICMR = 0x0; 270 - 271 - if (cpu_is_ixp46x() || cpu_is_ixp43x()) { 272 - /* Route upper 32 sources to IRQ instead of FIQ */ 273 - *IXP4XX_ICLR2 = 0x00; 274 - 275 - /* Disable upper 32 interrupts */ 276 - *IXP4XX_ICMR2 = 0x00; 277 - } 278 - 279 - /* Default to all level triggered */ 280 - for(i = 0; i < NR_IRQS; i++) { 281 - irq_set_chip_and_handler(i, &ixp4xx_irq_chip, 282 - handle_level_irq); 283 - irq_clear_status_flags(i, IRQ_NOREQUEST); 284 - } 101 + ixp4xx_irq_init(IXP4XX_INTC_BASE_PHYS, 102 + (cpu_is_ixp46x() || cpu_is_ixp43x())); 285 103 } 286 - 287 - 288 - /************************************************************************* 289 - * IXP4xx timer tick 290 - * We use OS timer1 on the CPU for the timer tick and the timestamp 291 - * counter as a source of real clock ticks to account for missed jiffies. 292 - *************************************************************************/ 293 - 294 - static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) 295 - { 296 - struct clock_event_device *evt = dev_id; 297 - 298 - /* Clear Pending Interrupt by writing '1' to it */ 299 - *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; 300 - 301 - evt->event_handler(evt); 302 - 303 - return IRQ_HANDLED; 304 - } 305 - 306 - static struct irqaction ixp4xx_timer_irq = { 307 - .name = "timer1", 308 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 309 - .handler = ixp4xx_timer_interrupt, 310 - .dev_id = &clockevent_ixp4xx, 311 - }; 312 104 313 105 void __init ixp4xx_timer_init(void) 314 106 { 315 - /* Reset/disable counter */ 316 - *IXP4XX_OSRT1 = 0; 317 - 318 - /* Clear Pending Interrupt by writing '1' to it */ 319 - *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; 320 - 321 - /* Reset time-stamp counter */ 322 - *IXP4XX_OSTS = 0; 323 - 324 - /* Connect the interrupt handler and enable the interrupt */ 325 - setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq); 326 - 327 - ixp4xx_clocksource_init(); 328 - ixp4xx_clockevent_init(); 107 + return ixp4xx_timer_setup(IXP4XX_TIMER_BASE_PHYS, 108 + IRQ_IXP4XX_TIMER1, 109 + IXP4XX_TIMER_FREQ); 329 110 } 330 111 331 112 static struct pxa2xx_udc_mach_info ixp4xx_udc_info; ··· 113 364 }, 114 365 }; 115 366 367 + static struct resource ixp4xx_gpio_resource[] = { 368 + { 369 + .start = IXP4XX_GPIO_BASE_PHYS, 370 + .end = IXP4XX_GPIO_BASE_PHYS + 0xfff, 371 + .flags = IORESOURCE_MEM, 372 + }, 373 + }; 374 + 375 + static struct platform_device ixp4xx_gpio_device = { 376 + .name = "ixp4xx-gpio", 377 + .id = -1, 378 + .dev = { 379 + .coherent_dma_mask = DMA_BIT_MASK(32), 380 + }, 381 + .resource = ixp4xx_gpio_resource, 382 + .num_resources = ARRAY_SIZE(ixp4xx_gpio_resource), 383 + }; 384 + 116 385 /* 117 386 * USB device controller. The IXP4xx uses the same controller as PXA25X, 118 387 * so we just use the same device. ··· 145 378 }, 146 379 }; 147 380 381 + static struct resource ixp4xx_npe_resources[] = { 382 + { 383 + .start = IXP4XX_NPEA_BASE_PHYS, 384 + .end = IXP4XX_NPEA_BASE_PHYS + 0xfff, 385 + .flags = IORESOURCE_MEM, 386 + }, 387 + { 388 + .start = IXP4XX_NPEB_BASE_PHYS, 389 + .end = IXP4XX_NPEB_BASE_PHYS + 0xfff, 390 + .flags = IORESOURCE_MEM, 391 + }, 392 + { 393 + .start = IXP4XX_NPEC_BASE_PHYS, 394 + .end = IXP4XX_NPEC_BASE_PHYS + 0xfff, 395 + .flags = IORESOURCE_MEM, 396 + }, 397 + 398 + }; 399 + 400 + static struct platform_device ixp4xx_npe_device = { 401 + .name = "ixp4xx-npe", 402 + .id = -1, 403 + .num_resources = ARRAY_SIZE(ixp4xx_npe_resources), 404 + .resource = ixp4xx_npe_resources, 405 + }; 406 + 407 + static struct resource ixp4xx_qmgr_resources[] = { 408 + { 409 + .start = IXP4XX_QMGR_BASE_PHYS, 410 + .end = IXP4XX_QMGR_BASE_PHYS + 0x3fff, 411 + .flags = IORESOURCE_MEM, 412 + }, 413 + { 414 + .start = IRQ_IXP4XX_QM1, 415 + .end = IRQ_IXP4XX_QM1, 416 + .flags = IORESOURCE_IRQ, 417 + }, 418 + { 419 + .start = IRQ_IXP4XX_QM2, 420 + .end = IRQ_IXP4XX_QM2, 421 + .flags = IORESOURCE_IRQ, 422 + }, 423 + }; 424 + 425 + static struct platform_device ixp4xx_qmgr_device = { 426 + .name = "ixp4xx-qmgr", 427 + .id = -1, 428 + .num_resources = ARRAY_SIZE(ixp4xx_qmgr_resources), 429 + .resource = ixp4xx_qmgr_resources, 430 + }; 431 + 148 432 static struct platform_device *ixp4xx_devices[] __initdata = { 433 + &ixp4xx_npe_device, 434 + &ixp4xx_qmgr_device, 435 + &ixp4xx_gpio_device, 149 436 &ixp4xx_udc_device, 150 437 }; 151 438 ··· 234 413 unsigned long ixp4xx_exp_bus_size; 235 414 EXPORT_SYMBOL(ixp4xx_exp_bus_size); 236 415 237 - static int ixp4xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) 238 - { 239 - gpio_line_config(gpio, IXP4XX_GPIO_IN); 240 - 241 - return 0; 242 - } 243 - 244 - static int ixp4xx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, 245 - int level) 246 - { 247 - gpio_line_set(gpio, level); 248 - gpio_line_config(gpio, IXP4XX_GPIO_OUT); 249 - 250 - return 0; 251 - } 252 - 253 - static int ixp4xx_gpio_get_value(struct gpio_chip *chip, unsigned gpio) 254 - { 255 - int value; 256 - 257 - gpio_line_get(gpio, &value); 258 - 259 - return value; 260 - } 261 - 262 - static void ixp4xx_gpio_set_value(struct gpio_chip *chip, unsigned gpio, 263 - int value) 264 - { 265 - gpio_line_set(gpio, value); 266 - } 267 - 268 - static struct gpio_chip ixp4xx_gpio_chip = { 269 - .label = "IXP4XX_GPIO_CHIP", 270 - .direction_input = ixp4xx_gpio_direction_input, 271 - .direction_output = ixp4xx_gpio_direction_output, 272 - .get = ixp4xx_gpio_get_value, 273 - .set = ixp4xx_gpio_set_value, 274 - .to_irq = ixp4xx_gpio_to_irq, 275 - .base = 0, 276 - .ngpio = 16, 277 - }; 278 - 279 416 void __init ixp4xx_sys_init(void) 280 417 { 281 418 ixp4xx_exp_bus_size = SZ_16M; 282 419 283 420 platform_add_devices(ixp4xx_devices, ARRAY_SIZE(ixp4xx_devices)); 284 - 285 - gpiochip_add_data(&ixp4xx_gpio_chip, NULL); 286 421 287 422 if (cpu_is_ixp46x()) { 288 423 int region; ··· 258 481 ixp4xx_exp_bus_size >> 20); 259 482 } 260 483 261 - /* 262 - * sched_clock() 263 - */ 264 - static u64 notrace ixp4xx_read_sched_clock(void) 265 - { 266 - return *IXP4XX_OSTS; 267 - } 268 - 269 - /* 270 - * clocksource 271 - */ 272 - 273 - static u64 ixp4xx_clocksource_read(struct clocksource *c) 274 - { 275 - return *IXP4XX_OSTS; 276 - } 277 - 278 484 unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; 279 485 EXPORT_SYMBOL(ixp4xx_timer_freq); 280 - static void __init ixp4xx_clocksource_init(void) 281 - { 282 - sched_clock_register(ixp4xx_read_sched_clock, 32, ixp4xx_timer_freq); 283 - 284 - clocksource_mmio_init(NULL, "OSTS", ixp4xx_timer_freq, 200, 32, 285 - ixp4xx_clocksource_read); 286 - } 287 - 288 - /* 289 - * clockevents 290 - */ 291 - static int ixp4xx_set_next_event(unsigned long evt, 292 - struct clock_event_device *unused) 293 - { 294 - unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK; 295 - 296 - *IXP4XX_OSRT1 = (evt & ~IXP4XX_OST_RELOAD_MASK) | opts; 297 - 298 - return 0; 299 - } 300 - 301 - static int ixp4xx_shutdown(struct clock_event_device *evt) 302 - { 303 - unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK; 304 - unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK; 305 - 306 - opts &= ~IXP4XX_OST_ENABLE; 307 - *IXP4XX_OSRT1 = osrt | opts; 308 - return 0; 309 - } 310 - 311 - static int ixp4xx_set_oneshot(struct clock_event_device *evt) 312 - { 313 - unsigned long opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT; 314 - unsigned long osrt = 0; 315 - 316 - /* period set by 'set next_event' */ 317 - *IXP4XX_OSRT1 = osrt | opts; 318 - return 0; 319 - } 320 - 321 - static int ixp4xx_set_periodic(struct clock_event_device *evt) 322 - { 323 - unsigned long opts = IXP4XX_OST_ENABLE; 324 - unsigned long osrt = IXP4XX_LATCH & ~IXP4XX_OST_RELOAD_MASK; 325 - 326 - *IXP4XX_OSRT1 = osrt | opts; 327 - return 0; 328 - } 329 - 330 - static int ixp4xx_resume(struct clock_event_device *evt) 331 - { 332 - unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK; 333 - unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK; 334 - 335 - opts |= IXP4XX_OST_ENABLE; 336 - *IXP4XX_OSRT1 = osrt | opts; 337 - return 0; 338 - } 339 - 340 - static struct clock_event_device clockevent_ixp4xx = { 341 - .name = "ixp4xx timer1", 342 - .features = CLOCK_EVT_FEAT_PERIODIC | 343 - CLOCK_EVT_FEAT_ONESHOT, 344 - .rating = 200, 345 - .set_state_shutdown = ixp4xx_shutdown, 346 - .set_state_periodic = ixp4xx_set_periodic, 347 - .set_state_oneshot = ixp4xx_set_oneshot, 348 - .tick_resume = ixp4xx_resume, 349 - .set_next_event = ixp4xx_set_next_event, 350 - }; 351 - 352 - static void __init ixp4xx_clockevent_init(void) 353 - { 354 - clockevent_ixp4xx.cpumask = cpumask_of(0); 355 - clockevents_config_and_register(&clockevent_ixp4xx, IXP4XX_TIMER_FREQ, 356 - 0xf, 0xfffffffe); 357 - } 358 486 359 487 void ixp4xx_restart(enum reboot_mode mode, const char *cmd) 360 488 {
+2
arch/arm/mach-ixp4xx/coyote-pci.c
··· 23 23 #include <asm/irq.h> 24 24 #include <asm/mach/pci.h> 25 25 26 + #include "irqs.h" 27 + 26 28 #define SLOT0_DEVID 14 27 29 #define SLOT1_DEVID 15 28 30
+2
arch/arm/mach-ixp4xx/coyote-setup.c
··· 25 25 #include <asm/mach/arch.h> 26 26 #include <asm/mach/flash.h> 27 27 28 + #include "irqs.h" 29 + 28 30 #define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3) 29 31 #define COYOTE_IDE_BASE_VIRT 0xFFFE1000 30 32 #define COYOTE_IDE_REGION_SIZE 0x1000
+2
arch/arm/mach-ixp4xx/dsmg600-pci.c
··· 22 22 #include <asm/mach/pci.h> 23 23 #include <asm/mach-types.h> 24 24 25 + #include "irqs.h" 26 + 25 27 #define MAX_DEV 4 26 28 #define IRQ_LINES 3 27 29
+2 -3
arch/arm/mach-ixp4xx/dsmg600-setup.c
··· 35 35 #include <asm/mach/flash.h> 36 36 #include <asm/mach/time.h> 37 37 38 + #include "irqs.h" 39 + 38 40 #define DSMG600_SDA_PIN 5 39 41 #define DSMG600_SCL_PIN 4 40 42 ··· 269 267 static void __init dsmg600_init(void) 270 268 { 271 269 ixp4xx_sys_init(); 272 - 273 - /* Make sure that GPIO14 and GPIO15 are not used as clocks */ 274 - *IXP4XX_GPIO_GPCLKR = 0; 275 270 276 271 dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); 277 272 dsmg600_flash_resource.end =
+2
arch/arm/mach-ixp4xx/fsg-pci.c
··· 22 22 #include <asm/mach/pci.h> 23 23 #include <asm/mach-types.h> 24 24 25 + #include "irqs.h" 26 + 25 27 #define MAX_DEV 3 26 28 #define IRQ_LINES 3 27 29
+2
arch/arm/mach-ixp4xx/fsg-setup.c
··· 29 29 #include <asm/mach/arch.h> 30 30 #include <asm/mach/flash.h> 31 31 32 + #include "irqs.h" 33 + 32 34 #define FSG_SDA_PIN 12 33 35 #define FSG_SCL_PIN 13 34 36
+2
arch/arm/mach-ixp4xx/gateway7001-pci.c
··· 27 27 28 28 #include <asm/mach/pci.h> 29 29 30 + #include "irqs.h" 31 + 30 32 void __init gateway7001_pci_preinit(void) 31 33 { 32 34 irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW);
+2
arch/arm/mach-ixp4xx/gateway7001-setup.c
··· 28 28 #include <asm/mach/arch.h> 29 29 #include <asm/mach/flash.h> 30 30 31 + #include "irqs.h" 32 + 31 33 static struct flash_platform_data gateway7001_flash_data = { 32 34 .map_name = "cfi_probe", 33 35 .width = 2,
+2
arch/arm/mach-ixp4xx/gtwx5715-pci.c
··· 30 30 #include <mach/hardware.h> 31 31 #include <asm/mach/pci.h> 32 32 33 + #include "irqs.h" 34 + 33 35 #define SLOT0_DEVID 0 34 36 #define SLOT1_DEVID 1 35 37 #define INTA 10 /* slot 1 has INTA and INTB crossed */
+2
arch/arm/mach-ixp4xx/gtwx5715-setup.c
··· 36 36 #include <asm/mach/arch.h> 37 37 #include <asm/mach/flash.h> 38 38 39 + #include "irqs.h" 40 + 39 41 /* GPIO 5,6,7 and 12 are hard wired to the Kendin KS8995M Switch 40 42 and operate as an SPI type interface. The details of the interface 41 43 are available on Kendin/Micrel's web site. */
-41
arch/arm/mach-ixp4xx/include/mach/entry-macro.S
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/entry-macro.S 3 - * 4 - * Low-level IRQ helper macros for IXP4xx-based platforms 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without any 8 - * warranty of any kind, whether express or implied. 9 - */ 10 - #include <mach/hardware.h> 11 - 12 - .macro get_irqnr_preamble, base, tmp 13 - .endm 14 - 15 - .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 16 - ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET) 17 - ldr \irqstat, [\irqstat] @ get interrupts 18 - cmp \irqstat, #0 19 - beq 1001f @ upper IRQ? 20 - clz \irqnr, \irqstat 21 - mov \base, #31 22 - sub \irqnr, \base, \irqnr 23 - b 1002f @ lower IRQ being 24 - @ handled 25 - 26 - 1001: 27 - /* 28 - * IXP465/IXP435 has an upper IRQ status register 29 - */ 30 - #if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X) 31 - ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET) 32 - ldr \irqstat, [\irqstat] @ get upper interrupts 33 - mov \irqnr, #63 34 - clz \irqstat, \irqstat 35 - cmp \irqstat, #32 36 - subne \irqnr, \irqnr, \irqstat 37 - #endif 38 - 1002: 39 - .endm 40 - 41 -
-75
arch/arm/mach-ixp4xx/include/mach/irqs.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/irqs.h 3 - * 4 - * IRQ definitions for IXP4XX based systems 5 - * 6 - * Copyright (C) 2002 Intel Corporation. 7 - * Copyright (C) 2003 MontaVista Software, Inc. 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License version 2 as 11 - * published by the Free Software Foundation. 12 - * 13 - */ 14 - 15 - #ifndef _ARCH_IXP4XX_IRQS_H_ 16 - #define _ARCH_IXP4XX_IRQS_H_ 17 - 18 - #define IRQ_IXP4XX_NPEA 0 19 - #define IRQ_IXP4XX_NPEB 1 20 - #define IRQ_IXP4XX_NPEC 2 21 - #define IRQ_IXP4XX_QM1 3 22 - #define IRQ_IXP4XX_QM2 4 23 - #define IRQ_IXP4XX_TIMER1 5 24 - #define IRQ_IXP4XX_GPIO0 6 25 - #define IRQ_IXP4XX_GPIO1 7 26 - #define IRQ_IXP4XX_PCI_INT 8 27 - #define IRQ_IXP4XX_PCI_DMA1 9 28 - #define IRQ_IXP4XX_PCI_DMA2 10 29 - #define IRQ_IXP4XX_TIMER2 11 30 - #define IRQ_IXP4XX_USB 12 31 - #define IRQ_IXP4XX_UART2 13 32 - #define IRQ_IXP4XX_TIMESTAMP 14 33 - #define IRQ_IXP4XX_UART1 15 34 - #define IRQ_IXP4XX_WDOG 16 35 - #define IRQ_IXP4XX_AHB_PMU 17 36 - #define IRQ_IXP4XX_XSCALE_PMU 18 37 - #define IRQ_IXP4XX_GPIO2 19 38 - #define IRQ_IXP4XX_GPIO3 20 39 - #define IRQ_IXP4XX_GPIO4 21 40 - #define IRQ_IXP4XX_GPIO5 22 41 - #define IRQ_IXP4XX_GPIO6 23 42 - #define IRQ_IXP4XX_GPIO7 24 43 - #define IRQ_IXP4XX_GPIO8 25 44 - #define IRQ_IXP4XX_GPIO9 26 45 - #define IRQ_IXP4XX_GPIO10 27 46 - #define IRQ_IXP4XX_GPIO11 28 47 - #define IRQ_IXP4XX_GPIO12 29 48 - #define IRQ_IXP4XX_SW_INT1 30 49 - #define IRQ_IXP4XX_SW_INT2 31 50 - #define IRQ_IXP4XX_USB_HOST 32 51 - #define IRQ_IXP4XX_I2C 33 52 - #define IRQ_IXP4XX_SSP 34 53 - #define IRQ_IXP4XX_TSYNC 35 54 - #define IRQ_IXP4XX_EAU_DONE 36 55 - #define IRQ_IXP4XX_SHA_DONE 37 56 - #define IRQ_IXP4XX_SWCP_PE 58 57 - #define IRQ_IXP4XX_QM_PE 60 58 - #define IRQ_IXP4XX_MCU_ECC 61 59 - #define IRQ_IXP4XX_EXP_PE 62 60 - 61 - #define _IXP4XX_GPIO_IRQ(n) (IRQ_IXP4XX_GPIO ## n) 62 - #define IXP4XX_GPIO_IRQ(n) _IXP4XX_GPIO_IRQ(n) 63 - 64 - /* 65 - * Only first 32 sources are valid if running on IXP42x systems 66 - */ 67 - #if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X) 68 - #define NR_IRQS 64 69 - #else 70 - #define NR_IRQS 32 71 - #endif 72 - 73 - #define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU) 74 - 75 - #endif
-94
arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
··· 43 43 * Queue Manager 44 44 */ 45 45 #define IXP4XX_QMGR_BASE_PHYS 0x60000000 46 - #define IXP4XX_QMGR_BASE_VIRT IOMEM(0xFEF15000) 47 - #define IXP4XX_QMGR_REGION_SIZE 0x00004000 48 46 49 47 /* 50 48 * Peripheral space, including debug UART. Must be section-aligned so that ··· 130 132 #define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) 131 133 #define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) 132 134 #define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) 133 - #define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x6000) 134 - #define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x7000) 135 - #define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x8000) 136 135 #define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) 137 136 #define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) 138 137 #define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) ··· 141 146 #define IXP4XX_TIMESYNC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x10000) 142 147 #define IXP4XX_I2C_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x11000) 143 148 #define IXP4XX_SSP_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x12000) 144 - 145 - /* 146 - * Constants to make it easy to access Interrupt Controller registers 147 - */ 148 - #define IXP4XX_ICPR_OFFSET 0x00 /* Interrupt Status */ 149 - #define IXP4XX_ICMR_OFFSET 0x04 /* Interrupt Enable */ 150 - #define IXP4XX_ICLR_OFFSET 0x08 /* Interrupt IRQ/FIQ Select */ 151 - #define IXP4XX_ICIP_OFFSET 0x0C /* IRQ Status */ 152 - #define IXP4XX_ICFP_OFFSET 0x10 /* FIQ Status */ 153 - #define IXP4XX_ICHR_OFFSET 0x14 /* Interrupt Priority */ 154 - #define IXP4XX_ICIH_OFFSET 0x18 /* IRQ Highest Pri Int */ 155 - #define IXP4XX_ICFH_OFFSET 0x1C /* FIQ Highest Pri Int */ 156 - 157 - /* 158 - * IXP465-only 159 - */ 160 - #define IXP4XX_ICPR2_OFFSET 0x20 /* Interrupt Status 2 */ 161 - #define IXP4XX_ICMR2_OFFSET 0x24 /* Interrupt Enable 2 */ 162 - #define IXP4XX_ICLR2_OFFSET 0x28 /* Interrupt IRQ/FIQ Select 2 */ 163 - #define IXP4XX_ICIP2_OFFSET 0x2C /* IRQ Status */ 164 - #define IXP4XX_ICFP2_OFFSET 0x30 /* FIQ Status */ 165 - #define IXP4XX_ICEEN_OFFSET 0x34 /* Error High Pri Enable */ 166 - 167 - 168 - /* 169 - * Interrupt Controller Register Definitions. 170 - */ 171 - 172 - #define IXP4XX_INTC_REG(x) ((volatile u32 *)(IXP4XX_INTC_BASE_VIRT+(x))) 173 - 174 - #define IXP4XX_ICPR IXP4XX_INTC_REG(IXP4XX_ICPR_OFFSET) 175 - #define IXP4XX_ICMR IXP4XX_INTC_REG(IXP4XX_ICMR_OFFSET) 176 - #define IXP4XX_ICLR IXP4XX_INTC_REG(IXP4XX_ICLR_OFFSET) 177 - #define IXP4XX_ICIP IXP4XX_INTC_REG(IXP4XX_ICIP_OFFSET) 178 - #define IXP4XX_ICFP IXP4XX_INTC_REG(IXP4XX_ICFP_OFFSET) 179 - #define IXP4XX_ICHR IXP4XX_INTC_REG(IXP4XX_ICHR_OFFSET) 180 - #define IXP4XX_ICIH IXP4XX_INTC_REG(IXP4XX_ICIH_OFFSET) 181 - #define IXP4XX_ICFH IXP4XX_INTC_REG(IXP4XX_ICFH_OFFSET) 182 - #define IXP4XX_ICPR2 IXP4XX_INTC_REG(IXP4XX_ICPR2_OFFSET) 183 - #define IXP4XX_ICMR2 IXP4XX_INTC_REG(IXP4XX_ICMR2_OFFSET) 184 - #define IXP4XX_ICLR2 IXP4XX_INTC_REG(IXP4XX_ICLR2_OFFSET) 185 - #define IXP4XX_ICIP2 IXP4XX_INTC_REG(IXP4XX_ICIP2_OFFSET) 186 - #define IXP4XX_ICFP2 IXP4XX_INTC_REG(IXP4XX_ICFP2_OFFSET) 187 - #define IXP4XX_ICEEN IXP4XX_INTC_REG(IXP4XX_ICEEN_OFFSET) 188 - 189 - /* 190 - * Constants to make it easy to access GPIO registers 191 - */ 192 - #define IXP4XX_GPIO_GPOUTR_OFFSET 0x00 193 - #define IXP4XX_GPIO_GPOER_OFFSET 0x04 194 - #define IXP4XX_GPIO_GPINR_OFFSET 0x08 195 - #define IXP4XX_GPIO_GPISR_OFFSET 0x0C 196 - #define IXP4XX_GPIO_GPIT1R_OFFSET 0x10 197 - #define IXP4XX_GPIO_GPIT2R_OFFSET 0x14 198 - #define IXP4XX_GPIO_GPCLKR_OFFSET 0x18 199 - #define IXP4XX_GPIO_GPDBSELR_OFFSET 0x1C 200 - 201 - /* 202 - * GPIO Register Definitions. 203 - * [Only perform 32bit reads/writes] 204 - */ 205 - #define IXP4XX_GPIO_REG(x) ((volatile u32 *)(IXP4XX_GPIO_BASE_VIRT+(x))) 206 - 207 - #define IXP4XX_GPIO_GPOUTR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPOUTR_OFFSET) 208 - #define IXP4XX_GPIO_GPOER IXP4XX_GPIO_REG(IXP4XX_GPIO_GPOER_OFFSET) 209 - #define IXP4XX_GPIO_GPINR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPINR_OFFSET) 210 - #define IXP4XX_GPIO_GPISR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPISR_OFFSET) 211 - #define IXP4XX_GPIO_GPIT1R IXP4XX_GPIO_REG(IXP4XX_GPIO_GPIT1R_OFFSET) 212 - #define IXP4XX_GPIO_GPIT2R IXP4XX_GPIO_REG(IXP4XX_GPIO_GPIT2R_OFFSET) 213 - #define IXP4XX_GPIO_GPCLKR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPCLKR_OFFSET) 214 - #define IXP4XX_GPIO_GPDBSELR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPDBSELR_OFFSET) 215 - 216 - /* 217 - * GPIO register bit definitions 218 - */ 219 - 220 - /* Interrupt styles 221 - */ 222 - #define IXP4XX_GPIO_STYLE_ACTIVE_HIGH 0x0 223 - #define IXP4XX_GPIO_STYLE_ACTIVE_LOW 0x1 224 - #define IXP4XX_GPIO_STYLE_RISING_EDGE 0x2 225 - #define IXP4XX_GPIO_STYLE_FALLING_EDGE 0x3 226 - #define IXP4XX_GPIO_STYLE_TRANSITIONAL 0x4 227 - 228 - /* 229 - * Mask used to clear interrupt styles 230 - */ 231 - #define IXP4XX_GPIO_STYLE_CLEAR 0x7 232 - #define IXP4XX_GPIO_STYLE_SIZE 3 233 149 234 150 /* 235 151 * Constants to make it easy to access Timer Control/Status registers
-2
arch/arm/mach-ixp4xx/include/mach/npe.h include/linux/soc/ixp4xx/npe.h
··· 16 16 }; 17 17 18 18 struct npe { 19 - struct resource *mem_res; 20 19 struct npe_regs __iomem *regs; 21 - u32 regs_phys; 22 20 int id; 23 21 int valid; 24 22 };
-204
arch/arm/mach-ixp4xx/include/mach/qmgr.h
··· 1 - /* 2 - * Copyright (C) 2007 Krzysztof Halasa <khc@pm.waw.pl> 3 - * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms of version 2 of the GNU General Public License 6 - * as published by the Free Software Foundation. 7 - */ 8 - 9 - #ifndef IXP4XX_QMGR_H 10 - #define IXP4XX_QMGR_H 11 - 12 - #include <linux/io.h> 13 - #include <linux/kernel.h> 14 - 15 - #define DEBUG_QMGR 0 16 - 17 - #define HALF_QUEUES 32 18 - #define QUEUES 64 19 - #define MAX_QUEUE_LENGTH 4 /* in dwords */ 20 - 21 - #define QUEUE_STAT1_EMPTY 1 /* queue status bits */ 22 - #define QUEUE_STAT1_NEARLY_EMPTY 2 23 - #define QUEUE_STAT1_NEARLY_FULL 4 24 - #define QUEUE_STAT1_FULL 8 25 - #define QUEUE_STAT2_UNDERFLOW 1 26 - #define QUEUE_STAT2_OVERFLOW 2 27 - 28 - #define QUEUE_WATERMARK_0_ENTRIES 0 29 - #define QUEUE_WATERMARK_1_ENTRY 1 30 - #define QUEUE_WATERMARK_2_ENTRIES 2 31 - #define QUEUE_WATERMARK_4_ENTRIES 3 32 - #define QUEUE_WATERMARK_8_ENTRIES 4 33 - #define QUEUE_WATERMARK_16_ENTRIES 5 34 - #define QUEUE_WATERMARK_32_ENTRIES 6 35 - #define QUEUE_WATERMARK_64_ENTRIES 7 36 - 37 - /* queue interrupt request conditions */ 38 - #define QUEUE_IRQ_SRC_EMPTY 0 39 - #define QUEUE_IRQ_SRC_NEARLY_EMPTY 1 40 - #define QUEUE_IRQ_SRC_NEARLY_FULL 2 41 - #define QUEUE_IRQ_SRC_FULL 3 42 - #define QUEUE_IRQ_SRC_NOT_EMPTY 4 43 - #define QUEUE_IRQ_SRC_NOT_NEARLY_EMPTY 5 44 - #define QUEUE_IRQ_SRC_NOT_NEARLY_FULL 6 45 - #define QUEUE_IRQ_SRC_NOT_FULL 7 46 - 47 - struct qmgr_regs { 48 - u32 acc[QUEUES][MAX_QUEUE_LENGTH]; /* 0x000 - 0x3FF */ 49 - u32 stat1[4]; /* 0x400 - 0x40F */ 50 - u32 stat2[2]; /* 0x410 - 0x417 */ 51 - u32 statne_h; /* 0x418 - queue nearly empty */ 52 - u32 statf_h; /* 0x41C - queue full */ 53 - u32 irqsrc[4]; /* 0x420 - 0x42F IRC source */ 54 - u32 irqen[2]; /* 0x430 - 0x437 IRQ enabled */ 55 - u32 irqstat[2]; /* 0x438 - 0x43F - IRQ access only */ 56 - u32 reserved[1776]; 57 - u32 sram[2048]; /* 0x2000 - 0x3FFF - config and buffer */ 58 - }; 59 - 60 - void qmgr_set_irq(unsigned int queue, int src, 61 - void (*handler)(void *pdev), void *pdev); 62 - void qmgr_enable_irq(unsigned int queue); 63 - void qmgr_disable_irq(unsigned int queue); 64 - 65 - /* request_ and release_queue() must be called from non-IRQ context */ 66 - 67 - #if DEBUG_QMGR 68 - extern char qmgr_queue_descs[QUEUES][32]; 69 - 70 - int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, 71 - unsigned int nearly_empty_watermark, 72 - unsigned int nearly_full_watermark, 73 - const char *desc_format, const char* name); 74 - #else 75 - int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, 76 - unsigned int nearly_empty_watermark, 77 - unsigned int nearly_full_watermark); 78 - #define qmgr_request_queue(queue, len, nearly_empty_watermark, \ 79 - nearly_full_watermark, desc_format, name) \ 80 - __qmgr_request_queue(queue, len, nearly_empty_watermark, \ 81 - nearly_full_watermark) 82 - #endif 83 - 84 - void qmgr_release_queue(unsigned int queue); 85 - 86 - 87 - static inline void qmgr_put_entry(unsigned int queue, u32 val) 88 - { 89 - struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT; 90 - #if DEBUG_QMGR 91 - BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */ 92 - 93 - printk(KERN_DEBUG "Queue %s(%i) put %X\n", 94 - qmgr_queue_descs[queue], queue, val); 95 - #endif 96 - __raw_writel(val, &qmgr_regs->acc[queue][0]); 97 - } 98 - 99 - static inline u32 qmgr_get_entry(unsigned int queue) 100 - { 101 - u32 val; 102 - const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT; 103 - val = __raw_readl(&qmgr_regs->acc[queue][0]); 104 - #if DEBUG_QMGR 105 - BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */ 106 - 107 - printk(KERN_DEBUG "Queue %s(%i) get %X\n", 108 - qmgr_queue_descs[queue], queue, val); 109 - #endif 110 - return val; 111 - } 112 - 113 - static inline int __qmgr_get_stat1(unsigned int queue) 114 - { 115 - const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT; 116 - return (__raw_readl(&qmgr_regs->stat1[queue >> 3]) 117 - >> ((queue & 7) << 2)) & 0xF; 118 - } 119 - 120 - static inline int __qmgr_get_stat2(unsigned int queue) 121 - { 122 - const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT; 123 - BUG_ON(queue >= HALF_QUEUES); 124 - return (__raw_readl(&qmgr_regs->stat2[queue >> 4]) 125 - >> ((queue & 0xF) << 1)) & 0x3; 126 - } 127 - 128 - /** 129 - * qmgr_stat_empty() - checks if a hardware queue is empty 130 - * @queue: queue number 131 - * 132 - * Returns non-zero value if the queue is empty. 133 - */ 134 - static inline int qmgr_stat_empty(unsigned int queue) 135 - { 136 - BUG_ON(queue >= HALF_QUEUES); 137 - return __qmgr_get_stat1(queue) & QUEUE_STAT1_EMPTY; 138 - } 139 - 140 - /** 141 - * qmgr_stat_below_low_watermark() - checks if a queue is below low watermark 142 - * @queue: queue number 143 - * 144 - * Returns non-zero value if the queue is below low watermark. 145 - */ 146 - static inline int qmgr_stat_below_low_watermark(unsigned int queue) 147 - { 148 - const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT; 149 - if (queue >= HALF_QUEUES) 150 - return (__raw_readl(&qmgr_regs->statne_h) >> 151 - (queue - HALF_QUEUES)) & 0x01; 152 - return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_EMPTY; 153 - } 154 - 155 - /** 156 - * qmgr_stat_above_high_watermark() - checks if a queue is above high watermark 157 - * @queue: queue number 158 - * 159 - * Returns non-zero value if the queue is above high watermark 160 - */ 161 - static inline int qmgr_stat_above_high_watermark(unsigned int queue) 162 - { 163 - BUG_ON(queue >= HALF_QUEUES); 164 - return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_FULL; 165 - } 166 - 167 - /** 168 - * qmgr_stat_full() - checks if a hardware queue is full 169 - * @queue: queue number 170 - * 171 - * Returns non-zero value if the queue is full. 172 - */ 173 - static inline int qmgr_stat_full(unsigned int queue) 174 - { 175 - const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT; 176 - if (queue >= HALF_QUEUES) 177 - return (__raw_readl(&qmgr_regs->statf_h) >> 178 - (queue - HALF_QUEUES)) & 0x01; 179 - return __qmgr_get_stat1(queue) & QUEUE_STAT1_FULL; 180 - } 181 - 182 - /** 183 - * qmgr_stat_underflow() - checks if a hardware queue experienced underflow 184 - * @queue: queue number 185 - * 186 - * Returns non-zero value if the queue experienced underflow. 187 - */ 188 - static inline int qmgr_stat_underflow(unsigned int queue) 189 - { 190 - return __qmgr_get_stat2(queue) & QUEUE_STAT2_UNDERFLOW; 191 - } 192 - 193 - /** 194 - * qmgr_stat_overflow() - checks if a hardware queue experienced overflow 195 - * @queue: queue number 196 - * 197 - * Returns non-zero value if the queue experienced overflow. 198 - */ 199 - static inline int qmgr_stat_overflow(unsigned int queue) 200 - { 201 - return __qmgr_get_stat2(queue) & QUEUE_STAT2_OVERFLOW; 202 - } 203 - 204 - #endif
+68
arch/arm/mach-ixp4xx/irqs.h
··· 1 + /* 2 + * arch/arm/mach-ixp4xx/include/mach/irqs.h 3 + * 4 + * IRQ definitions for IXP4XX based systems 5 + * 6 + * Copyright (C) 2002 Intel Corporation. 7 + * Copyright (C) 2003 MontaVista Software, Inc. 8 + * 9 + * This program is free software; you can redistribute it and/or modify 10 + * it under the terms of the GNU General Public License version 2 as 11 + * published by the Free Software Foundation. 12 + * 13 + */ 14 + 15 + #ifndef _ARCH_IXP4XX_IRQS_H_ 16 + #define _ARCH_IXP4XX_IRQS_H_ 17 + 18 + #define IRQ_IXP4XX_BASE 16 19 + 20 + #define IRQ_IXP4XX_NPEA (IRQ_IXP4XX_BASE + 0) 21 + #define IRQ_IXP4XX_NPEB (IRQ_IXP4XX_BASE + 1) 22 + #define IRQ_IXP4XX_NPEC (IRQ_IXP4XX_BASE + 2) 23 + #define IRQ_IXP4XX_QM1 (IRQ_IXP4XX_BASE + 3) 24 + #define IRQ_IXP4XX_QM2 (IRQ_IXP4XX_BASE + 4) 25 + #define IRQ_IXP4XX_TIMER1 (IRQ_IXP4XX_BASE + 5) 26 + #define IRQ_IXP4XX_GPIO0 (IRQ_IXP4XX_BASE + 6) 27 + #define IRQ_IXP4XX_GPIO1 (IRQ_IXP4XX_BASE + 7) 28 + #define IRQ_IXP4XX_PCI_INT (IRQ_IXP4XX_BASE + 8) 29 + #define IRQ_IXP4XX_PCI_DMA1 (IRQ_IXP4XX_BASE + 9) 30 + #define IRQ_IXP4XX_PCI_DMA2 (IRQ_IXP4XX_BASE + 10) 31 + #define IRQ_IXP4XX_TIMER2 (IRQ_IXP4XX_BASE + 11) 32 + #define IRQ_IXP4XX_USB (IRQ_IXP4XX_BASE + 12) 33 + #define IRQ_IXP4XX_UART2 (IRQ_IXP4XX_BASE + 13) 34 + #define IRQ_IXP4XX_TIMESTAMP (IRQ_IXP4XX_BASE + 14) 35 + #define IRQ_IXP4XX_UART1 (IRQ_IXP4XX_BASE + 15) 36 + #define IRQ_IXP4XX_WDOG (IRQ_IXP4XX_BASE + 16) 37 + #define IRQ_IXP4XX_AHB_PMU (IRQ_IXP4XX_BASE + 17) 38 + #define IRQ_IXP4XX_XSCALE_PMU (IRQ_IXP4XX_BASE + 18) 39 + #define IRQ_IXP4XX_GPIO2 (IRQ_IXP4XX_BASE + 19) 40 + #define IRQ_IXP4XX_GPIO3 (IRQ_IXP4XX_BASE + 20) 41 + #define IRQ_IXP4XX_GPIO4 (IRQ_IXP4XX_BASE + 21) 42 + #define IRQ_IXP4XX_GPIO5 (IRQ_IXP4XX_BASE + 22) 43 + #define IRQ_IXP4XX_GPIO6 (IRQ_IXP4XX_BASE + 23) 44 + #define IRQ_IXP4XX_GPIO7 (IRQ_IXP4XX_BASE + 24) 45 + #define IRQ_IXP4XX_GPIO8 (IRQ_IXP4XX_BASE + 25) 46 + #define IRQ_IXP4XX_GPIO9 (IRQ_IXP4XX_BASE + 26) 47 + #define IRQ_IXP4XX_GPIO10 (IRQ_IXP4XX_BASE + 27) 48 + #define IRQ_IXP4XX_GPIO11 (IRQ_IXP4XX_BASE + 28) 49 + #define IRQ_IXP4XX_GPIO12 (IRQ_IXP4XX_BASE + 29) 50 + #define IRQ_IXP4XX_SW_INT1 (IRQ_IXP4XX_BASE + 30) 51 + #define IRQ_IXP4XX_SW_INT2 (IRQ_IXP4XX_BASE + 31) 52 + #define IRQ_IXP4XX_USB_HOST (IRQ_IXP4XX_BASE + 32) 53 + #define IRQ_IXP4XX_I2C (IRQ_IXP4XX_BASE + 33) 54 + #define IRQ_IXP4XX_SSP (IRQ_IXP4XX_BASE + 34) 55 + #define IRQ_IXP4XX_TSYNC (IRQ_IXP4XX_BASE + 35) 56 + #define IRQ_IXP4XX_EAU_DONE (IRQ_IXP4XX_BASE + 36) 57 + #define IRQ_IXP4XX_SHA_DONE (IRQ_IXP4XX_BASE + 37) 58 + #define IRQ_IXP4XX_SWCP_PE (IRQ_IXP4XX_BASE + 58) 59 + #define IRQ_IXP4XX_QM_PE (IRQ_IXP4XX_BASE + 60) 60 + #define IRQ_IXP4XX_MCU_ECC (IRQ_IXP4XX_BASE + 61) 61 + #define IRQ_IXP4XX_EXP_PE (IRQ_IXP4XX_BASE + 62) 62 + 63 + #define _IXP4XX_GPIO_IRQ(n) (IRQ_IXP4XX_GPIO ## n) 64 + #define IXP4XX_GPIO_IRQ(n) _IXP4XX_GPIO_IRQ(n) 65 + 66 + #define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU) 67 + 68 + #endif
+2
arch/arm/mach-ixp4xx/ixdp425-pci.c
··· 24 24 #include <mach/hardware.h> 25 25 #include <asm/mach-types.h> 26 26 27 + #include "irqs.h" 28 + 27 29 #define MAX_DEV 4 28 30 #define IRQ_LINES 4 29 31
+2
arch/arm/mach-ixp4xx/ixdp425-setup.c
··· 32 32 #include <asm/mach/arch.h> 33 33 #include <asm/mach/flash.h> 34 34 35 + #include "irqs.h" 36 + 35 37 #define IXDP425_SDA_PIN 7 36 38 #define IXDP425_SCL_PIN 6 37 39
+2
arch/arm/mach-ixp4xx/ixdpg425-pci.c
··· 23 23 24 24 #include <asm/mach/pci.h> 25 25 26 + #include "irqs.h" 27 + 26 28 void __init ixdpg425_pci_preinit(void) 27 29 { 28 30 irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW);
+60
arch/arm/mach-ixp4xx/ixp4xx-of.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * IXP4xx Device Tree boot support 4 + */ 5 + #include <linux/kernel.h> 6 + #include <linux/init.h> 7 + #include <linux/io.h> 8 + 9 + #include <asm/mach/arch.h> 10 + #include <asm/mach/map.h> 11 + 12 + #include <mach/hardware.h> 13 + #include <mach/ixp4xx-regs.h> 14 + 15 + static struct map_desc ixp4xx_of_io_desc[] __initdata = { 16 + /* 17 + * This is needed for runtime system configuration checks, 18 + * such as reading if hardware so-and-so is present. This 19 + * could eventually be converted into a syscon once all boards 20 + * are converted to device tree. 21 + */ 22 + { 23 + .virtual = IXP4XX_EXP_CFG_BASE_VIRT, 24 + .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS), 25 + .length = SZ_4K, 26 + .type = MT_DEVICE, 27 + }, 28 + #ifdef CONFIG_DEBUG_UART_8250 29 + /* This is needed for LL-debug/earlyprintk/debug-macro.S */ 30 + { 31 + .virtual = CONFIG_DEBUG_UART_VIRT, 32 + .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS), 33 + .length = SZ_4K, 34 + .type = MT_DEVICE, 35 + }, 36 + #endif 37 + }; 38 + 39 + static void __init ixp4xx_of_map_io(void) 40 + { 41 + iotable_init(ixp4xx_of_io_desc, ARRAY_SIZE(ixp4xx_of_io_desc)); 42 + } 43 + 44 + /* 45 + * We handle 4 differen SoC families. These compatible strings are enough 46 + * to provide the core so that different boards can add their more detailed 47 + * specifics. 48 + */ 49 + static const char *ixp4xx_of_board_compat[] = { 50 + "intel,ixp42x", 51 + "intel,ixp43x", 52 + "intel,ixp45x", 53 + "intel,ixp46x", 54 + NULL, 55 + }; 56 + 57 + DT_MACHINE_START(IXP4XX_DT, "IXP4xx (Device Tree)") 58 + .map_io = ixp4xx_of_map_io, 59 + .dt_compat = ixp4xx_of_board_compat, 60 + MACHINE_END
+44 -24
arch/arm/mach-ixp4xx/ixp4xx_npe.c drivers/soc/ixp4xx/ixp4xx-npe.c
··· 20 20 #include <linux/io.h> 21 21 #include <linux/kernel.h> 22 22 #include <linux/module.h> 23 - #include <mach/npe.h> 23 + #include <linux/of.h> 24 + #include <linux/platform_device.h> 25 + #include <linux/soc/ixp4xx/npe.h> 24 26 25 27 #define DEBUG_MSG 0 26 28 #define DEBUG_FW 0 ··· 155 153 static struct npe npe_tab[NPE_COUNT] = { 156 154 { 157 155 .id = 0, 158 - .regs = (struct npe_regs __iomem *)IXP4XX_NPEA_BASE_VIRT, 159 - .regs_phys = IXP4XX_NPEA_BASE_PHYS, 160 156 }, { 161 157 .id = 1, 162 - .regs = (struct npe_regs __iomem *)IXP4XX_NPEB_BASE_VIRT, 163 - .regs_phys = IXP4XX_NPEB_BASE_PHYS, 164 158 }, { 165 159 .id = 2, 166 - .regs = (struct npe_regs __iomem *)IXP4XX_NPEC_BASE_VIRT, 167 - .regs_phys = IXP4XX_NPEC_BASE_PHYS, 168 160 } 169 161 }; 170 162 ··· 678 682 module_put(THIS_MODULE); 679 683 } 680 684 681 - 682 - static int __init npe_init_module(void) 685 + static int ixp4xx_npe_probe(struct platform_device *pdev) 683 686 { 684 - 685 687 int i, found = 0; 688 + struct device *dev = &pdev->dev; 689 + struct resource *res; 686 690 687 691 for (i = 0; i < NPE_COUNT; i++) { 688 692 struct npe *npe = &npe_tab[i]; 693 + 694 + res = platform_get_resource(pdev, IORESOURCE_MEM, i); 695 + if (!res) 696 + return -ENODEV; 697 + 689 698 if (!(ixp4xx_read_feature_bits() & 690 - (IXP4XX_FEATURE_RESET_NPEA << i))) 699 + (IXP4XX_FEATURE_RESET_NPEA << i))) { 700 + dev_info(dev, "NPE%d at 0x%08x-0x%08x not available\n", 701 + i, res->start, res->end); 691 702 continue; /* NPE already disabled or not present */ 692 - if (!(npe->mem_res = request_mem_region(npe->regs_phys, 693 - REGS_SIZE, 694 - npe_name(npe)))) { 695 - print_npe(KERN_ERR, npe, 696 - "failed to request memory region\n"); 703 + } 704 + npe->regs = devm_ioremap_resource(dev, res); 705 + if (!npe->regs) 706 + return -ENOMEM; 707 + 708 + if (npe_reset(npe)) { 709 + dev_info(dev, "NPE%d at 0x%08x-0x%08x does not reset\n", 710 + i, res->start, res->end); 697 711 continue; 698 712 } 699 - 700 - if (npe_reset(npe)) 701 - continue; 702 713 npe->valid = 1; 714 + dev_info(dev, "NPE%d at 0x%08x-0x%08x registered\n", 715 + i, res->start, res->end); 703 716 found++; 704 717 } 705 718 ··· 717 712 return 0; 718 713 } 719 714 720 - static void __exit npe_cleanup_module(void) 715 + static int ixp4xx_npe_remove(struct platform_device *pdev) 721 716 { 722 717 int i; 723 718 724 719 for (i = 0; i < NPE_COUNT; i++) 725 - if (npe_tab[i].mem_res) { 720 + if (npe_tab[i].regs) { 726 721 npe_reset(&npe_tab[i]); 727 - release_resource(npe_tab[i].mem_res); 728 722 } 723 + 724 + return 0; 729 725 } 730 726 731 - module_init(npe_init_module); 732 - module_exit(npe_cleanup_module); 727 + static const struct of_device_id ixp4xx_npe_of_match[] = { 728 + { 729 + .compatible = "intel,ixp4xx-network-processing-engine", 730 + }, 731 + {}, 732 + }; 733 + 734 + static struct platform_driver ixp4xx_npe_driver = { 735 + .driver = { 736 + .name = "ixp4xx-npe", 737 + .of_match_table = of_match_ptr(ixp4xx_npe_of_match), 738 + }, 739 + .probe = ixp4xx_npe_probe, 740 + .remove = ixp4xx_npe_remove, 741 + }; 742 + module_platform_driver(ixp4xx_npe_driver); 733 743 734 744 MODULE_AUTHOR("Krzysztof Halasa"); 735 745 MODULE_LICENSE("GPL v2");
+151 -35
arch/arm/mach-ixp4xx/ixp4xx_qmgr.c drivers/soc/ixp4xx/ixp4xx-qmgr.c
··· 12 12 #include <linux/interrupt.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/module.h> 15 - #include <mach/qmgr.h> 15 + #include <linux/of.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/soc/ixp4xx/qmgr.h> 16 18 17 - static struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT; 18 - static struct resource *mem_res; 19 + static struct qmgr_regs __iomem *qmgr_regs; 20 + static int qmgr_irq_1; 21 + static int qmgr_irq_2; 19 22 static spinlock_t qmgr_lock; 20 23 static u32 used_sram_bitmap[4]; /* 128 16-dword pages */ 21 24 static void (*irq_handlers[QUEUES])(void *pdev); ··· 27 24 #if DEBUG_QMGR 28 25 char qmgr_queue_descs[QUEUES][32]; 29 26 #endif 27 + 28 + void qmgr_put_entry(unsigned int queue, u32 val) 29 + { 30 + #if DEBUG_QMGR 31 + BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */ 32 + 33 + printk(KERN_DEBUG "Queue %s(%i) put %X\n", 34 + qmgr_queue_descs[queue], queue, val); 35 + #endif 36 + __raw_writel(val, &qmgr_regs->acc[queue][0]); 37 + } 38 + 39 + u32 qmgr_get_entry(unsigned int queue) 40 + { 41 + u32 val; 42 + val = __raw_readl(&qmgr_regs->acc[queue][0]); 43 + #if DEBUG_QMGR 44 + BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */ 45 + 46 + printk(KERN_DEBUG "Queue %s(%i) get %X\n", 47 + qmgr_queue_descs[queue], queue, val); 48 + #endif 49 + return val; 50 + } 51 + 52 + static int __qmgr_get_stat1(unsigned int queue) 53 + { 54 + return (__raw_readl(&qmgr_regs->stat1[queue >> 3]) 55 + >> ((queue & 7) << 2)) & 0xF; 56 + } 57 + 58 + static int __qmgr_get_stat2(unsigned int queue) 59 + { 60 + BUG_ON(queue >= HALF_QUEUES); 61 + return (__raw_readl(&qmgr_regs->stat2[queue >> 4]) 62 + >> ((queue & 0xF) << 1)) & 0x3; 63 + } 64 + 65 + /** 66 + * qmgr_stat_empty() - checks if a hardware queue is empty 67 + * @queue: queue number 68 + * 69 + * Returns non-zero value if the queue is empty. 70 + */ 71 + int qmgr_stat_empty(unsigned int queue) 72 + { 73 + BUG_ON(queue >= HALF_QUEUES); 74 + return __qmgr_get_stat1(queue) & QUEUE_STAT1_EMPTY; 75 + } 76 + 77 + /** 78 + * qmgr_stat_below_low_watermark() - checks if a queue is below low watermark 79 + * @queue: queue number 80 + * 81 + * Returns non-zero value if the queue is below low watermark. 82 + */ 83 + int qmgr_stat_below_low_watermark(unsigned int queue) 84 + { 85 + if (queue >= HALF_QUEUES) 86 + return (__raw_readl(&qmgr_regs->statne_h) >> 87 + (queue - HALF_QUEUES)) & 0x01; 88 + return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_EMPTY; 89 + } 90 + 91 + /** 92 + * qmgr_stat_full() - checks if a hardware queue is full 93 + * @queue: queue number 94 + * 95 + * Returns non-zero value if the queue is full. 96 + */ 97 + int qmgr_stat_full(unsigned int queue) 98 + { 99 + if (queue >= HALF_QUEUES) 100 + return (__raw_readl(&qmgr_regs->statf_h) >> 101 + (queue - HALF_QUEUES)) & 0x01; 102 + return __qmgr_get_stat1(queue) & QUEUE_STAT1_FULL; 103 + } 104 + 105 + /** 106 + * qmgr_stat_overflow() - checks if a hardware queue experienced overflow 107 + * @queue: queue number 108 + * 109 + * Returns non-zero value if the queue experienced overflow. 110 + */ 111 + int qmgr_stat_overflow(unsigned int queue) 112 + { 113 + return __qmgr_get_stat2(queue) & QUEUE_STAT2_OVERFLOW; 114 + } 30 115 31 116 void qmgr_set_irq(unsigned int queue, int src, 32 117 void (*handler)(void *pdev), void *pdev) ··· 186 95 187 96 static irqreturn_t qmgr_irq(int irq, void *pdev) 188 97 { 189 - int i, half = (irq == IRQ_IXP4XX_QM1 ? 0 : 1); 98 + int i, half = (irq == qmgr_irq_1 ? 0 : 1); 190 99 u32 req_bitmap = __raw_readl(&qmgr_regs->irqstat[half]); 191 100 192 101 if (!req_bitmap) ··· 373 282 module_put(THIS_MODULE); 374 283 } 375 284 376 - static int qmgr_init(void) 285 + static int ixp4xx_qmgr_probe(struct platform_device *pdev) 377 286 { 378 287 int i, err; 379 288 irq_handler_t handler1, handler2; 289 + struct device *dev = &pdev->dev; 290 + struct resource *res; 291 + int irq1, irq2; 380 292 381 - mem_res = request_mem_region(IXP4XX_QMGR_BASE_PHYS, 382 - IXP4XX_QMGR_REGION_SIZE, 383 - "IXP4xx Queue Manager"); 384 - if (mem_res == NULL) 385 - return -EBUSY; 293 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 294 + if (!res) 295 + return -ENODEV; 296 + qmgr_regs = devm_ioremap_resource(dev, res); 297 + if (!qmgr_regs) 298 + return -ENOMEM; 299 + 300 + irq1 = platform_get_irq(pdev, 0); 301 + if (irq1 <= 0) 302 + return irq1 ? irq1 : -EINVAL; 303 + qmgr_irq_1 = irq1; 304 + irq2 = platform_get_irq(pdev, 1); 305 + if (irq2 <= 0) 306 + return irq2 ? irq2 : -EINVAL; 307 + qmgr_irq_2 = irq2; 386 308 387 309 /* reset qmgr registers */ 388 310 for (i = 0; i < 4; i++) { ··· 420 316 } else 421 317 handler1 = handler2 = qmgr_irq; 422 318 423 - err = request_irq(IRQ_IXP4XX_QM1, handler1, 0, "IXP4xx Queue Manager", 424 - NULL); 319 + err = devm_request_irq(dev, irq1, handler1, 0, "IXP4xx Queue Manager", 320 + NULL); 425 321 if (err) { 426 - printk(KERN_ERR "qmgr: failed to request IRQ%i (%i)\n", 427 - IRQ_IXP4XX_QM1, err); 428 - goto error_irq; 322 + dev_err(dev, "failed to request IRQ%i (%i)\n", 323 + irq1, err); 324 + return err; 429 325 } 430 326 431 - err = request_irq(IRQ_IXP4XX_QM2, handler2, 0, "IXP4xx Queue Manager", 432 - NULL); 327 + err = devm_request_irq(dev, irq2, handler2, 0, "IXP4xx Queue Manager", 328 + NULL); 433 329 if (err) { 434 - printk(KERN_ERR "qmgr: failed to request IRQ%i (%i)\n", 435 - IRQ_IXP4XX_QM2, err); 436 - goto error_irq2; 330 + dev_err(dev, "failed to request IRQ%i (%i)\n", 331 + irq2, err); 332 + return err; 437 333 } 438 334 439 335 used_sram_bitmap[0] = 0xF; /* 4 first pages reserved for config */ 440 336 spin_lock_init(&qmgr_lock); 441 337 442 - printk(KERN_INFO "IXP4xx Queue Manager initialized.\n"); 338 + dev_info(dev, "IXP4xx Queue Manager initialized.\n"); 443 339 return 0; 444 - 445 - error_irq2: 446 - free_irq(IRQ_IXP4XX_QM1, NULL); 447 - error_irq: 448 - release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE); 449 - return err; 450 340 } 451 341 452 - static void qmgr_remove(void) 342 + static int ixp4xx_qmgr_remove(struct platform_device *pdev) 453 343 { 454 - free_irq(IRQ_IXP4XX_QM1, NULL); 455 - free_irq(IRQ_IXP4XX_QM2, NULL); 456 - synchronize_irq(IRQ_IXP4XX_QM1); 457 - synchronize_irq(IRQ_IXP4XX_QM2); 458 - release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE); 344 + synchronize_irq(qmgr_irq_1); 345 + synchronize_irq(qmgr_irq_2); 346 + return 0; 459 347 } 460 348 461 - module_init(qmgr_init); 462 - module_exit(qmgr_remove); 349 + static const struct of_device_id ixp4xx_qmgr_of_match[] = { 350 + { 351 + .compatible = "intel,ixp4xx-ahb-queue-manager", 352 + }, 353 + {}, 354 + }; 355 + 356 + static struct platform_driver ixp4xx_qmgr_driver = { 357 + .driver = { 358 + .name = "ixp4xx-qmgr", 359 + .of_match_table = of_match_ptr(ixp4xx_qmgr_of_match), 360 + }, 361 + .probe = ixp4xx_qmgr_probe, 362 + .remove = ixp4xx_qmgr_remove, 363 + }; 364 + module_platform_driver(ixp4xx_qmgr_driver); 463 365 464 366 MODULE_LICENSE("GPL v2"); 465 367 MODULE_AUTHOR("Krzysztof Halasa"); 466 368 369 + EXPORT_SYMBOL(qmgr_put_entry); 370 + EXPORT_SYMBOL(qmgr_get_entry); 371 + EXPORT_SYMBOL(qmgr_stat_empty); 372 + EXPORT_SYMBOL(qmgr_stat_below_low_watermark); 373 + EXPORT_SYMBOL(qmgr_stat_full); 374 + EXPORT_SYMBOL(qmgr_stat_overflow); 467 375 EXPORT_SYMBOL(qmgr_set_irq); 468 376 EXPORT_SYMBOL(qmgr_enable_irq); 469 377 EXPORT_SYMBOL(qmgr_disable_irq);
+2
arch/arm/mach-ixp4xx/nas100d-pci.c
··· 21 21 #include <asm/mach/pci.h> 22 22 #include <asm/mach-types.h> 23 23 24 + #include "irqs.h" 25 + 24 26 #define MAX_DEV 3 25 27 #define IRQ_LINES 3 26 28
+2 -3
arch/arm/mach-ixp4xx/nas100d-setup.c
··· 34 34 #include <asm/mach/arch.h> 35 35 #include <asm/mach/flash.h> 36 36 37 + #include "irqs.h" 38 + 37 39 #define NAS100D_SDA_PIN 5 38 40 #define NAS100D_SCL_PIN 6 39 41 ··· 280 278 int i; 281 279 282 280 ixp4xx_sys_init(); 283 - 284 - /* gpio 14 and 15 are _not_ clocks */ 285 - *IXP4XX_GPIO_GPCLKR = 0; 286 281 287 282 nas100d_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); 288 283 nas100d_flash_resource.end =
+2
arch/arm/mach-ixp4xx/nslu2-pci.c
··· 21 21 #include <asm/mach/pci.h> 22 22 #include <asm/mach-types.h> 23 23 24 + #include "irqs.h" 25 + 24 26 #define MAX_DEV 3 25 27 #define IRQ_LINES 3 26 28
+11 -1
arch/arm/mach-ixp4xx/nslu2-setup.c
··· 32 32 #include <asm/mach/flash.h> 33 33 #include <asm/mach/time.h> 34 34 35 + #include "irqs.h" 36 + 35 37 #define NSLU2_SDA_PIN 7 36 38 #define NSLU2_SCL_PIN 6 37 39 ··· 127 125 }, 128 126 }; 129 127 128 + static struct resource nslu2_beeper_resources[] = { 129 + { 130 + .start = IRQ_IXP4XX_TIMER2, 131 + .flags = IORESOURCE_IRQ, 132 + }, 133 + }; 134 + 130 135 static struct platform_device nslu2_beeper = { 131 136 .name = "ixp4xx-beeper", 132 137 .id = NSLU2_GPIO_BUZZ, 133 - .num_resources = 0, 138 + .resource = nslu2_beeper_resources, 139 + .num_resources = ARRAY_SIZE(nslu2_beeper_resources), 134 140 }; 135 141 136 142 static struct resource nslu2_uart_resources[] = {
+2
arch/arm/mach-ixp4xx/wg302v2-pci.c
··· 27 27 28 28 #include <asm/mach/pci.h> 29 29 30 + #include "irqs.h" 31 + 30 32 void __init wg302v2_pci_preinit(void) 31 33 { 32 34 irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW);
+2
arch/arm/mach-ixp4xx/wg302v2-setup.c
··· 29 29 #include <asm/mach/arch.h> 30 30 #include <asm/mach/flash.h> 31 31 32 + #include "irqs.h" 33 + 32 34 static struct flash_platform_data wg302v2_flash_data = { 33 35 .map_name = "cfi_probe", 34 36 .width = 2,
+3 -39
arch/arm/mach-lpc32xx/phy3250.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 1 2 /* 2 3 * Platform support for LPC32xx SoC 3 4 * ··· 6 5 * 7 6 * Copyright (C) 2012 Roland Stigge <stigge@antcom.de> 8 7 * Copyright (C) 2010 NXP Semiconductors 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of the GNU General Public License as published by 12 - * the Free Software Foundation; either version 2 of the License, or 13 - * (at your option) any later version. 14 - * 15 - * This program is distributed in the hope that it will be useful, 16 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 - * GNU General Public License for more details. 19 8 */ 20 9 21 - #include <linux/init.h> 22 - #include <linux/platform_device.h> 23 - #include <linux/device.h> 24 - #include <linux/interrupt.h> 25 - #include <linux/irq.h> 26 - #include <linux/dma-mapping.h> 27 - #include <linux/gpio.h> 28 - #include <linux/amba/bus.h> 29 - #include <linux/amba/clcd.h> 30 10 #include <linux/amba/pl08x.h> 31 - #include <linux/amba/mmci.h> 32 - #include <linux/of.h> 33 - #include <linux/of_address.h> 34 - #include <linux/of_irq.h> 35 - #include <linux/of_platform.h> 36 - #include <linux/clk.h> 37 - #include <linux/mtd/lpc32xx_slc.h> 38 11 #include <linux/mtd/lpc32xx_mlc.h> 12 + #include <linux/mtd/lpc32xx_slc.h> 13 + #include <linux/of_platform.h> 39 14 40 - #include <asm/setup.h> 41 - #include <asm/mach-types.h> 42 15 #include <asm/mach/arch.h> 43 - 44 - #include <mach/hardware.h> 45 - #include <mach/platform.h> 46 - #include <mach/board.h> 47 16 #include "common.h" 48 17 49 18 static struct pl08x_channel_data pl08x_slave_channels[] = { ··· 61 90 }; 62 91 63 92 static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = { 64 - OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", NULL), 65 - OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", NULL), 66 93 OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd), 67 94 OF_DEV_AUXDATA("nxp,lpc3220-slc", 0x20020000, "20020000.flash", 68 95 &lpc32xx_slc_data), ··· 72 103 static void __init lpc3250_machine_init(void) 73 104 { 74 105 lpc32xx_serial_init(); 75 - 76 - /* Test clock needed for UDA1380 initial init */ 77 - __raw_writel(LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC | 78 - LPC32XX_CLKPWR_TESTCLK_TESTCLK2_EN, 79 - LPC32XX_CLKPWR_TEST_CLK_SEL); 80 106 81 107 of_platform_default_populate(NULL, lpc32xx_auxdata_lookup, NULL); 82 108 }
+9
arch/arm/mach-omap2/common.h
··· 336 336 } 337 337 #endif 338 338 339 + #ifdef CONFIG_SOC_DRA7XX 340 + extern int dra7xx_pciess_reset(struct omap_hwmod *oh); 341 + #else 342 + static inline int dra7xx_pciess_reset(struct omap_hwmod *oh) 343 + { 344 + return 0; 345 + } 346 + #endif 347 + 339 348 void pdata_quirks_init(const struct of_device_id *); 340 349 void omap_auxdata_legacy_init(struct device *dev); 341 350 void omap_pcs_legacy_init(int irq, void (*rearm)(void));
+3 -8
arch/arm/mach-omap2/i2c.c
··· 53 53 u16 i2c_con; 54 54 int c = 0; 55 55 56 - if (oh->class->rev == OMAP_I2C_IP_VERSION_2) { 57 - i2c_con = OMAP4_I2C_CON_OFFSET; 58 - } else if (oh->class->rev == OMAP_I2C_IP_VERSION_1) { 56 + if (soc_is_omap24xx() || soc_is_omap34xx() || soc_is_am35xx()) 59 57 i2c_con = OMAP2_I2C_CON_OFFSET; 60 - } else { 61 - WARN(1, "Cannot reset I2C block %s: unsupported revision\n", 62 - oh->name); 63 - return -EINVAL; 64 - } 58 + else 59 + i2c_con = OMAP4_I2C_CON_OFFSET; 65 60 66 61 /* Disable I2C */ 67 62 v = omap_hwmod_read(oh, i2c_con);
+1 -6
arch/arm/mach-omap2/io.c
··· 411 411 412 412 static void __init __maybe_unused omap_hwmod_init_postsetup(void) 413 413 { 414 - u8 postsetup_state; 414 + u8 postsetup_state = _HWMOD_STATE_DEFAULT; 415 415 416 416 /* Set the default postsetup state for all hwmods */ 417 - #ifdef CONFIG_PM 418 - postsetup_state = _HWMOD_STATE_IDLE; 419 - #else 420 - postsetup_state = _HWMOD_STATE_ENABLED; 421 - #endif 422 417 omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state); 423 418 } 424 419
+8
arch/arm/mach-omap2/mmc.h
··· 7 7 #define OMAP4_MMC_REG_OFFSET 0x100 8 8 9 9 struct omap_hwmod; 10 + 11 + #ifdef CONFIG_SOC_OMAP2420 10 12 int omap_msdi_reset(struct omap_hwmod *oh); 13 + #else 14 + static inline int omap_msdi_reset(struct omap_hwmod *oh) 15 + { 16 + return 0; 17 + } 18 + #endif 11 19 12 20 /* called from board-specific card detection service routine */ 13 21 extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
+2 -2
arch/arm/mach-omap2/omap-wakeupgen.c
··· 436 436 { 437 437 switch (cmd) { 438 438 case CPU_CLUSTER_PM_ENTER: 439 - if (omap_type() == OMAP2_DEVICE_TYPE_GP) 439 + if (omap_type() == OMAP2_DEVICE_TYPE_GP || soc_is_am43xx()) 440 440 irq_save_context(); 441 441 else 442 442 irq_save_secure_context(); 443 443 break; 444 444 case CPU_CLUSTER_PM_EXIT: 445 - if (omap_type() == OMAP2_DEVICE_TYPE_GP) 445 + if (omap_type() == OMAP2_DEVICE_TYPE_GP || soc_is_am43xx()) 446 446 irq_restore_context(); 447 447 break; 448 448 }
+184 -26
arch/arm/mach-omap2/omap_hwmod.c
··· 155 155 #include "soc.h" 156 156 #include "common.h" 157 157 #include "clockdomain.h" 158 + #include "hdq1w.h" 159 + #include "mmc.h" 158 160 #include "powerdomain.h" 159 161 #include "cm2xxx.h" 160 162 #include "cm3xxx.h" ··· 167 165 #include "prm33xx.h" 168 166 #include "prminst44xx.h" 169 167 #include "pm.h" 168 + #include "wd_timer.h" 170 169 171 170 /* Name of the OMAP hwmod for the MPU */ 172 171 #define MPU_INITIATOR_NAME "mpu" ··· 208 205 static LIST_HEAD(clkctrl_providers); 209 206 210 207 /** 208 + * struct omap_hwmod_reset - IP specific reset functions 209 + * @match: string to match against the module name 210 + * @len: number of characters to match 211 + * @reset: IP specific reset function 212 + * 213 + * Used only in cases where struct omap_hwmod is dynamically allocated. 214 + */ 215 + struct omap_hwmod_reset { 216 + const char *match; 217 + int len; 218 + int (*reset)(struct omap_hwmod *oh); 219 + }; 220 + 221 + /** 211 222 * struct omap_hwmod_soc_ops - fn ptrs for some SoC-specific operations 212 223 * @enable_module: function to enable a module (via MODULEMODE) 213 224 * @disable_module: function to disable a module (via MODULEMODE) ··· 252 235 253 236 /* omap_hwmod_list contains all registered struct omap_hwmods */ 254 237 static LIST_HEAD(omap_hwmod_list); 238 + static DEFINE_MUTEX(list_lock); 255 239 256 240 /* mpu_oh: used to add/remove MPU initiator from sleepdep list */ 257 241 static struct omap_hwmod *mpu_oh; ··· 2483 2465 */ 2484 2466 static int _setup_reset(struct omap_hwmod *oh) 2485 2467 { 2486 - int r; 2468 + int r = 0; 2487 2469 2488 2470 if (oh->_state != _HWMOD_STATE_INITIALIZED) 2489 2471 return -EINVAL; ··· 2642 2624 * that the copy process would be relatively complex due to the large number 2643 2625 * of substructures. 2644 2626 */ 2645 - static int __init _register(struct omap_hwmod *oh) 2627 + static int _register(struct omap_hwmod *oh) 2646 2628 { 2647 2629 if (!oh || !oh->name || !oh->class || !oh->class->name || 2648 2630 (oh->_state != _HWMOD_STATE_UNKNOWN)) ··· 2681 2663 * locking in this code. Changes to this assumption will require 2682 2664 * additional locking. Returns 0. 2683 2665 */ 2684 - static int __init _add_link(struct omap_hwmod_ocp_if *oi) 2666 + static int _add_link(struct omap_hwmod_ocp_if *oi) 2685 2667 { 2686 2668 pr_debug("omap_hwmod: %s -> %s: adding link\n", oi->master->name, 2687 2669 oi->slave->name); ··· 3259 3241 * @sysc_offs: sysc register offset 3260 3242 * @syss_offs: syss register offset 3261 3243 */ 3262 - int omap_hwmod_init_reg_offs(struct device *dev, 3263 - const struct ti_sysc_module_data *data, 3264 - s32 *rev_offs, s32 *sysc_offs, s32 *syss_offs) 3244 + static int omap_hwmod_init_reg_offs(struct device *dev, 3245 + const struct ti_sysc_module_data *data, 3246 + s32 *rev_offs, s32 *sysc_offs, 3247 + s32 *syss_offs) 3265 3248 { 3266 3249 *rev_offs = -ENODEV; 3267 3250 *sysc_offs = 0; ··· 3286 3267 * @data: module data 3287 3268 * @sysc_flags: module configuration 3288 3269 */ 3289 - int omap_hwmod_init_sysc_flags(struct device *dev, 3290 - const struct ti_sysc_module_data *data, 3291 - u32 *sysc_flags) 3270 + static int omap_hwmod_init_sysc_flags(struct device *dev, 3271 + const struct ti_sysc_module_data *data, 3272 + u32 *sysc_flags) 3292 3273 { 3293 3274 *sysc_flags = 0; 3294 3275 ··· 3360 3341 * @data: module data 3361 3342 * @idlemodes: module supported idle modes 3362 3343 */ 3363 - int omap_hwmod_init_idlemodes(struct device *dev, 3364 - const struct ti_sysc_module_data *data, 3365 - u32 *idlemodes) 3344 + static int omap_hwmod_init_idlemodes(struct device *dev, 3345 + const struct ti_sysc_module_data *data, 3346 + u32 *idlemodes) 3366 3347 { 3367 3348 *idlemodes = 0; 3368 3349 ··· 3453 3434 * 3454 3435 * Note that the allocations here cannot use devm as ti-sysc can rebind. 3455 3436 */ 3456 - int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, 3457 - const struct ti_sysc_module_data *data, 3458 - struct sysc_regbits *sysc_fields, 3459 - s32 rev_offs, s32 sysc_offs, s32 syss_offs, 3460 - u32 sysc_flags, u32 idlemodes) 3437 + static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, 3438 + const struct ti_sysc_module_data *data, 3439 + struct sysc_regbits *sysc_fields, 3440 + s32 rev_offs, s32 sysc_offs, 3441 + s32 syss_offs, u32 sysc_flags, 3442 + u32 idlemodes) 3461 3443 { 3462 3444 struct omap_hwmod_class_sysconfig *sysc; 3463 - struct omap_hwmod_class *class; 3445 + struct omap_hwmod_class *class = NULL; 3446 + struct omap_hwmod_ocp_if *oi = NULL; 3447 + struct clockdomain *clkdm = NULL; 3448 + struct clk *clk = NULL; 3464 3449 void __iomem *regs = NULL; 3465 3450 unsigned long flags; 3466 3451 ··· 3488 3465 } 3489 3466 3490 3467 /* 3491 - * We need new oh->class as the other devices in the same class 3468 + * We may need a new oh->class as the other devices in the same class 3492 3469 * may not yet have ioremapped their registers. 3493 3470 */ 3494 - class = kmemdup(oh->class, sizeof(*oh->class), GFP_KERNEL); 3495 - if (!class) 3496 - return -ENOMEM; 3471 + if (oh->class->name && strcmp(oh->class->name, data->name)) { 3472 + class = kmemdup(oh->class, sizeof(*oh->class), GFP_KERNEL); 3473 + if (!class) 3474 + return -ENOMEM; 3475 + } 3497 3476 3498 - class->sysc = sysc; 3477 + if (list_empty(&oh->slave_ports)) { 3478 + oi = kcalloc(1, sizeof(*oi), GFP_KERNEL); 3479 + if (!oi) 3480 + return -ENOMEM; 3481 + 3482 + /* 3483 + * Note that we assume interconnect interface clocks will be 3484 + * managed by the interconnect driver for OCPIF_SWSUP_IDLE case 3485 + * on omap24xx and omap3. 3486 + */ 3487 + oi->slave = oh; 3488 + oi->user = OCP_USER_MPU | OCP_USER_SDMA; 3489 + } 3490 + 3491 + if (!oh->_clk) { 3492 + struct clk_hw_omap *hwclk; 3493 + 3494 + clk = of_clk_get_by_name(dev->of_node, "fck"); 3495 + if (!IS_ERR(clk)) 3496 + clk_prepare(clk); 3497 + else 3498 + clk = NULL; 3499 + 3500 + /* 3501 + * Populate clockdomain based on dts clock. It is needed for 3502 + * clkdm_deny_idle() and clkdm_allow_idle() until we have have 3503 + * interconnect driver and reset driver capable of blocking 3504 + * clockdomain idle during reset, enable and idle. 3505 + */ 3506 + if (clk) { 3507 + hwclk = to_clk_hw_omap(__clk_get_hw(clk)); 3508 + if (hwclk && hwclk->clkdm_name) 3509 + clkdm = clkdm_lookup(hwclk->clkdm_name); 3510 + } 3511 + 3512 + /* 3513 + * Note that we assume interconnect driver manages the clocks 3514 + * and do not need to populate oh->_clk for dynamically 3515 + * allocated modules. 3516 + */ 3517 + clk_unprepare(clk); 3518 + clk_put(clk); 3519 + } 3499 3520 3500 3521 spin_lock_irqsave(&oh->_lock, flags); 3501 3522 if (regs) 3502 3523 oh->_mpu_rt_va = regs; 3503 - oh->class = class; 3524 + if (class) 3525 + oh->class = class; 3526 + oh->class->sysc = sysc; 3527 + if (oi) 3528 + _add_link(oi); 3529 + if (clkdm) 3530 + oh->clkdm = clkdm; 3504 3531 oh->_state = _HWMOD_STATE_INITIALIZED; 3532 + oh->_postsetup_state = _HWMOD_STATE_DEFAULT; 3505 3533 _setup(oh, NULL); 3506 3534 spin_unlock_irqrestore(&oh->_lock, flags); 3507 3535 3508 3536 return 0; 3537 + } 3538 + 3539 + static const struct omap_hwmod_reset omap24xx_reset_quirks[] = { 3540 + { .match = "msdi", .len = 4, .reset = omap_msdi_reset, }, 3541 + }; 3542 + 3543 + static const struct omap_hwmod_reset dra7_reset_quirks[] = { 3544 + { .match = "pcie", .len = 4, .reset = dra7xx_pciess_reset, }, 3545 + }; 3546 + 3547 + static const struct omap_hwmod_reset omap_reset_quirks[] = { 3548 + { .match = "dss", .len = 3, .reset = omap_dss_reset, }, 3549 + { .match = "hdq1w", .len = 5, .reset = omap_hdq1w_reset, }, 3550 + { .match = "i2c", .len = 3, .reset = omap_i2c_reset, }, 3551 + { .match = "wd_timer", .len = 8, .reset = omap2_wd_timer_reset, }, 3552 + }; 3553 + 3554 + static void 3555 + omap_hwmod_init_reset_quirk(struct device *dev, struct omap_hwmod *oh, 3556 + const struct ti_sysc_module_data *data, 3557 + const struct omap_hwmod_reset *quirks, 3558 + int quirks_sz) 3559 + { 3560 + const struct omap_hwmod_reset *quirk; 3561 + int i; 3562 + 3563 + for (i = 0; i < quirks_sz; i++) { 3564 + quirk = &quirks[i]; 3565 + if (!strncmp(data->name, quirk->match, quirk->len)) { 3566 + oh->class->reset = quirk->reset; 3567 + 3568 + return; 3569 + } 3570 + } 3571 + } 3572 + 3573 + static void 3574 + omap_hwmod_init_reset_quirks(struct device *dev, struct omap_hwmod *oh, 3575 + const struct ti_sysc_module_data *data) 3576 + { 3577 + if (soc_is_omap24xx()) 3578 + omap_hwmod_init_reset_quirk(dev, oh, data, 3579 + omap24xx_reset_quirks, 3580 + ARRAY_SIZE(omap24xx_reset_quirks)); 3581 + 3582 + if (soc_is_dra7xx()) 3583 + omap_hwmod_init_reset_quirk(dev, oh, data, dra7_reset_quirks, 3584 + ARRAY_SIZE(dra7_reset_quirks)); 3585 + 3586 + omap_hwmod_init_reset_quirk(dev, oh, data, omap_reset_quirks, 3587 + ARRAY_SIZE(omap_reset_quirks)); 3509 3588 } 3510 3589 3511 3590 /** ··· 3630 3505 return -EINVAL; 3631 3506 3632 3507 oh = _lookup(data->name); 3633 - if (!oh) 3634 - return -ENODEV; 3508 + if (!oh) { 3509 + oh = kzalloc(sizeof(*oh), GFP_KERNEL); 3510 + if (!oh) 3511 + return -ENOMEM; 3512 + 3513 + oh->name = data->name; 3514 + oh->_state = _HWMOD_STATE_UNKNOWN; 3515 + lockdep_register_key(&oh->hwmod_key); 3516 + 3517 + /* Unused, can be handled by PRM driver handling resets */ 3518 + oh->prcm.omap4.flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT; 3519 + 3520 + oh->class = kzalloc(sizeof(*oh->class), GFP_KERNEL); 3521 + if (!oh->class) { 3522 + kfree(oh); 3523 + return -ENOMEM; 3524 + } 3525 + 3526 + omap_hwmod_init_reset_quirks(dev, oh, data); 3527 + 3528 + oh->class->name = data->name; 3529 + mutex_lock(&list_lock); 3530 + error = _register(oh); 3531 + mutex_unlock(&list_lock); 3532 + } 3635 3533 3636 3534 cookie->data = oh; 3637 3535 ··· 3675 3527 if (error) 3676 3528 return error; 3677 3529 3530 + if (data->cfg->quirks & SYSC_QUIRK_NO_IDLE) 3531 + oh->flags |= HWMOD_NO_IDLE; 3678 3532 if (data->cfg->quirks & SYSC_QUIRK_NO_IDLE_ON_INIT) 3679 3533 oh->flags |= HWMOD_INIT_NO_IDLE; 3680 3534 if (data->cfg->quirks & SYSC_QUIRK_NO_RESET_ON_INIT) 3681 3535 oh->flags |= HWMOD_INIT_NO_RESET; 3536 + if (data->cfg->quirks & SYSC_QUIRK_USE_CLOCKACT) 3537 + oh->flags |= HWMOD_SET_DEFAULT_CLOCKACT; 3538 + if (data->cfg->quirks & SYSC_QUIRK_SWSUP_SIDLE) 3539 + oh->flags |= HWMOD_SWSUP_SIDLE; 3540 + if (data->cfg->quirks & SYSC_QUIRK_SWSUP_SIDLE_ACT) 3541 + oh->flags |= HWMOD_SWSUP_SIDLE_ACT; 3542 + if (data->cfg->quirks & SYSC_QUIRK_SWSUP_MSTANDBY) 3543 + oh->flags |= HWMOD_SWSUP_MSTANDBY; 3682 3544 3683 3545 error = omap_hwmod_check_module(dev, oh, data, sysc_fields, 3684 3546 rev_offs, sysc_offs, syss_offs,
+6 -2
arch/arm/mach-omap2/omap_hwmod.h
··· 493 493 #define _HWMOD_STATE_IDLE 5 494 494 #define _HWMOD_STATE_DISABLED 6 495 495 496 + #ifdef CONFIG_PM 497 + #define _HWMOD_STATE_DEFAULT _HWMOD_STATE_IDLE 498 + #else 499 + #define _HWMOD_STATE_DEFAULT _HWMOD_STATE_ENABLED 500 + #endif 501 + 496 502 /** 497 503 * struct omap_hwmod_class - the type of an IP block 498 504 * @name: name of the hwmod_class 499 505 * @sysc: device SYSCONFIG/SYSSTATUS register data 500 - * @rev: revision of the IP class 501 506 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown 502 507 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn 503 508 * @enable_preprogram: ptr to fn to be executed during device enable ··· 528 523 struct omap_hwmod_class { 529 524 const char *name; 530 525 struct omap_hwmod_class_sysconfig *sysc; 531 - u32 rev; 532 526 int (*pre_shutdown)(struct omap_hwmod *oh); 533 527 int (*reset)(struct omap_hwmod *oh); 534 528 int (*enable_preprogram)(struct omap_hwmod *oh);
-1
arch/arm/mach-omap2/omap_hwmod_2420_data.c
··· 91 91 static struct omap_hwmod_class i2c_class = { 92 92 .name = "i2c", 93 93 .sysc = &i2c_sysc, 94 - .rev = OMAP_I2C_IP_VERSION_1, 95 94 .reset = &omap_i2c_reset, 96 95 }; 97 96
-1
arch/arm/mach-omap2/omap_hwmod_2430_data.c
··· 68 68 static struct omap_hwmod_class i2c_class = { 69 69 .name = "i2c", 70 70 .sysc = &i2c_sysc, 71 - .rev = OMAP_I2C_IP_VERSION_1, 72 71 .reset = &omap_i2c_reset, 73 72 }; 74 73
-1
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
··· 96 96 struct omap_hwmod_class omap2xxx_gpio_hwmod_class = { 97 97 .name = "gpio", 98 98 .sysc = &omap2xxx_gpio_sysc, 99 - .rev = 0, 100 99 }; 101 100 102 101 /* system dma */
-29
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
··· 30 30 extern struct omap_hwmod_ocp_if am33xx_l4_wkup__rtc; 31 31 extern struct omap_hwmod_ocp_if am33xx_l4_per__dcan0; 32 32 extern struct omap_hwmod_ocp_if am33xx_l4_per__dcan1; 33 - extern struct omap_hwmod_ocp_if am33xx_l4_per__gpio1; 34 - extern struct omap_hwmod_ocp_if am33xx_l4_per__gpio2; 35 - extern struct omap_hwmod_ocp_if am33xx_l4_per__gpio3; 36 33 extern struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio; 37 34 extern struct omap_hwmod_ocp_if am33xx_l4_ls__elm; 38 35 extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss0; 39 36 extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss1; 40 37 extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss2; 41 38 extern struct omap_hwmod_ocp_if am33xx_l3_s__gpmc; 42 - extern struct omap_hwmod_ocp_if am33xx_l4_per__i2c2; 43 - extern struct omap_hwmod_ocp_if am33xx_l4_per__i2c3; 44 39 extern struct omap_hwmod_ocp_if am33xx_l4_per__mailbox; 45 40 extern struct omap_hwmod_ocp_if am33xx_l4_ls__spinlock; 46 41 extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp0; 47 42 extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp1; 48 - extern struct omap_hwmod_ocp_if am33xx_l4_ls__mmc0; 49 - extern struct omap_hwmod_ocp_if am33xx_l4_ls__mmc1; 50 - extern struct omap_hwmod_ocp_if am33xx_l3_s__mmc2; 51 43 extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi0; 52 44 extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi1; 53 45 extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer2; ··· 52 60 extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc0; 53 61 extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc1; 54 62 extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc2; 55 - extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart2; 56 - extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart3; 57 - extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart4; 58 - extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart5; 59 - extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart6; 60 63 extern struct omap_hwmod_ocp_if am33xx_l3_main__ocmc; 61 64 extern struct omap_hwmod_ocp_if am33xx_l3_main__sha0; 62 65 extern struct omap_hwmod_ocp_if am33xx_l3_main__aes0; ··· 80 93 extern struct omap_hwmod am33xx_epwmss0_hwmod; 81 94 extern struct omap_hwmod am33xx_epwmss1_hwmod; 82 95 extern struct omap_hwmod am33xx_epwmss2_hwmod; 83 - extern struct omap_hwmod am33xx_gpio1_hwmod; 84 - extern struct omap_hwmod am33xx_gpio2_hwmod; 85 - extern struct omap_hwmod am33xx_gpio3_hwmod; 86 96 extern struct omap_hwmod am33xx_gpmc_hwmod; 87 - extern struct omap_hwmod am33xx_i2c1_hwmod; 88 - extern struct omap_hwmod am33xx_i2c2_hwmod; 89 - extern struct omap_hwmod am33xx_i2c3_hwmod; 90 97 extern struct omap_hwmod am33xx_mailbox_hwmod; 91 98 extern struct omap_hwmod am33xx_mcasp0_hwmod; 92 99 extern struct omap_hwmod am33xx_mcasp1_hwmod; 93 - extern struct omap_hwmod am33xx_mmc0_hwmod; 94 - extern struct omap_hwmod am33xx_mmc1_hwmod; 95 - extern struct omap_hwmod am33xx_mmc2_hwmod; 96 100 extern struct omap_hwmod am33xx_rtc_hwmod; 97 101 extern struct omap_hwmod am33xx_spi0_hwmod; 98 102 extern struct omap_hwmod am33xx_spi1_hwmod; ··· 99 121 extern struct omap_hwmod am33xx_tptc0_hwmod; 100 122 extern struct omap_hwmod am33xx_tptc1_hwmod; 101 123 extern struct omap_hwmod am33xx_tptc2_hwmod; 102 - extern struct omap_hwmod am33xx_uart1_hwmod; 103 - extern struct omap_hwmod am33xx_uart2_hwmod; 104 - extern struct omap_hwmod am33xx_uart3_hwmod; 105 - extern struct omap_hwmod am33xx_uart4_hwmod; 106 - extern struct omap_hwmod am33xx_uart5_hwmod; 107 - extern struct omap_hwmod am33xx_uart6_hwmod; 108 124 extern struct omap_hwmod am33xx_wd_timer1_hwmod; 109 125 110 126 extern struct omap_hwmod_class am33xx_emif_hwmod_class; 111 127 extern struct omap_hwmod_class am33xx_l4_hwmod_class; 112 128 extern struct omap_hwmod_class am33xx_wkup_m3_hwmod_class; 113 129 extern struct omap_hwmod_class am33xx_control_hwmod_class; 114 - extern struct omap_hwmod_class am33xx_gpio_hwmod_class; 115 130 extern struct omap_hwmod_class am33xx_timer_hwmod_class; 116 131 extern struct omap_hwmod_class am33xx_epwmss_hwmod_class; 117 132 extern struct omap_hwmod_class am33xx_ehrpwm_hwmod_class;
-103
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
··· 122 122 .user = OCP_USER_MPU | OCP_USER_SDMA, 123 123 }; 124 124 125 - /* l4 per/ls -> GPIO2 */ 126 - struct omap_hwmod_ocp_if am33xx_l4_per__gpio1 = { 127 - .master = &am33xx_l4_ls_hwmod, 128 - .slave = &am33xx_gpio1_hwmod, 129 - .clk = "l4ls_gclk", 130 - .user = OCP_USER_MPU | OCP_USER_SDMA, 131 - }; 132 - 133 - /* l4 per/ls -> gpio3 */ 134 - struct omap_hwmod_ocp_if am33xx_l4_per__gpio2 = { 135 - .master = &am33xx_l4_ls_hwmod, 136 - .slave = &am33xx_gpio2_hwmod, 137 - .clk = "l4ls_gclk", 138 - .user = OCP_USER_MPU | OCP_USER_SDMA, 139 - }; 140 - 141 - /* l4 per/ls -> gpio4 */ 142 - struct omap_hwmod_ocp_if am33xx_l4_per__gpio3 = { 143 - .master = &am33xx_l4_ls_hwmod, 144 - .slave = &am33xx_gpio3_hwmod, 145 - .clk = "l4ls_gclk", 146 - .user = OCP_USER_MPU | OCP_USER_SDMA, 147 - }; 148 - 149 125 struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = { 150 126 .master = &am33xx_cpgmac0_hwmod, 151 127 .slave = &am33xx_mdio_hwmod, ··· 164 188 .user = OCP_USER_MPU, 165 189 }; 166 190 167 - /* i2c2 */ 168 - struct omap_hwmod_ocp_if am33xx_l4_per__i2c2 = { 169 - .master = &am33xx_l4_ls_hwmod, 170 - .slave = &am33xx_i2c2_hwmod, 171 - .clk = "l4ls_gclk", 172 - .user = OCP_USER_MPU, 173 - }; 174 - 175 - struct omap_hwmod_ocp_if am33xx_l4_per__i2c3 = { 176 - .master = &am33xx_l4_ls_hwmod, 177 - .slave = &am33xx_i2c3_hwmod, 178 - .clk = "l4ls_gclk", 179 - .user = OCP_USER_MPU, 180 - }; 181 - 182 191 /* l4 ls -> mailbox */ 183 192 struct omap_hwmod_ocp_if am33xx_l4_per__mailbox = { 184 193 .master = &am33xx_l4_ls_hwmod, ··· 193 232 .master = &am33xx_l4_ls_hwmod, 194 233 .slave = &am33xx_mcasp1_hwmod, 195 234 .clk = "l4ls_gclk", 196 - .user = OCP_USER_MPU, 197 - }; 198 - 199 - /* l4 ls -> mmc0 */ 200 - struct omap_hwmod_ocp_if am33xx_l4_ls__mmc0 = { 201 - .master = &am33xx_l4_ls_hwmod, 202 - .slave = &am33xx_mmc0_hwmod, 203 - .clk = "l4ls_gclk", 204 - .user = OCP_USER_MPU, 205 - }; 206 - 207 - /* l4 ls -> mmc1 */ 208 - struct omap_hwmod_ocp_if am33xx_l4_ls__mmc1 = { 209 - .master = &am33xx_l4_ls_hwmod, 210 - .slave = &am33xx_mmc1_hwmod, 211 - .clk = "l4ls_gclk", 212 - .user = OCP_USER_MPU, 213 - }; 214 - 215 - /* l3 s -> mmc2 */ 216 - struct omap_hwmod_ocp_if am33xx_l3_s__mmc2 = { 217 - .master = &am33xx_l3_s_hwmod, 218 - .slave = &am33xx_mmc2_hwmod, 219 - .clk = "l3s_gclk", 220 235 .user = OCP_USER_MPU, 221 236 }; 222 237 ··· 289 352 .master = &am33xx_l3_main_hwmod, 290 353 .slave = &am33xx_tptc2_hwmod, 291 354 .clk = "l3_gclk", 292 - .user = OCP_USER_MPU, 293 - }; 294 - 295 - /* l4 ls -> uart2 */ 296 - struct omap_hwmod_ocp_if am33xx_l4_ls__uart2 = { 297 - .master = &am33xx_l4_ls_hwmod, 298 - .slave = &am33xx_uart2_hwmod, 299 - .clk = "l4ls_gclk", 300 - .user = OCP_USER_MPU, 301 - }; 302 - 303 - /* l4 ls -> uart3 */ 304 - struct omap_hwmod_ocp_if am33xx_l4_ls__uart3 = { 305 - .master = &am33xx_l4_ls_hwmod, 306 - .slave = &am33xx_uart3_hwmod, 307 - .clk = "l4ls_gclk", 308 - .user = OCP_USER_MPU, 309 - }; 310 - 311 - /* l4 ls -> uart4 */ 312 - struct omap_hwmod_ocp_if am33xx_l4_ls__uart4 = { 313 - .master = &am33xx_l4_ls_hwmod, 314 - .slave = &am33xx_uart4_hwmod, 315 - .clk = "l4ls_gclk", 316 - .user = OCP_USER_MPU, 317 - }; 318 - 319 - /* l4 ls -> uart5 */ 320 - struct omap_hwmod_ocp_if am33xx_l4_ls__uart5 = { 321 - .master = &am33xx_l4_ls_hwmod, 322 - .slave = &am33xx_uart5_hwmod, 323 - .clk = "l4ls_gclk", 324 - .user = OCP_USER_MPU, 325 - }; 326 - 327 - /* l4 ls -> uart6 */ 328 - struct omap_hwmod_ocp_if am33xx_l4_ls__uart6 = { 329 - .master = &am33xx_l4_ls_hwmod, 330 - .slave = &am33xx_uart6_hwmod, 331 - .clk = "l4ls_gclk", 332 355 .user = OCP_USER_MPU, 333 356 }; 334 357
-255
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
··· 16 16 17 17 #include <linux/types.h> 18 18 19 - #include <linux/platform_data/hsmmc-omap.h> 20 19 #include "omap_hwmod.h" 21 - #include "i2c.h" 22 20 #include "wd_timer.h" 23 21 #include "cm33xx.h" 24 22 #include "prm33xx.h" ··· 532 534 struct omap_hwmod_class am33xx_gpio_hwmod_class = { 533 535 .name = "gpio", 534 536 .sysc = &am33xx_gpio_sysc, 535 - .rev = 2, 536 537 }; 537 538 538 539 /* gpio1 */ ··· 624 627 }, 625 628 }; 626 629 627 - /* 'i2c' class */ 628 - static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = { 629 - .rev_offs = 0, 630 - .sysc_offs = 0x0010, 631 - .syss_offs = 0x0090, 632 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | 633 - SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 634 - SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), 635 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 636 - SIDLE_SMART_WKUP), 637 - .sysc_fields = &omap_hwmod_sysc_type1, 638 - }; 639 - 640 - static struct omap_hwmod_class i2c_class = { 641 - .name = "i2c", 642 - .sysc = &am33xx_i2c_sysc, 643 - .rev = OMAP_I2C_IP_VERSION_2, 644 - .reset = &omap_i2c_reset, 645 - }; 646 - 647 - /* i2c1 */ 648 - struct omap_hwmod am33xx_i2c1_hwmod = { 649 - .name = "i2c1", 650 - .class = &i2c_class, 651 - .clkdm_name = "l4_wkup_clkdm", 652 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 653 - .main_clk = "dpll_per_m2_div4_wkupdm_ck", 654 - .prcm = { 655 - .omap4 = { 656 - .modulemode = MODULEMODE_SWCTRL, 657 - }, 658 - }, 659 - }; 660 - 661 - /* i2c1 */ 662 - struct omap_hwmod am33xx_i2c2_hwmod = { 663 - .name = "i2c2", 664 - .class = &i2c_class, 665 - .clkdm_name = "l4ls_clkdm", 666 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 667 - .main_clk = "dpll_per_m2_div4_ck", 668 - .prcm = { 669 - .omap4 = { 670 - .modulemode = MODULEMODE_SWCTRL, 671 - }, 672 - }, 673 - }; 674 - 675 - /* i2c3 */ 676 - struct omap_hwmod am33xx_i2c3_hwmod = { 677 - .name = "i2c3", 678 - .class = &i2c_class, 679 - .clkdm_name = "l4ls_clkdm", 680 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 681 - .main_clk = "dpll_per_m2_div4_ck", 682 - .prcm = { 683 - .omap4 = { 684 - .modulemode = MODULEMODE_SWCTRL, 685 - }, 686 - }, 687 - }; 688 - 689 630 /* 690 631 * 'mailbox' class 691 632 * mailbox module allowing communication between the on-chip processors using a ··· 695 760 .modulemode = MODULEMODE_SWCTRL, 696 761 }, 697 762 }, 698 - }; 699 - 700 - /* 'mmc' class */ 701 - static struct omap_hwmod_class_sysconfig am33xx_mmc_sysc = { 702 - .rev_offs = 0x2fc, 703 - .sysc_offs = 0x110, 704 - .syss_offs = 0x114, 705 - .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | 706 - SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | 707 - SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), 708 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 709 - .sysc_fields = &omap_hwmod_sysc_type1, 710 - }; 711 - 712 - static struct omap_hwmod_class am33xx_mmc_hwmod_class = { 713 - .name = "mmc", 714 - .sysc = &am33xx_mmc_sysc, 715 - }; 716 - 717 - /* mmc0 */ 718 - static struct omap_hsmmc_dev_attr am33xx_mmc0_dev_attr = { 719 - .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, 720 - }; 721 - 722 - struct omap_hwmod am33xx_mmc0_hwmod = { 723 - .name = "mmc1", 724 - .class = &am33xx_mmc_hwmod_class, 725 - .clkdm_name = "l4ls_clkdm", 726 - .main_clk = "mmc_clk", 727 - .prcm = { 728 - .omap4 = { 729 - .modulemode = MODULEMODE_SWCTRL, 730 - }, 731 - }, 732 - .dev_attr = &am33xx_mmc0_dev_attr, 733 - }; 734 - 735 - /* mmc1 */ 736 - static struct omap_hsmmc_dev_attr am33xx_mmc1_dev_attr = { 737 - .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, 738 - }; 739 - 740 - struct omap_hwmod am33xx_mmc1_hwmod = { 741 - .name = "mmc2", 742 - .class = &am33xx_mmc_hwmod_class, 743 - .clkdm_name = "l4ls_clkdm", 744 - .main_clk = "mmc_clk", 745 - .prcm = { 746 - .omap4 = { 747 - .modulemode = MODULEMODE_SWCTRL, 748 - }, 749 - }, 750 - .dev_attr = &am33xx_mmc1_dev_attr, 751 - }; 752 - 753 - /* mmc2 */ 754 - static struct omap_hsmmc_dev_attr am33xx_mmc2_dev_attr = { 755 - .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, 756 - }; 757 - struct omap_hwmod am33xx_mmc2_hwmod = { 758 - .name = "mmc3", 759 - .class = &am33xx_mmc_hwmod_class, 760 - .clkdm_name = "l3s_clkdm", 761 - .main_clk = "mmc_clk", 762 - .prcm = { 763 - .omap4 = { 764 - .modulemode = MODULEMODE_SWCTRL, 765 - }, 766 - }, 767 - .dev_attr = &am33xx_mmc2_dev_attr, 768 763 }; 769 764 770 765 /* ··· 997 1132 }, 998 1133 }; 999 1134 1000 - /* 'uart' class */ 1001 - static struct omap_hwmod_class_sysconfig uart_sysc = { 1002 - .rev_offs = 0x50, 1003 - .sysc_offs = 0x54, 1004 - .syss_offs = 0x58, 1005 - .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP | 1006 - SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 1007 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1008 - SIDLE_SMART_WKUP), 1009 - .sysc_fields = &omap_hwmod_sysc_type1, 1010 - }; 1011 - 1012 - static struct omap_hwmod_class uart_class = { 1013 - .name = "uart", 1014 - .sysc = &uart_sysc, 1015 - }; 1016 - 1017 - struct omap_hwmod am33xx_uart1_hwmod = { 1018 - .name = "uart1", 1019 - .class = &uart_class, 1020 - .clkdm_name = "l4_wkup_clkdm", 1021 - .flags = DEBUG_AM33XXUART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT, 1022 - .main_clk = "dpll_per_m2_div4_wkupdm_ck", 1023 - .prcm = { 1024 - .omap4 = { 1025 - .modulemode = MODULEMODE_SWCTRL, 1026 - }, 1027 - }, 1028 - }; 1029 - 1030 - struct omap_hwmod am33xx_uart2_hwmod = { 1031 - .name = "uart2", 1032 - .class = &uart_class, 1033 - .clkdm_name = "l4ls_clkdm", 1034 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1035 - .main_clk = "dpll_per_m2_div4_ck", 1036 - .prcm = { 1037 - .omap4 = { 1038 - .modulemode = MODULEMODE_SWCTRL, 1039 - }, 1040 - }, 1041 - }; 1042 - 1043 - /* uart3 */ 1044 - struct omap_hwmod am33xx_uart3_hwmod = { 1045 - .name = "uart3", 1046 - .class = &uart_class, 1047 - .clkdm_name = "l4ls_clkdm", 1048 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1049 - .main_clk = "dpll_per_m2_div4_ck", 1050 - .prcm = { 1051 - .omap4 = { 1052 - .modulemode = MODULEMODE_SWCTRL, 1053 - }, 1054 - }, 1055 - }; 1056 - 1057 - struct omap_hwmod am33xx_uart4_hwmod = { 1058 - .name = "uart4", 1059 - .class = &uart_class, 1060 - .clkdm_name = "l4ls_clkdm", 1061 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1062 - .main_clk = "dpll_per_m2_div4_ck", 1063 - .prcm = { 1064 - .omap4 = { 1065 - .modulemode = MODULEMODE_SWCTRL, 1066 - }, 1067 - }, 1068 - }; 1069 - 1070 - struct omap_hwmod am33xx_uart5_hwmod = { 1071 - .name = "uart5", 1072 - .class = &uart_class, 1073 - .clkdm_name = "l4ls_clkdm", 1074 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1075 - .main_clk = "dpll_per_m2_div4_ck", 1076 - .prcm = { 1077 - .omap4 = { 1078 - .modulemode = MODULEMODE_SWCTRL, 1079 - }, 1080 - }, 1081 - }; 1082 - 1083 - struct omap_hwmod am33xx_uart6_hwmod = { 1084 - .name = "uart6", 1085 - .class = &uart_class, 1086 - .clkdm_name = "l4ls_clkdm", 1087 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1088 - .main_clk = "dpll_per_m2_div4_ck", 1089 - .prcm = { 1090 - .omap4 = { 1091 - .modulemode = MODULEMODE_SWCTRL, 1092 - }, 1093 - }, 1094 - }; 1095 - 1096 1135 /* 'wd_timer' class */ 1097 1136 static struct omap_hwmod_class_sysconfig wdt_sysc = { 1098 1137 .rev_offs = 0x0, ··· 1034 1265 1035 1266 static void omap_hwmod_am33xx_clkctrl(void) 1036 1267 { 1037 - CLKCTRL(am33xx_uart2_hwmod, AM33XX_CM_PER_UART1_CLKCTRL_OFFSET); 1038 - CLKCTRL(am33xx_uart3_hwmod, AM33XX_CM_PER_UART2_CLKCTRL_OFFSET); 1039 - CLKCTRL(am33xx_uart4_hwmod, AM33XX_CM_PER_UART3_CLKCTRL_OFFSET); 1040 - CLKCTRL(am33xx_uart5_hwmod, AM33XX_CM_PER_UART4_CLKCTRL_OFFSET); 1041 - CLKCTRL(am33xx_uart6_hwmod, AM33XX_CM_PER_UART5_CLKCTRL_OFFSET); 1042 1268 CLKCTRL(am33xx_dcan0_hwmod, AM33XX_CM_PER_DCAN0_CLKCTRL_OFFSET); 1043 1269 CLKCTRL(am33xx_dcan1_hwmod, AM33XX_CM_PER_DCAN1_CLKCTRL_OFFSET); 1044 1270 CLKCTRL(am33xx_elm_hwmod, AM33XX_CM_PER_ELM_CLKCTRL_OFFSET); ··· 1043 1279 CLKCTRL(am33xx_gpio1_hwmod, AM33XX_CM_PER_GPIO1_CLKCTRL_OFFSET); 1044 1280 CLKCTRL(am33xx_gpio2_hwmod, AM33XX_CM_PER_GPIO2_CLKCTRL_OFFSET); 1045 1281 CLKCTRL(am33xx_gpio3_hwmod, AM33XX_CM_PER_GPIO3_CLKCTRL_OFFSET); 1046 - CLKCTRL(am33xx_i2c2_hwmod, AM33XX_CM_PER_I2C1_CLKCTRL_OFFSET); 1047 - CLKCTRL(am33xx_i2c3_hwmod, AM33XX_CM_PER_I2C2_CLKCTRL_OFFSET); 1048 1282 CLKCTRL(am33xx_mailbox_hwmod, AM33XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET); 1049 1283 CLKCTRL(am33xx_mcasp0_hwmod, AM33XX_CM_PER_MCASP0_CLKCTRL_OFFSET); 1050 1284 CLKCTRL(am33xx_mcasp1_hwmod, AM33XX_CM_PER_MCASP1_CLKCTRL_OFFSET); 1051 - CLKCTRL(am33xx_mmc0_hwmod, AM33XX_CM_PER_MMC0_CLKCTRL_OFFSET); 1052 - CLKCTRL(am33xx_mmc1_hwmod, AM33XX_CM_PER_MMC1_CLKCTRL_OFFSET); 1053 1285 CLKCTRL(am33xx_spi0_hwmod, AM33XX_CM_PER_SPI0_CLKCTRL_OFFSET); 1054 1286 CLKCTRL(am33xx_spi1_hwmod, AM33XX_CM_PER_SPI1_CLKCTRL_OFFSET); 1055 1287 CLKCTRL(am33xx_spinlock_hwmod, AM33XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET); ··· 1059 1299 AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET); 1060 1300 CLKCTRL(am33xx_smartreflex1_hwmod, 1061 1301 AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET); 1062 - CLKCTRL(am33xx_uart1_hwmod, AM33XX_CM_WKUP_UART0_CLKCTRL_OFFSET); 1063 1302 CLKCTRL(am33xx_timer1_hwmod, AM33XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET); 1064 - CLKCTRL(am33xx_i2c1_hwmod, AM33XX_CM_WKUP_I2C0_CLKCTRL_OFFSET); 1065 1303 CLKCTRL(am33xx_wd_timer1_hwmod, AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET); 1066 1304 CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET); 1067 1305 PRCM_FLAGS(am33xx_rtc_hwmod, HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET); 1068 - CLKCTRL(am33xx_mmc2_hwmod, AM33XX_CM_PER_MMC2_CLKCTRL_OFFSET); 1069 1306 CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET); 1070 1307 CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET); 1071 1308 CLKCTRL(am33xx_l4_wkup_hwmod, AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET); ··· 1097 1340 1098 1341 static void omap_hwmod_am43xx_clkctrl(void) 1099 1342 { 1100 - CLKCTRL(am33xx_uart2_hwmod, AM43XX_CM_PER_UART1_CLKCTRL_OFFSET); 1101 - CLKCTRL(am33xx_uart3_hwmod, AM43XX_CM_PER_UART2_CLKCTRL_OFFSET); 1102 - CLKCTRL(am33xx_uart4_hwmod, AM43XX_CM_PER_UART3_CLKCTRL_OFFSET); 1103 - CLKCTRL(am33xx_uart5_hwmod, AM43XX_CM_PER_UART4_CLKCTRL_OFFSET); 1104 - CLKCTRL(am33xx_uart6_hwmod, AM43XX_CM_PER_UART5_CLKCTRL_OFFSET); 1105 1343 CLKCTRL(am33xx_dcan0_hwmod, AM43XX_CM_PER_DCAN0_CLKCTRL_OFFSET); 1106 1344 CLKCTRL(am33xx_dcan1_hwmod, AM43XX_CM_PER_DCAN1_CLKCTRL_OFFSET); 1107 1345 CLKCTRL(am33xx_elm_hwmod, AM43XX_CM_PER_ELM_CLKCTRL_OFFSET); ··· 1106 1354 CLKCTRL(am33xx_gpio1_hwmod, AM43XX_CM_PER_GPIO1_CLKCTRL_OFFSET); 1107 1355 CLKCTRL(am33xx_gpio2_hwmod, AM43XX_CM_PER_GPIO2_CLKCTRL_OFFSET); 1108 1356 CLKCTRL(am33xx_gpio3_hwmod, AM43XX_CM_PER_GPIO3_CLKCTRL_OFFSET); 1109 - CLKCTRL(am33xx_i2c2_hwmod, AM43XX_CM_PER_I2C1_CLKCTRL_OFFSET); 1110 - CLKCTRL(am33xx_i2c3_hwmod, AM43XX_CM_PER_I2C2_CLKCTRL_OFFSET); 1111 1357 CLKCTRL(am33xx_mailbox_hwmod, AM43XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET); 1112 1358 CLKCTRL(am33xx_mcasp0_hwmod, AM43XX_CM_PER_MCASP0_CLKCTRL_OFFSET); 1113 1359 CLKCTRL(am33xx_mcasp1_hwmod, AM43XX_CM_PER_MCASP1_CLKCTRL_OFFSET); 1114 - CLKCTRL(am33xx_mmc0_hwmod, AM43XX_CM_PER_MMC0_CLKCTRL_OFFSET); 1115 - CLKCTRL(am33xx_mmc1_hwmod, AM43XX_CM_PER_MMC1_CLKCTRL_OFFSET); 1116 1360 CLKCTRL(am33xx_spi0_hwmod, AM43XX_CM_PER_SPI0_CLKCTRL_OFFSET); 1117 1361 CLKCTRL(am33xx_spi1_hwmod, AM43XX_CM_PER_SPI1_CLKCTRL_OFFSET); 1118 1362 CLKCTRL(am33xx_spinlock_hwmod, AM43XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET); ··· 1122 1374 AM43XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET); 1123 1375 CLKCTRL(am33xx_smartreflex1_hwmod, 1124 1376 AM43XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET); 1125 - CLKCTRL(am33xx_uart1_hwmod, AM43XX_CM_WKUP_UART0_CLKCTRL_OFFSET); 1126 1377 CLKCTRL(am33xx_timer1_hwmod, AM43XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET); 1127 - CLKCTRL(am33xx_i2c1_hwmod, AM43XX_CM_WKUP_I2C0_CLKCTRL_OFFSET); 1128 1378 CLKCTRL(am33xx_wd_timer1_hwmod, AM43XX_CM_WKUP_WDT1_CLKCTRL_OFFSET); 1129 1379 CLKCTRL(am33xx_rtc_hwmod, AM43XX_CM_RTC_RTC_CLKCTRL_OFFSET); 1130 - CLKCTRL(am33xx_mmc2_hwmod, AM43XX_CM_PER_MMC2_CLKCTRL_OFFSET); 1131 1380 CLKCTRL(am33xx_gpmc_hwmod, AM43XX_CM_PER_GPMC_CLKCTRL_OFFSET); 1132 1381 CLKCTRL(am33xx_l4_ls_hwmod, AM43XX_CM_PER_L4LS_CLKCTRL_OFFSET); 1133 1382 CLKCTRL(am33xx_l4_wkup_hwmod, AM43XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);
-64
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
··· 14 14 * GNU General Public License for more details. 15 15 */ 16 16 17 - #include <linux/platform_data/i2c-omap.h> 18 - 19 17 #include "omap_hwmod.h" 20 18 #include "omap_hwmod_common_data.h" 21 19 ··· 21 23 #include "cm33xx.h" 22 24 #include "prm33xx.h" 23 25 #include "prm-regbits-33xx.h" 24 - #include "i2c.h" 25 26 #include "wd_timer.h" 26 27 #include "omap_hwmod_33xx_43xx_common_data.h" 27 28 ··· 227 230 }, 228 231 }; 229 232 230 - /* gpio0 */ 231 - static struct omap_hwmod_opt_clk gpio0_opt_clks[] = { 232 - { .role = "dbclk", .clk = "gpio0_dbclk" }, 233 - }; 234 - 235 - static struct omap_hwmod am33xx_gpio0_hwmod = { 236 - .name = "gpio1", 237 - .class = &am33xx_gpio_hwmod_class, 238 - .clkdm_name = "l4_wkup_clkdm", 239 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 240 - .main_clk = "dpll_core_m4_div2_ck", 241 - .prcm = { 242 - .omap4 = { 243 - .clkctrl_offs = AM33XX_CM_WKUP_GPIO0_CLKCTRL_OFFSET, 244 - .modulemode = MODULEMODE_SWCTRL, 245 - }, 246 - }, 247 - .opt_clks = gpio0_opt_clks, 248 - .opt_clks_cnt = ARRAY_SIZE(gpio0_opt_clks), 249 - }; 250 - 251 233 /* lcdc */ 252 234 static struct omap_hwmod_class_sysconfig lcdc_sysc = { 253 235 .rev_offs = 0x0, ··· 364 388 .user = OCP_USER_MPU, 365 389 }; 366 390 367 - /* L4 WKUP -> I2C1 */ 368 - static struct omap_hwmod_ocp_if am33xx_l4_wkup__i2c1 = { 369 - .master = &am33xx_l4_wkup_hwmod, 370 - .slave = &am33xx_i2c1_hwmod, 371 - .clk = "dpll_core_m4_div2_ck", 372 - .user = OCP_USER_MPU, 373 - }; 374 - 375 - /* L4 WKUP -> GPIO1 */ 376 - static struct omap_hwmod_ocp_if am33xx_l4_wkup__gpio0 = { 377 - .master = &am33xx_l4_wkup_hwmod, 378 - .slave = &am33xx_gpio0_hwmod, 379 - .clk = "dpll_core_m4_div2_ck", 380 - .user = OCP_USER_MPU | OCP_USER_SDMA, 381 - }; 382 - 383 391 /* L4 WKUP -> ADC_TSC */ 384 392 static struct omap_hwmod_ocp_if am33xx_l4_wkup__adc_tsc = { 385 393 .master = &am33xx_l4_wkup_hwmod, ··· 390 430 static struct omap_hwmod_ocp_if am33xx_l4_wkup__timer1 = { 391 431 .master = &am33xx_l4_wkup_hwmod, 392 432 .slave = &am33xx_timer1_hwmod, 393 - .clk = "dpll_core_m4_div2_ck", 394 - .user = OCP_USER_MPU, 395 - }; 396 - 397 - /* l4 wkup -> uart1 */ 398 - static struct omap_hwmod_ocp_if am33xx_l4_wkup__uart1 = { 399 - .master = &am33xx_l4_wkup_hwmod, 400 - .slave = &am33xx_uart1_hwmod, 401 433 .clk = "dpll_core_m4_div2_ck", 402 434 .user = OCP_USER_MPU, 403 435 }; ··· 431 479 &am33xx_l4_wkup__control, 432 480 &am33xx_l4_wkup__smartreflex0, 433 481 &am33xx_l4_wkup__smartreflex1, 434 - &am33xx_l4_wkup__uart1, 435 482 &am33xx_l4_wkup__timer1, 436 483 &am33xx_l4_wkup__rtc, 437 - &am33xx_l4_wkup__i2c1, 438 - &am33xx_l4_wkup__gpio0, 439 484 &am33xx_l4_wkup__adc_tsc, 440 485 &am33xx_l4_wkup__wd_timer1, 441 486 &am33xx_l4_hs__pruss, 442 487 &am33xx_l4_per__dcan0, 443 488 &am33xx_l4_per__dcan1, 444 - &am33xx_l4_per__gpio1, 445 - &am33xx_l4_per__gpio2, 446 - &am33xx_l4_per__gpio3, 447 - &am33xx_l4_per__i2c2, 448 - &am33xx_l4_per__i2c3, 449 489 &am33xx_l4_per__mailbox, 450 490 &am33xx_l4_ls__mcasp0, 451 491 &am33xx_l4_ls__mcasp1, 452 - &am33xx_l4_ls__mmc0, 453 - &am33xx_l4_ls__mmc1, 454 - &am33xx_l3_s__mmc2, 455 492 &am33xx_l4_ls__timer2, 456 493 &am33xx_l4_ls__timer3, 457 494 &am33xx_l4_ls__timer4, ··· 448 507 &am33xx_l4_ls__timer6, 449 508 &am33xx_l4_ls__timer7, 450 509 &am33xx_l3_main__tpcc, 451 - &am33xx_l4_ls__uart2, 452 - &am33xx_l4_ls__uart3, 453 - &am33xx_l4_ls__uart4, 454 - &am33xx_l4_ls__uart5, 455 - &am33xx_l4_ls__uart6, 456 510 &am33xx_l4_ls__spinlock, 457 511 &am33xx_l4_ls__elm, 458 512 &am33xx_l4_ls__epwmss0,
-4
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
··· 484 484 static struct omap_hwmod_class i2c_class = { 485 485 .name = "i2c", 486 486 .sysc = &i2c_sysc, 487 - .rev = OMAP_I2C_IP_VERSION_1, 488 487 .reset = &omap_i2c_reset, 489 488 }; 490 489 ··· 706 707 static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = { 707 708 .name = "gpio", 708 709 .sysc = &omap3xxx_gpio_sysc, 709 - .rev = 1, 710 710 }; 711 711 712 712 /* gpio1 */ ··· 1027 1029 static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = { 1028 1030 .name = "smartreflex", 1029 1031 .sysc = &omap34xx_sr_sysc, 1030 - .rev = 1, 1031 1032 }; 1032 1033 1033 1034 static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = { ··· 1041 1044 static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = { 1042 1045 .name = "smartreflex", 1043 1046 .sysc = &omap36xx_sr_sysc, 1044 - .rev = 2, 1045 1047 }; 1046 1048 1047 1049 /* SR1 */
-113
arch/arm/mach-omap2/omap_hwmod_43xx_data.c
··· 87 87 }, 88 88 }; 89 89 90 - static struct omap_hwmod_opt_clk gpio0_opt_clks[] = { 91 - { .role = "dbclk", .clk = "gpio0_dbclk" }, 92 - }; 93 - 94 - static struct omap_hwmod am43xx_gpio0_hwmod = { 95 - .name = "gpio1", 96 - .class = &am33xx_gpio_hwmod_class, 97 - .clkdm_name = "l4_wkup_clkdm", 98 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 99 - .main_clk = "sys_clkin_ck", 100 - .prcm = { 101 - .omap4 = { 102 - .clkctrl_offs = AM43XX_CM_WKUP_GPIO0_CLKCTRL_OFFSET, 103 - .modulemode = MODULEMODE_SWCTRL, 104 - }, 105 - }, 106 - .opt_clks = gpio0_opt_clks, 107 - .opt_clks_cnt = ARRAY_SIZE(gpio0_opt_clks), 108 - }; 109 - 110 90 static struct omap_hwmod_class_sysconfig am43xx_synctimer_sysc = { 111 91 .rev_offs = 0x0, 112 92 .sysc_offs = 0x4, ··· 242 262 .modulemode = MODULEMODE_SWCTRL, 243 263 }, 244 264 }, 245 - }; 246 - 247 - static struct omap_hwmod_opt_clk gpio4_opt_clks[] = { 248 - { .role = "dbclk", .clk = "gpio4_dbclk" }, 249 - }; 250 - 251 - static struct omap_hwmod am43xx_gpio4_hwmod = { 252 - .name = "gpio5", 253 - .class = &am33xx_gpio_hwmod_class, 254 - .clkdm_name = "l4ls_clkdm", 255 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 256 - .main_clk = "l4ls_gclk", 257 - .prcm = { 258 - .omap4 = { 259 - .clkctrl_offs = AM43XX_CM_PER_GPIO4_CLKCTRL_OFFSET, 260 - .modulemode = MODULEMODE_SWCTRL, 261 - }, 262 - }, 263 - .opt_clks = gpio4_opt_clks, 264 - .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks), 265 - }; 266 - 267 - static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { 268 - { .role = "dbclk", .clk = "gpio5_dbclk" }, 269 - }; 270 - 271 - static struct omap_hwmod am43xx_gpio5_hwmod = { 272 - .name = "gpio6", 273 - .class = &am33xx_gpio_hwmod_class, 274 - .clkdm_name = "l4ls_clkdm", 275 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 276 - .main_clk = "l4ls_gclk", 277 - .prcm = { 278 - .omap4 = { 279 - .clkctrl_offs = AM43XX_CM_PER_GPIO5_CLKCTRL_OFFSET, 280 - .modulemode = MODULEMODE_SWCTRL, 281 - }, 282 - }, 283 - .opt_clks = gpio5_opt_clks, 284 - .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 285 265 }; 286 266 287 267 static struct omap_hwmod_class am43xx_ocp2scp_hwmod_class = { ··· 590 650 .user = OCP_USER_MPU, 591 651 }; 592 652 593 - static struct omap_hwmod_ocp_if am43xx_l4_wkup__i2c1 = { 594 - .master = &am33xx_l4_wkup_hwmod, 595 - .slave = &am33xx_i2c1_hwmod, 596 - .clk = "sys_clkin_ck", 597 - .user = OCP_USER_MPU, 598 - }; 599 - 600 - static struct omap_hwmod_ocp_if am43xx_l4_wkup__gpio0 = { 601 - .master = &am33xx_l4_wkup_hwmod, 602 - .slave = &am43xx_gpio0_hwmod, 603 - .clk = "sys_clkin_ck", 604 - .user = OCP_USER_MPU | OCP_USER_SDMA, 605 - }; 606 - 607 653 static struct omap_hwmod_ocp_if am43xx_l4_wkup__adc_tsc = { 608 654 .master = &am33xx_l4_wkup_hwmod, 609 655 .slave = &am43xx_adc_tsc_hwmod, ··· 607 681 static struct omap_hwmod_ocp_if am43xx_l4_wkup__timer1 = { 608 682 .master = &am33xx_l4_wkup_hwmod, 609 683 .slave = &am33xx_timer1_hwmod, 610 - .clk = "sys_clkin_ck", 611 - .user = OCP_USER_MPU, 612 - }; 613 - 614 - static struct omap_hwmod_ocp_if am43xx_l4_wkup__uart1 = { 615 - .master = &am33xx_l4_wkup_hwmod, 616 - .slave = &am33xx_uart1_hwmod, 617 684 .clk = "sys_clkin_ck", 618 685 .user = OCP_USER_MPU, 619 686 }; ··· 693 774 .slave = &am43xx_spi4_hwmod, 694 775 .clk = "l4ls_gclk", 695 776 .user = OCP_USER_MPU, 696 - }; 697 - 698 - static struct omap_hwmod_ocp_if am43xx_l4_ls__gpio4 = { 699 - .master = &am33xx_l4_ls_hwmod, 700 - .slave = &am43xx_gpio4_hwmod, 701 - .clk = "l4ls_gclk", 702 - .user = OCP_USER_MPU | OCP_USER_SDMA, 703 - }; 704 - 705 - static struct omap_hwmod_ocp_if am43xx_l4_ls__gpio5 = { 706 - .master = &am33xx_l4_ls_hwmod, 707 - .slave = &am43xx_gpio5_hwmod, 708 - .clk = "l4ls_gclk", 709 - .user = OCP_USER_MPU | OCP_USER_SDMA, 710 777 }; 711 778 712 779 static struct omap_hwmod_ocp_if am43xx_l4_ls__ocp2scp0 = { ··· 812 907 &am43xx_l4_ls__mcspi2, 813 908 &am43xx_l4_ls__mcspi3, 814 909 &am43xx_l4_ls__mcspi4, 815 - &am43xx_l4_ls__gpio4, 816 - &am43xx_l4_ls__gpio5, 817 910 &am43xx_l3_main__pruss, 818 911 &am33xx_mpu__l3_main, 819 912 &am33xx_mpu__prcm, ··· 830 927 &am43xx_l4_wkup__control, 831 928 &am43xx_l4_wkup__smartreflex0, 832 929 &am43xx_l4_wkup__smartreflex1, 833 - &am43xx_l4_wkup__uart1, 834 930 &am43xx_l4_wkup__timer1, 835 - &am43xx_l4_wkup__i2c1, 836 - &am43xx_l4_wkup__gpio0, 837 931 &am43xx_l4_wkup__wd_timer1, 838 932 &am43xx_l4_wkup__adc_tsc, 839 933 &am43xx_l3_s__qspi, 840 934 &am33xx_l4_per__dcan0, 841 935 &am33xx_l4_per__dcan1, 842 - &am33xx_l4_per__gpio1, 843 - &am33xx_l4_per__gpio2, 844 - &am33xx_l4_per__gpio3, 845 - &am33xx_l4_per__i2c2, 846 - &am33xx_l4_per__i2c3, 847 936 &am33xx_l4_per__mailbox, 848 937 &am33xx_l4_per__rng, 849 938 &am33xx_l4_ls__mcasp0, 850 939 &am33xx_l4_ls__mcasp1, 851 - &am33xx_l4_ls__mmc0, 852 - &am33xx_l4_ls__mmc1, 853 - &am33xx_l3_s__mmc2, 854 940 &am33xx_l4_ls__timer2, 855 941 &am33xx_l4_ls__timer3, 856 942 &am33xx_l4_ls__timer4, ··· 847 955 &am33xx_l4_ls__timer6, 848 956 &am33xx_l4_ls__timer7, 849 957 &am33xx_l3_main__tpcc, 850 - &am33xx_l4_ls__uart2, 851 - &am33xx_l4_ls__uart3, 852 - &am33xx_l4_ls__uart4, 853 - &am33xx_l4_ls__uart5, 854 - &am33xx_l4_ls__uart6, 855 958 &am33xx_l4_ls__spinlock, 856 959 &am33xx_l4_ls__elm, 857 960 &am33xx_l4_ls__epwmss0,
-740
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
··· 21 21 */ 22 22 23 23 #include <linux/io.h> 24 - #include <linux/platform_data/hsmmc-omap.h> 25 24 #include <linux/power/smartreflex.h> 26 - #include <linux/platform_data/i2c-omap.h> 27 25 28 26 #include <linux/omap-dma.h> 29 27 ··· 31 33 #include "cm2_44xx.h" 32 34 #include "prm44xx.h" 33 35 #include "prm-regbits-44xx.h" 34 - #include "i2c.h" 35 36 #include "wd_timer.h" 36 37 37 38 /* Base offset for all OMAP4 interrupts external to MPUSS */ ··· 1053 1056 }; 1054 1057 1055 1058 /* 1056 - * 'gpio' class 1057 - * general purpose io module 1058 - */ 1059 - 1060 - static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = { 1061 - .rev_offs = 0x0000, 1062 - .sysc_offs = 0x0010, 1063 - .syss_offs = 0x0114, 1064 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP | 1065 - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | 1066 - SYSS_HAS_RESET_STATUS), 1067 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1068 - SIDLE_SMART_WKUP), 1069 - .sysc_fields = &omap_hwmod_sysc_type1, 1070 - }; 1071 - 1072 - static struct omap_hwmod_class omap44xx_gpio_hwmod_class = { 1073 - .name = "gpio", 1074 - .sysc = &omap44xx_gpio_sysc, 1075 - .rev = 2, 1076 - }; 1077 - 1078 - /* gpio1 */ 1079 - static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 1080 - { .role = "dbclk", .clk = "gpio1_dbclk" }, 1081 - }; 1082 - 1083 - static struct omap_hwmod omap44xx_gpio1_hwmod = { 1084 - .name = "gpio1", 1085 - .class = &omap44xx_gpio_hwmod_class, 1086 - .clkdm_name = "l4_wkup_clkdm", 1087 - .main_clk = "l4_wkup_clk_mux_ck", 1088 - .prcm = { 1089 - .omap4 = { 1090 - .clkctrl_offs = OMAP4_CM_WKUP_GPIO1_CLKCTRL_OFFSET, 1091 - .context_offs = OMAP4_RM_WKUP_GPIO1_CONTEXT_OFFSET, 1092 - .modulemode = MODULEMODE_HWCTRL, 1093 - }, 1094 - }, 1095 - .opt_clks = gpio1_opt_clks, 1096 - .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks), 1097 - }; 1098 - 1099 - /* gpio2 */ 1100 - static struct omap_hwmod_opt_clk gpio2_opt_clks[] = { 1101 - { .role = "dbclk", .clk = "gpio2_dbclk" }, 1102 - }; 1103 - 1104 - static struct omap_hwmod omap44xx_gpio2_hwmod = { 1105 - .name = "gpio2", 1106 - .class = &omap44xx_gpio_hwmod_class, 1107 - .clkdm_name = "l4_per_clkdm", 1108 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1109 - .main_clk = "l4_div_ck", 1110 - .prcm = { 1111 - .omap4 = { 1112 - .clkctrl_offs = OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET, 1113 - .context_offs = OMAP4_RM_L4PER_GPIO2_CONTEXT_OFFSET, 1114 - .modulemode = MODULEMODE_HWCTRL, 1115 - }, 1116 - }, 1117 - .opt_clks = gpio2_opt_clks, 1118 - .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks), 1119 - }; 1120 - 1121 - /* gpio3 */ 1122 - static struct omap_hwmod_opt_clk gpio3_opt_clks[] = { 1123 - { .role = "dbclk", .clk = "gpio3_dbclk" }, 1124 - }; 1125 - 1126 - static struct omap_hwmod omap44xx_gpio3_hwmod = { 1127 - .name = "gpio3", 1128 - .class = &omap44xx_gpio_hwmod_class, 1129 - .clkdm_name = "l4_per_clkdm", 1130 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1131 - .main_clk = "l4_div_ck", 1132 - .prcm = { 1133 - .omap4 = { 1134 - .clkctrl_offs = OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET, 1135 - .context_offs = OMAP4_RM_L4PER_GPIO3_CONTEXT_OFFSET, 1136 - .modulemode = MODULEMODE_HWCTRL, 1137 - }, 1138 - }, 1139 - .opt_clks = gpio3_opt_clks, 1140 - .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks), 1141 - }; 1142 - 1143 - /* gpio4 */ 1144 - static struct omap_hwmod_opt_clk gpio4_opt_clks[] = { 1145 - { .role = "dbclk", .clk = "gpio4_dbclk" }, 1146 - }; 1147 - 1148 - static struct omap_hwmod omap44xx_gpio4_hwmod = { 1149 - .name = "gpio4", 1150 - .class = &omap44xx_gpio_hwmod_class, 1151 - .clkdm_name = "l4_per_clkdm", 1152 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1153 - .main_clk = "l4_div_ck", 1154 - .prcm = { 1155 - .omap4 = { 1156 - .clkctrl_offs = OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET, 1157 - .context_offs = OMAP4_RM_L4PER_GPIO4_CONTEXT_OFFSET, 1158 - .modulemode = MODULEMODE_HWCTRL, 1159 - }, 1160 - }, 1161 - .opt_clks = gpio4_opt_clks, 1162 - .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks), 1163 - }; 1164 - 1165 - /* gpio5 */ 1166 - static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { 1167 - { .role = "dbclk", .clk = "gpio5_dbclk" }, 1168 - }; 1169 - 1170 - static struct omap_hwmod omap44xx_gpio5_hwmod = { 1171 - .name = "gpio5", 1172 - .class = &omap44xx_gpio_hwmod_class, 1173 - .clkdm_name = "l4_per_clkdm", 1174 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1175 - .main_clk = "l4_div_ck", 1176 - .prcm = { 1177 - .omap4 = { 1178 - .clkctrl_offs = OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET, 1179 - .context_offs = OMAP4_RM_L4PER_GPIO5_CONTEXT_OFFSET, 1180 - .modulemode = MODULEMODE_HWCTRL, 1181 - }, 1182 - }, 1183 - .opt_clks = gpio5_opt_clks, 1184 - .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 1185 - }; 1186 - 1187 - /* gpio6 */ 1188 - static struct omap_hwmod_opt_clk gpio6_opt_clks[] = { 1189 - { .role = "dbclk", .clk = "gpio6_dbclk" }, 1190 - }; 1191 - 1192 - static struct omap_hwmod omap44xx_gpio6_hwmod = { 1193 - .name = "gpio6", 1194 - .class = &omap44xx_gpio_hwmod_class, 1195 - .clkdm_name = "l4_per_clkdm", 1196 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 1197 - .main_clk = "l4_div_ck", 1198 - .prcm = { 1199 - .omap4 = { 1200 - .clkctrl_offs = OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET, 1201 - .context_offs = OMAP4_RM_L4PER_GPIO6_CONTEXT_OFFSET, 1202 - .modulemode = MODULEMODE_HWCTRL, 1203 - }, 1204 - }, 1205 - .opt_clks = gpio6_opt_clks, 1206 - .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks), 1207 - }; 1208 - 1209 - /* 1210 1059 * 'gpmc' class 1211 1060 * general purpose memory controller 1212 1061 */ ··· 1193 1350 .clkctrl_offs = OMAP4_CM_L3INIT_HSI_CLKCTRL_OFFSET, 1194 1351 .context_offs = OMAP4_RM_L3INIT_HSI_CONTEXT_OFFSET, 1195 1352 .modulemode = MODULEMODE_HWCTRL, 1196 - }, 1197 - }, 1198 - }; 1199 - 1200 - /* 1201 - * 'i2c' class 1202 - * multimaster high-speed i2c controller 1203 - */ 1204 - 1205 - static struct omap_hwmod_class_sysconfig omap44xx_i2c_sysc = { 1206 - .rev_offs = 0, 1207 - .sysc_offs = 0x0010, 1208 - .syss_offs = 0x0090, 1209 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | 1210 - SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 1211 - SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), 1212 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1213 - SIDLE_SMART_WKUP), 1214 - .sysc_fields = &omap_hwmod_sysc_type1, 1215 - }; 1216 - 1217 - static struct omap_hwmod_class omap44xx_i2c_hwmod_class = { 1218 - .name = "i2c", 1219 - .sysc = &omap44xx_i2c_sysc, 1220 - .rev = OMAP_I2C_IP_VERSION_2, 1221 - .reset = &omap_i2c_reset, 1222 - }; 1223 - 1224 - /* i2c1 */ 1225 - static struct omap_hwmod omap44xx_i2c1_hwmod = { 1226 - .name = "i2c1", 1227 - .class = &omap44xx_i2c_hwmod_class, 1228 - .clkdm_name = "l4_per_clkdm", 1229 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 1230 - .main_clk = "func_96m_fclk", 1231 - .prcm = { 1232 - .omap4 = { 1233 - .clkctrl_offs = OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET, 1234 - .context_offs = OMAP4_RM_L4PER_I2C1_CONTEXT_OFFSET, 1235 - .modulemode = MODULEMODE_SWCTRL, 1236 - }, 1237 - }, 1238 - }; 1239 - 1240 - /* i2c2 */ 1241 - static struct omap_hwmod omap44xx_i2c2_hwmod = { 1242 - .name = "i2c2", 1243 - .class = &omap44xx_i2c_hwmod_class, 1244 - .clkdm_name = "l4_per_clkdm", 1245 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 1246 - .main_clk = "func_96m_fclk", 1247 - .prcm = { 1248 - .omap4 = { 1249 - .clkctrl_offs = OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET, 1250 - .context_offs = OMAP4_RM_L4PER_I2C2_CONTEXT_OFFSET, 1251 - .modulemode = MODULEMODE_SWCTRL, 1252 - }, 1253 - }, 1254 - }; 1255 - 1256 - /* i2c3 */ 1257 - static struct omap_hwmod omap44xx_i2c3_hwmod = { 1258 - .name = "i2c3", 1259 - .class = &omap44xx_i2c_hwmod_class, 1260 - .clkdm_name = "l4_per_clkdm", 1261 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 1262 - .main_clk = "func_96m_fclk", 1263 - .prcm = { 1264 - .omap4 = { 1265 - .clkctrl_offs = OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET, 1266 - .context_offs = OMAP4_RM_L4PER_I2C3_CONTEXT_OFFSET, 1267 - .modulemode = MODULEMODE_SWCTRL, 1268 - }, 1269 - }, 1270 - }; 1271 - 1272 - /* i2c4 */ 1273 - static struct omap_hwmod omap44xx_i2c4_hwmod = { 1274 - .name = "i2c4", 1275 - .class = &omap44xx_i2c_hwmod_class, 1276 - .clkdm_name = "l4_per_clkdm", 1277 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 1278 - .main_clk = "func_96m_fclk", 1279 - .prcm = { 1280 - .omap4 = { 1281 - .clkctrl_offs = OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET, 1282 - .context_offs = OMAP4_RM_L4PER_I2C4_CONTEXT_OFFSET, 1283 - .modulemode = MODULEMODE_SWCTRL, 1284 1353 }, 1285 1354 }, 1286 1355 }; ··· 1574 1819 }; 1575 1820 1576 1821 /* 1577 - * 'mcspi' class 1578 - * multichannel serial port interface (mcspi) / master/slave synchronous serial 1579 - * bus 1580 - */ 1581 - 1582 - static struct omap_hwmod_class_sysconfig omap44xx_mcspi_sysc = { 1583 - .rev_offs = 0x0000, 1584 - .sysc_offs = 0x0010, 1585 - .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS | 1586 - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), 1587 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1588 - SIDLE_SMART_WKUP), 1589 - .sysc_fields = &omap_hwmod_sysc_type2, 1590 - }; 1591 - 1592 - static struct omap_hwmod_class omap44xx_mcspi_hwmod_class = { 1593 - .name = "mcspi", 1594 - .sysc = &omap44xx_mcspi_sysc, 1595 - }; 1596 - 1597 - /* mcspi1 */ 1598 - static struct omap_hwmod omap44xx_mcspi1_hwmod = { 1599 - .name = "mcspi1", 1600 - .class = &omap44xx_mcspi_hwmod_class, 1601 - .clkdm_name = "l4_per_clkdm", 1602 - .main_clk = "func_48m_fclk", 1603 - .prcm = { 1604 - .omap4 = { 1605 - .clkctrl_offs = OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET, 1606 - .context_offs = OMAP4_RM_L4PER_MCSPI1_CONTEXT_OFFSET, 1607 - .modulemode = MODULEMODE_SWCTRL, 1608 - }, 1609 - }, 1610 - }; 1611 - 1612 - /* mcspi2 */ 1613 - static struct omap_hwmod omap44xx_mcspi2_hwmod = { 1614 - .name = "mcspi2", 1615 - .class = &omap44xx_mcspi_hwmod_class, 1616 - .clkdm_name = "l4_per_clkdm", 1617 - .main_clk = "func_48m_fclk", 1618 - .prcm = { 1619 - .omap4 = { 1620 - .clkctrl_offs = OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET, 1621 - .context_offs = OMAP4_RM_L4PER_MCSPI2_CONTEXT_OFFSET, 1622 - .modulemode = MODULEMODE_SWCTRL, 1623 - }, 1624 - }, 1625 - }; 1626 - 1627 - /* mcspi3 */ 1628 - static struct omap_hwmod omap44xx_mcspi3_hwmod = { 1629 - .name = "mcspi3", 1630 - .class = &omap44xx_mcspi_hwmod_class, 1631 - .clkdm_name = "l4_per_clkdm", 1632 - .main_clk = "func_48m_fclk", 1633 - .prcm = { 1634 - .omap4 = { 1635 - .clkctrl_offs = OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET, 1636 - .context_offs = OMAP4_RM_L4PER_MCSPI3_CONTEXT_OFFSET, 1637 - .modulemode = MODULEMODE_SWCTRL, 1638 - }, 1639 - }, 1640 - }; 1641 - 1642 - /* mcspi4 */ 1643 - static struct omap_hwmod omap44xx_mcspi4_hwmod = { 1644 - .name = "mcspi4", 1645 - .class = &omap44xx_mcspi_hwmod_class, 1646 - .clkdm_name = "l4_per_clkdm", 1647 - .main_clk = "func_48m_fclk", 1648 - .prcm = { 1649 - .omap4 = { 1650 - .clkctrl_offs = OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET, 1651 - .context_offs = OMAP4_RM_L4PER_MCSPI4_CONTEXT_OFFSET, 1652 - .modulemode = MODULEMODE_SWCTRL, 1653 - }, 1654 - }, 1655 - }; 1656 - 1657 - /* 1658 - * 'mmc' class 1659 - * multimedia card high-speed/sd/sdio (mmc/sd/sdio) host controller 1660 - */ 1661 - 1662 - static struct omap_hwmod_class_sysconfig omap44xx_mmc_sysc = { 1663 - .rev_offs = 0x0000, 1664 - .sysc_offs = 0x0010, 1665 - .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE | 1666 - SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE | 1667 - SYSC_HAS_SOFTRESET), 1668 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1669 - SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | 1670 - MSTANDBY_SMART | MSTANDBY_SMART_WKUP), 1671 - .sysc_fields = &omap_hwmod_sysc_type2, 1672 - }; 1673 - 1674 - static struct omap_hwmod_class omap44xx_mmc_hwmod_class = { 1675 - .name = "mmc", 1676 - .sysc = &omap44xx_mmc_sysc, 1677 - }; 1678 - 1679 - /* mmc1 */ 1680 - static struct omap_hsmmc_dev_attr mmc1_dev_attr = { 1681 - .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, 1682 - }; 1683 - 1684 - static struct omap_hwmod omap44xx_mmc1_hwmod = { 1685 - .name = "mmc1", 1686 - .class = &omap44xx_mmc_hwmod_class, 1687 - .clkdm_name = "l3_init_clkdm", 1688 - .main_clk = "hsmmc1_fclk", 1689 - .prcm = { 1690 - .omap4 = { 1691 - .clkctrl_offs = OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET, 1692 - .context_offs = OMAP4_RM_L3INIT_MMC1_CONTEXT_OFFSET, 1693 - .modulemode = MODULEMODE_SWCTRL, 1694 - }, 1695 - }, 1696 - .dev_attr = &mmc1_dev_attr, 1697 - }; 1698 - 1699 - /* mmc2 */ 1700 - static struct omap_hwmod omap44xx_mmc2_hwmod = { 1701 - .name = "mmc2", 1702 - .class = &omap44xx_mmc_hwmod_class, 1703 - .clkdm_name = "l3_init_clkdm", 1704 - .main_clk = "hsmmc2_fclk", 1705 - .prcm = { 1706 - .omap4 = { 1707 - .clkctrl_offs = OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET, 1708 - .context_offs = OMAP4_RM_L3INIT_MMC2_CONTEXT_OFFSET, 1709 - .modulemode = MODULEMODE_SWCTRL, 1710 - }, 1711 - }, 1712 - }; 1713 - 1714 - /* mmc3 */ 1715 - static struct omap_hwmod omap44xx_mmc3_hwmod = { 1716 - .name = "mmc3", 1717 - .class = &omap44xx_mmc_hwmod_class, 1718 - .clkdm_name = "l4_per_clkdm", 1719 - .main_clk = "func_48m_fclk", 1720 - .prcm = { 1721 - .omap4 = { 1722 - .clkctrl_offs = OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET, 1723 - .context_offs = OMAP4_RM_L4PER_MMCSD3_CONTEXT_OFFSET, 1724 - .modulemode = MODULEMODE_SWCTRL, 1725 - }, 1726 - }, 1727 - }; 1728 - 1729 - /* mmc4 */ 1730 - static struct omap_hwmod omap44xx_mmc4_hwmod = { 1731 - .name = "mmc4", 1732 - .class = &omap44xx_mmc_hwmod_class, 1733 - .clkdm_name = "l4_per_clkdm", 1734 - .main_clk = "func_48m_fclk", 1735 - .prcm = { 1736 - .omap4 = { 1737 - .clkctrl_offs = OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET, 1738 - .context_offs = OMAP4_RM_L4PER_MMCSD4_CONTEXT_OFFSET, 1739 - .modulemode = MODULEMODE_SWCTRL, 1740 - }, 1741 - }, 1742 - }; 1743 - 1744 - /* mmc5 */ 1745 - static struct omap_hwmod omap44xx_mmc5_hwmod = { 1746 - .name = "mmc5", 1747 - .class = &omap44xx_mmc_hwmod_class, 1748 - .clkdm_name = "l4_per_clkdm", 1749 - .main_clk = "func_48m_fclk", 1750 - .prcm = { 1751 - .omap4 = { 1752 - .clkctrl_offs = OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET, 1753 - .context_offs = OMAP4_RM_L4PER_MMCSD5_CONTEXT_OFFSET, 1754 - .modulemode = MODULEMODE_SWCTRL, 1755 - }, 1756 - }, 1757 - }; 1758 - 1759 - /* 1760 1822 * 'mmu' class 1761 1823 * The memory management unit performs virtual to physical address translation 1762 1824 * for its requestors. ··· 1939 2367 static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { 1940 2368 .name = "smartreflex", 1941 2369 .sysc = &omap44xx_smartreflex_sysc, 1942 - .rev = 2, 1943 2370 }; 1944 2371 1945 2372 /* smartreflex_core */ ··· 2238 2667 .omap4 = { 2239 2668 .clkctrl_offs = OMAP4_CM_L4PER_DMTIMER11_CLKCTRL_OFFSET, 2240 2669 .context_offs = OMAP4_RM_L4PER_DMTIMER11_CONTEXT_OFFSET, 2241 - .modulemode = MODULEMODE_SWCTRL, 2242 - }, 2243 - }, 2244 - }; 2245 - 2246 - /* 2247 - * 'uart' class 2248 - * universal asynchronous receiver/transmitter (uart) 2249 - */ 2250 - 2251 - static struct omap_hwmod_class_sysconfig omap44xx_uart_sysc = { 2252 - .rev_offs = 0x0050, 2253 - .sysc_offs = 0x0054, 2254 - .syss_offs = 0x0058, 2255 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP | 2256 - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | 2257 - SYSS_HAS_RESET_STATUS), 2258 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 2259 - SIDLE_SMART_WKUP), 2260 - .sysc_fields = &omap_hwmod_sysc_type1, 2261 - }; 2262 - 2263 - static struct omap_hwmod_class omap44xx_uart_hwmod_class = { 2264 - .name = "uart", 2265 - .sysc = &omap44xx_uart_sysc, 2266 - }; 2267 - 2268 - /* uart1 */ 2269 - static struct omap_hwmod omap44xx_uart1_hwmod = { 2270 - .name = "uart1", 2271 - .class = &omap44xx_uart_hwmod_class, 2272 - .clkdm_name = "l4_per_clkdm", 2273 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2274 - .main_clk = "func_48m_fclk", 2275 - .prcm = { 2276 - .omap4 = { 2277 - .clkctrl_offs = OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET, 2278 - .context_offs = OMAP4_RM_L4PER_UART1_CONTEXT_OFFSET, 2279 - .modulemode = MODULEMODE_SWCTRL, 2280 - }, 2281 - }, 2282 - }; 2283 - 2284 - /* uart2 */ 2285 - static struct omap_hwmod omap44xx_uart2_hwmod = { 2286 - .name = "uart2", 2287 - .class = &omap44xx_uart_hwmod_class, 2288 - .clkdm_name = "l4_per_clkdm", 2289 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2290 - .main_clk = "func_48m_fclk", 2291 - .prcm = { 2292 - .omap4 = { 2293 - .clkctrl_offs = OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET, 2294 - .context_offs = OMAP4_RM_L4PER_UART2_CONTEXT_OFFSET, 2295 - .modulemode = MODULEMODE_SWCTRL, 2296 - }, 2297 - }, 2298 - }; 2299 - 2300 - /* uart3 */ 2301 - static struct omap_hwmod omap44xx_uart3_hwmod = { 2302 - .name = "uart3", 2303 - .class = &omap44xx_uart_hwmod_class, 2304 - .clkdm_name = "l4_per_clkdm", 2305 - .flags = DEBUG_OMAP4UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT, 2306 - .main_clk = "func_48m_fclk", 2307 - .prcm = { 2308 - .omap4 = { 2309 - .clkctrl_offs = OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET, 2310 - .context_offs = OMAP4_RM_L4PER_UART3_CONTEXT_OFFSET, 2311 - .modulemode = MODULEMODE_SWCTRL, 2312 - }, 2313 - }, 2314 - }; 2315 - 2316 - /* uart4 */ 2317 - static struct omap_hwmod omap44xx_uart4_hwmod = { 2318 - .name = "uart4", 2319 - .class = &omap44xx_uart_hwmod_class, 2320 - .clkdm_name = "l4_per_clkdm", 2321 - .flags = DEBUG_OMAP4UART4_FLAGS | HWMOD_SWSUP_SIDLE_ACT, 2322 - .main_clk = "func_48m_fclk", 2323 - .prcm = { 2324 - .omap4 = { 2325 - .clkctrl_offs = OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET, 2326 - .context_offs = OMAP4_RM_L4PER_UART4_CONTEXT_OFFSET, 2327 2670 .modulemode = MODULEMODE_SWCTRL, 2328 2671 }, 2329 2672 }, ··· 2564 3079 .master = &omap44xx_l4_cfg_hwmod, 2565 3080 .slave = &omap44xx_l3_main_1_hwmod, 2566 3081 .clk = "l4_div_ck", 2567 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2568 - }; 2569 - 2570 - /* mmc1 -> l3_main_1 */ 2571 - static struct omap_hwmod_ocp_if omap44xx_mmc1__l3_main_1 = { 2572 - .master = &omap44xx_mmc1_hwmod, 2573 - .slave = &omap44xx_l3_main_1_hwmod, 2574 - .clk = "l3_div_ck", 2575 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2576 - }; 2577 - 2578 - /* mmc2 -> l3_main_1 */ 2579 - static struct omap_hwmod_ocp_if omap44xx_mmc2__l3_main_1 = { 2580 - .master = &omap44xx_mmc2_hwmod, 2581 - .slave = &omap44xx_l3_main_1_hwmod, 2582 - .clk = "l3_div_ck", 2583 3082 .user = OCP_USER_MPU | OCP_USER_SDMA, 2584 3083 }; 2585 3084 ··· 3023 3554 .user = OCP_USER_MPU | OCP_USER_SDMA, 3024 3555 }; 3025 3556 3026 - /* l4_wkup -> gpio1 */ 3027 - static struct omap_hwmod_ocp_if omap44xx_l4_wkup__gpio1 = { 3028 - .master = &omap44xx_l4_wkup_hwmod, 3029 - .slave = &omap44xx_gpio1_hwmod, 3030 - .clk = "l4_wkup_clk_mux_ck", 3031 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3032 - }; 3033 - 3034 - /* l4_per -> gpio2 */ 3035 - static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio2 = { 3036 - .master = &omap44xx_l4_per_hwmod, 3037 - .slave = &omap44xx_gpio2_hwmod, 3038 - .clk = "l4_div_ck", 3039 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3040 - }; 3041 - 3042 - /* l4_per -> gpio3 */ 3043 - static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio3 = { 3044 - .master = &omap44xx_l4_per_hwmod, 3045 - .slave = &omap44xx_gpio3_hwmod, 3046 - .clk = "l4_div_ck", 3047 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3048 - }; 3049 - 3050 - /* l4_per -> gpio4 */ 3051 - static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio4 = { 3052 - .master = &omap44xx_l4_per_hwmod, 3053 - .slave = &omap44xx_gpio4_hwmod, 3054 - .clk = "l4_div_ck", 3055 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3056 - }; 3057 - 3058 - /* l4_per -> gpio5 */ 3059 - static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio5 = { 3060 - .master = &omap44xx_l4_per_hwmod, 3061 - .slave = &omap44xx_gpio5_hwmod, 3062 - .clk = "l4_div_ck", 3063 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3064 - }; 3065 - 3066 - /* l4_per -> gpio6 */ 3067 - static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio6 = { 3068 - .master = &omap44xx_l4_per_hwmod, 3069 - .slave = &omap44xx_gpio6_hwmod, 3070 - .clk = "l4_div_ck", 3071 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3072 - }; 3073 - 3074 3557 /* l3_main_2 -> gpmc */ 3075 3558 static struct omap_hwmod_ocp_if omap44xx_l3_main_2__gpmc = { 3076 3559 .master = &omap44xx_l3_main_2_hwmod, ··· 3051 3630 static struct omap_hwmod_ocp_if omap44xx_l4_cfg__hsi = { 3052 3631 .master = &omap44xx_l4_cfg_hwmod, 3053 3632 .slave = &omap44xx_hsi_hwmod, 3054 - .clk = "l4_div_ck", 3055 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3056 - }; 3057 - 3058 - /* l4_per -> i2c1 */ 3059 - static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c1 = { 3060 - .master = &omap44xx_l4_per_hwmod, 3061 - .slave = &omap44xx_i2c1_hwmod, 3062 - .clk = "l4_div_ck", 3063 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3064 - }; 3065 - 3066 - /* l4_per -> i2c2 */ 3067 - static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c2 = { 3068 - .master = &omap44xx_l4_per_hwmod, 3069 - .slave = &omap44xx_i2c2_hwmod, 3070 - .clk = "l4_div_ck", 3071 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3072 - }; 3073 - 3074 - /* l4_per -> i2c3 */ 3075 - static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c3 = { 3076 - .master = &omap44xx_l4_per_hwmod, 3077 - .slave = &omap44xx_i2c3_hwmod, 3078 - .clk = "l4_div_ck", 3079 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3080 - }; 3081 - 3082 - /* l4_per -> i2c4 */ 3083 - static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c4 = { 3084 - .master = &omap44xx_l4_per_hwmod, 3085 - .slave = &omap44xx_i2c4_hwmod, 3086 3633 .clk = "l4_div_ck", 3087 3634 .user = OCP_USER_MPU | OCP_USER_SDMA, 3088 3635 }; ··· 3156 3767 .master = &omap44xx_l4_abe_hwmod, 3157 3768 .slave = &omap44xx_mcpdm_hwmod, 3158 3769 .clk = "ocp_abe_iclk", 3159 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3160 - }; 3161 - 3162 - /* l4_per -> mcspi1 */ 3163 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi1 = { 3164 - .master = &omap44xx_l4_per_hwmod, 3165 - .slave = &omap44xx_mcspi1_hwmod, 3166 - .clk = "l4_div_ck", 3167 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3168 - }; 3169 - 3170 - /* l4_per -> mcspi2 */ 3171 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi2 = { 3172 - .master = &omap44xx_l4_per_hwmod, 3173 - .slave = &omap44xx_mcspi2_hwmod, 3174 - .clk = "l4_div_ck", 3175 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3176 - }; 3177 - 3178 - /* l4_per -> mcspi3 */ 3179 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi3 = { 3180 - .master = &omap44xx_l4_per_hwmod, 3181 - .slave = &omap44xx_mcspi3_hwmod, 3182 - .clk = "l4_div_ck", 3183 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3184 - }; 3185 - 3186 - /* l4_per -> mcspi4 */ 3187 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi4 = { 3188 - .master = &omap44xx_l4_per_hwmod, 3189 - .slave = &omap44xx_mcspi4_hwmod, 3190 - .clk = "l4_div_ck", 3191 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3192 - }; 3193 - 3194 - /* l4_per -> mmc1 */ 3195 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc1 = { 3196 - .master = &omap44xx_l4_per_hwmod, 3197 - .slave = &omap44xx_mmc1_hwmod, 3198 - .clk = "l4_div_ck", 3199 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3200 - }; 3201 - 3202 - /* l4_per -> mmc2 */ 3203 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc2 = { 3204 - .master = &omap44xx_l4_per_hwmod, 3205 - .slave = &omap44xx_mmc2_hwmod, 3206 - .clk = "l4_div_ck", 3207 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3208 - }; 3209 - 3210 - /* l4_per -> mmc3 */ 3211 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc3 = { 3212 - .master = &omap44xx_l4_per_hwmod, 3213 - .slave = &omap44xx_mmc3_hwmod, 3214 - .clk = "l4_div_ck", 3215 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3216 - }; 3217 - 3218 - /* l4_per -> mmc4 */ 3219 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc4 = { 3220 - .master = &omap44xx_l4_per_hwmod, 3221 - .slave = &omap44xx_mmc4_hwmod, 3222 - .clk = "l4_div_ck", 3223 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3224 - }; 3225 - 3226 - /* l4_per -> mmc5 */ 3227 - static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc5 = { 3228 - .master = &omap44xx_l4_per_hwmod, 3229 - .slave = &omap44xx_mmc5_hwmod, 3230 - .clk = "l4_div_ck", 3231 3770 .user = OCP_USER_MPU | OCP_USER_SDMA, 3232 3771 }; 3233 3772 ··· 3367 4050 .user = OCP_USER_MPU | OCP_USER_SDMA, 3368 4051 }; 3369 4052 3370 - /* l4_per -> uart1 */ 3371 - static struct omap_hwmod_ocp_if omap44xx_l4_per__uart1 = { 3372 - .master = &omap44xx_l4_per_hwmod, 3373 - .slave = &omap44xx_uart1_hwmod, 3374 - .clk = "l4_div_ck", 3375 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3376 - }; 3377 - 3378 - /* l4_per -> uart2 */ 3379 - static struct omap_hwmod_ocp_if omap44xx_l4_per__uart2 = { 3380 - .master = &omap44xx_l4_per_hwmod, 3381 - .slave = &omap44xx_uart2_hwmod, 3382 - .clk = "l4_div_ck", 3383 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3384 - }; 3385 - 3386 - /* l4_per -> uart3 */ 3387 - static struct omap_hwmod_ocp_if omap44xx_l4_per__uart3 = { 3388 - .master = &omap44xx_l4_per_hwmod, 3389 - .slave = &omap44xx_uart3_hwmod, 3390 - .clk = "l4_div_ck", 3391 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3392 - }; 3393 - 3394 - /* l4_per -> uart4 */ 3395 - static struct omap_hwmod_ocp_if omap44xx_l4_per__uart4 = { 3396 - .master = &omap44xx_l4_per_hwmod, 3397 - .slave = &omap44xx_uart4_hwmod, 3398 - .clk = "l4_div_ck", 3399 - .user = OCP_USER_MPU | OCP_USER_SDMA, 3400 - }; 3401 - 3402 4053 /* l4_cfg -> usb_host_fs */ 3403 4054 static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_cfg__usb_host_fs = { 3404 4055 .master = &omap44xx_l4_cfg_hwmod, ··· 3449 4164 &omap44xx_dss__l3_main_1, 3450 4165 &omap44xx_l3_main_2__l3_main_1, 3451 4166 &omap44xx_l4_cfg__l3_main_1, 3452 - &omap44xx_mmc1__l3_main_1, 3453 - &omap44xx_mmc2__l3_main_1, 3454 4167 &omap44xx_mpu__l3_main_1, 3455 4168 &omap44xx_debugss__l3_main_2, 3456 4169 &omap44xx_dma_system__l3_main_2, ··· 3505 4222 &omap44xx_l4_per__dss_venc, 3506 4223 &omap44xx_l4_per__elm, 3507 4224 &omap44xx_l4_cfg__fdif, 3508 - &omap44xx_l4_wkup__gpio1, 3509 - &omap44xx_l4_per__gpio2, 3510 - &omap44xx_l4_per__gpio3, 3511 - &omap44xx_l4_per__gpio4, 3512 - &omap44xx_l4_per__gpio5, 3513 - &omap44xx_l4_per__gpio6, 3514 4225 &omap44xx_l3_main_2__gpmc, 3515 4226 &omap44xx_l3_main_2__gpu, 3516 4227 &omap44xx_l4_per__hdq1w, 3517 4228 &omap44xx_l4_cfg__hsi, 3518 - &omap44xx_l4_per__i2c1, 3519 - &omap44xx_l4_per__i2c2, 3520 - &omap44xx_l4_per__i2c3, 3521 - &omap44xx_l4_per__i2c4, 3522 4229 &omap44xx_l3_main_2__ipu, 3523 4230 &omap44xx_l3_main_2__iss, 3524 4231 /* &omap44xx_iva__sl2if, */ ··· 3522 4249 &omap44xx_l4_abe__mcbsp3, 3523 4250 &omap44xx_l4_per__mcbsp4, 3524 4251 &omap44xx_l4_abe__mcpdm, 3525 - &omap44xx_l4_per__mcspi1, 3526 - &omap44xx_l4_per__mcspi2, 3527 - &omap44xx_l4_per__mcspi3, 3528 - &omap44xx_l4_per__mcspi4, 3529 - &omap44xx_l4_per__mmc1, 3530 - &omap44xx_l4_per__mmc2, 3531 - &omap44xx_l4_per__mmc3, 3532 - &omap44xx_l4_per__mmc4, 3533 - &omap44xx_l4_per__mmc5, 3534 4252 &omap44xx_l3_main_2__mmu_ipu, 3535 4253 &omap44xx_l4_cfg__mmu_dsp, 3536 4254 &omap44xx_l3_main_2__ocmc_ram, ··· 3550 4286 &omap44xx_l4_per__timer9, 3551 4287 &omap44xx_l4_per__timer10, 3552 4288 &omap44xx_l4_per__timer11, 3553 - &omap44xx_l4_per__uart1, 3554 - &omap44xx_l4_per__uart2, 3555 - &omap44xx_l4_per__uart3, 3556 - &omap44xx_l4_per__uart4, 3557 4289 /* &omap44xx_l4_cfg__usb_host_fs, */ 3558 4290 &omap44xx_l4_cfg__usb_host_hs, 3559 4291 &omap44xx_l4_cfg__usb_otg_hs,
-748
arch/arm/mach-omap2/omap_hwmod_54xx_data.c
··· 18 18 */ 19 19 20 20 #include <linux/io.h> 21 - #include <linux/platform_data/hsmmc-omap.h> 22 21 #include <linux/power/smartreflex.h> 23 - #include <linux/platform_data/i2c-omap.h> 24 22 25 23 #include <linux/omap-dma.h> 26 24 ··· 27 29 #include "cm1_54xx.h" 28 30 #include "cm2_54xx.h" 29 31 #include "prm54xx.h" 30 - #include "i2c.h" 31 32 #include "wd_timer.h" 32 33 33 34 /* Base offset for all OMAP5 interrupts external to MPUSS */ ··· 598 601 }; 599 602 600 603 /* 601 - * 'gpio' class 602 - * general purpose io module 603 - */ 604 - 605 - static struct omap_hwmod_class_sysconfig omap54xx_gpio_sysc = { 606 - .rev_offs = 0x0000, 607 - .sysc_offs = 0x0010, 608 - .syss_offs = 0x0114, 609 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP | 610 - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | 611 - SYSS_HAS_RESET_STATUS), 612 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 613 - SIDLE_SMART_WKUP), 614 - .sysc_fields = &omap_hwmod_sysc_type1, 615 - }; 616 - 617 - static struct omap_hwmod_class omap54xx_gpio_hwmod_class = { 618 - .name = "gpio", 619 - .sysc = &omap54xx_gpio_sysc, 620 - .rev = 2, 621 - }; 622 - 623 - /* gpio1 */ 624 - static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 625 - { .role = "dbclk", .clk = "gpio1_dbclk" }, 626 - }; 627 - 628 - static struct omap_hwmod omap54xx_gpio1_hwmod = { 629 - .name = "gpio1", 630 - .class = &omap54xx_gpio_hwmod_class, 631 - .clkdm_name = "wkupaon_clkdm", 632 - .main_clk = "wkupaon_iclk_mux", 633 - .prcm = { 634 - .omap4 = { 635 - .clkctrl_offs = OMAP54XX_CM_WKUPAON_GPIO1_CLKCTRL_OFFSET, 636 - .context_offs = OMAP54XX_RM_WKUPAON_GPIO1_CONTEXT_OFFSET, 637 - .modulemode = MODULEMODE_HWCTRL, 638 - }, 639 - }, 640 - .opt_clks = gpio1_opt_clks, 641 - .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks), 642 - }; 643 - 644 - /* gpio2 */ 645 - static struct omap_hwmod_opt_clk gpio2_opt_clks[] = { 646 - { .role = "dbclk", .clk = "gpio2_dbclk" }, 647 - }; 648 - 649 - static struct omap_hwmod omap54xx_gpio2_hwmod = { 650 - .name = "gpio2", 651 - .class = &omap54xx_gpio_hwmod_class, 652 - .clkdm_name = "l4per_clkdm", 653 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 654 - .main_clk = "l4_root_clk_div", 655 - .prcm = { 656 - .omap4 = { 657 - .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO2_CLKCTRL_OFFSET, 658 - .context_offs = OMAP54XX_RM_L4PER_GPIO2_CONTEXT_OFFSET, 659 - .modulemode = MODULEMODE_HWCTRL, 660 - }, 661 - }, 662 - .opt_clks = gpio2_opt_clks, 663 - .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks), 664 - }; 665 - 666 - /* gpio3 */ 667 - static struct omap_hwmod_opt_clk gpio3_opt_clks[] = { 668 - { .role = "dbclk", .clk = "gpio3_dbclk" }, 669 - }; 670 - 671 - static struct omap_hwmod omap54xx_gpio3_hwmod = { 672 - .name = "gpio3", 673 - .class = &omap54xx_gpio_hwmod_class, 674 - .clkdm_name = "l4per_clkdm", 675 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 676 - .main_clk = "l4_root_clk_div", 677 - .prcm = { 678 - .omap4 = { 679 - .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO3_CLKCTRL_OFFSET, 680 - .context_offs = OMAP54XX_RM_L4PER_GPIO3_CONTEXT_OFFSET, 681 - .modulemode = MODULEMODE_HWCTRL, 682 - }, 683 - }, 684 - .opt_clks = gpio3_opt_clks, 685 - .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks), 686 - }; 687 - 688 - /* gpio4 */ 689 - static struct omap_hwmod_opt_clk gpio4_opt_clks[] = { 690 - { .role = "dbclk", .clk = "gpio4_dbclk" }, 691 - }; 692 - 693 - static struct omap_hwmod omap54xx_gpio4_hwmod = { 694 - .name = "gpio4", 695 - .class = &omap54xx_gpio_hwmod_class, 696 - .clkdm_name = "l4per_clkdm", 697 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 698 - .main_clk = "l4_root_clk_div", 699 - .prcm = { 700 - .omap4 = { 701 - .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO4_CLKCTRL_OFFSET, 702 - .context_offs = OMAP54XX_RM_L4PER_GPIO4_CONTEXT_OFFSET, 703 - .modulemode = MODULEMODE_HWCTRL, 704 - }, 705 - }, 706 - .opt_clks = gpio4_opt_clks, 707 - .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks), 708 - }; 709 - 710 - /* gpio5 */ 711 - static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { 712 - { .role = "dbclk", .clk = "gpio5_dbclk" }, 713 - }; 714 - 715 - static struct omap_hwmod omap54xx_gpio5_hwmod = { 716 - .name = "gpio5", 717 - .class = &omap54xx_gpio_hwmod_class, 718 - .clkdm_name = "l4per_clkdm", 719 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 720 - .main_clk = "l4_root_clk_div", 721 - .prcm = { 722 - .omap4 = { 723 - .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO5_CLKCTRL_OFFSET, 724 - .context_offs = OMAP54XX_RM_L4PER_GPIO5_CONTEXT_OFFSET, 725 - .modulemode = MODULEMODE_HWCTRL, 726 - }, 727 - }, 728 - .opt_clks = gpio5_opt_clks, 729 - .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 730 - }; 731 - 732 - /* gpio6 */ 733 - static struct omap_hwmod_opt_clk gpio6_opt_clks[] = { 734 - { .role = "dbclk", .clk = "gpio6_dbclk" }, 735 - }; 736 - 737 - static struct omap_hwmod omap54xx_gpio6_hwmod = { 738 - .name = "gpio6", 739 - .class = &omap54xx_gpio_hwmod_class, 740 - .clkdm_name = "l4per_clkdm", 741 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 742 - .main_clk = "l4_root_clk_div", 743 - .prcm = { 744 - .omap4 = { 745 - .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO6_CLKCTRL_OFFSET, 746 - .context_offs = OMAP54XX_RM_L4PER_GPIO6_CONTEXT_OFFSET, 747 - .modulemode = MODULEMODE_HWCTRL, 748 - }, 749 - }, 750 - .opt_clks = gpio6_opt_clks, 751 - .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks), 752 - }; 753 - 754 - /* gpio7 */ 755 - static struct omap_hwmod_opt_clk gpio7_opt_clks[] = { 756 - { .role = "dbclk", .clk = "gpio7_dbclk" }, 757 - }; 758 - 759 - static struct omap_hwmod omap54xx_gpio7_hwmod = { 760 - .name = "gpio7", 761 - .class = &omap54xx_gpio_hwmod_class, 762 - .clkdm_name = "l4per_clkdm", 763 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 764 - .main_clk = "l4_root_clk_div", 765 - .prcm = { 766 - .omap4 = { 767 - .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO7_CLKCTRL_OFFSET, 768 - .context_offs = OMAP54XX_RM_L4PER_GPIO7_CONTEXT_OFFSET, 769 - .modulemode = MODULEMODE_HWCTRL, 770 - }, 771 - }, 772 - .opt_clks = gpio7_opt_clks, 773 - .opt_clks_cnt = ARRAY_SIZE(gpio7_opt_clks), 774 - }; 775 - 776 - /* gpio8 */ 777 - static struct omap_hwmod_opt_clk gpio8_opt_clks[] = { 778 - { .role = "dbclk", .clk = "gpio8_dbclk" }, 779 - }; 780 - 781 - static struct omap_hwmod omap54xx_gpio8_hwmod = { 782 - .name = "gpio8", 783 - .class = &omap54xx_gpio_hwmod_class, 784 - .clkdm_name = "l4per_clkdm", 785 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 786 - .main_clk = "l4_root_clk_div", 787 - .prcm = { 788 - .omap4 = { 789 - .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO8_CLKCTRL_OFFSET, 790 - .context_offs = OMAP54XX_RM_L4PER_GPIO8_CONTEXT_OFFSET, 791 - .modulemode = MODULEMODE_HWCTRL, 792 - }, 793 - }, 794 - .opt_clks = gpio8_opt_clks, 795 - .opt_clks_cnt = ARRAY_SIZE(gpio8_opt_clks), 796 - }; 797 - 798 - /* 799 - * 'i2c' class 800 - * multimaster high-speed i2c controller 801 - */ 802 - 803 - static struct omap_hwmod_class_sysconfig omap54xx_i2c_sysc = { 804 - .rev_offs = 0, 805 - .sysc_offs = 0x0010, 806 - .syss_offs = 0x0090, 807 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | 808 - SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 809 - SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), 810 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 811 - SIDLE_SMART_WKUP), 812 - .sysc_fields = &omap_hwmod_sysc_type1, 813 - }; 814 - 815 - static struct omap_hwmod_class omap54xx_i2c_hwmod_class = { 816 - .name = "i2c", 817 - .sysc = &omap54xx_i2c_sysc, 818 - .reset = &omap_i2c_reset, 819 - .rev = OMAP_I2C_IP_VERSION_2, 820 - }; 821 - 822 - /* i2c1 */ 823 - static struct omap_hwmod omap54xx_i2c1_hwmod = { 824 - .name = "i2c1", 825 - .class = &omap54xx_i2c_hwmod_class, 826 - .clkdm_name = "l4per_clkdm", 827 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 828 - .main_clk = "func_96m_fclk", 829 - .prcm = { 830 - .omap4 = { 831 - .clkctrl_offs = OMAP54XX_CM_L4PER_I2C1_CLKCTRL_OFFSET, 832 - .context_offs = OMAP54XX_RM_L4PER_I2C1_CONTEXT_OFFSET, 833 - .modulemode = MODULEMODE_SWCTRL, 834 - }, 835 - }, 836 - }; 837 - 838 - /* i2c2 */ 839 - static struct omap_hwmod omap54xx_i2c2_hwmod = { 840 - .name = "i2c2", 841 - .class = &omap54xx_i2c_hwmod_class, 842 - .clkdm_name = "l4per_clkdm", 843 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 844 - .main_clk = "func_96m_fclk", 845 - .prcm = { 846 - .omap4 = { 847 - .clkctrl_offs = OMAP54XX_CM_L4PER_I2C2_CLKCTRL_OFFSET, 848 - .context_offs = OMAP54XX_RM_L4PER_I2C2_CONTEXT_OFFSET, 849 - .modulemode = MODULEMODE_SWCTRL, 850 - }, 851 - }, 852 - }; 853 - 854 - /* i2c3 */ 855 - static struct omap_hwmod omap54xx_i2c3_hwmod = { 856 - .name = "i2c3", 857 - .class = &omap54xx_i2c_hwmod_class, 858 - .clkdm_name = "l4per_clkdm", 859 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 860 - .main_clk = "func_96m_fclk", 861 - .prcm = { 862 - .omap4 = { 863 - .clkctrl_offs = OMAP54XX_CM_L4PER_I2C3_CLKCTRL_OFFSET, 864 - .context_offs = OMAP54XX_RM_L4PER_I2C3_CONTEXT_OFFSET, 865 - .modulemode = MODULEMODE_SWCTRL, 866 - }, 867 - }, 868 - }; 869 - 870 - /* i2c4 */ 871 - static struct omap_hwmod omap54xx_i2c4_hwmod = { 872 - .name = "i2c4", 873 - .class = &omap54xx_i2c_hwmod_class, 874 - .clkdm_name = "l4per_clkdm", 875 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 876 - .main_clk = "func_96m_fclk", 877 - .prcm = { 878 - .omap4 = { 879 - .clkctrl_offs = OMAP54XX_CM_L4PER_I2C4_CLKCTRL_OFFSET, 880 - .context_offs = OMAP54XX_RM_L4PER_I2C4_CONTEXT_OFFSET, 881 - .modulemode = MODULEMODE_SWCTRL, 882 - }, 883 - }, 884 - }; 885 - 886 - /* i2c5 */ 887 - static struct omap_hwmod omap54xx_i2c5_hwmod = { 888 - .name = "i2c5", 889 - .class = &omap54xx_i2c_hwmod_class, 890 - .clkdm_name = "l4per_clkdm", 891 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 892 - .main_clk = "func_96m_fclk", 893 - .prcm = { 894 - .omap4 = { 895 - .clkctrl_offs = OMAP54XX_CM_L4PER_I2C5_CLKCTRL_OFFSET, 896 - .context_offs = OMAP54XX_RM_L4PER_I2C5_CONTEXT_OFFSET, 897 - .modulemode = MODULEMODE_SWCTRL, 898 - }, 899 - }, 900 - }; 901 - 902 - /* 903 604 * 'kbd' class 904 605 * keyboard controller 905 606 */ ··· 874 1179 .omap4 = { 875 1180 .clkctrl_offs = OMAP54XX_CM_L4PER_MCSPI4_CLKCTRL_OFFSET, 876 1181 .context_offs = OMAP54XX_RM_L4PER_MCSPI4_CONTEXT_OFFSET, 877 - .modulemode = MODULEMODE_SWCTRL, 878 - }, 879 - }, 880 - }; 881 - 882 - /* 883 - * 'mmc' class 884 - * multimedia card high-speed/sd/sdio (mmc/sd/sdio) host controller 885 - */ 886 - 887 - static struct omap_hwmod_class_sysconfig omap54xx_mmc_sysc = { 888 - .rev_offs = 0x0000, 889 - .sysc_offs = 0x0010, 890 - .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE | 891 - SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE | 892 - SYSC_HAS_SOFTRESET), 893 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 894 - SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | 895 - MSTANDBY_SMART | MSTANDBY_SMART_WKUP), 896 - .sysc_fields = &omap_hwmod_sysc_type2, 897 - }; 898 - 899 - static struct omap_hwmod_class omap54xx_mmc_hwmod_class = { 900 - .name = "mmc", 901 - .sysc = &omap54xx_mmc_sysc, 902 - }; 903 - 904 - /* mmc1 */ 905 - static struct omap_hwmod_opt_clk mmc1_opt_clks[] = { 906 - { .role = "32khz_clk", .clk = "mmc1_32khz_clk" }, 907 - }; 908 - 909 - /* mmc1 dev_attr */ 910 - static struct omap_hsmmc_dev_attr mmc1_dev_attr = { 911 - .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, 912 - }; 913 - 914 - static struct omap_hwmod omap54xx_mmc1_hwmod = { 915 - .name = "mmc1", 916 - .class = &omap54xx_mmc_hwmod_class, 917 - .clkdm_name = "l3init_clkdm", 918 - .main_clk = "mmc1_fclk", 919 - .prcm = { 920 - .omap4 = { 921 - .clkctrl_offs = OMAP54XX_CM_L3INIT_MMC1_CLKCTRL_OFFSET, 922 - .context_offs = OMAP54XX_RM_L3INIT_MMC1_CONTEXT_OFFSET, 923 - .modulemode = MODULEMODE_SWCTRL, 924 - }, 925 - }, 926 - .opt_clks = mmc1_opt_clks, 927 - .opt_clks_cnt = ARRAY_SIZE(mmc1_opt_clks), 928 - .dev_attr = &mmc1_dev_attr, 929 - }; 930 - 931 - /* mmc2 */ 932 - static struct omap_hwmod omap54xx_mmc2_hwmod = { 933 - .name = "mmc2", 934 - .class = &omap54xx_mmc_hwmod_class, 935 - .clkdm_name = "l3init_clkdm", 936 - .main_clk = "mmc2_fclk", 937 - .prcm = { 938 - .omap4 = { 939 - .clkctrl_offs = OMAP54XX_CM_L3INIT_MMC2_CLKCTRL_OFFSET, 940 - .context_offs = OMAP54XX_RM_L3INIT_MMC2_CONTEXT_OFFSET, 941 - .modulemode = MODULEMODE_SWCTRL, 942 - }, 943 - }, 944 - }; 945 - 946 - /* mmc3 */ 947 - static struct omap_hwmod omap54xx_mmc3_hwmod = { 948 - .name = "mmc3", 949 - .class = &omap54xx_mmc_hwmod_class, 950 - .clkdm_name = "l4per_clkdm", 951 - .main_clk = "func_48m_fclk", 952 - .prcm = { 953 - .omap4 = { 954 - .clkctrl_offs = OMAP54XX_CM_L4PER_MMC3_CLKCTRL_OFFSET, 955 - .context_offs = OMAP54XX_RM_L4PER_MMC3_CONTEXT_OFFSET, 956 - .modulemode = MODULEMODE_SWCTRL, 957 - }, 958 - }, 959 - }; 960 - 961 - /* mmc4 */ 962 - static struct omap_hwmod omap54xx_mmc4_hwmod = { 963 - .name = "mmc4", 964 - .class = &omap54xx_mmc_hwmod_class, 965 - .clkdm_name = "l4per_clkdm", 966 - .main_clk = "func_48m_fclk", 967 - .prcm = { 968 - .omap4 = { 969 - .clkctrl_offs = OMAP54XX_CM_L4PER_MMC4_CLKCTRL_OFFSET, 970 - .context_offs = OMAP54XX_RM_L4PER_MMC4_CONTEXT_OFFSET, 971 - .modulemode = MODULEMODE_SWCTRL, 972 - }, 973 - }, 974 - }; 975 - 976 - /* mmc5 */ 977 - static struct omap_hwmod omap54xx_mmc5_hwmod = { 978 - .name = "mmc5", 979 - .class = &omap54xx_mmc_hwmod_class, 980 - .clkdm_name = "l4per_clkdm", 981 - .main_clk = "func_96m_fclk", 982 - .prcm = { 983 - .omap4 = { 984 - .clkctrl_offs = OMAP54XX_CM_L4PER_MMC5_CLKCTRL_OFFSET, 985 - .context_offs = OMAP54XX_RM_L4PER_MMC5_CONTEXT_OFFSET, 986 1182 .modulemode = MODULEMODE_SWCTRL, 987 1183 }, 988 1184 }, ··· 1238 1652 .omap4 = { 1239 1653 .clkctrl_offs = OMAP54XX_CM_L4PER_TIMER11_CLKCTRL_OFFSET, 1240 1654 .context_offs = OMAP54XX_RM_L4PER_TIMER11_CONTEXT_OFFSET, 1241 - .modulemode = MODULEMODE_SWCTRL, 1242 - }, 1243 - }, 1244 - }; 1245 - 1246 - /* 1247 - * 'uart' class 1248 - * universal asynchronous receiver/transmitter (uart) 1249 - */ 1250 - 1251 - static struct omap_hwmod_class_sysconfig omap54xx_uart_sysc = { 1252 - .rev_offs = 0x0050, 1253 - .sysc_offs = 0x0054, 1254 - .syss_offs = 0x0058, 1255 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP | 1256 - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | 1257 - SYSS_HAS_RESET_STATUS), 1258 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1259 - SIDLE_SMART_WKUP), 1260 - .sysc_fields = &omap_hwmod_sysc_type1, 1261 - }; 1262 - 1263 - static struct omap_hwmod_class omap54xx_uart_hwmod_class = { 1264 - .name = "uart", 1265 - .sysc = &omap54xx_uart_sysc, 1266 - }; 1267 - 1268 - /* uart1 */ 1269 - static struct omap_hwmod omap54xx_uart1_hwmod = { 1270 - .name = "uart1", 1271 - .class = &omap54xx_uart_hwmod_class, 1272 - .clkdm_name = "l4per_clkdm", 1273 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1274 - .main_clk = "func_48m_fclk", 1275 - .prcm = { 1276 - .omap4 = { 1277 - .clkctrl_offs = OMAP54XX_CM_L4PER_UART1_CLKCTRL_OFFSET, 1278 - .context_offs = OMAP54XX_RM_L4PER_UART1_CONTEXT_OFFSET, 1279 - .modulemode = MODULEMODE_SWCTRL, 1280 - }, 1281 - }, 1282 - }; 1283 - 1284 - /* uart2 */ 1285 - static struct omap_hwmod omap54xx_uart2_hwmod = { 1286 - .name = "uart2", 1287 - .class = &omap54xx_uart_hwmod_class, 1288 - .clkdm_name = "l4per_clkdm", 1289 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1290 - .main_clk = "func_48m_fclk", 1291 - .prcm = { 1292 - .omap4 = { 1293 - .clkctrl_offs = OMAP54XX_CM_L4PER_UART2_CLKCTRL_OFFSET, 1294 - .context_offs = OMAP54XX_RM_L4PER_UART2_CONTEXT_OFFSET, 1295 - .modulemode = MODULEMODE_SWCTRL, 1296 - }, 1297 - }, 1298 - }; 1299 - 1300 - /* uart3 */ 1301 - static struct omap_hwmod omap54xx_uart3_hwmod = { 1302 - .name = "uart3", 1303 - .class = &omap54xx_uart_hwmod_class, 1304 - .clkdm_name = "l4per_clkdm", 1305 - .flags = DEBUG_OMAP4UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT, 1306 - .main_clk = "func_48m_fclk", 1307 - .prcm = { 1308 - .omap4 = { 1309 - .clkctrl_offs = OMAP54XX_CM_L4PER_UART3_CLKCTRL_OFFSET, 1310 - .context_offs = OMAP54XX_RM_L4PER_UART3_CONTEXT_OFFSET, 1311 - .modulemode = MODULEMODE_SWCTRL, 1312 - }, 1313 - }, 1314 - }; 1315 - 1316 - /* uart4 */ 1317 - static struct omap_hwmod omap54xx_uart4_hwmod = { 1318 - .name = "uart4", 1319 - .class = &omap54xx_uart_hwmod_class, 1320 - .clkdm_name = "l4per_clkdm", 1321 - .flags = DEBUG_OMAP4UART4_FLAGS | HWMOD_SWSUP_SIDLE_ACT, 1322 - .main_clk = "func_48m_fclk", 1323 - .prcm = { 1324 - .omap4 = { 1325 - .clkctrl_offs = OMAP54XX_CM_L4PER_UART4_CLKCTRL_OFFSET, 1326 - .context_offs = OMAP54XX_RM_L4PER_UART4_CONTEXT_OFFSET, 1327 - .modulemode = MODULEMODE_SWCTRL, 1328 - }, 1329 - }, 1330 - }; 1331 - 1332 - /* uart5 */ 1333 - static struct omap_hwmod omap54xx_uart5_hwmod = { 1334 - .name = "uart5", 1335 - .class = &omap54xx_uart_hwmod_class, 1336 - .clkdm_name = "l4per_clkdm", 1337 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1338 - .main_clk = "func_48m_fclk", 1339 - .prcm = { 1340 - .omap4 = { 1341 - .clkctrl_offs = OMAP54XX_CM_L4PER_UART5_CLKCTRL_OFFSET, 1342 - .context_offs = OMAP54XX_RM_L4PER_UART5_CONTEXT_OFFSET, 1343 - .modulemode = MODULEMODE_SWCTRL, 1344 - }, 1345 - }, 1346 - }; 1347 - 1348 - /* uart6 */ 1349 - static struct omap_hwmod omap54xx_uart6_hwmod = { 1350 - .name = "uart6", 1351 - .class = &omap54xx_uart_hwmod_class, 1352 - .clkdm_name = "l4per_clkdm", 1353 - .flags = HWMOD_SWSUP_SIDLE_ACT, 1354 - .main_clk = "func_48m_fclk", 1355 - .prcm = { 1356 - .omap4 = { 1357 - .clkctrl_offs = OMAP54XX_CM_L4PER_UART6_CLKCTRL_OFFSET, 1358 - .context_offs = OMAP54XX_RM_L4PER_UART6_CONTEXT_OFFSET, 1359 1655 .modulemode = MODULEMODE_SWCTRL, 1360 1656 }, 1361 1657 }, ··· 1742 2274 .user = OCP_USER_MPU | OCP_USER_SDMA, 1743 2275 }; 1744 2276 1745 - /* l4_wkup -> gpio1 */ 1746 - static struct omap_hwmod_ocp_if omap54xx_l4_wkup__gpio1 = { 1747 - .master = &omap54xx_l4_wkup_hwmod, 1748 - .slave = &omap54xx_gpio1_hwmod, 1749 - .clk = "wkupaon_iclk_mux", 1750 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1751 - }; 1752 - 1753 - /* l4_per -> gpio2 */ 1754 - static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio2 = { 1755 - .master = &omap54xx_l4_per_hwmod, 1756 - .slave = &omap54xx_gpio2_hwmod, 1757 - .clk = "l4_root_clk_div", 1758 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1759 - }; 1760 - 1761 - /* l4_per -> gpio3 */ 1762 - static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio3 = { 1763 - .master = &omap54xx_l4_per_hwmod, 1764 - .slave = &omap54xx_gpio3_hwmod, 1765 - .clk = "l4_root_clk_div", 1766 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1767 - }; 1768 - 1769 - /* l4_per -> gpio4 */ 1770 - static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio4 = { 1771 - .master = &omap54xx_l4_per_hwmod, 1772 - .slave = &omap54xx_gpio4_hwmod, 1773 - .clk = "l4_root_clk_div", 1774 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1775 - }; 1776 - 1777 - /* l4_per -> gpio5 */ 1778 - static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio5 = { 1779 - .master = &omap54xx_l4_per_hwmod, 1780 - .slave = &omap54xx_gpio5_hwmod, 1781 - .clk = "l4_root_clk_div", 1782 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1783 - }; 1784 - 1785 - /* l4_per -> gpio6 */ 1786 - static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio6 = { 1787 - .master = &omap54xx_l4_per_hwmod, 1788 - .slave = &omap54xx_gpio6_hwmod, 1789 - .clk = "l4_root_clk_div", 1790 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1791 - }; 1792 - 1793 - /* l4_per -> gpio7 */ 1794 - static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio7 = { 1795 - .master = &omap54xx_l4_per_hwmod, 1796 - .slave = &omap54xx_gpio7_hwmod, 1797 - .clk = "l4_root_clk_div", 1798 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1799 - }; 1800 - 1801 - /* l4_per -> gpio8 */ 1802 - static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio8 = { 1803 - .master = &omap54xx_l4_per_hwmod, 1804 - .slave = &omap54xx_gpio8_hwmod, 1805 - .clk = "l4_root_clk_div", 1806 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1807 - }; 1808 - 1809 - /* l4_per -> i2c1 */ 1810 - static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c1 = { 1811 - .master = &omap54xx_l4_per_hwmod, 1812 - .slave = &omap54xx_i2c1_hwmod, 1813 - .clk = "l4_root_clk_div", 1814 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1815 - }; 1816 - 1817 - /* l4_per -> i2c2 */ 1818 - static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c2 = { 1819 - .master = &omap54xx_l4_per_hwmod, 1820 - .slave = &omap54xx_i2c2_hwmod, 1821 - .clk = "l4_root_clk_div", 1822 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1823 - }; 1824 - 1825 - /* l4_per -> i2c3 */ 1826 - static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c3 = { 1827 - .master = &omap54xx_l4_per_hwmod, 1828 - .slave = &omap54xx_i2c3_hwmod, 1829 - .clk = "l4_root_clk_div", 1830 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1831 - }; 1832 - 1833 - /* l4_per -> i2c4 */ 1834 - static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c4 = { 1835 - .master = &omap54xx_l4_per_hwmod, 1836 - .slave = &omap54xx_i2c4_hwmod, 1837 - .clk = "l4_root_clk_div", 1838 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1839 - }; 1840 - 1841 - /* l4_per -> i2c5 */ 1842 - static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c5 = { 1843 - .master = &omap54xx_l4_per_hwmod, 1844 - .slave = &omap54xx_i2c5_hwmod, 1845 - .clk = "l4_root_clk_div", 1846 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1847 - }; 1848 - 1849 2277 /* l4_wkup -> kbd */ 1850 2278 static struct omap_hwmod_ocp_if omap54xx_l4_wkup__kbd = { 1851 2279 .master = &omap54xx_l4_wkup_hwmod, ··· 1818 2454 static struct omap_hwmod_ocp_if omap54xx_l4_per__mcspi4 = { 1819 2455 .master = &omap54xx_l4_per_hwmod, 1820 2456 .slave = &omap54xx_mcspi4_hwmod, 1821 - .clk = "l4_root_clk_div", 1822 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1823 - }; 1824 - 1825 - /* l4_per -> mmc1 */ 1826 - static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc1 = { 1827 - .master = &omap54xx_l4_per_hwmod, 1828 - .slave = &omap54xx_mmc1_hwmod, 1829 - .clk = "l3_iclk_div", 1830 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1831 - }; 1832 - 1833 - /* l4_per -> mmc2 */ 1834 - static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc2 = { 1835 - .master = &omap54xx_l4_per_hwmod, 1836 - .slave = &omap54xx_mmc2_hwmod, 1837 - .clk = "l3_iclk_div", 1838 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1839 - }; 1840 - 1841 - /* l4_per -> mmc3 */ 1842 - static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc3 = { 1843 - .master = &omap54xx_l4_per_hwmod, 1844 - .slave = &omap54xx_mmc3_hwmod, 1845 - .clk = "l4_root_clk_div", 1846 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1847 - }; 1848 - 1849 - /* l4_per -> mmc4 */ 1850 - static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc4 = { 1851 - .master = &omap54xx_l4_per_hwmod, 1852 - .slave = &omap54xx_mmc4_hwmod, 1853 - .clk = "l4_root_clk_div", 1854 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1855 - }; 1856 - 1857 - /* l4_per -> mmc5 */ 1858 - static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc5 = { 1859 - .master = &omap54xx_l4_per_hwmod, 1860 - .slave = &omap54xx_mmc5_hwmod, 1861 2457 .clk = "l4_root_clk_div", 1862 2458 .user = OCP_USER_MPU | OCP_USER_SDMA, 1863 2459 }; ··· 1934 2610 .user = OCP_USER_MPU | OCP_USER_SDMA, 1935 2611 }; 1936 2612 1937 - /* l4_per -> uart1 */ 1938 - static struct omap_hwmod_ocp_if omap54xx_l4_per__uart1 = { 1939 - .master = &omap54xx_l4_per_hwmod, 1940 - .slave = &omap54xx_uart1_hwmod, 1941 - .clk = "l4_root_clk_div", 1942 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1943 - }; 1944 - 1945 - /* l4_per -> uart2 */ 1946 - static struct omap_hwmod_ocp_if omap54xx_l4_per__uart2 = { 1947 - .master = &omap54xx_l4_per_hwmod, 1948 - .slave = &omap54xx_uart2_hwmod, 1949 - .clk = "l4_root_clk_div", 1950 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1951 - }; 1952 - 1953 - /* l4_per -> uart3 */ 1954 - static struct omap_hwmod_ocp_if omap54xx_l4_per__uart3 = { 1955 - .master = &omap54xx_l4_per_hwmod, 1956 - .slave = &omap54xx_uart3_hwmod, 1957 - .clk = "l4_root_clk_div", 1958 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1959 - }; 1960 - 1961 - /* l4_per -> uart4 */ 1962 - static struct omap_hwmod_ocp_if omap54xx_l4_per__uart4 = { 1963 - .master = &omap54xx_l4_per_hwmod, 1964 - .slave = &omap54xx_uart4_hwmod, 1965 - .clk = "l4_root_clk_div", 1966 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1967 - }; 1968 - 1969 - /* l4_per -> uart5 */ 1970 - static struct omap_hwmod_ocp_if omap54xx_l4_per__uart5 = { 1971 - .master = &omap54xx_l4_per_hwmod, 1972 - .slave = &omap54xx_uart5_hwmod, 1973 - .clk = "l4_root_clk_div", 1974 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1975 - }; 1976 - 1977 - /* l4_per -> uart6 */ 1978 - static struct omap_hwmod_ocp_if omap54xx_l4_per__uart6 = { 1979 - .master = &omap54xx_l4_per_hwmod, 1980 - .slave = &omap54xx_uart6_hwmod, 1981 - .clk = "l4_root_clk_div", 1982 - .user = OCP_USER_MPU | OCP_USER_SDMA, 1983 - }; 1984 - 1985 2613 /* l4_cfg -> usb_host_hs */ 1986 2614 static struct omap_hwmod_ocp_if omap54xx_l4_cfg__usb_host_hs = { 1987 2615 .master = &omap54xx_l4_cfg_hwmod, ··· 1995 2719 &omap54xx_l3_main_2__dss_rfbi, 1996 2720 &omap54xx_mpu__emif1, 1997 2721 &omap54xx_mpu__emif2, 1998 - &omap54xx_l4_wkup__gpio1, 1999 - &omap54xx_l4_per__gpio2, 2000 - &omap54xx_l4_per__gpio3, 2001 - &omap54xx_l4_per__gpio4, 2002 - &omap54xx_l4_per__gpio5, 2003 - &omap54xx_l4_per__gpio6, 2004 - &omap54xx_l4_per__gpio7, 2005 - &omap54xx_l4_per__gpio8, 2006 - &omap54xx_l4_per__i2c1, 2007 - &omap54xx_l4_per__i2c2, 2008 - &omap54xx_l4_per__i2c3, 2009 - &omap54xx_l4_per__i2c4, 2010 - &omap54xx_l4_per__i2c5, 2011 2722 &omap54xx_l3_main_2__mmu_ipu, 2012 2723 &omap54xx_l4_wkup__kbd, 2013 2724 &omap54xx_l4_cfg__mailbox, ··· 2006 2743 &omap54xx_l4_per__mcspi2, 2007 2744 &omap54xx_l4_per__mcspi3, 2008 2745 &omap54xx_l4_per__mcspi4, 2009 - &omap54xx_l4_per__mmc1, 2010 - &omap54xx_l4_per__mmc2, 2011 - &omap54xx_l4_per__mmc3, 2012 - &omap54xx_l4_per__mmc4, 2013 - &omap54xx_l4_per__mmc5, 2014 2746 &omap54xx_l4_cfg__mpu, 2015 2747 &omap54xx_l4_cfg__spinlock, 2016 2748 &omap54xx_l4_cfg__ocp2scp1, ··· 2020 2762 &omap54xx_l4_per__timer9, 2021 2763 &omap54xx_l4_per__timer10, 2022 2764 &omap54xx_l4_per__timer11, 2023 - &omap54xx_l4_per__uart1, 2024 - &omap54xx_l4_per__uart2, 2025 - &omap54xx_l4_per__uart3, 2026 - &omap54xx_l4_per__uart4, 2027 - &omap54xx_l4_per__uart5, 2028 - &omap54xx_l4_per__uart6, 2029 2765 &omap54xx_l4_cfg__usb_host_hs, 2030 2766 &omap54xx_l4_cfg__usb_tll_hs, 2031 2767 &omap54xx_l4_cfg__usb_otg_ss,
+1 -847
arch/arm/mach-omap2/omap_hwmod_7xx_data.c
··· 18 18 */ 19 19 20 20 #include <linux/io.h> 21 - #include <linux/platform_data/hsmmc-omap.h> 22 21 #include <linux/power/smartreflex.h> 23 - #include <linux/platform_data/i2c-omap.h> 24 22 25 23 #include <linux/omap-dma.h> 26 24 ··· 27 29 #include "cm1_7xx.h" 28 30 #include "cm2_7xx.h" 29 31 #include "prm7xx.h" 30 - #include "i2c.h" 31 32 #include "wd_timer.h" 32 33 #include "soc.h" 33 34 ··· 690 693 static struct omap_hwmod_class dra7xx_aes_hwmod_class = { 691 694 .name = "aes", 692 695 .sysc = &dra7xx_aes_sysc, 693 - .rev = 2, 694 696 }; 695 697 696 698 /* AES1 */ ··· 733 737 static struct omap_hwmod_class dra7xx_sha0_hwmod_class = { 734 738 .name = "sham", 735 739 .sysc = &dra7xx_sha0_sysc, 736 - .rev = 2, 737 740 }; 738 741 739 742 struct omap_hwmod dra7xx_sha0_hwmod = { ··· 784 789 .context_offs = DRA7XX_RM_L4PER_ELM_CONTEXT_OFFSET, 785 790 }, 786 791 }, 787 - }; 788 - 789 - /* 790 - * 'gpio' class 791 - * 792 - */ 793 - 794 - static struct omap_hwmod_class_sysconfig dra7xx_gpio_sysc = { 795 - .rev_offs = 0x0000, 796 - .sysc_offs = 0x0010, 797 - .syss_offs = 0x0114, 798 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP | 799 - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | 800 - SYSS_HAS_RESET_STATUS), 801 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 802 - SIDLE_SMART_WKUP), 803 - .sysc_fields = &omap_hwmod_sysc_type1, 804 - }; 805 - 806 - static struct omap_hwmod_class dra7xx_gpio_hwmod_class = { 807 - .name = "gpio", 808 - .sysc = &dra7xx_gpio_sysc, 809 - .rev = 2, 810 - }; 811 - 812 - /* gpio1 */ 813 - static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 814 - { .role = "dbclk", .clk = "gpio1_dbclk" }, 815 - }; 816 - 817 - static struct omap_hwmod dra7xx_gpio1_hwmod = { 818 - .name = "gpio1", 819 - .class = &dra7xx_gpio_hwmod_class, 820 - .clkdm_name = "wkupaon_clkdm", 821 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 822 - .main_clk = "wkupaon_iclk_mux", 823 - .prcm = { 824 - .omap4 = { 825 - .clkctrl_offs = DRA7XX_CM_WKUPAON_GPIO1_CLKCTRL_OFFSET, 826 - .context_offs = DRA7XX_RM_WKUPAON_GPIO1_CONTEXT_OFFSET, 827 - .modulemode = MODULEMODE_HWCTRL, 828 - }, 829 - }, 830 - .opt_clks = gpio1_opt_clks, 831 - .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks), 832 - }; 833 - 834 - /* gpio2 */ 835 - static struct omap_hwmod_opt_clk gpio2_opt_clks[] = { 836 - { .role = "dbclk", .clk = "gpio2_dbclk" }, 837 - }; 838 - 839 - static struct omap_hwmod dra7xx_gpio2_hwmod = { 840 - .name = "gpio2", 841 - .class = &dra7xx_gpio_hwmod_class, 842 - .clkdm_name = "l4per_clkdm", 843 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 844 - .main_clk = "l3_iclk_div", 845 - .prcm = { 846 - .omap4 = { 847 - .clkctrl_offs = DRA7XX_CM_L4PER_GPIO2_CLKCTRL_OFFSET, 848 - .context_offs = DRA7XX_RM_L4PER_GPIO2_CONTEXT_OFFSET, 849 - .modulemode = MODULEMODE_HWCTRL, 850 - }, 851 - }, 852 - .opt_clks = gpio2_opt_clks, 853 - .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks), 854 - }; 855 - 856 - /* gpio3 */ 857 - static struct omap_hwmod_opt_clk gpio3_opt_clks[] = { 858 - { .role = "dbclk", .clk = "gpio3_dbclk" }, 859 - }; 860 - 861 - static struct omap_hwmod dra7xx_gpio3_hwmod = { 862 - .name = "gpio3", 863 - .class = &dra7xx_gpio_hwmod_class, 864 - .clkdm_name = "l4per_clkdm", 865 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 866 - .main_clk = "l3_iclk_div", 867 - .prcm = { 868 - .omap4 = { 869 - .clkctrl_offs = DRA7XX_CM_L4PER_GPIO3_CLKCTRL_OFFSET, 870 - .context_offs = DRA7XX_RM_L4PER_GPIO3_CONTEXT_OFFSET, 871 - .modulemode = MODULEMODE_HWCTRL, 872 - }, 873 - }, 874 - .opt_clks = gpio3_opt_clks, 875 - .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks), 876 - }; 877 - 878 - /* gpio4 */ 879 - static struct omap_hwmod_opt_clk gpio4_opt_clks[] = { 880 - { .role = "dbclk", .clk = "gpio4_dbclk" }, 881 - }; 882 - 883 - static struct omap_hwmod dra7xx_gpio4_hwmod = { 884 - .name = "gpio4", 885 - .class = &dra7xx_gpio_hwmod_class, 886 - .clkdm_name = "l4per_clkdm", 887 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 888 - .main_clk = "l3_iclk_div", 889 - .prcm = { 890 - .omap4 = { 891 - .clkctrl_offs = DRA7XX_CM_L4PER_GPIO4_CLKCTRL_OFFSET, 892 - .context_offs = DRA7XX_RM_L4PER_GPIO4_CONTEXT_OFFSET, 893 - .modulemode = MODULEMODE_HWCTRL, 894 - }, 895 - }, 896 - .opt_clks = gpio4_opt_clks, 897 - .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks), 898 - }; 899 - 900 - /* gpio5 */ 901 - static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { 902 - { .role = "dbclk", .clk = "gpio5_dbclk" }, 903 - }; 904 - 905 - static struct omap_hwmod dra7xx_gpio5_hwmod = { 906 - .name = "gpio5", 907 - .class = &dra7xx_gpio_hwmod_class, 908 - .clkdm_name = "l4per_clkdm", 909 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 910 - .main_clk = "l3_iclk_div", 911 - .prcm = { 912 - .omap4 = { 913 - .clkctrl_offs = DRA7XX_CM_L4PER_GPIO5_CLKCTRL_OFFSET, 914 - .context_offs = DRA7XX_RM_L4PER_GPIO5_CONTEXT_OFFSET, 915 - .modulemode = MODULEMODE_HWCTRL, 916 - }, 917 - }, 918 - .opt_clks = gpio5_opt_clks, 919 - .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 920 - }; 921 - 922 - /* gpio6 */ 923 - static struct omap_hwmod_opt_clk gpio6_opt_clks[] = { 924 - { .role = "dbclk", .clk = "gpio6_dbclk" }, 925 - }; 926 - 927 - static struct omap_hwmod dra7xx_gpio6_hwmod = { 928 - .name = "gpio6", 929 - .class = &dra7xx_gpio_hwmod_class, 930 - .clkdm_name = "l4per_clkdm", 931 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 932 - .main_clk = "l3_iclk_div", 933 - .prcm = { 934 - .omap4 = { 935 - .clkctrl_offs = DRA7XX_CM_L4PER_GPIO6_CLKCTRL_OFFSET, 936 - .context_offs = DRA7XX_RM_L4PER_GPIO6_CONTEXT_OFFSET, 937 - .modulemode = MODULEMODE_HWCTRL, 938 - }, 939 - }, 940 - .opt_clks = gpio6_opt_clks, 941 - .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks), 942 - }; 943 - 944 - /* gpio7 */ 945 - static struct omap_hwmod_opt_clk gpio7_opt_clks[] = { 946 - { .role = "dbclk", .clk = "gpio7_dbclk" }, 947 - }; 948 - 949 - static struct omap_hwmod dra7xx_gpio7_hwmod = { 950 - .name = "gpio7", 951 - .class = &dra7xx_gpio_hwmod_class, 952 - .clkdm_name = "l4per_clkdm", 953 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 954 - .main_clk = "l3_iclk_div", 955 - .prcm = { 956 - .omap4 = { 957 - .clkctrl_offs = DRA7XX_CM_L4PER_GPIO7_CLKCTRL_OFFSET, 958 - .context_offs = DRA7XX_RM_L4PER_GPIO7_CONTEXT_OFFSET, 959 - .modulemode = MODULEMODE_HWCTRL, 960 - }, 961 - }, 962 - .opt_clks = gpio7_opt_clks, 963 - .opt_clks_cnt = ARRAY_SIZE(gpio7_opt_clks), 964 - }; 965 - 966 - /* gpio8 */ 967 - static struct omap_hwmod_opt_clk gpio8_opt_clks[] = { 968 - { .role = "dbclk", .clk = "gpio8_dbclk" }, 969 - }; 970 - 971 - static struct omap_hwmod dra7xx_gpio8_hwmod = { 972 - .name = "gpio8", 973 - .class = &dra7xx_gpio_hwmod_class, 974 - .clkdm_name = "l4per_clkdm", 975 - .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 976 - .main_clk = "l3_iclk_div", 977 - .prcm = { 978 - .omap4 = { 979 - .clkctrl_offs = DRA7XX_CM_L4PER_GPIO8_CLKCTRL_OFFSET, 980 - .context_offs = DRA7XX_RM_L4PER_GPIO8_CONTEXT_OFFSET, 981 - .modulemode = MODULEMODE_HWCTRL, 982 - }, 983 - }, 984 - .opt_clks = gpio8_opt_clks, 985 - .opt_clks_cnt = ARRAY_SIZE(gpio8_opt_clks), 986 792 }; 987 793 988 794 /* ··· 855 1059 .omap4 = { 856 1060 .clkctrl_offs = DRA7XX_CM_L4PER_HDQ1W_CLKCTRL_OFFSET, 857 1061 .context_offs = DRA7XX_RM_L4PER_HDQ1W_CONTEXT_OFFSET, 858 - .modulemode = MODULEMODE_SWCTRL, 859 - }, 860 - }, 861 - }; 862 - 863 - /* 864 - * 'i2c' class 865 - * 866 - */ 867 - 868 - static struct omap_hwmod_class_sysconfig dra7xx_i2c_sysc = { 869 - .rev_offs = 0, 870 - .sysc_offs = 0x0010, 871 - .syss_offs = 0x0090, 872 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | 873 - SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 874 - SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), 875 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 876 - SIDLE_SMART_WKUP), 877 - .sysc_fields = &omap_hwmod_sysc_type1, 878 - }; 879 - 880 - static struct omap_hwmod_class dra7xx_i2c_hwmod_class = { 881 - .name = "i2c", 882 - .sysc = &dra7xx_i2c_sysc, 883 - .reset = &omap_i2c_reset, 884 - .rev = OMAP_I2C_IP_VERSION_2, 885 - }; 886 - 887 - /* i2c1 */ 888 - static struct omap_hwmod dra7xx_i2c1_hwmod = { 889 - .name = "i2c1", 890 - .class = &dra7xx_i2c_hwmod_class, 891 - .clkdm_name = "l4per_clkdm", 892 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 893 - .main_clk = "func_96m_fclk", 894 - .prcm = { 895 - .omap4 = { 896 - .clkctrl_offs = DRA7XX_CM_L4PER_I2C1_CLKCTRL_OFFSET, 897 - .context_offs = DRA7XX_RM_L4PER_I2C1_CONTEXT_OFFSET, 898 - .modulemode = MODULEMODE_SWCTRL, 899 - }, 900 - }, 901 - }; 902 - 903 - /* i2c2 */ 904 - static struct omap_hwmod dra7xx_i2c2_hwmod = { 905 - .name = "i2c2", 906 - .class = &dra7xx_i2c_hwmod_class, 907 - .clkdm_name = "l4per_clkdm", 908 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 909 - .main_clk = "func_96m_fclk", 910 - .prcm = { 911 - .omap4 = { 912 - .clkctrl_offs = DRA7XX_CM_L4PER_I2C2_CLKCTRL_OFFSET, 913 - .context_offs = DRA7XX_RM_L4PER_I2C2_CONTEXT_OFFSET, 914 - .modulemode = MODULEMODE_SWCTRL, 915 - }, 916 - }, 917 - }; 918 - 919 - /* i2c3 */ 920 - static struct omap_hwmod dra7xx_i2c3_hwmod = { 921 - .name = "i2c3", 922 - .class = &dra7xx_i2c_hwmod_class, 923 - .clkdm_name = "l4per_clkdm", 924 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 925 - .main_clk = "func_96m_fclk", 926 - .prcm = { 927 - .omap4 = { 928 - .clkctrl_offs = DRA7XX_CM_L4PER_I2C3_CLKCTRL_OFFSET, 929 - .context_offs = DRA7XX_RM_L4PER_I2C3_CONTEXT_OFFSET, 930 - .modulemode = MODULEMODE_SWCTRL, 931 - }, 932 - }, 933 - }; 934 - 935 - /* i2c4 */ 936 - static struct omap_hwmod dra7xx_i2c4_hwmod = { 937 - .name = "i2c4", 938 - .class = &dra7xx_i2c_hwmod_class, 939 - .clkdm_name = "l4per_clkdm", 940 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 941 - .main_clk = "func_96m_fclk", 942 - .prcm = { 943 - .omap4 = { 944 - .clkctrl_offs = DRA7XX_CM_L4PER_I2C4_CLKCTRL_OFFSET, 945 - .context_offs = DRA7XX_RM_L4PER_I2C4_CONTEXT_OFFSET, 946 - .modulemode = MODULEMODE_SWCTRL, 947 - }, 948 - }, 949 - }; 950 - 951 - /* i2c5 */ 952 - static struct omap_hwmod dra7xx_i2c5_hwmod = { 953 - .name = "i2c5", 954 - .class = &dra7xx_i2c_hwmod_class, 955 - .clkdm_name = "ipu_clkdm", 956 - .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, 957 - .main_clk = "func_96m_fclk", 958 - .prcm = { 959 - .omap4 = { 960 - .clkctrl_offs = DRA7XX_CM_IPU_I2C5_CLKCTRL_OFFSET, 961 - .context_offs = DRA7XX_RM_IPU_I2C5_CONTEXT_OFFSET, 962 1062 .modulemode = MODULEMODE_SWCTRL, 963 1063 }, 964 1064 }, ··· 1324 1632 }; 1325 1633 1326 1634 /* 1327 - * 'mmc' class 1328 - * 1329 - */ 1330 - 1331 - static struct omap_hwmod_class_sysconfig dra7xx_mmc_sysc = { 1332 - .rev_offs = 0x0000, 1333 - .sysc_offs = 0x0010, 1334 - .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE | 1335 - SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE | 1336 - SYSC_HAS_SOFTRESET), 1337 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1338 - SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | 1339 - MSTANDBY_SMART | MSTANDBY_SMART_WKUP), 1340 - .sysc_fields = &omap_hwmod_sysc_type2, 1341 - }; 1342 - 1343 - static struct omap_hwmod_class dra7xx_mmc_hwmod_class = { 1344 - .name = "mmc", 1345 - .sysc = &dra7xx_mmc_sysc, 1346 - }; 1347 - 1348 - /* mmc1 */ 1349 - static struct omap_hwmod_opt_clk mmc1_opt_clks[] = { 1350 - { .role = "clk32k", .clk = "mmc1_clk32k" }, 1351 - }; 1352 - 1353 - /* mmc1 dev_attr */ 1354 - static struct omap_hsmmc_dev_attr mmc1_dev_attr = { 1355 - .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, 1356 - }; 1357 - 1358 - static struct omap_hwmod dra7xx_mmc1_hwmod = { 1359 - .name = "mmc1", 1360 - .class = &dra7xx_mmc_hwmod_class, 1361 - .clkdm_name = "l3init_clkdm", 1362 - .main_clk = "mmc1_fclk_div", 1363 - .prcm = { 1364 - .omap4 = { 1365 - .clkctrl_offs = DRA7XX_CM_L3INIT_MMC1_CLKCTRL_OFFSET, 1366 - .context_offs = DRA7XX_RM_L3INIT_MMC1_CONTEXT_OFFSET, 1367 - .modulemode = MODULEMODE_SWCTRL, 1368 - }, 1369 - }, 1370 - .opt_clks = mmc1_opt_clks, 1371 - .opt_clks_cnt = ARRAY_SIZE(mmc1_opt_clks), 1372 - .dev_attr = &mmc1_dev_attr, 1373 - }; 1374 - 1375 - /* mmc2 */ 1376 - static struct omap_hwmod_opt_clk mmc2_opt_clks[] = { 1377 - { .role = "clk32k", .clk = "mmc2_clk32k" }, 1378 - }; 1379 - 1380 - static struct omap_hwmod dra7xx_mmc2_hwmod = { 1381 - .name = "mmc2", 1382 - .class = &dra7xx_mmc_hwmod_class, 1383 - .clkdm_name = "l3init_clkdm", 1384 - .main_clk = "mmc2_fclk_div", 1385 - .prcm = { 1386 - .omap4 = { 1387 - .clkctrl_offs = DRA7XX_CM_L3INIT_MMC2_CLKCTRL_OFFSET, 1388 - .context_offs = DRA7XX_RM_L3INIT_MMC2_CONTEXT_OFFSET, 1389 - .modulemode = MODULEMODE_SWCTRL, 1390 - }, 1391 - }, 1392 - .opt_clks = mmc2_opt_clks, 1393 - .opt_clks_cnt = ARRAY_SIZE(mmc2_opt_clks), 1394 - }; 1395 - 1396 - /* mmc3 */ 1397 - static struct omap_hwmod_opt_clk mmc3_opt_clks[] = { 1398 - { .role = "clk32k", .clk = "mmc3_clk32k" }, 1399 - }; 1400 - 1401 - static struct omap_hwmod dra7xx_mmc3_hwmod = { 1402 - .name = "mmc3", 1403 - .class = &dra7xx_mmc_hwmod_class, 1404 - .clkdm_name = "l4per_clkdm", 1405 - .main_clk = "mmc3_gfclk_div", 1406 - .prcm = { 1407 - .omap4 = { 1408 - .clkctrl_offs = DRA7XX_CM_L4PER_MMC3_CLKCTRL_OFFSET, 1409 - .context_offs = DRA7XX_RM_L4PER_MMC3_CONTEXT_OFFSET, 1410 - .modulemode = MODULEMODE_SWCTRL, 1411 - }, 1412 - }, 1413 - .opt_clks = mmc3_opt_clks, 1414 - .opt_clks_cnt = ARRAY_SIZE(mmc3_opt_clks), 1415 - }; 1416 - 1417 - /* mmc4 */ 1418 - static struct omap_hwmod_opt_clk mmc4_opt_clks[] = { 1419 - { .role = "clk32k", .clk = "mmc4_clk32k" }, 1420 - }; 1421 - 1422 - static struct omap_hwmod dra7xx_mmc4_hwmod = { 1423 - .name = "mmc4", 1424 - .class = &dra7xx_mmc_hwmod_class, 1425 - .clkdm_name = "l4per_clkdm", 1426 - .main_clk = "mmc4_gfclk_div", 1427 - .prcm = { 1428 - .omap4 = { 1429 - .clkctrl_offs = DRA7XX_CM_L4PER_MMC4_CLKCTRL_OFFSET, 1430 - .context_offs = DRA7XX_RM_L4PER_MMC4_CONTEXT_OFFSET, 1431 - .modulemode = MODULEMODE_SWCTRL, 1432 - }, 1433 - }, 1434 - .opt_clks = mmc4_opt_clks, 1435 - .opt_clks_cnt = ARRAY_SIZE(mmc4_opt_clks), 1436 - }; 1437 - 1438 - /* 1439 1635 * 'mpu' class 1440 1636 * 1441 1637 */ ··· 1412 1832 * We use a PCIeSS HWMOD class specific reset handler to deassert the hardreset 1413 1833 * lines after asserting them. 1414 1834 */ 1415 - static int dra7xx_pciess_reset(struct omap_hwmod *oh) 1835 + int dra7xx_pciess_reset(struct omap_hwmod *oh) 1416 1836 { 1417 1837 int i; 1418 1838 ··· 1599 2019 static struct omap_hwmod_class dra7xx_smartreflex_hwmod_class = { 1600 2020 .name = "smartreflex", 1601 2021 .sysc = &dra7xx_smartreflex_sysc, 1602 - .rev = 2, 1603 2022 }; 1604 2023 1605 2024 /* smartreflex_core */ ··· 1949 2370 .omap4 = { 1950 2371 .clkctrl_offs = DRA7XX_CM_L4PER3_TIMER16_CLKCTRL_OFFSET, 1951 2372 .context_offs = DRA7XX_RM_L4PER3_TIMER16_CONTEXT_OFFSET, 1952 - .modulemode = MODULEMODE_SWCTRL, 1953 - }, 1954 - }, 1955 - }; 1956 - 1957 - /* 1958 - * 'uart' class 1959 - * 1960 - */ 1961 - 1962 - static struct omap_hwmod_class_sysconfig dra7xx_uart_sysc = { 1963 - .rev_offs = 0x0050, 1964 - .sysc_offs = 0x0054, 1965 - .syss_offs = 0x0058, 1966 - .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP | 1967 - SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | 1968 - SYSS_HAS_RESET_STATUS), 1969 - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 1970 - SIDLE_SMART_WKUP), 1971 - .sysc_fields = &omap_hwmod_sysc_type1, 1972 - }; 1973 - 1974 - static struct omap_hwmod_class dra7xx_uart_hwmod_class = { 1975 - .name = "uart", 1976 - .sysc = &dra7xx_uart_sysc, 1977 - }; 1978 - 1979 - /* uart1 */ 1980 - static struct omap_hwmod dra7xx_uart1_hwmod = { 1981 - .name = "uart1", 1982 - .class = &dra7xx_uart_hwmod_class, 1983 - .clkdm_name = "l4per_clkdm", 1984 - .main_clk = "uart1_gfclk_mux", 1985 - .flags = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP2UART1_FLAGS, 1986 - .prcm = { 1987 - .omap4 = { 1988 - .clkctrl_offs = DRA7XX_CM_L4PER_UART1_CLKCTRL_OFFSET, 1989 - .context_offs = DRA7XX_RM_L4PER_UART1_CONTEXT_OFFSET, 1990 - .modulemode = MODULEMODE_SWCTRL, 1991 - }, 1992 - }, 1993 - }; 1994 - 1995 - /* uart2 */ 1996 - static struct omap_hwmod dra7xx_uart2_hwmod = { 1997 - .name = "uart2", 1998 - .class = &dra7xx_uart_hwmod_class, 1999 - .clkdm_name = "l4per_clkdm", 2000 - .main_clk = "uart2_gfclk_mux", 2001 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2002 - .prcm = { 2003 - .omap4 = { 2004 - .clkctrl_offs = DRA7XX_CM_L4PER_UART2_CLKCTRL_OFFSET, 2005 - .context_offs = DRA7XX_RM_L4PER_UART2_CONTEXT_OFFSET, 2006 - .modulemode = MODULEMODE_SWCTRL, 2007 - }, 2008 - }, 2009 - }; 2010 - 2011 - /* uart3 */ 2012 - static struct omap_hwmod dra7xx_uart3_hwmod = { 2013 - .name = "uart3", 2014 - .class = &dra7xx_uart_hwmod_class, 2015 - .clkdm_name = "l4per_clkdm", 2016 - .main_clk = "uart3_gfclk_mux", 2017 - .flags = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP4UART3_FLAGS, 2018 - .prcm = { 2019 - .omap4 = { 2020 - .clkctrl_offs = DRA7XX_CM_L4PER_UART3_CLKCTRL_OFFSET, 2021 - .context_offs = DRA7XX_RM_L4PER_UART3_CONTEXT_OFFSET, 2022 - .modulemode = MODULEMODE_SWCTRL, 2023 - }, 2024 - }, 2025 - }; 2026 - 2027 - /* uart4 */ 2028 - static struct omap_hwmod dra7xx_uart4_hwmod = { 2029 - .name = "uart4", 2030 - .class = &dra7xx_uart_hwmod_class, 2031 - .clkdm_name = "l4per_clkdm", 2032 - .main_clk = "uart4_gfclk_mux", 2033 - .flags = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP4UART4_FLAGS, 2034 - .prcm = { 2035 - .omap4 = { 2036 - .clkctrl_offs = DRA7XX_CM_L4PER_UART4_CLKCTRL_OFFSET, 2037 - .context_offs = DRA7XX_RM_L4PER_UART4_CONTEXT_OFFSET, 2038 - .modulemode = MODULEMODE_SWCTRL, 2039 - }, 2040 - }, 2041 - }; 2042 - 2043 - /* uart5 */ 2044 - static struct omap_hwmod dra7xx_uart5_hwmod = { 2045 - .name = "uart5", 2046 - .class = &dra7xx_uart_hwmod_class, 2047 - .clkdm_name = "l4per_clkdm", 2048 - .main_clk = "uart5_gfclk_mux", 2049 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2050 - .prcm = { 2051 - .omap4 = { 2052 - .clkctrl_offs = DRA7XX_CM_L4PER_UART5_CLKCTRL_OFFSET, 2053 - .context_offs = DRA7XX_RM_L4PER_UART5_CONTEXT_OFFSET, 2054 - .modulemode = MODULEMODE_SWCTRL, 2055 - }, 2056 - }, 2057 - }; 2058 - 2059 - /* uart6 */ 2060 - static struct omap_hwmod dra7xx_uart6_hwmod = { 2061 - .name = "uart6", 2062 - .class = &dra7xx_uart_hwmod_class, 2063 - .clkdm_name = "ipu_clkdm", 2064 - .main_clk = "uart6_gfclk_mux", 2065 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2066 - .prcm = { 2067 - .omap4 = { 2068 - .clkctrl_offs = DRA7XX_CM_IPU_UART6_CLKCTRL_OFFSET, 2069 - .context_offs = DRA7XX_RM_IPU_UART6_CONTEXT_OFFSET, 2070 - .modulemode = MODULEMODE_SWCTRL, 2071 - }, 2072 - }, 2073 - }; 2074 - 2075 - /* uart7 */ 2076 - static struct omap_hwmod dra7xx_uart7_hwmod = { 2077 - .name = "uart7", 2078 - .class = &dra7xx_uart_hwmod_class, 2079 - .clkdm_name = "l4per2_clkdm", 2080 - .main_clk = "uart7_gfclk_mux", 2081 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2082 - .prcm = { 2083 - .omap4 = { 2084 - .clkctrl_offs = DRA7XX_CM_L4PER2_UART7_CLKCTRL_OFFSET, 2085 - .context_offs = DRA7XX_RM_L4PER2_UART7_CONTEXT_OFFSET, 2086 - .modulemode = MODULEMODE_SWCTRL, 2087 - }, 2088 - }, 2089 - }; 2090 - 2091 - /* uart8 */ 2092 - static struct omap_hwmod dra7xx_uart8_hwmod = { 2093 - .name = "uart8", 2094 - .class = &dra7xx_uart_hwmod_class, 2095 - .clkdm_name = "l4per2_clkdm", 2096 - .main_clk = "uart8_gfclk_mux", 2097 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2098 - .prcm = { 2099 - .omap4 = { 2100 - .clkctrl_offs = DRA7XX_CM_L4PER2_UART8_CLKCTRL_OFFSET, 2101 - .context_offs = DRA7XX_RM_L4PER2_UART8_CONTEXT_OFFSET, 2102 - .modulemode = MODULEMODE_SWCTRL, 2103 - }, 2104 - }, 2105 - }; 2106 - 2107 - /* uart9 */ 2108 - static struct omap_hwmod dra7xx_uart9_hwmod = { 2109 - .name = "uart9", 2110 - .class = &dra7xx_uart_hwmod_class, 2111 - .clkdm_name = "l4per2_clkdm", 2112 - .main_clk = "uart9_gfclk_mux", 2113 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2114 - .prcm = { 2115 - .omap4 = { 2116 - .clkctrl_offs = DRA7XX_CM_L4PER2_UART9_CLKCTRL_OFFSET, 2117 - .context_offs = DRA7XX_RM_L4PER2_UART9_CONTEXT_OFFSET, 2118 - .modulemode = MODULEMODE_SWCTRL, 2119 - }, 2120 - }, 2121 - }; 2122 - 2123 - /* uart10 */ 2124 - static struct omap_hwmod dra7xx_uart10_hwmod = { 2125 - .name = "uart10", 2126 - .class = &dra7xx_uart_hwmod_class, 2127 - .clkdm_name = "wkupaon_clkdm", 2128 - .main_clk = "uart10_gfclk_mux", 2129 - .flags = HWMOD_SWSUP_SIDLE_ACT, 2130 - .prcm = { 2131 - .omap4 = { 2132 - .clkctrl_offs = DRA7XX_CM_WKUPAON_UART10_CLKCTRL_OFFSET, 2133 - .context_offs = DRA7XX_RM_WKUPAON_UART10_CONTEXT_OFFSET, 2134 2373 .modulemode = MODULEMODE_SWCTRL, 2135 2374 }, 2136 2375 }, ··· 2510 3113 .user = OCP_USER_MPU | OCP_USER_SDMA, 2511 3114 }; 2512 3115 2513 - /* l4_wkup -> gpio1 */ 2514 - static struct omap_hwmod_ocp_if dra7xx_l4_wkup__gpio1 = { 2515 - .master = &dra7xx_l4_wkup_hwmod, 2516 - .slave = &dra7xx_gpio1_hwmod, 2517 - .clk = "wkupaon_iclk_mux", 2518 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2519 - }; 2520 - 2521 - /* l4_per1 -> gpio2 */ 2522 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio2 = { 2523 - .master = &dra7xx_l4_per1_hwmod, 2524 - .slave = &dra7xx_gpio2_hwmod, 2525 - .clk = "l3_iclk_div", 2526 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2527 - }; 2528 - 2529 - /* l4_per1 -> gpio3 */ 2530 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio3 = { 2531 - .master = &dra7xx_l4_per1_hwmod, 2532 - .slave = &dra7xx_gpio3_hwmod, 2533 - .clk = "l3_iclk_div", 2534 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2535 - }; 2536 - 2537 - /* l4_per1 -> gpio4 */ 2538 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio4 = { 2539 - .master = &dra7xx_l4_per1_hwmod, 2540 - .slave = &dra7xx_gpio4_hwmod, 2541 - .clk = "l3_iclk_div", 2542 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2543 - }; 2544 - 2545 - /* l4_per1 -> gpio5 */ 2546 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio5 = { 2547 - .master = &dra7xx_l4_per1_hwmod, 2548 - .slave = &dra7xx_gpio5_hwmod, 2549 - .clk = "l3_iclk_div", 2550 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2551 - }; 2552 - 2553 - /* l4_per1 -> gpio6 */ 2554 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio6 = { 2555 - .master = &dra7xx_l4_per1_hwmod, 2556 - .slave = &dra7xx_gpio6_hwmod, 2557 - .clk = "l3_iclk_div", 2558 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2559 - }; 2560 - 2561 - /* l4_per1 -> gpio7 */ 2562 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio7 = { 2563 - .master = &dra7xx_l4_per1_hwmod, 2564 - .slave = &dra7xx_gpio7_hwmod, 2565 - .clk = "l3_iclk_div", 2566 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2567 - }; 2568 - 2569 - /* l4_per1 -> gpio8 */ 2570 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio8 = { 2571 - .master = &dra7xx_l4_per1_hwmod, 2572 - .slave = &dra7xx_gpio8_hwmod, 2573 - .clk = "l3_iclk_div", 2574 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2575 - }; 2576 - 2577 3116 /* l3_main_1 -> gpmc */ 2578 3117 static struct omap_hwmod_ocp_if dra7xx_l3_main_1__gpmc = { 2579 3118 .master = &dra7xx_l3_main_1_hwmod, ··· 2522 3189 static struct omap_hwmod_ocp_if dra7xx_l4_per1__hdq1w = { 2523 3190 .master = &dra7xx_l4_per1_hwmod, 2524 3191 .slave = &dra7xx_hdq1w_hwmod, 2525 - .clk = "l3_iclk_div", 2526 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2527 - }; 2528 - 2529 - /* l4_per1 -> i2c1 */ 2530 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c1 = { 2531 - .master = &dra7xx_l4_per1_hwmod, 2532 - .slave = &dra7xx_i2c1_hwmod, 2533 - .clk = "l3_iclk_div", 2534 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2535 - }; 2536 - 2537 - /* l4_per1 -> i2c2 */ 2538 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c2 = { 2539 - .master = &dra7xx_l4_per1_hwmod, 2540 - .slave = &dra7xx_i2c2_hwmod, 2541 - .clk = "l3_iclk_div", 2542 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2543 - }; 2544 - 2545 - /* l4_per1 -> i2c3 */ 2546 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c3 = { 2547 - .master = &dra7xx_l4_per1_hwmod, 2548 - .slave = &dra7xx_i2c3_hwmod, 2549 - .clk = "l3_iclk_div", 2550 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2551 - }; 2552 - 2553 - /* l4_per1 -> i2c4 */ 2554 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c4 = { 2555 - .master = &dra7xx_l4_per1_hwmod, 2556 - .slave = &dra7xx_i2c4_hwmod, 2557 - .clk = "l3_iclk_div", 2558 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2559 - }; 2560 - 2561 - /* l4_per1 -> i2c5 */ 2562 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c5 = { 2563 - .master = &dra7xx_l4_per1_hwmod, 2564 - .slave = &dra7xx_i2c5_hwmod, 2565 3192 .clk = "l3_iclk_div", 2566 3193 .user = OCP_USER_MPU | OCP_USER_SDMA, 2567 3194 }; ··· 2658 3365 static struct omap_hwmod_ocp_if dra7xx_l4_per1__mcspi4 = { 2659 3366 .master = &dra7xx_l4_per1_hwmod, 2660 3367 .slave = &dra7xx_mcspi4_hwmod, 2661 - .clk = "l3_iclk_div", 2662 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2663 - }; 2664 - 2665 - /* l4_per1 -> mmc1 */ 2666 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__mmc1 = { 2667 - .master = &dra7xx_l4_per1_hwmod, 2668 - .slave = &dra7xx_mmc1_hwmod, 2669 - .clk = "l3_iclk_div", 2670 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2671 - }; 2672 - 2673 - /* l4_per1 -> mmc2 */ 2674 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__mmc2 = { 2675 - .master = &dra7xx_l4_per1_hwmod, 2676 - .slave = &dra7xx_mmc2_hwmod, 2677 - .clk = "l3_iclk_div", 2678 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2679 - }; 2680 - 2681 - /* l4_per1 -> mmc3 */ 2682 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__mmc3 = { 2683 - .master = &dra7xx_l4_per1_hwmod, 2684 - .slave = &dra7xx_mmc3_hwmod, 2685 - .clk = "l3_iclk_div", 2686 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2687 - }; 2688 - 2689 - /* l4_per1 -> mmc4 */ 2690 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__mmc4 = { 2691 - .master = &dra7xx_l4_per1_hwmod, 2692 - .slave = &dra7xx_mmc4_hwmod, 2693 3368 .clk = "l3_iclk_div", 2694 3369 .user = OCP_USER_MPU | OCP_USER_SDMA, 2695 3370 }; ··· 2894 3633 .user = OCP_USER_MPU | OCP_USER_SDMA, 2895 3634 }; 2896 3635 2897 - /* l4_per1 -> uart1 */ 2898 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart1 = { 2899 - .master = &dra7xx_l4_per1_hwmod, 2900 - .slave = &dra7xx_uart1_hwmod, 2901 - .clk = "l3_iclk_div", 2902 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2903 - }; 2904 - 2905 - /* l4_per1 -> uart2 */ 2906 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart2 = { 2907 - .master = &dra7xx_l4_per1_hwmod, 2908 - .slave = &dra7xx_uart2_hwmod, 2909 - .clk = "l3_iclk_div", 2910 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2911 - }; 2912 - 2913 - /* l4_per1 -> uart3 */ 2914 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart3 = { 2915 - .master = &dra7xx_l4_per1_hwmod, 2916 - .slave = &dra7xx_uart3_hwmod, 2917 - .clk = "l3_iclk_div", 2918 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2919 - }; 2920 - 2921 - /* l4_per1 -> uart4 */ 2922 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart4 = { 2923 - .master = &dra7xx_l4_per1_hwmod, 2924 - .slave = &dra7xx_uart4_hwmod, 2925 - .clk = "l3_iclk_div", 2926 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2927 - }; 2928 - 2929 - /* l4_per1 -> uart5 */ 2930 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart5 = { 2931 - .master = &dra7xx_l4_per1_hwmod, 2932 - .slave = &dra7xx_uart5_hwmod, 2933 - .clk = "l3_iclk_div", 2934 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2935 - }; 2936 - 2937 - /* l4_per1 -> uart6 */ 2938 - static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart6 = { 2939 - .master = &dra7xx_l4_per1_hwmod, 2940 - .slave = &dra7xx_uart6_hwmod, 2941 - .clk = "l3_iclk_div", 2942 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2943 - }; 2944 - 2945 - /* l4_per2 -> uart7 */ 2946 - static struct omap_hwmod_ocp_if dra7xx_l4_per2__uart7 = { 2947 - .master = &dra7xx_l4_per2_hwmod, 2948 - .slave = &dra7xx_uart7_hwmod, 2949 - .clk = "l3_iclk_div", 2950 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2951 - }; 2952 - 2953 3636 /* l4_per1 -> des */ 2954 3637 static struct omap_hwmod_ocp_if dra7xx_l4_per1__des = { 2955 3638 .master = &dra7xx_l4_per1_hwmod, 2956 3639 .slave = &dra7xx_des_hwmod, 2957 3640 .clk = "l3_iclk_div", 2958 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2959 - }; 2960 - 2961 - /* l4_per2 -> uart8 */ 2962 - static struct omap_hwmod_ocp_if dra7xx_l4_per2__uart8 = { 2963 - .master = &dra7xx_l4_per2_hwmod, 2964 - .slave = &dra7xx_uart8_hwmod, 2965 - .clk = "l3_iclk_div", 2966 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2967 - }; 2968 - 2969 - /* l4_per2 -> uart9 */ 2970 - static struct omap_hwmod_ocp_if dra7xx_l4_per2__uart9 = { 2971 - .master = &dra7xx_l4_per2_hwmod, 2972 - .slave = &dra7xx_uart9_hwmod, 2973 - .clk = "l3_iclk_div", 2974 - .user = OCP_USER_MPU | OCP_USER_SDMA, 2975 - }; 2976 - 2977 - /* l4_wkup -> uart10 */ 2978 - static struct omap_hwmod_ocp_if dra7xx_l4_wkup__uart10 = { 2979 - .master = &dra7xx_l4_wkup_hwmod, 2980 - .slave = &dra7xx_uart10_hwmod, 2981 - .clk = "wkupaon_iclk_mux", 2982 3641 .user = OCP_USER_MPU | OCP_USER_SDMA, 2983 3642 }; 2984 3643 ··· 3047 3866 &dra7xx_l3_main_1__aes2, 3048 3867 &dra7xx_l3_main_1__sha0, 3049 3868 &dra7xx_l4_per1__elm, 3050 - &dra7xx_l4_wkup__gpio1, 3051 - &dra7xx_l4_per1__gpio2, 3052 - &dra7xx_l4_per1__gpio3, 3053 - &dra7xx_l4_per1__gpio4, 3054 - &dra7xx_l4_per1__gpio5, 3055 - &dra7xx_l4_per1__gpio6, 3056 - &dra7xx_l4_per1__gpio7, 3057 - &dra7xx_l4_per1__gpio8, 3058 3869 &dra7xx_l3_main_1__gpmc, 3059 3870 &dra7xx_l4_per1__hdq1w, 3060 - &dra7xx_l4_per1__i2c1, 3061 - &dra7xx_l4_per1__i2c2, 3062 - &dra7xx_l4_per1__i2c3, 3063 - &dra7xx_l4_per1__i2c4, 3064 - &dra7xx_l4_per1__i2c5, 3065 3871 &dra7xx_l4_cfg__mailbox1, 3066 3872 &dra7xx_l4_per3__mailbox2, 3067 3873 &dra7xx_l4_per3__mailbox3, ··· 3066 3898 &dra7xx_l4_per1__mcspi2, 3067 3899 &dra7xx_l4_per1__mcspi3, 3068 3900 &dra7xx_l4_per1__mcspi4, 3069 - &dra7xx_l4_per1__mmc1, 3070 - &dra7xx_l4_per1__mmc2, 3071 - &dra7xx_l4_per1__mmc3, 3072 - &dra7xx_l4_per1__mmc4, 3073 3901 &dra7xx_l4_cfg__mpu, 3074 3902 &dra7xx_l4_cfg__ocp2scp1, 3075 3903 &dra7xx_l4_cfg__ocp2scp3, ··· 3093 3929 &dra7xx_l4_per3__timer14, 3094 3930 &dra7xx_l4_per3__timer15, 3095 3931 &dra7xx_l4_per3__timer16, 3096 - &dra7xx_l4_per1__uart1, 3097 - &dra7xx_l4_per1__uart2, 3098 - &dra7xx_l4_per1__uart3, 3099 - &dra7xx_l4_per1__uart4, 3100 - &dra7xx_l4_per1__uart5, 3101 - &dra7xx_l4_per1__uart6, 3102 - &dra7xx_l4_per2__uart7, 3103 - &dra7xx_l4_per2__uart8, 3104 - &dra7xx_l4_per2__uart9, 3105 - &dra7xx_l4_wkup__uart10, 3106 3932 &dra7xx_l4_per1__des, 3107 3933 &dra7xx_l4_per3__usb_otg_ss1, 3108 3934 &dra7xx_l4_per3__usb_otg_ss2,
-1
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
··· 484 484 static struct omap_hwmod_class dm81xx_gpio_hwmod_class = { 485 485 .name = "gpio", 486 486 .sysc = &dm81xx_gpio_sysc, 487 - .rev = 2, 488 487 }; 489 488 490 489 static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
+5 -3
arch/arm/mach-omap2/pm33xx-core.c
··· 51 51 52 52 /* CEFUSE domain can be turned off post bootup */ 53 53 cefuse_pwrdm = pwrdm_lookup("cefuse_pwrdm"); 54 - if (cefuse_pwrdm) 55 - omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF); 56 - else 54 + if (!cefuse_pwrdm) 57 55 pr_err("PM: Failed to get cefuse_pwrdm\n"); 56 + else if (omap_type() != OMAP2_DEVICE_TYPE_GP) 57 + pr_info("PM: Leaving EFUSE power domain active\n"); 58 + else 59 + omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF); 58 60 59 61 return 0; 60 62 }
+4 -1
arch/arm/mach-omap2/sr_device.c
··· 119 119 } 120 120 121 121 sr_data->name = oh->name; 122 - sr_data->ip_type = oh->class->rev; 122 + if (cpu_is_omap343x()) 123 + sr_data->ip_type = 1; 124 + else 125 + sr_data->ip_type = 2; 123 126 sr_data->senn_mod = 0x1; 124 127 sr_data->senp_mod = 0x1; 125 128
+1
arch/arm/mach-rockchip/platsmp.c
··· 245 245 } 246 246 247 247 pmu_base = of_iomap(node, 0); 248 + of_node_put(node); 248 249 if (!pmu_base) { 249 250 pr_err("%s: could not map pmu registers\n", __func__); 250 251 return -ENOMEM;
+2 -2
arch/arm/mach-rockchip/pm.c
··· 59 59 return l2ctlr; 60 60 } 61 61 62 - static void rk3288_config_bootdata(void) 62 + static void __init rk3288_config_bootdata(void) 63 63 { 64 64 rkpm_bootdata_cpusp = rk3288_bootram_phy + (SZ_4K - 8); 65 65 rkpm_bootdata_cpu_code = __pa_symbol(cpu_resume); ··· 230 230 pr_err("%s: Suspend finish failed\n", __func__); 231 231 } 232 232 233 - static int rk3288_suspend_init(struct device_node *np) 233 + static int __init rk3288_suspend_init(struct device_node *np) 234 234 { 235 235 struct device_node *sram_np; 236 236 struct resource res;
+11 -3
arch/arm/mach-s3c64xx/mach-crag6410-module.c
··· 328 328 int num_i2c_devs; 329 329 const struct spi_board_info *spi_devs; 330 330 int num_spi_devs; 331 + 332 + struct gpiod_lookup_table *gpiod_table; 331 333 } gf_mods[] = { 332 334 { .id = 0x01, .rev = 0xff, .name = "1250-EV1 Springbank" }, 333 335 { .id = 0x02, .rev = 0xff, .name = "1251-EV1 Jura" }, ··· 364 362 .i2c_devs = wm1255_devs, .num_i2c_devs = ARRAY_SIZE(wm1255_devs) }, 365 363 { .id = 0x3c, .rev = 0xff, .name = "1273-EV1 Longmorn" }, 366 364 { .id = 0x3d, .rev = 0xff, .name = "1277-EV1 Littlemill", 367 - .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs) }, 365 + .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs), 366 + .gpiod_table = &wm8994_gpiod_table }, 368 367 { .id = 0x3e, .rev = 0, .name = "WM5102-6271-EV1-CS127 Amrut", 369 368 .spi_devs = wm5102_reva_spi_devs, 370 - .num_spi_devs = ARRAY_SIZE(wm5102_reva_spi_devs) }, 369 + .num_spi_devs = ARRAY_SIZE(wm5102_reva_spi_devs), 370 + .gpiod_table = &wm5102_reva_gpiod_table }, 371 371 { .id = 0x3e, .rev = -1, .name = "WM5102-6271-EV1-CS127 Amrut", 372 372 .spi_devs = wm5102_spi_devs, 373 - .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs) }, 373 + .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs), 374 + .gpiod_table = &wm5102_gpiod_table }, 374 375 { .id = 0x3f, .rev = -1, .name = "WM2200-6271-CS90-M-REV1", 375 376 .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c) }, 376 377 }; ··· 413 408 414 409 spi_register_board_info(gf_mods[i].spi_devs, 415 410 gf_mods[i].num_spi_devs); 411 + 412 + if (gf_mods[i].gpiod_table) 413 + gpiod_add_lookup_table(gf_mods[i].gpiod_table); 416 414 } else { 417 415 dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n", 418 416 id, rev + 1);
+1
arch/arm/mach-shmobile/pm-rcar-gen2.c
··· 72 72 } 73 73 74 74 error = of_address_to_resource(np, 0, &res); 75 + of_node_put(np); 75 76 if (error) { 76 77 pr_err("Failed to get smp-sram address: %d\n", error); 77 78 return;
+4 -2
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* 3 - * R-Car Generation 2 da9063/da9210 regulator quirk 3 + * R-Car Generation 2 da9063(L)/da9210 regulator quirk 4 4 * 5 5 * Certain Gen2 development boards have an da9063 and one or more da9210 6 6 * regulators. All of these regulators have their interrupt request lines ··· 65 65 66 66 static const struct of_device_id rcar_gen2_quirk_match[] = { 67 67 { .compatible = "dlg,da9063", .data = &da9063_msg }, 68 + { .compatible = "dlg,da9063l", .data = &da9063_msg }, 68 69 { .compatible = "dlg,da9210", .data = &da9210_msg }, 69 70 {}, 70 71 }; ··· 148 147 149 148 if (!of_machine_is_compatible("renesas,koelsch") && 150 149 !of_machine_is_compatible("renesas,lager") && 150 + !of_machine_is_compatible("renesas,porter") && 151 151 !of_machine_is_compatible("renesas,stout") && 152 152 !of_machine_is_compatible("renesas,gose")) 153 153 return -ENODEV; ··· 212 210 goto err_free; 213 211 } 214 212 215 - pr_info("IRQ2 is asserted, installing da9063/da9210 regulator quirk\n"); 213 + pr_info("IRQ2 is asserted, installing regulator quirk\n"); 216 214 217 215 bus_register_notifier(&i2c_bus_type, &regulator_quirk_nb); 218 216 return 0;
+1 -4
arch/arm/mach-stm32/Kconfig
··· 4 4 select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7 5 5 select ARM_GIC if ARCH_MULTI_V7 6 6 select ARM_PSCI if ARCH_MULTI_V7 7 + select ARM_AMBA 7 8 select ARCH_HAS_RESET_CONTROLLER 8 9 select CLKSRC_STM32 9 10 select PINCTRL ··· 19 18 20 19 config MACH_STM32F429 21 20 bool "STMicroelectronics STM32F429" 22 - select ARM_AMBA 23 21 default y 24 22 25 23 config MACH_STM32F469 26 24 bool "STMicroelectronics STM32F469" 27 - select ARM_AMBA 28 25 default y 29 26 30 27 config MACH_STM32F746 31 28 bool "STMicroelectronics STM32F746" 32 - select ARM_AMBA 33 29 default y 34 30 35 31 config MACH_STM32F769 36 32 bool "STMicroelectronics STM32F769" 37 - select ARM_AMBA 38 33 default y 39 34 40 35 config MACH_STM32H743
+4 -1
arch/arm/mach-sunxi/mc_smp.c
··· 89 89 { 90 90 struct device_node *node; 91 91 int cpu = cluster * SUNXI_CPUS_PER_CLUSTER + core; 92 + bool is_compatible; 92 93 93 94 node = of_cpu_device_node_get(cpu); 94 95 ··· 108 107 return false; 109 108 } 110 109 111 - return of_device_is_compatible(node, "arm,cortex-a15"); 110 + is_compatible = of_device_is_compatible(node, "arm,cortex-a15"); 111 + of_node_put(node); 112 + return is_compatible; 112 113 } 113 114 114 115 static int sunxi_cpu_power_switch_set(unsigned int cpu, unsigned int cluster,
+4
arch/arm/mach-sunxi/platsmp.c
··· 50 50 } 51 51 52 52 prcm_membase = of_iomap(node, 0); 53 + of_node_put(node); 53 54 if (!prcm_membase) { 54 55 pr_err("Couldn't map A31 PRCM registers\n"); 55 56 return; ··· 64 63 } 65 64 66 65 cpucfg_membase = of_iomap(node, 0); 66 + of_node_put(node); 67 67 if (!cpucfg_membase) 68 68 pr_err("Couldn't map A31 CPU config registers\n"); 69 69 ··· 135 133 } 136 134 137 135 prcm_membase = of_iomap(node, 0); 136 + of_node_put(node); 138 137 if (!prcm_membase) { 139 138 pr_err("Couldn't map A23 PRCM registers\n"); 140 139 return; ··· 149 146 } 150 147 151 148 cpucfg_membase = of_iomap(node, 0); 149 + of_node_put(node); 152 150 if (!cpucfg_membase) 153 151 pr_err("Couldn't map A23 CPU config registers\n"); 154 152
+1 -2
arch/arm/mach-tegra/Kconfig
··· 2 2 menuconfig ARCH_TEGRA 3 3 bool "NVIDIA Tegra" 4 4 depends on ARCH_MULTI_V7 5 - select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 5 + select ARCH_HAS_RESET_CONTROLLER 6 6 select ARM_AMBA 7 7 select ARM_GIC 8 8 select CLKSRC_MMIO ··· 11 11 select HAVE_ARM_TWD if SMP 12 12 select PINCTRL 13 13 select PM_OPP 14 - select ARCH_HAS_RESET_CONTROLLER 15 14 select RESET_CONTROLLER 16 15 select SOC_BUS 17 16 select ZONE_DMA if ARM_LPAE
+3 -1
arch/arm/mach-tegra/cpuidle-tegra114.c
··· 21 21 #include <linux/kernel.h> 22 22 #include <linux/module.h> 23 23 24 + #include <linux/firmware/trusted_foundations.h> 25 + 24 26 #include <asm/cpuidle.h> 25 27 #include <asm/smp_plat.h> 26 28 #include <asm/suspend.h> ··· 48 46 tegra_set_cpu_in_lp2(); 49 47 cpu_pm_enter(); 50 48 51 - call_firmware_op(prepare_idle); 49 + call_firmware_op(prepare_idle, TF_PM_MODE_LP2_NOFLUSH_L2); 52 50 53 51 /* Do suspend by ourselves if the firmware does not implement it */ 54 52 if (call_firmware_op(do_idle, 0) == -ENOSYS)
+50
arch/arm/mach-tegra/pm.c
··· 27 27 #include <linux/spinlock.h> 28 28 #include <linux/suspend.h> 29 29 30 + #include <linux/firmware/trusted_foundations.h> 31 + 30 32 #include <soc/tegra/flowctrl.h> 31 33 #include <soc/tegra/fuse.h> 32 34 #include <soc/tegra/pm.h> 33 35 #include <soc/tegra/pmc.h> 34 36 35 37 #include <asm/cacheflush.h> 38 + #include <asm/firmware.h> 36 39 #include <asm/idmap.h> 37 40 #include <asm/proc-fns.h> 38 41 #include <asm/smp_plat.h> ··· 162 159 163 160 static int tegra_sleep_cpu(unsigned long v2p) 164 161 { 162 + /* 163 + * L2 cache disabling using kernel API only allowed when all 164 + * secondary CPU's are offline. Cache have to be disabled with 165 + * MMU-on if cache maintenance is done via Trusted Foundations 166 + * firmware. Note that CPUIDLE won't ever enter powergate on Tegra30 167 + * if any of secondary CPU's is online and this is the LP2-idle 168 + * code-path only for Tegra20/30. 169 + */ 170 + if (trusted_foundations_registered()) 171 + outer_disable(); 172 + 173 + /* 174 + * Note that besides of setting up CPU reset vector this firmware 175 + * call may also do the following, depending on the FW version: 176 + * 1) Disable L2. But this doesn't matter since we already 177 + * disabled the L2. 178 + * 2) Disable D-cache. This need to be taken into account in 179 + * particular by the tegra_disable_clean_inv_dcache() which 180 + * shall avoid the re-disable. 181 + */ 182 + call_firmware_op(prepare_idle, TF_PM_MODE_LP2); 183 + 165 184 setup_mm_for_reboot(); 166 185 tegra_sleep_cpu_finish(v2p); 167 186 ··· 222 197 223 198 cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu); 224 199 200 + /* 201 + * Resume L2 cache if it wasn't re-enabled early during resume, 202 + * which is the case for Tegra30 that has to re-enable the cache 203 + * via firmware call. In other cases cache is already enabled and 204 + * hence re-enabling is a no-op. This is always a no-op on Tegra114+. 205 + */ 206 + outer_resume(); 207 + 225 208 restore_cpu_complex(); 226 209 cpu_cluster_pm_exit(); 227 210 } ··· 248 215 249 216 static int tegra_sleep_core(unsigned long v2p) 250 217 { 218 + /* 219 + * Cache have to be disabled with MMU-on if cache maintenance is done 220 + * via Trusted Foundations firmware. This is a no-op on Tegra114+. 221 + */ 222 + if (trusted_foundations_registered()) 223 + outer_disable(); 224 + 225 + call_firmware_op(prepare_idle, TF_PM_MODE_LP1); 226 + 251 227 setup_mm_for_reboot(); 252 228 tegra_sleep_core_finish(v2p); 253 229 ··· 383 341 } 384 342 385 343 cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, tegra_sleep_func); 344 + 345 + /* 346 + * Resume L2 cache if it wasn't re-enabled early during resume, 347 + * which is the case for Tegra30 that has to re-enable the cache 348 + * via firmware call. In other cases cache is already enabled and 349 + * hence re-enabling is a no-op. 350 + */ 351 + outer_resume(); 386 352 387 353 switch (mode) { 388 354 case TEGRA_SUSPEND_LP1:
+40 -12
arch/arm/mach-tegra/reset-handler.S
··· 20 20 #include <soc/tegra/flowctrl.h> 21 21 #include <soc/tegra/fuse.h> 22 22 23 + #include <asm/assembler.h> 23 24 #include <asm/asm-offsets.h> 24 25 #include <asm/cache.h> 25 26 ··· 29 28 #include "sleep.h" 30 29 31 30 #define PMC_SCRATCH41 0x140 32 - 33 - #define RESET_DATA(x) ((TEGRA_RESET_##x)*4) 34 31 35 32 #ifdef CONFIG_PM_SLEEP 36 33 /* ··· 77 78 orr r1, r1, #1 78 79 str r1, [r0] 79 80 #endif 81 + bl tegra_resume_trusted_foundations 80 82 81 83 #ifdef CONFIG_CACHE_L2X0 82 84 /* L2 cache resume & re-enable */ ··· 90 90 91 91 b cpu_resume 92 92 ENDPROC(tegra_resume) 93 + 94 + /* 95 + * tegra_resume_trusted_foundations 96 + * 97 + * Trusted Foundations firmware initialization. 98 + * 99 + * Doesn't return if firmware presents. 100 + * Corrupted registers: r1, r2 101 + */ 102 + ENTRY(tegra_resume_trusted_foundations) 103 + /* Check whether Trusted Foundations firmware presents. */ 104 + mov32 r2, TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET 105 + ldr r1, =__tegra_cpu_reset_handler_data_offset + \ 106 + RESET_DATA(TF_PRESENT) 107 + ldr r1, [r2, r1] 108 + cmp r1, #0 109 + reteq lr 110 + 111 + .arch_extension sec 112 + /* First call after suspend wakes firmware. No arguments required. */ 113 + smc #0 114 + 115 + b cpu_resume 116 + ENDPROC(tegra_resume_trusted_foundations) 93 117 #endif 94 118 95 119 .align L1_CACHE_SHIFT ··· 139 115 * must be position-independent. 140 116 */ 141 117 118 + .arm 142 119 .align L1_CACHE_SHIFT 143 120 ENTRY(__tegra_cpu_reset_handler) 144 121 145 122 cpsid aif, 0x13 @ SVC mode, interrupts disabled 146 123 147 124 tegra_get_soc_id TEGRA_APB_MISC_BASE, r6 125 + 126 + adr r12, __tegra_cpu_reset_handler_data 127 + ldr r5, [r12, #RESET_DATA(TF_PRESENT)] 128 + cmp r5, #0 129 + bne after_errata 130 + 148 131 #ifdef CONFIG_ARCH_TEGRA_2x_SOC 149 132 t20_check: 150 133 cmp r6, #TEGRA20 ··· 186 155 and r10, r10, #0x3 @ R10 = CPU number 187 156 mov r11, #1 188 157 mov r11, r11, lsl r10 @ R11 = CPU mask 189 - adr r12, __tegra_cpu_reset_handler_data 190 158 191 159 #ifdef CONFIG_SMP 192 160 /* Does the OS know about this CPU? */ ··· 199 169 cmp r6, #TEGRA20 200 170 bne 1f 201 171 /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */ 202 - mov32 r5, TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET 203 172 mov r0, #CPU_NOT_RESETTABLE 204 173 cmp r10, #0 205 - strbne r0, [r5, #__tegra20_cpu1_resettable_status_offset] 174 + strbne r0, [r12, #RESET_DATA(RESETTABLE_STATUS)] 206 175 1: 207 176 #endif 208 177 ··· 306 277 .align L1_CACHE_SHIFT 307 278 .type __tegra_cpu_reset_handler_data, %object 308 279 .globl __tegra_cpu_reset_handler_data 309 - __tegra_cpu_reset_handler_data: 310 - .rept TEGRA_RESET_DATA_SIZE 311 - .long 0 312 - .endr 313 - .globl __tegra20_cpu1_resettable_status_offset 314 - .equ __tegra20_cpu1_resettable_status_offset, \ 280 + .globl __tegra_cpu_reset_handler_data_offset 281 + .equ __tegra_cpu_reset_handler_data_offset, \ 315 282 . - __tegra_cpu_reset_handler_start 316 - .byte 0 283 + __tegra_cpu_reset_handler_data: 284 + .rept TEGRA_RESET_DATA_SIZE 285 + .long 0 286 + .endr 317 287 .align L1_CACHE_SHIFT 318 288 319 289 ENTRY(__tegra_cpu_reset_handler_end)
+4
arch/arm/mach-tegra/reset.c
··· 19 19 #include <linux/init.h> 20 20 #include <linux/io.h> 21 21 22 + #include <linux/firmware/trusted_foundations.h> 23 + 22 24 #include <soc/tegra/fuse.h> 23 25 24 26 #include <asm/cacheflush.h> ··· 91 89 92 90 void __init tegra_cpu_reset_handler_init(void) 93 91 { 92 + __tegra_cpu_reset_handler_data[TEGRA_RESET_TF_PRESENT] = 93 + trusted_foundations_registered(); 94 94 95 95 #ifdef CONFIG_SMP 96 96 __tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_PRESENT] =
+7 -2
arch/arm/mach-tegra/reset.h
··· 25 25 #define TEGRA_RESET_STARTUP_SECONDARY 3 26 26 #define TEGRA_RESET_STARTUP_LP2 4 27 27 #define TEGRA_RESET_STARTUP_LP1 5 28 - #define TEGRA_RESET_DATA_SIZE 6 28 + #define TEGRA_RESET_RESETTABLE_STATUS 6 29 + #define TEGRA_RESET_TF_PRESENT 7 30 + #define TEGRA_RESET_DATA_SIZE 8 31 + 32 + #define RESET_DATA(x) ((TEGRA_RESET_##x)*4) 29 33 30 34 #ifndef __ASSEMBLY__ 31 35 ··· 53 49 (u32)__tegra_cpu_reset_handler_start))) 54 50 #define tegra20_cpu1_resettable_status \ 55 51 (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \ 56 - (u32)__tegra20_cpu1_resettable_status_offset)) 52 + ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_RESETTABLE_STATUS] - \ 53 + (u32)__tegra_cpu_reset_handler_start))) 57 54 #endif 58 55 59 56 #define tegra_cpu_reset_handler_offset \
+4
arch/arm/mach-tegra/sleep-tegra20.S
··· 28 28 #include <asm/cache.h> 29 29 30 30 #include "irammap.h" 31 + #include "reset.h" 31 32 #include "sleep.h" 32 33 33 34 #define EMC_CFG 0xc ··· 53 52 #define APB_MISC_XM2VTTGENPADCTRL 0x8d8 54 53 #define APB_MISC_XM2CFGCPADCTRL2 0x8e4 55 54 #define APB_MISC_XM2CFGDPADCTRL2 0x8e8 55 + 56 + #define __tegra20_cpu1_resettable_status_offset \ 57 + (__tegra_cpu_reset_handler_data_offset + RESET_DATA(RESETTABLE_STATUS)) 56 58 57 59 .macro pll_enable, rd, r_car_base, pll_base 58 60 ldr \rd, [\r_car_base, #\pll_base]
+9 -5
arch/arm/mach-tegra/sleep.S
··· 49 49 50 50 /* Disable the D-cache */ 51 51 mrc p15, 0, r2, c1, c0, 0 52 + tst r2, #CR_C @ see tegra_sleep_cpu() 52 53 bic r2, r2, #CR_C 53 - mcr p15, 0, r2, c1, c0, 0 54 + mcrne p15, 0, r2, c1, c0, 0 54 55 isb 55 56 56 57 /* Flush the D-cache */ ··· 133 132 #ifdef CONFIG_CACHE_L2X0 134 133 /* Disable L2 cache */ 135 134 check_cpu_part_num 0xc09, r9, r10 136 - movweq r2, #:lower16:(TEGRA_ARM_PERIF_BASE + 0x3000) 137 - movteq r2, #:upper16:(TEGRA_ARM_PERIF_BASE + 0x3000) 138 - moveq r3, #0 139 - streq r3, [r2, #L2X0_CTRL] 135 + retne r0 136 + 137 + mov32 r2, TEGRA_ARM_PERIF_BASE + 0x3000 138 + ldr r3, [r2, #L2X0_CTRL] 139 + tst r3, #L2X0_CTRL_EN @ see tegra_sleep_cpu() 140 + mov r3, #0 141 + strne r3, [r2, #L2X0_CTRL] 140 142 #endif 141 143 ret r0 142 144 ENDPROC(tegra_shut_off_mmu)
+4 -1
arch/arm/mach-tegra/tegra.c
··· 35 35 #include <linux/sys_soc.h> 36 36 #include <linux/usb/tegra_usb_phy.h> 37 37 38 + #include <linux/firmware/trusted_foundations.h> 39 + 38 40 #include <soc/tegra/fuse.h> 39 41 #include <soc/tegra/pmc.h> 40 42 43 + #include <asm/firmware.h> 41 44 #include <asm/hardware/cache-l2x0.h> 42 45 #include <asm/mach/arch.h> 43 46 #include <asm/mach/time.h> 44 47 #include <asm/mach-types.h> 45 48 #include <asm/setup.h> 46 - #include <asm/trusted_foundations.h> 47 49 48 50 #include "board.h" 49 51 #include "common.h" ··· 76 74 { 77 75 of_register_trusted_foundations(); 78 76 tegra_cpu_reset_handler_init(); 77 + call_firmware_op(l2x0_init); 79 78 } 80 79 81 80 static void __init tegra_dt_init_irq(void)
+2
arch/arm/mach-u300/regulator.c
··· 130 130 } 131 131 132 132 device_initcall(u300_init_boardpower); 133 + MODULE_LICENSE("GPL v2"); 134 + MODULE_AUTHOR("Linus Walleij");
-6
arch/arm/plat-pxa/ssp.c
··· 183 183 184 184 static int pxa_ssp_remove(struct platform_device *pdev) 185 185 { 186 - struct resource *res; 187 186 struct ssp_device *ssp; 188 187 189 188 ssp = platform_get_drvdata(pdev); 190 189 if (ssp == NULL) 191 190 return -ENODEV; 192 - 193 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 194 - release_mem_region(res->start, resource_size(res)); 195 - 196 - clk_put(ssp->clk); 197 191 198 192 mutex_lock(&ssp_lock); 199 193 list_del(&ssp->node);
+1 -1
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
··· 104 104 }; 105 105 106 106 &codec_analog { 107 - hpvcc-supply = <&reg_eldo1>; 107 + cpvdd-supply = <&reg_eldo1>; 108 108 status = "okay"; 109 109 }; 110 110
+1 -1
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
··· 80 80 }; 81 81 82 82 &codec_analog { 83 - hpvcc-supply = <&reg_eldo1>; 83 + cpvdd-supply = <&reg_eldo1>; 84 84 status = "okay"; 85 85 }; 86 86
+1 -1
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
··· 94 94 }; 95 95 96 96 &codec_analog { 97 - hpvcc-supply = <&reg_eldo1>; 97 + cpvdd-supply = <&reg_eldo1>; 98 98 status = "okay"; 99 99 }; 100 100
+1 -1
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
··· 48 48 #include <dt-bindings/gpio/gpio.h> 49 49 50 50 &codec_analog { 51 - hpvcc-supply = <&reg_eldo1>; 51 + cpvdd-supply = <&reg_eldo1>; 52 52 }; 53 53 54 54 &mmc0 {
+1 -1
drivers/ata/pata_ep93xx.c
··· 44 44 #include <linux/ktime.h> 45 45 46 46 #include <linux/platform_data/dma-ep93xx.h> 47 - #include <mach/platform.h> 47 + #include <linux/soc/cirrus/ep93xx.h> 48 48 49 49 #define DRV_NAME "ep93xx-ide" 50 50 #define DRV_VERSION "1.0"
+555 -120
drivers/bus/ti-sysc.c
··· 47 47 SYSC_MAX_CLOCKS, 48 48 }; 49 49 50 - static const char * const clock_names[SYSC_ICK + 1] = { "fck", "ick", }; 50 + static const char * const clock_names[SYSC_MAX_CLOCKS] = { 51 + "fck", "ick", "opt0", "opt1", "opt2", "opt3", "opt4", 52 + "opt5", "opt6", "opt7", 53 + }; 51 54 52 55 #define SYSC_IDLEMODE_MASK 3 53 56 #define SYSC_CLOCKACTIVITY_MASK 3 ··· 78 75 u32 module_size; 79 76 void __iomem *module_va; 80 77 int offsets[SYSC_MAX_REGS]; 78 + struct ti_sysc_module_data *mdata; 81 79 struct clk **clocks; 82 80 const char **clock_roles; 83 81 int nr_clocks; ··· 98 94 static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np, 99 95 bool is_child); 100 96 101 - void sysc_write(struct sysc *ddata, int offset, u32 value) 97 + static void sysc_write(struct sysc *ddata, int offset, u32 value) 102 98 { 103 99 writel_relaxed(value, ddata->module_va + offset); 104 100 } ··· 130 126 return 0; 131 127 132 128 return sysc_read(ddata, offset); 129 + } 130 + 131 + static int sysc_add_named_clock_from_child(struct sysc *ddata, 132 + const char *name, 133 + const char *optfck_name) 134 + { 135 + struct device_node *np = ddata->dev->of_node; 136 + struct device_node *child; 137 + struct clk_lookup *cl; 138 + struct clk *clock; 139 + const char *n; 140 + 141 + if (name) 142 + n = name; 143 + else 144 + n = optfck_name; 145 + 146 + /* Does the clock alias already exist? */ 147 + clock = of_clk_get_by_name(np, n); 148 + if (!IS_ERR(clock)) { 149 + clk_put(clock); 150 + 151 + return 0; 152 + } 153 + 154 + child = of_get_next_available_child(np, NULL); 155 + if (!child) 156 + return -ENODEV; 157 + 158 + clock = devm_get_clk_from_child(ddata->dev, child, name); 159 + if (IS_ERR(clock)) 160 + return PTR_ERR(clock); 161 + 162 + /* 163 + * Use clkdev_add() instead of clkdev_alloc() to avoid the MAX_DEV_ID 164 + * limit for clk_get(). If cl ever needs to be freed, it should be done 165 + * with clkdev_drop(). 166 + */ 167 + cl = kcalloc(1, sizeof(*cl), GFP_KERNEL); 168 + if (!cl) 169 + return -ENOMEM; 170 + 171 + cl->con_id = n; 172 + cl->dev_id = dev_name(ddata->dev); 173 + cl->clk = clock; 174 + clkdev_add(cl); 175 + 176 + clk_put(clock); 177 + 178 + return 0; 179 + } 180 + 181 + static int sysc_init_ext_opt_clock(struct sysc *ddata, const char *name) 182 + { 183 + const char *optfck_name; 184 + int error, index; 185 + 186 + if (ddata->nr_clocks < SYSC_OPTFCK0) 187 + index = SYSC_OPTFCK0; 188 + else 189 + index = ddata->nr_clocks; 190 + 191 + if (name) 192 + optfck_name = name; 193 + else 194 + optfck_name = clock_names[index]; 195 + 196 + error = sysc_add_named_clock_from_child(ddata, name, optfck_name); 197 + if (error) 198 + return error; 199 + 200 + ddata->clock_roles[index] = optfck_name; 201 + ddata->nr_clocks++; 202 + 203 + return 0; 133 204 } 134 205 135 206 static int sysc_get_one_clock(struct sysc *ddata, const char *name) ··· 278 199 if (ddata->nr_clocks < 1) 279 200 return 0; 280 201 202 + if ((ddata->cfg.quirks & SYSC_QUIRK_EXT_OPT_CLOCK)) { 203 + error = sysc_init_ext_opt_clock(ddata, NULL); 204 + if (error) 205 + return error; 206 + } 207 + 281 208 if (ddata->nr_clocks > SYSC_MAX_CLOCKS) { 282 209 dev_err(ddata->dev, "too many clocks for %pOF\n", np); 283 210 ··· 316 231 return 0; 317 232 } 318 233 234 + static int sysc_enable_main_clocks(struct sysc *ddata) 235 + { 236 + struct clk *clock; 237 + int i, error; 238 + 239 + if (!ddata->clocks) 240 + return 0; 241 + 242 + for (i = 0; i < SYSC_OPTFCK0; i++) { 243 + clock = ddata->clocks[i]; 244 + 245 + /* Main clocks may not have ick */ 246 + if (IS_ERR_OR_NULL(clock)) 247 + continue; 248 + 249 + error = clk_enable(clock); 250 + if (error) 251 + goto err_disable; 252 + } 253 + 254 + return 0; 255 + 256 + err_disable: 257 + for (i--; i >= 0; i--) { 258 + clock = ddata->clocks[i]; 259 + 260 + /* Main clocks may not have ick */ 261 + if (IS_ERR_OR_NULL(clock)) 262 + continue; 263 + 264 + clk_disable(clock); 265 + } 266 + 267 + return error; 268 + } 269 + 270 + static void sysc_disable_main_clocks(struct sysc *ddata) 271 + { 272 + struct clk *clock; 273 + int i; 274 + 275 + if (!ddata->clocks) 276 + return; 277 + 278 + for (i = 0; i < SYSC_OPTFCK0; i++) { 279 + clock = ddata->clocks[i]; 280 + if (IS_ERR_OR_NULL(clock)) 281 + continue; 282 + 283 + clk_disable(clock); 284 + } 285 + } 286 + 287 + static int sysc_enable_opt_clocks(struct sysc *ddata) 288 + { 289 + struct clk *clock; 290 + int i, error; 291 + 292 + if (!ddata->clocks) 293 + return 0; 294 + 295 + for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) { 296 + clock = ddata->clocks[i]; 297 + 298 + /* Assume no holes for opt clocks */ 299 + if (IS_ERR_OR_NULL(clock)) 300 + return 0; 301 + 302 + error = clk_enable(clock); 303 + if (error) 304 + goto err_disable; 305 + } 306 + 307 + return 0; 308 + 309 + err_disable: 310 + for (i--; i >= 0; i--) { 311 + clock = ddata->clocks[i]; 312 + if (IS_ERR_OR_NULL(clock)) 313 + continue; 314 + 315 + clk_disable(clock); 316 + } 317 + 318 + return error; 319 + } 320 + 321 + static void sysc_disable_opt_clocks(struct sysc *ddata) 322 + { 323 + struct clk *clock; 324 + int i; 325 + 326 + if (!ddata->clocks) 327 + return; 328 + 329 + for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) { 330 + clock = ddata->clocks[i]; 331 + 332 + /* Assume no holes for opt clocks */ 333 + if (IS_ERR_OR_NULL(clock)) 334 + return; 335 + 336 + clk_disable(clock); 337 + } 338 + } 339 + 319 340 /** 320 - * sysc_init_resets - reset module on init 341 + * sysc_init_resets - init rstctrl reset line if configured 321 342 * @ddata: device driver data 322 343 * 323 - * A module can have both OCP softreset control and external rstctrl. 324 - * If more complicated rstctrl resets are needed, please handle these 325 - * directly from the child device driver and map only the module reset 326 - * for the parent interconnect target module device. 327 - * 328 - * Automatic reset of the module on init can be skipped with the 329 - * "ti,no-reset-on-init" device tree property. 344 + * See sysc_rstctrl_reset_deassert(). 330 345 */ 331 346 static int sysc_init_resets(struct sysc *ddata) 332 347 { 333 - int error; 334 - 335 348 ddata->rsts = 336 349 devm_reset_control_array_get_optional_exclusive(ddata->dev); 337 350 if (IS_ERR(ddata->rsts)) 338 351 return PTR_ERR(ddata->rsts); 339 - 340 - if (ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) 341 - goto deassert; 342 - 343 - error = reset_control_assert(ddata->rsts); 344 - if (error) 345 - return error; 346 - 347 - deassert: 348 - error = reset_control_deassert(ddata->rsts); 349 - if (error) 350 - return error; 351 352 352 353 return 0; 353 354 } ··· 793 622 buf); 794 623 } 795 624 796 - static int __maybe_unused sysc_runtime_suspend(struct device *dev) 625 + #define SYSC_IDLE_MASK (SYSC_NR_IDLEMODES - 1) 626 + 627 + static int sysc_enable_module(struct device *dev) 628 + { 629 + struct sysc *ddata; 630 + const struct sysc_regbits *regbits; 631 + u32 reg, idlemodes, best_mode; 632 + 633 + ddata = dev_get_drvdata(dev); 634 + if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV) 635 + return 0; 636 + 637 + /* 638 + * TODO: Need to prevent clockdomain autoidle? 639 + * See clkdm_deny_idle() in arch/mach-omap2/omap_hwmod.c 640 + */ 641 + 642 + regbits = ddata->cap->regbits; 643 + reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]); 644 + 645 + /* Set SIDLE mode */ 646 + idlemodes = ddata->cfg.sidlemodes; 647 + if (!idlemodes || regbits->sidle_shift < 0) 648 + goto set_midle; 649 + 650 + best_mode = fls(ddata->cfg.sidlemodes) - 1; 651 + if (best_mode > SYSC_IDLE_MASK) { 652 + dev_err(dev, "%s: invalid sidlemode\n", __func__); 653 + return -EINVAL; 654 + } 655 + 656 + reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift); 657 + reg |= best_mode << regbits->sidle_shift; 658 + sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); 659 + 660 + set_midle: 661 + /* Set MIDLE mode */ 662 + idlemodes = ddata->cfg.midlemodes; 663 + if (!idlemodes || regbits->midle_shift < 0) 664 + return 0; 665 + 666 + best_mode = fls(ddata->cfg.midlemodes) - 1; 667 + if (best_mode > SYSC_IDLE_MASK) { 668 + dev_err(dev, "%s: invalid midlemode\n", __func__); 669 + return -EINVAL; 670 + } 671 + 672 + reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift); 673 + reg |= best_mode << regbits->midle_shift; 674 + sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); 675 + 676 + return 0; 677 + } 678 + 679 + static int sysc_best_idle_mode(u32 idlemodes, u32 *best_mode) 680 + { 681 + if (idlemodes & BIT(SYSC_IDLE_SMART_WKUP)) 682 + *best_mode = SYSC_IDLE_SMART_WKUP; 683 + else if (idlemodes & BIT(SYSC_IDLE_SMART)) 684 + *best_mode = SYSC_IDLE_SMART; 685 + else if (idlemodes & SYSC_IDLE_FORCE) 686 + *best_mode = SYSC_IDLE_FORCE; 687 + else 688 + return -EINVAL; 689 + 690 + return 0; 691 + } 692 + 693 + static int sysc_disable_module(struct device *dev) 694 + { 695 + struct sysc *ddata; 696 + const struct sysc_regbits *regbits; 697 + u32 reg, idlemodes, best_mode; 698 + int ret; 699 + 700 + ddata = dev_get_drvdata(dev); 701 + if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV) 702 + return 0; 703 + 704 + /* 705 + * TODO: Need to prevent clockdomain autoidle? 706 + * See clkdm_deny_idle() in arch/mach-omap2/omap_hwmod.c 707 + */ 708 + 709 + regbits = ddata->cap->regbits; 710 + reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]); 711 + 712 + /* Set MIDLE mode */ 713 + idlemodes = ddata->cfg.midlemodes; 714 + if (!idlemodes || regbits->midle_shift < 0) 715 + goto set_sidle; 716 + 717 + ret = sysc_best_idle_mode(idlemodes, &best_mode); 718 + if (ret) { 719 + dev_err(dev, "%s: invalid midlemode\n", __func__); 720 + return ret; 721 + } 722 + 723 + reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift); 724 + reg |= best_mode << regbits->midle_shift; 725 + sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); 726 + 727 + set_sidle: 728 + /* Set SIDLE mode */ 729 + idlemodes = ddata->cfg.sidlemodes; 730 + if (!idlemodes || regbits->sidle_shift < 0) 731 + return 0; 732 + 733 + ret = sysc_best_idle_mode(idlemodes, &best_mode); 734 + if (ret) { 735 + dev_err(dev, "%s: invalid sidlemode\n", __func__); 736 + return ret; 737 + } 738 + 739 + reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift); 740 + reg |= best_mode << regbits->sidle_shift; 741 + sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); 742 + 743 + return 0; 744 + } 745 + 746 + static int __maybe_unused sysc_runtime_suspend_legacy(struct device *dev, 747 + struct sysc *ddata) 797 748 { 798 749 struct ti_sysc_platform_data *pdata; 750 + int error; 751 + 752 + pdata = dev_get_platdata(ddata->dev); 753 + if (!pdata) 754 + return 0; 755 + 756 + if (!pdata->idle_module) 757 + return -ENODEV; 758 + 759 + error = pdata->idle_module(dev, &ddata->cookie); 760 + if (error) 761 + dev_err(dev, "%s: could not idle: %i\n", 762 + __func__, error); 763 + 764 + return 0; 765 + } 766 + 767 + static int __maybe_unused sysc_runtime_resume_legacy(struct device *dev, 768 + struct sysc *ddata) 769 + { 770 + struct ti_sysc_platform_data *pdata; 771 + int error; 772 + 773 + pdata = dev_get_platdata(ddata->dev); 774 + if (!pdata) 775 + return 0; 776 + 777 + if (!pdata->enable_module) 778 + return -ENODEV; 779 + 780 + error = pdata->enable_module(dev, &ddata->cookie); 781 + if (error) 782 + dev_err(dev, "%s: could not enable: %i\n", 783 + __func__, error); 784 + 785 + return 0; 786 + } 787 + 788 + static int __maybe_unused sysc_runtime_suspend(struct device *dev) 789 + { 799 790 struct sysc *ddata; 800 - int error = 0, i; 791 + int error = 0; 801 792 802 793 ddata = dev_get_drvdata(dev); 803 794 ··· 967 634 return 0; 968 635 969 636 if (ddata->legacy_mode) { 970 - pdata = dev_get_platdata(ddata->dev); 971 - if (!pdata) 972 - return 0; 973 - 974 - if (!pdata->idle_module) 975 - return -ENODEV; 976 - 977 - error = pdata->idle_module(dev, &ddata->cookie); 637 + error = sysc_runtime_suspend_legacy(dev, ddata); 978 638 if (error) 979 - dev_err(dev, "%s: could not idle: %i\n", 980 - __func__, error); 981 - 982 - goto idled; 639 + return error; 640 + } else { 641 + error = sysc_disable_module(dev); 642 + if (error) 643 + return error; 983 644 } 984 645 985 - for (i = 0; i < ddata->nr_clocks; i++) { 986 - if (IS_ERR_OR_NULL(ddata->clocks[i])) 987 - continue; 646 + sysc_disable_main_clocks(ddata); 988 647 989 - if (i >= SYSC_OPTFCK0 && !sysc_opt_clks_needed(ddata)) 990 - break; 648 + if (sysc_opt_clks_needed(ddata)) 649 + sysc_disable_opt_clocks(ddata); 991 650 992 - clk_disable(ddata->clocks[i]); 993 - } 994 - 995 - idled: 996 651 ddata->enabled = false; 997 652 998 653 return error; ··· 988 667 989 668 static int __maybe_unused sysc_runtime_resume(struct device *dev) 990 669 { 991 - struct ti_sysc_platform_data *pdata; 992 670 struct sysc *ddata; 993 - int error = 0, i; 671 + int error = 0; 994 672 995 673 ddata = dev_get_drvdata(dev); 996 674 997 675 if (ddata->enabled) 998 676 return 0; 999 677 1000 - if (ddata->legacy_mode) { 1001 - pdata = dev_get_platdata(ddata->dev); 1002 - if (!pdata) 1003 - return 0; 1004 - 1005 - if (!pdata->enable_module) 1006 - return -ENODEV; 1007 - 1008 - error = pdata->enable_module(dev, &ddata->cookie); 1009 - if (error) 1010 - dev_err(dev, "%s: could not enable: %i\n", 1011 - __func__, error); 1012 - 1013 - goto awake; 1014 - } 1015 - 1016 - for (i = 0; i < ddata->nr_clocks; i++) { 1017 - if (IS_ERR_OR_NULL(ddata->clocks[i])) 1018 - continue; 1019 - 1020 - if (i >= SYSC_OPTFCK0 && !sysc_opt_clks_needed(ddata)) 1021 - break; 1022 - 1023 - error = clk_enable(ddata->clocks[i]); 678 + if (sysc_opt_clks_needed(ddata)) { 679 + error = sysc_enable_opt_clocks(ddata); 1024 680 if (error) 1025 681 return error; 1026 682 } 1027 683 1028 - awake: 684 + error = sysc_enable_main_clocks(ddata); 685 + if (error) 686 + goto err_opt_clocks; 687 + 688 + if (ddata->legacy_mode) { 689 + error = sysc_runtime_resume_legacy(dev, ddata); 690 + if (error) 691 + goto err_main_clocks; 692 + } else { 693 + error = sysc_enable_module(dev); 694 + if (error) 695 + goto err_main_clocks; 696 + } 697 + 1029 698 ddata->enabled = true; 699 + 700 + return 0; 701 + 702 + err_main_clocks: 703 + sysc_disable_main_clocks(ddata); 704 + err_opt_clocks: 705 + if (sysc_opt_clks_needed(ddata)) 706 + sysc_disable_opt_clocks(ddata); 1030 707 1031 708 return error; 1032 709 } ··· 1107 788 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x4fff1301, 0xffff00ff, 1108 789 0), 1109 790 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff, 1110 - SYSC_QUIRK_LEGACY_IDLE), 791 + SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), 1111 792 /* Uarts on omap4 and later */ 1112 793 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x50411e03, 0xffff00ff, 1113 - SYSC_QUIRK_LEGACY_IDLE), 794 + SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), 1114 795 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47422e03, 0xffffffff, 1115 - SYSC_QUIRK_LEGACY_IDLE), 796 + SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), 797 + 798 + /* Quirks that need to be set based on the module address */ 799 + SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -1, 0x50000800, 0xffffffff, 800 + SYSC_QUIRK_EXT_OPT_CLOCK | SYSC_QUIRK_NO_RESET_ON_INIT | 801 + SYSC_QUIRK_SWSUP_SIDLE), 1116 802 1117 803 #ifdef DEBUG 1118 804 SYSC_QUIRK("adc", 0, 0, 0x10, -1, 0x47300001, 0xffffffff, 0), ··· 1129 805 0xffff00f0, 0), 1130 806 SYSC_QUIRK("dcan", 0, 0, -1, -1, 0xffffffff, 0xffffffff, 0), 1131 807 SYSC_QUIRK("dcan", 0, 0, -1, -1, 0x00001401, 0xffffffff, 0), 808 + SYSC_QUIRK("dmic", 0, 0, 0x10, -1, 0x50010000, 0xffffffff, 0), 1132 809 SYSC_QUIRK("dwc3", 0, 0, 0x10, -1, 0x500a0200, 0xffffffff, 0), 1133 810 SYSC_QUIRK("epwmss", 0, 0, 0x4, -1, 0x47400001, 0xffffffff, 0), 1134 811 SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -1, 0, 0, 0), ··· 1178 853 #endif 1179 854 }; 1180 855 856 + /* 857 + * Early quirks based on module base and register offsets only that are 858 + * needed before the module revision can be read 859 + */ 860 + static void sysc_init_early_quirks(struct sysc *ddata) 861 + { 862 + const struct sysc_revision_quirk *q; 863 + int i; 864 + 865 + for (i = 0; i < ARRAY_SIZE(sysc_revision_quirks); i++) { 866 + q = &sysc_revision_quirks[i]; 867 + 868 + if (!q->base) 869 + continue; 870 + 871 + if (q->base != ddata->module_pa) 872 + continue; 873 + 874 + if (q->rev_offset >= 0 && 875 + q->rev_offset != ddata->offsets[SYSC_REVISION]) 876 + continue; 877 + 878 + if (q->sysc_offset >= 0 && 879 + q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG]) 880 + continue; 881 + 882 + if (q->syss_offset >= 0 && 883 + q->syss_offset != ddata->offsets[SYSC_SYSSTATUS]) 884 + continue; 885 + 886 + ddata->name = q->name; 887 + ddata->cfg.quirks |= q->quirks; 888 + } 889 + } 890 + 891 + /* Quirks that also consider the revision register value */ 1181 892 static void sysc_init_revision_quirks(struct sysc *ddata) 1182 893 { 1183 894 const struct sysc_revision_quirk *q; ··· 1246 885 } 1247 886 } 1248 887 888 + /* 889 + * Note that pdata->init_module() typically does a reset first. After 890 + * pdata->init_module() is done, PM runtime can be used for the interconnect 891 + * target module. 892 + */ 893 + static int sysc_legacy_init(struct sysc *ddata) 894 + { 895 + struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); 896 + int error; 897 + 898 + if (!ddata->legacy_mode || !pdata || !pdata->init_module) 899 + return 0; 900 + 901 + error = pdata->init_module(ddata->dev, ddata->mdata, &ddata->cookie); 902 + if (error == -EEXIST) 903 + error = 0; 904 + 905 + return error; 906 + } 907 + 908 + /** 909 + * sysc_rstctrl_reset_deassert - deassert rstctrl reset 910 + * @ddata: device driver data 911 + * @reset: reset before deassert 912 + * 913 + * A module can have both OCP softreset control and external rstctrl. 914 + * If more complicated rstctrl resets are needed, please handle these 915 + * directly from the child device driver and map only the module reset 916 + * for the parent interconnect target module device. 917 + * 918 + * Automatic reset of the module on init can be skipped with the 919 + * "ti,no-reset-on-init" device tree property. 920 + */ 921 + static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset) 922 + { 923 + int error; 924 + 925 + if (!ddata->rsts) 926 + return 0; 927 + 928 + if (reset) { 929 + error = reset_control_assert(ddata->rsts); 930 + if (error) 931 + return error; 932 + } 933 + 934 + return reset_control_deassert(ddata->rsts); 935 + } 936 + 1249 937 static int sysc_reset(struct sysc *ddata) 1250 938 { 1251 939 int offset = ddata->offsets[SYSC_SYSCONFIG]; ··· 1325 915 100, MAX_MODULE_SOFTRESET_WAIT); 1326 916 } 1327 917 1328 - /* At this point the module is configured enough to read the revision */ 918 + /* 919 + * At this point the module is configured enough to read the revision but 920 + * module may not be completely configured yet to use PM runtime. Enable 921 + * all clocks directly during init to configure the quirks needed for PM 922 + * runtime based on the revision register. 923 + */ 1329 924 static int sysc_init_module(struct sysc *ddata) 1330 925 { 1331 - int error; 926 + int error = 0; 927 + bool manage_clocks = true; 928 + bool reset = true; 1332 929 1333 - if (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE_ON_INIT) { 1334 - ddata->revision = sysc_read_revision(ddata); 1335 - goto rev_quirks; 1336 - } 930 + if (ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) 931 + reset = false; 1337 932 1338 - error = pm_runtime_get_sync(ddata->dev); 1339 - if (error < 0) { 1340 - pm_runtime_put_noidle(ddata->dev); 1341 - 1342 - return 0; 1343 - } 1344 - 1345 - error = sysc_reset(ddata); 1346 - if (error) { 1347 - dev_err(ddata->dev, "Reset failed with %d\n", error); 1348 - pm_runtime_put_sync(ddata->dev); 1349 - 933 + error = sysc_rstctrl_reset_deassert(ddata, reset); 934 + if (error) 1350 935 return error; 936 + 937 + if (ddata->cfg.quirks & 938 + (SYSC_QUIRK_NO_IDLE | SYSC_QUIRK_NO_IDLE_ON_INIT)) 939 + manage_clocks = false; 940 + 941 + if (manage_clocks) { 942 + error = sysc_enable_opt_clocks(ddata); 943 + if (error) 944 + return error; 945 + 946 + error = sysc_enable_main_clocks(ddata); 947 + if (error) 948 + goto err_opt_clocks; 1351 949 } 1352 950 1353 951 ddata->revision = sysc_read_revision(ddata); 1354 - pm_runtime_put_sync(ddata->dev); 1355 - 1356 - rev_quirks: 1357 952 sysc_init_revision_quirks(ddata); 1358 953 1359 - return 0; 954 + error = sysc_legacy_init(ddata); 955 + if (error) 956 + goto err_main_clocks; 957 + 958 + error = sysc_reset(ddata); 959 + if (error) 960 + dev_err(ddata->dev, "Reset failed with %d\n", error); 961 + 962 + err_main_clocks: 963 + if (manage_clocks) 964 + sysc_disable_main_clocks(ddata); 965 + err_opt_clocks: 966 + if (manage_clocks) 967 + sysc_disable_opt_clocks(ddata); 968 + 969 + return error; 1360 970 } 1361 971 1362 972 static int sysc_init_sysc_mask(struct sysc *ddata) ··· 1638 1208 } 1639 1209 #endif 1640 1210 1641 - struct dev_pm_domain sysc_child_pm_domain = { 1211 + static struct dev_pm_domain sysc_child_pm_domain = { 1642 1212 .ops = { 1643 1213 SET_RUNTIME_PM_OPS(sysc_child_runtime_suspend, 1644 1214 sysc_child_runtime_resume, ··· 1711 1281 .mask = SYSC_QUIRK_NO_IDLE_ON_INIT, }, 1712 1282 { .name = "ti,no-reset-on-init", 1713 1283 .mask = SYSC_QUIRK_NO_RESET_ON_INIT, }, 1284 + { .name = "ti,no-idle", 1285 + .mask = SYSC_QUIRK_NO_IDLE, }, 1714 1286 }; 1715 1287 1716 1288 static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np, ··· 1762 1330 static void sysc_unprepare(struct sysc *ddata) 1763 1331 { 1764 1332 int i; 1333 + 1334 + if (!ddata->clocks) 1335 + return; 1765 1336 1766 1337 for (i = 0; i < SYSC_MAX_CLOCKS; i++) { 1767 1338 if (!IS_ERR_OR_NULL(ddata->clocks[i])) ··· 2011 1576 static int sysc_init_pdata(struct sysc *ddata) 2012 1577 { 2013 1578 struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); 2014 - struct ti_sysc_module_data mdata; 2015 - int error = 0; 1579 + struct ti_sysc_module_data *mdata; 2016 1580 2017 1581 if (!pdata || !ddata->legacy_mode) 2018 1582 return 0; 2019 1583 2020 - mdata.name = ddata->legacy_mode; 2021 - mdata.module_pa = ddata->module_pa; 2022 - mdata.module_size = ddata->module_size; 2023 - mdata.offsets = ddata->offsets; 2024 - mdata.nr_offsets = SYSC_MAX_REGS; 2025 - mdata.cap = ddata->cap; 2026 - mdata.cfg = &ddata->cfg; 1584 + mdata = devm_kzalloc(ddata->dev, sizeof(*mdata), GFP_KERNEL); 1585 + if (!mdata) 1586 + return -ENOMEM; 2027 1587 2028 - if (!pdata->init_module) 2029 - return -ENODEV; 1588 + mdata->name = ddata->legacy_mode; 1589 + mdata->module_pa = ddata->module_pa; 1590 + mdata->module_size = ddata->module_size; 1591 + mdata->offsets = ddata->offsets; 1592 + mdata->nr_offsets = SYSC_MAX_REGS; 1593 + mdata->cap = ddata->cap; 1594 + mdata->cfg = &ddata->cfg; 2030 1595 2031 - error = pdata->init_module(ddata->dev, &mdata, &ddata->cookie); 2032 - if (error == -EEXIST) 2033 - error = 0; 1596 + ddata->mdata = mdata; 2034 1597 2035 - return error; 1598 + return 0; 2036 1599 } 2037 1600 2038 1601 static int sysc_init_match(struct sysc *ddata) ··· 2084 1651 if (error) 2085 1652 goto unprepare; 2086 1653 2087 - error = sysc_get_clocks(ddata); 2088 - if (error) 2089 - return error; 2090 - 2091 1654 error = sysc_map_and_check_registers(ddata); 2092 1655 if (error) 2093 1656 goto unprepare; ··· 2104 1675 if (error) 2105 1676 goto unprepare; 2106 1677 1678 + sysc_init_early_quirks(ddata); 1679 + 1680 + error = sysc_get_clocks(ddata); 1681 + if (error) 1682 + return error; 1683 + 2107 1684 error = sysc_init_resets(ddata); 2108 1685 if (error) 2109 1686 return error; 2110 1687 2111 - pm_runtime_enable(ddata->dev); 2112 1688 error = sysc_init_module(ddata); 2113 1689 if (error) 2114 1690 goto unprepare; 2115 1691 1692 + pm_runtime_enable(ddata->dev); 2116 1693 error = pm_runtime_get_sync(ddata->dev); 2117 1694 if (error < 0) { 2118 1695 pm_runtime_put_noidle(ddata->dev);
+7
drivers/clocksource/Kconfig
··· 69 69 Enables support for the Faraday Technology timer block 70 70 FTTMR010. 71 71 72 + config IXP4XX_TIMER 73 + bool "Intel XScale IXP4xx timer driver" if COMPILE_TEST 74 + depends on HAS_IOMEM 75 + select CLKSRC_MMIO 76 + help 77 + Enables support for the Intel XScale IXP4xx SoC timer. 78 + 72 79 config ROCKCHIP_TIMER 73 80 bool "Rockchip timer driver" if COMPILE_TEST 74 81 depends on ARM || ARM64
+1
drivers/clocksource/Makefile
··· 20 20 obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o 21 21 obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o 22 22 obj-$(CONFIG_FTTMR010_TIMER) += timer-fttmr010.o 23 + obj-$(CONFIG_IXP4XX_TIMER) += timer-ixp4xx.o 23 24 obj-$(CONFIG_ROCKCHIP_TIMER) += timer-rockchip.o 24 25 obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o 25 26 obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o
+282
drivers/clocksource/timer-ixp4xx.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * IXP4 timer driver 4 + * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> 5 + * 6 + * Based on arch/arm/mach-ixp4xx/common.c 7 + * Copyright 2002 (C) Intel Corporation 8 + * Copyright 2003-2004 (C) MontaVista, Software, Inc. 9 + * Copyright (C) Deepak Saxena <dsaxena@plexity.net> 10 + */ 11 + #include <linux/interrupt.h> 12 + #include <linux/io.h> 13 + #include <linux/clockchips.h> 14 + #include <linux/clocksource.h> 15 + #include <linux/sched_clock.h> 16 + #include <linux/slab.h> 17 + #include <linux/bitops.h> 18 + #include <linux/delay.h> 19 + #include <linux/of_address.h> 20 + #include <linux/of_irq.h> 21 + /* Goes away with OF conversion */ 22 + #include <linux/platform_data/timer-ixp4xx.h> 23 + 24 + /* 25 + * Constants to make it easy to access Timer Control/Status registers 26 + */ 27 + #define IXP4XX_OSTS_OFFSET 0x00 /* Continuous Timestamp */ 28 + #define IXP4XX_OST1_OFFSET 0x04 /* Timer 1 Timestamp */ 29 + #define IXP4XX_OSRT1_OFFSET 0x08 /* Timer 1 Reload */ 30 + #define IXP4XX_OST2_OFFSET 0x0C /* Timer 2 Timestamp */ 31 + #define IXP4XX_OSRT2_OFFSET 0x10 /* Timer 2 Reload */ 32 + #define IXP4XX_OSWT_OFFSET 0x14 /* Watchdog Timer */ 33 + #define IXP4XX_OSWE_OFFSET 0x18 /* Watchdog Enable */ 34 + #define IXP4XX_OSWK_OFFSET 0x1C /* Watchdog Key */ 35 + #define IXP4XX_OSST_OFFSET 0x20 /* Timer Status */ 36 + 37 + /* 38 + * Timer register values and bit definitions 39 + */ 40 + #define IXP4XX_OST_ENABLE 0x00000001 41 + #define IXP4XX_OST_ONE_SHOT 0x00000002 42 + /* Low order bits of reload value ignored */ 43 + #define IXP4XX_OST_RELOAD_MASK 0x00000003 44 + #define IXP4XX_OST_DISABLED 0x00000000 45 + #define IXP4XX_OSST_TIMER_1_PEND 0x00000001 46 + #define IXP4XX_OSST_TIMER_2_PEND 0x00000002 47 + #define IXP4XX_OSST_TIMER_TS_PEND 0x00000004 48 + #define IXP4XX_OSST_TIMER_WDOG_PEND 0x00000008 49 + #define IXP4XX_OSST_TIMER_WARM_RESET 0x00000010 50 + 51 + #define IXP4XX_WDT_KEY 0x0000482E 52 + #define IXP4XX_WDT_RESET_ENABLE 0x00000001 53 + #define IXP4XX_WDT_IRQ_ENABLE 0x00000002 54 + #define IXP4XX_WDT_COUNT_ENABLE 0x00000004 55 + 56 + struct ixp4xx_timer { 57 + void __iomem *base; 58 + unsigned int tick_rate; 59 + u32 latch; 60 + struct clock_event_device clkevt; 61 + #ifdef CONFIG_ARM 62 + struct delay_timer delay_timer; 63 + #endif 64 + }; 65 + 66 + /* 67 + * A local singleton used by sched_clock and delay timer reads, which are 68 + * fast and stateless 69 + */ 70 + static struct ixp4xx_timer *local_ixp4xx_timer; 71 + 72 + static inline struct ixp4xx_timer * 73 + to_ixp4xx_timer(struct clock_event_device *evt) 74 + { 75 + return container_of(evt, struct ixp4xx_timer, clkevt); 76 + } 77 + 78 + static u64 notrace ixp4xx_read_sched_clock(void) 79 + { 80 + return __raw_readl(local_ixp4xx_timer->base + IXP4XX_OSTS_OFFSET); 81 + } 82 + 83 + static u64 ixp4xx_clocksource_read(struct clocksource *c) 84 + { 85 + return __raw_readl(local_ixp4xx_timer->base + IXP4XX_OSTS_OFFSET); 86 + } 87 + 88 + static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) 89 + { 90 + struct ixp4xx_timer *tmr = dev_id; 91 + struct clock_event_device *evt = &tmr->clkevt; 92 + 93 + /* Clear Pending Interrupt */ 94 + __raw_writel(IXP4XX_OSST_TIMER_1_PEND, 95 + tmr->base + IXP4XX_OSST_OFFSET); 96 + 97 + evt->event_handler(evt); 98 + 99 + return IRQ_HANDLED; 100 + } 101 + 102 + static int ixp4xx_set_next_event(unsigned long cycles, 103 + struct clock_event_device *evt) 104 + { 105 + struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); 106 + u32 val; 107 + 108 + val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET); 109 + /* Keep enable/oneshot bits */ 110 + val &= IXP4XX_OST_RELOAD_MASK; 111 + __raw_writel((cycles & ~IXP4XX_OST_RELOAD_MASK) | val, 112 + tmr->base + IXP4XX_OSRT1_OFFSET); 113 + 114 + return 0; 115 + } 116 + 117 + static int ixp4xx_shutdown(struct clock_event_device *evt) 118 + { 119 + struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); 120 + u32 val; 121 + 122 + val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET); 123 + val &= ~IXP4XX_OST_ENABLE; 124 + __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET); 125 + 126 + return 0; 127 + } 128 + 129 + static int ixp4xx_set_oneshot(struct clock_event_device *evt) 130 + { 131 + struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); 132 + 133 + __raw_writel(IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT, 134 + tmr->base + IXP4XX_OSRT1_OFFSET); 135 + 136 + return 0; 137 + } 138 + 139 + static int ixp4xx_set_periodic(struct clock_event_device *evt) 140 + { 141 + struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); 142 + u32 val; 143 + 144 + val = tmr->latch & ~IXP4XX_OST_RELOAD_MASK; 145 + val |= IXP4XX_OST_ENABLE; 146 + __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET); 147 + 148 + return 0; 149 + } 150 + 151 + static int ixp4xx_resume(struct clock_event_device *evt) 152 + { 153 + struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); 154 + u32 val; 155 + 156 + val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET); 157 + val |= IXP4XX_OST_ENABLE; 158 + __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET); 159 + 160 + return 0; 161 + } 162 + 163 + /* 164 + * IXP4xx timer tick 165 + * We use OS timer1 on the CPU for the timer tick and the timestamp 166 + * counter as a source of real clock ticks to account for missed jiffies. 167 + */ 168 + static __init int ixp4xx_timer_register(void __iomem *base, 169 + int timer_irq, 170 + unsigned int timer_freq) 171 + { 172 + struct ixp4xx_timer *tmr; 173 + int ret; 174 + 175 + tmr = kzalloc(sizeof(*tmr), GFP_KERNEL); 176 + if (!tmr) 177 + return -ENOMEM; 178 + tmr->base = base; 179 + tmr->tick_rate = timer_freq; 180 + 181 + /* 182 + * The timer register doesn't allow to specify the two least 183 + * significant bits of the timeout value and assumes them being zero. 184 + * So make sure the latch is the best value with the two least 185 + * significant bits unset. 186 + */ 187 + tmr->latch = DIV_ROUND_CLOSEST(timer_freq, 188 + (IXP4XX_OST_RELOAD_MASK + 1) * HZ) 189 + * (IXP4XX_OST_RELOAD_MASK + 1); 190 + 191 + local_ixp4xx_timer = tmr; 192 + 193 + /* Reset/disable counter */ 194 + __raw_writel(0, tmr->base + IXP4XX_OSRT1_OFFSET); 195 + 196 + /* Clear any pending interrupt on timer 1 */ 197 + __raw_writel(IXP4XX_OSST_TIMER_1_PEND, 198 + tmr->base + IXP4XX_OSST_OFFSET); 199 + 200 + /* Reset time-stamp counter */ 201 + __raw_writel(0, tmr->base + IXP4XX_OSTS_OFFSET); 202 + 203 + clocksource_mmio_init(NULL, "OSTS", timer_freq, 200, 32, 204 + ixp4xx_clocksource_read); 205 + 206 + tmr->clkevt.name = "ixp4xx timer1"; 207 + tmr->clkevt.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; 208 + tmr->clkevt.rating = 200; 209 + tmr->clkevt.set_state_shutdown = ixp4xx_shutdown; 210 + tmr->clkevt.set_state_periodic = ixp4xx_set_periodic; 211 + tmr->clkevt.set_state_oneshot = ixp4xx_set_oneshot; 212 + tmr->clkevt.tick_resume = ixp4xx_resume; 213 + tmr->clkevt.set_next_event = ixp4xx_set_next_event; 214 + tmr->clkevt.cpumask = cpumask_of(0); 215 + tmr->clkevt.irq = timer_irq; 216 + ret = request_irq(timer_irq, ixp4xx_timer_interrupt, 217 + IRQF_TIMER, "IXP4XX-TIMER1", tmr); 218 + if (ret) { 219 + pr_crit("no timer IRQ\n"); 220 + return -ENODEV; 221 + } 222 + clockevents_config_and_register(&tmr->clkevt, timer_freq, 223 + 0xf, 0xfffffffe); 224 + 225 + sched_clock_register(ixp4xx_read_sched_clock, 32, timer_freq); 226 + 227 + return 0; 228 + } 229 + 230 + /** 231 + * ixp4xx_timer_setup() - Timer setup function to be called from boardfiles 232 + * @timerbase: physical base of timer block 233 + * @timer_irq: Linux IRQ number for the timer 234 + * @timer_freq: Fixed frequency of the timer 235 + */ 236 + void __init ixp4xx_timer_setup(resource_size_t timerbase, 237 + int timer_irq, 238 + unsigned int timer_freq) 239 + { 240 + void __iomem *base; 241 + 242 + base = ioremap(timerbase, 0x100); 243 + if (!base) { 244 + pr_crit("IXP4xx: can't remap timer\n"); 245 + return; 246 + } 247 + ixp4xx_timer_register(base, timer_irq, timer_freq); 248 + } 249 + EXPORT_SYMBOL_GPL(ixp4xx_timer_setup); 250 + 251 + #ifdef CONFIG_OF 252 + static __init int ixp4xx_of_timer_init(struct device_node *np) 253 + { 254 + void __iomem *base; 255 + int irq; 256 + int ret; 257 + 258 + base = of_iomap(np, 0); 259 + if (!base) { 260 + pr_crit("IXP4xx: can't remap timer\n"); 261 + return -ENODEV; 262 + } 263 + 264 + irq = irq_of_parse_and_map(np, 0); 265 + if (irq <= 0) { 266 + pr_err("Can't parse IRQ\n"); 267 + ret = -EINVAL; 268 + goto out_unmap; 269 + } 270 + 271 + /* TODO: get some fixed clocks into the device tree */ 272 + ret = ixp4xx_timer_register(base, irq, 66666000); 273 + if (ret) 274 + goto out_unmap; 275 + return 0; 276 + 277 + out_unmap: 278 + iounmap(base); 279 + return ret; 280 + } 281 + TIMER_OF_DECLARE(ixp4xx, "intel,ixp4xx-timer", ixp4xx_of_timer_init); 282 + #endif
+2 -2
drivers/crypto/ixp4xx_crypto.c
··· 30 30 #include <crypto/authenc.h> 31 31 #include <crypto/scatterwalk.h> 32 32 33 - #include <mach/npe.h> 34 - #include <mach/qmgr.h> 33 + #include <linux/soc/ixp4xx/npe.h> 34 + #include <linux/soc/ixp4xx/qmgr.h> 35 35 36 36 #define MAX_KEYLEN 32 37 37
+16
drivers/firmware/Kconfig
··· 253 253 This protocol library is used by client drivers to use the features 254 254 provided by the system controller. 255 255 256 + config TRUSTED_FOUNDATIONS 257 + bool "Trusted Foundations secure monitor support" 258 + depends on ARM 259 + help 260 + Some devices (including most early Tegra-based consumer devices on 261 + the market) are booted with the Trusted Foundations secure monitor 262 + active, requiring some core operations to be performed by the secure 263 + monitor instead of the kernel. 264 + 265 + This option allows the kernel to invoke the secure monitor whenever 266 + required on devices using Trusted Foundations. See the functions and 267 + comments in linux/firmware/trusted_foundations.h or the device tree 268 + bindings for "tlm,trusted-foundations" for details on how to use it. 269 + 270 + Choose N if you don't know what this is about. 271 + 256 272 config HAVE_ARM_SMCCC 257 273 bool 258 274
+1
drivers/firmware/Makefile
··· 21 21 obj-$(CONFIG_QCOM_SCM_32) += qcom_scm-32.o 22 22 CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1) -march=armv7-a 23 23 obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o 24 + obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o 24 25 25 26 obj-$(CONFIG_ARM_SCMI_PROTOCOL) += arm_scmi/ 26 27 obj-y += psci/
+13
drivers/gpio/Kconfig
··· 286 286 287 287 If unsure, say N. 288 288 289 + config GPIO_IXP4XX 290 + bool "Intel IXP4xx GPIO" 291 + depends on ARM # For <asm/mach-types.h> 292 + depends on ARCH_IXP4XX 293 + select GPIO_GENERIC 294 + select IRQ_DOMAIN 295 + select IRQ_DOMAIN_HIERARCHY 296 + help 297 + Say yes here to support the GPIO functionality of a number of Intel 298 + IXP4xx series of chips. 299 + 300 + If unsure, say N. 301 + 289 302 config GPIO_LOONGSON 290 303 bool "Loongson-2/3 GPIO support" 291 304 depends on CPU_LOONGSON2 || CPU_LOONGSON3
+1
drivers/gpio/Makefile
··· 61 61 obj-$(CONFIG_HTC_EGPIO) += gpio-htc-egpio.o 62 62 obj-$(CONFIG_GPIO_ICH) += gpio-ich.o 63 63 obj-$(CONFIG_GPIO_IOP) += gpio-iop.o 64 + obj-$(CONFIG_GPIO_IXP4XX) += gpio-ixp4xx.o 64 65 obj-$(CONFIG_GPIO_IT87) += gpio-it87.o 65 66 obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o 66 67 obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o
+474
drivers/gpio/gpio-ixp4xx.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // 3 + // IXP4 GPIO driver 4 + // Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> 5 + // 6 + // based on previous work and know-how from: 7 + // Deepak Saxena <dsaxena@plexity.net> 8 + 9 + #include <linux/gpio/driver.h> 10 + #include <linux/io.h> 11 + #include <linux/irq.h> 12 + #include <linux/irqdomain.h> 13 + #include <linux/irqchip.h> 14 + #include <linux/of_irq.h> 15 + #include <linux/platform_device.h> 16 + #include <linux/bitops.h> 17 + /* Include that go away with DT transition */ 18 + #include <linux/irqchip/irq-ixp4xx.h> 19 + 20 + #include <asm/mach-types.h> 21 + 22 + #define IXP4XX_REG_GPOUT 0x00 23 + #define IXP4XX_REG_GPOE 0x04 24 + #define IXP4XX_REG_GPIN 0x08 25 + #define IXP4XX_REG_GPIS 0x0C 26 + #define IXP4XX_REG_GPIT1 0x10 27 + #define IXP4XX_REG_GPIT2 0x14 28 + #define IXP4XX_REG_GPCLK 0x18 29 + #define IXP4XX_REG_GPDBSEL 0x1C 30 + 31 + /* 32 + * The hardware uses 3 bits to indicate interrupt "style". 33 + * we clear and set these three bits accordingly. The lower 24 34 + * bits in two registers (GPIT1 and GPIT2) are used to set up 35 + * the style for 8 lines each for a total of 16 GPIO lines. 36 + */ 37 + #define IXP4XX_GPIO_STYLE_ACTIVE_HIGH 0x0 38 + #define IXP4XX_GPIO_STYLE_ACTIVE_LOW 0x1 39 + #define IXP4XX_GPIO_STYLE_RISING_EDGE 0x2 40 + #define IXP4XX_GPIO_STYLE_FALLING_EDGE 0x3 41 + #define IXP4XX_GPIO_STYLE_TRANSITIONAL 0x4 42 + #define IXP4XX_GPIO_STYLE_MASK GENMASK(2, 0) 43 + #define IXP4XX_GPIO_STYLE_SIZE 3 44 + 45 + /** 46 + * struct ixp4xx_gpio - IXP4 GPIO state container 47 + * @dev: containing device for this instance 48 + * @fwnode: the fwnode for this GPIO chip 49 + * @gc: gpiochip for this instance 50 + * @domain: irqdomain for this chip instance 51 + * @base: remapped I/O-memory base 52 + * @irq_edge: Each bit represents an IRQ: 1: edge-triggered, 53 + * 0: level triggered 54 + */ 55 + struct ixp4xx_gpio { 56 + struct device *dev; 57 + struct fwnode_handle *fwnode; 58 + struct gpio_chip gc; 59 + struct irq_domain *domain; 60 + void __iomem *base; 61 + unsigned long long irq_edge; 62 + }; 63 + 64 + /** 65 + * struct ixp4xx_gpio_map - IXP4 GPIO to parent IRQ map 66 + * @gpio_offset: offset of the IXP4 GPIO line 67 + * @parent_hwirq: hwirq on the parent IRQ controller 68 + */ 69 + struct ixp4xx_gpio_map { 70 + int gpio_offset; 71 + int parent_hwirq; 72 + }; 73 + 74 + /* GPIO lines 0..12 have corresponding IRQs, GPIOs 13..15 have no IRQs */ 75 + const struct ixp4xx_gpio_map ixp4xx_gpiomap[] = { 76 + { .gpio_offset = 0, .parent_hwirq = 6 }, 77 + { .gpio_offset = 1, .parent_hwirq = 7 }, 78 + { .gpio_offset = 2, .parent_hwirq = 19 }, 79 + { .gpio_offset = 3, .parent_hwirq = 20 }, 80 + { .gpio_offset = 4, .parent_hwirq = 21 }, 81 + { .gpio_offset = 5, .parent_hwirq = 22 }, 82 + { .gpio_offset = 6, .parent_hwirq = 23 }, 83 + { .gpio_offset = 7, .parent_hwirq = 24 }, 84 + { .gpio_offset = 8, .parent_hwirq = 25 }, 85 + { .gpio_offset = 9, .parent_hwirq = 26 }, 86 + { .gpio_offset = 10, .parent_hwirq = 27 }, 87 + { .gpio_offset = 11, .parent_hwirq = 28 }, 88 + { .gpio_offset = 12, .parent_hwirq = 29 }, 89 + }; 90 + 91 + static void ixp4xx_gpio_irq_ack(struct irq_data *d) 92 + { 93 + struct ixp4xx_gpio *g = irq_data_get_irq_chip_data(d); 94 + 95 + __raw_writel(BIT(d->hwirq), g->base + IXP4XX_REG_GPIS); 96 + } 97 + 98 + static void ixp4xx_gpio_irq_unmask(struct irq_data *d) 99 + { 100 + struct ixp4xx_gpio *g = irq_data_get_irq_chip_data(d); 101 + 102 + /* ACK when unmasking if not edge-triggered */ 103 + if (!(g->irq_edge & BIT(d->hwirq))) 104 + ixp4xx_gpio_irq_ack(d); 105 + 106 + irq_chip_unmask_parent(d); 107 + } 108 + 109 + static int ixp4xx_gpio_irq_set_type(struct irq_data *d, unsigned int type) 110 + { 111 + struct ixp4xx_gpio *g = irq_data_get_irq_chip_data(d); 112 + int line = d->hwirq; 113 + unsigned long flags; 114 + u32 int_style; 115 + u32 int_reg; 116 + u32 val; 117 + 118 + switch (type) { 119 + case IRQ_TYPE_EDGE_BOTH: 120 + irq_set_handler_locked(d, handle_edge_irq); 121 + int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL; 122 + g->irq_edge |= BIT(d->hwirq); 123 + break; 124 + case IRQ_TYPE_EDGE_RISING: 125 + irq_set_handler_locked(d, handle_edge_irq); 126 + int_style = IXP4XX_GPIO_STYLE_RISING_EDGE; 127 + g->irq_edge |= BIT(d->hwirq); 128 + break; 129 + case IRQ_TYPE_EDGE_FALLING: 130 + irq_set_handler_locked(d, handle_edge_irq); 131 + int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE; 132 + g->irq_edge |= BIT(d->hwirq); 133 + break; 134 + case IRQ_TYPE_LEVEL_HIGH: 135 + irq_set_handler_locked(d, handle_level_irq); 136 + int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH; 137 + g->irq_edge &= ~BIT(d->hwirq); 138 + break; 139 + case IRQ_TYPE_LEVEL_LOW: 140 + irq_set_handler_locked(d, handle_level_irq); 141 + int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW; 142 + g->irq_edge &= ~BIT(d->hwirq); 143 + break; 144 + default: 145 + return -EINVAL; 146 + } 147 + 148 + if (line >= 8) { 149 + /* pins 8-15 */ 150 + line -= 8; 151 + int_reg = IXP4XX_REG_GPIT2; 152 + } else { 153 + /* pins 0-7 */ 154 + int_reg = IXP4XX_REG_GPIT1; 155 + } 156 + 157 + spin_lock_irqsave(&g->gc.bgpio_lock, flags); 158 + 159 + /* Clear the style for the appropriate pin */ 160 + val = __raw_readl(g->base + int_reg); 161 + val &= ~(IXP4XX_GPIO_STYLE_MASK << (line * IXP4XX_GPIO_STYLE_SIZE)); 162 + __raw_writel(val, g->base + int_reg); 163 + 164 + __raw_writel(BIT(line), g->base + IXP4XX_REG_GPIS); 165 + 166 + /* Set the new style */ 167 + val = __raw_readl(g->base + int_reg); 168 + val |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE)); 169 + __raw_writel(val, g->base + int_reg); 170 + 171 + /* Force-configure this line as an input */ 172 + val = __raw_readl(g->base + IXP4XX_REG_GPOE); 173 + val |= BIT(d->hwirq); 174 + __raw_writel(val, g->base + IXP4XX_REG_GPOE); 175 + 176 + spin_unlock_irqrestore(&g->gc.bgpio_lock, flags); 177 + 178 + /* This parent only accept level high (asserted) */ 179 + return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); 180 + } 181 + 182 + static struct irq_chip ixp4xx_gpio_irqchip = { 183 + .name = "IXP4GPIO", 184 + .irq_ack = ixp4xx_gpio_irq_ack, 185 + .irq_mask = irq_chip_mask_parent, 186 + .irq_unmask = ixp4xx_gpio_irq_unmask, 187 + .irq_set_type = ixp4xx_gpio_irq_set_type, 188 + }; 189 + 190 + static int ixp4xx_gpio_to_irq(struct gpio_chip *gc, unsigned int offset) 191 + { 192 + struct ixp4xx_gpio *g = gpiochip_get_data(gc); 193 + struct irq_fwspec fwspec; 194 + 195 + fwspec.fwnode = g->fwnode; 196 + fwspec.param_count = 2; 197 + fwspec.param[0] = offset; 198 + fwspec.param[1] = IRQ_TYPE_NONE; 199 + 200 + return irq_create_fwspec_mapping(&fwspec); 201 + } 202 + 203 + static int ixp4xx_gpio_irq_domain_translate(struct irq_domain *domain, 204 + struct irq_fwspec *fwspec, 205 + unsigned long *hwirq, 206 + unsigned int *type) 207 + { 208 + 209 + /* We support standard DT translation */ 210 + if (is_of_node(fwspec->fwnode) && fwspec->param_count == 2) { 211 + *hwirq = fwspec->param[0]; 212 + *type = fwspec->param[1]; 213 + return 0; 214 + } 215 + 216 + /* This goes away when we transition to DT */ 217 + if (is_fwnode_irqchip(fwspec->fwnode)) { 218 + if (fwspec->param_count != 2) 219 + return -EINVAL; 220 + *hwirq = fwspec->param[0]; 221 + *type = fwspec->param[1]; 222 + WARN_ON(*type == IRQ_TYPE_NONE); 223 + return 0; 224 + } 225 + return -EINVAL; 226 + } 227 + 228 + static int ixp4xx_gpio_irq_domain_alloc(struct irq_domain *d, 229 + unsigned int irq, unsigned int nr_irqs, 230 + void *data) 231 + { 232 + struct ixp4xx_gpio *g = d->host_data; 233 + irq_hw_number_t hwirq; 234 + unsigned int type = IRQ_TYPE_NONE; 235 + struct irq_fwspec *fwspec = data; 236 + int ret; 237 + int i; 238 + 239 + ret = ixp4xx_gpio_irq_domain_translate(d, fwspec, &hwirq, &type); 240 + if (ret) 241 + return ret; 242 + 243 + dev_dbg(g->dev, "allocate IRQ %d..%d, hwirq %lu..%lu\n", 244 + irq, irq + nr_irqs - 1, 245 + hwirq, hwirq + nr_irqs - 1); 246 + 247 + for (i = 0; i < nr_irqs; i++) { 248 + struct irq_fwspec parent_fwspec; 249 + const struct ixp4xx_gpio_map *map; 250 + int j; 251 + 252 + /* Not all lines support IRQs */ 253 + for (j = 0; j < ARRAY_SIZE(ixp4xx_gpiomap); j++) { 254 + map = &ixp4xx_gpiomap[j]; 255 + if (map->gpio_offset == hwirq) 256 + break; 257 + } 258 + if (j == ARRAY_SIZE(ixp4xx_gpiomap)) { 259 + dev_err(g->dev, "can't look up hwirq %lu\n", hwirq); 260 + return -EINVAL; 261 + } 262 + dev_dbg(g->dev, "found parent hwirq %u\n", map->parent_hwirq); 263 + 264 + /* 265 + * We set handle_bad_irq because the .set_type() should 266 + * always be invoked and set the right type of handler. 267 + */ 268 + irq_domain_set_info(d, 269 + irq + i, 270 + hwirq + i, 271 + &ixp4xx_gpio_irqchip, 272 + g, 273 + handle_bad_irq, 274 + NULL, NULL); 275 + irq_set_probe(irq + i); 276 + 277 + /* 278 + * Create a IRQ fwspec to send up to the parent irqdomain: 279 + * specify the hwirq we address on the parent and tie it 280 + * all together up the chain. 281 + */ 282 + parent_fwspec.fwnode = d->parent->fwnode; 283 + parent_fwspec.param_count = 2; 284 + parent_fwspec.param[0] = map->parent_hwirq; 285 + /* This parent only handles asserted level IRQs */ 286 + parent_fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH; 287 + dev_dbg(g->dev, "alloc_irqs_parent for %d parent hwirq %d\n", 288 + irq + i, map->parent_hwirq); 289 + ret = irq_domain_alloc_irqs_parent(d, irq + i, 1, 290 + &parent_fwspec); 291 + if (ret) 292 + dev_err(g->dev, 293 + "failed to allocate parent hwirq %d for hwirq %lu\n", 294 + map->parent_hwirq, hwirq); 295 + } 296 + 297 + return 0; 298 + } 299 + 300 + static const struct irq_domain_ops ixp4xx_gpio_irqdomain_ops = { 301 + .translate = ixp4xx_gpio_irq_domain_translate, 302 + .alloc = ixp4xx_gpio_irq_domain_alloc, 303 + .free = irq_domain_free_irqs_common, 304 + }; 305 + 306 + static int ixp4xx_gpio_probe(struct platform_device *pdev) 307 + { 308 + unsigned long flags; 309 + struct device *dev = &pdev->dev; 310 + struct device_node *np = dev->of_node; 311 + struct irq_domain *parent; 312 + struct resource *res; 313 + struct ixp4xx_gpio *g; 314 + int ret; 315 + int i; 316 + 317 + g = devm_kzalloc(dev, sizeof(*g), GFP_KERNEL); 318 + if (!g) 319 + return -ENOMEM; 320 + g->dev = dev; 321 + 322 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 323 + g->base = devm_ioremap_resource(dev, res); 324 + if (IS_ERR(g->base)) { 325 + dev_err(dev, "ioremap error\n"); 326 + return PTR_ERR(g->base); 327 + } 328 + 329 + /* 330 + * Make sure GPIO 14 and 15 are NOT used as clocks but GPIO on 331 + * specific machines. 332 + */ 333 + if (machine_is_dsmg600() || machine_is_nas100d()) 334 + __raw_writel(0x0, g->base + IXP4XX_REG_GPCLK); 335 + 336 + /* 337 + * This is a very special big-endian ARM issue: when the IXP4xx is 338 + * run in big endian mode, all registers in the machine are switched 339 + * around to the CPU-native endianness. As you see mostly in the 340 + * driver we use __raw_readl()/__raw_writel() to access the registers 341 + * in the appropriate order. With the GPIO library we need to specify 342 + * byte order explicitly, so this flag needs to be set when compiling 343 + * for big endian. 344 + */ 345 + #if defined(CONFIG_CPU_BIG_ENDIAN) 346 + flags = BGPIOF_BIG_ENDIAN_BYTE_ORDER; 347 + #else 348 + flags = 0; 349 + #endif 350 + 351 + /* Populate and register gpio chip */ 352 + ret = bgpio_init(&g->gc, dev, 4, 353 + g->base + IXP4XX_REG_GPIN, 354 + g->base + IXP4XX_REG_GPOUT, 355 + NULL, 356 + NULL, 357 + g->base + IXP4XX_REG_GPOE, 358 + flags); 359 + if (ret) { 360 + dev_err(dev, "unable to init generic GPIO\n"); 361 + return ret; 362 + } 363 + g->gc.to_irq = ixp4xx_gpio_to_irq; 364 + g->gc.ngpio = 16; 365 + g->gc.label = "IXP4XX_GPIO_CHIP"; 366 + /* 367 + * TODO: when we have migrated to device tree and all GPIOs 368 + * are fetched using phandles, set this to -1 to get rid of 369 + * the fixed gpiochip base. 370 + */ 371 + g->gc.base = 0; 372 + g->gc.parent = &pdev->dev; 373 + g->gc.owner = THIS_MODULE; 374 + 375 + ret = devm_gpiochip_add_data(dev, &g->gc, g); 376 + if (ret) { 377 + dev_err(dev, "failed to add SoC gpiochip\n"); 378 + return ret; 379 + } 380 + 381 + /* 382 + * When we convert to device tree we will simply look up the 383 + * parent irqdomain using irq_find_host(parent) as parent comes 384 + * from IRQCHIP_DECLARE(), then use of_node_to_fwnode() to get 385 + * the fwnode. For now we need this boardfile style code. 386 + */ 387 + if (np) { 388 + struct device_node *irq_parent; 389 + 390 + irq_parent = of_irq_find_parent(np); 391 + if (!irq_parent) { 392 + dev_err(dev, "no IRQ parent node\n"); 393 + return -ENODEV; 394 + } 395 + parent = irq_find_host(irq_parent); 396 + if (!parent) { 397 + dev_err(dev, "no IRQ parent domain\n"); 398 + return -ENODEV; 399 + } 400 + g->fwnode = of_node_to_fwnode(np); 401 + } else { 402 + parent = ixp4xx_get_irq_domain(); 403 + g->fwnode = irq_domain_alloc_fwnode(g->base); 404 + if (!g->fwnode) { 405 + dev_err(dev, "no domain base\n"); 406 + return -ENODEV; 407 + } 408 + } 409 + g->domain = irq_domain_create_hierarchy(parent, 410 + IRQ_DOMAIN_FLAG_HIERARCHY, 411 + ARRAY_SIZE(ixp4xx_gpiomap), 412 + g->fwnode, 413 + &ixp4xx_gpio_irqdomain_ops, 414 + g); 415 + if (!g->domain) { 416 + irq_domain_free_fwnode(g->fwnode); 417 + dev_err(dev, "no hierarchical irq domain\n"); 418 + return ret; 419 + } 420 + 421 + /* 422 + * After adding OF support, this is no longer needed: irqs 423 + * will be allocated for the respective fwnodes. 424 + */ 425 + if (!np) { 426 + for (i = 0; i < ARRAY_SIZE(ixp4xx_gpiomap); i++) { 427 + const struct ixp4xx_gpio_map *map = &ixp4xx_gpiomap[i]; 428 + struct irq_fwspec fwspec; 429 + 430 + fwspec.fwnode = g->fwnode; 431 + /* This is the hwirq for the GPIO line side of things */ 432 + fwspec.param[0] = map->gpio_offset; 433 + fwspec.param[1] = IRQ_TYPE_EDGE_RISING; 434 + fwspec.param_count = 2; 435 + ret = __irq_domain_alloc_irqs(g->domain, 436 + -1, /* just pick something */ 437 + 1, 438 + NUMA_NO_NODE, 439 + &fwspec, 440 + false, 441 + NULL); 442 + if (ret < 0) { 443 + irq_domain_free_fwnode(g->fwnode); 444 + dev_err(dev, 445 + "can not allocate irq for GPIO line %d parent hwirq %d in hierarchy domain: %d\n", 446 + map->gpio_offset, map->parent_hwirq, 447 + ret); 448 + return ret; 449 + } 450 + } 451 + } 452 + 453 + platform_set_drvdata(pdev, g); 454 + dev_info(dev, "IXP4 GPIO @%p registered\n", g->base); 455 + 456 + return 0; 457 + } 458 + 459 + static const struct of_device_id ixp4xx_gpio_of_match[] = { 460 + { 461 + .compatible = "intel,ixp4xx-gpio", 462 + }, 463 + {}, 464 + }; 465 + 466 + 467 + static struct platform_driver ixp4xx_gpio_driver = { 468 + .driver = { 469 + .name = "ixp4xx-gpio", 470 + .of_match_table = of_match_ptr(ixp4xx_gpio_of_match), 471 + }, 472 + .probe = ixp4xx_gpio_probe, 473 + }; 474 + builtin_platform_driver(ixp4xx_gpio_driver);
+1 -1
drivers/input/keyboard/Kconfig
··· 205 205 206 206 config KEYBOARD_EP93XX 207 207 tristate "EP93xx Matrix Keypad support" 208 - depends on ARCH_EP93XX 208 + depends on ARCH_EP93XX || COMPILE_TEST 209 209 select INPUT_MATRIXKMAP 210 210 help 211 211 Say Y here to enable the matrix keypad on the Cirrus EP93XX.
+2 -6
drivers/input/keyboard/ep93xx_keypad.c
··· 27 27 #include <linux/io.h> 28 28 #include <linux/input/matrix_keypad.h> 29 29 #include <linux/slab.h> 30 - 31 - #include <mach/hardware.h> 30 + #include <linux/soc/cirrus/ep93xx.h> 32 31 #include <linux/platform_data/keypad-ep93xx.h> 33 32 34 33 /* ··· 136 137 struct ep93xx_keypad_platform_data *pdata = keypad->pdata; 137 138 unsigned int val = 0; 138 139 139 - if (pdata->flags & EP93XX_KEYPAD_KDIV) 140 - clk_set_rate(keypad->clk, EP93XX_KEYTCHCLK_DIV4); 141 - else 142 - clk_set_rate(keypad->clk, EP93XX_KEYTCHCLK_DIV16); 140 + clk_set_rate(keypad->clk, pdata->clk_rate); 143 141 144 142 if (pdata->flags & EP93XX_KEYPAD_DISABLE_3_KEY) 145 143 val |= KEY_INIT_DIS3KY;
+15 -5
drivers/input/misc/ixp4xx-beeper.c
··· 30 30 31 31 static DEFINE_SPINLOCK(beep_lock); 32 32 33 + static int ixp4xx_timer2_irq; 34 + 33 35 static void ixp4xx_spkr_control(unsigned int pin, unsigned int count) 34 36 { 35 37 unsigned long flags; ··· 92 90 static int ixp4xx_spkr_probe(struct platform_device *dev) 93 91 { 94 92 struct input_dev *input_dev; 93 + int irq; 95 94 int err; 96 95 97 96 input_dev = input_allocate_device(); ··· 113 110 input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); 114 111 input_dev->event = ixp4xx_spkr_event; 115 112 113 + irq = platform_get_irq(dev, 0); 114 + if (irq < 0) { 115 + err = irq; 116 + goto err_free_device; 117 + } 118 + 116 119 err = gpio_request(dev->id, "ixp4-beeper"); 117 120 if (err) 118 121 goto err_free_device; 119 122 120 - err = request_irq(IRQ_IXP4XX_TIMER2, &ixp4xx_spkr_interrupt, 123 + err = request_irq(irq, &ixp4xx_spkr_interrupt, 121 124 IRQF_NO_SUSPEND, "ixp4xx-beeper", 122 125 (void *) dev->id); 123 126 if (err) 124 127 goto err_free_gpio; 128 + ixp4xx_timer2_irq = irq; 125 129 126 130 err = input_register_device(input_dev); 127 131 if (err) ··· 139 129 return 0; 140 130 141 131 err_free_irq: 142 - free_irq(IRQ_IXP4XX_TIMER2, (void *)dev->id); 132 + free_irq(irq, (void *)dev->id); 143 133 err_free_gpio: 144 134 gpio_free(dev->id); 145 135 err_free_device: ··· 156 146 input_unregister_device(input_dev); 157 147 158 148 /* turn the speaker off */ 159 - disable_irq(IRQ_IXP4XX_TIMER2); 149 + disable_irq(ixp4xx_timer2_irq); 160 150 ixp4xx_spkr_control(pin, 0); 161 151 162 - free_irq(IRQ_IXP4XX_TIMER2, (void *)dev->id); 152 + free_irq(ixp4xx_timer2_irq, (void *)dev->id); 163 153 gpio_free(dev->id); 164 154 165 155 return 0; ··· 171 161 unsigned int pin = (unsigned int) input_get_drvdata(input_dev); 172 162 173 163 /* turn off the speaker */ 174 - disable_irq(IRQ_IXP4XX_TIMER2); 164 + disable_irq(ixp4xx_timer2_irq); 175 165 ixp4xx_spkr_control(pin, 0); 176 166 } 177 167
+6
drivers/irqchip/Kconfig
··· 160 160 select GENERIC_IRQ_CHIP 161 161 select IRQ_DOMAIN 162 162 163 + config IXP4XX_IRQ 164 + bool 165 + select IRQ_DOMAIN 166 + select GENERIC_IRQ_MULTI_HANDLER 167 + select SPARSE_IRQ 168 + 163 169 config MADERA_IRQ 164 170 tristate 165 171
+1
drivers/irqchip/Makefile
··· 43 43 obj-$(CONFIG_I8259) += irq-i8259.o 44 44 obj-$(CONFIG_IMGPDC_IRQ) += irq-imgpdc.o 45 45 obj-$(CONFIG_IRQ_MIPS_CPU) += irq-mips-cpu.o 46 + obj-$(CONFIG_IXP4XX_IRQ) += irq-ixp4xx.o 46 47 obj-$(CONFIG_SIRF_IRQ) += irq-sirfsoc.o 47 48 obj-$(CONFIG_JCORE_AIC) += irq-jcore-aic.o 48 49 obj-$(CONFIG_RDA_INTC) += irq-rda-intc.o
+403
drivers/irqchip/irq-ixp4xx.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * irqchip for the IXP4xx interrupt controller 4 + * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> 5 + * 6 + * Based on arch/arm/mach-ixp4xx/common.c 7 + * Copyright 2002 (C) Intel Corporation 8 + * Copyright 2003-2004 (C) MontaVista, Software, Inc. 9 + * Copyright (C) Deepak Saxena <dsaxena@plexity.net> 10 + */ 11 + #include <linux/bitops.h> 12 + #include <linux/gpio/driver.h> 13 + #include <linux/irq.h> 14 + #include <linux/io.h> 15 + #include <linux/irqchip.h> 16 + #include <linux/irqchip/irq-ixp4xx.h> 17 + #include <linux/irqdomain.h> 18 + #include <linux/of.h> 19 + #include <linux/of_address.h> 20 + #include <linux/of_irq.h> 21 + #include <linux/platform_device.h> 22 + #include <linux/cpu.h> 23 + 24 + #include <asm/exception.h> 25 + #include <asm/mach/irq.h> 26 + 27 + #define IXP4XX_ICPR 0x00 /* Interrupt Status */ 28 + #define IXP4XX_ICMR 0x04 /* Interrupt Enable */ 29 + #define IXP4XX_ICLR 0x08 /* Interrupt IRQ/FIQ Select */ 30 + #define IXP4XX_ICIP 0x0C /* IRQ Status */ 31 + #define IXP4XX_ICFP 0x10 /* FIQ Status */ 32 + #define IXP4XX_ICHR 0x14 /* Interrupt Priority */ 33 + #define IXP4XX_ICIH 0x18 /* IRQ Highest Pri Int */ 34 + #define IXP4XX_ICFH 0x1C /* FIQ Highest Pri Int */ 35 + 36 + /* IXP43x and IXP46x-only */ 37 + #define IXP4XX_ICPR2 0x20 /* Interrupt Status 2 */ 38 + #define IXP4XX_ICMR2 0x24 /* Interrupt Enable 2 */ 39 + #define IXP4XX_ICLR2 0x28 /* Interrupt IRQ/FIQ Select 2 */ 40 + #define IXP4XX_ICIP2 0x2C /* IRQ Status */ 41 + #define IXP4XX_ICFP2 0x30 /* FIQ Status */ 42 + #define IXP4XX_ICEEN 0x34 /* Error High Pri Enable */ 43 + 44 + /** 45 + * struct ixp4xx_irq - state container for the Faraday IRQ controller 46 + * @irqbase: IRQ controller memory base in virtual memory 47 + * @is_356: if this is an IXP43x, IXP45x or IX46x SoC (with 64 IRQs) 48 + * @irqchip: irqchip for this instance 49 + * @domain: IRQ domain for this instance 50 + */ 51 + struct ixp4xx_irq { 52 + void __iomem *irqbase; 53 + bool is_356; 54 + struct irq_chip irqchip; 55 + struct irq_domain *domain; 56 + }; 57 + 58 + /* Local static state container */ 59 + static struct ixp4xx_irq ixirq; 60 + 61 + /* GPIO Clocks */ 62 + #define IXP4XX_GPIO_CLK_0 14 63 + #define IXP4XX_GPIO_CLK_1 15 64 + 65 + static int ixp4xx_set_irq_type(struct irq_data *d, unsigned int type) 66 + { 67 + /* All are level active high (asserted) here */ 68 + if (type != IRQ_TYPE_LEVEL_HIGH) 69 + return -EINVAL; 70 + return 0; 71 + } 72 + 73 + static void ixp4xx_irq_mask(struct irq_data *d) 74 + { 75 + struct ixp4xx_irq *ixi = irq_data_get_irq_chip_data(d); 76 + u32 val; 77 + 78 + if (ixi->is_356 && d->hwirq >= 32) { 79 + val = __raw_readl(ixi->irqbase + IXP4XX_ICMR2); 80 + val &= ~BIT(d->hwirq - 32); 81 + __raw_writel(val, ixi->irqbase + IXP4XX_ICMR2); 82 + } else { 83 + val = __raw_readl(ixi->irqbase + IXP4XX_ICMR); 84 + val &= ~BIT(d->hwirq); 85 + __raw_writel(val, ixi->irqbase + IXP4XX_ICMR); 86 + } 87 + } 88 + 89 + /* 90 + * Level triggered interrupts on GPIO lines can only be cleared when the 91 + * interrupt condition disappears. 92 + */ 93 + static void ixp4xx_irq_unmask(struct irq_data *d) 94 + { 95 + struct ixp4xx_irq *ixi = irq_data_get_irq_chip_data(d); 96 + u32 val; 97 + 98 + if (ixi->is_356 && d->hwirq >= 32) { 99 + val = __raw_readl(ixi->irqbase + IXP4XX_ICMR2); 100 + val |= BIT(d->hwirq - 32); 101 + __raw_writel(val, ixi->irqbase + IXP4XX_ICMR2); 102 + } else { 103 + val = __raw_readl(ixi->irqbase + IXP4XX_ICMR); 104 + val |= BIT(d->hwirq); 105 + __raw_writel(val, ixi->irqbase + IXP4XX_ICMR); 106 + } 107 + } 108 + 109 + asmlinkage void __exception_irq_entry ixp4xx_handle_irq(struct pt_regs *regs) 110 + { 111 + struct ixp4xx_irq *ixi = &ixirq; 112 + unsigned long status; 113 + int i; 114 + 115 + status = __raw_readl(ixi->irqbase + IXP4XX_ICIP); 116 + for_each_set_bit(i, &status, 32) 117 + handle_domain_irq(ixi->domain, i, regs); 118 + 119 + /* 120 + * IXP465/IXP435 has an upper IRQ status register 121 + */ 122 + if (ixi->is_356) { 123 + status = __raw_readl(ixi->irqbase + IXP4XX_ICIP2); 124 + for_each_set_bit(i, &status, 32) 125 + handle_domain_irq(ixi->domain, i + 32, regs); 126 + } 127 + } 128 + 129 + static int ixp4xx_irq_domain_translate(struct irq_domain *domain, 130 + struct irq_fwspec *fwspec, 131 + unsigned long *hwirq, 132 + unsigned int *type) 133 + { 134 + /* We support standard DT translation */ 135 + if (is_of_node(fwspec->fwnode) && fwspec->param_count == 2) { 136 + *hwirq = fwspec->param[0]; 137 + *type = fwspec->param[1]; 138 + return 0; 139 + } 140 + 141 + if (is_fwnode_irqchip(fwspec->fwnode)) { 142 + if (fwspec->param_count != 2) 143 + return -EINVAL; 144 + *hwirq = fwspec->param[0]; 145 + *type = fwspec->param[1]; 146 + WARN_ON(*type == IRQ_TYPE_NONE); 147 + return 0; 148 + } 149 + 150 + return -EINVAL; 151 + } 152 + 153 + static int ixp4xx_irq_domain_alloc(struct irq_domain *d, 154 + unsigned int irq, unsigned int nr_irqs, 155 + void *data) 156 + { 157 + struct ixp4xx_irq *ixi = d->host_data; 158 + irq_hw_number_t hwirq; 159 + unsigned int type = IRQ_TYPE_NONE; 160 + struct irq_fwspec *fwspec = data; 161 + int ret; 162 + int i; 163 + 164 + ret = ixp4xx_irq_domain_translate(d, fwspec, &hwirq, &type); 165 + if (ret) 166 + return ret; 167 + 168 + for (i = 0; i < nr_irqs; i++) { 169 + /* 170 + * TODO: after converting IXP4xx to only device tree, set 171 + * handle_bad_irq as default handler and assume all consumers 172 + * call .set_type() as this is provided in the second cell in 173 + * the device tree phandle. 174 + */ 175 + irq_domain_set_info(d, 176 + irq + i, 177 + hwirq + i, 178 + &ixi->irqchip, 179 + ixi, 180 + handle_level_irq, 181 + NULL, NULL); 182 + irq_set_probe(irq + i); 183 + } 184 + 185 + return 0; 186 + } 187 + 188 + /* 189 + * This needs to be a hierarchical irqdomain to work well with the 190 + * GPIO irqchip (which is lower in the hierarchy) 191 + */ 192 + static const struct irq_domain_ops ixp4xx_irqdomain_ops = { 193 + .translate = ixp4xx_irq_domain_translate, 194 + .alloc = ixp4xx_irq_domain_alloc, 195 + .free = irq_domain_free_irqs_common, 196 + }; 197 + 198 + /** 199 + * ixp4xx_get_irq_domain() - retrieve the ixp4xx irq domain 200 + * 201 + * This function will go away when we transition to DT probing. 202 + */ 203 + struct irq_domain *ixp4xx_get_irq_domain(void) 204 + { 205 + struct ixp4xx_irq *ixi = &ixirq; 206 + 207 + return ixi->domain; 208 + } 209 + EXPORT_SYMBOL_GPL(ixp4xx_get_irq_domain); 210 + 211 + /* 212 + * This is the Linux IRQ to hwirq mapping table. This goes away when 213 + * we have DT support as all IRQ resources are defined in the device 214 + * tree. It will register all the IRQs that are not used by the hierarchical 215 + * GPIO IRQ chip. The "holes" inbetween these IRQs will be requested by 216 + * the GPIO driver using . This is a step-gap solution. 217 + */ 218 + struct ixp4xx_irq_chunk { 219 + int irq; 220 + int hwirq; 221 + int nr_irqs; 222 + }; 223 + 224 + static const struct ixp4xx_irq_chunk ixp4xx_irq_chunks[] = { 225 + { 226 + .irq = 16, 227 + .hwirq = 0, 228 + .nr_irqs = 6, 229 + }, 230 + { 231 + .irq = 24, 232 + .hwirq = 8, 233 + .nr_irqs = 11, 234 + }, 235 + { 236 + .irq = 46, 237 + .hwirq = 30, 238 + .nr_irqs = 2, 239 + }, 240 + /* Only on the 436 variants */ 241 + { 242 + .irq = 48, 243 + .hwirq = 32, 244 + .nr_irqs = 10, 245 + }, 246 + }; 247 + 248 + /** 249 + * ixp4x_irq_setup() - Common setup code for the IXP4xx interrupt controller 250 + * @ixi: State container 251 + * @irqbase: Virtual memory base for the interrupt controller 252 + * @fwnode: Corresponding fwnode abstraction for this controller 253 + * @is_356: if this is an IXP43x, IXP45x or IXP46x SoC variant 254 + */ 255 + static int ixp4xx_irq_setup(struct ixp4xx_irq *ixi, 256 + void __iomem *irqbase, 257 + struct fwnode_handle *fwnode, 258 + bool is_356) 259 + { 260 + int nr_irqs; 261 + 262 + ixi->irqbase = irqbase; 263 + ixi->is_356 = is_356; 264 + 265 + /* Route all sources to IRQ instead of FIQ */ 266 + __raw_writel(0x0, ixi->irqbase + IXP4XX_ICLR); 267 + 268 + /* Disable all interrupts */ 269 + __raw_writel(0x0, ixi->irqbase + IXP4XX_ICMR); 270 + 271 + if (is_356) { 272 + /* Route upper 32 sources to IRQ instead of FIQ */ 273 + __raw_writel(0x0, ixi->irqbase + IXP4XX_ICLR2); 274 + 275 + /* Disable upper 32 interrupts */ 276 + __raw_writel(0x0, ixi->irqbase + IXP4XX_ICMR2); 277 + 278 + nr_irqs = 64; 279 + } else { 280 + nr_irqs = 32; 281 + } 282 + 283 + ixi->irqchip.name = "IXP4xx"; 284 + ixi->irqchip.irq_mask = ixp4xx_irq_mask; 285 + ixi->irqchip.irq_unmask = ixp4xx_irq_unmask; 286 + ixi->irqchip.irq_set_type = ixp4xx_set_irq_type; 287 + 288 + ixi->domain = irq_domain_create_linear(fwnode, nr_irqs, 289 + &ixp4xx_irqdomain_ops, 290 + ixi); 291 + if (!ixi->domain) { 292 + pr_crit("IXP4XX: can not add primary irqdomain\n"); 293 + return -ENODEV; 294 + } 295 + 296 + set_handle_irq(ixp4xx_handle_irq); 297 + 298 + return 0; 299 + } 300 + 301 + /** 302 + * ixp4xx_irq_init() - Function to initialize the irqchip from boardfiles 303 + * @irqbase: physical base for the irq controller 304 + * @is_356: if this is an IXP43x, IXP45x or IXP46x SoC variant 305 + */ 306 + void __init ixp4xx_irq_init(resource_size_t irqbase, 307 + bool is_356) 308 + { 309 + struct ixp4xx_irq *ixi = &ixirq; 310 + void __iomem *base; 311 + struct fwnode_handle *fwnode; 312 + struct irq_fwspec fwspec; 313 + int nr_chunks; 314 + int ret; 315 + int i; 316 + 317 + base = ioremap(irqbase, 0x100); 318 + if (!base) { 319 + pr_crit("IXP4XX: could not ioremap interrupt controller\n"); 320 + return; 321 + } 322 + fwnode = irq_domain_alloc_fwnode(base); 323 + if (!fwnode) { 324 + pr_crit("IXP4XX: no domain handle\n"); 325 + return; 326 + } 327 + ret = ixp4xx_irq_setup(ixi, base, fwnode, is_356); 328 + if (ret) { 329 + pr_crit("IXP4XX: failed to set up irqchip\n"); 330 + irq_domain_free_fwnode(fwnode); 331 + } 332 + 333 + nr_chunks = ARRAY_SIZE(ixp4xx_irq_chunks); 334 + if (!is_356) 335 + nr_chunks--; 336 + 337 + /* 338 + * After adding OF support, this is no longer needed: irqs 339 + * will be allocated for the respective fwnodes. 340 + */ 341 + for (i = 0; i < nr_chunks; i++) { 342 + const struct ixp4xx_irq_chunk *chunk = &ixp4xx_irq_chunks[i]; 343 + 344 + pr_info("Allocate Linux IRQs %d..%d HW IRQs %d..%d\n", 345 + chunk->irq, chunk->irq + chunk->nr_irqs - 1, 346 + chunk->hwirq, chunk->hwirq + chunk->nr_irqs - 1); 347 + fwspec.fwnode = fwnode; 348 + fwspec.param[0] = chunk->hwirq; 349 + fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH; 350 + fwspec.param_count = 2; 351 + ret = __irq_domain_alloc_irqs(ixi->domain, 352 + chunk->irq, 353 + chunk->nr_irqs, 354 + NUMA_NO_NODE, 355 + &fwspec, 356 + false, 357 + NULL); 358 + if (ret < 0) { 359 + pr_crit("IXP4XX: can not allocate irqs in hierarchy %d\n", 360 + ret); 361 + return; 362 + } 363 + } 364 + } 365 + EXPORT_SYMBOL_GPL(ixp4xx_irq_init); 366 + 367 + #ifdef CONFIG_OF 368 + int __init ixp4xx_of_init_irq(struct device_node *np, 369 + struct device_node *parent) 370 + { 371 + struct ixp4xx_irq *ixi = &ixirq; 372 + void __iomem *base; 373 + struct fwnode_handle *fwnode; 374 + bool is_356; 375 + int ret; 376 + 377 + base = of_iomap(np, 0); 378 + if (!base) { 379 + pr_crit("IXP4XX: could not ioremap interrupt controller\n"); 380 + return -ENODEV; 381 + } 382 + fwnode = of_node_to_fwnode(np); 383 + 384 + /* These chip variants have 64 interrupts */ 385 + is_356 = of_device_is_compatible(np, "intel,ixp43x-interrupt") || 386 + of_device_is_compatible(np, "intel,ixp45x-interrupt") || 387 + of_device_is_compatible(np, "intel,ixp46x-interrupt"); 388 + 389 + ret = ixp4xx_irq_setup(ixi, base, fwnode, is_356); 390 + if (ret) 391 + pr_crit("IXP4XX: failed to set up irqchip\n"); 392 + 393 + return ret; 394 + } 395 + IRQCHIP_DECLARE(ixp42x, "intel,ixp42x-interrupt", 396 + ixp4xx_of_init_irq); 397 + IRQCHIP_DECLARE(ixp43x, "intel,ixp43x-interrupt", 398 + ixp4xx_of_init_irq); 399 + IRQCHIP_DECLARE(ixp45x, "intel,ixp45x-interrupt", 400 + ixp4xx_of_init_irq); 401 + IRQCHIP_DECLARE(ixp46x, "intel,ixp46x-interrupt", 402 + ixp4xx_of_init_irq); 403 + #endif
+1 -1
drivers/net/ethernet/cirrus/Kconfig
··· 41 41 42 42 config EP93XX_ETH 43 43 tristate "EP93xx Ethernet support" 44 - depends on ARM && ARCH_EP93XX 44 + depends on (ARM && ARCH_EP93XX) || COMPILE_TEST 45 45 select MII 46 46 help 47 47 This is a driver for the ethernet hardware included in EP93xx CPUs.
+1 -1
drivers/net/ethernet/cirrus/ep93xx_eth.c
··· 25 25 #include <linux/io.h> 26 26 #include <linux/slab.h> 27 27 28 - #include <mach/hardware.h> 28 + #include <linux/platform_data/eth-ep93xx.h> 29 29 30 30 #define DRV_MODULE_NAME "ep93xx-eth" 31 31 #define DRV_MODULE_VERSION "0.1"
+12 -2
drivers/net/ethernet/xscale/ixp4xx_eth.c
··· 31 31 #include <linux/io.h> 32 32 #include <linux/kernel.h> 33 33 #include <linux/net_tstamp.h> 34 + #include <linux/of.h> 34 35 #include <linux/phy.h> 35 36 #include <linux/platform_device.h> 36 37 #include <linux/ptp_classify.h> 37 38 #include <linux/slab.h> 38 39 #include <linux/module.h> 39 40 #include <mach/ixp46x_ts.h> 40 - #include <mach/npe.h> 41 - #include <mach/qmgr.h> 41 + #include <linux/soc/ixp4xx/npe.h> 42 + #include <linux/soc/ixp4xx/qmgr.h> 42 43 43 44 #define DEBUG_DESC 0 44 45 #define DEBUG_RX 0 ··· 1498 1497 static int __init eth_init_module(void) 1499 1498 { 1500 1499 int err; 1500 + 1501 + /* 1502 + * FIXME: we bail out on device tree boot but this really needs 1503 + * to be fixed in a nicer way: this registers the MDIO bus before 1504 + * even matching the driver infrastructure, we should only probe 1505 + * detected hardware. 1506 + */ 1507 + if (of_have_populated_dt()) 1508 + return -ENODEV; 1501 1509 if ((err = ixp4xx_mdio_register())) 1502 1510 return err; 1503 1511 return platform_driver_register(&ixp4xx_eth_driver);
+2 -2
drivers/net/wan/ixp4xx_hss.c
··· 22 22 #include <linux/platform_device.h> 23 23 #include <linux/poll.h> 24 24 #include <linux/slab.h> 25 - #include <mach/npe.h> 26 - #include <mach/qmgr.h> 25 + #include <linux/soc/ixp4xx/npe.h> 26 + #include <linux/soc/ixp4xx/qmgr.h> 27 27 28 28 #define DEBUG_DESC 0 29 29 #define DEBUG_RX 0
+1 -1
drivers/pwm/pwm-ep93xx.c
··· 35 35 36 36 #include <asm/div64.h> 37 37 38 - #include <mach/platform.h> /* for ep93xx_pwm_{acquire,release}_gpio() */ 38 + #include <linux/soc/cirrus/ep93xx.h> /* for ep93xx_pwm_{acquire,release}_gpio() */ 39 39 40 40 #define EP93XX_PWMx_TERM_COUNT 0x00 41 41 #define EP93XX_PWMx_DUTY_CYCLE 0x04
+1
drivers/soc/Kconfig
··· 6 6 source "drivers/soc/bcm/Kconfig" 7 7 source "drivers/soc/fsl/Kconfig" 8 8 source "drivers/soc/imx/Kconfig" 9 + source "drivers/soc/ixp4xx/Kconfig" 9 10 source "drivers/soc/mediatek/Kconfig" 10 11 source "drivers/soc/qcom/Kconfig" 11 12 source "drivers/soc/renesas/Kconfig"
+1
drivers/soc/Makefile
··· 11 11 obj-y += fsl/ 12 12 obj-$(CONFIG_ARCH_GEMINI) += gemini/ 13 13 obj-$(CONFIG_ARCH_MXC) += imx/ 14 + obj-$(CONFIG_ARCH_IXP4XX) += ixp4xx/ 14 15 obj-$(CONFIG_SOC_XWAY) += lantiq/ 15 16 obj-y += mediatek/ 16 17 obj-y += amlogic/
+16
drivers/soc/ixp4xx/Kconfig
··· 1 + menu "IXP4xx SoC drivers" 2 + 3 + config IXP4XX_QMGR 4 + tristate "IXP4xx Queue Manager support" 5 + help 6 + This driver supports IXP4xx built-in hardware queue manager 7 + and is automatically selected by Ethernet and HSS drivers. 8 + 9 + config IXP4XX_NPE 10 + tristate "IXP4xx Network Processor Engine support" 11 + select FW_LOADER 12 + help 13 + This driver supports IXP4xx built-in network coprocessors 14 + and is automatically selected by Ethernet and HSS drivers. 15 + 16 + endmenu
+2
drivers/soc/ixp4xx/Makefile
··· 1 + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx-qmgr.o 2 + obj-$(CONFIG_IXP4XX_NPE) += ixp4xx-npe.o
+14 -28
drivers/usb/host/ohci-da8xx.c
··· 40 40 struct phy *usb11_phy; 41 41 struct regulator *vbus_reg; 42 42 struct notifier_block nb; 43 - unsigned int reg_enabled; 44 - struct gpio_desc *vbus_gpio; 45 43 struct gpio_desc *oc_gpio; 46 44 }; 47 45 ··· 90 92 struct device *dev = hcd->self.controller; 91 93 int ret; 92 94 93 - if (da8xx_ohci->vbus_gpio) { 94 - gpiod_set_value_cansleep(da8xx_ohci->vbus_gpio, on); 95 - return 0; 96 - } 97 - 98 95 if (!da8xx_ohci->vbus_reg) 99 96 return 0; 100 97 101 - if (on && !da8xx_ohci->reg_enabled) { 98 + if (on) { 102 99 ret = regulator_enable(da8xx_ohci->vbus_reg); 103 100 if (ret) { 104 101 dev_err(dev, "Failed to enable regulator: %d\n", ret); 105 102 return ret; 106 103 } 107 - da8xx_ohci->reg_enabled = 1; 108 - 109 - } else if (!on && da8xx_ohci->reg_enabled) { 104 + } else { 110 105 ret = regulator_disable(da8xx_ohci->vbus_reg); 111 106 if (ret) { 112 107 dev_err(dev, "Failed to disable regulator: %d\n", ret); 113 108 return ret; 114 109 } 115 - da8xx_ohci->reg_enabled = 0; 116 110 } 117 111 118 112 return 0; ··· 113 123 static int ohci_da8xx_get_power(struct usb_hcd *hcd) 114 124 { 115 125 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); 116 - 117 - if (da8xx_ohci->vbus_gpio) 118 - return gpiod_get_value_cansleep(da8xx_ohci->vbus_gpio); 119 126 120 127 if (da8xx_ohci->vbus_reg) 121 128 return regulator_is_enabled(da8xx_ohci->vbus_reg); ··· 145 158 static int ohci_da8xx_has_set_power(struct usb_hcd *hcd) 146 159 { 147 160 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); 148 - 149 - if (da8xx_ohci->vbus_gpio) 150 - return 1; 151 161 152 162 if (da8xx_ohci->vbus_reg) 153 163 return 1; ··· 190 206 return 0; 191 207 } 192 208 193 - static irqreturn_t ohci_da8xx_oc_handler(int irq, void *data) 209 + static irqreturn_t ohci_da8xx_oc_thread(int irq, void *data) 194 210 { 195 211 struct da8xx_ohci_hcd *da8xx_ohci = data; 212 + struct device *dev = da8xx_ohci->hcd->self.controller; 213 + int ret; 196 214 197 - if (gpiod_get_value(da8xx_ohci->oc_gpio)) 198 - gpiod_set_value(da8xx_ohci->vbus_gpio, 0); 215 + if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio) && 216 + da8xx_ohci->vbus_reg) { 217 + ret = regulator_disable(da8xx_ohci->vbus_reg); 218 + if (ret) 219 + dev_err(dev, "Failed to disable regulator: %d\n", ret); 220 + } 199 221 200 222 return IRQ_HANDLED; 201 223 } ··· 414 424 } 415 425 } 416 426 417 - da8xx_ohci->vbus_gpio = devm_gpiod_get_optional(dev, "vbus", 418 - GPIOD_OUT_HIGH); 419 - if (IS_ERR(da8xx_ohci->vbus_gpio)) 420 - goto err; 421 - 422 427 da8xx_ohci->oc_gpio = devm_gpiod_get_optional(dev, "oc", GPIOD_IN); 423 428 if (IS_ERR(da8xx_ohci->oc_gpio)) 424 429 goto err; ··· 423 438 if (oc_irq < 0) 424 439 goto err; 425 440 426 - error = devm_request_irq(dev, oc_irq, ohci_da8xx_oc_handler, 427 - IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 441 + error = devm_request_threaded_irq(dev, oc_irq, NULL, 442 + ohci_da8xx_oc_thread, IRQF_TRIGGER_RISING | 443 + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 428 444 "OHCI over-current indicator", da8xx_ohci); 429 445 if (error) 430 446 goto err;
+9
drivers/watchdog/ixp4xx_wdt.c
··· 21 21 #include <linux/kernel.h> 22 22 #include <linux/fs.h> 23 23 #include <linux/miscdevice.h> 24 + #include <linux/of.h> 24 25 #include <linux/watchdog.h> 25 26 #include <linux/init.h> 26 27 #include <linux/bitops.h> ··· 177 176 { 178 177 int ret; 179 178 179 + /* 180 + * FIXME: we bail out on device tree boot but this really needs 181 + * to be fixed in a nicer way: this registers the MDIO bus before 182 + * even matching the driver infrastructure, we should only probe 183 + * detected hardware. 184 + */ 185 + if (of_have_populated_dt()) 186 + return -ENODEV; 180 187 if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) { 181 188 pr_err("Rev. A0 IXP42x CPU detected - watchdog disabled\n"); 182 189
+12
include/linux/irqchip/irq-ixp4xx.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __IRQ_IXP4XX_H 3 + #define __IRQ_IXP4XX_H 4 + 5 + #include <linux/ioport.h> 6 + struct irq_domain; 7 + 8 + void ixp4xx_irq_init(resource_size_t irqbase, 9 + bool is_356); 10 + struct irq_domain *ixp4xx_get_irq_domain(void); 11 + 12 + #endif /* __IRQ_IXP4XX_H */
+10
include/linux/platform_data/eth-ep93xx.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _LINUX_PLATFORM_DATA_ETH_EP93XX 3 + #define _LINUX_PLATFORM_DATA_ETH_EP93XX 4 + 5 + struct ep93xx_eth_data { 6 + unsigned char dev_addr[6]; 7 + unsigned char phy_id; 8 + }; 9 + 10 + #endif
+2 -2
include/linux/platform_data/keypad-ep93xx.h
··· 9 9 #define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */ 10 10 #define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */ 11 11 #define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */ 12 - #define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */ 13 - #define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */ 12 + #define EP93XX_KEYPAD_AUTOREPEAT (1<<4) /* enable key autorepeat */ 14 13 15 14 /** 16 15 * struct ep93xx_keypad_platform_data - platform specific device structure ··· 23 24 unsigned int debounce; 24 25 unsigned int prescale; 25 26 unsigned int flags; 27 + unsigned int clk_rate; 26 28 }; 27 29 28 30 #define EP93XX_MATRIX_ROWS (8)
+7 -2
include/linux/platform_data/ti-sysc.h
··· 46 46 s8 emufree_shift; 47 47 }; 48 48 49 - #define SYSC_QUIRK_LEGACY_IDLE BIT(8) 50 - #define SYSC_QUIRK_RESET_STATUS BIT(7) 49 + #define SYSC_QUIRK_SWSUP_MSTANDBY BIT(13) 50 + #define SYSC_QUIRK_SWSUP_SIDLE_ACT BIT(12) 51 + #define SYSC_QUIRK_SWSUP_SIDLE BIT(11) 52 + #define SYSC_QUIRK_EXT_OPT_CLOCK BIT(10) 53 + #define SYSC_QUIRK_LEGACY_IDLE BIT(9) 54 + #define SYSC_QUIRK_RESET_STATUS BIT(8) 55 + #define SYSC_QUIRK_NO_IDLE BIT(7) 51 56 #define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6) 52 57 #define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5) 53 58 #define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4)
+11
include/linux/platform_data/timer-ixp4xx.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __TIMER_IXP4XX_H 3 + #define __TIMER_IXP4XX_H 4 + 5 + #include <linux/ioport.h> 6 + 7 + void __init ixp4xx_timer_setup(resource_size_t timerbase, 8 + int timer_irq, 9 + unsigned int timer_freq); 10 + 11 + #endif
+37
include/linux/soc/cirrus/ep93xx.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _SOC_EP93XX_H 3 + #define _SOC_EP93XX_H 4 + 5 + struct platform_device; 6 + 7 + #define EP93XX_CHIP_REV_D0 3 8 + #define EP93XX_CHIP_REV_D1 4 9 + #define EP93XX_CHIP_REV_E0 5 10 + #define EP93XX_CHIP_REV_E1 6 11 + #define EP93XX_CHIP_REV_E2 7 12 + 13 + #ifdef CONFIG_ARCH_EP93XX 14 + int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); 15 + void ep93xx_pwm_release_gpio(struct platform_device *pdev); 16 + int ep93xx_ide_acquire_gpio(struct platform_device *pdev); 17 + void ep93xx_ide_release_gpio(struct platform_device *pdev); 18 + int ep93xx_keypad_acquire_gpio(struct platform_device *pdev); 19 + void ep93xx_keypad_release_gpio(struct platform_device *pdev); 20 + int ep93xx_i2s_acquire(void); 21 + void ep93xx_i2s_release(void); 22 + unsigned int ep93xx_chip_revision(void); 23 + 24 + #else 25 + static inline int ep93xx_pwm_acquire_gpio(struct platform_device *pdev) { return 0; } 26 + static inline void ep93xx_pwm_release_gpio(struct platform_device *pdev) {} 27 + static inline int ep93xx_ide_acquire_gpio(struct platform_device *pdev) { return 0; } 28 + static inline void ep93xx_ide_release_gpio(struct platform_device *pdev) {} 29 + static inline int ep93xx_keypad_acquire_gpio(struct platform_device *pdev) { return 0; } 30 + static inline void ep93xx_keypad_release_gpio(struct platform_device *pdev) {} 31 + static inline int ep93xx_i2s_acquire(void) { return 0; } 32 + static inline void ep93xx_i2s_release(void) {} 33 + static inline unsigned int ep93xx_chip_revision(void) { return 0; } 34 + 35 + #endif 36 + 37 + #endif
+91
include/linux/soc/ixp4xx/qmgr.h
··· 1 + /* 2 + * Copyright (C) 2007 Krzysztof Halasa <khc@pm.waw.pl> 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of version 2 of the GNU General Public License 6 + * as published by the Free Software Foundation. 7 + */ 8 + 9 + #ifndef IXP4XX_QMGR_H 10 + #define IXP4XX_QMGR_H 11 + 12 + #include <linux/io.h> 13 + #include <linux/kernel.h> 14 + 15 + #define DEBUG_QMGR 0 16 + 17 + #define HALF_QUEUES 32 18 + #define QUEUES 64 19 + #define MAX_QUEUE_LENGTH 4 /* in dwords */ 20 + 21 + #define QUEUE_STAT1_EMPTY 1 /* queue status bits */ 22 + #define QUEUE_STAT1_NEARLY_EMPTY 2 23 + #define QUEUE_STAT1_NEARLY_FULL 4 24 + #define QUEUE_STAT1_FULL 8 25 + #define QUEUE_STAT2_UNDERFLOW 1 26 + #define QUEUE_STAT2_OVERFLOW 2 27 + 28 + #define QUEUE_WATERMARK_0_ENTRIES 0 29 + #define QUEUE_WATERMARK_1_ENTRY 1 30 + #define QUEUE_WATERMARK_2_ENTRIES 2 31 + #define QUEUE_WATERMARK_4_ENTRIES 3 32 + #define QUEUE_WATERMARK_8_ENTRIES 4 33 + #define QUEUE_WATERMARK_16_ENTRIES 5 34 + #define QUEUE_WATERMARK_32_ENTRIES 6 35 + #define QUEUE_WATERMARK_64_ENTRIES 7 36 + 37 + /* queue interrupt request conditions */ 38 + #define QUEUE_IRQ_SRC_EMPTY 0 39 + #define QUEUE_IRQ_SRC_NEARLY_EMPTY 1 40 + #define QUEUE_IRQ_SRC_NEARLY_FULL 2 41 + #define QUEUE_IRQ_SRC_FULL 3 42 + #define QUEUE_IRQ_SRC_NOT_EMPTY 4 43 + #define QUEUE_IRQ_SRC_NOT_NEARLY_EMPTY 5 44 + #define QUEUE_IRQ_SRC_NOT_NEARLY_FULL 6 45 + #define QUEUE_IRQ_SRC_NOT_FULL 7 46 + 47 + struct qmgr_regs { 48 + u32 acc[QUEUES][MAX_QUEUE_LENGTH]; /* 0x000 - 0x3FF */ 49 + u32 stat1[4]; /* 0x400 - 0x40F */ 50 + u32 stat2[2]; /* 0x410 - 0x417 */ 51 + u32 statne_h; /* 0x418 - queue nearly empty */ 52 + u32 statf_h; /* 0x41C - queue full */ 53 + u32 irqsrc[4]; /* 0x420 - 0x42F IRC source */ 54 + u32 irqen[2]; /* 0x430 - 0x437 IRQ enabled */ 55 + u32 irqstat[2]; /* 0x438 - 0x43F - IRQ access only */ 56 + u32 reserved[1776]; 57 + u32 sram[2048]; /* 0x2000 - 0x3FFF - config and buffer */ 58 + }; 59 + 60 + void qmgr_put_entry(unsigned int queue, u32 val); 61 + u32 qmgr_get_entry(unsigned int queue); 62 + int qmgr_stat_empty(unsigned int queue); 63 + int qmgr_stat_below_low_watermark(unsigned int queue); 64 + int qmgr_stat_full(unsigned int queue); 65 + int qmgr_stat_overflow(unsigned int queue); 66 + void qmgr_release_queue(unsigned int queue); 67 + void qmgr_set_irq(unsigned int queue, int src, 68 + void (*handler)(void *pdev), void *pdev); 69 + void qmgr_enable_irq(unsigned int queue); 70 + void qmgr_disable_irq(unsigned int queue); 71 + 72 + /* request_ and release_queue() must be called from non-IRQ context */ 73 + 74 + #if DEBUG_QMGR 75 + extern char qmgr_queue_descs[QUEUES][32]; 76 + 77 + int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, 78 + unsigned int nearly_empty_watermark, 79 + unsigned int nearly_full_watermark, 80 + const char *desc_format, const char* name); 81 + #else 82 + int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, 83 + unsigned int nearly_empty_watermark, 84 + unsigned int nearly_full_watermark); 85 + #define qmgr_request_queue(queue, len, nearly_empty_watermark, \ 86 + nearly_full_watermark, desc_format, name) \ 87 + __qmgr_request_queue(queue, len, nearly_empty_watermark, \ 88 + nearly_full_watermark) 89 + #endif 90 + 91 + #endif
+1 -1
sound/soc/cirrus/edb93xx.c
··· 22 22 #include <linux/platform_device.h> 23 23 #include <linux/gpio.h> 24 24 #include <linux/module.h> 25 + #include <linux/soc/cirrus/ep93xx.h> 25 26 #include <sound/core.h> 26 27 #include <sound/pcm.h> 27 28 #include <sound/soc.h> 28 29 #include <asm/mach-types.h> 29 - #include <mach/hardware.h> 30 30 31 31 static int edb93xx_hw_params(struct snd_pcm_substream *substream, 32 32 struct snd_pcm_hw_params *params)
+1
sound/soc/cirrus/ep93xx-ac97.c
··· 24 24 #include <sound/soc.h> 25 25 26 26 #include <linux/platform_data/dma-ep93xx.h> 27 + #include <linux/soc/cirrus/ep93xx.h> 27 28 28 29 #include "ep93xx-pcm.h" 29 30
+1 -2
sound/soc/cirrus/ep93xx-i2s.c
··· 27 27 #include <sound/initval.h> 28 28 #include <sound/soc.h> 29 29 30 - #include <mach/hardware.h> 31 - #include <mach/ep93xx-regs.h> 32 30 #include <linux/platform_data/dma-ep93xx.h> 31 + #include <linux/soc/cirrus/ep93xx.h> 33 32 34 33 #include "ep93xx-pcm.h" 35 34
+1 -1
sound/soc/cirrus/simone.c
··· 13 13 #include <linux/init.h> 14 14 #include <linux/module.h> 15 15 #include <linux/platform_device.h> 16 + #include <linux/soc/cirrus/ep93xx.h> 16 17 17 18 #include <sound/core.h> 18 19 #include <sound/pcm.h> 19 20 #include <sound/soc.h> 20 21 21 22 #include <asm/mach-types.h> 22 - #include <mach/hardware.h> 23 23 24 24 static struct snd_soc_dai_link simone_dai = { 25 25 .name = "AC97",
+1 -1
sound/soc/cirrus/snappercl15.c
··· 13 13 14 14 #include <linux/platform_device.h> 15 15 #include <linux/module.h> 16 + #include <linux/soc/cirrus/ep93xx.h> 16 17 #include <sound/core.h> 17 18 #include <sound/pcm.h> 18 19 #include <sound/soc.h> 19 20 20 21 #include <asm/mach-types.h> 21 - #include <mach/hardware.h> 22 22 23 23 #include "../codecs/tlv320aic23.h" 24 24