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

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

Pull ARM SoC driver specific changes from Arnd Bergmann:
"These changes are all driver specific and cross over between arm-soc
contents and some other subsystem, in these cases cpufreq, crypto,
dma, pinctrl, mailbox and usb, and the subsystem owners agreed to have
these changes merged through arm-soc.

As we proceed to untangle the dependencies between platform code and
driver code, the amount of changes in this category is fortunately
shrinking, for 3.11 we have 16 branches here and 101 non-merge
changesets, the majority of which are for the stedma40 dma engine
driver used in the ux500 platform. Cleaning up that code touches
multiple subsystems, but gets rid of the dependency in the end.

The mailbox code moved out from mach-omap2 to drivers/mailbox is an
intermediate step and is still omap specific at the moment. Patches
exist to generalize the subsystem and add other drivers with the same
API, but those did not make it for 3.11."

* tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (101 commits)
crypto: ux500: use dmaengine_submit API
crypto: ux500: use dmaengine_prep_slave_sg API
crypto: ux500: use dmaengine_device_control API
crypto: ux500/crypt: add missing __iomem qualifiers
crypto: ux500/hash: add missing static qualifiers
crypto: ux500/hash: use readl on iomem addresses
dmaengine: ste_dma40: Declare memcpy config as static
ARM: ux500: Remove mop500_snowball_ethernet_clock_enable()
ARM: ux500: Correct the EN_3v3 regulator's on/off GPIO
ARM: ux500: Provide a AB8500 GPIO Device Tree node
gpio: rcar: fix gpio_rcar_of_table
gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections
gpio-rcar: Reference core gpio documentation in the DT bindings
clk: exynos5250: Add enum entries for divider clock of i2s1 and i2s2
ARM: dts: Update Samsung I2S documentation
ARM: dts: add clock provider information for i2s controllers in Exynos5250
ARM: dts: add Exynos audio subsystem clock controller node
clk: samsung: register audio subsystem clocks using common clock framework
ARM: dts: use #include for all device trees for Samsung
pinctrl: s3c24xx: use correct header for chained_irq functions
...

+3167 -1650
-1
Documentation/devicetree/bindings/bus/ti-gpmc.txt
··· 95 95 - gpmc,burst-wrap Enables wrap bursting 96 96 - gpmc,burst-read Enables read page/burst mode 97 97 - gpmc,burst-write Enables write page/burst mode 98 - - gpmc,device-nand Device is NAND 99 98 - gpmc,device-width Total width of device(s) connected to a GPMC 100 99 chip-select in bytes. The GPMC supports 8-bit 101 100 and 16-bit devices and so this property must be
+64
Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
··· 1 + * Samsung Audio Subsystem Clock Controller 2 + 3 + The Samsung Audio Subsystem clock controller generates and supplies clocks 4 + to Audio Subsystem block available in the S5PV210 and Exynos SoCs. The clock 5 + binding described here is applicable to all SoC's in Exynos family. 6 + 7 + Required Properties: 8 + 9 + - compatible: should be one of the following: 10 + - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs. 11 + - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs. 12 + 13 + - reg: physical base address and length of the controller's register set. 14 + 15 + - #clock-cells: should be 1. 16 + 17 + The following is the list of clocks generated by the controller. Each clock is 18 + assigned an identifier and client nodes use this identifier to specify the 19 + clock which they consume. Some of the clocks are available only on a particular 20 + Exynos4 SoC and this is specified where applicable. 21 + 22 + Provided clocks: 23 + 24 + Clock ID SoC (if specific) 25 + ----------------------------------------------- 26 + 27 + mout_audss 0 28 + mout_i2s 1 29 + dout_srp 2 30 + dout_aud_bus 3 31 + dout_i2s 4 32 + srp_clk 5 33 + i2s_bus 6 34 + sclk_i2s 7 35 + pcm_bus 8 36 + sclk_pcm 9 37 + 38 + Example 1: An example of a clock controller node is listed below. 39 + 40 + clock_audss: audss-clock-controller@3810000 { 41 + compatible = "samsung,exynos5250-audss-clock"; 42 + reg = <0x03810000 0x0C>; 43 + #clock-cells = <1>; 44 + }; 45 + 46 + Example 2: I2S controller node that consumes the clock generated by the clock 47 + controller. Refer to the standard clock bindings for information 48 + about 'clocks' and 'clock-names' property. 49 + 50 + i2s0: i2s@03830000 { 51 + compatible = "samsung,i2s-v5"; 52 + reg = <0x03830000 0x100>; 53 + dmas = <&pdma0 10 54 + &pdma0 9 55 + &pdma0 8>; 56 + dma-names = "tx", "rx", "tx-sec"; 57 + clocks = <&clock_audss EXYNOS_I2S_BUS>, 58 + <&clock_audss EXYNOS_I2S_BUS>, 59 + <&clock_audss EXYNOS_SCLK_I2S>, 60 + <&clock_audss EXYNOS_MOUT_AUDSS>, 61 + <&clock_audss EXYNOS_MOUT_I2S>; 62 + clock-names = "iis", "i2s_opclk0", "i2s_opclk1", 63 + "mout_audss", "mout_i2s"; 64 + };
+66
Documentation/devicetree/bindings/dma/ste-dma40.txt
··· 1 + * DMA40 DMA Controller 2 + 3 + Required properties: 4 + - compatible: "stericsson,dma40" 5 + - reg: Address range of the DMAC registers 6 + - reg-names: Names of the above areas to use during resource look-up 7 + - interrupt: Should contain the DMAC interrupt number 8 + - #dma-cells: must be <3> 9 + - memcpy-channels: Channels to be used for memcpy 10 + 11 + Optional properties: 12 + - dma-channels: Number of channels supported by hardware - if not present 13 + the driver will attempt to obtain the information from H/W 14 + - disabled-channels: Channels which can not be used 15 + 16 + Example: 17 + 18 + dma: dma-controller@801C0000 { 19 + compatible = "stericsson,db8500-dma40", "stericsson,dma40"; 20 + reg = <0x801C0000 0x1000 0x40010000 0x800>; 21 + reg-names = "base", "lcpa"; 22 + interrupt-parent = <&intc>; 23 + interrupts = <0 25 0x4>; 24 + 25 + #dma-cells = <2>; 26 + memcpy-channels = <56 57 58 59 60>; 27 + disabled-channels = <12>; 28 + dma-channels = <8>; 29 + }; 30 + 31 + Clients 32 + Required properties: 33 + - dmas: Comma separated list of dma channel requests 34 + - dma-names: Names of the aforementioned requested channels 35 + 36 + Each dmas request consists of 4 cells: 37 + 1. A phandle pointing to the DMA controller 38 + 2. Device Type 39 + 3. The DMA request line number (only when 'use fixed channel' is set) 40 + 4. A 32bit mask specifying; mode, direction and endianess [NB: This list will grow] 41 + 0x00000001: Mode: 42 + Logical channel when unset 43 + Physical channel when set 44 + 0x00000002: Direction: 45 + Memory to Device when unset 46 + Device to Memory when set 47 + 0x00000004: Endianess: 48 + Little endian when unset 49 + Big endian when set 50 + 0x00000008: Use fixed channel: 51 + Use automatic channel selection when unset 52 + Use DMA request line number when set 53 + 54 + Example: 55 + 56 + uart@80120000 { 57 + compatible = "arm,pl011", "arm,primecell"; 58 + reg = <0x80120000 0x1000>; 59 + interrupts = <0 11 0x4>; 60 + 61 + dmas = <&dma 13 0 0x2>, /* Logical - DevToMem */ 62 + <&dma 13 0 0x0>; /* Logical - MemToDev */ 63 + dma-names = "rx", "rx"; 64 + 65 + status = "disabled"; 66 + };
-43
Documentation/devicetree/bindings/gpio/gpio-samsung.txt
··· 39 39 #gpio-cells = <4>; 40 40 gpio-controller; 41 41 }; 42 - 43 - 44 - Samsung S3C24XX GPIO Controller 45 - 46 - Required properties: 47 - - compatible: Compatible property value should be "samsung,s3c24xx-gpio". 48 - 49 - - reg: Physical base address of the controller and length of memory mapped 50 - region. 51 - 52 - - #gpio-cells: Should be 3. The syntax of the gpio specifier used by client nodes 53 - should be the following with values derived from the SoC user manual. 54 - <[phandle of the gpio controller node] 55 - [pin number within the gpio controller] 56 - [mux function] 57 - [flags and pull up/down] 58 - 59 - Values for gpio specifier: 60 - - Pin number: depending on the controller a number from 0 up to 15. 61 - - Mux function: Depending on the SoC and the gpio bank the gpio can be set 62 - as input, output or a special function 63 - - Flags and Pull Up/Down: the values to use differ for the individual SoCs 64 - example S3C2416/S3C2450: 65 - 0 - Pull Up/Down Disabled. 66 - 1 - Pull Down Enabled. 67 - 2 - Pull Up Enabled. 68 - Bit 16 (0x00010000) - Input is active low. 69 - Consult the user manual for the correct values of Mux and Pull Up/Down. 70 - 71 - - gpio-controller: Specifies that the node is a gpio controller. 72 - - #address-cells: should be 1. 73 - - #size-cells: should be 1. 74 - 75 - Example: 76 - 77 - gpa: gpio-controller@56000000 { 78 - #address-cells = <1>; 79 - #size-cells = <1>; 80 - compatible = "samsung,s3c24xx-gpio"; 81 - reg = <0x56000000 0x10>; 82 - #gpio-cells = <3>; 83 - gpio-controller; 84 - };
+46
Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
··· 1 + * Renesas R-Car GPIO Controller 2 + 3 + Required Properties: 4 + 5 + - compatible: should be one of the following. 6 + - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller. 7 + - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller. 8 + - "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO controller. 9 + - "renesas,gpio-rcar": for generic R-Car GPIO controller. 10 + 11 + - reg: Base address and length of each memory resource used by the GPIO 12 + controller hardware module. 13 + 14 + - interrupt-parent: phandle of the parent interrupt controller. 15 + - interrupts: Interrupt specifier for the controllers interrupt. 16 + 17 + - gpio-controller: Marks the device node as a gpio controller. 18 + - #gpio-cells: Should be 2. The first cell is the GPIO number and the second 19 + cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the 20 + GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported. 21 + - gpio-ranges: Range of pins managed by the GPIO controller. 22 + 23 + Please refer to gpio.txt in this directory for details of gpio-ranges property 24 + and the common GPIO bindings used by client devices. 25 + 26 + Example: R8A7779 (R-Car H1) GPIO controller nodes 27 + 28 + gpio0: gpio@ffc40000 { 29 + compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar"; 30 + reg = <0xffc40000 0x2c>; 31 + interrupt-parent = <&gic>; 32 + interrupts = <0 141 0x4>; 33 + #gpio-cells = <2>; 34 + gpio-controller; 35 + gpio-ranges = <&pfc 0 0 32>; 36 + }; 37 + ... 38 + gpio6: gpio@ffc46000 { 39 + compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar"; 40 + reg = <0xffc46000 0x2c>; 41 + interrupt-parent = <&gic>; 42 + interrupts = <0 147 0x4>; 43 + #gpio-cells = <2>; 44 + gpio-controller; 45 + gpio-ranges = <&pfc 0 192 9>; 46 + };
+8
Documentation/devicetree/bindings/mtd/gpmc-nand.txt
··· 29 29 "bch4" 4-bit BCH ecc code 30 30 "bch8" 8-bit BCH ecc code 31 31 32 + - ti,nand-xfer-type: A string setting the data transfer type. One of: 33 + 34 + "prefetch-polled" Prefetch polled mode (default) 35 + "polled" Polled mode, without prefetch 36 + "prefetch-dma" Prefetch enabled sDMA mode 37 + "prefetch-irq" Prefetch enabled irq mode 38 + 32 39 - elm_id: Specifies elm device node. This is required to support BCH 33 40 error correction using ELM module. 34 41 ··· 62 55 reg = <0 0 0>; /* CS0, offset 0 */ 63 56 nand-bus-width = <16>; 64 57 ti,nand-ecc-opt = "bch8"; 58 + ti,nand-xfer-type = "polled"; 65 59 66 60 gpmc,sync-clk-ps = <0>; 67 61 gpmc,cs-on-ns = <0>;
+8
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
··· 7 7 8 8 Required Properties: 9 9 - compatible: should be one of the following. 10 + - "samsung,s3c2412-pinctrl": for S3C2412-compatible pin-controller, 11 + - "samsung,s3c2416-pinctrl": for S3C2416-compatible pin-controller, 12 + - "samsung,s3c2440-pinctrl": for S3C2440-compatible pin-controller, 13 + - "samsung,s3c2450-pinctrl": for S3C2450-compatible pin-controller, 10 14 - "samsung,s3c64xx-pinctrl": for S3C64xx-compatible pin-controller, 11 15 - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller. 12 16 - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller. ··· 120 116 121 117 - compatible: identifies the type of the external wakeup interrupt controller 122 118 The possible values are: 119 + - samsung,s3c2410-wakeup-eint: represents wakeup interrupt controller 120 + found on Samsung S3C24xx SoCs except S3C2412 and S3C2413, 121 + - samsung,s3c2412-wakeup-eint: represents wakeup interrupt controller 122 + found on Samsung S3C2412 and S3C2413 SoCs, 123 123 - samsung,s3c64xx-wakeup-eint: represents wakeup interrupt controller 124 124 found on Samsung S3C64xx SoCs, 125 125 - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller
+19 -27
Documentation/devicetree/bindings/sound/samsung-i2s.txt
··· 8 8 - dmas: list of DMA controller phandle and DMA request line ordered pairs. 9 9 - dma-names: identifier string for each DMA request line in the dmas property. 10 10 These strings correspond 1:1 with the ordered pairs in dmas. 11 + - clocks: Handle to iis clock and RCLK source clk. 12 + - clock-names: 13 + i2s0 uses some base clks from CMU and some are from audio subsystem internal 14 + clock controller. The clock names for i2s0 should be "iis", "i2s_opclk0" and 15 + "i2s_opclk1" as shown in the example below. 16 + i2s1 and i2s2 uses clocks from CMU. The clock names for i2s1 and i2s2 should 17 + be "iis" and "i2s_opclk0". 18 + "iis" is the i2s bus clock and i2s_opclk0, i2s_opclk1 are sources of the root 19 + clk. i2s0 has internal mux to select the source of root clk and i2s1 and i2s2 20 + doesn't have any such mux. 11 21 12 22 Optional SoC Specific Properties: 13 23 ··· 30 20 then this flag is enabled. 31 21 - samsung,idma-addr: Internal DMA register base address of the audio 32 22 sub system(used in secondary sound source). 33 - 34 - Required Board Specific Properties: 35 - 36 - - gpios: The gpio specifier for data out,data in, LRCLK, CDCLK and SCLK 37 - interface lines. The format of the gpio specifier depends on the gpio 38 - controller. 39 - The syntax of samsung gpio specifier is 40 - <[phandle of the gpio controller node] 41 - [pin number within the gpio controller] 42 - [mux function] 43 - [flags and pull up/down] 44 - [drive strength]> 23 + - pinctrl-0: Should specify pin control groups used for this controller. 24 + - pinctrl-names: Should contain only one value - "default". 45 25 46 26 Example: 47 27 48 - - SoC Specific Portion: 49 - 50 - i2s@03830000 { 28 + i2s0: i2s@03830000 { 51 29 compatible = "samsung,i2s-v5"; 52 30 reg = <0x03830000 0x100>; 53 31 dmas = <&pdma0 10 54 32 &pdma0 9 55 33 &pdma0 8>; 56 34 dma-names = "tx", "rx", "tx-sec"; 35 + clocks = <&clock_audss EXYNOS_I2S_BUS>, 36 + <&clock_audss EXYNOS_I2S_BUS>, 37 + <&clock_audss EXYNOS_SCLK_I2S>; 38 + clock-names = "iis", "i2s_opclk0", "i2s_opclk1"; 57 39 samsung,supports-6ch; 58 40 samsung,supports-rstclr; 59 41 samsung,supports-secdai; 60 42 samsung,idma-addr = <0x03000000>; 61 - }; 62 - 63 - - Board Specific Portion: 64 - 65 - i2s@03830000 { 66 - gpios = <&gpz 0 2 0 0>, /* I2S_0_SCLK */ 67 - <&gpz 1 2 0 0>, /* I2S_0_CDCLK */ 68 - <&gpz 2 2 0 0>, /* I2S_0_LRCK */ 69 - <&gpz 3 2 0 0>, /* I2S_0_SDI */ 70 - <&gpz 4 2 0 0>, /* I2S_0_SDO[1] */ 71 - <&gpz 5 2 0 0>, /* I2S_0_SDO[2] */ 72 - <&gpz 6 2 0 0>; /* I2S_0_SDO[3] */ 43 + pinctrl-names = "default"; 44 + pinctrl-0 = <&i2s0_bus>; 73 45 };
+82
Documentation/devicetree/bindings/usb/atmel-usb.txt
··· 47 47 interrupts = <10 4>; 48 48 atmel,vbus-gpio = <&pioC 5 0>; 49 49 }; 50 + 51 + Atmel High-Speed USB device controller 52 + 53 + Required properties: 54 + - compatible: Should be "atmel,at91sam9rl-udc" 55 + - reg: Address and length of the register set for the device 56 + - interrupts: Should contain usba interrupt 57 + - ep childnode: To specify the number of endpoints and their properties. 58 + 59 + Optional properties: 60 + - atmel,vbus-gpio: If present, specifies a gpio that needs to be 61 + activated for the bus to be powered. 62 + 63 + Required child node properties: 64 + - name: Name of the endpoint. 65 + - reg: Num of the endpoint. 66 + - atmel,fifo-size: Size of the fifo. 67 + - atmel,nb-banks: Number of banks. 68 + - atmel,can-dma: Boolean to specify if the endpoint support DMA. 69 + - atmel,can-isoc: Boolean to specify if the endpoint support ISOC. 70 + 71 + usb2: gadget@fff78000 { 72 + #address-cells = <1>; 73 + #size-cells = <0>; 74 + compatible = "atmel,at91sam9rl-udc"; 75 + reg = <0x00600000 0x80000 76 + 0xfff78000 0x400>; 77 + interrupts = <27 4 0>; 78 + atmel,vbus-gpio = <&pioB 19 0>; 79 + 80 + ep0 { 81 + reg = <0>; 82 + atmel,fifo-size = <64>; 83 + atmel,nb-banks = <1>; 84 + }; 85 + 86 + ep1 { 87 + reg = <1>; 88 + atmel,fifo-size = <1024>; 89 + atmel,nb-banks = <2>; 90 + atmel,can-dma; 91 + atmel,can-isoc; 92 + }; 93 + 94 + ep2 { 95 + reg = <2>; 96 + atmel,fifo-size = <1024>; 97 + atmel,nb-banks = <2>; 98 + atmel,can-dma; 99 + atmel,can-isoc; 100 + }; 101 + 102 + ep3 { 103 + reg = <3>; 104 + atmel,fifo-size = <1024>; 105 + atmel,nb-banks = <3>; 106 + atmel,can-dma; 107 + }; 108 + 109 + ep4 { 110 + reg = <4>; 111 + atmel,fifo-size = <1024>; 112 + atmel,nb-banks = <3>; 113 + atmel,can-dma; 114 + }; 115 + 116 + ep5 { 117 + reg = <5>; 118 + atmel,fifo-size = <1024>; 119 + atmel,nb-banks = <3>; 120 + atmel,can-dma; 121 + atmel,can-isoc; 122 + }; 123 + 124 + ep6 { 125 + reg = <6>; 126 + atmel,fifo-size = <1024>; 127 + atmel,nb-banks = <3>; 128 + atmel,can-dma; 129 + atmel,can-isoc; 130 + }; 131 + };
+50
Documentation/devicetree/bindings/usb/ux500-usb.txt
··· 1 + Ux500 MUSB 2 + 3 + Required properties: 4 + - compatible : Should be "stericsson,db8500-musb" 5 + - reg : Offset and length of registers 6 + - interrupts : Interrupt; mode, number and trigger 7 + - dr_mode : Dual-role; either host mode "host", peripheral mode "peripheral" 8 + or both "otg" 9 + 10 + Optional properties: 11 + - dmas : A list of dma channels; 12 + dma-controller, event-line, fixed-channel, flags 13 + - dma-names : An ordered list of channel names affiliated to the above 14 + 15 + Example: 16 + 17 + usb_per5@a03e0000 { 18 + compatible = "stericsson,db8500-musb", "mentor,musb"; 19 + reg = <0xa03e0000 0x10000>; 20 + interrupts = <0 23 0x4>; 21 + interrupt-names = "mc"; 22 + 23 + dr_mode = "otg"; 24 + 25 + dmas = <&dma 38 0 0x2>, /* Logical - DevToMem */ 26 + <&dma 38 0 0x0>, /* Logical - MemToDev */ 27 + <&dma 37 0 0x2>, /* Logical - DevToMem */ 28 + <&dma 37 0 0x0>, /* Logical - MemToDev */ 29 + <&dma 36 0 0x2>, /* Logical - DevToMem */ 30 + <&dma 36 0 0x0>, /* Logical - MemToDev */ 31 + <&dma 19 0 0x2>, /* Logical - DevToMem */ 32 + <&dma 19 0 0x0>, /* Logical - MemToDev */ 33 + <&dma 18 0 0x2>, /* Logical - DevToMem */ 34 + <&dma 18 0 0x0>, /* Logical - MemToDev */ 35 + <&dma 17 0 0x2>, /* Logical - DevToMem */ 36 + <&dma 17 0 0x0>, /* Logical - MemToDev */ 37 + <&dma 16 0 0x2>, /* Logical - DevToMem */ 38 + <&dma 16 0 0x0>, /* Logical - MemToDev */ 39 + <&dma 39 0 0x2>, /* Logical - DevToMem */ 40 + <&dma 39 0 0x0>; /* Logical - MemToDev */ 41 + 42 + dma-names = "iep_1_9", "oep_1_9", 43 + "iep_2_10", "oep_2_10", 44 + "iep_3_11", "oep_3_11", 45 + "iep_4_12", "oep_4_12", 46 + "iep_5_13", "oep_5_13", 47 + "iep_6_14", "oep_6_14", 48 + "iep_7_15", "oep_7_15", 49 + "iep_8", "oep_8"; 50 + };
-47
arch/arm/Kconfig
··· 2087 2087 2088 2088 if ARCH_HAS_CPUFREQ 2089 2089 source "drivers/cpufreq/Kconfig" 2090 - 2091 - config CPU_FREQ_S3C 2092 - bool 2093 - help 2094 - Internal configuration node for common cpufreq on Samsung SoC 2095 - 2096 - config CPU_FREQ_S3C24XX 2097 - bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)" 2098 - depends on ARCH_S3C24XX && CPU_FREQ 2099 - select CPU_FREQ_S3C 2100 - help 2101 - This enables the CPUfreq driver for the Samsung S3C24XX family 2102 - of CPUs. 2103 - 2104 - For details, take a look at <file:Documentation/cpu-freq>. 2105 - 2106 - If in doubt, say N. 2107 - 2108 - config CPU_FREQ_S3C24XX_PLL 2109 - bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" 2110 - depends on CPU_FREQ_S3C24XX 2111 - help 2112 - Compile in support for changing the PLL frequency from the 2113 - S3C24XX series CPUfreq driver. The PLL takes time to settle 2114 - after a frequency change, so by default it is not enabled. 2115 - 2116 - This also means that the PLL tables for the selected CPU(s) will 2117 - be built which may increase the size of the kernel image. 2118 - 2119 - config CPU_FREQ_S3C24XX_DEBUG 2120 - bool "Debug CPUfreq Samsung driver core" 2121 - depends on CPU_FREQ_S3C24XX 2122 - help 2123 - Enable s3c_freq_dbg for the Samsung S3C CPUfreq core 2124 - 2125 - config CPU_FREQ_S3C24XX_IODEBUG 2126 - bool "Debug CPUfreq Samsung driver IO timing" 2127 - depends on CPU_FREQ_S3C24XX 2128 - help 2129 - Enable s3c_freq_iodbg for the Samsung S3C CPUfreq core 2130 - 2131 - config CPU_FREQ_S3C24XX_DEBUGFS 2132 - bool "Export debugfs for CPUFreq" 2133 - depends on CPU_FREQ_S3C24XX && DEBUG_FS 2134 - help 2135 - Export status information via debugfs. 2136 - 2137 2090 endif 2138 2091 2139 2092 source "drivers/cpuidle/Kconfig"
+5
arch/arm/boot/dts/dbx5x0.dtsi
··· 360 360 interrupt-controller; 361 361 #interrupt-cells = <2>; 362 362 363 + ab8500_gpio: ab8500-gpio { 364 + gpio-controller; 365 + #gpio-cells = <2>; 366 + }; 367 + 363 368 ab8500-rtc { 364 369 compatible = "stericsson,ab8500-rtc"; 365 370 interrupts = <17 IRQ_TYPE_LEVEL_HIGH
+1 -1
arch/arm/boot/dts/exynos4.dtsi
··· 19 19 * published by the Free Software Foundation. 20 20 */ 21 21 22 - /include/ "skeleton.dtsi" 22 + #include "skeleton.dtsi" 23 23 24 24 / { 25 25 interrupt-parent = <&gic>;
+1 -1
arch/arm/boot/dts/exynos4210-origen.dts
··· 15 15 */ 16 16 17 17 /dts-v1/; 18 - /include/ "exynos4210.dtsi" 18 + #include "exynos4210.dtsi" 19 19 20 20 / { 21 21 model = "Insignal Origen evaluation board based on Exynos4210";
+1 -1
arch/arm/boot/dts/exynos4210-smdkv310.dts
··· 15 15 */ 16 16 17 17 /dts-v1/; 18 - /include/ "exynos4210.dtsi" 18 + #include "exynos4210.dtsi" 19 19 20 20 / { 21 21 model = "Samsung smdkv310 evaluation board based on Exynos4210";
+1 -1
arch/arm/boot/dts/exynos4210-trats.dts
··· 13 13 */ 14 14 15 15 /dts-v1/; 16 - /include/ "exynos4210.dtsi" 16 + #include "exynos4210.dtsi" 17 17 18 18 / { 19 19 model = "Samsung Trats based on Exynos4210";
+1 -1
arch/arm/boot/dts/exynos4210-universal_c210.dts
··· 13 13 */ 14 14 15 15 /dts-v1/; 16 - /include/ "exynos4210.dtsi" 16 + #include "exynos4210.dtsi" 17 17 18 18 / { 19 19 model = "Samsung Universal C210 based on Exynos4210 rev0";
+2 -2
arch/arm/boot/dts/exynos4210.dtsi
··· 19 19 * published by the Free Software Foundation. 20 20 */ 21 21 22 - /include/ "exynos4.dtsi" 23 - /include/ "exynos4210-pinctrl.dtsi" 22 + #include "exynos4.dtsi" 23 + #include "exynos4210-pinctrl.dtsi" 24 24 25 25 / { 26 26 compatible = "samsung,exynos4210";
+1 -1
arch/arm/boot/dts/exynos4212.dtsi
··· 17 17 * published by the Free Software Foundation. 18 18 */ 19 19 20 - /include/ "exynos4x12.dtsi" 20 + #include "exynos4x12.dtsi" 21 21 22 22 / { 23 23 compatible = "samsung,exynos4212";
+1 -1
arch/arm/boot/dts/exynos4412-odroidx.dts
··· 12 12 */ 13 13 14 14 /dts-v1/; 15 - /include/ "exynos4412.dtsi" 15 + #include "exynos4412.dtsi" 16 16 17 17 / { 18 18 model = "Hardkernel ODROID-X board based on Exynos4412";
+1 -1
arch/arm/boot/dts/exynos4412-origen.dts
··· 13 13 */ 14 14 15 15 /dts-v1/; 16 - /include/ "exynos4412.dtsi" 16 + #include "exynos4412.dtsi" 17 17 18 18 / { 19 19 model = "Insignal Origen evaluation board based on Exynos4412";
+1 -1
arch/arm/boot/dts/exynos4412-smdk4412.dts
··· 13 13 */ 14 14 15 15 /dts-v1/; 16 - /include/ "exynos4412.dtsi" 16 + #include "exynos4412.dtsi" 17 17 18 18 / { 19 19 model = "Samsung SMDK evaluation board based on Exynos4412";
+1 -1
arch/arm/boot/dts/exynos4412.dtsi
··· 17 17 * published by the Free Software Foundation. 18 18 */ 19 19 20 - /include/ "exynos4x12.dtsi" 20 + #include "exynos4x12.dtsi" 21 21 22 22 / { 23 23 compatible = "samsung,exynos4412";
+2 -2
arch/arm/boot/dts/exynos4x12.dtsi
··· 17 17 * published by the Free Software Foundation. 18 18 */ 19 19 20 - /include/ "exynos4.dtsi" 21 - /include/ "exynos4x12-pinctrl.dtsi" 20 + #include "exynos4.dtsi" 21 + #include "exynos4x12-pinctrl.dtsi" 22 22 23 23 / { 24 24 aliases {
+1 -1
arch/arm/boot/dts/exynos5250-arndale.dts
··· 10 10 */ 11 11 12 12 /dts-v1/; 13 - /include/ "exynos5250.dtsi" 13 + #include "exynos5250.dtsi" 14 14 15 15 / { 16 16 model = "Insignal Arndale evaluation board based on EXYNOS5250";
+1 -1
arch/arm/boot/dts/exynos5250-smdk5250.dts
··· 10 10 */ 11 11 12 12 /dts-v1/; 13 - /include/ "exynos5250.dtsi" 13 + #include "exynos5250.dtsi" 14 14 15 15 / { 16 16 model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
+2 -2
arch/arm/boot/dts/exynos5250-snow.dts
··· 9 9 */ 10 10 11 11 /dts-v1/; 12 - /include/ "exynos5250.dtsi" 13 - /include/ "cros5250-common.dtsi" 12 + #include "exynos5250.dtsi" 13 + #include "cros5250-common.dtsi" 14 14 15 15 / { 16 16 model = "Google Snow";
+18 -2
arch/arm/boot/dts/exynos5250.dtsi
··· 17 17 * published by the Free Software Foundation. 18 18 */ 19 19 20 - /include/ "skeleton.dtsi" 21 - /include/ "exynos5250-pinctrl.dtsi" 20 + #include "skeleton.dtsi" 21 + #include "exynos5250-pinctrl.dtsi" 22 + 23 + #include <dt-bindings/clk/exynos-audss-clk.h> 22 24 23 25 / { 24 26 compatible = "samsung,exynos5250"; ··· 71 69 clock: clock-controller@0x10010000 { 72 70 compatible = "samsung,exynos5250-clock"; 73 71 reg = <0x10010000 0x30000>; 72 + #clock-cells = <1>; 73 + }; 74 + 75 + clock_audss: audss-clock-controller@3810000 { 76 + compatible = "samsung,exynos5250-audss-clock"; 77 + reg = <0x03810000 0x0C>; 74 78 #clock-cells = <1>; 75 79 }; 76 80 ··· 459 451 &pdma0 9 460 452 &pdma0 8>; 461 453 dma-names = "tx", "rx", "tx-sec"; 454 + clocks = <&clock_audss EXYNOS_I2S_BUS>, 455 + <&clock_audss EXYNOS_I2S_BUS>, 456 + <&clock_audss EXYNOS_SCLK_I2S>; 457 + clock-names = "iis", "i2s_opclk0", "i2s_opclk1"; 462 458 samsung,supports-6ch; 463 459 samsung,supports-rstclr; 464 460 samsung,supports-secdai; ··· 477 465 dmas = <&pdma1 12 478 466 &pdma1 11>; 479 467 dma-names = "tx", "rx"; 468 + clocks = <&clock 307>, <&clock 157>; 469 + clock-names = "iis", "i2s_opclk0"; 480 470 pinctrl-names = "default"; 481 471 pinctrl-0 = <&i2s1_bus>; 482 472 }; ··· 489 475 dmas = <&pdma0 12 490 476 &pdma0 11>; 491 477 dma-names = "tx", "rx"; 478 + clocks = <&clock 308>, <&clock 158>; 479 + clock-names = "iis", "i2s_opclk0"; 492 480 pinctrl-names = "default"; 493 481 pinctrl-0 = <&i2s2_bus>; 494 482 };
+1 -1
arch/arm/boot/dts/exynos5440-sd5v1.dts
··· 10 10 */ 11 11 12 12 /dts-v1/; 13 - /include/ "exynos5440.dtsi" 13 + #include "exynos5440.dtsi" 14 14 15 15 / { 16 16 model = "SAMSUNG SD5v1 board based on EXYNOS5440";
+1 -1
arch/arm/boot/dts/exynos5440-ssdk5440.dts
··· 10 10 */ 11 11 12 12 /dts-v1/; 13 - /include/ "exynos5440.dtsi" 13 + #include "exynos5440.dtsi" 14 14 15 15 / { 16 16 model = "SAMSUNG SSDK5440 board based on EXYNOS5440";
+1 -1
arch/arm/boot/dts/exynos5440.dtsi
··· 9 9 * published by the Free Software Foundation. 10 10 */ 11 11 12 - /include/ "skeleton.dtsi" 12 + #include "skeleton.dtsi" 13 13 14 14 / { 15 15 compatible = "samsung,exynos5440";
-1
arch/arm/boot/dts/omap3430-sdp.dts
··· 106 106 nand-bus-width = <8>; 107 107 108 108 ti,nand-ecc-opt = "sw"; 109 - gpmc,device-nand; 110 109 gpmc,cs-on-ns = <0>; 111 110 gpmc,cs-rd-off-ns = <36>; 112 111 gpmc,cs-wr-off-ns = <36>;
+1 -1
arch/arm/boot/dts/s3c2416-smdk2416.dts
··· 9 9 */ 10 10 11 11 /dts-v1/; 12 - /include/ "s3c2416.dtsi" 12 + #include "s3c2416.dtsi" 13 13 14 14 / { 15 15 model = "SMDK2416";
+2 -2
arch/arm/boot/dts/s3c2416.dtsi
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 - /include/ "s3c24xx.dtsi" 12 - /include/ "s3c2416-pinctrl.dtsi" 11 + #include "s3c24xx.dtsi" 12 + #include "s3c2416-pinctrl.dtsi" 13 13 14 14 / { 15 15 model = "Samsung S3C2416 SoC";
+1 -1
arch/arm/boot/dts/s3c24xx.dtsi
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 - /include/ "skeleton.dtsi" 11 + #include "skeleton.dtsi" 12 12 13 13 / { 14 14 compatible = "samsung,s3c24xx";
+7 -6
arch/arm/boot/dts/snowball.dts
··· 22 22 23 23 en_3v3_reg: en_3v3 { 24 24 compatible = "regulator-fixed"; 25 - regulator-name = "en-3v3-fixed-supply"; 26 - regulator-min-microvolt = <3300000>; 27 - regulator-max-microvolt = <3300000>; 28 - gpios = <&gpio0 26 0x4>; // 26 29 - startup-delay-us = <5000>; 30 - enable-active-high; 25 + regulator-name = "en-3v3-fixed-supply"; 26 + regulator-min-microvolt = <3300000>; 27 + regulator-max-microvolt = <3300000>; 28 + /* AB8500 GPIOs start from 1 - offset 25 is GPIO26. */ 29 + gpio = <&ab8500_gpio 25 0x4>; 30 + startup-delay-us = <5000>; 31 + enable-active-high; 31 32 }; 32 33 33 34 gpio_keys {
+2 -1
arch/arm/configs/omap1_defconfig
··· 26 26 CONFIG_ARCH_OMAP1=y 27 27 CONFIG_OMAP_RESET_CLOCKS=y 28 28 # CONFIG_OMAP_MUX is not set 29 - CONFIG_OMAP_MBOX_FWK=y 29 + CONFIG_MAILBOX=y 30 + CONFIG_OMAP1_MBOX=y 30 31 CONFIG_OMAP_32K_TIMER=y 31 32 CONFIG_OMAP_DM_TIMER=y 32 33 CONFIG_ARCH_OMAP730=y
-4
arch/arm/mach-omap1/Makefile
··· 19 19 # Power Management 20 20 obj-$(CONFIG_PM) += pm.o sleep.o 21 21 22 - # DSP 23 - obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o 24 - mailbox_mach-objs := mailbox.o 25 - 26 22 i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o 27 23 obj-y += $(i2c-omap-m) $(i2c-omap-y) 28 24
+8 -4
arch/arm/mach-omap1/mailbox.c drivers/mailbox/mailbox-omap1.c
··· 13 13 #include <linux/interrupt.h> 14 14 #include <linux/platform_device.h> 15 15 #include <linux/io.h> 16 - #include <plat/mailbox.h> 16 + 17 + #include "omap-mbox.h" 17 18 18 19 #define MAILBOX_ARM2DSP1 0x00 19 20 #define MAILBOX_ARM2DSP1b 0x04 ··· 87 86 88 87 /* irq */ 89 88 static void 90 - omap1_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) 89 + omap1_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 91 90 { 92 91 if (irq == IRQ_RX) 93 92 enable_irq(mbox->irq); 94 93 } 95 94 96 95 static void 97 - omap1_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) 96 + omap1_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 98 97 { 99 98 if (irq == IRQ_RX) 100 99 disable_irq(mbox->irq); 101 100 } 102 101 103 102 static int 104 - omap1_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) 103 + omap1_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 105 104 { 106 105 if (irq == IRQ_TX) 107 106 return 0; ··· 153 152 list[0]->irq = platform_get_irq_byname(pdev, "dsp"); 154 153 155 154 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 155 + if (!mem) 156 + return -ENOENT; 157 + 156 158 mbox_base = ioremap(mem->start, resource_size(mem)); 157 159 if (!mbox_base) 158 160 return -ENOMEM;
-3
arch/arm/mach-omap2/Makefile
··· 212 212 obj-$(CONFIG_OMAP3_EMU) += emu.o 213 213 obj-$(CONFIG_HW_PERF_EVENTS) += pmu.o 214 214 215 - obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o 216 - mailbox_mach-objs := mailbox.o 217 - 218 215 iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o 219 216 obj-y += $(iommu-m) $(iommu-y) 220 217
+3
arch/arm/mach-omap2/board-flash.c
··· 112 112 .cs_rd_off = 36, 113 113 .cs_wr_off = 36, 114 114 115 + .we_on = 6, 116 + .oe_on = 6, 117 + 115 118 .adv_on = 6, 116 119 .adv_rd_off = 24, 117 120 .adv_wr_off = 36,
+10 -3
arch/arm/mach-omap2/devices.c
··· 21 21 #include <linux/pinctrl/machine.h> 22 22 #include <linux/platform_data/omap4-keypad.h> 23 23 #include <linux/wl12xx.h> 24 + #include <linux/platform_data/mailbox-omap.h> 24 25 25 26 #include <asm/mach-types.h> 26 27 #include <asm/mach/map.h> ··· 284 283 return 0; 285 284 } 286 285 287 - #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) 286 + #if defined(CONFIG_OMAP2PLUS_MBOX) || defined(CONFIG_OMAP2PLUS_MBOX_MODULE) 288 287 static inline void __init omap_init_mbox(void) 289 288 { 290 289 struct omap_hwmod *oh; 291 290 struct platform_device *pdev; 291 + struct omap_mbox_pdata *pdata; 292 292 293 293 oh = omap_hwmod_lookup("mailbox"); 294 294 if (!oh) { 295 295 pr_err("%s: unable to find hwmod\n", __func__); 296 296 return; 297 297 } 298 + if (!oh->dev_attr) { 299 + pr_err("%s: hwmod doesn't have valid attrs\n", __func__); 300 + return; 301 + } 298 302 299 - pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0); 303 + pdata = (struct omap_mbox_pdata *)oh->dev_attr; 304 + pdev = omap_device_build("omap-mailbox", -1, oh, pdata, sizeof(*pdata)); 300 305 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n", 301 306 __func__, PTR_ERR(pdev)); 302 307 } 303 308 #else 304 309 static inline void omap_init_mbox(void) { } 305 - #endif /* CONFIG_OMAP_MBOX_FWK */ 310 + #endif /* CONFIG_OMAP2PLUS_MBOX */ 306 311 307 312 static inline void omap_init_sti(void) {} 308 313
+3 -41
arch/arm/mach-omap2/gpmc-nand.c
··· 43 43 .resource = gpmc_nand_resource, 44 44 }; 45 45 46 - static int omap2_nand_gpmc_retime( 47 - struct omap_nand_platform_data *gpmc_nand_data, 48 - struct gpmc_timings *gpmc_t) 49 - { 50 - struct gpmc_timings t; 51 - int err; 52 - 53 - memset(&t, 0, sizeof(t)); 54 - t.sync_clk = gpmc_t->sync_clk; 55 - t.cs_on = gpmc_t->cs_on; 56 - t.adv_on = gpmc_t->adv_on; 57 - 58 - /* Read */ 59 - t.adv_rd_off = gpmc_t->adv_rd_off; 60 - t.oe_on = t.adv_on; 61 - t.access = gpmc_t->access; 62 - t.oe_off = gpmc_t->oe_off; 63 - t.cs_rd_off = gpmc_t->cs_rd_off; 64 - t.rd_cycle = gpmc_t->rd_cycle; 65 - 66 - /* Write */ 67 - t.adv_wr_off = gpmc_t->adv_wr_off; 68 - t.we_on = t.oe_on; 69 - if (cpu_is_omap34xx()) { 70 - t.wr_data_mux_bus = gpmc_t->wr_data_mux_bus; 71 - t.wr_access = gpmc_t->wr_access; 72 - } 73 - t.we_off = gpmc_t->we_off; 74 - t.cs_wr_off = gpmc_t->cs_wr_off; 75 - t.wr_cycle = gpmc_t->wr_cycle; 76 - 77 - err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); 78 - if (err) 79 - return err; 80 - 81 - return 0; 82 - } 83 - 84 46 static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) 85 47 { 86 48 /* support only OMAP3 class */ ··· 93 131 gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT); 94 132 95 133 if (gpmc_t) { 96 - err = omap2_nand_gpmc_retime(gpmc_nand_data, gpmc_t); 134 + err = gpmc_cs_set_timings(gpmc_nand_data->cs, gpmc_t); 97 135 if (err < 0) { 98 136 dev_err(dev, "Unable to set gpmc timings: %d\n", err); 99 137 return err; ··· 102 140 if (gpmc_nand_data->of_node) { 103 141 gpmc_read_settings_dt(gpmc_nand_data->of_node, &s); 104 142 } else { 105 - s.device_nand = true; 106 - 107 143 /* Enable RD PIN Monitoring Reg */ 108 144 if (gpmc_nand_data->dev_ready) { 109 145 s.wait_on_read = true; 110 146 s.wait_on_write = true; 111 147 } 112 148 } 149 + 150 + s.device_nand = true; 113 151 114 152 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) 115 153 s.device_width = GPMC_DEVWIDTH_16BIT;
+68 -14
arch/arm/mach-omap2/gpmc.c
··· 30 30 #include <linux/of_mtd.h> 31 31 #include <linux/of_device.h> 32 32 #include <linux/mtd/nand.h> 33 + #include <linux/pm_runtime.h> 33 34 34 35 #include <linux/platform_data/mtd-nand-omap2.h> 35 36 ··· 156 155 static DEFINE_SPINLOCK(gpmc_mem_lock); 157 156 /* Define chip-selects as reserved by default until probe completes */ 158 157 static unsigned int gpmc_cs_map = ((1 << GPMC_CS_NUM) - 1); 158 + static unsigned int gpmc_cs_num = GPMC_CS_NUM; 159 159 static unsigned int gpmc_nr_waitpins; 160 160 static struct device *gpmc_dev; 161 161 static int gpmc_irq; ··· 523 521 int ret; 524 522 u32 old_base, size; 525 523 526 - if (cs > GPMC_CS_NUM) 524 + if (cs > gpmc_cs_num) { 525 + pr_err("%s: requested chip-select is disabled\n", __func__); 527 526 return -ENODEV; 527 + } 528 528 gpmc_cs_get_memconf(cs, &old_base, &size); 529 529 if (base == old_base) 530 530 return 0; ··· 549 545 struct resource *res = &gpmc_cs_mem[cs]; 550 546 int r = -1; 551 547 552 - if (cs > GPMC_CS_NUM) 548 + if (cs > gpmc_cs_num) { 549 + pr_err("%s: requested chip-select is disabled\n", __func__); 553 550 return -ENODEV; 554 - 551 + } 555 552 size = gpmc_mem_align(size); 556 553 if (size > (1 << GPMC_SECTION_SHIFT)) 557 554 return -ENOMEM; ··· 587 582 void gpmc_cs_free(int cs) 588 583 { 589 584 spin_lock(&gpmc_mem_lock); 590 - if (cs >= GPMC_CS_NUM || cs < 0 || !gpmc_cs_reserved(cs)) { 585 + if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) { 591 586 printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); 592 587 BUG(); 593 588 spin_unlock(&gpmc_mem_lock); ··· 782 777 { 783 778 int cs; 784 779 785 - for (cs = 0; cs < GPMC_CS_NUM; cs++) { 780 + for (cs = 0; cs < gpmc_cs_num; cs++) { 786 781 if (!gpmc_cs_mem_enabled(cs)) 787 782 continue; 788 783 gpmc_cs_delete_mem(cs); ··· 803 798 gpmc_mem_root.end = GPMC_MEM_END; 804 799 805 800 /* Reserve all regions that has been set up by bootloader */ 806 - for (cs = 0; cs < GPMC_CS_NUM; cs++) { 801 + for (cs = 0; cs < gpmc_cs_num; cs++) { 807 802 u32 base, size; 808 803 809 804 if (!gpmc_cs_mem_enabled(cs)) ··· 1250 1245 1251 1246 p->sync_read = of_property_read_bool(np, "gpmc,sync-read"); 1252 1247 p->sync_write = of_property_read_bool(np, "gpmc,sync-write"); 1253 - p->device_nand = of_property_read_bool(np, "gpmc,device-nand"); 1254 1248 of_property_read_u32(np, "gpmc,device-width", &p->device_width); 1255 1249 of_property_read_u32(np, "gpmc,mux-add-data", &p->mux_add_data); 1256 1250 ··· 1349 1345 [OMAP_ECC_BCH8_CODE_HW] = "bch8", 1350 1346 }; 1351 1347 1348 + static const char * const nand_xfer_types[] = { 1349 + [NAND_OMAP_PREFETCH_POLLED] = "prefetch-polled", 1350 + [NAND_OMAP_POLLED] = "polled", 1351 + [NAND_OMAP_PREFETCH_DMA] = "prefetch-dma", 1352 + [NAND_OMAP_PREFETCH_IRQ] = "prefetch-irq", 1353 + }; 1354 + 1352 1355 static int gpmc_probe_nand_child(struct platform_device *pdev, 1353 1356 struct device_node *child) 1354 1357 { ··· 1382 1371 for (val = 0; val < ARRAY_SIZE(nand_ecc_opts); val++) 1383 1372 if (!strcasecmp(s, nand_ecc_opts[val])) { 1384 1373 gpmc_nand_data->ecc_opt = val; 1374 + break; 1375 + } 1376 + 1377 + if (!of_property_read_string(child, "ti,nand-xfer-type", &s)) 1378 + for (val = 0; val < ARRAY_SIZE(nand_xfer_types); val++) 1379 + if (!strcasecmp(s, nand_xfer_types[val])) { 1380 + gpmc_nand_data->xfer_type = val; 1385 1381 break; 1386 1382 } 1387 1383 ··· 1531 1513 if (!of_id) 1532 1514 return 0; 1533 1515 1516 + ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-cs", 1517 + &gpmc_cs_num); 1518 + if (ret < 0) { 1519 + pr_err("%s: number of chip-selects not defined\n", __func__); 1520 + return ret; 1521 + } else if (gpmc_cs_num < 1) { 1522 + pr_err("%s: all chip-selects are disabled\n", __func__); 1523 + return -EINVAL; 1524 + } else if (gpmc_cs_num > GPMC_CS_NUM) { 1525 + pr_err("%s: number of supported chip-selects cannot be > %d\n", 1526 + __func__, GPMC_CS_NUM); 1527 + return -EINVAL; 1528 + } 1529 + 1534 1530 ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-waitpins", 1535 1531 &gpmc_nr_waitpins); 1536 1532 if (ret < 0) { ··· 1609 1577 return PTR_ERR(gpmc_l3_clk); 1610 1578 } 1611 1579 1612 - clk_prepare_enable(gpmc_l3_clk); 1580 + pm_runtime_enable(&pdev->dev); 1581 + pm_runtime_get_sync(&pdev->dev); 1613 1582 1614 1583 gpmc_dev = &pdev->dev; 1615 1584 ··· 1643 1610 /* Now the GPMC is initialised, unreserve the chip-selects */ 1644 1611 gpmc_cs_map = 0; 1645 1612 1646 - if (!pdev->dev.of_node) 1613 + if (!pdev->dev.of_node) { 1614 + gpmc_cs_num = GPMC_CS_NUM; 1647 1615 gpmc_nr_waitpins = GPMC_NR_WAITPINS; 1616 + } 1648 1617 1649 1618 rc = gpmc_probe_dt(pdev); 1650 1619 if (rc < 0) { 1651 - clk_disable_unprepare(gpmc_l3_clk); 1620 + pm_runtime_put_sync(&pdev->dev); 1652 1621 clk_put(gpmc_l3_clk); 1653 1622 dev_err(gpmc_dev, "failed to probe DT parameters\n"); 1654 1623 return rc; ··· 1663 1628 { 1664 1629 gpmc_free_irq(); 1665 1630 gpmc_mem_exit(); 1631 + pm_runtime_put_sync(&pdev->dev); 1632 + pm_runtime_disable(&pdev->dev); 1666 1633 gpmc_dev = NULL; 1667 1634 return 0; 1668 1635 } 1636 + 1637 + #ifdef CONFIG_PM_SLEEP 1638 + static int gpmc_suspend(struct device *dev) 1639 + { 1640 + omap3_gpmc_save_context(); 1641 + pm_runtime_put_sync(dev); 1642 + return 0; 1643 + } 1644 + 1645 + static int gpmc_resume(struct device *dev) 1646 + { 1647 + pm_runtime_get_sync(dev); 1648 + omap3_gpmc_restore_context(); 1649 + return 0; 1650 + } 1651 + #endif 1652 + 1653 + static SIMPLE_DEV_PM_OPS(gpmc_pm_ops, gpmc_suspend, gpmc_resume); 1669 1654 1670 1655 static struct platform_driver gpmc_driver = { 1671 1656 .probe = gpmc_probe, ··· 1694 1639 .name = DEVICE_NAME, 1695 1640 .owner = THIS_MODULE, 1696 1641 .of_match_table = of_match_ptr(gpmc_dt_ids), 1642 + .pm = &gpmc_pm_ops, 1697 1643 }, 1698 1644 }; 1699 1645 ··· 1757 1701 return IRQ_HANDLED; 1758 1702 } 1759 1703 1760 - #ifdef CONFIG_ARCH_OMAP3 1761 1704 static struct omap3_gpmc_regs gpmc_context; 1762 1705 1763 1706 void omap3_gpmc_save_context(void) ··· 1770 1715 gpmc_context.prefetch_config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1); 1771 1716 gpmc_context.prefetch_config2 = gpmc_read_reg(GPMC_PREFETCH_CONFIG2); 1772 1717 gpmc_context.prefetch_control = gpmc_read_reg(GPMC_PREFETCH_CONTROL); 1773 - for (i = 0; i < GPMC_CS_NUM; i++) { 1718 + for (i = 0; i < gpmc_cs_num; i++) { 1774 1719 gpmc_context.cs_context[i].is_valid = gpmc_cs_mem_enabled(i); 1775 1720 if (gpmc_context.cs_context[i].is_valid) { 1776 1721 gpmc_context.cs_context[i].config1 = ··· 1802 1747 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, gpmc_context.prefetch_config1); 1803 1748 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, gpmc_context.prefetch_config2); 1804 1749 gpmc_write_reg(GPMC_PREFETCH_CONTROL, gpmc_context.prefetch_control); 1805 - for (i = 0; i < GPMC_CS_NUM; i++) { 1750 + for (i = 0; i < gpmc_cs_num; i++) { 1806 1751 if (gpmc_context.cs_context[i].is_valid) { 1807 1752 gpmc_cs_write_reg(i, GPMC_CS_CONFIG1, 1808 1753 gpmc_context.cs_context[i].config1); ··· 1821 1766 } 1822 1767 } 1823 1768 } 1824 - #endif /* CONFIG_ARCH_OMAP3 */
+107 -179
arch/arm/mach-omap2/mailbox.c drivers/mailbox/mailbox-omap2.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 + #include <linux/slab.h> 14 15 #include <linux/clk.h> 15 16 #include <linux/err.h> 16 17 #include <linux/platform_device.h> 17 18 #include <linux/io.h> 18 19 #include <linux/pm_runtime.h> 20 + #include <linux/platform_data/mailbox-omap.h> 19 21 20 - #include <plat/mailbox.h> 21 - 22 - #include "soc.h" 22 + #include "omap-mbox.h" 23 23 24 24 #define MAILBOX_REVISION 0x000 25 25 #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) ··· 59 59 u32 notfull_bit; 60 60 u32 ctx[OMAP4_MBOX_NR_REGS]; 61 61 unsigned long irqdisable; 62 + u32 intr_type; 62 63 }; 63 - 64 - static void omap2_mbox_enable_irq(struct omap_mbox *mbox, 65 - omap_mbox_type_t irq); 66 64 67 65 static inline unsigned int mbox_read_reg(size_t ofs) 68 66 { ··· 122 124 } 123 125 124 126 /* Mailbox IRQ handle functions */ 125 - static void omap2_mbox_enable_irq(struct omap_mbox *mbox, 126 - omap_mbox_type_t irq) 127 + static void omap2_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 127 128 { 128 129 struct omap_mbox2_priv *p = mbox->priv; 129 130 u32 l, bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; ··· 132 135 mbox_write_reg(l, p->irqenable); 133 136 } 134 137 135 - static void omap2_mbox_disable_irq(struct omap_mbox *mbox, 136 - omap_mbox_type_t irq) 138 + static void omap2_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 137 139 { 138 140 struct omap_mbox2_priv *p = mbox->priv; 139 141 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; 140 142 141 - if (!cpu_is_omap44xx()) 143 + /* 144 + * Read and update the interrupt configuration register for pre-OMAP4. 145 + * OMAP4 and later SoCs have a dedicated interrupt disabling register. 146 + */ 147 + if (!p->intr_type) 142 148 bit = mbox_read_reg(p->irqdisable) & ~bit; 143 149 144 150 mbox_write_reg(bit, p->irqdisable); 145 151 } 146 152 147 - static void omap2_mbox_ack_irq(struct omap_mbox *mbox, 148 - omap_mbox_type_t irq) 153 + static void omap2_mbox_ack_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 149 154 { 150 155 struct omap_mbox2_priv *p = mbox->priv; 151 156 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; ··· 158 159 mbox_read_reg(p->irqstatus); 159 160 } 160 161 161 - static int omap2_mbox_is_irq(struct omap_mbox *mbox, 162 - omap_mbox_type_t irq) 162 + static int omap2_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 163 163 { 164 164 struct omap_mbox2_priv *p = mbox->priv; 165 165 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; ··· 173 175 int i; 174 176 struct omap_mbox2_priv *p = mbox->priv; 175 177 int nr_regs; 176 - if (cpu_is_omap44xx()) 178 + 179 + if (p->intr_type) 177 180 nr_regs = OMAP4_MBOX_NR_REGS; 178 181 else 179 182 nr_regs = MBOX_NR_REGS; ··· 191 192 int i; 192 193 struct omap_mbox2_priv *p = mbox->priv; 193 194 int nr_regs; 194 - if (cpu_is_omap44xx()) 195 + 196 + if (p->intr_type) 195 197 nr_regs = OMAP4_MBOX_NR_REGS; 196 198 else 197 199 nr_regs = MBOX_NR_REGS; ··· 220 220 .restore_ctx = omap2_mbox_restore_ctx, 221 221 }; 222 222 223 - /* 224 - * MAILBOX 0: ARM -> DSP, 225 - * MAILBOX 1: ARM <- DSP. 226 - * MAILBOX 2: ARM -> IVA, 227 - * MAILBOX 3: ARM <- IVA. 228 - */ 229 - 230 - /* FIXME: the following structs should be filled automatically by the user id */ 231 - 232 - #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP2) 233 - /* DSP */ 234 - static struct omap_mbox2_priv omap2_mbox_dsp_priv = { 235 - .tx_fifo = { 236 - .msg = MAILBOX_MESSAGE(0), 237 - .fifo_stat = MAILBOX_FIFOSTATUS(0), 238 - }, 239 - .rx_fifo = { 240 - .msg = MAILBOX_MESSAGE(1), 241 - .msg_stat = MAILBOX_MSGSTATUS(1), 242 - }, 243 - .irqenable = MAILBOX_IRQENABLE(0), 244 - .irqstatus = MAILBOX_IRQSTATUS(0), 245 - .notfull_bit = MAILBOX_IRQ_NOTFULL(0), 246 - .newmsg_bit = MAILBOX_IRQ_NEWMSG(1), 247 - .irqdisable = MAILBOX_IRQENABLE(0), 248 - }; 249 - 250 - struct omap_mbox mbox_dsp_info = { 251 - .name = "dsp", 252 - .ops = &omap2_mbox_ops, 253 - .priv = &omap2_mbox_dsp_priv, 254 - }; 255 - #endif 256 - 257 - #if defined(CONFIG_ARCH_OMAP3) 258 - struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL }; 259 - #endif 260 - 261 - #if defined(CONFIG_SOC_OMAP2420) 262 - /* IVA */ 263 - static struct omap_mbox2_priv omap2_mbox_iva_priv = { 264 - .tx_fifo = { 265 - .msg = MAILBOX_MESSAGE(2), 266 - .fifo_stat = MAILBOX_FIFOSTATUS(2), 267 - }, 268 - .rx_fifo = { 269 - .msg = MAILBOX_MESSAGE(3), 270 - .msg_stat = MAILBOX_MSGSTATUS(3), 271 - }, 272 - .irqenable = MAILBOX_IRQENABLE(3), 273 - .irqstatus = MAILBOX_IRQSTATUS(3), 274 - .notfull_bit = MAILBOX_IRQ_NOTFULL(2), 275 - .newmsg_bit = MAILBOX_IRQ_NEWMSG(3), 276 - .irqdisable = MAILBOX_IRQENABLE(3), 277 - }; 278 - 279 - static struct omap_mbox mbox_iva_info = { 280 - .name = "iva", 281 - .ops = &omap2_mbox_ops, 282 - .priv = &omap2_mbox_iva_priv, 283 - }; 284 - #endif 285 - 286 - #ifdef CONFIG_ARCH_OMAP2 287 - struct omap_mbox *omap2_mboxes[] = { 288 - &mbox_dsp_info, 289 - #ifdef CONFIG_SOC_OMAP2420 290 - &mbox_iva_info, 291 - #endif 292 - NULL 293 - }; 294 - #endif 295 - 296 - #if defined(CONFIG_ARCH_OMAP4) 297 - /* OMAP4 */ 298 - static struct omap_mbox2_priv omap2_mbox_1_priv = { 299 - .tx_fifo = { 300 - .msg = MAILBOX_MESSAGE(0), 301 - .fifo_stat = MAILBOX_FIFOSTATUS(0), 302 - }, 303 - .rx_fifo = { 304 - .msg = MAILBOX_MESSAGE(1), 305 - .msg_stat = MAILBOX_MSGSTATUS(1), 306 - }, 307 - .irqenable = OMAP4_MAILBOX_IRQENABLE(0), 308 - .irqstatus = OMAP4_MAILBOX_IRQSTATUS(0), 309 - .notfull_bit = MAILBOX_IRQ_NOTFULL(0), 310 - .newmsg_bit = MAILBOX_IRQ_NEWMSG(1), 311 - .irqdisable = OMAP4_MAILBOX_IRQENABLE_CLR(0), 312 - }; 313 - 314 - struct omap_mbox mbox_1_info = { 315 - .name = "mailbox-1", 316 - .ops = &omap2_mbox_ops, 317 - .priv = &omap2_mbox_1_priv, 318 - }; 319 - 320 - static struct omap_mbox2_priv omap2_mbox_2_priv = { 321 - .tx_fifo = { 322 - .msg = MAILBOX_MESSAGE(3), 323 - .fifo_stat = MAILBOX_FIFOSTATUS(3), 324 - }, 325 - .rx_fifo = { 326 - .msg = MAILBOX_MESSAGE(2), 327 - .msg_stat = MAILBOX_MSGSTATUS(2), 328 - }, 329 - .irqenable = OMAP4_MAILBOX_IRQENABLE(0), 330 - .irqstatus = OMAP4_MAILBOX_IRQSTATUS(0), 331 - .notfull_bit = MAILBOX_IRQ_NOTFULL(3), 332 - .newmsg_bit = MAILBOX_IRQ_NEWMSG(2), 333 - .irqdisable = OMAP4_MAILBOX_IRQENABLE_CLR(0), 334 - }; 335 - 336 - struct omap_mbox mbox_2_info = { 337 - .name = "mailbox-2", 338 - .ops = &omap2_mbox_ops, 339 - .priv = &omap2_mbox_2_priv, 340 - }; 341 - 342 - struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL }; 343 - #endif 344 - 345 223 static int omap2_mbox_probe(struct platform_device *pdev) 346 224 { 347 225 struct resource *mem; 348 226 int ret; 349 - struct omap_mbox **list; 227 + struct omap_mbox **list, *mbox, *mboxblk; 228 + struct omap_mbox2_priv *priv, *privblk; 229 + struct omap_mbox_pdata *pdata = pdev->dev.platform_data; 230 + struct omap_mbox_dev_info *info; 231 + int i; 350 232 351 - if (false) 352 - ; 353 - #if defined(CONFIG_ARCH_OMAP3) 354 - else if (cpu_is_omap34xx()) { 355 - list = omap3_mboxes; 356 - 357 - list[0]->irq = platform_get_irq(pdev, 0); 358 - } 359 - #endif 360 - #if defined(CONFIG_ARCH_OMAP2) 361 - else if (cpu_is_omap2430()) { 362 - list = omap2_mboxes; 363 - 364 - list[0]->irq = platform_get_irq(pdev, 0); 365 - } else if (cpu_is_omap2420()) { 366 - list = omap2_mboxes; 367 - 368 - list[0]->irq = platform_get_irq_byname(pdev, "dsp"); 369 - list[1]->irq = platform_get_irq_byname(pdev, "iva"); 370 - } 371 - #endif 372 - #if defined(CONFIG_ARCH_OMAP4) 373 - else if (cpu_is_omap44xx()) { 374 - list = omap4_mboxes; 375 - 376 - list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0); 377 - } 378 - #endif 379 - else { 233 + if (!pdata || !pdata->info_cnt || !pdata->info) { 380 234 pr_err("%s: platform not supported\n", __func__); 381 235 return -ENODEV; 382 236 } 383 237 384 - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 385 - mbox_base = ioremap(mem->start, resource_size(mem)); 386 - if (!mbox_base) 238 + /* allocate one extra for marking end of list */ 239 + list = kzalloc((pdata->info_cnt + 1) * sizeof(*list), GFP_KERNEL); 240 + if (!list) 387 241 return -ENOMEM; 388 242 389 - ret = omap_mbox_register(&pdev->dev, list); 390 - if (ret) { 391 - iounmap(mbox_base); 392 - return ret; 243 + mboxblk = mbox = kzalloc(pdata->info_cnt * sizeof(*mbox), GFP_KERNEL); 244 + if (!mboxblk) { 245 + ret = -ENOMEM; 246 + goto free_list; 393 247 } 394 248 249 + privblk = priv = kzalloc(pdata->info_cnt * sizeof(*priv), GFP_KERNEL); 250 + if (!privblk) { 251 + ret = -ENOMEM; 252 + goto free_mboxblk; 253 + } 254 + 255 + info = pdata->info; 256 + for (i = 0; i < pdata->info_cnt; i++, info++, priv++) { 257 + priv->tx_fifo.msg = MAILBOX_MESSAGE(info->tx_id); 258 + priv->tx_fifo.fifo_stat = MAILBOX_FIFOSTATUS(info->tx_id); 259 + priv->rx_fifo.msg = MAILBOX_MESSAGE(info->rx_id); 260 + priv->rx_fifo.msg_stat = MAILBOX_MSGSTATUS(info->rx_id); 261 + priv->notfull_bit = MAILBOX_IRQ_NOTFULL(info->tx_id); 262 + priv->newmsg_bit = MAILBOX_IRQ_NEWMSG(info->rx_id); 263 + if (pdata->intr_type) { 264 + priv->irqenable = OMAP4_MAILBOX_IRQENABLE(info->usr_id); 265 + priv->irqstatus = OMAP4_MAILBOX_IRQSTATUS(info->usr_id); 266 + priv->irqdisable = 267 + OMAP4_MAILBOX_IRQENABLE_CLR(info->usr_id); 268 + } else { 269 + priv->irqenable = MAILBOX_IRQENABLE(info->usr_id); 270 + priv->irqstatus = MAILBOX_IRQSTATUS(info->usr_id); 271 + priv->irqdisable = MAILBOX_IRQENABLE(info->usr_id); 272 + } 273 + priv->intr_type = pdata->intr_type; 274 + 275 + mbox->priv = priv; 276 + mbox->name = info->name; 277 + mbox->ops = &omap2_mbox_ops; 278 + mbox->irq = platform_get_irq(pdev, info->irq_id); 279 + if (mbox->irq < 0) { 280 + ret = mbox->irq; 281 + goto free_privblk; 282 + } 283 + list[i] = mbox++; 284 + } 285 + 286 + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 287 + if (!mem) { 288 + ret = -ENOENT; 289 + goto free_privblk; 290 + } 291 + 292 + mbox_base = ioremap(mem->start, resource_size(mem)); 293 + if (!mbox_base) { 294 + ret = -ENOMEM; 295 + goto free_privblk; 296 + } 297 + 298 + ret = omap_mbox_register(&pdev->dev, list); 299 + if (ret) 300 + goto unmap_mbox; 301 + platform_set_drvdata(pdev, list); 302 + 395 303 return 0; 304 + 305 + unmap_mbox: 306 + iounmap(mbox_base); 307 + free_privblk: 308 + kfree(privblk); 309 + free_mboxblk: 310 + kfree(mboxblk); 311 + free_list: 312 + kfree(list); 313 + return ret; 396 314 } 397 315 398 316 static int omap2_mbox_remove(struct platform_device *pdev) 399 317 { 318 + struct omap_mbox2_priv *privblk; 319 + struct omap_mbox **list = platform_get_drvdata(pdev); 320 + struct omap_mbox *mboxblk = list[0]; 321 + 322 + privblk = mboxblk->priv; 400 323 omap_mbox_unregister(); 401 324 iounmap(mbox_base); 325 + kfree(privblk); 326 + kfree(mboxblk); 327 + kfree(list); 328 + platform_set_drvdata(pdev, NULL); 329 + 402 330 return 0; 403 331 } 404 332 405 333 static struct platform_driver omap2_mbox_driver = { 406 - .probe = omap2_mbox_probe, 407 - .remove = omap2_mbox_remove, 408 - .driver = { 334 + .probe = omap2_mbox_probe, 335 + .remove = omap2_mbox_remove, 336 + .driver = { 409 337 .name = "omap-mailbox", 410 338 }, 411 339 };
+14
arch/arm/mach-omap2/omap_hwmod_2420_data.c
··· 16 16 #include <linux/i2c-omap.h> 17 17 #include <linux/platform_data/spi-omap2-mcspi.h> 18 18 #include <linux/omap-dma.h> 19 + #include <linux/platform_data/mailbox-omap.h> 19 20 #include <plat/dmtimer.h> 20 21 21 22 #include "omap_hwmod.h" ··· 167 166 }; 168 167 169 168 /* mailbox */ 169 + static struct omap_mbox_dev_info omap2420_mailbox_info[] = { 170 + { .name = "dsp", .tx_id = 0, .rx_id = 1, .irq_id = 0, .usr_id = 0 }, 171 + { .name = "iva", .tx_id = 2, .rx_id = 3, .irq_id = 1, .usr_id = 3 }, 172 + }; 173 + 174 + static struct omap_mbox_pdata omap2420_mailbox_attrs = { 175 + .num_users = 4, 176 + .num_fifos = 6, 177 + .info_cnt = ARRAY_SIZE(omap2420_mailbox_info), 178 + .info = omap2420_mailbox_info, 179 + }; 180 + 170 181 static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { 171 182 { .name = "dsp", .irq = 26 + OMAP_INTC_START, }, 172 183 { .name = "iva", .irq = 34 + OMAP_INTC_START, }, ··· 199 186 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, 200 187 }, 201 188 }, 189 + .dev_attr = &omap2420_mailbox_attrs, 202 190 }; 203 191 204 192 /*
+13
arch/arm/mach-omap2/omap_hwmod_2430_data.c
··· 17 17 #include <linux/platform_data/asoc-ti-mcbsp.h> 18 18 #include <linux/platform_data/spi-omap2-mcspi.h> 19 19 #include <linux/omap-dma.h> 20 + #include <linux/platform_data/mailbox-omap.h> 20 21 #include <plat/dmtimer.h> 21 22 22 23 #include "omap_hwmod.h" ··· 171 170 }; 172 171 173 172 /* mailbox */ 173 + static struct omap_mbox_dev_info omap2430_mailbox_info[] = { 174 + { .name = "dsp", .tx_id = 0, .rx_id = 1 }, 175 + }; 176 + 177 + static struct omap_mbox_pdata omap2430_mailbox_attrs = { 178 + .num_users = 4, 179 + .num_fifos = 6, 180 + .info_cnt = ARRAY_SIZE(omap2430_mailbox_info), 181 + .info = omap2430_mailbox_info, 182 + }; 183 + 174 184 static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { 175 185 { .irq = 26 + OMAP_INTC_START, }, 176 186 { .irq = -1 }, ··· 201 189 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, 202 190 }, 203 191 }, 192 + .dev_attr = &omap2430_mailbox_attrs, 204 193 }; 205 194 206 195 /* mcspi3 */
+13
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
··· 25 25 #include <linux/platform_data/asoc-ti-mcbsp.h> 26 26 #include <linux/platform_data/spi-omap2-mcspi.h> 27 27 #include <linux/platform_data/iommu-omap.h> 28 + #include <linux/platform_data/mailbox-omap.h> 28 29 #include <plat/dmtimer.h> 29 30 30 31 #include "am35xx.h" ··· 1505 1504 .sysc = &omap3xxx_mailbox_sysc, 1506 1505 }; 1507 1506 1507 + static struct omap_mbox_dev_info omap3xxx_mailbox_info[] = { 1508 + { .name = "dsp", .tx_id = 0, .rx_id = 1 }, 1509 + }; 1510 + 1511 + static struct omap_mbox_pdata omap3xxx_mailbox_attrs = { 1512 + .num_users = 2, 1513 + .num_fifos = 2, 1514 + .info_cnt = ARRAY_SIZE(omap3xxx_mailbox_info), 1515 + .info = omap3xxx_mailbox_info, 1516 + }; 1517 + 1508 1518 static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = { 1509 1519 { .irq = 26 + OMAP_INTC_START, }, 1510 1520 { .irq = -1 }, ··· 1535 1523 .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT, 1536 1524 }, 1537 1525 }, 1526 + .dev_attr = &omap3xxx_mailbox_attrs, 1538 1527 }; 1539 1528 1540 1529 /*
+27 -39
arch/arm/mach-s3c24xx/Kconfig
··· 28 28 select CPU_ARM920T 29 29 select CPU_LLSERIAL_S3C2410 30 30 select S3C2410_CLOCK 31 - select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX 31 + select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ 32 32 select S3C2410_PM if PM 33 33 select SAMSUNG_HRT 34 34 select SAMSUNG_WDT_RESET ··· 206 206 Add an extra 128 gpio numbers to the available GPIO pool. This is 207 207 available for boards that need extra gpios for external devices. 208 208 209 + config S3C24XX_PLL 210 + bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" 211 + depends on ARM_S3C24XX 212 + help 213 + Compile in support for changing the PLL frequency from the 214 + S3C24XX series CPUfreq driver. The PLL takes time to settle 215 + after a frequency change, so by default it is not enabled. 216 + 217 + This also means that the PLL tables for the selected CPU(s) will 218 + be built which may increase the size of the kernel image. 219 + 209 220 # cpu frequency items common between s3c2410 and s3c2440/s3c2442 210 221 211 222 config S3C2410_IOTIMING 212 223 bool 213 - depends on CPU_FREQ_S3C24XX 224 + depends on ARM_S3C24XX_CPUFREQ 214 225 help 215 226 Internal node to select io timing code that is common to the s3c2410 216 227 and s3c2440/s3c2442 cpu frequency support. 217 228 218 229 config S3C2410_CPUFREQ_UTILS 219 - bool 220 - depends on CPU_FREQ_S3C24XX 221 - help 222 - Internal node to select timing code that is common to the s3c2410 223 - and s3c2440/s3c244 cpu frequency support. 230 + bool 231 + depends on ARM_S3C24XX_CPUFREQ 232 + help 233 + Internal node to select timing code that is common to the s3c2410 234 + and s3c2440/s3c244 cpu frequency support. 224 235 225 236 # cpu frequency support common to s3c2412, s3c2413 and s3c2442 226 237 227 238 config S3C2412_IOTIMING 228 239 bool 229 - depends on CPU_FREQ_S3C24XX && (CPU_S3C2412 || CPU_S3C2443) 240 + depends on ARM_S3C24XX_CPUFREQ && (CPU_S3C2412 || CPU_S3C2443) 230 241 help 231 242 Intel node to select io timing code that is common to the s3c2412 232 243 and the s3c2443. ··· 246 235 247 236 if CPU_S3C2410 248 237 249 - config S3C2410_CPUFREQ 250 - bool 251 - depends on CPU_FREQ_S3C24XX 252 - select S3C2410_CPUFREQ_UTILS 253 - help 254 - CPU Frequency scaling support for S3C2410 255 - 256 238 config S3C2410_PLL 257 239 bool 258 - depends on S3C2410_CPUFREQ && CPU_FREQ_S3C24XX_PLL 240 + depends on ARM_S3C2410_CPUFREQ && S3C24XX_PLL 259 241 default y 260 242 help 261 243 Select the PLL table for the S3C2410 ··· 284 280 bool "Simtec Electronics BAST (EB2410ITX)" 285 281 select ISA 286 282 select MACH_BAST_IDE 287 - select S3C2410_IOTIMING if S3C2410_CPUFREQ 283 + select S3C2410_IOTIMING if ARM_S3C2410_CPUFREQ 288 284 select S3C24XX_DCLK 289 285 select S3C24XX_SIMTEC_NOR 290 286 select S3C24XX_SIMTEC_PM if PM ··· 390 386 depends on !CPU_S3C2410 && !CPU_S3C2416 && !CPU_S3C2440 && \ 391 387 !CPU_S3C2442 && !CPU_S3C2443 392 388 default y 393 - 394 - config S3C2412_CPUFREQ 395 - bool 396 - depends on CPU_FREQ_S3C24XX 397 - default y 398 - select S3C2412_IOTIMING 399 - help 400 - CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs. 401 389 402 390 config S3C2412_DMA 403 391 bool ··· 504 508 505 509 if CPU_S3C2440 506 510 507 - config S3C2440_CPUFREQ 508 - bool "S3C2440/S3C2442 CPU Frequency scaling support" 509 - depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442) 510 - default y 511 - select S3C2410_CPUFREQ_UTILS 512 - help 513 - CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs. 514 - 515 511 config S3C2440_DMA 516 512 bool 517 513 help ··· 523 535 524 536 config S3C2440_PLL_12000000 525 537 bool 526 - depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000 527 - default y if CPU_FREQ_S3C24XX_PLL 538 + depends on ARM_S3C2440_CPUFREQ && S3C2440_XTAL_12000000 539 + default y if S3C24XX_PLL 528 540 help 529 541 PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals. 530 542 531 543 config S3C2440_PLL_16934400 532 544 bool 533 - depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400 534 - default y if CPU_FREQ_S3C24XX_PLL 545 + depends on ARM_S3C2440_CPUFREQ && S3C2440_XTAL_16934400 546 + default y if S3C24XX_PLL 535 547 help 536 548 PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals. 537 549 ··· 585 597 586 598 config MACH_OSIRIS 587 599 bool "Simtec IM2440D20 (OSIRIS) module" 588 - select S3C2410_IOTIMING if S3C2440_CPUFREQ 600 + select S3C2410_IOTIMING if ARM_S3C2440_CPUFREQ 589 601 select S3C2440_XTAL_12000000 590 602 select S3C24XX_DCLK 591 603 select S3C24XX_GPIO_EXTRA128 ··· 657 669 bool "HP iPAQ rx1950" 658 670 select I2C 659 671 select PM_H1940 if PM 660 - select S3C2410_IOTIMING if S3C2440_CPUFREQ 672 + select S3C2410_IOTIMING if ARM_S3C2440_CPUFREQ 661 673 select S3C2440_XTAL_16934400 662 674 select S3C24XX_DCLK 663 675 select S3C24XX_PWM
-6
arch/arm/mach-s3c24xx/Makefile
··· 17 17 obj-y += common.o 18 18 19 19 obj-$(CONFIG_CPU_S3C2410) += s3c2410.o 20 - obj-$(CONFIG_S3C2410_CPUFREQ) += cpufreq-s3c2410.o 21 20 obj-$(CONFIG_S3C2410_DMA) += dma-s3c2410.o 22 21 obj-$(CONFIG_S3C2410_PLL) += pll-s3c2410.o 23 22 obj-$(CONFIG_S3C2410_PM) += pm-s3c2410.o sleep-s3c2410.o 24 23 25 24 obj-$(CONFIG_CPU_S3C2412) += s3c2412.o clock-s3c2412.o 26 - obj-$(CONFIG_S3C2412_CPUFREQ) += cpufreq-s3c2412.o 27 25 obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o 28 26 obj-$(CONFIG_S3C2412_PM) += pm-s3c2412.o 29 27 obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o ··· 32 34 obj-$(CONFIG_CPU_S3C2440) += s3c2440.o clock-s3c2440.o 33 35 obj-$(CONFIG_CPU_S3C2442) += s3c2442.o 34 36 obj-$(CONFIG_CPU_S3C244X) += s3c244x.o clock-s3c244x.o 35 - obj-$(CONFIG_S3C2440_CPUFREQ) += cpufreq-s3c2440.o 36 37 obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o 37 38 obj-$(CONFIG_S3C2440_PLL_12000000) += pll-s3c2440-12000000.o 38 39 obj-$(CONFIG_S3C2440_PLL_16934400) += pll-s3c2440-16934400.o ··· 55 58 56 59 obj-$(CONFIG_S3C2443_COMMON) += common-s3c2443.o 57 60 obj-$(CONFIG_S3C2443_DMA) += dma-s3c2443.o 58 - 59 - obj-$(CONFIG_CPU_FREQ_S3C24XX) += cpufreq.o 60 - obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpufreq-debugfs.o 61 61 62 62 # 63 63 # machine support
arch/arm/mach-s3c24xx/cpufreq-debugfs.c drivers/cpufreq/s3c24xx-cpufreq-debugfs.c
arch/arm/mach-s3c24xx/cpufreq-s3c2410.c drivers/cpufreq/s3c2410-cpufreq.c
+1 -2
arch/arm/mach-s3c24xx/cpufreq-s3c2412.c drivers/cpufreq/s3c2412-cpufreq.c
··· 25 25 #include <asm/mach/map.h> 26 26 27 27 #include <mach/regs-clock.h> 28 + #include <mach/s3c2412.h> 28 29 29 30 #include <plat/cpu.h> 30 31 #include <plat/clock.h> 31 32 #include <plat/cpu-freq-core.h> 32 - 33 - #include "s3c2412.h" 34 33 35 34 /* our clock resources. */ 36 35 static struct clk *xtal;
arch/arm/mach-s3c24xx/cpufreq-s3c2440.c drivers/cpufreq/s3c2440-cpufreq.c
arch/arm/mach-s3c24xx/cpufreq.c drivers/cpufreq/s3c24xx-cpufreq.c
+1 -1
arch/arm/mach-s3c24xx/iotiming-s3c2412.c
··· 31 31 #include <plat/cpu-freq-core.h> 32 32 #include <plat/clock.h> 33 33 34 - #include "s3c2412.h" 34 + #include <mach/s3c2412.h> 35 35 36 36 #define print_ns(x) ((x) / 10), ((x) % 10) 37 37
arch/arm/mach-s3c24xx/s3c2412.h arch/arm/mach-s3c24xx/include/mach/s3c2412.h
+12 -56
arch/arm/mach-ux500/board-mop500-audio.c
··· 21 21 22 22 static struct stedma40_chan_cfg msp0_dma_rx = { 23 23 .high_priority = true, 24 - .dir = STEDMA40_PERIPH_TO_MEM, 25 - 26 - .src_dev_type = DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX, 27 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 28 - 29 - .src_info.psize = STEDMA40_PSIZE_LOG_4, 30 - .dst_info.psize = STEDMA40_PSIZE_LOG_4, 31 - 32 - /* data_width is set during configuration */ 24 + .dir = DMA_DEV_TO_MEM, 25 + .dev_type = DB8500_DMA_DEV31_MSP0_SLIM0_CH0, 33 26 }; 34 27 35 28 static struct stedma40_chan_cfg msp0_dma_tx = { 36 29 .high_priority = true, 37 - .dir = STEDMA40_MEM_TO_PERIPH, 38 - 39 - .src_dev_type = STEDMA40_DEV_DST_MEMORY, 40 - .dst_dev_type = DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX, 41 - 42 - .src_info.psize = STEDMA40_PSIZE_LOG_4, 43 - .dst_info.psize = STEDMA40_PSIZE_LOG_4, 44 - 45 - /* data_width is set during configuration */ 30 + .dir = DMA_MEM_TO_DEV, 31 + .dev_type = DB8500_DMA_DEV31_MSP0_SLIM0_CH0, 46 32 }; 47 33 48 34 struct msp_i2s_platform_data msp0_platform_data = { ··· 39 53 40 54 static struct stedma40_chan_cfg msp1_dma_rx = { 41 55 .high_priority = true, 42 - .dir = STEDMA40_PERIPH_TO_MEM, 43 - 44 - .src_dev_type = DB8500_DMA_DEV30_MSP3_RX, 45 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 46 - 47 - .src_info.psize = STEDMA40_PSIZE_LOG_4, 48 - .dst_info.psize = STEDMA40_PSIZE_LOG_4, 49 - 50 - /* data_width is set during configuration */ 56 + .dir = DMA_DEV_TO_MEM, 57 + .dev_type = DB8500_DMA_DEV30_MSP3, 51 58 }; 52 59 53 60 static struct stedma40_chan_cfg msp1_dma_tx = { 54 61 .high_priority = true, 55 - .dir = STEDMA40_MEM_TO_PERIPH, 56 - 57 - .src_dev_type = STEDMA40_DEV_DST_MEMORY, 58 - .dst_dev_type = DB8500_DMA_DEV30_MSP1_TX, 59 - 60 - .src_info.psize = STEDMA40_PSIZE_LOG_4, 61 - .dst_info.psize = STEDMA40_PSIZE_LOG_4, 62 - 63 - /* data_width is set during configuration */ 62 + .dir = DMA_MEM_TO_DEV, 63 + .dev_type = DB8500_DMA_DEV30_MSP1, 64 64 }; 65 65 66 66 struct msp_i2s_platform_data msp1_platform_data = { ··· 57 85 58 86 static struct stedma40_chan_cfg msp2_dma_rx = { 59 87 .high_priority = true, 60 - .dir = STEDMA40_PERIPH_TO_MEM, 61 - 62 - .src_dev_type = DB8500_DMA_DEV14_MSP2_RX, 63 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 64 - 65 - /* MSP2 DMA doesn't work with PSIZE == 4 on DB8500v2 */ 66 - .src_info.psize = STEDMA40_PSIZE_LOG_1, 67 - .dst_info.psize = STEDMA40_PSIZE_LOG_1, 68 - 69 - /* data_width is set during configuration */ 88 + .dir = DMA_DEV_TO_MEM, 89 + .dev_type = DB8500_DMA_DEV14_MSP2, 70 90 }; 71 91 72 92 static struct stedma40_chan_cfg msp2_dma_tx = { 73 93 .high_priority = true, 74 - .dir = STEDMA40_MEM_TO_PERIPH, 75 - 76 - .src_dev_type = STEDMA40_DEV_DST_MEMORY, 77 - .dst_dev_type = DB8500_DMA_DEV14_MSP2_TX, 78 - 79 - .src_info.psize = STEDMA40_PSIZE_LOG_4, 80 - .dst_info.psize = STEDMA40_PSIZE_LOG_4, 81 - 94 + .dir = DMA_MEM_TO_DEV, 95 + .dev_type = DB8500_DMA_DEV14_MSP2, 82 96 .use_fixed_channel = true, 83 97 .phy_channel = 1, 84 - 85 - /* data_width is set during configuration */ 86 98 }; 87 99 88 100 static struct platform_device *db8500_add_msp_i2s(struct device *parent,
+16 -40
arch/arm/mach-ux500/board-mop500-sdi.c
··· 34 34 #ifdef CONFIG_STE_DMA40 35 35 struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = { 36 36 .mode = STEDMA40_MODE_LOGICAL, 37 - .dir = STEDMA40_PERIPH_TO_MEM, 38 - .src_dev_type = DB8500_DMA_DEV29_SD_MM0_RX, 39 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 40 - .src_info.data_width = STEDMA40_WORD_WIDTH, 41 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 37 + .dir = DMA_DEV_TO_MEM, 38 + .dev_type = DB8500_DMA_DEV29_SD_MM0, 42 39 }; 43 40 44 41 static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = { 45 42 .mode = STEDMA40_MODE_LOGICAL, 46 - .dir = STEDMA40_MEM_TO_PERIPH, 47 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 48 - .dst_dev_type = DB8500_DMA_DEV29_SD_MM0_TX, 49 - .src_info.data_width = STEDMA40_WORD_WIDTH, 50 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 43 + .dir = DMA_MEM_TO_DEV, 44 + .dev_type = DB8500_DMA_DEV29_SD_MM0, 51 45 }; 52 46 #endif 53 47 ··· 83 89 #ifdef CONFIG_STE_DMA40 84 90 static struct stedma40_chan_cfg sdi1_dma_cfg_rx = { 85 91 .mode = STEDMA40_MODE_LOGICAL, 86 - .dir = STEDMA40_PERIPH_TO_MEM, 87 - .src_dev_type = DB8500_DMA_DEV32_SD_MM1_RX, 88 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 89 - .src_info.data_width = STEDMA40_WORD_WIDTH, 90 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 92 + .dir = DMA_DEV_TO_MEM, 93 + .dev_type = DB8500_DMA_DEV32_SD_MM1, 91 94 }; 92 95 93 96 static struct stedma40_chan_cfg sdi1_dma_cfg_tx = { 94 97 .mode = STEDMA40_MODE_LOGICAL, 95 - .dir = STEDMA40_MEM_TO_PERIPH, 96 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 97 - .dst_dev_type = DB8500_DMA_DEV32_SD_MM1_TX, 98 - .src_info.data_width = STEDMA40_WORD_WIDTH, 99 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 98 + .dir = DMA_MEM_TO_DEV, 99 + .dev_type = DB8500_DMA_DEV32_SD_MM1, 100 100 }; 101 101 #endif 102 102 ··· 115 127 #ifdef CONFIG_STE_DMA40 116 128 struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = { 117 129 .mode = STEDMA40_MODE_LOGICAL, 118 - .dir = STEDMA40_PERIPH_TO_MEM, 119 - .src_dev_type = DB8500_DMA_DEV28_SD_MM2_RX, 120 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 121 - .src_info.data_width = STEDMA40_WORD_WIDTH, 122 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 130 + .dir = DMA_DEV_TO_MEM, 131 + .dev_type = DB8500_DMA_DEV28_SD_MM2, 123 132 }; 124 133 125 134 static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = { 126 135 .mode = STEDMA40_MODE_LOGICAL, 127 - .dir = STEDMA40_MEM_TO_PERIPH, 128 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 129 - .dst_dev_type = DB8500_DMA_DEV28_SD_MM2_TX, 130 - .src_info.data_width = STEDMA40_WORD_WIDTH, 131 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 136 + .dir = DMA_MEM_TO_DEV, 137 + .dev_type = DB8500_DMA_DEV28_SD_MM2, 132 138 }; 133 139 #endif 134 140 ··· 151 169 #ifdef CONFIG_STE_DMA40 152 170 struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = { 153 171 .mode = STEDMA40_MODE_LOGICAL, 154 - .dir = STEDMA40_PERIPH_TO_MEM, 155 - .src_dev_type = DB8500_DMA_DEV42_SD_MM4_RX, 156 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 157 - .src_info.data_width = STEDMA40_WORD_WIDTH, 158 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 172 + .dir = DMA_DEV_TO_MEM, 173 + .dev_type = DB8500_DMA_DEV42_SD_MM4, 159 174 }; 160 175 161 176 static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = { 162 177 .mode = STEDMA40_MODE_LOGICAL, 163 - .dir = STEDMA40_MEM_TO_PERIPH, 164 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 165 - .dst_dev_type = DB8500_DMA_DEV42_SD_MM4_TX, 166 - .src_info.data_width = STEDMA40_WORD_WIDTH, 167 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 178 + .dir = DMA_MEM_TO_DEV, 179 + .dev_type = DB8500_DMA_DEV42_SD_MM4, 168 180 }; 169 181 #endif 170 182
+23 -71
arch/arm/mach-ux500/board-mop500.c
··· 413 413 regulator_put(prox_regulator); 414 414 } 415 415 416 - void mop500_snowball_ethernet_clock_enable(void) 417 - { 418 - struct clk *clk; 419 - 420 - clk = clk_get_sys("fsmc", NULL); 421 - if (!IS_ERR(clk)) 422 - clk_prepare_enable(clk); 423 - } 424 - 425 416 static struct cryp_platform_data u8500_cryp1_platform_data = { 426 417 .mem_to_engine = { 427 - .dir = STEDMA40_MEM_TO_PERIPH, 428 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 429 - .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX, 430 - .src_info.data_width = STEDMA40_WORD_WIDTH, 431 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 418 + .dir = DMA_MEM_TO_DEV, 419 + .dev_type = DB8500_DMA_DEV48_CAC1, 432 420 .mode = STEDMA40_MODE_LOGICAL, 433 - .src_info.psize = STEDMA40_PSIZE_LOG_4, 434 - .dst_info.psize = STEDMA40_PSIZE_LOG_4, 435 421 }, 436 422 .engine_to_mem = { 437 - .dir = STEDMA40_PERIPH_TO_MEM, 438 - .src_dev_type = DB8500_DMA_DEV48_CAC1_RX, 439 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 440 - .src_info.data_width = STEDMA40_WORD_WIDTH, 441 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 423 + .dir = DMA_DEV_TO_MEM, 424 + .dev_type = DB8500_DMA_DEV48_CAC1, 442 425 .mode = STEDMA40_MODE_LOGICAL, 443 - .src_info.psize = STEDMA40_PSIZE_LOG_4, 444 - .dst_info.psize = STEDMA40_PSIZE_LOG_4, 445 426 } 446 427 }; 447 428 448 429 static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = { 449 - .dir = STEDMA40_MEM_TO_PERIPH, 450 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 451 - .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX, 452 - .src_info.data_width = STEDMA40_WORD_WIDTH, 453 - .dst_info.data_width = STEDMA40_WORD_WIDTH, 430 + .dir = DMA_MEM_TO_DEV, 431 + .dev_type = DB8500_DMA_DEV50_HAC1_TX, 454 432 .mode = STEDMA40_MODE_LOGICAL, 455 - .src_info.psize = STEDMA40_PSIZE_LOG_16, 456 - .dst_info.psize = STEDMA40_PSIZE_LOG_16, 457 433 }; 458 434 459 435 static struct hash_platform_data u8500_hash1_platform_data = { ··· 446 470 #ifdef CONFIG_STE_DMA40 447 471 static struct stedma40_chan_cfg ssp0_dma_cfg_rx = { 448 472 .mode = STEDMA40_MODE_LOGICAL, 449 - .dir = STEDMA40_PERIPH_TO_MEM, 450 - .src_dev_type = DB8500_DMA_DEV8_SSP0_RX, 451 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 452 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 453 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 473 + .dir = DMA_DEV_TO_MEM, 474 + .dev_type = DB8500_DMA_DEV8_SSP0, 454 475 }; 455 476 456 477 static struct stedma40_chan_cfg ssp0_dma_cfg_tx = { 457 478 .mode = STEDMA40_MODE_LOGICAL, 458 - .dir = STEDMA40_MEM_TO_PERIPH, 459 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 460 - .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX, 461 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 462 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 479 + .dir = DMA_MEM_TO_DEV, 480 + .dev_type = DB8500_DMA_DEV8_SSP0, 463 481 }; 464 482 #endif 465 483 ··· 481 511 #ifdef CONFIG_STE_DMA40 482 512 static struct stedma40_chan_cfg uart0_dma_cfg_rx = { 483 513 .mode = STEDMA40_MODE_LOGICAL, 484 - .dir = STEDMA40_PERIPH_TO_MEM, 485 - .src_dev_type = DB8500_DMA_DEV13_UART0_RX, 486 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 487 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 488 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 514 + .dir = DMA_DEV_TO_MEM, 515 + .dev_type = DB8500_DMA_DEV13_UART0, 489 516 }; 490 517 491 518 static struct stedma40_chan_cfg uart0_dma_cfg_tx = { 492 519 .mode = STEDMA40_MODE_LOGICAL, 493 - .dir = STEDMA40_MEM_TO_PERIPH, 494 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 495 - .dst_dev_type = DB8500_DMA_DEV13_UART0_TX, 496 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 497 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 520 + .dir = DMA_MEM_TO_DEV, 521 + .dev_type = DB8500_DMA_DEV13_UART0, 498 522 }; 499 523 500 524 static struct stedma40_chan_cfg uart1_dma_cfg_rx = { 501 525 .mode = STEDMA40_MODE_LOGICAL, 502 - .dir = STEDMA40_PERIPH_TO_MEM, 503 - .src_dev_type = DB8500_DMA_DEV12_UART1_RX, 504 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 505 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 506 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 526 + .dir = DMA_DEV_TO_MEM, 527 + .dev_type = DB8500_DMA_DEV12_UART1, 507 528 }; 508 529 509 530 static struct stedma40_chan_cfg uart1_dma_cfg_tx = { 510 531 .mode = STEDMA40_MODE_LOGICAL, 511 - .dir = STEDMA40_MEM_TO_PERIPH, 512 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 513 - .dst_dev_type = DB8500_DMA_DEV12_UART1_TX, 514 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 515 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 532 + .dir = DMA_MEM_TO_DEV, 533 + .dev_type = DB8500_DMA_DEV12_UART1, 516 534 }; 517 535 518 536 static struct stedma40_chan_cfg uart2_dma_cfg_rx = { 519 537 .mode = STEDMA40_MODE_LOGICAL, 520 - .dir = STEDMA40_PERIPH_TO_MEM, 521 - .src_dev_type = DB8500_DMA_DEV11_UART2_RX, 522 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, 523 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 524 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 538 + .dir = DMA_DEV_TO_MEM, 539 + .dev_type = DB8500_DMA_DEV11_UART2, 525 540 }; 526 541 527 542 static struct stedma40_chan_cfg uart2_dma_cfg_tx = { 528 543 .mode = STEDMA40_MODE_LOGICAL, 529 - .dir = STEDMA40_MEM_TO_PERIPH, 530 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 531 - .dst_dev_type = DB8500_DMA_DEV11_UART2_TX, 532 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 533 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 544 + .dir = DMA_MEM_TO_DEV, 545 + .dev_type = DB8500_DMA_DEV11_UART2, 534 546 }; 535 547 #endif 536 548 ··· 626 674 mop500_audio_init(parent); 627 675 mop500_uart_init(parent); 628 676 629 - mop500_snowball_ethernet_clock_enable(); 677 + u8500_cryp1_hash1_init(parent); 630 678 631 679 /* This board has full regulator constraints */ 632 680 regulator_has_full_constraints();
+1 -1
arch/arm/mach-ux500/board-mop500.h
··· 93 93 extern struct amba_pl011_data uart1_plat; 94 94 extern struct amba_pl011_data uart2_plat; 95 95 extern struct pl022_ssp_controller ssp0_plat; 96 + extern struct stedma40_platform_data dma40_plat_data; 96 97 97 98 extern void mop500_sdi_init(struct device *parent); 98 99 extern void snowball_sdi_init(struct device *parent); ··· 105 104 void __init snowball_pinmaps_init(void); 106 105 void __init hrefv60_pinmaps_init(void); 107 106 void mop500_audio_init(struct device *parent); 108 - void mop500_snowball_ethernet_clock_enable(void); 109 107 110 108 int __init mop500_uib_init(void); 111 109 void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
+16 -50
arch/arm/mach-ux500/cpu-db8500.c
··· 162 162 dbx500_add_pinctrl(parent, "pinctrl-db8500", U8500_PRCMU_BASE); 163 163 } 164 164 165 - static int usb_db8500_rx_dma_cfg[] = { 166 - DB8500_DMA_DEV38_USB_OTG_IEP_1_9, 167 - DB8500_DMA_DEV37_USB_OTG_IEP_2_10, 168 - DB8500_DMA_DEV36_USB_OTG_IEP_3_11, 169 - DB8500_DMA_DEV19_USB_OTG_IEP_4_12, 170 - DB8500_DMA_DEV18_USB_OTG_IEP_5_13, 171 - DB8500_DMA_DEV17_USB_OTG_IEP_6_14, 172 - DB8500_DMA_DEV16_USB_OTG_IEP_7_15, 173 - DB8500_DMA_DEV39_USB_OTG_IEP_8 174 - }; 175 - 176 - static int usb_db8500_tx_dma_cfg[] = { 177 - DB8500_DMA_DEV38_USB_OTG_OEP_1_9, 178 - DB8500_DMA_DEV37_USB_OTG_OEP_2_10, 179 - DB8500_DMA_DEV36_USB_OTG_OEP_3_11, 180 - DB8500_DMA_DEV19_USB_OTG_OEP_4_12, 181 - DB8500_DMA_DEV18_USB_OTG_OEP_5_13, 182 - DB8500_DMA_DEV17_USB_OTG_OEP_6_14, 183 - DB8500_DMA_DEV16_USB_OTG_OEP_7_15, 184 - DB8500_DMA_DEV39_USB_OTG_OEP_8 165 + static int usb_db8500_dma_cfg[] = { 166 + DB8500_DMA_DEV38_USB_OTG_IEP_AND_OEP_1_9, 167 + DB8500_DMA_DEV37_USB_OTG_IEP_AND_OEP_2_10, 168 + DB8500_DMA_DEV36_USB_OTG_IEP_AND_OEP_3_11, 169 + DB8500_DMA_DEV19_USB_OTG_IEP_AND_OEP_4_12, 170 + DB8500_DMA_DEV18_USB_OTG_IEP_AND_OEP_5_13, 171 + DB8500_DMA_DEV17_USB_OTG_IEP_AND_OEP_6_14, 172 + DB8500_DMA_DEV16_USB_OTG_IEP_AND_OEP_7_15, 173 + DB8500_DMA_DEV39_USB_OTG_IEP_AND_OEP_8 185 174 }; 186 175 187 176 static const char *db8500_read_soc_id(void) ··· 204 215 205 216 db8500_add_rtc(parent); 206 217 db8500_add_gpios(parent); 207 - db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); 218 + db8500_add_usb(parent, usb_db8500_dma_cfg, usb_db8500_dma_cfg); 208 219 209 220 for (i = 0; i < ARRAY_SIZE(platform_devs); i++) 210 221 platform_devs[i]->dev.parent = parent; ··· 215 226 } 216 227 217 228 #ifdef CONFIG_MACH_UX500_DT 218 - 219 - /* TODO: Once all pieces are DT:ed, remove completely. */ 220 - static struct device * __init u8500_of_init_devices(void) 221 - { 222 - struct device *parent = db8500_soc_device_init(); 223 - 224 - db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); 225 - 226 - u8500_dma40_device.dev.parent = parent; 227 - 228 - /* 229 - * Devices to be DT:ed: 230 - * u8500_dma40_device = todo 231 - * db8500_pmu_device = done 232 - * db8500_prcmu_device = done 233 - */ 234 - platform_device_register(&u8500_dma40_device); 235 - 236 - return parent; 237 - } 238 - 239 229 static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { 240 230 /* Requires call-back bindings. */ 241 231 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), 242 232 /* Requires DMA bindings. */ 243 - OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), 244 - OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat), 245 - OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat), 233 + OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", NULL), 234 + OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", NULL), 235 + OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", NULL), 246 236 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat), 247 237 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data), 248 238 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data), ··· 262 294 "ux500-msp-i2s.2", &msp2_platform_data), 263 295 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000, 264 296 "ux500-msp-i2s.3", &msp3_platform_data), 297 + /* Requires clock name bindings and channel address lookup table. */ 298 + OF_DEV_AUXDATA("stericsson,db8500-dma40", 0x801C0000, "dma40.0", NULL), 265 299 {}, 266 300 }; 267 301 ··· 287 317 288 318 static void __init u8500_init_machine(void) 289 319 { 290 - struct device *parent = NULL; 320 + struct device *parent = db8500_soc_device_init(); 291 321 292 322 /* Pinmaps must be in place before devices register */ 293 323 if (of_machine_is_compatible("st-ericsson,mop500")) 294 324 mop500_pinmaps_init(); 295 325 else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { 296 326 snowball_pinmaps_init(); 297 - mop500_snowball_ethernet_clock_enable(); 298 327 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) 299 328 hrefv60_pinmaps_init(); 300 329 else if (of_machine_is_compatible("st-ericsson,ccu9540")) {} 301 330 /* TODO: Add pinmaps for ccu9540 board. */ 302 - 303 - /* TODO: Export SoC, USB, cpu-freq and DMA40 */ 304 - parent = u8500_of_init_devices(); 305 331 306 332 /* automatically probe child nodes of dbx5x0 devices */ 307 333 if (of_machine_is_compatible("st-ericsson,u8540"))
+1 -122
arch/arm/mach-ux500/devices-db8500.c
··· 42 42 } 43 43 }; 44 44 45 - /* Default configuration for physcial memcpy */ 46 - struct stedma40_chan_cfg dma40_memcpy_conf_phy = { 47 - .mode = STEDMA40_MODE_PHYSICAL, 48 - .dir = STEDMA40_MEM_TO_MEM, 49 - 50 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 51 - .src_info.psize = STEDMA40_PSIZE_PHY_1, 52 - .src_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, 53 - 54 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 55 - .dst_info.psize = STEDMA40_PSIZE_PHY_1, 56 - .dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, 57 - }; 58 - /* Default configuration for logical memcpy */ 59 - struct stedma40_chan_cfg dma40_memcpy_conf_log = { 60 - .dir = STEDMA40_MEM_TO_MEM, 61 - 62 - .src_info.data_width = STEDMA40_BYTE_WIDTH, 63 - .src_info.psize = STEDMA40_PSIZE_LOG_1, 64 - .src_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, 65 - 66 - .dst_info.data_width = STEDMA40_BYTE_WIDTH, 67 - .dst_info.psize = STEDMA40_PSIZE_LOG_1, 68 - .dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, 69 - }; 70 - 71 - /* 72 - * Mapping between destination event lines and physical device address. 73 - * The event line is tied to a device and therefore the address is constant. 74 - * When the address comes from a primecell it will be configured in runtime 75 - * and we set the address to -1 as a placeholder. 76 - */ 77 - static const dma_addr_t dma40_tx_map[DB8500_DMA_NR_DEV] = { 78 - /* MUSB - these will be runtime-reconfigured */ 79 - [DB8500_DMA_DEV39_USB_OTG_OEP_8] = -1, 80 - [DB8500_DMA_DEV16_USB_OTG_OEP_7_15] = -1, 81 - [DB8500_DMA_DEV17_USB_OTG_OEP_6_14] = -1, 82 - [DB8500_DMA_DEV18_USB_OTG_OEP_5_13] = -1, 83 - [DB8500_DMA_DEV19_USB_OTG_OEP_4_12] = -1, 84 - [DB8500_DMA_DEV36_USB_OTG_OEP_3_11] = -1, 85 - [DB8500_DMA_DEV37_USB_OTG_OEP_2_10] = -1, 86 - [DB8500_DMA_DEV38_USB_OTG_OEP_1_9] = -1, 87 - /* PrimeCells - run-time configured */ 88 - [DB8500_DMA_DEV0_SPI0_TX] = -1, 89 - [DB8500_DMA_DEV1_SD_MMC0_TX] = -1, 90 - [DB8500_DMA_DEV2_SD_MMC1_TX] = -1, 91 - [DB8500_DMA_DEV3_SD_MMC2_TX] = -1, 92 - [DB8500_DMA_DEV8_SSP0_TX] = -1, 93 - [DB8500_DMA_DEV9_SSP1_TX] = -1, 94 - [DB8500_DMA_DEV11_UART2_TX] = -1, 95 - [DB8500_DMA_DEV12_UART1_TX] = -1, 96 - [DB8500_DMA_DEV13_UART0_TX] = -1, 97 - [DB8500_DMA_DEV28_SD_MM2_TX] = -1, 98 - [DB8500_DMA_DEV29_SD_MM0_TX] = -1, 99 - [DB8500_DMA_DEV32_SD_MM1_TX] = -1, 100 - [DB8500_DMA_DEV33_SPI2_TX] = -1, 101 - [DB8500_DMA_DEV35_SPI1_TX] = -1, 102 - [DB8500_DMA_DEV40_SPI3_TX] = -1, 103 - [DB8500_DMA_DEV41_SD_MM3_TX] = -1, 104 - [DB8500_DMA_DEV42_SD_MM4_TX] = -1, 105 - [DB8500_DMA_DEV43_SD_MM5_TX] = -1, 106 - [DB8500_DMA_DEV14_MSP2_TX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET, 107 - [DB8500_DMA_DEV30_MSP1_TX] = U8500_MSP1_BASE + MSP_TX_RX_REG_OFFSET, 108 - [DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET, 109 - [DB8500_DMA_DEV48_CAC1_TX] = U8500_CRYP1_BASE + CRYP1_TX_REG_OFFSET, 110 - [DB8500_DMA_DEV50_HAC1_TX] = U8500_HASH1_BASE + HASH1_TX_REG_OFFSET, 111 - }; 112 - 113 - /* Mapping between source event lines and physical device address */ 114 - static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV] = { 115 - /* MUSB - these will be runtime-reconfigured */ 116 - [DB8500_DMA_DEV39_USB_OTG_IEP_8] = -1, 117 - [DB8500_DMA_DEV16_USB_OTG_IEP_7_15] = -1, 118 - [DB8500_DMA_DEV17_USB_OTG_IEP_6_14] = -1, 119 - [DB8500_DMA_DEV18_USB_OTG_IEP_5_13] = -1, 120 - [DB8500_DMA_DEV19_USB_OTG_IEP_4_12] = -1, 121 - [DB8500_DMA_DEV36_USB_OTG_IEP_3_11] = -1, 122 - [DB8500_DMA_DEV37_USB_OTG_IEP_2_10] = -1, 123 - [DB8500_DMA_DEV38_USB_OTG_IEP_1_9] = -1, 124 - /* PrimeCells */ 125 - [DB8500_DMA_DEV0_SPI0_RX] = -1, 126 - [DB8500_DMA_DEV1_SD_MMC0_RX] = -1, 127 - [DB8500_DMA_DEV2_SD_MMC1_RX] = -1, 128 - [DB8500_DMA_DEV3_SD_MMC2_RX] = -1, 129 - [DB8500_DMA_DEV8_SSP0_RX] = -1, 130 - [DB8500_DMA_DEV9_SSP1_RX] = -1, 131 - [DB8500_DMA_DEV11_UART2_RX] = -1, 132 - [DB8500_DMA_DEV12_UART1_RX] = -1, 133 - [DB8500_DMA_DEV13_UART0_RX] = -1, 134 - [DB8500_DMA_DEV28_SD_MM2_RX] = -1, 135 - [DB8500_DMA_DEV29_SD_MM0_RX] = -1, 136 - [DB8500_DMA_DEV32_SD_MM1_RX] = -1, 137 - [DB8500_DMA_DEV33_SPI2_RX] = -1, 138 - [DB8500_DMA_DEV35_SPI1_RX] = -1, 139 - [DB8500_DMA_DEV40_SPI3_RX] = -1, 140 - [DB8500_DMA_DEV41_SD_MM3_RX] = -1, 141 - [DB8500_DMA_DEV42_SD_MM4_RX] = -1, 142 - [DB8500_DMA_DEV43_SD_MM5_RX] = -1, 143 - [DB8500_DMA_DEV14_MSP2_RX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET, 144 - [DB8500_DMA_DEV30_MSP3_RX] = U8500_MSP3_BASE + MSP_TX_RX_REG_OFFSET, 145 - [DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET, 146 - [DB8500_DMA_DEV48_CAC1_RX] = U8500_CRYP1_BASE + CRYP1_RX_REG_OFFSET, 147 - }; 148 - 149 - /* Reserved event lines for memcpy only */ 150 - static int dma40_memcpy_event[] = { 151 - DB8500_DMA_MEMCPY_TX_0, 152 - DB8500_DMA_MEMCPY_TX_1, 153 - DB8500_DMA_MEMCPY_TX_2, 154 - DB8500_DMA_MEMCPY_TX_3, 155 - DB8500_DMA_MEMCPY_TX_4, 156 - DB8500_DMA_MEMCPY_TX_5, 157 - }; 158 - 159 - static struct stedma40_platform_data dma40_plat_data = { 160 - .dev_len = DB8500_DMA_NR_DEV, 161 - .dev_rx = dma40_rx_map, 162 - .dev_tx = dma40_tx_map, 163 - .memcpy = dma40_memcpy_event, 164 - .memcpy_len = ARRAY_SIZE(dma40_memcpy_event), 165 - .memcpy_conf_phy = &dma40_memcpy_conf_phy, 166 - .memcpy_conf_log = &dma40_memcpy_conf_log, 45 + struct stedma40_platform_data dma40_plat_data = { 167 46 .disabled_channels = {-1}, 168 47 }; 169 48
+67 -126
arch/arm/mach-ux500/ste-dma40-db8500.h
··· 12 12 13 13 #define DB8500_DMA_NR_DEV 64 14 14 15 - enum dma_src_dev_type { 16 - DB8500_DMA_DEV0_SPI0_RX = 0, 17 - DB8500_DMA_DEV1_SD_MMC0_RX = 1, 18 - DB8500_DMA_DEV2_SD_MMC1_RX = 2, 19 - DB8500_DMA_DEV3_SD_MMC2_RX = 3, 20 - DB8500_DMA_DEV4_I2C1_RX = 4, 21 - DB8500_DMA_DEV5_I2C3_RX = 5, 22 - DB8500_DMA_DEV6_I2C2_RX = 6, 23 - DB8500_DMA_DEV7_I2C4_RX = 7, /* Only on V1 and later */ 24 - DB8500_DMA_DEV8_SSP0_RX = 8, 25 - DB8500_DMA_DEV9_SSP1_RX = 9, 26 - DB8500_DMA_DEV10_MCDE_RX = 10, 27 - DB8500_DMA_DEV11_UART2_RX = 11, 28 - DB8500_DMA_DEV12_UART1_RX = 12, 29 - DB8500_DMA_DEV13_UART0_RX = 13, 30 - DB8500_DMA_DEV14_MSP2_RX = 14, 31 - DB8500_DMA_DEV15_I2C0_RX = 15, 32 - DB8500_DMA_DEV16_USB_OTG_IEP_7_15 = 16, 33 - DB8500_DMA_DEV17_USB_OTG_IEP_6_14 = 17, 34 - DB8500_DMA_DEV18_USB_OTG_IEP_5_13 = 18, 35 - DB8500_DMA_DEV19_USB_OTG_IEP_4_12 = 19, 36 - DB8500_DMA_DEV20_SLIM0_CH0_RX_HSI_RX_CH0 = 20, 37 - DB8500_DMA_DEV21_SLIM0_CH1_RX_HSI_RX_CH1 = 21, 38 - DB8500_DMA_DEV22_SLIM0_CH2_RX_HSI_RX_CH2 = 22, 39 - DB8500_DMA_DEV23_SLIM0_CH3_RX_HSI_RX_CH3 = 23, 40 - DB8500_DMA_DEV24_SRC_SXA0_RX_TX = 24, 41 - DB8500_DMA_DEV25_SRC_SXA1_RX_TX = 25, 42 - DB8500_DMA_DEV26_SRC_SXA2_RX_TX = 26, 43 - DB8500_DMA_DEV27_SRC_SXA3_RX_TX = 27, 44 - DB8500_DMA_DEV28_SD_MM2_RX = 28, 45 - DB8500_DMA_DEV29_SD_MM0_RX = 29, 46 - DB8500_DMA_DEV30_MSP1_RX = 30, 15 + /* 16 + * Unless otherwise specified, all channels numbers are used for 17 + * TX & RX, and can be used for either source or destination 18 + * channels. 19 + */ 20 + enum dma_dev_type { 21 + DB8500_DMA_DEV0_SPI0 = 0, 22 + DB8500_DMA_DEV1_SD_MMC0 = 1, 23 + DB8500_DMA_DEV2_SD_MMC1 = 2, 24 + DB8500_DMA_DEV3_SD_MMC2 = 3, 25 + DB8500_DMA_DEV4_I2C1 = 4, 26 + DB8500_DMA_DEV5_I2C3 = 5, 27 + DB8500_DMA_DEV6_I2C2 = 6, 28 + DB8500_DMA_DEV7_I2C4 = 7, /* Only on V1 and later */ 29 + DB8500_DMA_DEV8_SSP0 = 8, 30 + DB8500_DMA_DEV9_SSP1 = 9, 31 + DB8500_DMA_DEV10_MCDE_RX = 10, /* RX only */ 32 + DB8500_DMA_DEV11_UART2 = 11, 33 + DB8500_DMA_DEV12_UART1 = 12, 34 + DB8500_DMA_DEV13_UART0 = 13, 35 + DB8500_DMA_DEV14_MSP2 = 14, 36 + DB8500_DMA_DEV15_I2C0 = 15, 37 + DB8500_DMA_DEV16_USB_OTG_IEP_AND_OEP_7_15 = 16, 38 + DB8500_DMA_DEV17_USB_OTG_IEP_AND_OEP_6_14 = 17, 39 + DB8500_DMA_DEV18_USB_OTG_IEP_AND_OEP_5_13 = 18, 40 + DB8500_DMA_DEV19_USB_OTG_IEP_AND_OEP_4_12 = 19, 41 + DB8500_DMA_DEV20_SLIM0_CH0_HSI_CH0 = 20, 42 + DB8500_DMA_DEV21_SLIM0_CH1_HSI_CH1 = 21, 43 + DB8500_DMA_DEV22_SLIM0_CH2_HSI_CH2 = 22, 44 + DB8500_DMA_DEV23_SLIM0_CH3_HSI_CH3 = 23, 45 + DB8500_DMA_DEV24_SXA0 = 24, 46 + DB8500_DMA_DEV25_SXA1 = 25, 47 + DB8500_DMA_DEV26_SXA2 = 26, 48 + DB8500_DMA_DEV27_SXA3 = 27, 49 + DB8500_DMA_DEV28_SD_MM2 = 28, 50 + DB8500_DMA_DEV29_SD_MM0 = 29, 51 + DB8500_DMA_DEV30_MSP1 = 30, 47 52 /* On DB8500v2, MSP3 RX replaces MSP1 RX */ 48 - DB8500_DMA_DEV30_MSP3_RX = 30, 49 - DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX = 31, 50 - DB8500_DMA_DEV32_SD_MM1_RX = 32, 51 - DB8500_DMA_DEV33_SPI2_RX = 33, 52 - DB8500_DMA_DEV34_I2C3_RX2 = 34, 53 - DB8500_DMA_DEV35_SPI1_RX = 35, 54 - DB8500_DMA_DEV36_USB_OTG_IEP_3_11 = 36, 55 - DB8500_DMA_DEV37_USB_OTG_IEP_2_10 = 37, 56 - DB8500_DMA_DEV38_USB_OTG_IEP_1_9 = 38, 57 - DB8500_DMA_DEV39_USB_OTG_IEP_8 = 39, 58 - DB8500_DMA_DEV40_SPI3_RX = 40, 59 - DB8500_DMA_DEV41_SD_MM3_RX = 41, 60 - DB8500_DMA_DEV42_SD_MM4_RX = 42, 61 - DB8500_DMA_DEV43_SD_MM5_RX = 43, 62 - DB8500_DMA_DEV44_SRC_SXA4_RX_TX = 44, 63 - DB8500_DMA_DEV45_SRC_SXA5_RX_TX = 45, 64 - DB8500_DMA_DEV46_SLIM0_CH8_RX_SRC_SXA6_RX_TX = 46, 65 - DB8500_DMA_DEV47_SLIM0_CH9_RX_SRC_SXA7_RX_TX = 47, 66 - DB8500_DMA_DEV48_CAC1_RX = 48, 67 - /* 49, 50 and 51 are not used */ 68 - DB8500_DMA_DEV52_SLIM0_CH4_RX_HSI_RX_CH4 = 52, 69 - DB8500_DMA_DEV53_SLIM0_CH5_RX_HSI_RX_CH5 = 53, 70 - DB8500_DMA_DEV54_SLIM0_CH6_RX_HSI_RX_CH6 = 54, 71 - DB8500_DMA_DEV55_SLIM0_CH7_RX_HSI_RX_CH7 = 55, 72 - /* 56, 57, 58, 59 and 60 are not used */ 73 - DB8500_DMA_DEV61_CAC0_RX = 61, 74 - /* 62 and 63 are not used */ 75 - }; 76 - 77 - enum dma_dest_dev_type { 78 - DB8500_DMA_DEV0_SPI0_TX = 0, 79 - DB8500_DMA_DEV1_SD_MMC0_TX = 1, 80 - DB8500_DMA_DEV2_SD_MMC1_TX = 2, 81 - DB8500_DMA_DEV3_SD_MMC2_TX = 3, 82 - DB8500_DMA_DEV4_I2C1_TX = 4, 83 - DB8500_DMA_DEV5_I2C3_TX = 5, 84 - DB8500_DMA_DEV6_I2C2_TX = 6, 85 - DB8500_DMA_DEV7_I2C4_TX = 7, /* Only on V1 and later */ 86 - DB8500_DMA_DEV8_SSP0_TX = 8, 87 - DB8500_DMA_DEV9_SSP1_TX = 9, 88 - /* 10 is not used*/ 89 - DB8500_DMA_DEV11_UART2_TX = 11, 90 - DB8500_DMA_DEV12_UART1_TX = 12, 91 - DB8500_DMA_DEV13_UART0_TX = 13, 92 - DB8500_DMA_DEV14_MSP2_TX = 14, 93 - DB8500_DMA_DEV15_I2C0_TX = 15, 94 - DB8500_DMA_DEV16_USB_OTG_OEP_7_15 = 16, 95 - DB8500_DMA_DEV17_USB_OTG_OEP_6_14 = 17, 96 - DB8500_DMA_DEV18_USB_OTG_OEP_5_13 = 18, 97 - DB8500_DMA_DEV19_USB_OTG_OEP_4_12 = 19, 98 - DB8500_DMA_DEV20_SLIM0_CH0_TX_HSI_TX_CH0 = 20, 99 - DB8500_DMA_DEV21_SLIM0_CH1_TX_HSI_TX_CH1 = 21, 100 - DB8500_DMA_DEV22_SLIM0_CH2_TX_HSI_TX_CH2 = 22, 101 - DB8500_DMA_DEV23_SLIM0_CH3_TX_HSI_TX_CH3 = 23, 102 - DB8500_DMA_DEV24_DST_SXA0_RX_TX = 24, 103 - DB8500_DMA_DEV25_DST_SXA1_RX_TX = 25, 104 - DB8500_DMA_DEV26_DST_SXA2_RX_TX = 26, 105 - DB8500_DMA_DEV27_DST_SXA3_RX_TX = 27, 106 - DB8500_DMA_DEV28_SD_MM2_TX = 28, 107 - DB8500_DMA_DEV29_SD_MM0_TX = 29, 108 - DB8500_DMA_DEV30_MSP1_TX = 30, 109 - DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX = 31, 110 - DB8500_DMA_DEV32_SD_MM1_TX = 32, 111 - DB8500_DMA_DEV33_SPI2_TX = 33, 112 - DB8500_DMA_DEV34_I2C3_TX2 = 34, 113 - DB8500_DMA_DEV35_SPI1_TX = 35, 114 - DB8500_DMA_DEV36_USB_OTG_OEP_3_11 = 36, 115 - DB8500_DMA_DEV37_USB_OTG_OEP_2_10 = 37, 116 - DB8500_DMA_DEV38_USB_OTG_OEP_1_9 = 38, 117 - DB8500_DMA_DEV39_USB_OTG_OEP_8 = 39, 118 - DB8500_DMA_DEV40_SPI3_TX = 40, 119 - DB8500_DMA_DEV41_SD_MM3_TX = 41, 120 - DB8500_DMA_DEV42_SD_MM4_TX = 42, 121 - DB8500_DMA_DEV43_SD_MM5_TX = 43, 122 - DB8500_DMA_DEV44_DST_SXA4_RX_TX = 44, 123 - DB8500_DMA_DEV45_DST_SXA5_RX_TX = 45, 124 - DB8500_DMA_DEV46_SLIM0_CH8_TX_DST_SXA6_RX_TX = 46, 125 - DB8500_DMA_DEV47_SLIM0_CH9_TX_DST_SXA7_RX_TX = 47, 126 - DB8500_DMA_DEV48_CAC1_TX = 48, 127 - DB8500_DMA_DEV49_CAC1_TX_HAC1_TX = 49, 128 - DB8500_DMA_DEV50_HAC1_TX = 50, 129 - DB8500_DMA_MEMCPY_TX_0 = 51, 130 - DB8500_DMA_DEV52_SLIM1_CH4_TX_HSI_TX_CH4 = 52, 131 - DB8500_DMA_DEV53_SLIM1_CH5_TX_HSI_TX_CH5 = 53, 132 - DB8500_DMA_DEV54_SLIM1_CH6_TX_HSI_TX_CH6 = 54, 133 - DB8500_DMA_DEV55_SLIM1_CH7_TX_HSI_TX_CH7 = 55, 134 - DB8500_DMA_MEMCPY_TX_1 = 56, 135 - DB8500_DMA_MEMCPY_TX_2 = 57, 136 - DB8500_DMA_MEMCPY_TX_3 = 58, 137 - DB8500_DMA_MEMCPY_TX_4 = 59, 138 - DB8500_DMA_MEMCPY_TX_5 = 60, 139 - DB8500_DMA_DEV61_CAC0_TX = 61, 140 - DB8500_DMA_DEV62_CAC0_TX_HAC0_TX = 62, 141 - DB8500_DMA_DEV63_HAC0_TX = 63, 53 + DB8500_DMA_DEV30_MSP3 = 30, 54 + DB8500_DMA_DEV31_MSP0_SLIM0_CH0 = 31, 55 + DB8500_DMA_DEV32_SD_MM1 = 32, 56 + DB8500_DMA_DEV33_SPI2 = 33, 57 + DB8500_DMA_DEV34_I2C3_RX2_TX2 = 34, 58 + DB8500_DMA_DEV35_SPI1 = 35, 59 + DB8500_DMA_DEV36_USB_OTG_IEP_AND_OEP_3_11 = 36, 60 + DB8500_DMA_DEV37_USB_OTG_IEP_AND_OEP_2_10 = 37, 61 + DB8500_DMA_DEV38_USB_OTG_IEP_AND_OEP_1_9 = 38, 62 + DB8500_DMA_DEV39_USB_OTG_IEP_AND_OEP_8 = 39, 63 + DB8500_DMA_DEV40_SPI3 = 40, 64 + DB8500_DMA_DEV41_SD_MM3 = 41, 65 + DB8500_DMA_DEV42_SD_MM4 = 42, 66 + DB8500_DMA_DEV43_SD_MM5 = 43, 67 + DB8500_DMA_DEV44_SXA4 = 44, 68 + DB8500_DMA_DEV45_SXA5 = 45, 69 + DB8500_DMA_DEV46_SLIM0_CH8_SRC_SXA6 = 46, 70 + DB8500_DMA_DEV47_SLIM0_CH9_SRC_SXA7 = 47, 71 + DB8500_DMA_DEV48_CAC1 = 48, 72 + DB8500_DMA_DEV49_CAC1_TX_HAC1_TX = 49, /* TX only */ 73 + DB8500_DMA_DEV50_HAC1_TX = 50, /* TX only */ 74 + DB8500_DMA_MEMCPY_TX_0 = 51, /* TX only */ 75 + DB8500_DMA_DEV52_SLIM0_CH4_HSI_CH4 = 52, 76 + DB8500_DMA_DEV53_SLIM0_CH5_HSI_CH5 = 53, 77 + DB8500_DMA_DEV54_SLIM0_CH6_HSI_CH6 = 54, 78 + DB8500_DMA_DEV55_SLIM0_CH7_HSI_CH7 = 55, 79 + /* 56 -> 60 are channels reserved for memcpy only */ 80 + DB8500_DMA_DEV61_CAC0 = 61, 81 + DB8500_DMA_DEV62_CAC0_TX_HAC0_TX = 62, /* TX only */ 82 + DB8500_DMA_DEV63_HAC0_TX = 63, /* TX only */ 142 83 }; 143 84 144 85 #endif
+12 -35
arch/arm/mach-ux500/usb.c
··· 14 14 15 15 #define MUSB_DMA40_RX_CH { \ 16 16 .mode = STEDMA40_MODE_LOGICAL, \ 17 - .dir = STEDMA40_PERIPH_TO_MEM, \ 18 - .dst_dev_type = STEDMA40_DEV_DST_MEMORY, \ 19 - .src_info.data_width = STEDMA40_WORD_WIDTH, \ 20 - .dst_info.data_width = STEDMA40_WORD_WIDTH, \ 21 - .src_info.psize = STEDMA40_PSIZE_LOG_16, \ 22 - .dst_info.psize = STEDMA40_PSIZE_LOG_16, \ 17 + .dir = DMA_DEV_TO_MEM, \ 23 18 } 24 19 25 20 #define MUSB_DMA40_TX_CH { \ 26 21 .mode = STEDMA40_MODE_LOGICAL, \ 27 - .dir = STEDMA40_MEM_TO_PERIPH, \ 28 - .src_dev_type = STEDMA40_DEV_SRC_MEMORY, \ 29 - .src_info.data_width = STEDMA40_WORD_WIDTH, \ 30 - .dst_info.data_width = STEDMA40_WORD_WIDTH, \ 31 - .src_info.psize = STEDMA40_PSIZE_LOG_16, \ 32 - .dst_info.psize = STEDMA40_PSIZE_LOG_16, \ 22 + .dir = DMA_MEM_TO_DEV, \ 33 23 } 34 24 35 - static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_CHANNELS] 25 + static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] 36 26 = { 37 27 MUSB_DMA40_RX_CH, 38 28 MUSB_DMA40_RX_CH, ··· 34 44 MUSB_DMA40_RX_CH 35 45 }; 36 46 37 - static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_TX_CHANNELS] 47 + static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] 38 48 = { 39 49 MUSB_DMA40_TX_CH, 40 50 MUSB_DMA40_TX_CH, ··· 46 56 MUSB_DMA40_TX_CH, 47 57 }; 48 58 49 - static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_CHANNELS] = { 59 + static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] = { 50 60 &musb_dma_rx_ch[0], 51 61 &musb_dma_rx_ch[1], 52 62 &musb_dma_rx_ch[2], ··· 57 67 &musb_dma_rx_ch[7] 58 68 }; 59 69 60 - static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_TX_CHANNELS] = { 70 + static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] = { 61 71 &musb_dma_tx_ch[0], 62 72 &musb_dma_tx_ch[1], 63 73 &musb_dma_tx_ch[2], ··· 71 81 static struct ux500_musb_board_data musb_board_data = { 72 82 .dma_rx_param_array = ux500_dma_rx_param_array, 73 83 .dma_tx_param_array = ux500_dma_tx_param_array, 74 - .num_rx_channels = UX500_MUSB_DMA_NUM_RX_CHANNELS, 75 - .num_tx_channels = UX500_MUSB_DMA_NUM_TX_CHANNELS, 76 84 .dma_filter = stedma40_filter, 77 - }; 78 - 79 - static u64 ux500_musb_dmamask = DMA_BIT_MASK(32); 80 - 81 - static struct musb_hdrc_config musb_hdrc_config = { 82 - .multipoint = true, 83 - .dyn_fifo = true, 84 - .num_eps = 16, 85 - .ram_bits = 16, 86 85 }; 87 86 88 87 static struct musb_hdrc_platform_data musb_platform_data = { 89 88 .mode = MUSB_OTG, 90 - .config = &musb_hdrc_config, 91 89 .board_data = &musb_board_data, 92 90 }; 93 91 ··· 96 118 .id = 0, 97 119 .dev = { 98 120 .platform_data = &musb_platform_data, 99 - .dma_mask = &ux500_musb_dmamask, 100 121 .coherent_dma_mask = DMA_BIT_MASK(32), 101 122 }, 102 123 .num_resources = ARRAY_SIZE(usb_resources), 103 124 .resource = usb_resources, 104 125 }; 105 126 106 - static inline void ux500_usb_dma_update_rx_ch_config(int *src_dev_type) 127 + static inline void ux500_usb_dma_update_rx_ch_config(int *dev_type) 107 128 { 108 129 u32 idx; 109 130 110 - for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_CHANNELS; idx++) 111 - musb_dma_rx_ch[idx].src_dev_type = src_dev_type[idx]; 131 + for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; idx++) 132 + musb_dma_rx_ch[idx].dev_type = dev_type[idx]; 112 133 } 113 134 114 - static inline void ux500_usb_dma_update_tx_ch_config(int *dst_dev_type) 135 + static inline void ux500_usb_dma_update_tx_ch_config(int *dev_type) 115 136 { 116 137 u32 idx; 117 138 118 - for (idx = 0; idx < UX500_MUSB_DMA_NUM_TX_CHANNELS; idx++) 119 - musb_dma_tx_ch[idx].dst_dev_type = dst_dev_type[idx]; 139 + for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; idx++) 140 + musb_dma_tx_ch[idx].dev_type = dev_type[idx]; 120 141 } 121 142 122 143 void ux500_add_usb(struct device *parent, resource_size_t base, int irq,
-16
arch/arm/plat-omap/Kconfig
··· 86 86 to change the pin multiplexing setup. When there are no warnings 87 87 printed, it's safe to deselect OMAP_MUX for your product. 88 88 89 - config OMAP_MBOX_FWK 90 - tristate "Mailbox framework support" 91 - depends on ARCH_OMAP && !ARCH_MULTIPLATFORM 92 - help 93 - Say Y here if you want to use OMAP Mailbox framework support for 94 - DSP, IVA1.0 and IVA2 in OMAP1/2/3. 95 - 96 - config OMAP_MBOX_KFIFO_SIZE 97 - int "Mailbox kfifo default buffer size (bytes)" 98 - depends on OMAP_MBOX_FWK 99 - default 256 100 - help 101 - Specify the default size of mailbox's kfifo buffers (bytes). 102 - This can also be changed at runtime (via the mbox_kfifo_size 103 - module parameter). 104 - 105 89 config OMAP_IOMMU_IVA2 106 90 bool 107 91
-3
arch/arm/plat-omap/Makefile
··· 17 17 i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o 18 18 obj-y += $(i2c-omap-m) $(i2c-omap-y) 19 19 20 - # OMAP mailbox framework 21 - obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o 22 -
+16 -54
arch/arm/plat-omap/include/plat/mailbox.h drivers/mailbox/omap-mbox.h
··· 1 - /* mailbox.h */ 1 + /* 2 + * omap-mbox.h: OMAP mailbox internal definitions 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 2 8 3 - #ifndef MAILBOX_H 4 - #define MAILBOX_H 9 + #ifndef OMAP_MBOX_H 10 + #define OMAP_MBOX_H 5 11 12 + #include <linux/device.h> 13 + #include <linux/interrupt.h> 14 + #include <linux/kfifo.h> 6 15 #include <linux/spinlock.h> 7 16 #include <linux/workqueue.h> 8 - #include <linux/interrupt.h> 9 - #include <linux/device.h> 10 - #include <linux/kfifo.h> 11 - 12 - typedef u32 mbox_msg_t; 13 - struct omap_mbox; 14 - 15 - typedef int __bitwise omap_mbox_irq_t; 16 - #define IRQ_TX ((__force omap_mbox_irq_t) 1) 17 - #define IRQ_RX ((__force omap_mbox_irq_t) 2) 17 + #include <linux/omap-mailbox.h> 18 18 19 19 typedef int __bitwise omap_mbox_type_t; 20 20 #define OMAP_MBOX_TYPE1 ((__force omap_mbox_type_t) 1) ··· 51 51 }; 52 52 53 53 struct omap_mbox { 54 - char *name; 54 + const char *name; 55 55 unsigned int irq; 56 56 struct omap_mbox_queue *txq, *rxq; 57 57 struct omap_mbox_ops *ops; 58 58 struct device *dev; 59 59 void *priv; 60 60 int use_count; 61 - struct blocking_notifier_head notifier; 61 + struct blocking_notifier_head notifier; 62 62 }; 63 - 64 - int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); 65 - void omap_mbox_init_seq(struct omap_mbox *); 66 - 67 - struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb); 68 - void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb); 69 63 70 64 int omap_mbox_register(struct device *parent, struct omap_mbox **); 71 65 int omap_mbox_unregister(void); 72 66 73 - static inline void omap_mbox_save_ctx(struct omap_mbox *mbox) 74 - { 75 - if (!mbox->ops->save_ctx) { 76 - dev_err(mbox->dev, "%s:\tno save\n", __func__); 77 - return; 78 - } 79 - 80 - mbox->ops->save_ctx(mbox); 81 - } 82 - 83 - static inline void omap_mbox_restore_ctx(struct omap_mbox *mbox) 84 - { 85 - if (!mbox->ops->restore_ctx) { 86 - dev_err(mbox->dev, "%s:\tno restore\n", __func__); 87 - return; 88 - } 89 - 90 - mbox->ops->restore_ctx(mbox); 91 - } 92 - 93 - static inline void omap_mbox_enable_irq(struct omap_mbox *mbox, 94 - omap_mbox_irq_t irq) 95 - { 96 - mbox->ops->enable_irq(mbox, irq); 97 - } 98 - 99 - static inline void omap_mbox_disable_irq(struct omap_mbox *mbox, 100 - omap_mbox_irq_t irq) 101 - { 102 - mbox->ops->disable_irq(mbox, irq); 103 - } 104 - 105 - #endif /* MAILBOX_H */ 67 + #endif /* OMAP_MBOX_H */
+44 -10
arch/arm/plat-omap/mailbox.c drivers/mailbox/omap-mailbox.c
··· 31 31 #include <linux/notifier.h> 32 32 #include <linux/module.h> 33 33 34 - #include <plat/mailbox.h> 34 + #include "omap-mbox.h" 35 35 36 36 static struct omap_mbox **mboxes; 37 37 ··· 115 115 return ret; 116 116 } 117 117 EXPORT_SYMBOL(omap_mbox_msg_send); 118 + 119 + void omap_mbox_save_ctx(struct omap_mbox *mbox) 120 + { 121 + if (!mbox->ops->save_ctx) { 122 + dev_err(mbox->dev, "%s:\tno save\n", __func__); 123 + return; 124 + } 125 + 126 + mbox->ops->save_ctx(mbox); 127 + } 128 + EXPORT_SYMBOL(omap_mbox_save_ctx); 129 + 130 + void omap_mbox_restore_ctx(struct omap_mbox *mbox) 131 + { 132 + if (!mbox->ops->restore_ctx) { 133 + dev_err(mbox->dev, "%s:\tno restore\n", __func__); 134 + return; 135 + } 136 + 137 + mbox->ops->restore_ctx(mbox); 138 + } 139 + EXPORT_SYMBOL(omap_mbox_restore_ctx); 140 + 141 + void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 142 + { 143 + mbox->ops->enable_irq(mbox, irq); 144 + } 145 + EXPORT_SYMBOL(omap_mbox_enable_irq); 146 + 147 + void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 148 + { 149 + mbox->ops->disable_irq(mbox, irq); 150 + } 151 + EXPORT_SYMBOL(omap_mbox_disable_irq); 118 152 119 153 static void mbox_tx_tasklet(unsigned long tx_data) 120 154 { ··· 295 261 } 296 262 297 263 if (!mbox->use_count++) { 298 - ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED, 299 - mbox->name, mbox); 300 - if (unlikely(ret)) { 301 - pr_err("failed to register mailbox interrupt:%d\n", 302 - ret); 303 - goto fail_request_irq; 304 - } 305 264 mq = mbox_queue_alloc(mbox, NULL, mbox_tx_tasklet); 306 265 if (!mq) { 307 266 ret = -ENOMEM; ··· 309 282 } 310 283 mbox->rxq = mq; 311 284 mq->mbox = mbox; 285 + ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED, 286 + mbox->name, mbox); 287 + if (unlikely(ret)) { 288 + pr_err("failed to register mailbox interrupt:%d\n", 289 + ret); 290 + goto fail_request_irq; 291 + } 312 292 313 293 omap_mbox_enable_irq(mbox, IRQ_RX); 314 294 } 315 295 mutex_unlock(&mbox_configured_lock); 316 296 return 0; 317 297 298 + fail_request_irq: 299 + mbox_queue_free(mbox->rxq); 318 300 fail_alloc_rxq: 319 301 mbox_queue_free(mbox->txq); 320 302 fail_alloc_txq: 321 - free_irq(mbox->irq, mbox); 322 - fail_request_irq: 323 303 if (mbox->ops->shutdown) 324 304 mbox->ops->shutdown(mbox); 325 305 mbox->use_count--;
+5 -5
arch/arm/plat-samsung/include/plat/cpu-freq-core.h
··· 202 202 extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void); 203 203 extern struct s3c_iotimings *s3c_cpufreq_getiotimings(void); 204 204 205 - #ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS 205 + #ifdef CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS 206 206 #define s3c_cpufreq_debugfs_call(x) x 207 207 #else 208 208 #define s3c_cpufreq_debugfs_call(x) NULL ··· 259 259 #define s3c2412_iotiming_set NULL 260 260 #endif /* CONFIG_S3C2412_IOTIMING */ 261 261 262 - #ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUG 262 + #ifdef CONFIG_ARM_S3C24XX_CPUFREQ_DEBUG 263 263 #define s3c_freq_dbg(x...) printk(KERN_INFO x) 264 264 #else 265 265 #define s3c_freq_dbg(x...) do { if (0) printk(x); } while (0) 266 - #endif /* CONFIG_CPU_FREQ_S3C24XX_DEBUG */ 266 + #endif /* CONFIG_ARM_S3C24XX_CPUFREQ_DEBUG */ 267 267 268 - #ifdef CONFIG_CPU_FREQ_S3C24XX_IODEBUG 268 + #ifdef CONFIG_ARM_S3C24XX_CPUFREQ_IODEBUG 269 269 #define s3c_freq_iodbg(x...) printk(KERN_INFO x) 270 270 #else 271 271 #define s3c_freq_iodbg(x...) do { if (0) printk(x); } while (0) 272 - #endif /* CONFIG_CPU_FREQ_S3C24XX_IODEBUG */ 272 + #endif /* CONFIG_ARM_S3C24XX_CPUFREQ_IODEBUG */ 273 273 274 274 static inline int s3c_cpufreq_addfreq(struct cpufreq_frequency_table *table, 275 275 int index, size_t table_size,
+3 -3
arch/arm/plat-samsung/include/plat/cpu-freq.h
··· 126 126 }; 127 127 128 128 /* Things depending on frequency scaling. */ 129 - #ifdef CONFIG_CPU_FREQ_S3C 129 + #ifdef CONFIG_ARM_S3C_CPUFREQ 130 130 #define __init_or_cpufreq 131 131 #else 132 132 #define __init_or_cpufreq __init ··· 134 134 135 135 /* Board functions */ 136 136 137 - #ifdef CONFIG_CPU_FREQ_S3C 137 + #ifdef CONFIG_ARM_S3C_CPUFREQ 138 138 extern int s3c_cpufreq_setboard(struct s3c_cpufreq_board *board); 139 139 #else 140 140 ··· 142 142 { 143 143 return 0; 144 144 } 145 - #endif /* CONFIG_CPU_FREQ_S3C */ 145 + #endif /* CONFIG_ARM_S3C_CPUFREQ */
+1
drivers/clk/samsung/Makefile
··· 6 6 obj-$(CONFIG_ARCH_EXYNOS4) += clk-exynos4.o 7 7 obj-$(CONFIG_SOC_EXYNOS5250) += clk-exynos5250.o 8 8 obj-$(CONFIG_SOC_EXYNOS5440) += clk-exynos5440.o 9 + obj-$(CONFIG_ARCH_EXYNOS) += clk-exynos-audss.o
+133
drivers/clk/samsung/clk-exynos-audss.c
··· 1 + /* 2 + * Copyright (c) 2013 Samsung Electronics Co., Ltd. 3 + * Author: Padmavathi Venna <padma.v@samsung.com> 4 + * 5 + * This program is free software; you can redistribute it and/or modify 6 + * it under the terms of the GNU General Public License version 2 as 7 + * published by the Free Software Foundation. 8 + * 9 + * Common Clock Framework support for Audio Subsystem Clock Controller. 10 + */ 11 + 12 + #include <linux/clkdev.h> 13 + #include <linux/io.h> 14 + #include <linux/clk-provider.h> 15 + #include <linux/of_address.h> 16 + #include <linux/syscore_ops.h> 17 + 18 + #include <dt-bindings/clk/exynos-audss-clk.h> 19 + 20 + static DEFINE_SPINLOCK(lock); 21 + static struct clk **clk_table; 22 + static void __iomem *reg_base; 23 + static struct clk_onecell_data clk_data; 24 + 25 + #define ASS_CLK_SRC 0x0 26 + #define ASS_CLK_DIV 0x4 27 + #define ASS_CLK_GATE 0x8 28 + 29 + static unsigned long reg_save[][2] = { 30 + {ASS_CLK_SRC, 0}, 31 + {ASS_CLK_DIV, 0}, 32 + {ASS_CLK_GATE, 0}, 33 + }; 34 + 35 + /* list of all parent clock list */ 36 + static const char *mout_audss_p[] = { "fin_pll", "fout_epll" }; 37 + static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" }; 38 + 39 + #ifdef CONFIG_PM_SLEEP 40 + static int exynos_audss_clk_suspend(void) 41 + { 42 + int i; 43 + 44 + for (i = 0; i < ARRAY_SIZE(reg_save); i++) 45 + reg_save[i][1] = readl(reg_base + reg_save[i][0]); 46 + 47 + return 0; 48 + } 49 + 50 + static void exynos_audss_clk_resume(void) 51 + { 52 + int i; 53 + 54 + for (i = 0; i < ARRAY_SIZE(reg_save); i++) 55 + writel(reg_save[i][1], reg_base + reg_save[i][0]); 56 + } 57 + 58 + static struct syscore_ops exynos_audss_clk_syscore_ops = { 59 + .suspend = exynos_audss_clk_suspend, 60 + .resume = exynos_audss_clk_resume, 61 + }; 62 + #endif /* CONFIG_PM_SLEEP */ 63 + 64 + /* register exynos_audss clocks */ 65 + void __init exynos_audss_clk_init(struct device_node *np) 66 + { 67 + reg_base = of_iomap(np, 0); 68 + if (!reg_base) { 69 + pr_err("%s: failed to map audss registers\n", __func__); 70 + return; 71 + } 72 + 73 + clk_table = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS, 74 + GFP_KERNEL); 75 + if (!clk_table) { 76 + pr_err("%s: could not allocate clk lookup table\n", __func__); 77 + return; 78 + } 79 + 80 + clk_data.clks = clk_table; 81 + clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS; 82 + of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 83 + 84 + clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss", 85 + mout_audss_p, ARRAY_SIZE(mout_audss_p), 0, 86 + reg_base + ASS_CLK_SRC, 0, 1, 0, &lock); 87 + 88 + clk_table[EXYNOS_MOUT_I2S] = clk_register_mux(NULL, "mout_i2s", 89 + mout_i2s_p, ARRAY_SIZE(mout_i2s_p), 0, 90 + reg_base + ASS_CLK_SRC, 2, 2, 0, &lock); 91 + 92 + clk_table[EXYNOS_DOUT_SRP] = clk_register_divider(NULL, "dout_srp", 93 + "mout_audss", 0, reg_base + ASS_CLK_DIV, 0, 4, 94 + 0, &lock); 95 + 96 + clk_table[EXYNOS_DOUT_AUD_BUS] = clk_register_divider(NULL, 97 + "dout_aud_bus", "dout_srp", 0, 98 + reg_base + ASS_CLK_DIV, 4, 4, 0, &lock); 99 + 100 + clk_table[EXYNOS_DOUT_I2S] = clk_register_divider(NULL, "dout_i2s", 101 + "mout_i2s", 0, reg_base + ASS_CLK_DIV, 8, 4, 0, 102 + &lock); 103 + 104 + clk_table[EXYNOS_SRP_CLK] = clk_register_gate(NULL, "srp_clk", 105 + "dout_srp", CLK_SET_RATE_PARENT, 106 + reg_base + ASS_CLK_GATE, 0, 0, &lock); 107 + 108 + clk_table[EXYNOS_I2S_BUS] = clk_register_gate(NULL, "i2s_bus", 109 + "dout_aud_bus", CLK_SET_RATE_PARENT, 110 + reg_base + ASS_CLK_GATE, 2, 0, &lock); 111 + 112 + clk_table[EXYNOS_SCLK_I2S] = clk_register_gate(NULL, "sclk_i2s", 113 + "dout_i2s", CLK_SET_RATE_PARENT, 114 + reg_base + ASS_CLK_GATE, 3, 0, &lock); 115 + 116 + clk_table[EXYNOS_PCM_BUS] = clk_register_gate(NULL, "pcm_bus", 117 + "sclk_pcm", CLK_SET_RATE_PARENT, 118 + reg_base + ASS_CLK_GATE, 4, 0, &lock); 119 + 120 + clk_table[EXYNOS_SCLK_PCM] = clk_register_gate(NULL, "sclk_pcm", 121 + "div_pcm0", CLK_SET_RATE_PARENT, 122 + reg_base + ASS_CLK_GATE, 5, 0, &lock); 123 + 124 + #ifdef CONFIG_PM_SLEEP 125 + register_syscore_ops(&exynos_audss_clk_syscore_ops); 126 + #endif 127 + 128 + pr_info("Exynos: Audss: clock setup completed\n"); 129 + } 130 + CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock", 131 + exynos_audss_clk_init); 132 + CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock", 133 + exynos_audss_clk_init);
+3 -2
drivers/clk/samsung/clk-exynos5250.c
··· 87 87 sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3, 88 88 sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm, 89 89 sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2, 90 + div_i2s1, div_i2s2, 90 91 91 92 /* gate clocks */ 92 93 gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0, ··· 292 291 DIV(none, "div_pcm1", "sclk_audio1", DIV_PERIC4, 4, 8), 293 292 DIV(none, "div_audio2", "mout_audio2", DIV_PERIC4, 16, 4), 294 293 DIV(none, "div_pcm2", "sclk_audio2", DIV_PERIC4, 20, 8), 295 - DIV(none, "div_i2s1", "sclk_audio1", DIV_PERIC5, 0, 6), 296 - DIV(none, "div_i2s2", "sclk_audio2", DIV_PERIC5, 8, 6), 294 + DIV(div_i2s1, "div_i2s1", "sclk_audio1", DIV_PERIC5, 0, 6), 295 + DIV(div_i2s2, "div_i2s2", "sclk_audio2", DIV_PERIC5, 8, 6), 297 296 DIV(sclk_pixel, "div_hdmi_pixel", "sclk_vpll", DIV_DISP1_0, 28, 4), 298 297 DIV_A(none, "armclk", "div_arm", DIV_CPU0, 28, 3, "armclk"), 299 298 DIV_F(none, "div_mipi1_pre", "div_mipi1",
+5 -6
drivers/clocksource/clksrc-dbx500-prcmu.c
··· 10 10 * DBx500-PRCMU Timer 11 11 * The PRCMU has 5 timers which are available in a always-on 12 12 * power domain. We use the Timer 4 for our always-on clock 13 - * source on DB8500 and Timer 3 on DB5500. 13 + * source on DB8500. 14 14 */ 15 15 #include <linux/clockchips.h> 16 16 #include <linux/clksrc-dbx500-prcmu.h> ··· 30 30 31 31 static void __iomem *clksrc_dbx500_timer_base; 32 32 33 - static cycle_t clksrc_dbx500_prcmu_read(struct clocksource *cs) 33 + static cycle_t notrace clksrc_dbx500_prcmu_read(struct clocksource *cs) 34 34 { 35 + void __iomem *base = clksrc_dbx500_timer_base; 35 36 u32 count, count2; 36 37 37 38 do { 38 - count = readl(clksrc_dbx500_timer_base + 39 - PRCMU_TIMER_DOWNCOUNT); 40 - count2 = readl(clksrc_dbx500_timer_base + 41 - PRCMU_TIMER_DOWNCOUNT); 39 + count = readl_relaxed(base + PRCMU_TIMER_DOWNCOUNT); 40 + count2 = readl_relaxed(base + PRCMU_TIMER_DOWNCOUNT); 42 41 } while (count2 != count); 43 42 44 43 /* Negate because the timer is a decrementing counter */
+58
drivers/cpufreq/Kconfig.arm
··· 96 96 default ARCH_OMAP2PLUS 97 97 select CPU_FREQ_TABLE 98 98 99 + config ARM_S3C_CPUFREQ 100 + bool 101 + help 102 + Internal configuration node for common cpufreq on Samsung SoC 103 + 104 + config ARM_S3C24XX_CPUFREQ 105 + bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)" 106 + depends on ARCH_S3C24XX 107 + select ARM_S3C_CPUFREQ 108 + help 109 + This enables the CPUfreq driver for the Samsung S3C24XX family 110 + of CPUs. 111 + 112 + For details, take a look at <file:Documentation/cpu-freq>. 113 + 114 + If in doubt, say N. 115 + 116 + config ARM_S3C24XX_CPUFREQ_DEBUG 117 + bool "Debug CPUfreq Samsung driver core" 118 + depends on ARM_S3C24XX_CPUFREQ 119 + help 120 + Enable s3c_freq_dbg for the Samsung S3C CPUfreq core 121 + 122 + config ARM_S3C24XX_CPUFREQ_IODEBUG 123 + bool "Debug CPUfreq Samsung driver IO timing" 124 + depends on ARM_S3C24XX_CPUFREQ 125 + help 126 + Enable s3c_freq_iodbg for the Samsung S3C CPUfreq core 127 + 128 + config ARM_S3C24XX_CPUFREQ_DEBUGFS 129 + bool "Export debugfs for CPUFreq" 130 + depends on ARM_S3C24XX_CPUFREQ && DEBUG_FS 131 + help 132 + Export status information via debugfs. 133 + 134 + config ARM_S3C2410_CPUFREQ 135 + bool 136 + depends on ARM_S3C24XX_CPUFREQ && CPU_S3C2410 137 + select S3C2410_CPUFREQ_UTILS 138 + help 139 + CPU Frequency scaling support for S3C2410 140 + 141 + config ARM_S3C2412_CPUFREQ 142 + bool 143 + depends on ARM_S3C24XX_CPUFREQ && CPU_S3C2412 144 + default y 145 + select S3C2412_IOTIMING 146 + help 147 + CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs. 148 + 99 149 config ARM_S3C2416_CPUFREQ 100 150 bool "S3C2416 CPU Frequency scaling support" 101 151 depends on CPU_S3C2416 ··· 167 117 tests but not documented in any datasheet. 168 118 169 119 If in doubt, say N. 120 + 121 + config ARM_S3C2440_CPUFREQ 122 + bool "S3C2440/S3C2442 CPU Frequency scaling support" 123 + depends on ARM_S3C24XX_CPUFREQ && (CPU_S3C2440 || CPU_S3C2442) 124 + select S3C2410_CPUFREQ_UTILS 125 + default y 126 + help 127 + CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs. 170 128 171 129 config ARM_S3C64XX_CPUFREQ 172 130 bool "Samsung S3C64XX"
+5
drivers/cpufreq/Makefile
··· 65 65 obj-$(CONFIG_PXA25x) += pxa2xx-cpufreq.o 66 66 obj-$(CONFIG_PXA27x) += pxa2xx-cpufreq.o 67 67 obj-$(CONFIG_PXA3xx) += pxa3xx-cpufreq.o 68 + obj-$(CONFIG_ARM_S3C24XX_CPUFREQ) += s3c24xx-cpufreq.o 69 + obj-$(CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS) += s3c24xx-cpufreq-debugfs.o 70 + obj-$(CONFIG_ARM_S3C2410_CPUFREQ) += s3c2410-cpufreq.o 71 + obj-$(CONFIG_ARM_S3C2412_CPUFREQ) += s3c2412-cpufreq.o 68 72 obj-$(CONFIG_ARM_S3C2416_CPUFREQ) += s3c2416-cpufreq.o 73 + obj-$(CONFIG_ARM_S3C2440_CPUFREQ) += s3c2440-cpufreq.o 69 74 obj-$(CONFIG_ARM_S3C64XX_CPUFREQ) += s3c64xx-cpufreq.o 70 75 obj-$(CONFIG_ARM_S5PV210_CPUFREQ) += s5pv210-cpufreq.o 71 76 obj-$(CONFIG_ARM_SA1100_CPUFREQ) += sa1100-cpufreq.o
+2 -2
drivers/crypto/ux500/cryp/cryp.c
··· 291 291 int cryp_mode) 292 292 { 293 293 enum cryp_algo_mode algomode; 294 - struct cryp_register *src_reg = device_data->base; 294 + struct cryp_register __iomem *src_reg = device_data->base; 295 295 struct cryp_config *config = 296 296 (struct cryp_config *)device_data->current_ctx; 297 297 ··· 349 349 void cryp_restore_device_context(struct cryp_device_data *device_data, 350 350 struct cryp_device_context *ctx) 351 351 { 352 - struct cryp_register *reg = device_data->base; 352 + struct cryp_register __iomem *reg = device_data->base; 353 353 struct cryp_config *config = 354 354 (struct cryp_config *)device_data->current_ctx; 355 355
+6 -1
drivers/crypto/ux500/cryp/cryp.h
··· 114 114 }; 115 115 116 116 /* Cryp DMA interface */ 117 + #define CRYP_DMA_TX_FIFO 0x08 118 + #define CRYP_DMA_RX_FIFO 0x10 119 + 117 120 enum cryp_dma_req_type { 118 121 CRYP_DMA_DISABLE_BOTH, 119 122 CRYP_DMA_ENABLE_IN_DATA, ··· 220 217 221 218 /** 222 219 * struct cryp_device_data - structure for a cryp device. 223 - * @base: Pointer to the hardware base address. 220 + * @base: Pointer to virtual base address of the cryp device. 221 + * @phybase: Pointer to physical memory location of the cryp device. 224 222 * @dev: Pointer to the devices dev structure. 225 223 * @clk: Pointer to the device's clock control. 226 224 * @pwr_regulator: Pointer to the device's power control. ··· 236 232 */ 237 233 struct cryp_device_data { 238 234 struct cryp_register __iomem *base; 235 + phys_addr_t phybase; 239 236 struct device *dev; 240 237 struct clk *clk; 241 238 struct regulator *pwr_regulator;
+43 -14
drivers/crypto/ux500/cryp/cryp_core.c
··· 475 475 static void cryp_dma_setup_channel(struct cryp_device_data *device_data, 476 476 struct device *dev) 477 477 { 478 + struct dma_slave_config mem2cryp = { 479 + .direction = DMA_MEM_TO_DEV, 480 + .dst_addr = device_data->phybase + CRYP_DMA_TX_FIFO, 481 + .dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES, 482 + .dst_maxburst = 4, 483 + }; 484 + struct dma_slave_config cryp2mem = { 485 + .direction = DMA_DEV_TO_MEM, 486 + .src_addr = device_data->phybase + CRYP_DMA_RX_FIFO, 487 + .src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES, 488 + .src_maxburst = 4, 489 + }; 490 + 478 491 dma_cap_zero(device_data->dma.mask); 479 492 dma_cap_set(DMA_SLAVE, device_data->dma.mask); 480 493 ··· 502 489 dma_request_channel(device_data->dma.mask, 503 490 stedma40_filter, 504 491 device_data->dma.cfg_cryp2mem); 492 + 493 + dmaengine_slave_config(device_data->dma.chan_mem2cryp, &mem2cryp); 494 + dmaengine_slave_config(device_data->dma.chan_cryp2mem, &cryp2mem); 505 495 506 496 init_completion(&device_data->dma.cryp_dma_complete); 507 497 } ··· 553 537 dev_dbg(ctx->device->dev, "[%s]: Setting up DMA for buffer " 554 538 "(TO_DEVICE)", __func__); 555 539 556 - desc = channel->device->device_prep_slave_sg(channel, 557 - ctx->device->dma.sg_src, 558 - ctx->device->dma.sg_src_len, 559 - direction, DMA_CTRL_ACK, NULL); 540 + desc = dmaengine_prep_slave_sg(channel, 541 + ctx->device->dma.sg_src, 542 + ctx->device->dma.sg_src_len, 543 + direction, DMA_CTRL_ACK); 560 544 break; 561 545 562 546 case DMA_FROM_DEVICE: ··· 577 561 dev_dbg(ctx->device->dev, "[%s]: Setting up DMA for buffer " 578 562 "(FROM_DEVICE)", __func__); 579 563 580 - desc = channel->device->device_prep_slave_sg(channel, 581 - ctx->device->dma.sg_dst, 582 - ctx->device->dma.sg_dst_len, 583 - direction, 584 - DMA_CTRL_ACK | 585 - DMA_PREP_INTERRUPT, NULL); 564 + desc = dmaengine_prep_slave_sg(channel, 565 + ctx->device->dma.sg_dst, 566 + ctx->device->dma.sg_dst_len, 567 + direction, 568 + DMA_CTRL_ACK | 569 + DMA_PREP_INTERRUPT); 586 570 587 571 desc->callback = cryp_dma_out_callback; 588 572 desc->callback_param = ctx; ··· 594 578 return -EFAULT; 595 579 } 596 580 597 - cookie = desc->tx_submit(desc); 581 + cookie = dmaengine_submit(desc); 598 582 dma_async_issue_pending(channel); 599 583 600 584 return 0; ··· 607 591 dev_dbg(ctx->device->dev, "[%s]: ", __func__); 608 592 609 593 chan = ctx->device->dma.chan_mem2cryp; 610 - chan->device->device_control(chan, DMA_TERMINATE_ALL, 0); 594 + dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); 611 595 dma_unmap_sg(chan->device->dev, ctx->device->dma.sg_src, 612 596 ctx->device->dma.sg_src_len, DMA_TO_DEVICE); 613 597 614 598 chan = ctx->device->dma.chan_cryp2mem; 615 - chan->device->device_control(chan, DMA_TERMINATE_ALL, 0); 599 + dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); 616 600 dma_unmap_sg(chan->device->dev, ctx->device->dma.sg_dst, 617 601 ctx->device->dma.sg_dst_len, DMA_FROM_DEVICE); 618 602 } ··· 1447 1431 goto out_kfree; 1448 1432 } 1449 1433 1434 + device_data->phybase = res->start; 1450 1435 device_data->base = ioremap(res->start, resource_size(res)); 1451 1436 if (!device_data->base) { 1452 1437 dev_err(dev, "[%s]: ioremap failed!", __func__); ··· 1475 1458 goto out_regulator; 1476 1459 } 1477 1460 1461 + ret = clk_prepare(device_data->clk); 1462 + if (ret) { 1463 + dev_err(dev, "[%s]: clk_prepare() failed!", __func__); 1464 + goto out_clk; 1465 + } 1466 + 1478 1467 /* Enable device power (and clock) */ 1479 1468 ret = cryp_enable_power(device_data->dev, device_data, false); 1480 1469 if (ret) { 1481 1470 dev_err(dev, "[%s]: cryp_enable_power() failed!", __func__); 1482 - goto out_clk; 1471 + goto out_clk_unprepare; 1483 1472 } 1484 1473 1485 1474 cryp_error = cryp_check(device_data); ··· 1541 1518 goto out_power; 1542 1519 } 1543 1520 1521 + dev_info(dev, "successfully registered\n"); 1522 + 1544 1523 return 0; 1545 1524 1546 1525 out_power: 1547 1526 cryp_disable_power(device_data->dev, device_data, false); 1527 + 1528 + out_clk_unprepare: 1529 + clk_unprepare(device_data->clk); 1548 1530 1549 1531 out_clk: 1550 1532 clk_put(device_data->clk); ··· 1621 1593 dev_err(&pdev->dev, "[%s]: cryp_disable_power() failed", 1622 1594 __func__); 1623 1595 1596 + clk_unprepare(device_data->clk); 1624 1597 clk_put(device_data->clk); 1625 1598 regulator_put(device_data->pwr_regulator); 1626 1599
+4 -1
drivers/crypto/ux500/hash/hash_alg.h
··· 11 11 #include <linux/bitops.h> 12 12 13 13 #define HASH_BLOCK_SIZE 64 14 + #define HASH_DMA_FIFO 4 14 15 #define HASH_DMA_ALIGN_SIZE 4 15 16 #define HASH_DMA_PERFORMANCE_MIN_SIZE 1024 16 17 #define HASH_BYTES_PER_WORD 4 ··· 348 347 349 348 /** 350 349 * struct hash_device_data - structure for a hash device. 351 - * @base: Pointer to the hardware base address. 350 + * @base: Pointer to virtual base address of the hash device. 351 + * @phybase: Pointer to physical memory location of the hash device. 352 352 * @list_node: For inclusion in klist. 353 353 * @dev: Pointer to the device dev structure. 354 354 * @ctx_lock: Spinlock for current_ctx. ··· 363 361 */ 364 362 struct hash_device_data { 365 363 struct hash_register __iomem *base; 364 + phys_addr_t phybase; 366 365 struct klist_node list_node; 367 366 struct device *dev; 368 367 struct spinlock ctx_lock;
+38 -19
drivers/crypto/ux500/hash/hash_core.c
··· 122 122 struct device *dev) 123 123 { 124 124 struct hash_platform_data *platform_data = dev->platform_data; 125 + struct dma_slave_config conf = { 126 + .direction = DMA_MEM_TO_DEV, 127 + .dst_addr = device_data->phybase + HASH_DMA_FIFO, 128 + .dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES, 129 + .dst_maxburst = 16, 130 + }; 131 + 125 132 dma_cap_zero(device_data->dma.mask); 126 133 dma_cap_set(DMA_SLAVE, device_data->dma.mask); 127 134 ··· 137 130 dma_request_channel(device_data->dma.mask, 138 131 platform_data->dma_filter, 139 132 device_data->dma.cfg_mem2hash); 133 + 134 + dmaengine_slave_config(device_data->dma.chan_mem2hash, &conf); 140 135 141 136 init_completion(&device_data->dma.complete); 142 137 } ··· 180 171 181 172 dev_dbg(ctx->device->dev, "[%s]: Setting up DMA for buffer " 182 173 "(TO_DEVICE)", __func__); 183 - desc = channel->device->device_prep_slave_sg(channel, 174 + desc = dmaengine_prep_slave_sg(channel, 184 175 ctx->device->dma.sg, ctx->device->dma.sg_len, 185 - direction, DMA_CTRL_ACK | DMA_PREP_INTERRUPT, NULL); 176 + direction, DMA_CTRL_ACK | DMA_PREP_INTERRUPT); 186 177 if (!desc) { 187 178 dev_err(ctx->device->dev, 188 179 "[%s]: device_prep_slave_sg() failed!", __func__); ··· 192 183 desc->callback = hash_dma_callback; 193 184 desc->callback_param = ctx; 194 185 195 - cookie = desc->tx_submit(desc); 186 + cookie = dmaengine_submit(desc); 196 187 dma_async_issue_pending(channel); 197 188 198 189 return 0; ··· 203 194 struct dma_chan *chan; 204 195 205 196 chan = ctx->device->dma.chan_mem2hash; 206 - chan->device->device_control(chan, DMA_TERMINATE_ALL, 0); 197 + dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); 207 198 dma_unmap_sg(chan->device->dev, ctx->device->dma.sg, 208 199 ctx->device->dma.sg_len, DMA_TO_DEVICE); 209 200 ··· 473 464 HASH_SET_DIN(&word, nwords); 474 465 } 475 466 476 - while (device_data->base->str & HASH_STR_DCAL_MASK) 467 + while (readl(&device_data->base->str) & HASH_STR_DCAL_MASK) 477 468 cpu_relax(); 478 469 479 470 HASH_SET_DCAL; 480 471 481 - while (device_data->base->str & HASH_STR_DCAL_MASK) 472 + while (readl(&device_data->base->str) & HASH_STR_DCAL_MASK) 482 473 cpu_relax(); 483 474 } 484 475 ··· 661 652 if (index_bytes) 662 653 HASH_SET_DIN(message, nwords); 663 654 664 - while (device_data->base->str & HASH_STR_DCAL_MASK) 655 + while (readl(&device_data->base->str) & HASH_STR_DCAL_MASK) 665 656 cpu_relax(); 666 657 667 658 /* num_of_bytes == 0 => NBLW <- 0 (32 bits valid in DATAIN) */ ··· 676 667 (int)(readl_relaxed(&device_data->base->str) & 677 668 HASH_STR_NBLW_MASK)); 678 669 679 - while (device_data->base->str & HASH_STR_DCAL_MASK) 670 + while (readl(&device_data->base->str) & HASH_STR_DCAL_MASK) 680 671 cpu_relax(); 681 672 } 682 673 ··· 776 767 /* HW and SW initializations */ 777 768 /* Note: there is no need to initialize buffer and digest members */ 778 769 779 - while (device_data->base->str & HASH_STR_DCAL_MASK) 770 + while (readl(&device_data->base->str) & HASH_STR_DCAL_MASK) 780 771 cpu_relax(); 781 772 782 773 /* ··· 792 783 HASH_CLEAR_BITS(&device_data->base->str, HASH_STR_NBLW_MASK); 793 784 } 794 785 795 - int hash_process_data( 796 - struct hash_device_data *device_data, 786 + static int hash_process_data(struct hash_device_data *device_data, 797 787 struct hash_ctx *ctx, struct hash_req_ctx *req_ctx, 798 788 int msg_length, u8 *data_buffer, u8 *buffer, u8 *index) 799 789 { ··· 961 953 wait_for_completion(&ctx->device->dma.complete); 962 954 hash_dma_done(ctx); 963 955 964 - while (device_data->base->str & HASH_STR_DCAL_MASK) 956 + while (readl(&device_data->base->str) & HASH_STR_DCAL_MASK) 965 957 cpu_relax(); 966 958 967 959 if (ctx->config.oper_mode == HASH_OPER_MODE_HMAC && ctx->key) { ··· 991 983 * hash_hw_final - The final hash calculation function 992 984 * @req: The hash request for the job. 993 985 */ 994 - int hash_hw_final(struct ahash_request *req) 986 + static int hash_hw_final(struct ahash_request *req) 995 987 { 996 988 int ret = 0; 997 989 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); ··· 1059 1051 req_ctx->state.index); 1060 1052 } else { 1061 1053 HASH_SET_DCAL; 1062 - while (device_data->base->str & HASH_STR_DCAL_MASK) 1054 + while (readl(&device_data->base->str) & HASH_STR_DCAL_MASK) 1063 1055 cpu_relax(); 1064 1056 } 1065 1057 ··· 1188 1180 temp_cr = device_state->temp_cr; 1189 1181 writel_relaxed(temp_cr & HASH_CR_RESUME_MASK, &device_data->base->cr); 1190 1182 1191 - if (device_data->base->cr & HASH_CR_MODE_MASK) 1183 + if (readl(&device_data->base->cr) & HASH_CR_MODE_MASK) 1192 1184 hash_mode = HASH_OPER_MODE_HMAC; 1193 1185 else 1194 1186 hash_mode = HASH_OPER_MODE_HASH; ··· 1232 1224 * actually makes sure that there isn't any ongoing calculation in the 1233 1225 * hardware. 1234 1226 */ 1235 - while (device_data->base->str & HASH_STR_DCAL_MASK) 1227 + while (readl(&device_data->base->str) & HASH_STR_DCAL_MASK) 1236 1228 cpu_relax(); 1237 1229 1238 1230 temp_cr = readl_relaxed(&device_data->base->cr); ··· 1241 1233 1242 1234 device_state->din_reg = readl_relaxed(&device_data->base->din); 1243 1235 1244 - if (device_data->base->cr & HASH_CR_MODE_MASK) 1236 + if (readl(&device_data->base->cr) & HASH_CR_MODE_MASK) 1245 1237 hash_mode = HASH_OPER_MODE_HMAC; 1246 1238 else 1247 1239 hash_mode = HASH_OPER_MODE_HASH; ··· 1707 1699 goto out_kfree; 1708 1700 } 1709 1701 1702 + device_data->phybase = res->start; 1710 1703 device_data->base = ioremap(res->start, resource_size(res)); 1711 1704 if (!device_data->base) { 1712 1705 dev_err(dev, "[%s] ioremap() failed!", ··· 1735 1726 goto out_regulator; 1736 1727 } 1737 1728 1729 + ret = clk_prepare(device_data->clk); 1730 + if (ret) { 1731 + dev_err(dev, "[%s] clk_prepare() failed!", __func__); 1732 + goto out_clk; 1733 + } 1734 + 1738 1735 /* Enable device power (and clock) */ 1739 1736 ret = hash_enable_power(device_data, false); 1740 1737 if (ret) { 1741 1738 dev_err(dev, "[%s]: hash_enable_power() failed!", __func__); 1742 - goto out_clk; 1739 + goto out_clk_unprepare; 1743 1740 } 1744 1741 1745 1742 ret = hash_check_hw(device_data); ··· 1771 1756 goto out_power; 1772 1757 } 1773 1758 1774 - dev_info(dev, "[%s] successfully probed\n", __func__); 1759 + dev_info(dev, "successfully registered\n"); 1775 1760 return 0; 1776 1761 1777 1762 out_power: 1778 1763 hash_disable_power(device_data, false); 1764 + 1765 + out_clk_unprepare: 1766 + clk_unprepare(device_data->clk); 1779 1767 1780 1768 out_clk: 1781 1769 clk_put(device_data->clk); ··· 1844 1826 dev_err(dev, "[%s]: hash_disable_power() failed", 1845 1827 __func__); 1846 1828 1829 + clk_unprepare(device_data->clk); 1847 1830 clk_put(device_data->clk); 1848 1831 regulator_put(device_data->regulator); 1849 1832
+310 -223
drivers/dma/ste_dma40.c
··· 17 17 #include <linux/pm.h> 18 18 #include <linux/pm_runtime.h> 19 19 #include <linux/err.h> 20 + #include <linux/of.h> 21 + #include <linux/of_dma.h> 20 22 #include <linux/amba/bus.h> 21 23 #include <linux/regulator/consumer.h> 22 24 #include <linux/platform_data/dma-ste-dma40.h> ··· 47 45 #define D40_LCLA_LINK_PER_EVENT_GRP 128 48 46 #define D40_LCLA_END D40_LCLA_LINK_PER_EVENT_GRP 49 47 48 + /* Max number of logical channels per physical channel */ 49 + #define D40_MAX_LOG_CHAN_PER_PHY 32 50 + 50 51 /* Attempts before giving up to trying to get pages that are aligned */ 51 52 #define MAX_LCLA_ALLOC_ATTEMPTS 256 52 53 53 54 /* Bit markings for allocation map */ 54 - #define D40_ALLOC_FREE (1 << 31) 55 - #define D40_ALLOC_PHY (1 << 30) 55 + #define D40_ALLOC_FREE BIT(31) 56 + #define D40_ALLOC_PHY BIT(30) 56 57 #define D40_ALLOC_LOG_FREE 0 57 58 58 - #define MAX(a, b) (((a) < (b)) ? (b) : (a)) 59 + #define D40_MEMCPY_MAX_CHANS 8 60 + 61 + /* Reserved event lines for memcpy only. */ 62 + #define DB8500_DMA_MEMCPY_EV_0 51 63 + #define DB8500_DMA_MEMCPY_EV_1 56 64 + #define DB8500_DMA_MEMCPY_EV_2 57 65 + #define DB8500_DMA_MEMCPY_EV_3 58 66 + #define DB8500_DMA_MEMCPY_EV_4 59 67 + #define DB8500_DMA_MEMCPY_EV_5 60 68 + 69 + static int dma40_memcpy_channels[] = { 70 + DB8500_DMA_MEMCPY_EV_0, 71 + DB8500_DMA_MEMCPY_EV_1, 72 + DB8500_DMA_MEMCPY_EV_2, 73 + DB8500_DMA_MEMCPY_EV_3, 74 + DB8500_DMA_MEMCPY_EV_4, 75 + DB8500_DMA_MEMCPY_EV_5, 76 + }; 77 + 78 + /* Default configuration for physcial memcpy */ 79 + static struct stedma40_chan_cfg dma40_memcpy_conf_phy = { 80 + .mode = STEDMA40_MODE_PHYSICAL, 81 + .dir = DMA_MEM_TO_MEM, 82 + 83 + .src_info.data_width = DMA_SLAVE_BUSWIDTH_1_BYTE, 84 + .src_info.psize = STEDMA40_PSIZE_PHY_1, 85 + .src_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, 86 + 87 + .dst_info.data_width = DMA_SLAVE_BUSWIDTH_1_BYTE, 88 + .dst_info.psize = STEDMA40_PSIZE_PHY_1, 89 + .dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, 90 + }; 91 + 92 + /* Default configuration for logical memcpy */ 93 + static struct stedma40_chan_cfg dma40_memcpy_conf_log = { 94 + .mode = STEDMA40_MODE_LOGICAL, 95 + .dir = DMA_MEM_TO_MEM, 96 + 97 + .src_info.data_width = DMA_SLAVE_BUSWIDTH_1_BYTE, 98 + .src_info.psize = STEDMA40_PSIZE_LOG_1, 99 + .src_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, 100 + 101 + .dst_info.data_width = DMA_SLAVE_BUSWIDTH_1_BYTE, 102 + .dst_info.psize = STEDMA40_PSIZE_LOG_1, 103 + .dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL, 104 + }; 59 105 60 106 /** 61 107 * enum 40_command - The different commands and/or statuses. ··· 220 170 D40_CHAN_REG_SDPTR, 221 171 D40_CHAN_REG_SDLNK, 222 172 }; 173 + 174 + #define BACKUP_REGS_SZ_MAX ((BACKUP_REGS_SZ_V4A > BACKUP_REGS_SZ_V4B) ? \ 175 + BACKUP_REGS_SZ_V4A : BACKUP_REGS_SZ_V4B) 223 176 224 177 /** 225 178 * struct d40_interrupt_lookup - lookup table for interrupt handler ··· 524 471 * @phy_start: Physical memory start of the DMA registers. 525 472 * @phy_size: Size of the DMA register map. 526 473 * @irq: The IRQ number. 474 + * @num_memcpy_chans: The number of channels used for memcpy (mem-to-mem 475 + * transfers). 527 476 * @num_phy_chans: The number of physical channels. Read from HW. This 528 477 * is the number of available channels for this driver, not counting "Secure 529 478 * mode" allocated physical channels. ··· 569 514 phys_addr_t phy_start; 570 515 resource_size_t phy_size; 571 516 int irq; 517 + int num_memcpy_chans; 572 518 int num_phy_chans; 573 519 int num_log_chans; 574 520 struct device_dma_parameters dma_parms; ··· 590 534 resource_size_t lcpa_size; 591 535 struct kmem_cache *desc_slab; 592 536 u32 reg_val_backup[BACKUP_REGS_SZ]; 593 - u32 reg_val_backup_v4[MAX(BACKUP_REGS_SZ_V4A, BACKUP_REGS_SZ_V4B)]; 537 + u32 reg_val_backup_v4[BACKUP_REGS_SZ_MAX]; 594 538 u32 *reg_val_backup_chan; 595 539 u16 gcc_pwr_off_mask; 596 540 bool initialized; ··· 848 792 * that uses linked lists. 849 793 */ 850 794 if (!(chan->phy_chan->use_soft_lli && 851 - chan->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM)) 795 + chan->dma_cfg.dir == DMA_DEV_TO_MEM)) 852 796 curr_lcla = d40_lcla_alloc_one(chan, desc); 853 797 854 798 first_lcla = curr_lcla; ··· 1010 954 1011 955 /* 1012 956 * The dma only supports transmitting packages up to 1013 - * STEDMA40_MAX_SEG_SIZE << data_width. Calculate the total number of 1014 - * dma elements required to send the entire sg list 957 + * STEDMA40_MAX_SEG_SIZE * data_width, where data_width is stored in Bytes. 958 + * 959 + * Calculate the total number of dma elements required to send the entire sg list. 1015 960 */ 1016 961 static int d40_size_2_dmalen(int size, u32 data_width1, u32 data_width2) 1017 962 { 1018 963 int dmalen; 1019 964 u32 max_w = max(data_width1, data_width2); 1020 965 u32 min_w = min(data_width1, data_width2); 1021 - u32 seg_max = ALIGN(STEDMA40_MAX_SEG_SIZE << min_w, 1 << max_w); 966 + u32 seg_max = ALIGN(STEDMA40_MAX_SEG_SIZE * min_w, max_w); 1022 967 1023 968 if (seg_max > STEDMA40_MAX_SEG_SIZE) 1024 - seg_max -= (1 << max_w); 969 + seg_max -= max_w; 1025 970 1026 - if (!IS_ALIGNED(size, 1 << max_w)) 971 + if (!IS_ALIGNED(size, max_w)) 1027 972 return -EINVAL; 1028 973 1029 974 if (size <= seg_max) ··· 1314 1257 static void d40_config_set_event(struct d40_chan *d40c, 1315 1258 enum d40_events event_type) 1316 1259 { 1317 - /* Enable event line connected to device (or memcpy) */ 1318 - if ((d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) || 1319 - (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) { 1320 - u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.src_dev_type); 1260 + u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dev_type); 1321 1261 1262 + /* Enable event line connected to device (or memcpy) */ 1263 + if ((d40c->dma_cfg.dir == DMA_DEV_TO_MEM) || 1264 + (d40c->dma_cfg.dir == DMA_DEV_TO_DEV)) 1322 1265 __d40_config_set_event(d40c, event_type, event, 1323 1266 D40_CHAN_REG_SSLNK); 1324 - } 1325 1267 1326 - if (d40c->dma_cfg.dir != STEDMA40_PERIPH_TO_MEM) { 1327 - u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type); 1328 - 1268 + if (d40c->dma_cfg.dir != DMA_DEV_TO_MEM) 1329 1269 __d40_config_set_event(d40c, event_type, event, 1330 1270 D40_CHAN_REG_SDLNK); 1331 - } 1332 1271 } 1333 1272 1334 1273 static u32 d40_chan_has_events(struct d40_chan *d40c) ··· 1470 1417 >> D40_SREG_ELEM_PHY_ECNT_POS; 1471 1418 } 1472 1419 1473 - return num_elt * (1 << d40c->dma_cfg.dst_info.data_width); 1420 + return num_elt * d40c->dma_cfg.dst_info.data_width; 1474 1421 } 1475 1422 1476 1423 static bool d40_tx_is_linked(struct d40_chan *d40c) ··· 1746 1693 } 1747 1694 1748 1695 /* ACK interrupt */ 1749 - writel(1 << idx, base->virtbase + il[row].clr); 1696 + writel(BIT(idx), base->virtbase + il[row].clr); 1750 1697 1751 1698 spin_lock(&d40c->lock); 1752 1699 ··· 1768 1715 struct stedma40_chan_cfg *conf) 1769 1716 { 1770 1717 int res = 0; 1771 - u32 dst_event_group = D40_TYPE_TO_GROUP(conf->dst_dev_type); 1772 - u32 src_event_group = D40_TYPE_TO_GROUP(conf->src_dev_type); 1773 1718 bool is_log = conf->mode == STEDMA40_MODE_LOGICAL; 1774 1719 1775 1720 if (!conf->dir) { ··· 1775 1724 res = -EINVAL; 1776 1725 } 1777 1726 1778 - if (conf->dst_dev_type != STEDMA40_DEV_DST_MEMORY && 1779 - d40c->base->plat_data->dev_tx[conf->dst_dev_type] == 0 && 1780 - d40c->runtime_addr == 0) { 1781 - 1782 - chan_err(d40c, "Invalid TX channel address (%d)\n", 1783 - conf->dst_dev_type); 1727 + if ((is_log && conf->dev_type > d40c->base->num_log_chans) || 1728 + (!is_log && conf->dev_type > d40c->base->num_phy_chans) || 1729 + (conf->dev_type < 0)) { 1730 + chan_err(d40c, "Invalid device type (%d)\n", conf->dev_type); 1784 1731 res = -EINVAL; 1785 1732 } 1786 1733 1787 - if (conf->src_dev_type != STEDMA40_DEV_SRC_MEMORY && 1788 - d40c->base->plat_data->dev_rx[conf->src_dev_type] == 0 && 1789 - d40c->runtime_addr == 0) { 1790 - chan_err(d40c, "Invalid RX channel address (%d)\n", 1791 - conf->src_dev_type); 1792 - res = -EINVAL; 1793 - } 1794 - 1795 - if (conf->dir == STEDMA40_MEM_TO_PERIPH && 1796 - dst_event_group == STEDMA40_DEV_DST_MEMORY) { 1797 - chan_err(d40c, "Invalid dst\n"); 1798 - res = -EINVAL; 1799 - } 1800 - 1801 - if (conf->dir == STEDMA40_PERIPH_TO_MEM && 1802 - src_event_group == STEDMA40_DEV_SRC_MEMORY) { 1803 - chan_err(d40c, "Invalid src\n"); 1804 - res = -EINVAL; 1805 - } 1806 - 1807 - if (src_event_group == STEDMA40_DEV_SRC_MEMORY && 1808 - dst_event_group == STEDMA40_DEV_DST_MEMORY && is_log) { 1809 - chan_err(d40c, "No event line\n"); 1810 - res = -EINVAL; 1811 - } 1812 - 1813 - if (conf->dir == STEDMA40_PERIPH_TO_PERIPH && 1814 - (src_event_group != dst_event_group)) { 1815 - chan_err(d40c, "Invalid event group\n"); 1816 - res = -EINVAL; 1817 - } 1818 - 1819 - if (conf->dir == STEDMA40_PERIPH_TO_PERIPH) { 1734 + if (conf->dir == DMA_DEV_TO_DEV) { 1820 1735 /* 1821 1736 * DMAC HW supports it. Will be added to this driver, 1822 1737 * in case any dma client requires it. ··· 1792 1775 } 1793 1776 1794 1777 if (d40_psize_2_burst_size(is_log, conf->src_info.psize) * 1795 - (1 << conf->src_info.data_width) != 1778 + conf->src_info.data_width != 1796 1779 d40_psize_2_burst_size(is_log, conf->dst_info.psize) * 1797 - (1 << conf->dst_info.data_width)) { 1780 + conf->dst_info.data_width) { 1798 1781 /* 1799 1782 * The DMAC hardware only supports 1800 1783 * src (burst x width) == dst (burst x width) ··· 1836 1819 if (phy->allocated_src == D40_ALLOC_FREE) 1837 1820 phy->allocated_src = D40_ALLOC_LOG_FREE; 1838 1821 1839 - if (!(phy->allocated_src & (1 << log_event_line))) { 1840 - phy->allocated_src |= 1 << log_event_line; 1822 + if (!(phy->allocated_src & BIT(log_event_line))) { 1823 + phy->allocated_src |= BIT(log_event_line); 1841 1824 goto found; 1842 1825 } else 1843 1826 goto not_found; ··· 1848 1831 if (phy->allocated_dst == D40_ALLOC_FREE) 1849 1832 phy->allocated_dst = D40_ALLOC_LOG_FREE; 1850 1833 1851 - if (!(phy->allocated_dst & (1 << log_event_line))) { 1852 - phy->allocated_dst |= 1 << log_event_line; 1834 + if (!(phy->allocated_dst & BIT(log_event_line))) { 1835 + phy->allocated_dst |= BIT(log_event_line); 1853 1836 goto found; 1854 1837 } else 1855 1838 goto not_found; ··· 1879 1862 1880 1863 /* Logical channel */ 1881 1864 if (is_src) { 1882 - phy->allocated_src &= ~(1 << log_event_line); 1865 + phy->allocated_src &= ~BIT(log_event_line); 1883 1866 if (phy->allocated_src == D40_ALLOC_LOG_FREE) 1884 1867 phy->allocated_src = D40_ALLOC_FREE; 1885 1868 } else { 1886 - phy->allocated_dst &= ~(1 << log_event_line); 1869 + phy->allocated_dst &= ~BIT(log_event_line); 1887 1870 if (phy->allocated_dst == D40_ALLOC_LOG_FREE) 1888 1871 phy->allocated_dst = D40_ALLOC_FREE; 1889 1872 } ··· 1899 1882 1900 1883 static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user) 1901 1884 { 1902 - int dev_type; 1885 + int dev_type = d40c->dma_cfg.dev_type; 1903 1886 int event_group; 1904 1887 int event_line; 1905 1888 struct d40_phy_res *phys; ··· 1913 1896 phys = d40c->base->phy_res; 1914 1897 num_phy_chans = d40c->base->num_phy_chans; 1915 1898 1916 - if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { 1917 - dev_type = d40c->dma_cfg.src_dev_type; 1899 + if (d40c->dma_cfg.dir == DMA_DEV_TO_MEM) { 1918 1900 log_num = 2 * dev_type; 1919 1901 is_src = true; 1920 - } else if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || 1921 - d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { 1902 + } else if (d40c->dma_cfg.dir == DMA_MEM_TO_DEV || 1903 + d40c->dma_cfg.dir == DMA_MEM_TO_MEM) { 1922 1904 /* dst event lines are used for logical memcpy */ 1923 - dev_type = d40c->dma_cfg.dst_dev_type; 1924 1905 log_num = 2 * dev_type + 1; 1925 1906 is_src = false; 1926 1907 } else ··· 1928 1913 event_line = D40_TYPE_TO_EVENT(dev_type); 1929 1914 1930 1915 if (!is_log) { 1931 - if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { 1916 + if (d40c->dma_cfg.dir == DMA_MEM_TO_MEM) { 1932 1917 /* Find physical half channel */ 1933 1918 if (d40c->dma_cfg.use_fixed_channel) { 1934 1919 i = d40c->dma_cfg.phy_channel; ··· 2029 2014 dma_cap_mask_t cap = d40c->chan.device->cap_mask; 2030 2015 2031 2016 if (dma_has_cap(DMA_MEMCPY, cap) && !dma_has_cap(DMA_SLAVE, cap)) { 2032 - d40c->dma_cfg = *d40c->base->plat_data->memcpy_conf_log; 2033 - d40c->dma_cfg.src_dev_type = STEDMA40_DEV_SRC_MEMORY; 2034 - d40c->dma_cfg.dst_dev_type = d40c->base->plat_data-> 2035 - memcpy[d40c->chan.chan_id]; 2017 + d40c->dma_cfg = dma40_memcpy_conf_log; 2018 + d40c->dma_cfg.dev_type = dma40_memcpy_channels[d40c->chan.chan_id]; 2019 + 2020 + d40_log_cfg(&d40c->dma_cfg, 2021 + &d40c->log_def.lcsp1, &d40c->log_def.lcsp3); 2036 2022 2037 2023 } else if (dma_has_cap(DMA_MEMCPY, cap) && 2038 2024 dma_has_cap(DMA_SLAVE, cap)) { 2039 - d40c->dma_cfg = *d40c->base->plat_data->memcpy_conf_phy; 2025 + d40c->dma_cfg = dma40_memcpy_conf_phy; 2026 + 2027 + /* Generate interrrupt at end of transfer or relink. */ 2028 + d40c->dst_def_cfg |= BIT(D40_SREG_CFG_TIM_POS); 2029 + 2030 + /* Generate interrupt on error. */ 2031 + d40c->src_def_cfg |= BIT(D40_SREG_CFG_EIM_POS); 2032 + d40c->dst_def_cfg |= BIT(D40_SREG_CFG_EIM_POS); 2033 + 2040 2034 } else { 2041 2035 chan_err(d40c, "No memcpy\n"); 2042 2036 return -EINVAL; ··· 2058 2034 { 2059 2035 2060 2036 int res = 0; 2061 - u32 event; 2037 + u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dev_type); 2062 2038 struct d40_phy_res *phy = d40c->phy_chan; 2063 2039 bool is_src; 2064 2040 ··· 2076 2052 return -EINVAL; 2077 2053 } 2078 2054 2079 - if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || 2080 - d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { 2081 - event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type); 2055 + if (d40c->dma_cfg.dir == DMA_MEM_TO_DEV || 2056 + d40c->dma_cfg.dir == DMA_MEM_TO_MEM) 2082 2057 is_src = false; 2083 - } else if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { 2084 - event = D40_TYPE_TO_EVENT(d40c->dma_cfg.src_dev_type); 2058 + else if (d40c->dma_cfg.dir == DMA_DEV_TO_MEM) 2085 2059 is_src = true; 2086 - } else { 2060 + else { 2087 2061 chan_err(d40c, "Unknown direction\n"); 2088 2062 return -EINVAL; 2089 2063 } ··· 2122 2100 unsigned long flags; 2123 2101 void __iomem *active_reg; 2124 2102 u32 status; 2125 - u32 event; 2103 + u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dev_type); 2126 2104 2127 2105 spin_lock_irqsave(&d40c->lock, flags); 2128 2106 ··· 2141 2119 goto _exit; 2142 2120 } 2143 2121 2144 - if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || 2145 - d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { 2146 - event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type); 2122 + if (d40c->dma_cfg.dir == DMA_MEM_TO_DEV || 2123 + d40c->dma_cfg.dir == DMA_MEM_TO_MEM) { 2147 2124 status = readl(chanbase + D40_CHAN_REG_SDLNK); 2148 - } else if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { 2149 - event = D40_TYPE_TO_EVENT(d40c->dma_cfg.src_dev_type); 2125 + } else if (d40c->dma_cfg.dir == DMA_DEV_TO_MEM) { 2150 2126 status = readl(chanbase + D40_CHAN_REG_SSLNK); 2151 2127 } else { 2152 2128 chan_err(d40c, "Unknown direction\n"); ··· 2275 2255 return NULL; 2276 2256 } 2277 2257 2278 - static dma_addr_t 2279 - d40_get_dev_addr(struct d40_chan *chan, enum dma_transfer_direction direction) 2280 - { 2281 - struct stedma40_platform_data *plat = chan->base->plat_data; 2282 - struct stedma40_chan_cfg *cfg = &chan->dma_cfg; 2283 - dma_addr_t addr = 0; 2284 - 2285 - if (chan->runtime_addr) 2286 - return chan->runtime_addr; 2287 - 2288 - if (direction == DMA_DEV_TO_MEM) 2289 - addr = plat->dev_rx[cfg->src_dev_type]; 2290 - else if (direction == DMA_MEM_TO_DEV) 2291 - addr = plat->dev_tx[cfg->dst_dev_type]; 2292 - 2293 - return addr; 2294 - } 2295 - 2296 2258 static struct dma_async_tx_descriptor * 2297 2259 d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, 2298 2260 struct scatterlist *sg_dst, unsigned int sg_len, ··· 2301 2299 if (sg_next(&sg_src[sg_len - 1]) == sg_src) 2302 2300 desc->cyclic = true; 2303 2301 2304 - if (direction != DMA_TRANS_NONE) { 2305 - dma_addr_t dev_addr = d40_get_dev_addr(chan, direction); 2306 - 2307 - if (direction == DMA_DEV_TO_MEM) 2308 - src_dev_addr = dev_addr; 2309 - else if (direction == DMA_MEM_TO_DEV) 2310 - dst_dev_addr = dev_addr; 2311 - } 2302 + if (direction == DMA_DEV_TO_MEM) 2303 + src_dev_addr = chan->runtime_addr; 2304 + else if (direction == DMA_MEM_TO_DEV) 2305 + dst_dev_addr = chan->runtime_addr; 2312 2306 2313 2307 if (chan_is_logical(chan)) 2314 2308 ret = d40_prep_sg_log(chan, desc, sg_src, sg_dst, ··· 2364 2366 u32 rtreg; 2365 2367 u32 event = D40_TYPE_TO_EVENT(dev_type); 2366 2368 u32 group = D40_TYPE_TO_GROUP(dev_type); 2367 - u32 bit = 1 << event; 2369 + u32 bit = BIT(event); 2368 2370 u32 prioreg; 2369 2371 struct d40_gen_dmac *dmac = &d40c->base->gen_dmac; 2370 2372 ··· 2395 2397 if (d40c->base->rev < 3) 2396 2398 return; 2397 2399 2398 - if ((d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) || 2399 - (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) 2400 - __d40_set_prio_rt(d40c, d40c->dma_cfg.src_dev_type, true); 2400 + if ((d40c->dma_cfg.dir == DMA_DEV_TO_MEM) || 2401 + (d40c->dma_cfg.dir == DMA_DEV_TO_DEV)) 2402 + __d40_set_prio_rt(d40c, d40c->dma_cfg.dev_type, true); 2401 2403 2402 - if ((d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH) || 2403 - (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) 2404 - __d40_set_prio_rt(d40c, d40c->dma_cfg.dst_dev_type, false); 2404 + if ((d40c->dma_cfg.dir == DMA_MEM_TO_DEV) || 2405 + (d40c->dma_cfg.dir == DMA_DEV_TO_DEV)) 2406 + __d40_set_prio_rt(d40c, d40c->dma_cfg.dev_type, false); 2407 + } 2408 + 2409 + #define D40_DT_FLAGS_MODE(flags) ((flags >> 0) & 0x1) 2410 + #define D40_DT_FLAGS_DIR(flags) ((flags >> 1) & 0x1) 2411 + #define D40_DT_FLAGS_BIG_ENDIAN(flags) ((flags >> 2) & 0x1) 2412 + #define D40_DT_FLAGS_FIXED_CHAN(flags) ((flags >> 3) & 0x1) 2413 + 2414 + static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec, 2415 + struct of_dma *ofdma) 2416 + { 2417 + struct stedma40_chan_cfg cfg; 2418 + dma_cap_mask_t cap; 2419 + u32 flags; 2420 + 2421 + memset(&cfg, 0, sizeof(struct stedma40_chan_cfg)); 2422 + 2423 + dma_cap_zero(cap); 2424 + dma_cap_set(DMA_SLAVE, cap); 2425 + 2426 + cfg.dev_type = dma_spec->args[0]; 2427 + flags = dma_spec->args[2]; 2428 + 2429 + switch (D40_DT_FLAGS_MODE(flags)) { 2430 + case 0: cfg.mode = STEDMA40_MODE_LOGICAL; break; 2431 + case 1: cfg.mode = STEDMA40_MODE_PHYSICAL; break; 2432 + } 2433 + 2434 + switch (D40_DT_FLAGS_DIR(flags)) { 2435 + case 0: 2436 + cfg.dir = DMA_MEM_TO_DEV; 2437 + cfg.dst_info.big_endian = D40_DT_FLAGS_BIG_ENDIAN(flags); 2438 + break; 2439 + case 1: 2440 + cfg.dir = DMA_DEV_TO_MEM; 2441 + cfg.src_info.big_endian = D40_DT_FLAGS_BIG_ENDIAN(flags); 2442 + break; 2443 + } 2444 + 2445 + if (D40_DT_FLAGS_FIXED_CHAN(flags)) { 2446 + cfg.phy_channel = dma_spec->args[1]; 2447 + cfg.use_fixed_channel = true; 2448 + } 2449 + 2450 + return dma_request_channel(cap, stedma40_filter, &cfg); 2405 2451 } 2406 2452 2407 2453 /* DMA ENGINE functions */ ··· 2477 2435 } 2478 2436 2479 2437 pm_runtime_get_sync(d40c->base->dev); 2480 - /* Fill in basic CFG register values */ 2481 - d40_phy_cfg(&d40c->dma_cfg, &d40c->src_def_cfg, 2482 - &d40c->dst_def_cfg, chan_is_logical(d40c)); 2483 2438 2484 2439 d40_set_prio_realtime(d40c); 2485 2440 2486 2441 if (chan_is_logical(d40c)) { 2487 - d40_log_cfg(&d40c->dma_cfg, 2488 - &d40c->log_def.lcsp1, &d40c->log_def.lcsp3); 2489 - 2490 - if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) 2442 + if (d40c->dma_cfg.dir == DMA_DEV_TO_MEM) 2491 2443 d40c->lcpa = d40c->base->lcpa_base + 2492 - d40c->dma_cfg.src_dev_type * D40_LCPA_CHAN_SIZE; 2444 + d40c->dma_cfg.dev_type * D40_LCPA_CHAN_SIZE; 2493 2445 else 2494 2446 d40c->lcpa = d40c->base->lcpa_base + 2495 - d40c->dma_cfg.dst_dev_type * 2447 + d40c->dma_cfg.dev_type * 2496 2448 D40_LCPA_CHAN_SIZE + D40_LCPA_CHAN_DST_DELTA; 2449 + 2450 + /* Unmask the Global Interrupt Mask. */ 2451 + d40c->src_def_cfg |= BIT(D40_SREG_CFG_LOG_GIM_POS); 2452 + d40c->dst_def_cfg |= BIT(D40_SREG_CFG_LOG_GIM_POS); 2497 2453 } 2498 2454 2499 2455 dev_dbg(chan2dev(d40c), "allocated %s channel (phy %d%s)\n", ··· 2681 2641 static int 2682 2642 dma40_config_to_halfchannel(struct d40_chan *d40c, 2683 2643 struct stedma40_half_channel_info *info, 2684 - enum dma_slave_buswidth width, 2685 2644 u32 maxburst) 2686 2645 { 2687 - enum stedma40_periph_data_width addr_width; 2688 2646 int psize; 2689 - 2690 - switch (width) { 2691 - case DMA_SLAVE_BUSWIDTH_1_BYTE: 2692 - addr_width = STEDMA40_BYTE_WIDTH; 2693 - break; 2694 - case DMA_SLAVE_BUSWIDTH_2_BYTES: 2695 - addr_width = STEDMA40_HALFWORD_WIDTH; 2696 - break; 2697 - case DMA_SLAVE_BUSWIDTH_4_BYTES: 2698 - addr_width = STEDMA40_WORD_WIDTH; 2699 - break; 2700 - case DMA_SLAVE_BUSWIDTH_8_BYTES: 2701 - addr_width = STEDMA40_DOUBLEWORD_WIDTH; 2702 - break; 2703 - default: 2704 - dev_err(d40c->base->dev, 2705 - "illegal peripheral address width " 2706 - "requested (%d)\n", 2707 - width); 2708 - return -EINVAL; 2709 - } 2710 2647 2711 2648 if (chan_is_logical(d40c)) { 2712 2649 if (maxburst >= 16) ··· 2705 2688 psize = STEDMA40_PSIZE_PHY_1; 2706 2689 } 2707 2690 2708 - info->data_width = addr_width; 2709 2691 info->psize = psize; 2710 2692 info->flow_ctrl = STEDMA40_NO_FLOW_CTRL; 2711 2693 ··· 2728 2712 dst_maxburst = config->dst_maxburst; 2729 2713 2730 2714 if (config->direction == DMA_DEV_TO_MEM) { 2731 - dma_addr_t dev_addr_rx = 2732 - d40c->base->plat_data->dev_rx[cfg->src_dev_type]; 2733 - 2734 2715 config_addr = config->src_addr; 2735 - if (dev_addr_rx) 2736 - dev_dbg(d40c->base->dev, 2737 - "channel has a pre-wired RX address %08x " 2738 - "overriding with %08x\n", 2739 - dev_addr_rx, config_addr); 2740 - if (cfg->dir != STEDMA40_PERIPH_TO_MEM) 2716 + 2717 + if (cfg->dir != DMA_DEV_TO_MEM) 2741 2718 dev_dbg(d40c->base->dev, 2742 2719 "channel was not configured for peripheral " 2743 2720 "to memory transfer (%d) overriding\n", 2744 2721 cfg->dir); 2745 - cfg->dir = STEDMA40_PERIPH_TO_MEM; 2722 + cfg->dir = DMA_DEV_TO_MEM; 2746 2723 2747 2724 /* Configure the memory side */ 2748 2725 if (dst_addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED) ··· 2744 2735 dst_maxburst = src_maxburst; 2745 2736 2746 2737 } else if (config->direction == DMA_MEM_TO_DEV) { 2747 - dma_addr_t dev_addr_tx = 2748 - d40c->base->plat_data->dev_tx[cfg->dst_dev_type]; 2749 - 2750 2738 config_addr = config->dst_addr; 2751 - if (dev_addr_tx) 2752 - dev_dbg(d40c->base->dev, 2753 - "channel has a pre-wired TX address %08x " 2754 - "overriding with %08x\n", 2755 - dev_addr_tx, config_addr); 2756 - if (cfg->dir != STEDMA40_MEM_TO_PERIPH) 2739 + 2740 + if (cfg->dir != DMA_MEM_TO_DEV) 2757 2741 dev_dbg(d40c->base->dev, 2758 2742 "channel was not configured for memory " 2759 2743 "to peripheral transfer (%d) overriding\n", 2760 2744 cfg->dir); 2761 - cfg->dir = STEDMA40_MEM_TO_PERIPH; 2745 + cfg->dir = DMA_MEM_TO_DEV; 2762 2746 2763 2747 /* Configure the memory side */ 2764 2748 if (src_addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED) ··· 2762 2760 dev_err(d40c->base->dev, 2763 2761 "unrecognized channel direction %d\n", 2764 2762 config->direction); 2763 + return -EINVAL; 2764 + } 2765 + 2766 + if (config_addr <= 0) { 2767 + dev_err(d40c->base->dev, "no address supplied\n"); 2765 2768 return -EINVAL; 2766 2769 } 2767 2770 ··· 2788 2781 src_maxburst = dst_maxburst * dst_addr_width / src_addr_width; 2789 2782 } 2790 2783 2784 + /* Only valid widths are; 1, 2, 4 and 8. */ 2785 + if (src_addr_width <= DMA_SLAVE_BUSWIDTH_UNDEFINED || 2786 + src_addr_width > DMA_SLAVE_BUSWIDTH_8_BYTES || 2787 + dst_addr_width <= DMA_SLAVE_BUSWIDTH_UNDEFINED || 2788 + dst_addr_width > DMA_SLAVE_BUSWIDTH_8_BYTES || 2789 + ((src_addr_width > 1) && (src_addr_width & 1)) || 2790 + ((dst_addr_width > 1) && (dst_addr_width & 1))) 2791 + return -EINVAL; 2792 + 2793 + cfg->src_info.data_width = src_addr_width; 2794 + cfg->dst_info.data_width = dst_addr_width; 2795 + 2791 2796 ret = dma40_config_to_halfchannel(d40c, &cfg->src_info, 2792 - src_addr_width, 2793 2797 src_maxburst); 2794 2798 if (ret) 2795 2799 return ret; 2796 2800 2797 2801 ret = dma40_config_to_halfchannel(d40c, &cfg->dst_info, 2798 - dst_addr_width, 2799 2802 dst_maxburst); 2800 2803 if (ret) 2801 2804 return ret; ··· 2814 2797 if (chan_is_logical(d40c)) 2815 2798 d40_log_cfg(cfg, &d40c->log_def.lcsp1, &d40c->log_def.lcsp3); 2816 2799 else 2817 - d40_phy_cfg(cfg, &d40c->src_def_cfg, 2818 - &d40c->dst_def_cfg, false); 2800 + d40_phy_cfg(cfg, &d40c->src_def_cfg, &d40c->dst_def_cfg); 2819 2801 2820 2802 /* These settings will take precedence later */ 2821 2803 d40c->runtime_addr = config_addr; ··· 2945 2929 } 2946 2930 2947 2931 d40_chan_init(base, &base->dma_memcpy, base->log_chans, 2948 - base->num_log_chans, base->plat_data->memcpy_len); 2932 + base->num_log_chans, base->num_memcpy_chans); 2949 2933 2950 2934 dma_cap_zero(base->dma_memcpy.cap_mask); 2951 2935 dma_cap_set(DMA_MEMCPY, base->dma_memcpy.cap_mask); ··· 3139 3123 3140 3124 static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) 3141 3125 { 3142 - struct stedma40_platform_data *plat_data; 3126 + struct stedma40_platform_data *plat_data = pdev->dev.platform_data; 3143 3127 struct clk *clk = NULL; 3144 3128 void __iomem *virtbase = NULL; 3145 3129 struct resource *res = NULL; 3146 3130 struct d40_base *base = NULL; 3147 3131 int num_log_chans = 0; 3148 3132 int num_phy_chans; 3133 + int num_memcpy_chans; 3149 3134 int clk_ret = -EINVAL; 3150 3135 int i; 3151 3136 u32 pid; ··· 3206 3189 * DB8540v1 has revision 4 3207 3190 */ 3208 3191 rev = AMBA_REV_BITS(pid); 3209 - 3210 - plat_data = pdev->dev.platform_data; 3192 + if (rev < 2) { 3193 + d40_err(&pdev->dev, "hardware revision: %d is not supported", rev); 3194 + goto failure; 3195 + } 3211 3196 3212 3197 /* The number of physical channels on this HW */ 3213 3198 if (plat_data->num_of_phy_chans) ··· 3217 3198 else 3218 3199 num_phy_chans = 4 * (readl(virtbase + D40_DREG_ICFG) & 0x7) + 4; 3219 3200 3220 - dev_info(&pdev->dev, "hardware revision: %d @ 0x%x with %d physical channels\n", 3221 - rev, res->start, num_phy_chans); 3201 + /* The number of channels used for memcpy */ 3202 + if (plat_data->num_of_memcpy_chans) 3203 + num_memcpy_chans = plat_data->num_of_memcpy_chans; 3204 + else 3205 + num_memcpy_chans = ARRAY_SIZE(dma40_memcpy_channels); 3222 3206 3223 - if (rev < 2) { 3224 - d40_err(&pdev->dev, "hardware revision: %d is not supported", 3225 - rev); 3226 - goto failure; 3227 - } 3207 + num_log_chans = num_phy_chans * D40_MAX_LOG_CHAN_PER_PHY; 3228 3208 3229 - /* Count the number of logical channels in use */ 3230 - for (i = 0; i < plat_data->dev_len; i++) 3231 - if (plat_data->dev_rx[i] != 0) 3232 - num_log_chans++; 3233 - 3234 - for (i = 0; i < plat_data->dev_len; i++) 3235 - if (plat_data->dev_tx[i] != 0) 3236 - num_log_chans++; 3209 + dev_info(&pdev->dev, 3210 + "hardware rev: %d @ 0x%x with %d physical and %d logical channels\n", 3211 + rev, res->start, num_phy_chans, num_log_chans); 3237 3212 3238 3213 base = kzalloc(ALIGN(sizeof(struct d40_base), 4) + 3239 - (num_phy_chans + num_log_chans + plat_data->memcpy_len) * 3214 + (num_phy_chans + num_log_chans + num_memcpy_chans) * 3240 3215 sizeof(struct d40_chan), GFP_KERNEL); 3241 3216 3242 3217 if (base == NULL) { ··· 3240 3227 3241 3228 base->rev = rev; 3242 3229 base->clk = clk; 3230 + base->num_memcpy_chans = num_memcpy_chans; 3243 3231 base->num_phy_chans = num_phy_chans; 3244 3232 base->num_log_chans = num_log_chans; 3245 3233 base->phy_start = res->start; ··· 3292 3278 if (!base->lookup_phy_chans) 3293 3279 goto failure; 3294 3280 3295 - if (num_log_chans + plat_data->memcpy_len) { 3296 - /* 3297 - * The max number of logical channels are event lines for all 3298 - * src devices and dst devices 3299 - */ 3300 - base->lookup_log_chans = kzalloc(plat_data->dev_len * 2 * 3301 - sizeof(struct d40_chan *), 3302 - GFP_KERNEL); 3303 - if (!base->lookup_log_chans) 3304 - goto failure; 3305 - } 3281 + base->lookup_log_chans = kzalloc(num_log_chans * 3282 + sizeof(struct d40_chan *), 3283 + GFP_KERNEL); 3284 + if (!base->lookup_log_chans) 3285 + goto failure; 3306 3286 3307 3287 base->reg_val_backup_chan = kmalloc(base->num_phy_chans * 3308 3288 sizeof(d40_backup_regs_chan), ··· 3480 3472 return ret; 3481 3473 } 3482 3474 3475 + static int __init d40_of_probe(struct platform_device *pdev, 3476 + struct device_node *np) 3477 + { 3478 + struct stedma40_platform_data *pdata; 3479 + int num_phy = 0, num_memcpy = 0, num_disabled = 0; 3480 + const const __be32 *list; 3481 + 3482 + pdata = devm_kzalloc(&pdev->dev, 3483 + sizeof(struct stedma40_platform_data), 3484 + GFP_KERNEL); 3485 + if (!pdata) 3486 + return -ENOMEM; 3487 + 3488 + /* If absent this value will be obtained from h/w. */ 3489 + of_property_read_u32(np, "dma-channels", &num_phy); 3490 + if (num_phy > 0) 3491 + pdata->num_of_phy_chans = num_phy; 3492 + 3493 + list = of_get_property(np, "memcpy-channels", &num_memcpy); 3494 + num_memcpy /= sizeof(*list); 3495 + 3496 + if (num_memcpy > D40_MEMCPY_MAX_CHANS || num_memcpy <= 0) { 3497 + d40_err(&pdev->dev, 3498 + "Invalid number of memcpy channels specified (%d)\n", 3499 + num_memcpy); 3500 + return -EINVAL; 3501 + } 3502 + pdata->num_of_memcpy_chans = num_memcpy; 3503 + 3504 + of_property_read_u32_array(np, "memcpy-channels", 3505 + dma40_memcpy_channels, 3506 + num_memcpy); 3507 + 3508 + list = of_get_property(np, "disabled-channels", &num_disabled); 3509 + num_disabled /= sizeof(*list); 3510 + 3511 + if (num_disabled > STEDMA40_MAX_PHYS || num_disabled < 0) { 3512 + d40_err(&pdev->dev, 3513 + "Invalid number of disabled channels specified (%d)\n", 3514 + num_disabled); 3515 + return -EINVAL; 3516 + } 3517 + 3518 + of_property_read_u32_array(np, "disabled-channels", 3519 + pdata->disabled_channels, 3520 + num_disabled); 3521 + pdata->disabled_channels[num_disabled] = -1; 3522 + 3523 + pdev->dev.platform_data = pdata; 3524 + 3525 + return 0; 3526 + } 3527 + 3483 3528 static int __init d40_probe(struct platform_device *pdev) 3484 3529 { 3485 - int err; 3530 + struct stedma40_platform_data *plat_data = pdev->dev.platform_data; 3531 + struct device_node *np = pdev->dev.of_node; 3486 3532 int ret = -ENOENT; 3487 - struct d40_base *base; 3533 + struct d40_base *base = NULL; 3488 3534 struct resource *res = NULL; 3489 3535 int num_reserved_chans; 3490 3536 u32 val; 3491 3537 3492 - base = d40_hw_detect_init(pdev); 3538 + if (!plat_data) { 3539 + if (np) { 3540 + if(d40_of_probe(pdev, np)) { 3541 + ret = -ENOMEM; 3542 + goto failure; 3543 + } 3544 + } else { 3545 + d40_err(&pdev->dev, "No pdata or Device Tree provided\n"); 3546 + goto failure; 3547 + } 3548 + } 3493 3549 3550 + base = d40_hw_detect_init(pdev); 3494 3551 if (!base) 3495 3552 goto failure; 3496 3553 ··· 3648 3575 base->lcpa_regulator = regulator_get(base->dev, "lcla_esram"); 3649 3576 if (IS_ERR(base->lcpa_regulator)) { 3650 3577 d40_err(&pdev->dev, "Failed to get lcpa_regulator\n"); 3578 + ret = PTR_ERR(base->lcpa_regulator); 3651 3579 base->lcpa_regulator = NULL; 3652 3580 goto failure; 3653 3581 } ··· 3664 3590 } 3665 3591 3666 3592 base->initialized = true; 3667 - err = d40_dmaengine_init(base, num_reserved_chans); 3668 - if (err) 3593 + ret = d40_dmaengine_init(base, num_reserved_chans); 3594 + if (ret) 3669 3595 goto failure; 3670 3596 3671 3597 base->dev->dma_parms = &base->dma_parms; 3672 - err = dma_set_max_seg_size(base->dev, STEDMA40_MAX_SEG_SIZE); 3673 - if (err) { 3598 + ret = dma_set_max_seg_size(base->dev, STEDMA40_MAX_SEG_SIZE); 3599 + if (ret) { 3674 3600 d40_err(&pdev->dev, "Failed to set dma max seg size\n"); 3675 3601 goto failure; 3676 3602 } 3677 3603 3678 3604 d40_hw_init(base); 3605 + 3606 + if (np) { 3607 + ret = of_dma_controller_register(np, d40_xlate, NULL); 3608 + if (ret) 3609 + dev_err(&pdev->dev, 3610 + "could not register of_dma_controller\n"); 3611 + } 3679 3612 3680 3613 dev_info(base->dev, "initialized\n"); 3681 3614 return 0; ··· 3737 3656 return ret; 3738 3657 } 3739 3658 3659 + static const struct of_device_id d40_match[] = { 3660 + { .compatible = "stericsson,dma40", }, 3661 + {} 3662 + }; 3663 + 3740 3664 static struct platform_driver d40_driver = { 3741 3665 .driver = { 3742 3666 .owner = THIS_MODULE, 3743 3667 .name = D40_NAME, 3744 3668 .pm = DMA40_PM_OPS, 3669 + .of_match_table = d40_match, 3745 3670 }, 3746 3671 }; 3747 3672
+92 -85
drivers/dma/ste_dma40_ll.c
··· 10 10 11 11 #include "ste_dma40_ll.h" 12 12 13 + u8 d40_width_to_bits(enum dma_slave_buswidth width) 14 + { 15 + if (width == DMA_SLAVE_BUSWIDTH_1_BYTE) 16 + return STEDMA40_ESIZE_8_BIT; 17 + else if (width == DMA_SLAVE_BUSWIDTH_2_BYTES) 18 + return STEDMA40_ESIZE_16_BIT; 19 + else if (width == DMA_SLAVE_BUSWIDTH_8_BYTES) 20 + return STEDMA40_ESIZE_64_BIT; 21 + else 22 + return STEDMA40_ESIZE_32_BIT; 23 + } 24 + 13 25 /* Sets up proper LCSP1 and LCSP3 register for a logical channel */ 14 26 void d40_log_cfg(struct stedma40_chan_cfg *cfg, 15 27 u32 *lcsp1, u32 *lcsp3) ··· 30 18 u32 l1 = 0; /* src */ 31 19 32 20 /* src is mem? -> increase address pos */ 33 - if (cfg->dir == STEDMA40_MEM_TO_PERIPH || 34 - cfg->dir == STEDMA40_MEM_TO_MEM) 35 - l1 |= 1 << D40_MEM_LCSP1_SCFG_INCR_POS; 21 + if (cfg->dir == DMA_MEM_TO_DEV || 22 + cfg->dir == DMA_MEM_TO_MEM) 23 + l1 |= BIT(D40_MEM_LCSP1_SCFG_INCR_POS); 36 24 37 25 /* dst is mem? -> increase address pos */ 38 - if (cfg->dir == STEDMA40_PERIPH_TO_MEM || 39 - cfg->dir == STEDMA40_MEM_TO_MEM) 40 - l3 |= 1 << D40_MEM_LCSP3_DCFG_INCR_POS; 26 + if (cfg->dir == DMA_DEV_TO_MEM || 27 + cfg->dir == DMA_MEM_TO_MEM) 28 + l3 |= BIT(D40_MEM_LCSP3_DCFG_INCR_POS); 41 29 42 30 /* src is hw? -> master port 1 */ 43 - if (cfg->dir == STEDMA40_PERIPH_TO_MEM || 44 - cfg->dir == STEDMA40_PERIPH_TO_PERIPH) 45 - l1 |= 1 << D40_MEM_LCSP1_SCFG_MST_POS; 31 + if (cfg->dir == DMA_DEV_TO_MEM || 32 + cfg->dir == DMA_DEV_TO_DEV) 33 + l1 |= BIT(D40_MEM_LCSP1_SCFG_MST_POS); 46 34 47 35 /* dst is hw? -> master port 1 */ 48 - if (cfg->dir == STEDMA40_MEM_TO_PERIPH || 49 - cfg->dir == STEDMA40_PERIPH_TO_PERIPH) 50 - l3 |= 1 << D40_MEM_LCSP3_DCFG_MST_POS; 36 + if (cfg->dir == DMA_MEM_TO_DEV || 37 + cfg->dir == DMA_DEV_TO_DEV) 38 + l3 |= BIT(D40_MEM_LCSP3_DCFG_MST_POS); 51 39 52 - l3 |= 1 << D40_MEM_LCSP3_DCFG_EIM_POS; 40 + l3 |= BIT(D40_MEM_LCSP3_DCFG_EIM_POS); 53 41 l3 |= cfg->dst_info.psize << D40_MEM_LCSP3_DCFG_PSIZE_POS; 54 - l3 |= cfg->dst_info.data_width << D40_MEM_LCSP3_DCFG_ESIZE_POS; 42 + l3 |= d40_width_to_bits(cfg->dst_info.data_width) 43 + << D40_MEM_LCSP3_DCFG_ESIZE_POS; 55 44 56 - l1 |= 1 << D40_MEM_LCSP1_SCFG_EIM_POS; 45 + l1 |= BIT(D40_MEM_LCSP1_SCFG_EIM_POS); 57 46 l1 |= cfg->src_info.psize << D40_MEM_LCSP1_SCFG_PSIZE_POS; 58 - l1 |= cfg->src_info.data_width << D40_MEM_LCSP1_SCFG_ESIZE_POS; 47 + l1 |= d40_width_to_bits(cfg->src_info.data_width) 48 + << D40_MEM_LCSP1_SCFG_ESIZE_POS; 59 49 60 50 *lcsp1 = l1; 61 51 *lcsp3 = l3; 62 52 63 53 } 64 54 65 - /* Sets up SRC and DST CFG register for both logical and physical channels */ 66 - void d40_phy_cfg(struct stedma40_chan_cfg *cfg, 67 - u32 *src_cfg, u32 *dst_cfg, bool is_log) 55 + void d40_phy_cfg(struct stedma40_chan_cfg *cfg, u32 *src_cfg, u32 *dst_cfg) 68 56 { 69 57 u32 src = 0; 70 58 u32 dst = 0; 71 59 72 - if (!is_log) { 73 - /* Physical channel */ 74 - if ((cfg->dir == STEDMA40_PERIPH_TO_MEM) || 75 - (cfg->dir == STEDMA40_PERIPH_TO_PERIPH)) { 76 - /* Set master port to 1 */ 77 - src |= 1 << D40_SREG_CFG_MST_POS; 78 - src |= D40_TYPE_TO_EVENT(cfg->src_dev_type); 60 + if ((cfg->dir == DMA_DEV_TO_MEM) || 61 + (cfg->dir == DMA_DEV_TO_DEV)) { 62 + /* Set master port to 1 */ 63 + src |= BIT(D40_SREG_CFG_MST_POS); 64 + src |= D40_TYPE_TO_EVENT(cfg->dev_type); 79 65 80 - if (cfg->src_info.flow_ctrl == STEDMA40_NO_FLOW_CTRL) 81 - src |= 1 << D40_SREG_CFG_PHY_TM_POS; 82 - else 83 - src |= 3 << D40_SREG_CFG_PHY_TM_POS; 84 - } 85 - if ((cfg->dir == STEDMA40_MEM_TO_PERIPH) || 86 - (cfg->dir == STEDMA40_PERIPH_TO_PERIPH)) { 87 - /* Set master port to 1 */ 88 - dst |= 1 << D40_SREG_CFG_MST_POS; 89 - dst |= D40_TYPE_TO_EVENT(cfg->dst_dev_type); 66 + if (cfg->src_info.flow_ctrl == STEDMA40_NO_FLOW_CTRL) 67 + src |= BIT(D40_SREG_CFG_PHY_TM_POS); 68 + else 69 + src |= 3 << D40_SREG_CFG_PHY_TM_POS; 70 + } 71 + if ((cfg->dir == DMA_MEM_TO_DEV) || 72 + (cfg->dir == DMA_DEV_TO_DEV)) { 73 + /* Set master port to 1 */ 74 + dst |= BIT(D40_SREG_CFG_MST_POS); 75 + dst |= D40_TYPE_TO_EVENT(cfg->dev_type); 90 76 91 - if (cfg->dst_info.flow_ctrl == STEDMA40_NO_FLOW_CTRL) 92 - dst |= 1 << D40_SREG_CFG_PHY_TM_POS; 93 - else 94 - dst |= 3 << D40_SREG_CFG_PHY_TM_POS; 95 - } 96 - /* Interrupt on end of transfer for destination */ 97 - dst |= 1 << D40_SREG_CFG_TIM_POS; 77 + if (cfg->dst_info.flow_ctrl == STEDMA40_NO_FLOW_CTRL) 78 + dst |= BIT(D40_SREG_CFG_PHY_TM_POS); 79 + else 80 + dst |= 3 << D40_SREG_CFG_PHY_TM_POS; 81 + } 82 + /* Interrupt on end of transfer for destination */ 83 + dst |= BIT(D40_SREG_CFG_TIM_POS); 98 84 99 - /* Generate interrupt on error */ 100 - src |= 1 << D40_SREG_CFG_EIM_POS; 101 - dst |= 1 << D40_SREG_CFG_EIM_POS; 85 + /* Generate interrupt on error */ 86 + src |= BIT(D40_SREG_CFG_EIM_POS); 87 + dst |= BIT(D40_SREG_CFG_EIM_POS); 102 88 103 - /* PSIZE */ 104 - if (cfg->src_info.psize != STEDMA40_PSIZE_PHY_1) { 105 - src |= 1 << D40_SREG_CFG_PHY_PEN_POS; 106 - src |= cfg->src_info.psize << D40_SREG_CFG_PSIZE_POS; 107 - } 108 - if (cfg->dst_info.psize != STEDMA40_PSIZE_PHY_1) { 109 - dst |= 1 << D40_SREG_CFG_PHY_PEN_POS; 110 - dst |= cfg->dst_info.psize << D40_SREG_CFG_PSIZE_POS; 111 - } 89 + /* PSIZE */ 90 + if (cfg->src_info.psize != STEDMA40_PSIZE_PHY_1) { 91 + src |= BIT(D40_SREG_CFG_PHY_PEN_POS); 92 + src |= cfg->src_info.psize << D40_SREG_CFG_PSIZE_POS; 93 + } 94 + if (cfg->dst_info.psize != STEDMA40_PSIZE_PHY_1) { 95 + dst |= BIT(D40_SREG_CFG_PHY_PEN_POS); 96 + dst |= cfg->dst_info.psize << D40_SREG_CFG_PSIZE_POS; 97 + } 112 98 113 - /* Element size */ 114 - src |= cfg->src_info.data_width << D40_SREG_CFG_ESIZE_POS; 115 - dst |= cfg->dst_info.data_width << D40_SREG_CFG_ESIZE_POS; 99 + /* Element size */ 100 + src |= d40_width_to_bits(cfg->src_info.data_width) 101 + << D40_SREG_CFG_ESIZE_POS; 102 + dst |= d40_width_to_bits(cfg->dst_info.data_width) 103 + << D40_SREG_CFG_ESIZE_POS; 116 104 117 - /* Set the priority bit to high for the physical channel */ 118 - if (cfg->high_priority) { 119 - src |= 1 << D40_SREG_CFG_PRI_POS; 120 - dst |= 1 << D40_SREG_CFG_PRI_POS; 121 - } 122 - 123 - } else { 124 - /* Logical channel */ 125 - dst |= 1 << D40_SREG_CFG_LOG_GIM_POS; 126 - src |= 1 << D40_SREG_CFG_LOG_GIM_POS; 105 + /* Set the priority bit to high for the physical channel */ 106 + if (cfg->high_priority) { 107 + src |= BIT(D40_SREG_CFG_PRI_POS); 108 + dst |= BIT(D40_SREG_CFG_PRI_POS); 127 109 } 128 110 129 111 if (cfg->src_info.big_endian) 130 - src |= 1 << D40_SREG_CFG_LBE_POS; 112 + src |= BIT(D40_SREG_CFG_LBE_POS); 131 113 if (cfg->dst_info.big_endian) 132 - dst |= 1 << D40_SREG_CFG_LBE_POS; 114 + dst |= BIT(D40_SREG_CFG_LBE_POS); 133 115 134 116 *src_cfg = src; 135 117 *dst_cfg = dst; ··· 149 143 num_elems = 2 << psize; 150 144 151 145 /* Must be aligned */ 152 - if (!IS_ALIGNED(data, 0x1 << data_width)) 146 + if (!IS_ALIGNED(data, data_width)) 153 147 return -EINVAL; 154 148 155 149 /* Transfer size can't be smaller than (num_elms * elem_size) */ 156 - if (data_size < num_elems * (0x1 << data_width)) 150 + if (data_size < num_elems * data_width) 157 151 return -EINVAL; 158 152 159 153 /* The number of elements. IE now many chunks */ 160 - lli->reg_elt = (data_size >> data_width) << D40_SREG_ELEM_PHY_ECNT_POS; 154 + lli->reg_elt = (data_size / data_width) << D40_SREG_ELEM_PHY_ECNT_POS; 161 155 162 156 /* 163 157 * Distance to next element sized entry. 164 158 * Usually the size of the element unless you want gaps. 165 159 */ 166 160 if (addr_inc) 167 - lli->reg_elt |= (0x1 << data_width) << 168 - D40_SREG_ELEM_PHY_EIDX_POS; 161 + lli->reg_elt |= data_width << D40_SREG_ELEM_PHY_EIDX_POS; 169 162 170 163 /* Where the data is */ 171 164 lli->reg_ptr = data; ··· 172 167 173 168 /* If this scatter list entry is the last one, no next link */ 174 169 if (next_lli == 0) 175 - lli->reg_lnk = 0x1 << D40_SREG_LNK_PHY_TCP_POS; 170 + lli->reg_lnk = BIT(D40_SREG_LNK_PHY_TCP_POS); 176 171 else 177 172 lli->reg_lnk = next_lli; 178 173 179 174 /* Set/clear interrupt generation on this link item.*/ 180 175 if (term_int) 181 - lli->reg_cfg |= 0x1 << D40_SREG_CFG_TIM_POS; 176 + lli->reg_cfg |= BIT(D40_SREG_CFG_TIM_POS); 182 177 else 183 - lli->reg_cfg &= ~(0x1 << D40_SREG_CFG_TIM_POS); 178 + lli->reg_cfg &= ~BIT(D40_SREG_CFG_TIM_POS); 184 179 185 - /* Post link */ 186 - lli->reg_lnk |= 0 << D40_SREG_LNK_PHY_PRE_POS; 180 + /* 181 + * Post link - D40_SREG_LNK_PHY_PRE_POS = 0 182 + * Relink happens after transfer completion. 183 + */ 187 184 188 185 return 0; 189 186 } ··· 194 187 { 195 188 u32 max_w = max(data_width1, data_width2); 196 189 u32 min_w = min(data_width1, data_width2); 197 - u32 seg_max = ALIGN(STEDMA40_MAX_SEG_SIZE << min_w, 1 << max_w); 190 + u32 seg_max = ALIGN(STEDMA40_MAX_SEG_SIZE * min_w, max_w); 198 191 199 192 if (seg_max > STEDMA40_MAX_SEG_SIZE) 200 - seg_max -= (1 << max_w); 193 + seg_max -= max_w; 201 194 202 195 if (size <= seg_max) 203 196 return size; 204 197 205 198 if (size <= 2 * seg_max) 206 - return ALIGN(size / 2, 1 << max_w); 199 + return ALIGN(size / 2, max_w); 207 200 208 201 return seg_max; 209 202 } ··· 369 362 lli->lcsp13 = reg_cfg; 370 363 371 364 /* The number of elements to transfer */ 372 - lli->lcsp02 = ((data_size >> data_width) << 365 + lli->lcsp02 = ((data_size / data_width) << 373 366 D40_MEM_LCSP0_ECNT_POS) & D40_MEM_LCSP0_ECNT_MASK; 374 367 375 - BUG_ON((data_size >> data_width) > STEDMA40_MAX_SEG_SIZE); 368 + BUG_ON((data_size / data_width) > STEDMA40_MAX_SEG_SIZE); 376 369 377 370 /* 16 LSBs address of the current element */ 378 371 lli->lcsp02 |= data & D40_MEM_LCSP0_SPTR_MASK;
+1 -2
drivers/dma/ste_dma40_ll.h
··· 432 432 433 433 void d40_phy_cfg(struct stedma40_chan_cfg *cfg, 434 434 u32 *src_cfg, 435 - u32 *dst_cfg, 436 - bool is_log); 435 + u32 *dst_cfg); 437 436 438 437 void d40_log_cfg(struct stedma40_chan_cfg *cfg, 439 438 u32 *lcsp1,
+53 -10
drivers/gpio/gpio-rcar.c
··· 51 51 #define FILONOFF 0x28 52 52 #define BOTHEDGE 0x4c 53 53 54 + #define RCAR_MAX_GPIO_PER_BANK 32 55 + 54 56 static inline u32 gpio_rcar_read(struct gpio_rcar_priv *p, int offs) 55 57 { 56 58 return ioread32(p->base + offs); ··· 276 274 .map = gpio_rcar_irq_domain_map, 277 275 }; 278 276 277 + static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) 278 + { 279 + struct gpio_rcar_config *pdata = p->pdev->dev.platform_data; 280 + struct device_node *np = p->pdev->dev.of_node; 281 + struct of_phandle_args args; 282 + int ret; 283 + 284 + if (pdata) { 285 + p->config = *pdata; 286 + } else if (IS_ENABLED(CONFIG_OF) && np) { 287 + ret = of_parse_phandle_with_args(np, "gpio-ranges", 288 + "#gpio-range-cells", 0, &args); 289 + p->config.number_of_pins = ret == 0 && args.args_count == 3 290 + ? args.args[2] 291 + : RCAR_MAX_GPIO_PER_BANK; 292 + p->config.gpio_base = -1; 293 + } 294 + 295 + if (p->config.number_of_pins == 0 || 296 + p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) { 297 + dev_warn(&p->pdev->dev, 298 + "Invalid number of gpio lines %u, using %u\n", 299 + p->config.number_of_pins, RCAR_MAX_GPIO_PER_BANK); 300 + p->config.number_of_pins = RCAR_MAX_GPIO_PER_BANK; 301 + } 302 + } 303 + 279 304 static int gpio_rcar_probe(struct platform_device *pdev) 280 305 { 281 - struct gpio_rcar_config *pdata = pdev->dev.platform_data; 282 306 struct gpio_rcar_priv *p; 283 307 struct resource *io, *irq; 284 308 struct gpio_chip *gpio_chip; ··· 319 291 goto err0; 320 292 } 321 293 322 - /* deal with driver instance configuration */ 323 - if (pdata) 324 - p->config = *pdata; 325 - 326 294 p->pdev = pdev; 327 - platform_set_drvdata(pdev, p); 328 295 spin_lock_init(&p->lock); 296 + 297 + /* Get device configuration from DT node or platform data. */ 298 + gpio_rcar_parse_pdata(p); 299 + 300 + platform_set_drvdata(pdev, p); 329 301 330 302 io = platform_get_resource(pdev, IORESOURCE_MEM, 0); 331 303 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); ··· 353 325 gpio_chip->set = gpio_rcar_set; 354 326 gpio_chip->to_irq = gpio_rcar_to_irq; 355 327 gpio_chip->label = name; 328 + gpio_chip->dev = &pdev->dev; 356 329 gpio_chip->owner = THIS_MODULE; 357 330 gpio_chip->base = p->config.gpio_base; 358 331 gpio_chip->ngpio = p->config.number_of_pins; ··· 400 371 p->config.irq_base, ret); 401 372 } 402 373 403 - ret = gpiochip_add_pin_range(gpio_chip, p->config.pctl_name, 0, 404 - gpio_chip->base, gpio_chip->ngpio); 405 - if (ret < 0) 406 - dev_warn(&pdev->dev, "failed to add pin range\n"); 374 + if (p->config.pctl_name) { 375 + ret = gpiochip_add_pin_range(gpio_chip, p->config.pctl_name, 0, 376 + gpio_chip->base, gpio_chip->ngpio); 377 + if (ret < 0) 378 + dev_warn(&pdev->dev, "failed to add pin range\n"); 379 + } 407 380 408 381 return 0; 409 382 ··· 428 397 return 0; 429 398 } 430 399 400 + #ifdef CONFIG_OF 401 + static const struct of_device_id gpio_rcar_of_table[] = { 402 + { 403 + .compatible = "renesas,gpio-rcar", 404 + }, 405 + { }, 406 + }; 407 + 408 + MODULE_DEVICE_TABLE(of, gpio_rcar_of_table); 409 + #endif 410 + 431 411 static struct platform_driver gpio_rcar_device_driver = { 432 412 .probe = gpio_rcar_probe, 433 413 .remove = gpio_rcar_remove, 434 414 .driver = { 435 415 .name = "gpio_rcar", 416 + .of_match_table = of_match_ptr(gpio_rcar_of_table), 436 417 } 437 418 }; 438 419
+4 -63
drivers/gpio/gpio-samsung.c
··· 933 933 s3c_gpiolib_track(chip); 934 934 } 935 935 936 - #if defined(CONFIG_PLAT_S3C24XX) && defined(CONFIG_OF) 937 - static int s3c24xx_gpio_xlate(struct gpio_chip *gc, 938 - const struct of_phandle_args *gpiospec, u32 *flags) 939 - { 940 - unsigned int pin; 941 - 942 - if (WARN_ON(gc->of_gpio_n_cells < 3)) 943 - return -EINVAL; 944 - 945 - if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells)) 946 - return -EINVAL; 947 - 948 - if (gpiospec->args[0] > gc->ngpio) 949 - return -EINVAL; 950 - 951 - pin = gc->base + gpiospec->args[0]; 952 - 953 - if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(gpiospec->args[1]))) 954 - pr_warn("gpio_xlate: failed to set pin function\n"); 955 - if (s3c_gpio_setpull(pin, gpiospec->args[2] & 0xffff)) 956 - pr_warn("gpio_xlate: failed to set pin pull up/down\n"); 957 - 958 - if (flags) 959 - *flags = gpiospec->args[2] >> 16; 960 - 961 - return gpiospec->args[0]; 962 - } 963 - 964 - static const struct of_device_id s3c24xx_gpio_dt_match[] __initdata = { 965 - { .compatible = "samsung,s3c24xx-gpio", }, 966 - {} 967 - }; 968 - 969 - static __init void s3c24xx_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip, 970 - u64 base, u64 offset) 971 - { 972 - struct gpio_chip *gc = &chip->chip; 973 - u64 address; 974 - 975 - if (!of_have_populated_dt()) 976 - return; 977 - 978 - address = chip->base ? base + ((u32)chip->base & 0xfff) : base + offset; 979 - gc->of_node = of_find_matching_node_by_address(NULL, 980 - s3c24xx_gpio_dt_match, address); 981 - if (!gc->of_node) { 982 - pr_info("gpio: device tree node not found for gpio controller" 983 - " with base address %08llx\n", address); 984 - return; 985 - } 986 - gc->of_gpio_n_cells = 3; 987 - gc->of_xlate = s3c24xx_gpio_xlate; 988 - } 989 - #else 990 - static __init void s3c24xx_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip, 991 - u64 base, u64 offset) 992 - { 993 - return; 994 - } 995 - #endif /* defined(CONFIG_PLAT_S3C24XX) && defined(CONFIG_OF) */ 996 - 997 936 static void __init s3c24xx_gpiolib_add_chips(struct samsung_gpio_chip *chip, 998 937 int nr_chips, void __iomem *base) 999 938 { ··· 957 1018 gc->direction_output = samsung_gpiolib_2bit_output; 958 1019 959 1020 samsung_gpiolib_add(chip); 960 - 961 - s3c24xx_gpiolib_attach_ofnode(chip, S3C24XX_PA_GPIO, i * 0x10); 962 1021 } 963 1022 } 964 1023 ··· 2963 3026 */ 2964 3027 struct device_node *pctrl_np; 2965 3028 static const struct of_device_id exynos_pinctrl_ids[] = { 3029 + { .compatible = "samsung,s3c2412-pinctrl", }, 3030 + { .compatible = "samsung,s3c2416-pinctrl", }, 3031 + { .compatible = "samsung,s3c2440-pinctrl", }, 3032 + { .compatible = "samsung,s3c2450-pinctrl", }, 2966 3033 { .compatible = "samsung,exynos4210-pinctrl", }, 2967 3034 { .compatible = "samsung,exynos4x12-pinctrl", }, 2968 3035 { .compatible = "samsung,exynos5250-pinctrl", },
+34
drivers/mailbox/Kconfig
··· 16 16 Management Engine, primarily for cpufreq. Say Y here if you want 17 17 to use the PL320 IPCM support. 18 18 19 + config OMAP_MBOX 20 + tristate 21 + help 22 + This option is selected by any OMAP architecture specific mailbox 23 + driver such as CONFIG_OMAP1_MBOX or CONFIG_OMAP2PLUS_MBOX. This 24 + enables the common OMAP mailbox framework code. 25 + 26 + config OMAP1_MBOX 27 + tristate "OMAP1 Mailbox framework support" 28 + depends on ARCH_OMAP1 29 + select OMAP_MBOX 30 + help 31 + Mailbox implementation for OMAP chips with hardware for 32 + interprocessor communication involving DSP in OMAP1. Say Y here 33 + if you want to use OMAP1 Mailbox framework support. 34 + 35 + config OMAP2PLUS_MBOX 36 + tristate "OMAP2+ Mailbox framework support" 37 + depends on ARCH_OMAP2PLUS 38 + select OMAP_MBOX 39 + help 40 + Mailbox implementation for OMAP family chips with hardware for 41 + interprocessor communication involving DSP, IVA1.0 and IVA2 in 42 + OMAP2/3; or IPU, IVA HD and DSP in OMAP4/5. Say Y here if you 43 + want to use OMAP2+ Mailbox framework support. 44 + 45 + config OMAP_MBOX_KFIFO_SIZE 46 + int "Mailbox kfifo default buffer size (bytes)" 47 + depends on OMAP2PLUS_MBOX || OMAP1_MBOX 48 + default 256 49 + help 50 + Specify the default size of mailbox's kfifo buffers (bytes). 51 + This can also be changed at runtime (via the mbox_kfifo_size 52 + module parameter). 19 53 endif
+6
drivers/mailbox/Makefile
··· 1 1 obj-$(CONFIG_PL320_MBOX) += pl320-ipc.o 2 + 3 + obj-$(CONFIG_OMAP_MBOX) += omap-mailbox.o 4 + obj-$(CONFIG_OMAP1_MBOX) += mailbox_omap1.o 5 + mailbox_omap1-objs := mailbox-omap1.o 6 + obj-$(CONFIG_OMAP2PLUS_MBOX) += mailbox_omap2.o 7 + mailbox_omap2-objs := mailbox-omap2.o
+5
drivers/pinctrl/Kconfig
··· 217 217 select PINMUX 218 218 select PINCONF 219 219 220 + config PINCTRL_S3C24XX 221 + bool "Samsung S3C24XX SoC pinctrl driver" 222 + depends on ARCH_S3C24XX 223 + select PINCTRL_SAMSUNG 224 + 220 225 config PINCTRL_S3C64XX 221 226 bool "Samsung S3C64XX SoC pinctrl driver" 222 227 depends on ARCH_S3C64XX
+1
drivers/pinctrl/Makefile
··· 42 42 obj-$(CONFIG_PINCTRL_SAMSUNG) += pinctrl-samsung.o 43 43 obj-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o 44 44 obj-$(CONFIG_PINCTRL_EXYNOS5440) += pinctrl-exynos5440.o 45 + obj-$(CONFIG_PINCTRL_S3C24XX) += pinctrl-s3c24xx.o 45 46 obj-$(CONFIG_PINCTRL_S3C64XX) += pinctrl-s3c64xx.o 46 47 obj-$(CONFIG_PINCTRL_XWAY) += pinctrl-xway.o 47 48 obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o
+651
drivers/pinctrl/pinctrl-s3c24xx.c
··· 1 + /* 2 + * S3C24XX specific support for Samsung pinctrl/gpiolib driver. 3 + * 4 + * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de> 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; either version 2 of the License, or 9 + * (at your option) any later version. 10 + * 11 + * This file contains the SamsungS3C24XX specific information required by the 12 + * Samsung pinctrl/gpiolib driver. It also includes the implementation of 13 + * external gpio and wakeup interrupt support. 14 + */ 15 + 16 + #include <linux/module.h> 17 + #include <linux/device.h> 18 + #include <linux/interrupt.h> 19 + #include <linux/irqdomain.h> 20 + #include <linux/irq.h> 21 + #include <linux/of_irq.h> 22 + #include <linux/irqchip/chained_irq.h> 23 + #include <linux/io.h> 24 + #include <linux/slab.h> 25 + #include <linux/err.h> 26 + 27 + #include "pinctrl-samsung.h" 28 + 29 + #define NUM_EINT 24 30 + #define NUM_EINT_IRQ 6 31 + #define EINT_MAX_PER_GROUP 8 32 + 33 + #define EINTPEND_REG 0xa8 34 + #define EINTMASK_REG 0xa4 35 + 36 + #define EINT_GROUP(i) ((int)((i) / EINT_MAX_PER_GROUP)) 37 + #define EINT_REG(i) ((EINT_GROUP(i) * 4) + 0x88) 38 + #define EINT_OFFS(i) ((i) % EINT_MAX_PER_GROUP * 4) 39 + 40 + #define EINT_LEVEL_LOW 0 41 + #define EINT_LEVEL_HIGH 1 42 + #define EINT_EDGE_FALLING 2 43 + #define EINT_EDGE_RISING 4 44 + #define EINT_EDGE_BOTH 6 45 + #define EINT_MASK 0xf 46 + 47 + static struct samsung_pin_bank_type bank_type_1bit = { 48 + .fld_width = { 1, 1, }, 49 + .reg_offset = { 0x00, 0x04, }, 50 + }; 51 + 52 + static struct samsung_pin_bank_type bank_type_2bit = { 53 + .fld_width = { 2, 1, 2, }, 54 + .reg_offset = { 0x00, 0x04, 0x08, }, 55 + }; 56 + 57 + #define PIN_BANK_A(pins, reg, id) \ 58 + { \ 59 + .type = &bank_type_1bit, \ 60 + .pctl_offset = reg, \ 61 + .nr_pins = pins, \ 62 + .eint_type = EINT_TYPE_NONE, \ 63 + .name = id \ 64 + } 65 + 66 + #define PIN_BANK_2BIT(pins, reg, id) \ 67 + { \ 68 + .type = &bank_type_2bit, \ 69 + .pctl_offset = reg, \ 70 + .nr_pins = pins, \ 71 + .eint_type = EINT_TYPE_NONE, \ 72 + .name = id \ 73 + } 74 + 75 + #define PIN_BANK_2BIT_EINTW(pins, reg, id, eoffs, emask)\ 76 + { \ 77 + .type = &bank_type_2bit, \ 78 + .pctl_offset = reg, \ 79 + .nr_pins = pins, \ 80 + .eint_type = EINT_TYPE_WKUP, \ 81 + .eint_func = 2, \ 82 + .eint_mask = emask, \ 83 + .eint_offset = eoffs, \ 84 + .name = id \ 85 + } 86 + 87 + /** 88 + * struct s3c24xx_eint_data: EINT common data 89 + * @drvdata: pin controller driver data 90 + * @domains: IRQ domains of particular EINT interrupts 91 + * @parents: mapped parent irqs in the main interrupt controller 92 + */ 93 + struct s3c24xx_eint_data { 94 + struct samsung_pinctrl_drv_data *drvdata; 95 + struct irq_domain *domains[NUM_EINT]; 96 + int parents[NUM_EINT_IRQ]; 97 + }; 98 + 99 + /** 100 + * struct s3c24xx_eint_domain_data: per irq-domain data 101 + * @bank: pin bank related to the domain 102 + * @eint_data: common data 103 + * eint0_3_parent_only: live eints 0-3 only in the main intc 104 + */ 105 + struct s3c24xx_eint_domain_data { 106 + struct samsung_pin_bank *bank; 107 + struct s3c24xx_eint_data *eint_data; 108 + bool eint0_3_parent_only; 109 + }; 110 + 111 + static int s3c24xx_eint_get_trigger(unsigned int type) 112 + { 113 + switch (type) { 114 + case IRQ_TYPE_EDGE_RISING: 115 + return EINT_EDGE_RISING; 116 + break; 117 + case IRQ_TYPE_EDGE_FALLING: 118 + return EINT_EDGE_FALLING; 119 + break; 120 + case IRQ_TYPE_EDGE_BOTH: 121 + return EINT_EDGE_BOTH; 122 + break; 123 + case IRQ_TYPE_LEVEL_HIGH: 124 + return EINT_LEVEL_HIGH; 125 + break; 126 + case IRQ_TYPE_LEVEL_LOW: 127 + return EINT_LEVEL_LOW; 128 + break; 129 + default: 130 + return -EINVAL; 131 + } 132 + } 133 + 134 + static void s3c24xx_eint_set_handler(unsigned int irq, unsigned int type) 135 + { 136 + /* Edge- and level-triggered interrupts need different handlers */ 137 + if (type & IRQ_TYPE_EDGE_BOTH) 138 + __irq_set_handler_locked(irq, handle_edge_irq); 139 + else 140 + __irq_set_handler_locked(irq, handle_level_irq); 141 + } 142 + 143 + static void s3c24xx_eint_set_function(struct samsung_pinctrl_drv_data *d, 144 + struct samsung_pin_bank *bank, int pin) 145 + { 146 + struct samsung_pin_bank_type *bank_type = bank->type; 147 + unsigned long flags; 148 + void __iomem *reg; 149 + u8 shift; 150 + u32 mask; 151 + u32 val; 152 + 153 + /* Make sure that pin is configured as interrupt */ 154 + reg = d->virt_base + bank->pctl_offset; 155 + shift = pin * bank_type->fld_width[PINCFG_TYPE_FUNC]; 156 + mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1; 157 + 158 + spin_lock_irqsave(&bank->slock, flags); 159 + 160 + val = readl(reg); 161 + val &= ~(mask << shift); 162 + val |= bank->eint_func << shift; 163 + writel(val, reg); 164 + 165 + spin_unlock_irqrestore(&bank->slock, flags); 166 + } 167 + 168 + static int s3c24xx_eint_type(struct irq_data *data, unsigned int type) 169 + { 170 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 171 + struct samsung_pinctrl_drv_data *d = bank->drvdata; 172 + int index = bank->eint_offset + data->hwirq; 173 + void __iomem *reg; 174 + int trigger; 175 + u8 shift; 176 + u32 val; 177 + 178 + trigger = s3c24xx_eint_get_trigger(type); 179 + if (trigger < 0) { 180 + dev_err(d->dev, "unsupported external interrupt type\n"); 181 + return -EINVAL; 182 + } 183 + 184 + s3c24xx_eint_set_handler(data->irq, type); 185 + 186 + /* Set up interrupt trigger */ 187 + reg = d->virt_base + EINT_REG(index); 188 + shift = EINT_OFFS(index); 189 + 190 + val = readl(reg); 191 + val &= ~(EINT_MASK << shift); 192 + val |= trigger << shift; 193 + writel(val, reg); 194 + 195 + s3c24xx_eint_set_function(d, bank, data->hwirq); 196 + 197 + return 0; 198 + } 199 + 200 + /* Handling of EINTs 0-3 on all except S3C2412 and S3C2413 */ 201 + 202 + static void s3c2410_eint0_3_ack(struct irq_data *data) 203 + { 204 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 205 + struct s3c24xx_eint_domain_data *ddata = bank->irq_domain->host_data; 206 + struct s3c24xx_eint_data *eint_data = ddata->eint_data; 207 + int parent_irq = eint_data->parents[data->hwirq]; 208 + struct irq_chip *parent_chip = irq_get_chip(parent_irq); 209 + 210 + parent_chip->irq_ack(irq_get_irq_data(parent_irq)); 211 + } 212 + 213 + static void s3c2410_eint0_3_mask(struct irq_data *data) 214 + { 215 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 216 + struct s3c24xx_eint_domain_data *ddata = bank->irq_domain->host_data; 217 + struct s3c24xx_eint_data *eint_data = ddata->eint_data; 218 + int parent_irq = eint_data->parents[data->hwirq]; 219 + struct irq_chip *parent_chip = irq_get_chip(parent_irq); 220 + 221 + parent_chip->irq_mask(irq_get_irq_data(parent_irq)); 222 + } 223 + 224 + static void s3c2410_eint0_3_unmask(struct irq_data *data) 225 + { 226 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 227 + struct s3c24xx_eint_domain_data *ddata = bank->irq_domain->host_data; 228 + struct s3c24xx_eint_data *eint_data = ddata->eint_data; 229 + int parent_irq = eint_data->parents[data->hwirq]; 230 + struct irq_chip *parent_chip = irq_get_chip(parent_irq); 231 + 232 + parent_chip->irq_unmask(irq_get_irq_data(parent_irq)); 233 + } 234 + 235 + static struct irq_chip s3c2410_eint0_3_chip = { 236 + .name = "s3c2410-eint0_3", 237 + .irq_ack = s3c2410_eint0_3_ack, 238 + .irq_mask = s3c2410_eint0_3_mask, 239 + .irq_unmask = s3c2410_eint0_3_unmask, 240 + .irq_set_type = s3c24xx_eint_type, 241 + }; 242 + 243 + static void s3c2410_demux_eint0_3(unsigned int irq, struct irq_desc *desc) 244 + { 245 + struct irq_data *data = irq_desc_get_irq_data(desc); 246 + struct s3c24xx_eint_data *eint_data = irq_get_handler_data(irq); 247 + unsigned int virq; 248 + 249 + /* the first 4 eints have a simple 1 to 1 mapping */ 250 + virq = irq_linear_revmap(eint_data->domains[data->hwirq], data->hwirq); 251 + /* Something must be really wrong if an unmapped EINT is unmasked */ 252 + BUG_ON(!virq); 253 + 254 + generic_handle_irq(virq); 255 + } 256 + 257 + /* Handling of EINTs 0-3 on S3C2412 and S3C2413 */ 258 + 259 + static void s3c2412_eint0_3_ack(struct irq_data *data) 260 + { 261 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 262 + struct samsung_pinctrl_drv_data *d = bank->drvdata; 263 + 264 + unsigned long bitval = 1UL << data->hwirq; 265 + writel(bitval, d->virt_base + EINTPEND_REG); 266 + } 267 + 268 + static void s3c2412_eint0_3_mask(struct irq_data *data) 269 + { 270 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 271 + struct samsung_pinctrl_drv_data *d = bank->drvdata; 272 + unsigned long mask; 273 + 274 + mask = readl(d->virt_base + EINTMASK_REG); 275 + mask |= (1UL << data->hwirq); 276 + writel(mask, d->virt_base + EINTMASK_REG); 277 + } 278 + 279 + static void s3c2412_eint0_3_unmask(struct irq_data *data) 280 + { 281 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 282 + struct samsung_pinctrl_drv_data *d = bank->drvdata; 283 + unsigned long mask; 284 + 285 + mask = readl(d->virt_base + EINTMASK_REG); 286 + mask &= ~(1UL << data->hwirq); 287 + writel(mask, d->virt_base + EINTMASK_REG); 288 + } 289 + 290 + static struct irq_chip s3c2412_eint0_3_chip = { 291 + .name = "s3c2412-eint0_3", 292 + .irq_ack = s3c2412_eint0_3_ack, 293 + .irq_mask = s3c2412_eint0_3_mask, 294 + .irq_unmask = s3c2412_eint0_3_unmask, 295 + .irq_set_type = s3c24xx_eint_type, 296 + }; 297 + 298 + static void s3c2412_demux_eint0_3(unsigned int irq, struct irq_desc *desc) 299 + { 300 + struct irq_chip *chip = irq_get_chip(irq); 301 + struct irq_data *data = irq_desc_get_irq_data(desc); 302 + struct s3c24xx_eint_data *eint_data = irq_get_handler_data(irq); 303 + unsigned int virq; 304 + 305 + chained_irq_enter(chip, desc); 306 + 307 + /* the first 4 eints have a simple 1 to 1 mapping */ 308 + virq = irq_linear_revmap(eint_data->domains[data->hwirq], data->hwirq); 309 + /* Something must be really wrong if an unmapped EINT is unmasked */ 310 + BUG_ON(!virq); 311 + 312 + generic_handle_irq(virq); 313 + 314 + chained_irq_exit(chip, desc); 315 + } 316 + 317 + /* Handling of all other eints */ 318 + 319 + static void s3c24xx_eint_ack(struct irq_data *data) 320 + { 321 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 322 + struct samsung_pinctrl_drv_data *d = bank->drvdata; 323 + unsigned char index = bank->eint_offset + data->hwirq; 324 + 325 + writel(1UL << index, d->virt_base + EINTPEND_REG); 326 + } 327 + 328 + static void s3c24xx_eint_mask(struct irq_data *data) 329 + { 330 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 331 + struct samsung_pinctrl_drv_data *d = bank->drvdata; 332 + unsigned char index = bank->eint_offset + data->hwirq; 333 + unsigned long mask; 334 + 335 + mask = readl(d->virt_base + EINTMASK_REG); 336 + mask |= (1UL << index); 337 + writel(mask, d->virt_base + EINTMASK_REG); 338 + } 339 + 340 + static void s3c24xx_eint_unmask(struct irq_data *data) 341 + { 342 + struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(data); 343 + struct samsung_pinctrl_drv_data *d = bank->drvdata; 344 + unsigned char index = bank->eint_offset + data->hwirq; 345 + unsigned long mask; 346 + 347 + mask = readl(d->virt_base + EINTMASK_REG); 348 + mask &= ~(1UL << index); 349 + writel(mask, d->virt_base + EINTMASK_REG); 350 + } 351 + 352 + static struct irq_chip s3c24xx_eint_chip = { 353 + .name = "s3c-eint", 354 + .irq_ack = s3c24xx_eint_ack, 355 + .irq_mask = s3c24xx_eint_mask, 356 + .irq_unmask = s3c24xx_eint_unmask, 357 + .irq_set_type = s3c24xx_eint_type, 358 + }; 359 + 360 + static inline void s3c24xx_demux_eint(unsigned int irq, struct irq_desc *desc, 361 + u32 offset, u32 range) 362 + { 363 + struct irq_chip *chip = irq_get_chip(irq); 364 + struct s3c24xx_eint_data *data = irq_get_handler_data(irq); 365 + struct samsung_pinctrl_drv_data *d = data->drvdata; 366 + unsigned int pend, mask; 367 + 368 + chained_irq_enter(chip, desc); 369 + 370 + pend = readl(d->virt_base + EINTPEND_REG); 371 + mask = readl(d->virt_base + EINTMASK_REG); 372 + 373 + pend &= ~mask; 374 + pend &= range; 375 + 376 + while (pend) { 377 + unsigned int virq; 378 + 379 + irq = __ffs(pend); 380 + pend &= ~(1 << irq); 381 + virq = irq_linear_revmap(data->domains[irq], irq - offset); 382 + /* Something is really wrong if an unmapped EINT is unmasked */ 383 + BUG_ON(!virq); 384 + 385 + generic_handle_irq(virq); 386 + } 387 + 388 + chained_irq_exit(chip, desc); 389 + } 390 + 391 + static void s3c24xx_demux_eint4_7(unsigned int irq, struct irq_desc *desc) 392 + { 393 + s3c24xx_demux_eint(irq, desc, 0, 0xf0); 394 + } 395 + 396 + static void s3c24xx_demux_eint8_23(unsigned int irq, struct irq_desc *desc) 397 + { 398 + s3c24xx_demux_eint(irq, desc, 8, 0xffff00); 399 + } 400 + 401 + static irq_flow_handler_t s3c2410_eint_handlers[NUM_EINT_IRQ] = { 402 + s3c2410_demux_eint0_3, 403 + s3c2410_demux_eint0_3, 404 + s3c2410_demux_eint0_3, 405 + s3c2410_demux_eint0_3, 406 + s3c24xx_demux_eint4_7, 407 + s3c24xx_demux_eint8_23, 408 + }; 409 + 410 + static irq_flow_handler_t s3c2412_eint_handlers[NUM_EINT_IRQ] = { 411 + s3c2412_demux_eint0_3, 412 + s3c2412_demux_eint0_3, 413 + s3c2412_demux_eint0_3, 414 + s3c2412_demux_eint0_3, 415 + s3c24xx_demux_eint4_7, 416 + s3c24xx_demux_eint8_23, 417 + }; 418 + 419 + static int s3c24xx_gpf_irq_map(struct irq_domain *h, unsigned int virq, 420 + irq_hw_number_t hw) 421 + { 422 + struct s3c24xx_eint_domain_data *ddata = h->host_data; 423 + struct samsung_pin_bank *bank = ddata->bank; 424 + 425 + if (!(bank->eint_mask & (1 << (bank->eint_offset + hw)))) 426 + return -EINVAL; 427 + 428 + if (hw <= 3) { 429 + if (ddata->eint0_3_parent_only) 430 + irq_set_chip_and_handler(virq, &s3c2410_eint0_3_chip, 431 + handle_edge_irq); 432 + else 433 + irq_set_chip_and_handler(virq, &s3c2412_eint0_3_chip, 434 + handle_edge_irq); 435 + } else { 436 + irq_set_chip_and_handler(virq, &s3c24xx_eint_chip, 437 + handle_edge_irq); 438 + } 439 + irq_set_chip_data(virq, bank); 440 + set_irq_flags(virq, IRQF_VALID); 441 + return 0; 442 + } 443 + 444 + static const struct irq_domain_ops s3c24xx_gpf_irq_ops = { 445 + .map = s3c24xx_gpf_irq_map, 446 + .xlate = irq_domain_xlate_twocell, 447 + }; 448 + 449 + static int s3c24xx_gpg_irq_map(struct irq_domain *h, unsigned int virq, 450 + irq_hw_number_t hw) 451 + { 452 + struct s3c24xx_eint_domain_data *ddata = h->host_data; 453 + struct samsung_pin_bank *bank = ddata->bank; 454 + 455 + if (!(bank->eint_mask & (1 << (bank->eint_offset + hw)))) 456 + return -EINVAL; 457 + 458 + irq_set_chip_and_handler(virq, &s3c24xx_eint_chip, handle_edge_irq); 459 + irq_set_chip_data(virq, bank); 460 + set_irq_flags(virq, IRQF_VALID); 461 + return 0; 462 + } 463 + 464 + static const struct irq_domain_ops s3c24xx_gpg_irq_ops = { 465 + .map = s3c24xx_gpg_irq_map, 466 + .xlate = irq_domain_xlate_twocell, 467 + }; 468 + 469 + static const struct of_device_id s3c24xx_eint_irq_ids[] = { 470 + { .compatible = "samsung,s3c2410-wakeup-eint", .data = (void *)1 }, 471 + { .compatible = "samsung,s3c2412-wakeup-eint", .data = (void *)0 }, 472 + { } 473 + }; 474 + 475 + static int s3c24xx_eint_init(struct samsung_pinctrl_drv_data *d) 476 + { 477 + struct device *dev = d->dev; 478 + const struct of_device_id *match; 479 + struct device_node *eint_np = NULL; 480 + struct device_node *np; 481 + struct samsung_pin_bank *bank; 482 + struct s3c24xx_eint_data *eint_data; 483 + const struct irq_domain_ops *ops; 484 + unsigned int i; 485 + bool eint0_3_parent_only; 486 + irq_flow_handler_t *handlers; 487 + 488 + for_each_child_of_node(dev->of_node, np) { 489 + match = of_match_node(s3c24xx_eint_irq_ids, np); 490 + if (match) { 491 + eint_np = np; 492 + eint0_3_parent_only = (bool)match->data; 493 + break; 494 + } 495 + } 496 + if (!eint_np) 497 + return -ENODEV; 498 + 499 + eint_data = devm_kzalloc(dev, sizeof(*eint_data), GFP_KERNEL); 500 + if (!eint_data) 501 + return -ENOMEM; 502 + 503 + eint_data->drvdata = d; 504 + 505 + handlers = eint0_3_parent_only ? s3c2410_eint_handlers 506 + : s3c2412_eint_handlers; 507 + for (i = 0; i < NUM_EINT_IRQ; ++i) { 508 + unsigned int irq; 509 + 510 + irq = irq_of_parse_and_map(eint_np, i); 511 + if (!irq) { 512 + dev_err(dev, "failed to get wakeup EINT IRQ %d\n", i); 513 + return -ENXIO; 514 + } 515 + 516 + eint_data->parents[i] = irq; 517 + irq_set_chained_handler(irq, handlers[i]); 518 + irq_set_handler_data(irq, eint_data); 519 + } 520 + 521 + bank = d->ctrl->pin_banks; 522 + for (i = 0; i < d->ctrl->nr_banks; ++i, ++bank) { 523 + struct s3c24xx_eint_domain_data *ddata; 524 + unsigned int mask; 525 + unsigned int irq; 526 + unsigned int pin; 527 + 528 + if (bank->eint_type != EINT_TYPE_WKUP) 529 + continue; 530 + 531 + ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); 532 + if (!ddata) 533 + return -ENOMEM; 534 + 535 + ddata->bank = bank; 536 + ddata->eint_data = eint_data; 537 + ddata->eint0_3_parent_only = eint0_3_parent_only; 538 + 539 + ops = (bank->eint_offset == 0) ? &s3c24xx_gpf_irq_ops 540 + : &s3c24xx_gpg_irq_ops; 541 + 542 + bank->irq_domain = irq_domain_add_linear(bank->of_node, 543 + bank->nr_pins, ops, ddata); 544 + if (!bank->irq_domain) { 545 + dev_err(dev, "wkup irq domain add failed\n"); 546 + return -ENXIO; 547 + } 548 + 549 + irq = bank->eint_offset; 550 + mask = bank->eint_mask; 551 + for (pin = 0; mask; ++pin, mask >>= 1) { 552 + if (irq > NUM_EINT) 553 + break; 554 + if (!(mask & 1)) 555 + continue; 556 + eint_data->domains[irq] = bank->irq_domain; 557 + ++irq; 558 + } 559 + } 560 + 561 + return 0; 562 + } 563 + 564 + static struct samsung_pin_bank s3c2412_pin_banks[] = { 565 + PIN_BANK_A(23, 0x000, "gpa"), 566 + PIN_BANK_2BIT(11, 0x010, "gpb"), 567 + PIN_BANK_2BIT(16, 0x020, "gpc"), 568 + PIN_BANK_2BIT(16, 0x030, "gpd"), 569 + PIN_BANK_2BIT(16, 0x040, "gpe"), 570 + PIN_BANK_2BIT_EINTW(8, 0x050, "gpf", 0, 0xff), 571 + PIN_BANK_2BIT_EINTW(16, 0x060, "gpg", 8, 0xffff00), 572 + PIN_BANK_2BIT(11, 0x070, "gph"), 573 + PIN_BANK_2BIT(13, 0x080, "gpj"), 574 + }; 575 + 576 + struct samsung_pin_ctrl s3c2412_pin_ctrl[] = { 577 + { 578 + .pin_banks = s3c2412_pin_banks, 579 + .nr_banks = ARRAY_SIZE(s3c2412_pin_banks), 580 + .eint_wkup_init = s3c24xx_eint_init, 581 + .label = "S3C2412-GPIO", 582 + }, 583 + }; 584 + 585 + static struct samsung_pin_bank s3c2416_pin_banks[] = { 586 + PIN_BANK_A(27, 0x000, "gpa"), 587 + PIN_BANK_2BIT(11, 0x010, "gpb"), 588 + PIN_BANK_2BIT(16, 0x020, "gpc"), 589 + PIN_BANK_2BIT(16, 0x030, "gpd"), 590 + PIN_BANK_2BIT(16, 0x040, "gpe"), 591 + PIN_BANK_2BIT_EINTW(8, 0x050, "gpf", 0, 0xff), 592 + PIN_BANK_2BIT_EINTW(8, 0x060, "gpg", 8, 0xff00), 593 + PIN_BANK_2BIT(15, 0x070, "gph"), 594 + PIN_BANK_2BIT(16, 0x0e0, "gpk"), 595 + PIN_BANK_2BIT(14, 0x0f0, "gpl"), 596 + PIN_BANK_2BIT(2, 0x100, "gpm"), 597 + }; 598 + 599 + struct samsung_pin_ctrl s3c2416_pin_ctrl[] = { 600 + { 601 + .pin_banks = s3c2416_pin_banks, 602 + .nr_banks = ARRAY_SIZE(s3c2416_pin_banks), 603 + .eint_wkup_init = s3c24xx_eint_init, 604 + .label = "S3C2416-GPIO", 605 + }, 606 + }; 607 + 608 + static struct samsung_pin_bank s3c2440_pin_banks[] = { 609 + PIN_BANK_A(25, 0x000, "gpa"), 610 + PIN_BANK_2BIT(11, 0x010, "gpb"), 611 + PIN_BANK_2BIT(16, 0x020, "gpc"), 612 + PIN_BANK_2BIT(16, 0x030, "gpd"), 613 + PIN_BANK_2BIT(16, 0x040, "gpe"), 614 + PIN_BANK_2BIT_EINTW(8, 0x050, "gpf", 0, 0xff), 615 + PIN_BANK_2BIT_EINTW(16, 0x060, "gpg", 8, 0xffff00), 616 + PIN_BANK_2BIT(11, 0x070, "gph"), 617 + PIN_BANK_2BIT(13, 0x0d0, "gpj"), 618 + }; 619 + 620 + struct samsung_pin_ctrl s3c2440_pin_ctrl[] = { 621 + { 622 + .pin_banks = s3c2440_pin_banks, 623 + .nr_banks = ARRAY_SIZE(s3c2440_pin_banks), 624 + .eint_wkup_init = s3c24xx_eint_init, 625 + .label = "S3C2440-GPIO", 626 + }, 627 + }; 628 + 629 + static struct samsung_pin_bank s3c2450_pin_banks[] = { 630 + PIN_BANK_A(28, 0x000, "gpa"), 631 + PIN_BANK_2BIT(11, 0x010, "gpb"), 632 + PIN_BANK_2BIT(16, 0x020, "gpc"), 633 + PIN_BANK_2BIT(16, 0x030, "gpd"), 634 + PIN_BANK_2BIT(16, 0x040, "gpe"), 635 + PIN_BANK_2BIT_EINTW(8, 0x050, "gpf", 0, 0xff), 636 + PIN_BANK_2BIT_EINTW(16, 0x060, "gpg", 8, 0xffff00), 637 + PIN_BANK_2BIT(15, 0x070, "gph"), 638 + PIN_BANK_2BIT(16, 0x0d0, "gpj"), 639 + PIN_BANK_2BIT(16, 0x0e0, "gpk"), 640 + PIN_BANK_2BIT(15, 0x0f0, "gpl"), 641 + PIN_BANK_2BIT(2, 0x100, "gpm"), 642 + }; 643 + 644 + struct samsung_pin_ctrl s3c2450_pin_ctrl[] = { 645 + { 646 + .pin_banks = s3c2450_pin_banks, 647 + .nr_banks = ARRAY_SIZE(s3c2450_pin_banks), 648 + .eint_wkup_init = s3c24xx_eint_init, 649 + .label = "S3C2450-GPIO", 650 + }, 651 + };
+10
drivers/pinctrl/pinctrl-samsung.c
··· 1118 1118 { .compatible = "samsung,s3c64xx-pinctrl", 1119 1119 .data = s3c64xx_pin_ctrl }, 1120 1120 #endif 1121 + #ifdef CONFIG_PINCTRL_S3C24XX 1122 + { .compatible = "samsung,s3c2412-pinctrl", 1123 + .data = s3c2412_pin_ctrl }, 1124 + { .compatible = "samsung,s3c2416-pinctrl", 1125 + .data = s3c2416_pin_ctrl }, 1126 + { .compatible = "samsung,s3c2440-pinctrl", 1127 + .data = s3c2440_pin_ctrl }, 1128 + { .compatible = "samsung,s3c2450-pinctrl", 1129 + .data = s3c2450_pin_ctrl }, 1130 + #endif 1121 1131 {}, 1122 1132 }; 1123 1133 MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match);
+4
drivers/pinctrl/pinctrl-samsung.h
··· 255 255 extern struct samsung_pin_ctrl exynos4x12_pin_ctrl[]; 256 256 extern struct samsung_pin_ctrl exynos5250_pin_ctrl[]; 257 257 extern struct samsung_pin_ctrl s3c64xx_pin_ctrl[]; 258 + extern struct samsung_pin_ctrl s3c2412_pin_ctrl[]; 259 + extern struct samsung_pin_ctrl s3c2416_pin_ctrl[]; 260 + extern struct samsung_pin_ctrl s3c2440_pin_ctrl[]; 261 + extern struct samsung_pin_ctrl s3c2450_pin_ctrl[]; 258 262 259 263 #endif /* __PINCTRL_SAMSUNG_H */
+198
drivers/pinctrl/sh-pfc/pfc-r8a73a4.c
··· 1488 1488 IRQC_PINS_MUX(327, 55); 1489 1489 IRQC_PINS_MUX(328, 56); 1490 1490 IRQC_PINS_MUX(329, 57); 1491 + /* - MMCIF0 ----------------------------------------------------------------- */ 1492 + static const unsigned int mmc0_data1_pins[] = { 1493 + /* D[0] */ 1494 + 164, 1495 + }; 1496 + static const unsigned int mmc0_data1_mux[] = { 1497 + MMCD0_0_MARK, 1498 + }; 1499 + static const unsigned int mmc0_data4_pins[] = { 1500 + /* D[0:3] */ 1501 + 164, 165, 166, 167, 1502 + }; 1503 + static const unsigned int mmc0_data4_mux[] = { 1504 + MMCD0_0_MARK, MMCD0_1_MARK, MMCD0_2_MARK, MMCD0_3_MARK, 1505 + }; 1506 + static const unsigned int mmc0_data8_pins[] = { 1507 + /* D[0:7] */ 1508 + 164, 165, 166, 167, 168, 169, 170, 171, 1509 + }; 1510 + static const unsigned int mmc0_data8_mux[] = { 1511 + MMCD0_0_MARK, MMCD0_1_MARK, MMCD0_2_MARK, MMCD0_3_MARK, 1512 + MMCD0_4_MARK, MMCD0_5_MARK, MMCD0_6_MARK, MMCD0_7_MARK, 1513 + }; 1514 + static const unsigned int mmc0_ctrl_pins[] = { 1515 + /* CMD, CLK */ 1516 + 172, 173, 1517 + }; 1518 + static const unsigned int mmc0_ctrl_mux[] = { 1519 + MMCCMD0_MARK, MMCCLK0_MARK, 1520 + }; 1521 + /* - MMCIF1 ----------------------------------------------------------------- */ 1522 + static const unsigned int mmc1_data1_pins[] = { 1523 + /* D[0] */ 1524 + 199, 1525 + }; 1526 + static const unsigned int mmc1_data1_mux[] = { 1527 + MMCD1_0_MARK, 1528 + }; 1529 + static const unsigned int mmc1_data4_pins[] = { 1530 + /* D[0:3] */ 1531 + 199, 198, 197, 196, 1532 + }; 1533 + static const unsigned int mmc1_data4_mux[] = { 1534 + MMCD1_0_MARK, MMCD1_1_MARK, MMCD1_2_MARK, MMCD1_3_MARK, 1535 + }; 1536 + static const unsigned int mmc1_data8_pins[] = { 1537 + /* D[0:7] */ 1538 + 199, 198, 197, 196, 195, 194, 193, 192, 1539 + }; 1540 + static const unsigned int mmc1_data8_mux[] = { 1541 + MMCD1_0_MARK, MMCD1_1_MARK, MMCD1_2_MARK, MMCD1_3_MARK, 1542 + MMCD1_4_MARK, MMCD1_5_MARK, MMCD1_6_MARK, MMCD1_7_MARK, 1543 + }; 1544 + static const unsigned int mmc1_ctrl_pins[] = { 1545 + /* CMD, CLK */ 1546 + 200, 203, 1547 + }; 1548 + static const unsigned int mmc1_ctrl_mux[] = { 1549 + MMCCMD1_MARK, MMCCLK1_MARK, 1550 + }; 1491 1551 /* - SCIFA0 ----------------------------------------------------------------- */ 1492 1552 static const unsigned int scifa0_data_pins[] = { 1493 1553 /* SCIFA0_RXD, SCIFA0_TXD */ ··· 1743 1683 static const unsigned int scifb3_ctrl_b_mux[] = { 1744 1684 SCIFB3_RTS_38_MARK, SCIFB3_CTS_39_MARK, 1745 1685 }; 1686 + /* - SDHI0 ------------------------------------------------------------------ */ 1687 + static const unsigned int sdhi0_data1_pins[] = { 1688 + /* D0 */ 1689 + 302, 1690 + }; 1691 + static const unsigned int sdhi0_data1_mux[] = { 1692 + SDHID0_0_MARK, 1693 + }; 1694 + static const unsigned int sdhi0_data4_pins[] = { 1695 + /* D[0:3] */ 1696 + 302, 303, 304, 305, 1697 + }; 1698 + static const unsigned int sdhi0_data4_mux[] = { 1699 + SDHID0_0_MARK, SDHID0_1_MARK, SDHID0_2_MARK, SDHID0_3_MARK, 1700 + }; 1701 + static const unsigned int sdhi0_ctrl_pins[] = { 1702 + /* CLK, CMD */ 1703 + 308, 306, 1704 + }; 1705 + static const unsigned int sdhi0_ctrl_mux[] = { 1706 + SDHICLK0_MARK, SDHICMD0_MARK, 1707 + }; 1708 + static const unsigned int sdhi0_cd_pins[] = { 1709 + /* CD */ 1710 + 301, 1711 + }; 1712 + static const unsigned int sdhi0_cd_mux[] = { 1713 + SDHICD0_MARK, 1714 + }; 1715 + static const unsigned int sdhi0_wp_pins[] = { 1716 + /* WP */ 1717 + 307, 1718 + }; 1719 + static const unsigned int sdhi0_wp_mux[] = { 1720 + SDHIWP0_MARK, 1721 + }; 1722 + /* - SDHI1 ------------------------------------------------------------------ */ 1723 + static const unsigned int sdhi1_data1_pins[] = { 1724 + /* D0 */ 1725 + 289, 1726 + }; 1727 + static const unsigned int sdhi1_data1_mux[] = { 1728 + SDHID1_0_MARK, 1729 + }; 1730 + static const unsigned int sdhi1_data4_pins[] = { 1731 + /* D[0:3] */ 1732 + 289, 290, 291, 292, 1733 + }; 1734 + static const unsigned int sdhi1_data4_mux[] = { 1735 + SDHID1_0_MARK, SDHID1_1_MARK, SDHID1_2_MARK, SDHID1_3_MARK, 1736 + }; 1737 + static const unsigned int sdhi1_ctrl_pins[] = { 1738 + /* CLK, CMD */ 1739 + 293, 294, 1740 + }; 1741 + static const unsigned int sdhi1_ctrl_mux[] = { 1742 + SDHICLK1_MARK, SDHICMD1_MARK, 1743 + }; 1744 + /* - SDHI2 ------------------------------------------------------------------ */ 1745 + static const unsigned int sdhi2_data1_pins[] = { 1746 + /* D0 */ 1747 + 295, 1748 + }; 1749 + static const unsigned int sdhi2_data1_mux[] = { 1750 + SDHID2_0_MARK, 1751 + }; 1752 + static const unsigned int sdhi2_data4_pins[] = { 1753 + /* D[0:3] */ 1754 + 295, 296, 297, 298, 1755 + }; 1756 + static const unsigned int sdhi2_data4_mux[] = { 1757 + SDHID2_0_MARK, SDHID2_1_MARK, SDHID2_2_MARK, SDHID2_3_MARK, 1758 + }; 1759 + static const unsigned int sdhi2_ctrl_pins[] = { 1760 + /* CLK, CMD */ 1761 + 299, 300, 1762 + }; 1763 + static const unsigned int sdhi2_ctrl_mux[] = { 1764 + SDHICLK2_MARK, SDHICMD2_MARK, 1765 + }; 1746 1766 1747 1767 static const struct sh_pfc_pin_group pinmux_groups[] = { 1748 1768 SH_PFC_PIN_GROUP(irqc_irq0), ··· 1883 1743 SH_PFC_PIN_GROUP(irqc_irq55), 1884 1744 SH_PFC_PIN_GROUP(irqc_irq56), 1885 1745 SH_PFC_PIN_GROUP(irqc_irq57), 1746 + SH_PFC_PIN_GROUP(mmc0_data1), 1747 + SH_PFC_PIN_GROUP(mmc0_data4), 1748 + SH_PFC_PIN_GROUP(mmc0_data8), 1749 + SH_PFC_PIN_GROUP(mmc0_ctrl), 1750 + SH_PFC_PIN_GROUP(mmc1_data1), 1751 + SH_PFC_PIN_GROUP(mmc1_data4), 1752 + SH_PFC_PIN_GROUP(mmc1_data8), 1753 + SH_PFC_PIN_GROUP(mmc1_ctrl), 1886 1754 SH_PFC_PIN_GROUP(scifa0_data), 1887 1755 SH_PFC_PIN_GROUP(scifa0_clk), 1888 1756 SH_PFC_PIN_GROUP(scifa0_ctrl), ··· 1918 1770 SH_PFC_PIN_GROUP(scifb3_data_b), 1919 1771 SH_PFC_PIN_GROUP(scifb3_clk_b), 1920 1772 SH_PFC_PIN_GROUP(scifb3_ctrl_b), 1773 + SH_PFC_PIN_GROUP(sdhi0_data1), 1774 + SH_PFC_PIN_GROUP(sdhi0_data4), 1775 + SH_PFC_PIN_GROUP(sdhi0_ctrl), 1776 + SH_PFC_PIN_GROUP(sdhi0_cd), 1777 + SH_PFC_PIN_GROUP(sdhi0_wp), 1778 + SH_PFC_PIN_GROUP(sdhi1_data1), 1779 + SH_PFC_PIN_GROUP(sdhi1_data4), 1780 + SH_PFC_PIN_GROUP(sdhi1_ctrl), 1781 + SH_PFC_PIN_GROUP(sdhi2_data1), 1782 + SH_PFC_PIN_GROUP(sdhi2_data4), 1783 + SH_PFC_PIN_GROUP(sdhi2_ctrl), 1921 1784 }; 1922 1785 1923 1786 static const char * const irqc_groups[] = { ··· 1992 1833 "irqc_irq57", 1993 1834 }; 1994 1835 1836 + static const char * const mmc0_groups[] = { 1837 + "mmc0_data1", 1838 + "mmc0_data4", 1839 + "mmc0_data8", 1840 + "mmc0_ctrl", 1841 + }; 1842 + 1843 + static const char * const mmc1_groups[] = { 1844 + "mmc1_data1", 1845 + "mmc1_data4", 1846 + "mmc1_data8", 1847 + "mmc1_ctrl", 1848 + }; 1849 + 1995 1850 static const char * const scifa0_groups[] = { 1996 1851 "scifa0_data", 1997 1852 "scifa0_clk", ··· 2051 1878 "scifb3_ctrl_b", 2052 1879 }; 2053 1880 1881 + static const char * const sdhi0_groups[] = { 1882 + "sdhi0_data1", 1883 + "sdhi0_data4", 1884 + "sdhi0_ctrl", 1885 + "sdhi0_cd", 1886 + "sdhi0_wp", 1887 + }; 1888 + 1889 + static const char * const sdhi1_groups[] = { 1890 + "sdhi1_data1", 1891 + "sdhi1_data4", 1892 + "sdhi1_ctrl", 1893 + }; 1894 + 1895 + static const char * const sdhi2_groups[] = { 1896 + "sdhi2_data1", 1897 + "sdhi2_data4", 1898 + "sdhi2_ctrl", 1899 + }; 1900 + 2054 1901 static const struct sh_pfc_function pinmux_functions[] = { 2055 1902 SH_PFC_FUNCTION(irqc), 1903 + SH_PFC_FUNCTION(mmc0), 1904 + SH_PFC_FUNCTION(mmc1), 2056 1905 SH_PFC_FUNCTION(scifa0), 2057 1906 SH_PFC_FUNCTION(scifa1), 2058 1907 SH_PFC_FUNCTION(scifb0), 2059 1908 SH_PFC_FUNCTION(scifb1), 2060 1909 SH_PFC_FUNCTION(scifb2), 2061 1910 SH_PFC_FUNCTION(scifb3), 1911 + SH_PFC_FUNCTION(sdhi0), 1912 + SH_PFC_FUNCTION(sdhi1), 1913 + SH_PFC_FUNCTION(sdhi2), 2062 1914 }; 2063 1915 2064 1916 #undef PORTCR
+2 -2
drivers/pinctrl/sh-pfc/pfc-r8a7778.c
··· 1447 1447 MMC_PFC_CTRL(mmc_ctrl, MMC_CLK, MMC_CMD); 1448 1448 MMC_PFC_PINS(mmc_data1, RCAR_GP_PIN(1, 7)); 1449 1449 MMC_PFC_DAT1(mmc_data1, MMC_D0); 1450 - MMC_PFC_PINS(mmc_data4, RCAR_GP_PIN(1, 7), RCAR_GP_PIN(2, 8), 1450 + MMC_PFC_PINS(mmc_data4, RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 8), 1451 1451 RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 6)); 1452 1452 MMC_PFC_DAT4(mmc_data4, MMC_D0, MMC_D1, 1453 1453 MMC_D2, MMC_D3); 1454 - MMC_PFC_PINS(mmc_data8, RCAR_GP_PIN(1, 7), RCAR_GP_PIN(2, 8), 1454 + MMC_PFC_PINS(mmc_data8, RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 8), 1455 1455 RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 6), 1456 1456 RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 0), 1457 1457 RCAR_GP_PIN(0, 30), RCAR_GP_PIN(0, 31));
+203 -24
drivers/pinctrl/sh-pfc/pfc-r8a7790.c
··· 1979 1979 static const unsigned int scif1_clk_e_mux[] = { 1980 1980 SCK1_E_MARK, 1981 1981 }; 1982 + /* - HSCIF0 ----------------------------------------------------------------- */ 1983 + static const unsigned int hscif0_data_pins[] = { 1984 + /* RX, TX */ 1985 + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 9), 1986 + }; 1987 + static const unsigned int hscif0_data_mux[] = { 1988 + HRX0_MARK, HTX0_MARK, 1989 + }; 1990 + static const unsigned int hscif0_clk_pins[] = { 1991 + /* SCK */ 1992 + RCAR_GP_PIN(5, 7), 1993 + }; 1994 + static const unsigned int hscif0_clk_mux[] = { 1995 + HSCK0_MARK, 1996 + }; 1997 + static const unsigned int hscif0_ctrl_pins[] = { 1998 + /* RTS, CTS */ 1999 + RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10), 2000 + }; 2001 + static const unsigned int hscif0_ctrl_mux[] = { 2002 + HRTS0_N_MARK, HCTS0_N_MARK, 2003 + }; 2004 + static const unsigned int hscif0_data_b_pins[] = { 2005 + /* RX, TX */ 2006 + RCAR_GP_PIN(1, 23), RCAR_GP_PIN(1, 12), 2007 + }; 2008 + static const unsigned int hscif0_data_b_mux[] = { 2009 + HRX0_B_MARK, HTX0_B_MARK, 2010 + }; 2011 + static const unsigned int hscif0_ctrl_b_pins[] = { 2012 + /* RTS, CTS */ 2013 + RCAR_GP_PIN(1, 29), RCAR_GP_PIN(1, 28), 2014 + }; 2015 + static const unsigned int hscif0_ctrl_b_mux[] = { 2016 + HRTS0_N_B_MARK, HCTS0_N_B_MARK, 2017 + }; 2018 + static const unsigned int hscif0_data_c_pins[] = { 2019 + /* RX, TX */ 2020 + RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 16), 2021 + }; 2022 + static const unsigned int hscif0_data_c_mux[] = { 2023 + HRX0_C_MARK, HTX0_C_MARK, 2024 + }; 2025 + static const unsigned int hscif0_ctrl_c_pins[] = { 2026 + /* RTS, CTS */ 2027 + RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 7), 2028 + }; 2029 + static const unsigned int hscif0_ctrl_c_mux[] = { 2030 + HRTS0_N_C_MARK, HCTS0_N_C_MARK, 2031 + }; 2032 + static const unsigned int hscif0_data_d_pins[] = { 2033 + /* RX, TX */ 2034 + RCAR_GP_PIN(3, 20), RCAR_GP_PIN(3, 21), 2035 + }; 2036 + static const unsigned int hscif0_data_d_mux[] = { 2037 + HRX0_D_MARK, HTX0_D_MARK, 2038 + }; 2039 + static const unsigned int hscif0_ctrl_d_pins[] = { 2040 + /* RTS, CTS */ 2041 + RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 22), 2042 + }; 2043 + static const unsigned int hscif0_ctrl_d_mux[] = { 2044 + HRTS0_N_D_MARK, HCTS0_N_D_MARK, 2045 + }; 2046 + static const unsigned int hscif0_data_e_pins[] = { 2047 + /* RX, TX */ 2048 + RCAR_GP_PIN(2, 21), RCAR_GP_PIN(2, 22), 2049 + }; 2050 + static const unsigned int hscif0_data_e_mux[] = { 2051 + HRX0_E_MARK, HTX0_E_MARK, 2052 + }; 2053 + static const unsigned int hscif0_ctrl_e_pins[] = { 2054 + /* RTS, CTS */ 2055 + RCAR_GP_PIN(2, 24), RCAR_GP_PIN(2, 23), 2056 + }; 2057 + static const unsigned int hscif0_ctrl_e_mux[] = { 2058 + HRTS0_N_E_MARK, HCTS0_N_E_MARK, 2059 + }; 2060 + static const unsigned int hscif0_data_f_pins[] = { 2061 + /* RX, TX */ 2062 + RCAR_GP_PIN(2, 23), RCAR_GP_PIN(2, 25), 2063 + }; 2064 + static const unsigned int hscif0_data_f_mux[] = { 2065 + HRX0_F_MARK, HTX0_F_MARK, 2066 + }; 2067 + static const unsigned int hscif0_ctrl_f_pins[] = { 2068 + /* RTS, CTS */ 2069 + RCAR_GP_PIN(2, 26), RCAR_GP_PIN(2, 24), 2070 + }; 2071 + static const unsigned int hscif0_ctrl_f_mux[] = { 2072 + HRTS0_N_F_MARK, HCTS0_N_F_MARK, 2073 + }; 2074 + /* - HSCIF1 ----------------------------------------------------------------- */ 2075 + static const unsigned int hscif1_data_pins[] = { 2076 + /* RX, TX */ 2077 + RCAR_GP_PIN(4, 28), RCAR_GP_PIN(4, 29), 2078 + }; 2079 + static const unsigned int hscif1_data_mux[] = { 2080 + HRX1_MARK, HTX1_MARK, 2081 + }; 2082 + static const unsigned int hscif1_clk_pins[] = { 2083 + /* SCK */ 2084 + RCAR_GP_PIN(4, 27), 2085 + }; 2086 + static const unsigned int hscif1_clk_mux[] = { 2087 + HSCK1_MARK, 2088 + }; 2089 + static const unsigned int hscif1_ctrl_pins[] = { 2090 + /* RTS, CTS */ 2091 + RCAR_GP_PIN(4, 31), RCAR_GP_PIN(4, 30), 2092 + }; 2093 + static const unsigned int hscif1_ctrl_mux[] = { 2094 + HRTS1_N_MARK, HCTS1_N_MARK, 2095 + }; 2096 + static const unsigned int hscif1_data_b_pins[] = { 2097 + /* RX, TX */ 2098 + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 18), 2099 + }; 2100 + static const unsigned int hscif1_data_b_mux[] = { 2101 + HRX1_B_MARK, HTX1_B_MARK, 2102 + }; 2103 + static const unsigned int hscif1_clk_b_pins[] = { 2104 + /* SCK */ 2105 + RCAR_GP_PIN(1, 28), 2106 + }; 2107 + static const unsigned int hscif1_clk_b_mux[] = { 2108 + HSCK1_B_MARK, 2109 + }; 2110 + static const unsigned int hscif1_ctrl_b_pins[] = { 2111 + /* RTS, CTS */ 2112 + RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13), 2113 + }; 2114 + static const unsigned int hscif1_ctrl_b_mux[] = { 2115 + HRTS1_N_B_MARK, HCTS1_N_B_MARK, 2116 + }; 1982 2117 /* - SCIFA0 ----------------------------------------------------------------- */ 1983 2118 static const unsigned int scifa0_data_pins[] = { 1984 2119 /* RXD, TXD */ ··· 2506 2371 static const unsigned int tpu0_to3_mux[] = { 2507 2372 TPU0TO3_MARK, 2508 2373 }; 2509 - 2510 - /* - MMCIF ------------------------------------------------------------------ */ 2374 + /* - MMCIF0 ----------------------------------------------------------------- */ 2511 2375 static const unsigned int mmc0_data1_pins[] = { 2512 2376 /* D[0] */ 2513 2377 RCAR_GP_PIN(3, 18), ··· 2540 2406 static const unsigned int mmc0_ctrl_mux[] = { 2541 2407 MMC0_CLK_MARK, MMC0_CMD_MARK, 2542 2408 }; 2543 - 2409 + /* - MMCIF1 ----------------------------------------------------------------- */ 2544 2410 static const unsigned int mmc1_data1_pins[] = { 2545 2411 /* D[0] */ 2546 2412 RCAR_GP_PIN(3, 26), ··· 2561 2427 RCAR_GP_PIN(3, 26), RCAR_GP_PIN(3, 27), 2562 2428 RCAR_GP_PIN(3, 28), RCAR_GP_PIN(3, 29), 2563 2429 RCAR_GP_PIN(3, 30), RCAR_GP_PIN(3, 31), 2564 - RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14), 2430 + RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15), 2565 2431 }; 2566 2432 static const unsigned int mmc1_data8_mux[] = { 2567 2433 MMC1_D0_MARK, MMC1_D1_MARK, MMC1_D2_MARK, MMC1_D3_MARK, ··· 2574 2440 static const unsigned int mmc1_ctrl_mux[] = { 2575 2441 MMC1_CLK_MARK, MMC1_CMD_MARK, 2576 2442 }; 2577 - 2578 - /* - SDHI ------------------------------------------------------------------- */ 2443 + /* - SDHI0 ------------------------------------------------------------------ */ 2579 2444 static const unsigned int sdhi0_data1_pins[] = { 2580 2445 /* D0 */ 2581 2446 RCAR_GP_PIN(3, 2), ··· 2610 2477 static const unsigned int sdhi0_wp_mux[] = { 2611 2478 SD0_WP_MARK, 2612 2479 }; 2613 - 2480 + /* - SDHI1 ------------------------------------------------------------------ */ 2614 2481 static const unsigned int sdhi1_data1_pins[] = { 2615 2482 /* D0 */ 2616 2483 RCAR_GP_PIN(3, 10), ··· 2646 2513 static const unsigned int sdhi1_wp_mux[] = { 2647 2514 SD1_WP_MARK, 2648 2515 }; 2649 - 2516 + /* - SDHI2 ------------------------------------------------------------------ */ 2650 2517 static const unsigned int sdhi2_data1_pins[] = { 2651 2518 /* D0 */ 2652 2519 RCAR_GP_PIN(3, 18), ··· 2682 2549 static const unsigned int sdhi2_wp_mux[] = { 2683 2550 SD2_WP_MARK, 2684 2551 }; 2685 - 2552 + /* - SDHI3 ------------------------------------------------------------------ */ 2686 2553 static const unsigned int sdhi3_data1_pins[] = { 2687 2554 /* D0 */ 2688 2555 RCAR_GP_PIN(3, 26), ··· 2724 2591 SH_PFC_PIN_GROUP(eth_magic), 2725 2592 SH_PFC_PIN_GROUP(eth_mdio), 2726 2593 SH_PFC_PIN_GROUP(eth_rmii), 2594 + SH_PFC_PIN_GROUP(hscif0_data), 2595 + SH_PFC_PIN_GROUP(hscif0_clk), 2596 + SH_PFC_PIN_GROUP(hscif0_ctrl), 2597 + SH_PFC_PIN_GROUP(hscif0_data_b), 2598 + SH_PFC_PIN_GROUP(hscif0_ctrl_b), 2599 + SH_PFC_PIN_GROUP(hscif0_data_c), 2600 + SH_PFC_PIN_GROUP(hscif0_ctrl_c), 2601 + SH_PFC_PIN_GROUP(hscif0_data_d), 2602 + SH_PFC_PIN_GROUP(hscif0_ctrl_d), 2603 + SH_PFC_PIN_GROUP(hscif0_data_e), 2604 + SH_PFC_PIN_GROUP(hscif0_ctrl_e), 2605 + SH_PFC_PIN_GROUP(hscif0_data_f), 2606 + SH_PFC_PIN_GROUP(hscif0_ctrl_f), 2607 + SH_PFC_PIN_GROUP(hscif1_data), 2608 + SH_PFC_PIN_GROUP(hscif1_clk), 2609 + SH_PFC_PIN_GROUP(hscif1_ctrl), 2610 + SH_PFC_PIN_GROUP(hscif1_data_b), 2611 + SH_PFC_PIN_GROUP(hscif1_clk_b), 2612 + SH_PFC_PIN_GROUP(hscif1_ctrl_b), 2727 2613 SH_PFC_PIN_GROUP(intc_irq0), 2728 2614 SH_PFC_PIN_GROUP(intc_irq1), 2729 2615 SH_PFC_PIN_GROUP(intc_irq2), 2730 2616 SH_PFC_PIN_GROUP(intc_irq3), 2617 + SH_PFC_PIN_GROUP(mmc0_data1), 2618 + SH_PFC_PIN_GROUP(mmc0_data4), 2619 + SH_PFC_PIN_GROUP(mmc0_data8), 2620 + SH_PFC_PIN_GROUP(mmc0_ctrl), 2621 + SH_PFC_PIN_GROUP(mmc1_data1), 2622 + SH_PFC_PIN_GROUP(mmc1_data4), 2623 + SH_PFC_PIN_GROUP(mmc1_data8), 2624 + SH_PFC_PIN_GROUP(mmc1_ctrl), 2731 2625 SH_PFC_PIN_GROUP(scif0_data), 2732 2626 SH_PFC_PIN_GROUP(scif0_clk), 2733 2627 SH_PFC_PIN_GROUP(scif0_ctrl), ··· 2819 2659 SH_PFC_PIN_GROUP(scifb2_clk_b), 2820 2660 SH_PFC_PIN_GROUP(scifb2_ctrl_b), 2821 2661 SH_PFC_PIN_GROUP(scifb2_data_c), 2822 - SH_PFC_PIN_GROUP(tpu0_to0), 2823 - SH_PFC_PIN_GROUP(tpu0_to1), 2824 - SH_PFC_PIN_GROUP(tpu0_to2), 2825 - SH_PFC_PIN_GROUP(tpu0_to3), 2826 - SH_PFC_PIN_GROUP(mmc0_data1), 2827 - SH_PFC_PIN_GROUP(mmc0_data4), 2828 - SH_PFC_PIN_GROUP(mmc0_data8), 2829 - SH_PFC_PIN_GROUP(mmc0_ctrl), 2830 - SH_PFC_PIN_GROUP(mmc1_data1), 2831 - SH_PFC_PIN_GROUP(mmc1_data4), 2832 - SH_PFC_PIN_GROUP(mmc1_data8), 2833 - SH_PFC_PIN_GROUP(mmc1_ctrl), 2834 2662 SH_PFC_PIN_GROUP(sdhi0_data1), 2835 2663 SH_PFC_PIN_GROUP(sdhi0_data4), 2836 2664 SH_PFC_PIN_GROUP(sdhi0_ctrl), ··· 2839 2691 SH_PFC_PIN_GROUP(sdhi3_ctrl), 2840 2692 SH_PFC_PIN_GROUP(sdhi3_cd), 2841 2693 SH_PFC_PIN_GROUP(sdhi3_wp), 2694 + SH_PFC_PIN_GROUP(tpu0_to0), 2695 + SH_PFC_PIN_GROUP(tpu0_to1), 2696 + SH_PFC_PIN_GROUP(tpu0_to2), 2697 + SH_PFC_PIN_GROUP(tpu0_to3), 2842 2698 }; 2843 2699 2844 2700 static const char * const eth_groups[] = { ··· 2876 2724 "scif1_clk_d", 2877 2725 "scif1_data_e", 2878 2726 "scif1_clk_e", 2727 + }; 2728 + 2729 + static const char * const hscif0_groups[] = { 2730 + "hscif0_data", 2731 + "hscif0_clk", 2732 + "hscif0_ctrl", 2733 + "hscif0_data_b", 2734 + "hscif0_ctrl_b", 2735 + "hscif0_data_c", 2736 + "hscif0_ctrl_c", 2737 + "hscif0_data_d", 2738 + "hscif0_ctrl_d", 2739 + "hscif0_data_e", 2740 + "hscif0_ctrl_e", 2741 + "hscif0_data_f", 2742 + "hscif0_ctrl_f", 2743 + }; 2744 + 2745 + static const char * const hscif1_groups[] = { 2746 + "hscif1_data", 2747 + "hscif1_clk", 2748 + "hscif1_ctrl", 2749 + "hscif1_data_b", 2750 + "hscif1_clk_b", 2751 + "hscif1_ctrl_b", 2879 2752 }; 2880 2753 2881 2754 static const char * const scifa0_groups[] = { ··· 3027 2850 3028 2851 static const struct sh_pfc_function pinmux_functions[] = { 3029 2852 SH_PFC_FUNCTION(eth), 2853 + SH_PFC_FUNCTION(hscif0), 2854 + SH_PFC_FUNCTION(hscif1), 3030 2855 SH_PFC_FUNCTION(intc), 2856 + SH_PFC_FUNCTION(mmc0), 2857 + SH_PFC_FUNCTION(mmc1), 3031 2858 SH_PFC_FUNCTION(scif0), 3032 2859 SH_PFC_FUNCTION(scif1), 3033 2860 SH_PFC_FUNCTION(scifa0), ··· 3040 2859 SH_PFC_FUNCTION(scifb0), 3041 2860 SH_PFC_FUNCTION(scifb1), 3042 2861 SH_PFC_FUNCTION(scifb2), 3043 - SH_PFC_FUNCTION(tpu0), 3044 - SH_PFC_FUNCTION(mmc0), 3045 - SH_PFC_FUNCTION(mmc1), 3046 2862 SH_PFC_FUNCTION(sdhi0), 3047 2863 SH_PFC_FUNCTION(sdhi1), 3048 2864 SH_PFC_FUNCTION(sdhi2), 3049 2865 SH_PFC_FUNCTION(sdhi3), 2866 + SH_PFC_FUNCTION(tpu0), 3050 2867 }; 3051 2868 3052 2869 static struct pinmux_cfg_reg pinmux_config_regs[] = {
+2 -1
drivers/remoteproc/Kconfig
··· 14 14 depends on HAS_DMA 15 15 depends on ARCH_OMAP4 || SOC_OMAP5 16 16 depends on OMAP_IOMMU 17 - depends on OMAP_MBOX_FWK 18 17 select REMOTEPROC 18 + select MAILBOX 19 + select OMAP2PLUS_MBOX 19 20 select RPMSG 20 21 help 21 22 Say y here to support OMAP's remote processors (dual M3
+1 -1
drivers/remoteproc/omap_remoteproc.c
··· 27 27 #include <linux/platform_device.h> 28 28 #include <linux/dma-mapping.h> 29 29 #include <linux/remoteproc.h> 30 + #include <linux/omap-mailbox.h> 30 31 31 - #include <plat/mailbox.h> 32 32 #include <linux/platform_data/remoteproc-omap.h> 33 33 34 34 #include "omap_remoteproc.h"
+2 -1
drivers/staging/tidspbridge/Kconfig
··· 5 5 menuconfig TIDSPBRIDGE 6 6 tristate "DSP Bridge driver" 7 7 depends on ARCH_OMAP3 && !ARCH_MULTIPLATFORM 8 - select OMAP_MBOX_FWK 8 + select MAILBOX 9 + select OMAP2PLUS_MBOX 9 10 help 10 11 DSP/BIOS Bridge is designed for platforms that contain a GPP and 11 12 one or more attached DSPs. The GPP is considered the master or
+1 -1
drivers/staging/tidspbridge/include/dspbridge/host_os.h
··· 41 41 #include <linux/ioport.h> 42 42 #include <linux/platform_device.h> 43 43 #include <linux/clk.h> 44 - #include <plat/mailbox.h> 44 + #include <linux/omap-mailbox.h> 45 45 #include <linux/pagemap.h> 46 46 #include <asm/cacheflush.h> 47 47 #include <linux/dma-mapping.h>
+1 -1
drivers/usb/gadget/Kconfig
··· 155 155 156 156 config USB_ATMEL_USBA 157 157 tristate "Atmel USBA" 158 - depends on AVR32 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 158 + depends on AVR32 || ARCH_AT91 159 159 help 160 160 USBA is the integrated high-speed USB Device controller on 161 161 the AT32AP700x, some AT91SAM9 and AT91CAP9 processors from Atmel.
+184 -80
drivers/usb/gadget/atmel_usba_udc.c
··· 22 22 #include <linux/usb/atmel_usba_udc.h> 23 23 #include <linux/delay.h> 24 24 #include <linux/platform_data/atmel.h> 25 + #include <linux/of.h> 26 + #include <linux/of_gpio.h> 25 27 26 28 #include <asm/gpio.h> 27 29 28 30 #include "atmel_usba_udc.h" 29 - 30 - 31 - static struct usba_udc the_udc; 32 - static struct usba_ep *usba_ep; 33 31 34 32 #ifdef CONFIG_USB_GADGET_DEBUG_FS 35 33 #include <linux/debugfs.h> ··· 1012 1014 1013 1015 } 1014 1016 1015 - static struct usba_udc the_udc = { 1016 - .gadget = { 1017 - .ops = &usba_udc_ops, 1018 - .ep_list = LIST_HEAD_INIT(the_udc.gadget.ep_list), 1019 - .max_speed = USB_SPEED_HIGH, 1020 - .name = "atmel_usba_udc", 1021 - .dev = { 1022 - .init_name = "gadget", 1023 - .release = nop_release, 1024 - }, 1017 + struct usb_gadget usba_gadget_template = { 1018 + .ops = &usba_udc_ops, 1019 + .max_speed = USB_SPEED_HIGH, 1020 + .name = "atmel_usba_udc", 1021 + .dev = { 1022 + .init_name = "gadget", 1023 + .release = nop_release, 1025 1024 }, 1026 1025 }; 1027 1026 ··· 1142 1147 * Test_SE0_NAK: Force high-speed mode and set up ep0 1143 1148 * for Bulk IN transfers 1144 1149 */ 1145 - ep = &usba_ep[0]; 1150 + ep = &udc->usba_ep[0]; 1146 1151 usba_writel(udc, TST, 1147 1152 USBA_BF(SPEED_CFG, USBA_SPEED_CFG_FORCE_HIGH)); 1148 1153 usba_ep_writel(ep, CFG, ··· 1160 1165 break; 1161 1166 case 0x0400: 1162 1167 /* Test_Packet */ 1163 - ep = &usba_ep[0]; 1168 + ep = &udc->usba_ep[0]; 1164 1169 usba_ep_writel(ep, CFG, 1165 1170 USBA_BF(EPT_SIZE, USBA_EPT_SIZE_64) 1166 1171 | USBA_EPT_DIR_IN ··· 1663 1668 1664 1669 for (i = 1; i < USBA_NR_ENDPOINTS; i++) 1665 1670 if (dma_status & (1 << i)) 1666 - usba_dma_irq(udc, &usba_ep[i]); 1671 + usba_dma_irq(udc, &udc->usba_ep[i]); 1667 1672 } 1668 1673 1669 1674 ep_status = USBA_BFEXT(EPT_INT, status); ··· 1672 1677 1673 1678 for (i = 0; i < USBA_NR_ENDPOINTS; i++) 1674 1679 if (ep_status & (1 << i)) { 1675 - if (ep_is_control(&usba_ep[i])) 1676 - usba_control_irq(udc, &usba_ep[i]); 1680 + if (ep_is_control(&udc->usba_ep[i])) 1681 + usba_control_irq(udc, &udc->usba_ep[i]); 1677 1682 else 1678 - usba_ep_irq(udc, &usba_ep[i]); 1683 + usba_ep_irq(udc, &udc->usba_ep[i]); 1679 1684 } 1680 1685 } 1681 1686 ··· 1700 1705 DBG(DBG_BUS, "%s bus reset detected\n", 1701 1706 usb_speed_string(udc->gadget.speed)); 1702 1707 1703 - ep0 = &usba_ep[0]; 1708 + ep0 = &udc->usba_ep[0]; 1704 1709 ep0->ep.desc = &usba_ep0_desc; 1705 1710 ep0->state = WAIT_FOR_SETUP; 1706 1711 usba_ep_writel(ep0, CFG, ··· 1830 1835 return 0; 1831 1836 } 1832 1837 1833 - static int __init usba_udc_probe(struct platform_device *pdev) 1838 + #ifdef CONFIG_OF 1839 + static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, 1840 + struct usba_udc *udc) 1841 + { 1842 + u32 val; 1843 + const char *name; 1844 + enum of_gpio_flags flags; 1845 + struct device_node *np = pdev->dev.of_node; 1846 + struct device_node *pp; 1847 + int i, ret; 1848 + struct usba_ep *eps, *ep; 1849 + 1850 + udc->num_ep = 0; 1851 + 1852 + udc->vbus_pin = of_get_named_gpio_flags(np, "atmel,vbus-gpio", 0, 1853 + &flags); 1854 + udc->vbus_pin_inverted = (flags & OF_GPIO_ACTIVE_LOW) ? 1 : 0; 1855 + 1856 + pp = NULL; 1857 + while ((pp = of_get_next_child(np, pp))) 1858 + udc->num_ep++; 1859 + 1860 + eps = devm_kzalloc(&pdev->dev, sizeof(struct usba_ep) * udc->num_ep, 1861 + GFP_KERNEL); 1862 + if (!eps) 1863 + return ERR_PTR(-ENOMEM); 1864 + 1865 + udc->gadget.ep0 = &eps[0].ep; 1866 + 1867 + INIT_LIST_HEAD(&eps[0].ep.ep_list); 1868 + 1869 + pp = NULL; 1870 + i = 0; 1871 + while ((pp = of_get_next_child(np, pp))) { 1872 + ep = &eps[i]; 1873 + 1874 + ret = of_property_read_u32(pp, "reg", &val); 1875 + if (ret) { 1876 + dev_err(&pdev->dev, "of_probe: reg error(%d)\n", ret); 1877 + goto err; 1878 + } 1879 + ep->index = val; 1880 + 1881 + ret = of_property_read_u32(pp, "atmel,fifo-size", &val); 1882 + if (ret) { 1883 + dev_err(&pdev->dev, "of_probe: fifo-size error(%d)\n", ret); 1884 + goto err; 1885 + } 1886 + ep->fifo_size = val; 1887 + 1888 + ret = of_property_read_u32(pp, "atmel,nb-banks", &val); 1889 + if (ret) { 1890 + dev_err(&pdev->dev, "of_probe: nb-banks error(%d)\n", ret); 1891 + goto err; 1892 + } 1893 + ep->nr_banks = val; 1894 + 1895 + ep->can_dma = of_property_read_bool(pp, "atmel,can-dma"); 1896 + ep->can_isoc = of_property_read_bool(pp, "atmel,can-isoc"); 1897 + 1898 + ret = of_property_read_string(pp, "name", &name); 1899 + ep->ep.name = name; 1900 + 1901 + ep->ep_regs = udc->regs + USBA_EPT_BASE(i); 1902 + ep->dma_regs = udc->regs + USBA_DMA_BASE(i); 1903 + ep->fifo = udc->fifo + USBA_FIFO_BASE(i); 1904 + ep->ep.ops = &usba_ep_ops; 1905 + ep->ep.maxpacket = ep->fifo_size; 1906 + ep->udc = udc; 1907 + INIT_LIST_HEAD(&ep->queue); 1908 + 1909 + if (i) 1910 + list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); 1911 + 1912 + i++; 1913 + } 1914 + 1915 + return eps; 1916 + err: 1917 + return ERR_PTR(ret); 1918 + } 1919 + #else 1920 + static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, 1921 + struct usba_udc *udc) 1922 + { 1923 + return ERR_PTR(-ENOSYS); 1924 + } 1925 + #endif 1926 + 1927 + static struct usba_ep * usba_udc_pdata(struct platform_device *pdev, 1928 + struct usba_udc *udc) 1834 1929 { 1835 1930 struct usba_platform_data *pdata = pdev->dev.platform_data; 1931 + struct usba_ep *eps; 1932 + int i; 1933 + 1934 + if (!pdata) 1935 + return ERR_PTR(-ENXIO); 1936 + 1937 + eps = devm_kzalloc(&pdev->dev, sizeof(struct usba_ep) * pdata->num_ep, 1938 + GFP_KERNEL); 1939 + if (!eps) 1940 + return ERR_PTR(-ENOMEM); 1941 + 1942 + udc->gadget.ep0 = &eps[0].ep; 1943 + 1944 + udc->vbus_pin = pdata->vbus_pin; 1945 + udc->vbus_pin_inverted = pdata->vbus_pin_inverted; 1946 + udc->num_ep = pdata->num_ep; 1947 + 1948 + INIT_LIST_HEAD(&eps[0].ep.ep_list); 1949 + 1950 + for (i = 0; i < pdata->num_ep; i++) { 1951 + struct usba_ep *ep = &eps[i]; 1952 + 1953 + ep->ep_regs = udc->regs + USBA_EPT_BASE(i); 1954 + ep->dma_regs = udc->regs + USBA_DMA_BASE(i); 1955 + ep->fifo = udc->fifo + USBA_FIFO_BASE(i); 1956 + ep->ep.ops = &usba_ep_ops; 1957 + ep->ep.name = pdata->ep[i].name; 1958 + ep->fifo_size = ep->ep.maxpacket = pdata->ep[i].fifo_size; 1959 + ep->udc = udc; 1960 + INIT_LIST_HEAD(&ep->queue); 1961 + ep->nr_banks = pdata->ep[i].nr_banks; 1962 + ep->index = pdata->ep[i].index; 1963 + ep->can_dma = pdata->ep[i].can_dma; 1964 + ep->can_isoc = pdata->ep[i].can_isoc; 1965 + 1966 + if (i) 1967 + list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); 1968 + } 1969 + 1970 + return eps; 1971 + } 1972 + 1973 + static int __init usba_udc_probe(struct platform_device *pdev) 1974 + { 1836 1975 struct resource *regs, *fifo; 1837 1976 struct clk *pclk, *hclk; 1838 - struct usba_udc *udc = &the_udc; 1977 + struct usba_udc *udc; 1839 1978 int irq, ret, i; 1979 + 1980 + udc = devm_kzalloc(&pdev->dev, sizeof(*udc), GFP_KERNEL); 1981 + if (!udc) 1982 + return -ENOMEM; 1983 + 1984 + udc->gadget = usba_gadget_template; 1985 + INIT_LIST_HEAD(&udc->gadget.ep_list); 1840 1986 1841 1987 regs = platform_get_resource(pdev, IORESOURCE_MEM, CTRL_IOMEM_ID); 1842 1988 fifo = platform_get_resource(pdev, IORESOURCE_MEM, FIFO_IOMEM_ID); 1843 - if (!regs || !fifo || !pdata) 1989 + if (!regs || !fifo) 1844 1990 return -ENXIO; 1845 1991 1846 1992 irq = platform_get_irq(pdev, 0); ··· 2027 1891 usba_writel(udc, CTRL, USBA_DISABLE_MASK); 2028 1892 clk_disable(pclk); 2029 1893 2030 - usba_ep = kzalloc(sizeof(struct usba_ep) * pdata->num_ep, 2031 - GFP_KERNEL); 2032 - if (!usba_ep) 1894 + if (pdev->dev.of_node) 1895 + udc->usba_ep = atmel_udc_of_init(pdev, udc); 1896 + else 1897 + udc->usba_ep = usba_udc_pdata(pdev, udc); 1898 + 1899 + if (IS_ERR(udc->usba_ep)) { 1900 + ret = PTR_ERR(udc->usba_ep); 2033 1901 goto err_alloc_ep; 2034 - 2035 - the_udc.gadget.ep0 = &usba_ep[0].ep; 2036 - 2037 - INIT_LIST_HEAD(&usba_ep[0].ep.ep_list); 2038 - usba_ep[0].ep_regs = udc->regs + USBA_EPT_BASE(0); 2039 - usba_ep[0].dma_regs = udc->regs + USBA_DMA_BASE(0); 2040 - usba_ep[0].fifo = udc->fifo + USBA_FIFO_BASE(0); 2041 - usba_ep[0].ep.ops = &usba_ep_ops; 2042 - usba_ep[0].ep.name = pdata->ep[0].name; 2043 - usba_ep[0].ep.maxpacket = pdata->ep[0].fifo_size; 2044 - usba_ep[0].udc = &the_udc; 2045 - INIT_LIST_HEAD(&usba_ep[0].queue); 2046 - usba_ep[0].fifo_size = pdata->ep[0].fifo_size; 2047 - usba_ep[0].nr_banks = pdata->ep[0].nr_banks; 2048 - usba_ep[0].index = pdata->ep[0].index; 2049 - usba_ep[0].can_dma = pdata->ep[0].can_dma; 2050 - usba_ep[0].can_isoc = pdata->ep[0].can_isoc; 2051 - 2052 - for (i = 1; i < pdata->num_ep; i++) { 2053 - struct usba_ep *ep = &usba_ep[i]; 2054 - 2055 - ep->ep_regs = udc->regs + USBA_EPT_BASE(i); 2056 - ep->dma_regs = udc->regs + USBA_DMA_BASE(i); 2057 - ep->fifo = udc->fifo + USBA_FIFO_BASE(i); 2058 - ep->ep.ops = &usba_ep_ops; 2059 - ep->ep.name = pdata->ep[i].name; 2060 - ep->ep.maxpacket = pdata->ep[i].fifo_size; 2061 - ep->udc = &the_udc; 2062 - INIT_LIST_HEAD(&ep->queue); 2063 - ep->fifo_size = pdata->ep[i].fifo_size; 2064 - ep->nr_banks = pdata->ep[i].nr_banks; 2065 - ep->index = pdata->ep[i].index; 2066 - ep->can_dma = pdata->ep[i].can_dma; 2067 - ep->can_isoc = pdata->ep[i].can_isoc; 2068 - 2069 - list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); 2070 1902 } 2071 1903 2072 1904 ret = request_irq(irq, usba_udc_irq, 0, "atmel_usba_udc", udc); ··· 2045 1941 } 2046 1942 udc->irq = irq; 2047 1943 2048 - if (gpio_is_valid(pdata->vbus_pin)) { 2049 - if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) { 2050 - udc->vbus_pin = pdata->vbus_pin; 2051 - udc->vbus_pin_inverted = pdata->vbus_pin_inverted; 2052 - 1944 + if (gpio_is_valid(udc->vbus_pin)) { 1945 + if (!devm_gpio_request(&pdev->dev, udc->vbus_pin, "atmel_usba_udc")) { 2053 1946 ret = request_irq(gpio_to_irq(udc->vbus_pin), 2054 1947 usba_vbus_irq, 0, 2055 1948 "atmel_usba_udc", udc); 2056 1949 if (ret) { 2057 - gpio_free(udc->vbus_pin); 2058 1950 udc->vbus_pin = -ENODEV; 2059 1951 dev_warn(&udc->pdev->dev, 2060 1952 "failed to request vbus irq; " ··· 2069 1969 goto err_add_udc; 2070 1970 2071 1971 usba_init_debugfs(udc); 2072 - for (i = 1; i < pdata->num_ep; i++) 2073 - usba_ep_init_debugfs(udc, &usba_ep[i]); 1972 + for (i = 1; i < udc->num_ep; i++) 1973 + usba_ep_init_debugfs(udc, &udc->usba_ep[i]); 2074 1974 2075 1975 return 0; 2076 1976 2077 1977 err_add_udc: 2078 - if (gpio_is_valid(pdata->vbus_pin)) { 1978 + if (gpio_is_valid(udc->vbus_pin)) 2079 1979 free_irq(gpio_to_irq(udc->vbus_pin), udc); 2080 - gpio_free(udc->vbus_pin); 2081 - } 2082 1980 2083 1981 free_irq(irq, udc); 2084 1982 err_request_irq: 2085 - kfree(usba_ep); 2086 1983 err_alloc_ep: 2087 1984 iounmap(udc->fifo); 2088 1985 err_map_fifo: ··· 2096 1999 { 2097 2000 struct usba_udc *udc; 2098 2001 int i; 2099 - struct usba_platform_data *pdata = pdev->dev.platform_data; 2100 2002 2101 2003 udc = platform_get_drvdata(pdev); 2102 2004 2103 2005 usb_del_gadget_udc(&udc->gadget); 2104 2006 2105 - for (i = 1; i < pdata->num_ep; i++) 2106 - usba_ep_cleanup_debugfs(&usba_ep[i]); 2007 + for (i = 1; i < udc->num_ep; i++) 2008 + usba_ep_cleanup_debugfs(&udc->usba_ep[i]); 2107 2009 usba_cleanup_debugfs(udc); 2108 2010 2109 2011 if (gpio_is_valid(udc->vbus_pin)) { 2110 2012 free_irq(gpio_to_irq(udc->vbus_pin), udc); 2111 - gpio_free(udc->vbus_pin); 2112 2013 } 2113 2014 2114 2015 free_irq(udc->irq, udc); 2115 - kfree(usba_ep); 2116 2016 iounmap(udc->fifo); 2117 2017 iounmap(udc->regs); 2118 2018 clk_put(udc->hclk); ··· 2118 2024 return 0; 2119 2025 } 2120 2026 2027 + #if defined(CONFIG_OF) 2028 + static const struct of_device_id atmel_udc_dt_ids[] = { 2029 + { .compatible = "atmel,at91sam9rl-udc" }, 2030 + { /* sentinel */ } 2031 + }; 2032 + 2033 + MODULE_DEVICE_TABLE(of, atmel_udc_dt_ids); 2034 + #endif 2035 + 2121 2036 static struct platform_driver udc_driver = { 2122 2037 .remove = __exit_p(usba_udc_remove), 2123 2038 .driver = { 2124 2039 .name = "atmel_usba_udc", 2125 2040 .owner = THIS_MODULE, 2041 + .of_match_table = of_match_ptr(atmel_udc_dt_ids), 2126 2042 }, 2127 2043 }; 2128 2044
+2
drivers/usb/gadget/atmel_usba_udc.h
··· 317 317 int irq; 318 318 int vbus_pin; 319 319 int vbus_pin_inverted; 320 + int num_ep; 320 321 struct clk *pclk; 321 322 struct clk *hclk; 323 + struct usba_ep *usba_ep; 322 324 323 325 u16 devstatus; 324 326
+60 -1
drivers/usb/musb/ux500.c
··· 25 25 #include <linux/clk.h> 26 26 #include <linux/err.h> 27 27 #include <linux/io.h> 28 + #include <linux/of.h> 28 29 #include <linux/platform_device.h> 29 30 #include <linux/usb/musb-ux500.h> 30 31 31 32 #include "musb_core.h" 33 + 34 + static struct musb_hdrc_config ux500_musb_hdrc_config = { 35 + .multipoint = true, 36 + .dyn_fifo = true, 37 + .num_eps = 16, 38 + .ram_bits = 16, 39 + }; 32 40 33 41 struct ux500_glue { 34 42 struct device *dev; ··· 195 187 .set_vbus = ux500_musb_set_vbus, 196 188 }; 197 189 190 + static struct musb_hdrc_platform_data * 191 + ux500_of_probe(struct platform_device *pdev, struct device_node *np) 192 + { 193 + struct musb_hdrc_platform_data *pdata; 194 + const char *mode; 195 + int strlen; 196 + 197 + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 198 + if (!pdata) 199 + return NULL; 200 + 201 + mode = of_get_property(np, "dr_mode", &strlen); 202 + if (!mode) { 203 + dev_err(&pdev->dev, "No 'dr_mode' property found\n"); 204 + return NULL; 205 + } 206 + 207 + if (strlen > 0) { 208 + if (!strcmp(mode, "host")) 209 + pdata->mode = MUSB_HOST; 210 + if (!strcmp(mode, "otg")) 211 + pdata->mode = MUSB_OTG; 212 + if (!strcmp(mode, "peripheral")) 213 + pdata->mode = MUSB_PERIPHERAL; 214 + } 215 + 216 + return pdata; 217 + } 218 + 198 219 static int ux500_probe(struct platform_device *pdev) 199 220 { 200 221 struct resource musb_resources[2]; 201 222 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; 223 + struct device_node *np = pdev->dev.of_node; 202 224 struct platform_device *musb; 203 225 struct ux500_glue *glue; 204 226 struct clk *clk; 205 227 int ret = -ENOMEM; 228 + 229 + if (!pdata) { 230 + if (np) { 231 + pdata = ux500_of_probe(pdev, np); 232 + if (!pdata) 233 + goto err0; 234 + 235 + pdev->dev.platform_data = pdata; 236 + } else { 237 + dev_err(&pdev->dev, "no pdata or device tree found\n"); 238 + goto err0; 239 + } 240 + } 206 241 207 242 glue = kzalloc(sizeof(*glue), GFP_KERNEL); 208 243 if (!glue) { ··· 273 222 } 274 223 275 224 musb->dev.parent = &pdev->dev; 276 - musb->dev.dma_mask = pdev->dev.dma_mask; 225 + musb->dev.dma_mask = &pdev->dev.coherent_dma_mask; 277 226 musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask; 227 + musb->dev.of_node = pdev->dev.of_node; 278 228 279 229 glue->dev = &pdev->dev; 280 230 glue->musb = musb; 281 231 glue->clk = clk; 282 232 283 233 pdata->platform_ops = &ux500_ops; 234 + pdata->config = &ux500_musb_hdrc_config; 284 235 285 236 platform_set_drvdata(pdev, glue); 286 237 ··· 387 334 #define DEV_PM_OPS NULL 388 335 #endif 389 336 337 + static const struct of_device_id ux500_match[] = { 338 + { .compatible = "stericsson,db8500-musb", }, 339 + {} 340 + }; 341 + 390 342 static struct platform_driver ux500_driver = { 391 343 .probe = ux500_probe, 392 344 .remove = ux500_remove, 393 345 .driver = { 394 346 .name = "musb-ux500", 395 347 .pm = DEV_PM_OPS, 348 + .of_match_table = ux500_match, 396 349 }, 397 350 }; 398 351
+33 -26
drivers/usb/musb/ux500_dma.c
··· 34 34 #include <linux/platform_data/usb-musb-ux500.h> 35 35 #include "musb_core.h" 36 36 37 + static const char *iep_chan_names[] = { "iep_1_9", "iep_2_10", "iep_3_11", "iep_4_12", 38 + "iep_5_13", "iep_6_14", "iep_7_15", "iep_8" }; 39 + static const char *oep_chan_names[] = { "oep_1_9", "oep_2_10", "oep_3_11", "oep_4_12", 40 + "oep_5_13", "oep_6_14", "oep_7_15", "oep_8" }; 41 + 37 42 struct ux500_dma_channel { 38 43 struct dma_channel channel; 39 44 struct ux500_dma_controller *controller; ··· 53 48 54 49 struct ux500_dma_controller { 55 50 struct dma_controller controller; 56 - struct ux500_dma_channel rx_channel[UX500_MUSB_DMA_NUM_RX_CHANNELS]; 57 - struct ux500_dma_channel tx_channel[UX500_MUSB_DMA_NUM_TX_CHANNELS]; 58 - u32 num_rx_channels; 59 - u32 num_tx_channels; 51 + struct ux500_dma_channel rx_channel[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS]; 52 + struct ux500_dma_channel tx_channel[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS]; 60 53 void *private_data; 61 54 dma_addr_t phy_base; 62 55 }; ··· 146 143 struct ux500_dma_channel *ux500_channel = NULL; 147 144 struct musb *musb = controller->private_data; 148 145 u8 ch_num = hw_ep->epnum - 1; 149 - u32 max_ch; 150 146 151 - /* Max 8 DMA channels (0 - 7). Each DMA channel can only be allocated 147 + /* 8 DMA channels (0 - 7). Each DMA channel can only be allocated 152 148 * to specified hw_ep. For example DMA channel 0 can only be allocated 153 149 * to hw_ep 1 and 9. 154 150 */ 155 151 if (ch_num > 7) 156 152 ch_num -= 8; 157 153 158 - max_ch = is_tx ? controller->num_tx_channels : 159 - controller->num_rx_channels; 160 - 161 - if (ch_num >= max_ch) 154 + if (ch_num >= UX500_MUSB_DMA_NUM_RX_TX_CHANNELS) 162 155 return NULL; 163 156 164 157 ux500_channel = is_tx ? &(controller->tx_channel[ch_num]) : ··· 262 263 struct dma_channel *channel; 263 264 u8 ch_num; 264 265 265 - for (ch_num = 0; ch_num < controller->num_rx_channels; ch_num++) { 266 + for (ch_num = 0; ch_num < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; ch_num++) { 266 267 channel = &controller->rx_channel[ch_num].channel; 267 268 ux500_channel = channel->private_data; 268 269 ··· 272 273 dma_release_channel(ux500_channel->dma_chan); 273 274 } 274 275 275 - for (ch_num = 0; ch_num < controller->num_tx_channels; ch_num++) { 276 + for (ch_num = 0; ch_num < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; ch_num++) { 276 277 channel = &controller->tx_channel[ch_num].channel; 277 278 ux500_channel = channel->private_data; 278 279 ··· 293 294 struct musb *musb = controller->private_data; 294 295 struct device *dev = musb->controller; 295 296 struct musb_hdrc_platform_data *plat = dev->platform_data; 296 - struct ux500_musb_board_data *data = plat->board_data; 297 + struct ux500_musb_board_data *data; 297 298 struct dma_channel *dma_channel = NULL; 299 + char **chan_names; 298 300 u32 ch_num; 299 301 u8 dir; 300 302 u8 is_tx = 0; 301 303 302 304 void **param_array; 303 305 struct ux500_dma_channel *channel_array; 304 - u32 ch_count; 305 306 dma_cap_mask_t mask; 306 307 307 - if ((data->num_rx_channels > UX500_MUSB_DMA_NUM_RX_CHANNELS) || 308 - (data->num_tx_channels > UX500_MUSB_DMA_NUM_TX_CHANNELS)) 308 + if (!plat) { 309 + dev_err(musb->controller, "No platform data\n"); 309 310 return -EINVAL; 311 + } 310 312 311 - controller->num_rx_channels = data->num_rx_channels; 312 - controller->num_tx_channels = data->num_tx_channels; 313 + data = plat->board_data; 313 314 314 315 dma_cap_zero(mask); 315 316 dma_cap_set(DMA_SLAVE, mask); 316 317 317 318 /* Prepare the loop for RX channels */ 318 319 channel_array = controller->rx_channel; 319 - ch_count = data->num_rx_channels; 320 - param_array = data->dma_rx_param_array; 320 + param_array = data ? data->dma_rx_param_array : NULL; 321 + chan_names = (char **)iep_chan_names; 321 322 322 323 for (dir = 0; dir < 2; dir++) { 323 - for (ch_num = 0; ch_num < ch_count; ch_num++) { 324 + for (ch_num = 0; 325 + ch_num < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; 326 + ch_num++) { 324 327 ux500_channel = &channel_array[ch_num]; 325 328 ux500_channel->controller = controller; 326 329 ux500_channel->ch_num = ch_num; ··· 333 332 dma_channel->status = MUSB_DMA_STATUS_FREE; 334 333 dma_channel->max_len = SZ_16M; 335 334 336 - ux500_channel->dma_chan = dma_request_channel(mask, 337 - data->dma_filter, 338 - param_array[ch_num]); 335 + ux500_channel->dma_chan = 336 + dma_request_slave_channel(dev, chan_names[ch_num]); 337 + 338 + if (!ux500_channel->dma_chan) 339 + ux500_channel->dma_chan = 340 + dma_request_channel(mask, 341 + data->dma_filter, 342 + param_array[ch_num]); 343 + 339 344 if (!ux500_channel->dma_chan) { 340 345 ERR("Dma pipe allocation error dir=%d ch=%d\n", 341 346 dir, ch_num); ··· 356 349 357 350 /* Prepare the loop for TX channels */ 358 351 channel_array = controller->tx_channel; 359 - ch_count = data->num_tx_channels; 360 - param_array = data->dma_tx_param_array; 352 + param_array = data ? data->dma_tx_param_array : NULL; 353 + chan_names = (char **)oep_chan_names; 361 354 is_tx = 1; 362 355 } 363 356
+25
include/dt-bindings/clk/exynos-audss-clk.h
··· 1 + /* 2 + * This header provides constants for Samsung audio subsystem 3 + * clock controller. 4 + * 5 + * The constants defined in this header are being used in dts 6 + * and exynos audss driver. 7 + */ 8 + 9 + #ifndef _DT_BINDINGS_CLK_EXYNOS_AUDSS_H 10 + #define _DT_BINDINGS_CLK_EXYNOS_AUDSS_H 11 + 12 + #define EXYNOS_MOUT_AUDSS 0 13 + #define EXYNOS_MOUT_I2S 1 14 + #define EXYNOS_DOUT_SRP 2 15 + #define EXYNOS_DOUT_AUD_BUS 3 16 + #define EXYNOS_DOUT_I2S 4 17 + #define EXYNOS_SRP_CLK 5 18 + #define EXYNOS_I2S_BUS 6 19 + #define EXYNOS_SCLK_I2S 7 20 + #define EXYNOS_PCM_BUS 8 21 + #define EXYNOS_SCLK_PCM 9 22 + 23 + #define EXYNOS_AUDSS_MAX_CLKS 10 24 + 25 + #endif
+29
include/linux/omap-mailbox.h
··· 1 + /* 2 + * omap-mailbox: interprocessor communication module for OMAP 3 + * 4 + * This program is free software; you can redistribute it and/or modify 5 + * it under the terms of the GNU General Public License version 2 as 6 + * published by the Free Software Foundation. 7 + */ 8 + 9 + #ifndef OMAP_MAILBOX_H 10 + #define OMAP_MAILBOX_H 11 + 12 + typedef u32 mbox_msg_t; 13 + struct omap_mbox; 14 + 15 + typedef int __bitwise omap_mbox_irq_t; 16 + #define IRQ_TX ((__force omap_mbox_irq_t) 1) 17 + #define IRQ_RX ((__force omap_mbox_irq_t) 2) 18 + 19 + int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); 20 + 21 + struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb); 22 + void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb); 23 + 24 + void omap_mbox_save_ctx(struct omap_mbox *mbox); 25 + void omap_mbox_restore_ctx(struct omap_mbox *mbox); 26 + void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); 27 + void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); 28 + 29 + #endif /* OMAP_MAILBOX_H */
+7 -34
include/linux/platform_data/dma-ste-dma40.h
··· 70 70 STEDMA40_FLOW_CTRL, 71 71 }; 72 72 73 - enum stedma40_periph_data_width { 74 - STEDMA40_BYTE_WIDTH = STEDMA40_ESIZE_8_BIT, 75 - STEDMA40_HALFWORD_WIDTH = STEDMA40_ESIZE_16_BIT, 76 - STEDMA40_WORD_WIDTH = STEDMA40_ESIZE_32_BIT, 77 - STEDMA40_DOUBLEWORD_WIDTH = STEDMA40_ESIZE_64_BIT 78 - }; 79 - 80 - enum stedma40_xfer_dir { 81 - STEDMA40_MEM_TO_MEM = 1, 82 - STEDMA40_MEM_TO_PERIPH, 83 - STEDMA40_PERIPH_TO_MEM, 84 - STEDMA40_PERIPH_TO_PERIPH 85 - }; 86 - 87 - 88 73 /** 89 - * struct stedma40_chan_cfg - dst/src channel configuration 74 + * struct stedma40_half_channel_info - dst/src channel configuration 90 75 * 91 76 * @big_endian: true if the src/dst should be read as big endian 92 77 * @data_width: Data width of the src/dst hardware ··· 80 95 */ 81 96 struct stedma40_half_channel_info { 82 97 bool big_endian; 83 - enum stedma40_periph_data_width data_width; 98 + enum dma_slave_buswidth data_width; 84 99 int psize; 85 100 enum stedma40_flow_ctrl flow_ctrl; 86 101 }; ··· 94 109 * version 3+, i.e DB8500v2+ 95 110 * @mode: channel mode: physical, logical, or operation 96 111 * @mode_opt: options for the chosen channel mode 97 - * @src_dev_type: Src device type 98 - * @dst_dev_type: Dst device type 112 + * @dev_type: src/dst device type (driver uses dir to figure out which) 99 113 * @src_info: Parameters for dst half channel 100 114 * @dst_info: Parameters for dst half channel 101 115 * @use_fixed_channel: if true, use physical channel specified by phy_channel ··· 105 121 * 106 122 */ 107 123 struct stedma40_chan_cfg { 108 - enum stedma40_xfer_dir dir; 124 + enum dma_transfer_direction dir; 109 125 bool high_priority; 110 126 bool realtime; 111 127 enum stedma40_mode mode; 112 128 enum stedma40_mode_opt mode_opt; 113 - int src_dev_type; 114 - int dst_dev_type; 129 + int dev_type; 115 130 struct stedma40_half_channel_info src_info; 116 131 struct stedma40_half_channel_info dst_info; 117 132 ··· 121 138 /** 122 139 * struct stedma40_platform_data - Configuration struct for the dma device. 123 140 * 124 - * @dev_len: length of dev_tx and dev_rx 125 141 * @dev_tx: mapping between destination event line and io address 126 142 * @dev_rx: mapping between source event line and io address 127 - * @memcpy: list of memcpy event lines 128 - * @memcpy_len: length of memcpy 129 - * @memcpy_conf_phy: default configuration of physical channel memcpy 130 - * @memcpy_conf_log: default configuration of logical channel memcpy 131 143 * @disabled_channels: A vector, ending with -1, that marks physical channels 132 144 * that are for different reasons not available for the driver. 133 145 * @soft_lli_chans: A vector, that marks physical channels will use LLI by SW ··· 132 154 * @num_of_soft_lli_chans: The number of channels that needs to be configured 133 155 * to use SoftLLI. 134 156 * @use_esram_lcla: flag for mapping the lcla into esram region 157 + * @num_of_memcpy_chans: The number of channels reserved for memcpy. 135 158 * @num_of_phy_chans: The number of physical channels implemented in HW. 136 159 * 0 means reading the number of channels from DMA HW but this is only valid 137 160 * for 'multiple of 4' channels, like 8. 138 161 */ 139 162 struct stedma40_platform_data { 140 - u32 dev_len; 141 - const dma_addr_t *dev_tx; 142 - const dma_addr_t *dev_rx; 143 - int *memcpy; 144 - u32 memcpy_len; 145 - struct stedma40_chan_cfg *memcpy_conf_phy; 146 - struct stedma40_chan_cfg *memcpy_conf_log; 147 163 int disabled_channels[STEDMA40_MAX_PHYS]; 148 164 int *soft_lli_chans; 149 165 int num_of_soft_lli_chans; 150 166 bool use_esram_lcla; 167 + int num_of_memcpy_chans; 151 168 int num_of_phy_chans; 152 169 }; 153 170
+58
include/linux/platform_data/mailbox-omap.h
··· 1 + /* 2 + * mailbox-omap.h 3 + * 4 + * Copyright (C) 2013 Texas Instruments, Inc. 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License 8 + * version 2 as published by the Free Software Foundation. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + */ 15 + 16 + #ifndef _PLAT_MAILBOX_H 17 + #define _PLAT_MAILBOX_H 18 + 19 + /* Interrupt register configuration types */ 20 + #define MBOX_INTR_CFG_TYPE1 (0) 21 + #define MBOX_INTR_CFG_TYPE2 (1) 22 + 23 + /** 24 + * struct omap_mbox_dev_info - OMAP mailbox device attribute info 25 + * @name: name of the mailbox device 26 + * @tx_id: mailbox queue id used for transmitting messages 27 + * @rx_id: mailbox queue id on which messages are received 28 + * @irq_id: irq identifier number to use from the hwmod data 29 + * @usr_id: mailbox user id for identifying the interrupt into 30 + * the MPU interrupt controller. 31 + */ 32 + struct omap_mbox_dev_info { 33 + const char *name; 34 + u32 tx_id; 35 + u32 rx_id; 36 + u32 irq_id; 37 + u32 usr_id; 38 + }; 39 + 40 + /** 41 + * struct omap_mbox_pdata - OMAP mailbox platform data 42 + * @intr_type: type of interrupt configuration registers used 43 + while programming mailbox queue interrupts 44 + * @num_users: number of users (processor devices) that the mailbox 45 + * h/w block can interrupt 46 + * @num_fifos: number of h/w fifos within the mailbox h/w block 47 + * @info_cnt: number of mailbox devices for the platform 48 + * @info: array of mailbox device attributes 49 + */ 50 + struct omap_mbox_pdata { 51 + u32 intr_type; 52 + u32 num_users; 53 + u32 num_fifos; 54 + u32 info_cnt; 55 + struct omap_mbox_dev_info *info; 56 + }; 57 + 58 + #endif /* _PLAT_MAILBOX_H */
+1 -4
include/linux/platform_data/usb-musb-ux500.h
··· 9 9 10 10 #include <linux/dmaengine.h> 11 11 12 - #define UX500_MUSB_DMA_NUM_RX_CHANNELS 8 13 - #define UX500_MUSB_DMA_NUM_TX_CHANNELS 8 12 + #define UX500_MUSB_DMA_NUM_RX_TX_CHANNELS 8 14 13 15 14 struct ux500_musb_board_data { 16 15 void **dma_rx_param_array; 17 16 void **dma_tx_param_array; 18 - u32 num_rx_channels; 19 - u32 num_tx_channels; 20 17 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 21 18 }; 22 19
+5 -5
sound/soc/ux500/ux500_pcm.c
··· 76 76 dma_params = snd_soc_dai_get_dma_data(dai, substream); 77 77 dma_cfg = dma_params->dma_cfg; 78 78 79 - mem_data_width = STEDMA40_HALFWORD_WIDTH; 79 + mem_data_width = DMA_SLAVE_BUSWIDTH_2_BYTES; 80 80 81 81 switch (dma_params->data_size) { 82 82 case 32: 83 - per_data_width = STEDMA40_WORD_WIDTH; 83 + per_data_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 84 84 break; 85 85 case 16: 86 - per_data_width = STEDMA40_HALFWORD_WIDTH; 86 + per_data_width = DMA_SLAVE_BUSWIDTH_2_BYTES; 87 87 break; 88 88 case 8: 89 - per_data_width = STEDMA40_BYTE_WIDTH; 89 + per_data_width = DMA_SLAVE_BUSWIDTH_1_BYTE; 90 90 break; 91 91 default: 92 - per_data_width = STEDMA40_WORD_WIDTH; 92 + per_data_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 93 93 } 94 94 95 95 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {